Browse Source

mobs use hate value to hot swap targets

master
FatBoy-DOTC 2 years ago
parent
commit
508fac6168
  1. 4
      src/engine/ai/MobileFSM.java

4
src/engine/ai/MobileFSM.java

@ -719,8 +719,8 @@ public class MobileFSM { @@ -719,8 +719,8 @@ public class MobileFSM {
for (Entry playerEntry : mob.playerAgroMap.entrySet()) {
PlayerCharacter potentialTarget = PlayerCharacter.getFromCache((int)playerEntry.getKey());
if(potentialTarget != null && potentialTarget.getHateValue() > CurrentHateValue){
CurrentHateValue = ((AbstractCharacter)playerEntry.getKey()).getHateValue();
mostHatedTarget = PlayerCharacter.getFromCache((int)playerEntry.getKey());
CurrentHateValue = potentialTarget.getHateValue();
mostHatedTarget = potentialTarget;
}
}
return mostHatedTarget;

Loading…
Cancel
Save