--created by NeverThisAgain, coded by Lyris local s,id=GetID() function s.initial_effect(c) aux.AddOrigPandemoniumType(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_SZONE) e1:SetCountLimit(1,id) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetDescription(1109) e1:SetCondition(aux.PandActCheck) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCountLimit(1,id+1000) e2:SetCategory(CATEGORY_DESTROY) e2:SetDescription(1124) e2:SetCondition(aux.AND(aux.PandActCheck,function(e,tp) return Duel.GetTurnPlayer()~=tp end)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) aux.EnablePandemoniumAttribute(c,e1,e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SUMMON_SUCCESS) e3:SetCountLimit(1,id+2000) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCategory(CATEGORY_TOGRAVE) e3:SetTarget(s.tgtg) e3:SetOperation(s.tgop) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e4) local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e5:SetCode(EVENT_TO_GRAVE) e5:SetCountLimit(1,id+3000) e5:SetProperty(EFFECT_FLAG_CARD_TARGET) e5:SetCategory(CATEGORY_TOHAND) e5:SetTarget(s.tg) e5:SetOperation(s.op) c:RegisterEffect(e5) end function s.thfilter(c) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x9fa) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.Destroy(c,REASON_EFFECT) end end function s.tgfilter(c) return c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsAbleToGrave() and c:IsRace(RACE_REPTILE) end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_EXTRA,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_EXTRA,0,1,1,nil) if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end end function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and chkc:IsSetCard(0x9fa) and chkc:IsAbleToHand() and chkc~=c end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,aux.NecroValleyFilter(aux.AND(Card.IsSetCard,Card.IsAbleToHand)),tp,LOCATION_GRAVE,0,1,1,c,0x9fa) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0) end function s.op(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end