mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
[Simulated AI] Remove SIMULATE_LAND_PLAYS constant since it's enabled by default now.
This commit is contained in:
@@ -1037,7 +1037,7 @@ public class AiController {
|
|||||||
// re-created if needed and used for any AI logic that needs it.
|
// re-created if needed and used for any AI logic that needs it.
|
||||||
predictedCombat = null;
|
predictedCombat = null;
|
||||||
|
|
||||||
if (useSimulation && (SpellAbilityPicker.SIMULATE_LAND_PLAYS || simPicker.hasActivePlan())) {
|
if (useSimulation) {
|
||||||
return singleSpellAbilityList(simPicker.chooseSpellAbilityToPlay(null));
|
return singleSpellAbilityList(simPicker.chooseSpellAbilityToPlay(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1057,10 +1057,6 @@ public class AiController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useSimulation && !SpellAbilityPicker.SIMULATE_LAND_PLAYS) {
|
|
||||||
return singleSpellAbilityList(simPicker.chooseSpellAbilityToPlay(null));
|
|
||||||
}
|
|
||||||
|
|
||||||
return singleSpellAbilityList(getSpellAbilityToPlay());
|
return singleSpellAbilityList(getSpellAbilityToPlay());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ import forge.game.spellability.SpellAbilityCondition;
|
|||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
|
|
||||||
public class SpellAbilityPicker {
|
public class SpellAbilityPicker {
|
||||||
public static boolean SIMULATE_LAND_PLAYS = true;
|
|
||||||
|
|
||||||
private Game game;
|
private Game game;
|
||||||
private Player player;
|
private Player player;
|
||||||
private Score bestScore;
|
private Score bestScore;
|
||||||
@@ -94,19 +92,17 @@ public class SpellAbilityPicker {
|
|||||||
|
|
||||||
CardCollection cards = ComputerUtilAbility.getAvailableCards(game, player);
|
CardCollection cards = ComputerUtilAbility.getAvailableCards(game, player);
|
||||||
List<SpellAbility> all = ComputerUtilAbility.getSpellAbilities(cards, player);
|
List<SpellAbility> all = ComputerUtilAbility.getSpellAbilities(cards, player);
|
||||||
if (SIMULATE_LAND_PLAYS) {
|
CardCollection landsToPlay = ComputerUtilAbility.getAvailableLandsToPlay(game, player);
|
||||||
CardCollection landsToPlay = ComputerUtilAbility.getAvailableLandsToPlay(game, player);
|
if (landsToPlay != null) {
|
||||||
if (landsToPlay != null) {
|
HashMap<String, Card> landsDeDupe = new HashMap<String, Card>();
|
||||||
HashMap<String, Card> landsDeDupe = new HashMap<String, Card>();
|
for (Card land : landsToPlay) {
|
||||||
for (Card land : landsToPlay) {
|
Card previousLand = landsDeDupe.get(land.getName());
|
||||||
Card previousLand = landsDeDupe.get(land.getName());
|
// Skip identical lands.
|
||||||
// Skip identical lands.
|
if (previousLand != null && previousLand.getZone() == land.getZone() && previousLand.getOwner() == land.getOwner()) {
|
||||||
if (previousLand != null && previousLand.getZone() == land.getZone() && previousLand.getOwner() == land.getOwner()) {
|
continue;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
landsDeDupe.put(land.getName(), land);
|
|
||||||
all.add(new PlayLandAbility(land));
|
|
||||||
}
|
}
|
||||||
|
landsDeDupe.put(land.getName(), land);
|
||||||
|
all.add(new PlayLandAbility(land));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user