name: Number
card_text: 3 Level 5 monsters
  Once per turn: You can target 1 Special Summoned monster your opponent controls; attach it to this card as material. When this card is destroyed and sent to the GY while it has material: You can Special Summon this card from your GY, then gain LP equal to the original ATK of this card. "Number 101: Silent Honor ARK" must be in your GY to activate and to resolve this effect. If this card is Special Summoned this way, it cannot attack for the rest of this turn.
external_ids: local CARD_ID_0 = 48739166 --Number 101: Silent Honor ARK
  
lua: local CARD_ID_0 = 48739166 --Number 101: Silent Honor ARK
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 5, 3)
  	c:EnableReviveLimit()
  	--material
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--spsummon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_RECOVER)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_ACTIVATE_CONDITION)
  	e2:SetCode(EVENT_TO_GRAVE)
  	e2:SetCondition(s.spcon)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  end
  aux.xyz_number[id] = 101
  function s.filter(c)
  	return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsCanOverlay()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return e:GetHandler():IsType(TYPE_XYZ) and Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_XMATERIAL)
  	Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) and not tc:IsImmuneToEffect(e) then
  		local og = tc:GetOverlayGroup()
  		if og:GetCount() > 0 then
  			Duel.SendtoGrave(og, REASON_RULE)
  		end
  		Duel.Overlay(c, Group.FromCards(tc))
  	end
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return c:IsReason(REASON_DESTROY)
  		and c:IsPreviousLocation(LOCATION_MZONE)
  		and c:GetPreviousOverlayCountOnField() > 0
  		and Duel.IsExistingMatchingCard(Card.IsCode, tp, LOCATION_GRAVE, 0, 1, nil, CARD_ID_0)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  	local rec = e:GetHandler():GetBaseAttack()
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(rec)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, rec)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if not Duel.IsExistingMatchingCard(Card.IsCode, tp, LOCATION_GRAVE, 0, 1, nil, CARD_ID_0) then
  		return
  	end
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) > 0 then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_CANNOT_ATTACK)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		c:RegisterEffect(e1)
  		Duel.BreakEffect()
  		local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  		Duel.Recover(p, d, REASON_EFFECT)
  	end
  end
  
  
source_text: Number
  3 Level 5 monsters
  Once per turn: You can target 1 Special Summoned monster your opponent controls; attach it to this card as material. When this card is destroyed and sent to the GY while it has material: You can Special Summon this card from your GY, then gain LP equal to the original ATK of this card. "Number 101: Silent Honor ARK" must be in your GY to activate and to resolve this effect. If this card is Special Summoned this way, it cannot attack for the rest of this turn.
target_text: -- Number
  local CARD_ID_0 = 48739166 --Number 101: Silent Honor ARK
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 5, 3)
  	c:EnableReviveLimit()
  	--material
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--spsummon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_RECOVER)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_ACTIVATE_CONDITION)
  	e2:SetCode(EVENT_TO_GRAVE)
  	e2:SetCondition(s.spcon)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  end
  aux.xyz_number[id] = 101
  function s.filter(c)
  	return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsCanOverlay()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return e:GetHandler():IsType(TYPE_XYZ) and Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_XMATERIAL)
  	Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) and not tc:IsImmuneToEffect(e) then
  		local og = tc:GetOverlayGroup()
  		if og:GetCount() > 0 then
  			Duel.SendtoGrave(og, REASON_RULE)
  		end
  		Duel.Overlay(c, Group.FromCards(tc))
  	end
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return c:IsReason(REASON_DESTROY)
  		and c:IsPreviousLocation(LOCATION_MZONE)
  		and c:GetPreviousOverlayCountOnField() > 0
  		and Duel.IsExistingMatchingCard(Card.IsCode, tp, LOCATION_GRAVE, 0, 1, nil, CARD_ID_0)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  	local rec = e:GetHandler():GetBaseAttack()
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(rec)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, rec)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if not Duel.IsExistingMatchingCard(Card.IsCode, tp, LOCATION_GRAVE, 0, 1, nil, CARD_ID_0) then
  		return
  	end
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) > 0 then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_CANNOT_ATTACK)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		c:RegisterEffect(e1)
  		Duel.BreakEffect()
  		local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  		Duel.Recover(p, d, REASON_EFFECT)
  	end
  end
  
  