name: Number
card_text: 2 Xyz Monsters with the same Rank, except "Number" monsters
  (This card's original Rank is always treated as 1.)
  You can also Xyz Summon this card by using a "Utopia" monster or "Number F0: Utopic Future" you control as material. (Transfer its materials to this card.) Gains 500 ATK for each "Number" Xyz Monster in the GYs. Cannot be destroyed by battle. Once per turn: You can detach 1 material from this card; this card can make a second attack during each Battle Phase this turn.
external_ids: local CARD_ID_0 = 65305468 --Number F0: Utopic Future
  local SETCARD_ID_0 = 0x107f --Utopia
  local SETCARD_ID_1 = 0x48 --Number
  
lua: local CARD_ID_0 = 65305468 --Number F0: Utopic Future
  local SETCARD_ID_0 = 0x107f --Utopia
  local SETCARD_ID_1 = 0x48 --Number
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	c:EnableReviveLimit()
  	aux.AddXyzProcedureLevelFree(c, s.mfilter, s.xyzcheck, 2, 2, s.ovfilter, aux.Stringid(id, 1))
  	--atkup
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetValue(s.atkval)
  	c:RegisterEffect(e2)
  	--indes
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e3:SetValue(1)
  	c:RegisterEffect(e3)
  	--multi attack
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 0))
  	e4:SetType(EFFECT_TYPE_IGNITION)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetCountLimit(1)
  	e4:SetCondition(s.atkcon)
  	e4:SetCost(s.atkcost)
  	e4:SetTarget(s.atktg)
  	e4:SetOperation(s.atkop)
  	c:RegisterEffect(e4)
  end
  aux.xyz_number[id] = 0
  function s.mfilter(c, xyzc)
  	return c:IsXyzType(TYPE_XYZ) and not c:IsSetCard(SETCARD_ID_1)
  end
  function s.xyzcheck(g)
  	return g:GetClassCount(Card.GetRank) == 1
  end
  function s.ovfilter(c)
  	return c:IsFaceup() and (c:IsSetCard(SETCARD_ID_1) or c:IsCode(CARD_ID_0))
  end
  function s.atkfilter(c)
  	return c:IsType(TYPE_XYZ) and c:IsSetCard(SETCARD_ID_1)
  end
  function s.atkval(e, c)
  	return Duel.GetMatchingGroupCount(s.atkfilter, c:GetControler(), LOCATION_GRAVE, LOCATION_GRAVE, nil) * 500
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsAbleToEnterBP()
  end
  function s.atkcost(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.atktg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():GetEffectCount(EFFECT_EXTRA_ATTACK) == 0
  	end
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetCode(EFFECT_EXTRA_ATTACK)
  		e1:SetValue(1)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		c:RegisterEffect(e1)
  	end
  end
  
  
source_text: Number
  2 Xyz Monsters with the same Rank, except "Number" monsters
  (This card's original Rank is always treated as 1.)
  You can also Xyz Summon this card by using a "Utopia" monster or "Number F0: Utopic Future" you control as material. (Transfer its materials to this card.) Gains 500 ATK for each "Number" Xyz Monster in the GYs. Cannot be destroyed by battle. Once per turn: You can detach 1 material from this card; this card can make a second attack during each Battle Phase this turn.
target_text: -- Number
  local CARD_ID_0 = 65305468 --Number F0: Utopic Future
  local SETCARD_ID_0 = 0x107f --Utopia
  local SETCARD_ID_1 = 0x48 --Number
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	c:EnableReviveLimit()
  	aux.AddXyzProcedureLevelFree(c, s.mfilter, s.xyzcheck, 2, 2, s.ovfilter, aux.Stringid(id, 1))
  	--atkup
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetValue(s.atkval)
  	c:RegisterEffect(e2)
  	--indes
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e3:SetValue(1)
  	c:RegisterEffect(e3)
  	--multi attack
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 0))
  	e4:SetType(EFFECT_TYPE_IGNITION)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetCountLimit(1)
  	e4:SetCondition(s.atkcon)
  	e4:SetCost(s.atkcost)
  	e4:SetTarget(s.atktg)
  	e4:SetOperation(s.atkop)
  	c:RegisterEffect(e4)
  end
  aux.xyz_number[id] = 0
  function s.mfilter(c, xyzc)
  	return c:IsXyzType(TYPE_XYZ) and not c:IsSetCard(SETCARD_ID_1)
  end
  function s.xyzcheck(g)
  	return g:GetClassCount(Card.GetRank) == 1
  end
  function s.ovfilter(c)
  	return c:IsFaceup() and (c:IsSetCard(SETCARD_ID_1) or c:IsCode(CARD_ID_0))
  end
  function s.atkfilter(c)
  	return c:IsType(TYPE_XYZ) and c:IsSetCard(SETCARD_ID_1)
  end
  function s.atkval(e, c)
  	return Duel.GetMatchingGroupCount(s.atkfilter, c:GetControler(), LOCATION_GRAVE, LOCATION_GRAVE, nil) * 500
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsAbleToEnterBP()
  end
  function s.atkcost(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.atktg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():GetEffectCount(EFFECT_EXTRA_ATTACK) == 0
  	end
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetCode(EFFECT_EXTRA_ATTACK)
  		e1:SetValue(1)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		c:RegisterEffect(e1)
  	end
  end
  
  