From 0bce0ee2e1e755e6948b7a8f757737bb4bab8104 Mon Sep 17 00:00:00 2001 From: Agetian Date: Sat, 10 Jun 2017 07:02:53 +0000 Subject: [PATCH] - AI should only sac Ghost Quarter if it either has more lands in play than the opponent, or equal amount of lands but at least one replacement land in hand, otherwise the AI tends to play too suboptimally. --- .../src/main/java/forge/ai/ability/DestroyAi.java | 14 ++++++++++---- forge-gui/res/cardsfolder/g/ghost_quarter.txt | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java b/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java index 5d7451671a3..9a6dc7a5e40 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java @@ -222,9 +222,9 @@ public class DestroyAi extends SpellAbilityAi { else if (CardLists.getNotType(list, "Land").isEmpty()) { choice = ComputerUtilCard.getBestLandAI(list); - if ("LandForLand".equals(logic)) { + if ("LandForLand".equals(logic) || "GhostQuarter".equals(logic)) { // Strip Mine, Wasteland - cut short if the relevant logic fails - if (!doLandForLandRemovalLogic(sa, ai, choice)) { + if (!doLandForLandRemovalLogic(sa, ai, choice, logic)) { return false; } } @@ -402,7 +402,7 @@ public class DestroyAi extends SpellAbilityAi { return true; } - public boolean doLandForLandRemovalLogic(SpellAbility sa, Player ai, Card tgtLand) { + public boolean doLandForLandRemovalLogic(SpellAbility sa, Player ai, Card tgtLand, String logic) { if (tgtLand == null) { return false; } Player tgtPlayer = tgtLand.getController(); @@ -445,6 +445,12 @@ public class DestroyAi extends SpellAbilityAi { boolean tempoCheck = numLandsOTB >= amountNoTempoCheck || ((numLandsInHand >= amountLandsInHand || isHighPriority) && ((numLandsInHand + numLandsOTB >= amountNoTimingCheck) || timingCheck)); - return tempoCheck; + // For Ghost Quarter, only use it if you have either more lands in play than your opponent + // or the same number of lands but an extra land in hand (otherwise the AI plays too suboptimally) + if ("GhostQuarter".equals(logic)) { + return tempoCheck && (numLandsOTB > oppLands.size() || (numLandsOTB == oppLands.size() && numLandsInHand > 0)); + } else { + return tempoCheck; + } } } diff --git a/forge-gui/res/cardsfolder/g/ghost_quarter.txt b/forge-gui/res/cardsfolder/g/ghost_quarter.txt index f57fcd4560a..62c3e1eab59 100644 --- a/forge-gui/res/cardsfolder/g/ghost_quarter.txt +++ b/forge-gui/res/cardsfolder/g/ghost_quarter.txt @@ -2,7 +2,7 @@ Name:Ghost Quarter ManaCost:no cost Types:Land A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C} to your mana pool. -A:AB$ Destroy | Cost$ T Sac<1/CARDNAME> | ValidTgts$ Land | TgtPrompt$ Select target land. | SubAbility$ DBChange | AILogic$ LandForLand | AITgts$ Land.nonBasic | SpellDescription$ Destroy target land. Its controller may search his or her library for a basic land card, put it onto the battlefield, then shuffle his or her library. +A:AB$ Destroy | Cost$ T Sac<1/CARDNAME> | ValidTgts$ Land | TgtPrompt$ Select target land. | SubAbility$ DBChange | AILogic$ GhostQuarter | AITgts$ Land.nonBasic | SpellDescription$ Destroy target land. Its controller may search his or her library for a basic land card, put it onto the battlefield, then shuffle his or her library. SVar:DBChange:DB$ChangeZone | Optional$ True | Origin$ Library | Destination$ Battlefield | ChangeType$ Land.Basic | ChangeNum$ 1 | DefinedPlayer$ TargetedController | ShuffleNonMandatory$ True SVar:RemRandomDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/ghost_quarter.jpg