Skip to content

Commit

Permalink
BoostSourceEffect: format X like BoostTargetEffect
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nigelzor committed Nov 9, 2015
1 parent 7830dc1 commit eda5d1a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/sets/commander2013/TerraRavager.java
Expand Up @@ -106,6 +106,6 @@ public String toString() {

@Override
public String getMessage() {
return "land defending player controls";
return "the number of lands defending player controls";
}
}
3 changes: 2 additions & 1 deletion Mage.Sets/src/mage/sets/worldwake/DeathsShadow.java
Expand Up @@ -55,7 +55,8 @@ public DeathsShadow(UUID ownerId) {
this.toughness = new MageInt(13);

// Death's Shadow gets -X/-X, where X is your life total.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new SignInversionDynamicValue(new ControllerLifeCount()), new SignInversionDynamicValue(new ControllerLifeCount()), Duration.WhileOnBattlefield)));
SignInversionDynamicValue x = new SignInversionDynamicValue(new ControllerLifeCount());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(x, x, Duration.WhileOnBattlefield)));
}

public DeathsShadow(final DeathsShadow card) {
Expand Down
Expand Up @@ -137,14 +137,24 @@ private void setText() {
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();
}

Expand Down
Expand Up @@ -150,10 +150,10 @@ public String getText(Mode mode) {
}
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()) {
Expand Down

0 comments on commit eda5d1a

Please sign in to comment.