From c6b8c2cf4e69285c16a0a2e11b1e91956dcebebb Mon Sep 17 00:00:00 2001 From: Agetian Date: Mon, 2 Jan 2017 15:25:20 +0000 Subject: [PATCH] - Some tidying up in ChooseColorAi --- .../src/main/java/forge/ai/ability/ChooseColorAi.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/ChooseColorAi.java b/forge-ai/src/main/java/forge/ai/ability/ChooseColorAi.java index ae2be8e7dd1..cdfe62e604a 100644 --- a/forge-ai/src/main/java/forge/ai/ability/ChooseColorAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/ChooseColorAi.java @@ -34,13 +34,14 @@ public class ChooseColorAi extends SpellAbilityAi { return false; } - if ("Nykthos, Shrine to Nyx".equals(sa.getHostCard().getName())) { + if ("Nykthos, Shrine to Nyx".equals(source.getName())) { PhaseHandler ph = game.getPhaseHandler(); if (!ph.isPlayerTurn(ai) || ph.getPhase().isBefore(PhaseType.MAIN2)) { return false; } String prominentColor = ComputerUtilCard.getMostProminentColor(ai.getCardsIn(ZoneType.Battlefield)); - int devotion = CardFactoryUtil.xCount(sa.getHostCard(), "Count$Devotion." + prominentColor); + int devotion = CardFactoryUtil.xCount(source, "Count$Devotion." + prominentColor); + //int numLands = CardLists.filter(ai.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals(MagicColor.Constant.BASIC_LANDS.get(MagicColor.getIndexOfFirstColor(MagicColor.fromName(prominentColor))))).size(); // TODO: maybe this logic also has to take the number of available lands of most prominent color type into account // do not use Nykthos if devotion to most prominent color is less than 4 (since {2} is paid to activate Nykthos, and Nykthos itself is tapped too) @@ -49,7 +50,7 @@ public class ChooseColorAi extends SpellAbilityAi { } } - if ("Oona, Queen of the Fae".equals(sa.getHostCard().getName())) { + if ("Oona, Queen of the Fae".equals(source.getName())) { PhaseHandler ph = game.getPhaseHandler(); if (ph.isPlayerTurn(ai) || ph.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS)) { return false; @@ -60,7 +61,7 @@ public class ChooseColorAi extends SpellAbilityAi { return true; } - if ("Addle".equals(sa.getHostCard().getName())) { + if ("Addle".equals(source.getName())) { PhaseHandler ph = game.getPhaseHandler(); if (ph.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS) || ai.getOpponent().getCardsIn(ZoneType.Hand).isEmpty()) { return false;