@korial29/tiny-fps 1.10.1 → 1.11.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 (41) hide show
  1. package/dist/assets/{room-BPH05sFp.js → room-CmFLG8k9.js} +2 -2
  2. package/dist/brick-D8hJf8WJ.js +1 -0
  3. package/dist/index.js +8 -8
  4. package/dist/landfall-BYpMbytZ.js +21 -0
  5. package/dist/local.js +1 -1
  6. package/dist/paint-MnJfhuX-.js +4 -0
  7. package/dist/room.js +1 -1
  8. package/dist/server.js +1 -1
  9. package/dist/stone-BuPL-95D.js +1 -0
  10. package/dist/{textures-Big8KwfG.js → textures--_oN1PjN.js} +1 -1
  11. package/dist/tranquility-CT6deZ6t.js +1 -0
  12. package/dist/types/client/combat/constants.d.ts +24 -0
  13. package/dist/types/client/combat/create.d.ts +21 -0
  14. package/dist/types/client/combat/events.d.ts +41 -0
  15. package/dist/types/client/combat/types.d.ts +23 -0
  16. package/dist/types/client/combat.d.ts +3 -76
  17. package/dist/types/client/gun/ammo.d.ts +1 -1
  18. package/dist/types/client/hud/create.d.ts +7 -0
  19. package/dist/types/client/hud/css.d.ts +2 -0
  20. package/dist/types/client/hud/format.d.ts +26 -0
  21. package/dist/types/client/hud/markup.d.ts +2 -0
  22. package/dist/types/client/hud/text.d.ts +29 -0
  23. package/dist/types/client/hud/types.d.ts +148 -0
  24. package/dist/types/client/hud.d.ts +5 -203
  25. package/dist/types/client/hulk/common.d.ts +1 -1
  26. package/dist/types/client/hulk/types.d.ts +2 -0
  27. package/dist/types/client/index.d.ts +2 -51
  28. package/dist/types/client/paint.d.ts +16 -0
  29. package/dist/types/client/play/constants.d.ts +11 -0
  30. package/dist/types/client/play/entry.d.ts +13 -0
  31. package/dist/types/client/play/match.d.ts +8 -0
  32. package/dist/types/client/play/types.d.ts +39 -0
  33. package/dist/types/client/render/shader.d.ts +4 -0
  34. package/dist/types/client/render/shots.d.ts +1 -1
  35. package/dist/types/shared/beach.d.ts +2 -0
  36. package/package.json +1 -1
  37. package/dist/brick-KajeVVVE.js +0 -1
  38. package/dist/landfall-CSZGx2iA.js +0 -21
  39. package/dist/paint-DipbUTzI.js +0 -4
  40. package/dist/stone-DgvIDb2G.js +0 -1
  41. package/dist/tranquility-BGx_-pTQ.js +0 -1
@@ -1,203 +1,5 @@
1
- import type { Result } from '../shared/protocol';
2
- import type { Choice, PlayerState, Rover, Snapshot } from '../shared/types';
3
- import type { Mark } from './marks';
4
- export declare const rim: () => [number, number][];
5
- export declare const HUD_CSS: string;
6
- /** The menu of a game paused by Escape (the user, 2026-11-12): play on, then the two parts of the title screen it opens, then leave. */
7
- export declare const PAUSE: string[];
8
- /** The tabs of the title screen's menu, the first one shown first. */
9
- export declare const TABS: string[];
10
- /** The Audio panel's sliders (the user, 2026-11-20): a name, and its bus in LEVELS (audio.ts). */
11
- export declare const MIXES: [name: string, bus: number][];
12
- /** The characters' first names (the user, 2026-11-11: names, not "man" and "woman"), in BODY's order, and the size of the character's picture in pixels. */
13
- export declare const CAST: string[];
14
- export declare const SHOT: number[];
15
- /** The size of a haircut's picture, pixels. */
16
- export declare const HEAD_PX = 112;
17
- /** The haircuts of each body, in HAIRS_N's order: the man's by length (LENGTHS, soldier.ts), the woman's STYLE (hair.ts). */
18
- export declare const HAIR_NAMES: string[][];
19
- export declare const ROLES: [name: string, pros: string, cons: string, where: string][];
20
- /** A skin tone (TONES, linear) as a CSS colour. */
21
- export declare const swatch: (t: number[]) => string;
22
- /** Capture the flag in a few lines, with the room's default rules. */
23
- export declare const GOAL: string[];
24
- /**
25
- * The controls of the title screen, a group each: the caps of a row split by `|` (a `+`, `/`, `or`
26
- * or `twice` between them stays text), what they do, and the KeyboardEvent.codes the row tells,
27
- * which together must be all of input.ts's CODES.
28
- */
29
- export declare const CONTROLS: [group: string, rows: [keys: string, does: string, codes?: string][]][];
30
- /** Seconds the way out is shown after sitting down. */
31
- export declare const OUT_HINT = 4;
32
- /** The prompt of a glory kill on offer, drawn pulsing. */
33
- export declare const GLORY_ACT = "glory kill";
34
- /**
35
- * What E does for a player on foot: 'drive' near a rover whose wheel is free, 'ride' when only the
36
- * seat beside it is, or when he carries a flag (a carrier does not drive), 'fly' near a ship that
37
- * is there and has no pilot (a carrier does not fly), '' with no free seat in reach, seated or
38
- * down. The nearest vehicle with a seat for him counts, as the room judges it (nearby(), free()).
39
- */
40
- export declare const boarding: (me: Pick<PlayerState, "x" | "y" | "z" | "mode" | "down"> | undefined, rovers: readonly Rover[], carrying?: boolean) => "" | "drive" | "ride" | "fly";
41
- /** The speed-o-meter's reading of a rover: whole km/h over the ground. */
42
- export declare const kmh: (r: Pick<Rover, "vx" | "vz">) => number;
43
- /** What the end screen shows: the final captures and what each player did. */
44
- export interface Summary {
45
- score: [number, number];
46
- players: Result[];
47
- }
48
- export interface Hud {
49
- /**
50
- * The title screen with `status` on its button, "Click to play" or why not; '' hides it. `name`,
51
- * `tag` and `lore` are the map's (WorldDef).
52
- */
53
- title(status: string, name: string, tag?: string, lore?: string): void;
54
- /**
55
- * Whether the player has been in the game: then the title screen opens on the pause menu (PAUSE)
56
- * rather than the whole panel, until he plays again. `fresh`: he has not played yet (he comes from
57
- * the character screen), its first button reads Play.
58
- */
59
- paused(on: boolean, fresh?: boolean): void;
60
- /**
61
- * The character on the title screen: `pick` is told the whole choice (the body, the skin, the
62
- * haircut, the class) each time the player changes a part of it. Returns the canvas of his live
63
- * picture (SHOT pixels).
64
- */
65
- cast(pick: (c: Choice & {
66
- body: number;
67
- }) => void, preview?: (active: boolean) => void): HTMLCanvasElement;
68
- /** Shows the loader over the character portrait while its deferred render is pending. */
69
- previewLoading(loading: boolean): void;
70
- /** The pictures of the haircuts on offer, in their order (HEAD_PX square): the own head with each. */
71
- heads(): HTMLCanvasElement[];
72
- /** The own player's magazines, as his class holds them (Kit's mag, cap, clip): the spare ones counted by them. */
73
- magazines(sizes: number[]): void;
74
- /** Shows or hides the muted mark. */
75
- mute(on: boolean): void;
76
- /**
77
- * The score and the clock at the top, and under them the state of both flags: at home, taken by
78
- * a player (`who` gives his name) or dropped with the seconds left. Over, the clock reads END.
79
- */
80
- match(m: Pick<Snapshot, 'score' | 'clock' | 'over' | 'flags'>, who: (id: number) => string): void;
81
- /** The markers of this frame (see marks.ts), in the order given; the ones before are removed. */
82
- marks(list: Mark[]): void;
83
- /** The orbital station's mission line (mission.ts), `hot` when urgent; none hides it. */
84
- mission(text?: string, hot?: boolean): void;
85
- /**
86
- * The Hunter's current local vision mode, `text` empty for the plain view; with `hint`, the V key
87
- * is shown with it, blinking in the plain view.
88
- */
89
- hunterVision(text?: string, scoped?: boolean, hint?: boolean): void;
90
- /** The Predator-style shoulder-laser sight, at a screen point and progressing to a lock. */
91
- hunterAim(at?: [number, number], progress?: number, now?: number): void;
92
- /** The dark rim of a space helmet's visor around the screen: on while the own player wears one, off otherwise. */
93
- visor(on: boolean): void;
94
- /** The red vignette of a tackle, 0 (none) to 1 (full). */
95
- hurt(level: number): void;
96
- /** The orbital strike's light over the view, 0 (none) to 1 (all white), over the down screen. */
97
- glare(level: number): void;
98
- /**
99
- * The health as pips out of HP_MAX, and the weapon in hand: the ammo counter with the gun glyph,
100
- * the katana glyph when `wield` (or when it is all there is), or the rail gun's lightning left
101
- * (charge(), 99 full) with the gun glyph in violet when `railed`. -1 ammo is no gun, `blade` is a
102
- * katana carried, `rail` the rail gun's lightning (-1 none); two or more carried show their slots (1 gun, 2 katana, 3 rail gun)
103
- * over the glyph, none hides it. `loaded` is what the battery or the capsule of the gun in hand
104
- * holds, in the same count: big, with the rest after it as the magazines it makes (an open one for
105
- * a part) over its count; faded while `swapping` it. `rifle` is the
106
- * laser rifle's rounds (-1 none), shown with the glyph in red when `rifled` (slot 4), with the
107
- * `nades` left in its launcher as dots after the count, hollow for the ones spent. `armor` shows
108
- * as gold pips after the health's, only the ones he has.
109
- */
110
- vitals(hp: number, ammo: number, blade?: boolean, wield?: boolean, rail?: number, railed?: boolean, loaded?: number, swapping?: boolean, rifle?: number, rifled?: boolean, nades?: number, armor?: number, fists?: boolean,
111
- /** The Hunter's pistol is in hand: `ammo` and `loaded` are its own. */
112
- sided?: boolean): void;
113
- /** The health the own player's class has at most (Kit.hp): as many pips. */
114
- life(max: number): void;
115
- /** A hit marker on the crosshair for a moment: a ball or a cut of the own player hit. */
116
- hit(): void;
117
- /** The face over the health, frame `n` of face.ts (-1 hides it). */
118
- face(n: number): void;
119
- /**
120
- * The own player's character (BODY): the face is hers when she is the woman. `c` is what the
121
- * roster says he picked, shown chosen on the title screen, and `roles` the classes the map offers
122
- * (ROLE): the others are hidden.
123
- */
124
- wear(body: number, c?: Choice, roles?: number[]): void;
125
- /**
126
- * A saber lock: the gauge of the tug of war under the crosshair, with `lead` the own side's, -1
127
- * (the foe wins) to 1 (he wins); undefined hides it.
128
- */
129
- duel(lead: number | undefined): void;
130
- /** The state of being down: `level` 0 (up) to 1 hides or greys the screen, `left` seconds till the respawn. */
131
- down(level: number, left: number, what?: string): void;
132
- /** A line in the middle of the top of the screen in `team`'s colour, for a few seconds; a newer one replaces it. */
133
- banner(text: string, team?: number): void;
134
- /** The own frags this match, top left. */
135
- frags(n: number): void;
136
- /**
137
- * Under the banner for FRAG_MS: `text` ("Bob killed!", '' for none) and the announcer's `award`
138
- * in gold under it; a newer one replaces both.
139
- */
140
- fragged(text: string, award?: string): void;
141
- /**
142
- * A line of the kill feed, top right: `by` put `who` down, each [name, team] in his team's
143
- * colour. The newest at the bottom, FEED_MAX at most, each gone after FEED_MS.
144
- */
145
- feed(by: [string, number], who: [string, number]): void;
146
- /**
147
- * An ally on the radio: the small screen with `name` in `team`'s colour opens for `s` seconds
148
- * (and COMM_TAIL more), a newer one taking its place, and shows his `face` (COMM pixels square)
149
- * as a scrambled transmission with bad reception (signal.ts), static alone without one.
150
- */
151
- comm(name: string, team: number, s: number, face?: CanvasImageSource): void;
152
- /**
153
- * The rover: `act` is what E does now ('drive', 'ride', 'get out', GLORY_ACT which pulses; '' hides the prompt), and
154
- * `speed` the km/h shown at the wheel, where the gun and the crosshair then hide; undefined off it.
155
- */
156
- rover(act: string, speed?: number): void;
157
- /** The camera out of the head for a glory kill (killcam.ts): the crosshair, the gun and the visor's rim go. */
158
- outside(on: boolean): void;
159
- /** The rover's reticle, where its lasers cross: `at` on screen in [0, 1] from the top left; undefined hides it. */
160
- aim(at?: [number, number]): void;
161
- /** The ship flown: its missiles and height, and how near its limits are (limits(), ship.ts); undefined hides it. */
162
- ship(s?: ShipPanel): void;
163
- /**
164
- * A vehicle's health, of VEHICLE.HP: `own` in pips for who is seated in it (undefined on foot),
165
- * and `near` as a small bar over a vehicle close by, `at` on screen in [0, 1] from the top left.
166
- */
167
- hull(own?: number, near?: {
168
- hp: number;
169
- at: [number, number];
170
- }): void;
171
- /** The end screen with the result and each player's captures, frags and returns, `next` seconds before the next match; undefined hides it. */
172
- end(sum: Summary | undefined, next: number): void;
173
- }
174
- /** What the ship's panel shows. */
175
- export interface ShipPanel {
176
- nades: number;
177
- /** Metres over the crater's floor. */
178
- alt: number;
179
- /** limits(): the ceiling's and the edge's nearness, 1 at the limit. */
180
- up: number;
181
- out: number;
182
- }
183
- /** The warning of the nearest limit once one is within its last half of WARN, or ''. */
184
- export declare const warning: (up: number, out: number) => string;
185
- /** The ship's height on its panel: metres under the edge of space, kilometres in orbit. */
186
- export declare const height: (alt: number) => string;
187
- export declare const BANNER_MS = 2800;
188
- /** Milliseconds an own frag's name and award stay, and a line of the kill feed; the feed's lines. */
189
- export declare const FRAG_MS = 2400;
190
- export declare const FEED_MS = 6000;
191
- export declare const FEED_MAX = 5;
192
- /** The radio screen's canvas, pixels a side, and the seconds it stays after its line. */
193
- export declare const COMM = 192;
194
- export declare const COMM_TAIL = 0.5;
195
- export declare const HIT_MS = 140;
196
- /** m:ss. */
197
- export declare const clock: (s: number) => string;
198
- /**
199
- * Appends the HUD to `screen`, whose stylesheet has HUD_CSS. `play` is the title screen's button:
200
- * the click that starts the game (the panel takes its other clicks, the view round it plays too).
201
- * `recast`: what the pause menu's Character opens instead of the panel's part (the whole-page screen).
202
- */
203
- export declare const createHud: (screen: HTMLElement, play?: () => void, quit?: () => void, recast?: () => void) => Hud;
1
+ export * from './hud/css';
2
+ export * from './hud/text';
3
+ export * from './hud/types';
4
+ export * from './hud/format';
5
+ export * from './hud/create';
@@ -1,6 +1,6 @@
1
1
  import type { Piece } from '../../shared/beach';
2
2
  import type { V, Mat } from './types';
3
- export declare const tex: (l: number, k?: number, s?: number) => Mat;
3
+ export declare const tex: (l: number, k?: number, s?: number, r?: boolean) => Mat;
4
4
  export declare const ink: (c: V, k?: number, l?: number) => Mat;
5
5
  export declare const MID: number;
6
6
  export declare const WHITE: Mat;
@@ -4,4 +4,6 @@ export interface Mat {
4
4
  l: number;
5
5
  c: V;
6
6
  s: number;
7
+ /** Swaps the texture's u and v: wood's grain then runs up an upright face, along a pole. */
8
+ r?: boolean;
7
9
  }
