From dcccae1f7ce5ae95151dbf203a18e865a0d0ecf8 Mon Sep 17 00:00:00 2001 From: Sloth Date: Wed, 12 Feb 2014 21:28:28 +0000 Subject: [PATCH] - Fixed AI using Idle Thoughts. --- forge-ai/src/main/java/forge/ai/ability/DrawAi.java | 7 +++++-- forge-gui/res/cardsfolder/i/idle_thoughts.txt | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/DrawAi.java b/forge-ai/src/main/java/forge/ai/ability/DrawAi.java index 816f6b2569f..5288f72ca75 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DrawAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/DrawAi.java @@ -103,6 +103,10 @@ public class DrawAi extends SpellAbilityAi { return true; } + if (sa.getConditions() != null && !sa.getConditions().areMet(sa) && sa.getSubAbility() == null) { + return false; + } + // Don't use draw abilities before main 2 if possible if (game.getPhaseHandler().getPhase().isBefore(PhaseType.MAIN2) && !sa.hasParam("ActivationPhases") && !ComputerUtil.castSpellInMain1(ai, sa)) { @@ -161,8 +165,7 @@ public class DrawAi extends SpellAbilityAi { //if (n) // TODO: if xPaid and one of the below reasons would fail, instead of - // bailing - // reduce toPay amount to acceptable level + // bailing reduce toPay amount to acceptable level if (tgt != null) { // ability is targeted diff --git a/forge-gui/res/cardsfolder/i/idle_thoughts.txt b/forge-gui/res/cardsfolder/i/idle_thoughts.txt index 448bbec3d61..9538b0a2ba1 100644 --- a/forge-gui/res/cardsfolder/i/idle_thoughts.txt +++ b/forge-gui/res/cardsfolder/i/idle_thoughts.txt @@ -1,7 +1,7 @@ Name:Idle Thoughts ManaCost:3 U Types:Enchantment -A:AB$ Draw | Cost$ 2 | NumCards$ 1 | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0 | SpellDescription$ Draw a card if you have no cards in hand. +A:AB$ Draw | Cost$ 2 | NumCards$ 1 | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0 | References$ X | SpellDescription$ Draw a card if you have no cards in hand. SVar:X:Count$InYourHand SVar:Picture:http://www.wizards.com/global/images/magic/general/idle_thoughts.jpg Oracle:{2}: Draw a card if you have no cards in hand. \ No newline at end of file