Commit 8d1b03d3 authored by gg123gg's avatar gg123gg Committed by GitHub

fix

parent 812a95b6
--双色的恋意 --双色的恋意
function c12008006.initial_effect(c) local m=12008006
--recover local cm=_G["c"..m]
local e1=Effect.CreateEffect(c) function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) --recover
e1:SetCategory(CATEGORY_RECOVER) local e1=Effect.CreateEffect(c)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCost(c12008006.cost) e1:SetCategory(CATEGORY_RECOVER+CATEGORY_DESTROY)
e1:SetTarget(c12008006.tg) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c12008006.op) e1:SetCost(c12008006.cost)
c:RegisterEffect(e1) e1:SetTarget(c12008006.tg)
end e1:SetOperation(c12008006.op)
function c12008006.cost(e,tp,eg,ep,ev,re,r,rp,chk) c:RegisterEffect(e1)
local tuc=Duel.GetTurnCount() --recover
if chk==0 then return Duel.GetFlagEffect(tp,12008106)<tuc*2+2 end --special summon
Duel.RegisterFlagEffect(tp,12008106,RESET_PHASE+PHASE_END,0,1) local e2=Effect.CreateEffect(c)
end e2:SetDescription(aux.Stringid(12008006,0))
function c12008006.tg(e,tp,eg,ep,ev,re,r,rp,chk) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
if chk==0 then return true end e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
Duel.SetTargetPlayer(tp) e2:SetProperty(EFFECT_FLAG_DELAY)
Duel.SetTargetParam(800) e2:SetCode(EVENT_DESTROYED)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,800) e2:SetCondition(c12008006.spcon)
end e2:SetTarget(c12008006.sptg)
function c12008006.thfilter(c) e2:SetOperation(c12008006.spop)
return c:IsType(TYPE_MONSTER) and (c:IsSetCard(0x1fb3) or c:IsSetCard(0xfbb)) and c:IsAbleToHand() c:RegisterEffect(e2)
end -- if not c12008006.global_check then
function c12008006.op(e,tp,eg,ep,ev,re,r,rp) -- c12008006.global_check=true
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) -- local ge1=Effect.CreateEffect(c)
if Duel.Recover(p,d,REASON_EFFECT)<=0 then return end -- ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
Duel.BreakEffect() -- ge1:SetCode(EVENT_CHAINING)
local ct=Duel.GetFlagEffect(tp,12008006) -- ge1:SetOperation(c12008006.checkop)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then -- Duel.RegisterEffect(ge1,0)
Duel.RegisterFlagEffect(tp,12008006,RESET_PHASE+PHASE_END,0,1) -- end
end end
if ct<=0 then return end
local g=Duel.GetMatchingGroup(c12008006.thfilter,tp,LOCATION_DECK,0,nil) -- function c12008006.checkop(e,tp,eg,ep,ev,re,r,rp)
if ct>=1 and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(12008006,0)) then -- if not eg then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) -- if re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:GetHandler():IsCode(12008006) then
local tg=g:Select(tp,1,1,nil) -- Duel.RegisterFlagEffect(tp,12008006,RESET_PHASE+PHASE_END,0,1)
Duel.SendtoHand(tg,nil,REASON_EFFECT) -- end
Duel.ConfirmCards(1-tp,tg) --end
end function c12008006.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if ct>=2 then if chk==0 then return true end
Duel.Recover(p,d,REASON_EFFECT) Duel.RegisterFlagEffect(tp,12008006,RESET_PHASE+PHASE_END,0,1)
end end
local sg=Duel.GetMatchingGroup(c12008006.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp) function c12008006.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if ct>=3 and sg:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(12008006,1)) then if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.SetTargetPlayer(tp)
local tg=sg:Select(tp,1,1,nil) Duel.SetTargetParam(800)
local ts=tg:GetFirst() Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,800)
if ts and Duel.SpecialSummonStep(ts,0,tp,tp,false,false,POS_FACEUP) then end
local e1=Effect.CreateEffect(e:GetHandler()) function c12008006.spfilter(c)
e1:SetType(EFFECT_TYPE_SINGLE) return c:IsCode(12008006)
e1:SetCode(EFFECT_CANNOT_TRIGGER) end
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) function c12008006.op(e,tp,eg,ep,ev,re,r,rp)
ts:RegisterEffect(e1) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
end if true then Duel.Recover(p,d,REASON_EFFECT) end
Duel.SpecialSummonComplete() local sg=Duel.GetMatchingGroup(c12008006.spfilter,tp,LOCATION_ONFIELD,0,e:GetHandler())
end if sg:GetCount()>0 then
local dg=Duel.GetMatchingGroup(c12008006.thfilter2,tp,LOCATION_DECK,0,nil) Duel.Destroy(sg,REASON_EFFECT)
if ct>=4 and dg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(12008006,2)) then end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) end
local tg=dg:Select(tp,1,1,nil) function c12008006.spcon(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(tg,nil,REASON_EFFECT) local c=e:GetHandler()
Duel.ConfirmCards(1-tp,tg) return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD)
end end
end function c12008006.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function c12008006.thfilter2(c) if chk==0 then return true end
return c:IsCode(12008006) and c:IsAbleToHand() local ct=Duel.GetFlagEffect(tp,12008006)
end if ct<=0 then
function c12008006.spfilter(c,e,tp) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,800) end
return (c:IsSetCard(0x1fb3) or c:IsSetCard(0xfbb)) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) if ct>=1 then
end Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end
if ct>=3 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end
if ct==5 then
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,20000)
end
end
function c12008006.spfilter1(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c12008006.spfilter2(c)
return c:IsCode(12008006) and c:IsAbleToHand()
end
function c12008006.spop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFlagEffect(tp,12008006)
if ct<=0 then Duel.Damage(tp,800,REASON_EFFECT) end
if ct>=1 then Duel.Draw(tp,1,REASON_EFFECT) end
if ct>=3 and Duel.IsExistingMatchingCard(c12008006.spfilter1,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(12008006,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c12008006.spfilter1,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
if ct==5 then
Duel.Recover(tp,20000,REASON_EFFECT)
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment