@pkmn/engine 0.1.0-dev.83de29ee → 0.1.0-dev.84cc1a02
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 +22 -50
- package/build/pkg/data/layout.json +1 -1
- package/build/pkg/data.d.ts +2 -1
- package/build/pkg/data.js +5 -3
- package/build/pkg/data.js.map +1 -1
- package/build/pkg/gen1.d.ts +4 -5
- package/build/pkg/gen1.js +24 -35
- package/build/pkg/gen1.js.map +1 -1
- package/build/pkg/index.d.ts +12 -15
- package/build/pkg/index.js.map +1 -1
- package/build.zig +31 -23
- package/package.json +29 -40
- package/src/bin/install-pkmn-engine +28 -47
- package/src/lib/binding/node.zig +5 -5
- package/src/lib/binding/wasm.zig +3 -3
- package/src/lib/common/debug.zig +0 -1
- package/src/lib/common/options.zig +3 -3
- package/src/lib/common/protocol.zig +38 -38
- package/src/lib/gen1/README.md +63 -93
- package/src/lib/gen1/data.zig +17 -19
- package/src/lib/gen1/helpers.zig +13 -11
- package/src/lib/gen1/mechanics.zig +301 -378
- package/src/lib/gen2/data.zig +4 -4
- package/src/lib/pkmn.zig +7 -7
- package/build/pkg/addon.d.ts +0 -7
- package/build/pkg/addon.js +0 -111
- package/build/pkg/addon.js.map +0 -1
- package/build/test/display.js +0 -401
- package/build/test/display.js.map +0 -1
- package/build/tools/debug.js +0 -133
- package/build/tools/debug.js.map +0 -1
- package/src/bin/pkmn-debug +0 -62
- package/src/test/display/pkmn.html.tmpl +0 -368
package/src/lib/gen2/data.zig
CHANGED
|
@@ -19,13 +19,13 @@ const assert = std.debug.assert;
|
|
|
19
19
|
const expectEqual = std.testing.expectEqual;
|
|
20
20
|
const expect = std.testing.expect;
|
|
21
21
|
|
|
22
|
-
pub const
|
|
22
|
+
pub const MAX_OPTIONS: usize = 9; // move 1..4, switch 2..6
|
|
23
23
|
pub const MAX_LOGS: usize = 180; // TODO
|
|
24
24
|
|
|
25
|
-
pub const
|
|
26
|
-
|
|
25
|
+
pub const OPTIONS_SIZE = if (builtin.mode == .ReleaseSmall)
|
|
26
|
+
MAX_OPTIONS
|
|
27
27
|
else
|
|
28
|
-
std.math.ceilPowerOfTwo(usize,
|
|
28
|
+
std.math.ceilPowerOfTwo(usize, MAX_OPTIONS) catch unreachable;
|
|
29
29
|
pub const LOGS_SIZE = if (builtin.mode == .ReleaseSmall)
|
|
30
30
|
MAX_LOGS
|
|
31
31
|
else
|
package/src/lib/pkmn.zig
CHANGED
|
@@ -4,10 +4,10 @@ pub const options = @import("common/options.zig");
|
|
|
4
4
|
pub const Options = options.Options;
|
|
5
5
|
|
|
6
6
|
/// The minimum size in bytes required to hold all choice options.
|
|
7
|
-
pub const
|
|
7
|
+
pub const MAX_OPTIONS = gen1.MAX_OPTIONS;
|
|
8
8
|
/// The optimal size in bytes required to hold all choice options.
|
|
9
|
-
/// At least as large as `
|
|
10
|
-
pub const
|
|
9
|
+
/// At least as large as `MAX_OPTIONS`.
|
|
10
|
+
pub const OPTIONS_SIZE = gen1.OPTIONS_SIZE;
|
|
11
11
|
/// The maximum number of bytes possibly logged by a single update.
|
|
12
12
|
pub const MAX_LOGS = gen1.MAX_LOGS;
|
|
13
13
|
/// The optimal size in bytes required to hold the largest amount of log data
|
|
@@ -25,12 +25,12 @@ pub const Result = @import("common/data.zig").Result;
|
|
|
25
25
|
/// Pokémon Showdown's RNG (backed by a Generation V & VI RNG).
|
|
26
26
|
pub const PSRNG = @import("common/rng.zig").PSRNG;
|
|
27
27
|
|
|
28
|
-
/// Namespace for helpers related to protocol
|
|
28
|
+
/// Namespace for helpers related to protocol trace logging.
|
|
29
29
|
pub const protocol = if (options.internal) struct {
|
|
30
30
|
pub usingnamespace @import("common/protocol.zig");
|
|
31
31
|
} else struct {
|
|
32
32
|
/// Logs protocol information to its `Writer` during a battle update when
|
|
33
|
-
/// `options.
|
|
33
|
+
/// `options.trace` is enabled.
|
|
34
34
|
pub const Log = @import("common/protocol.zig").Log;
|
|
35
35
|
/// Stripped down version of `std.io.FixedBufferStream` optimized for
|
|
36
36
|
/// efficiently writing the individual protocol bytes. Note that the
|
|
@@ -41,8 +41,8 @@ pub const protocol = if (options.internal) struct {
|
|
|
41
41
|
/// intialized with a `LOGS_SIZE`-sized buffer.
|
|
42
42
|
pub const FixedLog = @import("common/protocol.zig").FixedLog;
|
|
43
43
|
/// Null object pattern implementation of `Log` backed by a
|
|
44
|
-
/// `std.io.null_writer`. Ignores anything sent to it, though
|
|
45
|
-
///
|
|
44
|
+
/// `std.io.null_writer`. Ignores anything sent to it, though trace logging
|
|
45
|
+
/// should addtionally be turned off entirely by using `options.trace`.
|
|
46
46
|
pub const NULL = @import("common/protocol.zig").NULL;
|
|
47
47
|
};
|
|
48
48
|
|
package/build/pkg/addon.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Choice, Player, Result } from '.';
|
|
2
|
-
export declare function check(showdown: boolean): void;
|
|
3
|
-
export declare function supports(showdown: boolean, log?: boolean): boolean;
|
|
4
|
-
export declare function update(index: number, showdown: boolean, battle: ArrayBuffer, c1?: Choice, c2?: Choice, log?: ArrayBuffer): Result;
|
|
5
|
-
export declare function choices(index: number, showdown: boolean, battle: ArrayBuffer, player: Player, choice: Choice['type'], buf: ArrayBuffer): Choice[];
|
|
6
|
-
export declare function choose(index: number, showdown: boolean, battle: ArrayBuffer, player: Player, choice: Choice['type'], buf: ArrayBuffer, fn: (n: number) => number): Choice;
|
|
7
|
-
export declare function size(index: number, type: 'choices' | 'log'): number;
|
package/build/pkg/addon.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.size = exports.choose = exports.choices = exports.update = exports.supports = exports.check = void 0;
|
|
27
|
-
const path = __importStar(require("path"));
|
|
28
|
-
const _1 = require(".");
|
|
29
|
-
const ROOT = path.join(__dirname, '..', '..');
|
|
30
|
-
let ADDON = undefined;
|
|
31
|
-
function load() {
|
|
32
|
-
if (ADDON)
|
|
33
|
-
return ADDON;
|
|
34
|
-
let pkmn = undefined;
|
|
35
|
-
let showdown = undefined;
|
|
36
|
-
try {
|
|
37
|
-
pkmn = require(path.join(ROOT, 'build', 'lib', 'pkmn.node'));
|
|
38
|
-
}
|
|
39
|
-
catch { }
|
|
40
|
-
try {
|
|
41
|
-
showdown = require(path.join(ROOT, 'build', 'lib', 'pkmn-showdown.node'));
|
|
42
|
-
}
|
|
43
|
-
catch { }
|
|
44
|
-
if (!pkmn && !showdown) {
|
|
45
|
-
throw new Error('Could not find native addons - did you run `npx install-pkmn-engine`?');
|
|
46
|
-
}
|
|
47
|
-
return (ADDON = [pkmn, showdown]);
|
|
48
|
-
}
|
|
49
|
-
function check(showdown) {
|
|
50
|
-
if (!load()[+showdown]) {
|
|
51
|
-
const opts = ADDON[+!showdown].options.log ? ['-log'] : [];
|
|
52
|
-
if (showdown)
|
|
53
|
-
opts.push('-Dshowdown');
|
|
54
|
-
throw new Error(`@pkmn/engine has ${showdown ? 'not' : 'only'} been configured to support Pokémon Showdown.` +
|
|
55
|
-
`\n(running \`npx install-pkmn-engine --options='${opts.join(' ')}'\` can fix this issue).`);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.check = check;
|
|
59
|
-
function supports(showdown, log) {
|
|
60
|
-
if (!load()[+showdown])
|
|
61
|
-
return false;
|
|
62
|
-
if (log === undefined)
|
|
63
|
-
return true;
|
|
64
|
-
return ADDON[+showdown].options.log === log;
|
|
65
|
-
}
|
|
66
|
-
exports.supports = supports;
|
|
67
|
-
function update(index, showdown, battle, c1, c2, log) {
|
|
68
|
-
return _1.Result.decode(ADDON[+showdown].bindings[index]
|
|
69
|
-
.update(battle, _1.Choice.encode(c1), _1.Choice.encode(c2), log));
|
|
70
|
-
}
|
|
71
|
-
exports.update = update;
|
|
72
|
-
function choices(index, showdown, battle, player, choice, buf) {
|
|
73
|
-
const request = choice[0] === 'p' ? 0 : choice[0] === 'm' ? 1 : 2;
|
|
74
|
-
const n = ADDON[+showdown].bindings[index].choices(battle, +(player !== 'p1'), request, buf);
|
|
75
|
-
// The top-level API signature means our hands our tied with respect to
|
|
76
|
-
// writing really fast bindings here. The simplest approach would be to return
|
|
77
|
-
// the ArrayBuffer the bindings populate as well as its size and only decode a
|
|
78
|
-
// Choice after the selection. However, given that we need to return
|
|
79
|
-
// `Choices[]` we need to decode all of them even if they're not all being
|
|
80
|
-
// used which is wasteful. This shouldn't be *that* bad as its a very small
|
|
81
|
-
// list, but its still wasted work. Switching the top-level API to return an
|
|
82
|
-
// Iterable<Choice> doesn't help as we need both the length and the ability to
|
|
83
|
-
// randomly access it, so the best way to make the current API fast would be
|
|
84
|
-
// to have the Zig bindings create Choice objects directly, only that won't
|
|
85
|
-
// scale well as it would require us to basically rewrite the low-level
|
|
86
|
-
// choices function for each generation within node.zig. We could do something
|
|
87
|
-
// really galaxy-brained and return some sort of frankenstein subclass of
|
|
88
|
-
// Array backed by ArrayBuffer which would lazily decode the Choice on access,
|
|
89
|
-
// but thats ultimately not worth the effort. You can't have both a high-level
|
|
90
|
-
// idiomatic API and performance here, hence why the choose function below
|
|
91
|
-
// exists.
|
|
92
|
-
const options = new Array(n);
|
|
93
|
-
const data = new Uint8Array(buf);
|
|
94
|
-
for (let i = 0; i < n; i++)
|
|
95
|
-
options[i] = _1.Choice.decode(data[i]);
|
|
96
|
-
return options;
|
|
97
|
-
}
|
|
98
|
-
exports.choices = choices;
|
|
99
|
-
function choose(index, showdown, battle, player, choice, buf, fn) {
|
|
100
|
-
const request = choice[0] === 'p' ? 0 : choice[0] === 'm' ? 1 : 2;
|
|
101
|
-
const n = ADDON[+showdown].bindings[index].choices(battle, +(player !== 'p1'), request, buf);
|
|
102
|
-
const data = new Uint8Array(buf);
|
|
103
|
-
return _1.Choice.decode(data[fn(n)]);
|
|
104
|
-
}
|
|
105
|
-
exports.choose = choose;
|
|
106
|
-
function size(index, type) {
|
|
107
|
-
const bindings = (ADDON[1] ?? ADDON[0]).bindings[index];
|
|
108
|
-
return type[0] === 'c' ? bindings.CHOICES_SIZE : bindings.LOGS_SIZE;
|
|
109
|
-
}
|
|
110
|
-
exports.size = size;
|
|
111
|
-
//# sourceMappingURL=addon.js.map
|
package/build/pkg/addon.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,CA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CAAC,CAAE,CAAC,QAAQ,CAAC,KAAK,CAAE,CAAC;IAC5D,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC;AACtE,CAAC;AAHD,oBAGC"}
|
package/build/test/display.js
DELETED
|
@@ -1,401 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.render = exports.toText = void 0;
|
|
27
|
-
const fs = __importStar(require("fs"));
|
|
28
|
-
const path = __importStar(require("path"));
|
|
29
|
-
const img_1 = require("@pkmn/img");
|
|
30
|
-
const html_minifier_1 = require("html-minifier");
|
|
31
|
-
const mustache = __importStar(require("mustache"));
|
|
32
|
-
const ROOT = path.resolve(__dirname, '..', '..');
|
|
33
|
-
const template = (s) => path.join(ROOT, 'src', 'test', 'display', `${s}.html.tmpl`);
|
|
34
|
-
const POSITIONS = ['a', 'b', 'c', 'd', 'e', 'f'];
|
|
35
|
-
const VOLATILES = {
|
|
36
|
-
bide: ['Bide', 'good'],
|
|
37
|
-
thrashing: ['Thrashing', 'neutral'],
|
|
38
|
-
flinch: ['Flinch', 'bad'],
|
|
39
|
-
charging: ['Charging', 'good'],
|
|
40
|
-
binding: ['Binding', 'bad'],
|
|
41
|
-
invulnerable: ['Invulnerable', 'good'],
|
|
42
|
-
confusion: ['Confusion', 'bad'],
|
|
43
|
-
mist: ['Mist', 'good'],
|
|
44
|
-
focusenergy: ['Focus Energy', 'good'],
|
|
45
|
-
substitute: ['Substitute', 'good'],
|
|
46
|
-
recharging: ['Recharging', 'bad'],
|
|
47
|
-
rage: ['Rage', 'neutral'],
|
|
48
|
-
leechseed: ['Leech Seed', 'bad'],
|
|
49
|
-
lightscreen: ['Light Screen', 'good'],
|
|
50
|
-
reflect: ['Reflect', 'good'],
|
|
51
|
-
transform: ['Transformed', 'neutral'],
|
|
52
|
-
};
|
|
53
|
-
const pretty = (choice) => choice
|
|
54
|
-
? choice.type === 'pass' ? choice.type : `${choice.type} ${choice.data}`
|
|
55
|
-
: '???';
|
|
56
|
-
const format = (kwVal) => typeof kwVal === 'boolean' ? '' : ` ${kwVal}`;
|
|
57
|
-
const trim = (args) => {
|
|
58
|
-
while (args.length && !args[args.length - 1])
|
|
59
|
-
args.pop();
|
|
60
|
-
return args;
|
|
61
|
-
};
|
|
62
|
-
const compact = (line) => [...trim(line.args.slice(0)), ...Object.keys(line.kwArgs)
|
|
63
|
-
.map(k => `[${k}]${format(line.kwArgs[k])}`)].join('|');
|
|
64
|
-
const debug = (s) => s.startsWith('|debug')
|
|
65
|
-
? /^\|debug\|[^|]*:\d/.test(s) ? 'class="debug rng"'
|
|
66
|
-
: 'class="debug"' : '';
|
|
67
|
-
const toText = (parsed) => `|${parsed.map(compact).join('\n|')}`;
|
|
68
|
-
exports.toText = toText;
|
|
69
|
-
function render(gen, showdown, error, seed, frames, partial = {}) {
|
|
70
|
-
const output = [];
|
|
71
|
-
const buf = [];
|
|
72
|
-
if (seed)
|
|
73
|
-
buf.push(`<h1>0x${seed.toString(16).toUpperCase()}</h1>`);
|
|
74
|
-
let last = undefined;
|
|
75
|
-
for (const frame of frames) {
|
|
76
|
-
buf.push(displayFrame(gen, showdown, frame, last));
|
|
77
|
-
if ('battle' in frame) {
|
|
78
|
-
last = frame.battle;
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
last = frame.seed;
|
|
82
|
-
output.push(frame.chunk);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
buf.push(displayFrame(gen, true, partial, last));
|
|
86
|
-
if (error) {
|
|
87
|
-
const err = error.replaceAll(ROOT + path.sep, '');
|
|
88
|
-
buf.push(`<pre class="error"><code>${escapeHTML(err)}</pre></code>`);
|
|
89
|
-
}
|
|
90
|
-
const type = Array.isArray(last) ? 'showdown' : 'pkmn';
|
|
91
|
-
const render = ('render' in mustache ? mustache : mustache.default).render;
|
|
92
|
-
return (0, html_minifier_1.minify)(render(fs.readFileSync(template(type), 'utf8'), type === 'pkmn'
|
|
93
|
-
? { content: buf.join('') }
|
|
94
|
-
: {
|
|
95
|
-
seed: buf.shift(),
|
|
96
|
-
content: buf.join(''),
|
|
97
|
-
output: output.join('\n'),
|
|
98
|
-
}), { minifyCSS: true, minifyJS: true });
|
|
99
|
-
}
|
|
100
|
-
exports.render = render;
|
|
101
|
-
function displayFrame(gen, showdown, partial, last) {
|
|
102
|
-
const buf = [];
|
|
103
|
-
if ('parsed' in partial && partial.parsed) {
|
|
104
|
-
buf.push('<div class="log">');
|
|
105
|
-
buf.push(`<pre><code>${(0, exports.toText)(partial.parsed)}</code></pre>`);
|
|
106
|
-
buf.push('</div>');
|
|
107
|
-
}
|
|
108
|
-
else if ('chunk' in partial && partial.chunk) {
|
|
109
|
-
buf.push('<div class="log"><pre>');
|
|
110
|
-
for (const line of partial.chunk.split('\n')) {
|
|
111
|
-
buf.push(`<code ${debug(line)}>${line}</code><br />`);
|
|
112
|
-
}
|
|
113
|
-
buf.push('</pre></div>');
|
|
114
|
-
}
|
|
115
|
-
if ('battle' in partial && partial.battle) {
|
|
116
|
-
buf.push(displayBattle(gen, showdown, partial.battle, last));
|
|
117
|
-
}
|
|
118
|
-
else if ('seed' in partial && partial.seed) {
|
|
119
|
-
buf.push(`<div class="seed">${partial.seed.join(', ')}</div>`);
|
|
120
|
-
}
|
|
121
|
-
if (partial.result) {
|
|
122
|
-
const { result, c1, c2 } = partial;
|
|
123
|
-
buf.push('<div class="sides" style="text-align: center;">');
|
|
124
|
-
buf.push(`<pre class="side"><code>${result.p1} -> ${pretty(c1)}</code></pre>`);
|
|
125
|
-
buf.push(`<pre class="side"><code>${result.p2} -> ${pretty(c2)}</code></pre>`);
|
|
126
|
-
buf.push('</div>');
|
|
127
|
-
}
|
|
128
|
-
return buf.join('');
|
|
129
|
-
}
|
|
130
|
-
function displayBattle(gen, showdown, battle, last) {
|
|
131
|
-
const buf = [];
|
|
132
|
-
buf.push('<div class="battle">');
|
|
133
|
-
if (battle.turn) {
|
|
134
|
-
buf.push('<div class="details">');
|
|
135
|
-
buf.push(`<h2>Turn ${battle.turn}</h2>`);
|
|
136
|
-
buf.push('<div class="inner">');
|
|
137
|
-
buf.push(`<div><strong>Last Damage:</strong> ${battle.lastDamage}</div>`);
|
|
138
|
-
buf.push(`<div><strong>Seed:</strong> ${battle.prng.join(', ')}</div>`);
|
|
139
|
-
buf.push('</div>');
|
|
140
|
-
buf.push('</div>');
|
|
141
|
-
}
|
|
142
|
-
buf.push('<div class="sides">');
|
|
143
|
-
const [p1, p2] = Array.from(battle.sides);
|
|
144
|
-
const [o1, o2] = last ? Array.from(last.sides) : [undefined, undefined];
|
|
145
|
-
buf.push(displaySide(gen, showdown, battle, 'p1', p1, o1));
|
|
146
|
-
buf.push(displaySide(gen, showdown, battle, 'p2', p2, o2));
|
|
147
|
-
buf.push('</div>');
|
|
148
|
-
buf.push('</div>');
|
|
149
|
-
return buf.join('');
|
|
150
|
-
}
|
|
151
|
-
function displaySide(gen, showdown, battle, player, side, last) {
|
|
152
|
-
const buf = [];
|
|
153
|
-
buf.push(`<div class="side ${player}">`);
|
|
154
|
-
if (battle.turn) {
|
|
155
|
-
buf.push('<div class="details">');
|
|
156
|
-
const used = side.lastUsedMove ? gen.moves.get(side.lastUsedMove).name : '<em>None</em>';
|
|
157
|
-
buf.push(`<div><strong>Last Used</strong><br />${used}</div>`);
|
|
158
|
-
const selected = side.lastSelectedMove ? gen.moves.get(side.lastSelectedMove) : undefined;
|
|
159
|
-
const move = selected?.name ?? '<em>None</em>';
|
|
160
|
-
const counterable = !!selected && selected.basePower > 0 && selected.id !== 'counter' &&
|
|
161
|
-
(selected.type === 'Normal' || selected.type === 'Fighting');
|
|
162
|
-
console.debug(selected?.name, counterable, side.lastMoveCounterable);
|
|
163
|
-
const mismatch = counterable !== side.lastMoveCounterable ? '*' : '';
|
|
164
|
-
const index = side.lastMoveIndex ? ` (${side.lastMoveIndex})` : '';
|
|
165
|
-
buf.push(`<div><strong>Last Selected</strong><br />${move}${mismatch}${index}</div>`);
|
|
166
|
-
buf.push('</div>');
|
|
167
|
-
}
|
|
168
|
-
if (side.active) {
|
|
169
|
-
buf.push('<div class="active">');
|
|
170
|
-
let prev = undefined;
|
|
171
|
-
if (last) {
|
|
172
|
-
for (const pokemon of last.pokemon) {
|
|
173
|
-
if (pokemon.position === side.active.position) {
|
|
174
|
-
prev = pokemon;
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
buf.push(displayPokemon(gen, showdown, battle, side.active, true, prev));
|
|
180
|
-
buf.push('</div>');
|
|
181
|
-
}
|
|
182
|
-
buf.push('<details class="team">');
|
|
183
|
-
buf.push('<summary><div class="teamicons">');
|
|
184
|
-
let i = 0;
|
|
185
|
-
const b = [];
|
|
186
|
-
for (const pokemon of side.pokemon) {
|
|
187
|
-
if (i === 3)
|
|
188
|
-
b.push('</div><div class="teamicons">');
|
|
189
|
-
b.push(icon(player, pokemon));
|
|
190
|
-
i++;
|
|
191
|
-
}
|
|
192
|
-
buf.push(b.join(''));
|
|
193
|
-
buf.push('</div></summary>');
|
|
194
|
-
for (const pokemon of side.pokemon) {
|
|
195
|
-
buf.push(displayPokemon(gen, showdown, battle, pokemon, false));
|
|
196
|
-
}
|
|
197
|
-
buf.push('</details>');
|
|
198
|
-
buf.push('</div>');
|
|
199
|
-
return buf.join('');
|
|
200
|
-
}
|
|
201
|
-
const STATS = ['hp', 'atk', 'def', 'spa', 'spd', 'spe'];
|
|
202
|
-
function displayPokemon(gen, showdown, battle, pokemon, active, last) {
|
|
203
|
-
const buf = [];
|
|
204
|
-
buf.push('<div class="pokemon">');
|
|
205
|
-
const species = active ? pokemon.species : pokemon.stored.species;
|
|
206
|
-
// HP Bar
|
|
207
|
-
const { title, percent, width, color } = getHP(pokemon);
|
|
208
|
-
buf.push(`<div class="left" title="${title}">`);
|
|
209
|
-
if (!active)
|
|
210
|
-
buf.push(`<div class="position">${POSITIONS[pokemon.position - 1]}</div>`);
|
|
211
|
-
buf.push('<div class="statbar rstatbar" style="display: block; opacity: 1;">');
|
|
212
|
-
buf.push('<span class="name">');
|
|
213
|
-
if (pokemon.status)
|
|
214
|
-
buf.push(displayStatus(pokemon));
|
|
215
|
-
let name = gen.species.get(species).name;
|
|
216
|
-
if (active && pokemon.species !== pokemon.stored.species)
|
|
217
|
-
name = `<em>${name}</em>`;
|
|
218
|
-
buf.push(`<strong>${name} <small>L${pokemon.level}</small></strong>`);
|
|
219
|
-
if (active && pokemon.species !== pokemon.stored.species)
|
|
220
|
-
buf.push('</em>');
|
|
221
|
-
buf.push('</span>');
|
|
222
|
-
buf.push('<div class="hpbar">');
|
|
223
|
-
const style = `width: ${width}; border-right-width: ${percent === 100 ? 1 : 0}px;`;
|
|
224
|
-
const hp = `<div class="hp ${color}" style="${style}"></div>`;
|
|
225
|
-
if (last && last.position === pokemon.position && pokemon.hp < last.hp) {
|
|
226
|
-
const prev = getHP(last);
|
|
227
|
-
const style = `width: ${prev.width}; border-right-width: ${prev.percent === 100 ? 1 : 0}px;`;
|
|
228
|
-
buf.push(`<div class="prevhp ${prev.color ? 'prev' + prev.color : ''}" style="${style}">`);
|
|
229
|
-
buf.push(hp);
|
|
230
|
-
buf.push('</div>');
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
buf.push(hp);
|
|
234
|
-
}
|
|
235
|
-
buf.push(`<div class="hptext">${percent}%</div>`);
|
|
236
|
-
buf.push('</div></div>');
|
|
237
|
-
// Sprite & Types
|
|
238
|
-
buf.push(sprite(showdown, species, pokemon.hp === 0));
|
|
239
|
-
const types = active ? pokemon.types : pokemon.stored.types;
|
|
240
|
-
buf.push('<div class="types">');
|
|
241
|
-
buf.push(typicon(types[0]));
|
|
242
|
-
if (types[0] !== types[1])
|
|
243
|
-
buf.push(typicon(types[1]));
|
|
244
|
-
buf.push('</div>');
|
|
245
|
-
buf.push('</div>');
|
|
246
|
-
buf.push('<div class="right">');
|
|
247
|
-
if (!active)
|
|
248
|
-
buf.push(`<div class="position">${POSITIONS[pokemon.position - 1]}</div>`);
|
|
249
|
-
// Stats & Boosts
|
|
250
|
-
buf.push('<div class="stats"><table><tr>');
|
|
251
|
-
const stats = active ? pokemon.stats : pokemon.stored.stats;
|
|
252
|
-
for (const stat of STATS) {
|
|
253
|
-
if (gen.num === 1 && stat === 'spd')
|
|
254
|
-
continue;
|
|
255
|
-
buf.push(`<th>${gen.stats.display(stat)}</th>`);
|
|
256
|
-
}
|
|
257
|
-
buf.push('</tr><tr>');
|
|
258
|
-
for (const stat of STATS) {
|
|
259
|
-
if (gen.num === 1 && stat === 'spd')
|
|
260
|
-
continue;
|
|
261
|
-
const boost = active ? pokemon.boosts[stat] : 0;
|
|
262
|
-
buf.push(`<td>${displayStat(stats[stat], boost)}</td>`);
|
|
263
|
-
}
|
|
264
|
-
buf.push('</tr></table>');
|
|
265
|
-
if (active) {
|
|
266
|
-
buf.push('<div class="boosts">');
|
|
267
|
-
if (pokemon.boosts.accuracy) {
|
|
268
|
-
buf.push(`<div><strong>Accuracy:</strong> ${displayBoost(pokemon.boosts.accuracy)}</div>`);
|
|
269
|
-
}
|
|
270
|
-
if (pokemon.boosts.evasion) {
|
|
271
|
-
buf.push(`<div><strong>Evasion:</strong> ${displayBoost(pokemon.boosts.evasion)}</div>`);
|
|
272
|
-
}
|
|
273
|
-
buf.push('</div>');
|
|
274
|
-
}
|
|
275
|
-
buf.push('</div>');
|
|
276
|
-
// Moves
|
|
277
|
-
buf.push('<div class="moves"><ul>');
|
|
278
|
-
const moves = active ? pokemon.moves : pokemon.stored.moves;
|
|
279
|
-
for (const move of moves) {
|
|
280
|
-
const name = gen.moves.get(move.id).name;
|
|
281
|
-
const maxpp = Math.min(gen.moves.get(move.id).pp / 5 * 8, gen.num === 1 ? 61 : 64);
|
|
282
|
-
const disabled = !move.pp || move.disabled ? 'disabled' : '';
|
|
283
|
-
const title = move.disabled ? `title="Disabled: ${move.disabled}"` : '';
|
|
284
|
-
const pp = `<small>(${move.pp}/${maxpp})</small>`;
|
|
285
|
-
buf.push(`<li class="${disabled}" ${title}>${name} ${pp}</li>`);
|
|
286
|
-
}
|
|
287
|
-
buf.push('</ul></div>');
|
|
288
|
-
// Volatiles
|
|
289
|
-
if (active) {
|
|
290
|
-
buf.push('<div class="volatiles">');
|
|
291
|
-
for (const v in pokemon.volatiles) {
|
|
292
|
-
const volatile = v;
|
|
293
|
-
const [name, type] = VOLATILES[volatile];
|
|
294
|
-
let data = '';
|
|
295
|
-
if (['binding', 'confusion', 'substitute'].includes(volatile)) {
|
|
296
|
-
data = Object.values(pokemon.volatiles[volatile])[0].toString();
|
|
297
|
-
}
|
|
298
|
-
else if (volatile === 'bide') {
|
|
299
|
-
const val = pokemon.volatiles[volatile];
|
|
300
|
-
data = `${val.duration} (${val.damage})`;
|
|
301
|
-
}
|
|
302
|
-
else if (volatile === 'rage') {
|
|
303
|
-
const val = pokemon.volatiles[volatile];
|
|
304
|
-
data = val.accuracy ? val.accuracy.toString() : '';
|
|
305
|
-
}
|
|
306
|
-
else if (volatile === 'thrashing') {
|
|
307
|
-
const val = pokemon.volatiles[volatile];
|
|
308
|
-
data = `${val.duration}${val.accuracy ? ` (${val.accuracy})` : ''}`;
|
|
309
|
-
}
|
|
310
|
-
else if (volatile === 'transform') {
|
|
311
|
-
const { player, slot } = pokemon.volatiles[volatile];
|
|
312
|
-
const p = +player.charAt(1) - 1;
|
|
313
|
-
let i = 0;
|
|
314
|
-
for (const side of battle.sides) {
|
|
315
|
-
if (i++ === p) {
|
|
316
|
-
i = 1;
|
|
317
|
-
for (const poke of side.pokemon) {
|
|
318
|
-
if (i++ === slot) {
|
|
319
|
-
data = `${player}${POSITIONS[poke.position - 1]}`;
|
|
320
|
-
break;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
break;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
data = (data ? `${name}: ${data}` : name).replace(' ', ' ');
|
|
328
|
-
buf.push(`<span class="volatile ${type}">${data}</span>`);
|
|
329
|
-
}
|
|
330
|
-
buf.push('</div>');
|
|
331
|
-
}
|
|
332
|
-
buf.push('</div>');
|
|
333
|
-
buf.push('</div>');
|
|
334
|
-
return buf.join('');
|
|
335
|
-
}
|
|
336
|
-
function escapeHTML(str) {
|
|
337
|
-
return (str
|
|
338
|
-
.replace(/&/g, '&')
|
|
339
|
-
.replace(/</g, '<')
|
|
340
|
-
.replace(/>/g, '>')
|
|
341
|
-
.replace(/"/g, '"')
|
|
342
|
-
.replace(/'/g, ''')
|
|
343
|
-
.replace(/\//g, '/')
|
|
344
|
-
.replace(/\n/g, '<br />'));
|
|
345
|
-
}
|
|
346
|
-
function getHP(pokemon) {
|
|
347
|
-
const title = `${pokemon.hp}/${pokemon.stats.hp}`;
|
|
348
|
-
const ratio = pokemon.hp / pokemon.stats.hp;
|
|
349
|
-
let percent = Math.ceil(ratio * 100);
|
|
350
|
-
if ((percent === 100) && (ratio < 1.0)) {
|
|
351
|
-
percent = 99;
|
|
352
|
-
}
|
|
353
|
-
const width = (pokemon.hp === 1 && pokemon.stats.hp > 45)
|
|
354
|
-
? '1px' : ratio === 1.0
|
|
355
|
-
? 'var(--hp-bar)' : `calc(${ratio} * var(--hp-bar))`;
|
|
356
|
-
const color = ratio > 0.5 ? '' : ratio > 0.2 ? 'hp-yellow' : 'hp-red';
|
|
357
|
-
return { title, percent, width, color };
|
|
358
|
-
}
|
|
359
|
-
function displayStatus(pokemon) {
|
|
360
|
-
const c = pokemon.status === 'tox' ? 'psn' : pokemon.status;
|
|
361
|
-
let t = '';
|
|
362
|
-
if (pokemon.statusData.sleep)
|
|
363
|
-
t += `Sleep: ${pokemon.statusData.sleep}`;
|
|
364
|
-
if (pokemon.status === 'tox' || pokemon.statusData.toxic) {
|
|
365
|
-
t += `Toxic: ${pokemon.statusData.toxic}`;
|
|
366
|
-
}
|
|
367
|
-
if (t)
|
|
368
|
-
t = `title="${t}"`;
|
|
369
|
-
const s = pokemon.statusData.self ? 'slf' : pokemon.status;
|
|
370
|
-
return `<span class="status ${c}" ${t}>${s}</span>`;
|
|
371
|
-
}
|
|
372
|
-
function displayStat(stat, boost) {
|
|
373
|
-
if (!boost)
|
|
374
|
-
return `${stat}`;
|
|
375
|
-
if (boost > 0)
|
|
376
|
-
return `<span class="good">${stat} (+${boost})</span>`;
|
|
377
|
-
return `<span class="bad">${stat} (${boost})</span>`;
|
|
378
|
-
}
|
|
379
|
-
function displayBoost(boost) {
|
|
380
|
-
if (boost > 0)
|
|
381
|
-
return `<span class="good">+${boost}</span>`;
|
|
382
|
-
return `<span class="bad">${boost}</span>`;
|
|
383
|
-
}
|
|
384
|
-
function icon(side, pokemon) {
|
|
385
|
-
const fainted = pokemon.hp === 0;
|
|
386
|
-
const icon = img_1.Icons.getPokemon(pokemon.stored.species, { side, fainted, domain: 'pkmn.cc' });
|
|
387
|
-
return `<span style="${icon.style}"></span>`;
|
|
388
|
-
}
|
|
389
|
-
function sprite(showdown, species, fainted) {
|
|
390
|
-
const s = img_1.Sprites.getPokemon(species, { gen: showdown ? 'gen1' : 'gen1rb' });
|
|
391
|
-
let style = s.pixelated ? 'image-rendering: pixelated;' : '';
|
|
392
|
-
if (fainted)
|
|
393
|
-
style += 'opacity: 0.3; filter: grayscale(100%) brightness(.5);';
|
|
394
|
-
return `<img class="sprite" src="${s.url}" width="${s.w}" height="${s.h}" style="${style}" />`;
|
|
395
|
-
}
|
|
396
|
-
function typicon(type) {
|
|
397
|
-
const i = img_1.Icons.getType(type);
|
|
398
|
-
const style = 'image-rendering: pixelated;';
|
|
399
|
-
return `<img class="icon" src="${i.url}" width="${i.w}" height="${i.h}" style="${style}" />`;
|
|
400
|
-
}
|
|
401
|
-
//# sourceMappingURL=display.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"display.js","sourceRoot":"","sources":["../../src/test/display.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAG7B,mCAAyC;AACzC,iDAAqC;AACrC,mDAAqC;AAIrC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACjD,MAAM,QAAQ,GAAG,CAAC,CAAsB,EAAE,EAAE,CAC1C,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;AAE9D,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,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