name: Number
card_text: 2 Level 4 monsters
  Once per turn, you can either: Target 1 face-up Xyz Monster you control; equip this card to that target, OR: Unequip this card and Special Summon it in Attack Position. The equipped monster can attack your opponent directly. When the equipped monster inflicts battle damage to your opponent: You can discard 1 card; inflict 500 damage to your opponent.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 4, 2)
  	c:EnableReviveLimit()
  	--equip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCategory(CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTarget(s.eqtg)
  	e1:SetOperation(s.eqop)
  	c:RegisterEffect(e1)
  	--unequip
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  	--direct
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_EQUIP)
  	e3:SetCode(EFFECT_DIRECT_ATTACK)
  	c:RegisterEffect(e3)
  	--damage
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 2))
  	e4:SetCategory(CATEGORY_DAMAGE)
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e4:SetCode(EVENT_BATTLE_DAMAGE)
  	e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e4:SetRange(LOCATION_SZONE)
  	e4:SetCondition(s.damcon)
  	e4:SetCost(s.damcost)
  	e4:SetTarget(s.damtg)
  	e4:SetOperation(s.damop)
  	c:RegisterEffect(e4)
  end
  aux.xyz_number[id] = 58
  function s.filter(c)
  	return c:IsFaceup() and c:IsType(TYPE_XYZ)
  end
  function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) and chkc ~= e:GetHandler()
  	end
  	if chk == 0 then
  		return e:GetHandler():GetFlagEffect(id) == 0 and Duel.GetLocationCount(tp, LOCATION_SZONE) > 0 and Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, 0, 1, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, 0, 1, 1, e:GetHandler())
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, g, 1, 0, 0)
  	e:GetHandler():RegisterFlagEffect(id, RESET_EVENT + 0x7e0000 + RESET_PHASE + PHASE_END, 0, 1)
  end
  function s.eqop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if not c:IsRelateToEffect(e) or c:IsFacedown() then
  		return
  	end
  	if not tc:IsRelateToEffect(e) or tc:IsFacedown() or tc:IsControler(1 - tp) then
  		Duel.SendtoGrave(c, REASON_EFFECT)
  		return
  	end
  	if not Duel.Equip(tp, c, tc, false) then
  		return
  	end
  	--eqlimit
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetCode(EFFECT_EQUIP_LIMIT)
  	e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e4:SetValue(s.eqlimit)
  	e4:SetReset(RESET_EVENT + RESETS_STANDARD)
  	e4:SetLabelObject(tc)
  	c:RegisterEffect(e4)
  end
  function s.eqlimit(e, c)
  	return c == e:GetLabelObject()
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:GetFlagEffect(id) == 0 and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and c:GetEquipTarget() and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP_ATTACK)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
  	c:RegisterFlagEffect(id, RESET_EVENT + 0x7e0000 + RESET_PHASE + PHASE_END, 0, 1)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP_ATTACK)
  end
  function s.damcon(e, tp, eg, ep, ev, re, r, rp)
  	return ep ~= tp and eg:GetFirst() == e:GetHandler():GetEquipTarget()
  end
  function s.damcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsDiscardable, tp, LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.DiscardHand(tp, Card.IsDiscardable, 1, 1, REASON_COST + REASON_DISCARD)
  end
  function s.damtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(1 - tp)
  	Duel.SetTargetParam(500)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, 500)
  end
  function s.damop(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Damage(p, d, REASON_EFFECT)
  end
  
  
source_text: Number
  2 Level 4 monsters
  Once per turn, you can either: Target 1 face-up Xyz Monster you control; equip this card to that target, OR: Unequip this card and Special Summon it in Attack Position. The equipped monster can attack your opponent directly. When the equipped monster inflicts battle damage to your opponent: You can discard 1 card; inflict 500 damage to your opponent.
target_text: -- Number
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 4, 2)
  	c:EnableReviveLimit()
  	--equip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCategory(CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTarget(s.eqtg)
  	e1:SetOperation(s.eqop)
  	c:RegisterEffect(e1)
  	--unequip
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  	--direct
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_EQUIP)
  	e3:SetCode(EFFECT_DIRECT_ATTACK)
  	c:RegisterEffect(e3)
  	--damage
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 2))
  	e4:SetCategory(CATEGORY_DAMAGE)
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e4:SetCode(EVENT_BATTLE_DAMAGE)
  	e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e4:SetRange(LOCATION_SZONE)
  	e4:SetCondition(s.damcon)
  	e4:SetCost(s.damcost)
  	e4:SetTarget(s.damtg)
  	e4:SetOperation(s.damop)
  	c:RegisterEffect(e4)
  end
  aux.xyz_number[id] = 58
  function s.filter(c)
  	return c:IsFaceup() and c:IsType(TYPE_XYZ)
  end
  function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) and chkc ~= e:GetHandler()
  	end
  	if chk == 0 then
  		return e:GetHandler():GetFlagEffect(id) == 0 and Duel.GetLocationCount(tp, LOCATION_SZONE) > 0 and Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, 0, 1, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, 0, 1, 1, e:GetHandler())
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, g, 1, 0, 0)
  	e:GetHandler():RegisterFlagEffect(id, RESET_EVENT + 0x7e0000 + RESET_PHASE + PHASE_END, 0, 1)
  end
  function s.eqop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if not c:IsRelateToEffect(e) or c:IsFacedown() then
  		return
  	end
  	if not tc:IsRelateToEffect(e) or tc:IsFacedown() or tc:IsControler(1 - tp) then
  		Duel.SendtoGrave(c, REASON_EFFECT)
  		return
  	end
  	if not Duel.Equip(tp, c, tc, false) then
  		return
  	end
  	--eqlimit
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetCode(EFFECT_EQUIP_LIMIT)
  	e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e4:SetValue(s.eqlimit)
  	e4:SetReset(RESET_EVENT + RESETS_STANDARD)
  	e4:SetLabelObject(tc)
  	c:RegisterEffect(e4)
  end
  function s.eqlimit(e, c)
  	return c == e:GetLabelObject()
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:GetFlagEffect(id) == 0 and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and c:GetEquipTarget() and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP_ATTACK)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
  	c:RegisterFlagEffect(id, RESET_EVENT + 0x7e0000 + RESET_PHASE + PHASE_END, 0, 1)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP_ATTACK)
  end
  function s.damcon(e, tp, eg, ep, ev, re, r, rp)
  	return ep ~= tp and eg:GetFirst() == e:GetHandler():GetEquipTarget()
  end
  function s.damcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsDiscardable, tp, LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.DiscardHand(tp, Card.IsDiscardable, 1, 1, REASON_COST + REASON_DISCARD)
  end
  function s.damtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(1 - tp)
  	Duel.SetTargetParam(500)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, 500)
  end
  function s.damop(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Damage(p, d, REASON_EFFECT)
  end
  
  