From 820ac85626e249350e0a59f3286b28ae844308bc Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 3 Nov 2015 19:59:17 -0500 Subject: [PATCH] v0.3.2: tweaked prison guard behaviour, eliminated bugs, made chains a bit more random, disallowed guards pulling you into a chasm --- .../shatteredpixeldungeon/actors/mobs/Guard.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java index fc991cc8f..7f66fc12d 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java @@ -62,10 +62,13 @@ public class Guard extends Mob { @Override protected boolean act() { + Dungeon.level.updateFieldOfView( this ); + if (state == HUNTING && - Level.fieldOfView[target] && - Level.distance( pos, target ) < 4 && !Level.adjacent( pos, target ) && - chain(target)) { + Level.fieldOfView[enemy.pos] && + Level.distance( pos, enemy.pos ) < 5 && !Level.adjacent( pos, enemy.pos ) && + Random.Int(3) == 0 && + chain(enemy.pos)) { return false; @@ -80,7 +83,7 @@ public class Guard extends Mob { Ballistica chain = new Ballistica(pos, target, Ballistica.PROJECTILE); - if (chain.collisionPos != Dungeon.hero.pos) + if (chain.collisionPos != Dungeon.hero.pos || Level.pit[chain.path.get(1)]) return false; else { int newPos = -1; @@ -103,6 +106,7 @@ public class Guard extends Mob { Dungeon.observe(); Dungeon.level.press(newHeroPos, Dungeon.hero); Cripple.prolong(Dungeon.hero, Cripple.class, 4f); + Dungeon.hero.interrupt(); next(); } }));