mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-24 00:09:31 +02:00
Apply suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
parent
bb99bcac8d
commit
94aeacfa47
@ -965,19 +965,16 @@ class ImprisonTag extends ArenaTrapTag {
|
||||
|
||||
/**
|
||||
* Helper function that retrieves the source Pokemon
|
||||
* @param {BattleScene} scene medium to retrieve the source Pokemon
|
||||
* @returns {Pokemon} pokemon or undefined
|
||||
* @param scene medium to retrieve the source Pokemon
|
||||
* @returns The source {@linkcode Pokemon} or `null` if none is found
|
||||
*/
|
||||
private retrieveSource(scene: BattleScene): Pokemon | undefined {
|
||||
if (this.sourceId) {
|
||||
return scene.getPokemonById(this.sourceId) ?? undefined;
|
||||
}
|
||||
return undefined;
|
||||
private retrieveSource(scene: BattleScene): Pokemon | null {
|
||||
return this.sourceId ? scene.getPokemonById(this.sourceId) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 opposing Pokemon on the field
|
||||
*/
|
||||
private retrieveField(scene: BattleScene): PlayerPokemon[] | EnemyPokemon[] {
|
||||
@ -1004,7 +1001,7 @@ class ImprisonTag extends ArenaTrapTag {
|
||||
* @param _arena
|
||||
* @returns `true` if the source of the tag is still active on the field | `false` if not
|
||||
*/
|
||||
override lapse({ scene }: Arena): boolean {
|
||||
override lapse({ scene }: BattleScene): boolean {
|
||||
const source = this.retrieveSource(scene);
|
||||
return source ? source.isActive(true) : false;
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ export class GorillaTacticsTag extends MoveRestrictionBattlerTag {
|
||||
/**
|
||||
* Loads the Gorilla Tactics Battler Tag along with its unique class variable moveId
|
||||
* @override
|
||||
* @param source {@linkcode BattlerTag} Gorilla Tactic's Battler Tag information
|
||||
* @param source Gorilla Tactics' {@linkcode BattlerTag} information
|
||||
*/
|
||||
override loadTag(source: BattlerTag | any): void {
|
||||
super.loadTag(source);
|
||||
@ -2633,13 +2633,10 @@ export class ImprisonTag extends MoveRestrictionBattlerTag {
|
||||
/**
|
||||
* Helper function that retrieves the source Pokemon object
|
||||
* @param scene medium to retrieve the source Pokemon
|
||||
* @returns source pokemon {@linkcode Pokemon} or undefined
|
||||
* @returns The source {@linkcode Pokemon} or `null` if none is found
|
||||
*/
|
||||
private retrieveSource(scene: BattleScene): Pokemon | undefined {
|
||||
if (this.sourceId) {
|
||||
return scene.getPokemonById(this.sourceId) ?? undefined;
|
||||
}
|
||||
return undefined;
|
||||
private retrieveSource(scene: BattleScene): Pokemon | null {
|
||||
return this.sourceId ? scene.getPokemonById(this.sourceId) : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user