name: Number
card_text: 3 Level 4 monsters
  Once per Chain, during the Battle Step, if your "Battlin' Boxer" monster battles an opponent's monster (Quick Effect): You can detach 1 material from this card; negate the effects of that opponent's monster while it is face-up until the end of this turn, that monster you control cannot be destroyed by that battle, also your opponent takes any battle damage you would have taken from that battle.
external_ids: local SETCARD_ID_0 = 0x1084 --Battlin'
  
lua: local SETCARD_ID_0 = 0x1084 --Battlin'
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 4, 3)
  	c:EnableReviveLimit()
  	--attack up
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(TIMING_BATTLE_PHASE)
  	e1:SetCondition(s.condition)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  aux.xyz_number[id] = 105
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local a = Duel.GetAttacker()
  	local at = Duel.GetAttackTarget()
  	return (Duel.GetCurrentPhase() >= PHASE_BATTLE_START and Duel.GetCurrentPhase() <= PHASE_BATTLE)
  		and at
  		and ((a:IsControler(tp) and a:IsOnField() and a:IsSetCard(SETCARD_ID_0)) or (at:IsControler(tp) and at:IsOnField() and at:IsFaceup() and at:IsSetCard(SETCARD_ID_0)))
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFlagEffect(tp, id) == 0 and e:GetHandler():CheckRemoveOverlayCard(tp, 1, REASON_COST)
  	end
  	e:GetHandler():RemoveOverlayCard(tp, 1, 1, REASON_COST)
  	Duel.RegisterFlagEffect(tp, id, RESET_PHASE + PHASE_DAMAGE, 0, 1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetCard(Duel.GetAttacker())
  	Duel.SetTargetCard(Duel.GetAttackTarget())
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local a = Duel.GetAttacker()
  	local at = Duel.GetAttackTarget()
  	if at:IsControler(tp) then
  		a, at = at, a
  	end
  	if a:IsFacedown() or not a:IsRelateToEffect(e) or not at:IsRelateToEffect(e) then
  		return
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e1:SetValue(1)
  	e1:SetReset(RESET_PHASE + PHASE_DAMAGE)
  	a:RegisterEffect(e1, true)
  	local e2 = Effect.CreateEffect(e:GetHandler())
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
  	e2:SetValue(1)
  	e2:SetReset(RESET_PHASE + PHASE_DAMAGE)
  	a:RegisterEffect(e2, true)
  	if at:IsType(TYPE_EFFECT) then
  		local e3 = Effect.CreateEffect(e:GetHandler())
  		e3:SetType(EFFECT_TYPE_SINGLE)
  		e3:SetCode(EFFECT_DISABLE)
  		e3:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		at:RegisterEffect(e3)
  		local e4 = Effect.CreateEffect(e:GetHandler())
  		e4:SetType(EFFECT_TYPE_SINGLE)
  		e4:SetCode(EFFECT_DISABLE_EFFECT)
  		e4:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		at:RegisterEffect(e4)
  	end
  end
  
  
source_text: Number
  3 Level 4 monsters
  Once per Chain, during the Battle Step, if your "Battlin' Boxer" monster battles an opponent's monster (Quick Effect): You can detach 1 material from this card; negate the effects of that opponent's monster while it is face-up until the end of this turn, that monster you control cannot be destroyed by that battle, also your opponent takes any battle damage you would have taken from that battle.
target_text: -- Number
  local SETCARD_ID_0 = 0x1084 --Battlin'
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 4, 3)
  	c:EnableReviveLimit()
  	--attack up
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(TIMING_BATTLE_PHASE)
  	e1:SetCondition(s.condition)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  aux.xyz_number[id] = 105
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local a = Duel.GetAttacker()
  	local at = Duel.GetAttackTarget()
  	return (Duel.GetCurrentPhase() >= PHASE_BATTLE_START and Duel.GetCurrentPhase() <= PHASE_BATTLE)
  		and at
  		and ((a:IsControler(tp) and a:IsOnField() and a:IsSetCard(SETCARD_ID_0)) or (at:IsControler(tp) and at:IsOnField() and at:IsFaceup() and at:IsSetCard(SETCARD_ID_0)))
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFlagEffect(tp, id) == 0 and e:GetHandler():CheckRemoveOverlayCard(tp, 1, REASON_COST)
  	end
  	e:GetHandler():RemoveOverlayCard(tp, 1, 1, REASON_COST)
  	Duel.RegisterFlagEffect(tp, id, RESET_PHASE + PHASE_DAMAGE, 0, 1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetCard(Duel.GetAttacker())
  	Duel.SetTargetCard(Duel.GetAttackTarget())
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local a = Duel.GetAttacker()
  	local at = Duel.GetAttackTarget()
  	if at:IsControler(tp) then
  		a, at = at, a
  	end
  	if a:IsFacedown() or not a:IsRelateToEffect(e) or not at:IsRelateToEffect(e) then
  		return
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e1:SetValue(1)
  	e1:SetReset(RESET_PHASE + PHASE_DAMAGE)
  	a:RegisterEffect(e1, true)
  	local e2 = Effect.CreateEffect(e:GetHandler())
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
  	e2:SetValue(1)
  	e2:SetReset(RESET_PHASE + PHASE_DAMAGE)
  	a:RegisterEffect(e2, true)
  	if at:IsType(TYPE_EFFECT) then
  		local e3 = Effect.CreateEffect(e:GetHandler())
  		e3:SetType(EFFECT_TYPE_SINGLE)
  		e3:SetCode(EFFECT_DISABLE)
  		e3:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		at:RegisterEffect(e3)
  		local e4 = Effect.CreateEffect(e:GetHandler())
  		e4:SetType(EFFECT_TYPE_SINGLE)
  		e4:SetCode(EFFECT_DISABLE_EFFECT)
  		e4:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		at:RegisterEffect(e4)
  	end
  end
  
  