name: Spiritual
card_text: Tribute 1 WATER monster; look at your opponent's hand, then send 1 card from their hand to the GY.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TOGRAVE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMING_TOHAND)
  	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.IsAttribute, 1, nil, ATTRIBUTE_WATER)
  	end
  	local g = Duel.SelectReleaseGroup(tp, Card.IsAttribute, 1, 1, nil, ATTRIBUTE_WATER)
  	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
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, 1 - tp, LOCATION_HAND)
  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, 0, LOCATION_HAND)
  	if g:GetCount() > 0 then
  		Duel.ConfirmCards(p, g)
  		Duel.Hint(HINT_SELECTMSG, p, HINTMSG_TOGRAVE)
  		local sg = g:Select(p, 1, 1, nil)
  		Duel.SendtoGrave(sg, REASON_EFFECT)
  		Duel.ShuffleHand(1 - p)
  	end
  end
  
  
source_text: Spiritual
  Tribute 1 WATER monster; look at your opponent's hand, then send 1 card from their hand to the GY.
target_text: -- Spiritual
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TOGRAVE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMING_TOHAND)
  	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.IsAttribute, 1, nil, ATTRIBUTE_WATER)
  	end
  	local g = Duel.SelectReleaseGroup(tp, Card.IsAttribute, 1, 1, nil, ATTRIBUTE_WATER)
  	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
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, 1 - tp, LOCATION_HAND)
  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, 0, LOCATION_HAND)
  	if g:GetCount() > 0 then
  		Duel.ConfirmCards(p, g)
  		Duel.Hint(HINT_SELECTMSG, p, HINTMSG_TOGRAVE)
  		local sg = g:Select(p, 1, 1, nil)
  		Duel.SendtoGrave(sg, REASON_EFFECT)
  		Duel.ShuffleHand(1 - p)
  	end
  end
  
  