name: Prayers
card_text: This card can be used to Ritual Summon any LIGHT Ritual Monster. You must also Tribute LIGHT monsters from your hand or field whose total Levels equal or exceed the Level of the Ritual Monster. If a face-up LIGHT Ritual Monster(s) you control leaves the field by an opponent's card effect (except during the Damage Step): You can banish this card from your GY; Special Summon 1 "Sauravis, the Ancient and Ascended", "Saffira, Queen of Dragons", or "Skull Guardian, Protector of the Voiceless Voice" from your hand or Deck, ignoring its Summoning conditions. You can only use this effect of "Prayers of the Voiceless Voice" once per turn.
external_ids: local CARD_ID_0 = 56350972 --Saffira, Queen of Dragons
  local CARD_ID_1 = 4810828 --Sauravis, the Ancient and Ascended
  local CARD_ID_2 = 10774240 --Skull Guardian, Protector of the Voiceless Voice
  
lua: local CARD_ID_0 = 56350972 --Saffira, Queen of Dragons
  local CARD_ID_1 = 4810828 --Sauravis, the Ancient and Ascended
  local CARD_ID_2 = 10774240 --Skull Guardian, Protector of the Voiceless Voice
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_1, CARD_ID_0, CARD_ID_2)
  	--Activate
  	aux.AddRitualProcGreater2(c, s.spfilter, nil, nil, s.mfilter)
  	--spsummon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_DELAY)
  	e2:SetCode(EVENT_LEAVE_FIELD)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetCountLimit(1, id)
  	e2:SetCondition(s.spcon)
  	e2:SetCost(aux.bfgcost)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  end
  function s.spfilter(c)
  	return c:IsAttribute(ATTRIBUTE_LIGHT)
  end
  function s.mfilter(c)
  	return c:IsAttribute(ATTRIBUTE_LIGHT)
  end
  function s.plcfilter(c, tp)
  	return c:IsType(TYPE_RITUAL)
  		and c:IsPreviousControler(tp)
  		and c:IsAttribute(ATTRIBUTE_LIGHT)
  		and c:GetPreviousAttributeOnField() & ATTRIBUTE_LIGHT > 0
  		and c:IsPreviousPosition(POS_FACEUP)
  		and c:GetReasonPlayer() == 1 - tp
  		and c:IsReason(REASON_EFFECT)
  		and c:IsPreviousLocation(LOCATION_MZONE)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.plcfilter, 1, nil, tp)
  end
  function s.filter(c, e, tp)
  	return c:IsCode(CARD_ID_1, CARD_ID_0, CARD_ID_2) and c:IsCanBeSpecialSummoned(e, 0, tp, true, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK + LOCATION_HAND, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_DECK + LOCATION_HAND, 0, 1, 1, nil, e, tp)
  	if g:GetCount() > 0 then
  		Duel.SpecialSummon(g, 0, tp, tp, true, false, POS_FACEUP)
  	end
  end
  
  
source_text: Prayers
  This card can be used to Ritual Summon any LIGHT Ritual Monster. You must also Tribute LIGHT monsters from your hand or field whose total Levels equal or exceed the Level of the Ritual Monster. If a face-up LIGHT Ritual Monster(s) you control leaves the field by an opponent's card effect (except during the Damage Step): You can banish this card from your GY; Special Summon 1 "Sauravis, the Ancient and Ascended", "Saffira, Queen of Dragons", or "Skull Guardian, Protector of the Voiceless Voice" from your hand or Deck, ignoring its Summoning conditions. You can only use this effect of "Prayers of the Voiceless Voice" once per turn.
target_text: -- Prayers
  local CARD_ID_0 = 56350972 --Saffira, Queen of Dragons
  local CARD_ID_1 = 4810828 --Sauravis, the Ancient and Ascended
  local CARD_ID_2 = 10774240 --Skull Guardian, Protector of the Voiceless Voice
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_1, CARD_ID_0, CARD_ID_2)
  	--Activate
  	aux.AddRitualProcGreater2(c, s.spfilter, nil, nil, s.mfilter)
  	--spsummon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_DELAY)
  	e2:SetCode(EVENT_LEAVE_FIELD)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetCountLimit(1, id)
  	e2:SetCondition(s.spcon)
  	e2:SetCost(aux.bfgcost)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  end
  function s.spfilter(c)
  	return c:IsAttribute(ATTRIBUTE_LIGHT)
  end
  function s.mfilter(c)
  	return c:IsAttribute(ATTRIBUTE_LIGHT)
  end
  function s.plcfilter(c, tp)
  	return c:IsType(TYPE_RITUAL)
  		and c:IsPreviousControler(tp)
  		and c:IsAttribute(ATTRIBUTE_LIGHT)
  		and c:GetPreviousAttributeOnField() & ATTRIBUTE_LIGHT > 0
  		and c:IsPreviousPosition(POS_FACEUP)
  		and c:GetReasonPlayer() == 1 - tp
  		and c:IsReason(REASON_EFFECT)
  		and c:IsPreviousLocation(LOCATION_MZONE)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.plcfilter, 1, nil, tp)
  end
  function s.filter(c, e, tp)
  	return c:IsCode(CARD_ID_1, CARD_ID_0, CARD_ID_2) and c:IsCanBeSpecialSummoned(e, 0, tp, true, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK + LOCATION_HAND, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_DECK + LOCATION_HAND, 0, 1, 1, nil, e, tp)
  	if g:GetCount() > 0 then
  		Duel.SpecialSummon(g, 0, tp, tp, true, false, POS_FACEUP)
  	end
  end
  
  