name: Crystal
card_text: FLIP: Excavate the top 2 cards of your Deck, then add 1 of them to your hand, then place the other on the bottom of your Deck.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--flip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_FLIP)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetFieldGroupCount(tp, LOCATION_DECK, 0) < 2 then
  		return
  	end
  	Duel.ConfirmDecktop(tp, 2)
  	local g = Duel.GetDecktopGroup(tp, 2)
  	if g:GetCount() > 0 then
  		Duel.DisableShuffleCheck()
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  		local add = g:Select(tp, 1, 1, nil)
  		if add:GetFirst():IsAbleToHand() then
  			Duel.SendtoHand(add, nil, REASON_EFFECT)
  			Duel.ConfirmCards(1 - tp, add)
  			Duel.ShuffleHand(tp)
  		else
  			Duel.SendtoGrave(add, REASON_EFFECT)
  		end
  		Duel.BreakEffect()
  		local back = Duel.GetDecktopGroup(tp, 1)
  		Duel.MoveSequence(back:GetFirst(), SEQ_DECKBOTTOM)
  	end
  end
  
  
source_text: Crystal
  FLIP: Excavate the top 2 cards of your Deck, then add 1 of them to your hand, then place the other on the bottom of your Deck.
target_text: -- Crystal
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--flip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_FLIP)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetFieldGroupCount(tp, LOCATION_DECK, 0) < 2 then
  		return
  	end
  	Duel.ConfirmDecktop(tp, 2)
  	local g = Duel.GetDecktopGroup(tp, 2)
  	if g:GetCount() > 0 then
  		Duel.DisableShuffleCheck()
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  		local add = g:Select(tp, 1, 1, nil)
  		if add:GetFirst():IsAbleToHand() then
  			Duel.SendtoHand(add, nil, REASON_EFFECT)
  			Duel.ConfirmCards(1 - tp, add)
  			Duel.ShuffleHand(tp)
  		else
  			Duel.SendtoGrave(add, REASON_EFFECT)
  		end
  		Duel.BreakEffect()
  		local back = Duel.GetDecktopGroup(tp, 1)
  		Duel.MoveSequence(back:GetFirst(), SEQ_DECKBOTTOM)
  	end
  end
  
  