name: Number
card_text: 2 Level 6 monsters
  When this card is Xyz Summoned: You can target 1 "Number" monster in your Graveyard; equip that target to this card. This card gains ATK equal to half the ATK of that equipped monster. Once per turn: You can detach 1 Xyz Material from this card, then send the monster equipped by this effect to the Graveyard; halve your opponent's Life Points. You cannot conduct your Battle Phase the turn you activate this effect.
external_ids: local SETCARD_ID_0 = 0x48 --Number
  
lua: local SETCARD_ID_0 = 0x48 --Number
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 6, 2)
  	c:EnableReviveLimit()
  	--equip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_LEAVE_GRAVE + CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCondition(s.eqcon)
  	e1:SetTarget(s.eqtg)
  	e1:SetOperation(s.eqop)
  	c:RegisterEffect(e1)
  	--lp
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetCountLimit(1)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCost(s.lpcost)
  	e2:SetOperation(s.lpop)
  	c:RegisterEffect(e2)
  end
  aux.xyz_number[id] = 6
  function s.eqcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
  end
  function s.filter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
  end
  function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_SZONE) > 0 and Duel.IsExistingTarget(s.filter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_LEAVE_GRAVE, g, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, g, 1, 0, 0)
  end
  function s.eqop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		if not Duel.Equip(tp, tc, c, false) then
  			return
  		end
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
  		e1:SetCode(EFFECT_EQUIP_LIMIT)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		e1:SetValue(s.eqlimit)
  		tc:RegisterEffect(e1)
  		local atk = math.ceil(tc:GetBaseAttack() / 2)
  		if atk > 0 then
  			local e2 = Effect.CreateEffect(c)
  			e2:SetType(EFFECT_TYPE_EQUIP)
  			e2:SetProperty(EFFECT_FLAG_OWNER_RELATE + EFFECT_FLAG_IGNORE_IMMUNE)
  			e2:SetCode(EFFECT_UPDATE_ATTACK)
  			e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  			e2:SetValue(atk)
  			tc:RegisterEffect(e2)
  		end
  		tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 1)
  	end
  end
  function s.eqlimit(e, c)
  	return e:GetOwner() == c
  end
  function s.lpfilter(c, tp)
  	return c:GetFlagEffect(id) ~= 0 and c:IsControler(tp) and c:IsLocation(LOCATION_SZONE) and c:IsAbleToGraveAsCost()
  end
  function s.lpcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	local eqg = c:GetEquipGroup()
  	if chk == 0 then
  		return Duel.GetCurrentPhase() == PHASE_MAIN1 and eqg:IsExists(s.lpfilter, 1, nil, tp) and c:CheckRemoveOverlayCard(tp, 1, REASON_COST)
  	end
  	c:RemoveOverlayCard(tp, 1, 1, REASON_COST)
  	local ec = eqg:FilterSelect(tp, s.lpfilter, 1, 1, nil, tp)
  	Duel.SendtoGrave(ec, REASON_COST)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_BP)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_OATH)
  	e1:SetTargetRange(1, 0)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  end
  function s.lpop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.SetLP(1 - tp, math.ceil(Duel.GetLP(1 - tp) / 2))
  end
  
  
source_text: Number
  2 Level 6 monsters
  When this card is Xyz Summoned: You can target 1 "Number" monster in your Graveyard; equip that target to this card. This card gains ATK equal to half the ATK of that equipped monster. Once per turn: You can detach 1 Xyz Material from this card, then send the monster equipped by this effect to the Graveyard; halve your opponent's Life Points. You cannot conduct your Battle Phase the turn you activate this effect.
target_text: -- Number
  local SETCARD_ID_0 = 0x48 --Number
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 6, 2)
  	c:EnableReviveLimit()
  	--equip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_LEAVE_GRAVE + CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCondition(s.eqcon)
  	e1:SetTarget(s.eqtg)
  	e1:SetOperation(s.eqop)
  	c:RegisterEffect(e1)
  	--lp
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetCountLimit(1)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCost(s.lpcost)
  	e2:SetOperation(s.lpop)
  	c:RegisterEffect(e2)
  end
  aux.xyz_number[id] = 6
  function s.eqcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
  end
  function s.filter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
  end
  function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_SZONE) > 0 and Duel.IsExistingTarget(s.filter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_LEAVE_GRAVE, g, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, g, 1, 0, 0)
  end
  function s.eqop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		if not Duel.Equip(tp, tc, c, false) then
  			return
  		end
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
  		e1:SetCode(EFFECT_EQUIP_LIMIT)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		e1:SetValue(s.eqlimit)
  		tc:RegisterEffect(e1)
  		local atk = math.ceil(tc:GetBaseAttack() / 2)
  		if atk > 0 then
  			local e2 = Effect.CreateEffect(c)
  			e2:SetType(EFFECT_TYPE_EQUIP)
  			e2:SetProperty(EFFECT_FLAG_OWNER_RELATE + EFFECT_FLAG_IGNORE_IMMUNE)
  			e2:SetCode(EFFECT_UPDATE_ATTACK)
  			e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  			e2:SetValue(atk)
  			tc:RegisterEffect(e2)
  		end
  		tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 1)
  	end
  end
  function s.eqlimit(e, c)
  	return e:GetOwner() == c
  end
  function s.lpfilter(c, tp)
  	return c:GetFlagEffect(id) ~= 0 and c:IsControler(tp) and c:IsLocation(LOCATION_SZONE) and c:IsAbleToGraveAsCost()
  end
  function s.lpcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	local eqg = c:GetEquipGroup()
  	if chk == 0 then
  		return Duel.GetCurrentPhase() == PHASE_MAIN1 and eqg:IsExists(s.lpfilter, 1, nil, tp) and c:CheckRemoveOverlayCard(tp, 1, REASON_COST)
  	end
  	c:RemoveOverlayCard(tp, 1, 1, REASON_COST)
  	local ec = eqg:FilterSelect(tp, s.lpfilter, 1, 1, nil, tp)
  	Duel.SendtoGrave(ec, REASON_COST)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_BP)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_OATH)
  	e1:SetTargetRange(1, 0)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  end
  function s.lpop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.SetLP(1 - tp, math.ceil(Duel.GetLP(1 - tp) / 2))
  end
  
  