Skip to content

Commit 506456f

Browse files
authored
Fix "Final Question"
-Destruction effects should not apply to monsters immune to Trap effects (i.e. Litmus Doom Swordsman) -Changed the announced number range to account for modes with EMZ enabled
1 parent 2d76684 commit 506456f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

unofficial/c511002028.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,14 @@ function s.initial_effect(c)
88
e1:SetType(EFFECT_TYPE_ACTIVATE)
99
e1:SetCode(EVENT_FREE_CHAIN)
1010
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
11-
e1:SetCondition(s.condition)
11+
e1:SetCondition(function(e) return Duel.GetTurnPlayer()==1-e:GetHandlerPlayer() and Duel.IsAbleToEnterBP() end)
1212
e1:SetOperation(s.activate)
1313
c:RegisterEffect(e1)
1414
end
15-
function s.condition(e,tp,eg,ep,ev,re,r,rp)
16-
return Duel.GetTurnPlayer()~=tp and Duel.IsAbleToEnterBP()
17-
end
1815
function s.activate(e,tp,eg,ep,ev,re,r,rp)
1916
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(id,0))
2017
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(id,0))
21-
local quest=Duel.AnnounceNumber(1-tp,0,1,2,3,4,5,6,7,8,9,10)
18+
local quest=Duel.AnnounceNumber(1-tp,0,1,2,3,4,5,6,7,8,9,10,11,12)
2219
local e1=Effect.CreateEffect(e:GetHandler())
2320
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
2421
e1:SetCode(EVENT_PHASE_START+PHASE_BATTLE)
@@ -38,24 +35,27 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
3835
Duel.RegisterEffect(e2,tp)
3936
e1:SetLabelObject(e2)
4037
end
38+
function s.cfilter(c,e)
39+
return not c:IsImmuneToEffect(e)
40+
end
4141
function s.op(e,tp,eg,ep,ev,re,r,rp)
4242
e:GetLabelObject():SetLabel(1)
4343
Duel.Hint(HINT_CARD,0,id)
4444
local quest=e:GetLabel()
4545
local ct=Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
4646
local c=e:GetHandler()
4747
if ct==quest then
48-
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,nil)
48+
local sg=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE,0,nil,e)
4949
Duel.Destroy(sg,REASON_EFFECT)
5050
else
51-
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
51+
local sg=Duel.GetMatchingGroup(s.cfilter,tp,0,LOCATION_MZONE,nil,e)
5252
Duel.Destroy(sg,REASON_EFFECT)
5353
end
5454
end
5555
function s.endop(e,tp,eg,ep,ev,re,r,rp)
5656
if e:GetLabel()==0 then
5757
Duel.Hint(HINT_CARD,0,id)
58-
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
58+
local sg=Duel.GetMatchingGroup(s.cfilter,tp,0,LOCATION_MZONE,nil,e)
5959
Duel.Destroy(sg,REASON_EFFECT)
6060
end
6161
end

0 commit comments

Comments
 (0)