--Skyburner Mobile Command --Commissioned by: Leon Duvall --Scripted by: Remnance --Bugfixing by: XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetRange(LOCATION_FZONE) e2:SetCountLimit(1,id) e2:SetCondition(cid.spcon) e2:SetTarget(cid.sptg) e2:SetOperation(cid.spop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e3) local e4=e2:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e4) --return local e5=Effect.CreateEffect(c) e5:SetCategory(CATEGORY_TOHAND) e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e5:SetCode(EVENT_PHASE+PHASE_END) e5:SetRange(LOCATION_FZONE) e5:SetCountLimit(1) e5:SetCondition(cid.rtcon) e5:SetTarget(cid.rttg) e5:SetOperation(cid.rtop) c:RegisterEffect(e5) --cannot target local e6=Effect.CreateEffect(c) e6:SetType(EFFECT_TYPE_SINGLE) e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e6:SetRange(LOCATION_FZONE) e6:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e6:SetCondition(cid.indcon) e6:SetValue(aux.tgoval) c:RegisterEffect(e6) local e7=Effect.CreateEffect(c) e7:SetType(EFFECT_TYPE_SINGLE) e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e7:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e7:SetRange(LOCATION_FZONE) e7:SetCondition(cid.indcon) e7:SetValue(aux.indoval) c:RegisterEffect(e7) end --filters function cid.cfilter(c,tp) return c:IsSetCard(0xf41) and c:IsType(TYPE_MONSTER) and c:GetSummonPlayer()==tp and Duel.GetTurnPlayer()~=tp and c:GetSummonType()~=SUMMON_TYPE_SPECIAL+1 end function cid.spfilter(c,e,tp) return c:IsSetCard(0xf41) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,1,tp,false,false) end function cid.rtfilter(c) return c:IsSetCard(0xf41) and c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_FUSION) and c:IsAbleToHand() end function cid.cfilter1(c) return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsSetCard(0xf41) end --special summon function cid.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(cid.cfilter,1,nil,tp) end function cid.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cid.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function cid.spop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,cid.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,1,tp,tp,false,false,POS_FACEUP) end end --return function cid.rtcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()~=tp end function cid.rttg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=Duel.GetMatchingGroup(cid.rtfilter,tp,LOCATION_MZONE,0,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0) end function cid.rtop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local g=Duel.GetMatchingGroup(cid.rtfilter,tp,LOCATION_MZONE,0,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) end end -- function cid.indcon(e) return Duel.IsExistingMatchingCard(cid.cfilter1,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end