@korial29/tiny-fps 0.131.0 → 0.132.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/index.js +13 -13
- package/dist/local.js +1 -1
- package/dist/server.js +45 -18
- package/dist/types/client/armor.d.ts +30 -3
- package/dist/types/client/hud.d.ts +2 -0
- package/dist/types/client/pads.d.ts +25 -0
- package/dist/types/shared/gun.d.ts +1 -1
- package/dist/types/shared/kit.d.ts +8 -0
- package/dist/types/shared/room.d.ts +6 -1
- package/package.json +1 -1
|
@@ -25,9 +25,10 @@ interface Region {
|
|
|
25
25
|
round?: [number, number, number];
|
|
26
26
|
/** Moulded: a smooth shell round the trunk rather than the skin's facets (moulding()). */
|
|
27
27
|
mould?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
ninja?: boolean;
|
|
28
|
+
/** The ninja's own armour (the user, 2026-11-13), worn by him alone; he wears no other plate. */
|
|
30
29
|
alone?: boolean;
|
|
30
|
+
/** How far it stands off the skin, when not OFF. */
|
|
31
|
+
off?: number;
|
|
31
32
|
}
|
|
32
33
|
/**
|
|
33
34
|
* The chest plate's pecs (the user, 2026-11-10: fuller toward the bottom, then the round part too
|
|
@@ -95,6 +96,30 @@ export declare const BAND: {
|
|
|
95
96
|
};
|
|
96
97
|
/** The gap the user asked between the chest plate and the belly's plates, and between those. */
|
|
97
98
|
export declare const GAP = 0.02;
|
|
99
|
+
/**
|
|
100
|
+
* The ninja's vest: the bottom of its chest piece at the sides, how far its chevron dips at the
|
|
101
|
+
* middle (and the lames' under it), the bottom of the V at its neck and its top beside it on the woman, the lames' height and the gap
|
|
102
|
+
* between two pieces.
|
|
103
|
+
*/
|
|
104
|
+
export declare const VEST: {
|
|
105
|
+
y: number;
|
|
106
|
+
dip: number;
|
|
107
|
+
neck: number;
|
|
108
|
+
top: number;
|
|
109
|
+
lame: number;
|
|
110
|
+
gap: number;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* The vest's armholes (the user, 2026-11-13: a crack in the chest piece by the armpit): over the
|
|
114
|
+
* trunk's split (1.41 m) the skin is the shoulder's and goes with the arm, away from the piece under
|
|
115
|
+
* it. Its top falls to `y`, under the split, between the angles `a`, where the shoulder's skin starts.
|
|
116
|
+
*/
|
|
117
|
+
export declare const ARMHOLE: {
|
|
118
|
+
a: number[];
|
|
119
|
+
y: number;
|
|
120
|
+
};
|
|
121
|
+
/** How far the ninja's bracers stand off the forearm: half a plate's thickness. */
|
|
122
|
+
export declare const BRACER = 0.006;
|
|
98
123
|
export declare const REGIONS: Region[];
|
|
99
124
|
/** A corner being clipped: its place at rest, its weights of its skin triangle's corners, its normal at rest, then the limits it lies on (BITS). */
|
|
100
125
|
type Corner = number[];
|
|
@@ -111,11 +136,13 @@ export declare const DOME: {
|
|
|
111
136
|
r: number;
|
|
112
137
|
h: number;
|
|
113
138
|
};
|
|
139
|
+
/** The ninja's vest has them a little smaller (the user, 2026-11-13): this much of their height. */
|
|
140
|
+
export declare const SLIM = 0.8;
|
|
114
141
|
/**
|
|
115
142
|
* Appends the armour cut out of the skin `s` drawn into `out` from the float `from` on (skin()
|
|
116
143
|
* writes three vertices per triangle of s.t, in order). Not `fine` (a runner not close by), curved
|
|
117
144
|
* outlines follow the skin's own triangles, unrefined, and there are no scratches. `plate` is the
|
|
118
|
-
* plates' colour (their walls a shade darker): white when absent.
|
|
145
|
+
* plates' colour (their walls a shade darker): white when absent. The `ninja` wears his own armour.
|
|
119
146
|
*/
|
|
120
147
|
export declare const armor: (out: number[], from: number, s: Skin, fine?: boolean, plate?: number[], ninja?: boolean) => void;
|
|
121
148
|
export {};
|
|
@@ -61,6 +61,8 @@ export interface Hud {
|
|
|
61
61
|
}) => void): HTMLCanvasElement;
|
|
62
62
|
/** The pictures of the haircuts on offer, in their order (HEAD_PX square): the own head with each. */
|
|
63
63
|
heads(): HTMLCanvasElement[];
|
|
64
|
+
/** The own player's magazines, as his class holds them (Kit's mag, cap, clip): the spare ones counted by them. */
|
|
65
|
+
magazines(sizes: number[]): void;
|
|
64
66
|
/** Shows or hides the muted mark. */
|
|
65
67
|
mute(on: boolean): void;
|
|
66
68
|
/**
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Vec3 } from './mesh';
|
|
2
|
+
import type { Quat } from './rig';
|
|
3
|
+
/**
|
|
4
|
+
* A lame, from the arm's joint at rest (metres, +x out): where it starts and ends across, its half
|
|
5
|
+
* width fore and aft, and its height at its start.
|
|
6
|
+
*/
|
|
7
|
+
export declare const LAMES: number[][];
|
|
8
|
+
/**
|
|
9
|
+
* His collar, standing round the back of the neck and open in front: how far round from the back it
|
|
10
|
+
* goes each side (rad), its radius at its foot and how much wider at its top, its foot under the
|
|
11
|
+
* neck's joint, and its height at the back and at its ends.
|
|
12
|
+
*/
|
|
13
|
+
export declare const COLLAR: {
|
|
14
|
+
a: number;
|
|
15
|
+
r: number;
|
|
16
|
+
flare: number;
|
|
17
|
+
foot: number;
|
|
18
|
+
back: number;
|
|
19
|
+
end: number;
|
|
20
|
+
};
|
|
21
|
+
/** Appends the ninja's shoulder pads and his collar on the solved pose `s`, in the team's `color`; smaller on the woman (`build`). */
|
|
22
|
+
export declare const pads: (out: number[], s: {
|
|
23
|
+
pos: Vec3[];
|
|
24
|
+
rot: Quat[];
|
|
25
|
+
}, build?: number, color?: number[]) => void;
|
|
@@ -28,7 +28,7 @@ export type Strike = (typeof STRIKE)[keyof typeof STRIKE];
|
|
|
28
28
|
* stays in hand for the length of a swing. `wield` is the katana in hand, `railed` the rail gun.
|
|
29
29
|
* - The gun fires from its battery (`mag`), the rail gun from its capsule (`cap`). An empty one, or
|
|
30
30
|
* KEY.RELOAD with room in it, swaps it for a full one from what he carries: `reload` ticks
|
|
31
|
-
* without firing, then it holds
|
|
31
|
+
* without firing, then it holds the kit's `mag` (`cap`, `clip`) or what is left. A switch of weapon drops it.
|
|
32
32
|
* The racks fill both.
|
|
33
33
|
* - The rail gun throws its bolt on every step FIRE is held, spending a tick of it (`zapping`),
|
|
34
34
|
* unless it is `hot`: its `heat` rises while it fires and falls when it does not (HEAT_MAX).
|
|
@@ -22,6 +22,14 @@ export interface Kit {
|
|
|
22
22
|
/** Ticks between two shots of the gun and of the rifle. */
|
|
23
23
|
cool: number;
|
|
24
24
|
rifleCool: number;
|
|
25
|
+
/** What the gun's battery, the rail gun's capsule and the rifle's cell hold. */
|
|
26
|
+
mag: number;
|
|
27
|
+
cap: number;
|
|
28
|
+
clip: number;
|
|
29
|
+
/** What a hit of his guns takes, of their damage (the host's: room.ts). */
|
|
30
|
+
damage: number;
|
|
31
|
+
/** His running speeds with a gun in hand, of his own. */
|
|
32
|
+
slow: number;
|
|
25
33
|
}
|
|
26
34
|
/** By ROLE. The astronaut moves and fights as the marine: the moon's gravity is the map's. */
|
|
27
35
|
export declare const KITS: readonly Kit[];
|
|
@@ -96,6 +96,11 @@ export declare class Room {
|
|
|
96
96
|
* lies down now or did then.
|
|
97
97
|
*/
|
|
98
98
|
private enemies;
|
|
99
|
+
/**
|
|
100
|
+
* `hp` of a gun's damage to `foe` from `by`: as his class deals it (Kit.damage, a ninja's half), the
|
|
101
|
+
* half points kept on `foe` toward the next. True when he went down.
|
|
102
|
+
*/
|
|
103
|
+
private shot;
|
|
99
104
|
/**
|
|
100
105
|
* `hp` of damage to `foe`; the last one puts him down: he lies where he fell, without the gun or
|
|
101
106
|
* the katana, a flag he carries drops with the lock, and `lost` is NONE (a cut sets it after).
|
|
@@ -141,7 +146,7 @@ export declare class Room {
|
|
|
141
146
|
* and counts a hit. An enemy vehicle's hull is drained the same way, and shields who is behind it.
|
|
142
147
|
*/
|
|
143
148
|
private rail;
|
|
144
|
-
/** 1 hp of the bolt's drain to `foe
|
|
149
|
+
/** 1 hp of the bolt's drain to `foe`, as his railer deals it; if it puts him down he is disintegrated (`fried`). */
|
|
145
150
|
private fry;
|
|
146
151
|
/**
|
|
147
152
|
* A saber lock of `p`, after his input: it ends when a side leads by LOCK_WIN presses (the other
|
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.132.1",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|