- Convert keyword "maxLevel" to SVar

This commit is contained in:
swordshine
2014-03-30 07:57:38 +00:00
parent 3ec3982e01
commit e31bbe28c5
25 changed files with 28 additions and 32 deletions

View File

@@ -2055,23 +2055,19 @@ public class CardFactoryUtil {
} // unearth
final int iLvlUp = hasKeyword(card, "Level up");
final int iLvlMax = hasKeyword(card, "maxLevel");
if (iLvlUp != -1 && iLvlMax != -1) {
if (iLvlUp != -1) {
final String strLevelCost = card.getKeyword().get(iLvlUp);
final String strMaxLevel = card.getKeyword().get(iLvlMax);
final String strMaxLevel = card.getSVar("maxLevel");
card.removeIntrinsicKeyword(strLevelCost);
card.removeIntrinsicKeyword(strMaxLevel);
final String[] k = strLevelCost.split(":");
final String manacost = k[1];
final String[] l = strMaxLevel.split(":");
final int maxLevel = Integer.parseInt(l[1]);
String effect = "AB$ PutCounter | Cost$ " + manacost + " | " +
"SorcerySpeed$ True | LevelUp$ True | CounterNum$ 1" +
" | CounterType$ LEVEL | PrecostDesc$ Level Up | MaxLevel$ " +
maxLevel + " | SpellDescription$ (Put a level counter on" +
strMaxLevel + " | SpellDescription$ (Put a level counter on" +
" this permanent. Activate this ability only any time you" +
" could cast a sorcery.)";