Browse Source

guard powers

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

13
src/engine/mobileAI/MobAI.java

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

2
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_DROP_AGGRO_RANGE = 60;
public static int AI_PULSE_MOB_THRESHOLD = 200; public static int AI_PULSE_MOB_THRESHOLD = 200;
public static int AI_PATROL_DIVISOR = 15; public static int AI_PATROL_DIVISOR = 15;
public static int AI_POWER_DIVISOR = 10; public static int AI_POWER_DIVISOR = 20;
// Thread constructor // Thread constructor
public MobAIThread() { public MobAIThread() {

Loading…
Cancel
Save