Skip to content

Commit ca1a752

Browse files
author
github-actions-bot
committed
Fix the Pikachu forms' images
1 parent e8975d1 commit ca1a752

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

plugins/pokedex-data-plugin/dex/functions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const getPokemonFormIndexById = (monsno, id, mode = GAMEDATA2) => {
3838
const ModeFormMap = FORM_MAP[mode];
3939
const formNo = ModeFormMap[monsno].findIndex((pokemonId) => pokemonId === id);
4040
if (mode === GAMEDATA2 && monsno === 25) {
41-
const mapped_form_no = LUMI_TO_RELUMI_PIKACHU_FORMS[formNo]
41+
const mapped_form_no = LUMI_TO_RELUMI_PIKACHU_FORMS[formNo];
4242
if (mapped_form_no !== undefined) return mapped_form_no;
4343
}
4444
return formNo;

plugins/pokedex-data-plugin/dex/moves.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ function searchForMovesOnPokemon(moveId = 0, mode = GAMEDATA2) {
390390
return Object.values(FORM_MAP[mode])
391391
.flat()
392392
.slice(1)
393+
.filter(id => id !== -1)
393394
.map((id) => {
394395
// This is a map and not a filter because
395396
// we want to return which method(s) a pokemon can learn a move

plugins/pokedex-data-plugin/dex/name.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const {
66
GAMEDATA3,
77
GAMEDATAV,
88
} = require('../../../__gamedata');
9-
const { START_OF_LINE_FORMS, END_OF_LINE_FORMS, REVERSE_ORDER_ARRAY } = require('./nameConstants')
9+
const { START_OF_LINE_FORMS, END_OF_LINE_FORMS, REVERSE_ORDER_ARRAY, LUMI_TO_RELUMI_PIKACHU_FORMS } = require('./nameConstants')
1010
const { FORM_MAP } = require('./functions');
1111

1212
const POKEMON_NAME_MAPV = PersonalTable[GAMEDATAV].Personal.reduce((pokemonNameMap, currentPokemon) => {
@@ -194,8 +194,12 @@ function getPokemonMonsNoAndFormNoFromPokemonId(pokemonId = 0, mode = GAMEDATA2)
194194
const MODE_FORM_MAP = FORM_MAP[mode];
195195

196196
const { monsno } = ModePersonalTable.Personal[pokemonId];
197-
const formno = MODE_FORM_MAP[monsno].indexOf(pokemonId);
198-
return [monsno, formno];
197+
const formNo = MODE_FORM_MAP[monsno].findIndex((id) => pokemonId === id);
198+
if (mode === GAMEDATA2 && monsno === 25) {
199+
const mapped_form_no = LUMI_TO_RELUMI_PIKACHU_FORMS[formNo];
200+
if (mapped_form_no !== undefined) return [monsno, mapped_form_no];
201+
}
202+
return [monsno, formNo];
199203
}
200204

201205
module.exports = {

src/utils/dex/functions.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ function createFormMap(formMap, currentPokemon) {
1212
formMap[currentPokemon.monsno] = [];
1313
}
1414

15-
formMap[currentPokemon.monsno].push(currentPokemon.id);
15+
const isValid = currentPokemon.valid_flag;
16+
17+
if (isValid === 1) {
18+
formMap[currentPokemon.monsno].push(currentPokemon.id);
19+
} else {
20+
formMap[currentPokemon.monsno].push(-1);
21+
}
1622
return formMap;
1723
}
1824

0 commit comments

Comments
 (0)