name: Ancient
card_text: See the top 5 cards of your opponent's Deck. Return the cards to the Deck in the same order.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--confirm
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.cftg)
  	e1:SetOperation(s.cfop)
  	c:RegisterEffect(e1)
  end
  function s.cftg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFieldGroupCount(tp, 0, LOCATION_DECK) > 0
  	end
  	Duel.SetTargetPlayer(tp)
  end
  function s.cfop(e, tp, eg, ep, ev, re, r, rp)
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	local ct = math.min(5, Duel.GetFieldGroupCount(p, 0, LOCATION_DECK))
  	local t = {}
  	for i = 1, ct do
  		t[i] = i
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 0))
  	local ac = Duel.AnnounceNumber(p, table.unpack(t))
  	local g = Duel.GetDecktopGroup(1 - p, ac)
  	if g:GetCount() > 0 then
  		Duel.ConfirmCards(p, g)
  	end
  end
  
  
source_text: Ancient
  See the top 5 cards of your opponent's Deck. Return the cards to the Deck in the same order.
target_text: -- Ancient
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--confirm
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.cftg)
  	e1:SetOperation(s.cfop)
  	c:RegisterEffect(e1)
  end
  function s.cftg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFieldGroupCount(tp, 0, LOCATION_DECK) > 0
  	end
  	Duel.SetTargetPlayer(tp)
  end
  function s.cfop(e, tp, eg, ep, ev, re, r, rp)
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	local ct = math.min(5, Duel.GetFieldGroupCount(p, 0, LOCATION_DECK))
  	local t = {}
  	for i = 1, ct do
  		t[i] = i
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 0))
  	local ac = Duel.AnnounceNumber(p, table.unpack(t))
  	local g = Duel.GetDecktopGroup(1 - p, ac)
  	if g:GetCount() > 0 then
  		Duel.ConfirmCards(p, g)
  	end
  end
  
  