--Mecha Phantom Beast Ectoaviator local s,id=GetID() function s.initial_effect(c) aux.AddOrigTimeleapType(c,false) aux.AddTimeleapProc(c,4,s.sumcon,s.tlfilter) c:EnableReviveLimit() --This card's ATK/DEF become the number of Tokens on the field x 800 local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_SET_ATTACK) e1:SetValue(s.val) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_SET_DEFENSE) c:RegisterEffect(e2) --Tokens you control cannot be destroyed by battle. local e3=Effect.CreateEffect(c) e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e3:SetType(EFFECT_TYPE_FIELD) e3:SetRange(LOCATION_MZONE) e3:SetTargetRange(LOCATION_ONFIELD,0) e3:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_TOKEN)) e3:SetValue(1) c:RegisterEffect(e3) --If this card is Time Leap Summoned while you control another non-Token "Mecha Phantom Beast" monster: You can Special Summon 1 "Mecha Phantom Beast Token" (Machine/Wind/Level 3/ATK 0/DEF 0). local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_SPSUMMON_SUCCESS) e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetCondition(s.spcon) e4:SetTarget(s.sptg) e4:SetOperation(s.spop) c:RegisterEffect(e4) --Once per turn (Quick Effect): You can Tribute 1 "Mecha Phantom Beast" monster, then target 1 face-up monster your opponent controls; negate its effects until the end of this turn. local e5=Effect.CreateEffect(c) e5:SetCategory(CATEGORY_DESTROY) e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetCode(EVENT_FREE_CHAIN) e5:SetRange(LOCATION_MZONE) e5:SetProperty(EFFECT_FLAG_CARD_TARGET) e5:SetCountLimit(1) e5:SetCost(s.discost) e5:SetTarget(s.distg) e5:SetOperation(s.disop) c:RegisterEffect(e5) end function s.sumcon(e,c) local tp=c:GetControler() local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil) return g:FilterCount(Card.IsType,nil,TYPE_EFFECT)>=1 and g:FilterCount(Card.IsType,nil,TYPE_TOKEN)>=1 end function s.tlfilter(c,e,mg) local tp=c:GetControler() local ef=e:GetHandler():GetFuture() return c:IsLevelBelow(ef-1) and not c:IsType(TYPE_EFFECT) end function s.val(e,c) return Duel.GetMatchingGroupCount(Card.IsType,c:GetControler(),LOCATION_MZONE,LOCATION_MZONE,nil,TYPE_TOKEN)*800 end function s.spfilter(c) return c:IsFaceup() and c:IsSetCard(0x101b) and not c:IsType(TYPE_TOKEN) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsSummonType(SUMMON_TYPE_TIMELEAP) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_MZONE,0,1,c) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,31533705,0x101b,TYPES_TOKEN_MONSTER,0,0,3,RACE_MACHINE,ATTRIBUTE_WIND) end Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.IsPlayerCanSpecialSummonMonster(tp,31533705,0x101b,TYPES_TOKEN_MONSTER,0,0,3,RACE_MACHINE,ATTRIBUTE_WIND) then local token=Duel.CreateToken(tp,72291079) Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP) end end function s.discost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,nil,0x101b) end local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,nil,0x101b) Duel.Release(g,REASON_COST) end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and aux.NegateMonsterFilter(chkc) end if chk==0 then return Duel.IsExistingTarget(aux.NegateMonsterFilter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE) Duel.SelectTarget(tp,aux.NegateMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil) end function s.disop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsCanBeDisabledByEffect(e) then Duel.NegateRelatedChain(tc,RESET_TURN_SET) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetValue(RESET_TURN_SET) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e2) end end