name: 手札抹殺
card_text: 1:手札があるプレイヤーは、その手札を全て捨てる。
  その後、そのプレイヤーは自身が捨てた枚数分ドローする。
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_HANDES + CATEGORY_DRAW)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		local h1 = Duel.GetFieldGroupCount(tp, LOCATION_HAND, 0)
  		if e:GetHandler():IsLocation(LOCATION_HAND) then
  			h1 = h1 - 1
  		end
  		local h2 = Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND)
  		return (h1 + h2 > 0) and (Duel.IsPlayerCanDraw(tp, h1) or h1 == 0) and (Duel.IsPlayerCanDraw(1 - tp) or h2 == 0)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_HANDES, nil, 0, PLAYER_ALL, 1)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, PLAYER_ALL, 1)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local h1 = Duel.GetFieldGroupCount(tp, LOCATION_HAND, 0)
  	local h2 = Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND)
  	local g = Duel.GetFieldGroup(tp, LOCATION_HAND, LOCATION_HAND)
  	Duel.SendtoGrave(g, REASON_EFFECT + REASON_DISCARD)
  	Duel.BreakEffect()
  	Duel.Draw(tp, h1, REASON_EFFECT)
  	Duel.Draw(1 - tp, h2, REASON_EFFECT)
  end
  
  
source_text: 手札抹殺
  1:手札があるプレイヤーは、その手札を全て捨てる。
  その後、そのプレイヤーは自身が捨てた枚数分ドローする。
target_text: -- 手札抹殺
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_HANDES + CATEGORY_DRAW)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		local h1 = Duel.GetFieldGroupCount(tp, LOCATION_HAND, 0)
  		if e:GetHandler():IsLocation(LOCATION_HAND) then
  			h1 = h1 - 1
  		end
  		local h2 = Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND)
  		return (h1 + h2 > 0) and (Duel.IsPlayerCanDraw(tp, h1) or h1 == 0) and (Duel.IsPlayerCanDraw(1 - tp) or h2 == 0)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_HANDES, nil, 0, PLAYER_ALL, 1)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, PLAYER_ALL, 1)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local h1 = Duel.GetFieldGroupCount(tp, LOCATION_HAND, 0)
  	local h2 = Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND)
  	local g = Duel.GetFieldGroup(tp, LOCATION_HAND, LOCATION_HAND)
  	Duel.SendtoGrave(g, REASON_EFFECT + REASON_DISCARD)
  	Duel.BreakEffect()
  	Duel.Draw(tp, h1, REASON_EFFECT)
  	Duel.Draw(1 - tp, h2, REASON_EFFECT)
  end
  
  