Commit 40d7219c authored by nekrozar's avatar nekrozar Committed by DailyShana

fix Winged Kuriboh LV9 (#458)

parent 84d8c7e5
...@@ -32,9 +32,40 @@ function c33776734.initial_effect(c) ...@@ -32,9 +32,40 @@ function c33776734.initial_effect(c)
local e4=e3:Clone() local e4=e3:Clone()
e4:SetCode(EFFECT_SET_DEFENSE) e4:SetCode(EFFECT_SET_DEFENSE)
c:RegisterEffect(e4) c:RegisterEffect(e4)
if not c33776734.global_check then
c33776734.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(c33776734.checkop1)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
e2:SetOperation(c33776734.checkop2)
Duel.RegisterEffect(ge2,0)
end
end end
c33776734.lvupcount=1 c33776734.lvupcount=1
c33776734.lvup={33776734} c33776734.lvup={33776734}
function c33776734.checkop1(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if re and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and tc==re:GetHandler() then
tc:RegisterFlagEffect(33776734,RESET_EVENT+0x1fe0000,0,1)
end
tc=eg:GetNext()
end
end
function c33776734.checkop2(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if re and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and tc==re:GetHandler() then
tc:ResetFlagEffect(33776734)
end
tc=eg:GetNext()
end
end
function c33776734.spcon(e,tp,eg,ep,ev,re,r,rp) function c33776734.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()>=2 return Duel.GetCurrentChain()>=2
end end
...@@ -45,13 +76,15 @@ function c33776734.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -45,13 +76,15 @@ function c33776734.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterFlagEffect(tp,33776734,RESET_CHAIN,0,0) Duel.RegisterFlagEffect(tp,33776734,RESET_CHAIN,0,0)
end end
function c33776734.spop(e,tp,eg,ep,ev,re,r,rp) function c33776734.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then local c=e:GetHandler()
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SendtoGrave(c,REASON_RULE)
end end
end end
function c33776734.rmtarget(e,c) function c33776734.rmtarget(e,c)
local ty=c:GetOriginalType() return c:IsFaceup() and c:GetFlagEffect(33776734)>0
return bit.band(ty,TYPE_SPELL)~=0 and c:IsFaceup() and not c:IsStatus(STATUS_ACTIVATE_DISABLED)
end end
function c33776734.val(e,c) function c33776734.val(e,c)
return Duel.GetMatchingGroupCount(Card.IsType,c:GetControler(),0,LOCATION_GRAVE,nil,TYPE_SPELL)*500 return Duel.GetMatchingGroupCount(Card.IsType,c:GetControler(),0,LOCATION_GRAVE,nil,TYPE_SPELL)*500
......
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