@korial29/tiny-fps 1.3.0 → 1.4.1
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/assets/{room-YVvLRPyv.js → room-CPp_hgii.js} +245 -155
- package/dist/brick-D5SJVjYo.js +1 -0
- package/dist/index.js +4 -4
- package/dist/landfall-DB8gCv3d.js +21 -0
- package/dist/local.js +1 -1
- package/dist/paint-CV6qcA8q.js +4 -0
- package/dist/room.js +1 -1
- package/dist/server.js +1 -1
- package/dist/{stone-ialWt0_i.js → stone-CnnB3DM5.js} +1 -1
- package/dist/{textures-h3GhbO1i.js → textures-ry-qPiMg.js} +1 -1
- package/dist/{tranquility-CW30oP0N.js → tranquility-DfbOPVxG.js} +1 -1
- package/dist/types/client/granite.d.ts +17 -0
- package/dist/types/client/render.d.ts +6 -3
- package/dist/types/shared/beach.d.ts +25 -8
- package/dist/types/shared/nav.d.ts +8 -3
- package/dist/types/shared/relief.d.ts +5 -0
- package/dist/types/shared/routes.d.ts +1 -1
- package/package.json +1 -1
- package/dist/brick-ol_VpTX9.js +0 -1
- package/dist/landfall-BuNoJDoz.js +0 -1
- package/dist/paint-Jz4w0T-7.js +0 -4
|
@@ -465,7 +465,7 @@ var made = /* @__PURE__ */ new WeakMap();
|
|
|
465
465
|
var raise = (def) => {
|
|
466
466
|
const old = made.get(def);
|
|
467
467
|
if (old) return old;
|
|
468
|
-
const { hole, bound, cell, at, pits = [] } = def;
|
|
468
|
+
const { hole, bound, cell, at, pits = [], origin: [ox, oz] = [0, 0] } = def;
|
|
469
469
|
const box = pits.reduce((b, q) => [
|
|
470
470
|
Math.min(b[0], q[0]),
|
|
471
471
|
Math.min(b[1], q[1]),
|
|
@@ -478,8 +478,8 @@ var raise = (def) => {
|
|
|
478
478
|
-Infinity
|
|
479
479
|
]);
|
|
480
480
|
const [cx, cz, a, b] = bound;
|
|
481
|
-
const x0 = Math.floor((cx - a) / cell) * cell;
|
|
482
|
-
const z0 = Math.floor((cz - b) / cell) * cell;
|
|
481
|
+
const x0 = Math.floor((cx - a - ox) / cell) * cell + ox;
|
|
482
|
+
const z0 = Math.floor((cz - b - oz) / cell) * cell + oz;
|
|
483
483
|
const nx = Math.ceil((cx + a - x0) / cell) + 1;
|
|
484
484
|
const nz = Math.ceil((cz + b - z0) / cell) + 1;
|
|
485
485
|
const h = new Float32Array(nx * nz);
|
|
@@ -5343,7 +5343,7 @@ var MOON = {
|
|
|
5343
5343
|
seam: ORBIT.SEAM,
|
|
5344
5344
|
station: STATION_DEF
|
|
5345
5345
|
};
|
|
5346
|
-
var MID$1 =
|
|
5346
|
+
var MID$1 = 125;
|
|
5347
5347
|
var [RED, BLUE] = TEAM_TINT;
|
|
5348
5348
|
var { METAL, STEEL, PAINT, WOOD, STONE, GRATE } = TEX;
|
|
5349
5349
|
var ORANGE = [
|
|
@@ -5359,15 +5359,16 @@ var YELLOW = [
|
|
|
5359
5359
|
/**
|
|
5360
5360
|
* The frame every piece is laid on, metres. Across x, from the sea to the forest: the water is too
|
|
5361
5361
|
* deep at `sea`, the waterline is at `shore` (the sand is at `water` there), the first trees stand
|
|
5362
|
-
* at `trees`, nothing is walked past `east`. Along z the
|
|
5363
|
-
* `cape` and after ZED - `cape
|
|
5362
|
+
* at `trees`, nothing is walked past `east`. Along z the sand runs on past each camp, among rocks,
|
|
5363
|
+
* to the headland's mass of rock, which closes the beach before z = `cape` and after ZED - `cape`:
|
|
5364
|
+
* past the ends of the 250 m, `cape` being negative.
|
|
5364
5365
|
*/
|
|
5365
5366
|
var FRAME = {
|
|
5366
5367
|
sea: 0,
|
|
5367
5368
|
shore: 30,
|
|
5368
5369
|
trees: 90,
|
|
5369
5370
|
east: 110,
|
|
5370
|
-
cape:
|
|
5371
|
+
cape: -6,
|
|
5371
5372
|
water: 0
|
|
5372
5373
|
};
|
|
5373
5374
|
/**
|
|
@@ -5376,10 +5377,10 @@ var FRAME = {
|
|
|
5376
5377
|
* at 1.4 m of water a standing runner still looks over it.
|
|
5377
5378
|
*/
|
|
5378
5379
|
var DEPTH = -1.4;
|
|
5379
|
-
/** Where nobody goes, x and z: the ghost wall behind the first palms and the one in each headland. */
|
|
5380
|
+
/** Where nobody goes, x and z: the ghost wall behind the first palms, and the one in each headland's mass, 4 m into it (z = cape and ZED - cape). */
|
|
5380
5381
|
var EDGE$1 = {
|
|
5381
5382
|
east: FRAME.trees + 5,
|
|
5382
|
-
cape: FRAME.cape
|
|
5383
|
+
cape: FRAME.cape - 4
|
|
5383
5384
|
};
|
|
5384
5385
|
/**
|
|
5385
5386
|
* The wreck, a hull along x on the centre line, broken in three: each section's x0 and x1. The
|
|
@@ -5738,121 +5739,186 @@ var WING$1 = {
|
|
|
5738
5739
|
*/
|
|
5739
5740
|
var ENGINES = [[
|
|
5740
5741
|
38.5,
|
|
5741
|
-
|
|
5742
|
+
150.3,
|
|
5742
5743
|
2.7,
|
|
5743
5744
|
19,
|
|
5744
5745
|
.78
|
|
5745
5746
|
], [
|
|
5746
5747
|
4.5,
|
|
5747
|
-
|
|
5748
|
+
137,
|
|
5748
5749
|
2.5,
|
|
5749
5750
|
9
|
|
5750
5751
|
]];
|
|
5751
5752
|
/** Red's camp: the escape pod its flag stands by (x, z, radius). */
|
|
5752
5753
|
var POD = [
|
|
5753
5754
|
60,
|
|
5754
|
-
|
|
5755
|
+
219,
|
|
5755
5756
|
4
|
|
5756
5757
|
];
|
|
5757
5758
|
/** The camp's ground, level. */
|
|
5758
5759
|
var CAMP = 1.25;
|
|
5759
5760
|
/**
|
|
5760
|
-
* Red's headland
|
|
5761
|
-
*
|
|
5762
|
-
*
|
|
5761
|
+
* Red's headland: each rock's x, z, radius, height and seed, a form of blockOf(). Blue's are their
|
|
5762
|
+
* twins. The map makes them solid and the scenery draws them, both from this list. Low and
|
|
5763
|
+
* scattered on the sand behind the camp, open sand between them, and along the waterline none: the
|
|
5764
|
+
* strand runs on past the headland's wall (EDGE.cape), which stands on open sand there, to rocks
|
|
5765
|
+
* in the sea that are only drawn. Bigger toward the trees, where the headland's mass begins.
|
|
5763
5766
|
*/
|
|
5764
5767
|
var ROCKS = [
|
|
5765
5768
|
[
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5769
|
+
38,
|
|
5770
|
+
237,
|
|
5771
|
+
3.5,
|
|
5772
|
+
2.6,
|
|
5770
5773
|
1
|
|
5771
5774
|
],
|
|
5772
5775
|
[
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5776
|
+
57,
|
|
5777
|
+
242,
|
|
5778
|
+
3,
|
|
5779
|
+
2.2,
|
|
5777
5780
|
2
|
|
5778
5781
|
],
|
|
5779
5782
|
[
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5783
|
+
47,
|
|
5784
|
+
251,
|
|
5785
|
+
4,
|
|
5786
|
+
3,
|
|
5784
5787
|
3
|
|
5785
5788
|
],
|
|
5786
5789
|
[
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5790
|
+
66,
|
|
5791
|
+
254,
|
|
5792
|
+
4.5,
|
|
5793
|
+
3.6,
|
|
5791
5794
|
4
|
|
5792
5795
|
],
|
|
5793
5796
|
[
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5797
|
+
78,
|
|
5798
|
+
241,
|
|
5799
|
+
4,
|
|
5800
|
+
3.4,
|
|
5798
5801
|
5
|
|
5799
5802
|
],
|
|
5800
5803
|
[
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
8,
|
|
5804
|
-
|
|
5804
|
+
33,
|
|
5805
|
+
256,
|
|
5806
|
+
2.8,
|
|
5807
|
+
1.8,
|
|
5805
5808
|
6
|
|
5806
5809
|
],
|
|
5807
5810
|
[
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5811
|
+
87,
|
|
5812
|
+
250,
|
|
5813
|
+
5.5,
|
|
5814
|
+
5,
|
|
5812
5815
|
7
|
|
5813
5816
|
],
|
|
5814
5817
|
[
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5818
|
+
97,
|
|
5819
|
+
243,
|
|
5820
|
+
6,
|
|
5821
|
+
6.5,
|
|
5819
5822
|
8
|
|
5820
5823
|
],
|
|
5821
5824
|
[
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
7,
|
|
5825
|
-
|
|
5825
|
+
100,
|
|
5826
|
+
256,
|
|
5827
|
+
7.5,
|
|
5828
|
+
9,
|
|
5826
5829
|
9
|
|
5827
5830
|
],
|
|
5828
5831
|
[
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
8,
|
|
5832
|
-
12,
|
|
5833
|
-
10
|
|
5834
|
-
],
|
|
5835
|
-
[
|
|
5836
|
-
105,
|
|
5837
|
-
194,
|
|
5832
|
+
89,
|
|
5833
|
+
262,
|
|
5838
5834
|
7,
|
|
5839
|
-
|
|
5840
|
-
|
|
5835
|
+
7,
|
|
5836
|
+
10
|
|
5841
5837
|
]
|
|
5842
5838
|
];
|
|
5843
5839
|
/**
|
|
5840
|
+
* The form of a block of granite of radius R and height H from a seed, as rockOf() in moon.ts: how
|
|
5841
|
+
* far it reaches from its middle (rockMid() over the ground) along a unit vector. A rounded box
|
|
5842
|
+
* (superellipsoids of the powers 4 and 8 blended: flat faces, rounded edges), turned and stretched by the seed, split
|
|
5843
|
+
* by two planes (a corner or a side sheared off, the edge softened), its faces dented by a low
|
|
5844
|
+
* noise. Under its middle it goes straight down, as wide as at its middle, to under the ground.
|
|
5845
|
+
* Only + - * /, Math.sqrt and the hash: the map's boxes come from it on every side.
|
|
5846
|
+
*/
|
|
5847
|
+
var blockOf = (s, R, H) => {
|
|
5848
|
+
const h = (k) => hash(s, k, 151);
|
|
5849
|
+
const t = 2 * h(1) - 1;
|
|
5850
|
+
const [cx, sx] = [(1 - t * t) / (1 + t * t), 2 * t / (1 + t * t)];
|
|
5851
|
+
const c = H - rockMid(H);
|
|
5852
|
+
const [a, b] = [R * (.85 + .3 * h(2)), R * (.6 + .3 * h(3))];
|
|
5853
|
+
const deep = rockMid(H) + .7 * H;
|
|
5854
|
+
/** The split planes: a unit normal and how far out of the middle along it, of what the box reaches there. */
|
|
5855
|
+
const cuts = [4, 8].map((k) => {
|
|
5856
|
+
const [nx, ny, nz] = [
|
|
5857
|
+
2 * h(k) - 1,
|
|
5858
|
+
.35 * h(k + 1),
|
|
5859
|
+
2 * h(k + 2) - 1
|
|
5860
|
+
];
|
|
5861
|
+
const l = Math.sqrt(nx * nx + ny * ny + nz * nz);
|
|
5862
|
+
return [
|
|
5863
|
+
nx / l,
|
|
5864
|
+
ny / l,
|
|
5865
|
+
nz / l,
|
|
5866
|
+
.7 + .2 * h(k + 3)
|
|
5867
|
+
];
|
|
5868
|
+
});
|
|
5869
|
+
const box = (u) => {
|
|
5870
|
+
const x = (u[0] * cx + u[2] * sx) / a;
|
|
5871
|
+
const z = (u[2] * cx - u[0] * sx) / b;
|
|
5872
|
+
const y = u[1] / c;
|
|
5873
|
+
const [x4, y4, z4] = [
|
|
5874
|
+
x * x * x * x,
|
|
5875
|
+
y * y * y * y,
|
|
5876
|
+
z * z * z * z
|
|
5877
|
+
];
|
|
5878
|
+
const p4 = Math.sqrt(Math.sqrt(x4 + y4 + z4));
|
|
5879
|
+
const p8 = Math.sqrt(Math.sqrt(Math.sqrt(x4 * x4 + y4 * y4 + z4 * z4)));
|
|
5880
|
+
return .25 / p4 + .75 / p8;
|
|
5881
|
+
};
|
|
5882
|
+
const reach = (u) => {
|
|
5883
|
+
if (u[1] < 0) {
|
|
5884
|
+
const l = Math.sqrt(u[0] * u[0] + u[2] * u[2]);
|
|
5885
|
+
return l < 1e-6 ? deep : Math.min(reach([
|
|
5886
|
+
u[0] / l,
|
|
5887
|
+
0,
|
|
5888
|
+
u[2] / l
|
|
5889
|
+
]) / l, deep / -u[1]);
|
|
5890
|
+
}
|
|
5891
|
+
let r = box(u);
|
|
5892
|
+
for (const [nx, ny, nz, k] of cuts) {
|
|
5893
|
+
const d = u[0] * nx + u[1] * ny + u[2] * nz;
|
|
5894
|
+
if (d > .001) {
|
|
5895
|
+
const p = k * box([
|
|
5896
|
+
nx,
|
|
5897
|
+
ny,
|
|
5898
|
+
nz
|
|
5899
|
+
]) / d;
|
|
5900
|
+
const w = Math.max(.2 - Math.abs(r - p), 0) / .2;
|
|
5901
|
+
r = Math.min(r, p) - .05 * w * w;
|
|
5902
|
+
}
|
|
5903
|
+
}
|
|
5904
|
+
return r * (.95 + .08 * noise(1.3 * u[0] + s, 1.3 * u[2] + 1.1 * u[1], s + 3));
|
|
5905
|
+
};
|
|
5906
|
+
return { reach };
|
|
5907
|
+
};
|
|
5908
|
+
/**
|
|
5844
5909
|
* Red's first row of palms, the trunks a runner can touch: each x, z and radius at the foot. The
|
|
5845
5910
|
* map makes them solid and the scenery draws a palm on each; the forest behind is drawn only.
|
|
5846
5911
|
* The first stands clear of the nose's flank.
|
|
5847
5912
|
*/
|
|
5848
|
-
var TRUNKS = Array.from({ length:
|
|
5913
|
+
var TRUNKS = Array.from({ length: 28 }, (_, i) => [
|
|
5849
5914
|
FRAME.trees + 3 * hash(i, 1, 7),
|
|
5850
|
-
|
|
5915
|
+
134 + 4 * i + 2 * hash(i, 2, 7),
|
|
5851
5916
|
.22 + .1 * hash(i, 3, 7)
|
|
5852
5917
|
]);
|
|
5853
5918
|
var c1 = (t) => Math.min(Math.max(t, 0), 1);
|
|
5854
5919
|
var sm = (t) => c1(t) * c1(t) * (3 - 2 * c1(t));
|
|
5855
5920
|
var far = (a, b) => Math.sqrt(a * a + b * b);
|
|
5921
|
+
MID$1 % 4;
|
|
5856
5922
|
/**
|
|
5857
5923
|
* Where the ground is level, x0, z0, x1, z1 (z in red's half) and the height: the way in to the
|
|
5858
5924
|
* hold's door through the bank, the sand under the tip of the wing, the camp. Level for 6 m round each, so that
|
|
@@ -5861,23 +5927,23 @@ var far = (a, b) => Math.sqrt(a * a + b * b);
|
|
|
5861
5927
|
var FLATS = [
|
|
5862
5928
|
[
|
|
5863
5929
|
57,
|
|
5864
|
-
|
|
5930
|
+
132,
|
|
5865
5931
|
61,
|
|
5866
|
-
|
|
5932
|
+
138,
|
|
5867
5933
|
HOLD.floor - .25
|
|
5868
5934
|
],
|
|
5869
5935
|
[
|
|
5870
5936
|
56,
|
|
5871
|
-
|
|
5937
|
+
171,
|
|
5872
5938
|
66,
|
|
5873
|
-
|
|
5939
|
+
175,
|
|
5874
5940
|
1.3
|
|
5875
5941
|
],
|
|
5876
5942
|
[
|
|
5877
5943
|
44,
|
|
5878
|
-
|
|
5944
|
+
209,
|
|
5879
5945
|
76,
|
|
5880
|
-
|
|
5946
|
+
229,
|
|
5881
5947
|
CAMP
|
|
5882
5948
|
]
|
|
5883
5949
|
];
|
|
@@ -5906,9 +5972,9 @@ var at$2 = (x, z) => {
|
|
|
5906
5972
|
};
|
|
5907
5973
|
/** The ground as it is walked on: at()'s lattice in float32, each square two triangles, as ground() in relief.ts reads it. */
|
|
5908
5974
|
var walked = (x, z) => {
|
|
5909
|
-
const [i, j] = [Math.floor(x / 4), Math.floor(z / 4)];
|
|
5910
|
-
const [fu, fv] = [x / 4 - i, z / 4 - j];
|
|
5911
|
-
const h = (u, v) => Math.fround(at$2(4 * (i + u), 4 * (j + v)));
|
|
5975
|
+
const [i, j] = [Math.floor(x / 4), Math.floor((z - 1) / 4)];
|
|
5976
|
+
const [fu, fv] = [x / 4 - i, (z - 1) / 4 - j];
|
|
5977
|
+
const h = (u, v) => Math.fround(at$2(4 * (i + u), 1 + 4 * (j + v)));
|
|
5912
5978
|
const [a, e] = [h(0, 0), h(1, 1)];
|
|
5913
5979
|
return fu >= fv ? a + (h(1, 0) - a) * fu + (e - h(1, 0)) * fv : a + (h(0, 1) - a) * fv + (e - h(0, 1)) * fu;
|
|
5914
5980
|
};
|
|
@@ -5936,19 +6002,19 @@ var flip$1 = (b) => ({
|
|
|
5936
6002
|
min: [
|
|
5937
6003
|
b.min[0],
|
|
5938
6004
|
b.min[1],
|
|
5939
|
-
|
|
6005
|
+
250 - b.max[2]
|
|
5940
6006
|
],
|
|
5941
6007
|
max: [
|
|
5942
6008
|
b.max[0],
|
|
5943
6009
|
b.max[1],
|
|
5944
|
-
|
|
6010
|
+
250 - b.min[2]
|
|
5945
6011
|
],
|
|
5946
6012
|
...b.tint ? { tint: b.tint === RED ? BLUE : b.tint } : {}
|
|
5947
6013
|
});
|
|
5948
6014
|
var flipPoint = ([x, y, z]) => [
|
|
5949
6015
|
x,
|
|
5950
6016
|
y,
|
|
5951
|
-
|
|
6017
|
+
250 - z
|
|
5952
6018
|
];
|
|
5953
6019
|
var both = (l, ...mid) => [
|
|
5954
6020
|
...l,
|
|
@@ -6044,38 +6110,38 @@ var hull$1 = () => SHIP$1.flatMap(({ cut, floor, holes, tears, fair, crates }, n
|
|
|
6044
6110
|
})];
|
|
6045
6111
|
}), ...crates.map(([x, deck]) => {
|
|
6046
6112
|
const y = c + (DECKS[deck] ?? floor);
|
|
6047
|
-
return note(line, "crate", box(x, y,
|
|
6113
|
+
return note(line, "crate", box(x, y, 124.25, x + 1.5, y + [
|
|
6048
6114
|
1,
|
|
6049
6115
|
1.4,
|
|
6050
6116
|
2
|
|
6051
|
-
][deck + 1],
|
|
6117
|
+
][deck + 1], 125.75, WOOD));
|
|
6052
6118
|
})];
|
|
6053
6119
|
});
|
|
6054
6120
|
var BACK$2 = HULL.axis.map((c) => c + HULL.r);
|
|
6055
6121
|
/** A heap of ribs in the middle of each gap, a pack on it, and a fallen frame leaning on each broken end. */
|
|
6056
6122
|
var GAPS = [40, 78].map((x) => {
|
|
6057
|
-
const [hi, lo] = under$1(x - 1.5,
|
|
6123
|
+
const [hi, lo] = under$1(x - 1.5, 123.5, x + 1.5, 126.5);
|
|
6058
6124
|
const top = Math.round((Math.max(hi, FRAME.water) + .4) * 32) / 32;
|
|
6059
6125
|
return {
|
|
6060
6126
|
x,
|
|
6061
6127
|
top,
|
|
6062
|
-
heap: box(x - 1.5, lo - .5,
|
|
6128
|
+
heap: box(x - 1.5, lo - .5, 123.5, x + 1.5, top, 126.5, STEEL, ORANGE)
|
|
6063
6129
|
};
|
|
6064
6130
|
});
|
|
6065
6131
|
/** A frame fallen against one broken end of each gap, on both sides of the line: the way through is between it and the heap, or round the heap's other side. */
|
|
6066
6132
|
var FRAMES = [36, 74].flatMap((x) => {
|
|
6067
|
-
const [hi, lo] = under$1(x,
|
|
6068
|
-
const b = box(x, lo - .5,
|
|
6133
|
+
const [hi, lo] = under$1(x, 128, x + 1.2, 130.5);
|
|
6134
|
+
const b = box(x, lo - .5, 128, x + 1.2, Math.round((hi + 1.4) * 32) / 32, 130.5, STEEL);
|
|
6069
6135
|
return [b, flip$1(b)];
|
|
6070
6136
|
});
|
|
6071
6137
|
/** The raft of the tail's skin afloat off its end, on the line: the middle of the way round. */
|
|
6072
|
-
var RAFT = box(.5, -.3,
|
|
6138
|
+
var RAFT = box(.5, -.3, 121, 5, .4, 129, METAL);
|
|
6073
6139
|
var centre = [
|
|
6074
6140
|
...hull$1(),
|
|
6075
6141
|
...GAPS.map((g) => note(line, "heap", g.heap)),
|
|
6076
6142
|
...FRAMES.map((b) => note(line, "frame", b)),
|
|
6077
6143
|
note(line, "raft", RAFT),
|
|
6078
|
-
ghost(box(EDGE$1.east, -10,
|
|
6144
|
+
ghost(box(EDGE$1.east, -10, EDGE$1.cape - 2, EDGE$1.east + 2, 40, 250 - EDGE$1.cape + 2, STONE))
|
|
6079
6145
|
];
|
|
6080
6146
|
/** How much a row of the wing stands over the next at most, metres. */
|
|
6081
6147
|
var RISE = .15;
|
|
@@ -6140,14 +6206,14 @@ var FIRES = [...[on(FALLEN[3]), [
|
|
|
6140
6206
|
], [
|
|
6141
6207
|
x,
|
|
6142
6208
|
y,
|
|
6143
|
-
|
|
6209
|
+
250 - z,
|
|
6144
6210
|
42,
|
|
6145
6211
|
1.3,
|
|
6146
6212
|
7
|
|
6147
6213
|
]]), ...HULL.sections.flatMap(([x0, x1], n) => [n && x0 - .6, n < 2 && x1 + .6].filter((x) => x).map((x) => [
|
|
6148
6214
|
+x,
|
|
6149
6215
|
HULL.axis[n] + 4.2,
|
|
6150
|
-
|
|
6216
|
+
125,
|
|
6151
6217
|
28,
|
|
6152
6218
|
.9,
|
|
6153
6219
|
4
|
|
@@ -6165,9 +6231,9 @@ var ENGINE = (() => {
|
|
|
6165
6231
|
* hands reach the deck from it and the hanging body clears it.
|
|
6166
6232
|
*/
|
|
6167
6233
|
var FLOATS$2 = [
|
|
6168
|
-
note(mine, "float", box(16, -1.6,
|
|
6169
|
-
note(mine, "float", box(10, -.2,
|
|
6170
|
-
note(mine, "float", box(23, -1.6,
|
|
6234
|
+
note(mine, "float", box(16, -1.6, 141, 22, .35, 144, METAL)),
|
|
6235
|
+
note(mine, "float", box(10, -.2, 138, 13, .5, 141, METAL)),
|
|
6236
|
+
note(mine, "float", box(23, -1.6, 132.6, 26, .2, 135, METAL))
|
|
6171
6237
|
];
|
|
6172
6238
|
/** The camp: the pod, the flag's step by it, a crate under each rack with a tarpaulin over it. */
|
|
6173
6239
|
var POD_BOX = note(mine, "pod", box(POD[0] - 3, .75, POD[1] - 3, POD[0] + 3, 4.25, POD[1] + 3, METAL));
|
|
@@ -6175,47 +6241,47 @@ var DAIS = note(mine, "dais", box(POD[0] - 2, .75, POD[1] - 10, POD[0] + 2, 1.3,
|
|
|
6175
6241
|
var crate = (x, z, h = .4, tint) => lay("crate", x - 1.5, z - 1.5, x + 1.5, z + 1.5, h, WOOD, tint);
|
|
6176
6242
|
/** A tarpaulin on four poles, wider than deep: no pole on a diagonal of the crate under it, where it would hide the rack from a spawn. */
|
|
6177
6243
|
var shelter = (x, z) => [box(x - 2.6, 3.85, z - 2.1, x + 2.6, 4, z + 2.1, PAINT, RED), ...[-1, 1].flatMap((a) => [-1, 1].map((b) => box(x + 2.5 * a - .1, .75, z + 2 * b - .1, x + 2.5 * a + .1, 3.85, z + 2 * b + .1, STEEL)))].map((b) => note(mine, "shelter", b));
|
|
6178
|
-
var [GUNS$1, BLADES] = [crate(49,
|
|
6179
|
-
var [RIFLES, RAILS] = [crate(84,
|
|
6244
|
+
var [GUNS$1, BLADES] = [crate(49, 221), crate(71, 221)];
|
|
6245
|
+
var [RIFLES, RAILS] = [crate(84, 185, .4, RED), crate(33, 153, .4, RED)];
|
|
6180
6246
|
/** The debris between the camp and the wing, a line to run: a panel, a container, the landing gear, a second container, the wing. */
|
|
6181
|
-
var PANEL = lay("panel", 67,
|
|
6182
|
-
var CONTAINER = lay("container", 68.5,
|
|
6183
|
-
var GEAR = lay("gear", 68.6,
|
|
6247
|
+
var PANEL = lay("panel", 67, 184.5, 70.5, 188, .65, METAL);
|
|
6248
|
+
var CONTAINER = lay("container", 68.5, 176, 71.1, 182, 1.875, METAL, ORANGE);
|
|
6249
|
+
var GEAR = lay("gear", 68.6, 170.6, 71, 173, 2.9, STEEL, YELLOW);
|
|
6184
6250
|
/** A second container, between the landing gear and the wing's second break. */
|
|
6185
|
-
var LAST = lay("container", 64,
|
|
6186
|
-
var BOGIE = lay("gear", 67.6,
|
|
6251
|
+
var LAST = lay("container", 64, 164.5, 67.5, 168, 2.6, METAL, ORANGE);
|
|
6252
|
+
var BOGIE = lay("gear", 67.6, 169.6, 72, 170.6, 1.2, STEEL);
|
|
6187
6253
|
/** What else lies about red's half, most with a pack on it. */
|
|
6188
6254
|
var SCRAP = {
|
|
6189
|
-
camp: [crate(76,
|
|
6255
|
+
camp: [crate(76, 213), crate(40, 217)],
|
|
6190
6256
|
west: [
|
|
6191
|
-
lay("panel", 44.5,
|
|
6192
|
-
lay("container", 33,
|
|
6193
|
-
lay("panel", 41,
|
|
6194
|
-
lay("panel", 25.5,
|
|
6195
|
-
lay("panel", 50.5,
|
|
6196
|
-
lay("container", 49.5,
|
|
6257
|
+
lay("panel", 44.5, 191.5, 47.5, 194.5, .5, METAL),
|
|
6258
|
+
lay("container", 33, 173.7, 39, 176.3, 2.2, METAL, ORANGE),
|
|
6259
|
+
lay("panel", 41, 163.5, 44, 166.5, .4, METAL),
|
|
6260
|
+
lay("panel", 25.5, 159.5, 28.5, 162.5, .5, METAL),
|
|
6261
|
+
lay("panel", 50.5, 139.5, 53.5, 142.5, .4, METAL),
|
|
6262
|
+
lay("container", 49.5, 132.4, 52.5, 135, 2.6, METAL, ORANGE)
|
|
6197
6263
|
],
|
|
6198
6264
|
east: [
|
|
6199
|
-
lay("panel", 62.5,
|
|
6200
|
-
crate(80,
|
|
6201
|
-
crate(85.5,
|
|
6202
|
-
crate(84,
|
|
6203
|
-
lay("panel", 84.5,
|
|
6265
|
+
lay("panel", 62.5, 145.5, 65.5, 148.5, .4, METAL),
|
|
6266
|
+
crate(80, 171),
|
|
6267
|
+
crate(85.5, 165),
|
|
6268
|
+
crate(84, 153),
|
|
6269
|
+
lay("panel", 84.5, 135.5, 87.5, 138.5, .4, METAL)
|
|
6204
6270
|
],
|
|
6205
6271
|
cover: [
|
|
6206
|
-
lay("panel", 78,
|
|
6207
|
-
lay("panel", 30,
|
|
6208
|
-
lay("container", 76,
|
|
6272
|
+
lay("panel", 78, 156.6, 83, 157, 2.6, METAL),
|
|
6273
|
+
lay("panel", 30, 166.6, 35, 167, 2.2, METAL),
|
|
6274
|
+
lay("container", 76, 190, 82, 192.6, 2.6, METAL, ORANGE)
|
|
6209
6275
|
]
|
|
6210
6276
|
};
|
|
6211
6277
|
/**
|
|
6212
|
-
* The boxes a headland rock collides with, inside what
|
|
6278
|
+
* The boxes a headland rock collides with, inside what blockOf() draws: layers `tall` high, each cut
|
|
6213
6279
|
* across x in strips `wide` wide that run from the rock's face toward the beach back to its far
|
|
6214
6280
|
* side or to `back`. Coarser than moon.ts fitted(), which would make 3000 boxes of red's eleven
|
|
6215
6281
|
* rocks: these stand at the end of the beach, behind the spawns.
|
|
6216
6282
|
*/
|
|
6217
6283
|
var massed = (x, z, R, H, s, back) => {
|
|
6218
|
-
const { reach } =
|
|
6284
|
+
const { reach } = blockOf(s, R, H);
|
|
6219
6285
|
const g = under$1(x - .8 * R, z - .8 * R, x + .8 * R, z + .8 * R);
|
|
6220
6286
|
const mid = walked(x, z) + rockMid(H);
|
|
6221
6287
|
const top = mid + reach([
|
|
@@ -6249,7 +6315,7 @@ var massed = (x, z, R, H, s, back) => {
|
|
|
6249
6315
|
return [edge(-1), edge(1)];
|
|
6250
6316
|
};
|
|
6251
6317
|
const out = [];
|
|
6252
|
-
const [wide, tall] = [2, 2];
|
|
6318
|
+
const [wide, tall] = [R < 5 ? 1 : R < 8 ? 2 : 3, H < 5 ? 1 : H < 12 ? 2 : 3];
|
|
6253
6319
|
for (let y0 = g[1] - .5; y0 < top - .3; y0 += tall) {
|
|
6254
6320
|
const y1 = Math.min(y0 + tall, top);
|
|
6255
6321
|
for (let x0 = -1.5 * R; x0 < 1.5 * R; x0 += wide) {
|
|
@@ -6284,7 +6350,7 @@ var CRAGS = ROCKS.map(([x, z, R, H, s]) => ({
|
|
|
6284
6350
|
R,
|
|
6285
6351
|
H,
|
|
6286
6352
|
s,
|
|
6287
|
-
parts: massed(x, z, R, H, s,
|
|
6353
|
+
parts: massed(x, z, R, H, s, 250 - EDGE$1.cape)
|
|
6288
6354
|
}));
|
|
6289
6355
|
var half = [
|
|
6290
6356
|
...wing(),
|
|
@@ -6295,8 +6361,8 @@ var half = [
|
|
|
6295
6361
|
DAIS,
|
|
6296
6362
|
GUNS$1,
|
|
6297
6363
|
BLADES,
|
|
6298
|
-
...shelter(49,
|
|
6299
|
-
...shelter(71,
|
|
6364
|
+
...shelter(49, 221),
|
|
6365
|
+
...shelter(71, 221),
|
|
6300
6366
|
RIFLES,
|
|
6301
6367
|
RAILS,
|
|
6302
6368
|
PANEL,
|
|
@@ -6310,7 +6376,7 @@ var half = [
|
|
|
6310
6376
|
return ghost(box(x - r, y - 1, z - r, x + r, y + 9, z + r, WOOD));
|
|
6311
6377
|
}),
|
|
6312
6378
|
...CRAGS.flatMap((c) => c.parts).map(([x0, y0, z0, x1, y1, z1]) => ghost(box(x0, y0, z0, x1, y1, z1, STONE))),
|
|
6313
|
-
ghost(box(-60, -10,
|
|
6379
|
+
ghost(box(-60, -10, 250 - EDGE$1.cape, EDGE$1.east + 2, 40, 250 - EDGE$1.cape + 2, STONE))
|
|
6314
6380
|
];
|
|
6315
6381
|
HULL.sections.map(([x0, x1], n) => [
|
|
6316
6382
|
x0,
|
|
@@ -6324,12 +6390,12 @@ HULL.sections.map(([x0, x1], n) => [
|
|
|
6324
6390
|
min: [
|
|
6325
6391
|
min[0],
|
|
6326
6392
|
min[1],
|
|
6327
|
-
|
|
6393
|
+
250 - max[2]
|
|
6328
6394
|
],
|
|
6329
6395
|
max: [
|
|
6330
6396
|
max[0],
|
|
6331
6397
|
max[1],
|
|
6332
|
-
|
|
6398
|
+
250 - min[2]
|
|
6333
6399
|
]
|
|
6334
6400
|
}))
|
|
6335
6401
|
], [...CRAGS, ...CRAGS.map((c) => ({
|
|
@@ -6337,15 +6403,15 @@ HULL.sections.map(([x0, x1], n) => [
|
|
|
6337
6403
|
at: [
|
|
6338
6404
|
c.at[0],
|
|
6339
6405
|
c.at[1],
|
|
6340
|
-
|
|
6406
|
+
250 - c.at[2]
|
|
6341
6407
|
],
|
|
6342
6408
|
parts: c.parts.map(([x0, y0, z0, x1, y1, z1]) => [
|
|
6343
6409
|
x0,
|
|
6344
6410
|
y0,
|
|
6345
|
-
|
|
6411
|
+
250 - z1,
|
|
6346
6412
|
x1,
|
|
6347
6413
|
y1,
|
|
6348
|
-
|
|
6414
|
+
250 - z0
|
|
6349
6415
|
])
|
|
6350
6416
|
}))];
|
|
6351
6417
|
/** Eight, behind the pod, facing the other camp. */
|
|
@@ -6357,12 +6423,12 @@ var SPAWNS = [
|
|
|
6357
6423
|
].flatMap((x) => [[
|
|
6358
6424
|
x,
|
|
6359
6425
|
CAMP,
|
|
6360
|
-
|
|
6426
|
+
226,
|
|
6361
6427
|
0
|
|
6362
6428
|
], [
|
|
6363
6429
|
x + 4,
|
|
6364
6430
|
CAMP,
|
|
6365
|
-
|
|
6431
|
+
229,
|
|
6366
6432
|
0
|
|
6367
6433
|
]]);
|
|
6368
6434
|
var team = (red) => {
|
|
@@ -6372,7 +6438,7 @@ var team = (red) => {
|
|
|
6372
6438
|
spawns: red ? SPAWNS : SPAWNS.map(([x, y, z]) => [
|
|
6373
6439
|
x,
|
|
6374
6440
|
y,
|
|
6375
|
-
|
|
6441
|
+
250 - z,
|
|
6376
6442
|
Math.PI
|
|
6377
6443
|
]),
|
|
6378
6444
|
rack: side(on(GUNS$1)),
|
|
@@ -6385,7 +6451,7 @@ var team = (red) => {
|
|
|
6385
6451
|
var GALLERY = [
|
|
6386
6452
|
70.5,
|
|
6387
6453
|
HULL.axis[1] + DECKS[1],
|
|
6388
|
-
|
|
6454
|
+
128
|
|
6389
6455
|
];
|
|
6390
6456
|
var BEACH = {
|
|
6391
6457
|
armor: true,
|
|
@@ -6464,9 +6530,10 @@ var BEACH = {
|
|
|
6464
6530
|
56,
|
|
6465
6531
|
MID$1,
|
|
6466
6532
|
100,
|
|
6467
|
-
|
|
6533
|
+
185
|
|
6468
6534
|
],
|
|
6469
6535
|
cell: 4,
|
|
6536
|
+
origin: [0, 1],
|
|
6470
6537
|
at: at$2
|
|
6471
6538
|
},
|
|
6472
6539
|
sun: {
|
|
@@ -6705,24 +6772,24 @@ var UP = {
|
|
|
6705
6772
|
* by beach.test.ts): from `start` in red's shallows, walked west so the first jump is come at
|
|
6706
6773
|
* along its line, onto the float aground there, to the second float, up onto the engine and down
|
|
6707
6774
|
* to the raft on the centre line (`out`); and from the raft back by the same boxes to red's
|
|
6708
|
-
* shallows (`in`). Blue's are their mirror across z =
|
|
6775
|
+
* shallows (`in`). Blue's are their mirror across z = 125, so a way round is `out` then the
|
|
6709
6776
|
* mirror of `in`.
|
|
6710
6777
|
*/
|
|
6711
6778
|
var LAGOON = {
|
|
6712
|
-
start: [26,
|
|
6779
|
+
start: [26, 143],
|
|
6713
6780
|
out: [
|
|
6714
|
-
leap([23,
|
|
6715
|
-
leap([16.4,
|
|
6716
|
-
leap([10.3,
|
|
6717
|
-
go(4,
|
|
6718
|
-
leap([3.5,
|
|
6781
|
+
leap([23, 142.5], [20, 142.5], .35, { sprint: false }),
|
|
6782
|
+
leap([16.4, 142.2], [12, 139.8], .5, { sprint: false }),
|
|
6783
|
+
leap([10.3, 139], [6, 137.5], 1.4, { sprint: false }),
|
|
6784
|
+
go(4, 133.8, 1.4, false),
|
|
6785
|
+
leap([3.5, 132.7], [3, 127], .4, { sprint: false })
|
|
6719
6786
|
],
|
|
6720
6787
|
in: [
|
|
6721
|
-
go(3,
|
|
6722
|
-
leap([3,
|
|
6723
|
-
leap([6.5,
|
|
6724
|
-
leap([12.6,
|
|
6725
|
-
go(21,
|
|
6788
|
+
go(3, 122, .4),
|
|
6789
|
+
leap([3, 128.5], [3.5, 133.5], 1.4, { sprint: false }),
|
|
6790
|
+
leap([6.5, 137.5], [11, 139.5], .5, { sprint: false }),
|
|
6791
|
+
leap([12.6, 140], [17, 142.3], .35, { sprint: false }),
|
|
6792
|
+
go(21, 142.5, .35, false)
|
|
6726
6793
|
]
|
|
6727
6794
|
};
|
|
6728
6795
|
// src/shared/nav.ts
|
|
@@ -7148,10 +7215,10 @@ var NEAR$1 = 6;
|
|
|
7148
7215
|
var ABOVE = 2.2;
|
|
7149
7216
|
var BELOW = 8;
|
|
7150
7217
|
/**
|
|
7151
|
-
* The rectangle a body at `v` stands on, or the nearest one within
|
|
7152
|
-
* it and BELOW under it, as (index, the point of it to walk to); -1 when none.
|
|
7218
|
+
* The rectangle a body at `v` stands on, or the nearest one within `near` metres, at most `above`
|
|
7219
|
+
* over it and BELOW under it, as (index, the point of it to walk to); -1 when none.
|
|
7153
7220
|
*/
|
|
7154
|
-
var locate = (nav, w, v) => {
|
|
7221
|
+
var locate = (nav, w, v, above = ABOVE, near = NEAR$1) => {
|
|
7155
7222
|
const i = under(nav, w, v[0], v[1], v[2], PLAYER_R);
|
|
7156
7223
|
if (i >= 0 && heightAt(w, nav.polys[i], v[0], v[2]) > v[1] - 1.5) return [i, onto(w, nav.polys[i], v[0], v[2])];
|
|
7157
7224
|
let best = -1;
|
|
@@ -7163,20 +7230,28 @@ var locate = (nav, w, v) => {
|
|
|
7163
7230
|
v[2],
|
|
7164
7231
|
v[0],
|
|
7165
7232
|
v[2]
|
|
7166
|
-
],
|
|
7233
|
+
], near, (k) => {
|
|
7167
7234
|
for (const j of nav.grid.get(k) ?? []) {
|
|
7168
7235
|
if (seen.has(j)) continue;
|
|
7169
7236
|
seen.add(j);
|
|
7170
7237
|
const o = onto(w, nav.polys[j], v[0], v[2]);
|
|
7171
7238
|
const d = flat$2(v[0], v[2], o[0], o[2]) + Math.abs(o[1] - v[1]);
|
|
7172
|
-
if (d < least && o[1] - v[1] <=
|
|
7239
|
+
if (d < least && o[1] - v[1] <= above && v[1] - o[1] <= BELOW) [best, least, pt] = [
|
|
7173
7240
|
j,
|
|
7174
7241
|
d,
|
|
7175
7242
|
o
|
|
7176
7243
|
];
|
|
7177
7244
|
}
|
|
7178
7245
|
});
|
|
7179
|
-
return [least <=
|
|
7246
|
+
return [least <= near ? best : -1, pt];
|
|
7247
|
+
};
|
|
7248
|
+
/**
|
|
7249
|
+
* Where a swimmer at `v` gets out: the nearest floor no higher than a step over his feet, within
|
|
7250
|
+
* twice NEAR. He neither jumps nor climbs in the water, so a float's or a box's top is no way out.
|
|
7251
|
+
*/
|
|
7252
|
+
var ashore = (nav, w, v) => {
|
|
7253
|
+
const [i, on] = locate(nav, w, v, STEP_H, 12);
|
|
7254
|
+
return i < 0 ? void 0 : on;
|
|
7180
7255
|
};
|
|
7181
7256
|
/**
|
|
7182
7257
|
* Adds a route's legs from `start` as links: a jump with the run up to it, a slide; the runs
|
|
@@ -7274,20 +7349,20 @@ var build = (w) => {
|
|
|
7274
7349
|
const [[tail], [west, east]] = HULL.sections;
|
|
7275
7350
|
nav.ways = 5;
|
|
7276
7351
|
polys.forEach(({ q, y, r }, i) => {
|
|
7277
|
-
if (q[1] <=
|
|
7352
|
+
if (q[1] <= 125 && q[3] >= 125) {
|
|
7278
7353
|
const x = (q[0] + q[2]) / 2;
|
|
7279
7354
|
route[i] = !r && y > HIGH_ROAD ? 0 : x < tail ? 4 : x < west ? 2 : x < east ? 1 : 3;
|
|
7280
7355
|
}
|
|
7281
7356
|
});
|
|
7282
7357
|
const [x, z] = LAGOON.start;
|
|
7283
7358
|
for (const blue of [false, true]) {
|
|
7284
|
-
const legs = [...LAGOON.out, ...LAGOON.in.map((l) => mirror(l,
|
|
7285
|
-
const sz = blue ?
|
|
7359
|
+
const legs = [...LAGOON.out, ...LAGOON.in.map((l) => mirror(l, 250))];
|
|
7360
|
+
const sz = blue ? 250 - z : z;
|
|
7286
7361
|
links(nav, w, [
|
|
7287
7362
|
x,
|
|
7288
7363
|
ground(w, x, sz),
|
|
7289
7364
|
sz
|
|
7290
|
-
], blue ? legs.map((l) => mirror(l,
|
|
7365
|
+
], blue ? legs.map((l) => mirror(l, 250)) : legs, 4, true);
|
|
7291
7366
|
}
|
|
7292
7367
|
}
|
|
7293
7368
|
return nav;
|
|
@@ -9945,12 +10020,13 @@ var Bot = class {
|
|
|
9945
10020
|
} else this.sortie.board = void 0;
|
|
9946
10021
|
this.gaze = void 0;
|
|
9947
10022
|
const goal = this.goalOf(s);
|
|
9948
|
-
|
|
10023
|
+
const afloat = p.mode === MODE.SWIM;
|
|
10024
|
+
if (!this.goal && !p.ground && !afloat) return {
|
|
9949
10025
|
keys: FORWARD,
|
|
9950
10026
|
yaw: p.yaw,
|
|
9951
10027
|
pitch: 0
|
|
9952
10028
|
};
|
|
9953
|
-
if (p.ground && (!this.goal || !!this.rackSteps || this.plannedWhy !== this.why && (this.urgent() || this.urgent(this.plannedWhy)) || this.urgent() && Math.abs(goal[1] - this.goal[1]) > HOVER || flat(goal[0], goal[2], this.goal[0], this.goal[2]) > Math.max(DRIFT, SHARE * flat(p.x, p.z, goal[0], goal[2])) || !this.steps.some((st) => st.leg) && t - this.planned > REPLAN)) this.plan(s.world, p, goal);
|
|
10029
|
+
if ((p.ground || afloat) && (!this.goal || !!this.rackSteps || this.plannedWhy !== this.why && (this.urgent() || this.urgent(this.plannedWhy)) || this.urgent() && Math.abs(goal[1] - this.goal[1]) > HOVER || flat(goal[0], goal[2], this.goal[0], this.goal[2]) > Math.max(DRIFT, SHARE * flat(p.x, p.z, goal[0], goal[2])) || !this.steps.some((st) => st.leg) && t - this.planned > REPLAN)) this.plan(s.world, p, goal);
|
|
9954
10030
|
const move = this.pilot(p);
|
|
9955
10031
|
const fight = this.fight(s, move.free, weapon);
|
|
9956
10032
|
if (!fight) {
|
|
@@ -9980,8 +10056,10 @@ var Bot = class {
|
|
|
9980
10056
|
pitch: 0
|
|
9981
10057
|
};
|
|
9982
10058
|
const keys = move.keys & ~(FORWARD | BACK | LEFT | RIGHT | SPRINT);
|
|
10059
|
+
const dirs = move.keys & FORWARD ? keysFor(this.aim, move.yaw) : 0;
|
|
10060
|
+
const side = this.dodge(s.world, p);
|
|
9983
10061
|
const out = {
|
|
9984
|
-
keys: (
|
|
10062
|
+
keys: (side ? dirs & ~(LEFT | RIGHT) : dirs) | side | keys | fight.keys,
|
|
9985
10063
|
yaw: this.aim,
|
|
9986
10064
|
pitch: this.pitch
|
|
9987
10065
|
};
|
|
@@ -10237,7 +10315,8 @@ var Bot = class {
|
|
|
10237
10315
|
const direct = this.urgent() && !this.steer || this.why.endsWith(" rack");
|
|
10238
10316
|
const nav = navOf(w);
|
|
10239
10317
|
const prefer = direct ? -1 : this.id % nav.ways;
|
|
10240
|
-
|
|
10318
|
+
const out = p.mode === MODE.SWIM && !this.rackSteps ? ashore(nav, w, at(p)) : void 0;
|
|
10319
|
+
this.steps = this.rackSteps ?? (out ? [{ to: out }, ...path(nav, w, out, goal, prefer)] : path(nav, w, at(p), goal, prefer));
|
|
10241
10320
|
this.rackSteps = void 0;
|
|
10242
10321
|
const [x, , z] = this.steps[0].to;
|
|
10243
10322
|
if (this.steps.length === 1 && this.steps[0].to !== goal && flat(p.x, p.z, x, z) < 1) this.steps = [{ to: goal }];
|
|
@@ -10252,6 +10331,17 @@ var Bot = class {
|
|
|
10252
10331
|
*/
|
|
10253
10332
|
pilot(p) {
|
|
10254
10333
|
const s = this.steps[this.step];
|
|
10334
|
+
const afloat = p.mode === MODE.SWIM;
|
|
10335
|
+
if (s?.leg && afloat) {
|
|
10336
|
+
if (s.edge) s.edge.fails = (s.edge.fails ?? 0) + 1;
|
|
10337
|
+
this.goal = void 0;
|
|
10338
|
+
return {
|
|
10339
|
+
keys: 0,
|
|
10340
|
+
yaw: p.yaw,
|
|
10341
|
+
free: false,
|
|
10342
|
+
exact: true
|
|
10343
|
+
};
|
|
10344
|
+
}
|
|
10255
10345
|
if (s?.leg) return this.fly(p, s.leg);
|
|
10256
10346
|
if (!s) return {
|
|
10257
10347
|
keys: 0,
|
|
@@ -10261,7 +10351,7 @@ var Bot = class {
|
|
|
10261
10351
|
};
|
|
10262
10352
|
const [x, y, z] = s.to;
|
|
10263
10353
|
const d = flat(p.x, p.z, x, z);
|
|
10264
|
-
if (!p.ground) return {
|
|
10354
|
+
if (!p.ground && !afloat) return {
|
|
10265
10355
|
keys: this.alight(p, x, y, z),
|
|
10266
10356
|
yaw: toward(p.x, p.z, x, z),
|
|
10267
10357
|
free: false,
|