--Legends and Myths, Elaine the Fallen Diviner function c1553125.initial_effect(c) --link summon c:EnableReviveLimit() aux.AddLinkProcedure(c,aux.FilterBoolFunction(c1553125.matfilter),1,1) --splimit local e0=Effect.CreateEffect(c) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e0:SetCode(EVENT_SPSUMMON_SUCCESS) e0:SetCondition(c1553125.regcon) e0:SetOperation(c1553125.regop) c:RegisterEffect(e0) --Special Summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(1553125,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,1553125) e1:SetTarget(c1553125.sptg) e1:SetOperation(c1553125.spop) c:RegisterEffect(e1) --Add To Extra local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(1553125,1)) e2:SetCategory(CATEGORY_TOEXTRA) e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_TO_GRAVE) e2:SetCountLimit(1,1553126) e2:SetTarget(c1553125.sctg) e2:SetOperation(c1553125.scop) c:RegisterEffect(e2) end function c1553125.matfilter(c) return c:IsSetCard(0x190) or c:IsSetCard(0xFA0) end function c1553125.regcon(e,tp,eg,ep,ev,re,r,rp) return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK end function c1553125.regop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(1,0) e1:SetReset(RESET_PHASE+PHASE_END) e1:SetTarget(c1553125.splimit) Duel.RegisterEffect(e1,tp) end function c1553125.splimit(e,c,sump,sumtype,sumpos,targetp,se) return c:IsCode(1553125) and bit.band(sumtype,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK end function c1553125.spfilter(c,e,tp,zone) return c:IsSetCard(0xFA0) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) end function c1553125.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local zone=e:GetHandler():GetLinkedZone(tp) return zone~=0 and Duel.IsExistingMatchingCard(c1553125.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp,zone) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function c1553125.spop(e,tp,eg,ep,ev,re,r,rp) local zone=e:GetHandler():GetLinkedZone(tp) if zone==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c1553125.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,zone) local tc=g:GetFirst() if tc and zone~=0 and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)~=0 then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) end end function c1553125.thcon2(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end function c1553125.scfilter(c) return c:IsType(TYPE_PENDULUM) and c:IsSetCard(0xFA0) and not c:IsForbidden() end function c1553125.sctg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c1553125.scfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,nil,1,tp,LOCATION_DECK) end function c1553125.scop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local g=Duel.SelectMatchingCard(tp,c1553125.scfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoExtraP(g,tp,REASON_EFFECT) end end