v0.8.2c: tweaked terror logic, should now better enforce fleeing

This commit is contained in:
Evan Debenham 2020-08-25 13:57:52 -04:00
parent e1f202b635
commit f8aebee09b

View File

@ -181,6 +181,10 @@ public abstract class Mob extends Char {
return true; return true;
} }
if (buff(Terror.class) != null){
state = FLEEING;
}
enemy = chooseEnemy(); enemy = chooseEnemy();
boolean enemyInFOV = enemy != null && enemy.isAlive() && fieldOfView[enemy.pos] && enemy.invisible <= 0; boolean enemyInFOV = enemy != null && enemy.isAlive() && fieldOfView[enemy.pos] && enemy.invisible <= 0;
@ -332,8 +336,12 @@ public abstract class Mob extends Char {
public void remove( Buff buff ) { public void remove( Buff buff ) {
super.remove( buff ); super.remove( buff );
if (buff instanceof Terror) { if (buff instanceof Terror) {
sprite.showStatus( CharSprite.NEGATIVE, Messages.get(this, "rage") ); if (enemySeen) {
state = HUNTING; sprite.showStatus(CharSprite.NEGATIVE, Messages.get(this, "rage"));
state = HUNTING;
} else {
state = WANDERING;
}
} }
} }
@ -729,7 +737,7 @@ public abstract class Mob extends Char {
notice(); notice();
if (state != HUNTING) { if (state != HUNTING && state != FLEEING) {
state = WANDERING; state = WANDERING;
} }
target = cell; target = cell;