Commit d64098ae authored by VanillaSalt's avatar VanillaSalt

update

parent fb85c59b
......@@ -5,7 +5,6 @@ function c1344018.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetTarget(c1344018.target)
c:RegisterEffect(e1)
--Cannot target
local e2=Effect.CreateEffect(c)
......@@ -26,7 +25,7 @@ function c1344018.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetHintTiming(0,0x1e0)
e3:SetCost(c1344018.descost)
e3:SetCountLimit(1,1344018)
e3:SetTarget(c1344018.destg)
e3:SetOperation(c1344018.desop)
c:RegisterEffect(e3)
......@@ -34,26 +33,6 @@ end
function c1344018.evalue(e,re,rp)
return re:IsActiveType(TYPE_TRAP) and rp~=e:GetHandlerPlayer()
end
function c1344018.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return true end
if c1344018.descost(e,tp,eg,ep,ev,re,r,rp,0) and c1344018.destg(e,tp,eg,ep,ev,re,r,rp,0)
and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_DESTROY)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
c1344018.descost(e,tp,eg,ep,ev,re,r,rp,1)
c1344018.destg(e,tp,eg,ep,ev,re,r,rp,1)
e:SetOperation(c1344018.desop)
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c1344018.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,1344018)==0 end
Duel.RegisterFlagEffect(tp,1344018,RESET_PHASE+PHASE_END,0,1)
end
function c1344018.desfilter(c)
return c:IsFaceup() and c:IsSetCard(0x98) and c:IsType(TYPE_PENDULUM)
end
......
......@@ -4,8 +4,6 @@ function c15582767.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c15582767.target1)
e1:SetOperation(c15582767.operation)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
......@@ -16,37 +14,11 @@ function c15582767.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,15582767)
e2:SetCost(c15582767.cost)
e2:SetTarget(c15582767.target2)
e2:SetTarget(c15582767.target)
e2:SetOperation(c15582767.operation)
e2:SetLabel(1)
c:RegisterEffect(e2)
end
function c15582767.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_PZONE) and chkc:IsControler(tp) end
if chk==0 then return true end
if Duel.GetFlagEffect(tp,15582767)==0 and Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(nil,tp,LOCATION_PZONE,0,1,nil)
and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.RegisterFlagEffect(tp,15582767,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_PZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
e:SetLabel(1)
else
e:SetCategory(0)
e:SetProperty(0)
e:SetLabel(0)
end
end
function c15582767.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,15582767)==0 end
Duel.RegisterFlagEffect(tp,15582767,RESET_PHASE+PHASE_END,0,1)
end
function c15582767.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c15582767.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_PZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(nil,tp,LOCATION_PZONE,0,1,nil) end
......@@ -56,7 +28,7 @@ function c15582767.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c15582767.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.BreakEffect()
......
......@@ -5,8 +5,6 @@ function c17874674.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_DRAW_PHASE)
e1:SetTarget(c17874674.target1)
e1:SetOperation(c17874674.operation)
c:RegisterEffect(e1)
--confirm
local e2=Effect.CreateEffect(c)
......@@ -15,8 +13,9 @@ function c17874674.initial_effect(c)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetCondition(c17874674.condition)
e2:SetTarget(c17874674.target2)
e2:SetTarget(c17874674.target)
e2:SetOperation(c17874674.operation)
c:RegisterEffect(e2)
--cancel target
......@@ -39,33 +38,18 @@ function c17874674.initial_effect(c)
e4:SetOperation(c17874674.costop)
c:RegisterEffect(e4)
end
function c17874674.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and aux.disfilter1(chkc) end
if chk==0 then return true end
if Duel.GetTurnPlayer()~=tp and Duel.GetCurrentPhase()==PHASE_STANDBY
and Duel.IsExistingTarget(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and Duel.SelectYesNo(tp,94) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
e:GetHandler():RegisterFlagEffect(17874674,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
else
e:SetProperty(0)
end
end
function c17874674.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c17874674.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c17874674.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and aux.disfilter1(chkc) end
if chk==0 then return e:GetHandler():GetFlagEffect(17874674)==0 end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
e:GetHandler():RegisterFlagEffect(17874674,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c17874674.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(17874674)==0 or not c:IsRelateToEffect(e) then return end
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc and ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then
c:SetCardTarget(tc)
......
......@@ -5,8 +5,6 @@ function c1802450.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c1802450.target1)
e1:SetOperation(c1802450.operation)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
......@@ -16,41 +14,25 @@ function c1802450.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCost(c1802450.cost2)
e2:SetTarget(c1802450.target2)
e2:SetCost(c1802450.cost)
e2:SetTarget(c1802450.target)
e2:SetOperation(c1802450.operation)
c:RegisterEffect(e2)
end
function c1802450.cfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_EARTH)
end
function c1802450.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return true end
if Duel.CheckReleaseGroup(tp,c1802450.cfilter,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(1802450,0)) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
local cg=Duel.SelectReleaseGroup(tp,c1802450.cfilter,1,1,nil)
Duel.Release(cg,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
e:GetHandler():RegisterFlagEffect(1802450,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
else e:SetProperty(0) end
end
function c1802450.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
function c1802450.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c1802450.cfilter,1,nil) end
local cg=Duel.SelectReleaseGroup(tp,c1802450.cfilter,1,1,nil)
Duel.Release(cg,REASON_COST)
end
function c1802450.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c1802450.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return e:GetHandler():GetFlagEffect(1802450)==0
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
e:GetHandler():RegisterFlagEffect(1802450,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c1802450.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
......
......@@ -5,9 +5,6 @@ function c18235309.initial_effect(c)
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c18235309.cost1)
e1:SetTarget(c18235309.target1)
e1:SetOperation(c18235309.activate)
c:RegisterEffect(e1)
--instant
local e3=Effect.CreateEffect(c)
......@@ -18,36 +15,25 @@ function c18235309.initial_effect(c)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,0x1c0+TIMING_MAIN_END+TIMING_BATTLE_START+TIMING_BATTLE_END)
e3:SetCountLimit(1)
e3:SetCondition(c18235309.condition2)
e3:SetTarget(c18235309.target2)
e3:SetCondition(c18235309.condition)
e3:SetTarget(c18235309.target)
e3:SetOperation(c18235309.activate)
e3:SetLabel(1)
c:RegisterEffect(e3)
end
function c18235309.filter(c)
return c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1)
end
function c18235309.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:SetLabel(0)
function c18235309.condition(e,tp,eg,ep,ev,re,r,rp)
local tn=Duel.GetTurnPlayer()
local ph=Duel.GetCurrentPhase()
if (tn~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)))
and Duel.IsExistingMatchingCard(c18235309.filter,tp,LOCATION_HAND,0,1,nil)
and Duel.SelectYesNo(tp,94) then
e:SetLabel(1)
end
return tn~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE))
end
function c18235309.filter(c)
return c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1)
end
function c18235309.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetLabel()~=1 then return end
e:GetHandler():RegisterFlagEffect(18235309,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,65)
function c18235309.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c18235309.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c18235309.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()~=1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c18235309.filter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
......@@ -61,13 +47,3 @@ function c18235309.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function c18235309.condition2(e,tp,eg,ep,ev,re,r,rp)
local tn=Duel.GetTurnPlayer()
local ph=Duel.GetCurrentPhase()
return tn~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE))
end
function c18235309.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(18235309)==0
and Duel.IsExistingMatchingCard(c18235309.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
......@@ -5,8 +5,6 @@ function c18634367.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x28)
e1:SetTarget(c18634367.target)
e1:SetOperation(c18634367.spop)
c:RegisterEffect(e1)
--cannot attack
local e2=Effect.CreateEffect(c)
......@@ -37,29 +35,8 @@ function c18634367.initial_effect(c)
e4:SetCondition(c18634367.spcon)
e4:SetTarget(c18634367.sptg)
e4:SetOperation(c18634367.spop)
e4:SetLabel(1)
c:RegisterEffect(e4)
end
function c18634367.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c18634367.filter(chkc,e,tp) end
if chk==0 then return true end
if Duel.IsExistingMatchingCard(c18634367.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and e:GetHandler():IsDestructable() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c18634367.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c18634367.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
e:SetLabel(1)
else
e:SetCategory(0)
e:SetProperty(0)
e:SetLabel(0)
end
end
function c18634367.mtcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
......@@ -90,7 +67,7 @@ function c18634367.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c18634367.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()~=1 or not Duel.IsExistingMatchingCard(c18634367.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then return end
if not Duel.IsExistingMatchingCard(c18634367.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) then
......
......@@ -6,8 +6,6 @@ function c20426907.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_SUMMON+TIMING_SPSUMMON)
e1:SetTarget(c20426907.distg1)
e1:SetOperation(c20426907.disop)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
......@@ -15,9 +13,8 @@ function c20426907.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetTarget(c20426907.distg2)
e2:SetOperation(c20426907.disop)
e2:SetLabel(1)
e2:SetTarget(c20426907.distg1)
e2:SetOperation(c20426907.disop1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
......@@ -27,9 +24,8 @@ function c20426907.initial_effect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetRange(LOCATION_SZONE)
e4:SetTarget(c20426907.distg3)
e4:SetOperation(c20426907.disop)
e4:SetLabel(2)
e4:SetTarget(c20426907.distg2)
e4:SetOperation(c20426907.disop2)
c:RegisterEffect(e4)
--tograve
local e5=Effect.CreateEffect(c)
......@@ -40,57 +36,52 @@ function c20426907.initial_effect(c)
e5:SetCondition(c20426907.sdcon)
c:RegisterEffect(e5)
end
function c20426907.filter(c)
return c:IsFaceup() and c:IsLevelAbove(5) and not c:IsType(TYPE_NORMAL)
end
function c20426907.distg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:SetLabel(0)
local res,teg,tep,tev,tre,tr,trp=Duel.CheckEvent(EVENT_SUMMON_SUCCESS,true)
if not res then
res,teg,tep,tev,tre,tr,trp=Duel.CheckEvent(EVENT_FLIP_SUMMON_SUCCESS,true)
end
if res then
local tc=teg:GetFirst()
if tc:IsLevelBelow(4) and not tc:IsType(TYPE_NORMAL)
and Duel.SelectYesNo(tp,94) then
e:SetLabel(1)
Duel.SetTargetCard(teg)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,teg,1,0,0)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,65)
if chk==0 then
local tc=eg:GetFirst()
if e:GetHandler():IsStatus(STATUS_ACTIVATED) then
return tc:IsLevelBelow(4)
else
return tc:IsLevelBelow(4) and not tc:IsType(TYPE_NORMAL)
end
return
end
res,teg,tep,tev,tre,tr,trp=Duel.CheckEvent(EVENT_SPSUMMON_SUCCESS,true)
if res then
local g=teg:Filter(c20426907.filter,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,94) then
e:SetLabel(2)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,65)
end
end
end
function c20426907.distg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:GetFirst():IsLevelBelow(4) end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c20426907.filter3(c)
return c:IsFaceup() and c:IsLevelAbove(5)
function c20426907.disop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
function c20426907.filter(c,activated)
return c:IsFaceup() and c:IsLevelAbove(5) and (activated or not c:IsType(TYPE_NORMAL))
end
function c20426907.distg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c20426907.filter3,1,nil) end
local g=eg:Filter(c20426907.filter3,nil)
function c20426907.distg2(e,tp,eg,ep,ev,re,r,rp,chk)
local activated=e:GetHandler():IsStatus(STATUS_ACTIVATED)
if chk==0 then return eg:IsExists(c20426907.filter,1,nil,activated) end
local g=eg:Filter(c20426907.filter,nil,activated)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
end
function c20426907.disfilter(c,e)
return c:IsFaceup() and c:IsRelateToEffect(e)
end
function c20426907.disop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end
function c20426907.disop2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c20426907.disfilter,nil,e)
local tc=g:GetFirst()
while tc do
......@@ -106,15 +97,13 @@ function c20426907.disop(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if e:GetLabel()==2 then
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+0x47e0000)
e3:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e3)
end
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+0x47e0000)
e3:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e3)
tc=g:GetNext()
end
end
......
......@@ -4,8 +4,6 @@ function c21237481.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c21237481.target1)
e1:SetOperation(c21237481.operation)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
......@@ -16,42 +14,22 @@ function c21237481.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,0x1e0)
e2:SetCost(c21237481.cost2)
e2:SetTarget(c21237481.target2)
e2:SetCost(c21237481.cost)
e2:SetTarget(c21237481.target)
e2:SetOperation(c21237481.operation)
c:RegisterEffect(e2)
end
function c21237481.costfilter(c)
return c:IsType(TYPE_SPELL) and c:IsDiscardable()
end
function c21237481.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.IsExistingMatchingCard(c21237481.costfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) and
Duel.SelectYesNo(tp,aux.Stringid(21237481,1)) then
e:SetCategory(CATEGORY_DAMAGE)
e:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local cg=Duel.SelectMatchingCard(tp,c21237481.costfilter,tp,LOCATION_HAND,0,1,60,nil)
Duel.SendtoGrave(cg,REASON_COST+REASON_DISCARD)
local dam=cg:GetCount()*500
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
e:SetLabel(dam)
else
e:SetCategory(0)
e:SetProperty(0)
e:SetLabel(0)
end
end
function c21237481.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
function c21237481.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21237481.costfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local cg=Duel.SelectMatchingCard(tp,c21237481.costfilter,tp,LOCATION_HAND,0,1,60,nil)
Duel.SendtoGrave(cg,REASON_COST+REASON_DISCARD)
e:SetLabel(cg:GetCount())
end
function c21237481.target2(e,tp,eg,ep,ev,re,r,rp,chk)
function c21237481.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local dam=e:GetLabel()*500
Duel.SetTargetPlayer(1-tp)
......@@ -59,7 +37,7 @@ function c21237481.target2(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function c21237481.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
......@@ -5,8 +5,6 @@ function c21558682.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_BATTLE_START)
e1:SetTarget(c21558682.atktg1)
e1:SetOperation(c21558682.atkop)
c:RegisterEffect(e1)
--change target
local e2=Effect.CreateEffect(c)
......@@ -16,7 +14,7 @@ function c21558682.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c21558682.atkcon)
e2:SetTarget(c21558682.atktg2)
e2:SetTarget(c21558682.atktg)
e2:SetOperation(c21558682.atkop)
c:RegisterEffect(e2)
end
......@@ -26,26 +24,7 @@ end
function c21558682.filter(c,atg)
return c:IsFaceup() and c:IsCode(31709826) and atg:IsContains(c)
end
function c21558682.atktg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
local atg=Duel.GetAttacker():GetAttackableTarget()
local at=Duel.GetAttackTarget()
return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc~=at and c21558682.filter(chkc,atg)
end
if chk==0 then return true end
e:SetProperty(0)
if Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) and tp~=Duel.GetTurnPlayer() then
local at=Duel.GetAttackTarget()
local atg=Duel.GetAttacker():GetAttackableTarget()
if at and Duel.IsExistingTarget(c21558682.filter,tp,LOCATION_MZONE,0,1,at,atg)
and Duel.SelectYesNo(tp,94) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c21558682.filter,tp,LOCATION_MZONE,0,1,1,at,atg)
end
end
end
function c21558682.atktg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c21558682.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local atg=Duel.GetAttacker():GetAttackableTarget()
local at=Duel.GetAttackTarget()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc~=at and c21558682.filter(chkc,atg) end
......
......@@ -4,8 +4,6 @@ function c22201234.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c22201234.atg)
e1:SetOperation(c22201234.aop)
c:RegisterEffect(e1)
--quick
local e2=Effect.CreateEffect(c)
......@@ -20,30 +18,6 @@ function c22201234.initial_effect(c)
e2:SetOperation(c22201234.qop)
c:RegisterEffect(e2)
end
function c22201234.atg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc==Duel.GetAttacker() end
if chk==0 then return true end
if Duel.CheckEvent(EVENT_BE_BATTLE_TARGET) then
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if d:IsFaceup() and d:IsSetCard(0x38) and d:IsControler(tp) and Duel.IsPlayerCanDiscardDeckAsCost(tp,2)
and a:IsOnField() and a:IsCanBeEffectTarget(e) and Duel.SelectYesNo(tp,aux.Stringid(22201234,0)) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetLabel(1)
Duel.DiscardDeck(tp,2,REASON_COST)
Duel.SetTargetCard(a)
end
else
e:SetProperty(0)
e:SetLabel(0)
end
end
function c22201234.aop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()==1 then
Duel.NegateAttack()
end
end
function c22201234.qcon(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
return d:IsFaceup() and d:IsSetCard(0x38) and d:IsControler(tp) and not e:GetHandler():IsStatus(STATUS_CHAINING)
......
......@@ -4,7 +4,6 @@ function c276357.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c276357.target)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
......@@ -31,18 +30,6 @@ function c276357.initial_effect(c)
e3:SetOperation(c276357.desop)
c:RegisterEffect(e3)
end
function c276357.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local res,teg,tep,tev,tre,tr,trp=Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE,true)
if res and c276357.condition(e,tp,teg,tep,tev,tre,tr,trp)
and c276357.cost(e,tp,teg,tep,tev,tre,tr,trp,0)
and Duel.SelectYesNo(tp,94) then
c276357.cost(e,tp,teg,tep,tev,tre,tr,trp,1)
e:SetOperation(c276357.activate)
else
e:SetOperation(nil)
end
end
function c276357.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
......@@ -50,9 +37,7 @@ function c276357.cfilter(c)
return c:IsType(TYPE_SPIRIT) and c:IsAbleToRemoveAsCost()
end
function c276357.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c276357.cfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.GetFlagEffect(tp,276357)==0 end
Duel.RegisterFlagEffect(tp,276357,RESET_PHASE+PHASE_END,0,1)
if chk==0 then return Duel.IsExistingMatchingCard(c276357.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c276357.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
......@@ -67,7 +52,7 @@ function c276357.filter(c,tp)
and c:IsControler(tp) and c:IsType(TYPE_SPIRIT)
end
function c276357.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c276357.filter,1,nil,tp)
return eg:IsExists(c276357.filter,1,nil,tp) and e:GetHandler():IsStatus(STATUS_ACTIVATED)
end
function c276357.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
......
......@@ -5,7 +5,6 @@ function c35125879.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c35125879.target)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
......@@ -48,38 +47,6 @@ function c35125879.initial_effect(c)
e4:SetOperation(c35125879.desop)
c:RegisterEffect(e4)
end
function c35125879.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c35125879.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
if chk==0 then return true end
local b1=c35125879.cost(e,tp,eg,ep,ev,re,r,rp,0)
and c35125879.sptg(e,tp,eg,ep,ev,re,r,rp,0)
local b2=c35125879.sumcon(e,tp,eg,ep,ev,re,r,rp)
and c35125879.cost(e,tp,eg,ep,ev,re,r,rp,0)
and c35125879.sumtg(e,tp,eg,ep,ev,re,r,rp,0)
if (b1 or b2) and Duel.SelectYesNo(tp,94) then
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(35125879,0),aux.Stringid(35125879,1))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(35125879,0))
else op=Duel.SelectOption(tp,aux.Stringid(35125879,1))+1 end
if op==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c35125879.spop)
c35125879.cost(e,tp,eg,ep,ev,re,r,rp,1)
c35125879.sptg(e,tp,eg,ep,ev,re,r,rp,1)
else
e:SetCategory(CATEGORY_SUMMON)
e:SetProperty(0)
e:SetOperation(c35125879.sumop)
c35125879.cost(e,tp,eg,ep,ev,re,r,rp,1)
c35125879.sumtg(e,tp,eg,ep,ev,re,r,rp,1)
end
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c35125879.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,35125879)==0 end
Duel.RegisterFlagEffect(tp,35125879,RESET_CHAIN,0,1)
......@@ -90,9 +57,7 @@ end
function c35125879.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c35125879.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c35125879.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetFlagEffect(tp,35125880)==0 end
Duel.RegisterFlagEffect(tp,35125880,RESET_PHASE+PHASE_END,0,1)
and Duel.IsExistingTarget(c35125879.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c35125879.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
......@@ -119,9 +84,7 @@ function c35125879.sumfilter(c)
return c:IsSetCard(0xf9) and c:IsSummonable(true,nil,1)
end
function c35125879.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c35125879.sumfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.GetFlagEffect(tp,35125881)==0 end
Duel.RegisterFlagEffect(tp,35125881,RESET_PHASE+PHASE_END,0,1)
if chk==0 then return Duel.IsExistingMatchingCard(c35125879.sumfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c35125879.sumop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -5,7 +5,6 @@ function c36970611.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c36970611.target1)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
......@@ -15,8 +14,8 @@ function c36970611.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCost(c36970611.cost2)
e2:SetTarget(c36970611.target2)
e2:SetCost(c36970611.cost)
e2:SetTarget(c36970611.target)
e2:SetOperation(c36970611.operation)
c:RegisterEffect(e2)
--to hand
......@@ -39,28 +38,13 @@ function c36970611.cfilter(c)
return c:IsSetCard(0xc1) and c:IsType(TYPE_MONSTER) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToRemoveAsCost()
and Duel.IsExistingTarget(c36970611.rmfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
end
function c36970611.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c36970611.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
if chk==0 then return true end
if c36970611.cost2(e,tp,eg,ep,ev,re,r,rp,0) and c36970611.target2(e,tp,eg,ep,ev,re,r,rp,0,chkc)
and Duel.SelectYesNo(tp,94) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c36970611.operation)
c36970611.cost2(e,tp,eg,ep,ev,re,r,rp,1)
c36970611.target2(e,tp,eg,ep,ev,re,r,rp,1,chkc)
else
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c36970611.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c36970611.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) and e:GetHandler():GetFlagEffect(36970611)==0 end
function c36970611.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c36970611.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local cg=Duel.SelectMatchingCard(tp,c36970611.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
Duel.Remove(cg,POS_FACEUP,REASON_COST)
e:GetHandler():RegisterFlagEffect(36970611,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c36970611.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c36970611.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToRemove() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
......
......@@ -4,8 +4,6 @@ function c37055344.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c37055344.target1)
e1:SetOperation(c37055344.operation)
c:RegisterEffect(e1)
--pos
local e2=Effect.CreateEffect(c)
......@@ -15,8 +13,9 @@ function c37055344.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetCondition(c37055344.condition)
e2:SetTarget(c37055344.target2)
e2:SetTarget(c37055344.target)
e2:SetOperation(c37055344.operation)
c:RegisterEffect(e2)
end
......@@ -35,50 +34,15 @@ end
function c37055344.filter4(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c37055344.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c37055344.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
if e:GetLabel()==0 then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c37055344.filter1(chkc)
else return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c37055344.filter3(chkc) end
end
if chk==0 then return true end
local b1=Duel.IsExistingTarget(c37055344.filter1,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c37055344.filter2,tp,0,LOCATION_MZONE,1,nil)
local b2=Duel.IsExistingTarget(c37055344.filter3,tp,LOCATION_MZONE,0,1,nil)
if (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE)
and (b1 or b2) and Duel.SelectYesNo(tp,aux.Stringid(37055344,3)) then
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(37055344,1),aux.Stringid(37055344,2))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(37055344,1))
else
op=Duel.SelectOption(tp,aux.Stringid(37055344,2))+1
end
e:SetLabel(op)
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c37055344.filter1,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWNDEFENSE)
local g=Duel.SelectTarget(tp,c37055344.filter3,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
e:GetHandler():RegisterFlagEffect(37055344,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
else
e:SetProperty(0)
end
end
function c37055344.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
if e:GetLabel()==0 then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c37055344.filter1(chkc)
else return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c37055344.filter3(chkc) end
end
local b1=Duel.IsExistingTarget(c37055344.filter1,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c37055344.filter2,tp,0,LOCATION_MZONE,1,nil)
local b2=Duel.IsExistingTarget(c37055344.filter3,tp,LOCATION_MZONE,0,1,nil)
if chk==0 then return (b1 or b2) and e:GetHandler():GetFlagEffect(37055344)==0 end
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(37055344,1),aux.Stringid(37055344,2))
......@@ -97,10 +61,9 @@ function c37055344.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,c37055344.filter3,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
e:GetHandler():RegisterFlagEffect(37055344,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c37055344.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(37055344)==0 or not e:GetHandler():IsRelateToEffect(e) then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if e:GetLabel()==0 then
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
......
......@@ -4,7 +4,6 @@ function c37209439.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c37209439.target)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
......@@ -14,7 +13,6 @@ function c37209439.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetCondition(c37209439.negcon)
e2:SetCost(c37209439.negcost)
e2:SetOperation(c37209439.negop)
c:RegisterEffect(e2)
--damage
......@@ -26,48 +24,16 @@ function c37209439.initial_effect(c)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(c37209439.damcon)
e3:SetCost(c37209439.damcost)
e3:SetTarget(c37209439.damtg)
e3:SetOperation(c37209439.damop)
c:RegisterEffect(e3)
end
function c37209439.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local b1=c37209439.negcon(e,tp,eg,ep,ev,re,r,rp)
local b2=c37209439.damcon(e,tp,eg,ep,ev,re,r,rp) and Duel.GetCurrentPhase()==PHASE_STANDBY
if (b1 or b2) and Duel.SelectYesNo(tp,94) then
local c=e:GetHandler()
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(37209439,0),aux.Stringid(37209439,1))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(37209439,0))
else op=Duel.SelectOption(tp,aux.Stringid(37209439,1))+1 end
if op==0 then
c:RegisterFlagEffect(37209439,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e:SetCategory(0)
e:SetOperation(c37209439.negop)
else
c:RegisterFlagEffect(37209440,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
c37209439.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetCategory(CATEGORY_DAMAGE)
e:SetOperation(c37209439.damop)
end
else
e:SetCategory(0)
e:SetOperation(nil)
end
end
function c37209439.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xaf)
end
function c37209439.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c37209439.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c37209439.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(37209439)==0 end
e:GetHandler():RegisterFlagEffect(37209439,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c37209439.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
......@@ -111,10 +77,6 @@ end
function c37209439.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c37209439.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(37209440)==0 end
e:GetHandler():RegisterFlagEffect(37209440,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c37209439.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
......
......@@ -4,8 +4,6 @@ function c3734202.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c3734202.target)
e1:SetOperation(c3734202.activate)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
......@@ -41,63 +39,12 @@ function c3734202.initial_effect(c)
e4:SetOperation(c3734202.thop)
c:RegisterEffect(e4)
end
function c3734202.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local b1=Duel.CheckReleaseGroup(tp,c3734202.cfilter1,1,nil)
and Duel.IsExistingMatchingCard(c3734202.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp)
local b2=Duel.CheckReleaseGroup(tp,c3734202.cfilter2,1,nil)
and Duel.IsExistingMatchingCard(c3734202.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp)
if Duel.GetFlagEffect(tp,3734202)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and (b1 or b2) and Duel.SelectYesNo(tp,94) then
local opt=0
if b1 and b2 then
opt=Duel.SelectOption(tp,aux.Stringid(3734202,0),aux.Stringid(3734202,1))
elseif b1 then
opt=Duel.SelectOption(tp,aux.Stringid(3734202,0))
else
opt=Duel.SelectOption(tp,aux.Stringid(3734202,1))+1
end
if opt==0 then
local g=Duel.SelectReleaseGroup(tp,c3734202.cfilter1,1,1,nil)
Duel.Release(g,REASON_COST)
else
local g=Duel.SelectReleaseGroup(tp,c3734202.cfilter2,1,1,nil)
Duel.Release(g,REASON_COST)
end
Duel.RegisterFlagEffect(tp,3734202,RESET_PHASE+PHASE_END,0,1)
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetLabel(opt+1)
else
e:SetCategory(0)
e:SetLabel(0)
end
end
function c3734202.activate(e,tp,eg,ep,ev,re,r,rp)
local opt=e:GetLabel()
if opt==0 or not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if opt==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c3734202.spfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c3734202.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c3734202.cfilter1(c)
return c:IsRace(RACE_INSECT) and c:IsAttribute(ATTRIBUTE_EARTH)
function c3734202.cfilter1(c,tp)
return c:IsRace(RACE_INSECT) and c:IsAttribute(ATTRIBUTE_EARTH) and Duel.GetMZoneCount(tp,c)>0
end
function c3734202.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,3734202)==0
and Duel.CheckReleaseGroup(tp,c3734202.cfilter1,1,nil) end
Duel.RegisterFlagEffect(tp,3734202,RESET_PHASE+PHASE_END,0,1)
local g=Duel.SelectReleaseGroup(tp,c3734202.cfilter1,1,1,nil)
if chk==0 then return Duel.CheckReleaseGroup(tp,c3734202.cfilter1,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c3734202.cfilter1,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c3734202.spfilter1(c,e,tp)
......@@ -105,8 +52,7 @@ function c3734202.spfilter1(c,e,tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c3734202.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c3734202.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(c3734202.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c3734202.spop1(e,tp,eg,ep,ev,re,r,rp)
......@@ -118,14 +64,12 @@ function c3734202.spop1(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c3734202.cfilter2(c)
return c:IsRace(RACE_PLANT) and c:IsAttribute(ATTRIBUTE_EARTH)
function c3734202.cfilter2(c,tp)
return c:IsRace(RACE_PLANT) and c:IsAttribute(ATTRIBUTE_EARTH) and Duel.GetMZoneCount(tp,c)>0
end
function c3734202.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,3734202)==0
and Duel.CheckReleaseGroup(tp,c3734202.cfilter2,1,nil) end
Duel.RegisterFlagEffect(tp,3734202,RESET_PHASE+PHASE_END,0,1)
local g=Duel.SelectReleaseGroup(tp,c3734202.cfilter2,1,1,nil)
if chk==0 then return Duel.CheckReleaseGroup(tp,c3734202.cfilter2,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c3734202.cfilter2,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c3734202.spfilter2(c,e,tp)
......@@ -133,8 +77,7 @@ function c3734202.spfilter2(c,e,tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c3734202.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c3734202.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(c3734202.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c3734202.spop2(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -5,7 +5,6 @@ function c39387565.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c39387565.target)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
......@@ -31,20 +30,6 @@ function c39387565.initial_effect(c)
e3:SetOperation(c39387565.spop2)
c:RegisterEffect(e3)
end
function c39387565.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c39387565.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
if chk==0 then return true end
if c39387565.spcon1(e,tp,eg,ep,ev,re,r,rp) and c39387565.sptg1(e,tp,eg,ep,ev,re,r,rp,0) and Duel.SelectYesNo(tp,aux.Stringid(39387565,0)) then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c39387565.spop1)
c39387565.sptg1(e,tp,eg,ep,ev,re,r,rp,1)
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c39387565.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3b)
end
......@@ -57,9 +42,7 @@ end
function c39387565.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c39387565.spfilter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c39387565.spfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetFlagEffect(tp,39387565)==0 end
Duel.RegisterFlagEffect(tp,39387565,RESET_PHASE+PHASE_END,0,1)
and Duel.IsExistingTarget(c39387565.spfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c39387565.spfilter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
......
......@@ -5,8 +5,6 @@ function c41930553.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c41930553.target1)
e1:SetOperation(c41930553.operation)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
......@@ -16,7 +14,7 @@ function c41930553.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetTarget(c41930553.target2)
e2:SetTarget(c41930553.target)
e2:SetOperation(c41930553.operation)
c:RegisterEffect(e2)
end
......@@ -26,29 +24,14 @@ end
function c41930553.rfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c41930553.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c41930553.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c41930553.rfilter(chkc) end
if chk==0 then return true end
if Duel.IsExistingMatchingCard(c41930553.cfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingTarget(c41930553.rfilter,tp,0,LOCATION_GRAVE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(41930553,0)) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c41930553.rfilter,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
e:GetHandler():RegisterFlagEffect(41930553,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
else e:SetProperty(0) end
end
function c41930553.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c41930553.rfilter(chkc) end
if chk==0 then return e:GetHandler():GetFlagEffect(41930553)==0
and Duel.IsExistingMatchingCard(c41930553.cfilter,tp,LOCATION_HAND,0,1,nil)
if chk==0 then return Duel.IsExistingMatchingCard(c41930553.cfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingTarget(c41930553.rfilter,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c41930553.rfilter,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
e:GetHandler():RegisterFlagEffect(41930553,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c41930553.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
......
......@@ -5,7 +5,6 @@ function c42378577.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c42378577.target)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
......@@ -17,7 +16,6 @@ function c42378577.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1,42378577)
e2:SetCost(c42378577.cost)
e2:SetTarget(c42378577.sptg)
e2:SetOperation(c42378577.spop)
c:RegisterEffect(e2)
......@@ -30,47 +28,10 @@ function c42378577.initial_effect(c)
e3:SetRange(LOCATION_SZONE)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetCountLimit(1,42378577)
e3:SetCost(c42378577.cost)
e3:SetTarget(c42378577.pentg)
e3:SetOperation(c42378577.penop)
c:RegisterEffect(e3)
end
function c42378577.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c42378577.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
or c42378577.pentg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
if chk==0 then return true end
local b1=c42378577.cost(e,tp,eg,ep,ev,re,r,rp,0)
and c42378577.sptg(e,tp,eg,ep,ev,re,r,rp,0)
local b2=c42378577.cost(e,tp,eg,ep,ev,re,r,rp,0)
and c42378577.pentg(e,tp,eg,ep,ev,re,r,rp,0)
if (b1 or b2) and Duel.SelectYesNo(tp,94) then
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(42378577,0),aux.Stringid(42378577,1))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(42378577,0))
else op=Duel.SelectOption(tp,aux.Stringid(42378577,1))+1 end
if op==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c42378577.spop)
c42378577.cost(e,tp,eg,ep,ev,re,r,rp,1)
c42378577.sptg(e,tp,eg,ep,ev,re,r,rp,1)
else
e:SetCategory(0)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c42378577.penop)
c42378577.cost(e,tp,eg,ep,ev,re,r,rp,1)
c42378577.pentg(e,tp,eg,ep,ev,re,r,rp,1)
end
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c42378577.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,42378577)==0 end
Duel.RegisterFlagEffect(tp,42378577,RESET_PHASE+PHASE_END,0,1)
end
function c42378577.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
......
......@@ -5,8 +5,6 @@ function c42425831.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c42425831.target1)
e1:SetOperation(c42425831.operation)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
......@@ -16,43 +14,27 @@ function c42425831.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCost(c42425831.cost2)
e2:SetTarget(c42425831.target2)
e2:SetCountLimit(1)
e2:SetCost(c42425831.cost)
e2:SetTarget(c42425831.target)
e2:SetOperation(c42425831.operation)
c:RegisterEffect(e2)
end
function c42425831.cfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WIND) and c:IsAbleToDeckAsCost()
end
function c42425831.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return true end
if Duel.IsExistingMatchingCard(c42425831.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(42425831,1)) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local cg=Duel.SelectMatchingCard(tp,c42425831.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoDeck(cg,nil,1,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
e:GetHandler():RegisterFlagEffect(42425831,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
else e:SetProperty(0) end
end
function c42425831.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
function c42425831.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c42425831.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local cg=Duel.SelectMatchingCard(tp,c42425831.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoDeck(cg,nil,1,REASON_COST)
end
function c42425831.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c42425831.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return e:GetHandler():GetFlagEffect(42425831)==0
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
e:GetHandler():RegisterFlagEffect(42425831,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c42425831.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
......
......@@ -4,7 +4,6 @@ function c43509019.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c43509019.target)
c:RegisterEffect(e1)
--change battle target
local e2=Effect.CreateEffect(c)
......@@ -17,17 +16,6 @@ function c43509019.initial_effect(c)
e2:SetOperation(c43509019.cbop)
c:RegisterEffect(e2)
end
function c43509019.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local res,teg,tep,tev,tre,tr,trp=Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE)
if res and c43509019.cbcon(e,tp,teg,tep,tev,tre,tr,trp)
and c43509019.cbtg(e,tp,teg,tep,tev,tre,tr,trp,0)
and Duel.SelectYesNo(tp,94) then
e:SetOperation(c43509019.cbop)
else
e:SetOperation(nil)
end
end
function c43509019.cbcon(e,tp,eg,ep,ev,re,r,rp)
local bt=Duel.GetAttackTarget()
return bt and bt:IsFaceup() and bt:IsLevelBelow(4) and bt:IsType(TYPE_TOON) and bt:GetControler()==e:GetHandlerPlayer()
......
......@@ -4,8 +4,6 @@ function c43889633.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c43889633.target1)
e1:SetOperation(c43889633.operation)
c:RegisterEffect(e1)
--instant(chain)
local e2=Effect.CreateEffect(c)
......@@ -15,7 +13,8 @@ function c43889633.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetTarget(c43889633.target2)
e2:SetCountLimit(1)
e2:SetTarget(c43889633.target)
e2:SetOperation(c43889633.operation)
c:RegisterEffect(e2)
--code
......@@ -31,23 +30,12 @@ function c43889633.filter(c)
local lv=c:GetLevel()
return c:IsFaceup() and lv>0 and lv<=4 and c:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA) and c:IsAbleToRemove()
end
function c43889633.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c43889633.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c43889633.filter(chkc) end
if chk==0 then return true end
if Duel.IsExistingTarget(c43889633.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(43889633,0)) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetCategory(CATEGORY_REMOVE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c43889633.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
e:GetHandler():RegisterFlagEffect(43889633,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e:SetLabel(1)
else
e:SetProperty(0)
e:SetCategory(0)
e:SetLabel(0)
end
if chk==0 then return Duel.IsExistingTarget(c43889633.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c43889633.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c43889633.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
......@@ -68,15 +56,6 @@ function c43889633.operation(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterEffect(e1)
end
end
function c43889633.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c43889633.filter(chkc) end
if chk==0 then return e:GetHandler():GetFlagEffect(43889633)==0
and Duel.IsExistingTarget(c43889633.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c43889633.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
e:GetHandler():RegisterFlagEffect(43889633,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c43889633.spcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return tc and tc:GetFlagEffect(43889634)~=0 and Duel.GetTurnPlayer()==tp
......
......@@ -6,7 +6,6 @@ function c47482043.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c47482043.target)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
......@@ -21,20 +20,6 @@ function c47482043.initial_effect(c)
e2:SetOperation(c47482043.spop)
c:RegisterEffect(e2)
end
function c47482043.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c47482043.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
if chk==0 then return true end
if c47482043.spcon(e,tp,eg,ep,ev,re,r,rp) and c47482043.sptg(e,tp,eg,ep,ev,re,r,rp,0) and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c47482043.spop)
c47482043.sptg(e,tp,eg,ep,ev,re,r,rp,1)
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c47482043.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
......@@ -44,9 +29,7 @@ end
function c47482043.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c47482043.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c47482043.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and e:GetHandler():GetFlagEffect(47482043)==0 end
e:GetHandler():RegisterFlagEffect(47482043,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
and Duel.IsExistingTarget(c47482043.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c47482043.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
......
......@@ -4,8 +4,6 @@ function c49838105.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c49838105.target1)
e1:SetOperation(c49838105.operation)
c:RegisterEffect(e1)
--attack
local e2=Effect.CreateEffect(c)
......@@ -15,9 +13,8 @@ function c49838105.initial_effect(c)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c49838105.condition)
e2:SetTarget(c49838105.target2)
e2:SetTarget(c49838105.target)
e2:SetOperation(c49838105.operation)
e2:SetLabel(1)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
......@@ -34,23 +31,11 @@ end
function c49838105.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil
end
function c49838105.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE)
and Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil
and Duel.IsPlayerCanDiscardDeck(tp,1) and Duel.SelectYesNo(tp,94) then
e:SetLabel(1)
e:SetCategory(CATEGORY_DECKDES)
else
e:SetLabel(0)
e:SetCategory(0)
end
end
function c49838105.target2(e,tp,eg,ep,ev,re,r,rp,chk)
function c49838105.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end
function c49838105.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
......
......@@ -5,7 +5,6 @@ function c49966595.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_ATTACK)
e1:SetTarget(c49966595.acttg)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
......@@ -15,7 +14,6 @@ function c49966595.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,49966595)
e2:SetCondition(c49966595.spcon1)
e2:SetCost(c49966595.spcost1)
e2:SetTarget(c49966595.sptg1)
e2:SetOperation(c49966595.spop1)
c:RegisterEffect(e2)
......@@ -28,49 +26,13 @@ function c49966595.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,49966596)
e3:SetCondition(c49966595.spcon2)
e3:SetCost(c49966595.spcost2)
e3:SetTarget(c49966595.sptg2)
e3:SetOperation(c49966595.spop2)
c:RegisterEffect(e3)
end
function c49966595.acttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c49966595.sptg2(e,tp,eg,ep,ev,re,r,rp,0,chkc) end
if chk==0 then return true end
if Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) then
if c49966595.spcon1(e,tp,eg,ep,ev,re,r,rp)
and c49966595.spcost1(e,tp,eg,ep,ev,re,r,rp,0)
and c49966595.sptg1(e,tp,eg,ep,ev,re,r,rp,0)
and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetProperty(0)
e:SetOperation(c49966595.spop1)
c49966595.spcost1(e,tp,eg,ep,ev,re,r,rp,1)
c49966595.sptg1(e,tp,eg,ep,ev,re,r,rp,1)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,65)
return
elseif c49966595.spcon2(e,tp,eg,ep,ev,re,r,rp)
and c49966595.spcost2(e,tp,eg,ep,ev,re,r,rp,0)
and c49966595.sptg2(e,tp,eg,ep,ev,re,r,rp,0,chkc)
and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c49966595.spop2)
c49966595.spcost2(e,tp,eg,ep,ev,re,r,rp,1)
c49966595.sptg2(e,tp,eg,ep,ev,re,r,rp,1,chkc)
return
end
end
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
function c49966595.spcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil
end
function c49966595.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,49966595)==0 end
Duel.RegisterFlagEffect(tp,49966595,RESET_PHASE+PHASE_END,0,1)
end
function c49966595.spfilter1(c,e,tp)
return c:IsSetCard(0xd1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
......@@ -94,10 +56,6 @@ function c49966595.spcon2(e,tp,eg,ep,ev,re,r,rp)
local c=Duel.GetAttacker()
return c:IsControler(tp) and c:IsSetCard(0xd1) and Duel.GetAttackTarget()==nil
end
function c49966595.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,49966596)==0 end
Duel.RegisterFlagEffect(tp,49966596,RESET_PHASE+PHASE_END,0,1)
end
function c49966595.spfilter2(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
end
......
......@@ -4,8 +4,6 @@ function c5026221.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c5026221.target1)
e1:SetOperation(c5026221.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
......@@ -18,20 +16,8 @@ function c5026221.initial_effect(c)
e2:SetCondition(c5026221.condition)
e2:SetTarget(c5026221.target2)
e2:SetOperation(c5026221.operation)
e2:SetLabel(1)
c:RegisterEffect(e2)
end
function c5026221.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if c5026221.condition(e,tp,eg,ep,ev,re,r,rp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c5026221.filter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,94) then
e:GetHandler():RegisterFlagEffect(5026221,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,65)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
end
function c5026221.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
if Duel.GetTurnPlayer()==tp then
......@@ -44,14 +30,12 @@ function c5026221.filter(c,e,tp)
return c:IsSetCard(0x9c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c5026221.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(5026221)==0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c5026221.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
e:GetHandler():RegisterFlagEffect(5026221,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c5026221.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(5026221)==0 or not e:GetHandler():IsRelateToEffect(e) then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c5026221.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
......
......@@ -6,8 +6,6 @@ function c51053997.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c51053997.target1)
e1:SetOperation(c51053997.operation)
c:RegisterEffect(e1)
--remove
local e3=Effect.CreateEffect(c)
......@@ -20,7 +18,7 @@ function c51053997.initial_effect(c)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetCountLimit(1)
e3:SetCost(c51053997.cost)
e3:SetTarget(c51053997.target2)
e3:SetTarget(c51053997.target)
e3:SetOperation(c51053997.operation)
c:RegisterEffect(e3)
--special summon
......@@ -33,39 +31,18 @@ function c51053997.initial_effect(c)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetCondition(c51053997.spcon)
e4:SetCost(c51053997.spcost)
e4:SetTarget(c51053997.sptg2)
e4:SetTarget(c51053997.sptg)
e4:SetOperation(c51053997.spop)
c:RegisterEffect(e4)
end
function c51053997.rmfilter(c)
return c:IsSetCard(0xc1) and c:IsAbleToRemove()
end
function c51053997.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c51053997.rmfilter(chkc) end
if chk==0 then return true end
if e:GetHandler():GetFlagEffect(51053997)==0 and Duel.CheckLPCost(tp,500)
and Duel.IsExistingTarget(c51053997.rmfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_REMOVE)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:GetHandler():RegisterFlagEffect(51053997,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.PayLPCost(tp,500)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c51053997.rmfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
else
e:SetCategory(0)
e:SetProperty(0)
end
end
function c51053997.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500)
and e:GetHandler():GetFlagEffect(51053997)==0 end
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
e:GetHandler():RegisterFlagEffect(51053997,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c51053997.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c51053997.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c51053997.rmfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c51053997.rmfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
......@@ -74,7 +51,7 @@ function c51053997.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c51053997.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(51053997)==0 or not c:IsRelateToEffect(e) then return end
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local ct=1
......@@ -113,14 +90,10 @@ end
function c51053997.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c51053997.cfilter,1,e:GetHandler(),tp)
end
function c51053997.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(51053999)==0 end
e:GetHandler():RegisterFlagEffect(51053999,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c51053997.spfilter(c,e,tp)
return c:IsSetCard(0xc1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c51053997.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
function c51053997.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c51053997.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
......
......@@ -4,8 +4,6 @@ function c52198054.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c52198054.target1)
e1:SetOperation(c52198054.operation)
e1:SetHintTiming(0,TIMING_MAIN_END)
c:RegisterEffect(e1)
--tograve
......@@ -17,11 +15,9 @@ function c52198054.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,52198054)
e2:SetCondition(c52198054.condition)
e2:SetCost(c52198054.cost)
e2:SetTarget(c52198054.target2)
e2:SetTarget(c52198054.target)
e2:SetOperation(c52198054.operation)
e2:SetHintTiming(0,TIMING_MAIN_END)
e2:SetLabel(1)
c:RegisterEffect(e2)
--change
local e3=Effect.CreateEffect(c)
......@@ -45,41 +41,17 @@ function c52198054.initial_effect(c)
e4:SetHintTiming(0,TIMING_MAIN_END)
c:RegisterEffect(e4)
end
function c52198054.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
and Duel.GetFlagEffect(tp,52198054)==0
and Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_HAND,0,1,nil,0x32)
and Duel.SelectYesNo(tp,aux.Stringid(52198054,0)) then
e:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DRAW)
e:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
Duel.RegisterFlagEffect(tp,52198054,RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
e:SetLabel(1)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(52198054,2))
else
e:SetCategory(0)
e:SetProperty(0)
e:SetLabel(0)
end
end
function c52198054.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c52198054.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,52198054)==0 end
Duel.RegisterFlagEffect(tp,52198054,RESET_PHASE+PHASE_END,0,1)
end
function c52198054.target2(e,tp,eg,ep,ev,re,r,rp,chk)
function c52198054.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_HAND,0,1,nil,0x32) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c52198054.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_HAND,0,1,1,nil,0x32)
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 and g:GetFirst():IsLocation(LOCATION_GRAVE) then
......
......@@ -5,8 +5,6 @@ function c52971944.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c52971944.target1)
e1:SetOperation(c52971944.operation)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
......@@ -16,43 +14,27 @@ function c52971944.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCost(c52971944.cost2)
e2:SetTarget(c52971944.target2)
e2:SetCountLimit(1)
e2:SetCost(c52971944.cost)
e2:SetTarget(c52971944.target)
e2:SetOperation(c52971944.operation)
c:RegisterEffect(e2)
end
function c52971944.cfilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToRemoveAsCost()
end
function c52971944.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return true end
if Duel.IsExistingMatchingCard(c52971944.cfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(52971944,0)) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local cg=Duel.SelectMatchingCard(tp,c52971944.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(cg,POS_FACEUP,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
e:GetHandler():RegisterFlagEffect(52971944,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
else e:SetProperty(0) end
end
function c52971944.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
function c52971944.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c52971944.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local cg=Duel.SelectMatchingCard(tp,c52971944.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(cg,POS_FACEUP,REASON_COST)
end
function c52971944.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c52971944.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return e:GetHandler():GetFlagEffect(52971944)==0
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
e:GetHandler():RegisterFlagEffect(52971944,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c52971944.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
......
......@@ -5,8 +5,6 @@ function c54059040.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_SUMMON+TIMING_SPSUMMON)
e1:SetTarget(c54059040.target1)
e1:SetOperation(c54059040.operation)
c:RegisterEffect(e1)
--pos
local e2=Effect.CreateEffect(c)
......@@ -15,9 +13,8 @@ function c54059040.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetTarget(c54059040.target2)
e2:SetTarget(c54059040.target)
e2:SetOperation(c54059040.operation)
e2:SetLabel(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
......@@ -29,30 +26,14 @@ end
function c54059040.pfilter(c,e)
return c:IsPosition(POS_FACEUP_ATTACK) and not c:IsAttribute(ATTRIBUTE_WATER) and (not e or c:IsRelateToEffect(e))
end
function c54059040.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local res,teg,tep,tev,tre,tr,trp=Duel.CheckEvent(EVENT_SUMMON_SUCCESS,true)
if not res then
res,teg,tep,tev,tre,tr,trp=Duel.CheckEvent(EVENT_SPSUMMON_SUCCESS,true)
end
if res and Duel.IsExistingMatchingCard(c54059040.cfilter,tp,LOCATION_MZONE,0,1,nil)
and teg:IsExists(c54059040.pfilter,1,nil)
and Duel.SelectYesNo(tp,94) then
e:SetLabel(1)
Duel.SetTargetCard(teg)
Duel.SetOperationInfo(0,CATEGORY_POSITION,teg,teg:GetCount(),0,0)
else
e:SetLabel(0)
end
end
function c54059040.target2(e,tp,eg,ep,ev,re,r,rp,chk)
function c54059040.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c54059040.cfilter,tp,LOCATION_MZONE,0,1,nil)
and eg:IsExists(c54059040.pfilter,1,nil) end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_POSITION,eg,eg:GetCount(),0,0)
end
function c54059040.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c54059040.pfilter,nil,e)
Duel.ChangePosition(g,POS_FACEUP_DEFENSE)
end
......@@ -5,8 +5,6 @@ function c54109233.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE)
e1:SetTarget(c54109233.target1)
e1:SetOperation(c54109233.activate)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
......@@ -18,7 +16,6 @@ function c54109233.initial_effect(c)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetTarget(c54109233.target)
e2:SetOperation(c54109233.activate)
e2:SetLabel(1)
c:RegisterEffect(e2)
if not c54109233.global_check then
c54109233.global_check=true
......@@ -40,28 +37,13 @@ end
function c54109233.filter(c)
return c:IsLevelBelow(3) and c:GetFlagEffect(54109233)~=0
end
function c54109233.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.GetCurrentPhase()==PHASE_END and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_DESTROY)
e:SetLabel(1)
local g=Duel.GetMatchingGroup(c54109233.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
e:GetHandler():RegisterFlagEffect(54109234,RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,65)
else
e:SetCategory(0)
e:SetLabel(0)
end
end
function c54109233.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(54109234)==0 end
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c54109233.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
e:GetHandler():RegisterFlagEffect(54109234,RESET_PHASE+PHASE_END,0,1)
end
function c54109233.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c54109233.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -5,7 +5,6 @@ function c54241725.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_ATTACK+TIMING_END_PHASE)
e1:SetTarget(c54241725.acttg)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
......@@ -16,7 +15,6 @@ function c54241725.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCost(c54241725.drcost)
e2:SetTarget(c54241725.drtg)
e2:SetOperation(c54241725.drop)
c:RegisterEffect(e2)
......@@ -34,25 +32,6 @@ function c54241725.initial_effect(c)
e3:SetOperation(c54241725.spop)
c:RegisterEffect(e3)
end
function c54241725.acttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
if c54241725.drcost(e,tp,eg,ep,ev,re,r,rp,0) and c54241725.drtg(e,tp,eg,ep,ev,re,r,rp,0,chkc) and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c54241725.drop)
c54241725.drcost(e,tp,eg,ep,ev,re,r,rp,1)
c54241725.drtg(e,tp,eg,ep,ev,re,r,rp,1,chkc)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,65)
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c54241725.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(54241725)==0 end
e:GetHandler():RegisterFlagEffect(54241725,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c54241725.tdfilter(c)
return c:IsSetCard(0xbe) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToDeck()
end
......
......@@ -4,8 +4,6 @@ function c56339050.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c56339050.target)
e1:SetOperation(c56339050.operation)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
......@@ -15,56 +13,35 @@ function c56339050.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCondition(c56339050.condition2)
e2:SetTarget(c56339050.target2)
e2:SetCountLimit(1)
e2:SetCondition(c56339050.condition)
e2:SetTarget(c56339050.target)
e2:SetOperation(c56339050.operation)
c:RegisterEffect(e2)
end
function c56339050.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc==Duel.GetAttacker() end
if chk==0 then return true end
if Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) and Duel.GetTurnPlayer()~=tp then
local tc=Duel.GetAttacker()
if Duel.IsExistingMatchingCard(c56339050.cfilter,tp,LOCATION_MZONE,0,1,nil,tc:GetAttack())
and tc:IsOnField() and tc:IsCanBeEffectTarget(e) then
e:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.SetTargetCard(tc)
local dam=tc:GetAttack()/2
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
e:GetHandler():RegisterFlagEffect(56339050,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
else
e:SetCategory(0)
e:SetProperty(0)
end
end
end
function c56339050.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsAttackable() then
local atk=tc:GetAttack()/2
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
end
function c56339050.cfilter(c,atk)
return c:IsFaceup() and c:IsSetCard(0x21) and c:GetAttack()>atk
end
function c56339050.condition2(e,tp,eg,ep,ev,re,r,rp)
function c56339050.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
return Duel.GetTurnPlayer()~=tp and Duel.IsExistingMatchingCard(c56339050.cfilter,tp,LOCATION_MZONE,0,1,nil,tc:GetAttack())
end
function c56339050.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c56339050.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tc=Duel.GetAttacker()
if chkc then return chkc==tc end
if chk==0 then return e:GetHandler():GetFlagEffect(56339050)==0 and tc:IsOnField() and tc:IsCanBeEffectTarget(e) end
if chk==0 then return tc:IsOnField() and tc:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tc)
local dam=tc:GetAttack()/2
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
e:GetHandler():RegisterFlagEffect(56339050,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c56339050.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsAttackable() then
local atk=tc:GetAttack()/2
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
end
--真竜の黙示録
function c61529473.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetHintTiming(0,TIMING_END_PHASE)
e0:SetTarget(c61529473.target)
c:RegisterEffect(e0)
--Activate(damage phase)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(61529473,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCountLimit(1,61529473)
e1:SetCondition(c61529473.atkcon1)
e1:SetCost(c61529473.cost)
e1:SetTarget(c61529473.atktg)
e1:SetOperation(c61529473.atkop)
e1:SetHintTiming(0,TIMING_END_PHASE)
c:RegisterEffect(e1)
--destory and atk & def down
local e2=Effect.CreateEffect(c)
......@@ -62,42 +48,6 @@ function c61529473.initial_effect(c)
e4:SetOperation(c61529473.desop)
c:RegisterEffect(e4)
end
function c61529473.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c61529473.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
if chk==0 then return true end
local b1=c61529473.atkcon(e,tp,eg,ep,ev,re,r,rp)
and c61529473.cost(e,tp,eg,ep,ev,re,r,rp,0)
and c61529473.atktg(e,tp,eg,ep,ev,re,r,rp,0)
local b2=c61529473.sumcon(e,tp,eg,ep,ev,re,r,rp)
and c61529473.cost(e,tp,eg,ep,ev,re,r,rp,0)
and c61529473.sumtg(e,tp,eg,ep,ev,re,r,rp,0)
if (b1 or b2) and Duel.SelectYesNo(tp,94) then
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(61529473,0),aux.Stringid(61529473,1))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(61529473,0))
else op=Duel.SelectOption(tp,aux.Stringid(61529473,1))+1 end
if op==0 then
e:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c61529473.atkop)
c61529473.cost(e,tp,eg,ep,ev,re,r,rp,1)
c61529473.atktg(e,tp,eg,ep,ev,re,r,rp,1)
else
e:SetCategory(CATEGORY_SUMMON)
e:SetProperty(0)
e:SetOperation(c61529473.sumop)
c61529473.cost(e,tp,eg,ep,ev,re,r,rp,1)
c61529473.sumtg(e,tp,eg,ep,ev,re,r,rp,1)
end
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c61529473.atkcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_DAMAGE and not Duel.IsDamageCalculated()
end
function c61529473.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
......@@ -112,9 +62,7 @@ function c61529473.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(tp) and c61529473.tgfilter(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(c61529473.tgfilter,tp,LOCATION_ONFIELD,0,1,c)
and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil)
and Duel.GetFlagEffect(tp,61529474)==0 end
Duel.RegisterFlagEffect(tp,61529474,RESET_PHASE+PHASE_END,0,1)
and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c61529473.tgfilter,tp,LOCATION_ONFIELD,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
......@@ -140,7 +88,7 @@ function c61529473.atkop(e,tp,eg,ep,ev,re,r,rp)
tc2=g:GetNext()
end
end
end
end
function c61529473.sumcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
......@@ -149,9 +97,7 @@ function c61529473.sumfilter(c)
return c:IsSetCard(0xf9) and c:IsSummonable(true,nil,1)
end
function c61529473.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c61529473.sumfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.GetFlagEffect(tp,61529475)==0 end
Duel.RegisterFlagEffect(tp,61529475,RESET_PHASE+PHASE_END,0,1)
if chk==0 then return Duel.IsExistingMatchingCard(c61529473.sumfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c61529473.sumop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -6,9 +6,6 @@ function c61965407.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_STANDBY_PHASE,TIMING_STANDBY_PHASE)
e1:SetTarget(c61965407.target)
e1:SetOperation(c61965407.operation)
e1:SetLabel(0)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
......@@ -17,11 +14,10 @@ function c61965407.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCountLimit(1,61965407)
e2:SetCondition(c61965407.thcon)
e2:SetCost(c61965407.thcost)
e2:SetTarget(c61965407.thtg)
e2:SetOperation(c61965407.operation)
e2:SetLabel(1)
e2:SetOperation(c61965407.thop)
c:RegisterEffect(e2)
--tograve
local e3=Effect.CreateEffect(c)
......@@ -30,11 +26,10 @@ function c61965407.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetCountLimit(1,61965408)
e3:SetCondition(c61965407.tgcon)
e3:SetCost(c61965407.tgcost)
e3:SetTarget(c61965407.tgtg)
e3:SetOperation(c61965407.operation)
e3:SetLabel(2)
e3:SetOperation(c61965407.tgop)
c:RegisterEffect(e3)
--tograve
local e4=Effect.CreateEffect(c)
......@@ -45,47 +40,9 @@ function c61965407.initial_effect(c)
e4:SetCondition(c61965407.sdcon)
c:RegisterEffect(e4)
end
function c61965407.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
if e:GetLabel()==1 then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c61965407.thfilter(chkc) end
if e:GetLabel()==2 then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c61965407.tgfilter(chkc) end
end
if chk==0 then return true end
if Duel.GetTurnPlayer()~=tp and Duel.GetCurrentPhase()==PHASE_STANDBY
and Duel.IsExistingTarget(c61965407.thfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.GetFlagEffect(tp,61965407)==0
and Duel.SelectYesNo(tp,aux.Stringid(61965407,0)) then
e:SetCategory(CATEGORY_TOHAND)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c61965407.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.RegisterFlagEffect(tp,61965407,RESET_PHASE+PHASE_END,0,1)
e:SetLabel(1)
elseif Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY
and Duel.IsExistingTarget(c61965407.tgfilter,tp,LOCATION_REMOVED,0,1,nil)
and Duel.GetFlagEffect(tp,61965408)==0
and Duel.SelectYesNo(tp,aux.Stringid(61965407,0)) then
e:SetCategory(CATEGORY_TOGRAVE)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,c61965407.tgfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
Duel.RegisterFlagEffect(tp,61965408,RESET_PHASE+PHASE_END,0,1)
e:SetLabel(2)
else
e:SetCategory(0)
e:SetProperty(0)
e:SetLabel(0)
end
end
function c61965407.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c61965407.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,61965407)==0 end
Duel.RegisterFlagEffect(tp,61965407,RESET_PHASE+PHASE_END,0,1)
end
function c61965407.thfilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
......@@ -96,13 +53,17 @@ function c61965407.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,c61965407.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c61965407.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
function c61965407.tgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c61965407.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,61965408)==0 end
Duel.RegisterFlagEffect(tp,61965408,RESET_PHASE+PHASE_END,0,1)
end
function c61965407.tgfilter(c)
return c:IsFaceup() and c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER)
end
......@@ -113,14 +74,10 @@ function c61965407.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,c61965407.tgfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c61965407.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end
function c61965407.tgop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
if e:GetLabel()==1 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT+REASON_RETURN)
end
end
......
......@@ -4,8 +4,6 @@ function c63881033.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c63881033.lvtg1)
e1:SetOperation(c63881033.lvop)
c:RegisterEffect(e1)
--disable spsummon
local e2=Effect.CreateEffect(c)
......@@ -23,7 +21,7 @@ function c63881033.initial_effect(c)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetTarget(c63881033.lvtg2)
e3:SetTarget(c63881033.lvtg)
e3:SetOperation(c63881033.lvop)
c:RegisterEffect(e3)
--destroy replace
......@@ -47,36 +45,21 @@ function c63881033.initial_effect(c)
e5:SetOperation(c63881033.thop)
c:RegisterEffect(e5)
end
function c63881033.lvtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.IsExistingMatchingCard(c63881033.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,94) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(63881033,1))
local lv=Duel.AnnounceLevel(tp,5,9)
e:SetLabel(lv)
e:GetHandler():RegisterFlagEffect(63881033,RESET_PHASE+PHASE_END,0,1)
else
e:SetLabel(0)
end
end
function c63881033.splimit(e,c)
return c:GetRace()~=RACE_MACHINE
end
function c63881033.filter(c)
return c:IsFaceup() and c:IsLevelAbove(5) and c:IsRace(RACE_MACHINE)
end
function c63881033.lvtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(63881033)==0
and Duel.IsExistingMatchingCard(c63881033.filter,tp,LOCATION_MZONE,0,1,nil) end
function c63881033.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c63881033.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(63881033,1))
local lv=Duel.AnnounceLevel(tp,5,9)
e:SetLabel(lv)
e:GetHandler():RegisterFlagEffect(63881033,RESET_PHASE+PHASE_END,0,1)
end
function c63881033.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if e:GetLabel()==0 then return end
local g=Duel.GetMatchingGroup(c63881033.filter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
......
......@@ -5,8 +5,6 @@ function c64038662.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c64038662.eftg1)
e1:SetOperation(c64038662.efop)
c:RegisterEffect(e1)
--equip or spsummon
local e2=Effect.CreateEffect(c)
......@@ -15,7 +13,8 @@ function c64038662.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c64038662.eftg2)
e2:SetCountLimit(1)
e2:SetTarget(c64038662.eftg)
e2:SetOperation(c64038662.efop)
c:RegisterEffect(e2)
end
......@@ -25,7 +24,14 @@ end
function c64038662.filter2(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x56) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c64038662.select(e,tp,b1,b2)
function c64038662.eftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
if e:GetLabel()==1 then return false
else return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c64038662.filter2(chkc,e,tp) end
end
local b1=Duel.IsExistingTarget(c64038662.filter1,tp,LOCATION_MZONE,0,2,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
local b2=Duel.IsExistingTarget(c64038662.filter2,tp,LOCATION_SZONE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(64038662,2),aux.Stringid(64038662,3))+1
......@@ -46,39 +52,10 @@ function c64038662.select(e,tp,b1,b2)
local g=Duel.SelectTarget(tp,c64038662.filter2,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
e:GetHandler():RegisterFlagEffect(64038662,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c64038662.eftg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
if e:GetLabel()==0 or e:GetLabel()==1 then return false
else return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c64038662.filter2(chkc,e,tp) end
end
if chk==0 then return true end
local b1=Duel.IsExistingTarget(c64038662.filter1,tp,LOCATION_MZONE,0,2,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
local b2=Duel.IsExistingTarget(c64038662.filter2,tp,LOCATION_SZONE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if (not b1 and not b2) or not Duel.SelectYesNo(tp,aux.Stringid(64038662,1)) then
e:SetProperty(0)
e:SetCategory(0)
e:SetLabel(0)
return
end
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
c64038662.select(e,tp,b1,b2)
end
function c64038662.eftg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
if e:GetLabel()==0 or e:GetLabel()==1 then return false
else return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c64038662.filter2(chkc,e,tp) end
end
local b1=Duel.IsExistingTarget(c64038662.filter1,tp,LOCATION_MZONE,0,2,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
local b2=Duel.IsExistingTarget(c64038662.filter2,tp,LOCATION_SZONE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return e:GetHandler():GetFlagEffect(64038662)==0 and (b1 or b2) end
c64038662.select(e,tp,b1,b2)
end
function c64038662.efop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()==0 then return
elseif e:GetLabel()==1 then
if e:GetLabel()==1 then
local tc1=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc2=g:GetFirst()
......
......@@ -4,8 +4,6 @@ function c64043465.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c64043465.target1)
e1:SetOperation(c64043465.operation)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
......@@ -17,10 +15,8 @@ function c64043465.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,64043465)
e2:SetHintTiming(0,0x1e0)
e2:SetCost(c64043465.cost)
e2:SetTarget(c64043465.target2)
e2:SetTarget(c64043465.target)
e2:SetOperation(c64043465.operation)
e2:SetLabel(1)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
......@@ -31,7 +27,6 @@ function c64043465.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,64043465)
e3:SetCondition(c64043465.thcon)
e3:SetCost(c64043465.cost)
e3:SetTarget(c64043465.thtg)
e3:SetOperation(c64043465.thop)
c:RegisterEffect(e3)
......@@ -39,31 +34,7 @@ end
function c64043465.tgfilter(c)
return ((c:IsSetCard(0x40) and c:IsType(TYPE_MONSTER)) or c:IsSetCard(0xde)) and c:IsAbleToGrave()
end
function c64043465.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsAbleToHand() end
if chk==0 then return true end
if Duel.GetFlagEffect(tp,64043465)==0 and Duel.IsExistingMatchingCard(c64043465.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TOHAND)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.RegisterFlagEffect(tp,64043465,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
e:SetLabel(1)
else
e:SetCategory(0)
e:SetProperty(0)
e:SetLabel(0)
end
end
function c64043465.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,64043465)==0 end
Duel.RegisterFlagEffect(tp,64043465,RESET_PHASE+PHASE_END,0,1)
end
function c64043465.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c64043465.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingMatchingCard(c64043465.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
......@@ -73,7 +44,7 @@ function c64043465.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c64043465.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c64043465.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 and g:GetFirst():IsLocation(LOCATION_GRAVE) then
......
......@@ -5,7 +5,6 @@ function c69452756.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE+TIMING_EQUIP)
e1:SetTarget(c69452756.target1)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
......@@ -16,35 +15,20 @@ function c69452756.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE+TIMING_EQUIP)
e2:SetCost(c69452756.cost2)
e2:SetTarget(c69452756.target2)
e2:SetCost(c69452756.cost)
e2:SetTarget(c69452756.target)
e2:SetOperation(c69452756.operation)
c:RegisterEffect(e2)
end
function c69452756.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c69452756.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c69452756.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
if chk==0 then return true end
if c69452756.cost2(e,tp,eg,ep,ev,re,r,rp,0) and c69452756.target2(e,tp,eg,ep,ev,re,r,rp,0,chkc)
and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_DESTROY)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c69452756.operation)
c69452756.cost2(e,tp,eg,ep,ev,re,r,rp,1)
c69452756.target2(e,tp,eg,ep,ev,re,r,rp,1,chkc)
else
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c69452756.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
function c69452756.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) and Duel.GetFlagEffect(tp,69452756)==0 end
Duel.PayLPCost(tp,1000)
Duel.RegisterFlagEffect(tp,69452756,RESET_CHAIN,0,1)
end
function c69452756.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c69452756.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c69452756.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c69452756.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
......
......@@ -4,8 +4,6 @@ function c70875955.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c70875955.sptg1)
e1:SetOperation(c70875955.spop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
......@@ -15,9 +13,9 @@ function c70875955.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetTarget(c70875955.sptg2)
e2:SetCountLimit(1)
e2:SetTarget(c70875955.sptg)
e2:SetOperation(c70875955.spop)
e2:SetLabel(1)
c:RegisterEffect(e2)
--cost
local e3=Effect.CreateEffect(c)
......@@ -30,30 +28,15 @@ function c70875955.initial_effect(c)
e3:SetOperation(c70875955.mtop)
c:RegisterEffect(e3)
end
function c70875955.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,31533705,0x101b,0x4011,0,0,3,RACE_MACHINE,ATTRIBUTE_WIND)
and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetLabel(1)
e:GetHandler():RegisterFlagEffect(70875955,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(70875955,3))
else
e:SetCategory(0)
e:SetLabel(0)
end
end
function c70875955.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(70875955)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
function c70875955.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,31533705,0x101b,0x4011,0,0,3,RACE_MACHINE,ATTRIBUTE_WIND) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
e:GetHandler():RegisterFlagEffect(70875955,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c70875955.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()==0 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,31533705,0x101b,0x4011,0,0,3,RACE_MACHINE,ATTRIBUTE_WIND) then
local token=Duel.CreateToken(tp,70875956)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
......
......@@ -5,8 +5,6 @@ function c73820802.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_STANDBY_PHASE,0)
e1:SetTarget(c73820802.target1)
e1:SetOperation(c73820802.operation)
c:RegisterEffect(e1)
--instant(chain)
local e2=Effect.CreateEffect(c)
......@@ -15,27 +13,16 @@ function c73820802.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetLabel(1)
e2:SetCountLimit(1)
e2:SetCondition(c73820802.condition)
e2:SetTarget(c73820802.target2)
e2:SetOperation(c73820802.operation)
c:RegisterEffect(e2)
end
function c73820802.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES)
e:SetLabel(1)
e:GetHandler():RegisterFlagEffect(73820802,RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,65)
else
e:SetCategory(0)
e:SetLabel(0)
end
function c73820802.condition(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c73820802.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()==0 then return end
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_CARDTYPE)
local op=Duel.AnnounceType(1-tp)
......@@ -53,10 +40,3 @@ function c73820802.operation(e,tp,eg,ep,ev,re,r,rp)
end
Duel.MoveSequence(tc,1)
end
function c73820802.condition(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c73820802.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(73820802)==0 end
e:GetHandler():RegisterFlagEffect(73820802,RESET_PHASE+PHASE_END,0,1)
end
......@@ -4,8 +4,6 @@ function c76297408.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c76297408.target1)
e1:SetOperation(c76297408.operation)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
......@@ -14,9 +12,9 @@ function c76297408.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(c76297408.condition2)
e2:SetCost(c76297408.cost2)
e2:SetTarget(c76297408.target2)
e2:SetCondition(c76297408.condition)
e2:SetCost(c76297408.cost)
e2:SetTarget(c76297408.target)
e2:SetOperation(c76297408.operation)
c:RegisterEffect(e2)
end
......@@ -26,31 +24,14 @@ end
function c76297408.rfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c76297408.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return true end
if Duel.IsExistingMatchingCard(c76297408.cfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.CheckLPCost(tp,500)
and Duel.IsExistingTarget(c76297408.rfilter,tp,0,LOCATION_GRAVE,1,nil)
and Duel.IsExistingTarget(c76297408.rfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(76297408,1)) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.PayLPCost(tp,500)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectTarget(tp,c76297408.rfilter,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local g2=Duel.SelectTarget(1-tp,c76297408.rfilter,1-tp,0,LOCATION_GRAVE,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g1,g1:GetCount(),0,0)
else e:SetProperty(0) end
end
function c76297408.condition2(e,tp,eg,ep,ev,re,r,rp)
function c76297408.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c76297408.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c76297408.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
function c76297408.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c76297408.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c76297408.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c76297408.rfilter,tp,0,LOCATION_GRAVE,1,nil)
and Duel.IsExistingTarget(c76297408.rfilter,tp,LOCATION_GRAVE,0,1,nil) end
......
......@@ -5,8 +5,6 @@ function c78625592.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_ATTACK)
e1:SetTarget(c78625592.target)
e1:SetOperation(c78625592.operation)
c:RegisterEffect(e1)
--disable attack
local e2=Effect.CreateEffect(c)
......@@ -36,20 +34,9 @@ end
function c78625592.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
e:SetLabel(1)
end
function c78625592.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:SetLabel(0)
if Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) and tp~=Duel.GetTurnPlayer()
and Duel.CheckLPCost(tp,1000) and Duel.SelectYesNo(tp,94) then
Duel.PayLPCost(tp,1000)
e:SetLabel(1)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,65)
end
end
function c78625592.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetHandler():IsRelateToEffect(e) then return end
Duel.NegateAttack()
end
function c78625592.grcondition(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -4,7 +4,6 @@ function c78765160.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c78765160.target)
c:RegisterEffect(e1)
--change code
local e2=Effect.CreateEffect(c)
......@@ -20,8 +19,8 @@ function c78765160.initial_effect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetCost(c78765160.damcost)
e3:SetTarget(c78765160.damtg)
e3:SetOperation(c78765160.damop)
c:RegisterEffect(e3)
--to deck
......@@ -32,43 +31,11 @@ function c78765160.initial_effect(c)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e4:SetTarget(c78765160.tdtg)
e4:SetOperation(c78765160.tdop)
c:RegisterEffect(e4)
end
function c78765160.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c78765160.tdtg(e,tp,eg,ep,ev,re,r,rp,0,chkc) end
if chk==0 then return true end
local b1=c78765160.damcost(e,tp,eg,ep,ev,re,r,rp,0)
and c78765160.damtg(e,tp,eg,ep,ev,re,r,rp,0)
local b2=c78765160.tdtg(e,tp,eg,ep,ev,re,r,rp,0)
if (b1 or b2) and Duel.SelectYesNo(tp,94) then
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(78765160,0),aux.Stringid(78765160,1))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(78765160,0))
else
op=Duel.SelectOption(tp,aux.Stringid(78765160,1))+1
end
if op==0 then
c78765160.damcost(e,tp,eg,ep,ev,re,r,rp,1)
c78765160.damtg(e,tp,eg,ep,ev,re,r,rp,1)
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(c78765160.damop)
else
c78765160.tdtg(e,tp,eg,ep,ev,re,r,rp,1)
e:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c78765160.tdop)
end
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c78765160.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and c:IsAbleToRemoveAsCost()
end
......@@ -78,10 +45,6 @@ function c78765160.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,c78765160.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c78765160.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(78765160)==0 end
e:GetHandler():RegisterFlagEffect(78765160,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c78765160.damop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -102,14 +65,12 @@ function c78765160.tdfilter(c)
end
function c78765160.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c78765160.tdfilter(chkc) end
if chk==0 then return e:GetHandler():GetFlagEffect(78765160)==0
and Duel.IsPlayerCanDraw(tp,1)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c78765160.tdfilter,tp,LOCATION_REMOVED,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c78765160.tdfilter,tp,LOCATION_REMOVED,0,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
e:GetHandler():RegisterFlagEffect(78765160,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c78765160.tdop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
......
......@@ -4,7 +4,6 @@ function c78949372.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c78949372.target)
e1:SetHintTiming(0,0x1c0)
c:RegisterEffect(e1)
--Draw
......@@ -38,27 +37,10 @@ end
function c78949372.filter(c)
return c:IsSetCard(0xd0) and c:IsAbleToDeck()
end
function c78949372.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return true end
if c78949372.drtg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c78949372.drop)
c78949372.drtg(e,tp,eg,ep,ev,re,r,rp,1,chkc)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(78949372,1))
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c78949372.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c78949372.filter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and e:GetHandler():GetFlagEffect(78949372)==0
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c78949372.filter,tp,LOCATION_GRAVE,0,5,nil) end
e:GetHandler():RegisterFlagEffect(78949372,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c78949372.filter,tp,LOCATION_GRAVE,0,5,5,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,5,0,0)
......
......@@ -6,7 +6,6 @@ function c81057455.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c81057455.target)
c:RegisterEffect(e1)
--pos
local e2=Effect.CreateEffect(c)
......@@ -16,6 +15,7 @@ function c81057455.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetCondition(c81057455.poscon)
e2:SetTarget(c81057455.postg)
e2:SetOperation(c81057455.posop)
......@@ -33,21 +33,6 @@ function c81057455.initial_effect(c)
e3:SetOperation(c81057455.drop)
c:RegisterEffect(e3)
end
function c81057455.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c81057455.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
if chk==0 then return true end
if c81057455.poscon(e,tp,eg,ep,ev,re,r,rp)
and c81057455.postg(e,tp,eg,ep,ev,re,r,rp,0)
and Duel.SelectYesNo(tp,94) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c81057455.posop)
c81057455.postg(e,tp,eg,ep,ev,re,r,rp,1)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,65)
else
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c81057455.poscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(0x37)<3
end
......@@ -56,12 +41,10 @@ function c81057455.filter(c)
end
function c81057455.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c81057455.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c81057455.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and e:GetHandler():GetFlagEffect(81057455)==0 end
if chk==0 then return Duel.IsExistingTarget(c81057455.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c81057455.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
e:GetHandler():RegisterFlagEffect(81057455,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c81057455.posop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
......
......@@ -5,8 +5,6 @@ function c81443745.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c81443745.target1)
e1:SetOperation(c81443745.operation)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
......@@ -16,43 +14,27 @@ function c81443745.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCost(c81443745.cost2)
e2:SetTarget(c81443745.target2)
e2:SetCountLimit(1)
e2:SetCost(c81443745.cost)
e2:SetTarget(c81443745.target)
e2:SetOperation(c81443745.operation)
c:RegisterEffect(e2)
end
function c81443745.cfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToGraveAsCost()
end
function c81443745.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return true end
if Duel.IsExistingMatchingCard(c81443745.cfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(81443745,1)) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local cg=Duel.SelectMatchingCard(tp,c81443745.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(cg,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
e:GetHandler():RegisterFlagEffect(81443745,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
else e:SetProperty(0) end
end
function c81443745.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
function c81443745.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c81443745.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local cg=Duel.SelectMatchingCard(tp,c81443745.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(cg,REASON_COST)
end
function c81443745.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c81443745.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return e:GetHandler():GetFlagEffect(81443745)==0
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
e:GetHandler():RegisterFlagEffect(81443745,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c81443745.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
......
......@@ -4,8 +4,6 @@ function c83319610.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c83319610.mttg1)
e1:SetOperation(c83319610.mtop)
c:RegisterEffect(e1)
--material
local e2=Effect.CreateEffect(c)
......@@ -14,10 +12,9 @@ function c83319610.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCost(c83319610.mtcost)
e2:SetTarget(c83319610.mttg2)
e2:SetCountLimit(1)
e2:SetTarget(c83319610.mttg)
e2:SetOperation(c83319610.mtop)
e2:SetLabel(1)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
......@@ -39,33 +36,14 @@ end
function c83319610.filter2(c,e)
return c:IsSetCard(0x58) and c:IsType(TYPE_MONSTER) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and not c:IsImmuneToEffect(e)
end
function c83319610.mttg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c83319610.filter1(chkc,e,tp) end
if chk==0 then return true end
if Duel.IsExistingTarget(c83319610.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(83319610,2)) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:GetHandler():RegisterFlagEffect(83319610,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c83319610.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
e:SetLabel(1)
else
e:SetProperty(0)
e:SetLabel(0)
end
end
function c83319610.mtcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(83319610)==0 end
e:GetHandler():RegisterFlagEffect(83319610,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c83319610.mttg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c83319610.mttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c83319610.filter1(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c83319610.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c83319610.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
end
function c83319610.mtop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
......
......@@ -5,8 +5,6 @@ function c83407038.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c83407038.target1)
e1:SetOperation(c83407038.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
......@@ -18,7 +16,7 @@ function c83407038.initial_effect(c)
e2:SetCountLimit(1)
e2:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END)
e2:SetCondition(c83407038.condition)
e2:SetTarget(c83407038.target2)
e2:SetTarget(c83407038.target)
e2:SetOperation(c83407038.operation)
c:RegisterEffect(e2)
--destroy
......@@ -43,19 +41,6 @@ function c83407038.initial_effect(c)
e4:SetOperation(c83407038.spop)
c:RegisterEffect(e4)
end
function c83407038.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ph=Duel.GetCurrentPhase()
if ((ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE))
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c83407038.filter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,94) then
e:GetHandler():RegisterFlagEffect(83407038,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,65)
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
end
function c83407038.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)
......@@ -63,16 +48,14 @@ end
function c83407038.filter(c,e,tp)
return c:IsSetCard(0x4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c83407038.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(83407038)==0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
function c83407038.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c83407038.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
e:GetHandler():RegisterFlagEffect(83407038,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c83407038.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(83407038)==0 or not c:IsRelateToEffect(e) then return end
if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c83407038.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst()
......
......@@ -5,7 +5,6 @@ function c92266279.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c92266279.target)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
......@@ -35,41 +34,9 @@ function c92266279.initial_effect(c)
e3:SetOperation(c92266279.recop)
c:RegisterEffect(e3)
end
function c92266279.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local b1=c92266279.thcost(e,tp,eg,ep,ev,re,r,rp,0) and c92266279.thtg(e,tp,eg,ep,ev,re,r,rp,0)
local b2=c92266279.reccon(e,tp,eg,ep,ev,re,r,rp) and c92266279.rectg(e,tp,eg,ep,ev,re,r,rp,0)
if (b1 or b2) and Duel.SelectYesNo(tp,94) then
local opt=0
if b1 and b2 then
opt=Duel.SelectOption(tp,aux.Stringid(92266279,1),aux.Stringid(92266279,2))
elseif b1 then
opt=Duel.SelectOption(tp,aux.Stringid(92266279,1))
else
opt=Duel.SelectOption(tp,aux.Stringid(92266279,2))+1
end
if opt==0 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e:SetProperty(0)
e:SetOperation(c92266279.thop)
c92266279.thcost(e,tp,eg,ep,ev,re,r,rp,1)
c92266279.thtg(e,tp,eg,ep,ev,re,r,rp,1)
else
e:SetCategory(CATEGORY_RECOVER)
e:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e:SetOperation(c92266279.recop)
c92266279.rectg(e,tp,eg,ep,ev,re,r,rp,1)
end
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c92266279.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) and Duel.GetFlagEffect(tp,92266279)==0 end
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
Duel.RegisterFlagEffect(tp,92266279,RESET_PHASE+PHASE_END,0,1)
end
function c92266279.thfilter(c)
return c:IsSetCard(0xc9) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
......@@ -91,11 +58,10 @@ function c92266279.reccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<Duel.GetLP(1-tp)
end
function c92266279.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,92266280)==0 end
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,500)
Duel.RegisterFlagEffect(tp,92266280,RESET_PHASE+PHASE_END,0,1)
end
function c92266279.recop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
......
......@@ -4,8 +4,6 @@ function c92773018.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c92773018.target1)
e1:SetOperation(c92773018.activate)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
......@@ -17,7 +15,7 @@ function c92773018.initial_effect(c)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCondition(c92773018.condition)
e2:SetCost(c92773018.cost)
e2:SetTarget(c92773018.target2)
e2:SetTarget(c92773018.target)
e2:SetOperation(c92773018.activate)
c:RegisterEffect(e2)
end
......@@ -33,27 +31,7 @@ function c92773018.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,c92773018.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c92773018.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc==Duel.GetAttacker() end
if chk==0 then return true end
local tg=Duel.GetAttacker()
if Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) and tp~=Duel.GetTurnPlayer()
and Duel.IsExistingMatchingCard(c92773018.cfilter,tp,LOCATION_MZONE,0,1,nil)
and tg:IsOnField() and tg:IsCanBeEffectTarget(e)
and Duel.SelectYesNo(tp,aux.Stringid(92773018,1)) then
e:SetCategory(CATEGORY_DESTROY)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c92773018.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0)
else
e:SetCategory(0)
e:SetProperty(0)
end
end
function c92773018.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c92773018.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Duel.GetAttacker()
if chkc then return chkc==tg end
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING)
......
......@@ -5,7 +5,6 @@ function c94212438.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c94212438.target)
c:RegisterEffect(e1)
--place card
local e2=Effect.CreateEffect(c)
......@@ -16,7 +15,6 @@ function c94212438.initial_effect(c)
e2:SetCountLimit(1)
e2:SetLabel(94212438)
e2:SetCondition(c94212438.plcon)
e2:SetTarget(c94212438.pltg)
e2:SetOperation(c94212438.plop)
c:RegisterEffect(e2)
--tograve
......@@ -41,24 +39,9 @@ function c94212438.initial_effect(c)
e5:SetOperation(c94212438.winop)
c:RegisterEffect(e5)
end
function c94212438.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.GetCurrentPhase()==PHASE_END and c94212438.plcon(e,tp,eg,ep,ev,re,r,rp) and Duel.SelectYesNo(tp,94) then
e:SetLabel(94212438)
e:SetOperation(c94212438.plop)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,65)
e:GetHandler():RegisterFlagEffect(94212439,RESET_PHASE+PHASE_END,0,1)
else
e:SetLabel(0)
e:SetOperation(nil)
end
end
function c94212438.plcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and e:GetHandler():GetFlagEffect(94212438)<4
end
function c94212438.pltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(94212439)==0 end
end
function c94212438.plop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
......
......@@ -6,8 +6,6 @@ function c94432298.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_STANDBY_PHASE,0)
e1:SetTarget(c94432298.tgtg1)
e1:SetOperation(c94432298.tgop)
c:RegisterEffect(e1)
--tograve
local e2=Effect.CreateEffect(c)
......@@ -17,8 +15,7 @@ function c94432298.initial_effect(c)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCountLimit(1)
e2:SetCondition(c94432298.tgcon)
e2:SetCost(c94432298.tgcost)
e2:SetTarget(c94432298.tgtg2)
e2:SetTarget(c94432298.tgtg)
e2:SetOperation(c94432298.tgop)
c:RegisterEffect(e2)
--tograve
......@@ -30,35 +27,18 @@ function c94432298.initial_effect(c)
e3:SetCondition(c94432298.sdcon)
c:RegisterEffect(e3)
end
function c94432298.tgtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY
and Duel.IsExistingMatchingCard(c94432298.filter,tp,LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_TOGRAVE)
e:GetHandler():RegisterFlagEffect(94432298,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(94432298,1))
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
else
e:SetCategory(0)
end
end
function c94432298.tgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c94432298.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(94432298)==0 end
e:GetHandler():RegisterFlagEffect(94432298,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c94432298.filter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c94432298.tgtg2(e,tp,eg,ep,ev,re,r,rp,chk)
function c94432298.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c94432298.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c94432298.tgop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(94432298)==0 then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c94432298.filter,tp,LOCATION_DECK,0,1,2,nil)
if g:GetCount()>0 then
......
......@@ -4,8 +4,6 @@ function c94804055.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c94804055.target1)
e1:SetOperation(c94804055.operation)
c:RegisterEffect(e1)
--quick
local e2=Effect.CreateEffect(c)
......@@ -14,10 +12,9 @@ function c94804055.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetLabel(1)
e2:SetCondition(c94804055.condition)
e2:SetCost(c94804055.cost)
e2:SetTarget(c94804055.target2)
e2:SetTarget(c94804055.target)
e2:SetOperation(c94804055.operation)
c:RegisterEffect(e2)
--maintain
......@@ -34,31 +31,9 @@ end
function c94804055.cfilter(c)
return c:IsRace(RACE_PYRO) and c:IsAbleToRemoveAsCost()
end
function c94804055.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return true end
if Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) then
local a=Duel.GetAttacker()
if a:IsControler(1-tp) and Duel.GetAttackTarget()==nil
and Duel.IsExistingMatchingCard(c94804055.cfilter,tp,LOCATION_GRAVE,0,1,nil)
and a:IsOnField() and a:IsCanBeEffectTarget(e) and Duel.SelectYesNo(tp,aux.Stringid(94804055,1)) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetLabel(1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c94804055.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.SetTargetCard(a)
end
else
e:SetProperty(0)
e:SetLabel(0)
end
end
function c94804055.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()==1 then
Duel.NegateAttack()
end
Duel.NegateAttack()
end
function c94804055.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil and not e:GetHandler():IsStatus(STATUS_CHAINING)
......@@ -69,7 +44,7 @@ function c94804055.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,c94804055.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c94804055.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c94804055.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Duel.GetAttacker()
if chkc then return false end
if chk==0 then return tg:IsOnField() and tg:IsCanBeEffectTarget(e) end
......
......@@ -4,8 +4,6 @@ function c96015976.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c96015976.target1)
e1:SetOperation(c96015976.operation)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
......@@ -14,39 +12,23 @@ function c96015976.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCost(c96015976.cost)
e2:SetTarget(c96015976.target2)
e2:SetCountLimit(1)
e2:SetTarget(c96015976.target)
e2:SetOperation(c96015976.operation)
c:RegisterEffect(e2)
end
function c96015976.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c96015976.filter(chkc) end
if chk==0 then return true end
if Duel.IsExistingTarget(c96015976.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,94) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c96015976.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
e:GetHandler():RegisterFlagEffect(96015976,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
else
e:SetProperty(0)
end
end
function c96015976.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(96015976)==0 end
e:GetHandler():RegisterFlagEffect(96015976,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c96015976.filter(c)
local lv=c:GetLevel()
return c:IsFaceup() and lv~=0 and lv~=c:GetOriginalLevel()
end
function c96015976.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c96015976.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c96015976.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c96015976.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c96015976.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c96015976.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(96015976)==0 then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local dc=Duel.TossDice(tp,1)
......
......@@ -6,7 +6,6 @@ function c96100333.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetTarget(c96100333.target)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
......@@ -17,7 +16,8 @@ function c96100333.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,0x1e0)
e2:SetCost(c96100333.cost)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetCost(c96100333.descost)
e2:SetTarget(c96100333.destg)
e2:SetOperation(c96100333.desop)
c:RegisterEffect(e2)
......@@ -30,6 +30,7 @@ function c96100333.initial_effect(c)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetHintTiming(0,0x1e0)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetTarget(c96100333.sptg)
e3:SetOperation(c96100333.spop)
c:RegisterEffect(e3)
......@@ -42,6 +43,7 @@ function c96100333.initial_effect(c)
e4:SetRange(LOCATION_SZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetHintTiming(0,0x1e0)
e4:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e4:SetTarget(c96100333.tdtg)
e4:SetOperation(c96100333.tdop)
c:RegisterEffect(e4)
......@@ -49,13 +51,11 @@ end
function c96100333.cfilter(c)
return (c:IsRace(RACE_ROCK) or c:IsType(TYPE_FIELD)) and c:IsAbleToRemoveAsCost()
end
function c96100333.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(96100333)==0
and Duel.IsExistingMatchingCard(c96100333.cfilter,tp,LOCATION_GRAVE,0,2,nil) end
function c96100333.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c96100333.cfilter,tp,LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c96100333.cfilter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:GetHandler():RegisterFlagEffect(96100333,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c96100333.desfilter(c)
return c:IsFaceup()
......@@ -89,8 +89,7 @@ function c96100333.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c96100333.spfilter(chkc,e,tp) end
local cg=Duel.GetMatchingGroup(c96100333.cfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Duel.GetMatchingGroup(c96100333.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return e:GetHandler():GetFlagEffect(96100333)==0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and cg:IsExists(c96100333.spcfilter1,1,nil,cg,sg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=cg:FilterSelect(tp,c96100333.spcfilter1,1,1,nil,cg,sg)
......@@ -104,7 +103,6 @@ function c96100333.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=sg:Select(tp,1,1,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
e:GetHandler():RegisterFlagEffect(96100333,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c96100333.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
......@@ -128,8 +126,7 @@ function c96100333.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c96100333.tdfilter(chkc) end
local cg=Duel.GetMatchingGroup(c96100333.cfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Duel.GetMatchingGroup(c96100333.tdfilter,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return e:GetHandler():GetFlagEffect(96100333)==0
and Duel.IsPlayerCanDraw(tp,1)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and cg:IsExists(c96100333.tdcfilter1,1,nil,cg,sg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=cg:FilterSelect(tp,c96100333.tdcfilter1,1,1,nil,cg,sg)
......@@ -144,7 +141,6 @@ function c96100333.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
e:GetHandler():RegisterFlagEffect(96100333,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c96100333.tdop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
......@@ -159,57 +155,3 @@ function c96100333.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c96100333.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
if e:GetLabel()==1 then return c96100333.destg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
elseif e:GetLabel()==2 then return c96100333.sptg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
else return c96100333.tdtg(e,tp,eg,ep,ev,re,r,rp,0,chkc) end
end
if chk==0 then return true end
local b1=c96100333.cost(e,tp,eg,ep,ev,re,r,rp,0)
and c96100333.destg(e,tp,eg,ep,ev,re,r,rp,0)
local b2=c96100333.sptg(e,tp,eg,ep,ev,re,r,rp,0)
local b3=c96100333.tdtg(e,tp,eg,ep,ev,re,r,rp,0)
if (b1 or b2 or b3) and Duel.SelectYesNo(tp,94) then
local ops={}
local opval={}
local off=1
if b1 then
ops[off]=aux.Stringid(96100333,1)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(96100333,2)
opval[off-1]=2
off=off+1
end
if b3 then
ops[off]=aux.Stringid(96100333,3)
opval[off-1]=3
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))
local sel=opval[op]
e:SetLabel(sel)
if sel==1 then
c96100333.cost(e,tp,eg,ep,ev,re,r,rp,1)
c96100333.destg(e,tp,eg,ep,ev,re,r,rp,1)
e:SetCategory(CATEGORY_DESTROY)
e:SetOperation(c96100333.desop)
elseif sel==2 then
c96100333.sptg(e,tp,eg,ep,ev,re,r,rp,1)
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetOperation(c96100333.spop)
else
c96100333.tdtg(e,tp,eg,ep,ev,re,r,rp,1)
e:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e:SetOperation(c96100333.tdop)
end
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
end
......@@ -7,8 +7,6 @@ function c9765723.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(0,0x1e0+TIMING_DAMAGE_STEP)
e1:SetCondition(c9765723.condition)
e1:SetTarget(c9765723.target)
e1:SetOperation(c9765723.operation)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
......@@ -43,7 +41,6 @@ function c9765723.initial_effect(c)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetCondition(c9765723.damcon)
e4:SetCost(c9765723.damcost)
e4:SetTarget(c9765723.damtg)
e4:SetOperation(c9765723.damop)
c:RegisterEffect(e4)
......@@ -51,60 +48,12 @@ end
function c9765723.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c9765723.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return true end
local ph=Duel.GetCurrentPhase()
local b1=Duel.GetFlagEffect(tp,9765723)==0
and Duel.IsExistingMatchingCard(c9765723.cfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local b2=Duel.GetTurnPlayer()==tp and ph==PHASE_STANDBY
if (b1 or b2) and ph~=PHASE_DAMAGE and Duel.SelectYesNo(tp,94) then
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(9765723,0),aux.Stringid(9765723,1))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(9765723,0))
else op=Duel.SelectOption(tp,aux.Stringid(9765723,1))+1 end
e:SetLabel(op)
if op==0 then
e:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
Duel.DiscardHand(tp,c9765723.cfilter,1,1,REASON_COST)
Duel.RegisterFlagEffect(tp,9765723,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
else
e:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e:GetHandler():RegisterFlagEffect(9765723,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,tp,1000)
end
else
e:SetLabel(2)
e:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
end
end
function c9765723.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local op=e:GetLabel()
if op==0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
elseif op==1 then
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
end
function c9765723.cfilter(c)
return (c:IsSetCard(0xaf) or c:IsSetCard(0xae)) and c:IsAbleToGraveAsCost()
end
function c9765723.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,9765723)==0
and Duel.IsExistingMatchingCard(c9765723.cfilter,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c9765723.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c9765723.cfilter,1,1,REASON_COST)
Duel.RegisterFlagEffect(tp,9765723,RESET_PHASE+PHASE_END,0,1)
end
function c9765723.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
......@@ -129,10 +78,6 @@ end
function c9765723.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c9765723.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(9765723)==0 end
e:GetHandler():RegisterFlagEffect(9765723,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c9765723.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
......
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