Browse Source

1 second delay for mobs chasing target

combat-2
FatBoy-DOTC 1 year ago
parent
commit
d506807a8f
  1. 5
      src/engine/mobileAI/MobAI.java

5
src/engine/mobileAI/MobAI.java

@ -896,6 +896,11 @@ public class MobAI {
try { try {
if(mob.getTimestamps().containsKey("lastChase") == false)
mob.getTimestamps().put("lastChase",System.currentTimeMillis());
else if(System.currentTimeMillis() < mob.getTimestamps().get("lastChase").longValue() + 1000)
return;
if (CombatUtilities.inRange2D(mob, mob.getCombatTarget(), mob.getRange()) == false) { if (CombatUtilities.inRange2D(mob, mob.getCombatTarget(), mob.getRange()) == false) {
if (mob.getRange() > 15) { if (mob.getRange() > 15) {
mob.destination = mob.getCombatTarget().getLoc(); mob.destination = mob.getCombatTarget().getLoc();

Loading…
Cancel
Save