name: Evil
card_text: When your opponent Special Summons a monster(s): Activate this card by targeting 1 of those Summoned monsters in Attack Position, with less ATK than an "Evil Eye" monster you control; take control of that monster. When that monster leaves the field, destroy this card. While "Evil Eye of Selene" is in your Spell & Trap Zone, that targeted monster is also treated as an "Evil Eye" monster. You can only activate 1 "Evil Eye Mesmerism" per turn.
external_ids: local CARD_ID_0 = 44133040 --Evil Eye of Selene
  local SETCARD_ID_0 = 0x129 --Evil
  
lua: local CARD_ID_0 = 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:SetCategory(CATEGORY_CONTROL)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--control
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_TARGET)
  	e2:SetCode(EFFECT_SET_CONTROL)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetValue(s.ctval)
  	c:RegisterEffect(e2)
  	--setcode
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_TARGET)
  	e3:SetCode(EFFECT_ADD_SETCODE)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetCondition(s.setcon)
  	e3:SetValue(0x129)
  	c:RegisterEffect(e3)
  	--Destroy
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_FIELD)
  	e4:SetRange(LOCATION_SZONE)
  	e4:SetCode(EVENT_LEAVE_FIELD)
  	e4:SetCondition(s.descon)
  	e4:SetOperation(s.desop)
  	c:RegisterEffect(e4)
  end
  function s.filter(c, atk)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsFaceup() and c:GetAttack() > atk
  end
  function s.filter1(c, e, tp)
  	return c:IsCanBeEffectTarget(e) and c:IsAttackPos() and c:IsControler(1 - tp) and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, nil, c:GetAttack())
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return eg:IsContains(chkc) and s.filter1(chkc, e, tp)
  	end
  	if chk == 0 then
  		return eg:IsExists(s.filter1, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONTROL)
  	local tc = eg:FilterSelect(tp, s.filter1, 1, 1, nil, e, tp):GetFirst()
  	Duel.SetTargetCard(tc)
  	Duel.SetOperationInfo(0, CATEGORY_CONTROL, tc, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
  		c:SetCardTarget(tc)
  	end
  end
  function s.ctval(e, c)
  	return e:GetHandlerPlayer()
  end
  function s.filter2(c)
  	return c:IsCode(CARD_ID_0) and c:IsFaceup()
  end
  function s.setcon(e)
  	return Duel.IsExistingMatchingCard(s.filter2, e:GetHandlerPlayer(), LOCATION_SZONE, 0, 1, nil)
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsStatus(STATUS_DESTROY_CONFIRMED) then
  		return false
  	end
  	local tc = c:GetFirstCardTarget()
  	return tc and eg:IsContains(tc)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Destroy(e:GetHandler(), REASON_EFFECT)
  end
  
  
source_text: Evil
  When your opponent Special Summons a monster(s): Activate this card by targeting 1 of those Summoned monsters in Attack Position, with less ATK than an "Evil Eye" monster you control; take control of that monster. When that monster leaves the field, destroy this card. While "Evil Eye of Selene" is in your Spell & Trap Zone, that targeted monster is also treated as an "Evil Eye" monster. You can only activate 1 "Evil Eye Mesmerism" per turn.
target_text: -- Evil
  local CARD_ID_0 = 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:SetCategory(CATEGORY_CONTROL)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--control
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_TARGET)
  	e2:SetCode(EFFECT_SET_CONTROL)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetValue(s.ctval)
  	c:RegisterEffect(e2)
  	--setcode
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_TARGET)
  	e3:SetCode(EFFECT_ADD_SETCODE)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetCondition(s.setcon)
  	e3:SetValue(0x129)
  	c:RegisterEffect(e3)
  	--Destroy
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_FIELD)
  	e4:SetRange(LOCATION_SZONE)
  	e4:SetCode(EVENT_LEAVE_FIELD)
  	e4:SetCondition(s.descon)
  	e4:SetOperation(s.desop)
  	c:RegisterEffect(e4)
  end
  function s.filter(c, atk)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsFaceup() and c:GetAttack() > atk
  end
  function s.filter1(c, e, tp)
  	return c:IsCanBeEffectTarget(e) and c:IsAttackPos() and c:IsControler(1 - tp) and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, nil, c:GetAttack())
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return eg:IsContains(chkc) and s.filter1(chkc, e, tp)
  	end
  	if chk == 0 then
  		return eg:IsExists(s.filter1, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONTROL)
  	local tc = eg:FilterSelect(tp, s.filter1, 1, 1, nil, e, tp):GetFirst()
  	Duel.SetTargetCard(tc)
  	Duel.SetOperationInfo(0, CATEGORY_CONTROL, tc, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
  		c:SetCardTarget(tc)
  	end
  end
  function s.ctval(e, c)
  	return e:GetHandlerPlayer()
  end
  function s.filter2(c)
  	return c:IsCode(CARD_ID_0) and c:IsFaceup()
  end
  function s.setcon(e)
  	return Duel.IsExistingMatchingCard(s.filter2, e:GetHandlerPlayer(), LOCATION_SZONE, 0, 1, nil)
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsStatus(STATUS_DESTROY_CONFIRMED) then
  		return false
  	end
  	local tc = c:GetFirstCardTarget()
  	return tc and eg:IsContains(tc)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Destroy(e:GetHandler(), REASON_EFFECT)
  end
  
  