@korial29/tiny-fps 0.211.0 → 0.213.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/server.js CHANGED
@@ -6012,7 +6012,7 @@ var wave = (p, team = 0) => ({
6012
6012
  arc: p.cut
6013
6013
  });
6014
6014
  /** The speed of the flight `b`, m/s: an arc's, a bolt's, a rifle round's (power 0) or a ball's. A grenade has its own (`Ball.v`). */
6015
- var speedOf = (b) => b.arc ? ARC_SPEED : b.power === 9 || b.power === 10 ? 52 : b.power === 8 ? 72 : b.power === 6 ? 120 : b.power === 0 ? 400 : 80;
6015
+ var speedOf = (b) => b.arc ? ARC_SPEED : b.power === 9 || b.power === 10 ? 52 : b.power === 8 ? 600 : b.power === 6 ? 120 : b.power === 0 ? 400 : 80;
6016
6016
  /** Metres the flight `b` goes in a tick. */
6017
6017
  var stepOf = (b) => speedOf(b) / 60;
6018
6018
  /**
@@ -6893,11 +6893,8 @@ var step = (p, i, w, team, armed = true, bodies = [], kit = KITS[0]) => {
6893
6893
  ];
6894
6894
  const own = kit.hunter;
6895
6895
  if (own) {
6896
- [p.rifle, p.clip, p.nades] = [
6897
- 0,
6898
- 0,
6899
- 0
6900
- ];
6896
+ [p.rifle, p.nades] = [0, 0];
6897
+ p.clip = Math.max(0, (p.clip ?? 0) - 1);
6901
6898
  if (p.ammo < 0 && !p.down) [p.ammo, p.mag, p.cap, p.rail] = [
6902
6899
  kit.ammo,
6903
6900
  kit.mag,
@@ -6932,7 +6929,7 @@ var step = (p, i, w, team, armed = true, bodies = [], kit = KITS[0]) => {
6932
6929
  [p.mag, p.cap, p.clip] = [
6933
6930
  Math.min(p.mag ?? 0, kit.mag),
6934
6931
  Math.min(p.cap ?? 0, kit.cap),
6935
- Math.min(p.clip ?? 0, kit.clip)
6932
+ own ? p.clip : Math.min(p.clip ?? 0, kit.clip)
6936
6933
  ];
6937
6934
  p.cool = Math.max(0, p.cool - 1);
6938
6935
  p.lob = Math.max(0, (p.lob ?? 0) - 1);
@@ -7059,8 +7056,8 @@ var step = (p, i, w, team, armed = true, bodies = [], kit = KITS[0]) => {
7059
7056
  [p.swing, p.charge] = [CUTS[p.cut].ticks, 0];
7060
7057
  launch(p);
7061
7058
  } else if (p.rifled && own) {
7062
- if (!p.cool) {
7063
- p.cool = 75;
7059
+ if (!p.clip) {
7060
+ p.clip = 120;
7064
7061
  p.shots = p.shots + 1 & 255;
7065
7062
  return STRIKE.DISK;
7066
7063
  }
@@ -10235,6 +10232,10 @@ var Room = class {
10235
10232
  b.y,
10236
10233
  b.z
10237
10234
  ];
10235
+ if ((b.power === 9 || b.power === 10) && by && !by.state.clip) {
10236
+ b.burst = true;
10237
+ return;
10238
+ }
10238
10239
  if (b.returning || b.power === 10) {
10239
10240
  if (!by) {
10240
10241
  b.burst = true;
@@ -10248,6 +10249,7 @@ var Room = class {
10248
10249
  const distance = Math.hypot(...delta);
10249
10250
  if (distance < .65) {
10250
10251
  b.burst = true;
10252
+ by.state.clip = 0;
10251
10253
  return;
10252
10254
  }
10253
10255
  [b.dx, b.dy, b.dz] = delta.map((v) => v / distance);
@@ -33,6 +33,8 @@ export interface Tracer {
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;
36
+ /** A harpoon bolt's impact at `at`: a brief white-hot flash, steel sparks and a puff of dust. */
37
+ impact(at: Vec3): void;
36
38
  /** A grenade burst at `at`: a white-hot fireball in orange puffs that swells and shrinks away, a shower of embers, a strong light. `size` times as wide for a vehicle blowing up. */
37
39
  blast(at: Vec3, size?: number): void;
38
40
  /** A shock wave from `at`: a ring of fire flat on the ground, out to `r` metres as it fades. */
