@pkmn/engine 0.1.0-dev.00879b8b

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 (60) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +368 -0
  3. package/build/pkg/addon.d.ts +7 -0
  4. package/build/pkg/addon.js +111 -0
  5. package/build/pkg/addon.js.map +1 -0
  6. package/build/pkg/data/ids.json +240 -0
  7. package/build/pkg/data/layout.json +108 -0
  8. package/build/pkg/data/protocol.json +230 -0
  9. package/build/pkg/data.d.ts +91 -0
  10. package/build/pkg/data.js +150 -0
  11. package/build/pkg/data.js.map +1 -0
  12. package/build/pkg/gen1.d.ts +110 -0
  13. package/build/pkg/gen1.js +684 -0
  14. package/build/pkg/gen1.js.map +1 -0
  15. package/build/pkg/index.d.ts +387 -0
  16. package/build/pkg/index.js +122 -0
  17. package/build/pkg/index.js.map +1 -0
  18. package/build/pkg/protocol.d.ts +73 -0
  19. package/build/pkg/protocol.js +473 -0
  20. package/build/pkg/protocol.js.map +1 -0
  21. package/build/test/display.js +400 -0
  22. package/build/test/display.js.map +1 -0
  23. package/build/tools/debug.js +134 -0
  24. package/build/tools/debug.js.map +1 -0
  25. package/build.zig +363 -0
  26. package/package.json +232 -0
  27. package/src/bin/install-pkmn-engine +404 -0
  28. package/src/bin/pkmn-debug +62 -0
  29. package/src/lib/common/battle.zig +17 -0
  30. package/src/lib/common/data.zig +117 -0
  31. package/src/lib/common/debug.zig +74 -0
  32. package/src/lib/common/js.zig +118 -0
  33. package/src/lib/common/optional.zig +67 -0
  34. package/src/lib/common/options.zig +51 -0
  35. package/src/lib/common/protocol.zig +1836 -0
  36. package/src/lib/common/rational.zig +357 -0
  37. package/src/lib/common/rng.zig +243 -0
  38. package/src/lib/common/util.zig +12 -0
  39. package/src/lib/gen1/calc.zig +507 -0
  40. package/src/lib/gen1/chance.zig +1063 -0
  41. package/src/lib/gen1/data/moves.zig +1866 -0
  42. package/src/lib/gen1/data/species.zig +1105 -0
  43. package/src/lib/gen1/data/types.zig +131 -0
  44. package/src/lib/gen1/data.zig +634 -0
  45. package/src/lib/gen1/helpers.zig +866 -0
  46. package/src/lib/gen1/mechanics.zig +3156 -0
  47. package/src/lib/gen2/calc.zig +143 -0
  48. package/src/lib/gen2/chance.zig +1315 -0
  49. package/src/lib/gen2/data/items.zig +230 -0
  50. package/src/lib/gen2/data/moves.zig +2878 -0
  51. package/src/lib/gen2/data/species.zig +1798 -0
  52. package/src/lib/gen2/data/types.zig +226 -0
  53. package/src/lib/gen2/data.zig +463 -0
  54. package/src/lib/gen2/generated.zig +806 -0
  55. package/src/lib/gen2/helpers.zig +249 -0
  56. package/src/lib/gen2/mechanics.zig +3632 -0
  57. package/src/lib/node.zig +131 -0
  58. package/src/lib/pkmn.zig +128 -0
  59. package/src/lib/wasm.zig +13 -0
  60. package/src/test/display/pkmn.html.tmpl +368 -0
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Lookup = exports.Data = exports.LAYOUT = exports.PROTOCOL = exports.IDS = exports.LE = void 0;
7
+ const ids_json_1 = __importDefault(require("./data/ids.json"));
8
+ const layout_json_1 = __importDefault(require("./data/layout.json"));
9
+ const protocol_json_1 = __importDefault(require("./data/protocol.json"));
10
+ exports.LE = (() => {
11
+ const u8 = new Uint8Array(4);
12
+ const u16 = new Uint16Array(u8.buffer);
13
+ return !!((u16[0] = 1) & u16[0]);
14
+ })();
15
+ exports.IDS = ids_json_1.default;
16
+ exports.PROTOCOL = {};
17
+ for (const decl in protocol_json_1.default) {
18
+ exports.PROTOCOL[decl] = {};
19
+ let i = 0;
20
+ for (const name of protocol_json_1.default[decl]) {
21
+ exports.PROTOCOL[decl][name] = i++;
22
+ }
23
+ }
24
+ exports.LAYOUT = layout_json_1.default;
25
+ for (const gen of exports.LAYOUT) {
26
+ gen.offsets.Battle.p1 = gen.offsets.Battle.sides;
27
+ gen.offsets.Battle.p2 = gen.offsets.Battle.sides + gen.sizes.Side;
28
+ }
29
+ exports.Data = new class {
30
+ view(buf) {
31
+ buf = Array.isArray(buf) ? Buffer.from(buf) : buf;
32
+ return new DataView(buf.buffer, buf.byteOffset, buf.byteLength);
33
+ }
34
+ };
35
+ const LOOKUPS = [];
36
+ /**
37
+ * Translation table for encoding/decoding Pokémon Showdown string identifiers
38
+ * to the identifiers used internally by the pkmn engine.
39
+ */
40
+ class Lookup {
41
+ gen;
42
+ typesByNum;
43
+ typesByName;
44
+ species;
45
+ moves;
46
+ itemsByNum;
47
+ itemsByID;
48
+ /** Returns a `Lookup` table for a given generation. */
49
+ static get(gen) {
50
+ if (gen.num > 2)
51
+ throw new Error(`Unsupported gen ${gen.num}`);
52
+ const lookup = LOOKUPS[gen.num - 1];
53
+ return lookup || (LOOKUPS[gen.num - 1] = new Lookup(gen));
54
+ }
55
+ constructor(gen) {
56
+ this.gen = gen;
57
+ this.typesByNum = exports.IDS[Math.min(gen.num, 2) - 1].types;
58
+ this.typesByName = {};
59
+ for (let i = 0; i < this.typesByNum.length; i++) {
60
+ this.typesByName[this.typesByNum[i]] = i;
61
+ }
62
+ this.species = [];
63
+ for (const specie of gen.species) {
64
+ this.species[specie.num - 1] = specie.id;
65
+ }
66
+ this.moves = [];
67
+ for (const move of gen.moves) {
68
+ this.moves[move.num - 1] = move.id;
69
+ }
70
+ if (gen.num === 1) {
71
+ this.itemsByNum = [];
72
+ this.itemsByID = {};
73
+ }
74
+ else {
75
+ this.itemsByNum = exports.IDS[gen.num - 1].items;
76
+ this.itemsByID = {};
77
+ for (let i = 0; i < this.itemsByNum.length; i++) {
78
+ if (this.itemsByNum[i] === 'flowermail') {
79
+ this.itemsByNum[i] = 'mail';
80
+ }
81
+ this.itemsByID[this.itemsByNum[i]] = i;
82
+ }
83
+ }
84
+ }
85
+ /**
86
+ * Returns the respective sizes of the various data types in the lookup table.
87
+ */
88
+ get sizes() {
89
+ return {
90
+ types: this.typesByNum.length,
91
+ species: this.species.length,
92
+ moves: this.moves.length,
93
+ items: this.itemsByNum.length,
94
+ };
95
+ }
96
+ /**
97
+ * Decodes the Pokémon Showdown `TypeName` for a type corresponding to the
98
+ * identifying `num` returned by the engine.
99
+ */
100
+ typeByNum(num) {
101
+ return this.typesByNum[num];
102
+ }
103
+ /**
104
+ * Encodes a `TypeName` to the number used as an identifier by the engine.
105
+ */
106
+ typeByName(name) {
107
+ return this.typesByName[name];
108
+ }
109
+ /**
110
+ * Decodes the Pokémon Showdown `ID` for a species corresponding to the
111
+ * identifying `num` returned by the engine.
112
+ */
113
+ speciesByNum(num) {
114
+ return this.species[num - 1];
115
+ }
116
+ /**
117
+ * Encodes a species `ID` to the number used as an identifier by the engine.
118
+ */
119
+ speciesByID(id) {
120
+ return id ? this.gen.species.get(id).num : 0;
121
+ }
122
+ /**
123
+ * Decodes the Pokémon Showdown `ID` for a move corresponding to the
124
+ * identifying `num` returned by the engine.
125
+ */
126
+ moveByNum(num) {
127
+ return this.moves[num - 1];
128
+ }
129
+ /**
130
+ * Encodes a move `ID` to the number used as an identifier by the engine.
131
+ */
132
+ moveByID(id) {
133
+ return id ? this.gen.moves.get(id).num : 0;
134
+ }
135
+ /**
136
+ * Decodes the Pokémon Showdown `ID` for an item corresponding to the
137
+ * identifying `num` returned by the engine.
138
+ */
139
+ itemByNum(num) {
140
+ return this.itemsByNum[num - 1];
141
+ }
142
+ /**
143
+ * Encodes an item `ID` to the number used as an identifier by the engine.
144
+ */
145
+ itemByID(id) {
146
+ return id ? this.itemsByID[id] + 1 : 0;
147
+ }
148
+ }
149
+ exports.Lookup = Lookup;
150
+ //# sourceMappingURL=data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.js","sourceRoot":"","sources":["../../src/pkg/data.ts"],"names":[],"mappings":";;;;;;AAEA,+DAAsC;AACtC,qEAA6C;AAC7C,yEAAgD;A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Table, Generation, ID, PokemonSet, StatID, StatsTable, StatusName, TypeName } from '@pkmn/data';
2
+ import { Lookup } from './data';
3
+ import { Choice, CreateOptions, Data, Gen1, Player, RestoreOptions, Result, Slot } from '.';
4
+ export declare class Battle implements Gen1.Battle {
5
+ readonly config: CreateOptions | RestoreOptions;
6
+ readonly log?: DataView;
7
+ private readonly lookup;
8
+ private readonly data;
9
+ private readonly options;
10
+ private readonly buf;
11
+ private readonly cache;
12
+ constructor(lookup: Lookup, data: DataView, config: CreateOptions | RestoreOptions);
13
+ update(c1?: Choice, c2?: Choice): Result;
14
+ choices(id: Player, result: Result): Choice[];
15
+ choose(id: Player, result: Result, fn: (n: number) => number): Choice;
16
+ get sides(): Generator<Side, void, unknown>;
17
+ _sides(): Generator<Side, void, unknown>;
18
+ side(id: Player): Side;
19
+ foe(side: Player): Side;
20
+ get turn(): number;
21
+ get lastDamage(): number;
22
+ get prng(): readonly number[];
23
+ toJSON(): Data<Gen1.Battle>;
24
+ static create(gen: Generation, lookup: Lookup, options: CreateOptions): Battle;
25
+ static restore(gen: Generation, lookup: Lookup, battle: Data<Gen1.Battle>, options: RestoreOptions): Battle;
26
+ }
27
+ export declare class Side implements Gen1.Side {
28
+ readonly id: 'p1' | 'p2';
29
+ private readonly battle;
30
+ private readonly lookup;
31
+ private readonly data;
32
+ private readonly offset;
33
+ private readonly cache;
34
+ constructor(battle: Battle, lookup: Lookup, data: DataView, id: 'p1' | 'p2');
35
+ get active(): Pokemon | undefined;
36
+ get pokemon(): Generator<Pokemon, void, unknown>;
37
+ _pokemon(): Generator<Pokemon, void, unknown>;
38
+ slot(id: number): Slot | undefined;
39
+ get(slot: Slot): Pokemon | undefined;
40
+ get lastUsedMove(): ID | undefined;
41
+ get lastSelectedMove(): ID | undefined;
42
+ get lastMoveIndex(): 1 | 2 | 3 | 4 | undefined;
43
+ get lastMoveCounterable(): boolean;
44
+ toJSON(): Gen1.Side;
45
+ static init(gen: Generation, lookup: Lookup, team: Partial<PokemonSet>[], data: DataView, offset: number): void;
46
+ static encode(gen: Generation, showdown: boolean, lookup: Lookup, battle: Data<Gen1.Battle>, side: Gen1.Side, data: DataView, offset: number): void;
47
+ }
48
+ export declare class Pokemon implements Gen1.Pokemon {
49
+ static Volatiles: {
50
+ [volatile: string]: number;
51
+ };
52
+ private readonly battle;
53
+ private readonly lookup;
54
+ private readonly data;
55
+ private readonly offset;
56
+ private readonly index;
57
+ readonly stored: StoredPokemon;
58
+ constructor(battle: Battle, lookup: Lookup, data: DataView, offset: number, index: number);
59
+ get position(): Slot;
60
+ get active(): boolean;
61
+ stat(stat: StatID | 'spc'): number;
62
+ get stats(): StatsTable;
63
+ volatile(bit: number): boolean;
64
+ get volatiles(): Gen1.Volatiles;
65
+ move(slot: 1 | 2 | 3 | 4): Gen1.MoveSlot | undefined;
66
+ get moves(): Iterable<Gen1.MoveSlot>;
67
+ _moves(): Generator<Gen1.MoveSlot, void, unknown>;
68
+ boost(boost: BoostID): number;
69
+ get boosts(): BoostsTable;
70
+ get species(): ID;
71
+ get types(): readonly [TypeName, TypeName];
72
+ get level(): number;
73
+ get hp(): number;
74
+ get status(): StatusName | undefined;
75
+ get statusData(): {
76
+ sleep: number;
77
+ self: boolean;
78
+ toxic: number;
79
+ };
80
+ private get sleep();
81
+ private get ext();
82
+ private get toxic();
83
+ toJSON(): Gen1.Pokemon;
84
+ static init(gen: Generation, lookup: Lookup, set: Partial<PokemonSet>, data: DataView, offset: number, index: number): void;
85
+ static encodeStored(gen: Generation, showdown: boolean, lookup: Lookup, pokemon: Gen1.Pokemon, data: DataView, offset: number): void;
86
+ static encodeActive(gen: Generation, lookup: Lookup, battle: Data<Gen1.Battle>, pokemon: Gen1.Pokemon | undefined, data: DataView, offset: number): void;
87
+ }
88
+ export declare class StoredPokemon {
89
+ private readonly lookup;
90
+ private readonly data;
91
+ private readonly offset;
92
+ constructor(lookup: Lookup, data: DataView, offset: number);
93
+ stat(stat: StatID | 'spc'): number;
94
+ get stats(): StatsTable;
95
+ move(slot: 1 | 2 | 3 | 4): {
96
+ id: ID;
97
+ pp: number;
98
+ } | undefined;
99
+ get moves(): Generator<{
100
+ id: ID;
101
+ pp: number;
102
+ }, void, unknown>;
103
+ _moves(): Generator<{
104
+ id: ID;
105
+ pp: number;
106
+ }, void, unknown>;
107
+ get species(): ID;
108
+ get types(): readonly [TypeName, TypeName];
109
+ toJSON(): Gen1.Pokemon['stored'];
110
+ }