--created by Windy Gurls, coded by Lyris local s,id=GetID() function s.initial_effect(c) local e1=aux.AddRitualProcEqual2(c,aux.FilterBoolFunction(Card.IsSetCard,0xa40)) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetOperation(s.activate) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_COUNTER) e2:SetCost(aux.bfgcost) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local mg=Duel.GetRitualMaterial(tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(aux.RitualUltimateFilter),tp,LOCATION_HAND,0,1,1,nil,aux.FilterBoolFunction(Card.IsSetCard,0xa40),e,tp,mg,nil,Card.GetLevel,"Equal") local tc=tg:GetFirst() if tc then mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) if tc.mat_filter then mg=mg:Filter(tc.mat_filter,tc,tp) else mg:RemoveCard(tc) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) local lv=Card.GetLevel(tc) aux.GCheckAdditional=aux.RitualCheckAdditional(tc,lv,"Equal") local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,lv,tp,tc,lv,"Equal") aux.GCheckAdditional=nil tc:SetMaterial(mat) Duel.ReleaseRitualMaterial(mat) Duel.BreakEffect() if Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)==0 then return end tc:CompleteProcedure() if tc:IsCanAddCounter(0x1015,1) and Duel.SelectEffectYesNo(tp,e:GetHandler()) then Duel.BreakEffect() tc:AddCounter(0x1015,1) end end end function s.filter(c) return c:GetType()&0x81==0x81 and c:IsSetCard(0xa40) and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsCanAddCounter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,0x1015,1) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,tp,1,LOCATION_DECK) end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if Duel.SendtoHand(g,nil,REASON_EFFECT)==0 or not g:GetFirst():IsLocation(LOCATION_HAND) then return end Duel.ConfirmCards(1-tp,g) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER) local tc=Duel.SelectMatchingCard(tp,Card.IsCanAddCounter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,0x1015,1):GetFirst() if tc then Duel.BreakEffect() tc:AddCounter(0x1015,1) end end