@pkmn/engine 0.1.0-dev.2c13d3ec → 0.1.0-dev.2c426670

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 (56) hide show
  1. package/LICENSE +1 -3
  2. package/README.md +85 -52
  3. package/build/pkg/addon.js +6 -7
  4. package/build/pkg/addon.js.map +1 -1
  5. package/build/pkg/data/ids.json +12 -12
  6. package/build/pkg/data/layout.json +2 -2
  7. package/build/pkg/data/protocol.json +69 -12
  8. package/build/pkg/data.d.ts +4 -4
  9. package/build/pkg/data.js.map +1 -1
  10. package/build/pkg/gen1.js +2 -2
  11. package/build/pkg/gen1.js.map +1 -1
  12. package/build/pkg/index.d.ts +2 -1
  13. package/build/pkg/index.js.map +1 -1
  14. package/build/pkg/protocol.js +61 -42
  15. package/build/pkg/protocol.js.map +1 -1
  16. package/build/test/display.js +8 -3
  17. package/build/test/display.js.map +1 -1
  18. package/build/tools/debug.js +5 -4
  19. package/build/tools/debug.js.map +1 -1
  20. package/build.zig +135 -128
  21. package/package.json +54 -25
  22. package/src/bin/install-pkmn-engine +27 -19
  23. package/src/lib/common/battle.zig +17 -0
  24. package/src/lib/common/data.zig +12 -24
  25. package/src/lib/common/debug.zig +2 -2
  26. package/src/lib/common/js.zig +118 -0
  27. package/src/lib/common/optional.zig +67 -0
  28. package/src/lib/common/options.zig +2 -0
  29. package/src/lib/common/protocol.zig +805 -327
  30. package/src/lib/common/rational.zig +447 -0
  31. package/src/lib/common/rng.zig +26 -17
  32. package/src/lib/common/util.zig +12 -0
  33. package/src/lib/gen1/calc.zig +831 -0
  34. package/src/lib/gen1/chance.zig +994 -0
  35. package/src/lib/gen1/data/moves.zig +192 -180
  36. package/src/lib/gen1/data/species.zig +3 -3
  37. package/src/lib/gen1/data/types.zig +7 -7
  38. package/src/lib/gen1/data.zig +63 -70
  39. package/src/lib/gen1/helpers.zig +87 -395
  40. package/src/lib/gen1/mechanics.zig +571 -544
  41. package/src/lib/gen2/calc.zig +143 -0
  42. package/src/lib/gen2/chance.zig +882 -0
  43. package/src/lib/gen2/data/items.zig +12 -18
  44. package/src/lib/gen2/data/moves.zig +663 -569
  45. package/src/lib/gen2/data/species.zig +1 -1
  46. package/src/lib/gen2/data/types.zig +134 -31
  47. package/src/lib/gen2/data.zig +106 -79
  48. package/src/lib/gen2/generated.zig +806 -0
  49. package/src/lib/gen2/helpers.zig +45 -19
  50. package/src/lib/gen2/mechanics.zig +3560 -9
  51. package/src/lib/{binding/node.zig → node.zig} +10 -13
  52. package/src/lib/pkmn.zig +27 -12
  53. package/src/lib/{binding/wasm.zig → wasm.zig} +2 -1
  54. package/src/test/display/pkmn.html.tmpl +5 -5
  55. package/src/lib/gen1/README.md +0 -814
  56. package/src/lib/gen2/README.md +0 -309
package/LICENSE CHANGED
@@ -1,6 +1,4 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2021-2023 pkmn contributors
1
+ Copyright (c) 2021-2024 pkmn contributors
4
2
 
5
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
4
  this software and associated documentation files (the "Software"), to deal in
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <br />
4
4
  <br />
5
5
  <a href="https://github.com/pkmn/engine/actions/workflows/test.yml">
6
- <img alt="Test Status" src="https://github.com/pkmn/engine/workflows/Tests/badge.svg" />
6
+ <img alt="Test Status" src="https://github.com/pkmn/engine/actions/workflows/test.yml/badge.svg" />
7
7
  </a>
8
8
  <a href="#status">
9
9
  <img alt="WIP" src="https://img.shields.io/badge/status-WIP-red.svg" />
@@ -12,6 +12,14 @@
12
12
  <img alt="License" src="https://img.shields.io/badge/License-MIT-blue.svg" />
