name: Eva
card_text: If this card is sent to the GY: You can banish up to 2 other LIGHT Fairy monsters from your field and/or GY; add the same number of Level 2 or lower LIGHT Fairy monsters with different names from your Deck to your hand, except "Eva". You can only use this effect of "Eva" once per turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--search
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_TO_GRAVE)
  	e1:SetProperty(EFFECT_FLAG_DELAY)
  	e1:SetCountLimit(1, id)
  	e1:SetTarget(s.thtg)
  	e1:SetOperation(s.thop)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToRemoveAsCost()
  end
  function s.filter(c)
  	return c:IsLevelBelow(2) and c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsCode(id) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE + LOCATION_GRAVE, 0, 1, e:GetHandler()) and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	local dg = Duel.GetMatchingGroup(s.filter, tp, LOCATION_DECK, 0, nil)
  	local ct = math.min(2, dg:GetClassCount(Card.GetCode))
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local rg = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_MZONE + LOCATION_GRAVE, 0, 1, ct, e:GetHandler())
  	local rc = Duel.Remove(rg, POS_FACEUP, REASON_COST)
  	e:SetLabel(rc)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, rc, tp, LOCATION_DECK)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	local dg = Duel.GetMatchingGroup(s.filter, tp, LOCATION_DECK, 0, nil)
  	local ct = e:GetLabel()
  	if dg:GetClassCount(Card.GetCode) < ct then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = dg:SelectSubGroup(tp, aux.dncheck, false, ct, ct)
  	Duel.SendtoHand(g, nil, REASON_EFFECT)
  	Duel.ConfirmCards(1 - tp, g)
  end
  
  
source_text: Eva
  If this card is sent to the GY: You can banish up to 2 other LIGHT Fairy monsters from your field and/or GY; add the same number of Level 2 or lower LIGHT Fairy monsters with different names from your Deck to your hand, except "Eva". You can only use this effect of "Eva" once per turn.
target_text: -- Eva
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--search
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_TO_GRAVE)
  	e1:SetProperty(EFFECT_FLAG_DELAY)
  	e1:SetCountLimit(1, id)
  	e1:SetTarget(s.thtg)
  	e1:SetOperation(s.thop)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToRemoveAsCost()
  end
  function s.filter(c)
  	return c:IsLevelBelow(2) and c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsCode(id) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE + LOCATION_GRAVE, 0, 1, e:GetHandler()) and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	local dg = Duel.GetMatchingGroup(s.filter, tp, LOCATION_DECK, 0, nil)
  	local ct = math.min(2, dg:GetClassCount(Card.GetCode))
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local rg = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_MZONE + LOCATION_GRAVE, 0, 1, ct, e:GetHandler())
  	local rc = Duel.Remove(rg, POS_FACEUP, REASON_COST)
  	e:SetLabel(rc)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, rc, tp, LOCATION_DECK)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	local dg = Duel.GetMatchingGroup(s.filter, tp, LOCATION_DECK, 0, nil)
  	local ct = e:GetLabel()
  	if dg:GetClassCount(Card.GetCode) < ct then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = dg:SelectSubGroup(tp, aux.dncheck, false, ct, ct)
  	Duel.SendtoHand(g, nil, REASON_EFFECT)
  	Duel.ConfirmCards(1 - tp, g)
  end
  
  