Get tools/set-import to work again

- a scripts.js init() method now calls toID
- Smogon updated the format of moveslots
This commit is contained in:
Kirk Scheibelhut 2020-02-25 14:49:31 -08:00
parent 26fa367f75
commit 37a331a4cb
4 changed files with 5 additions and 3 deletions

2
build
View File

@ -72,7 +72,7 @@ replace(path.join(__dirname, '.sim-dist'), [
replace(path.join(__dirname, '.server-dist'), [
{regex: new RegExp(`(require\\\(.*?)(lib|sim)(.*?\\\))`, 'g'), replace: `$1.$2-dist$3`},
]);
replace(path.join(__dirname, './tools/set-import'), [
replace(path.join(__dirname, './tools/set-import/importer.js'), [
{regex: new RegExp(`(require\\\(.*?)(lib|sim)(.*?\\\))`, 'g'), replace: `$1.$2-dist$3`},
]);

View File

@ -69,7 +69,7 @@
"eslint": "^6.8.0",
"husky": "^4.2.1",
"mocha": "^7.0.1",
"smogon": "^0.0.5",
"smogon": "^0.1.0",
"tslint": "^6.0.0",
"typescript": "^3.7.5"
}

View File

@ -245,7 +245,7 @@ function movesetToPokemonSet(dex: ModdedDex, format: Format, pokemon: string, se
const level = getLevel(format, set.level);
return {
level: level === 100 ? undefined : level,
moves: set.moveslots.map(ms => ms[0]),
moves: set.moveslots.map(ms => ms[0]).map(s => s.type ? `${s.move} ${s.type}` : s.move),
ability: fixedAbility(dex, pokemon, set.abilities[0]),
item: set.items[0] === 'No Item' ? undefined : set.items[0],
nature: set.natures[0],

View File

@ -56,6 +56,8 @@ Chat.plural = function (num, plural = 's', singular = '') {
}
return (num !== 1 ? plural : singular);
};
// Sigh. Yay globals!
global.toID = require('../../.sim-dist/dex').Dex.getId;
const importer = require('./importer.js');