From 5991c8f51c8891a0552222e2850c1534f1a7d42e Mon Sep 17 00:00:00 2001 From: Agetian Date: Sat, 23 Sep 2017 11:16:58 +0000 Subject: [PATCH] - Fixed Scry AI scrying away basic lands thinking that they do not produce mana since they do not use a mana-producing SA as such and rely on the basic land type instead. git-svn-id: http://svn.slightlymagic.net/forge/trunk@35720 269b9781-a132-4a9b-9d4e-f004f1b56b58 --- forge-ai/src/main/java/forge/ai/ComputerUtil.java | 3 ++- forge-game/src/main/java/forge/game/card/Card.java | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/forge-ai/src/main/java/forge/ai/ComputerUtil.java b/forge-ai/src/main/java/forge/ai/ComputerUtil.java index 845e9eb4..1fbfd28c 100644 --- a/forge-ai/src/main/java/forge/ai/ComputerUtil.java +++ b/forge-ai/src/main/java/forge/ai/ComputerUtil.java @@ -1896,7 +1896,8 @@ public class ComputerUtil { int numCards = allCreatures.size(); if (landsOTB.size() < maxLandsToScryLandsToTop && landsInHand.isEmpty()) { - if ((!c.isLand() && !manaArts.contains(c.getName())) || c.getManaAbilities().isEmpty()) { + if ((!c.isLand() && !manaArts.contains(c.getName())) + || (c.getManaAbilities().isEmpty() && !c.hasABasicLandType())) { // scry away non-lands and non-manaproducing lands in situations when the land count // on the battlefield is low, to try to improve the mana base early bottom = true; diff --git a/forge-game/src/main/java/forge/game/card/Card.java b/forge-game/src/main/java/forge/game/card/Card.java index b8506894..69aea8fd 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -4128,6 +4128,15 @@ public class Card extends GameEntity implements Comparable { return false; } + public final boolean hasABasicLandType() { + for (final String type : getType().getSubtypes()) { + if (forge.card.CardType.isABasicLandType(type)) { + return true; + } + } + return false; + } + public final boolean isUsedToPay() { return usedToPayCost; }