From 530f5c2e35009a580d6929481658781e24993df0 Mon Sep 17 00:00:00 2001 From: Agetian Date: Fri, 9 Nov 2018 22:19:02 +0300 Subject: [PATCH] - Fixed a logic error in the recent Momir strategy commit. --- forge-ai/src/main/java/forge/ai/AiController.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/AiController.java b/forge-ai/src/main/java/forge/ai/AiController.java index 6b00f8122c3..0da3b6d1a80 100644 --- a/forge-ai/src/main/java/forge/ai/AiController.java +++ b/forge-ai/src/main/java/forge/ai/AiController.java @@ -437,10 +437,14 @@ public class AiController { return null; } + CardCollection nonLandsInHand = CardLists.filter(player.getCardsIn(ZoneType.Hand), Predicates.not(CardPredicates.Presets.LANDS)); + // Some considerations for Momir/MoJhoSto boolean hasMomir = !CardLists.filter(player.getCardsIn(ZoneType.Command), CardPredicates.nameEquals("Momir Vig, Simic Visionary Avatar")).isEmpty(); - if (hasMomir) { + if (hasMomir && nonLandsInHand.isEmpty()) { + // Only do this if we have an all-basic land hand, which covers both stock Momir and MoJhoSto modes + // and also a custom Vanguard setup with a customized basic land deck and Momir as the avatar. String landStrategy = getProperty(AiProps.MOMIR_BASIC_LAND_STRATEGY); if (landStrategy.equalsIgnoreCase("random")) { // Pick a completely random basic land @@ -458,8 +462,8 @@ public class AiController { } } } - return Aggregates.random(landList); } + return Aggregates.random(landList); } // If nothing is done here, proceeds to the default land picking strategy } @@ -475,7 +479,6 @@ public class AiController { landList = unreflectedLands; } - CardCollection nonLandsInHand = CardLists.filter(player.getCardsIn(ZoneType.Hand), Predicates.not(CardPredicates.Presets.LANDS)); //try to skip lands that enter the battlefield tapped if (!nonLandsInHand.isEmpty()) {