Keyword: make Suspend extra class to make the special case if it doesn't have Cost or amount

This commit is contained in:
Hanmac
2017-11-09 05:23:28 +00:00
parent 0a9d5b73d8
commit cd55c4077e
3 changed files with 26 additions and 1 deletions

1
.gitattributes vendored
View File

@@ -618,6 +618,7 @@ forge-game/src/main/java/forge/game/keyword/Kicker.java -text svneol=unset#text/
forge-game/src/main/java/forge/game/keyword/Modular.java -text svneol=unset#text/plain forge-game/src/main/java/forge/game/keyword/Modular.java -text svneol=unset#text/plain
forge-game/src/main/java/forge/game/keyword/Protection.java -text forge-game/src/main/java/forge/game/keyword/Protection.java -text
forge-game/src/main/java/forge/game/keyword/SimpleKeyword.java -text forge-game/src/main/java/forge/game/keyword/SimpleKeyword.java -text
forge-game/src/main/java/forge/game/keyword/Suspend.java -text svneol=unset#text/plain
forge-game/src/main/java/forge/game/keyword/UndefinedKeyword.java -text forge-game/src/main/java/forge/game/keyword/UndefinedKeyword.java -text
forge-game/src/main/java/forge/game/mana/Mana.java svneol=native#text/plain forge-game/src/main/java/forge/game/mana/Mana.java svneol=native#text/plain
forge-game/src/main/java/forge/game/mana/ManaCostBeingPaid.java svneol=native#text/plain forge-game/src/main/java/forge/game/mana/ManaCostBeingPaid.java svneol=native#text/plain

View File

@@ -128,7 +128,7 @@ public enum Keyword {
STRIVE(KeywordWithCost.class, false, "CARDNAME costs %s more to cast for each target beyond the first."), STRIVE(KeywordWithCost.class, false, "CARDNAME costs %s more to cast for each target beyond the first."),
SUNBURST(SimpleKeyword.class, false, "This enters the battlefield with either a +1/+1 or charge counter on it for each color of mana spent to cast it based on whether it's a creature."), SUNBURST(SimpleKeyword.class, false, "This enters the battlefield with either a +1/+1 or charge counter on it for each color of mana spent to cast it based on whether it's a creature."),
SURGE(KeywordWithCost.class, true, "You may cast this spell for its surge cost if you or a teammate has cast another spell this turn."), SURGE(KeywordWithCost.class, true, "You may cast this spell for its surge cost if you or a teammate has cast another spell this turn."),
SUSPEND(KeywordWithCostAndAmount.class, false, "Rather than cast this card from your hand, you may pay %s and exile it with {%d:time counter} on it. At the beginning of your upkeep, remove a time counter. When the last is removed, cast it without paying its mana cost."), SUSPEND(Suspend.class, false, "Rather than cast this card from your hand, you may pay %s and exile it with {%d:time counter} on it. At the beginning of your upkeep, remove a time counter. When the last is removed, cast it without paying its mana cost."),
TOTEM_ARMOR(SimpleKeyword.class, true, "If enchanted permanent would be destroyed, instead remove all damage marked on it and destroy this Aura."), TOTEM_ARMOR(SimpleKeyword.class, true, "If enchanted permanent would be destroyed, instead remove all damage marked on it and destroy this Aura."),
TRAMPLE(SimpleKeyword.class, true, "If this creature would assign enough damage to its blockers to destroy them, you may have it assign the rest of its damage to defending player or planeswalker."), TRAMPLE(SimpleKeyword.class, true, "If this creature would assign enough damage to its blockers to destroy them, you may have it assign the rest of its damage to defending player or planeswalker."),
TRANSFIGURE(KeywordWithCost.class, false, "%s, Sacrifice this creature: Search your library for a creature card with the same converted mana cost as this creature and put that card onto the battlefield. Then shuffle your library. Transfigure only as a sorcery."), TRANSFIGURE(KeywordWithCost.class, false, "%s, Sacrifice this creature: Search your library for a creature card with the same converted mana cost as this creature and put that card onto the battlefield. Then shuffle your library. Transfigure only as a sorcery."),

View File

@@ -0,0 +1,24 @@
package forge.game.keyword;
public class Suspend extends KeywordWithCostAndAmount {
boolean withoutCostAndAmount = false;
@Override
protected void parse(String details) {
if ("".equals(details)) {
withoutCostAndAmount = true;
} else {
super.parse(details);
}
}
@Override
protected String formatReminderText(String reminderText) {
if (withoutCostAndAmount) {
return "At the beginning of its owner's upkeep, remove a time counter from that card. When the last is removed, the player plays it without paying its mana cost. If it's a creature, it has haste.";
} else {
return super.formatReminderText(reminderText);
}
}
}