mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- Some tidying up in ChooseColorAi
This commit is contained in:
@@ -34,13 +34,14 @@ public class ChooseColorAi extends SpellAbilityAi {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Nykthos, Shrine to Nyx".equals(sa.getHostCard().getName())) {
|
if ("Nykthos, Shrine to Nyx".equals(source.getName())) {
|
||||||
PhaseHandler ph = game.getPhaseHandler();
|
PhaseHandler ph = game.getPhaseHandler();
|
||||||
if (!ph.isPlayerTurn(ai) || ph.getPhase().isBefore(PhaseType.MAIN2)) {
|
if (!ph.isPlayerTurn(ai) || ph.getPhase().isBefore(PhaseType.MAIN2)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
String prominentColor = ComputerUtilCard.getMostProminentColor(ai.getCardsIn(ZoneType.Battlefield));
|
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
|
//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)
|
// 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();
|
PhaseHandler ph = game.getPhaseHandler();
|
||||||
if (ph.isPlayerTurn(ai) || ph.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS)) {
|
if (ph.isPlayerTurn(ai) || ph.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -60,7 +61,7 @@ public class ChooseColorAi extends SpellAbilityAi {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Addle".equals(sa.getHostCard().getName())) {
|
if ("Addle".equals(source.getName())) {
|
||||||
PhaseHandler ph = game.getPhaseHandler();
|
PhaseHandler ph = game.getPhaseHandler();
|
||||||
if (ph.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS) || ai.getOpponent().getCardsIn(ZoneType.Hand).isEmpty()) {
|
if (ph.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS) || ai.getOpponent().getCardsIn(ZoneType.Hand).isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user