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
@@ -137,31 +137,35 @@ public class Tengu extends Mob {
PrisonBossLevel.State state = ((PrisonBossLevel)Dungeon.level).state(); PrisonBossLevel.State state = ((PrisonBossLevel)Dungeon.level).state();
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;
//cannot be hit through multiple brackets at a time
//tengu cannot be hit through multiple brackets at a time if (HP <= (curbracket-1)*hpBracket){
if ((beforeHitHP/hpBracket - HP/hpBracket) >= 2){ HP = (curbracket-1)*hpBracket + 1;
HP = hpBracket * ((beforeHitHP/hpBracket)-1) + 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);
else lock.addTime(dmg); else lock.addTime(dmg);
} }
//phase 2 of the fight is over //phase 2 of the fight is over
if (HP == 0 && state == PrisonBossLevel.State.FIGHT_ARENA) { if (HP == 0 && state == PrisonBossLevel.State.FIGHT_ARENA) {
//let full attack action complete first //let full attack action complete first
Actor.add(new Actor() { Actor.add(new Actor() {
{ {
actPriority = VFX_PRIO; actPriority = VFX_PRIO;
} }
@Override @Override
protected boolean act() { protected boolean act() {
Actor.remove(this); Actor.remove(this);
@@ -171,16 +175,16 @@ public class Tengu extends Mob {
}); });
return; return;
} }
//phase 1 of the fight is over //phase 1 of the fight is over
if (state == PrisonBossLevel.State.FIGHT_START && HP <= HT/2){ if (state == PrisonBossLevel.State.FIGHT_START && HP <= HT/2){
HP = (HT/2); HP = (HT/2);
yell(Messages.get(this, "interesting")); yell(Messages.get(this, "interesting"));
((PrisonBossLevel)Dungeon.level).progress(); ((PrisonBossLevel)Dungeon.level).progress();
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() {