Fix infinite EXP bug

pull/7/head
Flashfyre 2023-11-24 16:27:26 -05:00
parent e5fe0c6e3a
commit 1a9c492a79
1 changed files with 50 additions and 47 deletions

View File

@ -2157,6 +2157,8 @@ export class VictoryPhase extends PokemonPhase {
const multipleParticipantExpBonusModifier = this.scene.findModifier(m => m instanceof MultipleParticipantExpBonusModifier) as MultipleParticipantExpBonusModifier;
const expPartyMembers = party.filter(p => p.hp && p.level < this.scene.getMaxExpLevel());
const partyMemberExp = [];
if (participantIds.size) {
let expValue = this.getPokemon().getExpValue();
if (this.scene.currentBattle.battleType === BattleType.TRAINER)
expValue = Math.floor(expValue * 1.5);
@ -2214,6 +2216,7 @@ export class VictoryPhase extends PokemonPhase {
this.scene.unshiftPhase(expPartyMembers[pm].isOnField() ? new ExpPhase(this.scene, partyMemberIndex, exp) : new ShowPartyExpBarPhase(this.scene, partyMemberIndex, exp));
}
}
}
if (!this.scene.getEnemyParty().filter(p => !p?.isFainted(true)).length) {
this.scene.pushPhase(new BattleEndPhase(this.scene));