name: Symph
card_text: Each time an effect of a "Symphonic Warrior" card is activated, place 1 Symphonic Counter on this card when that effect resolves. All "Symphonic Warrior" monsters on the field gain 100 ATK for each Symphonic Counter on this card. Once per turn: You can remove 5 or 7 Symphonic Counters from your field; apply this effect, depending on the number of Symphonic Counters removed.
  ● 5: Inflict 300 damage to your opponent for each "Symphonic Warrior" card on the field.
  ● 7: Banish cards your opponent controls and/or in their GY, up to the number of "Symphonic Warrior" cards on the field.
external_ids: local SETCARD_ID_0 = 0x1066 --Symphonic
  local COUNTER_ID_0 = 0x35 --Symphonic
  
lua: local SETCARD_ID_0 = 0x1066 --Symphonic
  local COUNTER_ID_0 = 0x35 --Symphonic
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableCounterPermit(0x35)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--counter
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_CHAIN_SOLVING)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetProperty(EFFECT_FLAG_DELAY)
  	e2:SetCondition(s.ctcon)
  	e2:SetOperation(s.ctop)
  	c:RegisterEffect(e2)
  	--atkup
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_UPDATE_ATTACK)
  	e3:SetRange(LOCATION_FZONE)
  	e3:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  	e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard, SETCARD_ID_0))
  	e3:SetValue(s.atkval)
  	c:RegisterEffect(e3)
  	--counter
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_IGNITION)
  	e4:SetRange(LOCATION_FZONE)
  	e4:SetCountLimit(1)
  	e4:SetTarget(s.target)
  	e4:SetOperation(s.operation)
  	c:RegisterEffect(e4)
  end
  function s.ctcon(e, tp, eg, ep, ev, re, r, rp)
  	return re and re:GetHandler():IsSetCard(SETCARD_ID_0) and not re:IsHasType(EFFECT_TYPE_ACTIVATE)
  end
  function s.ctop(e, tp, eg, ep, ev, re, r, rp)
  	e:GetHandler():AddCounter(COUNTER_ID_0, 1)
  end
  function s.atkval(e, c)
  	return e:GetHandler():GetCounter(COUNTER_ID_0) * 100
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local ct = Duel.GetMatchingGroupCount(s.filter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, nil)
  	local b1 = Duel.IsCanRemoveCounter(tp, 1, 0, COUNTER_ID_0, 5, REASON_COST)
  	local b2 = Duel.IsCanRemoveCounter(tp, 1, 0, COUNTER_ID_0, 7, REASON_COST) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_ONFIELD + LOCATION_GRAVE, 1, nil)
  	if chk == 0 then
  		return ct > 0 and (b1 or b2)
  	end
  	local op = 0
  	if b1 and b2 then
  		op = Duel.SelectOption(tp, aux.Stringid(id, 0), aux.Stringid(id, 1))
  	elseif b1 then
  		op = Duel.SelectOption(tp, aux.Stringid(id, 0))
  	else
  		op = Duel.SelectOption(tp, aux.Stringid(id, 1)) + 1
  	end
  	e:SetLabel(op)
  	if op == 0 then
  		e:SetCategory(CATEGORY_DAMAGE)
  		Duel.RemoveCounter(tp, 1, 0, COUNTER_ID_0, 5, REASON_COST)
  		Duel.SetTargetPlayer(1 - tp)
  		Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, ct * 300)
  	else
  		e:SetCategory(CATEGORY_REMOVE)
  		Duel.RemoveCounter(tp, 1, 0, COUNTER_ID_0, 7, REASON_COST)
  		Duel.SetOperationInfo(0, CATEGORY_REMOVE, nil, 1, 0, LOCATION_ONFIELD + LOCATION_GRAVE)
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local ct = Duel.GetMatchingGroupCount(s.filter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, nil)
  	if ct == 0 then
  		return
  	end
  	if e:GetLabel() == 0 then
  		local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  		Duel.Damage(p, ct * 300, REASON_EFFECT)
  	else
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  		local g = Duel.SelectMatchingCard(tp, Card.IsAbleToRemove, tp, 0, LOCATION_ONFIELD + LOCATION_GRAVE, 1, ct, nil)
  		if g:GetCount() > 0 then
  			Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
  		end
  	end
  end
  
  
