diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 91b57501371..2f918eaca2f 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -3524,7 +3524,6 @@ export default interface Pokemon { export class PlayerPokemon extends Pokemon { public compatibleTms: Moves[]; - public usedTms: Moves[]; constructor(scene: BattleScene, species: PokemonSpecies, level: integer, abilityIndex?: integer, formIndex?: integer, gender?: Gender, shiny?: boolean, variant?: Variant, ivs?: integer[], nature?: Nature, dataSource?: Pokemon | PokemonData) { super(scene, 106, 148, species, level, abilityIndex, formIndex, gender, shiny, variant, ivs, nature, dataSource); @@ -3548,7 +3547,6 @@ export class PlayerPokemon extends Pokemon { } } this.generateCompatibleTms(); - this.usedTms = []; } initBattleInfo(): void { diff --git a/src/phases/learn-move-phase.ts b/src/phases/learn-move-phase.ts index 201019e8860..26088f5b835 100644 --- a/src/phases/learn-move-phase.ts +++ b/src/phases/learn-move-phase.ts @@ -44,6 +44,9 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase { if (emptyMoveIndex > -1) { pokemon.setMove(emptyMoveIndex, this.moveId); if (this.fromTM) { + if (!pokemon.usedTMs) { + pokemon.usedTMs = []; + } pokemon.usedTMs.push(this.moveId); } initMoveAnim(this.scene, this.moveId).then(() => { @@ -91,6 +94,9 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase { this.scene.ui.showText(i18next.t("battle:learnMoveForgetSuccess", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: pokemon.moveset[moveIndex]!.getName() }), null, () => { // TODO: is the bang correct? this.scene.ui.showText(i18next.t("battle:learnMoveAnd"), null, () => { if (this.fromTM) { + if (!pokemon.usedTMs) { + pokemon.usedTMs = []; + } pokemon.usedTMs.push(this.moveId); } pokemon.setMove(moveIndex, Moves.NONE);