Skip to content

Commit f2bd7d6

Browse files
authored
Even more hand reveal workaround improvements
If the activating card itself ends up moving then shuffle the hand after the current Chain Link finishes resolving. This will make it so it matches the behaviour of the core which automatically shuffles the hand if the activating card is still there at the end of the resolution.
1 parent 84100bf commit f2bd7d6

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

proc_workaround.lua

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,26 @@ do
8585
if check_opinfo(ev,CATEGORY_RELEASE,rc) then return end
8686
--otherwise, shuffle
8787
Duel.ShuffleHand(player)
88+
89+
--if the activating card itself ends up moving then shuffle the hand after the current Chain Link finishes resolving
90+
--this will make it so it matches the behaviour of the core which automatically shuffles the hand if the activating card is still there at the end of the resolution
91+
local move_eff=Effect.CreateEffect(rc)
92+
move_eff:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
93+
move_eff:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
94+
move_eff:SetCode(EVENT_MOVE)
95+
move_eff:SetOperation(function()
96+
local eff=Effect.CreateEffect(rc)
97+
eff:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
98+
eff:SetCode(EVENT_CHAIN_SOLVED)
99+
eff:SetOperation(function() Duel.ShuffleHand(player) eff:Reset() end)
100+
eff:SetReset(RESET_CHAIN)
101+
Duel.RegisterEffect(eff,player)
102+
--
103+
move_eff:Reset()
104+
end)
105+
move_eff:SetReset(RESET_CHAIN)
106+
rc:RegisterEffect(move_eff)
107+
88108
player_table[player]=true
89109
end)
90110
Duel.RegisterEffect(shuffle_eff,0)
@@ -154,10 +174,12 @@ function Card.IsSummonPhase(c,phase)
154174
return c:GetSummonPhase()==phase
155175
end
156176
function Card.IsSummonPhaseMain(c)
157-
return c:GetSummonPhase()==PHASE_MAIN1 or c:GetSummonPhase()==PHASE_MAIN2
177+
local summon_phase=c:GetSummonPhase()
178+
return summon_phase==PHASE_MAIN1 or summon_phase==PHASE_MAIN2
158179
end
159180
function Card.IsSummonPhaseBattle(c)
160-
return c:GetSummonPhase()>=PHASE_BATTLE_START and c:GetSummonPhase()<=PHASE_BATTLE
181+
local summon_phase=c:GetSummonPhase()
182+
return summon_phase>=PHASE_BATTLE_START and summon_phase<=PHASE_BATTLE
161183
end
162184

163185
--[[

0 commit comments

Comments
 (0)