- For cards like Restore Balance, Balance, etc., and for other cases where the AI uses getWorstLand/getWorstLandToAnimate, ensure that lands with negative initial score are still considered and picked by the AI (otherwise they're never picked even if the pick is mandatory).

This commit is contained in:
Agetian
2017-02-19 04:27:45 +00:00
parent 60ad055c74
commit 423599eaa3

View File

@@ -703,7 +703,7 @@ public class ComputerUtilCard {
*/ */
public static Card getWorstLand(final List<Card> lands) { public static Card getWorstLand(final List<Card> lands) {
Card worstLand = null; Card worstLand = null;
int maxScore = 0; int maxScore = Integer.MIN_VALUE;
// first, check for tapped, basic lands // first, check for tapped, basic lands
for (Card tmp : lands) { for (Card tmp : lands) {
int score = tmp.isTapped() ? 2 : 0; int score = tmp.isTapped() ? 2 : 0;
@@ -726,7 +726,7 @@ public class ComputerUtilCard {
public static Card getBestLandToAnimate(final Iterable<Card> lands) { public static Card getBestLandToAnimate(final Iterable<Card> lands) {
Card land = null; Card land = null;
int maxScore = 0; int maxScore = Integer.MIN_VALUE;
// first, check for tapped, basic lands // first, check for tapped, basic lands
for (Card tmp : lands) { for (Card tmp : lands) {
// TODO Improve this by choosing basic lands that I have plenty of mana in // TODO Improve this by choosing basic lands that I have plenty of mana in