function c1553085.initial_effect(c) --xyz summon aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xFA0),5,2) c:EnableReviveLimit() --Add local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(1553085,0)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e1:SetCategory(CATEGORY_TOHAND) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,1553085) e1:SetCondition(c1553085.eqcon) e1:SetTarget(c1553085.eqtg) e1:SetOperation(c1553085.eqop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetDescription(aux.Stringid(1553085,1)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1,1553085+1) e2:SetRange(LOCATION_MZONE) e2:SetCost(c1553085.cost) e2:SetTarget(c1553085.target) e2:SetOperation(c1553085.operation) c:RegisterEffect(e2) end function c1553085.eqcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetSummonType()==SUMMON_TYPE_XYZ end function c1553085.cfilter(c) return c:IsFaceup() and c:IsSetCard(0xFA0) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function c1553085.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c1553085.cfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(c1553085.cfilter,tp,LOCATION_REMOVED,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,c1553085.cfilter,tp,LOCATION_REMOVED,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function c1553085.eqop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) end end function c1553085.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) end function c1553085.filter(c) return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x190) and c:IsAbleToHand() end function c1553085.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c1553085.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c1553085.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c1553085.filter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) Duel.ShuffleDeck(tp) end end