From 11e63f38b1a3edaa7e03b0aa46c706270c5dcbd1 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 5 Sep 2023 12:19:50 -0400 Subject: [PATCH] Update to mob retaliate logic. --- src/engine/gameManager/CombatManager.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/engine/gameManager/CombatManager.java b/src/engine/gameManager/CombatManager.java index b63d21f6..ecb05f66 100644 --- a/src/engine/gameManager/CombatManager.java +++ b/src/engine/gameManager/CombatManager.java @@ -1316,17 +1316,16 @@ public enum CombatManager { Mob attackedMobile = (Mob) target; - if (attackedMobile.getCombatTarget() != null && !attackedMobile.isSiege()) - return; + //handle minion informing his captain of an attack - //handle minion informing his captain of the attack - if (attacker.getObjectType().equals(GameObjectType.Mob)) { - Mob mob = (Mob) attacker; - if (mob.agentType.equals(AIAgentType.GUARDMINION) && mob.guardCaptain != null && mob.guardCaptain.isAlive()) - if (mob.guardCaptain.combatTarget == null) - mob.guardCaptain.setCombatTarget(attacker); + if (attackedMobile.agentType.equals(AIAgentType.GUARDMINION) && attackedMobile.guardCaptain != null && attackedMobile.guardCaptain.isAlive()) + if (attackedMobile.guardCaptain.combatTarget == null) + attackedMobile.guardCaptain.setCombatTarget(attacker); - } + // Mobile already has a target; don't switch. + + if (attackedMobile.getCombatTarget() != null && !attackedMobile.isSiege()) + return; attackedMobile.setCombatTarget(attacker);