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 7a2450a7e..a86c1c2ea 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 @@ -159,6 +159,9 @@ public class Berserk extends ShieldBuff implements ActionIndicator.Action { @Override public void detach() { super.detach(); + if (state == State.BERSERK) { + state = State.RECOVERING; + } ActionIndicator.clearAction(this); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Brute.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Brute.java index 3493550fb..8ee0ae238 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Brute.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Brute.java @@ -80,7 +80,7 @@ public class Brute extends Mob { } } - //cache this buff to prevent having to call buff(...) a bunch. + //cache this buff to prevent having to call buff(...) a bunch in isAlive private BruteRage rage; @Override @@ -92,16 +92,15 @@ public class Brute extends Mob { triggerEnrage(); } if (rage == null){ - for (BruteRage b : buffs(BruteRage.class)){ - rage = b; - } + rage = buff(BruteRage.class); } return rage != null && rage.shielding() > 0; } } protected void triggerEnrage(){ - Buff.affect(this, BruteRage.class).setShield(HT/2 + 4); + rage = Buff.affect(this, BruteRage.class); + rage.setShield(HT/2 + 4); sprite.showStatusWithIcon( CharSprite.POSITIVE, Integer.toString(HT/2 + 4), FloatingText.SHIELDING ); if (Dungeon.level.heroFOV[pos]) { SpellSprite.show( this, SpellSprite.BERSERK); @@ -149,6 +148,12 @@ public class Brute extends Mob { return true; } + @Override + public void detach() { + super.detach(); + decShield(shielding()); //clear shielding to track that this was detached + } + @Override public int icon () { return BuffIndicator.FURY;