Fix visual bug with boss segments
parent
0dc53bfeb8
commit
ed1f82b476
|
@ -2345,8 +2345,7 @@ export class EnemyPokemon extends Pokemon {
|
||||||
|
|
||||||
let bossSegmentIndex = this.bossSegmentIndex;
|
let bossSegmentIndex = this.bossSegmentIndex;
|
||||||
|
|
||||||
if (this.isBoss()) {
|
if (this.isBoss() && !ignoreSegments) {
|
||||||
if (!ignoreSegments) {
|
|
||||||
const segmentSize = this.getMaxHp() / this.bossSegments;
|
const segmentSize = this.getMaxHp() / this.bossSegments;
|
||||||
for (let s = this.bossSegmentIndex; s > 0; s--) {
|
for (let s = this.bossSegmentIndex; s > 0; s--) {
|
||||||
const hpThreshold = segmentSize * 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);
|
const ret = super.damage(damage, ignoreSegments, preventEndure);
|
||||||
|
|
||||||
if (this.isBoss() && bossSegmentIndex < this.bossSegmentIndex)
|
if (this.isBoss()) {
|
||||||
|
if (bossSegmentIndex < this.bossSegmentIndex)
|
||||||
this.handleBossSegmentCleared(bossSegmentIndex);
|
this.handleBossSegmentCleared(bossSegmentIndex);
|
||||||
|
this.battleInfo.updateBossSegments(this);
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue