--Crashing Cascadmirals --Script by XGlitchy30 function c31231310.initial_effect(c) aux.AddCodeList(c,31231300) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCost(c31231310.cost) e1:SetTarget(c31231310.target) e1:SetOperation(c31231310.activate) c:RegisterEffect(e1) --act in hand local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_TRAP_ACT_IN_HAND) e2:SetCondition(c31231310.handcon) c:RegisterEffect(e2) --spsummon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(31231310,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_GRAVE) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCountLimit(1,31231310) e3:SetCondition(aux.exccon) e3:SetCost(aux.bfgcost) e3:SetTarget(c31231310.sptg) e3:SetOperation(c31231310.spop) c:RegisterEffect(e3) end --c31231310.card_code_list={31231300} --filters function c31231310.cfilter(c) return c:IsSetCard(0x95) and c:IsType(TYPE_SPELL) and c:IsAbleToRemoveAsCost() end function c31231310.spfilter(c,e,tp) return c:IsSetCard(0x3233) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end --Activate function c31231310.handcon(e) return Duel.IsExistingMatchingCard(c31231310.cfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,1,nil) end function c31231310.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end if e:GetHandler():IsStatus(STATUS_ACT_FROM_HAND) then if Duel.IsExistingMatchingCard(c31231310.cfilter,tp,LOCATION_GRAVE,0,1,nil) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,c31231310.cfilter,tp,LOCATION_GRAVE,0,1,1,nil) if g:GetCount()>0 then Duel.Remove(g,POS_FACEUP,REASON_COST) end end end end function c31231310.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(1-tp) end function c31231310.activate(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetTargetRange(1,0) e1:SetValue(c31231310.aclimit) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,p) end function c31231310.aclimit(e,re,tp) local rc=re:GetHandler() return re:IsHasType(EFFECT_TYPE_ACTIVATE) and rc:IsLocation(LOCATION_SZONE) and rc:IsFacedown() end --spsummon function c31231310.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c31231310.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function c31231310.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c31231310.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) local sp=g:GetFirst() if sp then Duel.SpecialSummon(sp,0,tp,tp,false,false,POS_FACEUP) end end