Number
3 Level 4 monsters
Once per turn, when this attacking card destroys an opponent's monster by battle and sends it to the GY: You can detach 1 material from this card; Special Summon the destroyed monster to your opponent's field in Attack Position (but it loses 1000 ATK), and if you do, this card can make a second attack during this Battle Phase.
local s, id, o = GetID()
function s.initial_effect(c)
	--xyz summon
	aux.AddXyzProcedure(c, nil, 4, 3)
	c:EnableReviveLimit()
	--chain attack
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e1:SetCountLimit(1)
	e1:SetCode(EVENT_BATTLE_DESTROYING)
	e1:SetCondition(s.atcon)
	e1:SetCost(s.atcost)
	e1:SetTarget(s.attg)
	e1:SetOperation(s.atop)
	c:RegisterEffect(e1)
end
aux.xyz_number[id] = 32
function s.atcon(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	local bc = c:GetBattleTarget()
	return c == Duel.GetAttacker() and c:IsRelateToBattle() and c:IsStatus(STATUS_OPPO_BATTLE) and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
end
function s.atcost(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.attg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.GetLocationCount(1 - tp, LOCATION_MZONE) > 0 and Duel.GetAttackTarget():IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP_ATTACK, 1 - tp)
	end
	Duel.GetAttackTarget():CreateEffectRelation(e)
	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, Duel.GetAttackTarget(), 1, 0, 0)
end
function s.atop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	local bc = Duel.GetAttackTarget()
	if not bc:IsRelateToEffect(e) then
		return
	end
	if Duel.SpecialSummonStep(bc, 0, tp, 1 - tp, false, false, POS_FACEUP_ATTACK) then
		local e1 = Effect.CreateEffect(c)
		e1:SetType(EFFECT_TYPE_SINGLE)
		e1:SetCode(EFFECT_UPDATE_ATTACK)
		e1:SetValue(-1000)
		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
		bc:RegisterEffect(e1)
		Duel.SpecialSummonComplete()
		if c:IsFaceup() and c:IsRelateToEffect(e) then
			Duel.BreakEffect()
			local e1 = Effect.CreateEffect(c)
			e1:SetType(EFFECT_TYPE_SINGLE)
			e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
			e1:SetCode(EFFECT_EXTRA_ATTACK)
			e1:SetValue(1)
			e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
			c:RegisterEffect(e1)
		end
	end
end


Number
3 Level 4 monsters
Once per turn, when this attacking card destroys an opponent's monster by battle and sends it to the GY: You can detach 1 material from this card; Special Summon the destroyed monster to your opponent's field in Attack Position (but it loses 1000 ATK), and if you do, this card can make a second attack during this Battle Phase.
-- Number
local s, id, o = GetID()
function s.initial_effect(c)
	--xyz summon
	aux.AddXyzProcedure(c, nil, 4, 3)
	c:EnableReviveLimit()
	--chain attack
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e1:SetCountLimit(1)
	e1:SetCode(EVENT_BATTLE_DESTROYING)
	e1:SetCondition(s.atcon)
	e1:SetCost(s.atcost)
	e1:SetTarget(s.attg)
	e1:SetOperation(s.atop)
	c:RegisterEffect(e1)
end
aux.xyz_number[id] = 32
function s.atcon(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	local bc = c:GetBattleTarget()
	return c == Duel.GetAttacker() and c:IsRelateToBattle() and c:IsStatus(STATUS_OPPO_BATTLE) and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
end
function s.atcost(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.attg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.GetLocationCount(1 - tp, LOCATION_MZONE) > 0 and Duel.GetAttackTarget():IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP_ATTACK, 1 - tp)
	end
	Duel.GetAttackTarget():CreateEffectRelation(e)
	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, Duel.GetAttackTarget(), 1, 0, 0)
end
function s.atop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	local bc = Duel.GetAttackTarget()
	if not bc:IsRelateToEffect(e) then
		return
	end
	if Duel.SpecialSummonStep(bc, 0, tp, 1 - tp, false, false, POS_FACEUP_ATTACK) then
		local e1 = Effect.CreateEffect(c)
		e1:SetType(EFFECT_TYPE_SINGLE)
		e1:SetCode(EFFECT_UPDATE_ATTACK)
		e1:SetValue(-1000)
		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
		bc:RegisterEffect(e1)
		Duel.SpecialSummonComplete()
		if c:IsFaceup() and c:IsRelateToEffect(e) then
			Duel.BreakEffect()
			local e1 = Effect.CreateEffect(c)
			e1:SetType(EFFECT_TYPE_SINGLE)
			e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
			e1:SetCode(EFFECT_EXTRA_ATTACK)
			e1:SetValue(1)
			e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
			c:RegisterEffect(e1)
		end
	end
end

