diff --git a/forge-ai/src/main/java/forge/ai/ComputerUtilCard.java b/forge-ai/src/main/java/forge/ai/ComputerUtilCard.java index 253c8ace216..af09e275ed6 100644 --- a/forge-ai/src/main/java/forge/ai/ComputerUtilCard.java +++ b/forge-ai/src/main/java/forge/ai/ComputerUtilCard.java @@ -1312,21 +1312,22 @@ public class ComputerUtilCard { //2. grant haste if (keywords.contains("Haste") && c.hasSickness() && !c.isTapped()) { - double baseChance = 0.0f; + double nonCombatChance = 0.0f; + double combatChance = 0.0f; // non-combat Haste: has an activated ability with tap cost for (SpellAbility ab : c.getSpellAbilities()) { Cost abCost = ab.getPayCosts(); if (abCost != null && abCost.hasTapCost() && (!abCost.hasManaCost() || ComputerUtilMana.canPayManaCost(ab, ai, 0))) { - baseChance += 0.5f; + nonCombatChance += 0.5f; + break; } } // combat Haste: only grant it if the creature will attack if (ComputerUtilCard.doesSpecifiedCreatureAttackAI(ai, pumped)) { - if (baseChance < 0.5f) { baseChance = 0.5f; } - chance += 0.5f * ComputerUtilCombat.damageIfUnblocked(pumped, opp, combat, true) / opp.getLife(); + combatChance += 0.5f + (0.5f * ComputerUtilCombat.damageIfUnblocked(pumped, opp, combat, true) / opp.getLife()); } - chance += baseChance; + chance += nonCombatChance + combatChance; } //3. grant evasive