Commit 2658ada4 authored by JoyJ's avatar JoyJ

fix

parent 2b25417e
CupA = {}
function Auxiliary.PreloadUds() function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect() local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY) e1:SetCode(EVENT_ADJUST)
e1:SetCountLimit(1) e1:SetOperation(CupA.AdjustOperation)
e1:SetOperation(function(e)
Duel.Hint(HINT_CARD,0,37812118)
local tp=Duel.GetTurnPlayer()
local res1=Duel.TossCoin(tp,1)
local drawCounts={[0]=0,[1]=0}
if res1==1 then drawCounts[tp]=drawCounts[tp]+2 else drawCounts[1-tp]=drawCounts[1-tp]+2 end
if drawCounts[tp]>0 then Duel.Draw(tp,drawCounts[tp],REASON_EFFECT) end
if drawCounts[1-tp]>0 then Duel.Draw(1-tp,drawCounts[1-tp],REASON_EFFECT) end
end)
Duel.RegisterEffect(e1,0) Duel.RegisterEffect(e1,0)
end end
function CupA.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
Debug.Message("!")
if not CupA.Card then
CupA.Card=Duel.CreateToken(0,37812118)
Duel.Remove(CupA.Card,POS_FACEUP,REASON_RULE)
Debug.Message("!!!")
local e1=Effect.CreateEffect(CupA.Card)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_REMOVED)
e1:SetCountLimit(1)
e1:SetOperation(function(ee)
Debug.Message("!!")
Duel.Hint(HINT_CARD,0,37812118)
local tp=Duel.GetTurnPlayer()
local res1=Duel.TossCoin(tp,1)
local drawCounts={[0]=0,[1]=0}
if res1==1 then drawCounts[tp]=drawCounts[tp]+2 else drawCounts[1-tp]=drawCounts[1-tp]+2 end
if drawCounts[tp]>0 then Duel.Draw(tp,drawCounts[tp],REASON_EFFECT) end
if drawCounts[1-tp]>0 then Duel.Draw(1-tp,drawCounts[1-tp],REASON_EFFECT) end
end)
CupA.Card:RegisterEffect(e1)
end
if not CupA.Card:IsLocation(LOCATION_REMOVED) then
Duel.Remove(CupA.Card,POS_FACEUP,REASON_RULE)
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment