Browse Source

Mob AI uses two config entries.

master
MagicBot 1 year ago
parent
commit
9cd3cdf3a3
  1. 11
      src/engine/ai/MobileFSMManager.java
  2. 4
      src/engine/gameManager/ConfigManager.java

11
src/engine/ai/MobileFSMManager.java

@ -49,10 +49,15 @@ public class MobileFSMManager {
}; };
alive = true; alive = true;
//assign the AI varibales base don difficulty scaling from config file: //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 float difficulty = Float.parseFloat(ConfigManager.MB_AI_AGGRO_RANGE.getValue());
AI_POWER_DIVISOR = (int)(20 * (1.5f-difficulty)); //duration between mob casts 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"); Thread t = new Thread(worker, "MobileFSMManager");
t.start(); t.start();
} }

4
src/engine/gameManager/ConfigManager.java

@ -91,9 +91,7 @@ public enum ConfigManager {
MB_MAGICBOT_FORTOFIX, MB_MAGICBOT_FORTOFIX,
MB_MAGICBOT_RECRUIT, MB_MAGICBOT_RECRUIT,
MB_MAGICBOT_MAGICBOX, MB_MAGICBOT_MAGICBOX,
MB_MAGICBOT_ADMINLOG, MB_MAGICBOT_ADMINLOG;
MB_MOB_DIFFICULTY;//0.1(easy) - 1.0(hard)
// Map to hold our config pulled in from the environment // Map to hold our config pulled in from the environment
// We also use the config to point to the current message pump // We also use the config to point to the current message pump

Loading…
Cancel
Save