Gusto
If a face-up "Gusto" monster on the field is destroyed by battle or sent to your GY: You can Special Summon this card from your hand. If this card is Normal or Special Summoned: You can send 1 "Gusto" monster from your Deck to the GY, then, you can Special Summon 1 "Gusto" monster from your hand. You can only use each effect of "Gusto Vedir" once per turn.
local SETCARD_ID_0 = 0x10 --Gusto

local SETCARD_ID_0 = 0x10 --Gusto
local s, id, o = GetID()
function s.initial_effect(c)
	--special summon
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
	e1:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_DAMAGE_STEP)
	e1:SetCode(EVENT_CUSTOM + id)
	e1:SetRange(LOCATION_HAND)
	e1:SetCountLimit(1, id)
	e1:SetCondition(s.spcon)
	e1:SetTarget(s.sptg)
	e1:SetOperation(s.spop)
	c:RegisterEffect(e1)
	--to grave
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetCategory(CATEGORY_TOGRAVE + CATEGORY_SPECIAL_SUMMON)
	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e2:SetCode(EVENT_SUMMON_SUCCESS)
	e2:SetProperty(EFFECT_FLAG_DELAY)
	e2:SetCountLimit(1, id + 1)
	e2:SetTarget(s.tgtg)
	e2:SetOperation(s.tgop)
	c:RegisterEffect(e2)
	local e3 = e2:Clone()
	e3:SetCode(EVENT_SPSUMMON_SUCCESS)
	c:RegisterEffect(e3)
	if not s.global_check then
		s.global_check = true
		local ge1 = Effect.CreateEffect(c)
		ge1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
		ge1:SetCode(EVENT_BATTLE_DESTROYED)
		ge1:SetCondition(s.regcon)
		ge1:SetOperation(s.regop)
		Duel.RegisterEffect(ge1, 0)
		local ge2 = ge1:Clone()
		ge2:SetCode(EVENT_TO_GRAVE)
		ge2:SetCondition(s.regcon2)
		Duel.RegisterEffect(ge2, 0)
	end
end
function s.cfilter(c)
	return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousSetCard(SETCARD_ID_0)
end
function s.regcon(e, tp, eg, ep, ev, re, r, rp)
	if eg:IsExists(s.cfilter, 1, nil) then
		e:SetLabel(PLAYER_ALL)
		return true
	end
	e:SetLabel(PLAYER_NONE)
	return false
end
function s.cfilter2(c, p)
	return not c:IsReason(REASON_BATTLE) and c:IsControler(p) and s.cfilter(c)
end
function s.regcon2(e, tp, eg, ep, ev, re, r, rp)
	local v = 0
	if eg:IsExists(s.cfilter2, 1, nil, 0) then
		v = v + 1
	end
	if eg:IsExists(s.cfilter2, 1, nil, 1) then
		v = v + 2
	end
	if v == 0 then
		return false
	end
	e:SetLabel(({ 0, 1, PLAYER_ALL })[v])
	return true
end
function s.regop(e, tp, eg, ep, ev, re, r, rp)
	Duel.RaiseEvent(eg, EVENT_CUSTOM + id, re, r, rp, ep, e:GetLabel())
end
function s.spcon(e, tp, eg, ep, ev, re, r, rp)
	return ev == tp or ev == PLAYER_ALL
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
	local c = e:GetHandler()
	if chk == 0 then
		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
	end
	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
end
function s.spop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	if c:IsRelateToEffect(e) then
		Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
	end
end
function s.tgfilter(c)
	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) 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_0) 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)
	local tc = g:GetFirst()
	if
		tc
		and Duel.SendtoGrave(tc, REASON_EFFECT) ~= 0
		and tc: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


Gusto
If a face-up "Gusto" monster on the field is destroyed by battle or sent to your GY: You can Special Summon this card from your hand. If this card is Normal or Special Summoned: You can send 1 "Gusto" monster from your Deck to the GY, then, you can Special Summon 1 "Gusto" monster from your hand. You can only use each effect of "Gusto Vedir" once per turn.
-- Gusto
local SETCARD_ID_0 = 0x10 --Gusto
local s, id, o = GetID()
function s.initial_effect(c)
	--special summon
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
	e1:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_DAMAGE_STEP)
	e1:SetCode(EVENT_CUSTOM + id)
	e1:SetRange(LOCATION_HAND)
	e1:SetCountLimit(1, id)
	e1:SetCondition(s.spcon)
	e1:SetTarget(s.sptg)
	e1:SetOperation(s.spop)
	c:RegisterEffect(e1)
	--to grave
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetCategory(CATEGORY_TOGRAVE + CATEGORY_SPECIAL_SUMMON)
	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e2:SetCode(EVENT_SUMMON_SUCCESS)
	e2:SetProperty(EFFECT_FLAG_DELAY)
	e2:SetCountLimit(1, id + 1)
	e2:SetTarget(s.tgtg)
	e2:SetOperation(s.tgop)
	c:RegisterEffect(e2)
	local e3 = e2:Clone()
	e3:SetCode(EVENT_SPSUMMON_SUCCESS)
	c:RegisterEffect(e3)
	if not s.global_check then
		s.global_check = true
		local ge1 = Effect.CreateEffect(c)
		ge1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
		ge1:SetCode(EVENT_BATTLE_DESTROYED)
		ge1:SetCondition(s.regcon)
		ge1:SetOperation(s.regop)
		Duel.RegisterEffect(ge1, 0)
		local ge2 = ge1:Clone()
		ge2:SetCode(EVENT_TO_GRAVE)
		ge2:SetCondition(s.regcon2)
		Duel.RegisterEffect(ge2, 0)
	end
end
function s.cfilter(c)
	return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousSetCard(SETCARD_ID_0)
end
function s.regcon(e, tp, eg, ep, ev, re, r, rp)
	if eg:IsExists(s.cfilter, 1, nil) then
		e:SetLabel(PLAYER_ALL)
		return true
	end
	e:SetLabel(PLAYER_NONE)
	return false
end
function s.cfilter2(c, p)
	return not c:IsReason(REASON_BATTLE) and c:IsControler(p) and s.cfilter(c)
end
function s.regcon2(e, tp, eg, ep, ev, re, r, rp)
	local v = 0
	if eg:IsExists(s.cfilter2, 1, nil, 0) then
		v = v + 1
	end
	if eg:IsExists(s.cfilter2, 1, nil, 1) then
		v = v + 2
	end
	if v == 0 then
		return false
	end
	e:SetLabel(({ 0, 1, PLAYER_ALL })[v])
	return true
end
function s.regop(e, tp, eg, ep, ev, re, r, rp)
	Duel.RaiseEvent(eg, EVENT_CUSTOM + id, re, r, rp, ep, e:GetLabel())
end
function s.spcon(e, tp, eg, ep, ev, re, r, rp)
	return ev == tp or ev == PLAYER_ALL
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
	local c = e:GetHandler()
	if chk == 0 then
		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
	end
	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
end
function s.spop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	if c:IsRelateToEffect(e) then
		Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
	end
end
function s.tgfilter(c)
	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) 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_0) 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)
	local tc = g:GetFirst()
	if
		tc
		and Duel.SendtoGrave(tc, REASON_EFFECT) ~= 0
		and tc: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

