name: Luminous
card_text: This card is used to Ritual Summon "Paladin of Photon Dragon". You must also Tribute monsters from your hand or field whose total Levels equal exactly 4. You can banish this card from your Graveyard; banish monsters from your Graveyard whose total Levels equal exactly 4, and Special Summon 1 "Paladin of Photon Dragon" from your hand after that. (This Special Summon is treated as a Ritual Summon.)
external_ids: local CARD_ID_0 = 85346853 --Paladin of Photon Dragon
  
lua: local CARD_ID_0 = 85346853 --Paladin of Photon Dragon
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddRitualProcEqualCode(c, CARD_ID_0)
  	--spsummon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_GRAVE)
  	e1:SetCost(aux.bfgcost)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  end
  function s.mtfilter(c, e)
  	return c:GetLevel() > 0 and c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
  end
  function s.spfilter(c, e, tp, m)
  	return c:IsCode(CARD_ID_0) and c:IsCanBeSpecialSummoned(e, SUMMON_TYPE_RITUAL, tp, true, false) and m:CheckWithSumEqual(Card.GetRitualLevel, 4, 1, 99, c)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  			return false
  		end
  		local mg = Duel.GetMatchingGroup(s.mtfilter, tp, LOCATION_GRAVE, 0, e:GetHandler(), e)
  		return Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp, mg)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	local mg = Duel.GetMatchingGroup(s.mtfilter, tp, LOCATION_GRAVE, 0, nil, e)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_HAND, 0, 1, 1, nil, e, tp, mg)
  	local tc = g:GetFirst()
  	if tc then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  		local mat = mg:SelectWithSumEqual(tp, Card.GetRitualLevel, 4, 1, 99, tc)
  		tc:SetMaterial(mat)
  		Duel.ReleaseRitualMaterial(mat)
  		Duel.BreakEffect()
  		Duel.SpecialSummon(tc, SUMMON_TYPE_RITUAL, tp, tp, true, false, POS_FACEUP)
  		tc:CompleteProcedure()
  	end
  end
  
  
source_text: Luminous
  This card is used to Ritual Summon "Paladin of Photon Dragon". You must also Tribute monsters from your hand or field whose total Levels equal exactly 4. You can banish this card from your Graveyard; banish monsters from your Graveyard whose total Levels equal exactly 4, and Special Summon 1 "Paladin of Photon Dragon" from your hand after that. (This Special Summon is treated as a Ritual Summon.)
target_text: -- Luminous
  local CARD_ID_0 = 85346853 --Paladin of Photon Dragon
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddRitualProcEqualCode(c, CARD_ID_0)
  	--spsummon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_GRAVE)
  	e1:SetCost(aux.bfgcost)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  end
  function s.mtfilter(c, e)
  	return c:GetLevel() > 0 and c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
  end
  function s.spfilter(c, e, tp, m)
  	return c:IsCode(CARD_ID_0) and c:IsCanBeSpecialSummoned(e, SUMMON_TYPE_RITUAL, tp, true, false) and m:CheckWithSumEqual(Card.GetRitualLevel, 4, 1, 99, c)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  			return false
  		end
  		local mg = Duel.GetMatchingGroup(s.mtfilter, tp, LOCATION_GRAVE, 0, e:GetHandler(), e)
  		return Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp, mg)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	local mg = Duel.GetMatchingGroup(s.mtfilter, tp, LOCATION_GRAVE, 0, nil, e)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_HAND, 0, 1, 1, nil, e, tp, mg)
  	local tc = g:GetFirst()
  	if tc then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  		local mat = mg:SelectWithSumEqual(tp, Card.GetRitualLevel, 4, 1, 99, tc)
  		tc:SetMaterial(mat)
  		Duel.ReleaseRitualMaterial(mat)
  		Duel.BreakEffect()
  		Duel.SpecialSummon(tc, SUMMON_TYPE_RITUAL, tp, tp, true, false, POS_FACEUP)
  		tc:CompleteProcedure()
  	end
  end
  
  