forked from External/mage
[CLB] Implement Minthara, Merciless Soul (#9972)
This commit is contained in:
parent
6a4ead88e2
commit
7172027cde
4 changed files with 165 additions and 9 deletions
|
|
@ -3,6 +3,7 @@ package mage.abilities.keyword;
|
|||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.mana.ManaCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.common.CounterUnlessPaysEffect;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
|
|
@ -18,7 +19,10 @@ import mage.util.CardUtil;
|
|||
public class WardAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private final Cost cost;
|
||||
private final DynamicValue genericMana;
|
||||
|
||||
private final boolean showAbilityHint;
|
||||
private final String whereXIs;
|
||||
|
||||
public WardAbility(Cost cost) {
|
||||
this(cost, true);
|
||||
|
|
@ -27,13 +31,34 @@ public class WardAbility extends TriggeredAbilityImpl {
|
|||
public WardAbility(Cost cost, boolean showAbilityHint) {
|
||||
super(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(cost), false);
|
||||
this.cost = cost;
|
||||
this.genericMana = null;
|
||||
this.showAbilityHint = showAbilityHint;
|
||||
this.whereXIs = null;
|
||||
}
|
||||
|
||||
public WardAbility(DynamicValue genericMana) {
|
||||
this(genericMana, null);
|
||||
}
|
||||
|
||||
public WardAbility(DynamicValue genericMana, String whereXIs) {
|
||||
super(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(genericMana), false);
|
||||
this.genericMana = genericMana;
|
||||
this.whereXIs = whereXIs;
|
||||
this.cost = null;
|
||||
this.showAbilityHint = false;
|
||||
}
|
||||
|
||||
private WardAbility(final WardAbility ability) {
|
||||
super(ability);
|
||||
this.cost = ability.cost.copy();
|
||||
if (ability.cost != null) {
|
||||
this.cost = ability.cost.copy();
|
||||
this.genericMana = null;
|
||||
} else {
|
||||
this.genericMana = ability.genericMana.copy();
|
||||
this.cost = null;
|
||||
}
|
||||
this.showAbilityHint = ability.showAbilityHint;
|
||||
this.whereXIs = ability.whereXIs;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -75,21 +100,36 @@ public class WardAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public String getRule() {
|
||||
StringBuilder sb = new StringBuilder("ward");
|
||||
if (cost instanceof ManaCost) {
|
||||
sb.append(' ').append(cost.getText());
|
||||
if (cost != null) {
|
||||
if (cost instanceof ManaCost) {
|
||||
sb.append(' ').append(cost.getText());
|
||||
} else {
|
||||
sb.append("—").append(CardUtil.getTextWithFirstCharUpperCase(cost.getText())).append('.');
|
||||
}
|
||||
} else {
|
||||
sb.append("—").append(CardUtil.getTextWithFirstCharUpperCase(cost.getText())).append('.');
|
||||
sb.append(" {X}");
|
||||
if (whereXIs != null) {
|
||||
sb.append(", where X is ").append(whereXIs).append('.');
|
||||
}
|
||||
}
|
||||
|
||||
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());
|
||||
if (cost != null) {
|
||||
if (cost instanceof ManaCost) {
|
||||
sb.append("pays ").append(cost.getText());
|
||||
} else {
|
||||
sb.append(cost.getText().replace("pay ", "pays "));
|
||||
}
|
||||
sb.append(".)</i>");
|
||||
} else {
|
||||
sb.append(cost.getText().replace("pay ", "pays "));
|
||||
sb.append("pays {X}");
|
||||
if (whereXIs != null) {
|
||||
sb.append(whereXIs);
|
||||
}
|
||||
sb.append(".)</i>");
|
||||
}
|
||||
sb.append(".)</i>");
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue