mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-23 07:49:36 +02:00
Apply suggestions from code review
This commit is contained in:
parent
5c933441f9
commit
6114bb216f
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user