More Scarlet/Violet support

This commit is contained in:
Dragon Fire
2024-03-25 01:03:43 -04:00
parent f1e311cfae
commit 77ad98cc8e
4 changed files with 15 additions and 10 deletions
+3 -1
View File
@@ -28,5 +28,7 @@
"ultra-sun": "Ultra Sun",
"ultra-moon": "Ultra Moon",
"sword": "Sword",
"shield": "Shield"
"shield": "Shield",
"scarlet": "Scarlet",
"violet": "Violet"
}
+2 -1
View File
@@ -3,7 +3,8 @@ const { MessageEmbed } = require('discord.js');
const versions = {
'red-blue': 'Red and Blue',
'ultra-sun-ultra-moon': 'Ultra Sun and Ultra Moon',
'sword-shield': 'Sword and Shield'
'sword-shield': 'Sword and Shield',
'scarlet-violet': 'Scarlet and Violet'
};
module.exports = class PokedexMovesetCommand extends Command {
+1 -1
View File
@@ -80,7 +80,7 @@ module.exports = class PokedexCommand extends Command {
pokemon.serebiiURL
)
.setThumbnail(pokemon.formSpriteImageURL(variety.id))
.addField(` Base Stats (${variety.name || 'Base'} Form)`, stripIndents`
.addField(` Base Stats (${variety.name || 'Normal'} Form)`, stripIndents`
\`HP: [${'█'.repeat(repeat.hp)}${' '.repeat(20 - repeat.hp)}]\` **${variety.stats.hp}**
\`Attack: [${'█'.repeat(repeat.atk)}${' '.repeat(20 - repeat.atk)}]\` **${variety.stats.atk}**
\`Defense: [${'█'.repeat(repeat.def)}${' '.repeat(20 - repeat.def)}]\` **${variety.stats.def}**
+9 -7
View File
@@ -203,7 +203,9 @@ module.exports = class Pokemon {
defaultVariety.gameDataCached = true;
const inSwordShield = defaultBody.moves
.some(move => move.version_group_details.some(mve => mve.version_group.name === 'sword-shield'));
this.moveSetVersion = inSwordShield ? 'sword-shield' : 'ultra-sun-ultra-moon';
const inScarletViolet = defaultBody.moves
.some(move => move.version_group_details.some(mve => mve.version_group.name === 'scarlet-violet'));
this.moveSetVersion = inScarletViolet ? 'scarlet-violet' : inSwordShield ? 'sword-shield' : 'ultra-sun-ultra-moon';
this.height = defaultBody.height * 3.94;
this.weight = defaultBody.weight * 0.2205;
this.encountersURL = defaultBody.location_area_encounters;
@@ -230,12 +232,12 @@ module.exports = class Pokemon {
spd: body.stats.find(stat => stat.stat.name === 'speed').base_stat
};
const baseStats = defaultVariety.stats;
variety.statsDiffer = baseStats.hp !== variety.stats.hp
|| baseStats.atk !== variety.stats.atk
|| baseStats.def !== variety.stats.def
|| baseStats.sAtk !== variety.stats.sAtk
|| baseStats.sDef !== variety.stats.sDef
|| baseStats.spd !== variety.stats.spd;
variety.statsDiffer = !(baseStats.hp === variety.stats.hp
&& baseStats.atk === variety.stats.atk
&& baseStats.def === variety.stats.def
&& baseStats.sAtk === variety.stats.sAtk
&& baseStats.sDef === variety.stats.sDef
&& baseStats.spd === variety.stats.spd);
for (const ability of body.abilities) {
const abilityData = await this.store.abilities.fetch(ability.ability.name);
variety.abilities.push(abilityData);