--Skyburner Havoc --Commissioned by: Leon Duvall --Scripted by: XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) --pop backrow local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCondition(cid.drycon) e1:SetCost(cid.drycost) e1:SetTarget(cid.drytg) e1:SetOperation(cid.dryop) c:RegisterEffect(e1) --shuffle local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TODECK) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCondition(cid.movecon) e2:SetTarget(cid.movetg) e2:SetOperation(cid.moveop) c:RegisterEffect(e2) local e2x=e2:Clone() e2x:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2x) local e2y=e2:Clone() e2y:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e2y) end --POP MONSTERS function cid.drycon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(cid.cfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end function cid.drycost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsReleasable() end Duel.Release(e:GetHandler(),REASON_COST) end function cid.drytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsType(TYPE_MONSTER) end if chk==0 then return Duel.IsExistingTarget(Card.IsType,tp,0,LOCATION_MZONE,1,nil,TYPE_MONSTER) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,Card.IsType,tp,0,LOCATION_MZONE,1,2,nil,TYPE_MONSTER) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function cid.dryop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) Duel.Destroy(g,REASON_EFFECT) end --SEQUENCE function cid.movecon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()==1-tp end function cid.movetg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,PLAYER_ALL,LOCATION_GRAVE) end function cid.moveop(e,tp,eg,ep,ev,re,r,rp) local sg=Group.CreateGroup() sg:KeepAlive() for p=0,1 do Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToDeck),p,LOCATION_GRAVE,0,1,3,nil) if #g>0 then sg:Merge(g) end end if #sg>0 then Duel.HintSelection(sg) Duel.SendtoDeck(sg,nil,2,REASON_EFFECT) end sg:DeleteGroup() end