Skip to content

Commit 62dee8c

Browse files
authored
Return of the Zombies
- Missing ">0" when checking for available zones with "Duel.GetMZoneCount" - Wrong string id in e2
1 parent 3994301 commit 62dee8c

1 file changed

Lines changed: 32 additions & 32 deletions

File tree

official/c91742238.lua

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,77 +9,77 @@ function s.initial_effect(c)
99
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
1010
e1:SetType(EFFECT_TYPE_ACTIVATE)
1111
e1:SetCode(EVENT_FREE_CHAIN)
12-
e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
1312
e1:SetCountLimit(1,id)
13+
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
1414
e1:SetTarget(s.target)
1515
e1:SetOperation(s.activate)
1616
c:RegisterEffect(e1)
17-
--Shuffle 1 of your banished Zombie monsters into the Deck, and if you do, Set this card
17+
--Shuffle 1 of your banished Zombie monsters into the Deck, and if you do, Set this card, but banish it when it leaves the field
1818
local e2=Effect.CreateEffect(c)
19-
e2:SetDescription(aux.Stringid(id,0))
20-
e2:SetCategory(CATEGORY_TODECK)
19+
e2:SetDescription(aux.Stringid(id,1))
20+
e2:SetCategory(CATEGORY_TODECK+CATEGORY_LEAVE_GRAVE)
2121
e2:SetType(EFFECT_TYPE_QUICK_O)
2222
e2:SetCode(EVENT_FREE_CHAIN)
2323
e2:SetRange(LOCATION_GRAVE)
24-
e2:SetHintTiming(0,TIMING_END_PHASE)
2524
e2:SetCountLimit(1,{id,1})
25+
e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
2626
e2:SetTarget(s.settg)
2727
e2:SetOperation(s.setop)
2828
c:RegisterEffect(e2)
2929
end
3030
function s.rmfilter(c,e,tp)
31-
local p=c:GetControler()
32-
return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and c:IsAbleToRemove()
33-
and Duel.GetMZoneCount(p,c,p,LOCATION_REASON_TOFIELD)
34-
and Duel.IsExistingMatchingCard(s.spfilter,p,LOCATION_GRAVE,0,1,nil,e,tp,p)
31+
local ctrl=c:GetControler()
32+
return c:IsRace(RACE_ZOMBIE) and c:IsFaceup() and c:IsAbleToRemove() and Duel.GetMZoneCount(ctrl,c,tp)>0
33+
and Duel.IsExistingMatchingCard(s.spfilter,ctrl,LOCATION_GRAVE,0,1,nil,e,tp,ctrl)
3534
end
36-
function s.spfilter(c,e,tp,p)
37-
return c:IsRace(RACE_ZOMBIE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,p)
35+
function s.spfilter(c,e,tp,ctrl)
36+
return c:IsRace(RACE_ZOMBIE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,ctrl)
3837
end
3938
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
4039
if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
41-
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,PLAYER_ALL,LOCATION_MZONE)
42-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,PLAYER_ALL,LOCATION_GRAVE)
40+
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,PLAYER_EITHER,LOCATION_MZONE)
41+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,PLAYER_EITHER,LOCATION_GRAVE)
4342
end
4443
function s.activate(e,tp,eg,ep,ev,re,r,rp)
45-
if not Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) then return end
4644
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
4745
local rc=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp):GetFirst()
48-
if rc and Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)~=0 then
49-
local p=rc:GetPreviousControler()
46+
if not rc then return end
47+
Duel.HintSelection(rc)
48+
if Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)>0 then
49+
local ctrl=rc:GetPreviousControler()
5050
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
51-
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),p,LOCATION_GRAVE,0,1,1,nil,e,tp,p)
51+
local g=Duel.SelectMatchingCard(tp,s.spfilter,ctrl,LOCATION_GRAVE,0,1,1,nil,e,tp,ctrl)
5252
if #g>0 then
5353
Duel.BreakEffect()
54-
Duel.SpecialSummon(g,0,tp,p,false,false,POS_FACEUP_DEFENSE)
54+
Duel.SpecialSummon(g,0,tp,ctrl,false,false,POS_FACEUP_DEFENSE)
5555
end
5656
end
5757
end
58-
function s.setfilter(c)
59-
return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and c:IsAbleToDeck()
58+
function s.tdfilter(c)
59+
return c:IsRace(RACE_ZOMBIE) and c:IsFaceup() and c:IsAbleToDeck()
6060
end
6161
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
6262
local c=e:GetHandler()
63-
if chk==0 then return c:IsSSetable()
64-
and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_REMOVED,0,1,nil) end
65-
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
63+
if chk==0 then return c:IsSSetable() and Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_REMOVED,0,1,nil) end
6664
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_REMOVED)
65+
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,tp,0)
6766
end
6867
function s.setop(e,tp,eg,ep,ev,re,r,rp)
69-
local c=e:GetHandler()
7068
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
71-
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_REMOVED,0,1,1,nil)
72-
if #g>0 and Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0
73-
and c:IsRelateToEffect(e) and c:IsSSetable() then
74-
Duel.SSet(tp,c)
75-
--Banish it if it leaves the field
69+
local sc=Duel.SelectMatchingCard(tp,s.tdfilter,tp,LOCATION_REMOVED,0,1,1,nil):GetFirst()
70+
if not sc then return end
71+
Duel.HintSelection(sc)
72+
local c=e:GetHandler()
73+
if Duel.SendtoDeck(sc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and sc:IsLocation(LOCATION_DECK|LOCATION_EXTRA)
74+
and c:IsRelateToEffect(e) and Duel.SSet(tp,c)>0 then
75+
--Banish it when it leaves the field
7676
local e1=Effect.CreateEffect(c)
7777
e1:SetDescription(3300)
7878
e1:SetType(EFFECT_TYPE_SINGLE)
79-
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
8079
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
81-
e1:SetReset(RESET_EVENT|RESETS_REDIRECT)
80+
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
8281
e1:SetValue(LOCATION_REMOVED)
82+
e1:SetReset(RESET_EVENT|RESETS_REDIRECT)
8383
c:RegisterEffect(e1)
8484
end
85-
end
85+
end

0 commit comments

Comments
 (0)