@korial29/tiny-fps 0.221.0 → 0.222.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/dist/index.js +5 -5
- package/dist/local.js +1 -1
- package/dist/server.js +6 -6
- package/dist/types/client/audio.d.ts +14 -2
- package/dist/types/client/input.d.ts +9 -5
- package/dist/types/client/sfx.d.ts +6 -0
- package/dist/types/client/taunt.d.ts +9 -1
- package/dist/types/shared/gun.d.ts +1 -1
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -6832,7 +6832,7 @@ var STRIKE = {
|
|
|
6832
6832
|
* One input: the move, then the weapons. Returns what struck on this step (STRIKE), for the host to
|
|
6833
6833
|
* resolve it: a shot, or a cut, which is not a shot.
|
|
6834
6834
|
* - Down: the keys are dropped, and when `down` runs out the player is back at a spawn.
|
|
6835
|
-
* -
|
|
6835
|
+
* - Either team's rack fills the gun when the player steps into its circle (`rack` tells he is in it),
|
|
6836
6836
|
* and again each time he comes back; staying gives nothing. The katana rack gives the katana,
|
|
6837
6837
|
* once and for good: it stays until he goes down.
|
|
6838
6838
|
* - The rail rack fills the rail gun with RAIL_MAX ticks of lightning on arrival, as the gun's does.
|
|
@@ -6884,8 +6884,8 @@ var step = (p, i, w, team, armed = true, bodies = [], kit = KITS[0]) => {
|
|
|
6884
6884
|
if (locked) return duel(p, i);
|
|
6885
6885
|
const fresh = !!(i.keys & KEY.FIRE) && !p.pressed;
|
|
6886
6886
|
p.pressed = !!(i.keys & KEY.FIRE);
|
|
6887
|
-
const
|
|
6888
|
-
const inside =
|
|
6887
|
+
const near = (key) => w.def.teams.some((t) => !!t[key] && within(p, t[key], 1.2));
|
|
6888
|
+
const inside = near("rack");
|
|
6889
6889
|
const gear = kit.gear;
|
|
6890
6890
|
if (!gear) [p.ammo, p.rail, p.rifle, p.blade, p.nades] = [
|
|
6891
6891
|
-1,
|
|
@@ -6915,11 +6915,11 @@ var step = (p, i, w, team, armed = true, bodies = [], kit = KITS[0]) => {
|
|
|
6915
6915
|
}
|
|
6916
6916
|
if (armed && gear && inside && !p.rack) [p.ammo, p.mag] = [kit.ammo, kit.mag];
|
|
6917
6917
|
p.rack = inside;
|
|
6918
|
-
p.blade = !!kit.katana || !!p.blade || armed && gear &&
|
|
6919
|
-
const inRail =
|
|
6918
|
+
p.blade = !!kit.katana || !!p.blade || armed && gear && near("blade");
|
|
6919
|
+
const inRail = near("rail");
|
|
6920
6920
|
if (armed && gear && !own && inRail && !p.inRail) [p.rail, p.cap] = [kit.rail, kit.cap];
|
|
6921
6921
|
p.inRail = inRail;
|
|
6922
|
-
const inRifle =
|
|
6922
|
+
const inRifle = near("rifle");
|
|
6923
6923
|
if (armed && gear && !own && inRifle && !p.inRifle) [p.rifle, p.clip, p.nades] = [
|
|
6924
6924
|
kit.rifle,
|
|
6925
6925
|
kit.clip,
|
|
@@ -28,9 +28,10 @@ export interface Audio {
|
|
|
28
28
|
* Says clip `id` of the players' voices (CAST): placed and fainter with distance as play() with
|
|
29
29
|
* `at`, centred without; over the `radio`, clipped and thin as through a cheap headset, a burst
|
|
30
30
|
* of squelch before and after it and a hiss under it. False, and silent, until the voices are
|
|
31
|
-
* decoded.
|
|
31
|
+
* decoded. As a Hunter's `mimic` (the Predator's: he says back what he heard), deeper, through a
|
|
32
|
+
* ring modulator, its first syllable stuttered twice.
|
|
32
33
|
*/
|
|
33
|
-
speak(id: number, at?: Vec3, db?: number, rate?: number, radio?: boolean): boolean;
|
|
34
|
+
speak(id: number, at?: Vec3, db?: number, rate?: number, radio?: boolean, mimic?: boolean): boolean;
|
|
34
35
|
/** The sound `id` (one of LOOPED) as a loop, silent until its first set; the own player's, centred. */
|
|
35
36
|
loop(id: number): Loop;
|
|
36
37
|
/** Fades the music out (true) or back in (false), the other sounds untouched: the Hunter's visions. */
|
|
@@ -56,6 +57,17 @@ export declare const LOUD: Record<number, number>;
|
|
|
56
57
|
export declare const GROUP: string;
|
|
57
58
|
/** Sets bus `i` to `db` live, and keeps the mix for the next visit; none, the mix as made. */
|
|
58
59
|
export declare const mix: (i?: number, db?: number) => void;
|
|
60
|
+
/**
|
|
61
|
+
* A Hunter's mimicry: the speed (and so the pitch) of the line, the ring modulator's Hz and its
|
|
62
|
+
* share of the mix, and the stutter: the seconds of the line's start said before it, and how often.
|
|
63
|
+
*/
|
|
64
|
+
export declare const MIMIC: {
|
|
65
|
+
rate: number;
|
|
66
|
+
ring: number;
|
|
67
|
+
wet: number;
|
|
68
|
+
stutter: number;
|
|
69
|
+
times: number;
|
|
70
|
+
};
|
|
59
71
|
/**
|
|
60
72
|
* The announcer's sprite (voice/clips.ts), each as base64 and loaded only when asked for: Ogg Opus,
|
|
61
73
|
* then MP3 where the browser cannot decode the first (older Safari).
|
|
@@ -11,7 +11,7 @@ export declare const keyBit: (code: string) => number;
|
|
|
11
11
|
export declare const DOUBLE_CLICK_MS = 300;
|
|
12
12
|
/** The wheel swaps the weapon at most this often (ms): a trackpad's flick is a hundred events, one swap. */
|
|
13
13
|
export declare const WHEEL_MS = 250;
|
|
14
|
-
/** The weapon chosen
|
|
14
|
+
/** The weapon chosen. The values are the wire's and the HUD's, not the keys' order: SLOTS has that. */
|
|
15
15
|
export declare const WEAPON: {
|
|
16
16
|
readonly GUN: 0;
|
|
17
17
|
readonly BLADE: 1;
|
|
@@ -20,12 +20,16 @@ export declare const WEAPON: {
|
|
|
20
20
|
readonly FISTS: 4;
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
|
-
* The weapon
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* The weapon on each key, 1 to 5. The marine, the ninja and the astronaut: fists, katana, pistol,
|
|
24
|
+
* assault (laser) rifle, Tesla (rail) gun (the user, 2026-11-24). The Hunter: wrist blades,
|
|
25
|
+
* harpoon, shoulder cannon, disc, and no fifth slot (the user, 2026-11-23).
|
|
26
26
|
*/
|
|
27
|
+
export declare const SLOTS: readonly number[];
|
|
28
|
+
/** The weapon in a slot (the key's number less one). */
|
|
27
29
|
export declare const slotted: (slot: number, hunter?: boolean) => number;
|
|
28
|
-
/** The
|
|
30
|
+
/** The slot of a weapon: slotted()'s inverse. */
|
|
31
|
+
export declare const slotOf: (weapon: number, hunter?: boolean) => number;
|
|
32
|
+
/** The choice after a key: the weapon in its slot (SLOTS), the numpad's keys as the digits'; any other key keeps it. */
|
|
29
33
|
export declare const picked: (weapon: number, code: string, hunter?: boolean) => number;
|
|
30
34
|
/** Which of the gun, the katana, the rail gun, the laser rifle and the fists a player has (the Hunter no fists); all of them when there is no state yet. */
|
|
31
35
|
export declare const owned: (p?: PlayerState, hunter?: boolean) => boolean[];
|
|
@@ -188,6 +188,12 @@ export declare const SOUND: {
|
|
|
188
188
|
* the stock grinding out, a ratchet over them, and a heavy lock as they reach their stops.
|
|
189
189
|
*/
|
|
190
190
|
readonly HARPOON_OPEN: 94;
|
|
191
|
+
/**
|
|
192
|
+
* The Hunter's radio (the user, 2026-11-24: sounds and radio voices of his own): CLICKS his
|
|
193
|
+
* rattle, a trill of throat clicks over a low gurgle; GROWL a deep rolling roar.
|
|
194
|
+
*/
|
|
195
|
+
readonly HUNTER_CLICKS: 95;
|
|
196
|
+
readonly HUNTER_GROWL: 96;
|
|
191
197
|
};
|
|
192
198
|
/**
|
|
193
199
|
* The sounds of the game: one entry per sound, its voices layered, in SOUND order. A low-passed
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Audio } from './audio';
|
|
2
2
|
import type { Vec3 } from './mesh';
|
|
3
3
|
/** Seconds from a frag to its taunt: the victim's cry first. */
|
|
4
4
|
export declare const TAUNT_DELAY = 0.6;
|
|
@@ -15,6 +15,14 @@ export declare const paceOf: (id: number) => number;
|
|
|
15
15
|
* for the fists and the katana, else one of the taunts, a new one each frag.
|
|
16
16
|
*/
|
|
17
17
|
export declare const tauntOf: (speaker: number, how: number, n: number) => number;
|
|
18
|
+
/**
|
|
19
|
+
* What a Hunter says after his `n`th frag, in turn (the user, 2026-11-24: sounds and radio voices
|
|
20
|
+
* of his own): -1 the victim's own voice mimicked (a taunt of his, as the Predator says back what
|
|
21
|
+
* he heard), else a sound of his. A victim with no voice (a xenomorph, a Hunter) gets the next.
|
|
22
|
+
*/
|
|
23
|
+
export declare const HUNTER_CALLS: number[];
|
|
24
|
+
/** The seconds a Hunter's mimicry of clip `clip` lasts at `pace` (audio.ts, speak()). */
|
|
25
|
+
export declare const mimicSeconds: (clip: number, pace: number) => number;
|
|
18
26
|
/** A line over the radio that began: who says it, and its seconds. */
|
|
19
27
|
export interface Said {
|
|
20
28
|
by: number;
|
|
@@ -23,7 +23,7 @@ export type Strike = (typeof STRIKE)[keyof typeof STRIKE];
|
|
|
23
23
|
* One input: the move, then the weapons. Returns what struck on this step (STRIKE), for the host to
|
|
24
24
|
* resolve it: a shot, or a cut, which is not a shot.
|
|
25
25
|
* - Down: the keys are dropped, and when `down` runs out the player is back at a spawn.
|
|
26
|
-
* -
|
|
26
|
+
* - Either team's rack fills the gun when the player steps into its circle (`rack` tells he is in it),
|
|
27
27
|
* and again each time he comes back; staying gives nothing. The katana rack gives the katana,
|
|
28
28
|
* once and for good: it stays until he goes down.
|
|
29
29
|
* - The rail rack fills the rail gun with RAIL_MAX ticks of lightning on arrival, as the gun's does.
|
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.222.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|