Fix summary next level EXP showing incorrectly
parent
2b95d4ce51
commit
16fbe971f6
|
@ -17,7 +17,7 @@ const expLevels = [
|
|||
];
|
||||
|
||||
export function getLevelTotalExp(level: integer, growthRate: integer) {
|
||||
return expLevels[growthRate][level - 1];
|
||||
return expLevels[growthRate][Math.min(level, 100) - 1];
|
||||
};
|
||||
|
||||
export function getLevelRelExp(level: integer, growthRate: integer) {
|
||||
|
|
|
@ -496,7 +496,10 @@ export default class SummaryUiHandler extends UiHandler {
|
|||
expText.setOrigin(1, 0);
|
||||
statsContainer.add(expText);
|
||||
|
||||
const nextLvExpText = addTextObject(this.scene, 208, 128, (totalLvExp - this.pokemon.levelExp).toString(), TextStyle.WINDOW);
|
||||
const nextLvExp = this.pokemon.level < 100
|
||||
? getLevelTotalExp(this.pokemon.level + 1, this.pokemon.species.growthRate) - this.pokemon.levelExp
|
||||
: 0;
|
||||
const nextLvExpText = addTextObject(this.scene, 208, 128, nextLvExp.toString(), TextStyle.WINDOW);
|
||||
nextLvExpText.setOrigin(1, 0);
|
||||
statsContainer.add(nextLvExpText);
|
||||
|
||||
|
|
Loading…
Reference in New Issue