Fix visual bug with boss segments

pull/16/head
Flashfyre 2024-03-01 11:35:13 -05:00
parent 0dc53bfeb8
commit ed1f82b476
1 changed files with 21 additions and 21 deletions

View File

@ -2345,8 +2345,7 @@ export class EnemyPokemon extends Pokemon {
let bossSegmentIndex = this.bossSegmentIndex;
if (this.isBoss()) {
if (!ignoreSegments) {
if (this.isBoss() && !ignoreSegments) {
const segmentSize = this.getMaxHp() / this.bossSegments;
for (let s = this.bossSegmentIndex; s > 0; s--) {
const hpThreshold = segmentSize * s;
@ -2367,13 +2366,14 @@ export class EnemyPokemon extends Pokemon {
}
}
}
this.battleInfo.updateBossSegments(this);
}
const ret = super.damage(damage, ignoreSegments, preventEndure);
if (this.isBoss() && bossSegmentIndex < this.bossSegmentIndex)
if (this.isBoss()) {
if (bossSegmentIndex < this.bossSegmentIndex)
this.handleBossSegmentCleared(bossSegmentIndex);
this.battleInfo.updateBossSegments(this);
}
return ret;
}