Attempt fixing crash when getting EXP value

pull/2/head
Flashfyre 2023-10-19 22:54:19 -04:00
parent 6ab6360ec9
commit 59767c7607
2 changed files with 4 additions and 5 deletions

View File

@ -2007,9 +2007,11 @@ export class VictoryPhase extends PokemonPhase {
const expShareModifier = this.scene.findModifier(m => m instanceof ExpShareModifier) as ExpShareModifier;
const expBalanceModifier = this.scene.findModifier(m => m instanceof ExpBalanceModifier) as ExpBalanceModifier;
const multipleParticipantExpBonusModifier = this.scene.findModifier(m => m instanceof MultipleParticipantExpBonusModifier) as MultipleParticipantExpBonusModifier;
const expValue = this.getPokemon().getExpValue();
const expPartyMembers = party.filter(p => p.hp && p.level < this.scene.getMaxExpLevel());
const partyMemberExp = [];
let expValue = this.getPokemon().getExpValue();
if (this.scene.currentBattle.battleType === BattleType.TRAINER)
expValue = Math.floor(expValue * 1.5);
for (let partyMember of expPartyMembers) {
const pId = partyMember.id;
const participated = participantIds.has(pId);

View File

@ -990,10 +990,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
getExpValue(): integer {
// Logic to factor in victor level has been removed for balancing purposes, so the player doesn't have to focus on EXP maxxing
let ret = ((this.getSpeciesForm().baseExp * this.level) / 5 + 1);
if (this.scene.currentBattle.battleType === BattleType.TRAINER)
ret = Math.floor(ret * 1.5);
return ret;
return ((this.getSpeciesForm().baseExp * this.level) / 5 + 1);
}
setFrameRate(frameRate: integer) {