--Legends and Myths, Fraiysa the Fallen Necromancer function c1553215.initial_effect(c) aux.EnablePendulumAttribute(c) --splimit local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_FIELD) e0:SetRange(LOCATION_PZONE) e0:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE) e0:SetTargetRange(1,0) e0:SetTarget(c1553215.splimit) c:RegisterEffect(e0) --pend spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(1553215,0)) e2:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_PZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCost(aux.bfgcost) e2:SetCountLimit(1,1553215) e2:SetTarget(c1553215.sptg) e2:SetOperation(c1553215.spop) c:RegisterEffect(e2) --summon banish local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(1553215,1)) e3:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e3:SetRange(LOCATION_MZONE) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCountLimit(1,1553216) e3:SetCost(aux.bfgcost) e3:SetCondition(c1553215.condition) e3:SetTarget(c1553215.sptg2) e3:SetOperation(c1553215.spop2) c:RegisterEffect(e3) end function c1553215.splimit(e,c,sump,sumtype,sumpos,targetp) return not c:IsSetCard(0xFA0) and bit.band(sumtype,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM end function c1553215.spfilter(c,e,tp) return c:IsSetCard(0x190) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(1553215) end function c1553215.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c1553215.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c1553215.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,c1553215.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function c1553215.tdfilter(c) return c:IsSetCard(0x190) and c:IsAbleToDeck() end function c1553215.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) local g=Duel.GetMatchingGroup(c1553215.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil) if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(1553215,2)) then Duel.BreakEffect() local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c1553215.tdfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil) Duel.SendtoDeck(g,nil,2,REASON_EFFECT) end end end function c1553215.condition(e,tp,eg,ep,ev,re,r,rp) if not re then return false end local rc=re:GetHandler() return rc and (rc:IsSetCard(0xFA0)) or (e:GetHandler():GetSummonType()==SUMMON_TYPE_PENDULUM) end function c1553215.spfilter2(c,e,tp) return (c:IsSetCard(0x190) or c:IsSetCard(0xFA0)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(1553215) end function c1553215.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c1553215.spfilter2(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c1553215.spfilter2,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,aux.NecroValleyFilter(c1553215.spfilter2),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function c1553215.spop2(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e1,true) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e2,true) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_SET_ATTACK_FINAL) e3:SetValue(0) e3:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e3,true) local e4=e3:Clone() e4:SetCode(EFFECT_SET_DEFENSE_FINAL) tc:RegisterEffect(e4,true) end Duel.SpecialSummonComplete() end