--Legends and Myths, Bellora the Fallen Princess function c1553105.initial_effect(c) --synchro summon aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xFA0),aux.NonTuner(nil),1) c:EnableReviveLimit() local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(1553105,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,1553105) e1:SetCondition(c1553105.quickcon) e1:SetTarget(c1553105.target) e1:SetOperation(c1553105.operation) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetHintTiming(0,TIMING_END_PHASE) e2:SetCondition(c1553105.quickcon2) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(1553105,1)) e3:SetCategory(CATEGORY_TOGRAVE) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,1553105+1) e3:SetCondition(c1553105.quickcon) e3:SetCost(c1553105.rcost) e3:SetTarget(c1553105.rtarget) e3:SetOperation(c1553105.roperation) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetCode(EVENT_FREE_CHAIN) e4:SetHintTiming(0,TIMING_END_PHASE) e4:SetCondition(c1553105.quickcon2) c:RegisterEffect(e4) end function c1553105.quickcon(e,tp,eg,ep,ev,re,r,rp) return not Duel.IsPlayerAffectedByEffect(tp,1553120) end function c1553105.quickcon2(e,tp,eg,ep,ev,re,r,rp) return Duel.IsPlayerAffectedByEffect(tp,1553120) end function c1553105.filter1(c) return c:IsFaceup() and c:IsSetCard(0xFA0) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() end function c1553105.filter2(c) return c:IsAbleToHand() end function c1553105.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(c1553105.filter1,tp,LOCATION_REMOVED,0,1,nil) and Duel.IsExistingTarget(c1553105.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g1=Duel.SelectTarget(tp,c1553105.filter1,tp,LOCATION_REMOVED,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g1,1,0,0) e:SetLabelObject(g1:GetFirst()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOHAND) local g2=Duel.SelectTarget(tp,c1553105.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g2,1,0,0) end function c1553105.operation(e,tp,eg,ep,ev,re,r,rp) local tc1=e:GetLabelObject() local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local tc2=g:GetFirst() if tc1==tc2 then tc2=g:GetNext() end if tc1:IsRelateToEffect(e) and Duel.SendtoDeck(tc1,nil,2,REASON_EFFECT)~=0 then if tc2:IsFaceup() and tc2:IsRelateToEffect(e) then Duel.SendtoHand(tc2,nil,REASON_EFFECT) end end end function c1553105.tgfilter(c) return c:IsSetCard(0xFA0) and c:IsAbleToGrave() end function c1553105.rcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) end function c1553105.rtarget(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c1553105.tgfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end function c1553105.roperation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,c1553105.tgfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoGrave(g,REASON_EFFECT) end end