From 8f0a3f15a3aa8e8504a512383b0c5a8cadcdd824 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Fri, 29 Mar 2024 10:37:28 -0400 Subject: [PATCH] Change double boss bar split to factor in base stat total --- src/phases.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/phases.ts b/src/phases.ts index d66a8ec7d..0d78ab7a5 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -595,6 +595,8 @@ export class EncounterPhase extends BattlePhase { const battle = this.scene.currentBattle; + let totalBst = 0; + battle.enemyLevels.forEach((level, e) => { if (!this.loaded) { if (battle.battleType === BattleType.TRAINER) @@ -629,6 +631,8 @@ export class EncounterPhase extends BattlePhase { enemyPokemon.updateScale(); } } + + totalBst += enemyPokemon.getSpeciesForm().baseTotal; loadEnemyAssets.push(enemyPokemon.loadAssets()); @@ -638,11 +642,10 @@ 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) { + if (battle.enemyParty.filter(p => p.isBoss()).length > 1) { for (let enemyPokemon of battle.enemyParty) { if (enemyPokemon.isBoss()) { - enemyPokemon.setBoss(true, Math.ceil(enemyPokemon.bossSegments / bossCount)); + enemyPokemon.setBoss(true, Math.ceil(enemyPokemon.bossSegments * (enemyPokemon.getSpeciesForm().baseTotal / totalBst))); enemyPokemon.initBattleInfo(); } }