- 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.

This commit is contained in:
Agetian
2017-06-10 07:02:53 +00:00
parent aa3ca54ca8
commit 0bce0ee2e1
2 changed files with 11 additions and 5 deletions

View File

@@ -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;
}
}
}

View File

@@ -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