Commit 8a2f139c authored by GuGu's avatar GuGu

Update c20516.lua

parent 1f9e20f8
Pipeline #32855 passed with stage
in 7 seconds
...@@ -3,15 +3,19 @@ local s,id=GetID() ...@@ -3,15 +3,19 @@ local s,id=GetID()
function s.initial_effect(c) function s.initial_effect(c)
-- 连接召唤 -- 连接召唤
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,2,99,nil) aux.AddLinkProcedure(c,nil,2)
-- 特殊连接召唤手续 -- 特殊连接召唤手续
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetDescription(aux.Stringid(id,1))
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC) e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCondition(s.spcon) e0:SetRange(LOCATION_EXTRA)
e0:SetOperation(s.spop) e0:SetCondition(s.hspcon)
e0:SetTarget(s.hsptg)
e0:SetOperation(s.hspop)
e0:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e0) c:RegisterEffect(e0)
-- ①:特殊召唤限制 -- ①:特殊召唤限制
...@@ -36,25 +40,43 @@ function s.initial_effect(c) ...@@ -36,25 +40,43 @@ function s.initial_effect(c)
end end
-- 特殊连接召唤手续 -- 特殊连接召唤手续
function s.spfilter(c,typ) function s.checktype(c)
return c:IsSetCard(0x713) and c:IsAbleToRemove() and c:IsType(TYPE_MONSTER) and c:GetType()~=typ local res=0
if c:IsType(TYPE_FUSION) then res=res*10+1 end
if c:IsType(TYPE_XYZ) then res=res*10+2 end
if c:IsType(TYPE_LINK) then res=res*10+3 end
if c:IsType(TYPE_SYNCHRO) then res=res*10+4 end
if c:IsType(TYPE_RITUAL) then res=res*10+5 end
if res==0 then res=res*10+9 end
return res
end end
function s.spcon(e,c) function s.fselect(g,tp,sc)
return g:GetClassCount(s.checktype)==5 and Duel.GetLocationCountFromEx(tp,tp,g,sc)>0
end
function s.spfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and c:IsSetCard(0x713)
and (c:IsFaceup() or c:IsLocation(LOCATION_EXTRA))
end
function s.hspcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE+LOCATION_EXTRA,0,nil,nil) local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE+LOCATION_EXTRA,0,c)
return g:GetClassCount(Card.GetType)>=5 return rg:CheckSubGroup(s.fselect,5,5,tp,c)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c) function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local typ=nil local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE+LOCATION_EXTRA,0,c)
local sg=Group.CreateGroup() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE+LOCATION_EXTRA,0,nil,typ) local sg=rg:SelectSubGroup(tp,s.fselect,true,5,5,tp,c)
for i=1,5 do if sg then
local tc=g:FilterSelect(tp,s.spfilter,5,5,nil,typ):GetFirst() sg:KeepAlive()
typ=tc:GetType() e:SetLabelObject(sg)
sg:AddCard(tc) return true
end else return false end
Duel.Remove(sg,POS_FACEUP,REASON_COST) end
function s.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Remove(g,POS_FACEUP,REASON_SPSUMMON)
g:DeleteGroup()
end 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