name: Ignister
card_text: If you control no monsters in your Main Monster Zone: You can Special Summon 1 Level 4 or lower "@Ignister" monster from your hand, but for the rest of this turn, you cannot Special Summon monsters with the same original Attribute by the effect of "Ignister A.I.Land", also you cannot Special Summon, except Cyberse monsters (even if this card leaves the field). If this card is in your GY: You can banish 1 "@Ignister" monster from your GY; Set this card. You can only use this effect of "Ignister A.I.Land" once per turn.
external_ids: local SETCARD_ID_0 = 0x135 --@Ignister
  
lua: local SETCARD_ID_0 = 0x135 --@Ignister
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, id)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--special summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetCondition(s.spcon)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  	--set
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetRange(LOCATION_GRAVE)
  	e3:SetCountLimit(1, id)
  	e3:SetCost(s.setcost)
  	e3:SetTarget(s.settg)
  	e3:SetOperation(s.setop)
  	c:RegisterEffect(e3)
  end
  function s.cfilter(c)
  	return c:GetSequence() < 5
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return not Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.spfilter(c, e, tp)
  	return c:IsLevelBelow(4) and c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, LOCATION_HAND)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_HAND, 0, 1, 1, nil, e, tp)
  		if g:GetCount() > 0 and Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP) ~= 0 then
  			local e1 = Effect.CreateEffect(e:GetHandler())
  			e1:SetType(EFFECT_TYPE_FIELD)
  			e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  			e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  			e1:SetTargetRange(1, 0)
  			e1:SetLabel(g:GetFirst():GetOriginalAttribute())
  			e1:SetTarget(s.splimit)
  			e1:SetReset(RESET_PHASE + PHASE_END)
  			Duel.RegisterEffect(e1, tp)
  		end
  	end
  	local e2 = Effect.CreateEffect(e:GetHandler())
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e2:SetTargetRange(1, 0)
  	e2:SetTarget(s.splimit2)
  	e2:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e2, tp)
  end
  function s.splimit(e, c, sump, sumtype, sumpos, targetp, se)
  	return se and se:GetHandler():IsCode(id) and c:GetOriginalAttribute() == e:GetLabel()
  end
  function s.splimit2(e, c)
  	return not c:IsRace(RACE_CYBERSE)
  end
  function s.costfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
  end
  function s.setcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectMatchingCard(tp, s.costfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.Remove(g, POS_FACEUP, REASON_COST)
  end
  function s.settg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsSSetable()
  	end
  	Duel.SetOperationInfo(0, CATEGORY_LEAVE_GRAVE, e:GetHandler(), 1, 0, 0)
  end
  function s.setop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		Duel.SSet(tp, c)
  	end
  end
  
  
source_text: Ignister
  If you control no monsters in your Main Monster Zone: You can Special Summon 1 Level 4 or lower "@Ignister" monster from your hand, but for the rest of this turn, you cannot Special Summon monsters with the same original Attribute by the effect of "Ignister A.I.Land", also you cannot Special Summon, except Cyberse monsters (even if this card leaves the field). If this card is in your GY: You can banish 1 "@Ignister" monster from your GY; Set this card. You can only use this effect of "Ignister A.I.Land" once per turn.
target_text: -- Ignister
  local SETCARD_ID_0 = 0x135 --@Ignister
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, id)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--special summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetCondition(s.spcon)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  	--set
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetRange(LOCATION_GRAVE)
  	e3:SetCountLimit(1, id)
  	e3:SetCost(s.setcost)
  	e3:SetTarget(s.settg)
  	e3:SetOperation(s.setop)
  	c:RegisterEffect(e3)
  end
  function s.cfilter(c)
  	return c:GetSequence() < 5
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return not Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.spfilter(c, e, tp)
  	return c:IsLevelBelow(4) and c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, LOCATION_HAND)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_HAND, 0, 1, 1, nil, e, tp)
  		if g:GetCount() > 0 and Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP) ~= 0 then
  			local e1 = Effect.CreateEffect(e:GetHandler())
  			e1:SetType(EFFECT_TYPE_FIELD)
  			e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  			e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  			e1:SetTargetRange(1, 0)
  			e1:SetLabel(g:GetFirst():GetOriginalAttribute())
  			e1:SetTarget(s.splimit)
  			e1:SetReset(RESET_PHASE + PHASE_END)
  			Duel.RegisterEffect(e1, tp)
  		end
  	end
  	local e2 = Effect.CreateEffect(e:GetHandler())
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e2:SetTargetRange(1, 0)
  	e2:SetTarget(s.splimit2)
  	e2:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e2, tp)
  end
  function s.splimit(e, c, sump, sumtype, sumpos, targetp, se)
  	return se and se:GetHandler():IsCode(id) and c:GetOriginalAttribute() == e:GetLabel()
  end
  function s.splimit2(e, c)
  	return not c:IsRace(RACE_CYBERSE)
  end
  function s.costfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
  end
  function s.setcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectMatchingCard(tp, s.costfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.Remove(g, POS_FACEUP, REASON_COST)
  end
  function s.settg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsSSetable()
  	end
  	Duel.SetOperationInfo(0, CATEGORY_LEAVE_GRAVE, e:GetHandler(), 1, 0, 0)
  end
  function s.setop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		Duel.SSet(tp, c)
  	end
  end
  
  