--created by Zolanark, coded by Lyris local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.EnablePendulumAttribute(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_TO_HAND) e1:SetRange(LOCATION_PZONE) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND) e1:SetCondition(s.pcon) e1:SetTarget(s.ptg) e1:SetOperation(s.pop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_RECOVER) e2:SetTarget(s.mtg) e2:SetOperation(s.mop) c:RegisterEffect(e2) end function s.cfilter(c,tp) return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK) end function s.pcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,1-tp) end function s.cfilter2(c) return c:IsSetCard(0x89f) and c:IsDestructable() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsDestructable() and Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Destroy(Duel.SelectMatchingCard(tp,s.cfilter2,tp,LOCATION_HAND,0,1,1,nil)+c,REASON_COST) end function s.ptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>1 end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,1-tp,LOCATION_HAND) end function s.filter(c) return c:IsSetCard(0x89f) and c:IsAbleToHand() end function s.pop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)<2 then return end local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(tp,2) if Duel.SendtoDeck(g,nil,2,REASON_EFFECT)<2 or g:FilterCount(Card.IsLocation,nil,LOCATION_DECK)<2 then return end local dg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil) if #dg>0 and Duel.SelectYesNo(tp,1109) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=dg:Select(tp,1,1,nil) Duel.BreakEffect() Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sg) end end function s.mtg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsDestructable() and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) end local ct=Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,c) Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*300) end function s.mop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 then local ct=Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil) Duel.Recover(tp,ct*300,REASON_EFFECT) end end