name: Ra's
card_text: When this card is Summoned: You can Special Summon up to 2 "Ra's Disciple" from your hand and/or Deck. Cannot be Tributed, except for the Tribute Summon of "Slifer the Sky Dragon", "Obelisk the Tormentor", or "The Winged Dragon of Ra". You cannot Special Summon monsters, except by the effect of "Ra's Disciple".
external_ids: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 10000000 --Obelisk the Tormentor
  local CARD_ID_2 = 10000010 --The Winged Dragon of Ra
  local CARD_ID_3 = 10000020 --Slifer the Sky Dragon
  
lua: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 10000000 --Obelisk the Tormentor
  local CARD_ID_2 = 10000010 --The Winged Dragon of Ra
  local CARD_ID_3 = 10000020 --Slifer the Sky Dragon
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_2, CARD_ID_1, CARD_ID_3)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  	local e3 = e1:Clone()
  	e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
  	c:RegisterEffect(e3)
  	--release limit
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetCode(EFFECT_UNRELEASABLE_NONSUM)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  	local e5 = e4:Clone()
  	e5:SetCode(EFFECT_UNRELEASABLE_SUM)
  	e5:SetValue(s.sumval)
  	c:RegisterEffect(e5)
  	--
  	local e6 = Effect.CreateEffect(c)
  	e6:SetType(EFFECT_TYPE_FIELD)
  	e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e6:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e6:SetRange(LOCATION_MZONE)
  	e6:SetTargetRange(1, 0)
  	e6:SetTarget(s.splimit)
  	c:RegisterEffect(e6)
  end
  function s.filter(c, e, tp)
  	return c:IsCode(id) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.target(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 + LOCATION_HAND)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	if ft <= 0 then
  		return
  	end
  	if ft > 2 then
  		ft = 2
  	end
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		ft = 1
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_DECK + LOCATION_HAND, 0, 1, ft, nil, e, tp)
  	if g:GetCount() > 0 then
  		Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  function s.sumval(e, c)
  	return not c:IsCode(CARD_ID_1, CARD_ID_2, CARD_ID_3)
  end
  function s.splimit(e, c, sump, sumtype, sumpos, targetp, se)
  	return se == nil or not se:GetHandler():IsCode(id)
  end
  
  
source_text: Ra's
  When this card is Summoned: You can Special Summon up to 2 "Ra's Disciple" from your hand and/or Deck. Cannot be Tributed, except for the Tribute Summon of "Slifer the Sky Dragon", "Obelisk the Tormentor", or "The Winged Dragon of Ra". You cannot Special Summon monsters, except by the effect of "Ra's Disciple".
target_text: -- Ra's
  local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 10000000 --Obelisk the Tormentor
  local CARD_ID_2 = 10000010 --The Winged Dragon of Ra
  local CARD_ID_3 = 10000020 --Slifer the Sky Dragon
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_2, CARD_ID_1, CARD_ID_3)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  	local e3 = e1:Clone()
  	e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
  	c:RegisterEffect(e3)
  	--release limit
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetCode(EFFECT_UNRELEASABLE_NONSUM)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  	local e5 = e4:Clone()
  	e5:SetCode(EFFECT_UNRELEASABLE_SUM)
  	e5:SetValue(s.sumval)
  	c:RegisterEffect(e5)
  	--
  	local e6 = Effect.CreateEffect(c)
  	e6:SetType(EFFECT_TYPE_FIELD)
  	e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e6:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e6:SetRange(LOCATION_MZONE)
  	e6:SetTargetRange(1, 0)
  	e6:SetTarget(s.splimit)
  	c:RegisterEffect(e6)
  end
  function s.filter(c, e, tp)
  	return c:IsCode(id) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.target(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 + LOCATION_HAND)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	if ft <= 0 then
  		return
  	end
  	if ft > 2 then
  		ft = 2
  	end
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		ft = 1
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_DECK + LOCATION_HAND, 0, 1, ft, nil, e, tp)
  	if g:GetCount() > 0 then
  		Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  function s.sumval(e, c)
  	return not c:IsCode(CARD_ID_1, CARD_ID_2, CARD_ID_3)
  end
  function s.splimit(e, c, sump, sumtype, sumpos, targetp, se)
  	return se == nil or not se:GetHandler():IsCode(id)
  end
  
  