name: Evil
card_text: If you control an "Evil Eye" monster: Target 1 Spell/Trap your opponent controls; destroy it, and if you do, and "Evil Eye of Selene" is in your Spell & Trap Zone, banish that destroyed card. You can only activate 1 "Evil Eye Confrontation" 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_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMING_END_PHASE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsFaceup()
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.desfilter(c, res)
  	return c:IsType(TYPE_SPELL + TYPE_TRAP) and (not res or c:IsAbleToRemove())
  end
  function s.filter1(c)
  	return c:IsCode(CARD_ID_0) and c:IsFaceup()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	local res = Duel.IsExistingMatchingCard(s.filter1, tp, LOCATION_SZONE, 0, 1, nil)
  	if chkc then
  		return chkc:IsOnField() and s.desfilter(chkc, res) and chkc:IsControler(1 - tp)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.desfilter, tp, 0, LOCATION_ONFIELD, 1, nil, res)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, s.desfilter, tp, 0, LOCATION_ONFIELD, 1, 1, nil, res)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		if Duel.IsExistingMatchingCard(s.filter1, tp, LOCATION_SZONE, 0, 1, nil) then
  			Duel.Destroy(tc, REASON_EFFECT, LOCATION_REMOVED)
  		else
  			Duel.Destroy(tc, REASON_EFFECT)
  		end
  	end
  end
  
  
source_text: Evil
  If you control an "Evil Eye" monster: Target 1 Spell/Trap your opponent controls; destroy it, and if you do, and "Evil Eye of Selene" is in your Spell & Trap Zone, banish that destroyed card. You can only activate 1 "Evil Eye Confrontation" 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_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMING_END_PHASE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsFaceup()
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.desfilter(c, res)
  	return c:IsType(TYPE_SPELL + TYPE_TRAP) and (not res or c:IsAbleToRemove())
  end
  function s.filter1(c)
  	return c:IsCode(CARD_ID_0) and c:IsFaceup()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	local res = Duel.IsExistingMatchingCard(s.filter1, tp, LOCATION_SZONE, 0, 1, nil)
  	if chkc then
  		return chkc:IsOnField() and s.desfilter(chkc, res) and chkc:IsControler(1 - tp)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.desfilter, tp, 0, LOCATION_ONFIELD, 1, nil, res)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, s.desfilter, tp, 0, LOCATION_ONFIELD, 1, 1, nil, res)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		if Duel.IsExistingMatchingCard(s.filter1, tp, LOCATION_SZONE, 0, 1, nil) then
  			Duel.Destroy(tc, REASON_EFFECT, LOCATION_REMOVED)
  		else
  			Duel.Destroy(tc, REASON_EFFECT)
  		end
  	end
  end
  
  