Browse Source

Update to mob retaliate logic.

feature-workorder
MagicBot 1 year ago
parent
commit
11e63f38b1
  1. 17
      src/engine/gameManager/CombatManager.java

17
src/engine/gameManager/CombatManager.java

@ -1316,17 +1316,16 @@ public enum CombatManager { @@ -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);

Loading…
Cancel
Save