Commit fd8915c3 authored by Uytrewq's avatar Uytrewq Committed by GitHub

use Duel.IsChainSolving() (#2422)

parent 2427e7f9
...@@ -38,16 +38,14 @@ function c1372887.cfilter(c,tp) ...@@ -38,16 +38,14 @@ function c1372887.cfilter(c,tp)
return c:IsControler(1-tp) and not c:IsReason(REASON_DRAW) and c:IsPreviousLocation(LOCATION_DECK+LOCATION_GRAVE) return c:IsControler(1-tp) and not c:IsReason(REASON_DRAW) and c:IsPreviousLocation(LOCATION_DECK+LOCATION_GRAVE)
end end
function c1372887.drcon1(e,tp,eg,ep,ev,re,r,rp) function c1372887.drcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c1372887.cfilter,1,nil,tp) return eg:IsExists(c1372887.cfilter,1,nil,tp) and not Duel.IsChainSolving()
and (not re:IsHasType(EFFECT_TYPE_ACTIONS) or re:IsHasType(EFFECT_TYPE_CONTINUOUS))
end end
function c1372887.drop1(e,tp,eg,ep,ev,re,r,rp) function c1372887.drop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,1372887) Duel.Hint(HINT_CARD,0,1372887)
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
end end
function c1372887.regcon(e,tp,eg,ep,ev,re,r,rp) function c1372887.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c1372887.cfilter,1,nil,tp) and Duel.GetFlagEffect(tp,1372887)==0 return eg:IsExists(c1372887.cfilter,1,nil,tp) and Duel.IsChainSolving()
and re:IsHasType(EFFECT_TYPE_ACTIONS) and not re:IsHasType(EFFECT_TYPE_CONTINUOUS)
end end
function c1372887.regop(e,tp,eg,ep,ev,re,r,rp) function c1372887.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,1372887,RESET_CHAIN,0,1) Duel.RegisterFlagEffect(tp,1372887,RESET_CHAIN,0,1)
...@@ -56,7 +54,8 @@ function c1372887.drcon2(e,tp,eg,ep,ev,re,r,rp) ...@@ -56,7 +54,8 @@ function c1372887.drcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,1372887)>0 return Duel.GetFlagEffect(tp,1372887)>0
end end
function c1372887.drop2(e,tp,eg,ep,ev,re,r,rp) function c1372887.drop2(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFlagEffect(tp,1372887)
Duel.ResetFlagEffect(tp,1372887) Duel.ResetFlagEffect(tp,1372887)
Duel.Hint(HINT_CARD,0,1372887) Duel.Hint(HINT_CARD,0,1372887)
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,ct,REASON_EFFECT)
end end
...@@ -48,14 +48,14 @@ function c23434538.filter(c,sp) ...@@ -48,14 +48,14 @@ function c23434538.filter(c,sp)
end end
function c23434538.drcon1(e,tp,eg,ep,ev,re,r,rp) function c23434538.drcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c23434538.filter,1,nil,1-tp) return eg:IsExists(c23434538.filter,1,nil,1-tp)
and (not re:IsHasType(EFFECT_TYPE_ACTIONS) or re:IsHasType(EFFECT_TYPE_CONTINUOUS)) and not Duel.IsChainSolving()
end end
function c23434538.drop1(e,tp,eg,ep,ev,re,r,rp) function c23434538.drop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
end end
function c23434538.regcon(e,tp,eg,ep,ev,re,r,rp) function c23434538.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c23434538.filter,1,nil,1-tp) return eg:IsExists(c23434538.filter,1,nil,1-tp)
and re:IsHasType(EFFECT_TYPE_ACTIONS) and not re:IsHasType(EFFECT_TYPE_CONTINUOUS) and Duel.IsChainSolving()
end end
function c23434538.regop(e,tp,eg,ep,ev,re,r,rp) function c23434538.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,23434538,RESET_CHAIN,0,1) Duel.RegisterFlagEffect(tp,23434538,RESET_CHAIN,0,1)
......
...@@ -37,19 +37,6 @@ function c35199656.initial_effect(c) ...@@ -37,19 +37,6 @@ function c35199656.initial_effect(c)
e4:SetCondition(c35199656.damcon2) e4:SetCondition(c35199656.damcon2)
e4:SetOperation(c35199656.damop2) e4:SetOperation(c35199656.damop2)
c:RegisterEffect(e4) c:RegisterEffect(e4)
if not c35199656.global_check then
c35199656.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_SOLVING)
ge1:SetOperation(c35199656.count)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_CHAIN_SOLVED)
ge2:SetOperation(c35199656.reset)
Duel.RegisterEffect(ge2,0)
end
end end
function c35199656.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c35199656.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -79,14 +66,8 @@ function c35199656.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -79,14 +66,8 @@ function c35199656.operation(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function c35199656.count(e,tp,eg,ep,ev,re,r,rp)
c35199656.chain_solving=true
end
function c35199656.reset(e,tp,eg,ep,ev,re,r,rp)
c35199656.chain_solving=false
end
function c35199656.damcon1(e,tp,eg,ep,ev,re,r,rp) function c35199656.damcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,1-tp) and not c35199656.chain_solving return eg:IsExists(Card.IsControler,1,nil,1-tp) and not Duel.IsChainSolving()
end end
function c35199656.damop1(e,tp,eg,ep,ev,re,r,rp) function c35199656.damop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,35199656) Duel.Hint(HINT_CARD,0,35199656)
...@@ -94,7 +75,7 @@ function c35199656.damop1(e,tp,eg,ep,ev,re,r,rp) ...@@ -94,7 +75,7 @@ function c35199656.damop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(1-tp,ct*200,REASON_EFFECT) Duel.Damage(1-tp,ct*200,REASON_EFFECT)
end end
function c35199656.regcon(e,tp,eg,ep,ev,re,r,rp) function c35199656.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,1-tp) and c35199656.chain_solving return eg:IsExists(Card.IsControler,1,nil,1-tp) and Duel.IsChainSolving()
end end
function c35199656.regop(e,tp,eg,ep,ev,re,r,rp) function c35199656.regop(e,tp,eg,ep,ev,re,r,rp)
local ct=eg:FilterCount(Card.IsControler,nil,1-tp) local ct=eg:FilterCount(Card.IsControler,nil,1-tp)
......
...@@ -38,25 +38,6 @@ function c47408488.initial_effect(c) ...@@ -38,25 +38,6 @@ function c47408488.initial_effect(c)
e4:SetTarget(c47408488.pltg) e4:SetTarget(c47408488.pltg)
e4:SetOperation(c47408488.plop) e4:SetOperation(c47408488.plop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
if not c47408488.global_check then
c47408488.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_SOLVING)
ge1:SetOperation(c47408488.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_CHAIN_SOLVED)
ge2:SetOperation(c47408488.reset)
Duel.RegisterEffect(ge2,0)
end
end
function c47408488.checkop(e,tp,eg,ep,ev,re,r,rp)
c47408488.chain_solving=true
end
function c47408488.reset(e,tp,eg,ep,ev,re,r,rp)
c47408488.chain_solving=false
end end
function c47408488.cfilter(c) function c47408488.cfilter(c)
local type=c:GetOriginalType() local type=c:GetOriginalType()
...@@ -64,13 +45,13 @@ function c47408488.cfilter(c) ...@@ -64,13 +45,13 @@ function c47408488.cfilter(c)
return c:IsLocation(LOCATION_SZONE) and c:GetSequence()<5 and c:IsSetCard(0x1034) and bit.band(type,TYPE_MONSTER)~=0 return c:IsLocation(LOCATION_SZONE) and c:GetSequence()<5 and c:IsSetCard(0x1034) and bit.band(type,TYPE_MONSTER)~=0
end end
function c47408488.ctcon1(e,tp,eg,ep,ev,re,r,rp) function c47408488.ctcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c47408488.cfilter,1,nil) and not c47408488.chain_solving return eg:IsExists(c47408488.cfilter,1,nil) and not Duel.IsChainSolving()
end end
function c47408488.ctop1(e,tp,eg,ep,ev,re,r,rp) function c47408488.ctop1(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x6,1) e:GetHandler():AddCounter(0x6,1)
end end
function c47408488.regcon(e,tp,eg,ep,ev,re,r,rp) function c47408488.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c47408488.cfilter,1,nil) and c47408488.chain_solving return eg:IsExists(c47408488.cfilter,1,nil) and Duel.IsChainSolving()
end end
function c47408488.regop(e,tp,eg,ep,ev,re,r,rp) function c47408488.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(47408488,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1) e:GetHandler():RegisterFlagEffect(47408488,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
......
...@@ -92,7 +92,7 @@ function c53701259.lpcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -92,7 +92,7 @@ function c53701259.lpcon(e,tp,eg,ep,ev,re,r,rp)
end end
function c53701259.lpcon1(e,tp,eg,ep,ev,re,r,rp) function c53701259.lpcon1(e,tp,eg,ep,ev,re,r,rp)
return c53701259.lpcon(e,tp,eg,ep,ev,re,r,rp) return c53701259.lpcon(e,tp,eg,ep,ev,re,r,rp)
and (not re:IsHasType(EFFECT_TYPE_ACTIONS) or re:IsHasType(EFFECT_TYPE_CONTINUOUS)) and not Duel.IsChainSolving()
end end
function c53701259.lpop1(e,tp,eg,ep,ev,re,r,rp) function c53701259.lpop1(e,tp,eg,ep,ev,re,r,rp)
local lg=eg:Filter(c53701259.cfilter,nil,1-tp) local lg=eg:Filter(c53701259.cfilter,nil,1-tp)
...@@ -101,7 +101,7 @@ function c53701259.lpop1(e,tp,eg,ep,ev,re,r,rp) ...@@ -101,7 +101,7 @@ function c53701259.lpop1(e,tp,eg,ep,ev,re,r,rp)
end end
function c53701259.regcon(e,tp,eg,ep,ev,re,r,rp) function c53701259.regcon(e,tp,eg,ep,ev,re,r,rp)
return c53701259.lpcon(e,tp,eg,ep,ev,re,r,rp) return c53701259.lpcon(e,tp,eg,ep,ev,re,r,rp)
and re:IsHasType(EFFECT_TYPE_ACTIONS) and not re:IsHasType(EFFECT_TYPE_CONTINUOUS) and Duel.IsChainSolving()
end end
function c53701259.regop(e,tp,eg,ep,ev,re,r,rp) function c53701259.regop(e,tp,eg,ep,ev,re,r,rp)
local lg=eg:Filter(c53701259.cfilter,nil,1-tp) local lg=eg:Filter(c53701259.cfilter,nil,1-tp)
......
...@@ -63,7 +63,7 @@ function c60643553.lpcon1(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,7 +63,7 @@ function c60643553.lpcon1(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
return eg:IsExists(c60643553.cfilter,1,nil,1-tp) return eg:IsExists(c60643553.cfilter,1,nil,1-tp)
and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)) and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE))
and (not re:IsHasType(EFFECT_TYPE_ACTIONS) or re:IsHasType(EFFECT_TYPE_CONTINUOUS)) and not Duel.IsChainSolving()
end end
function c60643553.lpop1(e,tp,eg,ep,ev,re,r,rp) function c60643553.lpop1(e,tp,eg,ep,ev,re,r,rp)
local lg=eg:Filter(c60643553.cfilter,nil,1-tp) local lg=eg:Filter(c60643553.cfilter,nil,1-tp)
...@@ -75,7 +75,7 @@ function c60643553.regcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -75,7 +75,7 @@ function c60643553.regcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
return eg:IsExists(c60643553.cfilter,1,nil,1-tp) return eg:IsExists(c60643553.cfilter,1,nil,1-tp)
and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)) and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE))
and re:IsHasType(EFFECT_TYPE_ACTIONS) and not re:IsHasType(EFFECT_TYPE_CONTINUOUS) and Duel.IsChainSolving()
end end
function c60643553.regop(e,tp,eg,ep,ev,re,r,rp) function c60643553.regop(e,tp,eg,ep,ev,re,r,rp)
local lg=eg:Filter(c60643553.cfilter,nil,1-tp) local lg=eg:Filter(c60643553.cfilter,nil,1-tp)
......
...@@ -84,7 +84,7 @@ function c66425726.filter(c,sp) ...@@ -84,7 +84,7 @@ function c66425726.filter(c,sp)
end end
function c66425726.damcon1(e,tp,eg,ep,ev,re,r,rp) function c66425726.damcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c66425726.filter,1,nil,1-tp) return eg:IsExists(c66425726.filter,1,nil,1-tp)
and (not re:IsHasType(EFFECT_TYPE_ACTIONS) or re:IsHasType(EFFECT_TYPE_CONTINUOUS)) and not Duel.IsChainSolving()
end end
function c66425726.damop1(e,tp,eg,ep,ev,re,r,rp) function c66425726.damop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,66425726) Duel.Hint(HINT_CARD,0,66425726)
...@@ -92,7 +92,7 @@ function c66425726.damop1(e,tp,eg,ep,ev,re,r,rp) ...@@ -92,7 +92,7 @@ function c66425726.damop1(e,tp,eg,ep,ev,re,r,rp)
end end
function c66425726.regcon(e,tp,eg,ep,ev,re,r,rp) function c66425726.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c66425726.filter,1,nil,1-tp) return eg:IsExists(c66425726.filter,1,nil,1-tp)
and re:IsHasType(EFFECT_TYPE_ACTIONS) and not re:IsHasType(EFFECT_TYPE_CONTINUOUS) and Duel.IsChainSolving()
end end
function c66425726.regop(e,tp,eg,ep,ev,re,r,rp) function c66425726.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(66425726,RESET_CHAIN,0,1) e:GetHandler():RegisterFlagEffect(66425726,RESET_CHAIN,0,1)
......
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