Evil
Special Summon 1 "Familiar of the Evil Eye Token" (Fiend/DARK/Level 1/ATK 400/DEF 400), or, if "Evil Eye of Selene" is in your Spell & Trap Zone, you can Special Summon 2 instead, also for the rest of this turn after this card resolves, you cannot Special Summon monsters, except Fiend monsters. You can banish this card from your GY; your opponent cannot target "Evil Eye" Spells/Traps you control with card effects this turn. You can only use each effect of "Evil Eye Reemergence" once per turn.
local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
local CARD_ID_1 = 7610395 --Familiar of the Evil Eye Token
local CARD_ID_2 = 44133040 --Evil Eye of Selene
local SETCARD_ID_0 = 0x129 --Evil

local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
local CARD_ID_1 = 7610395 --Familiar of the Evil Eye Token
local CARD_ID_2 = 44133040 --Evil Eye of Selene
local SETCARD_ID_0 = 0x129 --Evil
local s, id, o = GetID()
function s.initial_effect(c)
	--activate
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetCountLimit(1, id)
	e1:SetTarget(s.target)
	e1:SetOperation(s.activate)
	c:RegisterEffect(e1)
	--immune
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetType(EFFECT_TYPE_IGNITION)
	e2:SetRange(LOCATION_GRAVE)
	e2:SetCountLimit(1, id + 1)
	e2:SetCost(aux.bfgcost)
	e2:SetOperation(s.imop)
	c:RegisterEffect(e2)
end
function s.filter(c)
	return c:IsFaceup() and c:IsCode(CARD_ID_2)
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.IsPlayerCanSpecialSummonMonster(tp, id + 1, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 400, 400, 1, RACE_FIEND, ATTRIBUTE_DARK)
	end
	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, 0)
	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, 0, 0)
end
function s.activate(e, tp, eg, ep, ev, re, r, rp)
	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
	local flag = false
	if ft > 0 and Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 400, 400, 1, RACE_FIEND, ATTRIBUTE_DARK) then
		if ft > 1 and not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_SZONE, 0, 1, nil) and Duel.SelectYesNo(tp, aux.Stringid(id, 2)) then
			flag = true
		end
		local token = Duel.CreateToken(tp, id + 1)
		Duel.SpecialSummonStep(token, 0, tp, tp, false, false, POS_FACEUP)
		if flag == true then
			local token = Duel.CreateToken(tp, id + 1)
			Duel.SpecialSummonStep(token, 0, tp, tp, false, false, POS_FACEUP)
		end
		Duel.SpecialSummonComplete()
	end
	if e:IsHasType(EFFECT_TYPE_ACTIVATE) 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:SetTarget(s.splimit)
		e1:SetReset(RESET_PHASE + PHASE_END)
		Duel.RegisterEffect(e1, tp)
	end
end
function s.splimit(e, c)
	return not c:IsRace(RACE_FIEND)
end
function s.imop(e, tp, eg, ep, ev, re, r, rp)
	local e1 = Effect.CreateEffect(e:GetHandler())
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
	e1:SetTargetRange(LOCATION_ONFIELD, 0)
	e1:SetTarget(s.imlimit)
	e1:SetValue(aux.tgoval)
	e1:SetReset(RESET_PHASE + PHASE_END)
	Duel.RegisterEffect(e1, tp)
end
function s.imlimit(e, c)
	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_SPELL + TYPE_TRAP)
end


Evil
Special Summon 1 "Familiar of the Evil Eye Token" (Fiend/DARK/Level 1/ATK 400/DEF 400), or, if "Evil Eye of Selene" is in your Spell & Trap Zone, you can Special Summon 2 instead, also for the rest of this turn after this card resolves, you cannot Special Summon monsters, except Fiend monsters. You can banish this card from your GY; your opponent cannot target "Evil Eye" Spells/Traps you control with card effects this turn. You can only use each effect of "Evil Eye Reemergence" once per turn.
-- Evil
local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
local CARD_ID_1 = 7610395 --Familiar of the Evil Eye Token
local CARD_ID_2 = 44133040 --Evil Eye of Selene
local SETCARD_ID_0 = 0x129 --Evil
local s, id, o = GetID()
function s.initial_effect(c)
	--activate
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetCountLimit(1, id)
	e1:SetTarget(s.target)
	e1:SetOperation(s.activate)
	c:RegisterEffect(e1)
	--immune
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetType(EFFECT_TYPE_IGNITION)
	e2:SetRange(LOCATION_GRAVE)
	e2:SetCountLimit(1, id + 1)
	e2:SetCost(aux.bfgcost)
	e2:SetOperation(s.imop)
	c:RegisterEffect(e2)
end
function s.filter(c)
	return c:IsFaceup() and c:IsCode(CARD_ID_2)
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.IsPlayerCanSpecialSummonMonster(tp, id + 1, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 400, 400, 1, RACE_FIEND, ATTRIBUTE_DARK)
	end
	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, 0)
	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, 0, 0)
end
function s.activate(e, tp, eg, ep, ev, re, r, rp)
	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
	local flag = false
	if ft > 0 and Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 400, 400, 1, RACE_FIEND, ATTRIBUTE_DARK) then
		if ft > 1 and not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_SZONE, 0, 1, nil) and Duel.SelectYesNo(tp, aux.Stringid(id, 2)) then
			flag = true
		end
		local token = Duel.CreateToken(tp, id + 1)
		Duel.SpecialSummonStep(token, 0, tp, tp, false, false, POS_FACEUP)
		if flag == true then
			local token = Duel.CreateToken(tp, id + 1)
			Duel.SpecialSummonStep(token, 0, tp, tp, false, false, POS_FACEUP)
		end
		Duel.SpecialSummonComplete()
	end
	if e:IsHasType(EFFECT_TYPE_ACTIVATE) 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:SetTarget(s.splimit)
		e1:SetReset(RESET_PHASE + PHASE_END)
		Duel.RegisterEffect(e1, tp)
	end
end
function s.splimit(e, c)
	return not c:IsRace(RACE_FIEND)
end
function s.imop(e, tp, eg, ep, ev, re, r, rp)
	local e1 = Effect.CreateEffect(e:GetHandler())
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
	e1:SetTargetRange(LOCATION_ONFIELD, 0)
	e1:SetTarget(s.imlimit)
	e1:SetValue(aux.tgoval)
	e1:SetReset(RESET_PHASE + PHASE_END)
	Duel.RegisterEffect(e1, tp)
end
function s.imlimit(e, c)
	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_SPELL + TYPE_TRAP)
end

