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; hitWithRanged = true;
} }
if ((!enemySeen || enemy.invisible > 0) if (surprisedBy(enemy) && Dungeon.hero.canSurpriseAttack()) {
&& enemy == Dungeon.hero && Dungeon.hero.canSurpriseAttack()) {
Statistics.sneakAttacks++; Statistics.sneakAttacks++;
Badges.validateRogueUnlock(); Badges.validateRogueUnlock();
Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG); Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG);
@ -579,7 +578,7 @@ public abstract class Mob extends Char {
} }
public boolean surprisedBy( Char enemy ){ 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 ) { public void aggro( Char ch ) {

View File

@ -112,10 +112,7 @@ public class YogDzewa extends Mob {
@Override @Override
protected boolean act() { protected boolean act() {
//catches an error-case from 0.8.0 & 0.8.0a enemySeen = true;
if (!isAlive()){
die(null);
}
if (phase == 0){ if (phase == 0){
if (Dungeon.hero.viewDistance >= Dungeon.level.distance(pos, Dungeon.hero.pos)) { if (Dungeon.hero.viewDistance >= Dungeon.level.distance(pos, Dungeon.hero.pos)) {