@korial29/tiny-fps 0.179.0 → 0.181.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 +32 -32
- package/dist/local.js +1 -1
- package/dist/server.js +83 -34
- package/dist/types/client/crawl.d.ts +13 -0
- package/dist/types/client/xeno.d.ts +9 -6
- package/dist/types/shared/constants.d.ts +15 -6
- package/dist/types/shared/physics.d.ts +5 -0
- package/dist/types/shared/room.d.ts +8 -6
- package/dist/types/shared/tackle.d.ts +7 -4
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -182,14 +182,18 @@ var [PUNCH_HITS, PUNCH_STUN, PUNCH_MEMORY] = [
|
|
|
182
182
|
3,
|
|
183
183
|
180
|
|
184
184
|
];
|
|
185
|
+
/** Its walk on a wall, a share of its run: the sprint key runs there (the user, 2026-11-16). */
|
|
186
|
+
var CLING_WALK = .5;
|
|
185
187
|
/** 1.4: a step of its burst stays under PLAYER_R, so it cannot tunnel through a thin brush (physics.ts). */
|
|
186
188
|
var XENO_DASH = 1.4;
|
|
187
189
|
var [POUNCE_HP, POUNCE_STUN] = [2, 60];
|
|
188
190
|
/**
|
|
189
191
|
* The glory kill (the user, 2026-11-16, after DOOM 2016): an enemy with GLORY_HP health or less, up,
|
|
190
|
-
* flashes
|
|
191
|
-
*
|
|
192
|
-
*
|
|
192
|
+
* flashes to one with the katana in hand, who beheads him on E within GLORY_REACH metres. The
|
|
193
|
+
* xenomorph's takes any enemy up, with no flash (the user, 2026-11-16): E within GLORY_FAR metres
|
|
194
|
+
* of him, in sight, and GLORY_ARC radians of its look locks the two (`lock`, `foe`, as a saber
|
|
195
|
+
* lock) for GLORY_TICKS, where he does not move and it dashes to him, then it eats his head: he
|
|
196
|
+
* goes down through his armour (LIMB.EATEN), a frag of FRAG.GLORY.
|
|
193
197
|
*/
|
|
194
198
|
var [GLORY_HP, GLORY_REACH, GLORY_ARC, GLORY_TICKS] = [
|
|
195
199
|
3,
|
|
@@ -197,6 +201,12 @@ var [GLORY_HP, GLORY_REACH, GLORY_ARC, GLORY_TICKS] = [
|
|
|
197
201
|
1,
|
|
198
202
|
54
|
|
199
203
|
];
|
|
204
|
+
/**
|
|
205
|
+
* The xenomorph's glory kill from afar (the user, 2026-11-16): within GLORY_FAR metres, in sight,
|
|
206
|
+
* it dashes to a metre of its prey over the first GLORY_DASH ticks of the lock. 7 m in 20 ticks is
|
|
207
|
+
* 21 m/s, a step under PLAYER_R: it cannot tunnel.
|
|
208
|
+
*/
|
|
209
|
+
var [GLORY_FAR, GLORY_DASH] = [8, 20];
|
|
200
210
|
/** How much faster than a man the xenomorph runs (the user, 2026-11-16: a little, not twice). */
|
|
201
211
|
var XENO_PACE = 1.25;
|
|
202
212
|
var PLASMA_R = .12;
|
|
@@ -1381,6 +1391,18 @@ var steer$1 = (p, wish, top, run = 6, accel = 1) => {
|
|
|
1381
1391
|
p.vz = pz + par * wz;
|
|
1382
1392
|
};
|
|
1383
1393
|
/**
|
|
1394
|
+
* A step along its speed, through the boxes and bodies as fly() takes it, with no gravity and no
|
|
1395
|
+
* control: the xenomorph's dash to its glory kill's prey (gun.ts).
|
|
1396
|
+
*/
|
|
1397
|
+
var coast = (p, w, bodies) => {
|
|
1398
|
+
fly$1(p, w, heightOf(p), 0, false, bodies);
|
|
1399
|
+
[p.x, p.y, p.z] = [
|
|
1400
|
+
f32$2(p.x),
|
|
1401
|
+
f32$2(p.y),
|
|
1402
|
+
f32$2(p.z)
|
|
1403
|
+
];
|
|
1404
|
+
};
|
|
1405
|
+
/**
|
|
1384
1406
|
* Moves the cylinder by its speed for one step: sideways (sliding along the boxes, which takes the
|
|
1385
1407
|
* speed into them away), then up or down by g times the world's gravity (a ceiling stops a rise, a floor a
|
|
1386
1408
|
* fall). Returns the speed it came down on a floor at, or -1 when it is not on one. With `snap`
|
|
@@ -1568,7 +1590,7 @@ var holdAt = (p, w, side) => {
|
|
|
1568
1590
|
* 2026-11-16: running into a wall, not walking): in the air within WALL_REACH, on a floor touching
|
|
1569
1591
|
* it, a wall from the knees to the head (wallGap). Not the side it just kicked off.
|
|
1570
1592
|
*/
|
|
1571
|
-
var clingTo = (p, w, c) => {
|
|
1593
|
+
var clingTo = (p, w, c, speed) => {
|
|
1572
1594
|
if (!c.kit.xeno || !c.fwd || !(c.keys & KEY.SPRINT) || c.stumble) return false;
|
|
1573
1595
|
const reach = p.mode === MODE.AIR ? WALL_REACH : .05;
|
|
1574
1596
|
for (let side = 1; side <= 4; side++) {
|
|
@@ -1577,7 +1599,12 @@ var clingTo = (p, w, c) => {
|
|
|
1577
1599
|
if (side !== p.wall && c.fx * nx + c.fz * nz >= .6 && gap !== void 0 && gap <= reach) {
|
|
1578
1600
|
enter(p, MODE.CLING);
|
|
1579
1601
|
p.wall = side;
|
|
1580
|
-
|
|
1602
|
+
const [tx, tz] = [-nz, nx];
|
|
1603
|
+
const k = Math.min(1, c.kit.sprint * c.pace / Math.max(speed[0], EPS));
|
|
1604
|
+
const a = (speed[1] * tx + speed[2] * tz) * k;
|
|
1605
|
+
p.vx = tx * a;
|
|
1606
|
+
p.vz = tz * a;
|
|
1607
|
+
p.vy = Math.sqrt(Math.max(0, (speed[0] * k) ** 2 - a * a));
|
|
1581
1608
|
p.jumps = 1;
|
|
1582
1609
|
p.coyote = 0;
|
|
1583
1610
|
p.ev |= EV.GRAB;
|
|
@@ -1589,8 +1616,8 @@ var clingTo = (p, w, c) => {
|
|
|
1589
1616
|
/**
|
|
1590
1617
|
* On a wall, the wall is its floor (the user, 2026-11-16, to roam it freely): the look's heading
|
|
1591
1618
|
* turned onto it is forward, so W climbs looking at the wall, goes along it looking along it and
|
|
1592
|
-
* down it looking away, S the other way, A and D across. Crouch lets go; a jump
|
|
1593
|
-
*
|
|
1619
|
+
* down it looking away, S the other way, A and D across. Crouch lets go; a jump leaps where the
|
|
1620
|
+
* view turned over onto the wall looks. At a top under the head, climbing pulls
|
|
1594
1621
|
* it up onto the top (MODE.CLIMB); down on a floor, it stands.
|
|
1595
1622
|
*/
|
|
1596
1623
|
var cling = (p, w, c) => {
|
|
@@ -1603,16 +1630,11 @@ var cling = (p, w, c) => {
|
|
|
1603
1630
|
}
|
|
1604
1631
|
if (c.jump) {
|
|
1605
1632
|
enter(p, MODE.AIR);
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
const cp = Math.cos(p.pitch);
|
|
1612
|
-
p.vx = c.fx * cp * 10;
|
|
1613
|
-
p.vz = c.fz * cp * 10;
|
|
1614
|
-
leap$1(p, Math.max(Math.sin(p.pitch) * 10, WALL_KICK_UP / 2));
|
|
1615
|
-
}
|
|
1633
|
+
const [cp, out] = [Math.cos(p.pitch) * 10, Math.sin(p.pitch) * 10];
|
|
1634
|
+
const [k, a] = [Math.max(out, WALL_KICK_SPEED / 2), (c.fz * nx - c.fx * nz) * cp];
|
|
1635
|
+
p.vx = -nx * k - nz * a;
|
|
1636
|
+
p.vz = -nz * k + nx * a;
|
|
1637
|
+
leap$1(p, (c.fx * nx + c.fz * nz) * cp);
|
|
1616
1638
|
return;
|
|
1617
1639
|
}
|
|
1618
1640
|
const fw = (c.keys & KEY.FORWARD ? 1 : 0) - (c.keys & KEY.BACK ? 1 : 0);
|
|
@@ -1621,7 +1643,12 @@ var cling = (p, w, c) => {
|
|
|
1621
1643
|
const [hu, ha] = [c.fx * nx + c.fz * nz, c.fx * tx + c.fz * tz];
|
|
1622
1644
|
const [wu, wa] = [fw * hu - s * ha, fw * ha + s * hu];
|
|
1623
1645
|
const n = Math.sqrt(wu * wu + wa * wa);
|
|
1624
|
-
const
|
|
1646
|
+
const was = Math.sqrt(p.vx * p.vx + p.vy * p.vy + p.vz * p.vz);
|
|
1647
|
+
const runs = c.keys & KEY.SPRINT;
|
|
1648
|
+
const run = c.kit.run * c.pace * (runs ? 1 : CLING_WALK);
|
|
1649
|
+
const top = runs ? c.kit.sprint * c.pace : run;
|
|
1650
|
+
const sp = was > top ? Math.max(top, was - 12 * DT$2) : Math.min(top, Math.max(run, was + 3 * c.kit.accel * DT$2));
|
|
1651
|
+
const v = n > 1 ? sp / n : sp;
|
|
1625
1652
|
const up = wu > .05 ? 1 : wu < -.05 ? -1 : 0;
|
|
1626
1653
|
const k = wa * v;
|
|
1627
1654
|
const { a, sign } = along(p, p.wall);
|
|
@@ -1689,6 +1716,11 @@ var free$1 = (p, w, c) => {
|
|
|
1689
1716
|
if (p.mode === MODE.AIR) air(p, w, c, burst);
|
|
1690
1717
|
const g = burst && p.vy <= 0 ? 0 : p.mode === MODE.WALLRUN ? WALLRUN_GRAVITY : 1;
|
|
1691
1718
|
const was = p.mode;
|
|
1719
|
+
const speed = [
|
|
1720
|
+
len$1(p.vx, p.vz),
|
|
1721
|
+
p.vx,
|
|
1722
|
+
p.vz
|
|
1723
|
+
];
|
|
1692
1724
|
const hit = fly$1(p, w, heightOf(p), g, onFloor(was), c.bodies);
|
|
1693
1725
|
if (hit >= 0) {
|
|
1694
1726
|
if (!onFloor(p.mode)) {
|
|
@@ -1708,7 +1740,7 @@ var free$1 = (p, w, c) => {
|
|
|
1708
1740
|
p.ev |= p.mode === MODE.SLIDE ? EV.SLIDE_END : 0;
|
|
1709
1741
|
enter(p, MODE.AIR);
|
|
1710
1742
|
}
|
|
1711
|
-
if ((p.mode === MODE.AIR || p.mode === MODE.GROUND) && clingTo(p, w, c)) return;
|
|
1743
|
+
if ((p.mode === MODE.AIR || p.mode === MODE.GROUND) && clingTo(p, w, c, speed)) return;
|
|
1712
1744
|
if (p.mode === MODE.AIR) {
|
|
1713
1745
|
const ledge = ledgeAt(p, w);
|
|
1714
1746
|
if (ledge) grab(p, ledge, c.kit.dashes);
|
|
@@ -6267,19 +6299,29 @@ var pouncing = (p) => p.dash > 50;
|
|
|
6267
6299
|
*/
|
|
6268
6300
|
var reaches = (a, b) => Math.hypot(a.x - b.x, a.z - b.z) < 1.1 && a.y < b.y + heightOf(b) && b.y < a.y + heightOf(a);
|
|
6269
6301
|
/**
|
|
6270
|
-
* The enemy
|
|
6271
|
-
*
|
|
6272
|
-
* GLORY_REACH on the floor plane,
|
|
6302
|
+
* The enemy `me` would glory kill with E (room.ts feast()), of `foes` as it sees them: the nearest
|
|
6303
|
+
* one up, in no lock and not seated, a body's height above or below and GLORY_ARC of its look. With
|
|
6304
|
+
* the katana (`w` undefined) within GLORY_REACH on the floor plane, with GLORY_HP health or less;
|
|
6305
|
+
* the xenomorph's within GLORY_FAR, in sight through the world `w`, at any health (the user,
|
|
6306
|
+
* 2026-11-16).
|
|
6273
6307
|
*/
|
|
6274
|
-
var glory = (me, foes) => {
|
|
6308
|
+
var glory = (me, foes, w) => {
|
|
6275
6309
|
const [fx, fz] = forward(me.yaw);
|
|
6276
6310
|
let best;
|
|
6277
|
-
let near = GLORY_REACH;
|
|
6311
|
+
let near = w ? GLORY_FAR : GLORY_REACH;
|
|
6278
6312
|
for (const f of foes) {
|
|
6279
6313
|
const [dx, dz] = [f.x - me.x, f.z - me.z];
|
|
6280
6314
|
const d = Math.hypot(dx, dz);
|
|
6281
6315
|
const facing = d < .001 || Math.acos(Math.min(1, (dx * fx + dz * fz) / d)) <= GLORY_ARC;
|
|
6282
|
-
if (!f.down && !f.lock && f.mode !== MODE.RIDE &&
|
|
6316
|
+
if (!f.down && !f.lock && f.mode !== MODE.RIDE && (w ? !hidden(w, [
|
|
6317
|
+
me.x,
|
|
6318
|
+
me.y + 1.3,
|
|
6319
|
+
me.z
|
|
6320
|
+
], [
|
|
6321
|
+
f.x,
|
|
6322
|
+
f.y + 1.3,
|
|
6323
|
+
f.z
|
|
6324
|
+
]) : f.hp <= GLORY_HP) && d <= near && Math.abs(f.y - me.y) < 1.8 && facing) [best, near] = [f, d];
|
|
6283
6325
|
}
|
|
6284
6326
|
return best;
|
|
6285
6327
|
};
|
|
@@ -6350,7 +6392,11 @@ var STRIKE = {
|
|
|
6350
6392
|
var step = (p, i, w, team, armed = true, bodies = [], kit = KITS[0]) => {
|
|
6351
6393
|
const down = p.down > 0;
|
|
6352
6394
|
const locked = !down && (p.lock ?? 0) > 0;
|
|
6353
|
-
|
|
6395
|
+
if (locked && !p.wield && p.lock > GLORY_TICKS - GLORY_DASH && (p.vx || p.vz)) {
|
|
6396
|
+
coast(p, w, bodies);
|
|
6397
|
+
p.ev = p.lock == GLORY_TICKS ? EV.DASH : 0;
|
|
6398
|
+
if (p.lock <= GLORY_TICKS - GLORY_DASH + 1) p.vx = p.vz = 0;
|
|
6399
|
+
} else move(p, down || locked ? {
|
|
6354
6400
|
...i,
|
|
6355
6401
|
keys: 0
|
|
6356
6402
|
} : i, w, team, bodies, kit);
|
|
@@ -9409,12 +9455,14 @@ var Room = class {
|
|
|
9409
9455
|
foe.state.fried = this.shot(foe, 1, foe.railer, foe.state.x - r.x, foe.state.z - r.z, FRAG.RAIL);
|
|
9410
9456
|
}
|
|
9411
9457
|
/**
|
|
9412
|
-
* E pressed by `p`, the xenomorph or one with the katana in hand: the nearest enemy who is up
|
|
9413
|
-
*
|
|
9414
|
-
*
|
|
9415
|
-
*
|
|
9416
|
-
*
|
|
9417
|
-
*
|
|
9458
|
+
* E pressed by `p`, the xenomorph or one with the katana in hand: the nearest enemy who is up,
|
|
9459
|
+
* within GLORY_ARC of its look where `p` drew him, and in no lock, is glory killed (glory()):
|
|
9460
|
+
* with the katana within GLORY_REACH and with GLORY_HP or less, the xenomorph's within
|
|
9461
|
+
* GLORY_FAR, in sight, at any health (the user, 2026-11-16). The katana takes his head at once
|
|
9462
|
+
* and throws the body back GLORY_PUSH m/s, the follow-through of a cut across in hand (the user,
|
|
9463
|
+
* 2026-11-16). The xenomorph holds him: the two locked (`lock`, `foe`) for GLORY_TICKS, his flag
|
|
9464
|
+
* dropped, `p` dashing to a metre of him (the user, 2026-11-16); duel() ends it. True when it
|
|
9465
|
+
* happened.
|
|
9418
9466
|
*/
|
|
9419
9467
|
feast(p, view) {
|
|
9420
9468
|
const me = p.state;
|
|
@@ -9430,7 +9478,7 @@ var Room = class {
|
|
|
9430
9478
|
lock,
|
|
9431
9479
|
mode
|
|
9432
9480
|
}] : [];
|
|
9433
|
-
}));
|
|
9481
|
+
}), xeno ? this.world : void 0);
|
|
9434
9482
|
const foe = this.players().find((q) => q.info.id === seen?.id);
|
|
9435
9483
|
if (!seen || !foe) return false;
|
|
9436
9484
|
const [dx, dz] = [seen.x - me.x, seen.z - me.z];
|
|
@@ -9472,7 +9520,8 @@ var Room = class {
|
|
|
9472
9520
|
vz: 0
|
|
9473
9521
|
});
|
|
9474
9522
|
}
|
|
9475
|
-
|
|
9523
|
+
const v = Math.max(d - 1, 0) * 60 / GLORY_DASH / d;
|
|
9524
|
+
[me.vx, me.vz] = [Math.fround(dx * v), Math.fround(dz * v)];
|
|
9476
9525
|
return true;
|
|
9477
9526
|
}
|
|
9478
9527
|
/**
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PlayerState } from '../shared/types';
|
|
2
|
+
/**
|
|
3
|
+
* The yaw, pitch and roll of the view `yaw`, `pitch`, `roll` turned by `a` (a quarter turn is the
|
|
4
|
+
* whole way) about the horizontal of the wall on `wall` (SIDE).
|
|
5
|
+
*/
|
|
6
|
+
export declare const turned: (yaw: number, pitch: number, roll: number, wall: number, a: number) => [number, number, number];
|
|
7
|
+
export interface Crawl {
|
|
8
|
+
/** Follows the own player `p` for dt seconds: on a wall the view turns over onto it, off it back. */
|
|
9
|
+
update(p: PlayerState | undefined, dt: number): void;
|
|
10
|
+
/** The view `yaw`, `pitch`, `roll` as drawn: turned over onto the wall as far as it has gone. */
|
|
11
|
+
view(yaw: number, pitch: number, roll: number): [number, number, number];
|
|
12
|
+
}
|
|
13
|
+
export declare const createCrawl: () => Crawl;
|
|
@@ -20,8 +20,8 @@ export declare const TAIL: {
|
|
|
20
20
|
* A pose of the tail, as bonesOf() takes it: its arch over the back (0 behind, 1 over the head and
|
|
21
21
|
* forward down into the view), its turn about the pelvis' up (radians, to its left: through its
|
|
22
22
|
* right side, a tail pointing back turns forward), its lean to the right, its reach (as a share of
|
|
23
|
-
* its length, a whip stretched), how much of the hook at its tip it keeps,
|
|
24
|
-
* rises (radians, less toward the tip).
|
|
23
|
+
* its length, a whip stretched), how much of the hook at its tip it keeps, how far its root
|
|
24
|
+
* rises (radians, less toward the tip), and how far it is coiled in an S to the side (0 to 1, a charge).
|
|
25
25
|
*/
|
|
26
26
|
export type Lash = readonly [
|
|
27
27
|
sting: number,
|
|
@@ -29,15 +29,18 @@ export type Lash = readonly [
|
|
|
29
29
|
lean: number,
|
|
30
30
|
reach: number,
|
|
31
31
|
hook: number,
|
|
32
|
-
rise: number
|
|
32
|
+
rise: number,
|
|
33
|
+
coil?: number
|
|
33
34
|
];
|
|
34
35
|
/** At rest: behind, hooked. */
|
|
35
36
|
export declare const HOOKED: Lash;
|
|
36
37
|
/**
|
|
37
38
|
* Where its tail is through a strike (TAILS, by the cut): it goes from HOOKED to the strike's poise
|
|
38
|
-
*
|
|
39
|
-
* at the
|
|
40
|
-
*
|
|
39
|
+
* in the first third of the wind-up (or most of the way to the strike for a special), so it answers
|
|
40
|
+
* the click at once (the user, 2026-11-16), is driven to its end at the strike, eased in, then
|
|
41
|
+
* comes back. A charge holds it cocked on its side, drawn in and coiled in an S over a tap of
|
|
42
|
+
* charge, then still but for its breath with the clock `t` (the user, 2026-11-16); let go, it
|
|
43
|
+
* strikes from there. The SPIN turns the tail low once round the body.
|
|
41
44
|
*/
|
|
42
45
|
export declare const lashOf: (p: Pick<PlayerState, "cut" | "swing" | "heavy" | "charge" | "down">, t?: number) => Lash;
|
|
43
46
|
/** A solved skeleton (solve() in rig.ts): each joint's place and turn in the world. */
|
|
@@ -259,28 +259,37 @@ export declare const PUNCH_HITS: number, PUNCH_STUN: number, PUNCH_MEMORY: numbe
|
|
|
259
259
|
/**
|
|
260
260
|
* The xenomorph (the user, 2026-11-15; kit.ts). XENO_HP health. It clings to a wall it faces with
|
|
261
261
|
* forward and the sprint held (MODE.CLING, physics.ts; the sprint since the user, 2026-11-16):
|
|
262
|
-
*
|
|
263
|
-
* while the wall rises CLING_HOLD m over its feet; a jump kicks it off along the look at CLING_LEAP
|
|
262
|
+
* up, down or along it at a walk (CLING_WALK of its run), with the sprint key at its run then its
|
|
263
|
+
* sprint as on a floor (the user, 2026-11-16) while the wall rises CLING_HOLD m over its feet; a jump kicks it off along the look at CLING_LEAP
|
|
264
264
|
* m/s. It dashes as a man does, XENO_DASH times as fast so as far, three in a row (kit.ts; the
|
|
265
265
|
* user, 2026-11-16: no more charged pounce); an enemy its dash's burst reaches is pinned (room.ts):
|
|
266
266
|
* POUNCE_HP health, his flag dropped, a stumble of POUNCE_STUN ticks, once per TACKLE_COOLDOWN. An
|
|
267
267
|
* enemy whose katana or fists hit it loses ACID_HP.
|
|
268
268
|
*/
|
|
269
269
|
export declare const XENO_HP = 12;
|
|
270
|
-
export declare const CLING_SPEED = 8;
|
|
271
270
|
export declare const CLING_FACING = 0.6;
|
|
272
271
|
export declare const CLING_HOLD = 0.4;
|
|
273
272
|
export declare const CLING_LEAP = 10;
|
|
273
|
+
/** Its walk on a wall, a share of its run: the sprint key runs there (the user, 2026-11-16). */
|
|
274
|
+
export declare const CLING_WALK = 0.5;
|
|
274
275
|
/** 1.4: a step of its burst stays under PLAYER_R, so it cannot tunnel through a thin brush (physics.ts). */
|
|
275
276
|
export declare const XENO_DASH = 1.4;
|
|
276
277
|
export declare const POUNCE_HP: number, POUNCE_STUN: number;
|
|
277
278
|
/**
|
|
278
279
|
* The glory kill (the user, 2026-11-16, after DOOM 2016): an enemy with GLORY_HP health or less, up,
|
|
279
|
-
* flashes
|
|
280
|
-
*
|
|
281
|
-
*
|
|
280
|
+
* flashes to one with the katana in hand, who beheads him on E within GLORY_REACH metres. The
|
|
281
|
+
* xenomorph's takes any enemy up, with no flash (the user, 2026-11-16): E within GLORY_FAR metres
|
|
282
|
+
* of him, in sight, and GLORY_ARC radians of its look locks the two (`lock`, `foe`, as a saber
|
|
283
|
+
* lock) for GLORY_TICKS, where he does not move and it dashes to him, then it eats his head: he
|
|
284
|
+
* goes down through his armour (LIMB.EATEN), a frag of FRAG.GLORY.
|
|
282
285
|
*/
|
|
283
286
|
export declare const GLORY_HP: number, GLORY_REACH: number, GLORY_ARC: number, GLORY_TICKS: number;
|
|
287
|
+
/**
|
|
288
|
+
* The xenomorph's glory kill from afar (the user, 2026-11-16): within GLORY_FAR metres, in sight,
|
|
289
|
+
* it dashes to a metre of its prey over the first GLORY_DASH ticks of the lock. 7 m in 20 ticks is
|
|
290
|
+
* 21 m/s, a step under PLAYER_R: it cannot tunnel.
|
|
291
|
+
*/
|
|
292
|
+
export declare const GLORY_FAR: number, GLORY_DASH: number;
|
|
284
293
|
/** The katana's glory kill (room.ts feast()): the speed it throws the beheaded body back at. */
|
|
285
294
|
export declare const GLORY_PUSH = 7;
|
|
286
295
|
/** How much faster than a man the xenomorph runs (the user, 2026-11-16: a little, not twice). */
|
|
@@ -105,6 +105,11 @@ export declare const floored: (p: Pick<PlayerState, "zap" | "stun">) => boolean;
|
|
|
105
105
|
* two steps. The katana's shock calls it with its own ticks and knock.
|
|
106
106
|
*/
|
|
107
107
|
export declare const stumble: (p: PlayerState, dx: number, dz: number, ticks?: number, knock?: number) => void;
|
|
108
|
+
/**
|
|
109
|
+
* A step along its speed, through the boxes and bodies as fly() takes it, with no gravity and no
|
|
110
|
+
* control: the xenomorph's dash to its glory kill's prey (gun.ts).
|
|
111
|
+
*/
|
|
112
|
+
export declare const coast: (p: PlayerState, w: World, bodies: readonly Body[]) => void;
|
|
108
113
|
/**
|
|
109
114
|
* Applies one input for 1 / TICK_HZ s, in place: yaw and pitch from the input (pitch clamped to
|
|
110
115
|
* MAX_PITCH), then the step of the current mode (see the top of the file). Feet under the world's
|
|
@@ -185,12 +185,14 @@ export declare class Room {
|
|
|
185
185
|
/** 1 hp of the bolt's drain to `foe`, as his railer deals it; if it puts him down he is disintegrated (`fried`). */
|
|
186
186
|
private fry;
|
|
187
187
|
/**
|
|
188
|
-
* E pressed by `p`, the xenomorph or one with the katana in hand: the nearest enemy who is up
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
188
|
+
* E pressed by `p`, the xenomorph or one with the katana in hand: the nearest enemy who is up,
|
|
189
|
+
* within GLORY_ARC of its look where `p` drew him, and in no lock, is glory killed (glory()):
|
|
190
|
+
* with the katana within GLORY_REACH and with GLORY_HP or less, the xenomorph's within
|
|
191
|
+
* GLORY_FAR, in sight, at any health (the user, 2026-11-16). The katana takes his head at once
|
|
192
|
+
* and throws the body back GLORY_PUSH m/s, the follow-through of a cut across in hand (the user,
|
|
193
|
+
* 2026-11-16). The xenomorph holds him: the two locked (`lock`, `foe`) for GLORY_TICKS, his flag
|
|
194
|
+
* dropped, `p` dashing to a metre of him (the user, 2026-11-16); duel() ends it. True when it
|
|
195
|
+
* happened.
|
|
194
196
|
*/
|
|
195
197
|
private feast;
|
|
196
198
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PlayerState } from './types';
|
|
2
|
+
import type { World } from './world';
|
|
2
3
|
/** Whether the player's body is a weapon: in a slide, or in the burst of a dash. */
|
|
3
4
|
export declare const tackling: (p: PlayerState) => boolean;
|
|
4
5
|
/**
|
|
@@ -12,8 +13,10 @@ export declare const pouncing: (p: PlayerState) => boolean;
|
|
|
12
13
|
*/
|
|
13
14
|
export declare const reaches: (a: PlayerState, b: PlayerState) => boolean;
|
|
14
15
|
/**
|
|
15
|
-
* The enemy
|
|
16
|
-
*
|
|
17
|
-
* GLORY_REACH on the floor plane,
|
|
16
|
+
* The enemy `me` would glory kill with E (room.ts feast()), of `foes` as it sees them: the nearest
|
|
17
|
+
* one up, in no lock and not seated, a body's height above or below and GLORY_ARC of its look. With
|
|
18
|
+
* the katana (`w` undefined) within GLORY_REACH on the floor plane, with GLORY_HP health or less;
|
|
19
|
+
* the xenomorph's within GLORY_FAR, in sight through the world `w`, at any health (the user,
|
|
20
|
+
* 2026-11-16).
|
|
18
21
|
*/
|
|
19
|
-
export declare const glory: (me: PlayerState, foes: readonly PlayerState[]) => PlayerState | undefined;
|
|
22
|
+
export declare const glory: (me: PlayerState, foes: readonly PlayerState[], w?: World) => PlayerState | undefined;
|
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.181.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|