v0.2.3d: piranha now move right away when a door is closed on them.
This commit is contained in:
parent
7b699cca6d
commit
1407ccf3bf
|
@ -57,6 +57,21 @@ public class Piranha extends Mob {
|
|||
die( null );
|
||||
return true;
|
||||
} else {
|
||||
//this causes pirahna to move away when a door is closed on them.
|
||||
Dungeon.level.updateFieldOfView( this );
|
||||
if (state == this.HUNTING && !(enemy.isAlive() && Level.fieldOfView[enemy.pos] && enemy.invisible <= 0)){
|
||||
state = this.WANDERING;
|
||||
int oldPos = pos;
|
||||
int i = 0;
|
||||
do {
|
||||
i++;
|
||||
target = Dungeon.level.randomDestination();
|
||||
if (i == 100) return true;
|
||||
} while (!getCloser(target));
|
||||
moveSprite( oldPos, pos );
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.act();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user