13
13
  </a>
14
14
  </p>
15
+
16
+ > [!WARNING]
17
+ > **This project is under heavy development** and currently the `main` branch contains numerous breaking
18
+ > changes which may not work and which are not fully documented. Please **wait for the forthcoming
19
+ > initial v0.1 release** before depending on this project (code from the
20
+ > [`old`](https://github.com/pkmn/engine/releases/tag/old) tag can also be used to experiment with a
21
+ > more stable version of the codebase).
22
+
15
23
  <hr />
16
24
 
17
25
  A minimal, complete, Pokémon battle simulation engine optimized for performance and
@@ -49,9 +57,9 @@ $ zig build --prefix /usr/local -Doptimize=ReleaseFast
49
57
  ```
50
58
 
51
59
  The Zig website has [installation instructions](https://ziglang.org/learn/getting-started/) which
52
- walk through how to install Zig on each platform - the engine code should work on Zig v0.11.0 dev
53
- build 3859 or greater, though tracks Zig's master branch so this may change in the future if
54
- breaking language changes are introduced:
60
+ walk through how to install Zig on each platform - the engine code should work on Zig v0.13.0,
61
+ though tracks Zig's master branch so this may change in the future if breaking language changes are
62
+ introduced.
55
63
 
56
64
  `libpkmn` can be built with `-Dshowdown` to instead produce the Pokémon Showdown compatible
57
65
  `libpkmn-showdown` library. Furthermore, protocol message logging can be enabled through `-Dlog`.
@@ -67,40 +75,65 @@ $ npm install @pkmn/engine
67
75
  ```
68
76
 
69
77
  The driver depends on being able to find compiled Node/WASM addons in
70
- `node_modules/@pkmn/engine/build/lib` in order to be useful. When you install the package a
71
- [`postinstall` lifecycle script](https://docs.npmjs.com/cli/v8/using-npm/scripts) will run
72
- [`install-pkmn-engine`](src/bin/install-pkmn-engine) which will check for a compatible `zig`
73
- compiler (see above regarding minimum version) and download one to
74
- `node_module/@pkmn/engine/build/bin` if it can't find one, as well as looking for (and downloading,
75
- if necessary) the required Node headers needed to successfully build the addons natively.
78
+ `node_modules/@pkmn/engine/build/lib` to be useful. When you install the package a [`postinstall`
79
+ lifecycle script](https://docs.npmjs.com/cli/v8/using-npm/scripts) runs
80
+ [`install-pkmn-engine`](src/bin/install-pkmn-engine) which checks for a compatible `zig` compiler
81
+ (see earlier regarding minimum version) and download one to `node_module/@pkmn/engine/build/bin` if
82
+ it can't find one, as well as looking for (and downloading, if necessary) the required Node headers
83
+ needed to successfully build the addons natively.
76
84
 
77
85
  **If you have configured `npm` to `--ignore-scripts` you must either run `npx install-pkmn-engine`
78
86
  directly or build the addons manually and place the artifacts in the expected paths.**
79
87
 
80
88
  ### `pkmn`
81
89
 
82
- Until the [Zig package manager](https://github.com/ziglang/zig/projects/4) is completed, the
83
- recommended way of using the `pkmn` package in Zig is by either copying this repository into your
84
- project or by using [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) and then
85
- adding the following to your `build.zig`:
90
+ To include `pkmn`, add it as a dependency in your project's
91
+ [`build.zig.zon`](https://github.com/ziglang/zig/blob/master/doc/build.zig.zon.md) using [Zig's
92
+ Package Management
93
+ system](https://ziglang.org/download/0.11.0/release-notes.html#Package-Management):
94
+
95
+
96
+ ```zig
97
+ .dependencies = .{
98
+ .pkmn = .{
99
+ .url = "https://github.com/pkmn/engine/archive/RELEASE.tar.gz",
100
+ },
101
+ },
102
+ ```
103
+
104
+ Replace `RELEASE` with the tag for the [release](https://github.com/pkmn/engine/releases) you wish
105
+ to use (e.g. `0.1.0` or `nightly`) or the specific hash of any commit. Next, run `zig build` and
106
+ copy the expected hash from the error message into your `build.zig.zon` alongside the `.url`:
107
+
108
+ ```sh
109
+ $ zig build
110
+ error: dependency is missing hash field
111
+ .url = "https://github.com/pkmn/engine/archive/nightly.tar.gz",
112
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
113
+ note: expected .hash = "122056b93b403033cb7d9bed96a02c2eb8cc1275515976167726ada6eb4207e8ef8a",
114
+ ```
115
+
116
+ Note that this hash is **not** going to be the same as the commit hash. After adding the hash to
117
+ your `build.zig.zon` you will be able to import the `pkmn` package's build helpers into your
118
+ `build.zig`:
86
119
 
87
120
  ```zig
88
121
  const std = @import("std");
89
- const pkmn = @import("lib/pkmn/build.zig");
90
122
 
91
123
  pub fn build(b: *std.Build) void {
92
124
  ...
93
- exe.addModule("pkmn", pkmn.module(b, .{ .showdown = true, .log = true }));
125
+ const pkmn = b.dependency("pkmn", .{ .showdown = true, .log = true });
126
+ exe.root_module.addImport("pkmn", pkmn.module("pkmn"));
94
127
  ...
95
128
  }
96
129
  ```
97
130
 
98
- The engine's `build.zig` exposes a `module` function that takes an options structure to allow for
99
- configuring whether or not Pokémon Showdown compatibility mode or protocol message logging should be
100
- enabled. Alternatively, you may set options via a `pkmn_options` [root source file
131
+ The `pkmn` package can be configured with various options such as whether or not Pokémon Showdown
132
+ compatibility mode or protocol message logging should be enabled. Alternatively, you may set options
133
+ via a `pkmn_options` [root source file
101
134
  declaration](https://ziglang.org/documentation/master/#Root-Source-File). There are several
102
135
  undocumented internal options that can be tweaked as well via build or root options, though these
103
- options are not officially supported, affect correctness, and may change meaning or behavior without
136
+ options aren't officially supported, affect correctness, and may change meaning or behavior without
104
137
  warning. Use at your own risk.
105
138
 
106
139
  ```zig
@@ -112,11 +145,11 @@ pub const pkmn_options = .{ .showdown = true, .log = true };
112
145
  For each Pokémon generation, the engine provides a battle structure with two functions - a function
113
146
  to `update` the battle's state based on both players' choices and a function that defines which
114
147
  `choices` are valid at that decision point (at the beginning of a battle both player's must "pass"
115
- as their first choice in order to switch in the first member of their party). If `-Dlog` protocol
116
- logging is enabled each update will produce logs which can be decoded into a buffer (`LOGS_SIZE`
117
- constants are provided to make it easy to allocate a buffer of the correct size). Each `update` will
118
- return a result to indicate either that the battle has terminated or which types of choices will be
119
- available for each player.
148
+ as their first choice to switch in the first member of their party). If `-Dlog` protocol logging is
149
+ enabled each update produces logs which can be decoded into a buffer (`LOGS_SIZE` constants are
150
+ provided to make it easy to allocate a buffer of the correct size). Each `update` returns a result
151
+ to indicate either that the battle has terminated or which types of choices are available for each
152
+ player.
120
153
 
121
154
  Unlike [Pokémon Showdown's
122
155
  SIM-PROTOCOL](https://github.com/smogon/pokemon-showdown/blob/master/sim/SIM-PROTOCOL.md#choice-requests)
@@ -128,19 +161,19 @@ state or cause the engine to crash.**
128
161
 
129
162
  Battles may be played out from any point but to freshly initialize a battle which is yet to start
130
163
  the turn count and active Pokémon should be zeroed out (driver code should handle this for you).
131
- Most driver code should also provide helpers to make initialize a battle convenient - check the
164
+ Most driver code should also provide helpers to make initializing battle convenient - check the
132
165
  respective documentation and examples for the bindings being used. The engine's [protocol
133
166
  documentation](docs/PROTOCOL.md) goes into greater detail on the specifics of updates and the
134
167
  potential logs that may result.
135
168
 
136
169
  *The snippets below are meant to merely illustrate in broad strokes how the pkmn engine can be used
137
- \- the [`examples`](src/examples) directory contains fully commented and runnable code.*
170
+ \- the [`examples`](examples) directory contains fully commented and runnable code.*
138
171
 
139
172
  ### C
140
173
 
141
174
  [`pkmn.h`](src/include/pkmn.h) exports the C API for `libpkmn`. Symbols are all prefixed with
142
175
  `pkmn_` to avoid name collisions. If `-Dlog` is enabled and logging throws an error then the error
143
- will be encoded in the `pkmn_result` and can be checked with `pkmn_error`.
176
+ is encoded in the `pkmn_result` and can be checked with `pkmn_error`.
144
177
 
145
178
  ```c
146
179
  #include <pkmn.h>
@@ -159,19 +192,19 @@ while (!pkmn_result_type(result = pkmn_battle_update(&battle, c1, c2, &options))
159
192
  if (pkmn_error(result)) exit(1);
160
193
  ```
161
194
 
162
- [(full code)](src/examples/c/example.c)
195
+ [(full code)](examples/c/example.c)
163
196
 
164
- The C API does not export any helpers for creating or accessing the opaque battle objects - it is
197
+ The C API doesn't export any helpers for creating or accessing the opaque battle objects - it's
165
198
  instead intended to be used as the foundation for more ergonomic bindings in [other
166
199
  languages](#other) (the lack of namespaces and bit fields having an implementation-defined layout in
167
200
  C are the main contributing factors to the sparseness of what `libpkmn` chooses to expose).
168
201
 
169
202
  ### JavaScript / TypeScript
170
203
 
171
- `@pkmn/engine` depends on the [`@pkmn/data`](https://www.npmjs.com/package/@pkmn/data) which
204
+ `@pkmn/engine` depends on the [`@pkmn/data`](https://www.npmjs.com/package/@pkmn/data) package which
172
205
  requires a `Dex` implementation to be provided as well. The `Battle.create` function can be used to
173
206
  initialize a `Battle` from the beginning, or `Battle.restore` can be used to re-instantiate a battle
174
- which is in already progress. If logging is enabled the output can be turned into Pokémon Showdown
207
+ which is already in progress. If logging is enabled the output can be turned into Pokémon Showdown
175
208
  protocol via `Log.parse`.
176
209
 
177
210
  ```ts
@@ -194,20 +227,20 @@ while (!(result = battle.update(c1, c2)).type) {
194
227
  console.log(result);
195
228
  ```
196
229
 
197
- [(full code)](src/examples/js/example.ts)
230
+ [(full code)](examples/js/example.ts)
198
231
 
199
- By default, the `@pkmn/engine` package will compile the engine with `-Dshowdown`, though by running
232
+ By default, the `@pkmn/engine` package compiles the engine with `-Dshowdown`, though by running
200
233
  `install-pkmn-engine` directly and passing in `--options` you can override this default and build
201
234
  different configurations of the extension for the driver to use. The driver can support
202
235
  configurations both with and without Pokémon Showdown compatibility simultaneously if present. On
203
- update, the post-install script will attempt to rebuild whichever extensions it finds with the same
236
+ update, the post-install script attempts to rebuild whichever extensions it finds with the same
204
237
  configuration parameters that were originally used meaning updating to the newest version of the
205
238
  library should be seamless.
206
239
 
207
240
  Despite relying on the native engine code, the `@pkmn/engine` code is designed to also work in
208
241
  browsers which support [WebAssembly](https://webassembly.org/). Running `npm run start:web` from the
209
- [`examples`](src/examples/js) directory will start a server that can be used to demonstrate the
210
- engine running in the browser.
242
+ [`examples`](examples/js) directory starts a server that can be used to demonstrate the engine
243
+ running in the browser.
211
244
 
212
245
  ### Zig
213
246
 
@@ -218,7 +251,7 @@ be used when logging is enabled to allow for easily printing e.g. to standard ou
218
251
  const std = @import("std");
219
252
  const pkmn = @import("pkmn");
220
253
 
221
- var random = std.rand.DefaultPrng.init(seed).random();
254
+ var random = std.Random.DefaultPrng.init(seed).random();
222
255
  var choices: [pkmn.CHOICES_SIZE]pkmn.Choice = undefined;
223
256
 
224
257
  var battle = ...
@@ -236,11 +269,11 @@ while (result.type == .None) : (result = try battle.update(c1, c2, &options)) {
236
269
  std.debug.print("{}\n", .{result.type});
237
270
  ```
238
271
 
239
- [(full code)](src/examples/zig/example.zig)
272
+ [(full code)](examples/zig/example.zig)
240
273
 
241
274
  The Zig package also supports some APIs which are difficult to expose elsewhere such as the
242
275
  `FixedRNG` which allows you to fully specify the exact RNG frames (which can be useful for ensuring
243
- certain outcomes/effects always occur) for a battle, though doing so will change the size of the
276
+ certain outcomes/effects always occur) for a battle, though doing so changes the size of the
244
277
  `Battle` object.
245
278
 
246
279
  ### Other
@@ -251,7 +284,7 @@ simplify the process even further [`src/data`](src/data) contains JSON dumps of
251
284
  data, structure sizes and offsets, and protocol information used by the reference driver code. The
252
285
  following is a list of known `libpkmn` bindings written by developers outside of the [pkmn
253
286
  organization](https://github.com/pkmn) that may be helpful (though note that these projects may not
254
- necessarily be up-to-date/complete/correct - inclusion in this list does not imply endorsement):
287
+ necessarily be up-to-date/complete/correct - inclusion in this list doesn't imply endorsement):
255
288
 
256
289
  | Language | License | URL |
257
290
  | ---------- | --------- | ------------------------------------ |
@@ -279,7 +312,7 @@ By default, `pkmn-debug` expects to read [binary debug protocol](docs/PROTOCOL.m
279
312
  $ <cmd> | pkmn-debug > index.html
280
313
  ```
281
314
 
282
- Alternatively, if a single filename argument is passed to the `pkmn-debug` it will read from that
315
+ Alternatively, if a single filename argument is passed to the `pkmn-debug` it reads from that
283
316
  instead:
284
317
 
285
318
  ```sh
@@ -301,14 +334,14 @@ Currently, most of the foundational work from stage 0 is done:
301
334
 
302
335
  - [benchmark and integration testing](src/test) infrastructure
303
336
  - [documentation](docs) about design, research, methodology, etc
304
- - definition and implementation of the [protocol](docs/PROTOCOL.md) that will be used by the engine
337
+ - definition and implementation of the [protocol](docs/PROTOCOL.md) that's used by the engine
305
338
 
306
- **Stage 1 is currently in progress** and will see the implementation of the actual Generation I & II
339
+ **Stage 1 is currently in progress** and involves the implementation of the actual Generation I & II
307
340
  battle engines, followed by Generation III & IV in stage 2. The implementation of further Pokémon
308
- generations is in scope for the project but should not be considered as part of the immediate
309
- roadmap (i.e. exploring the options for broadening support for old generation APIs will be given
310
- higher priority than implementing more modern generations). Furthermore, implementation of modern
311
- generations is soft-blocked on the [availability of high quality
341
+ generations is in scope for the project but shouldn't be considered part of the immediate roadmap
342
+ (i.e. exploring the options for broadening support for old generation APIs is given higher priority
343
+ than implementing more modern generations). Furthermore, implementation of modern generations is
344
+ soft-blocked on the [availability of high quality
312
345
  decompilations](https://github.com/orgs/pret/repositories) of the original games in question.
313
346
 
314
347
  Certain features will always be deemed **out of scope**:
@@ -326,10 +359,10 @@ The pkmn engine is distributed under the terms of the [MIT License](LICENSE).
326
359
  [^1]: In the case of Pokémon Showdown, only bugs which stem from a misimplementation of specific
327
360
  effects are reproduced in the engine, bugs which are the result of a misunderstanding of the
328
361
  fundamental mechanics of Pokémon or which simply arise due to specific Pokémon Showdown
329
- implementation details that are not replicable without making the same (incorrect) architectural
330
- choices are not. Furthermore, the "Pokémon Showdown" code referenced by this project includes
362
+ implementation details that aren't replicable without making the same (incorrect) architectural
363
+ choices aren't. Furthermore, the "Pokémon Showdown" code referenced by this project includes
331
364
  several [patches](docs/TESTING.md#patches) to improve accuracy and smooth over some of the more
332
365
  egregious implementation issues. In practical terms, the vast majority of games played out in the
333
- pkmn engine's compatibility mode and on this patched Pokémon Showdown simulator will be the same,
334
- it is only in a well defined and documented set of circumstances where the two implementations
366
+ pkmn engine's compatibility mode and on this patched Pokémon Showdown simulator are the same,
367
+ it's only in a well defined and documented set of circumstances where the two implementations
335
368
  diverge.
@@ -23,7 +23,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.size = exports.choose = exports.choices = exports.update = exports.supports = exports.check = void 0;
26
+ exports.check = check;
27
+ exports.supports = supports;
28
+ exports.update = update;
29
+ exports.choices = choices;
30
+ exports.choose = choose;
31
+ exports.size = size;
27
32
  const path = __importStar(require("path"));
28
33
  const _1 = require(".");
29
34
  const ROOT = path.join(__dirname, '..', '..');
@@ -56,7 +61,6 @@ function check(showdown) {
56
61
  `\n(running \`npx install-pkmn-engine --options='${opts.join(' ')}'\` can fix this issue).`);
57
62
  }
58
63
  }
59
- exports.check = check;
60
64
  function supports(showdown, log) {
61
65
  if (!load()[+showdown])
62
66
  return false;
@@ -64,12 +68,10 @@ function supports(showdown, log) {
64
68
  return true;
65
69
  return ADDON[+showdown].options.log === log;
66
70
  }
67
- exports.supports = supports;
68
71
  function update(index, showdown, battle, c1, c2, log) {
69
72
  return _1.Result.decode(ADDON[+showdown].bindings[index]
70
73
  .update(battle, _1.Choice.encode(c1), _1.Choice.encode(c2), log));
71
74
  }
72
- exports.update = update;
73
75
  function choices(index, showdown, battle, player, choice, buf) {
74
76
  const request = choice[0] === 'p' ? 0 : choice[0] === 'm' ? 1 : 2;
75
77
  const n = ADDON[+showdown].bindings[index].choices(battle, +(player !== 'p1'), request, buf);
@@ -96,17 +98,14 @@ function choices(index, showdown, battle, player, choice, buf) {
96
98
  options[i] = _1.Choice.decode(data[i]);
97
99
  return options;
98
100
  }
99
- exports.choices = choices;
100
101
  function choose(index, showdown, battle, player, choice, buf, fn) {
101
102
  const request = choice[0] === 'p' ? 0 : choice[0] === 'm' ? 1 : 2;
102
103
  const n = ADDON[+showdown].bindings[index].choices(battle, +(player !== 'p1'), request, buf);
103
104
  const data = new Uint8Array(buf);
104
105
  return _1.Choice.decode(data[fn(n)]);
105
106
  }
106
- exports.choose = choose;
107
107
  function size(index, type) {
108
108
  const bindings = (ADDON[1] ?? ADDON[0]).bindings[index];
109
109
  return type[0] === 'c' ? bindings.CHOICES_SIZE : bindings.LOGS_SIZE;
110
110
  }
111
- exports.size = size;
112
111
  //# sourceMappingURL=addon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"addon.js","sourceRoot":"","sources":["../../src/pkg/addon.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAE7B,wBAAyC;AAEzC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAE9C,IAAI,KAAK,GAAoD,SAAS,CAAC;AAcvE,SAAS,IAAI;IACX,IAAI,KAAK;QAAE,OAAO,KAAK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AAG,KAAM,CAAC,CAAC,QAAQ,CAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,KAAK,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;IAC/F,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IACjC,OAAO,SAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC;AAED,SAAgB,IAAI,CAAC,KAAa,EAAE,IAAuB;IACzD,MAAM,QAAQ,GAAG,CAAC,KAAM,CAAC,CAAC,CAAC,IAAI,KAAM,CAAC,CAAC,CAAC,CAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC;AACtE,CAAC"}
@@ -20,15 +20,15 @@
20
20
  },
21
21
  {
22
22
  "types": [
23
+ "Ground",
24
+ "Rock",
25
+ "Steel",
23
26
  "Normal",
24
27
  "Fighting",
25
28
  "Flying",
26
29
  "Poison",
27
- "Ground",
28
- "Rock",
29
30
  "Bug",
30
31
  "Ghost",
31
- "Steel",
32
32
  "???",
33
33
  "Fire",
34
34
  "Water",
@@ -40,15 +40,15 @@
40
40
  "Dark"
41
41
  ],
42
42
  "items": [
43
+ "softsand",
44
+ "hardstone",
45
+ "metalcoat",
43
46
  "pinkbow",
44
47
  "blackbelt",
45
48
  "sharpbeak",
46
49
  "poisonbarb",
47
- "softsand",
48
- "hardstone",
49
50
  "silverpowder",
50
51
  "spelltag",
51
- "metalcoat",
52
52
  "polkadotbow",
53
53
  "charcoal",
54
54
  "mysticwater",
@@ -65,21 +65,21 @@
65
65
  "stick",
66
66
  "thickclub",
67
67
  "focusband",
68
- "berryjuice",
69
68
  "scopelens",
70
69
  "leftovers",
71
70
  "berserkgene",
72
71
  "lightball",
72
+ "berry",
73
+ "berryjuice",
74
+ "goldberry",
75
+ "mintberry",
73
76
  "psncureberry",
74
77
  "przcureberry",
75
- "burntberry",
76
78
  "iceberry",
77
- "bitterberry",
78
- "mintberry",
79
+ "burntberry",
79
80
  "miracleberry",
81
+ "bitterberry",
80
82
  "mysteryberry",
81
- "berry",
82
- "goldberry",
83
83
  "masterball",
84
84
  "ultraball",
85
85
  "greatball",
@@ -79,8 +79,8 @@
79
79
  "state": 24,
80
80
  "substitute": 40,
81
81
  "transform": 48,
82
- "disabled_duration": 52,
83
- "disabled_move": 56,
82
+ "disable_duration": 52,
83
+ "disable_move": 56,
84
84
  "toxic": 59
85
85
  },
86
86
  "Action": {
@@ -70,7 +70,8 @@
70
70
  "Burst",
71
71
  "ClearPositiveBoost",
72
72
  "CanDynamax",
73
- "SwapSideConditions"
73
+ "SwapSideConditions",
74
+ "Terastallize"
74
75
  ],
75
76
  "Move": [
76
77
  "None",
@@ -84,12 +85,14 @@
84
85
  "Flinch",
85
86
  "Disable",
86
87
  "Recharge",
87
- "PP"
88
+ "PP",
89
+ "Attract"
88
90
  ],
89
91
  "Heal": [
90
92
  "None",
91
93
  "Silent",
92
- "Drain"
94
+ "Drain",
95
+ "Leftovers"
93
96
  ],
94
97
  "Damage": [
95
98
  "None",
@@ -97,7 +100,13 @@
97
100
  "Burn",
98
101
  "Confusion",
99
102
  "LeechSeed",
100
- "RecoilOf"
103
+ "RecoilOf",
104
+ "Bind",
105
+ "Wrap",
106
+ "FireSpin",
107
+ "Clamp",
108
+ "Whirlpool",
109
+ "Spikes"
101
110
  ],
102
111
  "Status": [
103
112
  "None",
@@ -136,7 +145,15 @@
136
145
  "Mist",
137
146
  "Struggle",
138
147
  "Substitute",
139
- "Splash"
148
+ "Splash",
149
+ "Attract",
150
+ "LockOn",
151
+ "Bind",
152
+ "Wrap",
153
+ "FireSpin",
154
+ "Clamp",
155
+ "Whirlpool",
156
+ "BeatUp"
140
157
  ],
141
158
  "Start": [
142
159
  "Bide",
@@ -150,24 +167,64 @@
150
167
  "Substitute",
151
168
  "TypeChange",
152
169
  "Disable",
153
- "Mimic"
170
+ "Mimic",
171
+ "Nightmare",
172
+ "Curse",
173
+ "Foresight",
174
+ "Encore",
175
+ "FutureSight",
176
+ "PerishSong3Silent",
177
+ "PerishSong3",
178
+ "PerishSong2",
179
+ "PerishSong1",
180
+ "PerishSong0"
154
181
  ],
155
182
  "End": [
156
183
  "Disable",
157
184
  "Confusion",
158
185
  "Bide",
159
186
  "Substitute",
187
+ "Nightmare",
188
+ "Curse",
189
+ "Foresight",
190
+ "Encore",
191
+ "FutureSight",
192
+ "LeechSeed",
193
+ "Bind",
194
+ "Wrap",
195
+ "FireSpin",
196
+ "Clamp",
197
+ "Whirlpool",
160
198
  "DisableSilent",
161
199
  "ConfusionSilent",
162
- "Mist",
163
- "FocusEnergy",
164
- "LeechSeed",
165
- "Toxic",
166
- "LightScreen",
167
- "Reflect"
200
+ "MistSilent",
201
+ "FocusEnergySilent",
202
+ "LeechSeedSilent",
203
+ "ToxicSilent",
204
+ "LightScreenSilent",
205
+ "ReflectSilent",
206
+ "BideSilent"
168
207
  ],
169
208
  "Immune": [
170
209
  "None",
171
210
  "OHKO"
211
+ ],
212
+ "EndItem": [
213
+ "None",
214
+ "Eat"
215
+ ],
216
+ "SetHP": [
217
+ "None",
218
+ "Silent"
219
+ ],
220
+ "Side": [
221
+ "Safeguard",
222
+ "Reflect",
223
+ "LightScreen",
224
+ "Spikes"
225
+ ],
226
+ "Weather": [
227
+ "None",
228
+ "Upkeep"
172
229
  ]
173
230
  }
@@ -2,11 +2,11 @@ import { Generation, ID, TypeName } from '@pkmn/data';
2
2
  export declare const LE: boolean;
3
3
  export type IDs = [
4
4
  {
5
- types: TypeName[];
5
+ types: Exclude<TypeName, 'Dark' | 'Steel' | 'Fairy' | 'Stellar'>[];
6
6
  },
7
7
  {
8
8
  items: ID[];
9
- types: TypeName[];
9
+ types: Exclude<TypeName, 'Fairy' | 'Stellar'>[];
10
10
  }
11
11
  ];
12
12
  export declare const IDS: IDs;
@@ -15,7 +15,7 @@ export declare const PROTOCOL: {
15
15
  [name: string]: number;
16
16
  };
17
17
  };
18
- export declare const LAYOUT: {
18
+ export declare const LAYOUT: Array<{
19
19
  sizes: {
20
20
  [decl: string]: number;
21
21
  };
@@ -24,7 +24,7 @@ export declare const LAYOUT: {
24
24
  [field: string]: number;
25
25
  };
26
26
  };
27
- }[];
27
+ }>;
28
28
  export declare const Data: {
29
29
  view(buf: number[] | Buffer): DataView;
30
30
  };
@@ -1 +1 @@
1
- {"version":3,"file":"data.js","sourceRoot":"","sources":["../../src/pkg/data.ts"],"names":[],"mappings":";;;;;;AAEA,+DAAsC;AACtC,qEAA6C;AAC7C,yEAAgD;AAEnC,QAAA,EAAE,GAAG,CAAC,GAAG,EAAE;IACtB,MAAM,EAAE,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;IAC7B,MAAM,GAAG,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IACvC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC,CAAC,EAAE,CAAC;AAOQ,QAAA,GAAG,GAAG,kBAAc,CAAC;AAErB,QAAA,QAAQ,GAA+C,EAAE,CAAC;AACvE,KAAK,MAAM,IAAI,IAAI,uBAAY,EAAE;IAC/B,gBAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;IACpB,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,KAAK,MAAM,IAAI,IAAI,uBAAY,CAAC,IAAiC,CAAC,EAAE;QAClE,gBAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;KAC5B;CACF;AAEY,QAAA,MAAM,GAAG,qBA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ACzB,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,GAAW;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,EAAkB;QACzB,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;CACF;AArHD,wBAqHC"}
package/build/pkg/gen1.js CHANGED
@@ -378,11 +378,11 @@ class Pokemon {
378
378
  const pp = this.data.getUint8(off + ((slot << 1) - 1));
379
379
  const byte = this.data.getUint8(this.offset.active +
380
380
  OFFSETS.ActivePokemon.volatiles +
381
- (OFFSETS.Volatiles.disabled_move >> 3));
381
+ (OFFSETS.Volatiles.disable_move >> 3));
382
382
  const disabled = ((byte & 0b111) === slot)
383
383
  ? this.data.getUint8(this.offset.active +
384
384
  OFFSETS.ActivePokemon.volatiles +
385
- (OFFSETS.Volatiles.disabled_duration >> 3)) >> 4
385
+ (OFFSETS.Volatiles.disable_duration >> 3)) >> 4
386
386
  : undefined;
387
387
  return { id, pp, disabled };
388
388
  }