name: Number
card_text: 3 Level 9 monsters
  If this card is Special Summoned: Destroy as many monsters with String Counters as possible, and if you do, draw 1 card, then inflict damage to your opponent equal to the highest original ATK among those destroyed monsters in the GY (your choice, if tied). Once per turn: You can detach 1 material from this card; place 1 String Counter on each face-up monster your opponent controls.
external_ids: local COUNTER_ID_0 = 0x1024 --String
  
lua: local COUNTER_ID_0 = 0x1024 --String
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 9, 3)
  	c:EnableReviveLimit()
  	--destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DESTROY + CATEGORY_DRAW)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetTarget(s.destg)
  	e1:SetOperation(s.desop)
  	c:RegisterEffect(e1)
  	--counter
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_COUNTER)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1)
  	e2:SetCost(s.ctcost)
  	e2:SetTarget(s.cttg)
  	e2:SetOperation(s.ctop)
  	c:RegisterEffect(e2)
  end
  aux.xyz_number[id] = 40
  function s.desfilter(c)
  	return c:GetCounter(COUNTER_ID_0) ~= 0
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(s.desfilter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, 1)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.desfilter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	if Duel.Destroy(g, REASON_EFFECT) == 0 then
  		return
  	end
  	local og = Duel.GetOperatedGroup():Filter(Card.IsLocation, nil, LOCATION_GRAVE)
  	if Duel.Draw(tp, 1, REASON_EFFECT) ~= 0 and og:GetCount() > 0 then
  		Duel.BreakEffect()
  		local mg, matk = og:GetMaxGroup(Card.GetBaseAttack)
  		if matk > 0 then
  			Duel.Damage(1 - tp, matk, REASON_EFFECT)
  		end
  	end
  end
  function s.ctcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():CheckRemoveOverlayCard(tp, 1, REASON_COST)
  	end
  	e:GetHandler():RemoveOverlayCard(tp, 1, 1, REASON_COST)
  end
  function s.cttg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsCanAddCounter, tp, 0, LOCATION_MZONE, 1, nil, 0x1024, 1)
  	end
  end
  function s.ctop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(Card.IsCanAddCounter, tp, 0, LOCATION_MZONE, nil, 0x1024, 1)
  	local tc = g:GetFirst()
  	while tc do
  		tc:AddCounter(COUNTER_ID_0, 1)
  		tc = g:GetNext()
  	end
  end
  
  
source_text: Number
  3 Level 9 monsters
  If this card is Special Summoned: Destroy as many monsters with String Counters as possible, and if you do, draw 1 card, then inflict damage to your opponent equal to the highest original ATK among those destroyed monsters in the GY (your choice, if tied). Once per turn: You can detach 1 material from this card; place 1 String Counter on each face-up monster your opponent controls.
target_text: -- Number
  local COUNTER_ID_0 = 0x1024 --String
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 9, 3)
  	c:EnableReviveLimit()
  	--destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DESTROY + CATEGORY_DRAW)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetTarget(s.destg)
  	e1:SetOperation(s.desop)
  	c:RegisterEffect(e1)
  	--counter
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_COUNTER)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1)
  	e2:SetCost(s.ctcost)
  	e2:SetTarget(s.cttg)
  	e2:SetOperation(s.ctop)
  	c:RegisterEffect(e2)
  end
  aux.xyz_number[id] = 40
  function s.desfilter(c)
  	return c:GetCounter(COUNTER_ID_0) ~= 0
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(s.desfilter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, 1)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.desfilter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	if Duel.Destroy(g, REASON_EFFECT) == 0 then
  		return
  	end
  	local og = Duel.GetOperatedGroup():Filter(Card.IsLocation, nil, LOCATION_GRAVE)
  	if Duel.Draw(tp, 1, REASON_EFFECT) ~= 0 and og:GetCount() > 0 then
  		Duel.BreakEffect()
  		local mg, matk = og:GetMaxGroup(Card.GetBaseAttack)
  		if matk > 0 then
  			Duel.Damage(1 - tp, matk, REASON_EFFECT)
  		end
  	end
  end
  function s.ctcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():CheckRemoveOverlayCard(tp, 1, REASON_COST)
  	end
  	e:GetHandler():RemoveOverlayCard(tp, 1, 1, REASON_COST)
  end
  function s.cttg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsCanAddCounter, tp, 0, LOCATION_MZONE, 1, nil, 0x1024, 1)
  	end
  end
  function s.ctop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(Card.IsCanAddCounter, tp, 0, LOCATION_MZONE, nil, 0x1024, 1)
  	local tc = g:GetFirst()
  	while tc do
  		tc:AddCounter(COUNTER_ID_0, 1)
  		tc = g:GetNext()
  	end
  end
  
  