From fd5a7985ce497578df99a63b8c10e5ed55d1db3c Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Fri, 1 Mar 2024 11:49:26 -0500 Subject: [PATCH] Fix additional issue with boss bar divider display --- src/ui/battle-info.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/battle-info.ts b/src/ui/battle-info.ts index 0a1c61e94a1..8e468246ec0 100644 --- a/src/ui/battle-info.ts +++ b/src/ui/battle-info.ts @@ -236,8 +236,9 @@ export default class BattleInfo extends Phaser.GameObjects.Container { this.hpBarSegmentDividers.pop().destroy(); if (this.boss && this.bossSegments > 1) { + const maxHp = pokemon.getMaxHp(); for (let s = 1; s < this.bossSegments; s++) { - const dividerX = (Math.round((pokemon.hp / this.bossSegments) * s) / pokemon.hp) * this.hpBar.width; + const dividerX = (Math.round((maxHp / this.bossSegments) * s) / maxHp) * this.hpBar.width; const divider = this.scene.add.rectangle(0, 0, 1, this.hpBar.height, pokemon.bossSegmentIndex >= s ? 0xFFFFFF : 0x404040); divider.setOrigin(0.5, 0); this.add(divider);