mirror of
https://github.com/magefree/mage.git
synced 2026-01-18 09:19:56 -08:00
Reworked text generation a bit. Now the text for alternate costs are build correct. But maybe it's better to redesign AlternateCostImpl a bit so that the value of GetName() and GetText() is for all AlternateCost classes handled in the same way.
This commit is contained in:
parent
d05491c8ab
commit
396490cc77
3 changed files with 13 additions and 19 deletions
|
|
@ -231,8 +231,9 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
|
|||
protected boolean useAlternativeCost(Game game) {
|
||||
for (AlternativeCost cost: alternativeCosts) {
|
||||
if (cost.isAvailable(game, this)) {
|
||||
if (game.getPlayer(this.controllerId).chooseUse(Outcome.Neutral, "Use alternative cost " + cost.getName(), game))
|
||||
if (game.getPlayer(this.controllerId).chooseUse(Outcome.Neutral, "Use alternative cost " + cost.getName(), game)) {
|
||||
return cost.pay(this, game, sourceId, controllerId, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
@ -349,19 +350,6 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
|
|||
sbRule.append(": ");
|
||||
}
|
||||
}
|
||||
else if (this.alternativeCosts.size() > 0) {
|
||||
for (AlternativeCost cost: alternativeCosts) {
|
||||
sbRule.append(cost.getText()).append("\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (Cost cost: this.costs) {
|
||||
if (!(cost instanceof ManaCost)) {
|
||||
sbRule.append("As an additional cost to cast {this}, ").append(cost.getText()).append("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sbRule.append(modes.getText());
|
||||
|
||||
return sbRule.toString();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue