Commit e6b8d2b2 authored by songtongtong's avatar songtongtong

fix bug

parent 4263cde0
......@@ -25,10 +25,20 @@ function c12044023.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_DECK)
e2:SetCondition(c12044023.spcon)
e2:SetOperation(c12044023.spop)
e2:SetCondition(c12044023.spcon2)
e2:SetOperation(c12044023.spop2)
e2:SetValue(1)
c:RegisterEffect(e2)
--Special Summon effect
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c12044023.spcon)
e1:SetTarget(c12044023.sptg)
e1:SetOperation(c12044023.spop)
c:RegisterEffect(e1)
end
function c12044023.spcost(e,c,tp)
return Duel.GetFlagEffect(tp,12044022)==0 or not c:IsLocation(LOCATION_DECK)
......@@ -111,12 +121,12 @@ function c12044023.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
function c12044023.spcon(e,c)
function c12044023.spcon2(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsFaceup()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsFaceup() and Duel.CheckReleaseGroup(tp,Card.IsCode,4,nil,12044025)
end
function c12044023.spop(e,tp,eg,ep,ev,re,r,rp,c)
function c12044023.spop2(e,tp,eg,ep,ev,re,r,rp,c)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsCode,4,nil,12044025) end
local g=Duel.SelectReleaseGroup(tp,Card.IsType,4,4,nil,TYPE_TOKEN)
Duel.Release(g,REASON_COST)
......
......@@ -92,6 +92,7 @@ function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
if Duel.Destroy(eg,REASON_EFFECT)~=0 then
if Duel.IsExistingMatchingCard(cm.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e,tp) then
......
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