CardFactoryUtil: moved "At the beginning of your upkeep, sacrifice" as "UpkeepCost" in CardFactoryUtil

delete Upkeep class because its not needed anymore
This commit is contained in:
Hanmac
2016-12-17 18:03:43 +00:00
parent 4b10704390
commit d8c97d9c4e
7 changed files with 40 additions and 104 deletions

View File

@@ -163,7 +163,7 @@ public class CreatureEvaluator implements Function<Card, Integer> {
value -= subValue(50, "eot-leaves");
} else if (c.hasStartOfKeyword("Cumulative upkeep")) {
value -= subValue(30, "cupkeep");
} else if (c.hasStartOfKeyword("At the beginning of your upkeep, sacrifice CARDNAME unless you pay")) {
} else if (c.hasStartOfKeyword("UpkeepCost")) {
value -= subValue(20, "sac-unless");
} else if (c.hasStartOfKeyword("Echo") && c.cameUnderControlSinceLastUpkeep()) {
value -= subValue(10, "echo-unpaid");

View File

@@ -135,9 +135,9 @@ public class PermanentAi extends SpellAbilityAi {
// don't play cards without being able to pay the upkeep for
for (String ability : card.getKeywords()) {
if (ability.startsWith("At the beginning of your upkeep, sacrifice CARDNAME unless you pay")) {
final String[] k = ability.split(" pay ");
final String costs = k[1].replaceAll("[{]", "").replaceAll("[}]", " ");
if (ability.startsWith("UpkeepCost")) {
final String[] k = ability.split(":");
final String costs = k[1];
final SpellAbility emptyAbility = new SpellAbility.EmptySa(card, ai);
emptyAbility.setPayCosts(new Cost(costs, true));