v3.3.0: fixed further cases of brutes becoming immortal

This commit is contained in:
Evan Debenham
2025-11-27 12:08:26 -05:00
parent 72d659c771
commit 1f5c4a187a
2 changed files with 13 additions and 5 deletions

View File

@@ -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);
}

View File

@@ -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;