--created & coded by Swag local s,id=GetID() s.dfc_front_side=id+1 function s.initial_effect(c) aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x412),2) c:EnableReviveLimit() c:SetSPSummonOnce(id) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_ADD_ATTRIBUTE) e1:SetRange(LOCATION_MZONE) e1:SetValue(ATTRIBUTE_LIGHT) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCondition(s.sscon) e2:SetTarget(s.sstg) e2:SetOperation(s.ssop) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCondition(s.syncon) e3:SetTarget(s.syntg) e3:SetOperation(s.synop) c:RegisterEffect(e3) local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetCode(EVENT_BECOME_TARGET) e4:SetRange(LOCATION_MZONE) e4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return rp~=tp and re and eg:IsContains(e:GetHandler()) end) e4:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c.dfc_front_side end Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) end) e4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local tcode=c.dfc_front_side if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) or not tcode then return false end c:SetEntityCode(tcode,true) c:ReplaceEffect(tcode,0,0) Duel.SetMetatable(c,_G["c"..tcode]) end) c:RegisterEffect(e4) end function s.lcheck(g) return g:GetClassCount(Card.GetLinkAttribute)==#g and g:GetClassCount(Card.GetLinkRace)==#g end function s.sscon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) end function s.filter(c,e,tp,zone) return c:IsSetCard(0x412) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) end function s.sstg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local zone=e:GetHandler():GetLinkedZone(tp)&0x1f return zone~=0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp,zone) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.ssop(e,tp,eg,ep,ev,re,r,rp) local zone=e:GetHandler():GetLinkedZone(tp)&0x1f if zone~=0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp,zone) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP,zone) end end end function s.seqcfilter(c,tp,lg) return c:IsType(TYPE_SYNCHRO) and c:IsSetCard(0x412) and lg:IsContains(c) end function s.syncon(e,tp,eg,ep,ev,re,r,rp) local lg=e:GetHandler():GetLinkedGroup() return eg:IsExists(s.seqcfilter,1,nil,tp,lg) end function s.syntg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local zone=e:GetHandler():GetLinkedZone(tp)&0x1f return zone~=0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,zone) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function s.synop(e,tp,eg,ep,ev,re,r,rp) local zone=e:GetHandler():GetLinkedZone(tp)&0x1f if zone~=0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,zone) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP,zone) end end end