From ae7d963fb5f6d53a6d8ee8a9528570e74f839e96 Mon Sep 17 00:00:00 2001 From: AJ Fontaine Date: Fri, 1 Aug 2025 22:51:39 -0400 Subject: [PATCH] Fix relearns counting for starter moves --- src/data/challenge.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 6115729e9af..2419b11c9fe 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -24,7 +24,7 @@ import type { Pokemon } from "#field/pokemon"; import { Trainer } from "#field/trainer"; import { PokemonMove } from "#moves/pokemon-move"; import type { DexAttrProps, GameData } from "#system/game-data"; -import { BooleanHolder, type NumberHolder, randSeedItem } from "#utils/common"; +import { BooleanHolder, isBetween, type NumberHolder, randSeedItem } from "#utils/common"; import { deepCopy } from "#utils/data"; import { getPokemonSpecies } from "#utils/pokemon-utils"; import { toCamelCase, toSnakeCase } from "#utils/strings"; @@ -705,11 +705,12 @@ export class FreshStartChallenge extends Challenge { pokemon.nature = Nature.HARDY; // Neutral nature let validMoves = pokemon.species .getLevelMoves() - .filter(m => m[0] <= 5) + .filter(m => isBetween(m[0], 1, 5)) .map(lm => lm[1]); - // filter egg moves out of the moveset, + // Filter egg moves out of the moveset pokemon.moveset = pokemon.moveset.filter(pm => validMoves.includes(pm.moveId)); if (pokemon.moveset.length < 4) { + // If there's empty slots fill with remaining valid moves validMoves = validMoves.filter(m => !pokemon.moveset.map(pm => pm.moveId).includes(m)); pokemon.moveset = pokemon.moveset.concat(validMoves.map(m => new PokemonMove(m))).slice(0, 4); }