From a55fdc2a2211f40e0775cbf18623f8334ab0b65d Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Thu, 3 Dec 2020 10:50:40 -0500 Subject: [PATCH] Add base stat total --- commands/search/pokedex.js | 1 + structures/pokemon/Pokemon.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/commands/search/pokedex.js b/commands/search/pokedex.js index a0caad00..167e3baf 100644 --- a/commands/search/pokedex.js +++ b/commands/search/pokedex.js @@ -102,6 +102,7 @@ module.exports = class PokedexCommand extends Command { \`Sp. Attack: [${'█'.repeat(repeat.sAtk)}${' '.repeat(20 - repeat.sAtk)}]\` **${data.stats.sAtk}** \`Sp. Defense: [${'█'.repeat(repeat.sDef)}${' '.repeat(20 - repeat.sDef)}]\` **${data.stats.sDef}** \`Speed: [${'█'.repeat(repeat.spd)}${' '.repeat(20 - repeat.spd)}]\` **${data.stats.spd}** + **Total: ${data.baseStatTotal}** `) .addField('❯ Abilities', data.abilities.join(' / ')); if (data.cry) { diff --git a/structures/pokemon/Pokemon.js b/structures/pokemon/Pokemon.js index 775a4685..a2adbd16 100644 --- a/structures/pokemon/Pokemon.js +++ b/structures/pokemon/Pokemon.js @@ -45,6 +45,11 @@ module.exports = class Pokemon { : path.join(__dirname, '..', '..', 'assets', 'sounds', 'pokedex', `${data.id}.wav`); } + get baseStatTotal() { + if (!this.stats) return null; + return this.stats.hp + this.stats.atk + this.stats.def + this.stats.sAtk + this.stats.sDef + this.stats.spd; + } + get displayID() { if (this.missingno) return '???'; return this.id.toString().padStart(3, '0');