Fixed hints on ward

This commit is contained in:
Alex Vasile 2022-02-06 16:24:57 -05:00
parent 149c799926
commit 24ff47c803
16 changed files with 48 additions and 26 deletions

View file

@ -18,15 +18,22 @@ import mage.util.CardUtil;
public class WardAbility extends TriggeredAbilityImpl {
private final Cost cost;
private final boolean showAbilityHint;
public WardAbility(Cost cost) {
this(cost, true);
}
public WardAbility(Cost cost, boolean showAbilityHint) {
super(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(cost), false);
this.cost = cost;
this.showAbilityHint = showAbilityHint;
}
private WardAbility(final WardAbility ability) {
super(ability);
this.cost = ability.cost.copy();
this.showAbilityHint = ability.showAbilityHint;
}
@Override
@ -73,14 +80,18 @@ public class WardAbility extends TriggeredAbilityImpl {
} else {
sb.append("—").append(CardUtil.getTextWithFirstCharUpperCase(cost.getText())).append('.');
}
sb.append(" <i>(Whenever {this} becomes the target of a spell or ability an opponent controls, " +
"counter that spell or ability unless that player ");
if (cost instanceof ManaCost) {
sb.append("pays ").append(cost.getText());
} else {
sb.append(cost.getText().replace("pay ", "pays "));
if (showAbilityHint) {
sb.append(" <i>(Whenever this creature becomes the target of a spell or ability an opponent controls, " +
"counter it unless that player ");
if (cost instanceof ManaCost) {
sb.append("pays ").append(cost.getText());
} else {
sb.append(cost.getText().replace("pay ", "pays "));
}
sb.append(".)</i>");
}
sb.append(".)</i>");
return sb.toString();
}
}