From 56d6efc4e421db2e437fbf41946bfacda7bbc577 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 24 May 2023 20:27:58 -0500 Subject: [PATCH] mob chance to cast set at 50% --- src/engine/ai/MobileFSM.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/engine/ai/MobileFSM.java b/src/engine/ai/MobileFSM.java index c2736e99..f8dd2625 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -29,7 +29,6 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ThreadLocalRandom; import static engine.math.FastMath.sqr; public class MobileFSM { - public static int AI_POWER_CHANCE = 30; // set 1 -100 to determine mobs chance to cast a spell private static void AttackTarget(Mob mob, AbstractWorldObject target) { if (mob == null) return; @@ -223,11 +222,11 @@ public class MobileFSM { // mobile in the proper state to cast. if (mob == null) return false; - if(ThreadLocalRandom.current().nextInt(100) > AI_POWER_CHANCE){ - return false; - } + if (mob.mobPowers.isEmpty()) return false; + if(ThreadLocalRandom.current().nextInt(100) > 50) + return false; if (mob.nextCastTime == 0) mob.nextCastTime = System.currentTimeMillis(); return mob.nextCastTime <= System.currentTimeMillis();