--Battlin' Boxer Punching Phoenix local s,id=GetID() function s.initial_effect(c) aux.AddOrigTimeleapType(c,false) aux.AddTimeleapProc(c,5,s.sumcon,s.tlfilter) c:EnableReviveLimit() --Gains 200 ATK for each "Battlin' Boxer" monster you control. local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetRange(LOCATION_MZONE) e1:SetValue(s.val) c:RegisterEffect(e1) --When your opponent activates a card or effect during the Battle Phase (Quick Effect): You can negate the activation, and if you do, destroy that card, and if you do that, inflict 800 damage to your opponent. local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY+CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,0}) e2:SetCondition(s.discon) e2:SetTarget(s.distg) e2:SetOperation(s.disop) c:RegisterEffect(e2) --If this card on the field is destroyed by battle or card effect: You can target 1 "Battlin' Boxer" monster in your GY; Special Summon it. local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_DESTROYED) e3:SetCountLimit(1,{id,1}) e3:SetCondition(s.spcon) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) aux.GlobalCheck(s,function() local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_BATTLED) ge1:SetLabel(id) ge1:SetOperation(s.regop) Duel.RegisterEffect(ge1,0) end) end function s.sumcon(e,c) return Duel.GetFlagEffect(e:GetHandlerPlayer(),id)>0 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_TOKEN) end function s.val(e,c) return Duel.GetMatchingGroupCount(s.filter,c:GetControler(),LOCATION_MZONE,0,nil)*200 end function s.filter(c) return c:IsFaceup() and c:IsSetCard(0x1084) end function s.discon(e,tp,eg,ep,ev,re,r,rp) return rp~=tp and Duel.IsBattlePhase() and Duel.IsChainNegatable(ev) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800) end end function s.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then if Duel.Destroy(eg,REASON_EFFECT)>0 then Duel.Damage(1-tp,800,REASON_EFFECT) end end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and (r&REASON_EFFECT+REASON_BATTLE)~=0 end function s.spfilter(c,e,tp) return c:IsMonster() and c:IsSetCard(0x1084) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end function s.regop(e,tp,eg,ep,ev,re,r,rp) Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(1-tp,id,RESET_PHASE+PHASE_END,0,1) end