From 8f576b3298d61c738a8cf57bd6f21319cc2c4764 Mon Sep 17 00:00:00 2001 From: Benjamin Odom Date: Sun, 19 May 2024 10:34:58 -0500 Subject: [PATCH] Update ability.ts --- src/data/ability.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/data/ability.ts b/src/data/ability.ts index 54b7858e887..b5e4a91a11c 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2277,10 +2277,21 @@ export class PostTurnFormChangeAbAttr extends PostTurnAbAttr { } } +/** + * Grabs the last failed Pokeball used + * @extends PostTurnAbAttr + * @see {@linkcode applyPostTurn} */ export class FetchBallAbAttr extends PostTurnAbAttr { constructor() { super(); } + /** + * Adds the last used Pokeball back into the player's inventory + * @param pokemon {@linkcode Pokemon} with this ability + * @param passive N/A + * @param args N/A + * @returns true if player has used a pokeball and this pokemon is owned by the player + */ applyPostTurn(pokemon: Pokemon, passive: boolean, args: any[]): boolean { let lastUsed = pokemon.scene.currentBattle.lastUsedPokeball; if(lastUsed != null && pokemon.isPlayer) {