From 1ea54bcd4540400a9f69772ff3f4e996746d2638 Mon Sep 17 00:00:00 2001 From: Agetian Date: Tue, 27 Jun 2017 03:38:23 +0000 Subject: [PATCH] - Reverted previous commit (doesn't work as intended). --- forge-ai/src/main/java/forge/ai/ComputerUtil.java | 5 +++++ forge-game/src/main/java/forge/game/GameAction.java | 12 +++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ComputerUtil.java b/forge-ai/src/main/java/forge/ai/ComputerUtil.java index 28f4fa12e6b..d930b75c22a 100644 --- a/forge-ai/src/main/java/forge/ai/ComputerUtil.java +++ b/forge-ai/src/main/java/forge/ai/ComputerUtil.java @@ -2654,6 +2654,11 @@ public class ComputerUtil { AiController aic = ((PlayerControllerAi) ai.getController()).getAi(); Card targetSpellCard = null; for (Card c : options) { + if (withoutPayingManaCost && c.getManaCost() != null && c.getManaCost().getShardCount(ManaCostShard.X) > 0) { + // The AI will otherwise cheat with the mana payment, announcing X > 0 for spells like Heat Ray when replaying them + // without paying their mana cost. + continue; + } for (SpellAbility ab : c.getSpellAbilities()) { if (ab.getApi() == null) { // only API-based SAs are supported, other things may lead to a NPE (e.g. Ancestral Vision Suspend SA) diff --git a/forge-game/src/main/java/forge/game/GameAction.java b/forge-game/src/main/java/forge/game/GameAction.java index defee2068f6..5f4bddc76c8 100644 --- a/forge-game/src/main/java/forge/game/GameAction.java +++ b/forge-game/src/main/java/forge/game/GameAction.java @@ -184,15 +184,9 @@ public class GameAction { zoneChangedEarly = true; } - if (fromBattlefield) { - // Clean up the temporary Dash SVar when the Dashed card leaves the battlefield - if (c.getSVar("EndOfTurnLeavePlay").equals("Dash")) { - c.removeSVar("EndOfTurnLeavePlay"); - } - // Clean up the temporary X announcement variable used by the AI - if (!zoneTo.is(ZoneType.Stack) && c.hasSVar("PayX")) { - c.removeSVar("PayX"); - } + // Clean up the temporary Dash SVar when the Dashed card leaves the battlefield + if (fromBattlefield && c.getSVar("EndOfTurnLeavePlay").equals("Dash")) { + c.removeSVar("EndOfTurnLeavePlay"); } if (fromBattlefield && !toBattlefield) {