name: Number
card_text: 3 Level 4 monsters
  When this card is Special Summoned: You can target 1 monster your opponent controls; this card gains ATK equal to that monster's current ATK. If your opponent controls more cards than you do: You can detach 1 Xyz Material from this card, then choose 1 unused Main Monster Zone or Spell & Trap Zone; while this card is face-up on the field, that zone cannot be used.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 4, 3)
  	c:EnableReviveLimit()
  	--atkup
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DAMAGE_STEP)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetTarget(s.atktg)
  	e1:SetOperation(s.atkop)
  	c:RegisterEffect(e1)
  	--disable zone
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCondition(s.zcon)
  	e2:SetCost(s.zcost)
  	e2:SetTarget(s.ztg)
  	e2:SetOperation(s.zop)
  	c:RegisterEffect(e2)
  end
  aux.xyz_number[id] = 57
  function s.atktg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsControler(1 - tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(Card.IsFaceup, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, Card.IsFaceup, tp, 0, LOCATION_MZONE, 1, 1, nil)
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(tc:GetAttack())
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  		c:RegisterEffect(e1)
  	end
  end
  function s.zcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFieldGroupCount(tp, 0, LOCATION_ONFIELD) > Duel.GetFieldGroupCount(tp, LOCATION_ONFIELD, 0)
  end
  function s.zcost(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.ztg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE, PLAYER_NONE, 0)
  				+ Duel.GetLocationCount(1 - tp, LOCATION_MZONE, PLAYER_NONE, 0)
  				+ Duel.GetLocationCount(tp, LOCATION_SZONE, PLAYER_NONE, 0)
  				+ Duel.GetLocationCount(1 - tp, LOCATION_SZONE, PLAYER_NONE, 0)
  			> 0
  	end
  	local dis = Duel.SelectDisableField(tp, 1, LOCATION_ONFIELD, LOCATION_ONFIELD, 0xe000e0)
  	e:SetLabel(dis)
  	Duel.Hint(HINT_ZONE, tp, dis)
  end
  function s.zop(e, tp, eg, ep, ev, re, r, rp)
  	local zone = e:GetLabel()
  	if tp == 1 then
  		zone = ((zone & 0xffff) << 16) | ((zone >> 16) & 0xffff)
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EFFECT_DISABLE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetValue(zone)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  	e:GetHandler():RegisterEffect(e1)
  end
  
  
source_text: Number
  3 Level 4 monsters
  When this card is Special Summoned: You can target 1 monster your opponent controls; this card gains ATK equal to that monster's current ATK. If your opponent controls more cards than you do: You can detach 1 Xyz Material from this card, then choose 1 unused Main Monster Zone or Spell & Trap Zone; while this card is face-up on the field, that zone cannot be used.
target_text: -- Number
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 4, 3)
  	c:EnableReviveLimit()
  	--atkup
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DAMAGE_STEP)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetTarget(s.atktg)
  	e1:SetOperation(s.atkop)
  	c:RegisterEffect(e1)
  	--disable zone
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCondition(s.zcon)
  	e2:SetCost(s.zcost)
  	e2:SetTarget(s.ztg)
  	e2:SetOperation(s.zop)
  	c:RegisterEffect(e2)
  end
  aux.xyz_number[id] = 57
  function s.atktg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsControler(1 - tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(Card.IsFaceup, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, Card.IsFaceup, tp, 0, LOCATION_MZONE, 1, 1, nil)
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(tc:GetAttack())
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  		c:RegisterEffect(e1)
  	end
  end
  function s.zcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFieldGroupCount(tp, 0, LOCATION_ONFIELD) > Duel.GetFieldGroupCount(tp, LOCATION_ONFIELD, 0)
  end
  function s.zcost(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.ztg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE, PLAYER_NONE, 0)
  				+ Duel.GetLocationCount(1 - tp, LOCATION_MZONE, PLAYER_NONE, 0)
  				+ Duel.GetLocationCount(tp, LOCATION_SZONE, PLAYER_NONE, 0)
  				+ Duel.GetLocationCount(1 - tp, LOCATION_SZONE, PLAYER_NONE, 0)
  			> 0
  	end
  	local dis = Duel.SelectDisableField(tp, 1, LOCATION_ONFIELD, LOCATION_ONFIELD, 0xe000e0)
  	e:SetLabel(dis)
  	Duel.Hint(HINT_ZONE, tp, dis)
  end
  function s.zop(e, tp, eg, ep, ev, re, r, rp)
  	local zone = e:GetLabel()
  	if tp == 1 then
  		zone = ((zone & 0xffff) << 16) | ((zone >> 16) & 0xffff)
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EFFECT_DISABLE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetValue(zone)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  	e:GetHandler():RegisterEffect(e1)
  end
  
  