diff --git a/src/main/java/forge/game/ai/ComputerUtilMana.java b/src/main/java/forge/game/ai/ComputerUtilMana.java index a666f4042d3..e9ca9e8c092 100644 --- a/src/main/java/forge/game/ai/ComputerUtilMana.java +++ b/src/main/java/forge/game/ai/ComputerUtilMana.java @@ -105,6 +105,8 @@ public class ComputerUtilMana { Map> sourcesForShards = ComputerUtilMana.groupAndOrderToPayShards(ai, manaAbilityMap, cost); // Loop over mana needed + List cardsUsed = test ? new ArrayList() : null; + ManaCostShard toPay = null; while (!cost.isPaid()) { toPay = getNextShardToPay(cost, sourcesForShards); @@ -113,6 +115,8 @@ public class ComputerUtilMana { List payableSources = new ArrayList(); if( saList != null ) { for (final SpellAbility ma : saList) { + if( test && cardsUsed.contains(ma.getSourceCard()) ) + continue; if( canPayShardWithSpellAbility(toPay, ai, ma, sa, checkPlayable || !test ) ) { payableSources.add(ma); } @@ -144,6 +148,7 @@ public class ComputerUtilMana { for(Collection kv : sourcesForShards.values()) { kv.remove(saPayment); } + cardsUsed.add(saPayment.getSourceCard()); } else { if (saPayment.getPayCosts() != null) { final CostPayment pay = new CostPayment(saPayment.getPayCosts(), saPayment);