|
85 | 85 | if check_opinfo(ev,CATEGORY_RELEASE,rc) then return end |
86 | 86 | --otherwise, shuffle |
87 | 87 | 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 | + |
88 | 108 | player_table[player]=true |
89 | 109 | end) |
90 | 110 | Duel.RegisterEffect(shuffle_eff,0) |
@@ -154,10 +174,12 @@ function Card.IsSummonPhase(c,phase) |
154 | 174 | return c:GetSummonPhase()==phase |
155 | 175 | end |
156 | 176 | 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 |
158 | 179 | end |
159 | 180 | 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 |
161 | 183 | end |
162 | 184 |
|
163 | 185 | --[[ |
|
0 commit comments