mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
CardFactoryUtil: move LevelUp to addSpellAbility section
This commit is contained in:
@@ -1503,6 +1503,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
|| keyword.startsWith("Evoke") || keyword.startsWith("Bestow") || keyword.startsWith("Dash")
|
||||
|| keyword.startsWith("Surge") || keyword.startsWith("Transmute") || keyword.startsWith("Suspend")
|
||||
|| keyword.equals("Undaunted") || keyword.startsWith("Monstrosity") || keyword.startsWith("Embalm")
|
||||
|| keyword.startsWith("Level up")
|
||||
|| keyword.startsWith("Cycling") || keyword.startsWith("TypeCycling")) {
|
||||
// keyword parsing takes care of adding a proper description
|
||||
} else if (keyword.startsWith("CantBeBlockedBy")) {
|
||||
|
||||
@@ -2003,20 +2003,7 @@ public class CardFactoryUtil {
|
||||
addSpellAbility(keyword, card, null);
|
||||
}
|
||||
else if (keyword.startsWith("Level up")) {
|
||||
final String strMaxLevel = card.getSVar("maxLevel");
|
||||
card.removeIntrinsicKeyword(keyword);
|
||||
|
||||
final String[] k = keyword.split(":");
|
||||
final String manacost = k[1];
|
||||
|
||||
String effect = "AB$ PutCounter | Cost$ " + manacost + " | " +
|
||||
"SorcerySpeed$ True | LevelUp$ True | CounterNum$ 1" +
|
||||
" | CounterType$ LEVEL | PrecostDesc$ Level Up | MaxLevel$ " +
|
||||
strMaxLevel + " | SpellDescription$ (Put a level counter on" +
|
||||
" this permanent. Activate this ability only any time you" +
|
||||
" could cast a sorcery.)";
|
||||
|
||||
card.addSpellAbility(AbilityFactory.getAbility(effect, card));
|
||||
addSpellAbility(keyword, card, null);
|
||||
}
|
||||
else if (keyword.startsWith("Cycling")) {
|
||||
addSpellAbility(keyword, card, null);
|
||||
@@ -3717,6 +3704,29 @@ public class CardFactoryUtil {
|
||||
sa.setIntrinsic(intrinsic);
|
||||
card.addSpellAbility(sa);
|
||||
}
|
||||
} else if (keyword.startsWith("Level up")) {
|
||||
final String[] k = keyword.split(":");
|
||||
final String manacost = k[1];
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("AB$ PutCounter| Cost$ ").append(manacost);
|
||||
sb.append(" | PrecostDesc$ Level Up | CostDesc$ ").append(ManaCostParser.parse(manacost));
|
||||
sb.append(" | SorcerySpeed$ True | LevelUp$ True | CounterNum$ 1 | CounterType$ LEVEL");
|
||||
if (card.hasSVar("maxLevel")) {
|
||||
final String strMaxLevel = card.getSVar("maxLevel");
|
||||
sb.append("| MaxLevel$ ").append(strMaxLevel);
|
||||
}
|
||||
sb.append(" | SpellDescription$ (").append(Keyword.getInstance(keyword).getReminderText()).append(")");
|
||||
|
||||
final SpellAbility sa = AbilityFactory.getAbility(sb.toString(), card);
|
||||
sa.setIntrinsic(intrinsic);
|
||||
|
||||
if (!intrinsic) {
|
||||
sa.setTemporary(true);
|
||||
kws.addSpellAbility(sa);
|
||||
}
|
||||
|
||||
card.addSpellAbility(sa);
|
||||
} else if (keyword.startsWith("Monstrosity")) {
|
||||
final String[] k = keyword.split(":");
|
||||
final String magnitude = k[1];
|
||||
|
||||
@@ -76,7 +76,7 @@ public enum Keyword {
|
||||
INTIMIDATE(SimpleKeyword.class, true, "This creature can't be blocked except by artifact creatures and/or creatures that share a color with it."),
|
||||
KICKER(Kicker.class, false, "You may pay an additional %s as you cast this spell."),
|
||||
LANDWALK(KeywordWithType.class, false, "This creature is unblockable as long as defending player controls a %s."),
|
||||
LEVELUP(KeywordWithCost.class, false, "%s: Put a level counter on this permanent. Activate this ability only any time you could cast a sorcery."),
|
||||
LEVEL_UP(KeywordWithCost.class, false, "%s: Put a level counter on this. Level up only as a sorcery."),
|
||||
LIFELINK(SimpleKeyword.class, true, "Damage dealt by this creature also causes its controller to gain that much life."),
|
||||
LIVING_WEAPON(SimpleKeyword.class, true, "When this Equipment enters the battlefield, create a 0/0 black Germ creature token, then attach this Equipment to it."),
|
||||
MADNESS(KeywordWithCost.class, true, "If you discard this card, you may cast it for %s instead of putting it into your graveyard."),
|
||||
|
||||
Reference in New Issue
Block a user