Fix random moveset generation logic not working properly with evolutions

pull/16/head
Flashfyre 2024-03-25 14:27:04 -04:00
parent 4bf83645b5
commit a8cabd50d9
1 changed files with 1 additions and 1 deletions

View File

@ -779,7 +779,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
const evolutionChain = this.species.getSimulatedEvolutionChain(this.level, this.hasTrainer(), this.isBoss(), this.isPlayer()); const evolutionChain = this.species.getSimulatedEvolutionChain(this.level, this.hasTrainer(), this.isBoss(), this.isPlayer());
for (let e = 0; e < evolutionChain.length; e++) { for (let e = 0; e < evolutionChain.length; e++) {
const speciesLevelMoves = getPokemonSpecies(evolutionChain[e][0] as Species).getLevelMoves(); const speciesLevelMoves = getPokemonSpecies(evolutionChain[e][0] as Species).getLevelMoves();
levelMoves.push(...speciesLevelMoves.filter(lm => (includeEvolutionMoves && !lm[0]) || (!e && (e === evolutionChain.length - 1 || lm[0] < evolutionChain[e + 1][0])))); levelMoves.push(...speciesLevelMoves.filter(lm => (includeEvolutionMoves && !lm[0]) || (lm[0] >= evolutionChain[e][0] && (e === evolutionChain.length - 1 || lm[0] <= evolutionChain[e + 1][0]))));
} }
const uniqueMoves: Moves[] = []; const uniqueMoves: Moves[] = [];
levelMoves = levelMoves.filter(lm => { levelMoves = levelMoves.filter(lm => {