--Kerubiel, Combattente Ængelico || Kerubiel, Ængelic Battler --Scripted by: XGlitchy30 local s,id=GetID() function s.initial_effect(c) --cannot remove local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_CANNOT_BANISH) e1:SetRange(LOCATION_MZONE) e1:SetValue(POS_FACEDOWN) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,id) e2:SetCost(s.spcost) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --shuffle local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_TODECK+CATEGORY_REMOVE) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetTarget(s.target) e3:SetOperation(s.activate) c:RegisterEffect(e3) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) end function s.counterfilter(c) return c:IsSetCard(0xae6) end --spsummon function s.cfilter(c) return c:IsAbleToRemoveAsCost(POS_FACEDOWN) and c:IsSetCard(0xae6) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,e:GetHandler()) end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetReset(RESET_PHASE+PHASE_END) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) Duel.RegisterEffect(e1,tp) -- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,e:GetHandler()) Duel.Remove(g,POS_FACEDOWN,REASON_COST) end function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) return not s.counterfilter(c) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end --shuffle function s.filter1(c,tp) return c:IsFacedown() and c:IsAbleToDeck() and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_DECK,0,1,c,tp) end function s.filter2(c,tp) return c:IsSetCard(0xae6) and c:IsAbleToRemove(tp,POS_FACEDOWN) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter1,tp,LOCATION_REMOVED,0,1,nil,tp) end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_REMOVED,0,nil,tp) if #g<1 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local dg=g:Select(tp,1,1,nil) Duel.HintSelection(dg) if Duel.SendtoDeck(dg,nil,2,REASON_EFFECT)>0 and dg:GetFirst():IsLocation(LOCATION_DECK+LOCATION_EXTRA) and dg:GetFirst():IsControler(tp) then local sg=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_DECK,0,nil,tp) if #sg==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local hg=sg:Select(tp,1,1,nil) Duel.ConfirmCards(1-tp,hg) Duel.Remove(hg,POS_FACEDOWN,REASON_EFFECT) end end