source_text: Symph
  Each time an effect of a "Symphonic Warrior" card is activated, place 1 Symphonic Counter on this card when that effect resolves. All "Symphonic Warrior" monsters on the field gain 100 ATK for each Symphonic Counter on this card. Once per turn: You can remove 5 or 7 Symphonic Counters from your field; apply this effect, depending on the number of Symphonic Counters removed.
  ● 5: Inflict 300 damage to your opponent for each "Symphonic Warrior" card on the field.
  ● 7: Banish cards your opponent controls and/or in their GY, up to the number of "Symphonic Warrior" cards on the field.
target_text: -- Symph
  local SETCARD_ID_0 = 0x1066 --Symphonic
  local COUNTER_ID_0 = 0x35 --Symphonic
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableCounterPermit(0x35)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--counter
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_CHAIN_SOLVING)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetProperty(EFFECT_FLAG_DELAY)
  	e2:SetCondition(s.ctcon)
  	e2:SetOperation(s.ctop)
  	c:RegisterEffect(e2)
  	--atkup
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_UPDATE_ATTACK)
  	e3:SetRange(LOCATION_FZONE)
  	e3:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  	e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard, SETCARD_ID_0))
  	e3:SetValue(s.atkval)
  	c:RegisterEffect(e3)
  	--counter
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_IGNITION)
  	e4:SetRange(LOCATION_FZONE)
  	e4:SetCountLimit(1)
  	e4:SetTarget(s.target)
  	e4:SetOperation(s.operation)
  	c:RegisterEffect(e4)
  end
  function s.ctcon(e, tp, eg, ep, ev, re, r, rp)
  	return re and re:GetHandler():IsSetCard(SETCARD_ID_0) and not re:IsHasType(EFFECT_TYPE_ACTIVATE)
  end
  function s.ctop(e, tp, eg, ep, ev, re, r, rp)
  	e:GetHandler():AddCounter(COUNTER_ID_0, 1)
  end
  function s.atkval(e, c)
  	return e:GetHandler():GetCounter(COUNTER_ID_0) * 100
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local ct = Duel.GetMatchingGroupCount(s.filter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, nil)
  	local b1 = Duel.IsCanRemoveCounter(tp, 1, 0, COUNTER_ID_0, 5, REASON_COST)
  	local b2 = Duel.IsCanRemoveCounter(tp, 1, 0, COUNTER_ID_0, 7, REASON_COST) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_ONFIELD + LOCATION_GRAVE, 1, nil)
  	if chk == 0 then
  		return ct > 0 and (b1 or b2)
  	end
  	local op = 0
  	if b1 and b2 then
  		op = Duel.SelectOption(tp, aux.Stringid(id, 0), aux.Stringid(id, 1))
  	elseif b1 then
  		op = Duel.SelectOption(tp, aux.Stringid(id, 0))
  	else
  		op = Duel.SelectOption(tp, aux.Stringid(id, 1)) + 1
  	end
  	e:SetLabel(op)
  	if op == 0 then
  		e:SetCategory(CATEGORY_DAMAGE)
  		Duel.RemoveCounter(tp, 1, 0, COUNTER_ID_0, 5, REASON_COST)
  		Duel.SetTargetPlayer(1 - tp)
  		Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, ct * 300)
  	else
  		e:SetCategory(CATEGORY_REMOVE)
  		Duel.RemoveCounter(tp, 1, 0, COUNTER_ID_0, 7, REASON_COST)
  		Duel.SetOperationInfo(0, CATEGORY_REMOVE, nil, 1, 0, LOCATION_ONFIELD + LOCATION_GRAVE)
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local ct = Duel.GetMatchingGroupCount(s.filter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, nil)
  	if ct == 0 then
  		return
  	end
  	if e:GetLabel() == 0 then
  		local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  		Duel.Damage(p, ct * 300, REASON_EFFECT)
  	else
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  		local g = Duel.SelectMatchingCard(tp, Card.IsAbleToRemove, tp, 0, LOCATION_ONFIELD + LOCATION_GRAVE, 1, ct, nil)
  		if g:GetCount() > 0 then
  			Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
  		end
  	end
  end
  
  