v2.3.0: fixed gnoll sappers something moving too far from starting poa

This commit is contained in:
Evan Debenham
2023-11-15 18:12:06 -05:00
parent d2920face3
commit ab8ca6b6fa
2 changed files with 11 additions and 1 deletions

View File

@@ -182,10 +182,20 @@ public class GnollSapper extends Mob {
@Override
public boolean act(boolean enemyInFOV, boolean justAlerted) {
if (!enemyInFOV) {
if (Dungeon.level.distance(spawnPos, target) > 3){
//don't chase something more than a few tiles out of spawning position
target = pos;
}
return super.act(enemyInFOV, justAlerted);
} else {
enemySeen = true;
if (Actor.findById(guardID) instanceof GnollGuard
&& Dungeon.level.distance(pos, enemy.pos) <= 3){
((GnollGuard) Actor.findById(guardID)).beckon(enemy.pos);
((GnollGuard) Actor.findById(guardID)).aggro(enemy);
}
if (abilityCooldown-- <= 0){
boolean targetNextToBarricade = false;
for (int i : PathFinder.NEIGHBOURS8){

View File

@@ -1153,7 +1153,7 @@ public abstract class Mob extends Char {
if (!enemyInFOV) {
sprite.showLost();
state = WANDERING;
target = Dungeon.level.randomDestination( Mob.this );
target = ((Mob.Wandering)WANDERING).randomDestination();
}
return true;
}