name: Pineapple
card_text: When you Normal Summon a monster, if your opponent controls more monsters than you do: Your opponent chooses monster(s) they control, equal to the number of monsters you control, then you destroy all of their monsters they did not choose.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return ep == tp and Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) > Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(aux.TRUE, tp, 0, LOCATION_MZONE, nil)
  	local ct = Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) - Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, ct, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(aux.TRUE, tp, 0, LOCATION_MZONE, nil)
  	local ct = Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) - Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0)
  	if ct > 0 then
  		Duel.Hint(HINT_SELECTMSG, 1 - tp, HINTMSG_DESTROY)
  		local dg = g:Select(1 - tp, ct, ct, nil)
  		Duel.Destroy(dg, REASON_EFFECT)
  	end
  end
  
  
source_text: Pineapple
  When you Normal Summon a monster, if your opponent controls more monsters than you do: Your opponent chooses monster(s) they control, equal to the number of monsters you control, then you destroy all of their monsters they did not choose.
target_text: -- Pineapple
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return ep == tp and Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) > Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(aux.TRUE, tp, 0, LOCATION_MZONE, nil)
  	local ct = Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) - Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, ct, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(aux.TRUE, tp, 0, LOCATION_MZONE, nil)
  	local ct = Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) - Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0)
  	if ct > 0 then
  		Duel.Hint(HINT_SELECTMSG, 1 - tp, HINTMSG_DESTROY)
  		local dg = g:Select(1 - tp, ct, ct, nil)
  		Duel.Destroy(dg, REASON_EFFECT)
  	end
  end
  
  