@korial29/tiny-fps 0.167.0 → 0.168.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 +20 -20
- package/dist/local.js +1 -1
- package/dist/server.js +8 -2
- package/dist/types/client/balls.d.ts +6 -0
- package/dist/types/shared/constants.d.ts +6 -1
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -192,6 +192,11 @@ var [POUNCE_COOL, POUNCE_FLY] = [48, 40];
|
|
|
192
192
|
var [POUNCE_HP, POUNCE_STUN] = [2, 60];
|
|
193
193
|
var PLASMA_R = .12;
|
|
194
194
|
/**
|
|
195
|
+
* What a vehicle's bolts take (the user, 2026-11-16: stronger, they grazed like the rifle's rounds):
|
|
196
|
+
* BOLT_HP from a player each one that hits him, and 1 from a hull every BOLT_GRAZE on it.
|
|
197
|
+
*/
|
|
198
|
+
var [BOLT_HP, BOLT_GRAZE] = [1, 2];
|
|
199
|
+
/**
|
|
195
200
|
* The cuts, by CUT. A swing lasts `ticks`, during which no other starts, and strikes once, `strike`
|
|
196
201
|
* ticks after its start. `hold` is the top of its wind-up, where FIRE held keeps it (a charge; -1:
|
|
197
202
|
* a special, which does not charge). It hits every enemy whose body comes within `reach` metres of the
|
|
@@ -9131,7 +9136,7 @@ var Room = class {
|
|
|
9131
9136
|
if (by) by.state.hits = by.state.hits + 1 & 255;
|
|
9132
9137
|
if (b.power === 0 || b.power === 6) {
|
|
9133
9138
|
const w = this.wear[this.rovers.indexOf(hull)];
|
|
9134
|
-
w.graze = (w.graze + 1) % VEHICLE.GRAZE;
|
|
9139
|
+
w.graze = (w.graze + 1) % (b.power === 6 ? BOLT_GRAZE : VEHICLE.GRAZE);
|
|
9135
9140
|
if (!w.graze) this.hurt(hull, 1, b.by, b.team);
|
|
9136
9141
|
} else this.hurt(hull, b.arc ? CUTS[b.arc].hp : b.power ?? 1, b.by, b.team);
|
|
9137
9142
|
return;
|
|
@@ -9139,7 +9144,8 @@ var Room = class {
|
|
|
9139
9144
|
const foe = foes.find((q) => q.state === hit);
|
|
9140
9145
|
if (!foe) return;
|
|
9141
9146
|
if (by) by.state.hits = by.state.hits + 1 & 255;
|
|
9142
|
-
if (b.power ===
|
|
9147
|
+
if (b.power === 6) this.shot(foe, BOLT_HP, by, b.dx, b.dz);
|
|
9148
|
+
else if (b.power === 0) {
|
|
9143
9149
|
foe.graze = ((foe.graze ?? 0) + 1) % 2;
|
|
9144
9150
|
if (!foe.graze) this.shot(foe, 1, by, b.dx, b.dz);
|
|
9145
9151
|
} else if (!b.arc) this.shot(foe, b.power ?? 1, by, b.dx, b.dz);
|
|
@@ -19,4 +19,10 @@ export interface Balls {
|
|
|
19
19
|
bursts: [Vec3, number, number?][];
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* The key of a ball the host sends: its shooter and id, and apart for a vehicle's bolts and
|
|
24
|
+
* missiles, which a driver's bolt count names (room.ts) and could meet the number of a shot of his
|
|
25
|
+
* own gun: one of those, in flight or spent, would hide it.
|
|
26
|
+
*/
|
|
27
|
+
export declare const keyOf: (b: Ball) => number;
|
|
22
28
|
export declare const createBalls: (world: World) => Balls;
|
|
@@ -314,9 +314,14 @@ export declare const RIFLE_SPEED = 400;
|
|
|
314
314
|
export declare const PLASMA_R = 0.12;
|
|
315
315
|
/** Plasma balls in flight in a room at most: past it the oldest bursts. They go on the wire. */
|
|
316
316
|
export declare const PLASMA_MAX = 64;
|
|
317
|
-
/** Ball.power of a
|
|
317
|
+
/** Ball.power of a vehicle's laser bolt (rover.ts): past CHARGE_MAX, so it names the bolt. It flies at BOLT_SPEED m/s. */
|
|
318
318
|
export declare const BOLT = 6;
|
|
319
319
|
export declare const BOLT_SPEED = 120;
|
|
320
|
+
/**
|
|
321
|
+
* What a vehicle's bolts take (the user, 2026-11-16: stronger, they grazed like the rifle's rounds):
|
|
322
|
+
* BOLT_HP from a player each one that hits him, and 1 from a hull every BOLT_GRAZE on it.
|
|
323
|
+
*/
|
|
324
|
+
export declare const BOLT_HP: number, BOLT_GRAZE: number;
|
|
320
325
|
/** Radians the view kicks up per shot (client side: the kick is in the pitch the inputs carry). */
|
|
321
326
|
export declare const RECOIL = 0.012;
|
|
322
327
|
/** Ticks a player lies down after the health ran out, then he is back at a spawn of his team. */
|
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.168.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|