|
5 | 5 | 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 |
6 | 6 | --]] |
7 | 7 | 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 | + |
8 | 14 | local shuffle_eff=Effect.GlobalEffect() |
9 | 15 | shuffle_eff:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) |
10 | 16 | shuffle_eff:SetCode(EVENT_CHAIN_SOLVING) |
11 | 17 | shuffle_eff:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) |
12 | 18 | if Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)~=LOCATION_HAND then return end |
13 | 19 | 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()) |
17 | 34 | end) |
18 | 35 | Duel.RegisterEffect(shuffle_eff,0) |
19 | 36 | end |
|
0 commit comments