@korial29/tiny-fps 0.145.0 → 0.146.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/index.js +16 -16
- package/dist/local.js +1 -1
- package/dist/server.js +65 -25
- package/dist/types/client/armor.d.ts +15 -1
- package/dist/types/client/beams.d.ts +2 -1
- package/dist/types/client/body.d.ts +4 -3
- package/dist/types/client/buckle.d.ts +2 -1
- package/dist/types/client/craft.d.ts +2 -1
- package/dist/types/client/doors.d.ts +3 -2
- package/dist/types/client/drops.d.ts +2 -1
- package/dist/types/client/dust.d.ts +2 -1
- package/dist/types/client/flag.d.ts +8 -5
- package/dist/types/client/gun.d.ts +3 -2
- package/dist/types/client/hair.d.ts +2 -1
- package/dist/types/client/helm.d.ts +2 -1
- package/dist/types/client/helmet.d.ts +5 -4
- package/dist/types/client/hud.d.ts +3 -2
- package/dist/types/client/katana.d.ts +4 -3
- package/dist/types/client/limbs.d.ts +2 -1
- package/dist/types/client/mask.d.ts +5 -2
- package/dist/types/client/mesh.d.ts +4 -3
- package/dist/types/client/moonbase.d.ts +6 -5
- package/dist/types/client/pack.d.ts +4 -3
- package/dist/types/client/pads.d.ts +5 -2
- package/dist/types/client/pouch.d.ts +2 -1
- package/dist/types/client/props.d.ts +8 -5
- package/dist/types/client/render.d.ts +2 -1
- package/dist/types/client/rover.d.ts +3 -2
- package/dist/types/client/skin.d.ts +2 -1
- package/dist/types/client/soldier.d.ts +3 -2
- package/dist/types/client/traffic.d.ts +2 -1
- package/dist/types/client/trail.d.ts +2 -1
- package/dist/types/client/verts.d.ts +26 -0
- package/dist/types/client/vision.d.ts +2 -1
- package/dist/types/client/wreck.d.ts +3 -2
- package/dist/types/shared/constants.d.ts +10 -3
- package/dist/types/shared/physics.d.ts +1 -0
- package/dist/types/shared/room.d.ts +9 -8
- package/dist/types/shared/types.d.ts +4 -2
- package/dist/types/shared/world.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Vec3 } from './mesh';
|
|
2
2
|
import type { Quat } from './rig';
|
|
3
|
+
import type { Out } from './verts';
|
|
3
4
|
/**
|
|
4
5
|
* The pack's body in the chest joint's frame (at 1.30 m; the back of the trunk is about 0.12
|
|
5
6
|
* behind it), its front sunk a little in the back: its centre, half width, height and depth, and how square its corners are.
|
|
@@ -20,14 +21,14 @@ export declare const HOSE: {
|
|
|
20
21
|
* Appends the pack at level of detail `lod` on the chest joint at `at` turned by `q` (see solve()
|
|
21
22
|
* in rig.ts); its light strips glow in `rgb`, the team's colour.
|
|
22
23
|
*/
|
|
23
|
-
export declare const pack: (out:
|
|
24
|
+
export declare const pack: (out: Out, at: Vec3, q: Quat, rgb: number[], lod: number) => void;
|
|
24
25
|
/**
|
|
25
26
|
* Appends the hose from the helmet on the head joint (`head`, `hq`) to the pack on the chest joint
|
|
26
27
|
* (`chest`, `cq`), at level of detail `lod`: a Bezier leaving the helmet out and down and entering
|
|
27
28
|
* the pack's port from above, ribbed close up. None far.
|
|
28
29
|
*/
|
|
29
|
-
export declare const hose: (out:
|
|
30
|
+
export declare const hose: (out: Out, head: Vec3, hq: Quat, chest: Vec3, cq: Quat, lod: number) => void;
|
|
30
31
|
/** The woman's panel, scaled about its joint: smaller, as far out (her briefs are where his are). */
|
|
31
32
|
export declare const CUP_F: Vec3;
|
|
32
33
|
/** Appends the crotch panel on the pelvis joint at `at` turned by `q`, in `plate` (white when absent). */
|
|
33
|
-
export declare const crotch: (out:
|
|
34
|
+
export declare const crotch: (out: Out, at: Vec3, q: Quat, plate?: number[], scale?: number | Vec3) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Vec3 } from './mesh';
|
|
2
2
|
import type { Quat } from './rig';
|
|
3
|
+
import type { Out } from './verts';
|
|
3
4
|
/**
|
|
4
5
|
* A lame, from the arm's joint at rest (metres, +x out): where it starts and ends across, its half
|
|
5
6
|
* width fore and aft, and its height at its start.
|
|
@@ -78,7 +79,9 @@ export declare const COLLAR_CLOTH: number[];
|
|
|
78
79
|
* smaller on the woman (`build`). Or the `marine`'s shoulder bells, and no collar, with a band
|
|
79
80
|
* round them in `band` (the astronaut's team colour on his white bells).
|
|
80
81
|
*/
|
|
81
|
-
export declare const pads: (out:
|
|
82
|
+
export declare const pads: (out: Out, s: {
|
|
82
83
|
pos: Vec3[];
|
|
83
84
|
rot: Quat[];
|
|
84
|
-
}, build?: number, color?: number[], marine?: boolean, band?: number[]
|
|
85
|
+
}, build?: number, color?: number[], marine?: boolean, band?: number[],
|
|
86
|
+
/** A far runner's: fewer quads. */
|
|
87
|
+
far?: boolean) => void;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { Vec3 } from './mesh';
|
|
2
2
|
import type { Quat } from './rig';
|
|
3
|
+
import type { Out } from './verts';
|
|
3
4
|
/**
|
|
4
5
|
* The pouch's mouth for a skeleton with its pelvis at `at` turned by `q`, and its axes: out of the
|
|
5
6
|
* hip, forward, and down into it.
|
|
6
7
|
*/
|
|
7
8
|
export declare const pouchAt: (at: Vec3, q: Quat) => [Vec3, Vec3[]];
|
|
8
9
|
/** Appends the pouch, and the spare's top 8 mm out of it, for the pelvis at `at` turned by `q`. */
|
|
9
|
-
export declare const pouch: (out:
|
|
10
|
+
export declare const pouch: (out: Out, at: Vec3, q: Quat) => void;
|
|
10
11
|
/**
|
|
11
12
|
* The left hand fetching a new battery from the pouch at `s` of a swap (the user, 2026-11-09): from
|
|
12
13
|
* `start` down over the pouch, into it, then up with the battery along an arc to `seat`, where the
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Vec3 } from './mesh';
|
|
2
|
+
import type { Out } from './verts';
|
|
2
3
|
/**
|
|
3
4
|
* The packs of `all` whose bit is set in `mask`, if any: the ones that are there to take. The bits
|
|
4
5
|
* count from `from`: the ammo packs come after the health packs.
|
|
@@ -9,12 +10,14 @@ export declare const packsOf: (all?: readonly Vec3[], mask?: number, from?: numb
|
|
|
9
10
|
* the weapon, and the weapon over it: the gun, or by `kind` the katana (1), crackling, the rail
|
|
10
11
|
* gun (2) or the laser rifle (3).
|
|
11
12
|
*/
|
|
12
|
-
export declare const rack: (out:
|
|
13
|
+
export declare const rack: (out: Out, at: Vec3, rgb: number[], t: number, kind?: number) => void;
|
|
13
14
|
/** Each team's gun rack, katana rack, rail gun rack and laser rifle rack, where it has them. */
|
|
14
|
-
export declare const racks: (out:
|
|
15
|
+
export declare const racks: (out: Out, guns?: readonly (Vec3 | undefined)[], blades?: readonly (Vec3 | undefined)[], t?: number, rails?: readonly (Vec3 | undefined)[], rifles?: readonly (Vec3 | undefined)[]) => void;
|
|
15
16
|
/** A health pack at `at`: a white box with a glowing green cross on each side. */
|
|
16
|
-
export declare const kit: (out:
|
|
17
|
+
export declare const kit: (out: Out, at: Vec3, t: number) => void;
|
|
17
18
|
/** An ammo pack at `at`: a violet box with a glowing cyan cartridge on each side, the gun's colours. */
|
|
18
|
-
export declare const cell: (out:
|
|
19
|
+
export declare const cell: (out: Out, at: Vec3, t: number) => void;
|
|
19
20
|
/** A rail cell at `at`: a gunmetal box with a glowing violet-white bolt on each side, the rail gun's colours. */
|
|
20
|
-
export declare const battery: (out:
|
|
21
|
+
export declare const battery: (out: Out, at: Vec3, t: number) => void;
|
|
22
|
+
/** An armour at `at`: a bigger steel box with a glowing gold shield on each side. */
|
|
23
|
+
export declare const vest: (out: Out, at: Vec3, t: number) => void;
|
|
@@ -6,6 +6,7 @@ import type { Effects } from './effects';
|
|
|
6
6
|
import type { CtfScene } from './flag';
|
|
7
7
|
import type { Light } from './lights';
|
|
8
8
|
import type { Vec3 } from './mesh';
|
|
9
|
+
import type { Out } from './verts';
|
|
9
10
|
/** Tints a world can use at once, white included (see palette). */
|
|
10
11
|
export declare const MAX_TINTS = 16;
|
|
11
12
|
/** Shadow map side in texels. */
|
|
@@ -134,7 +135,7 @@ export interface Renderer {
|
|
|
134
135
|
/** The own player when the camera is not in his head (seated in a rover): drawn whole, like the others. */
|
|
135
136
|
self?: PlayerState,
|
|
136
137
|
/** Adds what else moves in the map (the doors): drawn lit, casting shadows, with the other players. */
|
|
137
|
-
more?: (v:
|
|
138
|
+
more?: (v: Out) => void): void;
|
|
138
139
|
/** A world point on screen as of the last frame, in [0, 1] from the top left. */
|
|
139
140
|
project(x: number, y: number, z: number): [number, number] | undefined;
|
|
140
141
|
/** The footsteps of the player `id`'s runner so far (Gait.steps), undefined before it is drawn. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Rover } from '../shared/types';
|
|
2
2
|
import type { World } from '../shared/world';
|
|
3
3
|
import type { Vec3 } from './mesh';
|
|
4
|
+
import type { Out } from './verts';
|
|
4
5
|
/** A point of the body's frame: metres right, up and ahead of the centre. */
|
|
5
6
|
export declare const P: (x: number, y: number, a: number) => Vec3;
|
|
6
7
|
/** A flat polygon of three or four corners facing `to`; a fourth number of the colour is its layer. */
|
|
@@ -11,7 +12,7 @@ export declare const loft: (o: number[], a: Vec3[], b: Vec3[], cols: number[][],
|
|
|
11
12
|
export declare const LINK: number[];
|
|
12
13
|
export declare const TUBE: number[];
|
|
13
14
|
/** A tube from a to b, r thick. */
|
|
14
|
-
export declare const rod: (o:
|
|
15
|
+
export declare const rod: (o: Out, tube: number[], a: Vec3, b: Vec3, r: number, rgb: number[]) => void;
|
|
15
16
|
/**
|
|
16
17
|
* How far each wheel's spring is squeezed, metres in 0..CMAX, in AT's order: the simulation's own
|
|
17
18
|
* (wheels() in shared/rover.ts), from the state and the world alone. 0 is a wheel hanging in the air.
|
|
@@ -45,4 +46,4 @@ export declare const contacts: (r: Rover, w: World) => Vec3[];
|
|
|
45
46
|
* Its damage shows (wreck.ts, `n` its index among the map's vehicles): scorched where it arcs; a
|
|
46
47
|
* wreck sagged on splayed wheels, charred, falling apart at the end.
|
|
47
48
|
*/
|
|
48
|
-
export declare const rover: (out:
|
|
49
|
+
export declare const rover: (out: Out, state: Rover, w: World, spin: number, rgb: number[], lod: number, n?: number) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Choice } from '../shared/types';
|
|
2
2
|
import type { Quat } from './rig';
|
|
3
3
|
import type { Vec3 } from './mesh';
|
|
4
|
+
import type { Out } from './verts';
|
|
4
5
|
/** The regions a runner's outfit is recoloured or covered by: the skin, the trousers, the boots, the gloves, the stripes and the belt. */
|
|
5
6
|
export declare const REGION: {
|
|
6
7
|
FLESH: number;
|
|
@@ -106,7 +107,7 @@ export declare const bindOf: (build?: number) => Vec3[];
|
|
|
106
107
|
* carry it, their dual quaternions mixed by the weights (so a bent joint keeps its thickness), its
|
|
107
108
|
* normal turned the same way.
|
|
108
109
|
*/
|
|
109
|
-
export declare const skin: (out:
|
|
110
|
+
export declare const skin: (out: Out, s: Skin, { pos, rot }: {
|
|
110
111
|
pos: Vec3[];
|
|
111
112
|
rot: Quat[];
|
|
112
113
|
}, colors: number[][], face?: ArrayLike<number>) => void;
|
|
@@ -7,6 +7,7 @@ import type { Vec3 } from './mesh';
|
|
|
7
7
|
import type { Pose } from './rig';
|
|
8
8
|
import type { Face } from './expression';
|
|
9
9
|
import type { Trail } from './trail';
|
|
10
|
+
import type { Out } from './verts';
|
|
10
11
|
/** What a runner keeps between frames. */
|
|
11
12
|
export interface Runner {
|
|
12
13
|
/** The player as last seen. */
|
|
@@ -116,7 +117,7 @@ export declare const fried: (p: PlayerState) => number;
|
|
|
116
117
|
* at once, each drifts up and out on its own, and goes when `k` passes its own share, so the body
|
|
117
118
|
* thins to nothing.
|
|
118
119
|
*/
|
|
119
|
-
export declare const dissolve: (out:
|
|
120
|
+
export declare const dissolve: (out: Out, from: number, k: number) => void;
|
|
120
121
|
/**
|
|
121
122
|
* Appends a runner at level of detail `lod` (see body(): 0 far, 1 near, 3 close; its weapon is near
|
|
122
123
|
* when the runner is close): the jacket in `color` (r, g, b), dark
|
|
@@ -141,7 +142,7 @@ export declare const stance: (r: Runner) => {
|
|
|
141
142
|
carry: [Vec3, Vec3[]] | undefined;
|
|
142
143
|
};
|
|
143
144
|
/** Draws the runner and gives back its solved skeleton, or nothing once a bolt has burnt it away. */
|
|
144
|
-
export declare const soldier: (out:
|
|
145
|
+
export declare const soldier: (out: Out, r: Runner, color: number[], lod?: number, helmets?: boolean, armored?: boolean) => {
|
|
145
146
|
pos: Vec3[];
|
|
146
147
|
rot: import("./rig").Quat[];
|
|
147
148
|
} | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { WorldDef } from '../shared/world';
|
|
2
2
|
import type { Vec3 } from './mesh';
|
|
3
|
+
import type { Out } from './verts';
|
|
3
4
|
/** Cars on the roads round the play area, and on the rest of the grid out to MARKS, fewer to the kilometre. */
|
|
4
5
|
export declare const CARS = 64;
|
|
5
6
|
export declare const FAR_CARS = 160;
|
|
@@ -42,4 +43,4 @@ export declare const MODEL: {
|
|
|
42
43
|
* The drawer of a world's traffic: appends the cars in view (in front of the camera, within FAR) at
|
|
43
44
|
* time t, each BODY + CABIN + LAMPS vertices, the cabin only up to NEAR_CAR and the lamps up to LIT.
|
|
44
45
|
*/
|
|
45
|
-
export declare const traffic: (def: WorldDef) => (out:
|
|
46
|
+
export declare const traffic: (def: WorldDef) => (out: Out, eye: Vec3, fwd: Vec3, t: number) => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Vec3 } from './mesh';
|
|
2
|
+
import type { Out } from './verts';
|
|
2
3
|
/** Seconds a sample of the trail lasts. */
|
|
3
4
|
export declare const LIFE = 0.15;
|
|
4
5
|
export interface Trail {
|
|
@@ -7,7 +8,7 @@ export interface Trail {
|
|
|
7
8
|
/** Ages the samples by dt seconds and drops the ones that are over. */
|
|
8
9
|
update(dt: number): void;
|
|
9
10
|
/** Appends the ribbon, in the vertex format of mesh.ts. */
|
|
10
|
-
draw(out:
|
|
11
|
+
draw(out: Out): void;
|
|
11
12
|
/** The samples alive now. */
|
|
12
13
|
readonly count: number;
|
|
13
14
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Where the vertices go: a plain array (the tests, the meshes built once) or the frame's Verts. */
|
|
2
|
+
export type Out = number[] | Verts;
|
|
3
|
+
/** Numbers written and read by index: a plain array or a Verts' store. */
|
|
4
|
+
export interface Floats {
|
|
5
|
+
[i: number]: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The frame's vertices in a store that only grows. Doubles, as a plain array holds them: what is
|
|
9
|
+
* read back (the armour off the skin) comes out the same, and the upload rounds them to floats.
|
|
10
|
+
*/
|
|
11
|
+
export declare class Verts {
|
|
12
|
+
a: Float64Array<ArrayBuffer>;
|
|
13
|
+
/** The numbers written: the next goes there. Set it lower to drop the last ones. */
|
|
14
|
+
length: number;
|
|
15
|
+
/** Makes room for `n` numbers more and returns the store to write them in. */
|
|
16
|
+
room(n: number): Float64Array;
|
|
17
|
+
push(...v: number[]): void;
|
|
18
|
+
/** The numbers from `from` to `to` (at most the length), as an array. */
|
|
19
|
+
slice(from: number, to: number): number[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Makes room in `out` for `n` numbers more and returns where to write them by index, from
|
|
23
|
+
* `out.length` on. Set `out.length` to the end of what was written afterwards: a Verts does not
|
|
24
|
+
* count by itself (a plain array does, and the assignment is then a no-op).
|
|
25
|
+
*/
|
|
26
|
+
export declare const room: (out: Out, n: number) => Floats;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Brush, WorldDef } from '../shared/world';
|
|
2
2
|
import type { Vec3 } from './mesh';
|
|
3
|
+
import type { Out } from './verts';
|
|
3
4
|
/** A side of a brush: its axis (0 x, 2 z) and 1 for its max, 0 for its min. */
|
|
4
5
|
export type Side = [axis: number, up: number];
|
|
5
6
|
export interface Use {
|
|
@@ -13,7 +14,7 @@ export interface Use {
|
|
|
13
14
|
/** What a runner can use on brush `b` of the world `def`. */
|
|
14
15
|
export declare const uses: ({ brushes, floor }: WorldDef, b: Brush) => Use;
|
|
15
16
|
/** One face of the box min..max (flat on `axis` when min and max agree there) as two triangles, pushed in the map's vertex format. */
|
|
16
|
-
export declare const face: (out:
|
|
17
|
+
export declare const face: (out: Out, min: Vec3, max: Vec3, axis: number, up: number, layer: number, rgb: number[]) => void;
|
|
17
18
|
/** The red of every use in the world, in the map's vertex format (layer -2 glows, -1 is lit). Not on ghosts: nothing shows them. */
|
|
18
19
|
export declare const vision: (def: WorldDef) => number[];
|
|
19
20
|
/** A square on each team's roof around its base, lit paint of the team's colour: pale inside, a strong frame. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Rover } from '../shared/types';
|
|
2
2
|
import type { World } from '../shared/world';
|
|
3
3
|
import type { Vec3 } from './mesh';
|
|
4
|
+
import type { Out } from './verts';
|
|
4
5
|
/**
|
|
5
6
|
* Where a hull arcs, right of the vehicle's centre, above it and ahead of it, each on the model: a
|
|
6
7
|
* rover's (the four wheels' arms, the nose, the rear deck, the two lasers, the dashboard, the roll
|
|
@@ -29,7 +30,7 @@ export declare const sparking: (r: Rover, k: number, slot: number) => [Vec3, Vec
|
|
|
29
30
|
* last VEHICLE.FADE ticks it falls apart into embers. One just parked afresh (`wreck` below 0)
|
|
30
31
|
* shimmers in.
|
|
31
32
|
*/
|
|
32
|
-
export declare const char: (out:
|
|
33
|
+
export declare const char: (out: Out, from: number, r: Rover, k?: number) => void;
|
|
33
34
|
/** What plays a vehicle's damage: the tracer's bolts, fireballs and sparks, the sounds, the camera's shake. */
|
|
34
35
|
export interface Stage {
|
|
35
36
|
tracer: {
|
|
@@ -54,7 +55,7 @@ export interface Wrecks {
|
|
|
54
55
|
*/
|
|
55
56
|
frame(rovers: Rover[], dt: number, eye?: Vec3): Rover[];
|
|
56
57
|
/** Appends the debris and the smoke. */
|
|
57
|
-
draw(out:
|
|
58
|
+
draw(out: Out): void;
|
|
58
59
|
/** Debris and puffs in flight. */
|
|
59
60
|
readonly count: number;
|
|
60
61
|
}
|
|
@@ -166,8 +166,15 @@ export declare const FLAG_REACH = 1.5;
|
|
|
166
166
|
export declare const FLAG_H = 2.2;
|
|
167
167
|
/** Seconds a dropped flag lies before it goes home by itself. */
|
|
168
168
|
export declare const FLAG_RETURN = 10;
|
|
169
|
-
/** Health of a player; a hit takes 1, so HP_MAX hits put him down. */
|
|
170
|
-
export declare const HP_MAX =
|
|
169
|
+
/** Health of a player; a hit takes 1, so HP_MAX hits put him down (8 since the user, 2026-11-14: 5 before). */
|
|
170
|
+
export declare const HP_MAX = 8;
|
|
171
|
+
/**
|
|
172
|
+
* Armour (the user, 2026-11-14): points on top of the health, spent first, 1 per point of damage.
|
|
173
|
+
* An armour pickup (WorldDef.armor) fills it to ARMOR_MAX for a player short of it, then it is
|
|
174
|
+
* gone ARMOR_BACK s. Going down loses it; a spawn starts without.
|
|
175
|
+
*/
|
|
176
|
+
export declare const ARMOR_MAX = 3;
|
|
177
|
+
export declare const ARMOR_BACK = 10;
|
|
171
178
|
/**
|
|
172
179
|
* Fall damage (the user, 2026-11-13): a landing faster than FALL_SAFE m/s (a 10 m drop at full
|
|
173
180
|
* gravity; Highline's routes land at 18.4 at most) takes 1 hp, and 1 more each FALL_HP m/s past it.
|
|
@@ -264,7 +271,7 @@ export declare const PACK_BACK = 20;
|
|
|
264
271
|
/** Shots an ammo pack gives, up to AMMO_MAX, and seconds before a taken one is back. */
|
|
265
272
|
export declare const AMMO_PACK = 20;
|
|
266
273
|
export declare const AMMO_BACK = 10;
|
|
267
|
-
/** Health packs, ammo packs
|
|
274
|
+
/** Health packs, ammo packs, rail cells and armours a map has at most: the bits of Snapshot.packs. */
|
|
268
275
|
export declare const PACK_BITS = 48;
|
|
269
276
|
/** Metres from a pack or a rack, feet to point on the floor plane, that take it. */
|
|
270
277
|
export declare const PACK_R = 0.9;
|
|
@@ -39,7 +39,7 @@ export declare class Room {
|
|
|
39
39
|
constructor(rules?: Partial<Rules>, def?: WorldDef);
|
|
40
40
|
/** Every vehicle of the map parked afresh: whole, empty, on its spawn. */
|
|
41
41
|
private fresh;
|
|
42
|
-
/** The health, ammo and cell packs of the map, all there (0 ticks before each is back). */
|
|
42
|
+
/** The health, ammo and cell packs and the armours of the map, all there (0 ticks before each is back). */
|
|
43
43
|
private spots;
|
|
44
44
|
/** The host: the player in the room the longest. */
|
|
45
45
|
private host;
|
|
@@ -107,10 +107,10 @@ export declare class Room {
|
|
|
107
107
|
*/
|
|
108
108
|
private shot;
|
|
109
109
|
/**
|
|
110
|
-
* `hp` of damage to `foe
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* is how he falls (felled()).
|
|
110
|
+
* `hp` of damage to `foe`, his armour taking it first (Infinity goes through it); the last one
|
|
111
|
+
* puts him down: he lies where he fell, without the gun, the katana or armour, a flag he carries
|
|
112
|
+
* drops with the lock, and `lost` is NONE (a cut sets it after). True when he went down: an enemy
|
|
113
|
+
* `by` scores a frag made `how` (FRAG), told to everyone. `fell` is how he falls (felled()).
|
|
114
114
|
*/
|
|
115
115
|
private harm;
|
|
116
116
|
/**
|
|
@@ -163,10 +163,11 @@ export declare class Room {
|
|
|
163
163
|
*/
|
|
164
164
|
private duel;
|
|
165
165
|
/**
|
|
166
|
-
* The packs, health ones first, then the ammo ones, then the rail cells
|
|
167
|
-
* back after PACK_BACK s, an ammo pack after AMMO_BACK s
|
|
166
|
+
* The packs, health ones first, then the ammo ones, then the rail cells, then the armours: one
|
|
167
|
+
* that is gone comes back after PACK_BACK s, an ammo pack after AMMO_BACK s, an armour after
|
|
168
|
+
* ARMOR_BACK s. A health pack goes to a hurt player standing at it, an ammo pack to one
|
|
168
169
|
* with the gun short of AMMO_MAX or the laser rifle short of RIFLE_MAX (RIFLE_CLIP more rounds), a rail cell to one with the rail gun and less than
|
|
169
|
-
* RAIL_MAX of lightning.
|
|
170
|
+
* RAIL_MAX of lightning, an armour to one short of ARMOR_MAX. All change the state between two inputs, like a hit: the snapshot
|
|
170
171
|
* carries the result and the predictor replays its unacked inputs on it.
|
|
171
172
|
*/
|
|
172
173
|
private heal;
|
|
@@ -222,6 +222,8 @@ export interface PlayerState {
|
|
|
222
222
|
held: number;
|
|
223
223
|
/** Health, 0 to HP_MAX. */
|
|
224
224
|
hp: number;
|
|
225
|
+
/** Armour, 0 to ARMOR_MAX, spent before the health; the host's alone, like hp. Absent: none. */
|
|
226
|
+
armor?: number;
|
|
225
227
|
/** Shots left in the gun; -1 without the gun (taken at the team's rack, lost on death). */
|
|
226
228
|
ammo: number;
|
|
227
229
|
/** Ticks to the next shot. */
|
|
@@ -421,8 +423,8 @@ export interface Snapshot {
|
|
|
421
423
|
flags: [FlagState, FlagState];
|
|
422
424
|
/**
|
|
423
425
|
* Bit n set: pack n is there to take, the health packs of WorldDef.packs first, then the ammo
|
|
424
|
-
* packs of WorldDef.ammo (bit packs.length + n), then the rail cells of WorldDef.cells
|
|
425
|
-
*
|
|
426
|
+
* packs of WorldDef.ammo (bit packs.length + n), then the rail cells of WorldDef.cells, then the
|
|
427
|
+
* armours of WorldDef.vests. PACK_BITS bits, past the 32 of the bitwise operators: read a bit with arithmetic.
|
|
426
428
|
* Absent: none.
|
|
427
429
|
*/
|
|
428
430
|
packs?: number;
|
|
@@ -52,6 +52,8 @@ export interface WorldDef {
|
|
|
52
52
|
ammo?: Vec3[];
|
|
53
53
|
/** Rail cells, points on tops (with the health and ammo packs at most PACK_BITS): within PACK_R a player with the rail gun and less than RAIL_MAX of lightning takes RAIL_CELL, then it is gone PACK_BACK seconds. */
|
|
54
54
|
cells?: Vec3[];
|
|
55
|
+
/** Armours, points on tops (with the packs and the cells at most PACK_BITS): within PACK_R a player short of ARMOR_MAX is filled to it, then it is gone ARMOR_BACK seconds. */
|
|
56
|
+
vests?: Vec3[];
|
|
55
57
|
/** Unit direction toward the sun, and its colour (linear RGB, may exceed 1). */
|
|
56
58
|
sun: {
|
|
57
59
|
dir: Vec3;
|
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.
|
|
5
|
+
"version": "0.146.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|