Gladiator
2 "Gladiator Beast" monsters
If a "Gladiator Beast" monster you control attacks, it cannot be destroyed by that battle, also your opponent cannot activate cards or effects until the end of the Damage Step. At the end of the Battle Phase, if this card battled: You can return this card to the Extra Deck; Special Summon 2 "Gladiator Beast" monsters with different names from your Deck. You can only use this effect of "Gladiator Beast Dragases" once per turn.
local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
local SETCARD_ID_0 = 0x1019 --Gladiator

local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
local SETCARD_ID_0 = 0x1019 --Gladiator
local s, id, o = GetID()
function s.initial_effect(c)
	--link summon
	c:EnableReviveLimit()
	aux.AddLinkProcedure(c, aux.FilterBoolFunction(Card.IsLinkSetCard, SETCARD_ID_0), 2, 2)
	--indes
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
	e1:SetRange(LOCATION_MZONE)
	e1:SetTargetRange(LOCATION_MZONE, 0)
	e1:SetTarget(s.indtg)
	e1:SetValue(1)
	c:RegisterEffect(e1)
	--actlimit
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_FIELD)
	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
	e2:SetCode(EFFECT_CANNOT_ACTIVATE)
	e2:SetRange(LOCATION_MZONE)
	e2:SetTargetRange(0, 1)
	e2:SetValue(1)
	e2:SetCondition(s.actcon)
	c:RegisterEffect(e2)
	--special summon
	local e6 = Effect.CreateEffect(c)
	e6:SetDescription(aux.Stringid(id, 0))
	e6:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e6:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
	e6:SetCode(EVENT_PHASE + PHASE_BATTLE)
	e6:SetRange(LOCATION_MZONE)
	e6:SetCountLimit(1, id)
	e6:SetCondition(s.spcon)
	e6:SetCost(s.spcost)
	e6:SetTarget(s.sptg)
	e6:SetOperation(s.spop)
	c:RegisterEffect(e6)
end
function s.indtg(e, c)
	return c:IsSetCard(SETCARD_ID_0) and Duel.GetAttacker() == c
end
function s.actcon(e)
	local tc = Duel.GetAttacker()
	local tp = e:GetHandlerPlayer()
	return tc and tc:IsControler(tp) and tc:IsSetCard(SETCARD_ID_0)
end
function s.spcon(e, tp, eg, ep, ev, re, r, rp)
	return e:GetHandler():GetBattledGroupCount() > 0
end
function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
	local c = e:GetHandler()
	if chk == 0 then
		return c:IsAbleToExtraAsCost()
	end
	Duel.SendtoDeck(c, nil, SEQ_DECKTOP, REASON_COST)
end
function s.spfilter(c, e, tp)
	return c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
		if e:GetHandler():GetSequence() < 5 then
			ft = ft + 1
		end
		local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_DECK, 0, nil, e, tp)
		return ft > 1 and not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) and g:GetClassCount(Card.GetCode) >= 2
	end
	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 2, tp, LOCATION_DECK)
end
function s.spop(e, tp, eg, ep, ev, re, r, rp)
	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
		return
	end
	if Duel.GetLocationCount(tp, LOCATION_MZONE) < 2 then
		return
	end
	local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_DECK, 0, nil, e, tp)
	if g:GetCount() >= 2 and g:GetClassCount(Card.GetCode) >= 2 then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
		local sg1 = g:SelectSubGroup(tp, aux.dncheck, false, 2, 2)
		local tc = sg1:GetFirst()
		Duel.SpecialSummonStep(tc, 0, tp, tp, false, false, POS_FACEUP)
		tc:RegisterFlagEffect(tc:GetOriginalCode(), RESET_EVENT + RESETS_STANDARD + RESET_DISABLE, 0, 0)
		tc = sg1:GetNext()
		Duel.SpecialSummonStep(tc, 0, tp, tp, false, false, POS_FACEUP)
		tc:RegisterFlagEffect(tc:GetOriginalCode(), RESET_EVENT + RESETS_STANDARD + RESET_DISABLE, 0, 0)
		Duel.SpecialSummonComplete()
	end
