Skip to content

Commit ec87a0c

Browse files
committed
"Yowie" fix
Fixed a bug where the next Draw Phase would not be properly skipped if the effect of "Yowie" was activated during the opponent's Draw Phase
1 parent b658fc0 commit ec87a0c

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

official/c33393090.lua

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
-- ヨーウィー
2-
-- Yowie
3-
-- scripted by Hatter
1+
--ヨーウィー
2+
--Yowie
3+
--Scripted by Hatter
44
local s,id=GetID()
55
function s.initial_effect(c)
6-
-- Skip opponent's next draw phase
6+
--Skip opponent's next draw phase
77
local e1=Effect.CreateEffect(c)
88
e1:SetDescription(aux.Stringid(id,0))
99
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
1010
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY)
11-
e1:SetRange(LOCATION_MZONE)
1211
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
12+
e1:SetRange(LOCATION_MZONE)
1313
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_DUEL)
1414
e1:SetCondition(s.condition)
1515
e1:SetCost(s.cost)
@@ -21,7 +21,7 @@ function s.initial_effect(c)
2121
local e3=e1:Clone()
2222
e3:SetCode(EVENT_SUMMON_SUCCESS)
2323
c:RegisterEffect(e3)
24-
-- Count special summons
24+
--Count special summons
2525
aux.GlobalCheck(s,function()
2626
local ge1=Effect.CreateEffect(c)
2727
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
@@ -31,20 +31,20 @@ function s.initial_effect(c)
3131
end)
3232
end
3333
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
34-
Duel.RegisterFlagEffect(ep,id,RESET_PHASE+PHASE_END,0,1)
34+
Duel.RegisterFlagEffect(ep,id,RESET_PHASE|PHASE_END,0,1)
3535
end
3636
function s.condition(e,tp,eg,ep,ev,re,r,rp)
3737
return #eg==1 and eg:IsContains(e:GetHandler())
3838
end
3939
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
4040
if chk==0 then return Duel.GetFlagEffect(e:GetOwnerPlayer(),id)<=1 end
41-
-- Cannot special summon more than once
41+
--Cannot special summon more than once
4242
local e1=Effect.CreateEffect(e:GetHandler())
4343
e1:SetType(EFFECT_TYPE_FIELD)
4444
e1:SetDescription(aux.Stringid(id,1))
4545
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
4646
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
47-
e1:SetReset(RESET_PHASE+PHASE_END)
47+
e1:SetReset(RESET_PHASE|PHASE_END)
4848
e1:SetOwnerPlayer(tp)
4949
e1:SetCondition(s.spcon)
5050
e1:SetTargetRange(1,0)
@@ -54,11 +54,12 @@ function s.spcon(e)
5454
return Duel.GetFlagEffect(e:GetOwnerPlayer(),id)>0
5555
end
5656
function s.operation(e,tp,eg,ep,ev,re,r,rp)
57+
local is_op_drawphase=Duel.IsTurnPlayer(1-tp) and Duel.IsPhase(PHASE_DRAW)
5758
local e1=Effect.CreateEffect(e:GetHandler())
5859
e1:SetType(EFFECT_TYPE_FIELD)
5960
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
6061
e1:SetTargetRange(0,1)
6162
e1:SetCode(EFFECT_SKIP_DP)
62-
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_OPPO_TURN)
63+
e1:SetReset(RESET_PHASE|PHASE_DRAW|RESET_OPPO_TURN,is_op_drawphase and 2 or 1)
6364
Duel.RegisterEffect(e1,tp)
64-
end
65+
end

0 commit comments

Comments
 (0)