--Sven, Rear Cascad --Script by XGlitchy30 function c31231311.initial_effect(c) --xyz summon aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_AQUA),2,3) c:EnableReviveLimit() --destroy spell/trap local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(31231311,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_DAMAGE_STEP_END) e1:SetCondition(c31231311.stcon) e1:SetCost(c31231311.stcost) e1:SetTarget(c31231311.sttg) e1:SetOperation(c31231311.stop) c:RegisterEffect(e1) --extra attacks local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_EXTRA_ATTACK) e2:SetCondition(c31231311.atcon) e2:SetValue(c31231311.atval) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e3:SetCode(EVENT_PRE_BATTLE_DAMAGE) e3:SetCondition(c31231311.rdcon) e3:SetOperation(c31231311.rdop) c:RegisterEffect(e3) --spsummon local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(31231311,1)) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_GRAVE) e4:SetCost(c31231311.hspcost) e4:SetTarget(c31231311.hsptg) e4:SetOperation(c31231311.hspop) c:RegisterEffect(e4) end --filters function c31231311.stfilter(c) return c:IsType(TYPE_SPELL+TYPE_TRAP) end function c31231311.atfilter(c) return c:IsSetCard(0x3233) and c:IsType(TYPE_MONSTER) end function c31231311.rfilter(c) return c:IsRace(RACE_AQUA) and c:IsAbleToRemoveAsCost() end --destroy spell/trap function c31231311.stcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler()==Duel.GetAttacker() and e:GetHandler():IsRelateToBattle() end function c31231311.stcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) end function c31231311.sttg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c31231311.stfilter,tp,0,LOCATION_ONFIELD,1,nil) end Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,1-tp,LOCATION_ONFIELD) end function c31231311.stop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,c31231311.stfilter,tp,0,LOCATION_ONFIELD,1,1,nil) local tc=g:GetFirst() if tc then Duel.Destroy(tc,REASON_EFFECT) end end --extra attacks function c31231311.atcon(e) return e:GetHandler():GetOverlayGroup():IsExists(c31231311.atfilter,1,nil) end function c31231311.atval(e,c) local oc=e:GetHandler():GetOverlayCount() return math.max(0,oc-1) end function c31231311.rdcon(e,tp,eg,ep,ev,re,r,rp) return ep~=tp and e:GetHandler():GetOverlayGroup():IsExists(c31231311.atfilter,1,nil) end function c31231311.rdop(e,tp,eg,ep,ev,re,r,rp) Duel.ChangeBattleDamage(ep,ev/2) end --spsummon function c31231311.hspcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c31231311.rfilter,tp,LOCATION_GRAVE,0,2,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,c31231311.rfilter,tp,LOCATION_GRAVE,0,2,2,e:GetHandler()) Duel.Remove(g,POS_FACEUP,REASON_COST) end function c31231311.hsptg(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 c31231311.hspop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end