--created by Swag, coded by Lyris local s,id=GetID() function s.initial_effect(c) local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetCode(EVENT_FREE_CHAIN) e0:SetCountLimit(1,id) e0:SetCategory(CATEGORY_TODECK+CATEGORY_DAMAGE) e0:SetTarget(s.target) e0:SetOperation(s.activate) c:RegisterEffect(e0) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_TO_GRAVE) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id-7) e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TOGRAVE) e1:SetCondition(s.tgcon) e1:SetTarget(s.tgtg) e1:SetOperation(s.tgop) c:RegisterEffect(e1) end function s.cfilter(c) return c:IsSetCard(0x9b5) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_GRAVE,0,nil) if chk==0 then return #g>=15 end Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,3500) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_GRAVE,0,nil) if Duel.SendtoDeck(g,nil,2,REASON_EFFECT)==0 or not g:IsExists(Card.IsLocation,#g,nil,LOCATION_DECK) or g:IsExists(Card.IsControler,1,nil,1-tp) then return end Duel.BreakEffect() Duel.Damage(1-tp,3500,REASON_EFFECT) end function s.tgcon(e,tp,eg,ep,ev,re,r,rp) return r&REASON_EFFECT~=0 end function s.filter(c) return c:IsAbleToGrave() and c:IsLevelBelow(6) and c:IsLevelAbove(1) and c:IsSetCard(0x9b5) and c:IsType(TYPE_MONSTER) end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToRemove() and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or Duel.Remove(c,POS_FACEUP,REASON_EFFECT)==0 or not c:IsLocation(LOCATION_REMOVED) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.BreakEffect() Duel.SendtoGrave(g,REASON_EFFECT) end end