From f47c3e22ce1dfeffe46a69e41d53b6845044ee3a Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Thu, 14 Dec 2023 08:55:08 -0500 Subject: [PATCH] Fix evolution level up moves --- src/pokemon.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pokemon.ts b/src/pokemon.ts index 1dd29ec0d..4a4914d1f 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -634,12 +634,17 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (!startingLevel) startingLevel = this.level; if (this.fusionSpecies) { + const evolutionLevelMoves = levelMoves.slice(0, Math.max(levelMoves.findIndex(lm => !!lm[0]), 0)); const fusionLevelMoves = this.getFusionSpeciesForm().getLevelMoves(); const newLevelMoves: LevelMoves = []; while (levelMoves.length && levelMoves[0][0] < startingLevel) levelMoves.shift(); while (fusionLevelMoves.length && fusionLevelMoves[0][0] < startingLevel) fusionLevelMoves.shift(); + if (includeEvolutionMoves) { + for (let elm of evolutionLevelMoves.reverse()) + levelMoves.unshift(elm); + } for (let l = includeEvolutionMoves ? 0 : startingLevel; l <= this.level; l++) { if (l === 1 && startingLevel > 1) l = startingLevel; @@ -659,7 +664,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (levelMoves) { for (let lm of levelMoves) { const level = lm[0]; - if (level < startingLevel) + if ((!includeEvolutionMoves || level) && level < startingLevel) continue; else if (level > this.level) break;