diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index 39663c35b..c0abf6bcd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -543,8 +543,7 @@ public abstract class Mob extends Char { hitWithRanged = true; } - if ((!enemySeen || enemy.invisible > 0) - && enemy == Dungeon.hero && Dungeon.hero.canSurpriseAttack()) { + if (surprisedBy(enemy) && Dungeon.hero.canSurpriseAttack()) { Statistics.sneakAttacks++; Badges.validateRogueUnlock(); Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG); @@ -579,7 +578,7 @@ public abstract class Mob extends Char { } public boolean surprisedBy( Char enemy ){ - return (!enemySeen || enemy.invisible > 0) && enemy == Dungeon.hero; + return enemy == Dungeon.hero && (enemy.invisible > 0 || (!enemySeen && state != PASSIVE)); } public void aggro( Char ch ) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java index 3896899f8..950b1b9ac 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java @@ -112,10 +112,7 @@ public class YogDzewa extends Mob { @Override protected boolean act() { - //catches an error-case from 0.8.0 & 0.8.0a - if (!isAlive()){ - die(null); - } + enemySeen = true; if (phase == 0){ if (Dungeon.hero.viewDistance >= Dungeon.level.distance(pos, Dungeon.hero.pos)) {