- Improved mana source detection for Nykthos, Shrine to Nyx AI.

This commit is contained in:
Agetian
2017-01-04 14:35:18 +00:00
parent ba71d9ec8c
commit 70ada910be

View File

@@ -57,9 +57,7 @@ public class ChooseColorAi extends SpellAbilityAi {
final CardCollectionView cards = ai.getCardsIn(new ZoneType[] {ZoneType.Hand, ZoneType.Battlefield, ZoneType.Command}); final CardCollectionView cards = ai.getCardsIn(new ZoneType[] {ZoneType.Hand, ZoneType.Battlefield, ZoneType.Command});
List<SpellAbility> all = ComputerUtilAbility.getSpellAbilities(cards, ai); List<SpellAbility> all = ComputerUtilAbility.getSpellAbilities(cards, ai);
// TODO: this is inexact for the purpose, assuming that each land can serve as at least some form of mana source. int numLands = CardLists.filter(ComputerUtilMana.getAvailableMana(ai, true), CardPredicates.Presets.UNTAPPED).size();
// Improve somehow to only account for mana-producing lands and also possibly for other (non-land) mana sources.
int numLands = CardLists.filter(ai.getCardsIn(ZoneType.Battlefield), Predicates.and(CardPredicates.Presets.LANDS, CardPredicates.Presets.UNTAPPED)).size();
for (final SpellAbility testSa : ComputerUtilAbility.getOriginalAndAltCostAbilities(all, ai)) { for (final SpellAbility testSa : ComputerUtilAbility.getOriginalAndAltCostAbilities(all, ai)) {
ManaCost cost = testSa.getPayCosts().getTotalMana(); ManaCost cost = testSa.getPayCosts().getTotalMana();