@korial29/tiny-fps 0.209.0 → 0.211.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/server.js
CHANGED
|
@@ -841,7 +841,9 @@ var KITS = [
|
|
|
841
841
|
katana: true,
|
|
842
842
|
hunter: true,
|
|
843
843
|
ammo: 12,
|
|
844
|
-
mag: 1
|
|
844
|
+
mag: 1,
|
|
845
|
+
cap: 15,
|
|
846
|
+
rail: 90
|
|
845
847
|
}
|
|
846
848
|
];
|
|
847
849
|
/**
|
|
@@ -1098,7 +1100,7 @@ var spawn = (id, w, n, team = 0, kit = KITS[0]) => {
|
|
|
1098
1100
|
ammo: kit.ammo,
|
|
1099
1101
|
mag: kit.mag,
|
|
1100
1102
|
rail: 0,
|
|
1101
|
-
cap:
|
|
1103
|
+
cap: kit.cap,
|
|
1102
1104
|
charge: 0
|
|
1103
1105
|
},
|
|
1104
1106
|
blade: !!kit.katana,
|
|
@@ -6891,14 +6893,25 @@ var step = (p, i, w, team, armed = true, bodies = [], kit = KITS[0]) => {
|
|
|
6891
6893
|
];
|
|
6892
6894
|
const own = kit.hunter;
|
|
6893
6895
|
if (own) {
|
|
6894
|
-
[p.
|
|
6895
|
-
0,
|
|
6896
|
-
0,
|
|
6896
|
+
[p.rifle, p.clip, p.nades] = [
|
|
6897
6897
|
0,
|
|
6898
6898
|
0,
|
|
6899
6899
|
0
|
|
6900
6900
|
];
|
|
6901
|
-
if (p.ammo < 0 && !p.down) [p.ammo, p.mag
|
|
6901
|
+
if (p.ammo < 0 && !p.down) [p.ammo, p.mag, p.cap, p.rail] = [
|
|
6902
|
+
kit.ammo,
|
|
6903
|
+
kit.mag,
|
|
6904
|
+
kit.cap,
|
|
6905
|
+
0
|
|
6906
|
+
];
|
|
6907
|
+
p.cap = Math.min(p.cap ?? kit.cap, kit.cap);
|
|
6908
|
+
p.rail = Math.min(Math.max(p.rail ?? 0, 0), 90);
|
|
6909
|
+
if (p.cap >= kit.cap) p.rail = 0;
|
|
6910
|
+
else if (p.rail > 1) p.rail--;
|
|
6911
|
+
else {
|
|
6912
|
+
p.cap++;
|
|
6913
|
+
p.rail = p.cap < kit.cap ? 90 : 0;
|
|
6914
|
+
}
|
|
6902
6915
|
}
|
|
6903
6916
|
if (armed && gear && inside && !p.rack) [p.ammo, p.mag] = [kit.ammo, kit.mag];
|
|
6904
6917
|
p.rack = inside;
|
|
@@ -6993,7 +7006,7 @@ var step = (p, i, w, team, armed = true, bodies = [], kit = KITS[0]) => {
|
|
|
6993
7006
|
const [load, full] = [p[key] ?? 0, Math.min(size, carried)];
|
|
6994
7007
|
if (p.reload) {
|
|
6995
7008
|
if (!--p.reload) p[key] = full;
|
|
6996
|
-
} else if (hand >= 0 && hand != 1 && !busy && load < full && (!load || i.keys & KEY.RELOAD)) [p.reload, p.charge] = [ticks2, 0];
|
|
7009
|
+
} else if (hand >= 0 && hand != 1 && !(own && hand == 2) && !busy && load < full && (!load || i.keys & KEY.RELOAD)) [p.reload, p.charge] = [ticks2, 0];
|
|
6997
7010
|
const bare = hand < 0;
|
|
6998
7011
|
const c = kit.xeno ? swingOf(p, TAILS) : bare ? PUNCHES[p.cut ?? 0] ?? PUNCHES[0] : swingOf(p);
|
|
6999
7012
|
if (p.swing && c.ticks - p.swing === c.strike) return STRIKE.CUT;
|
|
@@ -7060,8 +7073,10 @@ var step = (p, i, w, team, armed = true, bodies = [], kit = KITS[0]) => {
|
|
|
7060
7073
|
return STRIKE.LASER;
|
|
7061
7074
|
}
|
|
7062
7075
|
} else if (p.railed && own) {
|
|
7063
|
-
if (!p.cool) {
|
|
7076
|
+
if (!p.cool && p.cap) {
|
|
7064
7077
|
p.cool = 15;
|
|
7078
|
+
p.cap--;
|
|
7079
|
+
p.rail = 90;
|
|
7065
7080
|
p.shots = p.shots + 1 & 255;
|
|
7066
7081
|
return STRIKE.RAIL;
|
|
7067
7082
|
}
|
|
@@ -8300,7 +8315,7 @@ var Bot = class {
|
|
|
8300
8315
|
/** The input of this tick. */
|
|
8301
8316
|
think(s) {
|
|
8302
8317
|
const p = s.me.state;
|
|
8303
|
-
const weapon = p.down ? 0 : s.kit?.katana && p.blade ? BLADE : (p.rail ?? 0) > 0 ? KEY.RAIL : (p.rifle ?? 0) > 0 ? KEY.RIFLE : p.ammo < 0 && p.blade ? BLADE : 0;
|
|
8318
|
+
const weapon = p.down ? 0 : s.kit?.katana && p.blade ? BLADE : !s.kit?.hunter && (p.rail ?? 0) > 0 ? KEY.RAIL : (p.rifle ?? 0) > 0 ? KEY.RIFLE : p.ammo < 0 && p.blade ? BLADE : 0;
|
|
8304
8319
|
if (this.foe >= 0 && this.keys & FIRE && p.zapping) this.railWarnings++;
|
|
8305
8320
|
const i = this.decide(s, weapon);
|
|
8306
8321
|
i.keys |= weapon;
|
|
@@ -108,6 +108,12 @@ export declare const HUNTER_HAND: Vec3;
|
|
|
108
108
|
export declare const CLAW_ROLL: Vec3;
|
|
109
109
|
/** The Hunter's left hand in its guard while the blades are out (view space, mirrored): low left, ahead. */
|
|
110
110
|
export declare const GUARD: Vec3;
|
|
111
|
+
/**
|
|
112
|
+
* The Hunter's left wrist with the shoulder cannon out (view space, mirrored): low on the left,
|
|
113
|
+
* close, the arm bent toward the eye, the computer on the forearm facing up, the view above it
|
|
114
|
+
* clear (the user, 2026-11-24, after a reference shot).
|
|
115
|
+
*/
|
|
116
|
+
export declare const COMPUTER: Vec3;
|
|
111
117
|
/** The guard hand thrown out ahead through a cut's wind-up, and pulled in to the belly on its strike. */
|
|
112
118
|
export declare const LUNGE_L: Vec3;
|
|
113
119
|
export declare const TUCK: Vec3;
|
|
@@ -171,6 +177,8 @@ export interface Grip {
|
|
|
171
177
|
spread?: number;
|
|
172
178
|
/** The right hand's fingers' last bones bent further, radians: gripping an edge. */
|
|
173
179
|
hook?: number;
|
|
180
|
+
/** The right index straightened out of the fist as `point` the left (the Hunter's wrist computer). */
|
|
181
|
+
poke?: number;
|
|
174
182
|
}
|
|
175
183
|
/**
|
|
176
184
|
* Both hands of the skeleton `s` on its wrists, left then right, each closed `curls[i]` (hand()), in
|
|
@@ -178,7 +186,7 @@ export interface Grip {
|
|
|
178
186
|
* body and the runners share it, so a runner's fist closes on a grip as the own one does. `lite` is
|
|
179
187
|
* a near runner's hand, `skip` a hand not drawn (the one a cut took off with its arm).
|
|
180
188
|
*/
|
|
181
|
-
export declare const hands: (out: Out, s: Solved, build: number, curls: number[], glove: number[], bare: number[], { point, push, to, cup, lights, claws, spread, hook, }?: Grip, lite?: boolean, skip?: number) => void;
|
|
189
|
+
export declare const hands: (out: Out, s: Solved, build: number, curls: number[], glove: number[], bare: number[], { point, push, to, cup, lights, claws, spread, hook, poke, }?: Grip, lite?: boolean, skip?: number) => void;
|
|
182
190
|
/** On a wall run the rail gun is put away, unless its bolt is going out. */
|
|
183
191
|
export declare const stowed: (p: PlayerState) => boolean;
|
|
184
192
|
/**
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Vec3 } from './mesh';
|
|
2
|
+
/** Shots per glyph: the cannon's HUNTER_CELLS over the three glyphs. */
|
|
3
|
+
export declare const PER_GLYPH: number;
|
|
4
|
+
/** The fire key, in the forearm's frame (the right hand presses it). */
|
|
5
|
+
export declare const FIRE_KEY: Vec3;
|
|
6
|
+
/** The computer with `shots` of the cannon's shots left, in the left forearm's frame; made once each. */
|
|
7
|
+
export declare const wristComputer: (shots: number) => number[];
|
|
@@ -173,6 +173,14 @@ export declare const SOUND: {
|
|
|
173
173
|
readonly HUNTER_FLASH: 88;
|
|
174
174
|
readonly HEARTBEAT: 89;
|
|
175
175
|
readonly STATIC: 90;
|
|
176
|
+
/**
|
|
177
|
+
* The shoulder cannon taking a foe in its sight, after the Predator's (the user, 2026-11-23; the
|
|
178
|
+
* first 5 s of "Predator Target lock and Plasma weapon sound FX", analysed): three dry clicks round
|
|
179
|
+
* 700 Hz 75 ms apart and a breath of noise, then HUNTER_SEEK, looped until the lock: a steady
|
|
180
|
+
* electronic hum at 1.5 kHz over a fainter 1.2 kHz, each buzzing at 65 Hz.
|
|
181
|
+
*/
|
|
182
|
+
readonly HUNTER_TRACK: 91;
|
|
183
|
+
readonly HUNTER_SEEK: 92;
|
|
176
184
|
};
|
|
177
185
|
/**
|
|
178
186
|
* The sounds of the game: one entry per sound, its voices layered, in SOUND order. A low-passed
|
|
@@ -390,6 +390,12 @@ export declare const HUNTER_LASER_LOCK: number;
|
|
|
390
390
|
export declare const HUNTER_LASER_HP = 3;
|
|
391
391
|
/** Ticks between two shots of the shoulder cannon held down; `cool` is 4 bits on the wire, so 15 at most. */
|
|
392
392
|
export declare const HUNTER_LASER_COOL = 15;
|
|
393
|
+
/**
|
|
394
|
+
* The shoulder cannon's battery (the user, 2026-11-23): its shots when full, kept in `cap`, and
|
|
395
|
+
* the ticks without firing that bring one back, counted down in `rail` (both u8 on the wire).
|
|
396
|
+
*/
|
|
397
|
+
export declare const HUNTER_CELLS = 15;
|
|
398
|
+
export declare const HUNTER_CELL_TICKS = 90;
|
|
393
399
|
/** Plasma balls in flight in a room at most: past it the oldest bursts. They go on the wire. */
|
|
394
400
|
export declare const PLASMA_MAX = 64;
|
|
395
401
|
/** 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. */
|
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.211.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|