name: Avida,
card_text: Cannot be Normal Summoned/Set. Must be Special Summoned (from your hand) by there being at least 8 or more Link Monsters with different names on the field and/or in the GYs. You cannot Special Summon other monsters the turn you Special Summon this card. This card's Special Summon cannot be negated. If this card is Special Summoned: Shuffle all other monsters that are banished, on the field, and in the GYs into the Decks. Neither player can activate cards or effects in response to this effect's activation.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCondition(s.sprcon)
  	c:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e2:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
  	c:RegisterEffect(e2)
  	--cannot special summon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e3:SetCode(EFFECT_SPSUMMON_CONDITION)
  	c:RegisterEffect(e3)
  	--special summon cost
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e4:SetCode(EFFECT_SPSUMMON_COST)
  	e4:SetCost(s.spcost)
  	e4:SetOperation(s.spop)
  	c:RegisterEffect(e4)
  	--todeck
  	local e5 = Effect.CreateEffect(c)
  	e5:SetDescription(aux.Stringid(id, 0))
  	e5:SetCategory(CATEGORY_TODECK)
  	e5:SetType(EFFECT_TYPE_TRIGGER_F + EFFECT_TYPE_SINGLE)
  	e5:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e5:SetTarget(s.tdtg)
  	e5:SetOperation(s.tdop)
  	c:RegisterEffect(e5)
  end
  function s.sprfilter(c)
  	return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_LINK)
  end
  function s.sprcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	local g = Duel.GetMatchingGroup(s.sprfilter, tp, LOCATION_MZONE + LOCATION_GRAVE, LOCATION_MZONE + LOCATION_GRAVE, nil)
  	return g:GetClassCount(Card.GetCode) >= 8 and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  end
  function s.spcost(e, c, tp)
  	return Duel.GetActivityCount(tp, ACTIVITY_SPSUMMON) == 0
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_OATH)
  	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(s.splimit)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  end
  function s.splimit(e, c, tp, sumtp, sumpos)
  	return c ~= e:GetHandler()
  end
  function s.tdfilter(c)
  	return (not c:IsLocation(LOCATION_REMOVED) or c:IsFaceup()) and c:IsAbleToDeck() and c:IsType(TYPE_MONSTER)
  end
  function s.tdtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(s.tdfilter, tp, LOCATION_MZONE + LOCATION_GRAVE + LOCATION_REMOVED, LOCATION_MZONE + LOCATION_GRAVE + LOCATION_REMOVED, e:GetHandler())
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, g, g:GetCount(), 0, LOCATION_MZONE + LOCATION_GRAVE + LOCATION_REMOVED)
  	Duel.SetChainLimit(aux.FALSE)
  end
  function s.tdop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.tdfilter, tp, LOCATION_MZONE + LOCATION_GRAVE + LOCATION_REMOVED, LOCATION_MZONE + LOCATION_GRAVE + LOCATION_REMOVED, aux.ExceptThisCard(e))
  	if aux.NecroValleyNegateCheck(g) then
  		return
  	end
  	Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
  end
  
  
source_text: Avida,
  Cannot be Normal Summoned/Set. Must be Special Summoned (from your hand) by there being at least 8 or more Link Monsters with different names on the field and/or in the GYs. You cannot Special Summon other monsters the turn you Special Summon this card. This card's Special Summon cannot be negated. If this card is Special Summoned: Shuffle all other monsters that are banished, on the field, and in the GYs into the Decks. Neither player can activate cards or effects in response to this effect's activation.
target_text: -- Avida,
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCondition(s.sprcon)
  	c:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e2:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
  	c:RegisterEffect(e2)
  	--cannot special summon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e3:SetCode(EFFECT_SPSUMMON_CONDITION)
  	c:RegisterEffect(e3)
  	--special summon cost
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e4:SetCode(EFFECT_SPSUMMON_COST)
  	e4:SetCost(s.spcost)
  	e4:SetOperation(s.spop)
  	c:RegisterEffect(e4)
  	--todeck
  	local e5 = Effect.CreateEffect(c)
  	e5:SetDescription(aux.Stringid(id, 0))
  	e5:SetCategory(CATEGORY_TODECK)
  	e5:SetType(EFFECT_TYPE_TRIGGER_F + EFFECT_TYPE_SINGLE)
  	e5:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e5:SetTarget(s.tdtg)
  	e5:SetOperation(s.tdop)
  	c:RegisterEffect(e5)
  end
  function s.sprfilter(c)
  	return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_LINK)
  end
  function s.sprcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	local g = Duel.GetMatchingGroup(s.sprfilter, tp, LOCATION_MZONE + LOCATION_GRAVE, LOCATION_MZONE + LOCATION_GRAVE, nil)
  	return g:GetClassCount(Card.GetCode) >= 8 and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  end
  function s.spcost(e, c, tp)
  	return Duel.GetActivityCount(tp, ACTIVITY_SPSUMMON) == 0
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_OATH)
  	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(s.splimit)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  end
  function s.splimit(e, c, tp, sumtp, sumpos)
  	return c ~= e:GetHandler()
  end
  function s.tdfilter(c)
  	return (not c:IsLocation(LOCATION_REMOVED) or c:IsFaceup()) and c:IsAbleToDeck() and c:IsType(TYPE_MONSTER)
  end
  function s.tdtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(s.tdfilter, tp, LOCATION_MZONE + LOCATION_GRAVE + LOCATION_REMOVED, LOCATION_MZONE + LOCATION_GRAVE + LOCATION_REMOVED, e:GetHandler())
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, g, g:GetCount(), 0, LOCATION_MZONE + LOCATION_GRAVE + LOCATION_REMOVED)
  	Duel.SetChainLimit(aux.FALSE)
  end
  function s.tdop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.tdfilter, tp, LOCATION_MZONE + LOCATION_GRAVE + LOCATION_REMOVED, LOCATION_MZONE + LOCATION_GRAVE + LOCATION_REMOVED, aux.ExceptThisCard(e))
  	if aux.NecroValleyNegateCheck(g) then
  		return
  	end
  	Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
  end
  
  