Skip to content

Commit fec5bf6

Browse files
authored
Hand reveal workaround improvements
Don't shuffle the hand if the card whose effect was activated would (even potentially) be moved out of the hand due to this effect (e.g. the "Subterror Behemoth" monsters).
1 parent 550b4a2 commit fec5bf6

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

proc_workaround.lua

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,32 @@
55
Fixes cases such as the "Enneacraft" monsters where the opponent shouldn't know if the player Special Summoned the monster whose effect was activated or not
66
--]]
77
do
8+
local function check_opinfo(ev,category,rc)
9+
local ex,tg=Duel.GetOperationInfo(ev,category)
10+
local possible_ex,possible_tg=Duel.GetPossibleOperationInfo(ev,category)
11+
return (ex and tg and tg:IsContains(rc)) or (possible_ex and possible_tg and possible_tg:IsContains(rc))
12+
end
13+
814
local shuffle_eff=Effect.GlobalEffect()
915
shuffle_eff:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
1016
shuffle_eff:SetCode(EVENT_CHAIN_SOLVING)
1117
shuffle_eff:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
1218
if Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)~=LOCATION_HAND then return end
1319
local rc=re:GetHandler()
14-
if rc:IsRelateToEffect(re) and rc:IsLocation(LOCATION_HAND) then
15-
Duel.ShuffleHand(rc:GetControler())
16-
end
20+
--if it's not the same card in the hand anymore then don't shuffle
21+
if not (rc:IsRelateToEffect(re) and rc:IsLocation(LOCATION_HAND)) then return end
22+
--if there's opinfo that would (even potentially) move rc then don't shuffle, e.g. the "Subterror Behemoth" monsters
23+
if check_opinfo(ev,CATEGORY_SPECIAL_SUMMON,rc) then return end
24+
if check_opinfo(ev,CATEGORY_SUMMON,rc) then return end
25+
if check_opinfo(ev,CATEGORY_TOGRAVE,rc) then return end
26+
if check_opinfo(ev,CATEGORY_DESTROY,rc) then return end
27+
if check_opinfo(ev,CATEGORY_REMOVE,rc) then return end
28+
if check_opinfo(ev,CATEGORY_TODECK,rc) then return end
29+
if check_opinfo(ev,CATEGORY_TOEXTRA,rc) then return end
30+
if check_opinfo(ev,CATEGORY_EQUIP,rc) then return end
31+
if check_opinfo(ev,CATEGORY_RELEASE,rc) then return end
32+
--otherwise, shuffle
33+
Duel.ShuffleHand(rc:GetControler())
1734
end)
1835
Duel.RegisterEffect(shuffle_eff,0)
1936
end

0 commit comments

Comments
 (0)