@korial29/tiny-fps 0.207.2 → 0.208.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
@@ -5990,7 +5990,10 @@ var launch$1 = (p, team = 0, harpoon = false) => {
5990
5990
  };
5991
5991
  /** The Hunter's returning disc: a wide, fast shot that the room turns back toward its owner. */
5992
5992
  var disk = (p, team = 0) => ({
5993
- ...launch$1(p, team),
5993
+ ...launch$1({
5994
+ ...p,
5995
+ rifled: false
5996
+ }, team),
5994
5997
  power: 9,
5995
5998
  left: 28
5996
5999
  });
@@ -6887,12 +6890,16 @@ var step = (p, i, w, team, armed = true, bodies = [], kit = KITS[0]) => {
6887
6890
  0
6888
6891
  ];
6889
6892
  const own = kit.hunter;
6890
- if (own) [p.rail, p.cap, p.rifle, p.nades] = [
6891
- 0,
6892
- 0,
6893
- -1,
6894
- 0
6895
- ];
6893
+ if (own) {
6894
+ [p.rail, p.cap, p.rifle, p.clip, p.nades] = [
6895
+ 0,
6896
+ 0,
6897
+ 0,
6898
+ 0,
6899
+ 0
6900
+ ];
6901
+ if (p.ammo < 0 && !p.down) [p.ammo, p.mag] = [kit.ammo, kit.mag];
6902
+ }
6896
6903
  if (armed && gear && inside && !p.rack) [p.ammo, p.mag] = [kit.ammo, kit.mag];
6897
6904
  p.rack = inside;
6898
6905
  p.blade = !!kit.katana || !!p.blade || armed && gear && !!blade && within(p, blade, 1.2);
@@ -7019,11 +7026,6 @@ var step = (p, i, w, team, armed = true, bodies = [], kit = KITS[0]) => {
7019
7026
  p.shots = p.shots + 1 & 255;
7020
7027
  return STRIKE.NADE;
7021
7028
  }
