name: Battlin'
card_text: During your Main Phase: You can detach 1 material from a "Battlin' Boxer" Xyz Monster you control, and if you do, Special Summon this card from your hand. You can only use this effect of "Battlin' Boxer Shadow" once per turn.
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)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_XYZ)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		local g = Group.CreateGroup()
  		local mg = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_MZONE, 0, nil)
  		local tc = mg:GetFirst()
  		while tc do
  			g:Merge(tc:GetOverlayGroup())
  			tc = mg:GetNext()
  		end
  		if g:GetCount() == 0 then
  			return false
  		end
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Group.CreateGroup()
  	local mg = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_MZONE, 0, nil)
  	local tc = mg:GetFirst()
  	while tc do
  		g:Merge(tc:GetOverlayGroup())
  		tc = mg:GetNext()
  	end
  	if g:GetCount() == 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVEXYZ)
  	local sg = g:Select(tp, 1, 1, nil)
  	Duel.SendtoGrave(sg, REASON_EFFECT)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
  end
  
  
source_text: Battlin'
  During your Main Phase: You can detach 1 material from a "Battlin' Boxer" Xyz Monster you control, and if you do, Special Summon this card from your hand. You can only use this effect of "Battlin' Boxer Shadow" once per turn.
target_text: -- Battlin'
  local SETCARD_ID_0 = 0x1084 --Battlin'
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_XYZ)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		local g = Group.CreateGroup()
  		local mg = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_MZONE, 0, nil)
  		local tc = mg:GetFirst()
  		while tc do
  			g:Merge(tc:GetOverlayGroup())
  			tc = mg:GetNext()
  		end
  		if g:GetCount() == 0 then
  			return false
  		end
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Group.CreateGroup()
  	local mg = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_MZONE, 0, nil)
  	local tc = mg:GetFirst()
  	while tc do
  		g:Merge(tc:GetOverlayGroup())
  		tc = mg:GetNext()
  	end
  	if g:GetCount() == 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVEXYZ)
  	local sg = g:Select(tp, 1, 1, nil)
  	Duel.SendtoGrave(sg, REASON_EFFECT)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
  end
  
  