@pkmn/sim 0.8.8 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +33 -1
  2. package/build/cjs/config/formats.js +178 -596
  3. package/build/cjs/config/formats.js.map +1 -1
  4. package/build/cjs/data/abilities.js +1 -1
  5. package/build/cjs/data/abilities.js.map +1 -1
  6. package/build/cjs/data/aliases.js +2 -2
  7. package/build/cjs/data/aliases.js.map +1 -1
  8. package/build/cjs/data/formats-data.js +126 -126
  9. package/build/cjs/data/formats-data.js.map +1 -1
  10. package/build/cjs/data/learnsets.js +3 -0
  11. package/build/cjs/data/learnsets.js.map +1 -1
  12. package/build/cjs/data/mods/gen2/formats-data.js +2 -2
  13. package/build/cjs/data/mods/gen2/formats-data.js.map +1 -1
  14. package/build/cjs/data/mods/gen3/abilities.js +9 -0
  15. package/build/cjs/data/mods/gen3/abilities.js.map +1 -1
  16. package/build/cjs/data/mods/gen5/formats-data.js +110 -129
  17. package/build/cjs/data/mods/gen5/formats-data.js.map +1 -1
  18. package/build/cjs/data/mods/gen8/moves.js +1 -9
  19. package/build/cjs/data/mods/gen8/moves.js.map +1 -1
  20. package/build/cjs/data/moves.js +40 -11
  21. package/build/cjs/data/moves.js.map +1 -1
  22. package/build/cjs/data/pokedex.js +18 -18
  23. package/build/cjs/data/pokedex.js.map +1 -1
  24. package/build/cjs/data/rulesets.js +0 -1
  25. package/build/cjs/data/rulesets.js.map +1 -1
  26. package/build/cjs/sim/battle-actions.js +2 -1
  27. package/build/cjs/sim/battle-actions.js.map +1 -1
  28. package/build/cjs/sim/battle-stream.d.ts +3 -2
  29. package/build/cjs/sim/battle-stream.js +4 -2
  30. package/build/cjs/sim/battle-stream.js.map +1 -1
  31. package/build/cjs/sim/battle.d.ts +1 -1
  32. package/build/cjs/sim/battle.js +4 -4
  33. package/build/cjs/sim/battle.js.map +1 -1
  34. package/build/cjs/sim/dex-formats.d.ts +2 -0
  35. package/build/cjs/sim/dex-formats.js +12 -6
  36. package/build/cjs/sim/dex-formats.js.map +1 -1
  37. package/build/cjs/sim/dex-moves.d.ts +2 -0
  38. package/build/cjs/sim/dex-moves.js.map +1 -1
  39. package/build/cjs/sim/dex.d.ts +4 -2
  40. package/build/cjs/sim/dex.js +2 -0
  41. package/build/cjs/sim/dex.js.map +1 -1
  42. package/build/esm/config/formats.mjs +178 -596
  43. package/build/esm/config/formats.mjs.map +1 -1
  44. package/build/esm/data/abilities.mjs +1 -1
  45. package/build/esm/data/abilities.mjs.map +1 -1
  46. package/build/esm/data/aliases.mjs +2 -2
  47. package/build/esm/data/aliases.mjs.map +1 -1
  48. package/build/esm/data/formats-data.mjs +126 -126
  49. package/build/esm/data/formats-data.mjs.map +1 -1
  50. package/build/esm/data/learnsets.mjs +3 -0
  51. package/build/esm/data/learnsets.mjs.map +1 -1
  52. package/build/esm/data/mods/gen2/formats-data.mjs +2 -2
  53. package/build/esm/data/mods/gen2/formats-data.mjs.map +1 -1
  54. package/build/esm/data/mods/gen3/abilities.mjs +9 -0
  55. package/build/esm/data/mods/gen3/abilities.mjs.map +1 -1
  56. package/build/esm/data/mods/gen5/formats-data.mjs +110 -129
  57. package/build/esm/data/mods/gen5/formats-data.mjs.map +1 -1
  58. package/build/esm/data/mods/gen8/moves.mjs +1 -9
  59. package/build/esm/data/mods/gen8/moves.mjs.map +1 -1
  60. package/build/esm/data/moves.mjs +40 -11
  61. package/build/esm/data/moves.mjs.map +1 -1
  62. package/build/esm/data/pokedex.mjs +18 -18
  63. package/build/esm/data/pokedex.mjs.map +1 -1
  64. package/build/esm/data/rulesets.mjs +0 -1
  65. package/build/esm/data/rulesets.mjs.map +1 -1
  66. package/build/esm/sim/battle-actions.mjs +2 -1
  67. package/build/esm/sim/battle-actions.mjs.map +1 -1
  68. package/build/esm/sim/battle-stream.d.mts +3 -2
  69. package/build/esm/sim/battle-stream.mjs +4 -2
  70. package/build/esm/sim/battle-stream.mjs.map +1 -1
  71. package/build/esm/sim/battle.d.mts +1 -1
  72. package/build/esm/sim/battle.mjs +4 -4
  73. package/build/esm/sim/battle.mjs.map +1 -1
  74. package/build/esm/sim/dex-formats.d.mts +2 -0
  75. package/build/esm/sim/dex-formats.mjs +12 -6
  76. package/build/esm/sim/dex-formats.mjs.map +1 -1
  77. package/build/esm/sim/dex-moves.d.mts +2 -0
  78. package/build/esm/sim/dex-moves.mjs.map +1 -1
  79. package/build/esm/sim/dex.d.mts +4 -2
  80. package/build/esm/sim/dex.mjs +2 -0
  81. package/build/esm/sim/dex.mjs.map +1 -1
  82. package/package.json +3 -3
