Commit 1cfed1e4 authored by Vury Leo's avatar Vury Leo

lint

parent c16291ac
Pipeline #39225 failed with stages
in 1 minute and 43 seconds
......@@ -88,7 +88,7 @@ end
-- guard for "next opponent turn" skips of Main 1
function s.turncon(e)
return Duel.GetTurnCount()~=e:GetLabel()
return Duel.GetTurnCount()~=e:GetLabel()
end
-- helper to schedule a one‑time skip effect
......@@ -100,73 +100,73 @@ function s.schedule_skip(c,tp,code,next_turn)
if code==EFFECT_SKIP_M2 then
phase=PHASE_MAIN2
end
local e=Effect.CreateEffect(c)
e:SetType(EFFECT_TYPE_FIELD)
e:SetCode(code)
e:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e:SetTargetRange(0,1)
if next_turn then
e:SetLabel(Duel.GetTurnCount())
e:SetCondition(s.turncon)
-- covers end of this opp turn + end of next opp turn
e:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,2)
else
-- reset as soon as that phase would start on their turn, this turn
e:SetReset(RESET_PHASE+phase+RESET_OPPO_TURN,1)
end
Duel.RegisterEffect(e,tp)
return e
local e=Effect.CreateEffect(c)
e:SetType(EFFECT_TYPE_FIELD)
e:SetCode(code)
e:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e:SetTargetRange(0,1)
if next_turn then
e:SetLabel(Duel.GetTurnCount())
e:SetCondition(s.turncon)
-- covers end of this opp turn + end of next opp turn
e:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,2)
else
-- reset as soon as that phase would start on their turn, this turn
e:SetReset(RESET_PHASE+phase+RESET_OPPO_TURN,1)
end
Duel.RegisterEffect(e,tp)
return e
end
function s.tpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local op=1-tp
local ph=Duel.GetCurrentPhase()
local turn_player=Duel.GetTurnPlayer()
local c=e:GetHandler()
local op=1-tp
local ph=Duel.GetCurrentPhase()
local turn_player=Duel.GetTurnPlayer()
-- My turn → skip their NEXT Main 1 (on turn change)
if turn_player==tp then
s.schedule_skip(c,tp,EFFECT_SKIP_M1,true)
return
end
-- My turn → skip their NEXT Main 1 (on turn change)
if turn_player==tp then
s.schedule_skip(c,tp,EFFECT_SKIP_M1,true)
return
end
-- Opponent in Battle Phase → skip their upcoming Main 2
if Duel.IsBattlePhase() then
s.schedule_skip(c,tp,EFFECT_SKIP_M2,false)
return
end
-- Opponent in Battle Phase → skip their upcoming Main 2
if Duel.IsBattlePhase() then
s.schedule_skip(c,tp,EFFECT_SKIP_M2,false)
return
end
-- Opponent in Main 1 →
-- a) schedule skip of *next* Main 1,
-- b) but pivot to skip M2 if they enter BP
if ph==PHASE_MAIN1 then
-- skip their *next* M1
local skip_m1=s.schedule_skip(c,tp,EFFECT_SKIP_M1,true)
-- Opponent in Main 1 →
-- a) schedule skip of *next* Main 1,
-- b) but pivot to skip M2 if they enter BP
if ph==PHASE_MAIN1 then
-- skip their *next* M1
local skip_m1=s.schedule_skip(c,tp,EFFECT_SKIP_M1,true)
-- b) watch for BP to cancel M1 skip & schedule M2 skip
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE) -- PHASE_BATTLE is the end of BP
e2:SetCountLimit(1)
e2:SetLabelObject(skip_m1)
e2:SetOperation(function(ee,tp2,eg2,ep2,ev2,re2,rp2)
ee:GetLabelObject():Reset() -- cancel skip‑M1
s.schedule_skip(c,tp,EFFECT_SKIP_M2,false)
ee:Reset() -- destroy watcher
end)
-- expires at end of their turn if no BP
e2:SetReset(RESET_PHASE+PHASE_END,1)
Duel.RegisterEffect(e2,op)
return
end
-- Opponent in Main 2/EP → skip their *next* Main 1 (on their next turn)
if ph>=PHASE_MAIN2 then
s.schedule_skip(c,tp,EFFECT_SKIP_M1,true)
return
end
-- Opponent before Main 1 (Draw/Standby) → skip this turn’s Main 1
-- b) watch for BP to cancel M1 skip & schedule M2 skip
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE) -- PHASE_BATTLE is the end of BP
e2:SetCountLimit(1)
e2:SetLabelObject(skip_m1)
e2:SetOperation(function(ee,tp2,eg2,ep2,ev2,re2,rp2)
ee:GetLabelObject():Reset() -- cancel skip‑M1
s.schedule_skip(c,tp,EFFECT_SKIP_M2,false)
ee:Reset() -- destroy watcher
end)
-- expires at end of their turn if no BP
e2:SetReset(RESET_PHASE+PHASE_END,1)
Duel.RegisterEffect(e2,op)
return
end
-- Opponent in Main 2/EP → skip their *next* Main 1 (on their next turn)
if ph>=PHASE_MAIN2 then
s.schedule_skip(c,tp,EFFECT_SKIP_M1,true)
return
end
-- Opponent before Main 1 (Draw/Standby) → skip this turn’s Main 1
if ph<PHASE_MAIN1 then
s.schedule_skip(c,tp,EFFECT_SKIP_M1,false)
s.schedule_skip(c,tp,EFFECT_SKIP_M1,false)
return
end
assert(false)
......
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