mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 15:03:24 +02:00
[Bug] Breaking a boss bar will no longer crash at max stat stages (#6440)
Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
This commit is contained in:
parent
98e65b9b8b
commit
dadc7b9598
@ -6916,7 +6916,7 @@ export class EnemyPokemon extends Pokemon {
|
|||||||
const leftoverStats = EFFECTIVE_STATS.filter((s: EffectiveStat) => this.getStatStage(s) < 6);
|
const leftoverStats = EFFECTIVE_STATS.filter((s: EffectiveStat) => this.getStatStage(s) < 6);
|
||||||
const statWeights = leftoverStats.map((s: EffectiveStat) => this.getStat(s, false));
|
const statWeights = leftoverStats.map((s: EffectiveStat) => this.getStat(s, false));
|
||||||
|
|
||||||
let boostedStat: EffectiveStat;
|
let boostedStat: EffectiveStat | undefined;
|
||||||
const statThresholds: number[] = [];
|
const statThresholds: number[] = [];
|
||||||
let totalWeight = 0;
|
let totalWeight = 0;
|
||||||
|
|
||||||
@ -6934,6 +6934,11 @@ export class EnemyPokemon extends Pokemon {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (boostedStat === undefined) {
|
||||||
|
this.bossSegmentIndex--;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let stages = 1;
|
let stages = 1;
|
||||||
|
|
||||||
// increase the boost if the boss has at least 3 segments and we passed last shield
|
// increase the boost if the boss has at least 3 segments and we passed last shield
|
||||||
@ -6949,7 +6954,7 @@ export class EnemyPokemon extends Pokemon {
|
|||||||
"StatStageChangePhase",
|
"StatStageChangePhase",
|
||||||
this.getBattlerIndex(),
|
this.getBattlerIndex(),
|
||||||
true,
|
true,
|
||||||
[boostedStat!],
|
[boostedStat],
|
||||||
stages,
|
stages,
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
|
Loading…
Reference in New Issue
Block a user