Commit Graph

33 Commits

Author SHA1 Message Date
Kirk Scheibelhut
6d7bf4e202 Improve battleOnly forme handling in set-import
With this change we no longer make requests to Smogon for battle
only formes (as they just get duped to their base forme), instead we
try to pull out sets for the battle-only forme based on their bases.
This also more gracefully handles the Zygarde/Necrozma edge case.
2020-05-03 23:02:10 -07:00
Kirk Scheibelhut
4754076efa Update for @pokemon-showdown/sets v0.4.0
- updates smogon package dependency to the latest version
- make sure no old artifacts are left around from previous runs
- revert change from 7aa42b12: for whatever reason we do encounter
instances where `typeof species.battleOnly !== 'string'` and
`throw`-ing means no sets get output.
2020-05-03 13:24:25 -07:00
Guangcong Luo
56f6ab5489 Fix Zygarde-Complete validation 2020-05-01 13:02:30 -07:00
Guangcong Luo
7aa42b1212 Remove Dex.getOutOfBattleSpecies
Literally every current use is a bug.
2020-04-30 23:29:20 -07:00
Guangcong Luo
f6f4467265 Turn on prefer-const for .js files
Not having prefer-const on the JS side makes JS -> TS refactors really
unreadable. This commit just auto-fixes it so we're using
`prefer-const` everywhere.
2020-04-23 11:37:47 -07:00
Guangcong Luo
a049d85a98 Fix build errors from TypeScript update
I'm not entirely sure why these two errors are cropping up now, but
they are.

