Add MissingNo.

This commit is contained in:
Dragon Fire
2020-03-23 14:27:13 -04:00
parent 57e590d2dd
commit 8c27d55d55
5 changed files with 38 additions and 2 deletions
+4
View File
@@ -9,6 +9,7 @@ module.exports = class Pokemon {
.map(entry => entry.flavor_text.replace(/\n|\f|\r/g, ' ')));
this.names = data.names.map(entry => ({ name: entry.name, language: entry.language.name }));
this.genus = `The ${data.genera.filter(entry => entry.language.name === 'en')[0].genus}`;
this.missingno = data.missingno || false;
}
get displayID() {
@@ -20,14 +21,17 @@ module.exports = class Pokemon {
}
get spriteImageURL() {
if (this.missingno) return 'https://cdn.bulbagarden.net/upload/9/98/Missingno_RB.png';
return `https://www.serebii.net/sunmoon/pokemon/${this.displayID}.png`;
}
get boxImageURL() {
if (this.missingno) return 'https://cdn.bulbagarden.net/upload/1/1f/AniMS_Missingno_I.png';
return `https://www.serebii.net/pokedex-sm/icon/${this.displayID}.png`;
}
get serebiiURL() {
if (this.missingno) return 'https://bulbapedia.bulbagarden.net/wiki/MissingNo.';
return `https://www.serebii.net/pokedex-sm/${this.displayID}.shtml`;
}
};