v0.8.1: passive enemies are no longer auto-surprise attacked

This commit is contained in:
Evan Debenham 2020-06-17 15:23:28 -04:00
parent a0ff6dcb75
commit c4ffb9b82a
2 changed files with 3 additions and 7 deletions

View File

@ -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 ) {

View File

@ -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)) {