mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Don't ignore counterspells in simulated AI.
This commit is contained in:
@@ -8,7 +8,6 @@ import forge.ai.ComputerUtilAbility;
|
|||||||
import forge.ai.ComputerUtilCost;
|
import forge.ai.ComputerUtilCost;
|
||||||
import forge.ai.simulation.GameStateEvaluator.Score;
|
import forge.ai.simulation.GameStateEvaluator.Score;
|
||||||
import forge.game.Game;
|
import forge.game.Game;
|
||||||
import forge.game.ability.ApiType;
|
|
||||||
import forge.game.phase.PhaseType;
|
import forge.game.phase.PhaseType;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.spellability.SpellAbility;
|
import forge.game.spellability.SpellAbility;
|
||||||
@@ -38,15 +37,15 @@ public class SpellAbilityPicker {
|
|||||||
controller = new SimulationController();
|
controller = new SimulationController();
|
||||||
printOutput = true;
|
printOutput = true;
|
||||||
}
|
}
|
||||||
print("---- choose ability (phase = " + game.getPhaseHandler().getPhase() + ")");
|
String phaseStr = game.getPhaseHandler().getPhase().toString();
|
||||||
long startTime = System.currentTimeMillis();
|
if (game.getPhaseHandler().getPlayerTurn() != player) {
|
||||||
|
phaseStr = "opponent " + phaseStr;
|
||||||
|
}
|
||||||
|
print("---- choose ability (phase = " + phaseStr + ")");
|
||||||
|
|
||||||
|
long startTime = System.currentTimeMillis();
|
||||||
List<SpellAbility> candidateSAs = new ArrayList<>();
|
List<SpellAbility> candidateSAs = new ArrayList<>();
|
||||||
for (final SpellAbility sa : ComputerUtilAbility.getOriginalAndAltCostAbilities(all, player)) {
|
for (final SpellAbility sa : ComputerUtilAbility.getOriginalAndAltCostAbilities(all, player)) {
|
||||||
// Don't add Counterspells to the "normal" playcard lookups
|
|
||||||
if (skipCounter && sa.getApi() == ApiType.Counter) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (sa.isManaAbility()) {
|
if (sa.isManaAbility()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -61,6 +60,7 @@ public class SpellAbilityPicker {
|
|||||||
continue;
|
continue;
|
||||||
candidateSAs.add(sa);
|
candidateSAs.add(sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (candidateSAs.isEmpty()) {
|
if (candidateSAs.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user