v0.8.0: tweaked when enemy sprites show zap vfx. Now shows if either enemy or target is visible

This commit is contained in:
Evan Debenham 2019-11-09 12:20:26 -05:00
parent b666231e7f
commit 94078bd9b9
4 changed files with 9 additions and 10 deletions

View File

@ -86,7 +86,7 @@ public class DM100 extends Mob implements Callback {
} else { } else {
if (sprite != null && sprite.visible) { if (sprite != null && (sprite.visible || enemy.sprite.visible)) {
sprite.zap( enemy.pos ); sprite.zap( enemy.pos );
} }

View File

@ -462,17 +462,16 @@ public abstract class Mob extends Char {
protected boolean doAttack( Char enemy ) { protected boolean doAttack( Char enemy ) {
boolean visible = Dungeon.level.heroFOV[pos]; if (sprite != null && (sprite.visible || enemy.sprite.visible)) {
if (visible) {
sprite.attack( enemy.pos ); sprite.attack( enemy.pos );
spend( attackDelay() );
return false;
} else { } else {
attack( enemy ); attack( enemy );
}
spend( attackDelay() ); spend( attackDelay() );
return true;
return !visible; }
} }
@Override @Override

View File

@ -93,7 +93,7 @@ public abstract class Shaman extends Mob {
} else { } else {
if (sprite != null && sprite.visible) { if (sprite != null && (sprite.visible || enemy.sprite.visible)) {
sprite.zap( enemy.pos ); sprite.zap( enemy.pos );
return false; return false;
} else { } else {

View File

@ -84,7 +84,7 @@ public class Warlock extends Mob implements Callback {
} else { } else {
if (sprite != null && sprite.visible) { if (sprite != null && (sprite.visible || enemy.sprite.visible)) {
sprite.zap( enemy.pos ); sprite.zap( enemy.pos );
return false; return false;
} else { } else {