@pkmn/sim 0.8.9 → 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.
- package/README.md +33 -1
- package/build/cjs/config/formats.js +46 -532
- package/build/cjs/config/formats.js.map +1 -1
- package/build/cjs/data/formats-data.js +11 -11
- package/build/cjs/data/formats-data.js.map +1 -1
- package/build/cjs/data/pokedex.js +18 -18
- package/build/cjs/data/pokedex.js.map +1 -1
- package/build/cjs/data/rulesets.js +0 -1
- package/build/cjs/data/rulesets.js.map +1 -1
- package/build/cjs/sim/battle-stream.d.ts +3 -2
- package/build/cjs/sim/battle-stream.js +4 -2
- package/build/cjs/sim/battle-stream.js.map +1 -1
- package/build/cjs/sim/battle.d.ts +1 -1
- package/build/cjs/sim/battle.js +4 -4
- package/build/cjs/sim/battle.js.map +1 -1
- package/build/cjs/sim/dex-formats.d.ts +2 -0
- package/build/cjs/sim/dex-formats.js +12 -6
- package/build/cjs/sim/dex-formats.js.map +1 -1
- package/build/cjs/sim/dex.d.ts +4 -2
- package/build/cjs/sim/dex.js +2 -0
- package/build/cjs/sim/dex.js.map +1 -1
- package/build/esm/config/formats.mjs +46 -532
- package/build/esm/config/formats.mjs.map +1 -1
- package/build/esm/data/formats-data.mjs +11 -11
- package/build/esm/data/formats-data.mjs.map +1 -1
- package/build/esm/data/pokedex.mjs +18 -18
- package/build/esm/data/pokedex.mjs.map +1 -1
- package/build/esm/data/rulesets.mjs +0 -1
- package/build/esm/data/rulesets.mjs.map +1 -1
- package/build/esm/sim/battle-stream.d.mts +3 -2
- package/build/esm/sim/battle-stream.mjs +4 -2
- package/build/esm/sim/battle-stream.mjs.map +1 -1
- package/build/esm/sim/battle.d.mts +1 -1
- package/build/esm/sim/battle.mjs +4 -4
- package/build/esm/sim/battle.mjs.map +1 -1
- package/build/esm/sim/dex-formats.d.mts +2 -0
- package/build/esm/sim/dex-formats.mjs +12 -6
- package/build/esm/sim/dex-formats.mjs.map +1 -1
- package/build/esm/sim/dex.d.mts +4 -2
- package/build/esm/sim/dex.mjs +2 -0
- package/build/esm/sim/dex.mjs.map +1 -1
- package/package.json +2 -2
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
|
|
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
|