Rename LearnMoveSituation to LearnMoveContext

This commit is contained in:
Sirz Benjie 2025-04-14 09:09:12 -05:00
parent 2394726dcf
commit 4e7f35e4c2
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E
3 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
export enum LearnMoveSituation { export enum LearnMoveContext {
MISC, MISC,
LEVEL_UP, LEVEL_UP,
RELEARN, RELEARN,

View File

@ -259,7 +259,7 @@ import { MoveFlags } from "#enums/MoveFlags";
import { timedEventManager } from "#app/global-event-manager"; import { timedEventManager } from "#app/global-event-manager";
import { loadMoveAnimations } from "#app/sprites/pokemon-asset-loader"; import { loadMoveAnimations } from "#app/sprites/pokemon-asset-loader";
import { ResetStatusPhase } from "#app/phases/reset-status-phase"; import { ResetStatusPhase } from "#app/phases/reset-status-phase";
import { LearnMoveSituation } from "#enums/learn-move-situation"; import { LearnMoveContext } from "#enums/learn-move-context";
import { TurnMove } from "#app/interfaces/turn-move"; import { TurnMove } from "#app/interfaces/turn-move";
import { AiType } from "#enums/ai-type"; import { AiType } from "#enums/ai-type";
import { PokemonMove } from "#app/data/moves/pokemon-move"; import { PokemonMove } from "#app/data/moves/pokemon-move";
@ -2919,7 +2919,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
includeEvolutionMoves = false, includeEvolutionMoves = false,
simulateEvolutionChain = false, simulateEvolutionChain = false,
includeRelearnerMoves = false, includeRelearnerMoves = false,
learnSituation: LearnMoveSituation = LearnMoveSituation.MISC, learnSituation: LearnMoveContext = LearnMoveContext.MISC,
): LevelMoves { ): LevelMoves {
const ret: LevelMoves = []; const ret: LevelMoves = [];
let levelMoves: LevelMoves = []; let levelMoves: LevelMoves = [];
@ -2927,7 +2927,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
startingLevel = this.level; startingLevel = this.level;
} }
if ( if (
learnSituation === LearnMoveSituation.EVOLUTION_FUSED && learnSituation === LearnMoveContext.EVOLUTION_FUSED &&
this.fusionSpecies this.fusionSpecies
) { ) {
// For fusion evolutions, get ONLY the moves of the component mon that evolved // For fusion evolutions, get ONLY the moves of the component mon that evolved
@ -2979,7 +2979,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
} }
if ( if (
this.fusionSpecies && this.fusionSpecies &&
learnSituation !== LearnMoveSituation.EVOLUTION_FUSED_BASE learnSituation !== LearnMoveContext.EVOLUTION_FUSED_BASE
) { ) {
// For fusion evolutions, get ONLY the moves of the component mon that evolved // For fusion evolutions, get ONLY the moves of the component mon that evolved
if (simulateEvolutionChain) { if (simulateEvolutionChain) {

View File

@ -10,7 +10,7 @@ import { Mode } from "#app/ui/ui";
import { cos, sin } from "#app/field/anims"; import { cos, sin } from "#app/field/anims";
import type { PlayerPokemon } from "#app/field/pokemon"; import type { PlayerPokemon } from "#app/field/pokemon";
import type Pokemon from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon";
import { LearnMoveSituation } from "#enums/learn-move-situation"; import { LearnMoveContext } from "#enums/learn-move-context";
import { getTypeRgb } from "#app/data/type"; import { getTypeRgb } from "#app/data/type";
import i18next from "i18next"; import i18next from "i18next";
import { getPokemonNameWithAffix } from "#app/messages"; import { getPokemonNameWithAffix } from "#app/messages";
@ -343,11 +343,11 @@ export class EvolutionPhase extends Phase {
this.evolutionHandler.canCancel = false; this.evolutionHandler.canCancel = false;
this.pokemon.evolve(this.evolution, this.pokemon.species).then(() => { this.pokemon.evolve(this.evolution, this.pokemon.species).then(() => {
const learnSituation: LearnMoveSituation = this.fusionSpeciesEvolved const learnSituation: LearnMoveContext = this.fusionSpeciesEvolved
? LearnMoveSituation.EVOLUTION_FUSED ? LearnMoveContext.EVOLUTION_FUSED
: this.pokemon.fusionSpecies : this.pokemon.fusionSpecies
? LearnMoveSituation.EVOLUTION_FUSED_BASE ? LearnMoveContext.EVOLUTION_FUSED_BASE
: LearnMoveSituation.EVOLUTION; : LearnMoveContext.EVOLUTION;
const levelMoves = this.pokemon const levelMoves = this.pokemon
.getLevelMoves(this.lastLevel + 1, true, false, false, learnSituation) .getLevelMoves(this.lastLevel + 1, true, false, false, learnSituation)
.filter(lm => lm[0] === EVOLVE_MOVE); .filter(lm => lm[0] === EVOLVE_MOVE);