@korial29/tiny-fps 0.53.1 → 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/index.js +15 -15
- package/dist/local.js +1 -1
- package/dist/server.js +109 -30
- package/dist/types/client/beams.d.ts +2 -0
- package/dist/types/client/combat.d.ts +2 -2
- package/dist/types/client/flag.d.ts +2 -0
- package/dist/types/client/gun.d.ts +33 -10
- package/dist/types/client/hud.d.ts +3 -2
- package/dist/types/client/input.d.ts +7 -6
- package/dist/types/client/props.d.ts +4 -4
- package/dist/types/client/sfx.d.ts +2 -0
- package/dist/types/shared/constants.d.ts +15 -0
- package/dist/types/shared/gun.d.ts +4 -1
- package/dist/types/shared/physics.d.ts +4 -0
- package/dist/types/shared/protocol.d.ts +1 -1
- package/dist/types/shared/rail.d.ts +13 -3
- package/dist/types/shared/room.d.ts +6 -1
- package/dist/types/shared/types.d.ts +10 -0
- package/dist/types/shared/world.d.ts +2 -0
- package/package.json +1 -1
|
@@ -30,6 +30,22 @@ export declare const ARC: number[];
|
|
|
30
30
|
* tipped with a glowing ball. arc() is the spark between them.
|
|
31
31
|
*/
|
|
32
32
|
export declare const railgun: (lod: number) => number[];
|
|
33
|
+
/** The weapon a gun model is, from a player or a flag: 0 the gun, 2 the rail gun (or true), 3 the laser rifle. */
|
|
34
|
+
export declare const kindOf: (p: Pick<PlayerState, "railed" | "rifled"> | boolean | number) => number;
|
|
35
|
+
/** The laser rifle's muzzle, the lens at the end of its shroud, and where the left hand holds the shroud from under it: the middle of the fist. */
|
|
36
|
+
export declare const RIFLE_MUZZLE: Vec3;
|
|
37
|
+
export declare const RIFLE_GRIP: Vec3;
|
|
38
|
+
/** The red of the laser, which blooms. */
|
|
39
|
+
export declare const LASER: number[];
|
|
40
|
+
/**
|
|
41
|
+
* The laser rifle (the user, 2026-11-08), built once like gun(), after Halo's assault rifle held in
|
|
42
|
+
* both hands: a long angular body from the butt at the shoulder past the grip (a bullpup), a tall
|
|
43
|
+
* housing over the grip whose sloped back carries the counter (scope()), a square shroud to a red
|
|
44
|
+
* lens, held from under it by the left hand, and a strip of red light along each side.
|
|
45
|
+
*/
|
|
46
|
+
export declare const rifle: (lod: number) => number[];
|
|
47
|
+
/** The rifle's power cell, built once: a box of olive metal along its own forward from its foot, a red band near the foot. */
|
|
48
|
+
export declare const cell: (lod: number) => number[];
|
|
33
49
|
/**
|
|
34
50
|
* The gun's battery (the user, 2026-11-08), built once: a gunmetal cell in the grip, along its own
|
|
35
51
|
* forward from its foot, which stands out under the lower shell with a band of glow round it.
|
|
@@ -44,7 +60,7 @@ export declare const ease: (t: number) => number;
|
|
|
44
60
|
/** `t` from `a` to `b` as 0 to 1. */
|
|
45
61
|
export declare const span: (t: number, a: number, b: number) => number;
|
|
46
62
|
/** How far through the swap of the gun in hand `p` is, 0 to 1; -1 when it is not swapping. */
|
|
47
|
-
export declare const swapOf: (p: Pick<PlayerState, "reload" | "railed">) => number;
|
|
63
|
+
export declare const swapOf: (p: Pick<PlayerState, "reload" | "railed" | "rifled">) => number;
|
|
48
64
|
/**
|
|
49
65
|
* The glow of a weapon `t` seconds after it came to hand: dark as it rises, then flickering up to
|
|
50
66
|
* full at `end` (0.6 s; the gun's 1.4 s, its counter standing up first).
|
|
@@ -62,7 +78,7 @@ export declare const GUN_ON: {
|
|
|
62
78
|
* along its axis (metres), how far round its axis (radians, the capsule's screw), and how far it
|
|
63
79
|
* tumbles (radians). The old one comes out and goes, the new one comes in, the left hand bringing it.
|
|
64
80
|
*/
|
|
65
|
-
export declare const swapped: (s: number,
|
|
81
|
+
export declare const swapped: (s: number, kind: boolean | number) => number[];
|
|
66
82
|
/**
|
|
67
83
|
* The screwing of a new capsule at `s` of a swap: how far round it still is (radians, to 0 when it
|
|
68
84
|
* is in), and how far the wrist has turned from where it took hold: with it through each stroke,
|
|
@@ -76,7 +92,7 @@ export declare const CUES: number[][];
|
|
|
76
92
|
* are `ax`, `k` times its size, at `s` of a swap: its foot (base) and its axes, its forward along
|
|
77
93
|
* the grip (up).
|
|
78
94
|
*/
|
|
79
|
-
export declare const loadFrame: (at: Vec3, ax: Vec3[],
|
|
95
|
+
export declare const loadFrame: (at: Vec3, ax: Vec3[], kind: boolean | number, s?: number, k?: number) => [Vec3, Vec3[]];
|
|
80
96
|
/**
|
|
81
97
|
* The spark between the electrodes' tips at the time `t` (s), in model space: a thin glowing line
|
|
82
98
|
* through four jagged points, a new shape 30 times a second.
|
|
@@ -85,11 +101,12 @@ export declare const arc: (t: number) => number[];
|
|
|
85
101
|
/**
|
|
86
102
|
* Where the left hand holds a rail gun whose grip is at `at` and whose axes are [right, up,
|
|
87
103
|
* forward]: the middle of its front grip, and the way the grip runs from its foot up to the barrel,
|
|
88
|
-
* which the thumb points along (see wield() in body.ts).
|
|
104
|
+
* which the thumb points along (see wield() in body.ts). For the laser rifle (`kind` 3): under its
|
|
105
|
+
* shroud, the thumb along it, and the way the hand goes, across under it and up its right side.
|
|
89
106
|
*/
|
|
90
|
-
export declare const fore: (at: Vec3, [r, u, f]: Vec3[]) => [Vec3, Vec3];
|
|
107
|
+
export declare const fore: (at: Vec3, [r, u, f]: Vec3[], kind?: boolean | number) => [Vec3, Vec3, Vec3?];
|
|
91
108
|
/** fore() for the hand at `pos` turned by `q`, which holds the grip. */
|
|
92
|
-
export declare const foregrip: (pos: Vec3, q: Quat) => [Vec3, Vec3];
|
|
109
|
+
export declare const foregrip: (pos: Vec3, q: Quat, kind?: boolean | number) => [Vec3, Vec3, (Vec3 | undefined)?];
|
|
93
110
|
/** The rail gun's lightning left as the counters show it: 99 when full (of `max`, a load by default), 0 when spent. */
|
|
94
111
|
export declare const charge: (rail: number, max?: number) => number;
|
|
95
112
|
/** The electrodes' tips of a gun whose grip is at `at` and whose axes are [right, up, forward]. */
|
|
@@ -112,6 +129,12 @@ export declare const readout: (ammo: number, level?: number, shown?: boolean) =>
|
|
|
112
129
|
* the metal round it: a glow would bloom over the digits.
|
|
113
130
|
*/
|
|
114
131
|
export declare const lcd: (ammo: number) => number[];
|
|
132
|
+
/**
|
|
133
|
+
* The laser rifle's counter (`n` rounds in its cell), in model space: a trapezoid screen, narrow at
|
|
134
|
+
* the top, set in the sloped back of the housing and turned to the eye, ringed in cyan, with two
|
|
135
|
+
* cyan digits once `shown`. All glow but the dark screen.
|
|
136
|
+
*/
|
|
137
|
+
export declare const scope: (n: number, shown?: boolean) => number[];
|
|
115
138
|
/**
|
|
116
139
|
* How a gun is drawn beyond its place: its glow from 0 (off) to 1, the swap under way (0 to 1, -1
|
|
117
140
|
* none), whether its battery or capsule holds any, how far the gun's counter stands up (0 folded
|
|
@@ -125,14 +148,14 @@ export interface Lit {
|
|
|
125
148
|
digits?: boolean;
|
|
126
149
|
}
|
|
127
150
|
/**
|
|
128
|
-
* Appends the gun (the rail gun
|
|
151
|
+
* Appends the gun (the rail gun or the laser rifle by `kind`, the rail gun's spark at the time `t`) held in the hand at `pos`
|
|
129
152
|
* with the world rotation `q`, `k` times its size about the grip, with the ammo on its back when
|
|
130
153
|
* given, and the charge gauge at `level`; its battery (capsule) where the swap has it, its glow and
|
|
131
154
|
* its counter dimmed with `light`, and the spark only when it is all on.
|
|
132
155
|
*/
|
|
133
|
-
export declare const held: (out: number[], pos: Vec3, q: Quat, lod: number, k?: number, ammo?: number, level?: number,
|
|
134
|
-
/** The muzzle of a gun (the rail gun's
|
|
135
|
-
export declare const tip: (at: Vec3, [, u, f]: Vec3[],
|
|
156
|
+
export declare const held: (out: number[], pos: Vec3, q: Quat, lod: number, k?: number, ammo?: number, level?: number, kind?: boolean | number, t?: number, { light, swap, empty, stand, digits }?: Lit) => void;
|
|
157
|
+
/** The muzzle of a gun (the rail gun's or the rifle's by `kind`) whose grip is at `at` and whose axes are [right, up, forward]. */
|
|
158
|
+
export declare const tip: (at: Vec3, [, u, f]: Vec3[], kind?: boolean | number) => Vec3;
|
|
136
159
|
/**
|
|
137
160
|
* The axes [right, up, forward] of a gun held with its grip at `at` so that its long axis, from the
|
|
138
161
|
* back of the body to the emitter, points at `to`: the beam leaves the emitter along it. `side` is
|
|
@@ -27,9 +27,10 @@ export interface Hud {
|
|
|
27
27
|
* (charge(), 99 full) with the gun glyph in violet when `railed`. -1 ammo is no gun, `blade` is a
|
|
28
28
|
* katana carried, `rail` the rail gun's lightning (-1 none); two or more carried show their slots (1 gun, 2 katana, 3 rail gun)
|
|
29
29
|
* over the glyph, none hides it. `loaded` is what the battery or the capsule of the gun in hand
|
|
30
|
-
* holds, in the same count: big, with the rest after it; faded while `swapping` it.
|
|
30
|
+
* holds, in the same count: big, with the rest after it; faded while `swapping` it. `rifle` is the
|
|
31
|
+
* laser rifle's rounds (-1 none), shown with the glyph in red when `rifled` (slot 4).
|
|
31
32
|
*/
|
|
32
|
-
vitals(hp: number, ammo: number, blade?: boolean, wield?: boolean, rail?: number, railed?: boolean, loaded?: number, swapping?: boolean): void;
|
|
33
|
+
vitals(hp: number, ammo: number, blade?: boolean, wield?: boolean, rail?: number, railed?: boolean, loaded?: number, swapping?: boolean, rifle?: number, rifled?: boolean): void;
|
|
33
34
|
/** A hit marker on the crosshair for a moment: a ball or a cut of the own player hit. */
|
|
34
35
|
hit(): void;
|
|
35
36
|
/**
|
|
@@ -9,25 +9,26 @@ export declare const keyBit: (code: string) => number;
|
|
|
9
9
|
export declare const DOUBLE_CLICK_MS = 300;
|
|
10
10
|
/** The wheel swaps the weapon at most this often (ms): a trackpad's flick is a hundred events, one swap. */
|
|
11
11
|
export declare const WHEEL_MS = 250;
|
|
12
|
-
/** The weapon chosen: 1, 2 and
|
|
12
|
+
/** The weapon chosen: 1, 2, 3 and 4 on the keyboard. */
|
|
13
13
|
export declare const WEAPON: {
|
|
14
14
|
readonly GUN: 0;
|
|
15
15
|
readonly BLADE: 1;
|
|
16
16
|
readonly RAIL: 2;
|
|
17
|
+
readonly RIFLE: 3;
|
|
17
18
|
};
|
|
18
|
-
/** The choice after a key: 1 the gun, 2 the katana, 3 the rail gun, any other key keeps it. */
|
|
19
|
+
/** The choice after a key: 1 the gun, 2 the katana, 3 the rail gun, 4 the laser rifle, any other key keeps it. */
|
|
19
20
|
export declare const picked: (weapon: number, code: string) => number;
|
|
20
|
-
/** Which of the gun, the katana
|
|
21
|
+
/** Which of the gun, the katana, the rail gun and the laser rifle a player has; all of them when there is no state yet. */
|
|
21
22
|
export declare const owned: (p?: PlayerState) => boolean[];
|
|
22
23
|
/**
|
|
23
|
-
* The choice after a step of the own player. Picking the katana
|
|
24
|
+
* The choice after a step of the own player. Picking the katana, the rail gun or the rifle up switches to
|
|
24
25
|
* it, once; losing every weapon (going down) goes back to the gun; anything else, the gun picked
|
|
25
26
|
* up included, keeps it.
|
|
26
27
|
*/
|
|
27
28
|
export declare const chosen: (weapon: number, was?: PlayerState, now?: PlayerState) => number;
|
|
28
|
-
/** The keys of a step with KEY.BLADE set while the katana is the choice, KEY.RAIL while the rail gun is. */
|
|
29
|
+
/** The keys of a step with KEY.BLADE set while the katana is the choice, KEY.RAIL while the rail gun is, KEY.RIFLE while the rifle is. */
|
|
29
30
|
export declare const withWeapon: (keys: number, weapon: number) => number;
|
|
30
|
-
/** The choice the wheel turns to, `dir` 1 or -1: the next weapon he has, round the
|
|
31
|
+
/** The choice the wheel turns to, `dir` 1 or -1: the next weapon he has, round the four. */
|
|
31
32
|
export declare const turned: (weapon: number, dir: number, have: boolean[]) => number;
|
|
32
33
|
/** Live look angles and held keys; the loop reads them once per step and per frame. */
|
|
33
34
|
export interface Controls {
|
|
@@ -6,12 +6,12 @@ import type { Vec3 } from './mesh';
|
|
|
6
6
|
export declare const packsOf: (all?: readonly Vec3[], mask?: number, from?: number) => Vec3[];
|
|
7
7
|
/**
|
|
8
8
|
* A rack at `at` (a point on a top): a post and a dish, a ring on the roof of the radius that gives
|
|
9
|
-
* the weapon, and the weapon over it: the gun, or by `kind` the katana (1), crackling,
|
|
10
|
-
* gun (2).
|
|
9
|
+
* the weapon, and the weapon over it: the gun, or by `kind` the katana (1), crackling, the rail
|
|
10
|
+
* gun (2) or the laser rifle (3).
|
|
11
11
|
*/
|
|
12
12
|
export declare const rack: (out: number[], at: Vec3, rgb: number[], t: number, kind?: number) => void;
|
|
13
|
-
/** Each team's gun rack, katana rack
|
|
14
|
-
export declare const racks: (out: number[], guns?: readonly (Vec3 | undefined)[], blades?: readonly (Vec3 | undefined)[], t?: number, rails?: readonly (Vec3 | undefined)[]) => void;
|
|
13
|
+
/** Each team's gun rack, katana rack, rail gun rack and laser rifle rack, where it has them. */
|
|
14
|
+
export declare const racks: (out: number[], guns?: readonly (Vec3 | undefined)[], blades?: readonly (Vec3 | undefined)[], t?: number, rails?: readonly (Vec3 | undefined)[], rifles?: readonly (Vec3 | undefined)[]) => void;
|
|
15
15
|
/** A health pack at `at`: a white box with a glowing green cross on each side. */
|
|
16
16
|
export declare const kit: (out: number[], at: Vec3, t: number) => void;
|
|
17
17
|
/** An ammo pack at `at`: a violet box with a glowing cyan cartridge on each side, the gun's colours. */
|
|
@@ -71,6 +71,8 @@ export declare const SOUND: {
|
|
|
71
71
|
readonly POP: 33;
|
|
72
72
|
readonly SCREW: 34;
|
|
73
73
|
readonly BOOT: 35;
|
|
74
|
+
/** The laser rifle's shot: a punch in the bass and the middle, short enough for 20 a second. */
|
|
75
|
+
readonly LASE: 36;
|
|
74
76
|
};
|
|
75
77
|
/**
|
|
76
78
|
* The sounds of the game: one entry per sound, its voices layered, in SOUND order. A low-passed
|
|
@@ -289,6 +289,21 @@ export declare const RAIL_RANGE = 30;
|
|
|
289
289
|
export declare const RAIL_TICKS = 180;
|
|
290
290
|
export declare const RAIL_DRAIN = 60;
|
|
291
291
|
export declare const SLOW_SPEED = 3;
|
|
292
|
+
/**
|
|
293
|
+
* The laser rifle (the user, 2026-11-08), held in both hands, after Halo's assault rifle: taken at
|
|
294
|
+
* the team's fourth rack with RIFLE_MAX rounds, it fires while FIRE is held, one round each
|
|
295
|
+
* RIFLE_COOL ticks (20 a second) from a power cell of RIFLE_CLIP (RIFLE_RELOAD to swap). Each shot
|
|
296
|
+
* is an instant beam RIFLE_RANGE metres along the look, drifted by up to RIFLE_DRIFT radians in a
|
|
297
|
+
* pattern of the shot count; every RIFLE_HITS of them that enter an enemy take 1 hp from him.
|
|
298
|
+
* Rounds and the cell are u8 on the wire.
|
|
299
|
+
*/
|
|
300
|
+
export declare const RIFLE_MAX = 240;
|
|
301
|
+
export declare const RIFLE_CLIP = 60;
|
|
302
|
+
export declare const RIFLE_RELOAD = 96;
|
|
303
|
+
export declare const RIFLE_COOL = 3;
|
|
304
|
+
export declare const RIFLE_RANGE = 60;
|
|
305
|
+
export declare const RIFLE_DRIFT = 0.012;
|
|
306
|
+
export declare const RIFLE_HITS = 2;
|
|
292
307
|
/** Seconds a carrier who is made to drop the flag cannot take it again: he would pick it up where he stands. */
|
|
293
308
|
export declare const FLAG_LOCK = 2;
|
|
294
309
|
/** Seconds the end screen of a match stays, then a new match starts. */
|
|
@@ -3,12 +3,13 @@ import type { World } from './world';
|
|
|
3
3
|
type Vec3 = [number, number, number];
|
|
4
4
|
/** Whether the feet of `p` are within `r` of the point `at` on the floor plane and within PICK_H of its height. */
|
|
5
5
|
export declare const within: (p: PlayerState, at: Vec3, r: number) => boolean;
|
|
6
|
-
/** What a step struck, for the host to resolve: nothing, a shot (a plasma ball), the katana's cut,
|
|
6
|
+
/** What a step struck, for the host to resolve: nothing, a shot (a plasma ball), the katana's cut, a rail gun's beam, or a laser rifle's shot. */
|
|
7
7
|
export declare const STRIKE: {
|
|
8
8
|
readonly NONE: 0;
|
|
9
9
|
readonly SHOT: 1;
|
|
10
10
|
readonly CUT: 2;
|
|
11
11
|
readonly RAIL: 3;
|
|
12
|
+
readonly LASER: 4;
|
|
12
13
|
};
|
|
13
14
|
export type Strike = (typeof STRIKE)[keyof typeof STRIKE];
|
|
14
15
|
/**
|
|
@@ -27,6 +28,8 @@ export type Strike = (typeof STRIKE)[keyof typeof STRIKE];
|
|
|
27
28
|
* without firing, then it holds GUN_MAG (RAIL_CAP) or what is left. A switch of weapon drops it.
|
|
28
29
|
* The racks fill both.
|
|
29
30
|
* - The rail gun throws its bolt on every step FIRE is held, spending a tick of it (`zapping`).
|
|
31
|
+
* - The laser rifle (KEY.RIFLE, `rifled`), filled at its rack on arrival, fires a round from its
|
|
32
|
+
* cell (`clip`) each RIFLE_COOL ticks while FIRE is held (STRIKE.LASER).
|
|
30
33
|
* - The trigger: `cool` and `swing` run down, and at 0 a held FIRE charges the gun, with ammo, and
|
|
31
34
|
* letting it go fires a ball as strong as the charge (powerOf()), spending as many shots; or it
|
|
32
35
|
* starts the katana's swing (`cut` from the keys), unless the hands are busy (a hang, a climb).
|
|
@@ -28,7 +28,7 @@ export declare const MSG_INPUT = 1;
|
|
|
28
28
|
export declare const MSG_SNAPSHOT = 2;
|
|
29
29
|
export declare const INPUT_BYTES = 12;
|
|
30
30
|
export declare const SNAP_HEAD = 4;
|
|
31
|
-
export declare const SNAP_PLAYER =
|
|
31
|
+
export declare const SNAP_PLAYER = 60;
|
|
32
32
|
/** The match block after the players: the captures, the clock, the packs; the flags follow (2 to 16 bytes). */
|
|
33
33
|
export declare const SNAP_MATCH = 10;
|
|
34
34
|
/** Bytes of a plasma ball. */
|
|
@@ -2,10 +2,20 @@ import type { PlayerState } from './types';
|
|
|
2
2
|
import type { World } from './world';
|
|
3
3
|
type Vec3 = [number, number, number];
|
|
4
4
|
/**
|
|
5
|
-
* The beam `p` fires along his look: where it starts (his eye), its
|
|
6
|
-
* (to the first brush, or
|
|
5
|
+
* The beam `p` fires along his look, turned by `drift` (yaw, pitch): where it starts (his eye), its
|
|
6
|
+
* unit direction, how far it goes (to the first brush, or `range`) and the first of `foes` whose
|
|
7
|
+
* body it enters before that.
|
|
7
8
|
*/
|
|
8
|
-
export declare const beam: (w: World, p: PlayerState, foes?: PlayerState[]) => {
|
|
9
|
+
export declare const beam: (w: World, p: PlayerState, foes?: PlayerState[], range?: number, [dy, dp]?: [number, number]) => {
|
|
10
|
+
o: Vec3;
|
|
11
|
+
d: Vec3;
|
|
12
|
+
t: number;
|
|
13
|
+
hit?: PlayerState;
|
|
14
|
+
};
|
|
15
|
+
/** How far shot `n` of the laser rifle drifts off the look, yaw and pitch: a pattern within RIFLE_DRIFT, the same for the host and every client. */
|
|
16
|
+
export declare const drift: (n: number) => [number, number];
|
|
17
|
+
/** The laser rifle's beam of `p`, its last shot (`shots`): drifted, to RIFLE_RANGE. */
|
|
18
|
+
export declare const laser: (w: World, p: PlayerState, foes?: PlayerState[]) => {
|
|
9
19
|
o: Vec3;
|
|
10
20
|
d: Vec3;
|
|
11
21
|
t: number;
|
|
@@ -89,6 +89,11 @@ export declare class Room {
|
|
|
89
89
|
* and counts a hit.
|
|
90
90
|
*/
|
|
91
91
|
private rail;
|
|
92
|
+
/**
|
|
93
|
+
* The laser rifle's shot of `p` at the view tick `view`: a hit on the first enemy it enters as `p`
|
|
94
|
+
* drew him, and every RIFLE_HITS hits on him (from anyone, until he goes down) take 1 hp.
|
|
95
|
+
*/
|
|
96
|
+
private laser;
|
|
92
97
|
/** 1 hp of the bolt's drain to `foe`; if it puts him down he is disintegrated (`fried`). */
|
|
93
98
|
private fry;
|
|
94
99
|
/**
|
|
@@ -101,7 +106,7 @@ export declare class Room {
|
|
|
101
106
|
/**
|
|
102
107
|
* The packs, health ones first, then the ammo ones, then the rail cells: one that is gone comes
|
|
103
108
|
* back after PACK_BACK s, an ammo pack after AMMO_BACK s. A health pack goes to a hurt player standing at it, an ammo pack to one
|
|
104
|
-
* with the gun
|
|
109
|
+
* with the gun short of AMMO_MAX or the laser rifle short of RIFLE_MAX (RIFLE_CLIP more rounds), a rail cell to one with the rail gun and less than
|
|
105
110
|
* RAIL_MAX of lightning. Both change the state between two inputs, like a hit: the snapshot
|
|
106
111
|
* carries the result and the predictor replays its unacked inputs on it.
|
|
107
112
|
*/
|
|
@@ -49,6 +49,8 @@ export declare const KEY: {
|
|
|
49
49
|
readonly RAIL: 2048;
|
|
50
50
|
/** Press to swap the battery or the capsule of the gun in hand (see GUN_MAG). */
|
|
51
51
|
readonly RELOAD: 4096;
|
|
52
|
+
/** Set while the player wants the laser rifle in hand (4 or the wheel), with BLADE and RAIL clear. Ignored without it. */
|
|
53
|
+
readonly RIFLE: 8192;
|
|
52
54
|
};
|
|
53
55
|
/**
|
|
54
56
|
* The katana's cuts (PlayerState.cut, constants CUTS), chosen by the keys held when FIRE starts
|
|
@@ -194,6 +196,14 @@ export interface PlayerState {
|
|
|
194
196
|
cap?: number;
|
|
195
197
|
/** Ticks left swapping the battery or the capsule of the gun in hand, 0 when not. Absent reads 0. */
|
|
196
198
|
reload?: number;
|
|
199
|
+
/** Rounds left in the laser rifle; absent or -1 without it (taken at the team's fourth rack, lost on going down). */
|
|
200
|
+
rifle?: number;
|
|
201
|
+
/** Rounds in the laser rifle's power cell, of `rifle` (RIFLE_CLIP at most). Absent reads 0. */
|
|
202
|
+
clip?: number;
|
|
203
|
+
/** The laser rifle is in hand (see KEY.RIFLE). Absent reads false. */
|
|
204
|
+
rifled?: boolean;
|
|
205
|
+
/** Standing inside the circle of the team's rifle rack as of the last step. Absent reads false. */
|
|
206
|
+
inRifle?: boolean;
|
|
197
207
|
/** Ticks FIRE has been held with the gun, up to CHARGE_TICKS, 0 when not charging. Absent reads 0. */
|
|
198
208
|
charge?: number;
|
|
199
209
|
/** The strength of the last shot, 1 to CHARGE_MAX: the shots it spent and the health it takes. Set by the step that fires; not on the wire. */
|
|
@@ -24,6 +24,8 @@ export interface TeamDef {
|
|
|
24
24
|
blade?: Vec3;
|
|
25
25
|
/** The rail gun rack, on the other side of the gun rack: walking within RACK_R gives the rail gun with RAIL_MAX shots. */
|
|
26
26
|
rail?: Vec3;
|
|
27
|
+
/** The laser rifle rack, past the rail gun's: walking within RACK_R gives the rifle with RIFLE_MAX rounds. */
|
|
28
|
+
rifle?: Vec3;
|
|
27
29
|
}
|
|
28
30
|
export interface WorldDef {
|
|
29
31
|
/** Shown on the title screen. */
|
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": "0.
|
|
5
|
+
"version": "0.55.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|