@@ -60,7 +60,7 @@ export declare const dreadful: (was: {
60
60
  life: number;
61
61
  vy: number;
62
62
  }, p: PlayerState) => boolean;
63
- export declare const createCombat: (world: World, audio: Pick<Audio, "play"> & Partial<Pick<Audio, "loop">>, hud: Pick<Hud, "vitals" | "hit" | "down">, fx: Pick<Effects, "fire" | "cut" | "wound" | "lie" | "quake" | "blow" | "punch">, tracer: Pick<Tracer, "flash" | "burst" | "blast" | "orbs" | "update" | "mount" | "crackle" | "laser" | "charging" | "lightning" | "tesla">, ctl: {
63
+ export declare const createCombat: (world: World, audio: Pick<Audio, "play"> & Partial<Pick<Audio, "loop">>, hud: Pick<Hud, "vitals" | "hit" | "down">, fx: Pick<Effects, "fire" | "cut" | "wound" | "lie" | "quake" | "blow" | "punch">, tracer: Pick<Tracer, "flash" | "burst" | "impact" | "blast" | "orbs" | "update" | "mount" | "crackle" | "laser" | "charging" | "lightning" | "tesla">, ctl: {
64
64
  pitch: number;
65
65
  }, balls: Pick<Balls, "fire" | "frame">,
66
66
  /** The muzzle of a runner's long gun as last drawn, from his feet (Renderer.muzzle()). */
@@ -164,7 +164,7 @@ export declare const SOUND: {
164
164
  /** A rising three-step target lock and a heavy shoulder-mounted laser discharge. */
165
165
  readonly HUNTER_LOCK: 85;
166
166
  readonly HUNTER_LASER: 86;
167
- /** The harpoon's next bolt racked in from behind: a servo's whine, the slide, the lock home. */
167
+ /** The harpoon's next bolt racked in from behind: steel sliding along steel, then the lock home. */
168
168
  readonly HARPOON_RELOAD: 87;
169
169
  /**
170
170
  * The Hunter's views (the user, 2026-11-23): the flash of a view switched with V, then, while a
@@ -181,6 +181,8 @@ export declare const SOUND: {
181
181
  */
182
182
  readonly HUNTER_TRACK: 91;
183
183
  readonly HUNTER_SEEK: 92;
184
+ /** A harpoon bolt striking (the user, 2026-11-24: a shock, not a laser's splash). */
185
+ readonly HARPOON_HIT: 93;
184
186
  };
185
187
  /**
186
188
  * The sounds of the game: one entry per sound, its voices layered, in SOUND order. A low-passed
@@ -372,7 +372,11 @@ export declare const RIFLE_SPEED = 400;
372
372
  export declare const PLASMA_R = 0.12;
373
373
  /** Ball.power of the Hunter's harpoon: its own projectile kind in snapshots. */
374
374
  export declare const HARPOON = 8;
375
- export declare const HARPOON_SPEED = 72;
375
+ /**
376
+ * The bolt reaches its target almost at once, like a sniper round (the user, 2026-11-24): 10 m a
377
+ * tick, the full HARPOON_RANGE in 0.15 s. It was 72.
378
+ */
379
+ export declare const HARPOON_SPEED = 600;
376
380
  export declare const HARPOON_RANGE = 90;
377
381
  export declare const HARPOON_R = 0.08;
378
382
  export declare const HARPOON_HP = 4;
@@ -383,7 +387,12 @@ export declare const DISK_SPEED = 52;
383
387
  export declare const DISK_RANGE = 28;
384
388
  export declare const DISK_R = 0.16;
385
389
  export declare const DISK_HP = 3;
386
- export declare const DISK_COOL = 75;
390
+ /**
391
+ * Ticks a thrown disc may stay out (the user, 2026-11-24): it can be thrown again only once it is
392
+ * back in the hand, and one that has not come back by then (stuck) is in the hand again. Counted
393
+ * down in the Hunter's `clip` (gun.ts), which his disc's slot takes from the laser rifle.
394
+ */
395
+ export declare const DISK_LOST: number;
387
396
  /** Ticks a Hunter must keep a target in the shoulder laser's sight to lock on. */
388
397
  export declare const HUNTER_LASER_LOCK: number;
389
398
  /** Damage dealt by a locked Hunter shoulder laser. */
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.211.0",
5
+ "version": "0.213.0",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"