From 965d0f04ea9f0165d74f2937de82274df04e33da Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 4 Nov 2016 02:39:11 -0400 Subject: [PATCH] v0.4.3b: fixed some bugs with the berserker subclass --- .../shatteredpixeldungeon/actors/buffs/Berserk.java | 2 +- .../shatteredpixeldungeon/actors/hero/Hero.java | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Berserk.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Berserk.java index 02ccdbc93..9727ee0b8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Berserk.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Berserk.java @@ -119,7 +119,7 @@ public class Berserk extends Buff { } - return state == State.BERSERK; + return state == State.BERSERK && target.SHLD > 0; } public void recover(float percent){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index a95a2bd4c..d3fd2c300 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -1393,10 +1393,9 @@ public class Hero extends Char { @Override public boolean isAlive() { - if (subClass == HeroSubClass.BERSERKER - && berserk != null - && berserk.berserking()){ - return true; + if (subClass == HeroSubClass.BERSERKER){ + if (berserk == null) berserk = Buff.affect(this, Berserk.class); + if (berserk.berserking()) return true; } return super.isAlive(); }