v2.3.0: fixed Tengu not quite handling taking massive damage correctly

This commit is contained in:
Evan Debenham
2023-11-27 16:41:04 -05:00
parent 59f37cb4c0
commit c221387115
@@ -138,15 +138,19 @@ public class Tengu extends Mob {
int hpBracket = HT / 8; int hpBracket = HT / 8;
int curbracket = HP / hpBracket;
int beforeHitHP = HP; int beforeHitHP = HP;
super.damage(dmg, src); super.damage(dmg, src);
dmg = beforeHitHP - HP;
//tengu cannot be hit through multiple brackets at a time //cannot be hit through multiple brackets at a time
if ((beforeHitHP/hpBracket - HP/hpBracket) >= 2){ if (HP <= (curbracket-1)*hpBracket){
HP = hpBracket * ((beforeHitHP/hpBracket)-1) + 1; HP = (curbracket-1)*hpBracket + 1;
} }
int newBracket = HP / hpBracket;
dmg = beforeHitHP - HP;
LockedFloor lock = Dungeon.hero.buff(LockedFloor.class); LockedFloor lock = Dungeon.hero.buff(LockedFloor.class);
if (lock != null) { if (lock != null) {
if (Dungeon.isChallenged(Challenges.STRONGER_BOSSES)) lock.addTime(2*dmg/3f); if (Dungeon.isChallenged(Challenges.STRONGER_BOSSES)) lock.addTime(2*dmg/3f);
@@ -180,7 +184,7 @@ public class Tengu extends Mob {
BossHealthBar.bleed(true); BossHealthBar.bleed(true);
//if tengu has lost a certain amount of hp, jump //if tengu has lost a certain amount of hp, jump
} else if (beforeHitHP / hpBracket != HP / hpBracket) { } else if (newBracket != curbracket) {
//let full attack action complete first //let full attack action complete first
Actor.add(new Actor() { Actor.add(new Actor() {