From 9cd3cdf3a37a874dd75b98f49b32e204e726d5b1 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 27 Jun 2023 16:19:15 -0400 Subject: [PATCH] Mob AI uses two config entries. --- src/engine/ai/MobileFSMManager.java | 11 ++++++++--- src/engine/gameManager/ConfigManager.java | 4 +--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/engine/ai/MobileFSMManager.java b/src/engine/ai/MobileFSMManager.java index 7c94ba2f..f99308b3 100644 --- a/src/engine/ai/MobileFSMManager.java +++ b/src/engine/ai/MobileFSMManager.java @@ -49,10 +49,15 @@ public class MobileFSMManager { }; alive = true; + //assign the AI varibales base don difficulty scaling from config file: - float difficulty = Float.parseFloat(ConfigManager.MB_MOB_DIFFICULTY.getValue()); - AI_BASE_AGGRO_RANGE = (int)(100 * difficulty); // range at which aggressive mobs will attack you - AI_POWER_DIVISOR = (int)(20 * (1.5f-difficulty)); //duration between mob casts + + float difficulty = Float.parseFloat(ConfigManager.MB_AI_AGGRO_RANGE.getValue()); + AI_BASE_AGGRO_RANGE = (int) (100 * difficulty); // range at which aggressive mobs will attack you + + difficulty = Float.parseFloat(ConfigManager.MB_AI_CAST_FREQUENCY.getValue()); + AI_POWER_DIVISOR = (int) (20 * (1.5f - difficulty)); //duration between mob casts + Thread t = new Thread(worker, "MobileFSMManager"); t.start(); } diff --git a/src/engine/gameManager/ConfigManager.java b/src/engine/gameManager/ConfigManager.java index 4946e3af..9a7b880e 100644 --- a/src/engine/gameManager/ConfigManager.java +++ b/src/engine/gameManager/ConfigManager.java @@ -91,9 +91,7 @@ public enum ConfigManager { MB_MAGICBOT_FORTOFIX, MB_MAGICBOT_RECRUIT, MB_MAGICBOT_MAGICBOX, - MB_MAGICBOT_ADMINLOG, - - MB_MOB_DIFFICULTY;//0.1(easy) - 1.0(hard) + MB_MAGICBOT_ADMINLOG; // Map to hold our config pulled in from the environment // We also use the config to point to the current message pump