v2.0.0: fixed DM-201s rarely lobbing grenades through closed doors

This commit is contained in:
Evan Debenham
2023-01-17 14:12:16 -05:00
parent 870111c2a9
commit b2124e13e2
2 changed files with 3 additions and 3 deletions

View File

@@ -128,7 +128,7 @@ public class DM200 extends Mob {
}
private boolean canVent(int target){
protected boolean canVent(int target){
if (ventCooldown > 0) return false;
PathFinder.buildDistanceMap(target, BArray.not(Dungeon.level.solid, null), Dungeon.level.distance(pos, target)+1);
//vent can go around blocking terrain, but not through it

View File

@@ -59,8 +59,8 @@ public class DM201 extends DM200 {
Dungeon.level.updateFieldOfView( this, fieldOfView );
}
if (paralysed <= 0 && state == HUNTING && enemy != null && enemySeen
&& threatened && !Dungeon.level.adjacent(pos, enemy.pos) && fieldOfView[enemy.pos]){
if (paralysed <= 0 && state == HUNTING && enemy != null && enemySeen && threatened
&& canVent(enemy.pos) && !Dungeon.level.adjacent(pos, enemy.pos) && fieldOfView[enemy.pos]){
enemySeen = enemy.isAlive() && fieldOfView[enemy.pos] && enemy.invisible <= 0;
if (sprite != null && (sprite.visible || enemy.sprite.visible)) {
sprite.zap( enemy.pos );