name: Test
card_text: If you control a face-up "Gladiator Beast" monster, you can Special Summon this card (from your hand). You can Tribute this card to target 1 face-up "Gladiator Beast" monster you control; shuffle that target into the Deck, then Special Summon 1 "Gladiator Beast" from your Deck, and treat it as if it was Special Summoned by the effect of a "Gladiator Beast" monster.
external_ids: local SETCARD_ID_0 = 0x1019 --Gladiator
  
lua: local SETCARD_ID_0 = 0x1019 --Gladiator
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon rule
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCondition(s.sprcon)
  	c:RegisterEffect(e1)
  	--special summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_TODECK + CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCost(s.spcost)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  end
  function s.sprfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.sprcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.sprfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:IsReleasable()
  	end
  	Duel.Release(c, REASON_COST)
  end
  function s.tgfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsAbleToDeck()
  end
  function s.spfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, SUMMON_VALUE_GLADIATOR, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > -2
  			and Duel.IsExistingTarget(s.tgfilter, tp, LOCATION_MZONE, 0, 1, nil)
  			and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_DECK, 0, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
  	Duel.SelectTarget(tp, s.tgfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, LOCATION_DECK)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local rc = Duel.GetFirstTarget()
  	if not rc or rc:IsFacedown() or not rc:IsRelateToEffect(e) then
  		return
  	end
  	local rt = Duel.SendtoDeck(rc, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
  	if rt == 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_DECK, 0, 1, 1, nil, e, tp)
  	local tc = g:GetFirst()
  	if tc then
  		Duel.SpecialSummon(tc, SUMMON_VALUE_GLADIATOR, tp, tp, false, false, POS_FACEUP)
  		tc:RegisterFlagEffect(tc:GetOriginalCode(), RESET_EVENT + RESETS_STANDARD + RESET_DISABLE, 0, 0)
  	end
  end
  
  
source_text: Test
  If you control a face-up "Gladiator Beast" monster, you can Special Summon this card (from your hand). You can Tribute this card to target 1 face-up "Gladiator Beast" monster you control; shuffle that target into the Deck, then Special Summon 1 "Gladiator Beast" from your Deck, and treat it as if it was Special Summoned by the effect of a "Gladiator Beast" monster.
target_text: -- Test
  local SETCARD_ID_0 = 0x1019 --Gladiator
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon rule
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCondition(s.sprcon)
  	c:RegisterEffect(e1)
  	--special summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_TODECK + CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCost(s.spcost)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  end
  function s.sprfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.sprcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.sprfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:IsReleasable()
  	end
  	Duel.Release(c, REASON_COST)
  end
  function s.tgfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsAbleToDeck()
  end
  function s.spfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, SUMMON_VALUE_GLADIATOR, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > -2
  			and Duel.IsExistingTarget(s.tgfilter, tp, LOCATION_MZONE, 0, 1, nil)
  			and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_DECK, 0, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
  	Duel.SelectTarget(tp, s.tgfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, LOCATION_DECK)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local rc = Duel.GetFirstTarget()
  	if not rc or rc:IsFacedown() or not rc:IsRelateToEffect(e) then
  		return
  	end
  	local rt = Duel.SendtoDeck(rc, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
  	if rt == 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_DECK, 0, 1, 1, nil, e, tp)
  	local tc = g:GetFirst()
  	if tc then
  		Duel.SpecialSummon(tc, SUMMON_VALUE_GLADIATOR, tp, tp, false, false, POS_FACEUP)
  		tc:RegisterFlagEffect(tc:GetOriginalCode(), RESET_EVENT + RESETS_STANDARD + RESET_DISABLE, 0, 0)
  	end
  end
  
  