Browse Source

guard powers

master
FatBoy-DOTC 1 year ago
parent
commit
a5af696806
  1. 9
      src/engine/mobileAI/MobAI.java
  2. 2
      src/engine/mobileAI/Threads/MobAIThread.java

9
src/engine/mobileAI/MobAI.java

@ -476,9 +476,9 @@ public class MobAI { @@ -476,9 +476,9 @@ public class MobAI {
return false;
int powerToken = 0;
int nukeRoll = ThreadLocalRandom.current().nextInt(1,100);
if( nukeRoll < 65){
if( nukeRoll < 55){
//use direct damage spell
powerToken = powerTokens.get(3);
powerToken = powerTokens.get(0);
} else{
//use random spell
powerToken = powerTokens.get(ThreadLocalRandom.current().nextInt(powerTokens.size()));
@ -502,9 +502,14 @@ public class MobAI { @@ -502,9 +502,14 @@ public class MobAI {
PerformActionMsg msg;
if (!mobPower.isHarmful() || mobPower.targetSelf) {
if(mobPower.category.equals("DISPEL")){
PowersManager.useMobPower(mob, target, mobPower, powerRank);
msg = PowersManager.createPowerMsg(mobPower, powerRank, mob, target);
}else {
PowersManager.useMobPower(mob, mob, mobPower, powerRank);
msg = PowersManager.createPowerMsg(mobPower, powerRank, mob, mob);
}
}
else {
PowersManager.useMobPower(mob, target, mobPower, powerRank);
msg = PowersManager.createPowerMsg(mobPower, powerRank, mob, target);

2
src/engine/mobileAI/Threads/MobAIThread.java

@ -11,7 +11,7 @@ public class MobAIThread implements Runnable{ @@ -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 = 10;
public static int AI_POWER_DIVISOR = 20;
// Thread constructor
public MobAIThread() {

Loading…
Cancel
Save