name: Number
card_text: 2 Level 7 monsters
  If you control no other monsters, this card can attack directly, but when it does so using this effect, the battle damage inflicted to your opponent is halved. When this card inflicts battle damage to your opponent: You can detach 1 material from this card; inflict 500 damage to your opponent for each card in their hand.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 7, 2)
  	c:EnableReviveLimit()
  	--direct attack
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_DIRECT_ATTACK)
  	e1:SetCondition(s.dircon)
  	c:RegisterEffect(e1)
  	--damage reduce
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
  	e2:SetCondition(s.rdcon)
  	e2:SetValue(aux.ChangeBattleDamage(1, HALF_DAMAGE))
  	c:RegisterEffect(e2)
  	--damage
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_DAMAGE)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e3:SetCode(EVENT_BATTLE_DAMAGE)
  	e3:SetCondition(s.damcon)
  	e3:SetCost(s.damcost)
  	e3:SetTarget(s.damtg)
  	e3:SetOperation(s.damop)
  	c:RegisterEffect(e3)
  end
  aux.xyz_number[id] = 28
  function s.dircon(e)
  	return Duel.GetFieldGroupCount(e:GetHandlerPlayer(), LOCATION_MZONE, 0) <= 1
  end
  function s.rdcon(e)
  	local c = e:GetHandler()
  	local tp = e:GetHandlerPlayer()
  	return Duel.GetAttackTarget() == nil and c:GetEffectCount(EFFECT_DIRECT_ATTACK) < 2 and Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) > 0
  end
  function s.damcon(e, tp, eg, ep, ev, re, r, rp)
  	return ep ~= tp
  end
  function s.damcost(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.damtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local ct = Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND)
  	if chk == 0 then
  		return ct > 0
  	end
  	Duel.SetTargetPlayer(1 - tp)
  	local dam = ct * 500
  	Duel.SetTargetParam(dam)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, dam)
  end
  function s.damop(e, tp, eg, ep, ev, re, r, rp)
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	local dam = Duel.GetFieldGroupCount(p, LOCATION_HAND, 0) * 500
  	Duel.Damage(p, dam, REASON_EFFECT)
  end
  
  
source_text: Number
  2 Level 7 monsters
  If you control no other monsters, this card can attack directly, but when it does so using this effect, the battle damage inflicted to your opponent is halved. When this card inflicts battle damage to your opponent: You can detach 1 material from this card; inflict 500 damage to your opponent for each card in their hand.
target_text: -- Number
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 7, 2)
  	c:EnableReviveLimit()
  	--direct attack
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_DIRECT_ATTACK)
  	e1:SetCondition(s.dircon)
  	c:RegisterEffect(e1)
  	--damage reduce
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
  	e2:SetCondition(s.rdcon)
  	e2:SetValue(aux.ChangeBattleDamage(1, HALF_DAMAGE))
  	c:RegisterEffect(e2)
  	--damage
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_DAMAGE)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e3:SetCode(EVENT_BATTLE_DAMAGE)
  	e3:SetCondition(s.damcon)
  	e3:SetCost(s.damcost)
  	e3:SetTarget(s.damtg)
  	e3:SetOperation(s.damop)
  	c:RegisterEffect(e3)
  end
  aux.xyz_number[id] = 28
  function s.dircon(e)
  	return Duel.GetFieldGroupCount(e:GetHandlerPlayer(), LOCATION_MZONE, 0) <= 1
  end
  function s.rdcon(e)
  	local c = e:GetHandler()
  	local tp = e:GetHandlerPlayer()
  	return Duel.GetAttackTarget() == nil and c:GetEffectCount(EFFECT_DIRECT_ATTACK) < 2 and Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) > 0
  end
  function s.damcon(e, tp, eg, ep, ev, re, r, rp)
  	return ep ~= tp
  end
  function s.damcost(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.damtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local ct = Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND)
  	if chk == 0 then
  		return ct > 0
  	end
  	Duel.SetTargetPlayer(1 - tp)
  	local dam = ct * 500
  	Duel.SetTargetParam(dam)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, dam)
  end
  function s.damop(e, tp, eg, ep, ev, re, r, rp)
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	local dam = Duel.GetFieldGroupCount(p, LOCATION_HAND, 0) * 500
  	Duel.Damage(p, dam, REASON_EFFECT)
  end
  
  