@korial29/tiny-fps 0.203.0 → 0.204.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 +5 -5
- package/dist/local.js +1 -1
- package/dist/server.js +20 -3
- package/dist/types/client/gait.d.ts +1 -1
- package/dist/types/client/hud.d.ts +4 -2
- package/dist/types/client/hunter.d.ts +3 -0
- package/dist/types/client/input.d.ts +2 -0
- package/dist/types/shared/constants.d.ts +1 -1
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -833,7 +833,9 @@ var KITS = [
|
|
|
833
833
|
{
|
|
834
834
|
...MARINE,
|
|
835
835
|
katana: true,
|
|
836
|
-
hunter: true
|
|
836
|
+
hunter: true,
|
|
837
|
+
ammo: 12,
|
|
838
|
+
mag: 1
|
|
837
839
|
}
|
|
838
840
|
];
|
|
839
841
|
/**
|
|
@@ -1086,6 +1088,10 @@ var spawn = (id, w, n, team = 0, kit = KITS[0]) => {
|
|
|
1086
1088
|
ground: true,
|
|
1087
1089
|
...STILL,
|
|
1088
1090
|
hp: kit.hp,
|
|
1091
|
+
...kit.hunter && {
|
|
1092
|
+
ammo: kit.ammo,
|
|
1093
|
+
mag: kit.mag
|
|
1094
|
+
},
|
|
1089
1095
|
blade: !!kit.katana,
|
|
1090
1096
|
wield: !!kit.katana
|
|
1091
1097
|
};
|
|
@@ -7036,7 +7042,18 @@ var step = (p, i, w, team, armed = true, bodies = [], kit = KITS[0]) => {
|
|
|
7036
7042
|
p.zapping = true;
|
|
7037
7043
|
return STRIKE.RAIL;
|
|
7038
7044
|
}
|
|
7039
|
-
} else if (!p.wield && !p.cool && p.mag && !p.reload)
|
|
7045
|
+
} else if (!p.wield && !p.cool && p.mag && !p.reload) {
|
|
7046
|
+
if (kit.hunter) {
|
|
7047
|
+
p.power = 1;
|
|
7048
|
+
p.ammo--;
|
|
7049
|
+
p.mag--;
|
|
7050
|
+
p.charge = 0;
|
|
7051
|
+
p.cool = kit.cool;
|
|
7052
|
+
p.shots = p.shots + 1 & 255;
|
|
7053
|
+
return STRIKE.SHOT;
|
|
7054
|
+
}
|
|
7055
|
+
p.charge = Math.min((p.charge ?? 0) + 1, 60);
|
|
7056
|
+
}
|
|
7040
7057
|
} else if (p.charge) {
|
|
7041
7058
|
p.power = Math.min(powerOf(p.charge), p.mag);
|
|
7042
7059
|
p.charge = 0;
|
|
@@ -10214,7 +10231,7 @@ var Room = class {
|
|
|
10214
10231
|
}
|
|
10215
10232
|
if (by) by.state.hits = by.state.hits + 1 & 255;
|
|
10216
10233
|
if (b.power === 6) this.shot(foe, BOLT_HP, by, b.dx, b.dz);
|
|
10217
|
-
else if (b.power === 8) this.shot(foe,
|
|
10234
|
+
else if (b.power === 8) this.shot(foe, 4, by, b.dx, b.dz, FRAG.GUN, b.back);
|
|
10218
10235
|
else if (b.power === 9) this.shot(foe, 3, by, b.dx, b.dz, FRAG.GUN, b.back);
|
|
10219
10236
|
else if (b.power === 0) {
|
|
10220
10237
|
foe.graze = ((foe.graze ?? 0) + 1) % 2;
|
|
@@ -16,7 +16,7 @@ export interface Gait {
|
|
|
16
16
|
* Moves to the state `p` after dt seconds. Without `floor` the feet stand on y = p.y. `seat` is
|
|
17
17
|
* where a player who rides sits: without it he sits level, a rider, facing his look.
|
|
18
18
|
*/
|
|
19
|
-
update(p: PlayerState, dt: number, floor?: Floor, seat?: Seat): void;
|
|
19
|
+
update(p: PlayerState, dt: number, floor?: Floor, seat?: Seat, clock?: number): void;
|
|
20
20
|
/** The pose now: one object, rewritten by each call. */
|
|
21
21
|
pose(): Pose;
|
|
22
22
|
/** Stride phase, in cycles: the left foot lands at 0 and the right one at a half. */
|
|
@@ -62,7 +62,9 @@ export interface Hud {
|
|
|
62
62
|
*/
|
|
63
63
|
cast(pick: (c: Choice & {
|
|
64
64
|
body: number;
|
|
65
|
-
}) => void): HTMLCanvasElement;
|
|
65
|
+
}) => void, preview?: (active: boolean) => void): HTMLCanvasElement;
|
|
66
|
+
/** Shows the loader over the character portrait while its deferred render is pending. */
|
|
67
|
+
previewLoading(loading: boolean): void;
|
|
66
68
|
/** The pictures of the haircuts on offer, in their order (HEAD_PX square): the own head with each. */
|
|
67
69
|
heads(): HTMLCanvasElement[];
|
|
68
70
|
/** The own player's magazines, as his class holds them (Kit's mag, cap, clip): the spare ones counted by them. */
|
|
@@ -79,7 +81,7 @@ export interface Hud {
|
|
|
79
81
|
/** The orbital station's mission line (mission.ts), `hot` when urgent; none hides it. */
|
|
80
82
|
mission(text?: string, hot?: boolean): void;
|
|
81
83
|
/** The Hunter's current local vision mode. */
|
|
82
|
-
hunterVision(text?: string): void;
|
|
84
|
+
hunterVision(text?: string, scoped?: boolean): void;
|
|
83
85
|
/** The Predator-style shoulder-laser sight, at a screen point and progressing to a lock. */
|
|
84
86
|
hunterAim(at?: [number, number], progress?: number): void;
|
|
85
87
|
/** The dark rim of a space helmet's visor around the screen: on while the own player wears one, off otherwise. */
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { Vec3 } from './mesh';
|
|
2
|
+
import type { Out } from './verts';
|
|
2
3
|
export declare function hunter(lod: 0 | 1 | 2): Record<string, number[]>;
|
|
3
4
|
/** Model-space cut trail on the same scaled mount as the baked blades. */
|
|
4
5
|
export declare const hunterWristEnds: () => Vec3[];
|
|
6
|
+
/** Slide and stock travel in opposite directions as the compact back-mounted rifle opens. */
|
|
7
|
+
export declare const drawHarpoon: (out: Out, lod: 0 | 1 | 2, at: Vec3, axes: Vec3[], scale: number, open: number, loaded?: boolean) => void;
|
|
5
8
|
export declare const hunterHarpoon: (lod: 0 | 1 | 2) => number[];
|
|
@@ -53,6 +53,8 @@ export interface Controls {
|
|
|
53
53
|
vision: number;
|
|
54
54
|
/** Whether the local player chose the Hunter class. */
|
|
55
55
|
hunter: boolean;
|
|
56
|
+
canScope: boolean;
|
|
57
|
+
scoped: boolean;
|
|
56
58
|
/**
|
|
57
59
|
* The KEY bits of the next step, read once per step. Same as `keys`, plus BLADE while the katana
|
|
58
60
|
* is chosen and RAIL while the rail gun is, except for the step right after a double tap: it carries DASH and only the tapped
|
|
@@ -369,7 +369,7 @@ export declare const HARPOON = 8;
|
|
|
369
369
|
export declare const HARPOON_SPEED = 72;
|
|
370
370
|
export declare const HARPOON_RANGE = 90;
|
|
371
371
|
export declare const HARPOON_R = 0.08;
|
|
372
|
-
export declare const HARPOON_HP =
|
|
372
|
+
export declare const HARPOON_HP = 4;
|
|
373
373
|
/** Ball.power values for a Hunter's returning disc (outbound, then returning). */
|
|
374
374
|
export declare const DISK = 9;
|
|
375
375
|
export declare const DISK_RETURN = 10;
|
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.204.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|