name: Number
card_text: 2 Level 1 monsters
  Once per turn, during either player's turn: You can detach 1 Xyz Material from this card; change all monsters your opponent controls to face-up Attack Position, also all monsters your opponent currently controls must attack this card this turn, if able. While you control "Number 31: Embodiment of Punishment", this card gains these effects.
  ● This card cannot be destroyed by battle or by card effects while it has Xyz Material.
  ● Your opponent takes any battle damage you would have taken from attacks on this card.
external_ids: local CARD_ID_0 = 95442074 --Number 31: Embodiment of Punishment
  
lua: local CARD_ID_0 = 95442074 --Number 31: Embodiment of Punishment
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 1, 2)
  	c:EnableReviveLimit()
  	--pos
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_POSITION)
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e2:SetCondition(s.indcon)
  	e2:SetValue(1)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	c:RegisterEffect(e3)
  	--reflect
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
  	e4:SetCondition(s.refcon)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  end
  aux.xyz_number[id] = 13
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():CheckRemoveOverlayCard(tp, 1, REASON_COST)
  	end
  	e:GetHandler():RemoveOverlayCard(tp, 1, 1, REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) > 0
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local g = Duel.GetFieldGroup(tp, 0, LOCATION_MZONE)
  	if g:GetCount() > 0 then
  		Duel.ChangePosition(g, POS_FACEUP_ATTACK)
  		local fid = c:GetRealFieldID()
  		local tc = g:GetFirst()
  		while tc do
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetCode(EFFECT_MUST_ATTACK)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  			tc:RegisterEffect(e1)
  			local e2 = e1:Clone()
  			e2:SetCode(EFFECT_MUST_ATTACK_MONSTER)
  			e2:SetValue(s.atklimit)
  			e2:SetLabel(fid)
  			tc:RegisterEffect(e2)
  			tc = g:GetNext()
  		end
  	end
  end
  function s.atklimit(e, c)
  	return c:GetRealFieldID() == e:GetLabel()
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0)
  end
  function s.indcon(e)
  	return Duel.IsExistingMatchingCard(s.filter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, 1, nil) and e:GetHandler():GetOverlayCount() ~= 0
  end
  function s.refcon(e)
  	return Duel.IsExistingMatchingCard(s.filter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, 1, nil) and Duel.GetAttackTarget() == e:GetHandler()
  end
  
  
source_text: Number
  2 Level 1 monsters
  Once per turn, during either player's turn: You can detach 1 Xyz Material from this card; change all monsters your opponent controls to face-up Attack Position, also all monsters your opponent currently controls must attack this card this turn, if able. While you control "Number 31: Embodiment of Punishment", this card gains these effects.
  ● This card cannot be destroyed by battle or by card effects while it has Xyz Material.
  ● Your opponent takes any battle damage you would have taken from attacks on this card.
target_text: -- Number
  local CARD_ID_0 = 95442074 --Number 31: Embodiment of Punishment
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 1, 2)
  	c:EnableReviveLimit()
  	--pos
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_POSITION)
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e2:SetCondition(s.indcon)
  	e2:SetValue(1)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	c:RegisterEffect(e3)
  	--reflect
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
  	e4:SetCondition(s.refcon)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  end
  aux.xyz_number[id] = 13
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():CheckRemoveOverlayCard(tp, 1, REASON_COST)
  	end
  	e:GetHandler():RemoveOverlayCard(tp, 1, 1, REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) > 0
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local g = Duel.GetFieldGroup(tp, 0, LOCATION_MZONE)
  	if g:GetCount() > 0 then
  		Duel.ChangePosition(g, POS_FACEUP_ATTACK)
  		local fid = c:GetRealFieldID()
  		local tc = g:GetFirst()
  		while tc do
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetCode(EFFECT_MUST_ATTACK)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  			tc:RegisterEffect(e1)
  			local e2 = e1:Clone()
  			e2:SetCode(EFFECT_MUST_ATTACK_MONSTER)
  			e2:SetValue(s.atklimit)
  			e2:SetLabel(fid)
  			tc:RegisterEffect(e2)
  			tc = g:GetNext()
  		end
  	end
  end
  function s.atklimit(e, c)
  	return c:GetRealFieldID() == e:GetLabel()
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0)
  end
  function s.indcon(e)
  	return Duel.IsExistingMatchingCard(s.filter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, 1, nil) and e:GetHandler():GetOverlayCount() ~= 0
  end
  function s.refcon(e)
  	return Duel.IsExistingMatchingCard(s.filter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, 1, nil) and Duel.GetAttackTarget() == e:GetHandler()
  end
  
  