--Created and coded by Rising Phoenix function c100000909.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetDescription(aux.Stringid(100000909,1)) e1:SetTarget(c100000909.target) e1:SetOperation(c100000909.activate) c:RegisterEffect(e1) --search local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(100000909,0)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,100000909) e2:SetCost(c100000909.costh) e2:SetTarget(c100000909.targeth) e2:SetOperation(c100000909.operationh) c:RegisterEffect(e2) --counter local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(100000909,0)) e3:SetCategory(CATEGORY_TODECK) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_GRAVE) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCost(c100000909.ctcost) e3:SetTarget(c100000909.cttg) e3:SetOperation(c100000909.ctop) c:RegisterEffect(e3) end c100000909.fit_monster={100000908} function c100000909.ctcost(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 c100000909.filtershu(c) return c:IsSetCard(0x763) and c:IsAbleToDeck() and c:IsType(TYPE_MONSTER) end function c100000909.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:GetLocation()==LOCATION_GRAVE and chkc:GetControler()==tp and c100000909.filtershu(chkc) end if chk==0 then return Duel.IsExistingTarget(c100000909.filtershu,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,c100000909.filtershu,tp,LOCATION_GRAVE,0,1,7,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0) end function c100000909.tgfilter(c,e) return not c:IsRelateToEffect(e) end function c100000909.ctop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) if tg:IsExists(c100000909.tgfilter,1,nil,e) then return end Duel.SendtoDeck(tg,nil,0,REASON_EFFECT) Duel.ShuffleDeck(tp) end function c100000909.costh(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsDiscardable() end Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD) end function c100000909.filterh(c) return c:IsCode(100000908) and c:IsAbleToHand() end function c100000909.targeth(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.IsExistingMatchingCard(c100000909.filterh,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c100000909.operationh(e,tp,eg,ep,ev,re,r,rp,chk) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c100000909.filterh,tp,LOCATION_DECK,0,0,1,nil) if g:GetCount()>0 then end Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end function c100000909.filter(c,e,tp,m) if bit.band(c:GetType(),0x81)~=0x81 or not c:IsCode(100000908) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end if c.mat_filter then m=m:Filter(c.mat_filter,nil) end return m:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c) end function c100000909.matfilter(c) return c:IsAbleToGrave() and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x763) end function c100000909.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end local mg=Duel.GetMatchingGroup(c100000909.matfilter,tp,LOCATION_DECK,0,nil) return Duel.IsExistingMatchingCard(c100000909.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,mg) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) end function c100000909.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local mg=Duel.GetMatchingGroup(c100000909.matfilter,tp,LOCATION_DECK,0,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tg=Duel.SelectMatchingCard(tp,c100000909.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,mg) if tg:GetCount()>0 then local tc=tg:GetFirst() if tc.mat_filter then mg=mg:Filter(tc.mat_filter,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc) tc:SetMaterial(mat) Duel.SendtoGrave(mat,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL) Duel.BreakEffect() Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) tc:CompleteProcedure() end end