mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
CardFactoryUtil: fixed Eternalize and nonManaCost
This commit is contained in:
@@ -3764,13 +3764,28 @@ public class CardFactoryUtil {
|
|||||||
} else if (keyword.startsWith("Eternalize")) {
|
} else if (keyword.startsWith("Eternalize")) {
|
||||||
final String[] kw = keyword.split(":");
|
final String[] kw = keyword.split(":");
|
||||||
String costStr = kw[1];
|
String costStr = kw[1];
|
||||||
|
Cost cost = new Cost(costStr, true);
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
String effect = "AB$ CopyPermanent | Cost$ " + costStr + " ExileFromGrave<1/CARDNAME> " +
|
sb.append("AB$ CopyPermanent | Cost$ ").append(costStr).append(" ExileFromGrave<1/CARDNAME>")
|
||||||
"| ActivationZone$ Graveyard | SorcerySpeed$ True | Eternalize$ True " +
|
.append(" | Defined$ Self | ActivationZone$ Graveyard | SorcerySpeed$ True | Eternalize$ True");
|
||||||
"| PrecostDesc$ Eternalize | CostDesc$ " + ManaCostParser.parse(costStr) + " | Defined$ Self " +
|
|
||||||
"| StackDescription$ Eternalize - CARDNAME "+
|
sb.append(" | PrecostDesc$ Eternalize ");
|
||||||
"| SpellDescription$ (" + Keyword.getInstance(keyword).getReminderText() + ")" ;
|
if (!cost.isOnlyManaCost()) { //Something other than a mana cost
|
||||||
final SpellAbility sa = AbilityFactory.getAbility(effect, card);
|
sb.append("- ");
|
||||||
|
}
|
||||||
|
// don't use SimpleString there because it does has "and" between cost i dont want that
|
||||||
|
costStr = cost.toString();
|
||||||
|
// but now it has ": " at the end i want to remove
|
||||||
|
sb.append("| CostDesc$ ").append(costStr.substring(0, costStr.length() - 2));
|
||||||
|
if (!cost.isOnlyManaCost()) {
|
||||||
|
sb.append(".");
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.append(" | StackDescription$ Eternalize - CARDNAME ")
|
||||||
|
.append("| SpellDescription$ (").append(Keyword.getInstance(keyword).getReminderText()).append(")");
|
||||||
|
final SpellAbility sa = AbilityFactory.getAbility(sb.toString(), card);
|
||||||
sa.setIntrinsic(intrinsic);
|
sa.setIntrinsic(intrinsic);
|
||||||
|
|
||||||
if (!intrinsic) {
|
if (!intrinsic) {
|
||||||
|
|||||||
Reference in New Issue
Block a user