From dde98c7c58e45427d19d8263a02a22a73728e0b3 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 6 Aug 2023 17:07:25 -0500 Subject: [PATCH] guard casting work --- src/engine/mobileAI/MobAI.java | 10 ++++++++-- src/engine/mobileAI/Threads/MobAIThread.java | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 66823709..582c6aee 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -483,8 +483,14 @@ public class MobAI { if (powerTokens.isEmpty()) return false; - - int powerToken = powerTokens.get(ThreadLocalRandom.current().nextInt(powerTokens.size())); + int powerToken = 0; + if(ThreadLocalRandom.current().nextInt(1,100) < 65){ + //use direct damage spell + powerToken = mob.mobPowers.get(3); + } else{ + //use other random spell + powerToken = powerTokens.get(ThreadLocalRandom.current().nextInt(powerTokens.size() - 1)); + } int powerRank = mob.mobPowers.get(powerToken); PowersBase mobPower = PowersManager.getPowerByToken(powerToken); diff --git a/src/engine/mobileAI/Threads/MobAIThread.java b/src/engine/mobileAI/Threads/MobAIThread.java index 3e92a1f9..590a133b 100644 --- a/src/engine/mobileAI/Threads/MobAIThread.java +++ b/src/engine/mobileAI/Threads/MobAIThread.java @@ -11,7 +11,7 @@ public class MobAIThread implements Runnable{ public static int AI_DROP_AGGRO_RANGE = 60; public static int AI_PULSE_MOB_THRESHOLD = 200; public static int AI_PATROL_DIVISOR = 15; - public static int AI_POWER_DIVISOR = 20; + public static int AI_POWER_DIVISOR = 10; // Thread constructor public MobAIThread() {