Merge branch 'stackDescs' into 'master'

some more getStackDescription improvements

See merge request core-developers/forge!6281
This commit is contained in:
Michael Kamensky
2022-02-22 09:48:59 +00:00
2 changed files with 8 additions and 7 deletions

View File

@@ -88,7 +88,7 @@ public class CountersPutEffect extends SpellAbilityEffect {
stringBuilder.append(targetCard); stringBuilder.append(targetCard);
Integer v = spellAbility.getDividedValue(targetCard); Integer v = spellAbility.getDividedValue(targetCard);
if (v != null) // fix null counter stack description if (v != null) // fix null counter stack description
stringBuilder.append(" (").append(v).append(" counter)"); stringBuilder.append(" (").append(v).append(v == 1 ? " counter)" : " counters)");
if(i == targetCards.size() - 2) { if(i == targetCards.size() - 2) {
stringBuilder.append(" and "); stringBuilder.append(" and ");

View File

@@ -182,16 +182,17 @@ public class PumpEffect extends SpellAbilityEffect {
keywords.addAll(Arrays.asList(sa.getParam("KW").split(" & "))); keywords.addAll(Arrays.asList(sa.getParam("KW").split(" & ")));
} }
if (sa instanceof AbilitySub & sa.getRootAbility().getTargets().containsAll(tgts)) {
//try to avoid having the same long list of targets twice in a StackDescription
sb.append(tgts.size() == 1 && tgts.get(0) instanceof Card ? "It " : "They ");
} else {
sb.append(Lang.joinHomogenous(tgts)).append(" "); sb.append(Lang.joinHomogenous(tgts)).append(" ");
}
if (sa.hasParam("Radiance")) { if (sa.hasParam("Radiance")) {
sb.append("and each other ").append(sa.getParam("ValidTgts")) sb.append("and each other ").append(sa.getParam("ValidTgts"))
.append(" that shares a color with "); .append(" that shares a color with ");
if (tgts.size() > 1) { sb.append(tgts.size() > 1 ? "them " : "it ");
sb.append("them ");
} else {
sb.append("it ");
}
} }
final int atk = AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParam("NumAtt"), sa, true); final int atk = AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParam("NumAtt"), sa, true);