mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- 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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user