mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-14 12:22:19 +02:00
Added documentation for getStat and changeSummonStat methods
This commit is contained in:
parent
ffc9262aa2
commit
9f4aa49289
@ -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 {
|
getStat(stat: Stat): integer {
|
||||||
if (!this.summonData) {
|
if (!this.summonData) {
|
||||||
return this.stats[stat];
|
return this.stats[stat];
|
||||||
@ -1707,6 +1712,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
return healAmount;
|
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 {
|
changeSummonStat(stat: Stat, value: integer) : void {
|
||||||
this.summonData.stats[stat] = value;
|
this.summonData.stats[stat] = value;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user