- Check for alternative additional costs in the AI routines (fixes AI not paying those costs for Final Payment and other cards).

This commit is contained in:
Agetian
2019-01-31 08:45:53 +03:00
parent 2e0812dd6a
commit 3956a5b558

View File

@@ -95,7 +95,14 @@ public class ComputerUtilAbility {
public static List<SpellAbility> getOriginalAndAltCostAbilities(final List<SpellAbility> originList, final Player player) { public static List<SpellAbility> getOriginalAndAltCostAbilities(final List<SpellAbility> originList, final Player player) {
final List<SpellAbility> newAbilities = Lists.newArrayList(); final List<SpellAbility> newAbilities = Lists.newArrayList();
List<SpellAbility> originListWithAddCosts = Lists.newArrayList();
for (SpellAbility sa : originList) { for (SpellAbility sa : originList) {
// If this spell has alternative additional costs, add them instead of the unmodified SA itself
originListWithAddCosts.addAll(GameActionUtil.getAdditionalCostSpell(sa));
}
for (SpellAbility sa : originListWithAddCosts) {
sa.setActivatingPlayer(player); sa.setActivatingPlayer(player);
// determine which alternative costs are cheaper than the original and prioritize them // determine which alternative costs are cheaper than the original and prioritize them