From a8b8b6cedf41a1b5e08051fd6e72b76136f6f8a1 Mon Sep 17 00:00:00 2001 From: Sloth Date: Sun, 28 Apr 2013 15:08:43 +0000 Subject: [PATCH] - Added some AI specific for Laboratory Maniac. --- res/cardsfolder/e/enduring_ideal.txt | 2 +- src/main/java/forge/card/ability/ai/DrawAi.java | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/res/cardsfolder/e/enduring_ideal.txt b/res/cardsfolder/e/enduring_ideal.txt index 3a6f4444950..2ae1dff6187 100644 --- a/res/cardsfolder/e/enduring_ideal.txt +++ b/res/cardsfolder/e/enduring_ideal.txt @@ -3,7 +3,7 @@ ManaCost:5 W W Types:Sorcery K:Epic A:SP$ChangeZone | Cost$ 5 W W | Origin$ Library | Destination$ Battlefield | ChangeType$ Enchantment | ChangeNum$ 1 | SpellDescription$ Search your library for an enchantment card and put it onto the battlefield. Then shuffle your library. -SVar:RemAIDeck:True +SVar:RemRandomDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/enduring_ideal.jpg Oracle:Search your library for an enchantment card and put it onto the battlefield. Then shuffle your library.\nEpic (For the rest of the game, you can't cast spells. At the beginning of each of your upkeeps, copy this spell except for its epic ability.) SetInfo:SOK Rare \ No newline at end of file diff --git a/src/main/java/forge/card/ability/ai/DrawAi.java b/src/main/java/forge/card/ability/ai/DrawAi.java index 7ba870f3b53..6da0a719f9b 100644 --- a/src/main/java/forge/card/ability/ai/DrawAi.java +++ b/src/main/java/forge/card/ability/ai/DrawAi.java @@ -191,7 +191,7 @@ public class DrawAi extends SpellAbilityAi { return false; } - if (canTgtHuman && !opp.cantLose() && (numCards >= humanLibrarySize)) { + if (canTgtHuman && !opp.cantLose() && numCards >= humanLibrarySize) { // Deck the Human? DO IT! tgt.addTarget(opp); return true; @@ -210,8 +210,7 @@ public class DrawAi extends SpellAbilityAi { } } - if (((computerHandSize + numCards) > computerMaxHandSize) - && game.getPhaseHandler().isPlayerTurn(ai)) { + if (computerHandSize + numCards > computerMaxHandSize && game.getPhaseHandler().isPlayerTurn(ai)) { if (xPaid) { numCards = computerMaxHandSize - computerHandSize; source.setSVar("PayX", Integer.toString(numCards)); @@ -240,6 +239,9 @@ public class DrawAi extends SpellAbilityAi { // ability is not targeted if (numCards >= computerLibrarySize) { + if (ai.isCardInPlay("Laboratory Maniac")) { + return true; + } // Don't deck yourself return false; }