Commit f88387fb authored by DailyShana's avatar DailyShana

update フレシアの蟲惑魔

remove special treatment of EVENT_CHAINING
need Fluorohydride/ygopro-core@6287d670d6110a70f3b211bea230e5cf68a1860d
parent 007f3071
...@@ -38,21 +38,10 @@ function c6511113.initial_effect(c) ...@@ -38,21 +38,10 @@ function c6511113.initial_effect(c)
e5:SetCode(EVENT_FREE_CHAIN) e5:SetCode(EVENT_FREE_CHAIN)
e5:SetHintTiming(0x3c0) e5:SetHintTiming(0x3c0)
e5:SetCountLimit(1) e5:SetCountLimit(1)
e5:SetCondition(c6511113.condition)
e5:SetCost(c6511113.cost) e5:SetCost(c6511113.cost)
e5:SetTarget(c6511113.target) e5:SetTarget(c6511113.target)
e5:SetOperation(c6511113.operation) e5:SetOperation(c6511113.operation)
c:RegisterEffect(e5) c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(6511113,1))
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetRange(LOCATION_MZONE)
e6:SetCode(EVENT_CHAINING)
e6:SetCountLimit(1)
e6:SetCost(c6511113.cost)
e6:SetTarget(c6511113.target2)
e6:SetOperation(c6511113.operation)
c:RegisterEffect(e6)
end end
function c6511113.imcon(e) function c6511113.imcon(e)
return e:GetHandler():GetOverlayCount()>0 return e:GetHandler():GetOverlayCount()>0
...@@ -63,15 +52,11 @@ end ...@@ -63,15 +52,11 @@ end
function c6511113.imtg(e,c) function c6511113.imtg(e,c)
return c:IsSetCard(0x108a) and not c:IsCode(6511113) return c:IsSetCard(0x108a) and not c:IsCode(6511113)
end end
function c6511113.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.CheckEvent(EVENT_CHAINING)
end
function c6511113.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c6511113.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1) e:SetLabel(1)
if chk==0 then return e:GetHandler():GetFlagEffect(6511113)==0 end return true
e:GetHandler():RegisterFlagEffect(6511113,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end end
function c6511113.filter1(c) function c6511113.filter(c)
return c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89) and c:IsAbleToGraveAsCost() return c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89) and c:IsAbleToGraveAsCost()
and c:CheckActivateEffect(false,true,false)~=nil and c:CheckActivateEffect(false,true,false)~=nil
end end
...@@ -80,11 +65,11 @@ function c6511113.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -80,11 +65,11 @@ function c6511113.target(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetLabel()==0 then return false end if e:GetLabel()==0 then return false end
e:SetLabel(0) e:SetLabel(0)
return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST)
and Duel.IsExistingMatchingCard(c6511113.filter1,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(c6511113.filter,tp,LOCATION_DECK,0,1,nil)
end end
e:SetLabel(0) e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c6511113.filter1,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c6511113.filter,tp,LOCATION_DECK,0,1,1,nil)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true) local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
...@@ -102,47 +87,3 @@ function c6511113.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -102,47 +87,3 @@ function c6511113.operation(e,tp,eg,ep,ev,re,r,rp)
local op=te:GetOperation() local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end if op then op(e,tp,eg,ep,ev,re,r,rp) end
end end
function c6511113.filter2(c,e,tp,eg,ep,ev,re,r,rp)
if c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89) and c:IsAbleToGraveAsCost() then
if c:CheckActivateEffect(false,true,false)~=nil then return true end
local te=c:GetActivateEffect()
if te:GetCode()~=EVENT_CHAINING then return false end
local con=te:GetCondition()
if con and not con(e,tp,eg,ep,ev,re,r,rp) then return false end
local tg=te:GetTarget()
if tg and not tg(e,tp,eg,ep,ev,re,r,rp,0) then return false end
return true
else return false end
end
function c6511113.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST)
and Duel.IsExistingMatchingCard(c6511113.filter2,tp,LOCATION_DECK,0,1,nil,e,tp,eg,ep,ev,re,r,rp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c6511113.filter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
local te,ceg,cep,cev,cre,cr,crp
local fchain=c6511113.filter1(tc)
if fchain then
te,ceg,cep,cev,cre,cr,crp=tc:CheckActivateEffect(false,true,true)
else
te=tc:GetActivateEffect()
end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.SendtoGrave(g,REASON_COST)
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then
if fchain then
tg(e,tp,ceg,cep,cev,cre,cr,crp,1)
else
tg(e,tp,eg,ep,ev,re,r,rp,1)
end
end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
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