--created by Seth, coded by Lyris local cid,id=GetID() function cid.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetDescription(2) e1:SetTarget(cid.tg) e1:SetOperation(cid.op) c:RegisterEffect(e1) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCategory(CATEGORY_REMOVE+CATEGORY_DISABLE) e3:SetDescription(1131) e3:SetTarget(cid.distg) e3:SetOperation(cid.disop) c:RegisterEffect(e3) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD) e2:SetCategory(CATEGORY_TOHAND) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetRange(LOCATION_REMOVED) e2:SetCountLimit(1) e2:SetTarget(cid.sumtg) e2:SetOperation(cid.sumop) c:RegisterEffect(e2) end function cid.sfilter(c,e,tp) local ct=c:GetTributeRequirement() return c:IsLevelAbove(5) and c:IsSetCard(0x83e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(aux.AND(Card.IsSetCard,Card.IsAbleToRemove),tp,LOCATION_DECK,0,ct,c,0x83e) end function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cid.sfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function cid.op(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local g=Duel.SelectMatchingCard(tp,cid.sfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local tc=g:GetFirst() if tc then Duel.ConfirmCards(1-tp,tc) local ct=tc:GetTributeRequirement() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local mg=Duel.SelectMatchingCard(tp,aux.AND(Card.IsSetCard,Card.IsAbleToRemove),tp,LOCATION_DECK,0,ct,ct,tc,0x83e) if #mg~=ct or Duel.Remove(mg,POS_FACEUP,REASON_EFFECT)~=ct or mg:FilterCount(Card.IsLocation,nil,LOCATION_REMOVED)0 and c:GetFlagEffect(id)>0 and c:IsAbleToHand() end Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0) end function cid.sumop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SendtoHand(c,nil,REASON_EFFECT) end end