name: Zeta
card_text: You can Tribute 1 "Eva Token" to Special Summon this card from your hand. While this card is in your Graveyard, each time a monster(s) your opponent controls is removed from play, Special Summon 1 "Eva Token" (Fiend-Type/DARK/Level 2/ATK 500/DEF 500).
external_ids: local CARD_ID_0 = 64382840 --Eva Token
  
lua: local CARD_ID_0 = 64382840 --Eva Token
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--token
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e1:SetRange(LOCATION_GRAVE)
  	e1:SetCode(EVENT_REMOVE)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--special summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_SPSUMMON_PROC)
  	e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e2:SetRange(LOCATION_HAND)
  	e2:SetCondition(s.hspcon)
  	e2:SetTarget(s.hsptg)
  	e2:SetOperation(s.hspop)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c, tp)
  	return c:IsPreviousControler(1 - tp) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_TOKEN)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.cfilter, 1, nil, tp)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	if not Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, 0, TYPES_TOKEN_MONSTER, 500, 500, 2, RACE_FIEND, ATTRIBUTE_DARK) then
  		return
  	end
  	local token = Duel.CreateToken(tp, id + 1)
  	Duel.SpecialSummon(token, 0, tp, tp, false, false, POS_FACEUP)
  end
  function s.spfilter(c, tp)
  	return c:IsCode(id + 1) and Duel.GetMZoneCount(tp, c) > 0 and (c:IsControler(tp) or c:IsFaceup())
  end
  function s.hspcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	return Duel.CheckReleaseGroupEx(tp, s.spfilter, 1, REASON_SPSUMMON, false, nil, tp)
  end
  function s.hsptg(e, tp, eg, ep, ev, re, r, rp, chk, c)
  	local g = Duel.GetReleaseGroup(tp, false, REASON_SPSUMMON):Filter(s.spfilter, nil, tp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RELEASE)
  	local tc = g:SelectUnselect(nil, tp, false, true, 1, 1)
  	if tc then
  		e:SetLabelObject(tc)
  		return true
  	else
  		return false
  	end
  end
  function s.hspop(e, tp, eg, ep, ev, re, r, rp, c)
  	local g = e:GetLabelObject()
  	Duel.Release(g, REASON_SPSUMMON)
  end
  
  
source_text: Zeta
  You can Tribute 1 "Eva Token" to Special Summon this card from your hand. While this card is in your Graveyard, each time a monster(s) your opponent controls is removed from play, Special Summon 1 "Eva Token" (Fiend-Type/DARK/Level 2/ATK 500/DEF 500).
target_text: -- Zeta
  local CARD_ID_0 = 64382840 --Eva Token
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--token
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e1:SetRange(LOCATION_GRAVE)
  	e1:SetCode(EVENT_REMOVE)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--special summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_SPSUMMON_PROC)
  	e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e2:SetRange(LOCATION_HAND)
  	e2:SetCondition(s.hspcon)
  	e2:SetTarget(s.hsptg)
  	e2:SetOperation(s.hspop)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c, tp)
  	return c:IsPreviousControler(1 - tp) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_TOKEN)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.cfilter, 1, nil, tp)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	if not Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, 0, TYPES_TOKEN_MONSTER, 500, 500, 2, RACE_FIEND, ATTRIBUTE_DARK) then
  		return
  	end
  	local token = Duel.CreateToken(tp, id + 1)
  	Duel.SpecialSummon(token, 0, tp, tp, false, false, POS_FACEUP)
  end
  function s.spfilter(c, tp)
  	return c:IsCode(id + 1) and Duel.GetMZoneCount(tp, c) > 0 and (c:IsControler(tp) or c:IsFaceup())
  end
  function s.hspcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	return Duel.CheckReleaseGroupEx(tp, s.spfilter, 1, REASON_SPSUMMON, false, nil, tp)
  end
  function s.hsptg(e, tp, eg, ep, ev, re, r, rp, chk, c)
  	local g = Duel.GetReleaseGroup(tp, false, REASON_SPSUMMON):Filter(s.spfilter, nil, tp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RELEASE)
  	local tc = g:SelectUnselect(nil, tp, false, true, 1, 1)
  	if tc then
  		e:SetLabelObject(tc)
  		return true
  	else
  		return false
  	end
  end
  function s.hspop(e, tp, eg, ep, ev, re, r, rp, c)
  	local g = e:GetLabelObject()
  	Duel.Release(g, REASON_SPSUMMON)
  end
  
  