From 77b8f97dee1b3c7e682f06b5ca5c4cda6ea11558 Mon Sep 17 00:00:00 2001 From: Luc Date: Wed, 8 May 2024 20:31:43 -0400 Subject: [PATCH] added comments & documentation --- src/data/move.ts | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index f4cb0ed2f..65304dbbf 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1206,7 +1206,14 @@ export class EatBerryAttr extends MoveEffectAttr { super(true, MoveEffectTrigger.HIT); this.chosenBerry = undefined; } - +/** + * Cut's the user's Max HP in half and displays the appropriate recoil message + * @param {Pokemon} user Pokemon that used the move + * @param {Pokemon} target Pokemon that is + * @param {Move} move Move with this attribute + * @param {any[]} args N/A + * @returns {boolean} true if the function succeeds + */ apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { if (!super.apply(user, target, move, args)) return false; @@ -1238,12 +1245,22 @@ export class EatBerryAttr extends MoveEffectAttr { } } - +/** + * Attribute used for moves that steal a random berry from the target. The user then eats the stolen berry. + * Used for Pluck & Bug Bite. + */ export class StealEatBerryAttr extends EatBerryAttr { constructor() { super(); } - +/** + * User steals a random berry from the target and then eats it. + * @param {Pokemon} user Pokemon that used the move and will eat the stolen berry + * @param {Pokemon} target Pokemon that will have its berry stolen + * @param {Move} move Move with this attribute + * @param {any[]} args N/A + * @returns {boolean} true if the function succeeds + */ apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { const cancelled = new Utils.BooleanHolder(false);