Browse Source

Attacking guard flags you as an outlaw.

combat-2
MagicBot 1 year ago
parent
commit
a8e8804ce3
  1. 10
      src/engine/gameManager/CombatManager.java

10
src/engine/gameManager/CombatManager.java

@ -1318,10 +1318,18 @@ public enum CombatManager {
//handle minion informing his captain of an attack //handle minion informing his captain of an attack
if (attackedMobile.agentType.equals(AIAgentType.GUARDMINION) && attackedMobile.guardCaptain != null && attackedMobile.guardCaptain.isAlive()) if (attackedMobile.agentType.equals(AIAgentType.GUARDMINION) && attackedMobile.guardCaptain != null && attackedMobile.guardCaptain.isAlive()) {
if (attackedMobile.guardCaptain.combatTarget == null) if (attackedMobile.guardCaptain.combatTarget == null)
attackedMobile.guardCaptain.setCombatTarget(attacker); attackedMobile.guardCaptain.setCombatTarget(attacker);
// Add to city outlaw list
if (attacker.getObjectType().equals(GameObjectType.PlayerCharacter))
attackedMobile.guardedCity.cityOutlaws.add(attacker.getObjectUUID());
}
// Mobile already has a target; don't switch. // Mobile already has a target; don't switch.
if (attackedMobile.getCombatTarget() != null && !attackedMobile.isSiege()) if (attackedMobile.getCombatTarget() != null && !attackedMobile.isSiege())

Loading…
Cancel
Save