--created by Zarc, coded by Lyris --Elflair - Nihilis, Enhanced Elf Sorcerer local s,id,o=GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x355),1,1) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(1,0) e1:SetTarget(aux.TargetBoolFunction(aux.NOT(Card.IsSetCard),0x355)) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:HOPT() e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) c:SetSPSummonOnce(id) end function s.GetMultiLinkedZone(tp) local f=function(c) return c:IsFaceup() and c:IsType(TYPE_LINK) and c:IsSetCard(0x355) end local lg=Duel.GetMatchingGroup(f,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local multi_linked_zone=0 local single_linked_zone=0 for tc in aux.Next(lg) do local zone=tc:GetLinkedZone(tp)&0x7f multi_linked_zone=single_linked_zone&zone|multi_linked_zone single_linked_zone=single_linked_zone~zone end return multi_linked_zone end function s.filter(c,e,tp,zone) return c:IsFaceupEx() and c:IsSetCard(0x355) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local zone=s.GetMultiLinkedZone(tp) if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and s.filter(chkc,e,tp,zone) end if chk==0 then return zone~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp,zone) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp,zone) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local zone=s.GetMultiLinkedZone(tp) local tc=Duel.GetFirstTarget() if zone~=0 and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone) end end