Apply suggestions from code review

This commit is contained in:
NightKev 2024-10-11 14:26:45 -07:00 committed by GitHub
parent 5c933441f9
commit 6114bb216f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View File

@ -77,16 +77,16 @@ export abstract class ArenaTag {
* @param scene medium to retrieve the source Pokemon * @param scene medium to retrieve the source Pokemon
* @returns The source {@linkcode Pokemon} or `null` if none is found * @returns The source {@linkcode Pokemon} or `null` if none is found
*/ */
retrieveSource(scene: BattleScene): Pokemon | null { public retrieveSource(scene: BattleScene): Pokemon | null {
return this.sourceId ? scene.getPokemonById(this.sourceId) : null; return this.sourceId ? scene.getPokemonById(this.sourceId) : null;
} }
/** /**
* Helper function that retrieves the Pokemon affected * Helper function that retrieves the Pokemon affected
* @param {BattleScene} scene medium to retrieve the involved Pokemon * @param scene - medium to retrieve the involved Pokemon
* @returns list of PlayerPokemon or EnemyPokemon on the field * @returns list of PlayerPokemon or EnemyPokemon on the field
*/ */
retrieveField(scene: BattleScene): Pokemon[] { public retrieveField(scene: BattleScene): Pokemon[] {
switch (this.side) { switch (this.side) {
case ArenaTagSide.PLAYER: case ArenaTagSide.PLAYER:
return scene.getPlayerField() ?? []; return scene.getPlayerField() ?? [];
@ -1015,7 +1015,7 @@ class ImprisonTag extends ArenaTrapTag {
const source = this.retrieveSource(scene); const source = this.retrieveSource(scene);
if (source) { if (source) {
const party = this.retrieveField(scene); const party = this.retrieveField(scene);
party?.forEach((p: Pokemon ) => { party?.forEach((p: Pokemon) => {
if (p.isAllowedInBattle()) { if (p.isAllowedInBattle()) {
p.addTag(BattlerTagType.IMPRISON, 1, Moves.IMPRISON, this.sourceId); p.addTag(BattlerTagType.IMPRISON, 1, Moves.IMPRISON, this.sourceId);
} }

View File

@ -97,7 +97,7 @@ export class BattlerTag {
* @param scene medium to retrieve the source Pokemon * @param scene medium to retrieve the source Pokemon
* @returns The source {@linkcode Pokemon} or `null` if none is found * @returns The source {@linkcode Pokemon} or `null` if none is found
*/ */
retrieveSource(scene: BattleScene): Pokemon | null { public retrieveSource(scene: BattleScene): Pokemon | null {
return this.sourceId ? scene.getPokemonById(this.sourceId) : null; return this.sourceId ? scene.getPokemonById(this.sourceId) : null;
} }
} }
@ -146,9 +146,9 @@ export abstract class MoveRestrictionBattlerTag extends BattlerTag {
/** /**
* Gets whether this tag is restricting a move. * Gets whether this tag is restricting a move.
* *
* @param {Moves} move {@linkcode Moves} ID to check restriction for. * @param move - {@linkcode Moves} ID to check restriction for.
* @param {Pokemon} user {@linkcode Pokemon} the Pokemon involved * @param user - The {@linkcode Pokemon} involved
* @returns {boolean} `true` if the move is restricted by this tag, otherwise `false`. * @returns `true` if the move is restricted by this tag, otherwise `false`.
*/ */
public abstract isMoveRestricted(move: Moves, user?: Pokemon): boolean; public abstract isMoveRestricted(move: Moves, user?: Pokemon): boolean;