From 255177857fd357aa77d36bf7b99604ad4ec30d1d Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Tue, 19 Mar 2024 20:09:22 -0400 Subject: [PATCH] Update moveset generation to included evolved lower level moves --- src/field/pokemon.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 2d444b73d42..3ffac250447 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -776,8 +776,15 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { const evolutionChain = this.species.getSimulatedEvolutionChain(this.level, this.hasTrainer(), this.isBoss(), this.isPlayer()); for (let e = 0; e < evolutionChain.length; e++) { const speciesLevelMoves = getPokemonSpecies(evolutionChain[e][0] as Species).getLevelMoves(); - levelMoves.push(...speciesLevelMoves.filter(lm => (includeEvolutionMoves && !lm[0]) || ((!e || lm[0] >= evolutionChain[e - 1][0]) && (e === evolutionChain.length - 1 || lm[0] < evolutionChain[e + 1][0])))); + levelMoves.push(...speciesLevelMoves.filter(lm => (includeEvolutionMoves && !lm[0]) || (!e && (e === evolutionChain.length - 1 || lm[0] < evolutionChain[e + 1][0])))); } + const uniqueMoves: Moves[] = []; + levelMoves = levelMoves.filter(lm => { + if (uniqueMoves.find(m => m === lm[1])) + return false; + uniqueMoves.push(lm[1]); + return true; + }); } else levelMoves = this.getSpeciesForm().getLevelMoves(); if (this.fusionSpecies) {