name: Soul
card_text: If your opponent controls a monster and you control a Normal Monster: Choose 5 Normal Monsters in your Deck, add 1 of them to your hand and banish the rest.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH + CATEGORY_REMOVE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsType(TYPE_NORMAL)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.filter(c)
  	return c:IsType(TYPE_NORMAL) and c:IsAbleToHand()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsPlayerCanRemove(tp) and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK, 0, 5, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if not Duel.IsPlayerCanRemove(tp) then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 0))
  	local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_DECK, 0, 5, 5, nil)
  	if g:GetCount() < 5 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local sg = g:Select(tp, 1, 1, nil)
  	Duel.SendtoHand(sg, nil, REASON_EFFECT)
  	g:Sub(sg)
  	Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
  end
  
  
source_text: Soul
  If your opponent controls a monster and you control a Normal Monster: Choose 5 Normal Monsters in your Deck, add 1 of them to your hand and banish the rest.
target_text: -- Soul
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH + CATEGORY_REMOVE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsType(TYPE_NORMAL)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.filter(c)
  	return c:IsType(TYPE_NORMAL) and c:IsAbleToHand()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsPlayerCanRemove(tp) and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK, 0, 5, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if not Duel.IsPlayerCanRemove(tp) then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 0))
  	local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_DECK, 0, 5, 5, nil)
  	if g:GetCount() < 5 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local sg = g:Select(tp, 1, 1, nil)
  	Duel.SendtoHand(sg, nil, REASON_EFFECT)
  	g:Sub(sg)
  	Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
  end
  
  