end


Gladiator
2 "Gladiator Beast" monsters
If a "Gladiator Beast" monster you control attacks, it cannot be destroyed by that battle, also your opponent cannot activate cards or effects until the end of the Damage Step. At the end of the Battle Phase, if this card battled: You can return this card to the Extra Deck; Special Summon 2 "Gladiator Beast" monsters with different names from your Deck. You can only use this effect of "Gladiator Beast Dragases" once per turn.
-- Gladiator
local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
local SETCARD_ID_0 = 0x1019 --Gladiator
local s, id, o = GetID()
function s.initial_effect(c)
	--link summon
	c:EnableReviveLimit()
	aux.AddLinkProcedure(c, aux.FilterBoolFunction(Card.IsLinkSetCard, SETCARD_ID_0), 2, 2)
	--indes
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
	e1:SetRange(LOCATION_MZONE)
	e1:SetTargetRange(LOCATION_MZONE, 0)
	e1:SetTarget(s.indtg)
	e1:SetValue(1)
	c:RegisterEffect(e1)
	--actlimit
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_FIELD)
	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
	e2:SetCode(EFFECT_CANNOT_ACTIVATE)
	e2:SetRange(LOCATION_MZONE)
	e2:SetTargetRange(0, 1)
	e2:SetValue(1)
	e2:SetCondition(s.actcon)
	c:RegisterEffect(e2)
	--special summon
	local e6 = Effect.CreateEffect(c)
	e6:SetDescription(aux.Stringid(id, 0))
	e6:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e6:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
	e6:SetCode(EVENT_PHASE + PHASE_BATTLE)
	e6:SetRange(LOCATION_MZONE)
	e6:SetCountLimit(1, id)
	e6:SetCondition(s.spcon)
	e6:SetCost(s.spcost)
	e6:SetTarget(s.sptg)
	e6:SetOperation(s.spop)
	c:RegisterEffect(e6)
end
function s.indtg(e, c)
	return c:IsSetCard(SETCARD_ID_0) and Duel.GetAttacker() == c
end
function s.actcon(e)
	local tc = Duel.GetAttacker()
	local tp = e:GetHandlerPlayer()
	return tc and tc:IsControler(tp) and tc:IsSetCard(SETCARD_ID_0)
end
function s.spcon(e, tp, eg, ep, ev, re, r, rp)
	return e:GetHandler():GetBattledGroupCount() > 0
end
function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
	local c = e:GetHandler()
	if chk == 0 then
		return c:IsAbleToExtraAsCost()
	end
	Duel.SendtoDeck(c, nil, SEQ_DECKTOP, REASON_COST)
end
function s.spfilter(c, e, tp)
	return c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
		if e:GetHandler():GetSequence() < 5 then
			ft = ft + 1
		end
		local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_DECK, 0, nil, e, tp)
		return ft > 1 and not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) and g:GetClassCount(Card.GetCode) >= 2
	end
	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 2, tp, LOCATION_DECK)
end
function s.spop(e, tp, eg, ep, ev, re, r, rp)
	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
		return
	end
	if Duel.GetLocationCount(tp, LOCATION_MZONE) < 2 then
		return
	end
	local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_DECK, 0, nil, e, tp)
	if g:GetCount() >= 2 and g:GetClassCount(Card.GetCode) >= 2 then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
		local sg1 = g:SelectSubGroup(tp, aux.dncheck, false, 2, 2)
		local tc = sg1:GetFirst()
		Duel.SpecialSummonStep(tc, 0, tp, tp, false, false, POS_FACEUP)
		tc:RegisterFlagEffect(tc:GetOriginalCode(), RESET_EVENT + RESETS_STANDARD + RESET_DISABLE, 0, 0)
		tc = sg1:GetNext()
		Duel.SpecialSummonStep(tc, 0, tp, tp, false, false, POS_FACEUP)
		tc:RegisterFlagEffect(tc:GetOriginalCode(), RESET_EVENT + RESETS_STANDARD + RESET_DISABLE, 0, 0)
		Duel.SpecialSummonComplete()
	end
end

