@korial29/tiny-fps 0.160.0 → 0.161.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 +33 -30
- package/dist/local.js +1 -1
- package/dist/server.js +302 -28
- package/dist/types/client/announce.d.ts +1 -1
- package/dist/types/client/body.d.ts +1 -1
- package/dist/types/client/features.d.ts +2 -0
- package/dist/types/client/hud.d.ts +2 -0
- package/dist/types/client/input.d.ts +2 -0
- package/dist/types/client/render.d.ts +2 -0
- package/dist/types/shared/constants.d.ts +25 -0
- package/dist/types/shared/kit.d.ts +14 -1
- package/dist/types/shared/protocol.d.ts +2 -0
- package/dist/types/shared/room.d.ts +13 -0
- package/dist/types/shared/tackle.d.ts +5 -0
- package/dist/types/shared/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ export declare const ROLE: {
|
|
|
3
3
|
readonly MARINE: 0;
|
|
4
4
|
readonly NINJA: 1;
|
|
5
5
|
readonly ASTRONAUT: 2;
|
|
6
|
+
readonly XENO: 3;
|
|
6
7
|
};
|
|
7
8
|
export interface Kit {
|
|
8
9
|
run: number;
|
|
@@ -30,12 +31,24 @@ export interface Kit {
|
|
|
30
31
|
damage: number;
|
|
31
32
|
/** His running speeds with a gun in hand, of his own. */
|
|
32
33
|
slow: number;
|
|
34
|
+
/** Health at a spawn, and what the packs heal up to. */
|
|
35
|
+
hp: number;
|
|
36
|
+
/** Whether the racks give him their weapons and he wears the armour pickups. */
|
|
37
|
+
gear: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The xenomorph's body: claws and a tail for weapons (PUNCHES from BLOW.CLAW_L), clinging to the
|
|
40
|
+
* walls (MODE.CLING), the dash a pounce charged on DASH held, acid for blood (room.ts).
|
|
41
|
+
*/
|
|
42
|
+
xeno: boolean;
|
|
33
43
|
}
|
|
34
44
|
/** By ROLE. The astronaut moves and fights as the marine: the moon's gravity is the map's. */
|
|
35
45
|
export declare const KITS: readonly Kit[];
|
|
36
46
|
/** Ticks after a dash's start before the next of a chain: the burst and a breath. */
|
|
37
47
|
export declare const DASH_GAP = 16;
|
|
38
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* The classes a map offers, the first one the default: on a map with space helmets the astronaut
|
|
50
|
+
* and the xenomorph, who breathes none.
|
|
51
|
+
*/
|
|
39
52
|
export declare const rolesOf: (def: Pick<WorldDef, "helmets">) => number[];
|
|
40
53
|
/** The class a player plays on the map: his `role` when the map offers it, else the map's default. */
|
|
41
54
|
export declare const roleOf: (role: number | undefined, def: Pick<WorldDef, "helmets">) => number;
|
|
@@ -25,6 +25,7 @@ export interface Result {
|
|
|
25
25
|
frags: number;
|
|
26
26
|
}
|
|
27
27
|
/** What put a player down, in a frag message. */
|
|
28
|
+
/** CLAW is all the xenomorph's: claws, tail, pounce, and its acid. */
|
|
28
29
|
export declare const FRAG: {
|
|
29
30
|
readonly GUN: 0;
|
|
30
31
|
readonly BLADE: 1;
|
|
@@ -32,6 +33,7 @@ export declare const FRAG: {
|
|
|
32
33
|
readonly RAIL: 3;
|
|
33
34
|
readonly NADE: 4;
|
|
34
35
|
readonly VEHICLE: 5;
|
|
36
|
+
readonly CLAW: 6;
|
|
35
37
|
};
|
|
36
38
|
export type ServerText =
|
|
37
39
|
/**
|
|
@@ -103,6 +103,19 @@ export declare class Room {
|
|
|
103
103
|
* tackler goes. Once per TACKLE_COOLDOWN ticks, for the first carrier hit.
|
|
104
104
|
*/
|
|
105
105
|
private tackle;
|
|
106
|
+
/**
|
|
107
|
+
* A xenomorph's pounce `p` meets an enemy who is up, where `p` drew him: he is pinned, POUNCE_HP
|
|
108
|
+
* of health, his flag dropped and a stumble of POUNCE_STUN thrown the way it leapt. The pounce
|
|
109
|
+
* ends on him: it stops, its dash timer past the strike.
|
|
110
|
+
*/
|
|
111
|
+
private pin;
|
|
112
|
+
/** The class `p` plays on this map (kit.ts). */
|
|
113
|
+
private kit;
|
|
114
|
+
/**
|
|
115
|
+
* An enemy's katana or fists struck the xenomorph `foe`: its acid takes ACID_HP from `by`, unless
|
|
116
|
+
* he is one too or already down.
|
|
117
|
+
*/
|
|
118
|
+
private acid;
|
|
106
119
|
/**
|
|
107
120
|
* The enemies of `p` as `p` drew them at the view tick `view` (lag compensation), without one who
|
|
108
121
|
* lies down now or did then.
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { PlayerState } from './types';
|
|
2
2
|
/** Whether the player's body is a weapon: in a slide, or in the burst of a dash. */
|
|
3
3
|
export declare const tackling: (p: PlayerState) => boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Whether a xenomorph is in the strike of its pounce: in the air, the first POUNCE_FLY ticks of the
|
|
6
|
+
* dash timer it leapt with (POUNCE_COOL). Only for a xenomorph: another's dash runs through it too.
|
|
7
|
+
*/
|
|
8
|
+
export declare const pouncing: (p: PlayerState) => boolean;
|
|
4
9
|
/**
|
|
5
10
|
* Whether the cylinders of `a` and `b` overlap, with TACKLE_REACH of reach on top: closer than
|
|
6
11
|
* two radii and the reach on the floor plane, and their heights (low in a slide) overlap.
|
|
@@ -135,6 +135,8 @@ export declare const MODE: {
|
|
|
135
135
|
readonly CROUCH: 6;
|
|
136
136
|
/** Seated in a rover (rover.ts): the body follows the seat, move() leaves it there. */
|
|
137
137
|
readonly RIDE: 7;
|
|
138
|
+
/** The xenomorph on a wall (`wall` the side): it climbs, goes down and along it with no gravity. */
|
|
139
|
+
readonly CLING: 8;
|
|
138
140
|
};
|
|
139
141
|
/**
|
|
140
142
|
* Which side of the player a wall or a ledge is on (PlayerState.wall). In the air it is the side
|
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.161.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|