v0.3.3a: tweaked fleeing to behave a bit more consistently with an invisible enemy

This commit is contained in:
Evan Debenham 2015-12-25 02:29:11 -05:00
parent 62086adc4a
commit 73d9302be5

View File

@ -641,11 +641,11 @@ public abstract class Mob extends Char {
@Override
public boolean act( boolean enemyInFOV, boolean justAlerted ) {
enemySeen = enemyInFOV;
if (enemyInFOV) {
target = enemy.pos;
//loses target when 0-dist rolls a 6 or greater.
} else if (1 + Random.Int(Level.distance(pos, target)) >= 6){
if (!enemyInFOV && 1 + Random.Int(Level.distance(pos, target)) >= 6){
target = -1;
} else {
target = enemy.pos;
}
int oldPos = pos;