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()
function s.initial_effect(c)
-- 连接召唤
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,2,99,nil)
aux.AddLinkProcedure(c,nil,2)
-- 特殊连接召唤手续
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:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCondition(s.spcon)
e0:SetOperation(s.spop)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(s.hspcon)
e0:SetTarget(s.hsptg)
e0:SetOperation(s.hspop)
e0:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e0)
-- ①:特殊召唤限制
......@@ -36,25 +40,43 @@ function s.initial_effect(c)
end
-- 特殊连接召唤手续
function s.spfilter(c,typ)
return c:IsSetCard(0x713) and c:IsAbleToRemove() and c:IsType(TYPE_MONSTER) and c:GetType()~=typ
function s.checktype(c)
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
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
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE+LOCATION_EXTRA,0,nil,nil)
return g:GetClassCount(Card.GetType)>=5
local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE+LOCATION_EXTRA,0,c)
return rg:CheckSubGroup(s.fselect,5,5,tp,c)
end
function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE+LOCATION_EXTRA,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=rg:SelectSubGroup(tp,s.fselect,true,5,5,tp,c)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
local typ=nil
local sg=Group.CreateGroup()
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE+LOCATION_EXTRA,0,nil,typ)
for i=1,5 do
local tc=g:FilterSelect(tp,s.spfilter,5,5,nil,typ):GetFirst()
typ=tc:GetType()
sg:AddCard(tc)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST)
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
-- 特殊连接召唤手续的辅助检查
......
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