BoostSourceEffect: format X like BoostTargetEffect

primarily to fix Chameleon Colossus and friends, but also updated
Terra Ravager's ability to match the corrected format, and now
both Source and Target support -X, for Death's Shadow.
This commit is contained in:
Neil Gentleman 2015-11-07 12:27:02 -08:00
parent 7830dc1098
commit eda5d1a1ef
4 changed files with 20 additions and 9 deletions

View file

@ -137,14 +137,24 @@ public class BoostSourceEffect extends ContinuousEffectImpl implements SourceEff
if (duration != Duration.WhileOnBattlefield) {
sb.append(" ").append(duration.toString());
}
String message = power.getMessage();
if (message.length() == 0) {
String message = null;
String fixedPart = null;
if (t.contains("X")) {
message = toughness.getMessage();
fixedPart = ", where X is ";
} else if (p.contains("X")) {
message = power.getMessage();
fixedPart = ", where X is ";
} else if (!power.getMessage().isEmpty()) {
message = power.getMessage();
fixedPart = " for each ";
} else if (!toughness.getMessage().isEmpty()) {
message = toughness.getMessage();
fixedPart = " for each ";
}
if (message.length() > 0) {
sb.append(" for each ");
if (message != null && !message.isEmpty() && fixedPart != null) {
sb.append(fixedPart).append(message);
}
sb.append(message);
staticText = sb.toString();
}

View file

@ -150,10 +150,10 @@ public class BoostTargetEffect extends ContinuousEffectImpl {
}
String message = null;
String fixedPart = null;
if (t.equals("X")) {
if (t.contains("X")) {
message = toughness.getMessage();
fixedPart = ", where X is ";
} else if (p.equals("X")) {
} else if (p.contains("X")) {
message = power.getMessage();
fixedPart = ", where X is ";
} else if (!power.getMessage().isEmpty()) {