Commit 9c2d25f8 authored by GuGu's avatar GuGu

Update c26507.lua

parent 0349f1de
Pipeline #33400 passed with stage
in 8 seconds
......@@ -2,16 +2,7 @@
function c26507.initial_effect(c)
c:EnableReviveLimit()
--link summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetDescription(aux.Stringid(26507,0))
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c26507.lkcon)
e1:SetOperation(c26507.lkop)
e1:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e1)
c26507.AddLinkProcedure(c,aux.TRUE,1,1)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(26507,1))
......@@ -26,24 +17,12 @@ function c26507.initial_effect(c)
e3:SetOperation(c26507.fusop)
c:RegisterEffect(e3)
end
function c26507.lkfilter(c,lc)
local tp=lc:GetControler()
return c:IsFaceup() and c:IsCanBeLinkMaterial(lc) and Duel.GetLocationCountFromEx(tp,tp,c,lc)>0
end
function c26507.lkcon(e,c)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c26507.lkfilter,tp,LOCATION_MZONE,0,nil,c)
return mg:GetCount()>0
end
function c26507.lkop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c26507.lkfilter,tp,LOCATION_MZONE,0,nil,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local sg=mg:Select(tp,1,1,nil)
local sg=e:GetLabelObject()
local tc=sg:GetFirst()
local code=tc:GetOriginalCode()
c:SetMaterial(sg)
aux.LExtraMaterialCount(sg,c,tp)
Duel.SendtoGrave(sg,REASON_MATERIAL+REASON_LINK)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -67,6 +46,7 @@ function c26507.lkop(e,tp,eg,ep,ev,re,r,rp,c)
e3:SetTarget(c26507.splimit)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
sg:DeleteGroup()
end
function c26507.splimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
......@@ -133,3 +113,19 @@ function c26507.fusop(e,tp,eg,ep,ev,re,r,rp)
tc:CompleteProcedure()
end
end
--
function c26507.AddLinkProcedure(c,f,min,max,gf)
if max==nil then max=c:GetLink() end
local e1=Effect.CreateEffect(c)
e1:SetDescription(1166)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(aux.LinkCondition(f,min,max,gf))
e1:SetTarget(aux.LinkTarget(f,min,max,gf))
e1:SetOperation(c26507.lkop)
e1:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e1)
return e1
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