Browse Source

mob chance to cast set at 50%

master
FatBoy-DOTC 1 year ago
parent
commit
56d6efc4e4
  1. 7
      src/engine/ai/MobileFSM.java

7
src/engine/ai/MobileFSM.java

@ -29,7 +29,6 @@ import java.util.concurrent.ConcurrentHashMap; @@ -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 { @@ -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();

Loading…
Cancel
Save