CountersPutEffect Stringbuilder tweak for 0 targets

This commit is contained in:
Northmoc
2020-09-18 12:11:15 -04:00
parent 8640a595ab
commit 71e521e788

View File

@@ -49,6 +49,13 @@ public class CountersPutEffect extends SpellAbilityEffect {
final boolean dividedAsYouChoose = spellAbility.hasParam("DividedAsYouChoose");
final int amount = AbilityUtils.calculateAmount(card, spellAbility.getParamOrDefault("CounterNum", "1"), spellAbility);
//skip the StringBuilder if no targets are chosen ("up to" scenario)
if (spellAbility.usesTargeting()) {
final List<Card> targetCards = SpellAbilityEffect.getTargetCards(spellAbility);
if (targetCards.size() == 0) {
return stringBuilder.toString();
}
}
if (spellAbility.hasParam("Bolster")) {
stringBuilder.append("Bolster ").append(amount);
return stringBuilder.toString();