From ab8038c3bbcd6c362c88764123e520cc55691f76 Mon Sep 17 00:00:00 2001 From: Agetian Date: Sat, 10 Jun 2017 16:39:09 +0000 Subject: [PATCH] - A more reliable check in the Cavern of Souls AI that works with ability-changing effects like Blood Moon. --- forge-ai/src/main/java/forge/ai/ComputerUtilMana.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java b/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java index 145b95c44f0..b229d96e036 100644 --- a/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java +++ b/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java @@ -222,10 +222,13 @@ public class ComputerUtilMana { // Exception: when paying generic mana with Cavern of Souls, prefer the colored mana producing ability // to attempt to make the spell uncounterable when possible. if ((toPay == ManaCostShard.GENERIC || toPay == ManaCostShard.X) - && ma.getHostCard().getName().equals("Cavern of Souls") - && !ma.getManaPart().isAnyMana() + && ComputerUtilAbility.getAbilitySourceName(ma).equals("Cavern of Souls") && sa.getHostCard().getType().getCreatureTypes().contains(ma.getHostCard().getChosenType())) { - continue; + for (SpellAbility ab : saList) { + if (ab.isManaAbility() && ab.getManaPart().isAnyMana() && ab.hasParam("AddsNoCounter")) { + return ab; + } + } } final String typeRes = cost.getSourceRestriction();