name: Delinquent
card_text: Pay 1000 LP; your opponent discards 1 random card, and if they have any other cards in their hand, discard 1 more card of their choice.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_HANDES)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	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.CheckLPCost(tp, 1000)
  	end
  	Duel.PayLPCost(tp, 1000)
  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_HANDES, nil, 0, 1 - tp, 2)
  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
  		local sg = g:RandomSelect(p, 1)
  		Duel.SendtoGrave(sg, REASON_EFFECT + REASON_DISCARD)
  		g:RemoveCard(sg:GetFirst())
  		if g:GetCount() > 0 then
  			Duel.Hint(HINT_SELECTMSG, 1 - p, HINTMSG_DISCARD)
  			sg = g:Select(1 - p, 1, 1, nil)
  			Duel.SendtoGrave(sg, REASON_EFFECT + REASON_DISCARD)
  		end
  	end
  end
  
  
source_text: Delinquent
  Pay 1000 LP; your opponent discards 1 random card, and if they have any other cards in their hand, discard 1 more card of their choice.
target_text: -- Delinquent
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_HANDES)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	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.CheckLPCost(tp, 1000)
  	end
  	Duel.PayLPCost(tp, 1000)
  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_HANDES, nil, 0, 1 - tp, 2)
  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
  		local sg = g:RandomSelect(p, 1)
  		Duel.SendtoGrave(sg, REASON_EFFECT + REASON_DISCARD)
  		g:RemoveCard(sg:GetFirst())
  		if g:GetCount() > 0 then
  			Duel.Hint(HINT_SELECTMSG, 1 - p, HINTMSG_DISCARD)
  			sg = g:Select(1 - p, 1, 1, nil)
  			Duel.SendtoGrave(sg, REASON_EFFECT + REASON_DISCARD)
  		end
  	end
  end
  
  