Merge branch 'cpeff_stack' into 'master'

CountersPutEffect Stringbuilder tweak for 0 targets

See merge request core-developers/forge!3153
This commit is contained in:
Michael Kamensky
2020-09-21 05:47:45 +00:00

View File

@@ -49,6 +49,13 @@ public class CountersPutEffect extends SpellAbilityEffect {
final boolean dividedAsYouChoose = spellAbility.hasParam("DividedAsYouChoose"); final boolean dividedAsYouChoose = spellAbility.hasParam("DividedAsYouChoose");
final int amount = AbilityUtils.calculateAmount(card, spellAbility.getParamOrDefault("CounterNum", "1"), spellAbility); 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")) { if (spellAbility.hasParam("Bolster")) {
stringBuilder.append("Bolster ").append(amount); stringBuilder.append("Bolster ").append(amount);
return stringBuilder.toString(); return stringBuilder.toString();