mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Improved mana source detection for Nykthos, Shrine to Nyx AI.
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user