From 76bcbc632e0bd2ee9a29e8d21b5a97235d0bdcda Mon Sep 17 00:00:00 2001 From: Seravy Date: Mon, 12 Feb 2018 00:03:09 +0100 Subject: [PATCH] Rearranged to fix rounding problem --- forge-ai/src/main/java/forge/ai/AiAttackController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forge-ai/src/main/java/forge/ai/AiAttackController.java b/forge-ai/src/main/java/forge/ai/AiAttackController.java index 92e7689b4d2..e3fe107291f 100644 --- a/forge-ai/src/main/java/forge/ai/AiAttackController.java +++ b/forge-ai/src/main/java/forge/ai/AiAttackController.java @@ -1090,7 +1090,7 @@ public class AiAttackController { // so a priority of 4 means the creature will not attack unless it can defeat that player in 4 successful attacks. // the lower the priroity, the less willing the AI is to use the creature for attacking. // TODO Somehow subtract expected damage of other attacking creatures from enemy life total (how? other attackers not yet declared? Can the AI guesstimate which of their creatures will not get blocked?) - if (attacker.getCurrentPower() < ai.getOpponentsSmallestLifeTotal() / Integer.parseInt(attacker.getSVar("NonCombatPriority"))) { + if (attacker.getCurrentPower() * Integer.parseInt(attacker.getSVar("NonCombatPriority")) < ai.getOpponentsSmallestLifeTotal()) { // Check if the card actually has an ability the AI can and wants to play, if not, attacking is fine! boolean wantability = false; for (SpellAbility sa : attacker.getSpellAbilities()) {