@korial29/tiny-fps 0.182.1 → 0.183.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
@@ -199,13 +199,14 @@ var [POUNCE_HP, POUNCE_STUN] = [2, 60];
199
199
  * xenomorph's takes any enemy up, with no flash (the user, 2026-11-16): E within GLORY_FAR metres
200
200
  * of him, in sight, and GLORY_ARC radians of its look locks the two (`lock`, `foe`, as a saber
201
201
  * lock) for GLORY_TICKS, where he does not move and it dashes to him, then it eats his head: he
202
- * goes down through his armour (LIMB.EATEN), a frag of FRAG.GLORY.
202
+ * goes down through his armour (LIMB.EATEN), a frag of FRAG.GLORY. 2 s, the time to see it climb
203
+ * on him and bite (the user, 2026-11-16: 0.9 s before).
203
204
  */
204
205
  var [GLORY_HP, GLORY_REACH, GLORY_ARC, GLORY_TICKS] = [
205
206
  3,
206
207
  2.5,
207
208
  1,
208
- 54
209
+ 120
209
210
  ];
210
211
  /**
211
212
  * The xenomorph's glory kill from afar (the user, 2026-11-16): within GLORY_FAR metres, in sight,
@@ -213,6 +214,21 @@ var [GLORY_HP, GLORY_REACH, GLORY_ARC, GLORY_TICKS] = [
213
214
  * 21 m/s, a step under PLAYER_R: it cannot tunnel.
214
215
  */
215
216
  var [GLORY_FAR, GLORY_DASH] = [8, 20];
217
+ /**
218
+ * The katana's glory kill, an execution (room.ts feast(), the user 2026-11-17: 1.5 s, not at once):
219
+ * E locks the two for EXEC.TICKS (`exec` KILLER and VICTIM); the swordsman dashes in front of him,
220
+ * to EXEC.REACH metres, over GLORY_DASH ticks, cuts down (CUT.SLASH) at EXEC.CUTS[0] and drops him
221
+ * to his knees, then spins into a cut across (CUT.RIGHT) at EXEC.CUTS[1], whose strike is the
222
+ * lock's last tick: his head goes (LIMB.HEAD) and the body, still on its knee, tips over where it
223
+ * is (feast.ts topple()).
224
+ */
225
+ var EXEC = {
226
+ TICKS: 88,
227
+ REACH: 1.3,
228
+ CUTS: [20, 74],
229
+ KILLER: 1,
230
+ VICTIM: 2
231
+ };
216
232
  /** How much faster than a man the xenomorph runs (the user, 2026-11-16: a little, not twice). */
217
233
  var XENO_PACE = 1.25;
218
234
  var PLASMA_R = .12;
