- More cleanup.

This commit is contained in:
Agetian
2018-02-20 08:02:31 +03:00
parent fcc02ed600
commit 5bb9ac6fcd

View File

@@ -935,6 +935,30 @@ public class SpecialCardAi {
} }
} }
// Phyrexian Dreadnought
public static class PhyrexianDreadnought {
public static CardCollection reviseCreatureSacList(final Player ai, final SpellAbility sa, final CardCollection choices) {
choices.sort(Collections.reverseOrder(ComputerUtilCard.EvaluateCreatureComparator));
int power = 0;
List<Card> toKeep = Lists.newArrayList();
for (Card c : choices) {
if (c.getName().equals(ComputerUtilAbility.getAbilitySourceName(sa))) {
continue; // not worth it sac'ing another Dreadnaught
}
if (c.getNetPower() < 1) {
continue; // contributes nothing to Dreadnought requirements
}
if (power >= 12) {
break;
}
toKeep.add(c);
power += c.getNetPower();
}
return new CardCollection(toKeep);
}
}
// Price of Progress // Price of Progress
public static class PriceOfProgress { public static class PriceOfProgress {
public static boolean consider(final Player ai, final SpellAbility sa) { public static boolean consider(final Player ai, final SpellAbility sa) {
@@ -993,30 +1017,6 @@ public class SpecialCardAi {
} }
} }
// Phyrexian Dreadnought
public static class PhyrexianDreadnought {
public static CardCollection reviseCreatureSacList(final Player ai, final SpellAbility sa, final CardCollection choices) {
choices.sort(Collections.reverseOrder(ComputerUtilCard.EvaluateCreatureComparator));
int power = 0;
List<Card> toKeep = Lists.newArrayList();
for (Card c : choices) {
if (c.getName().equals(ComputerUtilAbility.getAbilitySourceName(sa))) {
continue; // not worth it sac'ing another Dreadnaught
}
if (c.getNetPower() < 1) {
continue; // contributes nothing to Dreadnought requirements
}
if (power >= 12) {
break;
}
toKeep.add(c);
power += c.getNetPower();
}
return new CardCollection(toKeep);
}
}
// Sarkhan the Mad // Sarkhan the Mad
public static class SarkhanTheMad { public static class SarkhanTheMad {
public static boolean considerDig(final Player ai, final SpellAbility sa) { public static boolean considerDig(final Player ai, final SpellAbility sa) {