Commit ca575f1d authored by 聖園ミカ's avatar 聖園ミカ 🐟

wdnmd

parent 1d694839
Pipeline #25850 passed with stages
in 27 minutes and 40 seconds
No preview for this file type
--异界共鸣-同调融合
function c17032170.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c17032170.target)
e1:SetOperation(c17032170.activate)
c:RegisterEffect(e1)
end
function c17032170.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c17032170.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c17032170.chkfilter(c,tp)
return c:IsControler(tp) and Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,c,nil)
end
function c17032170.fselect(g,e,tp)
local chkf=tp
return Duel.IsExistingMatchingCard(c17032170.synfilter,tp,LOCATION_EXTRA,0,1,nil,g)
and Duel.IsExistingMatchingCard(c17032170.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,g,nil,chkf)
end
function c17032170.synfilter(c,g)
local res=nil
if c:IsCode(16172067,97489701,62242678,93157004) then
res=c:IsSynchroSummonable(nil,g,g:GetCount()-2,g:GetCount()-2)
elseif c:IsCode(99585850) then
res=c:IsSynchroSummonable(nil,g,g:GetCount()-3,g:GetCount()-3)
else
res=c:IsSynchroSummonable(nil,g,g:GetCount()-1,g:GetCount()-1)
end
return res
end
function c17032170.chkfilter(c,tp)
return c:IsType(TYPE_SYNCHRO) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c17032170.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if not Duel.IsPlayerCanSpecialSummonCount(tp,2) then return false end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return false end
local cg=Duel.GetMatchingGroup(c17032170.chkfilter,tp,LOCATION_EXTRA,0,nil,tp)
if #cg==0 then return false end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
return g:CheckSubGroup(c17032170.fselect,2,#g,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_EXTRA)
end
function c17032170.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerCanSpecialSummonCount(tp,2) and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c17032170.fselect,false,2,#g,e,tp)
if sg then
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
local tg=Duel.GetMatchingGroup(c17032170.synfilter,tp,LOCATION_EXTRA,0,nil,sg)
fg=Duel.GetMatchingGroup(c17032170.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,sg,nil,chkf)
if tg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local scg=tg:Select(tp,1,1,nil):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local fcg=fg:Select(tp,1,1,nil):GetFirst()
scg:SetMaterial(sg)
fcg:SetMaterial(sg)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_MATERIAL+REASON_SYNCHRO+REASON_FUSION)
Duel.SpecialSummonStep(scg,SUMMON_SYNCHRO,tp,tp,true,false,POS_FACEUP)
Duel.SpecialSummonStep(fcg,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
Duel.BreakEffect()
Duel.SpecialSummonComplete()
end
end
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