name: Painful
card_text: Select 5 cards from your Deck and show them to your opponent. Your opponent selects 1 card among them. Add that card to your hand and discard the remaining cards to the Graveyard.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsAbleToHand, 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)
  	Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 0))
  	local g = Duel.SelectMatchingCard(tp, Card.IsAbleToHand, tp, LOCATION_DECK, 0, 5, 5, nil)
  	if g:GetCount() < 5 then
  		return
  	end
  	Duel.ConfirmCards(1 - tp, g)
  	Duel.Hint(HINT_SELECTMSG, 1 - tp, aux.Stringid(id, 1))
  	local sg = g:Select(1 - tp, 1, 1, nil)
  	sg:GetFirst():SetStatus(STATUS_TO_HAND_WITHOUT_CONFIRM, true)
  	Duel.SendtoHand(sg, nil, REASON_EFFECT)
  	g:Sub(sg)
  	Duel.SendtoGrave(g, REASON_EFFECT)
  end
  
  
source_text: Painful
  Select 5 cards from your Deck and show them to your opponent. Your opponent selects 1 card among them. Add that card to your hand and discard the remaining cards to the Graveyard.
target_text: -- Painful
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsAbleToHand, 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)
  	Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 0))
  	local g = Duel.SelectMatchingCard(tp, Card.IsAbleToHand, tp, LOCATION_DECK, 0, 5, 5, nil)
  	if g:GetCount() < 5 then
  		return
  	end
  	Duel.ConfirmCards(1 - tp, g)
  	Duel.Hint(HINT_SELECTMSG, 1 - tp, aux.Stringid(id, 1))
  	local sg = g:Select(1 - tp, 1, 1, nil)
  	sg:GetFirst():SetStatus(STATUS_TO_HAND_WITHOUT_CONFIRM, true)
  	Duel.SendtoHand(sg, nil, REASON_EFFECT)
  	g:Sub(sg)
  	Duel.SendtoGrave(g, REASON_EFFECT)
  end
  
  