mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-16 05:12:19 +02:00
Adding doc comments based on new standard
This commit is contained in:
parent
9ca01fc3b8
commit
e5964743aa
@ -2254,19 +2254,48 @@ export class RunSuccessAbAttr extends AbAttr {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Base class for checking if a Pokemon is trapped by arena trap
|
||||
* @extends AbAttr
|
||||
* @see {@linkcode applyCheckTrapped}
|
||||
*/
|
||||
export class CheckTrappedAbAttr extends AbAttr {
|
||||
constructor() {
|
||||
super(false);
|
||||
}
|
||||
|
||||
applyCheckTrapped(pokemon: Pokemon, passive: boolean, trapped: Utils.BooleanHolder, otherPokemon: Pokemon[], args: any[]): boolean | Promise<boolean> {
|
||||
/**
|
||||
* Checks if enemy Pokemon is trapped by an Arena Trap-esque ability
|
||||
* @param pokemon N/A
|
||||
* @param passive N/A
|
||||
* @param trapped N/A
|
||||
* @param otherPokemon N/A
|
||||
* @param args N/A
|
||||
* @returns if enemy Pokemon is trapped or not
|
||||
*/
|
||||
applyCheckTrapped(pokemon: Pokemon, passive: boolean, trapped: Utils.BooleanHolder, otherPokemon: Pokemon, args: any[]): boolean | Promise<boolean> {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determines whether a Pokemon is blocked from switching/running away
|
||||
* because of a trapping ability or move.
|
||||
* @extends CheckTrappedAbAttr
|
||||
* @see {@linkcode applyCheckTrapped}
|
||||
*/
|
||||
export class ArenaTrapAbAttr extends CheckTrappedAbAttr {
|
||||
applyCheckTrapped(pokemon: Pokemon, passive: boolean, trapped: Utils.BooleanHolder, otherPokemon: Pokemon[], args: any[]): boolean {
|
||||
if (otherPokemon[0].getTypes().includes(Type.GHOST)){
|
||||
/**
|
||||
* Checks if enemy Pokemon is trapped by an Arena Trap-esque ability
|
||||
* @param pokemon The {@link Pokemon} with this {@link AbAttr}
|
||||
* @param passive N/A
|
||||
* @param trapped {@link Utils.BooleanHolder} indicating whether the other Pokemon is trapped or not
|
||||
* @param otherPokemon The {@link Pokemon} that is affected by an Arena Trap ability
|
||||
* @param args N/A
|
||||
* @returns if enemy Pokemon is trapped or not
|
||||
*/
|
||||
applyCheckTrapped(pokemon: Pokemon, passive: boolean, trapped: Utils.BooleanHolder, otherPokemon: Pokemon, args: any[]): boolean {
|
||||
if (otherPokemon.getTypes().includes(Type.GHOST)){
|
||||
trapped.value = false;
|
||||
return false;
|
||||
}
|
||||
@ -2735,8 +2764,8 @@ export function applyPostTerrainChangeAbAttrs(attrType: { new(...args: any[]): P
|
||||
}
|
||||
|
||||
export function applyCheckTrappedAbAttrs(attrType: { new(...args: any[]): CheckTrappedAbAttr },
|
||||
pokemon: Pokemon, trapped: Utils.BooleanHolder, ...args: any[]): Promise<void> {
|
||||
return applyAbAttrsInternal<CheckTrappedAbAttr>(attrType, pokemon, (attr, passive) => attr.applyCheckTrapped(pokemon, passive, trapped, args), args, true);
|
||||
pokemon: Pokemon, trapped: Utils.BooleanHolder, otherPokemon: Pokemon, ...args: any[]): Promise<void> {
|
||||
return applyAbAttrsInternal<CheckTrappedAbAttr>(attrType, pokemon, (attr, passive) => attr.applyCheckTrapped(pokemon, passive, trapped, otherPokemon, args), args, true);
|
||||
}
|
||||
|
||||
export function applyPostBattleAbAttrs(attrType: { new(...args: any[]): PostBattleAbAttr },
|
||||
|
Loading…
Reference in New Issue
Block a user