@korial29/tiny-fps 0.191.2 → 0.192.1

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/server.js CHANGED
@@ -213,11 +213,12 @@ var [GLORY_HP, GLORY_REACH, GLORY_ARC, GLORY_TICKS] = [
213
213
  /**
214
214
  * The katana's glory kill, an execution (room.ts feast(), the user 2026-11-17: 1.5 s, not at once):
215
215
  * E locks the two for EXEC.TICKS (`exec` KILLER and VICTIM); the swordsman dashes in front of him,
216
- * to EXEC.REACH metres, over GLORY_DASH ticks, cuts down (CUT.SLASH) at EXEC.CUTS[0] and drops him
217
- * to his knees, then spins into a cut across (CUT.RIGHT) at EXEC.CUTS[1], whose strike is the
218
- * lock's last tick: his head goes (LIMB.HEAD) and the body, still on its knee, tips over where it
216
+ * to EXEC.REACH metres, over GLORY_DASH ticks, runs him through (CUT.THRUST, the user 2026-11-19) at EXEC.CUTS[0] and drops him
217
+ * to his knees, then raises the blade over his head and cuts down (CUT.SLASH, the user
218
+ * 2026-11-19: a samurai's execution, no spin) at EXEC.CUTS[1], whose strike is the lock's last
219
+ * tick: his head goes (LIMB.HEAD) and the body, still on its knee, tips over where it
219
220
  * is (feast.ts topple()). Without the katana in hand it is the fists' (the user, 2026-11-17): the
220
- * same lock, dashing to EXEC.FIST metres, a punch in the belly on the cut down's strike drops him on
221
+ * same lock, dashing to EXEC.FIST metres, a punch in the belly on the thrust's strike drops him on
221
222
  * his knee the same, and a punch down on his head on the lock's last tick bursts it (LIMB.BURST).
222
223
  * The fists strike nothing on the host: their blows are drawn (feast.ts pummel()).
223
224
  */
@@ -225,7 +226,7 @@ var EXEC = {
225
226
  TICKS: 88,
226
227
  REACH: 1.3,
227
228
  FIST: .7,
228
- CUTS: [20, 74],
229
+ CUTS: [26, 71],
229
230
  KILLER: 1,
230
231
  VICTIM: 2
231
232
  };
@@ -6661,7 +6662,7 @@ var duel = (p, i) => {
6661
6662
  /**
6662
6663
  * A step of a glory kill's execution (EXEC), whatever the keys: with the katana in hand at its start
6663
6664
  * (`wield`, kept through it) the swordsman's two cuts start on their ticks of the lock (EXEC.CUTS: a
6664
- * cut down, then one across whose strike is the lock's last tick), and strike no one; the fists'
6665
+ * thrust, then a cut down whose strike is the lock's last tick), and strike no one; the fists'
6665
6666
  * start no swing (their blows are drawn). His victim holds no weapon up. Predicted, as a cut is.
6666
6667
  */
6667
6668
  var execute = (p) => {
@@ -6670,7 +6671,7 @@ var execute = (p) => {
6670
6671
  const e = EXEC.TICKS - p.lock;
6671
6672
  const at = EXEC.CUTS.indexOf(e);
6672
6673
  const blade = p.exec === EXEC.KILLER && !!p.wield;
6673
- p.cut = blade && at >= 0 ? [CUT.SLASH, CUT.RIGHT][at] : p.cut;
6674
+ p.cut = blade && at >= 0 ? [CUT.THRUST, CUT.SLASH][at] : p.cut;
6674
6675
  p.swing = blade && at >= 0 ? CUTS[p.cut].ticks : Math.max(0, (p.swing ?? 0) - 1);
6675
6676
  [p.wield, p.charge, p.heavy] = [
6676
6677
  blade,
@@ -87,12 +87,14 @@ export declare const eating: (lock: number, mount: number) => number;
87
87
  export declare const chew: (pose: Pose, a: number, t: number) => Pose;
88
88
  /**
89
89
  * The katana's execution as drawn (EXEC, the user 2026-11-17): its victim turns to the swordsman as
90
- * he dashes in (TURN ticks), drops on the strike of the cut down (KNEEL: from that tick, over so
90
+ * he dashes in (TURN ticks), drops on the strike of the thrust (KNEEL: from that tick, over so
91
91
  * many) onto one knee, the right, the left foot ahead (STEP, metres), his hips LOW metres lower,
92
92
  * bent over in pain (BOW, radians: spine, chest, neck) with his hands on his belly (BELLY: across,
93
93
  * ahead and over his pelvis), panting (PANT: radians of the chest's heave, beats a second) and his
94
- * head shaking no (NO: radians each way, shakes a second); the swordsman spins a whole turn into the
95
- * cut across, ending on its strike (SPIN); on the cut down a spurt of WOUND drops of blood, and when
94
+ * head shaking no (NO: radians each way, shakes a second); the swordsman runs him through, draws
95
+ * the blade out, raises it over his head in both hands (RAISE: from that tick, over so many),
96
+ * holds it there and brings it down on the bowed neck (the user, 2026-11-19: a samurai's
97
+ * execution, a thrust first, no turn on himself); on the thrust a spurt of WOUND drops of blood, and when
96
98
  * his head goes NECK drops, then BLEED a second from the neck for BLEEDING seconds.
97
99
  */
98
100
  export declare const EXECUTE: {
@@ -106,7 +108,7 @@ export declare const EXECUTE: {
106
108
  readonly BELLY: readonly [0.08, 0.2, 0.1];
107
109
  readonly PANT: readonly [0.07, 2.6];
108
110
  readonly NO: readonly [0.4, 1.4];
109
- readonly SPIN: readonly [74, number];
111
+ readonly RAISE: readonly [number, 14];
110
112
  /** The beheaded body, still on its knee, tips over onto its right side about it: in so many seconds, so far (radians). */
111
113
  readonly FALL: readonly [0.7, 1.45];
112
114
  /** Its bounce on the floor: a share of the fall, how fast it dies out, its rate (rad/s); and the seconds it takes to go limp. */
@@ -119,8 +121,13 @@ export declare const EXECUTE: {
119
121
  };
120
122
  /** How far down on his knees its victim is with `lock` ticks left, 0 to 1. */
121
123
  export declare const kneeling: (lock: number) => number;
122
- /** How far the swordsman has spun into his cut across with `lock` ticks left, radians (a whole turn at its strike). */
123
- export declare const spun: (lock: number) => number;
124
+ /**
125
+ * Where in the cut down's swing (katana.ts stroke()) the swordsman's blade is drawn with `lock`
126
+ * ticks left and his own swing at `prog`: his thrust first (-1: his own cut, as it is), then, the
127
+ * blade drawn out of him and back in the guard, up to the top of the cut down's wind-up (`top`),
128
+ * held there until that cut comes down from it.
129
+ */
130
+ export declare const raised: (lock: number, prog: number, top: number) => number;
124
131
  /**
125
132
  * The victim's `pose` before the swordsman whose feet are at `killer`, with `lock` ticks of the
126
133
  * execution left, at `t` seconds: turned to him, then down on his right knee, his left foot ahead,
@@ -158,7 +165,7 @@ export declare const crouch: (pose: Pose, w: number) => Pose;
158
165
  * The fists' execution as drawn (EXEC, the user 2026-11-17: a glory kill for everyone, the victim's
159
166
  * kneel the katana's, the killer's blows his own), in ticks of the lock: turned to his victim over
160
167
  * TURN, the right fist drawn back low by the hip (GUT: cocked, still cocked), driven up into his
161
- * belly on the strike of the katana's cut down, so the victim kneels on it (home), buried there as he
168
+ * belly on the strike of the katana's thrust, so the victim kneels on it (home), buried there as he
162
169
  * folds (held), back to the guard (back); the left hand on the back of his bowed head, holding it
163
170
  * (GRAB: from, on); the right fist raised high over the shoulder (SMASH: from, raised), held there a
164
171
  * beat, brought down onto his head on the lock's last tick, as it bursts. Past the lock, the punch
@@ -223,6 +230,9 @@ export interface Prey {
223
230
  belly?: Vec3;
224
231
  head?: Vec3;
225
232
  }
233
+ export declare const LUNGE: number[][];
234
+ /** The swordsman's `pose` `e` ticks into the katana's execution (past EXEC.TICKS after the kill): his hips and his right foot on LUNGE, the left where it stands. */
235
+ export declare const lunge: (pose: Pose, e: number) => Pose;
226
236
  /**
227
237
  * The killer's `pose` in the fists' execution `e` ticks into its lock (past EXEC.TICKS after the
228
238
  * kill, a fraction between ticks), on `prey`: turned to him, the blows of PUMMEL, his feet where
@@ -17,7 +17,7 @@ export type Cue = [
17
17
  ];
18
18
  /** The xenomorph's, over GLORY_TICKS: on him at 18, its head back from 46, the bite home at 114. */
19
19
  export declare const FEAST_CUES: Cue[];
20
- /** The katana's, over EXEC.TICKS: the cut down bites at 36, he is on his knee at 46. */
20
+ /** The katana's, over EXEC.TICKS: the thrust goes in at 36, he is on his knee at 46. */
21
21
  export declare const EXEC_CUES: Cue[];
22
22
  /**
23
23
  * The fists', over EXEC.TICKS (feast.ts PUMMEL): the push off at 2 and 3, down on the left foot at 19
@@ -73,6 +73,8 @@ export declare const PARRY_IN: number, PARRY_OUT: number;
73
73
  export declare const parrying: (s: number) => number;
74
74
  /** The grip and blade `k` (as stroke() gives them) taken `e` of the way to the parry `to`, the blade a unit again: a new array. */
75
75
  export declare const deflect: (k: number[], e: number, to?: number[]) => number[];
76
+ /** The share of the cut down's swing at the top of its wind-up, the blade over the head. */
77
+ export declare const SLASH_TOP = 0.28;
76
78
  /** The grip and the blade direction (x, y, z each) of cut `cut` at `p` of the swing: one array, rewritten by each call. */
77
79
  export declare const stroke: (cut: number, p: number) => number[];
78
80
  /** The trunk's [twist, bend, lean] (radians, see TRUNK) of cut `cut` at `p` of its swing: one array, rewritten by each call. */
@@ -72,6 +72,18 @@ export declare const fragOf: (def: Pick<WorldDef, "scenery" | "seam" | "relief">
72
72
  export declare const viewProj: (eye: Vec3, yaw: number, pitch: number, aspect: number, roll?: number, t?: number, [N, F]?: [number, number]) => Float32Array<ArrayBuffer>;
73
73
  /** A world point on screen, in [0, 1] from the top left; undefined behind the camera. */
74
74
  export declare const project: (m: Float32Array, x: number, y: number, z: number) => [number, number] | undefined;
75
+ /**
76
+ * Whether a sphere reaches into the view of `m`, by its left, right, bottom, top and near planes (the
77
+ * last row plus or minus another). A point light out of it lights no pixel drawn, and the GPU pays
78
+ * for every light on every fragment, hidden ones too.
79
+ */
80
+ export declare const inView: (m: Float32Array, p: Vec3, r: number) => boolean;
81
+ /**
82
+ * The pixels [x, y, width, height] (from the bottom left) the quads cover on a `w` by `h` target seen
83
+ * through `m`, cut at the near plane, a pixel wider each side; undefined when none. Each quad's box
84
+ * is clamped alone: two mouths off either side of the view are none.
85
+ */
86
+ export declare const cover: (m: Float32Array, quads: Vec3[][], w: number, h: number) => [number, number, number, number] | undefined;
75
87
  /**
76
88
  * The view-projection of a spot's shadow map: from its position along its axis, a square window
77
89
  * just wide enough for the cone, clipped from 0.3 m (a flashlight sits inside its player's head)
@@ -99,6 +99,8 @@ export interface Runner {
99
99
  */
100
100
  pum?: number;
101
101
  prey?: Prey;
102
+ /** The katana's execution (feast.ts lunge()): its swordsman's ticks into the lock, smoothed as `pum`, running on past it for his recovery. */
103
+ exe?: number;
102
104
  fist?: boolean;
103
105
  /** The skeleton as last drawn: a limb cut off leaves from it (limbs.ts track()). */
104
106
  s?: ReturnType<typeof solve>;
@@ -303,11 +303,12 @@ export declare const XENO_FEED = 1;
303
303
  /**
304
304
  * The katana's glory kill, an execution (room.ts feast(), the user 2026-11-17: 1.5 s, not at once):
305
305
  * E locks the two for EXEC.TICKS (`exec` KILLER and VICTIM); the swordsman dashes in front of him,
306
- * to EXEC.REACH metres, over GLORY_DASH ticks, cuts down (CUT.SLASH) at EXEC.CUTS[0] and drops him
307
- * to his knees, then spins into a cut across (CUT.RIGHT) at EXEC.CUTS[1], whose strike is the
308
- * lock's last tick: his head goes (LIMB.HEAD) and the body, still on its knee, tips over where it
306
+ * to EXEC.REACH metres, over GLORY_DASH ticks, runs him through (CUT.THRUST, the user 2026-11-19) at EXEC.CUTS[0] and drops him
307
+ * to his knees, then raises the blade over his head and cuts down (CUT.SLASH, the user
308
+ * 2026-11-19: a samurai's execution, no spin) at EXEC.CUTS[1], whose strike is the lock's last
309
+ * tick: his head goes (LIMB.HEAD) and the body, still on its knee, tips over where it
309
310
  * is (feast.ts topple()). Without the katana in hand it is the fists' (the user, 2026-11-17): the
310
- * same lock, dashing to EXEC.FIST metres, a punch in the belly on the cut down's strike drops him on
311
+ * same lock, dashing to EXEC.FIST metres, a punch in the belly on the thrust's strike drops him on
311
312
  * his knee the same, and a punch down on his head on the lock's last tick bursts it (LIMB.BURST).
312
313
  * The fists strike nothing on the host: their blows are drawn (feast.ts pummel()).
313
314
  */
@@ -315,7 +316,7 @@ export declare const EXEC: {
315
316
  readonly TICKS: 88;
316
317
  readonly REACH: 1.3;
317
318
  readonly FIST: 0.7;
318
- readonly CUTS: readonly [20, 74];
319
+ readonly CUTS: readonly [26, 71];
319
320
  readonly KILLER: 1;
320
321
  readonly VICTIM: 2;
321
322
  };
@@ -37,6 +37,10 @@ export declare const STATION: {
37
37
  export declare const reaches: ({ post: [min, max] }: StationDef, { x, y, z }: PlayerState) => boolean;
38
38
  /** True when (x, y, z) is inside the station. */
39
39
  export declare const inside: ({ hall: [min, max] }: StationDef, x: number, y: number, z: number) => boolean;
40
+ /** The hangar and the command room, each [min, max]: shut but for the hangar's mouths (station()). */
41
+ export declare const rooms: ({ hull: [x, , z], post: [[, Y]] }: StationDef) => [Vec3, Vec3][];
42
+ /** The hangar's two mouths, between its side walls and under the lintels: four corners each. */
43
+ export declare const mouths: ({ hull: [x, , z], post: [[, Y]] }: StationDef) => Vec3[][];
40
44
  export declare class Station {
41
45
  phase: number;
42
46
  /** The team that armed the mission (ARMED, STRUCK). */
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.191.2",
5
+ "version": "0.192.1",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"