name: Psi-Impulse
card_text: Tribute 1 Psychic-Type monster. Return all cards in your opponent's hand to the Deck. Then, they draw 3 cards.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TODECK + CATEGORY_DRAW)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckReleaseGroup(tp, Card.IsRace, 1, nil, RACE_PSYCHO)
  	end
  	local g = Duel.SelectReleaseGroup(tp, Card.IsRace, 1, 1, nil, RACE_PSYCHO)
  	Duel.Release(g, REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND) > 0 and Duel.IsPlayerCanDraw(1 - tp, 3)
  	end
  	Duel.SetTargetPlayer(1 - tp)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	local g = Duel.GetFieldGroup(p, LOCATION_HAND, 0)
  	if g:GetCount() == 0 then
  		return
  	end
  	Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
  	Duel.ShuffleDeck(p)
  	Duel.BreakEffect()
  	Duel.Draw(p, 3, REASON_EFFECT)
  end
  
  
source_text: Psi-Impulse
  Tribute 1 Psychic-Type monster. Return all cards in your opponent's hand to the Deck. Then, they draw 3 cards.
target_text: -- Psi-Impulse
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TODECK + CATEGORY_DRAW)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckReleaseGroup(tp, Card.IsRace, 1, nil, RACE_PSYCHO)
  	end
  	local g = Duel.SelectReleaseGroup(tp, Card.IsRace, 1, 1, nil, RACE_PSYCHO)
  	Duel.Release(g, REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND) > 0 and Duel.IsPlayerCanDraw(1 - tp, 3)
  	end
  	Duel.SetTargetPlayer(1 - tp)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	local g = Duel.GetFieldGroup(p, LOCATION_HAND, 0)
  	if g:GetCount() == 0 then
  		return
  	end
  	Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
  	Duel.ShuffleDeck(p)
  	Duel.BreakEffect()
  	Duel.Draw(p, 3, REASON_EFFECT)
  end
  
  