Browse Source

mobs respect invisibility again

master
FatBoy-DOTC 1 year ago
parent
commit
01b8b67ffd
  1. 6
      src/engine/ai/MobileFSM.java

6
src/engine/ai/MobileFSM.java

@ -59,7 +59,7 @@ public class MobileFSM {
} }
} }
public static void AttackPlayer(Mob mob, PlayerCharacter target) { public static void AttackPlayer(Mob mob, PlayerCharacter target) {
if (mob.getMobBase().getSeeInvis() < target.getHidden() || !target.isAlive()) { if(!mob.canSee(target)){
mob.setCombatTarget(null); mob.setCombatTarget(null);
return; return;
} }
@ -221,6 +221,10 @@ public class MobileFSM {
return false; return false;
if (mob.mobPowers.isEmpty()) if (mob.mobPowers.isEmpty())
return false; return false;
if(!mob.canSee((PlayerCharacter) mob.getCombatTarget())){
mob.setCombatTarget(null);
return false;
}
if (mob.nextCastTime == 0) if (mob.nextCastTime == 0)
mob.nextCastTime = System.currentTimeMillis(); mob.nextCastTime = System.currentTimeMillis();
return mob.nextCastTime <= System.currentTimeMillis(); return mob.nextCastTime <= System.currentTimeMillis();

Loading…
Cancel
Save