v0.6.5: adjusted invisibility to always override seen values

This commit is contained in:
Evan Debenham 2018-05-01 21:57:31 -04:00 committed by Evan Debenham
parent 5056176c57
commit 3f8c55b0b8
2 changed files with 7 additions and 4 deletions

View File

@ -873,8 +873,7 @@ public class Hero extends Char {
enemy = action.target;
if (enemy.isAlive() && canAttack( enemy ) && !isCharmedBy( enemy )) {
Invisibility.dispel();
spend( attackDelay() );
sprite.attack( enemy.pos );
@ -1432,6 +1431,8 @@ public class Hero extends Char {
if (combo != null) combo.miss();
}
}
Invisibility.dispel();
curAction = null;

View File

@ -465,7 +465,8 @@ public abstract class Mob extends Char {
@Override
public int defenseSkill( Char enemy ) {
boolean seen = enemySeen || (enemy == Dungeon.hero && !Dungeon.hero.canSurpriseAttack());
boolean seen = (enemySeen && enemy.invisible == 0);
if (enemy == Dungeon.hero && !Dungeon.hero.canSurpriseAttack()) seen = true;
if ( seen
&& paralysed == 0
&& !(alignment == Alignment.ALLY && enemy == Dungeon.hero)) {
@ -479,7 +480,8 @@ public abstract class Mob extends Char {
@Override
public int defenseProc( Char enemy, int damage ) {
if (!enemySeen && enemy == Dungeon.hero && Dungeon.hero.canSurpriseAttack()) {
if ((!enemySeen || enemy.invisible > 0)
&& enemy == Dungeon.hero && Dungeon.hero.canSurpriseAttack()) {
if (enemy.buff(Preparation.class) != null) {
Wound.hit(this);
} else {