Protector
2 monsters
If this card is Link Summoned: You can send 1 "Destruction Sword" card from your Deck to the GY, then, you can Special Summon 1 "Buster Blader" monster from your hand. At the end of your Battle Phase, if your opponent controls no monsters: You can target 1 "Buster Blader" monster you control that did not declare an attack this turn; inflict damage to your opponent equal to that monster's ATK. You can only use each effect of "Protector Whelp of the Destruction Swordsman" once per turn.
local SETCARD_ID_0 = 0xd6 --Destruction
local SETCARD_ID_1 = 0xd7 --Buster

local SETCARD_ID_0 = 0xd6 --Destruction
local SETCARD_ID_1 = 0xd7 --Buster
local s, id, o = GetID()
function s.initial_effect(c)
	--link summon
	c:EnableReviveLimit()
	aux.AddLinkProcedure(c, nil, 2, 2)
	--to grave
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_TOGRAVE + CATEGORY_SPECIAL_SUMMON)
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
	e1:SetProperty(EFFECT_FLAG_DELAY)
	e1:SetCountLimit(1, id)
	e1:SetCondition(s.tgcon)
	e1:SetTarget(s.tgtg)
	e1:SetOperation(s.tgop)
	c:RegisterEffect(e1)
	--damage
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetCategory(CATEGORY_DAMAGE)
	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
	e2:SetCode(EVENT_PHASE + PHASE_BATTLE)
	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e2:SetRange(LOCATION_MZONE)
	e2:SetCountLimit(1, id + 1)
	e2:SetCondition(s.damcon)
	e2:SetTarget(s.damtg)
	e2:SetOperation(s.damop)
	c:RegisterEffect(e2)
end
function s.tgcon(e, tp, eg, ep, ev, re, r, rp)
	return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function s.tgfilter(c)
	return c:IsSetCard(SETCARD_ID_1) and c:IsAbleToGrave()
end
function s.tgtg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(s.tgfilter, tp, LOCATION_DECK, 0, 1, nil)
	end
	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, tp, LOCATION_DECK)
end
function s.spfilter(c, e, tp)
	return c:IsSetCard(SETCARD_ID_1) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
end
function s.tgop(e, tp, eg, ep, ev, re, r, rp)
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
	local g = Duel.SelectMatchingCard(tp, s.tgfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
	if
		g:GetCount() > 0
		and Duel.SendtoGrave(g, REASON_EFFECT) ~= 0
		and g:GetFirst():IsLocation(LOCATION_GRAVE)
		and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
		and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
		and Duel.SelectYesNo(tp, aux.Stringid(id, 2))
	then
		Duel.BreakEffect()
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
		local sg = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_HAND, 0, 1, 1, nil, e, tp)
		Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP)
	end
end
function s.damfilter(c)
	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_1) and c:GetAttackAnnouncedCount() == 0 and c:GetAttack() > 0
end
function s.damcon(e, tp, eg, ep, ev, re, r, rp)
	return Duel.GetTurnPlayer() == tp and Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) <= 0
end
function s.damtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.damfilter(chkc)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(s.damfilter, tp, LOCATION_MZONE, 0, 1, nil)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
	local g = Duel.SelectTarget(tp, s.damfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, g:GetFirst():GetAttack())
end
function s.damop(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	if tc:IsRelateToEffect(e) and tc:IsFaceup() then
		Duel.Damage(1 - tp, tc:GetAttack(), REASON_EFFECT)
	end
end


Protector
2 monsters
If this card is Link Summoned: You can send 1 "Destruction Sword" card from your Deck to the GY, then, you can Special Summon 1 "Buster Blader" monster from your hand. At the end of your Battle Phase, if your opponent controls no monsters: You can target 1 "Buster Blader" monster you control that did not declare an attack this turn; inflict damage to your opponent equal to that monster's ATK. You can only use each effect of "Protector Whelp of the Destruction Swordsman" once per turn.
-- Protector
local SETCARD_ID_0 = 0xd6 --Destruction
local SETCARD_ID_1 = 0xd7 --Buster
local s, id, o = GetID()
function s.initial_effect(c)
	--link summon
	c:EnableReviveLimit()
	aux.AddLinkProcedure(c, nil, 2, 2)
	--to grave
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_TOGRAVE + CATEGORY_SPECIAL_SUMMON)
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
	e1:SetProperty(EFFECT_FLAG_DELAY)
	e1:SetCountLimit(1, id)
	e1:SetCondition(s.tgcon)
	e1:SetTarget(s.tgtg)
	e1:SetOperation(s.tgop)
	c:RegisterEffect(e1)
	--damage
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetCategory(CATEGORY_DAMAGE)
	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
	e2:SetCode(EVENT_PHASE + PHASE_BATTLE)
	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e2:SetRange(LOCATION_MZONE)
	e2:SetCountLimit(1, id + 1)
	e2:SetCondition(s.damcon)
	e2:SetTarget(s.damtg)
	e2:SetOperation(s.damop)
	c:RegisterEffect(e2)
end
function s.tgcon(e, tp, eg, ep, ev, re, r, rp)
	return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function s.tgfilter(c)
	return c:IsSetCard(SETCARD_ID_1) and c:IsAbleToGrave()
end
function s.tgtg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(s.tgfilter, tp, LOCATION_DECK, 0, 1, nil)
	end
	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, tp, LOCATION_DECK)
end
function s.spfilter(c, e, tp)
	return c:IsSetCard(SETCARD_ID_1) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
end
function s.tgop(e, tp, eg, ep, ev, re, r, rp)
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
	local g = Duel.SelectMatchingCard(tp, s.tgfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
	if
		g:GetCount() > 0
		and Duel.SendtoGrave(g, REASON_EFFECT) ~= 0
		and g:GetFirst():IsLocation(LOCATION_GRAVE)
		and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
		and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
		and Duel.SelectYesNo(tp, aux.Stringid(id, 2))
	then
		Duel.BreakEffect()
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
		local sg = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_HAND, 0, 1, 1, nil, e, tp)
		Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP)
	end
end
function s.damfilter(c)
	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_1) and c:GetAttackAnnouncedCount() == 0 and c:GetAttack() > 0
end
function s.damcon(e, tp, eg, ep, ev, re, r, rp)
	return Duel.GetTurnPlayer() == tp and Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) <= 0
end
function s.damtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.damfilter(chkc)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(s.damfilter, tp, LOCATION_MZONE, 0, 1, nil)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
	local g = Duel.SelectTarget(tp, s.damfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, g:GetFirst():GetAttack())
end
function s.damop(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	if tc:IsRelateToEffect(e) and tc:IsFaceup() then
		Duel.Damage(1 - tp, tc:GetAttack(), REASON_EFFECT)
	end
end

