From 2b213da4a69f4510fea260f774bc1a3743c8ced5 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Fri, 29 Mar 2024 10:29:19 -0400 Subject: [PATCH] Split double boss HP bar segments --- src/phases.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/phases.ts b/src/phases.ts index 4351f089a..d66a8ec7d 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -637,6 +637,17 @@ export class EncounterPhase extends BattlePhase { if (battle.battleType === BattleType.TRAINER) loadEnemyAssets.push(battle.trainer.loadAssets().then(() => battle.trainer.initSprite())); + else { + const bossCount = battle.enemyParty.filter(p => p.isBoss()).length; + if (bossCount > 1) { + for (let enemyPokemon of battle.enemyParty) { + if (enemyPokemon.isBoss()) { + enemyPokemon.setBoss(true, Math.ceil(enemyPokemon.bossSegments / bossCount)); + enemyPokemon.initBattleInfo(); + } + } + } + } Promise.all(loadEnemyAssets).then(() => { battle.enemyParty.forEach((enemyPokemon, e) => {