@@ -1,51 +1,2 @@
1
- import type { PlayerInfo, SocketLike } from '../shared/types';
2
- export type { PlayerInfo, SocketLike } from '../shared/types';
3
- export interface TinyFpsOptions {
4
- name: string;
5
- /** WebSocket URL, e.g. ws://localhost:8787/demo (the path picks the room). */
6
- url?: string;
7
- /** Any WebSocket-like socket, e.g. localSocket('room') from '@korial29/tiny-fps/local'. */
8
- socket?: SocketLike;
9
- /**
10
- * The map's key, 'highline' (the default) or 'tranquility', built while the room is joined. The
11
- * room's roster says the map it plays, and the game follows it: the host picks it.
12
- */
13
- map?: string;
14
- /** The character to play (BODY): the man (0, the default) or the woman (1). The look only. */
15
- body?: number;
16
- /**
17
- * Opens on the character screen (lobby.ts): the room is joined and the map loads only once its
18
- * Start is pressed, with the character picked there. Without it, the room is joined at once.
19
- */
20
- cast?: boolean;
21
- /**
22
- * false: no spoken voice, neither the announcer's nor the players' (taunts, cries, radio). Their
23
- * sprites (about 190 KB of Opus, or 465 KB of MP3) are then never downloaded. The synth's sounds,
24
- * the music and the announcer's words on screen stay.
25
- */
26
- voices?: boolean;
27
- }
28
- /**
29
- * quit: the player left from the pause menu (Escape, then Quit); the page decides where he goes.
30
- * start: the character screen's Start (TinyFpsOptions.cast), the map loading from then on.
31
- */
32
- export type TinyFpsEvent = 'roster' | 'open' | 'close' | 'quit' | 'start';
33
- export interface TinyFps {
34
- on(ev: TinyFpsEvent, cb: () => void): void;
35
- /** Everyone in the room, the own player included. */
36
- players(): PlayerInfo[];
37
- /** Closes the socket, stops the loop and removes the canvas. */
38
- destroy(): void;
39
- }
40
- /**
41
- * Mounts the game in a Shadow DOM inside container: one WebGL2 canvas filling it, a click locks the
42
- * pointer, the mouse looks, WASD (ZQSD on AZERTY) moves, Shift sprints, Space jumps (again in the
43
- * air for a second jump), C crouches and slides, a direction key pressed twice dashes, E gets in
44
- * and out of a rover. Without the lock the title screen shows: a menu, the character to play, the
45
- * mode, the map and the controls.
46
- *
47
- * The socket is this function's; the scene of one map is play()'s, behind a socket of its own.
48
- * When the room plays another map, the scene goes and one of the new map takes its place on the
49
- * same connection: the room keeps the player, his team and the host.
50
- */
51
- export declare const tinyFps: (container: HTMLElement, opts: TinyFpsOptions) => TinyFps;
1
+ export type { PlayerInfo, SocketLike, TinyFps, TinyFpsEvent, TinyFpsOptions } from './play/types';
2
+ export { tinyFps } from './play/entry';
@@ -25,3 +25,19 @@ export declare const CANOPY = -7;
25
25
  export declare const CANOPY_GLSL: (fog: string) => string;
26
26
  /** Its mirror, in main(), after the light: `k` the sky its normal `m` reflects (the lit sand under the horizon), `fr` the fresnel term; and the sand's light thrown back up under it. */
27
27
  export declare const GLOSS = "c+=hk*(mix(vec3(.8,.72,.56),k,smoothstep(-.3,.05,r.y))*(.15+.6*fr)+vec3(.3,.27,.21)*clamp(.5-m.y,0.,1.));";
28
+ /**
29
+ * The camps' tarpaulins (debris.ts shelter()): lit cloth in the team's colour (c.x, c.y, c.w), matt.
30
+ * Between SAND's band and -1.1, where the GLOSS spec starts, and under -1.08, where the runners'
31
+ * own layers end.
32
+ */
33
+ export declare const TARP = -1.098;
34
+ /** Metres of hem drawn down each long edge of a tarpaulin: the shader frays it shorter. */
35
+ export declare const HEM = 1;
36
+ /**
37
+ * Its pixel, in main(), before the light: a canvas weave of 4 mm threads that fades before it
38
+ * aliases, slow blotches of sun-bleach and dirt. Torn (the user, 2026-11-26: tears less angular):
39
+ * holes through the roof where a slow noise peaks, their edges frayed by finer ones and scorched
40
+ * dark; the hems, hanging from AWNING, cut to tatters of their own lengths, slit up from the foot.
41
+ * By world position, so the roof's two faces tear alike.
42
+ */
43
+ export declare const TARP_GLSL: string;
@@ -0,0 +1,11 @@
1
+ export declare const STEP: number;
2
+ /** Steps run in one frame at most: a background tab catches up by this much, not by minutes. */
3
+ export declare const MAX_STEPS = 5;
4
+ /** The Hunter's harpoon scope: the view's field of view change in degrees (70 to 18, about 4×) and its ease-in time (s). */
5
+ export declare const SCOPE_FOV: number, SCOPE_IN: number;
6
+ /** Metres within which a vehicle shows its health over it: a rover, a ship. */
7
+ export declare const NEAR_HULL: number[];
8
+ /** Ms after a hard landing during which a loss of health is the fall's, not a foe's: the snapshot's lag. */
9
+ export declare const FELL = 500;
10
+ /** Frames a second of the menu's character picture: each is a frame of the scene of its own. */
11
+ export declare const PREVIEW_HZ = 30;
@@ -0,0 +1,13 @@
1
+ import type { TinyFps, TinyFpsOptions } from './types';
2
+ /**
3
+ * Mounts the game in a Shadow DOM inside container: one WebGL2 canvas filling it, a click locks the
4
+ * pointer, the mouse looks, WASD (ZQSD on AZERTY) moves, Shift sprints, Space jumps (again in the
5
+ * air for a second jump), C crouches and slides, a direction key pressed twice dashes, E gets in
6
+ * and out of a rover. Without the lock the title screen shows: a menu, the character to play, the
7
+ * mode, the map and the controls.
8
+ *
9
+ * The socket is this function's; the scene of one map is play()'s, behind a socket of its own.
10
+ * When the room plays another map, the scene goes and one of the new map takes its place on the
11
+ * same connection: the room keeps the player, his team and the host.
12
+ */
13
+ export declare const tinyFps: (container: HTMLElement, opts: TinyFpsOptions) => TinyFps;
@@ -0,0 +1,8 @@
1
+ import type { SocketLike } from '../../shared/types';
2
+ /**
3
+ * The game on one map, talking through `ws`: the scene, the HUD, the input, the sound. `progress`
4
+ * hears each step of STEPS (loading.ts) as it starts, then STEPS.length once the first frame is drawn.
5
+ */
6
+ export declare const play: (container: HTMLElement, key: string, ws: SocketLike, quit?: () => void, progress?: (step: number) => void, period?: number, cast?: boolean, voices?: boolean, look?: import("../render").Decor) => {
7
+ destroy(): void;
8
+ };
@@ -0,0 +1,39 @@
1
+ import type { PlayerInfo, SocketLike } from '../../shared/types';
2
+ export type { PlayerInfo, SocketLike } from '../../shared/types';
3
+ export interface TinyFpsOptions {
4
+ name: string;
5
+ /** WebSocket URL, e.g. ws://localhost:8787/demo (the path picks the room). */
6
+ url?: string;
7
+ /** Any WebSocket-like socket, e.g. localSocket('room') from '@korial29/tiny-fps/local'. */
8
+ socket?: SocketLike;
9
+ /**
10
+ * The map's key, 'highline' (the default) or 'tranquility', built while the room is joined. The
11
+ * room's roster says the map it plays, and the game follows it: the host picks it.
12
+ */
13
+ map?: string;
14
+ /** The character to play (BODY): the man (0, the default) or the woman (1). The look only. */
15
+ body?: number;
16
+ /**
17
+ * Opens on the character screen (lobby.ts): the room is joined and the map loads only once its
18
+ * Start is pressed, with the character picked there. Without it, the room is joined at once.
19
+ */
20
+ cast?: boolean;
21
+ /**
22
+ * false: no spoken voice, neither the announcer's nor the players' (taunts, cries, radio). Their
23
+ * sprites (about 190 KB of Opus, or 465 KB of MP3) are then never downloaded. The synth's sounds,
24
+ * the music and the announcer's words on screen stay.
25
+ */
26
+ voices?: boolean;
27
+ }
28
+ /**
29
+ * quit: the player left from the pause menu (Escape, then Quit); the page decides where he goes.
30
+ * start: the character screen's Start (TinyFpsOptions.cast), the map loading from then on.
31
+ */
32
+ export type TinyFpsEvent = 'roster' | 'open' | 'close' | 'quit' | 'start';
33
+ export interface TinyFps {
34
+ on(ev: TinyFpsEvent, cb: () => void): void;
35
+ /** Everyone in the room, the own player included. */
36
+ players(): PlayerInfo[];
37
+ /** Closes the socket, stops the loop and removes the canvas. */
38
+ destroy(): void;
39
+ }
@@ -19,6 +19,10 @@ export declare const PLEATS = 38;
19
19
  export declare const PITCH = 620;
20
20
  /** Metres a height of 1 in a texture's alpha stands for. */
21
21
  export declare const RELIEF = 0.06;
22
+ /** Landfall's floors' grating stands out this much more than RELIEF (the user, 2026-11-26: a bump map on it); no other map's GRATE changes. */
23
+ export declare const GRATE_RELIEF = 4;
24
+ /** Landfall's steel and plates, shiny (the user, 2026-11-26): their Blinn-Phong strength and exponent, sharper than SPEC's; they mirror the sky more too, in shade as in the sun. */
25
+ export declare const BRIGHT_METAL: number[];
22
26
  /** Metres from the eye where the mirrors begin to fade to the sky, and where they end. */
23
27
  export declare const MIRROR_NEAR: number[];
24
28
  /** Landfall's haze over a pixel `ds` metres from the eye, for what its own code draws (the sea, the smoke). */
@@ -47,7 +47,7 @@ export declare const backing: (cw: number, ch: number, dpr: number) => [number,
47
47
  * player who joins or change in the menu mid-match), the xenomorph's skins and rigid pieces (its
48
48
  * close skull alone took a frame of 70 ms), the racks' weapons and the textures. An armour's
49
49
  * recipe is a step of many (preparing()), a slice of its skin at a time. createRenderer()
50
- * runs them at once; index.ts runs them one task each before, so the loading screen paints on.
50
+ * runs them at once; play/entry.ts runs them one task each before, so the loading screen paints on.
51
51
  * `own` is the own runner's build, whose first-person body is drawn close: a match's, not the
52
52
  * character screen's. `hunter`: the Hunter's pieces too (warmHunter()), which the character
53
53
  * screen draws on a tile and a match only once one comes.
@@ -189,6 +189,8 @@ export declare const edge: (l: number[][], v: number) => number;
189
189
  export declare const FIRES: number[][];
190
190
  /** Metres the flames at a fire's foot reach out from its middle and up from it: smoke.ts stands three balls of 0.55 m within 0.6 of the foot's radius, up to 2.3 m. */
191
191
  export declare const FLAME: number[];
