Commit 0b7ea09d authored by Uytrewq's avatar Uytrewq Committed by GitHub

fix&update continuous traps (#2330)

* fix&update

* fix
parent 6c0a7dd0
...@@ -2,26 +2,22 @@ ...@@ -2,26 +2,22 @@
function c10131855.initial_effect(c) function c10131855.initial_effect(c)
--activate --activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10131855,0))
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--instant(chain) --replace effect
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10131855,1)) e2:SetDescription(aux.Stringid(10131855,1))
e2:SetCategory(CATEGORY_TOHAND) e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_ACTIVATE) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_CHAINING) e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN) e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c10131855.condition) e2:SetCondition(c10131855.condition)
e2:SetTarget(c10131855.target) e2:SetTarget(c10131855.target)
e2:SetOperation(c10131855.operation) e2:SetOperation(c10131855.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE)
c:RegisterEffect(e3)
end end
function c10131855.repop(e,tp,eg,ep,ev,re,r,rp) function c10131855.repop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND) local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
......
...@@ -5,8 +5,6 @@ function c3160805.initial_effect(c) ...@@ -5,8 +5,6 @@ function c3160805.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c3160805.target1)
e1:SetOperation(c3160805.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--instant --instant
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -16,8 +14,8 @@ function c3160805.initial_effect(c) ...@@ -16,8 +14,8 @@ function c3160805.initial_effect(c)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE) e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCost(c3160805.cost2) e2:SetCountLimit(1,3160805)
e2:SetTarget(c3160805.target2) e2:SetTarget(c3160805.target)
e2:SetOperation(c3160805.operation) e2:SetOperation(c3160805.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
...@@ -35,27 +33,23 @@ end ...@@ -35,27 +33,23 @@ end
function c3160805.thfilter2(c,lv) function c3160805.thfilter2(c,lv)
return c:IsLevel(lv) and c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToHand() return c:IsLevel(lv) and c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToHand()
end end
function c3160805.target1(e,tp,eg,ep,ev,re,r,rp,chk) function c3160805.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local b1=Duel.IsExistingMatchingCard(c3160805.tgfilter1,tp,LOCATION_HAND,0,1,nil,tp) local b1=Duel.IsExistingMatchingCard(c3160805.tgfilter1,tp,LOCATION_HAND,0,1,nil,tp)
local b2=Duel.IsExistingMatchingCard(c3160805.tgfilter2,tp,LOCATION_HAND,0,1,nil,tp) local b2=Duel.IsExistingMatchingCard(c3160805.tgfilter2,tp,LOCATION_HAND,0,1,nil,tp)
local op=2 if chk==0 then return b1 or b2 end
if Duel.GetFlagEffect(tp,3160805)==0 and (b1 or b2) and Duel.SelectYesNo(tp,aux.Stringid(3160805,1)) then local op=0
if b1 and b2 then if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(3160805,2),aux.Stringid(3160805,3)) op=Duel.SelectOption(tp,aux.Stringid(3160805,2),aux.Stringid(3160805,3))
elseif b1 then elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(3160805,2)) op=Duel.SelectOption(tp,aux.Stringid(3160805,2))
else else
op=Duel.SelectOption(tp,aux.Stringid(3160805,3))+1 op=Duel.SelectOption(tp,aux.Stringid(3160805,3))+1
end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.RegisterFlagEffect(tp,3160805,RESET_PHASE+PHASE_END,0,1)
end end
e:SetLabel(op) e:SetLabel(op)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c3160805.operation(e,tp,eg,ep,ev,re,r,rp) function c3160805.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==2 or not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()==0 then if e:GetLabel()==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c3160805.tgfilter1,tp,LOCATION_HAND,0,1,1,nil,tp) local g=Duel.SelectMatchingCard(tp,c3160805.tgfilter1,tp,LOCATION_HAND,0,1,1,nil,tp)
...@@ -78,23 +72,3 @@ function c3160805.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -78,23 +72,3 @@ function c3160805.operation(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function c3160805.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,3160805)==0 end
Duel.RegisterFlagEffect(tp,3160805,RESET_PHASE+PHASE_END,0,1)
end
function c3160805.target2(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c3160805.tgfilter1,tp,LOCATION_HAND,0,1,nil,tp)
local b2=Duel.IsExistingMatchingCard(c3160805.tgfilter2,tp,LOCATION_HAND,0,1,nil,tp)
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(3160805,2),aux.Stringid(3160805,3))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(3160805,2))
else
op=Duel.SelectOption(tp,aux.Stringid(3160805,3))+1
end
e:SetLabel(op)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
...@@ -4,58 +4,30 @@ function c35011819.initial_effect(c) ...@@ -4,58 +4,30 @@ function c35011819.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c35011819.target1)
e1:SetOperation(c35011819.activate1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--instant --draw
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(35011819,0)) e2:SetDescription(aux.Stringid(35011819,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DRAW) e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_CHAINING) e2:SetCode(EVENT_CHAINING)
e2:SetCondition(c35011819.condition2) e2:SetCondition(c35011819.condition)
e2:SetTarget(c35011819.target2) e2:SetTarget(c35011819.target)
e2:SetOperation(c35011819.activate2) e2:SetOperation(c35011819.activate)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c35011819.target1(e,tp,eg,ep,ev,re,r,rp,chk) function c35011819.condition(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return true end
e:SetLabel(0)
local ct=Duel.GetCurrentChain()
if ct==1 then return end
local ct=Duel.GetCurrentChain()
local te=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
if te:GetCode()==EVENT_SUMMON_SUCCESS and te:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ct-1)
and Duel.IsPlayerCanDraw(tc:GetControler(),1) and Duel.SelectYesNo(tp,aux.Stringid(35011819,1)) then
e:SetLabel(1)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,tc,1,0,0)
Duel.SetTargetPlayer(tc:GetControler())
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tc:GetControler(),1)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(35011819,2))
end
end
function c35011819.activate1(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()~=1 then return end
local c=e:GetHandler()
local ct=Duel.GetChainInfo(0,CHAININFO_CHAIN_COUNT)
Duel.NegateActivation(ct-1)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c35011819.condition2(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and re:GetCode()==EVENT_SUMMON_SUCCESS and Duel.IsChainNegatable(ev) return re:IsActiveType(TYPE_MONSTER) and re:GetCode()==EVENT_SUMMON_SUCCESS and Duel.IsChainNegatable(ev)
end end
function c35011819.target2(e,tp,eg,ep,ev,re,r,rp,chk) function c35011819.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(rp,1) end if chk==0 then return Duel.IsPlayerCanDraw(rp,1) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetTargetPlayer(rp) Duel.SetTargetPlayer(rp)
Duel.SetTargetParam(1) Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,rp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,rp,1)
end end
function c35011819.activate2(e,tp,eg,ep,ev,re,r,rp) function c35011819.activate(e,tp,eg,ep,ev,re,r,rp)
if not Duel.NegateActivation(ev) then return end if not Duel.NegateActivation(ev) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT) Duel.Draw(p,d,REASON_EFFECT)
......
...@@ -5,10 +5,8 @@ function c35419032.initial_effect(c) ...@@ -5,10 +5,8 @@ function c35419032.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c35419032.target1)
e1:SetOperation(c35419032.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--instant(chain) --to hand
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(35419032,0)) e2:SetDescription(aux.Stringid(35419032,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
...@@ -16,9 +14,9 @@ function c35419032.initial_effect(c) ...@@ -16,9 +14,9 @@ function c35419032.initial_effect(c)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE) e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetLabel(1) e2:SetCountLimit(1)
e2:SetCost(c35419032.cost2) e2:SetCost(c35419032.cost)
e2:SetTarget(c35419032.target2) e2:SetTarget(c35419032.target)
e2:SetOperation(c35419032.operation) e2:SetOperation(c35419032.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
...@@ -28,36 +26,7 @@ end ...@@ -28,36 +26,7 @@ end
function c35419032.afilter(c) function c35419032.afilter(c)
return c:IsSetCard(0xa) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsSetCard(0xa) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function c35419032.target1(e,tp,eg,ep,ev,re,r,rp,chk) function c35419032.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.IsExistingMatchingCard(c35419032.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c35419032.afilter,tp,LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(35419032,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c35419032.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if g:GetFirst():IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,g)
end
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e:SetLabel(1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
e:GetHandler():RegisterFlagEffect(35419032,RESET_PHASE+PHASE_END,0,1)
else
e:SetCategory(0)
e:SetLabel(0)
end
end
function c35419032.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c35419032.afilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c35419032.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c35419032.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c35419032.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c35419032.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c35419032.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
...@@ -66,9 +35,15 @@ function c35419032.cost2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -66,9 +35,15 @@ function c35419032.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
end end
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST) Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end end
function c35419032.target2(e,tp,eg,ep,ev,re,r,rp,chk) function c35419032.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(35419032)==0 if chk==0 then return Duel.IsExistingMatchingCard(c35419032.afilter,tp,LOCATION_DECK,0,1,nil) end
and Duel.IsExistingMatchingCard(c35419032.afilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
e:GetHandler():RegisterFlagEffect(35419032,RESET_PHASE+PHASE_END,0,1) end
function c35419032.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c35419032.afilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end end
...@@ -6,8 +6,6 @@ function c48680970.initial_effect(c) ...@@ -6,8 +6,6 @@ function c48680970.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c48680970.target1)
e1:SetOperation(c48680970.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--instant --instant
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -15,8 +13,8 @@ function c48680970.initial_effect(c) ...@@ -15,8 +13,8 @@ function c48680970.initial_effect(c)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE) e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCost(c48680970.cost2) e2:SetCountLimit(1,48680970)
e2:SetTarget(c48680970.target2) e2:SetTarget(c48680970.target)
e2:SetOperation(c48680970.operation) e2:SetOperation(c48680970.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--immune effect --immune effect
...@@ -44,34 +42,29 @@ end ...@@ -44,34 +42,29 @@ end
function c48680970.filter2(c) function c48680970.filter2(c)
return c:IsCode(2314238,63391643) and c:IsAbleToHand() return c:IsCode(2314238,63391643) and c:IsAbleToHand()
end end
function c48680970.target1(e,tp,eg,ep,ev,re,r,rp,chk) function c48680970.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c48680970.filter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(c48680970.filter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(c48680970.filter2,tp,LOCATION_DECK,0,1,nil) local b2=Duel.IsExistingMatchingCard(c48680970.filter2,tp,LOCATION_DECK,0,1,nil)
local op=2 if chk==0 then return b1 or b2 end
e:SetCategory(0) local op=0
if Duel.GetFlagEffect(tp,48680970)==0 and (b1 or b2) and Duel.SelectYesNo(tp,aux.Stringid(48680970,0)) then if b1 and b2 then
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(48680970,1),aux.Stringid(48680970,2))
op=Duel.SelectOption(tp,aux.Stringid(48680970,1),aux.Stringid(48680970,2)) elseif b1 then
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(48680970,1))
op=Duel.SelectOption(tp,aux.Stringid(48680970,1)) else
else op=Duel.SelectOption(tp,aux.Stringid(48680970,2))+1
op=Duel.SelectOption(tp,aux.Stringid(48680970,2))+1
end
if op==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
else
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
Duel.RegisterFlagEffect(tp,48680970,RESET_PHASE+PHASE_END,0,1)
end end
e:SetLabel(op) e:SetLabel(op)
if op==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
else
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
end end
function c48680970.operation(e,tp,eg,ep,ev,re,r,rp) function c48680970.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==2 or not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()==0 then if e:GetLabel()==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
...@@ -88,32 +81,6 @@ function c48680970.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -88,32 +81,6 @@ function c48680970.operation(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function c48680970.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,48680970)==0 end
Duel.RegisterFlagEffect(tp,48680970,RESET_PHASE+PHASE_END,0,1)
end
function c48680970.target2(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c48680970.filter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(c48680970.filter2,tp,LOCATION_DECK,0,1,nil)
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(48680970,1),aux.Stringid(48680970,2))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(48680970,1))
else
op=Duel.SelectOption(tp,aux.Stringid(48680970,2))+1
end
e:SetLabel(op)
if op==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
else
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
end
function c48680970.etarget(e,c) function c48680970.etarget(e,c)
return c:IsCode(46986414) return c:IsCode(46986414)
end end
......
...@@ -5,77 +5,76 @@ function c53670497.initial_effect(c) ...@@ -5,77 +5,76 @@ function c53670497.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c53670497.target1)
e1:SetOperation(c53670497.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--instant --to grave
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(53670497,1)) e2:SetDescription(aux.Stringid(53670497,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE) e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetLabel(1) e2:SetCountLimit(1)
e2:SetTarget(c53670497.target2) e2:SetCondition(c53670497.condition1)
e2:SetOperation(c53670497.activate) e2:SetTarget(c53670497.target1)
e2:SetOperation(c53670497.activate1)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--spsummmon --return grave
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(53670497,2)) e3:SetDescription(aux.Stringid(53670497,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_TO_GRAVE) e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c53670497.spcon) e3:SetCode(EVENT_FREE_CHAIN)
e3:SetTarget(c53670497.sptg) e3:SetCountLimit(1)
e3:SetOperation(c53670497.spop) e3:SetCondition(c53670497.condition2)
e3:SetTarget(c53670497.target2)
e3:SetOperation(c53670497.activate2)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--spsummmon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(53670497,2))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(c53670497.spcon)
e4:SetTarget(c53670497.sptg)
e4:SetOperation(c53670497.spop)
c:RegisterEffect(e4)
end
function c53670497.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp)
end end
function c53670497.filter1(c) function c53670497.filter1(c)
return c:IsSetCard(0x69) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() return c:IsSetCard(0x69) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end end
function c53670497.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c53670497.filter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c53670497.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c53670497.filter1,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_EFFECT)
end
function c53670497.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(tp)
end
function c53670497.filter2(c) function c53670497.filter2(c)
return c:IsFaceup() and c:IsSetCard(0x69) and c:IsType(TYPE_MONSTER) return c:IsFaceup() and c:IsSetCard(0x69) and c:IsType(TYPE_MONSTER)
end end
function c53670497.target1(e,tp,eg,ep,ev,re,r,rp,chk) function c53670497.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c53670497.filter2(chkc) end
e:SetLabel(0) if chk==0 then return Duel.IsExistingTarget(c53670497.filter2,tp,LOCATION_REMOVED,0,1,nil) end
local turnp=Duel.GetTurnPlayer() Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(53670497,3))
if ((turnp~=tp and Duel.IsExistingMatchingCard(c53670497.filter1,tp,LOCATION_DECK,0,1,nil)) local g=Duel.SelectTarget(tp,c53670497.filter2,tp,LOCATION_REMOVED,0,1,1,nil)
or (turnp==tp and Duel.IsExistingMatchingCard(c53670497.filter2,tp,LOCATION_REMOVED,0,1,nil))) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
and Duel.SelectYesNo(tp,aux.Stringid(53670497,0)) then
if turnp==tp then
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_REMOVED)
else
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
e:SetLabel(1)
e:GetHandler():RegisterFlagEffect(53670497,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function c53670497.target2(e,tp,eg,ep,ev,re,r,rp,chk)
local turnp=Duel.GetTurnPlayer()
if chk==0 then return e:GetHandler():GetFlagEffect(53670497)==0
and ((turnp~=tp and Duel.IsExistingMatchingCard(c53670497.filter1,tp,LOCATION_DECK,0,1,nil))
or (turnp==tp and Duel.IsExistingMatchingCard(c53670497.filter2,tp,LOCATION_REMOVED,0,1,nil))) end
if turnp==tp then
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_REMOVED)
else
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
e:GetHandler():RegisterFlagEffect(53670497,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end end
function c53670497.activate(e,tp,eg,ep,ev,re,r,rp) function c53670497.activate2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local tc=Duel.GetFirstTarget()
if e:GetLabel()~=1 or not c:IsRelateToEffect(e) then return end if tc:IsRelateToChain() then
local turnp=Duel.GetTurnPlayer() Duel.SendtoGrave(tc,REASON_EFFECT+REASON_RETURN)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
if turnp~=tp then
local g=Duel.SelectMatchingCard(tp,c53670497.filter1,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_EFFECT)
else
local g=Duel.SelectMatchingCard(tp,c53670497.filter2,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_RETURN)
end end
end end
function c53670497.spcon(e,tp,eg,ep,ev,re,r,rp) function c53670497.spcon(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -5,10 +5,8 @@ function c53936268.initial_effect(c) ...@@ -5,10 +5,8 @@ function c53936268.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c53936268.target1)
e1:SetOperation(c53936268.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--instant(chain) --to hand
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(53936268,0)) e2:SetDescription(aux.Stringid(53936268,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
...@@ -16,8 +14,9 @@ function c53936268.initial_effect(c) ...@@ -16,8 +14,9 @@ function c53936268.initial_effect(c)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE) e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1)
e2:SetCost(c53936268.cost) e2:SetCost(c53936268.cost)
e2:SetTarget(c53936268.target2) e2:SetTarget(c53936268.target)
e2:SetOperation(c53936268.operation) e2:SetOperation(c53936268.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
...@@ -27,30 +26,6 @@ end ...@@ -27,30 +26,6 @@ end
function c53936268.thfilter(c) function c53936268.thfilter(c)
return c:IsSetCard(0x103) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsSetCard(0x103) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function c53936268.target1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
if c53936268.cost(e,tp,eg,ep,ev,re,r,rp,0)
and Duel.IsExistingMatchingCard(c53936268.thfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,94) then
c53936268.cost(e,tp,eg,ep,ev,re,r,rp,1)
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
c:RegisterFlagEffect(53936268,RESET_PHASE+PHASE_END,0,1)
c:RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,65)
else
e:SetCategory(0)
end
end
function c53936268.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(53936268)==0 or not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c53936268.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c53936268.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c53936268.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c53936268.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(c53936268.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
...@@ -60,9 +35,16 @@ function c53936268.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -60,9 +35,16 @@ function c53936268.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST) Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end end
function c53936268.target2(e,tp,eg,ep,ev,re,r,rp,chk) function c53936268.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(53936268)==0 if chk==0 then return Duel.IsExistingMatchingCard(c53936268.thfilter,tp,LOCATION_DECK,0,1,nil) end
and Duel.IsExistingMatchingCard(c53936268.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
e:GetHandler():RegisterFlagEffect(53936268,RESET_PHASE+PHASE_END,0,1)
end end
function c53936268.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c53936268.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
...@@ -5,19 +5,17 @@ function c6733059.initial_effect(c) ...@@ -5,19 +5,17 @@ function c6733059.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetCost(c6733059.cost1)
e1:SetOperation(c6733059.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--instant(chain) --destroy
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(6733059,1)) e2:SetDescription(aux.Stringid(6733059,1))
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCategory(CATEGORY_DESTROY) e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e2:SetCost(c6733059.cost2) e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCost(c6733059.cost)
e2:SetOperation(c6733059.operation) e2:SetOperation(c6733059.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
...@@ -27,34 +25,7 @@ end ...@@ -27,34 +25,7 @@ end
function c6733059.tfilter(c,lv) function c6733059.tfilter(c,lv)
return c:IsFaceup() and c:IsLevelBelow(lv) return c:IsFaceup() and c:IsLevelBelow(lv)
end end
function c6733059.cost1(e,tp,eg,ep,ev,re,r,rp,chk) function c6733059.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:SetLabel(0)
local cg=Duel.GetMatchingGroup(c6733059.cfilter,tp,LOCATION_GRAVE,0,nil)
local tg=Duel.GetMatchingGroup(c6733059.tfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,cg:GetCount())
if tg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(6733059,0)) then
local lvt={}
local tc=tg:GetFirst()
while tc do
local tlv=tc:GetLevel()
lvt[tlv]=tlv
tc=tg:GetNext()
end
local pc=1
for i=1,12 do
if lvt[i] then lvt[i]=nil lvt[pc]=i pc=pc+1 end
end
lvt[pc]=nil
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(6733059,2))
local lv=Duel.AnnounceNumber(tp,table.unpack(lvt))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=cg:Select(tp,lv,lv,nil)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0)
Duel.SetTargetParam(lv)
end
end
function c6733059.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local cg=Duel.GetMatchingGroup(c6733059.cfilter,tp,LOCATION_GRAVE,0,nil) local cg=Duel.GetMatchingGroup(c6733059.cfilter,tp,LOCATION_GRAVE,0,nil)
local tg=Duel.GetMatchingGroup(c6733059.tfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,cg:GetCount()) local tg=Duel.GetMatchingGroup(c6733059.tfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,cg:GetCount())
......
...@@ -4,75 +4,34 @@ function c92408984.initial_effect(c) ...@@ -4,75 +4,34 @@ function c92408984.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c92408984.cost1)
e1:SetTarget(c92408984.target1)
e1:SetOperation(c92408984.operation1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--instant(chain) --negate
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(92408984,0)) e2:SetDescription(aux.Stringid(92408984,0))
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_CHAINING) e2:SetCode(EVENT_CHAINING)
e2:SetCondition(c92408984.condition2) e2:SetCondition(c92408984.condition)
e2:SetCost(c92408984.cost2) e2:SetCost(c92408984.cost)
e2:SetTarget(c92408984.target2) e2:SetTarget(c92408984.target)
e2:SetOperation(c92408984.operation2) e2:SetOperation(c92408984.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c92408984.cfilter(c) function c92408984.cfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsRace(RACE_DRAGON) return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsRace(RACE_DRAGON)
end end
function c92408984.cost1(e,tp,eg,ep,ev,re,r,rp,chk) function c92408984.condition(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return true end
e:SetLabel(0)
local ct=Duel.GetCurrentChain()
if ct==1 then return end
local pe=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT)
if not pe:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
if not pe:IsHasType(EFFECT_TYPE_ACTIVATE) or not pe:IsActiveType(TYPE_TRAP) then return false end
local tg=Duel.GetChainInfo(ct-1,CHAININFO_TARGET_CARDS)
if not tg or not tg:IsExists(c92408984.cfilter,1,nil) then return false end
if not Duel.IsChainNegatable(ct-1) then return false end
if not Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) then return end
if Duel.SelectYesNo(tp,aux.Stringid(92408984,1)) then
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
e:SetLabel(1)
end
end
function c92408984.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetLabel()~=1 then return end
local ct=Duel.GetCurrentChain()
local te=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
Duel.SetOperationInfo(0,CATEGORY_DISABLE,tc,1,0,0)
if tc:IsDestructable() then
Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
end
end
function c92408984.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()~=1 then return end
local ct=Duel.GetChainInfo(0,CHAININFO_CHAIN_COUNT)
local tc=Duel.GetFirstTarget()
if Duel.NegateEffect(ct-1) and tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c92408984.condition2(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
if not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:IsActiveType(TYPE_TRAP) then return false end if not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:IsActiveType(TYPE_TRAP) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not tg or not tg:IsExists(c92408984.cfilter,1,nil) then return false end if not tg or not tg:IsExists(c92408984.cfilter,1,nil) then return false end
return Duel.IsChainNegatable(ev) return Duel.IsChainNegatable(ev)
end end
function c92408984.cost2(e,tp,eg,ep,ev,re,r,rp,chk) function c92408984.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end end
function c92408984.target2(e,tp,eg,ep,ev,re,r,rp,chk) function c92408984.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
if eg:GetFirst():IsLocation(LOCATION_ONFIELD) then if eg:GetFirst():IsLocation(LOCATION_ONFIELD) then
...@@ -80,7 +39,7 @@ function c92408984.target2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -80,7 +39,7 @@ function c92408984.target2(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end end
end end
function c92408984.operation2(e,tp,eg,ep,ev,re,r,rp) function c92408984.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT) Duel.Destroy(eg,REASON_EFFECT)
......
...@@ -4,20 +4,7 @@ function c93016201.initial_effect(c) ...@@ -4,20 +4,7 @@ function c93016201.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c93016201.cost1)
e1:SetTarget(c93016201.target1)
e1:SetOperation(c93016201.activate1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--Activate(timing)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(93016201,0))
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_SPSUMMON)
e2:SetCondition(c93016201.condition2)
e2:SetCost(c93016201.cost2)
e2:SetTarget(c93016201.target2)
e2:SetOperation(c93016201.activate2)
c:RegisterEffect(e2)
--instant --instant
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(93016201,0)) e3:SetDescription(aux.Stringid(93016201,0))
...@@ -25,7 +12,7 @@ function c93016201.initial_effect(c) ...@@ -25,7 +12,7 @@ function c93016201.initial_effect(c)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_BOTH_SIDE) e3:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e3:SetCode(EVENT_SPSUMMON) e3:SetCode(EVENT_SPSUMMON)
e3:SetCondition(c93016201.condition2) e3:SetCondition(aux.NegateSummonCondition)
e3:SetCost(c93016201.cost2) e3:SetCost(c93016201.cost2)
e3:SetTarget(c93016201.target2) e3:SetTarget(c93016201.target2)
e3:SetOperation(c93016201.activate2) e3:SetOperation(c93016201.activate2)
...@@ -43,44 +30,6 @@ function c93016201.initial_effect(c) ...@@ -43,44 +30,6 @@ function c93016201.initial_effect(c)
e4:SetOperation(c93016201.activate3) e4:SetOperation(c93016201.activate3)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c93016201.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:SetLabel(0)
if not Duel.CheckLPCost(tp,800) then return end
local ct=Duel.GetCurrentChain()
if ct==1 then return end
local pe=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT)
if not pe:IsHasCategory(CATEGORY_SPECIAL_SUMMON) then return end
if not Duel.IsChainDisablable(ct-1) then return end
if Duel.SelectYesNo(tp,aux.Stringid(93016201,1)) then
Duel.PayLPCost(tp,800)
e:SetLabel(1)
end
end
function c93016201.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetLabel()~=1 then return end
local ct=Duel.GetCurrentChain()
local te=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
Duel.SetOperationInfo(0,CATEGORY_DISABLE,tc,1,0,0)
if tc:IsRelateToEffect(te) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
end
end
function c93016201.activate1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()~=1 then return end
local ct=Duel.GetChainInfo(0,CHAININFO_CHAIN_COUNT)
local te=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
if Duel.NegateEffect(ct-1) and tc:IsRelateToEffect(te) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c93016201.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function c93016201.cost2(e,tp,eg,ep,ev,re,r,rp,chk) function c93016201.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,800) end if chk==0 then return Duel.CheckLPCost(tp,800) end
Duel.PayLPCost(tp,800) Duel.PayLPCost(tp,800)
......
...@@ -7,67 +7,38 @@ function c99064191.initial_effect(c) ...@@ -7,67 +7,38 @@ function c99064191.initial_effect(c)
e1:SetTarget(c99064191.target1) e1:SetTarget(c99064191.target1)
e1:SetOperation(c99064191.activate1) e1:SetOperation(c99064191.activate1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--instant(chain) --negate
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(99064191,0)) e2:SetDescription(aux.Stringid(99064191,0))
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_CHAINING) e2:SetCode(EVENT_CHAINING)
e2:SetCondition(c99064191.condition2) e2:SetCountLimit(1)
e2:SetCost(c99064191.cost2) e2:SetCondition(c99064191.condition)
e2:SetTarget(c99064191.target2) e2:SetCost(c99064191.cost)
e2:SetOperation(c99064191.activate2) e2:SetTarget(c99064191.target)
e2:SetOperation(c99064191.activate)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c99064191.cfilter(c) function c99064191.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) return c:IsFaceup() and c:IsType(TYPE_XYZ)
end end
function c99064191.target1(e,tp,eg,ep,ev,re,r,rp,chk) function c99064191.condition(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return true end
e:SetLabel(0)
local ct=Duel.GetCurrentChain()
if ct==1 or not Duel.IsExistingMatchingCard(c99064191.cfilter,tp,LOCATION_MZONE,0,1,nil)
or not Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) then return false end
local pe=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT)
local tc=pe:GetHandler()
if pe:IsActiveType(TYPE_EFFECT) and tc:IsLevelAbove(5)
and Duel.IsChainDisablable(ct-1) and Duel.SelectYesNo(tp,aux.Stringid(99064191,1)) then
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,tc,1,0,0)
if tc:IsRelateToEffect(pe) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
end
e:SetLabel(1)
e:GetHandler():RegisterFlagEffect(99064191,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function c99064191.activate1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()~=1 or not c:IsRelateToEffect(e) then return end
local ct=Duel.GetChainInfo(0,CHAININFO_CHAIN_COUNT)
local te=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
if Duel.NegateEffect(ct-1) and tc:IsRelateToEffect(te) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c99064191.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c99064191.cfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c99064191.cfilter,tp,LOCATION_MZONE,0,1,nil)
and re:IsActiveType(TYPE_EFFECT) and re:GetHandler():IsLevelAbove(5) and Duel.IsChainDisablable(ev) and re:IsActiveType(TYPE_EFFECT) and re:GetHandler():IsLevelAbove(5) and Duel.IsChainDisablable(ev)
end end
function c99064191.cost2(e,tp,eg,ep,ev,re,r,rp,chk) function c99064191.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end end
function c99064191.target2(e,tp,eg,ep,ev,re,r,rp,chk) function c99064191.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(99064191)==0 end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end end
e:GetHandler():RegisterFlagEffect(99064191,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end end
function c99064191.activate2(e,tp,eg,ep,ev,re,r,rp) function c99064191.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT) Duel.Destroy(eg,REASON_EFFECT)
end end
......
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