From 94078bd9b9ad40df3cf3b51ba234bc736730967f Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 9 Nov 2019 12:20:26 -0500 Subject: [PATCH] v0.8.0: tweaked when enemy sprites show zap vfx. Now shows if either enemy or target is visible --- .../shatteredpixeldungeon/actors/mobs/DM100.java | 2 +- .../shatteredpixeldungeon/actors/mobs/Mob.java | 13 ++++++------- .../shatteredpixeldungeon/actors/mobs/Shaman.java | 2 +- .../shatteredpixeldungeon/actors/mobs/Warlock.java | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM100.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM100.java index 6814c0447..4a0c74b63 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM100.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM100.java @@ -86,7 +86,7 @@ public class DM100 extends Mob implements Callback { } else { - if (sprite != null && sprite.visible) { + if (sprite != null && (sprite.visible || enemy.sprite.visible)) { sprite.zap( enemy.pos ); } 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 92e594c7e..6e78a0e3a 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 @@ -462,17 +462,16 @@ public abstract class Mob extends Char { protected boolean doAttack( Char enemy ) { - boolean visible = Dungeon.level.heroFOV[pos]; - - if (visible) { + if (sprite != null && (sprite.visible || enemy.sprite.visible)) { sprite.attack( enemy.pos ); + spend( attackDelay() ); + return false; + } else { attack( enemy ); + spend( attackDelay() ); + return true; } - - spend( attackDelay() ); - - return !visible; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Shaman.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Shaman.java index 530e619fa..c06117542 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Shaman.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Shaman.java @@ -93,7 +93,7 @@ public abstract class Shaman extends Mob { } else { - if (sprite != null && sprite.visible) { + if (sprite != null && (sprite.visible || enemy.sprite.visible)) { sprite.zap( enemy.pos ); return false; } else { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java index 26ed674b5..fa20bb6d4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java @@ -84,7 +84,7 @@ public class Warlock extends Mob implements Callback { } else { - if (sprite != null && sprite.visible) { + if (sprite != null && (sprite.visible || enemy.sprite.visible)) { sprite.zap( enemy.pos ); return false; } else {