Commit 910f8160 authored by mercury233's avatar mercury233

fix

parent ac3b2b30
......@@ -6,18 +6,39 @@ function c94145021.initial_effect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_TO_HAND)
e1:SetCode(EVENT_CUSTOM+94145021)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c94145021.condition)
e1:SetCost(c94145021.cost)
e1:SetOperation(c94145021.operation)
c:RegisterEffect(e1)
if not c94145021.global_check then
c94145021.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_TO_HAND)
ge1:SetCondition(c94145021.regcon)
ge1:SetOperation(c94145021.regop)
Duel.RegisterEffect(ge1,0)
end
end
function c94145021.cfilter(c,tp)
return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK)
end
function c94145021.regcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentPhase()==PHASE_DRAW then return false end
local v=0
if eg:IsExists(c94145021.cfilter,1,nil,0) then v=v+1 end
if eg:IsExists(c94145021.cfilter,1,nil,1) then v=v+2 end
if v==0 then return false end
e:SetLabel(({0,1,PLAYER_ALL})[v])
return true
end
function c94145021.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(eg,EVENT_CUSTOM+94145021,re,r,rp,ep,e:GetLabel())
end
function c94145021.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DRAW and eg:IsExists(c94145021.cfilter,1,nil,1-tp)
return ev==1-tp or ev==PLAYER_ALL
end
function c94145021.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
......
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