package/README.md CHANGED
@@ -93,7 +93,7 @@ Pokémon Showdown's `sim/` directory has been modified in the following ways:
93
93
  - **only Gens 1 - 9 are supported, no other mods**. Generation 9 as the `base` mod is supported as
94
94
  with Pokémon Showdown, but after that only the canconical `genN` mods are supported (no Stadium,
95
95
  Let's Go, or pet mods). However, the [`@pkmn/mods`](../mods) package provides the information
96
- required for additional formats, and support for Other Metagames can be acheived with the modified
96
+ required for additional formats, and support for Other Metagames can be achieved with the modified
97
97
  `Dex#mod` method. The `Dex#mod` and `Dex.forGen` methods will `throw` if an unsupported mod/gen is
98
98
  requested. A `Dex#modid` method has also been added which returns the current mod applied to the
99
99
  `Dex`.
@@ -129,6 +129,38 @@ Pokémon Showdown's `sim/` directory has been modified in the following ways:
129
129
  (the simulator expects `'move:<ID>'`, where the client allows for `'move: <Name>'`) and the
130
130
  returned object's ID is actually a legal ID (the simulator returns `'move:<ID>' as ID`).
131
131
 
132
+ ### Formats
133
+
134
+ Pokémon Showdown expects server owners to modify
135
+ [`config/formats.ts`](https://github.com/smogon/pokemon-showdown/blob/master/config/formats.ts) in
136
+ order to configure the formats their simulator supports. **`@pkmn/sim` does not ship the same
137
+ `config/formats.ts` as the upstream `smogon/pokemon-showdown` repository** - `@pkmn/sim` bundles
138
+ stable, popular formats that require no mods, looking to cut down on bundle size and churn. However,
139
+ users may extend the default formats by providing their own:
140
+
141
+
142
+ ```ts
143
+ import {Dex} from '@pkmn/sim';
144
+ import {Formats} from 'myformats.ts';
145
+
146
+ Dex.formats.extend(Formats);
147
+ ```
148
+
149
+ You can copy Pokémon Showdown's formats verbatim by simply fetching the latest formats and saving
150
+ the file locally.
151
+
152
+ ```sh
153
+ $ curl -o myformats.ts https://raw.githubusercontent.com/smogon/pokemon-showdown/master/config/formats.ts
154
+ ```
155
+
156
+ Note that not all of Pokémon Showdown's formats are expected to work out of the box, you may need to
157
+ mod the `Dex` with additional data (including any `Rulesets`). Furthrmore, formats are
158
+ `Dex`-specific, if you mod a `Dex` you must instead call `extend` on that `dex.formats`. Similarly,
159
+ that `dex` then must be passed to whichever object (eg. `Battle`, `BattleStream`, `TeamValidator`,
160
+ etc) needs access to the format. `Dex#mod` will automatically call `extend` if the data provided to
161
+ it includes a `Formats` list.
162
+
163
+
132
164
  ## License
133
165
 
134
166
  Substantial amounts of the code in this package have been either derived or generated from portions