From 9596143170c5503e1ebe4963cc9ee15c2923efc1 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 03:56:14 +0000 Subject: [PATCH] The AI will only cast Mind Twist/Shatter if it can cause the human to discard at least two cards. Added a MaxX test into the canPlayAI() to make sure that the computer has enough untapped mana to power up the X cost. --- src/forge/CardFactory.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index d18c0f6440c..0da2c40470d 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -17128,7 +17128,9 @@ public class CardFactory implements NewConstants { @Override public boolean canPlayAI() { - return AllZone.Human_Hand.size() > 1; + final int maxX = ComputerUtil.getAvailableMana().size() - 1; + return ((cardName.equals("Mind Twist") && AllZone.Human_Hand.size() > 1 && maxX >= 2) || + (cardName.equals("Mind Shatter") && AllZone.Human_Hand.size() > 1 && maxX >= 3)); } @Override