From 9f4aa492894c4a1c7a6cf221becc437105243f40 Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Mon, 13 May 2024 14:38:38 +0100 Subject: [PATCH] Added documentation for getStat and changeSummonStat methods --- src/field/pokemon.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 99ef623609c..a4c74c570ab 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -544,6 +544,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { }); } + /** + * Returns the value of the specified stat. Depending on whether the pokemon has been summoned or not, it may use the base stats or the current stats. + * @param {Stat} stat Stat to get the value of. + * @returns {integer} Returns the value of the stat. If the pokemon is already summoned, it uses those values, otherwise uses the base stats. + */ getStat(stat: Stat): integer { if (!this.summonData) { return this.stats[stat]; @@ -1707,6 +1712,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return healAmount; } + /** + * Sets a specific stat to a specific value. Used for summon data, while the pokemon is out until the next time it is retrieved. + * @param {Stat} stat Stat to change. + * @param {integer} value Amount to set the stat to. + */ changeSummonStat(stat: Stat, value: integer) : void { this.summonData.stats[stat] = value; }