name: Dark
card_text: 3 monsters with different names
  If a monster(s) is Special Summoned to a zone(s) this card points to, even during the Damage Step: You can Special Summon as many Level 4 or lower "@Ignister" monsters from your GY as possible to your zone(s) this card points to, but their effects are negated. When this card destroys an opponent's monster by battle: You can Special Summon 1 Cyberse monster from your GY. You can only use each effect of "Dark Templar @Ignister" once per turn.
external_ids: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local SETCARD_ID_0 = 0x135 --@Ignister
  
lua: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local SETCARD_ID_0 = 0x135 --@Ignister
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--link summon
  	aux.AddLinkProcedure(c, nil, 3, 3, s.lcheck)
  	c:EnableReviveLimit()
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.spcon1)
  	e1:SetTarget(s.sptg1)
  	e1:SetOperation(s.spop1)
  	c:RegisterEffect(e1)
  	--special summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetCode(EVENT_BATTLE_DESTROYING)
  	e2:SetCountLimit(1, id + 1)
  	e2:SetCondition(aux.bdocon)
  	e2:SetTarget(s.sptg2)
  	e2:SetOperation(s.spop2)
  	c:RegisterEffect(e2)
  end
  function s.lcheck(g, lc)
  	return g:GetClassCount(Card.GetLinkCode) == g:GetCount()
  end
  function s.cfilter(c, lg)
  	return lg:IsContains(c)
  end
  function s.spcon1(e, tp, eg, ep, ev, re, r, rp)
  	local lg = e:GetHandler():GetLinkedGroup()
  	return eg:IsExists(s.cfilter, 1, nil, lg)
  end
  function s.spfilter1(c, e, tp, zone)
  	return c:IsLevelBelow(4) and c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP, tp, zone)
  end
  function s.sptg1(e, tp, eg, ep, ev, re, r, rp, chk)
  	local zone = bit.band(e:GetHandler():GetLinkedZone(tp), 0x1f)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter1, tp, LOCATION_GRAVE, 0, 1, nil, e, tp, zone)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_GRAVE)
  end
  function s.spop1(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local zone = bit.band(c:GetLinkedZone(tp), 0x1f)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE, tp, LOCATION_REASON_TOFIELD, zone)
  	if zone == 0 or ft <= 0 then
  		return
  	end
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		ft = 1
  	end
  	local tg = Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter1), tp, LOCATION_GRAVE, 0, nil, e, tp, zone)
  	local g = nil
  	if tg:GetCount() > ft then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		g = tg:Select(tp, ft, ft, nil)
  	else
  		g = tg
  	end
  	if g:GetCount() > 0 then
  		local tc = g:GetFirst()
  		while tc do
  			Duel.SpecialSummonStep(tc, 0, tp, tp, false, false, POS_FACEUP, zone)
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetCode(EFFECT_DISABLE)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  			tc:RegisterEffect(e1)
  			local e2 = Effect.CreateEffect(c)
  			e2:SetType(EFFECT_TYPE_SINGLE)
  			e2:SetCode(EFFECT_DISABLE_EFFECT)
  			e2:SetValue(RESET_TURN_SET)
  			e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  			tc:RegisterEffect(e2)
  			tc = g:GetNext()
  		end
  		Duel.SpecialSummonComplete()
  	end
  end
  function s.spfilter2(c, e, tp)
  	return c:IsRace(RACE_CYBERSE) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg2(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter2, tp, LOCATION_GRAVE, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_GRAVE)
  end
  function s.spop2(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.spfilter2), tp, LOCATION_GRAVE, 0, 1, 1, nil, e, tp)
  	if g:GetCount() > 0 then
  		Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  
source_text: Dark
  3 monsters with different names
  If a monster(s) is Special Summoned to a zone(s) this card points to, even during the Damage Step: You can Special Summon as many Level 4 or lower "@Ignister" monsters from your GY as possible to your zone(s) this card points to, but their effects are negated. When this card destroys an opponent's monster by battle: You can Special Summon 1 Cyberse monster from your GY. You can only use each effect of "Dark Templar @Ignister" once per turn.
target_text: -- Dark
  local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local SETCARD_ID_0 = 0x135 --@Ignister
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--link summon
  	aux.AddLinkProcedure(c, nil, 3, 3, s.lcheck)
  	c:EnableReviveLimit()
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.spcon1)
  	e1:SetTarget(s.sptg1)
  	e1:SetOperation(s.spop1)
  	c:RegisterEffect(e1)
  	--special summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetCode(EVENT_BATTLE_DESTROYING)
  	e2:SetCountLimit(1, id + 1)
  	e2:SetCondition(aux.bdocon)
  	e2:SetTarget(s.sptg2)
  	e2:SetOperation(s.spop2)
  	c:RegisterEffect(e2)
  end
  function s.lcheck(g, lc)
  	return g:GetClassCount(Card.GetLinkCode) == g:GetCount()
  end
  function s.cfilter(c, lg)
  	return lg:IsContains(c)
  end
  function s.spcon1(e, tp, eg, ep, ev, re, r, rp)
  	local lg = e:GetHandler():GetLinkedGroup()
  	return eg:IsExists(s.cfilter, 1, nil, lg)
  end
  function s.spfilter1(c, e, tp, zone)
  	return c:IsLevelBelow(4) and c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP, tp, zone)
  end
  function s.sptg1(e, tp, eg, ep, ev, re, r, rp, chk)
  	local zone = bit.band(e:GetHandler():GetLinkedZone(tp), 0x1f)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter1, tp, LOCATION_GRAVE, 0, 1, nil, e, tp, zone)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_GRAVE)
  end
  function s.spop1(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local zone = bit.band(c:GetLinkedZone(tp), 0x1f)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE, tp, LOCATION_REASON_TOFIELD, zone)
  	if zone == 0 or ft <= 0 then
  		return
  	end
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		ft = 1
  	end
  	local tg = Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter1), tp, LOCATION_GRAVE, 0, nil, e, tp, zone)
  	local g = nil
  	if tg:GetCount() > ft then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		g = tg:Select(tp, ft, ft, nil)
  	else
  		g = tg
  	end
  	if g:GetCount() > 0 then
  		local tc = g:GetFirst()
  		while tc do
  			Duel.SpecialSummonStep(tc, 0, tp, tp, false, false, POS_FACEUP, zone)
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetCode(EFFECT_DISABLE)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  			tc:RegisterEffect(e1)
  			local e2 = Effect.CreateEffect(c)
  			e2:SetType(EFFECT_TYPE_SINGLE)
  			e2:SetCode(EFFECT_DISABLE_EFFECT)
  			e2:SetValue(RESET_TURN_SET)
  			e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  			tc:RegisterEffect(e2)
  			tc = g:GetNext()
  		end
  		Duel.SpecialSummonComplete()
  	end
  end
  function s.spfilter2(c, e, tp)
  	return c:IsRace(RACE_CYBERSE) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg2(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter2, tp, LOCATION_GRAVE, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_GRAVE)
  end
  function s.spop2(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.spfilter2), tp, LOCATION_GRAVE, 0, 1, 1, nil, e, tp)
  	if g:GetCount() > 0 then
  		Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  