name: Rainbow
card_text: If you have 7 "Crystal Beast" cards with different names on your field and/or in your GY: Special Summon 1 "Ultimate Crystal" monster from your Deck or GY, ignoring its Summoning conditions.
external_ids: local SETCARD_ID_0 = 0x1034 --Crystal
  local SETCARD_ID_1 = 0x2034 --Ultimate
  
lua: local SETCARD_ID_0 = 0x1034 --Crystal
  local SETCARD_ID_1 = 0x2034 --Ultimate
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMING_END_PHASE)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return c:IsSetCard(SETCARD_ID_1) and (not c:IsOnField() or c:IsFaceup())
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_ONFIELD + LOCATION_GRAVE, 0, nil)
  	local ct = g:GetClassCount(Card.GetCode)
  	return ct > 6
  end
  function s.filter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsCanBeSpecialSummoned(e, 0, tp, true, 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_GRAVE, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK + LOCATION_GRAVE)
  end
  function s.activate(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, aux.NecroValleyFilter(s.filter), tp, LOCATION_DECK + LOCATION_GRAVE, 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: Rainbow
  If you have 7 "Crystal Beast" cards with different names on your field and/or in your GY: Special Summon 1 "Ultimate Crystal" monster from your Deck or GY, ignoring its Summoning conditions.
target_text: -- Rainbow
  local SETCARD_ID_0 = 0x1034 --Crystal
  local SETCARD_ID_1 = 0x2034 --Ultimate
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMING_END_PHASE)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return c:IsSetCard(SETCARD_ID_1) and (not c:IsOnField() or c:IsFaceup())
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_ONFIELD + LOCATION_GRAVE, 0, nil)
  	local ct = g:GetClassCount(Card.GetCode)
  	return ct > 6
  end
  function s.filter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsCanBeSpecialSummoned(e, 0, tp, true, 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_GRAVE, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK + LOCATION_GRAVE)
  end
  function s.activate(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, aux.NecroValleyFilter(s.filter), tp, LOCATION_DECK + LOCATION_GRAVE, 0, 1, 1, nil, e, tp)
  	if g:GetCount() > 0 then
  		Duel.SpecialSummon(g, 0, tp, tp, true, false, POS_FACEUP)
  	end
  end
  
  