name: Ritual
card_text: 1 "Ritual Beast Tamer" monster + 1 "Spiritual Beast" monster
  Must be Special Summoned (from your Extra Deck) by banishing the above cards from your field and/or GY. You can only Special Summon "Ritual Beast Ulti-Nochiudrago(s)" once per turn. Your opponent cannot target other "Ritual Beast" monsters you control with card effects. (Quick Effect): You can return this card to the Extra Deck, then target 1 of your banished "Ritual Beast" monsters; Special Summon it, but it cannot attack directly.
external_ids: local SETCARD_ID_0 = 0x20b5 --Spiritual
  local SETCARD_ID_1 = 0xb5 --Ritual
  local SETCARD_ID_2 = 0x10b5 --Ritual
  
lua: local SETCARD_ID_0 = 0x20b5 --Spiritual
  local SETCARD_ID_1 = 0xb5 --Ritual
  local SETCARD_ID_2 = 0x10b5 --Ritual
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--spsummon times limit
  	c:SetSPSummonOnce(id)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcFun2(c, aux.FilterBoolFunction(Card.IsFusionSetCard, SETCARD_ID_2), aux.FilterBoolFunction(Card.IsFusionSetCard, SETCARD_ID_2), true)
  	aux.AddContactFusionProcedure(c, Card.IsAbleToRemoveAsCost, LOCATION_MZONE + LOCATION_GRAVE, 0, Duel.Remove, POS_FACEUP, REASON_COST)
  	--spsummon condition
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	c:RegisterEffect(e1)
  	--can not be effect target
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_MZONE, 0)
  	e2:SetTarget(s.etlimit)
  	e2:SetValue(aux.tgoval)
  	c:RegisterEffect(e2)
  	--spsummon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e3:SetType(EFFECT_TYPE_QUICK_O)
  	e3:SetCode(EVENT_FREE_CHAIN)
  	e3:SetHintTiming(0, TIMING_END_PHASE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCost(s.spcost)
  	e3:SetTarget(s.sptg)
  	e3:SetOperation(s.spop)
  	c:RegisterEffect(e3)
  end
  function s.etlimit(e, c)
  	return c ~= e:GetHandler() and c:IsFaceup() and c:IsSetCard(SETCARD_ID_2)
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToExtraAsCost()
  	end
  	Duel.SendtoDeck(e:GetHandler(), nil, SEQ_DECKTOP, REASON_COST)
  end
  function s.filter(c, e, tp)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_2) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.filter(chkc, e, tp)
  	end
  	if chk == 0 then
  		return Duel.GetMZoneCount(tp, e:GetHandler()) > 0 and Duel.IsExistingTarget(s.filter, tp, LOCATION_REMOVED, 0, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local tc = Duel.SelectTarget(tp, s.filter, tp, LOCATION_REMOVED, 0, 1, 1, nil, e, tp):GetFirst()
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, tc, 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetTargetsRelateToChain():GetFirst()
  	if not tc then
  		return
  	end
  	if Duel.SpecialSummon(tc, 0, tp, tp, false, false, POS_FACEUP) == 0 then
  		return
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
  	e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  	tc:RegisterEffect(e1, true)
  end
  
  
source_text: Ritual
  1 "Ritual Beast Tamer" monster + 1 "Spiritual Beast" monster
  Must be Special Summoned (from your Extra Deck) by banishing the above cards from your field and/or GY. You can only Special Summon "Ritual Beast Ulti-Nochiudrago(s)" once per turn. Your opponent cannot target other "Ritual Beast" monsters you control with card effects. (Quick Effect): You can return this card to the Extra Deck, then target 1 of your banished "Ritual Beast" monsters; Special Summon it, but it cannot attack directly.
target_text: -- Ritual
  local SETCARD_ID_0 = 0x20b5 --Spiritual
  local SETCARD_ID_1 = 0xb5 --Ritual
  local SETCARD_ID_2 = 0x10b5 --Ritual
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--spsummon times limit
  	c:SetSPSummonOnce(id)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcFun2(c, aux.FilterBoolFunction(Card.IsFusionSetCard, SETCARD_ID_2), aux.FilterBoolFunction(Card.IsFusionSetCard, SETCARD_ID_2), true)
  	aux.AddContactFusionProcedure(c, Card.IsAbleToRemoveAsCost, LOCATION_MZONE + LOCATION_GRAVE, 0, Duel.Remove, POS_FACEUP, REASON_COST)
  	--spsummon condition
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	c:RegisterEffect(e1)
  	--can not be effect target
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_MZONE, 0)
  	e2:SetTarget(s.etlimit)
  	e2:SetValue(aux.tgoval)
  	c:RegisterEffect(e2)
  	--spsummon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e3:SetType(EFFECT_TYPE_QUICK_O)
  	e3:SetCode(EVENT_FREE_CHAIN)
  	e3:SetHintTiming(0, TIMING_END_PHASE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCost(s.spcost)
  	e3:SetTarget(s.sptg)
  	e3:SetOperation(s.spop)
  	c:RegisterEffect(e3)
  end
  function s.etlimit(e, c)
  	return c ~= e:GetHandler() and c:IsFaceup() and c:IsSetCard(SETCARD_ID_2)
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToExtraAsCost()
  	end
  	Duel.SendtoDeck(e:GetHandler(), nil, SEQ_DECKTOP, REASON_COST)
  end
  function s.filter(c, e, tp)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_2) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.filter(chkc, e, tp)
  	end
  	if chk == 0 then
  		return Duel.GetMZoneCount(tp, e:GetHandler()) > 0 and Duel.IsExistingTarget(s.filter, tp, LOCATION_REMOVED, 0, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local tc = Duel.SelectTarget(tp, s.filter, tp, LOCATION_REMOVED, 0, 1, 1, nil, e, tp):GetFirst()
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, tc, 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetTargetsRelateToChain():GetFirst()
  	if not tc then
  		return
  	end
  	if Duel.SpecialSummon(tc, 0, tp, tp, false, false, POS_FACEUP) == 0 then
  		return
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
  	e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  	tc:RegisterEffect(e1, true)
  end
  
  