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 {
for (Entry playerEntry : mob.playerAgroMap.entrySet()) { for (Entry playerEntry : mob.playerAgroMap.entrySet()) {
PlayerCharacter potentialTarget = PlayerCharacter.getFromCache((int)playerEntry.getKey()); PlayerCharacter potentialTarget = PlayerCharacter.getFromCache((int)playerEntry.getKey());
if(potentialTarget != null && potentialTarget.getHateValue() > CurrentHateValue){ if(potentialTarget != null && potentialTarget.getHateValue() > CurrentHateValue){
CurrentHateValue = ((AbstractCharacter)playerEntry.getKey()).getHateValue(); CurrentHateValue = potentialTarget.getHateValue();
mostHatedTarget = PlayerCharacter.getFromCache((int)playerEntry.getKey()); mostHatedTarget = potentialTarget;
} }
} }
return mostHatedTarget; return mostHatedTarget;

Loading…
Cancel
Save