mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Added test that ensures all lands can be played
This commit is contained in:
@@ -8,6 +8,7 @@ import forge.game.phase.PhaseType;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.spellability.AbilityManaPart;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.staticability.StaticAbility;
|
||||
import forge.game.zone.ZoneType;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -173,9 +174,9 @@ public class GameStateEvaluator {
|
||||
colors_produced.addAll(Arrays.asList(mp.mana(m).split(" ")));
|
||||
}
|
||||
}
|
||||
value = 100 * max_produced;
|
||||
value += 100 * max_produced;
|
||||
int size = max(colors_produced.size(), colors_produced.contains("Any") ? 5 : 0);
|
||||
value += size * 2;
|
||||
value += size * 6;
|
||||
|
||||
// add a value for each activated ability that the land has that's not an activated ability.
|
||||
for (SpellAbility m: c.getNonManaAbilities()) {
|
||||
@@ -184,6 +185,12 @@ public class GameStateEvaluator {
|
||||
value += 6;
|
||||
}
|
||||
|
||||
// Add a value for each static ability that the land has
|
||||
for (StaticAbility s : c.getStaticAbilities()) {
|
||||
// More than the value of having a card in hand. See comment above
|
||||
value += 6;
|
||||
}
|
||||
|
||||
|
||||
return value;
|
||||
} else if (c.isEnchantingCard()) {
|
||||
|
||||
@@ -64,7 +64,7 @@ public class SpellAbilityPicker {
|
||||
print("---- choose ability (phase = " + phaseStr + ")");
|
||||
}
|
||||
|
||||
private List<SpellAbility> getCandidateSpellsAndAbilities() {
|
||||
public List<SpellAbility> getCandidateSpellsAndAbilities() {
|
||||
CardCollection cards = ComputerUtilAbility.getAvailableCards(game, player);
|
||||
cards = ComputerUtilCard.dedupeCards(cards);
|
||||
List<SpellAbility> all = ComputerUtilAbility.getSpellAbilities(cards, player);
|
||||
@@ -351,7 +351,7 @@ public class SpellAbilityPicker {
|
||||
return AiPlayDecision.WillPlay;
|
||||
}
|
||||
|
||||
private Score evaluateSa(final SimulationController controller, PhaseType phase, List<SpellAbility> saList, int saIndex) {
|
||||
public Score evaluateSa(final SimulationController controller, PhaseType phase, List<SpellAbility> saList, int saIndex) {
|
||||
controller.evaluateSpellAbility(saList, saIndex);
|
||||
SpellAbility sa = saList.get(saIndex);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user