@korial29/tiny-fps 0.167.0 → 0.169.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
@@ -192,6 +192,11 @@ var [POUNCE_COOL, POUNCE_FLY] = [48, 40];
192
192
  var [POUNCE_HP, POUNCE_STUN] = [2, 60];
193
193
  var PLASMA_R = .12;
194
194
  /**
195
+ * What a vehicle's bolts take (the user, 2026-11-16: stronger, they grazed like the rifle's rounds):
196
+ * BOLT_HP from a player each one that hits him, and 1 from a hull every BOLT_GRAZE on it.
197
+ */
198
+ var [BOLT_HP, BOLT_GRAZE] = [1, 2];
199
+ /**
195
200
  * The cuts, by CUT. A swing lasts `ticks`, during which no other starts, and strikes once, `strike`
196
201
  * ticks after its start. `hold` is the top of its wind-up, where FIRE held keeps it (a charge; -1:
197
202
  * a special, which does not charge). It hits every enemy whose body comes within `reach` metres of the
@@ -9131,7 +9136,7 @@ var Room = class {
9131
9136
  if (by) by.state.hits = by.state.hits + 1 & 255;
9132
9137
  if (b.power === 0 || b.power === 6) {
9133
9138
  const w = this.wear[this.rovers.indexOf(hull)];
9134
- w.graze = (w.graze + 1) % VEHICLE.GRAZE;
9139
+ w.graze = (w.graze + 1) % (b.power === 6 ? BOLT_GRAZE : VEHICLE.GRAZE);
9135
9140
  if (!w.graze) this.hurt(hull, 1, b.by, b.team);
9136
9141
  } else this.hurt(hull, b.arc ? CUTS[b.arc].hp : b.power ?? 1, b.by, b.team);
9137
9142
  return;
@@ -9139,7 +9144,8 @@ var Room = class {
9139
9144
  const foe = foes.find((q) => q.state === hit);
9140
9145
  if (!foe) return;
9141
9146
  if (by) by.state.hits = by.state.hits + 1 & 255;
9142
- if (b.power === 0 || b.power === 6) {
9147
+ if (b.power === 6) this.shot(foe, BOLT_HP, by, b.dx, b.dz);
9148
+ else if (b.power === 0) {
9143
9149
  foe.graze = ((foe.graze ?? 0) + 1) % 2;
9144
9150
  if (!foe.graze) this.shot(foe, 1, by, b.dx, b.dz);
9145
9151
  } else if (!b.arc) this.shot(foe, b.power ?? 1, by, b.dx, b.dz);
@@ -19,4 +19,10 @@ export interface Balls {
19
19
  bursts: [Vec3, number, number?][];
20
20
  };
21
21
  }
22
+ /**
23
+ * The key of a ball the host sends: its shooter and id, and apart for a vehicle's bolts and
24
+ * missiles, which a driver's bolt count names (room.ts) and could meet the number of a shot of his
25
+ * own gun: one of those, in flight or spent, would hide it.
26
+ */
27
+ export declare const keyOf: (b: Ball) => number;
22
28
  export declare const createBalls: (world: World) => Balls;
@@ -23,12 +23,16 @@ export interface Effects {
23
23
  kick: number;
24
24
  /** 0 to 1: how far the view has gone down to the floor, while the own player is down. */
25
25
  lie: number;
26
+ /** 0 to 1: the white light of the orbital station's lasers on the own player (glareAt()). */
27
+ glare: number;
26
28
  /** The own player fired a shot of `power` (1 to CHARGE_MAX): a shake of the eye, the look and the roll, and the kick of the gun, much stronger for a charged one. */
27
29
  fire(power?: number): void;
28
30
  /** The own player was hit: the red vignette and a small knock. */
29
31
  wound(): void;
30
32
  /** The own player was tackled: a hard jolt of the eye, the look and the roll, and the vignette. */
31
33
  jolt(): void;
34
+ /** The orbital station's lasers came down on the own player: the light that blinds him starts. */
35
+ blind(): void;
32
36
  /** A grenade burst near the own player, `k` 0 to 1 as it is nearer: the view is shaken as hard as a tackle at 1. */
33
37
  quake(k: number): void;
34
38
  /** The own player tackled someone: a small punch of the look and the field of view. */
@@ -52,4 +56,11 @@ export interface Effects {
52
56
  export declare const stepLength: (v: number) => number;
53
57
  /** Taking steps: on a floor, or along a wall. */
54
58
  export declare const stepping: (s?: PlayerState) => boolean;
59
+ /**
60
+ * The orbital strike's light on the own player: seconds it grows to white (while the lasers burn,
61
+ * RAY in beams.ts), stays white, and clears off the DISINTEGRATED screen.
62
+ */
63
+ export declare const BLIND: number[];
64
+ /** The strike's light `t` seconds after it came down: ever faster up to 1, held, then eased away. */
65
+ export declare const glareAt: (t: number) => number;
55
66
  export declare const createEffects: () => Effects;
@@ -78,6 +78,8 @@ export interface Hud {
78
78
  visor(on: boolean): void;
79
79
  /** The red vignette of a tackle, 0 (none) to 1 (full). */
80
80
  hurt(level: number): void;
81
+ /** The orbital strike's light over the view, 0 (none) to 1 (all white), over the down screen. */
82
+ glare(level: number): void;
81
83
  /**
82
84
  * The health as pips out of HP_MAX, and the weapon in hand: the ammo counter with the gun glyph,
83
85
  * the katana glyph when `wield` (or when it is all there is), or the rail gun's lightning left
@@ -314,9 +314,14 @@ export declare const RIFLE_SPEED = 400;
314
314
  export declare const PLASMA_R = 0.12;
315
315
  /** Plasma balls in flight in a room at most: past it the oldest bursts. They go on the wire. */
316
316
  export declare const PLASMA_MAX = 64;
317
- /** Ball.power of a rover's laser bolt (rover.ts): past CHARGE_MAX, so it names the bolt. It flies at BOLT_SPEED m/s and grazes like the laser rifle's. */
317
+ /** Ball.power of a vehicle's laser bolt (rover.ts): past CHARGE_MAX, so it names the bolt. It flies at BOLT_SPEED m/s. */
318
318
  export declare const BOLT = 6;
319
319
  export declare const BOLT_SPEED = 120;
320
+ /**
321
+ * What a vehicle's bolts take (the user, 2026-11-16: stronger, they grazed like the rifle's rounds):
322
+ * BOLT_HP from a player each one that hits him, and 1 from a hull every BOLT_GRAZE on it.
323
+ */
324
+ export declare const BOLT_HP: number, BOLT_GRAZE: number;
320
325
  /** Radians the view kicks up per shot (client side: the kick is in the pitch the inputs carry). */
321
326
  export declare const RECOIL = 0.012;
322
327
  /** Ticks a player lies down after the health ran out, then he is back at a spawn of his team. */
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.167.0",
5
+ "version": "0.169.0",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"