Split double boss HP bar segments
parent
4f62dec998
commit
2b213da4a6
|
@ -637,6 +637,17 @@ export class EncounterPhase extends BattlePhase {
|
||||||
|
|
||||||
if (battle.battleType === BattleType.TRAINER)
|
if (battle.battleType === BattleType.TRAINER)
|
||||||
loadEnemyAssets.push(battle.trainer.loadAssets().then(() => battle.trainer.initSprite()));
|
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(() => {
|
Promise.all(loadEnemyAssets).then(() => {
|
||||||
battle.enemyParty.forEach((enemyPokemon, e) => {
|
battle.enemyParty.forEach((enemyPokemon, e) => {
|
||||||
|
|
Loading…
Reference in New Issue