From 1ff42b775c5457df3b5e8ddb8f32fe50275e4358 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 21 Apr 2023 10:02:09 -0500 Subject: [PATCH] added hamlet guard logic --- src/engine/Enum.java | 2 +- src/engine/ai/MobileFSM.java | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/engine/Enum.java b/src/engine/Enum.java index 9206213e..e0b77b17 100644 --- a/src/engine/Enum.java +++ b/src/engine/Enum.java @@ -2826,7 +2826,7 @@ public class Enum { GuardMinion(GuardCaptain, false, true, true, false, true), GuardWallArcher(null, false, true, false, false, false), Wanderer(null, false, false, false, false, false), - HamletGuard(null, false, false, false, false, false), + HamletGuard(null, false, true, false, false, false), AggroWanderer(null, false, false, false, false, false); private static HashMap _behaviourTypes = new HashMap<>(); diff --git a/src/engine/ai/MobileFSM.java b/src/engine/ai/MobileFSM.java index de96c5e9..7d56fa66 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -368,6 +368,9 @@ public class MobileFSM { case Pet1: PetLogic(mob); break; + case HamletGuard: + HamletGuardLogic(mob); + break; default: DefaultLogic(mob); break; @@ -606,10 +609,19 @@ public class MobileFSM { CheckForAttack(mob); } } + private static void HamletGuardLogic(Mob mob){ + if (mob.getCombatTarget() == null) { + //safehold guard + SafeGuardAggro(mob); + if(mob.getCombatTarget() != null){ + CheckForAttack(mob); + } + } + } private static void DefaultLogic(Mob mob){ //check for players that can be aggroed if mob is agressive and has no target if (mob.BehaviourType.isAgressive && mob.getCombatTarget() == null) { - if (mob.BehaviourType == Enum.MobBehaviourType.SimpleStandingGuard) { + if (mob.BehaviourType == Enum.MobBehaviourType.HamletGuard) { //safehold guard SafeGuardAggro(mob); } else {