192
+ /** The top of the camps' tarpaulins: their hems hang from it (client paint.ts TARP_GLSL). */
193
+ export declare const AWNING: number;
192
194
  /**
193
195
  * What the scenery draws on the map's boxes, both halves, blue's mirrored: the hull's sections
194
196
  * (x0, x1, the axis' height), every piece of the wreck and of the camps by kind (skin, deck,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@korial29/tiny-fps",
3
3
  "description": "Tiny multiplayer first-person rooftop game for the browser: raw WebGL, zero runtime dependencies, WebSocket or same-browser multi-tab play.",
4
4
  "license": "Apache-2.0",
5
- "version": "1.10.1",
5
+ "version": "1.11.0",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"
@@ -1 +0,0 @@
1
- var e,t=.4,n=1.8,r=1.6,i=1.55,a=.5,o=2.4,s=.03,c=[`Red`,`Blue`],l=[`#ff3d4f`,`#2f80ff`],u={ticks:20,strike:6,reach:1.4,arc:.6,hp:0,hold:-1,knock:0},d={JAB:0,CROSS:1,HOOK:2,LUNGE:3,CLAW_L:4,CLAW_R:5},f={ticks:16,strike:5,reach:1.8,arc:.7,hp:2,hold:-1,knock:0},p=[u,u,{ticks:28,strike:9,reach:1.5,arc:.9,hp:1,hold:-1,knock:1.4},{ticks:26,strike:7,reach:2.2,arc:.5,hp:1,hold:-1,knock:1.2},f,f],m=[2,6],h={STAB:0,SWEEP_L:1,SWEEP_R:2,LASH:3,SPIN:6,LEAP:7},g=[{ticks:52,strike:26,reach:3.4,arc:.25,hp:m[0],hold:18,knock:0},{ticks:50,strike:26,reach:2.8,arc:1.1,hp:m[0],hold:16,knock:0},{ticks:50,strike:26,reach:2.8,arc:1.1,hp:m[0],hold:16,knock:0},{ticks:54,strike:28,reach:3.1,arc:.4,hp:m[0],hold:20,knock:0},f,f,{ticks:60,strike:30,reach:2.6,arc:Math.PI,hp:3,hold:18,knock:0},{ticks:63,strike:52,reach:2.8,arc:.6,hp:5,hold:32,knock:0}],[_,v]=[.75,1],[y,b,x,ee]=[3,2.5,1,120],te={TICKS:88,REACH:1.3,FIST:.85,CUTS:[26,71],KILLER:1,VICTIM:2},ne=.12,S=.08,re=.16,ie=.5,ae=.012,oe=1.2,se=[{ticks:28,strike:10,reach:2.65,arc:.3,hp:2,hold:8},{ticks:34,strike:13,reach:2.15,arc:1.2,hp:2,hold:4},{ticks:34,strike:13,reach:2.15,arc:1.2,hp:2,hold:4},{ticks:40,strike:16,reach:2.15,arc:.45,hp:3,hold:11},{ticks:36,strike:12,reach:3.2,arc:.3,hp:3,hold:-1},{ticks:46,strike:20,reach:2.15,arc:.6,hp:3,hold:-1},{ticks:46,strike:20,reach:2.15,arc:.6,hp:3,hold:-1},{ticks:58,strike:40,reach:2.4,arc:.6,hp:4,hold:-1}],[ce,le,ue]=[1.8,15,60],[de,fe,pe]=[2,.5,1.4],[me,he,ge]=[24,15,.6],_e=7.5,ve=.7,ye=.3,[be,xe,Se]=[20,4,2.5],Ce=.012,we={maxPlayers:16,scoreLimit:3,timeLimit:480,map:`highline`},Te={HP:10,WRECK:300,FADE:60,GRAZE:4,SKID:.92},Ee={SEAM:300,TOP:960,ALT:25e4},De=(e,t,n)=>{let r=Math.imul(e,374761393)+Math.imul(t,668265263)+Math.imul(n,144665)|0;return r=Math.imul(r^r>>>13,1274126177),((r^r>>>16)>>>0)/4294967296},C=(e,t,n)=>{let[r,i]=[Math.floor(e),Math.floor(t)],[a,o]=[e-r,t-i].map(e=>e*e*(3-2*e)),s=(e,t)=>De(r+e,i+t,n);return(s(0,0)*(1-a)+s(1,0)*a)*(1-o)+(s(0,1)*(1-a)+s(1,1)*a)*o},Oe=/* @__PURE__ */ new WeakMap,ke=e=>{let t=Oe.get(e);if(t)return t;let{hole:n,bound:r,cell:i,at:a,pits:o=[],origin:[s,c]=[0,0]}=e,l=o.reduce((e,t)=>[Math.min(e[0],t[0]),Math.min(e[1],t[1]),Math.max(e[2],t[2]),Math.max(e[3],t[3])],[1/0,1/0,-1/0,-1/0]),[u,d,f,p]=r,m=Math.floor((u-f-s)/i)*i+s,h=Math.floor((d-p-c)/i)*i+c,g=Math.ceil((u+f-m)/i)+1,_=Math.ceil((d+p-h)/i)+1,v=new Float32Array(g*_),y=-1/0;for(let e=0;e<_;e++)for(let t=0;t<g;t++)v[t+e*g]=a(m+t*i,h+e*i),y=Math.max(y,v[t+e*g]);let b=new Uint8Array(g*_);for(let[e,t,n,r]of o)for(let a=Math.floor((t-h)/i)-1;a<=Math.floor((r-h)/i)+1;a++)for(let t=Math.floor((e-m)/i)-1;t<=Math.floor((n-m)/i)+1;t++)t>=0&&a>=0&&t<g&&a<_&&(b[t+a*g]=1);let x={x0:m,z0:h,cell:i,nx:g,nz:_,h:v,hole:n,pits:o,pitted:b,box:l,bound:r,top:y};return Oe.set(e,x),x},Ae=(e,t,n)=>{let r=e.relief;if(!r||t>r.hole[0]&&t<r.hole[2]&&n>r.hole[1]&&n<r.hole[3])return-1/0;let i=Math.min(Math.max((t-r.x0)/r.cell,0),r.nx-1),a=Math.min(Math.max((n-r.z0)/r.cell,0),r.nz-1),o=Math.min(Math.floor(i),r.nx-2),s=Math.min(Math.floor(a),r.nz-2);if(r.pitted[o+s*r.nx]&&r.pits.some(e=>t>=e[0]&&t<=e[2]&&n>=e[1]&&n<=e[3]))return-1/0;let[c,l]=[i-o,a-s],u=o+s*r.nx,[d,f,p,m]=[r.h[u],r.h[u+1],r.h[u+r.nx],r.h[u+r.nx+1]];return c>=l?d+(f-d)*c+(m-f)*l:d+(p-d)*l+(m-p)*c},je=(e,t)=>{if(!t.relief)return;let[n,r,i,a]=t.relief.bound,[o,s]=[(e.x-n)/i,(e.z-r)/a],c=o*o+s*s;if(c<=1)return;let l=1/Math.sqrt(c);e.x=n+o*l*i,e.z=r+s*l*a;let[u,d]=[o*l/i,s*l/a],f=(e.vx*u+e.vz*d)/(u*u+d*d);f>0&&(e.vx-=f*u,e.vz-=f*d)},Me={HOME:0,CARRIED:1,DROPPED:2},w={FORWARD:1,BACK:2,LEFT:4,RIGHT:8,JUMP:16,SPRINT:32,DASH:64,CROUCH:128,FIRE:256,BLADE:512,SPECIAL:1024,RAIL:2048,RELOAD:4096,RIFLE:8192,USE:16384,FISTS:32768},Ne={THRUST:0,LEFT:1,RIGHT:2,SLASH:3,LUNGE:4,ARC_L:5,ARC_R:6,LEAP:7},Pe={NONE:0,HEAD:1,ARM_L:2,ARM_R:3,LEG_L:4,LEG_R:5,EATEN:6,BURST:7},Fe={PLAIN:0,SHOT:1,STRUCK:2},T={GROUND:0,AIR:1,WALLRUN:2,HANG:3,CLIMB:4,SLIDE:5,CROUCH:6,RIDE:7,CLING:8,SWIM:9},E={JUMP:1,DOUBLE:2,DASH:4,LAND:8,GRAB:16,CLIMB:32,WALLRUN_START:64,WALLRUN_END:128,SLIDE_START:256,SLIDE_END:512,RESPAWN:1024},D={BRICK:0,TILE:1,LAVA:2,STONE:3,METAL:4,WOOD:5,MOSS:6,GRATE:7,CONCRETE:8,GLASS:9,STEEL:10,PAINT:11,ROCK:12},Ie={MARINE:0,NINJA:1,ASTRONAUT:2,XENO:3,HUNTER:4},Le={run:6,sprint:9,jump:7,double:6,wallrun:75,dashes:1,dash:16,haste:1,ammo:60,rail:240,rifle:240,cool:7,rifleCool:3,mag:15,cap:80,clip:60,damage:1,slow:1,accel:1,parry:0,hp:8,gear:!0,xeno:!1},Re=[Le,{run:6*1.2,sprint:9*1.2,jump:9.1,double:6*1.3,wallrun:150,dashes:3,dash:16,haste:2,ammo:30,rail:120,rifle:120,cool:14,rifleCool:6,mag:8,cap:40,clip:30,damage:.5,slow:.55,accel:1,parry:.7,katana:!0,hp:8,gear:!0,xeno:!1},Le,{...Le,run:7.5,sprint:11.25,jump:7*Math.SQRT2,double:6*Math.SQRT2,dashes:3,dash:22.4,accel:1.25,ammo:0,rail:0,rifle:0,mag:0,cap:0,clip:0,hp:12,gear:!1,xeno:!0,girth:.1},{...Le,katana:!0,hunter:!0,ammo:12,mag:1,cap:15,rail:90,girth:.25,size:1.2}],ze=e=>e.helmets?[Ie.ASTRONAUT,Ie.XENO,Ie.HUNTER]:[Ie.MARINE,Ie.NINJA,Ie.XENO,Ie.HUNTER],Be=(e,t)=>{let n=ze(t);return n.includes(e??-1)?e:n[0]},Ve=(e,t)=>Be(e.role,t)==Ie.XENO?0:e.body??0,He=(e,t)=>Re[Be(e,t)],Ue=1024,We=(e,t)=>2048*(e+Ue)+t+Ue,O=(e,t)=>Math.min(Math.max(Math.floor(e/t),-1024),1023),Ge=[],Ke=(e,t=4)=>{let n=/* @__PURE__ */ new Map;return e.brushes.forEach(({min:e,max:r},i)=>{for(let a=O(e[0],t);a<=O(r[0],t);a++)for(let o=O(e[2],t);o<=O(r[2],t);o++){let e=We(a,o),t=n.get(e);t?t.push(i):n.set(e,[i])}}),{def:e,cell:t,grid:n,...e.relief?{relief:ke(e.relief)}:{},...e.doors?{doors:e.doors.map(()=>({open:0,wait:0}))}:{}}},qe=/* @__PURE__ */ new Uint32Array,Je=0,k=(e,t,n,r)=>{let i=[];qe.length<e.def.brushes.length&&(qe=new Uint32Array(e.def.brushes.length)),Je=Je+1>>>0||(qe.fill(0),1);for(let a=O(t-r,e.cell);a<=O(t+r,e.cell);a++)for(let t=O(n-r,e.cell);t<=O(n+r,e.cell);t++)for(let n of e.grid.get(We(a,t))??[])qe[n]!==Je&&(qe[n]=Je,i.push(n));return i},Ye=(e,t,n,r,i=0)=>{let a=Xe(e,t,n,r,i);return e.doors?.forEach(({open:r},o)=>{if(r<.5){let{min:r,max:s}=e.def.doors[o],[c,l]=[0,a];for(let e=0;e<3;e++){let[a,o]=n[e]?[(r[e]-i-t[e])/n[e],(s[e]+i-t[e])/n[e]]:t[e]<r[e]-i||t[e]>s[e]+i?[1,-1]:[-1/0,1/0];c=Math.max(c,Math.min(a,o)),l=Math.min(l,Math.max(a,o))}c<=l&&l>0&&(a=c)}}),e.relief?((e,t,n,r,i=0)=>{let a=e.relief;if(!a||Math.min(t[1],t[1]+n[1]*r)-i>a.top)return r;let[o,s]=[0,r];for(let e of[0,1]){let[r,i,c,l]=[t[2*e],n[2*e],a.hole[e],a.hole[e+2]];if(i){let[e,t]=[(c-r)/i,(l-r)/i];o=Math.max(o,Math.min(e,t)),s=Math.min(s,Math.max(e,t))}else(r<=c||r>=l)&&(s=-1)}let c=r=>t[1]+n[1]*r-i-Ae(e,t[0]+n[0]*r,t[2]+n[2]*r);if(!n[0]&&!n[2]){let e=c(0);return e<0?0:n[1]<0?Math.min(r,e/-n[1]):r}for(let[e,t]of o<s?[[0,o],[s,r]]:[[0,r]]){if(e<t&&c(e)<0)return e;for(let n=e;n<t;n+=1){let e=Math.min(n+1,t);if(c(e)<0){let[t,r]=[n,e];for(let e=0;e<6;e++){let e=(t+r)/2;c(e)<0?r=e:t=e}return t}}}return r})(e,t,n,a,i):a},Xe=(e,t,n,r,i)=>{let{cell:a,def:o}=e,s=r,c=O(t[0],a),l=O(t[2],a),u=Math.sign(n[0]),d=Math.sign(n[2]),f=u?((c+ +(u>0))*a-t[0])/n[0]:1/0,p=d?((l+ +(d>0))*a-t[2])/n[2]:1/0,m=u?a/Math.abs(n[0]):1/0,h=d?a/Math.abs(n[2]):1/0;for(;;){for(let r of e.grid.get(We(c,l))??[]){let e=o.brushes[r],[a,c]=[0,s];for(let r=0;r<3&&a<=c;r++){if(!n[r]){(t[r]<e.min[r]-i||t[r]>e.max[r]+i)&&(c=-1);continue}let o=(e.min[r]-i-t[r])/n[r],s=(e.max[r]+i-t[r])/n[r];a=Math.max(a,Math.min(o,s)),c=Math.min(c,Math.max(o,s))}a<=c&&c>0&&a<s&&(s=a)}if(Math.min(f,p)>=s||Math.abs(c)>Ue||Math.abs(l)>Ue)return s;f<p?(c+=u,f+=m):(l+=d,p+=h)}},Ze=(e,t,n)=>{let[r,i,a]=[n[0]-t[0],n[1]-t[1],n[2]-t[2]],o=Math.hypot(r,i,a);return o>0&&Ye(e,t,[r/o,i/o,a/o],o)<o-1e-4},A=1/60,Qe=2*Math.PI,$e=1e-6,j=.01,et=e=>(e%Qe+Qe)%Qe,tt=e=>[-Math.sin(e),-Math.cos(e)],M=Math.fround,nt=Math.sqrt,rt=(e,t,n)=>Math.min(Math.max(e,t),n),N=(e,t)=>nt(e*e+t*t),P=[[0,0],[1,0],[-1,0],[0,1],[0,-1]],it={vx:0,vz:0,mode:T.GROUND,t:0,wall:0,edge:0,jumps:1,dashes:1,dash:0,stun:0,coyote:6,buffer:0,held:0,hp:8,armor:0,ammo:-1,cool:0,mag:0,cap:0,reload:0,rack:!1,down:0,shots:0,hits:0,blade:!1,wield:!1,fists:!1,side:-1,sideMag:0,sided:!1,swing:0,cut:0,zap:!1,lost:Pe.NONE,rail:-1,railed:!1,rifle:-1,clip:0,rifled:!1,nades:0,lob:0,inRifle:!1,inRail:!1,zapping:!1,slow:0,fried:!1,heavy:!1,ev:0,fall:0},at=(e,t,n,r=0,i=Re[0])=>{let{spawns:a}=t.def.teams[r],[o,s,c,l]=a[(n%a.length+a.length)%a.length];return{id:e,x:M(o),y:M(s),z:M(c),vy:0,yaw:et(l),pitch:0,ground:!0,...it,hp:i.hp,blade:!!i.katana,wield:!!i.katana}},ot=(e,t,n,r=Re[0])=>{let{yaw:i,pitch:a,id:o,shots:s,hits:c}=e;Object.assign(e,at(o,t,o,n,r),{yaw:i,pitch:a,shots:s,hits:c,ev:e.ev|E.RESPAWN})},st=e=>e===T.GROUND||e===T.SLIDE||e===T.CROUCH,ct=e=>e.mode===T.SLIDE||e.mode===T.CROUCH?.9:n,lt=e=>e.mode===T.SWIM?1.35:e.mode===T.SLIDE||e.mode===T.CROUCH?.7:1.6,ut=e=>N(e.vx,e.vz),dt=e=>e.mode===T.GROUND&&N(e.vx,e.vz)>6.5,ft=(e,t,n)=>e.max[1]>t+.5+j&&e.min[1]<t+n-j,pt=(e,t,n)=>[t-rt(t,e.min[0],e.max[0]),n-rt(n,e.min[2],e.max[2])],mt=(e,n,r)=>ht(e,n,r,t),ht=(e,t,n,r)=>{let{brushes:i}=t.def,a=k(t,e.x,e.z,2*r),o=(r-$e)**2,[s,c]=[0,0];for(let t=0;t<4;t++){let t=0,l=0,u=0;for(let s of a){let a=i[s];if(!ft(a,e.y,n))continue;let[c,d]=pt(a,e.x,e.z),f=c*c+d*d;if(f>=o)continue;if(f){let e=nt(f);r-e>t&&(t=r-e,l=c/e*t,u=d/e*t);continue}let[p,m,h]=[[e.x-a.min[0],-1,0],[a.max[0]-e.x,1,0],[e.z-a.min[2],0,-1],[a.max[2]-e.z,0,1]].reduce((e,t)=>t[0]<e[0]?t:e);p+r>t&&(t=p+r,[l,u]=[m*t,h*t])}if(!t)break;e.x+=l,e.z+=u,s+=l,c+=u}return[s,c]},gt=(e,t,n)=>{let[[r,i,a],[o,s,c]]=[e.a,e.b],[l,u]=[o-r,c-a],d=l*l+u*u,f=d?rt(((t-r)*l+(n-a)*u)/d,0,1):0;return[t-r-f*l,n-a-f*u,i+f*(s-i)]},_t=(e,t,n,r)=>t>=Math.min(e.a[0],e.b[0])-r&&t<=Math.max(e.a[0],e.b[0])+r&&n>=Math.min(e.a[2],e.b[2])-r&&n<=Math.max(e.a[2],e.b[2])+r,vt=(e,n,r,i=[])=>{let{brushes:a}=n.def,o=(t-$e)**2,s=Ae(n,e.x,e.z),c=1/0;for(let i of k(n,e.x,e.z,t)){let t=a[i],[n,l]=pt(t,e.x,e.z);n*n+l*l>=o||(t.max[1]<=e.y+.5+j?s=Math.max(s,t.max[1]):t.min[1]>=e.y+r-j&&(c=Math.min(c,t.min[1])))}for(let t of i){if(!_t(t,e.x,e.z,t.r+.4))continue;let[n,i,a]=gt(t,e.x,e.z);n*n+i*i>=(t.r+.4-$e)**2||(a+t.h<=e.y+.5+j?s=Math.max(s,a+t.h):a>=e.y+r-j&&(c=Math.min(c,a)))}return[s,c]},yt=(e,t,n,r)=>{let i=Ae(e,t,n);for(let a of((e,t,n)=>e.grid.get(We(O(t,e.cell),O(n,e.cell)))??Ge)(e,t,n)){let{min:o,max:s}=e.def.brushes[a];t>=o[0]&&t<=s[0]&&n>=o[2]&&n<=s[2]&&s[1]<=r&&(i=Math.max(i,s[1]))}return i},bt=(e,n)=>{let r=(t-$e)**2;return k(n,e.x,e.z,t).every(t=>{let i=n.def.brushes[t],[a,o]=pt(i,e.x,e.z);return a*a+o*o>=r||!ft(i,e.y,1.8)})},xt=(e,n,r,i,a)=>{let o=(t-$e)**2;return k(e,n,r,t).every(t=>{let s=e.def.brushes[t],[c,l]=pt(s,n,r);return c*c+l*l>=o||s.max[1]<=i||s.min[1]>=a})},St=(e,t)=>{let[n,r]=P[t],i=n?0:2;return{a:i,o:2-i,sign:n||r,c:n?e.x:e.z,co:n?e.z:e.x}},Ct=(e,t,n,r)=>{let{a:i,o:a,sign:o,c:s,co:c}=St(t,n),l=((o>0?e.min[i]:e.max[i])-s)*o;return l>=.399&&l<=.4+r&&c>=e.min[a]&&c<=e.max[a]?l:void 0},wt=(e,n,r)=>{let i;for(let a of k(n,e.x,e.z,.9)){let o=n.def.brushes[a],s=Ct(o,e,r,.5);s!==void 0&&o.min[1]<e.y+.5&&o.max[1]>e.y+1.8&&(i=Math.min(i??1/0,Math.max(0,s-t)))}return i},Tt=e=>e>20?Math.ceil((e-20)/2):0,Et=e=>20*(e.def.gravity??1),F=(e,t)=>{e.mode=t,e.t=0},Dt=e=>!!e.zap&&e.stun>24,Ot=(e,t)=>{let n=N(e.vx,e.vz);n>t&&(e.vx*=t/n,e.vz*=t/n)},kt=(e,t,n,r)=>{let[i,a]=[n.wx,n.wz];for(let n of k(t,e.x,e.z,.401)){let o=t.def.brushes[n],[s,c]=pt(o,e.x,e.z),l=N(s,c);if(l>0&&l<=.401&&ft(o,e.y,r)){let e=(-i*s-a*c)/l;e>0&&(i+=e*s/l,a+=e*c/l)}}return[i,a]},At=(e,t,n,r=6,i=1)=>{let a=N(t[0],t[1]);if(a<$e){let t=N(e.vx,e.vz),n=t?Math.max(0,t-.75)/t:0;e.vx*=n,e.vz*=n;return}let[o,s]=[t[0]/a,t[1]/a],c=e.vx*o+e.vz*s,[l,u]=[e.vx-c*o,e.vz-c*s],d=N(l,u);if(d){let e=Math.max(0,d-.75)/d;[l,u]=[l*e,u*e]}c=c<(n*=a)?Math.min(n,c+(c>=r?3:50)*i*A):Math.max(n,c-.2),e.vx=l+c*o,e.vz=u+c*s},jt=(e,t,n)=>{Mt(e,t,ct(e),0,!1,n),[e.x,e.y,e.z]=[M(e.x),M(e.y),M(e.z)]},Mt=(e,n,r,i,a,o)=>{let s=e.y;e.x+=e.vx*A,e.z+=e.vz*A;let[c,l]=mt(e,n,r),[u,d]=((e,n,r)=>{let[i,a]=[0,0];for(let o of n){let n=o.r+t;if(!_t(o,e.x,e.z,n))continue;let[s,c,l]=gt(o,e.x,e.z),u=s*s+c*c;if(u>=(n-$e)**2||l+o.h<=e.y+.5+j||l>=e.y+r-j)continue;let d=nt(u),[f,p]=[o.b[0]-o.a[0],o.b[2]-o.a[2]],m=N(f,p),[h,g]=d?[s/d,c/d]:m?[p/m,-f/m]:[1,0];e.x+=h*(n-d),e.z+=g*(n-d),i+=h*(n-d),a+=g*(n-d)}return[i,a]})(e,o,r);if(u||d){let[t,i]=mt(e,n,r);c+=u+t,l+=d+i}let f=N(c,l);if(f){let t=(e.vx*c+e.vz*l)/f;t<0&&(e.vx-=t*c/f,e.vz-=t*l/f)}je(e,n);let[p,m]=vt(e,n,r,o),h=e.vy-i*Et(n)*A;if(e.y+=(e.vy+h)/2*A,e.vy=h,e.y+r>m&&(e.y=m-r,e.vy=Math.min(e.vy,0)),e.vy<=0?e.y<=p+j:e.y<p){if(e.y=p,e.vy<=0){let t=-e.vy;return e.vy=0,t}}else if(a&&e.vy<=0&&p>=s-.5)return e.y=p,e.vy=0,0;return-1},Nt=(e,t)=>{e.vy=t,e.coyote=0,e.buffer=0,e.ev|=E.JUMP},Pt=e=>(e.def.water??0)-1.1,Ft=(e,t,r,i)=>{let a=(r.keys&w.CROUCH)!==0;if(e.buffer>0&&(e.mode===T.GROUND||bt(e,t)))return e.ev|=e.mode===T.SLIDE?E.SLIDE_END:0,F(e,T.AIR),void Nt(e,r.kit.jump);let o=N(e.vx,e.vz);if(e.mode===T.GROUND&&a){let t=o>=7.5;F(e,t?T.SLIDE:T.CROUCH),e.ev|=t?E.SLIDE_START:0}else e.mode===T.SLIDE&&(e.t>=60||o<4.5||r.stumble)?(e.ev|=E.SLIDE_END,F(e,!a&&bt(e,t)?T.GROUND:T.CROUCH)):e.mode===T.SLIDE&&!a&&bt(e,t)?(e.ev|=E.SLIDE_END,F(e,T.GROUND)):e.mode===T.CROUCH&&!a&&bt(e,t)&&F(e,T.GROUND);if(!i){if(r.stumble){if(o>2.5){let t=Math.max(2.5,o-.2)/o;e.vx*=t,e.vz*=t}else At(e,kt(e,t,r,ct(e)),2.5)}else if(e.mode===T.SLIDE){let t=Math.max(0,o-4*A)/o;e.vx*=t,e.vz*=t}else if(e.mode===T.CROUCH)At(e,kt(e,t,r,.9),3);else{let i=(r.keys&w.SPRINT)!==0&&r.fwd,a=r.kit.run*r.pace;At(e,kt(e,t,r,n),i?r.kit.sprint*r.pace:a,a,r.kit.accel)}}},It=(e,t,r,i)=>{if(e.buffer>0&&(e.coyote>0?Nt(e,r.kit.jump):e.jumps>0&&!((e,t)=>{if(e.vy>=0)return!1;let[r]=vt(e,t,n);return e.y-r<=.1*-e.vy+.5*Et(t)*.1*.1})(e,t)&&(e.jumps--,Nt(e,r.kit.double),e.ev=e.ev&~E.JUMP|E.DOUBLE)),i||!r.wx&&!r.wz)return;let a=N(e.vx,e.vz);e.vx+=14*r.wx*A,e.vz+=14*r.wz*A,Ot(e,Math.max(a,6))},Lt=(e,r,i,a=0,o=[],s=Re[0])=>{e.yaw=et(r.yaw),e.pitch=Math.max(-1.55,Math.min(1.55,r.pitch));let c=(r.keys&w.FORWARD?1:0)-(r.keys&w.BACK?1:0),l=(r.keys&w.RIGHT?1:0)-(r.keys&w.LEFT?1:0),u=Dt(e)?1/0:N(c,l)||1,[d,f]=tt(e.yaw),p=t=>(r.keys&t)!==0&&(e.held&t)===0,m=e.stun>0,h=e.mode===T.RIDE,g={keys:r.keys,stumble:m,jump:!m&&!h&&p(w.JUMP),dash:!m&&!h&&p(w.DASH),fwd:c>0,wx:(d*c-f*l)/u,wz:(f*c+d*l)/u,fx:d,fz:f,bodies:o,kit:s,pace:e.fists||e.wield||!(e.ammo>=0||(e.rail??-1)>=0||(e.rifle??-1)>=0)?1:s.slow},_=e.mode;e.ev=0,e.fall=0,g.jump&&(e.buffer=7),m&&e.stun--,e.dash>0&&(e.dash--,e.dash===50&&Ot(e,10)),e.mode===T.HANG&&((e,t,r)=>{let[i,a]=P[e.wall],o=t=>{F(e,t),e.edge=0};if(r.keys&(w.BACK|w.CROUCH))o(T.AIR),e.coyote=0;else if(r.jump&&r.fx*i+r.fz*a<0)o(T.AIR),e.vx=4*-i,e.vz=4*-a,Nt(e,6);else if(r.jump||r.fwd&&e.t>=6)F(e,T.CLIMB);else if(e.t>=30)o(T.AIR),e.coyote=0;else{let r=Math.max(e.edge-2,vt(e,t,n)[0]);e.y+=rt(r-e.y,-8*A,8*A)}})(e,i,g),e.mode===T.CLING&&((e,n,r)=>{let[i,a]=P[e.wall],o=((e,n,r)=>{let{a:i,sign:a}=St(e,r),o;for(let s of k(n,e.x,e.z,.9)){let c=n.def.brushes[s],l=Ct(c,e,r,.5);if(l!==void 0&&c.max[1]>e.y+.4&&c.min[1]<e.y+1.8){let e=Math.max(0,l-t);o={gap:Math.min(o?.gap??1/0,e),top:Math.max(o?.top??-1/0,c.max[1]),face:a>0?c.min[i]:c.max[i]}}}return o})(e,n,e.wall);if(r.keys&w.CROUCH||!o)return F(e,T.AIR),void(e.coyote=0);if(r.jump){F(e,T.AIR);let[t,n]=[10*Math.cos(e.pitch),10*Math.sin(e.pitch)],[o,s]=[Math.max(n,3.25),(r.fz*i-r.fx*a)*t];e.vx=-i*o-a*s,e.vz=-a*o+i*s,Nt(e,(r.fx*i+r.fz*a)*t);return}let s=(r.keys&w.FORWARD?1:0)-(r.keys&w.BACK?1:0),c=(r.keys&w.RIGHT?1:0)-(r.keys&w.LEFT?1:0),[l,u]=[-a,i],[d,f]=[r.fx*i+r.fz*a,r.fx*l+r.fz*u],[p,m]=[s*d-c*f,s*f+c*d],h=Math.sqrt(p*p+m*m),g=Math.sqrt(e.vx*e.vx+e.vy*e.vy+e.vz*e.vz),_=r.keys&w.SPRINT,v=r.kit.run*r.pace*(_?1:.5),y=_?r.kit.sprint*r.pace:v,b=g>y?Math.max(y,g-.2):Math.min(y,Math.max(v,g+3*r.kit.accel*A)),x=h>1?b/h:b,ee=p>.05?1:p<-.05?-1:0,te=m*x,{a:ne,sign:S}=St(e,e.wall);if(ee>0&&o.top<e.y+1.8){let t=o.face+.2*S,[r,i]=ne===0?[t,e.z]:[e.x,t];if(xt(n,r,i,o.top+j,o.top+1.8))return F(e,T.CLIMB),e.edge=M(o.top),void(e.vx=e.vy=e.vz=0)}e.vx=l*te,e.vz=u*te,e.vy=ee>0&&o.top-e.y<=.45?0:p*x;let re=Math.min(o.gap,4*A);e.x+=i*re,e.z+=a*re,Mt(e,n,1.8,0,!1,r.bodies)>=0&&ee<0&&(F(e,T.GROUND),e.wall=0,e.coyote=6,e.ev|=E.LAND)})(e,i,g),e.mode===T.SWIM?((e,t,n)=>{let r=.1,i=Pt(t),a=(n.keys&w.FORWARD?1:0)-(n.keys&w.BACK?1:0),o=a!==0&&(e.pitch<0||e.y<i-j)?Math.cos(e.pitch):1;e.vx+=(4*n.wx*o-e.vx)*r,e.vz+=(4*n.wz*o-e.vz)*r,e.vy+=((a===0?1.5:a*Math.sin(e.pitch)*4)-e.vy)*r,Mt(e,t,ct(e),0,!1,n.bodies),vt(e,t,ct(e),n.bodies)[0]>=i-j?(e.y=Math.max(e.y,i),e.vy=0,e.jumps=1,e.dashes=n.kit.dashes,F(e,T.GROUND)):e.y>i&&(e.y=i,e.vy=Math.min(e.vy,0))})(e,i,g):e.mode===T.CLIMB?((e,t)=>{let[n,r]=P[e.wall];e.y<e.edge?e.y=Math.min(e.edge,e.y+8*A):(e.x+=5.5*n*A,e.z+=5.5*r*A),e.y>=e.edge&&((e,t)=>{let{a:n,o:r,sign:i,c:a,co:o}=St(e,e.wall);return k(t,e.x,e.z,0).some(s=>{let c=t.def.brushes[s],l=i>0?a-c.min[n]:c.max[n]-a;return M(c.max[1])===e.edge&&o>=c.min[r]&&o<=c.max[r]&&l>=.2})})(e,t)?(F(e,T.GROUND),e.vx=3*n,e.vz=3*r,e.vy=0,e.edge=0,e.wall=0,e.coyote=6,e.ev|=E.CLIMB):e.t>=40&&(F(e,e.y>=e.edge?T.GROUND:T.AIR),e.edge=0,e.wall=0)})(e,i):e.mode===T.HANG||e.mode===T.CLING||h||((e,n,r)=>{let i=e.mode===T.GROUND,a=r.kit.dashes>1;if(a&&i&&e.dash===0&&(e.dashes=r.kit.dashes),r.dash&&(e.dash===0||a&&e.dashes>0&&e.dash<=44)&&(i?!a||e.dashes>0:(e.mode===T.AIR||e.mode===T.WALLRUN)&&e.dashes>0)){let[t,n]=r.wx||r.wz?[r.wx,r.wz]:[r.fx,r.fz];e.dashes-=+(i&&a),i||(e.dashes--,e.vy=0,e.mode===T.WALLRUN&&(F(e,T.AIR),e.ev|=E.WALLRUN_END)),e.vx=t*r.kit.dash,e.vz=n*r.kit.dash,e.dash=60,e.ev|=E.DASH}let o=e.dash>50;e.mode===T.WALLRUN&&((e,t,n)=>{let[r,i]=P[e.wall],a=e.vx*r+e.vz*i,[o,s]=[e.vx-a*r,e.vz-a*i],c=N(o,s);if(n.jump){F(e,T.AIR);let t=c>0?1+2/c:1;e.vx=o*t-6.5*r,e.vz=s*t-6.5*i,Nt(e,7.5),e.jumps=1,e.dashes=n.kit.dashes,e.ev|=E.WALLRUN_END}else{let a=wt(e,t,e.wall);if(a===void 0||!n.fwd||c<3.5||e.t>=n.kit.wallrun)return F(e,T.AIR),void(e.ev|=E.WALLRUN_END);let l=Math.max(0,c-.025)/c;e.vx=o*l,e.vz=s*l;let u=Math.min(a,4*A);e.x+=r*u,e.z+=i*u}})(e,n,r),st(e.mode)&&Ft(e,n,r,o),e.mode===T.AIR&&It(e,n,r,o);let s=o&&e.vy<=0?0:e.mode===T.WALLRUN?.15:1,c=e.mode,l=[N(e.vx,e.vz),e.vx,e.vz],u=Mt(e,n,ct(e),s,st(c),r.bodies);if(u>=0){if(!st(e.mode)){if(e.ev|=E.LAND|(e.mode===T.WALLRUN?E.WALLRUN_END:0),e.fall=u,e.jumps=1,e.dashes=r.kit.dashes,e.wall=0,r.keys&w.CROUCH){let t=N(e.vx,e.vz)>=7.5;F(e,t?T.SLIDE:T.CROUCH),e.ev|=t?E.SLIDE_START:0}else F(e,T.GROUND)}e.coyote=6}else st(e.mode)&&(e.ev|=e.mode===T.SLIDE?E.SLIDE_END:0,F(e,T.AIR));if((e.mode!==T.AIR&&e.mode!==T.GROUND||!((e,t,n,r)=>{if(!n.kit.xeno||!n.fwd||!(n.keys&w.SPRINT)||n.stumble)return!1;let i=e.mode===T.AIR?.5:.05;for(let a=1;a<=4;a++){let[o,s]=P[a],c=wt(e,t,a);if(a!==e.wall&&n.fx*o+n.fz*s>=.6&&c!==void 0&&c<=i){F(e,T.CLING),e.wall=a;let[t,i]=[-s,o],c=Math.min(1,n.kit.sprint*n.pace/Math.max(r[0],$e)),l=(r[1]*t+r[2]*i)*c;return e.vx=t*l,e.vz=i*l,e.vy=Math.sqrt(Math.max(0,(r[0]*c)**2-l*l)),e.jumps=1,e.coyote=0,e.ev|=E.GRAB,!0}}return!1})(e,n,r,l))&&e.mode===T.AIR){let i=((e,n)=>{let[r,i]=tt(e.yaw),a;for(let o=1;o<=4;o++){let[s,c]=P[o];if(o===e.wall||r*s+i*c<.5)continue;let{a:l,sign:u}=St(e,o);for(let r of k(n,e.x,e.z,t+.2)){let i=n.def.brushes[r],s=i.max[1],c=s-e.y;if(Ct(i,e,o,.2)===void 0||c<1.2||c>2.4||i.min[1]>s-.25||a&&a.top>=s)continue;let d=u>0?i.min[l]:i.max[l],f=d-u*(t+.03),p=d+.2*u,[m,h]=l===0?[f,e.z]:[e.x,f],[g,_]=l===0?[p,e.z]:[e.x,p];xt(n,m,h,Math.min(e.y,s-2)+j,s+1.8)&&xt(n,g,_,s+j,s+1.8)&&(a={side:o,top:s,hang:f})}}return a})(e,n);i?((e,t,n)=>{F(e,T.HANG),e.wall=t.side,e.edge=M(t.top),t.side<=2?e.x=t.hang:e.z=t.hang,e.vx=e.vy=e.vz=0,e.jumps=1,e.dashes=n,e.coyote=0,e.buffer=0,e.ev|=E.GRAB})(e,i,r.kit.dashes):((e,t,n)=>{if(!n.fwd)return;let r=N(e.vx,e.vz);if(!(r<4.5))for(let i=1;i<=4;i++){let[a,o]=P[i],s=e.vx*a+e.vz*o,[c,l]=[e.vx-s*a,e.vz-s*o];if(i!==e.wall&&s<=.75*r&&s>=-.2*r&&wt(e,t,i)!==void 0){let t=N(c,l),a=Math.max(t,.9*r)/t;F(e,T.WALLRUN),e.wall=i,[e.vx,e.vz]=[c*a,l*a],e.vy=rt(e.vy,2,3),e.jumps=1,e.dashes=n.kit.dashes,e.coyote=0,e.ev|=E.WALLRUN_START;return}}})(e,n,r)}})(e,i,g),((e,t)=>{t.def.water===void 0||e.y>=Pt(t)-.02||e.mode!==T.GROUND&&e.mode!==T.AIR&&e.mode!==T.CROUCH&&e.mode!==T.SLIDE&&e.mode!==T.WALLRUN||(F(e,T.SWIM),e.y=Pt(t),e.vy=0,e.dash=0,e.wall=0)})(e,i),e.slow&&(e.slow--,Ot(e,3)),e.y<i.def.floor&&e.mode!==T.SWIM&&ot(e,i,a,s),e.t=e.mode===_?Math.min(255,e.t+1):e.t,e.buffer=Math.max(0,e.buffer-1),e.mode===T.AIR&&_===T.AIR&&(e.coyote=Math.max(0,e.coyote-1)),e.held=r.keys&(w.JUMP|w.DASH|w.USE),e.ground=st(e.mode),e.x=M(e.x),e.y=M(e.y),e.z=M(e.z),e.vx=M(e.vx),e.vy=M(e.vy),e.vz=M(e.vz),e.edge=M(e.edge)},Rt=class{a=/* @__PURE__ */ new Float64Array(65536);length=0;room(e){let t=this.length+e;if(t>this.a.length){let e=new Float64Array(Math.max(t,2*this.a.length));e.set(this.a),this.a=e}return this.a}push(...e){let t=this.room(e.length);for(let n=0;n<e.length;n++)t[this.length++]=e[n]}slice(e,t){return Array.from(this.a.subarray(e,t))}},zt=(e,t)=>Array.isArray(e)?e:e.room(t),Bt=(e,t)=>[e[0]-t[0],e[1]-t[1],e[2]-t[2]],Vt=(e,t)=>[e[0]+t[0],e[1]+t[1],e[2]+t[2]],Ht=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2],Ut=(e,t,n)=>[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n],Wt=e=>{let t=Math.hypot(...e)||1;return[e[0]/t,e[1]/t,e[2]/t]},Gt=-1.25,Kt=-1.12,qt=-1.42,[Jt,Yt]=[-1.45,.04],[Xt,Zt]=[-1.36,1e-4],Qt=-1.06,$t=-1.17,en=-1.19,tn=-1.135,nn=-.94,rn=(e,t,n=0)=>{let[r,i,a,o,s,c]=[e,t,n].flatMap(e=>[Math.sin(e),Math.cos(e)]),l=[i,0,-r],u=[r*a,o,i*a];return[l.map((e,t)=>e*c-u[t]*s),u.map((e,t)=>e*c+l[t]*s),[-r*o,a,-i*o]]},an=(e,t,n=[0,0,0])=>{let r=[],i=e.filter((t,n)=>!n||Math.hypot(t[0]-e[n-1][0],t[1]-e[n-1][1])>1e-9),a=i.slice(1).map(([e,t],n)=>{let[r,a]=i[n],o=Math.hypot(e-r,t-a);return[(t-a)/o,-(e-r)/o]}),o=i.map(([e],t)=>{let[n,r]=[0,1].map(e=>(a[t-1]?.[e]??0)+(a[t]?.[e]??0)),i=Math.hypot(n,r);return e?[n/i,r/i]:[0,Math.sign(r)]}),s=(e,a)=>{let[s,c]=i[a],[l,u]=[Math.cos(e*Qe/t),Math.sin(e*Qe/t)];r.push(n[0]+s*l,n[1]+s*u,n[2]-c,o[a][0]*l,o[a][0]*u,-o[a][1])};for(let e=1;e<i.length;e++)for(let n=0;n<t;n++)[...i[e-1][0]?[[n,e-1],[n+1,e-1],[n+1,e]]:[],...i[e][0]?[[n,e-1],[n+1,e],[n,e]]:[]].forEach(([e,t])=>s(e,t));return r},on=(e,t,n,[r,i],a)=>{let o=(e,t,n,r)=>Array.from({length:t},(i,a)=>{let o=a*Qe/t/4;return[e*Math.sin(o),n-r*e*Math.cos(o)]});return an([...r?o(t[0],r,0,1):[[0,0]],...t.map((n,r)=>[n,e*r/(t.length-1)]),...i?o(t[t.length-1],i,e,-1).reverse():[[0,e]]],n,a)},sn=(e,[t,n,r])=>Array.from({length:e.length*(10/6)},(i,a)=>{let[o,s]=[Math.floor(a/10),a%10];return s<6?e[6*o+s]:[t,n,-1,r][s-6]}),cn=[[5,1],[7,2],[10,3]],ln=/* @__PURE__ */ new Map,un=(e,t,n,r=[1,1])=>{let[i,a]=cn[e];!e&&n.length>3&&(n=[n[0],n[n.length>>1],n[n.length-1]]);let o=`${e} ${t} ${n} ${r}`,s=ln.get(o);return s||(s=sn(on(t,n,i,r.map(e=>Math.ceil(a*e))),[1,1,1]),ln.set(o,s)),s},dn=(e,t,n,[r,i,a],o,s,c=[1,1,1])=>{let[l,u,d]=typeof s==`number`?[s,s,s]:s,f=l==u&&u==d,[p,m,h,g,_,v,y,b,x]=[...r,...i,...a],ee=n[0]+p*o[0]+g*o[1]+y*o[2],te=n[1]+m*o[0]+_*o[1]+b*o[2],ne=n[2]+h*o[0]+v*o[1]+x*o[2];for(let n=0;n<t.length;n+=10){let[r,i,a]=[t[n]*l,t[n+1]*u,t[n+2]*d],[o,s,S]=[t[n+3],t[n+4],t[n+5]];if(!f){[o,s,S]=[o/l,s/u,S/d];let e=Math.sqrt(o*o+s*s+S*S)||1;[o,s,S]=[o/e,s/e,S/e]}e.push(ee+p*r+g*i-y*a,te+m*r+_*i-b*a,ne+h*r+v*i-x*a,p*o+g*s-y*S,m*o+_*s-b*S,h*o+v*s-x*S,t[n+6]*c[0],t[n+7]*c[1],t[n+8],t[n+9]*c[2])}},fn=(e,t,n)=>{let r=zt(e,0);for(let i=t;n<1&&i<e.length;i+=10)r[i+8]==-2&&(r[i+6]*=n,r[i+7]*=n,r[i+9]*=n)},pn=(e,t)=>{let n=e[0]*t[0]+e[1]*t[1]+e[2]*t[2],r=t.map((t,r)=>t-e[r]*n),i=Math.hypot(...r)||1,[a,o,s]=r.map(e=>e/i);return[[a,o,s],[o*e[2]-s*e[1],s*e[0]-a*e[2],a*e[1]-o*e[0]],e]},mn=(e,t,n,r,i,a,o=1,s)=>{let c=[r[0]-n[0],r[1]-n[1],r[2]-n[2]],l=Math.hypot(...c)||1,[u,d]=typeof o==`number`?[o,o]:o;dn(e,t,n,pn([c[0]/l,c[1]/l,c[2]/l],i),[0,0,0],[u,d,l/a],s)},I=(e,t,n,r,i,a=D.CONCRETE)=>({min:[e,-30,t],max:[n,i,r],top:D.CONCRETE,side:a}),L=([e,t,n],[r,i,a],o,s=o,c)=>({min:[e,t,n],max:[r,i,a],top:o,side:s,tint:c}),hn=(I(4,57.7,24,76,10),I(4,36,24,53.5,10,D.GLASS),I(4,20,24,36,12.4),I(4,-5,24,7,12.4,D.GLASS),I(27,20,47,50,8),I(27,60,47,76,8,D.BRICK),L([9,12.2,39],[19,12.6,47],D.STEEL),[1,2,3,4,5,6].map(e=>L([12,10,53-e],[14,10+.4*e,53-e+1],D.CONCRETE)),L([5,10,42],[5.5,14,42.5],D.STEEL),L([5,10,50],[5.5,14,50.5],D.STEEL),L([8,12.4,24],[20,12.85,24.45],D.STEEL),L([36,8,22],[37,14.5,48],D.PAINT,D.PAINT,[.15,.72,.62]),L([30,8,28],[34,10,32],D.CONCRETE),L([40,8,30],[44,10.2,34],D.PAINT,D.PAINT,[1,.3,.06]),L([28,9.2,44],[35,12,46],D.STEEL,D.PAINT,[.2,.42,1]),L([41.5,7.6,50],[42,8,60],D.STEEL),L([30,8,64],[34,9.6,68],D.PAINT,D.PAINT,[.2,.8,.3]),240),R=[1,.22,.26],gn=[.2,.46,1],_n=[R,gn],vn=[1,.42,.08],yn=[.12,.7,.62],bn=(e,t,n,r,i,a,o)=>L([e,t,n],[r,i,a],D.PAINT,D.PAINT,o),xn=(e,t,n,r,i,a,o,s=-30)=>{let c=Math.ceil((o-a)/.46);return Array.from({length:c},(l,u)=>{let[d,f]=[t+(n-t)*u/c,t+(n-t)*(u+1)/c].sort((e,t)=>e-t),p=a+(o-a)*(u+1)/c;return e===0?L([d,s,r],[f,p,i],D.CONCRETE):L([r,s,d],[i,p,f],D.CONCRETE)})},Sn=(e,t,n,r,i,a,o)=>o.map((o,s)=>L([e+s*n,a,t+s*r],[e+s*n+4,o,t+s*r+i],D.STEEL,D.CONCRETE)),Cn=[I(12,212,52,240,26,D.GLASS),bn(12,26,212,52,26.12,212.5,R),bn(12,26,239.5,52,26.12,240,R),bn(12,26,212.5,12.5,26.12,239.5,R),bn(51.5,26,212.5,52,26.12,239.5,R),bn(11.6,12,222,12,25.8,232,R),bn(28,12,211.4,31,25.5,212,R),L([19,26,222],[22,27.4,225],D.STEEL),L([42,26,222],[45,27.4,225],D.STEEL),L([29,26,229],[35,27.1,229.6],D.CONCRETE),I(6,164,26,201,26,D.GLASS),I(6,134,26,147,26,D.GLASS),I(6,201,26,212,19),I(15,147,26,164,19),L([14,26,164],[15,32,196],D.PAINT,D.PAINT,yn),L([14,18,147],[15,32,164],D.PAINT,D.PAINT,yn),L([14,26,134],[15,32,147],D.PAINT,D.PAINT,yn),...Sn(6,201,7,0,4,19,[21.2,23.4,25]),...[[18,152,22,156,21.2],[18,158,22,162,23.4],[23,160,26,164,25]].map(([e,t,n,r,i])=>L([e,19,t],[n,i,r],D.STEEL,D.CONCRETE)),L([20,26,178],[23,27.3,181],D.STEEL),L([8,26,176],[11,27.2,179],D.STEEL),L([8,26,190],[11,27.3,193],D.STEEL),L([20,26,140],[23,27.3,143],D.STEEL),I(32,186,76,209,19),bn(32,19,207.5,76,19.1,209,R),...Sn(33,209,7,0,3,19,[21.2,23.4,25]),...[[28,196,32,200,21.2],[28,190,32,194,23.4],[26,184,30,188,25]].map(([e,t,n,r,i])=>L([e,-30,t],[n,i,r],D.STEEL,D.CONCRETE)),I(32,166,64,182,21.2,D.GLASS),I(32,140,64,161,19),L([40,21.2,172],[44,22.6,176],D.STEEL),L([52,19,148],[57,20.3,151],D.STEEL),L([38,19,196],[41,20.4,199],D.STEEL),L([60,19,200],[63,20.4,203],D.STEEL),L([52,19,190],[58,20.6,194],D.STEEL),L([66,19,204],[72,20.2,207],D.STEEL),L([56,21.2,170],[60,22.4,174],D.STEEL),L([34,19,152],[37,20.3,156],D.STEEL),...Sn(36,135,18,0,3,15,[17.2,17.2]),...Sn(6.5,129,6,0,4,15,[17.2,19.4,21.6,23.8]),I(76,213,100,240,14.5,D.STEEL),bn(76,14.5,238.5,100,14.6,240,R),I(76,185,100,209,14.5),I(76,138,100,181,14.5,D.GLASS),L([80,15.7,158],[96,17.7,162],D.STEEL,D.PAINT,vn),L([82,14.5,234],[85,15.9,237],D.STEEL),L([91,14.5,190],[94,15.9,193],D.STEEL),L([80,14.5,204],[83,15.6,207],D.STEEL),L([78,14.5,170],[81,15.9,173],D.STEEL),L([92,14.5,146],[95,15.7,149],D.STEEL),L([92,14.5,222],[96,15.8,226],D.STEEL),...xn(0,76,52,226,232,14.5,26),...xn(0,85,76,196,202,14.5,19,14.5)],wn=[I(6,106,62,134,15),I(62,106,100,134,14.5),L([34,15,112],[54,17.2,128],D.CONCRETE),bn(38,17.2,116,50,17.3,124,vn),...[[35,113],[35,126.2],[51,113],[51,126.2]].map(([e,t])=>L([e,17.2,t],[e+.8,21.5,t+.8],D.STEEL)),L([34.6,21.5,112.6],[52.2,21.9,127.4],D.GLASS),L([14,15,114],[17,16.5,117],D.STEEL),L([14,15,123],[17,16.5,126],D.STEEL),L([56,15,114],[59,16.5,117],D.STEEL),L([56,15,123],[59,16.5,126],D.STEEL),L([15.35,25.5,106],[15.85,26,134],D.STEEL),L([70,14.5,108],[70.8,38,108.8],D.STEEL),L([70,14.5,131.2],[70.8,38,132],D.STEEL),L([66,14.5,110],[69,15.9,113],D.STEEL),L([66,14.5,127],[69,15.9,130],D.STEEL)],Tn=(e,t,n)=>[...[16,22,28,34,40].map(n=>[n,26,t,e]),...[19,31,43].map(t=>[t,26,n,e])],En=[[20,26,190],[48,21.2,172],[48,19,200],[88,14.5,198]],Dn=[[21,26,168],[16,26,140],[46,19,144],[36,21.2,178],[58,19,156],[64,19,196],[88,14.5,216],[88,14.5,172],[90,14.5,150]],On=[[19.5,26,179],[46,19,152],[39.5,21.2,172],[88,14.5,186],[88,14.5,207]],kn={armor:!0,name:`Highline`,tag:`Rooftops · 94 × 240 m`,lore:`The towers of an old business district, closed for years, far above streets that still have traffic. Two crews of runners have taken the roofs. Three routes cross between them, and a fall takes you back to your tower.`,brushes:[...Cn,...Cn.map(e=>({...e,min:[e.min[0],e.min[1],hn-e.max[2]],max:[e.max[0],e.max[1],hn-e.min[2]],tint:e.tint===R?gn:e.tint})),...wn],teams:[{base:[32,26,224],spawns:Tn(0,236,231),rack:[30.75,26,217],blade:[38,26,217],rail:[18,26,137],rifle:[48,19,156]},{base:[32,26,16],spawns:Tn(Math.PI,4,9),rack:[30.75,26,23],blade:[38,26,23],rail:[18,26,103],rifle:[48,19,84]}],packs:[...En,...En.map(([e,t,n])=>[e,t,hn-n]),[24,15,112],[24,15,128]],ammo:[...Dn,...Dn.map(([e,t,n])=>[e,t,hn-n]),[12,15,116],[12,15,124]],cells:[...On,...On.map(([e,t,n])=>[e,t,hn-n]),[28,15,120]],vests:[[36,17.2,120],[23,26,136],[23,26,104]],floor:-25,sun:{dir:[.8,.6,0],color:[2.6,2.3,1.8]},sky:[[.04,.2,.72],[.72,.86,.98]],fog:[.72,.86,.98,.0035]},{CONCRETE:An,METAL:jn,STEEL:z,PAINT:Mn}=D,B=(e,t,n,r,i,a,o,s=o,c)=>({min:[e,t,n],max:[r,i,a],top:o,side:s,tint:c}),Nn=(e,t,n,r,i,a)=>({min:[e,t,n],max:[r,i,a]}),Pn=e=>Math.round(10*e)/10,Fn=[0,10.5,13.5,15.5,17],In=e=>[[1,.39],[.93,.71],[.71,.93],[.39,1]].map(([t,n])=>[Pn(t*e),Pn(n*e)]),[[Ln,Rn],[zn,Bn]]=In(22.599999999999998),Vn=.4,Hn=2.48,[V,Un]=[.4,2.48],H=[80,236],Wn=[Nn(111,0,222,125,5,230),Nn(96,0,196,110,5,204)],Gn=[Nn(102,0,223.2,111,3.5,227.2),Nn(98,0,204,102,3.5,227.2)],[[Kn,,qn],[Jn,Yn,Xn],[Zn,,Qn],[$n]]=Gn.flatMap(e=>[e.min,e.max]),er=[[19.8,6.7],[16,13.5]],[[tr,nr],[rr,ir]]=er,ar=[[0,-tr,2,3,2.8],[rr,-10.8,2,3.5,2]],or=[Nn(H[0]-ar[0][2],0,H[1]-tr-1.55,H[0]+ar[0][2],ar[0][3],H[1]-tr-1.25),Nn(116.8,0,Wn[0].max[2]-.3,119.2,Un,Wn[0].max[2]-.1),Nn(101.8,0,Wn[1].min[2]+.1,104.2,Un,Wn[1].min[2]+.3)],sr=e=>[...new Map(e.flatMap(([e,t,n,r])=>[1,-1].flatMap(i=>[1,-1].flatMap(a=>[[e,n,t,r],[t,r,e,n]].map(([e,t,n,r])=>[Math.min(i*e,i*t),Math.min(a*n,a*r),Math.max(i*e,i*t),Math.max(a*n,a*r)])))).map(e=>[`${e}`,e])).values()],U=([e,t,n,r],i,a,o=An,s=o)=>({...B(H[0]+e,i,H[1]+t,H[0]+n,a,H[1]+r,o,s),ghost:!0}),cr=(e,t,n,r,i,a,o)=>{let s=Math.ceil((o-a)/.46);return Array.from({length:s},(c,l)=>{let[u,d]=[t+(n-t)*l/s,t+(n-t)*(l+1)/s].sort((e,t)=>e-t),f=a+(o-a)*(l+1)/s;return e?B(r,a,u,i,f,d,An):B(u,a,r,d,f,i,An)})},lr=[...sr([[12,-ir,rr,ir],[rr,-nr,tr,nr]]).filter(e=>e[1]>-tr).map(e=>U(e,3.1,3.5,jn,z)),...cr(2,H[1]+5.6,H[1]+12,H[0]-1.5,H[0]+1.5,0,3.5).map(e=>({...e,ghost:!0})),U([-3,19,3,tr],3.5,4.6,z,jn),U([-9,12,-2.5,12.5],3.5,4.6,z,Mn),U([2.5,12,9,12.5],3.5,4.6,z,Mn),U([-9.5,-10,-7.5,-8],0,1.4,z),U([7.5,-10,9.5,-8],0,1.4,z),U([7.5,3,10,5.5],0,2.4,z)],ur={BENCH:0,SAMPLES:1,RACKS:2,SCOPE:3,ANALYSER:4,PLANTS:5,LOCKERS:6,SUIT:7},{BENCH:dr,SAMPLES:fr,RACKS:pr,SCOPE:mr,ANALYSER:hr,PLANTS:gr,LOCKERS:_r,SUIT:vr}=ur,yr=[[dr,60.2,230.5,61.2,241.5,0,.95,0],[fr,65,233.5,66.5,238.5,0,.9,0],[pr,98.8,229.3,99.8,234.3,0,3.1,2],[pr,98.8,237.7,99.8,242.7,0,3.1,2],[mr,68.9,250.8,70.1,252,3.5,4.5,3],[hr,89.4,250.8,91.4,252,3.5,4.8,3],[gr,115,222.4,121,223.2,0,2,1],[gr,123.8,226.4,124.6,229.6,0,2,2],[_r,96.4,200.4,97,203.6,0,2.1,0],[vr,108.6,197.4,109.6,198.4,0,2,2]],br=(e,t,n,r,i,a,o=[])=>{let s=(t,n,o)=>e?B(r,o,t,i,a,n,An):B(t,o,r,n,a,i,An);return[...o,[n,n]].flatMap(([e,n],r,i)=>[s(r?i[r-1][1]:t,e,0),...n>e?[s(e,n,Un)]:[]])},xr=({min:[e,,t],max:[n,r,i]},a,o)=>[B(e,4,t,n,r,i,jn,An),...br(0,e,n,t,t+V,4,a[0]),...br(0,e,n,i-V,i,4,a[1]),...br(2,t+V,i-V,e,e+V,4,a[2]),...br(2,t+V,i-V,n-V,n,4),o],Sr=[1,.42,.08],Cr=[...Fn.slice(2).flatMap((e,t)=>In((e=>e<5?22.4:22.4*Math.sqrt(1-((e-5)/12)**2))(Fn[t+1])+.2).map(([n,r])=>U([-n,-r,n,r],Fn[t+1],e))),...sr([[tr,-Rn,Ln,Rn],[rr,nr,zn,Bn],[ir,ir,rr,rr]]).map(e=>U(e,ar.find(([t,n])=>e[0]<=t&&t<=e[2]&&e[1]<=n&&n<=e[3])?.[3]??0,Fn[1])),...[[-Rn,-Ln,-ar[0][2],-tr],[ar[0][2],-Ln,Rn,-tr],[rr,Xn-H[1],zn,-nr],[rr,-Bn,Zn-H[0],qn-H[1]]].map(e=>U(e,0,Fn[1])),...lr,...yr.map(([,e,t,n,r,i,a])=>({...B(e,i,t,n,a,r,z),ghost:!0})),...xr(Wn[0],[[[118,118]],[[116.8,119.2]],[[qn+V,Xn-V]]],B(121.5,0,223.5,123.5,1.2,225.5,Mn,Mn,Sr)),...xr(Wn[1],[[[101.8,104.2]],[[Zn+V,$n-V],[105.8,105.8]]],B(106,0,200.6,108,1.2,202.6,Mn,Mn,Sr)),B(Kn,Un,qn,Jn,Yn,Xn,z,jn),B(Zn,Un,Qn,$n,Yn,Xn,z,jn),B(Zn,0,Xn-V,Jn,Un,Xn,jn),B($n-V,0,qn,Jn,Un,qn+V,jn),B(Zn,0,Qn,Zn+V,Un,qn,jn),B($n-V,0,Qn,$n,Un,qn,jn),...cr(2,214,qn,105,109,0,3.5),...cr(0,108,$n,206,210,0,3.5)],wr={READY:0,ARMED:1,STRUCK:2,COOL:3},Tr=({hall:[e,t]},n,r,i)=>n>e[0]&&n<t[0]&&r>e[1]&&r<t[1]&&i>e[2]&&i<t[2],Er=({hull:[e,,t],post:[[,n]]})=>[[[e-24,n,t-Mr.R],[e+24,n+14,t+Mr.R]],[[e+24,n,t-10],[e+40,n+4,t+10]]],Dr=({hull:[e,,t],post:[[,n]]})=>[t-Mr.R,t+Mr.R].map(t=>[[e-20,n,t],[e+20,n,t],[e+20,n+11,t],[e-20,n+11,t]]),{METAL:Or,STEEL:kr,PAINT:W,GLASS:Ar,GRATE:jr}=D,G=(e,t,n,r,i,a,o,s=o,c)=>({min:[e,t,n],max:[r,i,a],top:o,side:s,tint:c}),Mr={R:44,LOW:-40,TOP:130},K={BARREL:.68,GUN:44,BOOM:16,PANEL:44,SPAN:50,GAP:2,WING:.45,DOME:7,MAST:16},[Nr,Pr]=_n,{STONE:q,CONCRETE:Fr,METAL:Ir,STEEL:Lr,PAINT:Rr}=D,zr=({min:e,max:t})=>Nn(e[0],e[1],280-t[2],t[0],t[1],280-e[2]),Br=[[40,220,13],[13.5,220,13]],Vr=[[106.2,230.4],[103.2,212.4]],Hr=H[1]-2,J=e=>Math.min(Math.max(e,0),1),Y=e=>J(e)*J(e)*(3-2*J(e)),X=(e,t)=>Math.sqrt(e*e+t*t),Ur=[[-100,0,46,.13,.52],[-4,224,36,.12,.67],[110,236,16],[-112,108,14],[236,170,13],[-52,230,10],[80,184,14],[150,250,13],[-36,168,10],[200,152,12],[262,134,14],[240,150,9],[-140,60,12],[-66,60,9],[40,262,10],[118,200,11]],Wr=[[-20,0,-1,0],[192,124,0,-1],[64,236,1,0],[-60,100,0,1]],[Gr,Kr]=[[248,64],[180,200]],qr=[[12,24],[36,60],[72,88],[124,156]],Jr=(()=>{let e=Array.from({length:160},(e,t)=>qr.some(([e,n])=>t>=e-1&&t<=n)?0:Math.min(Math.round(Math.max(26*C(t/17,0,33)+8*C(t/5,0,35)-11,0))/2,6.5));for(let t of[1,-1])for(let n=t>0?1:158;n>=0&&n<160;n+=t)e[n]=Math.min(e[n],e[n-t]+.5);return e.map((e,t)=>{let n=Math.min(t,159-t);return n<4?-6:n<8?-3:e})})(),Yr=e=>e.reduce((e,t,n)=>(e.at(-1)?.[2]===t?e.at(-1)[1]++:e.push([n,1,t]),e),[]),Xr=Yr(Jr),Z=[114,176,2],Zr=[48,144],[Qr,$r]=[3,8],ei=[[27,67,53,93],[.5,67,26.5,93],[56,74,104,133],[96,56,125,90],[98,36,102,40],[28,113,32,117],[30,45,30,45],[135,50,135,50],[50,106,50,106],[35,104,35,104],[115,22,115,22],[45,20,51,62],[114,36,114,36],[141,20,147,66]],ti=[[0,0,4.5],[-14,6,3],[10,-12,3.5],[16,10,2.5],[-8,-16,2.2],[-20,-8,3.8],[6,18,3],[22,-4,2],[-12,20,2.4]].map(([e,t,n])=>[e-50,t+330,n]),ni=[[126,143,131,147,1.2],[130,138.5,135,141.5,2.4],[126,133,131,137,1.2]],ri=[[180,340],[173,346],[186,347]],ii=[Ur[0][0]-4.5,140],ai=[[6,174,2.5],[32.5,156.5,3.1],[67.5,159.5,1.9],[97.5,166,2.8],[128,177.5,3.4],[94,188,2.5],...Array.from({length:36},(e,t)=>{let n=e=>De(t,e,41),r=Math.floor(3*n(1)),[i,a]=r<2?[(r?151:0)+9*n(2),150+122*n(3)]:[5+150*n(2),273+7*n(3)];return[i,a+(r===0&&Math.abs(a-174)<8?16:0),.6+2.4*n(4)*n(4)]}),...ti],oi=(e,t)=>{let n=t=>J((12-Math.abs(t-e))/8)*J((152-t)/4),r=4*Math.floor(t/4);return n(r)+(n(r+4)-n(r))*(t-r)/4},si=[[8,0,28,16],[70,0,90,16],[122,0,139,16],[36,0,60,16],[132,0,156,16]],ci=(e,t)=>{t=Math.abs(t-140);let n=X((e-80)/300,t/360),r=Math.max((n-.78)/.22,0),i=((e,t)=>{let[n,r]=[0,0];for(let[i,a,o,s=.17,c=0]of Ur){let l=X(e-i,t-a),[u,d]=l?[(e-i)/l,(t-a)/l]:[1,0],f=l/o*(.9+.2*C(2.5*u+.37*i,2.5*d+.21*a,9)),p=.03+.045*C(4*u-.1*a,4*d+.1*i,10),m=1-J((f-1-4/o)/.6),h=c?(s+p)*J((f-c)/(1-c))-s:(s+p)*f*f-s;n+=o*(f<1?h:p*m*m),r=Math.max(r,c?J((1.6-f)/(1.5-c)):0)}return[n,r]})(e,t),a=Math.max(Math.abs(e-80)-80,t-140),o=Y((a-12)/48)*(1-.7*Y(r))*(16*C(e/96,t/96,1)+6*C(e/52,t/52,4)+5*C(e/36,t/36,2)+1.4*C(e/22,t/22,3)-14.2);if(a<0){let n=Y((t-16-10*C(e/19,.5,37))/8)*Y(-a/10);for(let[r,i,a,o]of ei)n*=Y((X(Math.max(r-e,e-a,0),Math.max(i-t,t-o,0))-(r<a?6:7.5))/6);o=n*Math.min(Math.max(4.8*C(e/15,t/15,21)-.9,0)+Math.max(3*C(e/31,t/31,23)-.6,0),2.6);let r=Y((10-X(e-Z[0],t-(Z[1]-140)))/8);o=o*(1-r)-Z[2]*r;for(let n of Zr)o+=Qr*J((8+$r-t)/$r)*oi(n,e);o=t<8?0:o}o=(a<0?o:o*(1-i[1]))+i[0]+((e,t,n)=>{let r=(n,r,i)=>n.reduce((n,[a,o,s,c])=>n*Y((X(Math.max(a-e,e-s,0),Math.max(o-t,t-c,0))-r)/i),1);if(n<0){let i=Math.min(Math.max(Math.floor(e),6),Jr.length-7),a=Math.max(...Jr.slice(i-6,i+7),0);return(.6*Math.max(C(e/5,t/5,61)-.42,0)+.25*Math.max(C(e/9,t/9,67)-.5,0))*Y(-n/4)*Y((t-14-a)/3)*r(ei.filter(e=>e[0]===e[2]),7.5,2)*r(ei.filter(e=>e[0]<e[2]),5.7,2)*r(si,5.7,2)}let i=Y(n/4)*(Math.abs(e-80)<96?Y((t-10)/6):1);for(let[n,r,a,o]of Wr){let[s,c]=[e-n,t-r],l=s*a+c*o;i*=Y((X(Math.max(-22-l,l-38,0),Math.max(Math.abs(s*o-c*a)-10,0))-2)/4)}for(let[n,r,a]of Ur)i*=Y((X(e-n,t-r)/a-1.3)/.25);return i*=Y((X(e-Kr[0],t-Kr[1])-40)/20),(.75*Math.max(C(e/5,t/5,61)-.42,0)-.8*Math.max(C(e/7,t/7,63)-.6,0)+.25*(C(e/11,t/11,65)-.5))*i})(e,t,a)*(1-i[1])*(1-Y(r));for(let[n,r,i,a]of Wr){let[s,c]=[e-n,t-r],l=s*i+c*a;o+=5.6*J(Math.min(l/16,(32-l)/12))*J((18-Math.abs(s*a-c*i))/12)}let s=J(X(e-Gr[0],Math.max(t-Gr[1],0))/36);o+=12*(1-s*s)*(1-s*s)+8*Y((36-X(e-Kr[0],t-Kr[1]))/24);let c=10*r*(1+r);if(n>1){let r=28+14*C(e/170,t/170,5)+6*C(e/70,t/70,7),i=10*Y((n-1)/.1);c=(c+r-Math.sqrt((c-r)*(c-r)+i*i))/2*(1-Y((n-1.3)/.35))}return o*=1-.55*Y((16-X(e-44,t-122))/10),Math.max(o,-14.5)+c},li=e=>Math.max(.3*e,Math.min(.5*e,.8)),ui=(e,t,n)=>{let r=t=>De(e,t,131),i=e=>{let[t,n]=[2*r(e)-1,2*r(e+1)-1],i=Math.sqrt(t*t+n*n)||1;return[t/i,n/i]},[a,o]=i(1),[s,c]=[t*(.9+.25*r(3)),t*(.68+.22*r(4))],l=.3*r(9)-.15,[u,d]=i(5),[f,p]=i(7),m=t=>{let n=.8+.28*C(1.1*t[0]+e,1.1*t[2]+.9*t[1],e)+.1*C(2.3*t[0]-e,2.3*t[2]+1.7*t[1],e+1),r=J((.8*(t[0]*u+t[2]*d)+.6*t[1]-.55)/.45),i=J((.954*(t[0]*f+t[2]*p)+.3*t[1]-.4)/.6);return n*(1-.14*r*r)*(1-.16*i*i)},h=(n-li(n))/m([0,1,0]),g=li(n)+.7*n,_=e=>{if(e[1]<0){let t=Math.sqrt(e[0]*e[0]+e[2]*e[2]);return t<1e-6?g:Math.min(_([e[0]/t,0,e[2]/t])/t,g/-e[1])}let t=(e[0]*a+e[2]*o-l*e[1])/s,n=(e[2]*a-e[0]*o-(.15-l)*e[1])/c,r=e[1]*e[1]/(h*h),[i,u]=[t*t+n*n+.65*r,.35*r*r],d=u<1e-12?1/i:(Math.sqrt(i*i+4*u)-i)/(2*u);return Math.sqrt(d)*m(e)};return{reach:_}},di=[.16,.3,.16,.3],fi=({reach:e},t,r,i,a)=>{let o=(n,r)=>{let i=new Float64Array(8*r),a=[0,0,0];for(let o=0;o<8*r;o++){let s=(o%(2*r)+.5)/r-1,c=Math.floor(o/(2*r)),l=Math.sqrt(1+s*s)*(c>1?-1:1),u=(c%2?-s:1)/l,d=(c%2?1:s)/l,f=0,p=1.6*t;for(let t=0;t<8;t++){let t=(f+p)/2,r=Math.sqrt(t*t+n*n);a[0]=t*u/r,a[1]=n/r,a[2]=t*d/r,r<=e(a)+.07?f=t:p=t}i[o]=f}return i},s=(e,t,n)=>{let r=e.length/8,i=Math.abs(t)>=Math.abs(n);if(Math.abs(t)+Math.abs(n)<1e-9)return!0;let a=(1+(i?n/t:-t/n))*r-.5+2*(i?t>0?0:2:n>0?1:3)*r,o=Math.floor(a),s=e[(o+8*r)%(8*r)]*(1-(a-o))+e[(o+1)%(8*r)]*(a-o);return t*t+n*n<=s*s},c=e([0,1,0])-.1,l=Math.max(.07,Math.min(.12,t/12)),u=[],d=i-n+.7,f=[r];for(let e=r;e<c-1e-9;){let t=e<i-1e-9?di[0]:di[1],n=o(e+.03,2),a=Math.min(e===r&&d<c-.3?d:e+.25,c);for(;a<c&&a-e<.9&&o(Math.min(a+.1,c),2).every((e,r)=>Math.abs(e-n[r])<=t);)a=Math.min(a+.1,c);e=c-a<.15?c:a,f.push(e)}let p=f.map((e,t)=>o(t?e:e+.03,8));for(let e=0;e+1<f.length;e++){let[t,n]=[f[e],f[e+1]],r=t<i-1e-9?di[2]:di[3],o=Math.ceil(Math.min(Math.max(...p[e]),Math.max(...p[e+1]))/l)+1,c=2*o+1,d=new Uint8Array(c*c);for(let t=0;t<c;t++)for(let n=0;n<c;n++){let[r,i]=[(t-o)*l,(n-o)*l];d[t+n*c]=s(p[e],r,i)&&s(p[e+1],r,i)?1:0}let m=Math.max(1,Math.round(r/l)),h=(e,t)=>e>=0&&e<c&&t>=0&&t<c&&d[e+t*c]>0,g=new Uint8Array(c*c);for(let e=0;e<c;e++)for(let t=0;t<c;t++)g[e+t*c]=!h(e,t)||h(e-1,t)&&h(e+1,t)&&h(e,t-1)&&h(e,t+1)?0:1;let _=[],v=new Uint8Array(c),y=c>48?2:1;for(let e=0;e<c;e+=y){v.fill(1);for(let t=e;t<c;t++){let n=!1;for(let r=0,i=0;r<=c;r++)v[r]=r<c&&v[r]&&d[t+r*c]?1:0,v[r]||(r-1-i>=2&&t-e>=2&&(t-e)%y===0&&_.push([e,i,t,r-1]),n||=r-1>i,i=r+1);if(!n)break}}let b=new Int32Array((c+1)*(c+1)),x=(e,t,n,r)=>{let[i,a,o,s]=[Math.max(e,0),Math.max(t,0),Math.min(n,c-1)+1,Math.min(r,c-1)+1];return b[o+s*(c+1)]-b[i+s*(c+1)]-b[o+a*(c+1)]+b[i+a*(c+1)]},ee=[];for(let r=0;r<40&&_.length;r++){for(let e=0;e<c;e++)for(let t=0;t<c;t++)b[t+1+(e+1)*(c+1)]=g[t+e*c]+b[t+(e+1)*(c+1)]+b[t+1+e*(c+1)]-b[t+e*(c+1)];let[i,s]=[-1,0];for(let e=0;e<_.length;e++){let t=_[e];if(r&&!ee.some(e=>t[0]<e[2]&&e[0]<t[2]&&t[1]<e[3]&&e[1]<t[3]))continue;let n=(t[2]-t[0])*(t[3]-t[1]),a=r?x(t[0]-m,t[1]-m,t[2]+m,t[3]+m):2,o=r?1e6*a+n:n;a>=2&&o>s&&([i,s]=[e,o])}if(i<0)break;let[d,f,p,h]=_[i];ee.push(_[i]);for(let e=Math.max(d-m,0);e<=Math.min(p+m,c-1);e++)for(let t=Math.max(f-m,0);t<=Math.min(h+m,c-1);t++)g[e+t*c]=0;u.push([(d-o)*l,e?t:a,(f-o)*l,(p-o)*l,n,(h-o)*l])}}return u},pi=(e,t)=>{let[n,r]=[Math.floor(e/4),Math.floor(t/4)],[i,a]=[e/4-n,t/4-r],o=(e,t)=>ci(4*(n+e),4*(r+t)),[s,c]=[o(0,0),o(1,1)];return i>=a?s+(o(1,0)-s)*i+(c-o(1,0))*a:s+(o(0,1)-s)*a+(c-o(0,1))*i},mi=[[32.5,156.5,3.1,3.45,62],[67.5,159.5,1.86,1.84,63],[97.5,166,2.79,2.99,64],[128,177.5,3.41,3.68,65],[-50,330,3.6,2.9,100],[-64,336,2.4,1.9,101],[-14,204,2.4,1.9,110],[176,212,2.8,2.3,111]].map(([e,t,r,i,a])=>((e,t,r,i,a)=>{let o=pi(e,t),s=o+li(i),c=[-3,-2,-1,0,1,2,3].map(e=>.4*r*e),l=c.map(n=>c.map(r=>pi(e+n,t+r))),u=Math.max(Math.min(...l.flat()),o-.55*i),d=Math.max(...l.flat())+n;return{at:[e,o,t],R:r,H:i,s:a,parts:fi(ui(a,r,i),r,u-s,d-s,u-.5-s).map(([n,r,i,a,o,c])=>[e+n,s+r,t+i,e+a,s+o,t+c])}})(e,t,r,i,a)),[Q,hi,gi,_i]=[9,12,-19,7],vi=Ur.filter(e=>e[4]).map(([e,t],n)=>{let r=140+t,i=Array.from({length:2*Q},(e,t)=>{let i=Math.abs(t+.5-Q),a=Math.sqrt(Q*Q-i*i),o=e=>Math.ceil(2*a*(.88+.24*C(i/4,e+.5,60+n)))/2;return[r-Q+t,r-Q+t+1,o(0),o(1)]});return{x:e,z:r,level:ci(e,r),rows:i}}),yi=({x:e,z:t,level:n,rows:r})=>{let i=r.reduce((e,[t,n,r,i])=>{let a=e.at(-1);return a&&a[2]===r&&a[3]===i?a[1]=n:e.push([t,n,r,i]),e},[]),a=r[Q][3],o=(n-gi)/_i;return[B(e-hi,-30,t-hi,e+hi,n,t-Q,q),B(e-hi,-30,t+Q,e+hi,n,t+hi,q),...i.flatMap(([t,r,i,a])=>[B(e-hi,-30,t,e-i,n,r,q),B(e+a,-30,t,e+hi,n,r,q)]),B(e-Q-1.5,-30,t-Q,e+Q+1.5,gi,t+Q,q),...Array.from({length:_i-1},(n,r)=>B(e+a-1.3*(_i-1-r),gi,t-1,e+a-1.3*(_i-2-r),gi+o*(r+1),t+1,q))].map(e=>({...e,ghost:!0}))},bi=(e,t,n,r)=>({...B(e-n,ci(e,t)-6,t-n,e+n,ci(e,t)+r,t+n,q),ghost:!0}),xi={dishes:[...ri,...ri.map(([e,t])=>[e,280-t])],ramps:Wr.flatMap(([e,t,n,r])=>(t?[1,-1]:[1]).map(i=>[e+16*n,140+i*(t+16*r),n,i*r+0])),wreck:ii,pits:vi.flatMap(e=>e.z===140?[e]:[e,{...e,z:280-e.z,rows:e.rows.map(([e,t,n,r])=>[280-t,280-e,n,r]).reverse()}]),bowls:Ur.flatMap(([e,t,n,r=.17])=>(t?[1,-1]:[1]).map(i=>[e,140+i*t,n,r])),crags:mi,sites:ai,pillars:ni,domes:[H,[H[0],280-H[1]]],pads:[...Br,...Br.map(([e,t,n])=>[e,280-t,n])],modules:[...Wn,...Wn.map(zr)],tubes:[...Gn,...Gn.map(zr)],masts:[...Vr,...Vr.map(([e,t])=>[e,280-t])]},Si=([e,t,n])=>[e,t,280-n],Ci=(e,...t)=>[...e,...e.map(Si),...t],wi=[...[B(0,-30,160,160,0,Z[1]-12,q),B(0,-30,Z[1]-12,Z[0]-12,0,Z[1]+12,q),B(Z[0]+12,-30,Z[1]-12,160,0,Z[1]+12,q),B(0,-30,Z[1]+12,160,0,280,q),B(Z[0]-12,-30,Z[1]-12,Z[0]+12,-3,Z[1]+12,q),...Xr.filter(e=>e[2]<0).map(([e,t,n])=>B(e,-30,148+n,e+t,0,160,q)),...Array.from({length:14},(e,t)=>Yr(Jr.map(e=>e<0?2:+(e>t/2))).filter(e=>!e[2]).map(([e,n])=>B(e,-30,148+t/2,e+n,0,t<13?148.5+t/2:160,q))).flat(),...Zr.flatMap(e=>[-12,-10,-8,-6,-4,4,6,8,10].map(e=>[e,e+(e===-4?8:2)]).map(([t,n])=>[e+t,e+n,Qr*Math.min(oi(e,e+t),oi(e,e+n))*(1-.5/$r)-.12]).filter(e=>e[2]>.3).map(([e,t,n])=>B(e,0,148,t,n,148.5,q)))].map(e=>({...e,ghost:!0})),...Cr,{...B(75.25,0,Hr-4.75,84.75,.5,Hr+4.75,Rr,Fr,Nr),ghost:!0},{...B(75.75,.5,Hr-4.25,84.25,1,Hr+4.25,Rr,Fr,Nr),ghost:!0},...Br.map(([e,t,n])=>B(e-n,0,t-n,e+n,.25,t+n,Ir)),...Vr.map(([e,t])=>B(e-.2,0,t-.2,e+.2,10,t+.2,Lr)),B(12,-30,146.75,24,0,148,Rr,q,[1,.42,.08]),...vi.filter(e=>e.z!==140).flatMap(yi),...(e=mi,e.flatMap(e=>e.parts).map(([e,t,n,r,i,a])=>({...B(e,t,n,r,i,a,q),ghost:!0}))),...ri.map(([e,t])=>bi(e,t,.4,6))],Ti=[B(74,-1.5,132,86,0,148,Ir,Lr),B(74,0,132,74.4,1.1,148,Fr),B(85.6,0,132,86,1.1,148,Fr),...ni.map(([e,t,n,r,i])=>({...B(e,-30,t,n,i,r,q),ghost:!0})),{...B(-10,-30,132,0,0,148,q),ghost:!0},{...B(160,-30,132,170,0,148,q),ghost:!0},{...B(ii[0]-3.6,-30,ii[1]-3.6,ii[0]+3.6,gi+3.5,ii[1]+3.6,q),ghost:!0},...vi.filter(e=>e.z===140).flatMap(yi),...xi.ramps.flatMap(([e,t,n,r])=>[-8,8].map(i=>bi(e+i*r,t-i*n,.2,2.2)))],Ei=[...[56,68,80,92,104].map(e=>[e,0,271,0]),...[62,80,98].map(e=>[e,0,267,0])],Di=(e,t)=>{let n=t=>e>140?t:Si(t);return{base:[80,1,e],spawns:t,rack:n([66,0,262]),blade:n([94,0,262]),rifle:n([145,0,191]),rail:n([43,0,158])}},[Oi,ki,Ai]=((e,t,n)=>{let{R:r,LOW:i,TOP:a}=Mr,[o,s,c,l]=[56,104,n-r,n+r],u=[.78,.8,.84],d=[.95,.55,.15],f=[[110.5,t,138.5],[112.5,601.1,141.5]],p=[];for(let u=e-r;u<e+r;u+=4){let d=Math.max(Math.abs(u-e),Math.abs(u+4-e)),f=Math.sqrt(r*r-d*d),m=(e,t,n,r)=>r>n&&p.push({...G(u,e,n,u+4,t,r,Or),ghost:!0});m(t+i,598,n-f,n+f),m(616,t+a,n-f,n+f);let[h,g]=u<s?u+4>o?[c,l]:[n,n]:u<120?[130,150]:[n,n];m(598,616,n-f,Math.min(h,n+f)),m(598,616,Math.max(g,n-f),n+f);let _=Math.sqrt(Math.max(0,(.75*r)**2-d*d));m(t+a,t+a+K.DOME-2,n-_,n+_);let v=K.BARREL*r+3,y=Math.sqrt(Math.max(0,v*v-d*d));m(t+i-K.GUN,t+i,n-y,n+y)}let m=t+i+(a-i)*K.WING,h=K.BOOM+4*(K.PANEL+K.GAP)+3;for(let t of[-1,1]){let[n,i]=[e+t*r,e+t*(r+h)];p.push({...G(Math.min(n,i),m-1.5,138.5,Math.max(n,i),m+1.5,141.5,Or),ghost:!0},{...G(Math.min(n,i),m-K.SPAN/2,139.6,Math.max(n,i),m+K.SPAN/2,140.4,Or),ghost:!0})}p.push({...G(55,t+a+3,133,73,t+a+K.MAST+6,147,Or),ghost:!0});let g=[[s-2.15,t,137],[s-1.85,603.2,143]];return[[G(o,598,c,s,t,l,jr,Or),G(o,614,c,s,616,l,Or),G(o,t,c,o+4,614,l,W,W,u),G(s-4,t,c,s,614,137,W,W,u),G(s-4,t,143,s,614,l,W,W,u),G(s-4,603.2,137,s,614,143,W,W,u),G(o+4,611,c,s-4,614,c+4,kr,kr,d),G(o+4,611,l-4,s-4,614,l,kr,kr,d),G(s,598,130,120,t,150,Or),G(s,604,130,120,605,150,Or),G(s,t,130,120,604,132,W,W,u),G(s,t,148,120,604,150,W,W,u),G(118,t,132,120,604,148,Ar),G(...f[0],...f[1],kr,kr,d),...p],{post:f,hall:[[o,599,c],[120,616,l]],hull:[e,t+i,n,t+a],gun:[e,t+i-K.GUN,n]},{min:g[0],max:g[1]}]})(80,600,140),ji={name:`Tranquility`,tag:`Moon · half gravity`,lore:`A mining base left in a lunar crater, its domes still lit. Two crews fight for it in space helmets, under the Earth and a black sky. Jumps float twice as high, and a rille cuts the base in two.`,brushes:[...wi,...wi.map(e=>({...e,min:[e.min[0],e.min[1],280-e.max[2]],max:[e.max[0],e.max[1],280-e.min[2]],tint:e.tint===Nr?Pr:e.tint})),...Ti,...Oi],teams:[Di(Hr,Ei),Di(280-Hr,Ei.map(([e,t,n])=>[e,t,280-n,Math.PI]))],packs:Ci([[90,0,210],[118,5,226],[30,0,185],[80,3.5,253.5]],[45,0,162],[45,0,118]),ammo:Ci([[50,0,246],[103,5,200],[135,0,190]],[115,0,162],[115,0,118]),cells:Ci([[106.5,3.5,226],[35,0,244]],[80,0,140]),vests:Ci([[107,5,200]],[132.5,2.4,140]),floor:-26,relief:{hole:[0,132,160,148],pits:[...Xr.flatMap(([e,t,n])=>n>0?[[e,148,e+t,148+n],[e,132-n,e+t,132]]:[]),...xi.pits.flatMap(({x:e,rows:t})=>t.map(([t,n,r,i])=>[e-r,t,e+i,n]))],bound:[80,140,300,360],cell:4,at:ci},sun:{dir:[.87996,.40998,.23999],color:[3,2.95,2.85]},sky:[[.002,.002,.006],[.02,.02,.035]],gravity:.5,rovers:[[100,0,178,0],[30,0,255,0],[100,0,102,Math.PI],[30,0,25,Math.PI]],ships:[...Br.map(([e,t])=>[e,.25,t,0]),...Br.map(([e,t])=>[e,.25,280-t,Math.PI])],doors:[...or,...or.map(zr),Ai],scenery:`moon`,helmets:!0,armor:!0,seam:Ee.SEAM,station:ki},Mi={PELVIS:0,SPINE:1,CHEST:2,NECK:3,HEAD:4,CLAVICLE_L:5,ARM_L:6,FOREARM_L:7,HAND_L:8,CLAVICLE_R:9,ARM_R:10,FOREARM_R:11,HAND_R:12,THIGH_L:13,SHIN_L:14,FOOT_L:15,TOE_L:16,THIGH_R:17,SHIN_R:18,FOOT_R:19,TOE_R:20},Ni=Object.keys(Mi).length,Pi=[-1,0,1,2,3,2,5,6,7,2,9,10,11,0,13,14,15,0,17,18,19],Fi=[[0,.98,0],[0,.12,0],[0,.2,0],[0,.22,0],[0,.1,0],[-.04,.17,0],[-.15,0,0],[-.03,-.29,0],[0,-.26,0],[.04,.17,0],[.15,0,0],[.03,-.29,0],[0,-.26,0],[-.1,-.05,0],[0,-.44,0],[0,-.43,0],[0,-.04,-.13],[.1,-.05,0],[0,-.44,0],[0,-.43,0],[0,-.04,-.13]],Ii={MALE:0,FEMALE:1},$=Fi.map(e=>[...e]);$[1]=[0,.115,0],$[2]=[0,.19,0],$[3]=[0,.21,0],$[4]=[0,.095,0],[-1,1].forEach((e,t)=>{$[5+4*t]=[.035*e,.16,0],$[6+4*t]=[.132*e,0,0],$[7+4*t]=[.026*e,-.275,0],$[8+4*t]=[0,-.25,0],$[13+4*t]=[.104*e,-.05,0]});var Li=[Fi,$],Ri=[0,0,0,1],zi=(e=[0,0,0],t=0,n=0)=>({at:e,yaw:t,hips:[0,0,0],rot:Array.from({length:Ni},()=>[...Ri]),...n?{rest:Li[n]}:{}}),Bi=([e,t,n,r],[i,a,o,s])=>[r*i+e*s+t*o-n*a,r*a-e*o+t*s+n*i,r*o+e*a-t*i+n*s,r*s-e*i-t*a-n*o],Vi=([e,t,n],r)=>{let i=Math.sin(r/2);return[e*i,t*i,n*i,Math.cos(r/2)]},Hi=(e,[t,n,r])=>{let[i,a,o,s]=e,[c,l,u]=[2*(a*r-o*n),2*(o*t-i*r),2*(i*n-a*t)];return[t+s*c+a*u-o*l,n+s*l+o*c-i*u,r+s*u+i*l-a*c]},Ui=(e,t,n)=>{let r=e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],i=r<0?-1:1;if(r*=i,r>.9995){let r=e.map((e,r)=>e+(i*t[r]-e)*n),a=Math.hypot(...r);return r.map(e=>e/a)}let a=Math.acos(r),[o,s]=[Math.sin((1-n)*a),Math.sin(n*a)*i],c=1/Math.sin(a);return e.map((e,n)=>(e*o+t[n]*s)*c)},Wi=e=>{let t=[],n=[],r=Vi([0,1,0],e.yaw),i=e.rest??Li[0];for(let a=0;a<Ni;a++){let o=Pi[a],s=o<0?r:n[o];n[a]=Bi(s,e.rot[a]);let c=Hi(s,a===0?i[0].map((t,n)=>t+e.hips[n]):i[a]),l=o<0?e.at:t[o];t[a]=[l[0]+c[0],l[1]+c[1],l[2]+c[2]]}return{pos:t,rot:n}},Gi=[1,.62],Ki=2.2,qi=e=>{let t=parseInt(l[e].slice(1),16);return[t>>16,t>>8&255,255&t].map(e=>e/255)},Ji=(e,t,n)=>e.flatMap((e,r)=>{if(e.state===Me.DROPPED)return[{team:r,at:[e.x,e.y,e.z],dropped:!0}];if(e.state===Me.CARRIED){let t=n(e.by);return t?[{team:r,at:[t.x,t.y,t.z],by:{id:e.by,yaw:t.yaw,vx:t.vx,vz:t.vz}}]:[]}return[{team:r,at:t[r]}]}),Yi=[[1,0,0],[0,1,0],[0,0,1]],Xi=(e,t,n)=>{let r=zt(e,0);for(let i=t;i<e.length;i+=10)r[i+6]*=n,r[i+7]*=n,r[i+9]*=n,r[i+8]=-2},Zi=(e,t,n,r,[i,a,o])=>{let[s,c,l]=[n[0]-t[0],n[1]-t[1],n[2]-t[2]],[u,d,f]=[r[0]-t[0],r[1]-t[1],r[2]-t[2]],p=[c*f-l*d,l*u-s*f,s*d-c*u],m=Math.hypot(...p)||1;if(Array.isArray(e))for(let s of[t,n,r])e.push(...s,p[0]/m,p[1]/m,p[2]/m,i,a,-1,o);else{let s=e.room(30),c=e.length,l=p[0]/m,u=p[1]/m,d=p[2]/m;for(let e of[t,n,r])s[c++]=e[0],s[c++]=e[1],s[c++]=e[2],s[c++]=l,s[c++]=u,s[c++]=d,s[c++]=i,s[c++]=a,s[c++]=-1,s[c++]=o;e.length=c}},Qi=(e,t,n,r,i)=>{for(let a=0;a<28;a++){let[o,s]=[a,a+1].map(e=>2*e*Math.PI/28),c=(e,n)=>[t[0]+e*Math.cos(n),t[1],t[2]+e*Math.sin(n)];Zi(e,c(n,o),c(r,s),c(r,o),i),Zi(e,c(n,o),c(n,s),c(r,s),i)}},$i=(e,t,n,r)=>{((e,t,n,r)=>{for(let i=0;i<28;i++){let[a,o]=[i,i+1].map(e=>2*e*Math.PI/28);Zi(e,t,[t[0]+n*Math.cos(o),t[1],t[2]+n*Math.sin(o)],[t[0]+n*Math.cos(a),t[1],t[2]+n*Math.sin(a)],r)}})(e,[t[0],t[1]+.04,t[2]],1.5,n.map(e=>.4*e));let i=e.length;Qi(e,[t[0],t[1]+.045,t[2]],1.34,1.5,n),Xi(e,i,Ki*(.75+.25*Math.sin(3*r)))},ea=(e,t,n,[r,i],a,o,s)=>{let c=[-n[2],0,n[0]],l=(e,s)=>{let l=a*e*Math.sin(7*o-5*e),u=i*s*(1-e);return[t[0]+n[0]*r*e+c[0]*l,t[1]-u+.12*r*e*Math.sin(5*o-4*e)*a,t[2]+n[2]*r*e+c[2]*l]};for(let t=0;t<8;t++){let[n,r]=[t/8,(t+1)/8],[i,a,o,c]=[l(n,0),l(r,0),l(r,1),l(n,1)],u=[(a[1]-i[1])*(c[2]-i[2])-(a[2]-i[2])*(c[1]-i[1]),(a[2]-i[2])*(c[0]-i[0])-(a[0]-i[0])*(c[2]-i[2]),(a[0]-i[0])*(c[1]-i[1])-(a[1]-i[1])*(c[0]-i[0])],d=Math.hypot(...u)||1,f=(e,t)=>[e[0]+u[0]/d*.004*t,e[1]+u[1]/d*.004*t,e[2]+u[2]/d*.004*t];for(let t of[1,-1]){let n=[i,a,o,c].map(e=>f(e,t)),[r,l,u,d]=t>0?n:[n[0],n[3],n[2],n[1]];Zi(e,r,l,u,s),Zi(e,r,u,d,s)}}},ta=(e,t,n,r)=>{mn(e,un(1,1,[1,1],[0,0]),t,n,[.6,0,.8],1,.045,[.82,.84,.9]);let i=e.length;dn(e,un(1,0,[1,1]),n,Yi,[0,0,0],.09,r),Xi(e,i,Ki)},na=(e,t,n,r,i)=>{let[a,o,s]=t.at,c=r+1.7*t.team;if(t.by){let{yaw:r,vx:l,vz:u}=t.by,d=-Math.sin(r),f=-Math.cos(r),p=Math.hypot(l,u),[m,h]=i??[[a,o+1.3,s],Vi([0,1,0],r)],g=e=>Hi(h,e).map((e,t)=>m[t]+e),_=g([0,-.4,.2]),v=g([0,1.5499999999999998,.42]),[y,b]=p>1?[-l/p,-u/p]:[-d,-f];ta(e,_,v,n);let x=Math.min(1,p/8);ea(e,v,[y,0,b],[Gi[0]*(.7+.5*x),Gi[1]],.1+.16*x,c,n);return}if(t.dropped){let t=12.9898*a+78.233*s,[i,l]=[Math.cos(t),Math.sin(t)],u=[a+2.3*i,o+.6,s+2.3*l];ta(e,[a,o+.06,s],u,n),ea(e,u,[i,0,l],[.8*Gi[0],.8*Gi[1]],.04,c,n);let d=e.length;Qi(e,[a,o+.045,s],1.4,1.5,n),Xi(e,d,Ki*(.5+.5*Math.abs(Math.sin(5*r))));return}let l=[a,o+2.4,s];ta(e,[a,o,s],l,n);let u=.6+t.team*Math.PI;ea(e,l,[Math.cos(u),0,Math.sin(u)],Gi,.18,c,n)},ra=[[1,0,0],[0,0,1],[0,1,0]],ia=(e,t)=>[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]],aa=(e,t,n,r)=>{let i=ia(Bt(t[1],t[0]),Bt(t[2],t[0])),a=r&&Ht(i,Bt(t[0],r))<0?[...t].reverse():t;for(let t=1;t<a.length-1;t++)Zi(e,a[0],a[t],a[t+1],n)},oa=(e,t,n,r,i=0)=>{let a=t.map((e,t)=>(e+n[t])/2),o=e=>[1&e?n[0]:t[0],2&e?n[1]:t[1],4&e?n[2]:t[2]];for(let t of[[0,1,3,2],[4,5,7,6],[0,1,5,4],[2,3,7,6],[0,2,6,4],[1,3,7,5]].filter((e,t)=>!(i>>t&1)))aa(e,t.map(o),r,a)},sa=(e,t,n)=>{let r=e.length;n(),Xi(e,r,t)};export{Vn as $,be as $n,Ye as $t,gi as A,b as An,it as At,Tr as B,le as Bn,Et as Bt,Ui as C,se as Cn,mn as Ct,xi as D,r as Dn,Wt as Dt,ei as E,te as En,Bt as Et,li as F,ce as Fn,lt as Ft,lr as G,ye as Gn,ot as Gt,Er as H,i as Hn,Lt as Ht,ui as I,pe as In,yt as It,ur as J,t as Jn,ut as Jt,er as K,ne as Kn,ht as Kt,Mr as L,de as Ln,Dt as Lt,hi as M,s as Mn,P as Mt,_i as N,o as Nn,Tt as Nt,Jr as O,x as On,Rt as Ot,si as P,S as Pn,jt as Pt,Gn as Q,Ce as Qn,k as Qt,K as R,ue as Rn,tt as Rt,zi as S,d as Sn,dn as St,Hi as T,ie as Tn,un as Tt,Cr as U,Ee as Un,_t as Ut,Dr as V,_e as Vn,ct as Vt,H as W,ve as Wn,et as Wt,Wn as X,oe as Xn,Ke as Xt,yr as Y,p as Yn,dt as Yt,ar as Z,ae as Zn,Ze as Zt,Pi as _,C as _n,on as _t,sa as a,ze as an,v as ar,qt as at,Vi as b,he as bn,sn as bt,na as c,Fe as cn,c as cr,Yt as ct,Qi as d,Pe as dn,en as dt,Re as en,xe as er,kn as et,qi as f,T as fn,tn as ft,Ni as g,De as gn,rn as gt,Mi as h,Ae as hn,pn as ht,aa as i,Be as in,g as ir,$t as it,Q as j,ee as jn,Qe as jt,ji as k,y as kn,zt as kt,Ji as l,Me as ln,Te as lr,Gt as lt,Ii as m,je as mn,Vt as mt,oa as n,Ve as nn,a as nr,Xt as nt,Ki as o,Ne as on,_ as or,Kt as ot,Zi as p,D as pn,nn as pt,Hn as q,n as qn,at as qt,ia as r,He as rn,h as rr,Zt as rt,$i as s,E as sn,l as sr,Jt as st,ra as t,Ie as tn,we as tr,_n as tt,Xi as u,w as un,Qt as ut,Fi as v,ke as vn,fn as vt,Wi as w,re as wn,an as wt,Bi as x,me as xn,Ut as xt,Li as y,ge as yn,Ht as yt,wr as z,fe as zn,gt as zt};