name: Needlebug
card_text: Send the top 5 cards of your Deck to the GY.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--discard deck
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCategory(CATEGORY_DECKDES)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTarget(s.distarget)
  	e1:SetOperation(s.disop)
  	c:RegisterEffect(e1)
  end
  function s.distarget(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsPlayerCanDiscardDeck(tp, 5)
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(5)
  	Duel.SetOperationInfo(0, CATEGORY_DECKDES, nil, 0, tp, 5)
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	local p, val = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.DiscardDeck(p, val, REASON_EFFECT)
  end
  
  
source_text: Needlebug
  Send the top 5 cards of your Deck to the GY.
target_text: -- Needlebug
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--discard deck
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCategory(CATEGORY_DECKDES)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTarget(s.distarget)
  	e1:SetOperation(s.disop)
  	c:RegisterEffect(e1)
  end
  function s.distarget(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsPlayerCanDiscardDeck(tp, 5)
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(5)
  	Duel.SetOperationInfo(0, CATEGORY_DECKDES, nil, 0, tp, 5)
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	local p, val = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.DiscardDeck(p, val, REASON_EFFECT)
  end
  
  