- RemAIDeck update: next iteration.

This commit is contained in:
Agetian
2017-10-06 05:54:29 +00:00
parent 0733f7a69a
commit 3613cb704e
13 changed files with 34 additions and 18 deletions

View File

@@ -513,6 +513,21 @@ public class ComputerUtilMana {
// extraMana, sa.getHostCard(), sa.toUnsuppressedString(), StringUtils.join(paymentPlan, "\n\t"));
// }
// See if it's possible to pay with something that was left in the mana pool in corner cases,
// e.g. Gemstone Caverns with a Luck counter on it generating colored mana (which fails to be
// processed correctly on a per-ability basis, leaving floating mana in the pool)
if (!cost.isPaid() && !manapool.isEmpty()) {
for (ManaCostShard shard : cost.getDistinctShards()) {
for (byte color : MagicColor.WUBRGC) {
manapool.tryPayCostWithColor(color, sa, cost);
}
if (cost.isPaid()) {
break;
}
}
}
// The cost is still unpaid, so refund the mana and report
if (!cost.isPaid()) {
refundMana(manaSpentToPay, ai, sa);
if (test) {