The "thenable" one seems to be a bug, but in what?
2020-04-17 23:00:28 -07:00
Kirk Scheibelhut
50a6b4c967 Fix long ling in set-import/importer.ts 2020-04-01 20:01:43 -07:00
Kirk Scheibelhut
59bcdab260 Update deps to get newest smogon for set-import 2020-04-01 20:00:36 -07:00
Kris Johnson
994fc60aed
Rename Template to Species (#6478) 2020-03-25 23:29:27 -07:00
Guangcong Luo
62f432c6c3 Fix build error 2020-03-17 19:49:13 -07:00
Kirk Scheibelhut
86d3cc1174 Fix handling of missing format/level in sets 2020-03-17 15:03:43 -07:00
Kris Johnson
83ebdb27da
Add Dex#getOutOfBattleSpecies (#6463) 2020-03-16 20:31:38 +04:00
Guangcong Luo
64ff1da81f Refactor more things to use inheritsFrom 2020-03-10 09:59:36 -07:00
Kirk Scheibelhut
36b5b48d79 Add Gen 8 support for RandomPlayerAI and sim tools
- add support to the RandomPlayerAI for Dynamaxing
 - add support to ExhaustiveRunner for Gigantamax Pokemon
 - simplify range logic in RandomPlayerAPI
 - handle crash from toID (needed by data/scripts.js) and Config
	(needed if a Battle takes long enough to potentially allow for
	requesting ties) globals not being defined
 - mark Gen 8 formats as runnable by the runners
2020-03-08 20:56:59 -07:00
Guangcong Luo
647ba61a46 Turn on prefer-regex-exec in eslint 2020-03-07 13:39:02 -08:00
Guangcong Luo
125fe31d06 Improve eslintrc
Fixed some more code style, allowing these rules to be enabled:

- `comma-dangle`
- `function-paren-newline`
- `member-delimiter-style`
- `no-eval`
- `no-fallthrough`
- `no-misused-promises`
- `no-unused-vars`
- `operator-linebreak`
2020-03-06 22:35:55 -08:00
Guangcong Luo
2f0e83c14b Categorize eslintrc rules
eslintrc rules are now sorted into categories, in theory making them
easier to maintain.
2020-03-06 22:35:45 -08:00
Guangcong Luo
b21c9047e2
Migrate to typescript-eslint (#6342) 2020-03-05 08:33:06 -08:00
Kirk Scheibelhut
f3b666cc8c Use latestDate to simplify tools/set-import
The STATISTICS map was out of date anyway, this moves maintaining it
to the smogon package (which now has logic for updating it in an
automated way).
2020-03-02 17:47:39 -08:00
Kirk Scheibelhut
738fdc9c46 Update deps to get newest smogon for set-import 2020-03-02 16:31:59 -08:00
Kirk Scheibelhut
fdf5679a24 Update set-import stats to use latest stats logic
smogon@0.2.0 now supports the qualified naming transition period
at the end of Gen 6.
2020-02-27 17:00:40 -08:00
Kirk Scheibelhut
df8a7df29e Fix tools/set-import/stats and update for Gen 8 2020-02-26 10:16:42 -08:00
Kirk Scheibelhut
7bf4c01440 Zero sub-versions in set-import on version bump 2020-02-25 14:59:58 -08:00
Kirk Scheibelhut
37a331a4cb Get tools/set-import to work again
- a scripts.js init() method now calls toID
- Smogon updated the format of moveslots
2020-02-25 14:49:38 -08:00
Spandan Punwatkar
b6b66de896 Update Repo Links (#6102) 2019-11-28 12:47:38 +04:00
Kirk Scheibelhut
71bc4d5c05 Update tools/set-import for Gen 8 2019-11-25 15:32:12 -08:00
Kirk Scheibelhut
bfc0b0d75d Fix typos in set-import docs 2019-09-20 12:55:17 -07:00
Kirk Scheibelhut
c8b7f515fd Add an explicit LICENSE file to sets package 2019-09-20 12:37:42 -07:00
Kirk Scheibelhut
19d768e00e Fix mistakes from #5749
- and error 'ls' found its way into the source
- the sets/{README.md,index.d.ts} were excluded which also meant
  the sets/ directory didn't exist, causing errors
- the command is `npm publish --access public` not `publish`
2019-09-10 21:16:49 -07:00
Kirk Scheibelhut
b9e5fcb387
Introduce set importer logic (#5749)
`node tools/set-import [version]` can be run to create a
`@pokemon-showdown/sets` package containing sets from Smogon, usage
stats and third party sources. Some notes:

- The build is set up so that `tools/set-import/importer.ts` is
  compiled to `tools/set-import/importer.js` - creating a
  `.tools-dist/set-import` directory for the sole artifact was
  deemed to be overkill
- The sets package is generated such that it can be used easily on
  Node or in a browser (where the large set JSON can be loaded
  asynchronously)
- Supported tiers/formats are mostly arbitrary - those popular
  enough to have a signficant playerbase or analyses on Smogon have
  been included, but additional formats can be added based on demand
- Some set information is redundant for ease of use by downstream
  users: certain formes are split out and information that could
  theoretically be inferred like level/ability/HP IVs are included
  to simplify parsing logic and make the sets more immediately
  available. This results in what should mostly be negligible
  size overhead.
- In a similar vein, display versions of effect names instead of IDs
  are used (name -> ID is trivial, ID -> name requires data lookup)
- All sets pass validation, provided certain simple transformations
  are applied (eg. reverting `battleOnly` formes like Megas)

This tool has primarily been tested to run on Linux - running on
other platforms is not guaranteed to result in error-free output.
2019-09-10 21:15:05 -04:00
Guangcong Luo
7436c1f0f2 Remove import = and export =
`import =` and `export =` are really only intended for backwards
compatibility with CommonJS. While I really don't like the new module
system TC39 has designed for us, it's what we should be using, and
consistency is important.
2019-05-16 01:27:07 +04:00
Kirk Scheibelhut
df3d9b91ef Battle toJSON/fromJSON (#5427) 2019-04-30 14:48:27 +12:00
Kirk Scheibelhut
4975f1902b Move simulator harness to sim/tools (#5451) 2019-04-18 04:17:07 +09:30