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

View File

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