7022
- if (kit.hunter && p.wield && i.keys & KEY.SPECIAL && !(i.keys & KEY.FIRE) && !busy && !p.swing && !p.cool) {
7023
- p.cool = 75;
7024
- p.shots = p.shots + 1 & 255;
7025
- return STRIKE.DISK;
7026
- }
7027
7029
  if (p.wield && i.keys & KEY.SPECIAL && !busy && !p.swing) {
7028
7030
  p.cut = i.keys & KEY.FIRE ? cutOf(i.keys, !kit.hunter) + 4 : (i.keys & (KEY.LEFT | KEY.RIGHT)) === KEY.LEFT ? CUT.ARC_L : CUT.ARC_R;
7029
7031
  [p.swing, p.charge] = [CUTS[p.cut].ticks, 0];
@@ -7043,6 +7045,12 @@ var step = (p, i, w, team, armed = true, bodies = [], kit = KITS[0]) => {
7043
7045
  p.cut = cutOf(i.keys, !kit.hunter);
7044
7046
  [p.swing, p.charge] = [CUTS[p.cut].ticks, 0];
7045
7047
  launch(p);
7048
+ } else if (p.rifled && own) {
7049
+ if (!p.cool) {
7050
+ p.cool = 75;
7051
+ p.shots = p.shots + 1 & 255;
7052
+ return STRIKE.DISK;
7053
+ }
7046
7054
  } else if (p.rifled) {
7047
7055
  if (!p.cool && p.clip && !p.reload) {
7048
7056
  p.rifle--;
@@ -33,6 +33,8 @@ export interface Audio {
33
33
  speak(id: number, at?: Vec3, db?: number, rate?: number, radio?: boolean): boolean;
34
34
  /** The sound `id` (one of LOOPED) as a loop, silent until its first set; the own player's, centred. */
35
35
  loop(id: number): Loop;
36
+ /** Fades the music out (true) or back in (false), the other sounds untouched: the Hunter's visions. */
37
+ hush(on: boolean): void;
36
38
  /** Mutes or unmutes everything, music included. */
37
39
  mute(on: boolean): void;
38
40
  readonly muted: boolean;
@@ -29,7 +29,7 @@ export interface Tracer {
29
29
  a: Vec3;
30
30
  b: Vec3;
31
31
  }[]): void;
32
- /** The Hunter's shoulder cannon's shot from `a` to `b`: a straight red beam that fades in CANNON seconds. */
32
+ /** The Hunter's shoulder cannon's shot from `a` to `b`: a red ball like the pistol's flying there, bursting at `b`. */
33
33
  laser(a: Vec3, b: Vec3): void;
34
34
  /** A ball burst at `at`: a splash of light and a spray of sparks; a laser rifle's, `red`, bigger and fiercer. */
35
35
  burst(at: Vec3, red?: boolean): void;
@@ -63,6 +63,8 @@ export interface Tracer {
63
63
  mount(a: Vec3): void;
64
64
  /** Ages everything by dt seconds and drops what is over. */
65
65
  update(dt: number): void;
66
+ /** Appends the thrown discs' metal, lit and casting shadows like the bodies: before draw()'s glow. */
67
+ solids(out: Out): void;
66
68
  /** Appends the balls, the flashes, the bolts and the sparks, turned to the camera at `eye`. */
67
69
  draw(out: Out, eye: Vec3): void;
68
70
  /** The lights of the flashes, the splashes, the bolts and the nearest balls, for gather(). */
@@ -120,22 +120,12 @@ export declare const counter: (p: Pick<PlayerState, "cut">, prog: number) => [nu
120
120
  type Claws = boolean | 'short';
121
121
  /** The ring of a finger from which on it is bare: the glove's fingers end 60 % along the middle phalanx. */
122
122
  export declare const BARE = 8;
123
- /**
124
- * The rings of a finger, in the hand's space: from `p` along `d1`, `d2` then `d3`, its three
125
- * phalanges (BONES of `l`), `r` thick at the root, the first ring across `t`. Each bend is a curve
126
- * through the joint, not a corner, so that a fist keeps a round knuckle. The glove ends at ring
127
- * BARE in a rolled edge; the skin goes on to the tip.
128
- */
129
123
  export declare const finger: (p: Vec3, d1: Vec3, d2: Vec3, d3: Vec3, l: number, r: number, t: Vec3,
130
124
  /** 0 to 1: a skeleton's finger (the xenomorph's), thin bones between swollen knuckles, a fine tip. */
131
- bony?: number) => Ring[];
132
- /**
133
- * The directions of the three phalanges of the finger i (index to little) at `curl`, in the hand's
134
- * space. At 0.9, the curl of every grip, they go round a handle 2.5 cm thick 7.8 cm along the
135
- * fingers from the wrist and 2.2 cm toward the palm, their tips back at the heel of the palm (the
136
- * user, 2026-11-09: the fingers stood off the katana's grip).
137
- */
138
- export declare const phalanges: (curl: number, i: number) => [Vec3, Vec3, Vec3];
125
+ bony?: number,
126
+ /** How far each joint's curve reaches along the bones, a share of them: less, a sharper joint. */
127
+ knee?: number) => Ring[];
128
+ export declare const phalanges: (curl: number, i: number, spread?: number, hook?: number) => [Vec3, Vec3, Vec3];
139
129
  /** The strap round the wrist (the user, 2026-11-14: finer): its width, and how far it stands out of the palm's ring. */
140
130
  export declare const STRAP: {
141
131
  w: number;
@@ -162,7 +152,11 @@ lights?: boolean,
162
152
  /** The xenomorph's claws on the fingertips (Grip). */
163
153
  claws?: Claws,
164
154
  /** Its size: the xenomorph's grows from the wrist over 4 cm, hers is smaller (hands()). */
165
- grow?: number) => void;
155
+ grow?: number,
156
+ /** How far the fingers fan out, times an open hand's (phalanges()). */
157
+ spread?: number,
158
+ /** How far the fingers' last bones bend further, radians (phalanges()). */
159
+ hook?: number) => void;
166
160
  /** What a hand does besides closing (hand()): the left index pointing, the right thumb pushing toward `to`, the left thumb cupped. */
167
161
  export interface Grip {
168
162
  point?: number;
@@ -173,6 +167,10 @@ export interface Grip {
173
167
  lights?: boolean;
174
168
  /** The xenomorph's: a hooked claw of bone on each fingertip, for the nail. */
175
169
  claws?: Claws;
170
+ /** The right hand's fingers fanned out this many times an open hand's (the Hunter's disc). */
171
+ spread?: number;
172
+ /** The right hand's fingers' last bones bent further, radians: gripping an edge. */
173
+ hook?: number;
176
174
  }
177
175
  /**
178
176
  * Both hands of the skeleton `s` on its wrists, left then right, each closed `curls[i]` (hand()), in
@@ -180,7 +178,7 @@ export interface Grip {
180
178
  * body and the runners share it, so a runner's fist closes on a grip as the own one does. `lite` is
181
179
  * a near runner's hand, `skip` a hand not drawn (the one a cut took off with its arm).
182
180
  */
183
- 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;
181
+ export declare const hands: (out: Out, s: Solved, build: number, curls: number[], glove: number[], bare: number[], { point, push, to, cup, lights, claws, spread, hook, }?: Grip, lite?: boolean, skip?: number) => void;
184
182
  /** On a wall run the rail gun is put away, unless its bolt is going out. */
185
183
  export declare const stowed: (p: PlayerState) => boolean;
186
184
  /**
@@ -38,12 +38,12 @@ export interface Combat {
38
38
  /** Shots between two states of a player, a u8 counter that wraps. */
39
39
  export declare const fired: (a?: PlayerState, b?: PlayerState) => number;
40
40
  /** What the katana's sounds read of a player: the swing, the cut and whether it is in hand. */
41
- type Blade = Pick<PlayerState, 'swing' | 'cut' | 'wield' | 'blade' | 'fists' | 'heavy' | 'down' | 'railed' | 'ammo' | 'reload' | 'rifled' | 'hot' | 'hits'>;
41
+ type Blade = Pick<PlayerState, 'swing' | 'cut' | 'wield' | 'blade' | 'fists' | 'heavy' | 'charge' | 'down' | 'railed' | 'ammo' | 'reload' | 'rifled' | 'hot' | 'hits'>;
42
42
  /**
43
43
  * The CUT of a swing that started between two states of a player, or -1: `swing` jumped up (it
44
44
  * only counts down), or the cut changed under a running one.
45
45
  */
46
- export declare const swung: (a?: Blade, b?: Blade) => number;
46
+ export declare const swung: (a?: Blade, b?: Blade, xeno?: boolean) => number;
47
47
  /**
48
48
  * Whether the step from a to b is the strike of its cut: `swing` went down through the strike tick
49
49
  * (CUTS; the xenomorph's, `xeno`, TAILS).
@@ -66,6 +66,8 @@ export interface HunterPiece {
66
66
  harpoon: boolean;
67
67
  /** The shoulder cannon, from its hinge (CANNON_HINGE) rather than the joint: it folds about it. */
68
68
  cannon: boolean;
69
+ /** The disc on his hip, left out while it is in his hand. */
70
+ disc: boolean;
69
71
  vertices: number[];
70
72
  }
71
73
  /**
@@ -102,3 +104,31 @@ export declare const hunterPose: (pos: Vec3[], rot: [number, number, number, num
102
104
  * rotations: each vertex placed by both bones and mixed by its share, its normal likewise.
103
105
  */
104
106
  export declare const blendHunter: (out: Out, band: HunterBand, joints: Vec3[], rot: [number, number, number, number][]) => void;
107
+ /** The thrown disc and the disc in hand, times the hip's (the user, 2026-11-23: bigger). */
108
+ export declare const DISC_SCALE = 1.5;
109
+ /**
110
+ * The hip's throwing disc (the model's 'Flying disc' without its belt clip) in its own frame: the
111
+ * hub at the origin, the disc in the x-y plane and its face along +z, DISC_SCALE times as big. The thrown disc and the disc
112
+ * in hand are drawn with it (the user, 2026-11-23: the armour's disc).
113
+ */
114
+ export declare const discVertices: (lod: 0 | 1 | 2) => number[];
115
+ /**
116
+ * The disc's hub from the hand's grip (gun.ts grip()), metres: forward along the fingers, and down
117
+ * under the palm (against gun.ts axes()' right, the back of the hand).
118
+ */
119
+ export declare const DISC_HOLD: readonly [number, number];
120
+ /** The own hand holding the disc, moved from the gun's place in camera space (right, up, ahead), metres. */
121
+ export declare const DISC_RAISE: Vec3;
122
+ /** The own hand holding the disc: how far its fingers lean ahead of straight up (a slope). */
123
+ export declare const DISC_TILT = 2;
124
+ /** The fingers on the disc fanned out this many times an open hand's (the user, 2026-11-23). */
125
+ export declare const DISC_SPREAD = 5.5;
126
+ /** How far the fingers bend over the disc's edge in all, radians, over their three joints (the user, 2026-11-23). */
127
+ export declare const DISC_HOOK = 1.4;
128
+ /** How far the fingers close over the disc (hand()'s curl): little, long over its hub (the user, 2026-11-23). */
129
+ export declare const DISC_CURL = 0.05;
130
+ /**
131
+ * The armour's disc in a hand (the user, 2026-11-23: the disc in hand is the one on his hip):
132
+ * centred `at`, its plane along `x` and `y` and its face along `n`, all unit.
133
+ */
134
+ export declare const drawDisc: (out: Out, at: Vec3, x: Vec3, y: Vec3, n: Vec3, lod?: 0 | 1 | 2) => void;
@@ -184,7 +184,7 @@ export interface Renderer {
184
184
  /** The xenomorph's vision (the own player is one): a grey-blue world, the enemies in sight glowing. */
185
185
  vision(on: boolean): void;
186
186
  /** The Hunter's local vision filter and the players it can detect. */
187
- hunterVision(mode: number, targets: PlayerState[]): void;
187
+ hunterVision(mode: number, targets: PlayerState[], cold?: PlayerState[]): void;
188
188
  /** Let eligible glory kill targets flash during play. */
189
189
  edge(on: boolean): void;
190
190
  /** The body of each player (PlayerInfo.body, BODY), from the roster: the man's for one not in it; and the skin and haircut he picked, his id's for one not in `looks`. */
@@ -42,7 +42,7 @@ export declare const HOOKED: Lash;
42
42
  * Where its tail is through a strike (TAILS, by the cut): it goes from HOOKED to the strike's poise
43
43
  * in the first third of the wind-up (or most of the way to the strike for a special), so it answers
44
44
  * the click at once (the user, 2026-11-16), is driven to its end at the strike, eased in, then
45
- * comes back. A charge holds it cocked on its side, drawn in and coiled in an S over a tap of
45
+ * comes back. A charge holds it at that poise, drawn in and coiled in an S over a tap of
46
46
  * charge, then still but for its breath with the clock `t` (the user, 2026-11-16); let go, it
47
47
  * strikes from there. The SPIN turns the tail low once round the body.
48
48
  */
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.207.2",
5
+ "version": "0.208.1",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"