From 405bfeb77c72fafffe3e905bff71a13d350bdc35 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 3 Aug 2018 17:51:53 -0400 Subject: [PATCH] v0.7.0: bugfixes: - mirror and prismatic images being able to dodge friendly darts - friendly darts not working on fading prismatic images - prismatic images always healing while a floor is locked --- .../com/shatteredpixel/shatteredpixeldungeon/actors/Char.java | 2 +- .../shatteredpixeldungeon/actors/buffs/PrismaticGuard.java | 3 ++- .../shatteredpixeldungeon/actors/mobs/npcs/MirrorImage.java | 4 ++-- .../actors/mobs/npcs/PrismaticImage.java | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java index edb296106..5807246f4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java @@ -178,7 +178,7 @@ public abstract class Char extends Actor { public boolean attack( Char enemy ) { - if (enemy == null || !enemy.isAlive()) return false; + if (enemy == null) return false; boolean visibleFight = Dungeon.level.heroFOV[pos] || Dungeon.level.heroFOV[enemy.pos]; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/PrismaticGuard.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/PrismaticGuard.java index 3319e263e..268c0c3e3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/PrismaticGuard.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/PrismaticGuard.java @@ -85,7 +85,8 @@ public class PrismaticGuard extends Buff { spend(TICK); } - if (HP < maxHP()){ + LockedFloor lock = target.buff(LockedFloor.class); + if (HP < maxHP() && (lock == null || lock.regenOn())){ HP += 0.1f; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/MirrorImage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/MirrorImage.java index 2239c6dc2..3e6946766 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/MirrorImage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/MirrorImage.java @@ -43,7 +43,7 @@ public class MirrorImage extends NPC { spriteClass = MirrorSprite.class; HP = HT = 1; - defenseSkill = 0; + defenseSkill = 1; alignment = Alignment.ALLY; state = HUNTING; @@ -119,7 +119,7 @@ public class MirrorImage extends NPC { int heroEvasion = hero.defenseSkill(enemy); //if the hero has more/less evasion, 50% of it is applied - return (baseEvasion + heroEvasion) / 2; + return super.defenseSkill(enemy) * (baseEvasion + heroEvasion) / 2; } else { return 0; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/PrismaticImage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/PrismaticImage.java index 0d66a5814..675624adf 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/PrismaticImage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/PrismaticImage.java @@ -46,7 +46,7 @@ public class PrismaticImage extends NPC { spriteClass = PrismaticSprite.class; HP = HT = 8; - defenseSkill = 0; + defenseSkill = 1; alignment = Alignment.ALLY; state = HUNTING; @@ -151,7 +151,7 @@ public class PrismaticImage extends NPC { int heroEvasion = hero.defenseSkill(enemy); //if the hero has more/less evasion, 50% of it is applied - return (baseEvasion + heroEvasion) / 2; + return super.defenseSkill(enemy) * (baseEvasion + heroEvasion) / 2; } else { return 0; }