@@ -6409,10 +6425,12 @@ var STRIKE = {
6409
6425
  var step = (p, i, w, team, armed = true, bodies = [], kit = KITS[0]) => {
6410
6426
  const down = p.down > 0;
6411
6427
  const locked = !down && (p.lock ?? 0) > 0;
6412
- if (locked && !p.wield && p.lock > GLORY_TICKS - GLORY_DASH && (p.vx || p.vz)) {
6428
+ const all = p.exec ? EXEC.TICKS : GLORY_TICKS;
6429
+ const killer = !p.wield || p.exec === EXEC.KILLER;
6430
+ if (locked && killer && p.lock > all - GLORY_DASH && (p.vx || p.vz)) {
6413
6431
  coast(p, w, bodies);
6414
- p.ev = p.lock == GLORY_TICKS ? EV.DASH : 0;
6415
- if (p.lock <= GLORY_TICKS - GLORY_DASH + 1) p.vx = p.vz = 0;
6432
+ p.ev = p.lock == all ? EV.DASH : 0;
6433
+ if (p.lock <= all - GLORY_DASH + 1) p.vx = p.vz = 0;
6416
6434
  } else move(p, down || locked ? {
6417
6435
  ...i,
6418
6436
  keys: 0
@@ -6621,6 +6639,7 @@ var beast = (p, i, fresh, busy) => {
6621
6639
  * lock runs down to 1, where it waits for the host, who parts the two (room.ts).
6622
6640
  */
6623
6641
  var duel = (p, i) => {
6642
+ if (p.exec) return execute(p);
6624
6643
  const fire = !!(i.keys & KEY.FIRE);
6625
6644
  p.pushes = (p.pushes ?? 0) + +(fire && !p.pressed) & 255;
6626
6645
  p.pressed = fire;
@@ -6633,6 +6652,26 @@ var duel = (p, i) => {
6633
6652
  ];
6634
6653
  return STRIKE.NONE;
6635
6654
  };
6655
+ /**
6656
+ * A step of a katana's glory kill (EXEC), whatever the keys: the swordsman's two cuts start on
6657
+ * their ticks of the lock (EXEC.CUTS: a cut down, then one across whose strike is the lock's last
6658
+ * tick), and strike no one; his victim holds no weapon up. Predicted, as a cut is.
6659
+ */
6660
+ var execute = (p) => {
6661
+ p.lock = Math.max(1, p.lock - 1);
6662
+ p.away = p.pushes = 0;
6663
+ const e = EXEC.TICKS - p.lock;
6664
+ const at = EXEC.CUTS.indexOf(e);
6665
+ const killer = p.exec === EXEC.KILLER;
6666
+ p.cut = killer && at >= 0 ? [CUT.SLASH, CUT.RIGHT][at] : p.cut;
6667
+ p.swing = killer && at >= 0 ? CUTS[p.cut].ticks : Math.max(0, (p.swing ?? 0) - 1);
6668
+ [p.wield, p.charge, p.heavy] = [
6669
+ killer && !!p.blade,
6670
+ 0,
6671
+ false
6672
+ ];
6673
+ return STRIKE.NONE;
6674
+ };
6636
6675
  /** The strength a charge of `ticks` gives, 1 to CHARGE_MAX: 1 under CHARGE_TAP, CHARGE_MAX at CHARGE_TICKS. */
6637
6676
  var powerOf = (ticks) => ticks < 10 ? 1 : 1 + Math.floor(4 * (ticks - 10) / 50);
6638
6677
  // src/shared/rover.ts
@@ -8509,7 +8548,7 @@ var encodeSnapshot = (s) => {
8509
8548
  v.setUint8(o + 48, p.lock ?? 0);
8510
8549
  v.setUint8(o + 49, (p.foe ?? 0) & 15 | (p.dashes & 2) << 3 | (p.hp & 8) << 2 | (p.mode & 8) << 3 | (p.pressed ? 128 : 0));
8511
8550
  v.setUint8(o + 50, p.pushes ?? 0);
8512
- v.setUint8(o + 51, p.away ?? 0);
8551
+ v.setUint8(o + 51, (p.away ?? 0) | (p.exec ?? 0) << 6);
8513
8552
  v.setUint8(o + 52, (p.rail ?? -1) + 1);
8514
8553
  v.setUint8(o + 53, +!!p.railed | +!!p.inRail << 1 | +!!p.zapping << 2 | +!!p.rifled << 3 | +!!p.inRifle << 4 | +!!p.hot << 5 | (p.held & KEY.USE ? 64 : 0) | (p.cool & 8) << 4);
8515
8554
  v.setUint8(o + 54, p.slow ?? 0);
@@ -8721,7 +8760,8 @@ var FREE = {
8721
8760
  foe: 0,
8722
8761
  pushes: 0,
8723
8762
  pressed: false,
8724
- away: 0
8763
+ away: 0,
8764
+ exec: 0
8725
8765
  };
8726
8766
  /** Where a rewound copy of a player stood and looked, to put over his live state. */
8727
8767
  var pick = ({ x, y, z, yaw }) => ({
@@ -9477,11 +9517,10 @@ var Room = class {
9477
9517
  * E pressed by `p`, the xenomorph or one with the katana in hand: the nearest enemy who is up,
9478
9518
  * within GLORY_ARC of its look where `p` drew him, and in no lock, is glory killed (glory()):
9479
9519
  * with the katana within GLORY_REACH and with GLORY_HP or less, the xenomorph's within
9480
- * GLORY_FAR, in sight, at any health (the user, 2026-11-16). The katana takes his head at once
9481
- * and throws the body back GLORY_PUSH m/s, the follow-through of a cut across in hand (the user,
9482
- * 2026-11-16). The xenomorph holds him: the two locked (`lock`, `foe`) for GLORY_TICKS, his flag
9483
- * dropped, `p` dashing to a metre of him (the user, 2026-11-16); duel() ends it. True when it
9484
- * happened.
9520
+ * GLORY_FAR, in sight, at any health (the user, 2026-11-16). The two are locked (`lock`, `foe`),
9521
+ * his flag dropped, `p` dashing in front of him: the xenomorph to a metre for GLORY_TICKS (the
9522
+ * user, 2026-11-16), the swordsman to EXEC.REACH for an execution of EXEC.TICKS (`exec`, the user
9523
+ * 2026-11-17: no longer at once); duel() ends it. True when it happened.
9485
9524
  */
9486
9525
  feast(p, view) {
9487
9526
  const me = p.state;
@@ -9502,31 +9541,20 @@ var Room = class {
9502
9541
  if (!seen || !foe) return false;
9503
9542
  const [dx, dz] = [seen.x - me.x, seen.z - me.z];
9504
9543
  const d = Math.hypot(dx, dz) || 1;
9505
- if (!xeno) {
9506
- const c = CUTS[CUT.RIGHT];
9507
- [me.cut, me.swing, me.heavy, me.charge] = [
9508
- CUT.RIGHT,
9509
- c.ticks - c.strike - 1,
9510
- false,
9511
- 0
9512
- ];
9513
- me.hits = me.hits + 1 & 255;
9514
- this.harm(foe, Infinity, p, FRAG.GLORY, felled(FALL$1.STRUCK, dx / d, dz / d));
9515
- Object.assign(foe.state, {
9516
- lost: LIMB.HEAD,
9517
- vx: dx / d * 7,
9518
- vy: 3,
9519
- vz: dz / d * 7,
9520
- ground: false,
9521
- mode: MODE.AIR
9522
- });
9523
- return true;
9524
- }
9525
9544
  this.drop(foe.info.id);
9526
- for (const [a, b] of [[p, foe], [foe, p]]) {
9545
+ const [lock, near] = xeno ? [GLORY_TICKS, 1] : [EXEC.TICKS, EXEC.REACH];
9546
+ for (const [a, b, exec] of [[
9547
+ p,
9548
+ foe,
9549
+ EXEC.KILLER
9550
+ ], [
9551
+ foe,
9552
+ p,
9553
+ EXEC.VICTIM
9554
+ ]]) {
9527
9555
  Object.assign(a.state, {
9528
9556
  ...FREE,
9529
- lock: GLORY_TICKS,
9557
+ lock,
9530
9558
  foe: b.info.id,
9531
9559
  pressed: true
9532
9560
  });
@@ -9538,8 +9566,9 @@ var Room = class {
9538
9566
  vx: 0,
9539
9567
  vz: 0
9540
9568
  });
9569
+ a.state.exec = xeno ? 0 : exec;
9541
9570
  }
9542
- const v = Math.max(d - 1, 0) * 60 / GLORY_DASH / d;
9571
+ const v = Math.max(d - near, 0) * 60 / GLORY_DASH / d;
9543
9572
  [me.vx, me.vz] = [Math.fround(dx * v), Math.fround(dz * v)];
9544
9573
  return true;
9545
9574
  }
@@ -9558,16 +9587,17 @@ var Room = class {
9558
9587
  return;
9559
9588
  }
9560
9589
  const [x, y] = [p, o].map((r) => this.kit(r).xeno);
9561
- if (x !== y) {
9590
+ const exec = !!q.exec;
9591
+ if (x !== y || exec) {
9562
9592
  if (q.lock > 1 && o.state.lock > 1) return;
9563
- const [eater, prey] = x ? [p, o] : [o, p];
9593
+ const [eater, prey] = (exec ? q.exec === EXEC.KILLER : x) ? [p, o] : [o, p];
9564
9594
  Object.assign(q, FREE);
9565
9595
  Object.assign(o.state, FREE);
9566
9596
  eater.state.hits = eater.state.hits + 1 & 255;
9567
9597
  const [dx, dz] = [prey.state.x - eater.state.x, prey.state.z - eater.state.z];
9568
9598
  const d = Math.hypot(dx, dz) || 1;
9569
9599
  this.harm(prey, Infinity, eater, FRAG.GLORY, felled(FALL$1.STRUCK, dx / d, dz / d));
9570
- prey.state.lost = LIMB.EATEN;
9600
+ prey.state.lost = exec ? LIMB.HEAD : LIMB.EATEN;
9571
9601
  return;
9572
9602
  }
9573
9603
  const lead = (q.pushes ?? 0) - (o.state.pushes ?? 0);
@@ -53,6 +53,8 @@ export interface Tracer {
53
53
  strike(at: Vec3, from?: Vec3): void;
54
54
  /** One spark out of `at`, up and a little aside: a cut limb's stump spitting. */
55
55
  spit(at: Vec3): void;
56
+ /** `n` drops of blood out of `at`, flung at `speed` m/s each way and up, falling. */
57
+ gore(at: Vec3, n: number, speed?: number): void;
56
58
  /** Where the own muzzle is now: its flash stays there, so that a kick of the view does not leave it behind. */
57
59
  mount(a: Vec3): void;
58
60
  /** Ages everything by dt seconds and drops what is over. */
@@ -161,9 +161,14 @@ export interface Grip {
161
161
  export declare const hands: (out: Out, s: Solved, build: number, curls: number[], glove: number[], bare: number[], { point, push, to, cup, lights, claws }?: Grip, lite?: boolean, skip?: number) => void;
162
162
  /** On a wall run the rail gun is put away, unless its bolt is going out. */
163
163
  export declare const stowed: (p: PlayerState) => boolean;
164
+ /**
165
+ * Ticks into a glory kill where the head starts back, where it strikes and where the strike is home:
166
+ * GLORY_TICKS takes his head 0.1 s later (the user, 2026-11-16: the head went too long after).
167
+ */
168
+ export declare const BITE: number[];
164
169
  /**
165
170
  * The bite of a glory kill (the user, 2026-11-16, after DOOM 2016) at `lock` ticks left of its
166
- * GLORY_TICKS: the head drawn back over the first two thirds as the claws hold the prey, then
171
+ * GLORY_TICKS: once on him (feast.ts) the head drawn slowly back as the claws hold the prey, then
167
172
  * driven down into him; the neck's turn for menace().
168
173
  */
169
174
  export declare const devour: (lock: number) => number;
@@ -0,0 +1,156 @@
1
+ import type { Vec3 } from './mesh';
2
+ import type { Pose } from './rig';
3
+ export declare const FEAST: {
4
+ /** The tick of the lock its lunge starts on (its dash is over at GLORY_DASH, 20), and the ticks it takes. */
5
+ readonly LEAP: readonly [18, 18];
6
+ /** Seconds it takes to let go of him after the kill. */
7
+ readonly DROP: 0.5;
8
+ /** Its hop back off him after the kill (the user, 2026-11-17): how high it arcs, metres. */
9
+ readonly HOP: 0.45;
10
+ /** Its pelvis in front of his feet, toward it, and how far it climbs, metres: a little, its head over his (the user, 2026-11-16). */
11
+ readonly CLING: 0.5;
12
+ readonly LIFT: 0.35;
13
+ /** The tip back of its pelvis that stands its bent back up against him, radians. */
14
+ readonly UPRIGHT: 0.05;
15
+ /** Its feet on the front of his thighs: across from his middle, toward it, and up; its knees forward and apart, as a knee bends. */
16
+ readonly FEET: readonly [0.17, 0.22, 0.6];
17
+ /** Its claws over his shoulders: across, toward it (negative: behind his front), and up. */
18
+ readonly CLAWS: readonly [0.19, -0.08, 1.52];
19
+ /** His bend back under its weight, spine to head (radians), and how far his hips sink (metres). */
20
+ readonly BEND: readonly [0.16, 0.2, 0.12, 0.22];
21
+ readonly SINK: 0.1;
22
+ /** His head thrown about in panic: the most it turns (radians) left and right, up and down, and over. */
23
+ readonly PANIC: readonly [0.55, 0.35, 0.3];
24
+ /**
25
+ * His body fighting it (the user, 2026-11-16): the jerk back as it seizes him (radians, at the
26
+ * middle of its lunge), then his chest twisting and his trunk rocking (radians), his hands shoving (metres).
27
+ */
28
+ readonly STARTLE: 0.35;
29
+ readonly STRUGGLE: readonly [0.3, 0.12, 0.07];
30
+ /** Its head shaken left and right as it eats (the user, 2026-11-16): the most it turns (radians) and how often (Hz). */
31
+ readonly CHEW: readonly [0.32, 6];
32
+ /** Drops of blood a second from his head as it eats, and in the burst when his head goes. */
33
+ readonly GORE: readonly [110, 40];
34
+ /** His hands raised against it, at its neck and its chest, to tear it off him (the user, 2026-11-17): across, toward it, and up. */
35
+ readonly PUSH: readonly [0.2, 0.36, 1.78];
36
+ /** His hands clawing at it, each its own way: metres up and down, and across. */
37
+ readonly CLAW: readonly [0.06, 0.04];
38
+ /**
39
+ * His hands on its belly as drawn (the user, 2026-11-17: on it, not through it): across from its
40
+ * middle, off it toward him (its belly's radius), and up; they shove by pulling back off it.
41
+ */
42
+ readonly HOLD: readonly [0.1, 0.16, 0.04];
43
+ /**
44
+ * The two rocking left and right together as they fight (the user, 2026-11-17): metres aside,
45
+ * radians of lean, and beats a second, on the lock's own ticks so both screens agree.
46
+ */
47
+ readonly SWAY: readonly [0.07, 0.12, 1.7];
48
+ /** Drops of blood a second from his thighs while its feet grip them, and where: across and up. */
49
+ readonly GRIP: readonly [30, 0.17, 0.62];
50
+ /**
51
+ * Seconds it keeps its head down at his after the kill, chewing, turned to him, and the last of
52
+ * them lifting it slowly as the chewing dies out (the user, 2026-11-17: not all at once), only
53
+ * once the killer's camera is back in his eye (KILLCAM.HOLD and BLEND).
54
+ */
55
+ readonly FEED: readonly [2.2, 0.8];
56
+ /** How far down its head stays once it has lifted it (devour()'s scale: 0.7 in him), and the seconds it then takes to come up the rest (the user, 2026-11-17: it went too high). */
57
+ readonly LOW: readonly [0.3, 1.2];
58
+ /**
59
+ * Its low hunting crouch at the end, as its head comes up from eating, as a cat's (the user,
60
+ * 2026-11-17: standing first, on the hunt again only at the end): how far its hips sink and go back (metres); its back bent forward (radians:
61
+ * spine, chest) and its neck lifting the head back up level; its claws ahead and low (metres
62
+ * ahead of its pelvis, over the floor, across).
63
+ */
64
+ readonly CROUCH: readonly [0.3, 0.12, 0.35, 0.3, 0.45, 0.5, 0.35, 0.22];
65
+ };
66
+ /** How far onto its prey the xenomorph is with `lock` ticks of its glory kill left: 0 on its feet, 1 on him. */
67
+ export declare const mounted: (lock: number) => number;
68
+ /**
69
+ * The xenomorph's `pose` on its prey, whose feet are at `prey`, by the share `m` (mounted()): turned
70
+ * to him and up on him, its feet on his thighs, its claws over his shoulders, leaning over his head.
71
+ */
72
+ export declare const seize: (pose: Pose, prey: Vec3, m: number, sway?: number, hop?: number) => Pose;
73
+ /**
74
+ * The prey's `pose` under the xenomorph whose feet are at `eater`, by the share `m`: turned to it,
75
+ * bent back with his hips sunk, his feet where they were, his arms raised against it (his hands on
76
+ * its belly `bust` as drawn, when it is known), jerked
77
+ * back as it seizes him, then fighting it, his head thrown about in panic, at `t` seconds (the
78
+ * user, 2026-11-16).
79
+ */
80
+ export declare const clutched: (pose: Pose, eater: Vec3, m: number, t?: number, bust?: Vec3, sway?: number) => Pose;
81
+ /**
82
+ * How hard the xenomorph eats, 0 to 1: from its strike (BITE[1]) to the kill with `lock` ticks
83
+ * left, then `mount` as it lets go of him (lock 0).
84
+ */
85
+ export declare const eating: (lock: number, mount: number) => number;
86
+ /** The xenomorph's `pose` with its head shaken left and right, `a` of the way (eating()), at `t` seconds. */
87
+ export declare const chew: (pose: Pose, a: number, t: number) => Pose;
88
+ /**
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
91
+ * many) onto one knee, the right, the left foot ahead (STEP, metres), his hips LOW metres lower,
92
+ * bent over in pain (BOW, radians: spine, chest, neck) with his hands on his belly (BELLY: across,
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
96
+ * his head goes NECK drops, then BLEED a second from the neck for BLEEDING seconds.
97
+ */
98
+ export declare const EXECUTE: {
99
+ readonly TURN: 8;
100
+ readonly KNEEL: readonly [number, 10];
101
+ readonly STEP: 0.4;
102
+ /** The kneeling leg over the floor, metres: the knee joint, the ankle and the toes' joint. */
103
+ readonly SOLE: readonly [0.09, 0.15, 0.06];
104
+ readonly LOW: 0.42;
105
+ readonly BOW: readonly [0.25, 0.4, 0.2];
106
+ readonly BELLY: readonly [0.08, 0.2, 0.1];
107
+ readonly PANT: readonly [0.07, 2.6];
108
+ readonly NO: readonly [0.4, 1.4];
109
+ readonly SPIN: readonly [74, number];
110
+ /** The beheaded body, still on its knee, tips over onto its right side about it: in so many seconds, so far (radians). */
111
+ readonly FALL: readonly [0.7, 1.45];
112
+ /** 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. */
113
+ readonly SETTLE: readonly [0.06, 5, 14];
114
+ readonly LIMP: 1.1;
115
+ readonly WOUND: 25;
116
+ readonly NECK: 45;
117
+ readonly BLEED: 60;
118
+ readonly BLEEDING: 0.8;
119
+ };
120
+ /** How far down on his knees its victim is with `lock` ticks left, 0 to 1. */
121
+ 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
+ * The victim's `pose` before the swordsman whose feet are at `killer`, with `lock` ticks of the
126
+ * execution left, at `t` seconds: turned to him, then down on his right knee, his left foot ahead,
127
+ * bent over with his hands on his belly, panting, his head shaking no.
128
+ */
129
+ export declare const kneel: (pose: Pose, killer: Vec3, lock: number, t?: number) => Pose;
130
+ /**
131
+ * How far the beheaded body has tipped over `t` seconds after the kill, radians: faster as it goes,
132
+ * as a fall does, then a small bounce on the floor (SETTLE: its share, how fast it dies out, its rate).
133
+ */
134
+ export declare const toppled: (t: number) => number;
135
+ /**
136
+ * The kneeling `pose` `t` seconds after his head went: tipped onto its right side about its right
137
+ * knee on the floor (toppled()), or about `pivot` (the xenomorph's prey, standing: his right foot),
138
+ * going limp as it goes (the user, 2026-11-17: not stiff): the raised leg stretching out, the arms
139
+ * falling along the body, the trunk slumping and turning a little.
140
+ */
141
+ export declare const topple: (pose: Pose, t: number, pivot?: number) => Pose;
142
+ /**
143
+ * How far the two rock as they fight with `lock` ticks of the glory kill left, -1 to 1, times how
144
+ * far it is on him (`m`): on the lock's ticks, which both of them count, so the two go together.
145
+ */
146
+ export declare const swaying: (lock: number, m: number) => number;
147
+ /**
148
+ * The xenomorph's `pose` turned to its prey at `prey`, `w` of the way, its neck and head with its
149
+ * body rather than after the player's look (the user, 2026-11-17: its head on him all along).
150
+ */
151
+ export declare const intent: (pose: Pose, prey: Vec3, w: number) => Pose;
152
+ /**
153
+ * The xenomorph's `pose` down in a low hunting crouch, `w` of the way (CROUCH): its hips sunk and
154
+ * back, its feet where they were, its back bent forward and its head kept up, its claws ahead and low.
155
+ */
156
+ export declare const crouch: (pose: Pose, w: number) => Pose;
@@ -0,0 +1,7 @@
1
+ import type { Pose } from './rig';
2
+ /** More round every joint but the soles' points: the armour stands off the skin. */
3
+ export declare const MARGIN = 0.035;
4
+ /** How far the skin stands round each joint, metres: the most it goes under the joint's centre. */
5
+ export declare const RADII: number[];
6
+ /** The pose `q` kept over the floor at height `floor`. */
7
+ export declare const footing: (q: Pose, floor: number) => Pose;
@@ -26,6 +26,8 @@ export declare const GOAL: string[];
26
26
  export declare const CONTROLS: [group: string, rows: [keys: string, does: string, codes?: string][]][];
27
27
  /** Seconds the way out is shown after sitting down. */
28
28
  export declare const OUT_HINT = 4;
29
+ /** The prompt of a glory kill on offer, drawn pulsing. */
30
+ export declare const GLORY_ACT = "glory kill";
29
31
  /**
30
32
  * What E does for a player on foot: 'drive' near a rover whose wheel is free, 'ride' when only the
31
33
  * seat beside it is, or when he carries a flag (a carrier does not drive), 'fly' near a ship that
@@ -133,10 +135,12 @@ export interface Hud {
133
135
  */
134
136
  comm(name: string, team: number, s: number, face?: CanvasImageSource): void;
135
137
  /**
136
- * The rover: `act` is what E does now ('drive', 'ride', 'get out'; '' hides the prompt), and
138
+ * The rover: `act` is what E does now ('drive', 'ride', 'get out', GLORY_ACT which pulses; '' hides the prompt), and
137
139
  * `speed` the km/h shown at the wheel, where the gun and the crosshair then hide; undefined off it.
138
140
  */
139
141
  rover(act: string, speed?: number): void;
142
+ /** The camera out of the head for a glory kill (killcam.ts): the crosshair, the gun and the visor's rim go. */
143
+ outside(on: boolean): void;
140
144
  /** The rover's reticle, where its lasers cross: `at` on screen in [0, 1] from the top left; undefined hides it. */
141
145
  aim(at?: [number, number]): void;
142
146
  /** The ship flown: its missiles and height, and how near its limits are (limits(), ship.ts); undefined hides it. */
@@ -0,0 +1,41 @@
1
+ import type { World } from '../shared/world';
2
+ import type { Vec3 } from './mesh';
3
+ export declare const KILLCAM: {
4
+ /** The pivot over the two's feet, the camera back from it on the floor plane and up over it: metres. */
5
+ readonly UP: 1.3;
6
+ readonly BACK: 3.4;
7
+ readonly RISE: 1.1;
8
+ /** The camera's side angle from behind the killer at the start (rad), and the turn it makes over SPAN. */
9
+ readonly FROM: 1.35;
10
+ readonly SWEEP: 0.6;
11
+ /** Seconds the turn takes: a xenomorph's lock and the hold after the kill. */
12
+ readonly SPAN: number;
13
+ /** Seconds the camera stays after the kill: the head eaten, or the body thrown back. */
14
+ readonly HOLD: 1.1;
15
+ /** Seconds from the eye to the side, and back. */
16
+ readonly BLEND: 0.25;
17
+ /** The camera is a ball of this radius for the ground and the brushes. */
18
+ readonly PAD: 0.3;
19
+ };
20
+ /**
21
+ * Whether the xenomorph's vision (grey-blue world, glowing enemies) is on with the kill camera `k`
22
+ * of the way out: it is its eyes', so out of its head the world and the prey keep their colours
23
+ * (the user, 2026-11-16), from halfway out.
24
+ */
25
+ export declare const sees: (xeno: boolean, k: number) => boolean;
26
+ /** What a frame is drawn from. */
27
+ export interface Kill {
28
+ at: Vec3;
29
+ yaw: number;
30
+ pitch: number;
31
+ /** 0 at the eye to 1 out of it, eased. */
32
+ k: number;
33
+ }
34
+ export interface KillCam {
35
+ /**
36
+ * Advances dt seconds. `pair` is the killer's feet and the victim's while the kill is shown,
37
+ * undefined after; `yaw` is the killer's look, `eye` the first-person camera.
38
+ */
39
+ frame(pair: [Vec3, Vec3] | undefined, yaw: number, eye: Vec3, dt: number): Kill;
40
+ }
41
+ export declare const createKillCam: (world: World) => KillCam;
@@ -54,6 +54,8 @@ export declare const track: (r: {
54
54
  cut?: Piece;
55
55
  build?: number;
56
56
  look?: Choice;
57
+ /** The skeleton as last drawn, which the limb leaves from: the gait's pose without it. */
58
+ s?: ReturnType<typeof solve>;
57
59
  }, dt: number, floor: Ground, fresh: boolean, tracer?: Pick<Tracer, "shock" | "spit">) => void;
58
60
  /**
59
61
  * Appends the piece at level of detail `lod`, in `colors` (see palette()), sunk by `sink` metres with
@@ -6,6 +6,7 @@ import type { Pieces } from './store';
6
6
  import type { Tracer } from './beams';
7
7
  import type { Piece } from './limbs';
8
8
  import type { Vec3 } from './mesh';
9
+ import { solve } from './rig';
9
10
  import type { Pose, Quat } from './rig';
10
11
  import type { Face } from './expression';
11
12
  import type { Trail } from './trail';
@@ -62,6 +63,36 @@ export interface Runner {
62
63
  build?: number;
63
64
  /** The skin and haircut the player picked (PlayerInfo.tone and hair): his id's when absent. */
64
65
  look?: Choice;
66
+ /**
67
+ * A xenomorph's glory kill (feast.ts): the id of the other one, how far the xenomorph is on its
68
+ * prey (mounted(), then down to 0 over FEAST.DROP once it has fed), and the other's feet.
69
+ */
70
+ mate?: number;
71
+ mount?: number;
72
+ with?: Vec3;
73
+ /** The xenomorph's belly as last drawn, for its prey's hands; the seconds it eats on after the kill. */
74
+ bust?: Vec3;
75
+ feed?: number;
76
+ /** Where its prey's feet were as it last held him (FEAST.FEED); the seconds left of its head coming up after (FEAST.LOW). */
77
+ fedOn?: Vec3;
78
+ low?: number;
79
+ /** The share of a drop of blood owed to the next frame (FEAST.GORE, EXECUTE.BLEED), the same from its prey's thighs (FEAST.GRIP), and the drops so far. */
80
+ gore?: number;
81
+ grip?: number;
82
+ drops?: number;
83
+ /** Seconds left of the blood from the neck of one the katana's execution beheaded. */
84
+ bleed?: number;
85
+ /** The execution's victim: the swordsman's feet while he kneels; once beheaded, them and the seconds since. */
86
+ killer?: Vec3;
87
+ slain?: {
88
+ at: Vec3;
89
+ t: number;
90
+ pivot?: number;
91
+ };
92
+ /** The execution's victim's pose as he last knelt, or the xenomorph's prey's as it last held him: the dead body tips over from it. */
93
+ knelt?: Pose;
94
+ /** The skeleton as last drawn: a limb cut off leaves from it (limbs.ts track()). */
95
+ s?: ReturnType<typeof solve>;
65
96
  }
66
97
  /** A man's haircuts (look.ts's HAIR_NAMES[0]): how long the hair stands off the scalp, the first one shaved. */
67
98
  export declare const LENGTHS: number[];
@@ -108,7 +139,7 @@ export declare const watched: (p: PlayerState, crowd: PlayerState[], held?: numb
108
139
  id: number;
109
140
  at: Vec3;
110
141
  } | undefined;
111
- export declare const animate: (book: Map<number, Runner>, others: PlayerState[], dt: number, world?: World, tracer?: Pick<Tracer, "shock" | "spit">, rovers?: Rover[], builds?: ReadonlyMap<number, number>, looks?: ReadonlyMap<number, Choice>) => void;
142
+ export declare const animate: (book: Map<number, Runner>, others: PlayerState[], dt: number, world?: World, tracer?: Pick<Tracer, "shock" | "spit"> & Partial<Pick<Tracer, "gore">>, rovers?: Rover[], builds?: ReadonlyMap<number, number>, looks?: ReadonlyMap<number, Choice>) => void;
112
143
  /**
113
144
  * A long gun's butt plate in the hollow of the right shoulder: from the shoulder joint, in the
114
145
  * chest's frame (to its right, up, back). The gun goes from there along the look, so it is
@@ -287,7 +287,8 @@ export declare const POUNCE_HP: number, POUNCE_STUN: number;
287
287
  * xenomorph's takes any enemy up, with no flash (the user, 2026-11-16): E within GLORY_FAR metres
288
288
  * of him, in sight, and GLORY_ARC radians of its look locks the two (`lock`, `foe`, as a saber
289
289
  * lock) for GLORY_TICKS, where he does not move and it dashes to him, then it eats his head: he
290
- * goes down through his armour (LIMB.EATEN), a frag of FRAG.GLORY.
290
+ * goes down through his armour (LIMB.EATEN), a frag of FRAG.GLORY. 2 s, the time to see it climb
291
+ * on him and bite (the user, 2026-11-16: 0.9 s before).
291
292
  */
292
293
  export declare const GLORY_HP: number, GLORY_REACH: number, GLORY_ARC: number, GLORY_TICKS: number;
293
294
  /**
@@ -296,8 +297,21 @@ export declare const GLORY_HP: number, GLORY_REACH: number, GLORY_ARC: number, G
296
297
  * 21 m/s, a step under PLAYER_R: it cannot tunnel.
297
298
  */
298
299
  export declare const GLORY_FAR: number, GLORY_DASH: number;
299
- /** The katana's glory kill (room.ts feast()): the speed it throws the beheaded body back at. */
300
- export declare const GLORY_PUSH = 7;
300
+ /**
301
+ * The katana's glory kill, an execution (room.ts feast(), the user 2026-11-17: 1.5 s, not at once):
302
+ * E locks the two for EXEC.TICKS (`exec` KILLER and VICTIM); the swordsman dashes in front of him,
303
+ * to EXEC.REACH metres, over GLORY_DASH ticks, cuts down (CUT.SLASH) at EXEC.CUTS[0] and drops him
304
+ * to his knees, then spins into a cut across (CUT.RIGHT) at EXEC.CUTS[1], whose strike is the
305
+ * lock's last tick: his head goes (LIMB.HEAD) and the body, still on its knee, tips over where it
306
+ * is (feast.ts topple()).
307
+ */
308
+ export declare const EXEC: {
309
+ readonly TICKS: 88;
310
+ readonly REACH: 1.3;
311
+ readonly CUTS: readonly [20, 74];
312
+ readonly KILLER: 1;
313
+ readonly VICTIM: 2;
314
+ };
301
315
  /** How much faster than a man the xenomorph runs (the user, 2026-11-16: a little, not twice). */
302
316
  export declare const XENO_PACE = 1.25;
303
317
  export declare const ACID_HP = 1;
@@ -48,6 +48,8 @@ export type Strike = (typeof STRIKE)[keyof typeof STRIKE];
48
48
  * `armed` is false while the match is over: no weapon, no rack. `bodies` are move()'s.
49
49
  */
50
50
  export declare const step: (p: PlayerState, i: Input, w: World, team: number, armed?: boolean, bodies?: readonly Body[], kit?: Kit) => Strike;
51
+ /** A lock that is a saber lock, not a glory kill's execution: the blades cross. */
52
+ export declare const sabering: (p: Pick<PlayerState, "lock" | "exec">) => boolean;
51
53
  /** The strength a charge of `ticks` gives, 1 to CHARGE_MAX: 1 under CHARGE_TAP, CHARGE_MAX at CHARGE_TICKS. */
52
54
  export declare const powerOf: (ticks: number) => number;
53
55
  export {};
@@ -188,11 +188,10 @@ export declare class Room {
188
188
  * E pressed by `p`, the xenomorph or one with the katana in hand: the nearest enemy who is up,
189
189
  * within GLORY_ARC of its look where `p` drew him, and in no lock, is glory killed (glory()):
190
190
  * with the katana within GLORY_REACH and with GLORY_HP or less, the xenomorph's within
191
- * GLORY_FAR, in sight, at any health (the user, 2026-11-16). The katana takes his head at once
192
- * and throws the body back GLORY_PUSH m/s, the follow-through of a cut across in hand (the user,
193
- * 2026-11-16). The xenomorph holds him: the two locked (`lock`, `foe`) for GLORY_TICKS, his flag
194
- * dropped, `p` dashing to a metre of him (the user, 2026-11-16); duel() ends it. True when it
195
- * happened.
191
+ * GLORY_FAR, in sight, at any health (the user, 2026-11-16). The two are locked (`lock`, `foe`),
192
+ * his flag dropped, `p` dashing in front of him: the xenomorph to a metre for GLORY_TICKS (the
193
+ * user, 2026-11-16), the swordsman to EXEC.REACH for an execution of EXEC.TICKS (`exec`, the user
194
+ * 2026-11-17: no longer at once); duel() ends it. True when it happened.
196
195
  */
197
196
  private feast;
198
197
  /**
@@ -281,6 +281,8 @@ export interface PlayerState {
281
281
  foe?: number;
282
282
  pushes?: number;
283
283
  pressed?: boolean;
284
+ /** In a katana's glory kill rather than a saber lock: EXEC.KILLER or EXEC.VICTIM. Absent reads 0. */
285
+ exec?: number;
284
286
  away?: number;
285
287
  /** Ticks of lightning left in the rail gun; absent or -1 without it (taken at the team's rail rack, lost on going down). */
286
288
  rail?: number;
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.182.1",
5
+ "version": "0.183.1",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"