Apply suggestions from code review

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
Mumble 2024-09-04 13:54:35 -07:00 committed by GitHub
parent 91c0374bda
commit 2eed9b137d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 13 deletions

View File

@ -72,12 +72,14 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
/** /**
* This facilitates the process in which an old move is chosen to be forgotten. * This facilitates the process in which an old move is chosen to be forgotten.
*
* > Which move should be forgotten? * > Which move should be forgotten?
* The game then goes Mode.SUMMARY to select a move to be forgotten. *
* If a player does not select a move or chooses the new move (moveIndex === 4), the game goes to this.rejectMoveAndEnd() * The game then goes `Mode.SUMMARY` to select a move to be forgotten.
* If an old move is selected, the function then passes the moveIndex to this.learnMove() * If a player does not select a move or chooses the new move (`moveIndex === 4`), the game goes to `this.rejectMoveAndEnd()`.
* @param move - the Move to be learned * If an old move is selected, the function then passes the `moveIndex` to `this.learnMove()`
* @param Pokemon - the Pokemon learning the move * @param move The Move to be learned
* @param Pokemon The Pokemon learning the move
*/ */
forgetMoveProcess(move: Move, pokemon: Pokemon) { forgetMoveProcess(move: Move, pokemon: Pokemon) {
this.scene.ui.setMode(this.messageMode); this.scene.ui.setMode(this.messageMode);
@ -96,11 +98,13 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
/** /**
* This asks the player if they wish to end the current move learning process. * This asks the player if they wish to end the current move learning process.
* > Stop trying to teach [MoveName]? --> Mode.CONFIRM --> Yes: > [Pokemon] did not learn the move [MoveName], No: this.replaceMoveCheck() *
* > Stop trying to teach [MoveName]? --> `Mode.CONFIRM` --> Yes: > [Pokemon] did not learn the move [MoveName], No: `this.replaceMoveCheck()`
*
* If the player wishes to not teach the Pokemon the move, it displays a message and ends the phase. * If the player wishes to not teach the Pokemon the move, it displays a message and ends the phase.
* If the player reconsiders, it repeats the process for a Pokemon with a full moveset once again. * If the player reconsiders, it repeats the process for a Pokemon with a full moveset once again.
* @param move - the Move to be learned * @param move The Move to be learned
* @param Pokemon - the Pokemon learning the move * @param Pokemon The Pokemon learning the move
*/ */
rejectMoveAndEnd(move: Move, pokemon: Pokemon) { rejectMoveAndEnd(move: Move, pokemon: Pokemon) {
this.scene.ui.showTextPromise(i18next.t("battle:learnMoveStopTeaching", { moveName: move.name }), undefined, false).then(()=> { this.scene.ui.showTextPromise(i18next.t("battle:learnMoveStopTeaching", { moveName: move.name }), undefined, false).then(()=> {
@ -121,16 +125,16 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
* This teaches the Pokemon the new move and ends the phase. * This teaches the Pokemon the new move and ends the phase.
* When a Pokemon forgets a move and learns a new one, its 'Learn Move' message is significantly longer. * When a Pokemon forgets a move and learns a new one, its 'Learn Move' message is significantly longer.
* *
* Pokemon with a moveset.length < 4 * Pokemon with a `moveset.length < 4`
* > [Pokemon] learned [MoveName] * > [Pokemon] learned [MoveName]
* *
* Pokemon with a moveset.length > 4 * Pokemon with a `moveset.length > 4`
* > 1... 2... and 3... and Poof! * > 1... 2... and 3... and Poof!
* > [Pokemon] forgot how to use [MoveName] * > [Pokemon] forgot how to use [MoveName]
* > And... * > And...
* > [Pokemon] learned [MoveName]! * > [Pokemon] learned [MoveName]!
* @param move - the Move to be learned * @param move The Move to be learned
* @param Pokemon - the Pokemon learning the move * @param Pokemon The Pokemon learning the move
*/ */
learnMove(index: number, move: Move, pokemon: Pokemon, textMessage?: string) { learnMove(index: number, move: Move, pokemon: Pokemon, textMessage?: string) {
if (this.fromTM) { if (this.fromTM) {

View File

@ -51,7 +51,7 @@ export class OverridesHelper extends GameManagerHelper {
/** /**
* Override the XP Multiplier * Override the XP Multiplier
* @param value the XP multiplier to set * @param value the XP multiplier to set
* @returns this * @returns `this`
*/ */
xpMultiplier(value: number): this { xpMultiplier(value: number): this {
vi.spyOn(Overrides, "XP_MULTIPLIER_OVERRIDE", "get").mockReturnValue(value); vi.spyOn(Overrides, "XP_MULTIPLIER_OVERRIDE", "get").mockReturnValue(value);