@korial29/tiny-fps 0.131.0 → 0.132.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 +13 -13
- package/dist/local.js +1 -1
- package/dist/server.js +45 -18
- package/dist/types/client/armor.d.ts +14 -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
|
@@ -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.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|