name: Five
card_text: If the only monster you control is 1 Level 5 monster: Tribute that monster; Special Summon 5 monsters (1 "Kuribah", 1 "Kuribee", 1 "Kuriboo", 1 "Kuribeh", and 1 "Kuriboh") from your hand, Deck, and/or GY, but they cannot be Tributed for a Tribute Summon. You can only activate 1 "Five Star Twilight" per turn.
external_ids: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 7021574 --Kuriboo
  local CARD_ID_2 = 34419588 --Kuribeh
  local CARD_ID_3 = 71036835 --Kuribee
  local CARD_ID_4 = 40640057 --Kuriboh
  local CARD_ID_5 = 44632120 --Kuribah
  
lua: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 7021574 --Kuriboo
  local CARD_ID_2 = 34419588 --Kuribeh
  local CARD_ID_3 = 71036835 --Kuribee
  local CARD_ID_4 = 40640057 --Kuriboh
  local CARD_ID_5 = 44632120 --Kuribah
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_5, CARD_ID_3, CARD_ID_1, CARD_ID_2, CARD_ID_4)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  s.spchecks = aux.CreateChecks(Card.IsCode, { CARD_ID_5, CARD_ID_3, CARD_ID_1, CARD_ID_2, CARD_ID_4 })
  function s.cfilter(c, tp)
  	return c:IsFaceup() and c:IsLevel(5) and c:IsReleasable() and Duel.GetMZoneCount(tp, c) >= 5
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	e:SetLabel(1)
  	if chk == 0 and Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0) ~= 1 then
  		return false
  	end
  	local rc = Duel.GetFirstMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, nil, tp)
  	if chk == 0 then
  		return rc
  	end
  	Duel.Release(rc, REASON_COST)
  end
  function s.spfilter(c, e, tp)
  	return c:IsCode(CARD_ID_5, CARD_ID_3, CARD_ID_1, CARD_ID_2, CARD_ID_4) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local res = e:GetLabel() == 1 or Duel.GetLocationCount(tp, LOCATION_MZONE) >= 5
  	if chk == 0 then
  		e:SetLabel(0)
  		local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_HAND + LOCATION_DECK + LOCATION_GRAVE, 0, nil, e, tp)
  		return res and not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) and g:CheckSubGroupEach(s.spchecks)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 5, tp, LOCATION_HAND + LOCATION_DECK + LOCATION_GRAVE)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) >= 5 and not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		local g = Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter), tp, LOCATION_HAND + LOCATION_DECK + LOCATION_GRAVE, 0, nil, e, tp)
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local sg = g:SelectSubGroupEach(tp, s.spchecks, false)
  		if sg then
  			Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP)
  			for tc in aux.Next(sg) do
  				local e1 = Effect.CreateEffect(e:GetHandler())
  				e1:SetType(EFFECT_TYPE_SINGLE)
  				e1:SetCode(EFFECT_UNRELEASABLE_SUM)
  				e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  				e1:SetValue(1)
  				tc:RegisterEffect(e1, true)
  			end
  		end
  	end
  end
  
  
source_text: Five
  If the only monster you control is 1 Level 5 monster: Tribute that monster; Special Summon 5 monsters (1 "Kuribah", 1 "Kuribee", 1 "Kuriboo", 1 "Kuribeh", and 1 "Kuriboh") from your hand, Deck, and/or GY, but they cannot be Tributed for a Tribute Summon. You can only activate 1 "Five Star Twilight" per turn.
target_text: -- Five
  local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 7021574 --Kuriboo
  local CARD_ID_2 = 34419588 --Kuribeh
  local CARD_ID_3 = 71036835 --Kuribee
  local CARD_ID_4 = 40640057 --Kuriboh
  local CARD_ID_5 = 44632120 --Kuribah
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_5, CARD_ID_3, CARD_ID_1, CARD_ID_2, CARD_ID_4)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  s.spchecks = aux.CreateChecks(Card.IsCode, { CARD_ID_5, CARD_ID_3, CARD_ID_1, CARD_ID_2, CARD_ID_4 })
  function s.cfilter(c, tp)
  	return c:IsFaceup() and c:IsLevel(5) and c:IsReleasable() and Duel.GetMZoneCount(tp, c) >= 5
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	e:SetLabel(1)
  	if chk == 0 and Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0) ~= 1 then
  		return false
  	end
  	local rc = Duel.GetFirstMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, nil, tp)
  	if chk == 0 then
  		return rc
  	end
  	Duel.Release(rc, REASON_COST)
  end
  function s.spfilter(c, e, tp)
  	return c:IsCode(CARD_ID_5, CARD_ID_3, CARD_ID_1, CARD_ID_2, CARD_ID_4) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local res = e:GetLabel() == 1 or Duel.GetLocationCount(tp, LOCATION_MZONE) >= 5
  	if chk == 0 then
  		e:SetLabel(0)
  		local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_HAND + LOCATION_DECK + LOCATION_GRAVE, 0, nil, e, tp)
  		return res and not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) and g:CheckSubGroupEach(s.spchecks)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 5, tp, LOCATION_HAND + LOCATION_DECK + LOCATION_GRAVE)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) >= 5 and not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		local g = Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter), tp, LOCATION_HAND + LOCATION_DECK + LOCATION_GRAVE, 0, nil, e, tp)
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local sg = g:SelectSubGroupEach(tp, s.spchecks, false)
  		if sg then
  			Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP)
  			for tc in aux.Next(sg) do
  				local e1 = Effect.CreateEffect(e:GetHandler())
  				e1:SetType(EFFECT_TYPE_SINGLE)
  				e1:SetCode(EFFECT_UNRELEASABLE_SUM)
  				e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  				e1:SetValue(1)
  				tc:RegisterEffect(e1, true)
  			end
  		end
  	end
  end
  
  