@korial29/tiny-fps 0.225.4 → 0.227.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
@@ -871,21 +871,21 @@ var roleOf = (role, def) => {
871
871
  var kitOf = (role, def) => KITS[roleOf(role, def)];
872
872
  // src/shared/world.ts
873
873
  /** Metres per grid cell: about the size of the player's reach, so a query touches 1 to 4 cells. */
874
- var CELL$1 = 4;
874
+ var CELL$2 = 4;
875
875
  /** Cell coordinates run from -OFF to OFF - 1: a 8 km square at 4 m, far more than any map. */
876
876
  var OFF = 1024;
877
877
  /** The key of the cell with integer coordinates (cx, cz). */
878
878
  var key = (cx, cz) => (cx + OFF) * (2 * OFF) + cz + OFF;
879
879
  /** Integer cell coordinate of a metre value, clamped to the keyed range. */
880
- var at$3 = (v, cell) => Math.min(Math.max(Math.floor(v / cell), -1024), 1023);
880
+ var at$4 = (v, cell) => Math.min(Math.max(Math.floor(v / cell), -1024), 1023);
881
881
  var EMPTY = [];
882
882
  /** Brush candidates in the one cell containing a point; the returned list is read-only. */
883
- var atPoint = (w, x, z) => w.grid.get(key(at$3(x, w.cell), at$3(z, w.cell))) ?? EMPTY;
883
+ var atPoint = (w, x, z) => w.grid.get(key(at$4(x, w.cell), at$4(z, w.cell))) ?? EMPTY;
884
884
  /** Builds the grid: each brush is listed in every cell its footprint covers. */
885
- var build$1 = (def, cell = CELL$1) => {
885
+ var build$1 = (def, cell = CELL$2) => {
886
886
  const grid = /* @__PURE__ */ new Map();
887
887
  def.brushes.forEach(({ min, max }, i) => {
888
- for (let cx = at$3(min[0], cell); cx <= at$3(max[0], cell); cx++) for (let cz = at$3(min[2], cell); cz <= at$3(max[2], cell); cz++) {
888
+ for (let cx = at$4(min[0], cell); cx <= at$4(max[0], cell); cx++) for (let cz = at$4(min[2], cell); cz <= at$4(max[2], cell); cz++) {
889
889
  const k = key(cx, cz);
890
890
  const list = grid.get(k);
891
891
  if (list) list.push(i);
@@ -914,7 +914,7 @@ var near = (w, x, z, r) => {
914
914
  const out = [];
915
915
  if (marks.length < w.def.brushes.length) marks = new Uint32Array(w.def.brushes.length);
916
916
  mark = mark + 1 >>> 0 || (marks.fill(0), 1);
917
- for (let cx = at$3(x - r, w.cell); cx <= at$3(x + r, w.cell); cx++) for (let cz = at$3(z - r, w.cell); cz <= at$3(z + r, w.cell); cz++) for (const i of w.grid.get(key(cx, cz)) ?? []) if (marks[i] !== mark) {
917
+ for (let cx = at$4(x - r, w.cell); cx <= at$4(x + r, w.cell); cx++) for (let cz = at$4(z - r, w.cell); cz <= at$4(z + r, w.cell); cz++) for (const i of w.grid.get(key(cx, cz)) ?? []) if (marks[i] !== mark) {
918
918
  marks[i] = mark;
919
919
  out.push(i);
920
920
  }
@@ -952,8 +952,8 @@ var ray = (w, o, d, max, grow = 0) => {
952
952
  var faces = (w, o, d, max, grow) => {
953
953
  const { cell, def } = w;
954
954
  let best = max;
955
- let cx = at$3(o[0], cell);
956
- let cz = at$3(o[2], cell);
955
+ let cx = at$4(o[0], cell);
956
+ let cz = at$4(o[2], cell);
957
957
  const sx = Math.sign(d[0]);
958
958
  const sz = Math.sign(d[2]);
959
959
  const nx = sx ? ((cx + (sx > 0 ? 1 : 0)) * cell - o[0]) / d[0] : Infinity;
@@ -2116,7 +2116,7 @@ var roof$1 = (x0, z0, x1, z1, top, side = TEX.CONCRETE) => ({
2116
2116
  side
2117
2117
  });
2118
2118
  /** Any box, corners (x0, y0, z0) and (x1, y1, z1). */
2119
- var box$2 = ([x0, y0, z0], [x1, y1, z1], top, side = top, tint) => ({
2119
+ var box$3 = ([x0, y0, z0], [x1, y1, z1], top, side = top, tint) => ({
2120
2120
  min: [
2121
2121
  x0,
2122
2122
  y0,
@@ -2139,7 +2139,7 @@ var stair = (z, y) => [
2139
2139
  4,
2140
2140
  5,
2141
2141
  6
2142
- ].map((k) => box$2([
2142
+ ].map((k) => box$3([
2143
2143
  12,
2144
2144
  y,
2145
2145
  z - k
@@ -2155,7 +2155,7 @@ var stair = (z, y) => [
2155
2155
  roof$1(4, -5, 24, 7, 12.4, TEX.GLASS),
2156
2156
  roof$1(27, 20, 47, 50, 8),
2157
2157
  roof$1(27, 60, 47, 76, 8, TEX.BRICK),
2158
- box$2([
2158
+ box$3([
2159
2159
  9,
2160
2160
  12.2,
2161
2161
  39
@@ -2165,7 +2165,7 @@ var stair = (z, y) => [
2165
2165
  47
2166
2166
  ], TEX.STEEL),
2167
2167
  ...stair(53, 10),
2168
- box$2([
2168
+ box$3([
2169
2169
  5,
2170
2170
  10,
2171
2171
  42
@@ -2174,7 +2174,7 @@ var stair = (z, y) => [
2174
2174
  14,
2175
2175
  42.5
2176
2176
  ], TEX.STEEL),
2177
- box$2([
2177
+ box$3([
2178
2178
  5,
2179
2179
  10,
2180
2180
  50
@@ -2183,7 +2183,7 @@ var stair = (z, y) => [
2183
2183
  14,
2184
2184
  50.5
2185
2185
  ], TEX.STEEL),
2186
- box$2([
2186
+ box$3([
2187
2187
  8,
2188
2188
  12.4,
2189
2189
  24
@@ -2192,7 +2192,7 @@ var stair = (z, y) => [
2192
2192
  12.85,
2193
2193
  24.45
2194
2194
  ], TEX.STEEL),
2195
- box$2([
2195
+ box$3([
2196
2196
  36,
2197
2197
  8,
2198
2198
  22
@@ -2205,7 +2205,7 @@ var stair = (z, y) => [
2205
2205
  .72,
2206
2206
  .62
2207
2207
  ]),
2208
- box$2([
2208
+ box$3([
2209
2209
  30,
2210
2210
  8,
2211
2211
  28
@@ -2214,7 +2214,7 @@ var stair = (z, y) => [
2214
2214
  10,
2215
2215
  32
2216
2216
  ], TEX.CONCRETE),
2217
- box$2([
2217
+ box$3([
2218
2218
  40,
2219
2219
  8,
2220
2220
  30
@@ -2227,7 +2227,7 @@ var stair = (z, y) => [
2227
2227
  .3,
2228
2228
  .06
2229
2229
  ]),
2230
- box$2([
2230
+ box$3([
2231
2231
  28,
2232
2232
  9.2,
2233
2233
  44
@@ -2240,7 +2240,7 @@ var stair = (z, y) => [
2240
2240
  .42,
2241
2241
  1
2242
2242
  ]),
2243
- box$2([
2243
+ box$3([
2244
2244
  41.5,
2245
2245
  7.6,
2246
2246
  50
@@ -2249,7 +2249,7 @@ var stair = (z, y) => [
2249
2249
  8,
2250
2250
  60
2251
2251
  ], TEX.STEEL),
2252
- box$2([
2252
+ box$3([
2253
2253
  30,
2254
2254
  8,
2255
2255
  64
@@ -2264,21 +2264,21 @@ var stair = (z, y) => [
2264
2264
  ])
2265
2265
  ];
2266
2266
  /** The map is 240 m long: a point at z has its twin at ZED - z. */
2267
- var ZED$1 = 240;
2267
+ var ZED$2 = 240;
2268
2268
  /** Team colours as brush tints: the flip swaps one for the other, so a red accent has a blue twin. */
2269
- var RED$1 = [
2269
+ var RED$2 = [
2270
2270
  1,
2271
2271
  .22,
2272
2272
  .26
2273
2273
  ];
2274
- var BLUE$1 = [
2274
+ var BLUE$2 = [
2275
2275
  .2,
2276
2276
  .46,
2277
2277
  1
2278
2278
  ];
2279
2279
  /** The two team tints, red then blue. */
2280
- var TEAM_TINT = [RED$1, BLUE$1];
2281
- var ORANGE$1 = [
2280
+ var TEAM_TINT = [RED$2, BLUE$2];
2281
+ var ORANGE$2 = [
2282
2282
  1,
2283
2283
  .42,
2284
2284
  .08
@@ -2289,7 +2289,7 @@ var TEAL = [
2289
2289
  .62
2290
2290
  ];
2291
2291
  /** An accent: a slab of tinted paint, corners (x0, y0, z0) and (x1, y1, z1). */
2292
- var pad = (x0, y0, z0, x1, y1, z1, tint) => box$2([
2292
+ var pad = (x0, y0, z0, x1, y1, z1, tint) => box$3([
2293
2293
  x0,
2294
2294
  y0,
2295
2295
  z0
@@ -2307,7 +2307,7 @@ var stairs$1 = (axis, a, b, w0, w1, y, top, low = BASE$1) => {
2307
2307
  return Array.from({ length: n }, (_, i) => {
2308
2308
  const [s0, s1] = [a + (b - a) * i / n, a + (b - a) * (i + 1) / n].sort((p, q) => p - q);
2309
2309
  const up = y + (top - y) * (i + 1) / n;
2310
- return axis === 0 ? box$2([
2310
+ return axis === 0 ? box$3([
2311
2311
  s0,
2312
2312
  low,
2313
2313
  w0
@@ -2315,7 +2315,7 @@ var stairs$1 = (axis, a, b, w0, w1, y, top, low = BASE$1) => {
2315
2315
  s1,
2316
2316
  up,
2317
2317
  w1
2318
- ], TEX.CONCRETE) : box$2([
2318
+ ], TEX.CONCRETE) : box$3([
2319
2319
  w0,
2320
2320
  low,
2321
2321
  s0
@@ -2330,7 +2330,7 @@ var stairs$1 = (axis, a, b, w0, w1, y, top, low = BASE$1) => {
2330
2330
  * A ledge ladder: one platform 4 m wide and `d` deep per top in `tops`, the first at (x, z), each
2331
2331
  * next one (dx, dz) further, over the roof at `low`. The hands catch the face of each from the one before.
2332
2332
  */
2333
- var ladder = (x, z, dx, dz, d, low, tops) => tops.map((top, k) => box$2([
2333
+ var ladder = (x, z, dx, dz, d, low, tops) => tops.map((top, k) => box$3([
2334
2334
  x + k * dx,
2335
2335
  low,
2336
2336
  z + k * dz
@@ -2340,15 +2340,15 @@ var ladder = (x, z, dx, dz, d, low, tops) => tops.map((top, k) => box$2([
2340
2340
  z + k * dz + d
2341
2341
  ], TEX.STEEL, TEX.CONCRETE));
2342
2342
  /** Red's half: z from 120 to 240, then flipped. */
2343
- var half$1 = [
2343
+ var half$2 = [
2344
2344
  roof$1(12, 212, 52, 240, 26, TEX.GLASS),
2345
- pad(12, 26, 212, 52, 26.12, 212.5, RED$1),
2346
- pad(12, 26, 239.5, 52, 26.12, 240, RED$1),
2347
- pad(12, 26, 212.5, 12.5, 26.12, 239.5, RED$1),
2348
- pad(51.5, 26, 212.5, 52, 26.12, 239.5, RED$1),
2349
- pad(11.6, 12, 222, 12, 25.8, 232, RED$1),
2350
- pad(28, 12, 211.4, 31, 25.5, 212, RED$1),
2351
- box$2([
2345
+ pad(12, 26, 212, 52, 26.12, 212.5, RED$2),
2346
+ pad(12, 26, 239.5, 52, 26.12, 240, RED$2),
2347
+ pad(12, 26, 212.5, 12.5, 26.12, 239.5, RED$2),
2348
+ pad(51.5, 26, 212.5, 52, 26.12, 239.5, RED$2),
2349
+ pad(11.6, 12, 222, 12, 25.8, 232, RED$2),
2350
+ pad(28, 12, 211.4, 31, 25.5, 212, RED$2),
2351
+ box$3([
2352
2352
  19,
2353
2353
  26,
2354
2354
  222
@@ -2357,7 +2357,7 @@ var half$1 = [
2357
2357
  27.4,
2358
2358
  225
2359
2359
  ], TEX.STEEL),
2360
- box$2([
2360
+ box$3([
2361
2361
  42,
2362
2362
  26,
2363
2363
  222
@@ -2366,7 +2366,7 @@ var half$1 = [
2366
2366
  27.4,
2367
2367
  225
2368
2368
  ], TEX.STEEL),
2369
- box$2([
2369
+ box$3([
2370
2370
  29,
2371
2371
  26,
2372
2372
  229
@@ -2379,7 +2379,7 @@ var half$1 = [
2379
2379
  roof$1(6, 134, 26, 147, 26, TEX.GLASS),
2380
2380
  roof$1(6, 201, 26, 212, 19),
2381
2381
  roof$1(15, 147, 26, 164, 19),
2382
- box$2([
2382
+ box$3([
2383
2383
  14,
2384
2384
  26,
2385
2385
  164
@@ -2388,7 +2388,7 @@ var half$1 = [
2388
2388
  32,
2389
2389
  196
2390
2390
  ], TEX.PAINT, TEX.PAINT, TEAL),
2391
- box$2([
2391
+ box$3([
2392
2392
  14,
2393
2393
  18,
2394
2394
  147
@@ -2397,7 +2397,7 @@ var half$1 = [
2397
2397
  32,
2398
2398
  164
2399
2399
  ], TEX.PAINT, TEX.PAINT, TEAL),
2400
- box$2([
2400
+ box$3([
2401
2401
  14,
2402
2402
  26,
2403
2403
  134
@@ -2433,7 +2433,7 @@ var half$1 = [
2433
2433
  164,
2434
2434
  25
2435
2435
  ]
2436
- ].map(([x0, z0, x1, z1, top]) => box$2([
2436
+ ].map(([x0, z0, x1, z1, top]) => box$3([
2437
2437
  x0,
2438
2438
  19,
2439
2439
  z0
@@ -2442,7 +2442,7 @@ var half$1 = [
2442
2442
  top,
2443
2443
  z1
2444
2444
  ], TEX.STEEL, TEX.CONCRETE)),
2445
- box$2([
2445
+ box$3([
2446
2446
  20,
2447
2447
  26,
2448
2448
  178
@@ -2451,7 +2451,7 @@ var half$1 = [
2451
2451
  27.3,
2452
2452
  181
2453
2453
  ], TEX.STEEL),
2454
- box$2([
2454
+ box$3([
2455
2455
  8,
2456
2456
  26,
2457
2457
  176
@@ -2460,7 +2460,7 @@ var half$1 = [
2460
2460
  27.2,
2461
2461
  179
2462
2462
  ], TEX.STEEL),
2463
- box$2([
2463
+ box$3([
2464
2464
  8,
2465
2465
  26,
2466
2466
  190
@@ -2469,7 +2469,7 @@ var half$1 = [
2469
2469
  27.3,
2470
2470
  193
2471
2471
  ], TEX.STEEL),
2472
- box$2([
2472
+ box$3([
2473
2473
  20,
2474
2474
  26,
2475
2475
  140
@@ -2479,7 +2479,7 @@ var half$1 = [
2479
2479
  143
2480
2480
  ], TEX.STEEL),
2481
2481
  roof$1(32, 186, 76, 209, 19),
2482
- pad(32, 19, 207.5, 76, 19.1, 209, RED$1),
2482
+ pad(32, 19, 207.5, 76, 19.1, 209, RED$2),
2483
2483
  ...ladder(33, 209, 7, 0, 3, 19, [
2484
2484
  21.2,
2485
2485
  23.4,
@@ -2507,7 +2507,7 @@ var half$1 = [
2507
2507
  188,
2508
2508
  25
2509
2509
  ]
2510
- ].map(([x0, z0, x1, z1, top]) => box$2([
2510
+ ].map(([x0, z0, x1, z1, top]) => box$3([
2511
2511
  x0,
2512
2512
  BASE$1,
2513
2513
  z0
@@ -2518,7 +2518,7 @@ var half$1 = [
2518
2518
  ], TEX.STEEL, TEX.CONCRETE)),
2519
2519
  roof$1(32, 166, 64, 182, 21.2, TEX.GLASS),
2520
2520
  roof$1(32, 140, 64, 161, 19),
2521
- box$2([
2521
+ box$3([
2522
2522
  40,
2523
2523
  21.2,
2524
2524
  172
@@ -2527,7 +2527,7 @@ var half$1 = [
2527
2527
  22.6,
2528
2528
  176
2529
2529
  ], TEX.STEEL),
2530
- box$2([
2530
+ box$3([
2531
2531
  52,
2532
2532
  19,
2533
2533
  148
@@ -2536,7 +2536,7 @@ var half$1 = [
2536
2536
  20.3,
2537
2537
  151
2538
2538
  ], TEX.STEEL),
2539
- box$2([
2539
+ box$3([
2540
2540
  38,
2541
2541
  19,
2542
2542
  196
@@ -2545,7 +2545,7 @@ var half$1 = [
2545
2545
  20.4,
2546
2546
  199
2547
2547
  ], TEX.STEEL),
2548
- box$2([
2548
+ box$3([
2549
2549
  60,
2550
2550
  19,
2551
2551
  200
@@ -2554,7 +2554,7 @@ var half$1 = [
2554
2554
  20.4,
2555
2555
  203
2556
2556
  ], TEX.STEEL),
2557
- box$2([
2557
+ box$3([
2558
2558
  52,
2559
2559
  19,
2560
2560
  190
@@ -2563,7 +2563,7 @@ var half$1 = [
2563
2563
  20.6,
2564
2564
  194
2565
2565
  ], TEX.STEEL),
2566
- box$2([
2566
+ box$3([
2567
2567
  66,
2568
2568
  19,
2569
2569
  204
@@ -2572,7 +2572,7 @@ var half$1 = [
2572
2572
  20.2,
2573
2573
  207
2574
2574
  ], TEX.STEEL),
2575
- box$2([
2575
+ box$3([
2576
2576
  56,
2577
2577
  21.2,
2578
2578
  170
@@ -2581,7 +2581,7 @@ var half$1 = [
2581
2581
  22.4,
2582
2582
  174
2583
2583
  ], TEX.STEEL),
2584
- box$2([
2584
+ box$3([
2585
2585
  34,
2586
2586
  19,
2587
2587
  152
@@ -2598,10 +2598,10 @@ var half$1 = [
2598
2598
  23.8
2599
2599
  ]),
2600
2600
  roof$1(76, 213, 100, 240, 14.5, TEX.STEEL),
2601
- pad(76, 14.5, 238.5, 100, 14.6, 240, RED$1),
2601
+ pad(76, 14.5, 238.5, 100, 14.6, 240, RED$2),
2602
2602
  roof$1(76, 185, 100, 209, 14.5),
2603
2603
  roof$1(76, 138, 100, 181, 14.5, TEX.GLASS),
2604
- box$2([
2604
+ box$3([
2605
2605
  80,
2606
2606
  15.7,
2607
2607
  158
@@ -2609,8 +2609,8 @@ var half$1 = [
2609
2609
  96,
2610
2610
  17.7,
2611
2611
  162
2612
- ], TEX.STEEL, TEX.PAINT, ORANGE$1),
2613
- box$2([
2612
+ ], TEX.STEEL, TEX.PAINT, ORANGE$2),
2613
+ box$3([
2614
2614
  82,
2615
2615
  14.5,
2616
2616
  234
@@ -2619,7 +2619,7 @@ var half$1 = [
2619
2619
  15.9,
2620
2620
  237
2621
2621
  ], TEX.STEEL),
2622
- box$2([
2622
+ box$3([
2623
2623
  91,
2624
2624
  14.5,
2625
2625
  190
@@ -2628,7 +2628,7 @@ var half$1 = [
2628
2628
  15.9,
2629
2629
  193
2630
2630
  ], TEX.STEEL),
2631
- box$2([
2631
+ box$3([
2632
2632
  80,
2633
2633
  14.5,
2634
2634
  204
@@ -2637,7 +2637,7 @@ var half$1 = [
2637
2637
  15.6,
2638
2638
  207
2639
2639
  ], TEX.STEEL),
2640
- box$2([
2640
+ box$3([
2641
2641
  78,
2642
2642
  14.5,
2643
2643
  170
@@ -2646,7 +2646,7 @@ var half$1 = [
2646
2646
  15.9,
2647
2647
  173
2648
2648
  ], TEX.STEEL),
2649
- box$2([
2649
+ box$3([
2650
2650
  92,
2651
2651
  14.5,
2652
2652
  146
@@ -2655,7 +2655,7 @@ var half$1 = [
2655
2655
  15.7,
2656
2656
  149
2657
2657
  ], TEX.STEEL),
2658
- box$2([
2658
+ box$3([
2659
2659
  92,
2660
2660
  14.5,
2661
2661
  222
@@ -2668,10 +2668,10 @@ var half$1 = [
2668
2668
  ...stairs$1(0, 85, 76, 196, 202, 14.5, 19, 14.5)
2669
2669
  ];
2670
2670
  /** What stands on the centre line, symmetric as written: the plaza, its dais and canopy, the beam. */
2671
- var centre$1 = [
2671
+ var centre$2 = [
2672
2672
  roof$1(6, 106, 62, 134, 15),
2673
2673
  roof$1(62, 106, 100, 134, 14.5),
2674
- box$2([
2674
+ box$3([
2675
2675
  34,
2676
2676
  15,
2677
2677
  112
@@ -2680,13 +2680,13 @@ var centre$1 = [
2680
2680
  17.2,
2681
2681
  128
2682
2682
  ], TEX.CONCRETE),
2683
- pad(38, 17.2, 116, 50, 17.3, 124, ORANGE$1),
2683
+ pad(38, 17.2, 116, 50, 17.3, 124, ORANGE$2),
2684
2684
  ...[
2685
2685
  [35, 113],
2686
2686
  [35, 126.2],
2687
2687
  [51, 113],
2688
2688
  [51, 126.2]
2689
- ].map(([x, z]) => box$2([
2689
+ ].map(([x, z]) => box$3([
2690
2690
  x,
2691
2691
  17.2,
2692
2692
  z
@@ -2695,7 +2695,7 @@ var centre$1 = [
2695
2695
  21.5,
2696
2696
  z + .8
2697
2697
  ], TEX.STEEL)),
2698
- box$2([
2698
+ box$3([
2699
2699
  34.6,
2700
2700
  21.5,
2701
2701
  112.6
@@ -2704,7 +2704,7 @@ var centre$1 = [
2704
2704
  21.9,
2705
2705
  127.4
2706
2706
  ], TEX.GLASS),
2707
- box$2([
2707
+ box$3([
2708
2708
  14,
2709
2709
  15,
2710
2710
  114
@@ -2713,7 +2713,7 @@ var centre$1 = [
2713
2713
  16.5,
2714
2714
  117
2715
2715
  ], TEX.STEEL),
2716
- box$2([
2716
+ box$3([
2717
2717
  14,
2718
2718
  15,
2719
2719
  123
@@ -2722,7 +2722,7 @@ var centre$1 = [
2722
2722
  16.5,
2723
2723
  126
2724
2724
  ], TEX.STEEL),
2725
- box$2([
2725
+ box$3([
2726
2726
  56,
2727
2727
  15,
2728
2728
  114
@@ -2731,7 +2731,7 @@ var centre$1 = [
2731
2731
  16.5,
2732
2732
  117
2733
2733
  ], TEX.STEEL),
2734
- box$2([
2734
+ box$3([
2735
2735
  56,
2736
2736
  15,
2737
2737
  123
@@ -2740,7 +2740,7 @@ var centre$1 = [
2740
2740
  16.5,
2741
2741
  126
2742
2742
  ], TEX.STEEL),
2743
- box$2([
2743
+ box$3([
2744
2744
  15.35,
2745
2745
  25.5,
2746
2746
  106
@@ -2749,7 +2749,7 @@ var centre$1 = [
2749
2749
  26,
2750
2750
  134
2751
2751
  ], TEX.STEEL),
2752
- box$2([
2752
+ box$3([
2753
2753
  70,
2754
2754
  14.5,
2755
2755
  108
@@ -2758,7 +2758,7 @@ var centre$1 = [
2758
2758
  38,
2759
2759
  108.8
2760
2760
  ], TEX.STEEL),
2761
- box$2([
2761
+ box$3([
2762
2762
  70,
2763
2763
  14.5,
2764
2764
  131.2
@@ -2767,7 +2767,7 @@ var centre$1 = [
2767
2767
  38,
2768
2768
  132
2769
2769
  ], TEX.STEEL),
2770
- box$2([
2770
+ box$3([
2771
2771
  66,
2772
2772
  14.5,
2773
2773
  110
@@ -2776,7 +2776,7 @@ var centre$1 = [
2776
2776
  15.9,
2777
2777
  113
2778
2778
  ], TEX.STEEL),
2779
- box$2([
2779
+ box$3([
2780
2780
  66,
2781
2781
  14.5,
2782
2782
  127
@@ -2787,19 +2787,19 @@ var centre$1 = [
2787
2787
  ], TEX.STEEL)
2788
2788
  ];
2789
2789
  /** The twin of a brush across the centre line. */
2790
- var flip$2 = (b) => ({
2790
+ var flip$3 = (b) => ({
2791
2791
  ...b,
2792
2792
  min: [
2793
2793
  b.min[0],
2794
2794
  b.min[1],
2795
- ZED$1 - b.max[2]
2795
+ ZED$2 - b.max[2]
2796
2796
  ],
2797
2797
  max: [
2798
2798
  b.max[0],
2799
2799
  b.max[1],
2800
- ZED$1 - b.min[2]
2800
+ ZED$2 - b.min[2]
2801
2801
  ],
2802
- tint: b.tint === RED$1 ? BLUE$1 : b.tint
2802
+ tint: b.tint === RED$2 ? BLUE$2 : b.tint
2803
2803
  });
2804
2804
  /** Where a team starts: two rows facing the other end. */
2805
2805
  var row = (yaw, z, z2) => [...[
@@ -2935,9 +2935,9 @@ var HIGHLINE = {
2935
2935
  tag: "Rooftops · 94 × 240 m",
2936
2936
  lore: "The towers of an old business district, closed for years, far above streets that still have traffic. Two crews of runners have taken the roofs. Three routes cross between them, and a fall takes you back to your tower.",
2937
2937
  brushes: [
2938
- ...half$1,
2939
- ...half$1.map(flip$2),
2940
- ...centre$1
2938
+ ...half$2,
2939
+ ...half$2.map(flip$3),
2940
+ ...centre$2
2941
2941
  ],
2942
2942
  teams: [{
2943
2943
  base: [
@@ -2999,7 +2999,7 @@ var HIGHLINE = {
2999
2999
  ...PACKS.map(([x, y, z]) => [
3000
3000
  x,
3001
3001
  y,
3002
- ZED$1 - z
3002
+ ZED$2 - z
3003
3003
  ]),
3004
3004
  [
3005
3005
  24,
@@ -3017,7 +3017,7 @@ var HIGHLINE = {
3017
3017
  ...AMMO.map(([x, y, z]) => [
3018
3018
  x,
3019
3019
  y,
3020
- ZED$1 - z
3020
+ ZED$2 - z
3021
3021
  ]),
3022
3022
  [
3023
3023
  12,
@@ -3035,19 +3035,19 @@ var HIGHLINE = {
3035
3035
  ...CELLS.map(([x, y, z]) => [
3036
3036
  x,
3037
3037
  y,
3038
- ZED$1 - z
3038
+ ZED$2 - z
3039
3039
  ]),
3040
3040
  [
3041
3041
  28,
3042
3042
  15,
3043
- ZED$1 / 2
3043
+ ZED$2 / 2
3044
3044
  ]
3045
3045
  ],
3046
3046
  vests: [
3047
3047
  [
3048
3048
  36,
3049
3049
  17.2,
3050
- ZED$1 / 2
3050
+ ZED$2 / 2
3051
3051
  ],
3052
3052
  [
3053
3053
  23,
@@ -3090,9 +3090,9 @@ var HIGHLINE = {
3090
3090
  ]
3091
3091
  };
3092
3092
  // src/shared/moonbase.ts
3093
- var { CONCRETE: CONCRETE$1, METAL: METAL$2, STEEL: STEEL$2, PAINT: PAINT$2 } = TEX;
3093
+ var { CONCRETE: CONCRETE$1, METAL: METAL$3, STEEL: STEEL$3, PAINT: PAINT$3 } = TEX;
3094
3094
  /** A box, corners (x0, y0, z0) and (x1, y1, z1), tops and sides, a tint. */
3095
- var box$1 = (x0, y0, z0, x1, y1, z1, top, side = top, tint) => ({
3095
+ var box$2 = (x0, y0, z0, x1, y1, z1, top, side = top, tint) => ({
3096
3096
  min: [
3097
3097
  x0,
3098
3098
  y0,
@@ -3191,8 +3191,8 @@ var turns = (l) => [...new Map(l.flatMap(([x0, z0, x1, z1]) => [1, -1].flatMap((
3191
3191
  Math.max(j * c, j * d)
3192
3192
  ])))).map((p) => [`${p}`, p])).values()];
3193
3193
  /** A ghost box about the dome's centre, (x0, z0, x1, z1) from y0 to y1. */
3194
- var ghost = ([x0, z0, x1, z1], y0, y1, top = CONCRETE$1, side = top) => ({
3195
- ...box$1(DOME[0] + x0, y0, DOME[1] + z0, DOME[0] + x1, y1, DOME[1] + z1, top, side),
3194
+ var ghost$1 = ([x0, z0, x1, z1], y0, y1, top = CONCRETE$1, side = top) => ({
3195
+ ...box$2(DOME[0] + x0, y0, DOME[1] + z0, DOME[0] + x1, y1, DOME[1] + z1, top, side),
3196
3196
  ghost: true
3197
3197
  });
3198
3198
  /**
@@ -3204,7 +3204,7 @@ var stairs = (axis, a, b, w0, w1, y, top) => {
3204
3204
  return Array.from({ length: n }, (_, i) => {
3205
3205
  const [s, t] = [a + (b - a) * i / n, a + (b - a) * (i + 1) / n].sort((p, q) => p - q);
3206
3206
  const up = y + (top - y) * (i + 1) / n;
3207
- return axis ? box$1(w0, y, s, w1, up, t, CONCRETE$1) : box$1(s, y, w0, t, up, w1, CONCRETE$1);
3207
+ return axis ? box$2(w0, y, s, w1, up, t, CONCRETE$1) : box$2(s, y, w0, t, up, w1, CONCRETE$1);
3208
3208
  });
3209
3209
  };
3210
3210
  /**
@@ -3224,47 +3224,47 @@ var FIT$1 = [
3224
3224
  -D0,
3225
3225
  C0,
3226
3226
  D0
3227
- ]]).filter((p) => p[1] > -C0).map((p) => ghost(p, 3.1, 3.5, METAL$2, STEEL$2)),
3227
+ ]]).filter((p) => p[1] > -C0).map((p) => ghost$1(p, 3.1, 3.5, METAL$3, STEEL$3)),
3228
3228
  ...stairs(2, DOME[1] + 5.6, DOME[1] + 12, DOME[0] - 1.5, DOME[0] + 1.5, 0, 3.5).map((b) => ({
3229
3229
  ...b,
3230
3230
  ghost: true
3231
3231
  })),
3232
- ghost([
3232
+ ghost$1([
3233
3233
  -3,
3234
3234
  19,
3235
3235
  3,
3236
3236
  C0
3237
- ], 3.5, 4.6, STEEL$2, METAL$2),
3238
- ghost([
3237
+ ], 3.5, 4.6, STEEL$3, METAL$3),
3238
+ ghost$1([
3239
3239
  -9,
3240
3240
  12,
3241
3241
  -2.5,
3242
3242
  12.5
3243
- ], 3.5, 4.6, STEEL$2, PAINT$2),
3244
- ghost([
3243
+ ], 3.5, 4.6, STEEL$3, PAINT$3),
3244
+ ghost$1([
3245
3245
  2.5,
3246
3246
  12,
3247
3247
  9,
3248
3248
  12.5
3249
- ], 3.5, 4.6, STEEL$2, PAINT$2),
3250
- ghost([
3249
+ ], 3.5, 4.6, STEEL$3, PAINT$3),
3250
+ ghost$1([
3251
3251
  -9.5,
3252
3252
  -10,
3253
3253
  -7.5,
3254
3254
  -8
3255
- ], 0, 1.4, STEEL$2),
3256
- ghost([
3255
+ ], 0, 1.4, STEEL$3),
3256
+ ghost$1([
3257
3257
  7.5,
3258
3258
  -10,
3259
3259
  9.5,
3260
3260
  -8
3261
- ], 0, 1.4, STEEL$2),
3262
- ghost([
3261
+ ], 0, 1.4, STEEL$3),
3262
+ ghost$1([
3263
3263
  7.5,
3264
3264
  3,
3265
3265
  10,
3266
3266
  5.5
3267
- ], 0, 2.4, STEEL$2)
3267
+ ], 0, 2.4, STEEL$3)
3268
3268
  ];
3269
3269
  var { BENCH, SAMPLES, RACKS, SCOPE, ANALYSER, PLANTS, LOCKERS, SUIT } = {
3270
3270
  BENCH: 0,
@@ -3390,26 +3390,26 @@ var KIT = [
3390
3390
  * gap (from, to). A gap of no width only cuts the wall in two: vision.ts stripes a wall of 8 m.
3391
3391
  */
3392
3392
  var wall = (k, a, b, p, q, y, gaps = []) => {
3393
- const piece = (s, t, y0) => k ? box$1(p, y0, s, q, y, t, CONCRETE$1) : box$1(s, y0, p, t, y, q, CONCRETE$1);
3393
+ const piece = (s, t, y0) => k ? box$2(p, y0, s, q, y, t, CONCRETE$1) : box$2(s, y0, p, t, y, q, CONCRETE$1);
3394
3394
  return [...gaps, [b, b]].flatMap(([s, t], i, l) => [piece(i ? l[i - 1][1] : a, s, 0), ...t > s ? [piece(s, t, H)] : []]);
3395
3395
  };
3396
3396
  /** A module: a roof slab on four walls, with the gaps of the walls at its low z, high z, low x and high x. */
3397
3397
  var room = ({ min: [x0, , z0], max: [x1, y, z1] }, gaps, crate) => [
3398
- box$1(x0, 4, z0, x1, y, z1, METAL$2, CONCRETE$1),
3398
+ box$2(x0, 4, z0, x1, y, z1, METAL$3, CONCRETE$1),
3399
3399
  ...wall(0, x0, x1, z0, z0 + T, 4, gaps[0]),
3400
3400
  ...wall(0, x0, x1, z1 - T, z1, 4, gaps[1]),
3401
3401
  ...wall(2, z0 + T, z1 - T, x0, x0 + T, 4, gaps[2]),
3402
3402
  ...wall(2, z0 + T, z1 - T, x1 - T, x1, 4),
3403
3403
  crate
3404
3404
  ];
3405
- var ORANGE = [
3405
+ var ORANGE$1 = [
3406
3406
  1,
3407
3407
  .42,
3408
3408
  .08
3409
3409
  ];
3410
3410
  /** Red's half of the base. */
3411
3411
  var BASE = [
3412
- ...BANDS.slice(2).flatMap((y1, i) => around(shell(BANDS[i + 1]) + .2).map(([a, b]) => ghost([
3412
+ ...BANDS.slice(2).flatMap((y1, i) => around(shell(BANDS[i + 1]) + .2).map(([a, b]) => ghost$1([
3413
3413
  -a,
3414
3414
  -b,
3415
3415
  a,
@@ -3434,7 +3434,7 @@ var BASE = [
3434
3434
  C1,
3435
3435
  C1
3436
3436
  ]
3437
- ]).map((p) => ghost(p, MOUTHS.find(([x, z]) => p[0] <= x && x <= p[2] && p[1] <= z && z <= p[3])?.[3] ?? 0, BANDS[1])),
3437
+ ]).map((p) => ghost$1(p, MOUTHS.find(([x, z]) => p[0] <= x && x <= p[2] && p[1] <= z && z <= p[3])?.[3] ?? 0, BANDS[1])),
3438
3438
  ...[
3439
3439
  [
3440
3440
  -B0,
@@ -3460,24 +3460,24 @@ var BASE = [
3460
3460
  UX0 - DOME[0],
3461
3461
  TZ0 - DOME[1]
3462
3462
  ]
3463
- ].map((p) => ghost(p, 0, BANDS[1])),
3463
+ ].map((p) => ghost$1(p, 0, BANDS[1])),
3464
3464
  ...FIT$1,
3465
3465
  ...KIT.map(([, x0, z0, x1, z1, y0, y1]) => ({
3466
- ...box$1(x0, y0, z0, x1, y1, z1, STEEL$2),
3466
+ ...box$2(x0, y0, z0, x1, y1, z1, STEEL$3),
3467
3467
  ghost: true
3468
3468
  })),
3469
3469
  ...room(MODULES[0], [
3470
3470
  [[118, 118]],
3471
3471
  [[116.8, 119.2]],
3472
3472
  [[TZ0 + T, TZ1 - T]]
3473
- ], box$1(121.5, 0, 223.5, 123.5, 1.2, 225.5, PAINT$2, PAINT$2, ORANGE)),
3474
- ...room(MODULES[1], [[[101.8, 104.2]], [[UX0 + T, UX1 - T], [105.8, 105.8]]], box$1(106, 0, 200.6, 108, 1.2, 202.6, PAINT$2, PAINT$2, ORANGE)),
3475
- box$1(TX0, H, TZ0, TX1, TY, TZ1, STEEL$2, METAL$2),
3476
- box$1(UX0, H, UZ0, UX1, TY, TZ1, STEEL$2, METAL$2),
3477
- box$1(UX0, 0, TZ1 - T, TX1, H, TZ1, METAL$2),
3478
- box$1(UX1 - T, 0, TZ0, TX1, H, TZ0 + T, METAL$2),
3479
- box$1(UX0, 0, UZ0, UX0 + T, H, TZ0, METAL$2),
3480
- box$1(UX1 - T, 0, UZ0, UX1, H, TZ0, METAL$2),
3473
+ ], box$2(121.5, 0, 223.5, 123.5, 1.2, 225.5, PAINT$3, PAINT$3, ORANGE$1)),
3474
+ ...room(MODULES[1], [[[101.8, 104.2]], [[UX0 + T, UX1 - T], [105.8, 105.8]]], box$2(106, 0, 200.6, 108, 1.2, 202.6, PAINT$3, PAINT$3, ORANGE$1)),
3475
+ box$2(TX0, H, TZ0, TX1, TY, TZ1, STEEL$3, METAL$3),
3476
+ box$2(UX0, H, UZ0, UX1, TY, TZ1, STEEL$3, METAL$3),
3477
+ box$2(UX0, 0, TZ1 - T, TX1, H, TZ1, METAL$3),
3478
+ box$2(UX1 - T, 0, TZ0, TX1, H, TZ0 + T, METAL$3),
3479
+ box$2(UX0, 0, UZ0, UX0 + T, H, TZ0, METAL$3),
3480
+ box$2(UX1 - T, 0, UZ0, UX1, H, TZ0, METAL$3),
3481
3481
  ...stairs(2, 214, TZ0, 105, 109, 0, 3.5),
3482
3482
  ...stairs(0, 108, UX1, 206, 210, 0, 3.5)
3483
3483
  ];
@@ -3556,8 +3556,8 @@ var Station = class {
3556
3556
  };
3557
3557
  }
3558
3558
  };
3559
- var { METAL: METAL$1, STEEL: STEEL$1, PAINT: PAINT$1, GLASS, GRATE } = TEX;
3560
- var box = (x0, y0, z0, x1, y1, z1, top, side = top, tint) => ({
3559
+ var { METAL: METAL$2, STEEL: STEEL$2, PAINT: PAINT$2, GLASS, GRATE: GRATE$1 } = TEX;
3560
+ var box$1 = (x0, y0, z0, x1, y1, z1, top, side = top, tint) => ({
3561
3561
  min: [
3562
3562
  x0,
3563
3563
  y0,
@@ -3576,7 +3576,7 @@ var box = (x0, y0, z0, x1, y1, z1, top, side = top, tint) => ({
3576
3576
  * The satellite's body: a cylinder standing round the hangar, its radius and its bottom and top over
3577
3577
  * the deck. As in the user's picture it is about twice as long as it is wide.
3578
3578
  */
3579
- var HULL = {
3579
+ var HULL$1 = {
3580
3580
  R: 44,
3581
3581
  LOW: -40,
3582
3582
  TOP: 130
@@ -3609,7 +3609,7 @@ var PARTS = {
3609
3609
  * 4 m), so a ship stops on what it sees. Returns the brushes, the StationDef and the door.
3610
3610
  */
3611
3611
  var station = (x, Y, z) => {
3612
- const { R, LOW, TOP } = HULL;
3612
+ const { R, LOW, TOP } = HULL$1;
3613
3613
  const [w, e, s, n] = [
3614
3614
  x - 24,
3615
3615
  x + 24,
@@ -3640,7 +3640,7 @@ var station = (x, Y, z) => {
3640
3640
  const off = Math.max(Math.abs(a - x), Math.abs(a + 4 - x));
3641
3641
  const h = Math.sqrt(R * R - off * off);
3642
3642
  const slice = (y0, y1, z0, z1) => z1 > z0 && body.push({
3643
- ...box(a, y0, z0, a + 4, y1, z1, METAL$1),
3643
+ ...box$1(a, y0, z0, a + 4, y1, z1, METAL$2),
3644
3644
  ghost: true
3645
3645
  });
3646
3646
  slice(Y + LOW, Y - 2, z - h, z + h);
@@ -3659,15 +3659,15 @@ var station = (x, Y, z) => {
3659
3659
  for (const k of [-1, 1]) {
3660
3660
  const [a, b] = [x + k * R, x + k * (R + reach)];
3661
3661
  body.push({
3662
- ...box(Math.min(a, b), mid - 1.5, z - 1.5, Math.max(a, b), mid + 1.5, z + 1.5, METAL$1),
3662
+ ...box$1(Math.min(a, b), mid - 1.5, z - 1.5, Math.max(a, b), mid + 1.5, z + 1.5, METAL$2),
3663
3663
  ghost: true
3664
3664
  }, {
3665
- ...box(Math.min(a, b), mid - PARTS.SPAN / 2, z - .4, Math.max(a, b), mid + PARTS.SPAN / 2, z + .4, METAL$1),
3665
+ ...box$1(Math.min(a, b), mid - PARTS.SPAN / 2, z - .4, Math.max(a, b), mid + PARTS.SPAN / 2, z + .4, METAL$2),
3666
3666
  ghost: true
3667
3667
  });
3668
3668
  }
3669
3669
  body.push({
3670
- ...box(x - 25, Y + TOP + 3, z - 7, x - 7, Y + TOP + PARTS.MAST + 6, z + 7, METAL$1),
3670
+ ...box$1(x - 25, Y + TOP + 3, z - 7, x - 7, Y + TOP + PARTS.MAST + 6, z + 7, METAL$2),
3671
3671
  ghost: true
3672
3672
  });
3673
3673
  const door = [[
@@ -3681,20 +3681,20 @@ var station = (x, Y, z) => {
3681
3681
  ]];
3682
3682
  return [
3683
3683
  [
3684
- box(w, Y - 2, s, e, Y, n, GRATE, METAL$1),
3685
- box(w, Y + 14, s, e, Y + 16, n, METAL$1),
3686
- box(w, Y, s, w + 4, Y + 14, n, PAINT$1, PAINT$1, grey),
3687
- box(e - 4, Y, s, e, Y + 14, z - 3, PAINT$1, PAINT$1, grey),
3688
- box(e - 4, Y, z + 3, e, Y + 14, n, PAINT$1, PAINT$1, grey),
3689
- box(e - 4, Y + 3.2, z - 3, e, Y + 14, z + 3, PAINT$1, PAINT$1, grey),
3690
- box(w + 4, Y + 11, s, e - 4, Y + 14, s + 4, STEEL$1, STEEL$1, lit),
3691
- box(w + 4, Y + 11, n - 4, e - 4, Y + 14, n, STEEL$1, STEEL$1, lit),
3692
- box(e, Y - 2, z - 10, x + 40, Y, z + 10, METAL$1),
3693
- box(e, Y + 4, z - 10, x + 40, Y + 5, z + 10, METAL$1),
3694
- box(e, Y, z - 10, x + 40, Y + 4, z - 8, PAINT$1, PAINT$1, grey),
3695
- box(e, Y, z + 8, x + 40, Y + 4, z + 10, PAINT$1, PAINT$1, grey),
3696
- box(x + 38, Y, z - 8, x + 40, Y + 4, z + 8, GLASS),
3697
- box(...post[0], ...post[1], STEEL$1, STEEL$1, lit),
3684
+ box$1(w, Y - 2, s, e, Y, n, GRATE$1, METAL$2),
3685
+ box$1(w, Y + 14, s, e, Y + 16, n, METAL$2),
3686
+ box$1(w, Y, s, w + 4, Y + 14, n, PAINT$2, PAINT$2, grey),
3687
+ box$1(e - 4, Y, s, e, Y + 14, z - 3, PAINT$2, PAINT$2, grey),
3688
+ box$1(e - 4, Y, z + 3, e, Y + 14, n, PAINT$2, PAINT$2, grey),
3689
+ box$1(e - 4, Y + 3.2, z - 3, e, Y + 14, z + 3, PAINT$2, PAINT$2, grey),
3690
+ box$1(w + 4, Y + 11, s, e - 4, Y + 14, s + 4, STEEL$2, STEEL$2, lit),
3691
+ box$1(w + 4, Y + 11, n - 4, e - 4, Y + 14, n, STEEL$2, STEEL$2, lit),
3692
+ box$1(e, Y - 2, z - 10, x + 40, Y, z + 10, METAL$2),
3693
+ box$1(e, Y + 4, z - 10, x + 40, Y + 5, z + 10, METAL$2),
3694
+ box$1(e, Y, z - 10, x + 40, Y + 4, z - 8, PAINT$2, PAINT$2, grey),
3695
+ box$1(e, Y, z + 8, x + 40, Y + 4, z + 10, PAINT$2, PAINT$2, grey),
3696
+ box$1(x + 38, Y, z - 8, x + 40, Y + 4, z + 8, GLASS),
3697
+ box$1(...post[0], ...post[1], STEEL$2, STEEL$2, lit),
3698
3698
  ...body
3699
3699
  ],
3700
3700
  {
@@ -3726,8 +3726,8 @@ var station = (x, Y, z) => {
3726
3726
  }
3727
3727
  ];
3728
3728
  };
3729
- var [RED, BLUE] = TEAM_TINT;
3730
- var { STONE, CONCRETE, METAL, STEEL, PAINT } = TEX;
3729
+ var [RED$1, BLUE$1] = TEAM_TINT;
3730
+ var { STONE: STONE$1, CONCRETE, METAL: METAL$1, STEEL: STEEL$1, PAINT: PAINT$1 } = TEX;
3731
3731
  /** The twin of a box across the centre line. */
3732
3732
  var mirror$1 = ({ min, max }) => bx(min[0], min[1], 280 - max[2], max[0], max[1], 280 - min[2]);
3733
3733
  /** The domes' centres, the landing pads (x, z, radius), the modules, the tubes and the masts (centres), red's then blue's: what the scenery draws on. */
@@ -3745,9 +3745,9 @@ var PADS = [[
3745
3745
  var MASTS = [[106.2, 230.4], [103.2, 212.4]];
3746
3746
  /** Red's flag: in the hall, 2 m from the dome's centre toward the door. */
3747
3747
  var FLAG = DOME[1] - 2;
3748
- var c1 = (t) => Math.min(Math.max(t, 0), 1);
3749
- var sm = (t) => c1(t) * c1(t) * (3 - 2 * c1(t));
3750
- var far = (a, b) => Math.sqrt(a * a + b * b);
3748
+ var c1$1 = (t) => Math.min(Math.max(t, 0), 1);
3749
+ var sm$1 = (t) => c1$1(t) * c1$1(t) * (3 - 2 * c1$1(t));
3750
+ var far$1 = (a, b) => Math.sqrt(a * a + b * b);
3751
3751
  /**
3752
3752
  * Craters, x, z, radius and how deep as a share of the radius: a bowl under a rim, both wandering
3753
3753
  * with the bearing (the rim is 0.03 to 0.075 of the radius high and up to 10 % nearer or further),
@@ -3923,7 +3923,7 @@ var [MOUND, RISE] = [3, 8];
3923
3923
  * triangles are level over it) and back to itself 6 m further. The lips need none: the field
3924
3924
  * starts 12 m behind them.
3925
3925
  */
3926
- var FLATS = [
3926
+ var FLATS$1 = [
3927
3927
  [
3928
3928
  27,
3929
3929
  67,
@@ -4140,14 +4140,14 @@ var SITES = [
4140
4140
  var bowls = (x, z) => {
4141
4141
  let [h, m] = [0, 0];
4142
4142
  for (const [cx, cz, r, k = .17, flat = 0] of BOWLS) {
4143
- const d = far(x - cx, z - cz);
4143
+ const d = far$1(x - cx, z - cz);
4144
4144
  const [ux, uz] = d ? [(x - cx) / d, (z - cz) / d] : [1, 0];
4145
4145
  const q = d / r * (.9 + .2 * noise(2.5 * ux + .37 * cx, 2.5 * uz + .21 * cz, 9));
4146
4146
  const rim = .03 + .045 * noise(4 * ux - .1 * cz, 4 * uz + .1 * cx, 10);
4147
- const s = 1 - c1((q - 1 - 4 / r) / .6);
4148
- const wall = flat ? (k + rim) * c1((q - flat) / (1 - flat)) - k : (k + rim) * q * q - k;
4147
+ const s = 1 - c1$1((q - 1 - 4 / r) / .6);
4148
+ const wall = flat ? (k + rim) * c1$1((q - flat) / (1 - flat)) - k : (k + rim) * q * q - k;
4149
4149
  h += r * (q < 1 ? wall : rim * s * s);
4150
- m = Math.max(m, flat ? c1((1.6 - q) / (1.5 - flat)) : 0);
4150
+ m = Math.max(m, flat ? c1$1((1.6 - q) / (1.5 - flat)) : 0);
4151
4151
  }
4152
4152
  return [h, m];
4153
4153
  };
@@ -4157,7 +4157,7 @@ var bowls = (x, z) => {
4157
4157
  * between the lattice's lines, so the ground between two nodes is what at() says.
4158
4158
  */
4159
4159
  var across = (cx, x) => {
4160
- const f = (u) => c1((12 - Math.abs(u - cx)) / 8) * c1((152 - u) / 4);
4160
+ const f = (u) => c1$1((12 - Math.abs(u - cx)) / 8) * c1$1((152 - u) / 4);
4161
4161
  const x0 = 4 * Math.floor(x / 4);
4162
4162
  return f(x0) + (f(x0 + 4) - f(x0)) * (x - x0) / 4;
4163
4163
  };
@@ -4212,20 +4212,20 @@ var STRIPS = [
4212
4212
  * the jump ramps outside with their run-ups and landings, the craters and the dishes' hill.
4213
4213
  */
4214
4214
  var rough = (x, z, out) => {
4215
- const gap = (l, by, over) => l.reduce((m, [x0, z0, x1, z1]) => m * sm((far(Math.max(x0 - x, x - x1, 0), Math.max(z0 - z, z - z1, 0)) - by) / over), 1);
4215
+ const gap = (l, by, over) => l.reduce((m, [x0, z0, x1, z1]) => m * sm$1((far$1(Math.max(x0 - x, x - x1, 0), Math.max(z0 - z, z - z1, 0)) - by) / over), 1);
4216
4216
  if (out < 0) {
4217
4217
  const i = Math.min(Math.max(Math.floor(x), 6), LIP.length - 7);
4218
4218
  const lip = Math.max(...LIP.slice(i - 6, i + 7), 0);
4219
- return (.6 * Math.max(noise(x / 5, z / 5, 61) - .42, 0) + .25 * Math.max(noise(x / 9, z / 9, 67) - .5, 0)) * sm(-out / 4) * sm((z - 14 - lip) / 3) * gap(FLATS.filter((f) => f[0] === f[2]), 7.5, 2) * gap(FLATS.filter((f) => f[0] < f[2]), 5.7, 2) * gap(STRIPS, 5.7, 2);
4219
+ return (.6 * Math.max(noise(x / 5, z / 5, 61) - .42, 0) + .25 * Math.max(noise(x / 9, z / 9, 67) - .5, 0)) * sm$1(-out / 4) * sm$1((z - 14 - lip) / 3) * gap(FLATS$1.filter((f) => f[0] === f[2]), 7.5, 2) * gap(FLATS$1.filter((f) => f[0] < f[2]), 5.7, 2) * gap(STRIPS, 5.7, 2);
4220
4220
  }
4221
- let m = sm(out / 4) * (Math.abs(x - 80) < 96 ? sm((z - 10) / 6) : 1);
4221
+ let m = sm$1(out / 4) * (Math.abs(x - 80) < 96 ? sm$1((z - 10) / 6) : 1);
4222
4222
  for (const [rx, rz, ax, az] of RAMPS) {
4223
4223
  const [p, q] = [x - rx, z - rz];
4224
4224
  const a = p * ax + q * az;
4225
- m *= sm((far(Math.max(-22 - a, a - 38, 0), Math.max(Math.abs(p * az - q * ax) - 10, 0)) - 2) / 4);
4225
+ m *= sm$1((far$1(Math.max(-22 - a, a - 38, 0), Math.max(Math.abs(p * az - q * ax) - 10, 0)) - 2) / 4);
4226
4226
  }
4227
- for (const [cx, cz, r] of BOWLS) m *= sm((far(x - cx, z - cz) / r - 1.3) / .25);
4228
- m *= sm((far(x - HILL[0], z - HILL[1]) - 40) / 20);
4227
+ for (const [cx, cz, r] of BOWLS) m *= sm$1((far$1(x - cx, z - cz) / r - 1.3) / .25);
4228
+ m *= sm$1((far$1(x - HILL[0], z - HILL[1]) - 40) / 20);
4229
4229
  return (.75 * Math.max(noise(x / 5, z / 5, 61) - .42, 0) - .8 * Math.max(noise(x / 7, z / 7, 63) - .6, 0) + .25 * (noise(x / 11, z / 11, 65) - .5)) * m;
4230
4230
  };
4231
4231
  /**
@@ -4236,37 +4236,37 @@ var rough = (x, z, out) => {
4236
4236
  * is 20 m high on it and, past it where nobody goes, rounds off under a crest of 28 to 48 m that
4237
4237
  * rolls slowly and falls to the plain at 1.65 of the bound. Lower than the ranges drawn far behind it.
4238
4238
  */
4239
- var at$2 = (x, z) => {
4239
+ var at$3 = (x, z) => {
4240
4240
  z = Math.abs(z - 140);
4241
- const k = far((x - 80) / 300, z / 360);
4241
+ const k = far$1((x - 80) / 300, z / 360);
4242
4242
  const t = Math.max((k - .78) / .22, 0);
4243
4243
  const dug = bowls(x, z);
4244
4244
  const out = Math.max(Math.abs(x - 80) - 80, z - 140);
4245
- let h = sm((out - 12) / 48) * (1 - .7 * sm(t)) * (16 * noise(x / 96, z / 96, 1) + 6 * noise(x / 52, z / 52, 4) + 5 * noise(x / 36, z / 36, 2) + 1.4 * noise(x / 22, z / 22, 3) - 14.2);
4245
+ let h = sm$1((out - 12) / 48) * (1 - .7 * sm$1(t)) * (16 * noise(x / 96, z / 96, 1) + 6 * noise(x / 52, z / 52, 4) + 5 * noise(x / 36, z / 36, 2) + 1.4 * noise(x / 22, z / 22, 3) - 14.2);
4246
4246
  if (out < 0) {
4247
- let m = sm((z - 16 - 10 * noise(x / 19, .5, 37)) / 8) * sm(-out / 10);
4248
- for (const [x0, z0, x1, z1] of FLATS) m *= sm((far(Math.max(x0 - x, x - x1, 0), Math.max(z0 - z, z - z1, 0)) - (x0 < x1 ? 6 : 7.5)) / 6);
4247
+ let m = sm$1((z - 16 - 10 * noise(x / 19, .5, 37)) / 8) * sm$1(-out / 10);
4248
+ for (const [x0, z0, x1, z1] of FLATS$1) m *= sm$1((far$1(Math.max(x0 - x, x - x1, 0), Math.max(z0 - z, z - z1, 0)) - (x0 < x1 ? 6 : 7.5)) / 6);
4249
4249
  h = m * Math.min(Math.max(4.8 * noise(x / 15, z / 15, 21) - .9, 0) + Math.max(3 * noise(x / 31, z / 31, 23) - .6, 0), 2.6);
4250
- const s = sm((10 - far(x - HOLLOW[0], z - (HOLLOW[1] - 140))) / 8);
4250
+ const s = sm$1((10 - far$1(x - HOLLOW[0], z - (HOLLOW[1] - 140))) / 8);
4251
4251
  h = h * (1 - s) - HOLLOW[2] * s;
4252
- for (const cx of MOUNDS) h += MOUND * c1((8 + RISE - z) / RISE) * across(cx, x);
4252
+ for (const cx of MOUNDS) h += MOUND * c1$1((8 + RISE - z) / RISE) * across(cx, x);
4253
4253
  h = z < 8 ? 0 : h;
4254
4254
  }
4255
- h = (out < 0 ? h : h * (1 - dug[1])) + dug[0] + rough(x, z, out) * (1 - dug[1]) * (1 - sm(t));
4255
+ h = (out < 0 ? h : h * (1 - dug[1])) + dug[0] + rough(x, z, out) * (1 - dug[1]) * (1 - sm$1(t));
4256
4256
  for (const [rx, rz, ax, az] of RAMPS) {
4257
4257
  const [p, q] = [x - rx, z - rz];
4258
4258
  const a = p * ax + q * az;
4259
- h += 5.6 * c1(Math.min(a / 16, (32 - a) / 12)) * c1((18 - Math.abs(p * az - q * ax)) / 12);
4259
+ h += 5.6 * c1$1(Math.min(a / 16, (32 - a) / 12)) * c1$1((18 - Math.abs(p * az - q * ax)) / 12);
4260
4260
  }
4261
- const d = c1(far(x - RIDGE[0], Math.max(z - RIDGE[1], 0)) / 36);
4262
- h += 12 * (1 - d * d) * (1 - d * d) + 8 * sm((36 - far(x - HILL[0], z - HILL[1])) / 24);
4261
+ const d = c1$1(far$1(x - RIDGE[0], Math.max(z - RIDGE[1], 0)) / 36);
4262
+ h += 12 * (1 - d * d) * (1 - d * d) + 8 * sm$1((36 - far$1(x - HILL[0], z - HILL[1])) / 24);
4263
4263
  let w = 10 * t * (1 + t);
4264
4264
  if (k > 1) {
4265
4265
  const crest = 28 + 14 * noise(x / 170, z / 170, 5) + 6 * noise(x / 70, z / 70, 7);
4266
- const soft = 10 * sm((k - 1) / .1);
4267
- w = (w + crest - Math.sqrt((w - crest) * (w - crest) + soft * soft)) / 2 * (1 - sm((k - 1.3) / .35));
4266
+ const soft = 10 * sm$1((k - 1) / .1);
4267
+ w = (w + crest - Math.sqrt((w - crest) * (w - crest) + soft * soft)) / 2 * (1 - sm$1((k - 1.3) / .35));
4268
4268
  }
4269
- h *= 1 - .55 * sm((16 - far(x - 44, z - 122)) / 10);
4269
+ h *= 1 - .55 * sm$1((16 - far$1(x - 44, z - 122)) / 10);
4270
4270
  return Math.max(h, -14.5) + w;
4271
4271
  };
4272
4272
  /** How high a rock's middle is over the ground: three tenths of its height, and 0.6 m or half its height if less. Its widest is there, its flank steep down to the ground: a body is stopped at its foot. */
@@ -4293,8 +4293,8 @@ var rockOf = (s, R, H) => {
4293
4293
  const [fx, fz] = flat(7);
4294
4294
  const swell = (u) => {
4295
4295
  const n = .8 + .28 * noise(1.1 * u[0] + s, 1.1 * u[2] + .9 * u[1], s) + .1 * noise(2.3 * u[0] - s, 2.3 * u[2] + 1.7 * u[1], s + 1);
4296
- const hollow = c1((.8 * (u[0] * hx + u[2] * hz) + .6 * u[1] - .55) / .45);
4297
- const side = c1((.954 * (u[0] * fx + u[2] * fz) + .3 * u[1] - .4) / .6);
4296
+ const hollow = c1$1((.8 * (u[0] * hx + u[2] * hz) + .6 * u[1] - .55) / .45);
4297
+ const side = c1$1((.954 * (u[0] * fx + u[2] * fz) + .3 * u[1] - .4) / .6);
4298
4298
  return n * (1 - .14 * hollow * hollow) * (1 - .16 * side * side);
4299
4299
  };
4300
4300
  const cu = (H - rockMid(H)) / swell([
@@ -4476,16 +4476,16 @@ var fitted = ({ reach }, R, lo, band, foot) => {
4476
4476
  return out;
4477
4477
  };
4478
4478
  /** The ground as it is walked on: at()'s 4 m lattice, each square two triangles, as ground() in relief.ts reads it. */
4479
- var walked = (x, z) => {
4479
+ var walked$1 = (x, z) => {
4480
4480
  const [i, j] = [Math.floor(x / 4), Math.floor(z / 4)];
4481
4481
  const [fu, fv] = [x / 4 - i, z / 4 - j];
4482
- const h = (u, v) => at$2(4 * (i + u), 4 * (j + v));
4482
+ const h = (u, v) => at$3(4 * (i + u), 4 * (j + v));
4483
4483
  const [a, d] = [h(0, 0), h(1, 1)];
4484
4484
  return fu >= fv ? a + (h(1, 0) - a) * fu + (d - h(1, 0)) * fv : a + (h(0, 1) - a) * fv + (d - h(0, 1)) * fu;
4485
4485
  };
4486
4486
  /** A rock of the map: where its middle is over the ground (x, the ground's height, z), its radius, height and seed, and the boxes it collides with (x0, y0, z0, x1, y1, z1), inside what rockOf() draws. */
4487
4487
  var crag = (x, z, R, H, s) => {
4488
- const g = walked(x, z);
4488
+ const g = walked$1(x, z);
4489
4489
  const y = g + rockMid(H);
4490
4490
  const span = [
4491
4491
  -3,
@@ -4496,7 +4496,7 @@ var crag = (x, z, R, H, s) => {
4496
4496
  2,
4497
4497
  3
4498
4498
  ].map((k) => .4 * R * k);
4499
- const round = span.map((u) => span.map((v) => walked(x + u, z + v)));
4499
+ const round = span.map((u) => span.map((v) => walked$1(x + u, z + v)));
4500
4500
  const lo = Math.max(Math.min(...round.flat()), g - .55 * H);
4501
4501
  const band = Math.max(...round.flat()) + PLAYER_H;
4502
4502
  return {
@@ -4519,7 +4519,7 @@ var crag = (x, z, R, H, s) => {
4519
4519
  };
4520
4520
  };
4521
4521
  /** Red's boulders, each with the boxes it collides with; blue's are their mirrors. */
4522
- var CRAGS = [
4522
+ var CRAGS$1 = [
4523
4523
  [
4524
4524
  32.5,
4525
4525
  156.5,
@@ -4578,7 +4578,7 @@ var CRAGS = [
4578
4578
  ]
4579
4579
  ].map(([x, z, R, H, s]) => crag(x, z, R, H, s));
4580
4580
  var ghosts = (l) => l.flatMap((c) => c.parts).map(([x0, y0, z0, x1, y1, z1]) => ({
4581
- ...box$1(x0, y0, z0, x1, y1, z1, STONE),
4581
+ ...box$2(x0, y0, z0, x1, y1, z1, STONE$1),
4582
4582
  ghost: true
4583
4583
  }));
4584
4584
  /** A pit: PIT_R in radius, cut in a square of half side PIT_S of its crater's terrace, its floor at PIT_FLOOR, 7 m over the kill floor; a flight of PIT_STEPS steps up its east wall. */
@@ -4610,7 +4610,7 @@ var PITS = BOWLS.filter((b) => b[4]).map(([x, zf], n) => {
4610
4610
  return {
4611
4611
  x,
4612
4612
  z,
4613
- level: at$2(x, z),
4613
+ level: at$3(x, z),
4614
4614
  rows
4615
4615
  };
4616
4616
  });
@@ -4630,11 +4630,11 @@ var pit = ({ x, z, level, rows }) => {
4630
4630
  const east = rows[PIT_R][3];
4631
4631
  const rise = (level - PIT_FLOOR) / PIT_STEPS;
4632
4632
  return [
4633
- box$1(x - PIT_S, -30, z - PIT_S, x + PIT_S, level, z - PIT_R, STONE),
4634
- box$1(x - PIT_S, -30, z + PIT_R, x + PIT_S, level, z + PIT_S, STONE),
4635
- ...runs.flatMap(([z0, z1, a, b]) => [box$1(x - PIT_S, -30, z0, x - a, level, z1, STONE), box$1(x + b, -30, z0, x + PIT_S, level, z1, STONE)]),
4636
- box$1(x - PIT_R - 1.5, -30, z - PIT_R, x + PIT_R + 1.5, PIT_FLOOR, z + PIT_R, STONE),
4637
- ...Array.from({ length: PIT_STEPS - 1 }, (_, k) => box$1(x + east - 1.3 * (PIT_STEPS - 1 - k), PIT_FLOOR, z - 1, x + east - 1.3 * (PIT_STEPS - 2 - k), PIT_FLOOR + rise * (k + 1), z + 1, STONE))
4633
+ box$2(x - PIT_S, -30, z - PIT_S, x + PIT_S, level, z - PIT_R, STONE$1),
4634
+ box$2(x - PIT_S, -30, z + PIT_R, x + PIT_S, level, z + PIT_S, STONE$1),
4635
+ ...runs.flatMap(([z0, z1, a, b]) => [box$2(x - PIT_S, -30, z0, x - a, level, z1, STONE$1), box$2(x + b, -30, z0, x + PIT_S, level, z1, STONE$1)]),
4636
+ box$2(x - PIT_R - 1.5, -30, z - PIT_R, x + PIT_R + 1.5, PIT_FLOOR, z + PIT_R, STONE$1),
4637
+ ...Array.from({ length: PIT_STEPS - 1 }, (_, k) => box$2(x + east - 1.3 * (PIT_STEPS - 1 - k), PIT_FLOOR, z - 1, x + east - 1.3 * (PIT_STEPS - 2 - k), PIT_FLOOR + rise * (k + 1), z + 1, STONE$1))
4638
4638
  ].map((b) => ({
4639
4639
  ...b,
4640
4640
  ghost: true
@@ -4642,10 +4642,10 @@ var pit = ({ x, z, level, rows }) => {
4642
4642
  };
4643
4643
  /** The ghost under a drawn rock or mast: a box of half side s from under the ground to h above it. */
4644
4644
  var lump = (x, z, s, h) => ({
4645
- ...box$1(x - s, at$2(x, z) - 6, z - s, x + s, at$2(x, z) + h, z + s, STONE),
4645
+ ...box$2(x - s, at$3(x, z) - 6, z - s, x + s, at$3(x, z) + h, z + s, STONE$1),
4646
4646
  ghost: true
4647
4647
  });
4648
- var LAYOUT = {
4648
+ var LAYOUT$1 = {
4649
4649
  /** Outside the arena: the dishes, the ramps (the middle of the lip and the unit way up it), the wreck. */
4650
4650
  dishes: [...DISHES, ...DISHES.map(([x, z]) => [x, 280 - z])],
4651
4651
  ramps: RAMPS.flatMap(([x, z, ax, az]) => (z ? [1, -1] : [1]).map((m) => [
@@ -4674,7 +4674,7 @@ var LAYOUT = {
4674
4674
  k
4675
4675
  ])),
4676
4676
  /** Red's boulders, in the field and outside: blue's are their mirrors. */
4677
- crags: CRAGS,
4677
+ crags: CRAGS$1,
4678
4678
  /** Where the boulders stood, red's side (x, z, radius): pebbles lie thickest there. */
4679
4679
  sites: SITES,
4680
4680
  pillars: PILLARS,
@@ -4689,7 +4689,7 @@ var LAYOUT = {
4689
4689
  masts: [...MASTS, ...MASTS.map(([x, z]) => [x, 280 - z])]
4690
4690
  };
4691
4691
  /** The twin of a brush, a point or a spawn across the centre line. */
4692
- var flip$1 = (b) => ({
4692
+ var flip$2 = (b) => ({
4693
4693
  ...b,
4694
4694
  min: [
4695
4695
  b.min[0],
@@ -4701,29 +4701,29 @@ var flip$1 = (b) => ({
4701
4701
  b.max[1],
4702
4702
  280 - b.min[2]
4703
4703
  ],
4704
- tint: b.tint === RED ? BLUE : b.tint
4704
+ tint: b.tint === RED$1 ? BLUE$1 : b.tint
4705
4705
  });
4706
- var flipPoint = ([x, y, z]) => [
4706
+ var flipPoint$1 = ([x, y, z]) => [
4707
4707
  x,
4708
4708
  y,
4709
4709
  280 - z
4710
4710
  ];
4711
4711
  /** The list and its twins, then the pieces by the rille. */
4712
- var both = (l, ...mid) => [
4712
+ var both$1 = (l, ...mid) => [
4713
4713
  ...l,
4714
- ...l.map(flipPoint),
4714
+ ...l.map(flipPoint$1),
4715
4715
  ...mid
4716
4716
  ];
4717
4717
  /** Red's half: z from 140 to 280. */
4718
- var half = [
4718
+ var half$1 = [
4719
4719
  ...[
4720
- box$1(0, -30, 160, 160, 0, HOLLOW[1] - 12, STONE),
4721
- box$1(0, -30, HOLLOW[1] - 12, HOLLOW[0] - 12, 0, HOLLOW[1] + 12, STONE),
4722
- box$1(HOLLOW[0] + 12, -30, HOLLOW[1] - 12, 160, 0, HOLLOW[1] + 12, STONE),
4723
- box$1(0, -30, HOLLOW[1] + 12, 160, 0, 280, STONE),
4724
- box$1(HOLLOW[0] - 12, -30, HOLLOW[1] - 12, HOLLOW[0] + 12, -3, HOLLOW[1] + 12, STONE),
4725
- ...RUNS.filter((r) => r[2] < 0).map(([x, w, n]) => box$1(x, -30, 148 + n, x + w, 0, 160, STONE)),
4726
- ...Array.from({ length: 14 }, (_, k) => runs(LIP.map((n) => n < 0 ? 2 : n > k / 2 ? 1 : 0)).filter((r) => !r[2]).map(([x, w]) => box$1(x, -30, 148 + k / 2, x + w, 0, k < 13 ? 148.5 + k / 2 : 160, STONE))).flat(),
4720
+ box$2(0, -30, 160, 160, 0, HOLLOW[1] - 12, STONE$1),
4721
+ box$2(0, -30, HOLLOW[1] - 12, HOLLOW[0] - 12, 0, HOLLOW[1] + 12, STONE$1),
4722
+ box$2(HOLLOW[0] + 12, -30, HOLLOW[1] - 12, 160, 0, HOLLOW[1] + 12, STONE$1),
4723
+ box$2(0, -30, HOLLOW[1] + 12, 160, 0, 280, STONE$1),
4724
+ box$2(HOLLOW[0] - 12, -30, HOLLOW[1] - 12, HOLLOW[0] + 12, -3, HOLLOW[1] + 12, STONE$1),
4725
+ ...RUNS.filter((r) => r[2] < 0).map(([x, w, n]) => box$2(x, -30, 148 + n, x + w, 0, 160, STONE$1)),
4726
+ ...Array.from({ length: 14 }, (_, k) => runs(LIP.map((n) => n < 0 ? 2 : n > k / 2 ? 1 : 0)).filter((r) => !r[2]).map(([x, w]) => box$2(x, -30, 148 + k / 2, x + w, 0, k < 13 ? 148.5 + k / 2 : 160, STONE$1))).flat(),
4727
4727
  ...MOUNDS.flatMap((x) => [
4728
4728
  -12,
4729
4729
  -10,
@@ -4738,57 +4738,57 @@ var half = [
4738
4738
  x + a,
4739
4739
  x + b,
4740
4740
  MOUND * Math.min(across(x, x + a), across(x, x + b)) * (1 - .5 / RISE) - .12
4741
- ]).filter((r) => r[2] > .3).map(([a, b, y]) => box$1(a, 0, 148, b, y, 148.5, STONE)))
4741
+ ]).filter((r) => r[2] > .3).map(([a, b, y]) => box$2(a, 0, 148, b, y, 148.5, STONE$1)))
4742
4742
  ].map((b) => ({
4743
4743
  ...b,
4744
4744
  ghost: true
4745
4745
  })),
4746
4746
  ...BASE,
4747
4747
  {
4748
- ...box$1(75.25, 0, FLAG - 4.75, 84.75, .5, FLAG + 4.75, PAINT, CONCRETE, RED),
4748
+ ...box$2(75.25, 0, FLAG - 4.75, 84.75, .5, FLAG + 4.75, PAINT$1, CONCRETE, RED$1),
4749
4749
  ghost: true
4750
4750
  },
4751
4751
  {
4752
- ...box$1(75.75, .5, FLAG - 4.25, 84.25, 1, FLAG + 4.25, PAINT, CONCRETE, RED),
4752
+ ...box$2(75.75, .5, FLAG - 4.25, 84.25, 1, FLAG + 4.25, PAINT$1, CONCRETE, RED$1),
4753
4753
  ghost: true
4754
4754
  },
4755
- ...PADS.map(([x, z, r]) => box$1(x - r, 0, z - r, x + r, .25, z + r, METAL)),
4756
- ...MASTS.map(([x, z]) => box$1(x - .2, 0, z - .2, x + .2, 10, z + .2, STEEL)),
4757
- box$1(12, -30, 148 - 2.5 / 2, 24, 0, 148, PAINT, STONE, [
4755
+ ...PADS.map(([x, z, r]) => box$2(x - r, 0, z - r, x + r, .25, z + r, METAL$1)),
4756
+ ...MASTS.map(([x, z]) => box$2(x - .2, 0, z - .2, x + .2, 10, z + .2, STEEL$1)),
4757
+ box$2(12, -30, 148 - 2.5 / 2, 24, 0, 148, PAINT$1, STONE$1, [
4758
4758
  1,
4759
4759
  .42,
4760
4760
  .08
4761
4761
  ]),
4762
4762
  ...PITS.filter((p) => p.z !== 140).flatMap(pit),
4763
- ...ghosts(CRAGS),
4763
+ ...ghosts(CRAGS$1),
4764
4764
  ...DISHES.map(([x, z]) => lump(x, z, .4, 6))
4765
4765
  ];
4766
4766
  /** What stands on the centre line, symmetric as written: the bridge, the stones, the rille's plugs and the wreck. */
4767
- var centre = [
4768
- box$1(74, -1.5, 132, 86, 0, 148, METAL, STEEL),
4769
- box$1(74, 0, 132, 74.4, 1.1, 148, CONCRETE),
4770
- box$1(85.6, 0, 132, 86, 1.1, 148, CONCRETE),
4767
+ var centre$1 = [
4768
+ box$2(74, -1.5, 132, 86, 0, 148, METAL$1, STEEL$1),
4769
+ box$2(74, 0, 132, 74.4, 1.1, 148, CONCRETE),
4770
+ box$2(85.6, 0, 132, 86, 1.1, 148, CONCRETE),
4771
4771
  ...PILLARS.map(([x0, z0, x1, z1, y]) => ({
4772
- ...box$1(x0, -30, z0, x1, y, z1, STONE),
4772
+ ...box$2(x0, -30, z0, x1, y, z1, STONE$1),
4773
4773
  ghost: true
4774
4774
  })),
4775
4775
  {
4776
- ...box$1(-10, -30, 132, 0, 0, 148, STONE),
4776
+ ...box$2(-10, -30, 132, 0, 0, 148, STONE$1),
4777
4777
  ghost: true
4778
4778
  },
4779
4779
  {
4780
- ...box$1(160, -30, 132, 170, 0, 148, STONE),
4780
+ ...box$2(160, -30, 132, 170, 0, 148, STONE$1),
4781
4781
  ghost: true
4782
4782
  },
4783
4783
  {
4784
- ...box$1(WRECK[0] - 3.6, -30, WRECK[1] - 3.6, WRECK[0] + 3.6, PIT_FLOOR + 3.5, WRECK[1] + 3.6, STONE),
4784
+ ...box$2(WRECK[0] - 3.6, -30, WRECK[1] - 3.6, WRECK[0] + 3.6, PIT_FLOOR + 3.5, WRECK[1] + 3.6, STONE$1),
4785
4785
  ghost: true
4786
4786
  },
4787
4787
  ...PITS.filter((p) => p.z === 140).flatMap(pit),
4788
- ...LAYOUT.ramps.flatMap(([x, z, ax, az]) => [-8, 8].map((c) => lump(x + c * az, z - c * ax, .2, 2.2)))
4788
+ ...LAYOUT$1.ramps.flatMap(([x, z, ax, az]) => [-8, 8].map((c) => lump(x + c * az, z - c * ax, .2, 2.2)))
4789
4789
  ];
4790
4790
  /** Red's spawns behind the dome facing blue (yaw 0 looks toward -z): five in a row, three in front. */
4791
- var SPAWNS = [...[
4791
+ var SPAWNS$1 = [...[
4792
4792
  56,
4793
4793
  68,
4794
4794
  80,
@@ -4809,8 +4809,8 @@ var SPAWNS = [...[
4809
4809
  267,
4810
4810
  0
4811
4811
  ])];
4812
- var team = (z, s) => {
4813
- const side = (p) => z > 140 ? p : flipPoint(p);
4812
+ var team$1 = (z, s) => {
4813
+ const side = (p) => z > 140 ? p : flipPoint$1(p);
4814
4814
  return {
4815
4815
  base: [
4816
4816
  80,
@@ -4847,18 +4847,18 @@ var MOON = {
4847
4847
  tag: "Moon · half gravity",
4848
4848
  lore: "A mining base left in a lunar crater, its domes still lit. Two crews fight for it in space helmets, under the Earth and a black sky. Jumps float twice as high, and a rille cuts the base in two.",
4849
4849
  brushes: [
4850
- ...half,
4851
- ...half.map(flip$1),
4852
- ...centre,
4850
+ ...half$1,
4851
+ ...half$1.map(flip$2),
4852
+ ...centre$1,
4853
4853
  ...STATION_BRUSHES
4854
4854
  ],
4855
- teams: [team(FLAG, SPAWNS), team(280 - FLAG, SPAWNS.map(([x, y, z]) => [
4855
+ teams: [team$1(FLAG, SPAWNS$1), team$1(280 - FLAG, SPAWNS$1.map(([x, y, z]) => [
4856
4856
  x,
4857
4857
  y,
4858
4858
  280 - z,
4859
4859
  Math.PI
4860
4860
  ]))],
4861
- packs: both([
4861
+ packs: both$1([
4862
4862
  [
4863
4863
  90,
4864
4864
  0,
@@ -4888,7 +4888,7 @@ var MOON = {
4888
4888
  0,
4889
4889
  118
4890
4890
  ]),
4891
- ammo: both([
4891
+ ammo: both$1([
4892
4892
  [
4893
4893
  50,
4894
4894
  0,
@@ -4913,7 +4913,7 @@ var MOON = {
4913
4913
  0,
4914
4914
  118
4915
4915
  ]),
4916
- cells: both([[
4916
+ cells: both$1([[
4917
4917
  106.5,
4918
4918
  3.5,
4919
4919
  226
@@ -4926,7 +4926,7 @@ var MOON = {
4926
4926
  0,
4927
4927
  140
4928
4928
  ]),
4929
- vests: both([[
4929
+ vests: both$1([[
4930
4930
  107,
4931
4931
  5,
4932
4932
  200
@@ -4953,7 +4953,7 @@ var MOON = {
4953
4953
  132 - n,
4954
4954
  x + w,
4955
4955
  132
4956
- ]] : []), ...LAYOUT.pits.flatMap(({ x, rows }) => rows.map(([z0, z1, a, b]) => [
4956
+ ]] : []), ...LAYOUT$1.pits.flatMap(({ x, rows }) => rows.map(([z0, z1, a, b]) => [
4957
4957
  x - a,
4958
4958
  z0,
4959
4959
  x + b,
@@ -4966,7 +4966,7 @@ var MOON = {
4966
4966
  360
4967
4967
  ],
4968
4968
  cell: 4,
4969
- at: at$2
4969
+ at: at$3
4970
4970
  },
4971
4971
  sun: {
4972
4972
  dir: [
@@ -5038,6 +5038,782 @@ var MOON = {
5038
5038
  seam: ORBIT.SEAM,
5039
5039
  station: STATION_DEF
5040
5040
  };
5041
+ var MID$1 = 100;
5042
+ var [RED, BLUE] = TEAM_TINT;
5043
+ var { METAL, STEEL, PAINT, WOOD, STONE, GRATE } = TEX;
5044
+ var ORANGE = [
5045
+ 1,
5046
+ .42,
5047
+ .08
5048
+ ];
5049
+ var YELLOW = [
5050
+ .95,
5051
+ .75,
5052
+ .1
5053
+ ];
5054
+ /**
5055
+ * The frame every piece is laid on, metres. Across x, from the sea to the forest: the water is too
5056
+ * deep at `sea`, the waterline is at `shore` (the sand is at `water` there), the first trees stand
5057
+ * at `trees`, nothing is walked past `east`. Along z the headlands' rocks close the beach before
5058
+ * `cape` and after ZED - `cape`.
5059
+ */
5060
+ var FRAME = {
5061
+ sea: 0,
5062
+ shore: 30,
5063
+ trees: 90,
5064
+ east: 110,
5065
+ cape: 8,
5066
+ water: 0
5067
+ };
5068
+ /**
5069
+ * Feet under this have gone under: the runner is put back at a spawn (WorldDef.floor, the fall of
5070
+ * Highline's roofs, no new rule). The water's surface is y 0 and the eye is 1.6 m over the feet:
5071
+ * at 1.4 m of water a standing runner still looks over it.
5072
+ */
5073
+ var DEPTH = -1.4;
5074
+ /** Where nobody goes, x and z: the ghost wall behind the first palms and the one in each headland. */
5075
+ var EDGE$1 = {
5076
+ east: FRAME.trees + 5,
5077
+ cape: FRAME.cape / 2
5078
+ };
5079
+ /**
5080
+ * The wreck, a hull along x on the centre line, broken in three: each section's x0 and x1. The
5081
+ * tail is in the water, the middle on the sand, the nose in the trees; the two gaps are crossed on
5082
+ * foot. `r` is the hull's radius and `sunk` how deep its axis sits under r, so its back is at
5083
+ * 2 r - sunk over the sand. `axis` is the height of each section's axis: each lies level, 2 m in
5084
+ * the ground it came to rest on.
5085
+ */
5086
+ var HULL = {
5087
+ r: 7,
5088
+ sunk: 2,
5089
+ sections: [
5090
+ [6, 36],
5091
+ [44, 74],
5092
+ [82, 106]
5093
+ ],
5094
+ axis: [
5095
+ 4,
5096
+ 6.25,
5097
+ 7.5
5098
+ ]
5099
+ };
5100
+ /**
5101
+ * The hull's cross-section as stacked boxes: each a height over the axis and the half width from
5102
+ * there up to the next. A wall under the axis, the widest at it, two shoulders and the back, flat
5103
+ * and 5 m wide.
5104
+ */
5105
+ var RINGS = [
5106
+ [-HULL.r - 2, 5.8],
5107
+ [-2, 6.5],
5108
+ [2.5, 4.9],
5109
+ [5, 2.5],
5110
+ [HULL.r, 0]
5111
+ ];
5112
+ /** The middle section's hold: its floor and ceiling, the half width inside, the ends inside, the doors' x0 and x1 and their height. */
5113
+ var HOLD = {
5114
+ floor: HULL.axis[1] - 5,
5115
+ ceil: HULL.axis[1] - 2,
5116
+ half: 4.5,
5117
+ x: [47, 71],
5118
+ door: [57.5, 60.5],
5119
+ lintel: 2.4,
5120
+ /** The two bulkheads across it (x0, x1), each with a doorway `way` wide on the centre line. */
5121
+ walls: [[54.5, 55], [63, 63.5]],
5122
+ way: 2.4
5123
+ };
5124
+ /**
5125
+ * Red's wing, torn at the root and lying as a ramp from the sand up to the hull's back: its root
5126
+ * on the middle section (x0, x1 at z = ZED / 2 + HULL.r) and its tip on the sand (x0, x1, z).
5127
+ * Blue's is its twin.
5128
+ */
5129
+ var WING$1 = {
5130
+ root: [50, 68],
5131
+ tip: [
5132
+ 56,
5133
+ 66,
5134
+ 150
5135
+ ]
5136
+ };
5137
+ /** The wing's steps, each under what a runner walks up, and how thick it is where one walks under it. */
5138
+ var [STEPS, THICK] = [26, .8];
5139
+ /**
5140
+ * Red's engines, torn off: the middle of each nacelle (x, z), its radius and length, lying along z.
5141
+ * One on the sand by the wing, run through; one in the lagoon off the tail's end, stood on.
5142
+ */
5143
+ var ENGINES = [[
5144
+ 70,
5145
+ 138.5,
5146
+ 2.5,
5147
+ 9
5148
+ ], [
5149
+ 4.5,
5150
+ 112,
5151
+ 2.5,
5152
+ 9
5153
+ ]];
5154
+ /** Red's camp: the escape pod its flag stands by (x, z, radius). */
5155
+ var POD = [
5156
+ 60,
5157
+ 174,
5158
+ 4
5159
+ ];
5160
+ /** The camp's ground, level. */
5161
+ var CAMP = 1.25;
5162
+ /**
5163
+ * Red's headland, the rocks that close the beach past z = ZED - FRAME.cape, from the sea to the
5164
+ * trees: each x, z, radius, height and seed, a form of moon.ts rockOf(). Blue's are their twins.
5165
+ * The map makes them solid and the scenery draws them, both from this list.
5166
+ */
5167
+ var ROCKS = [
5168
+ [
5169
+ -4,
5170
+ 190,
5171
+ 7,
5172
+ 9,
5173
+ 1
5174
+ ],
5175
+ [
5176
+ 6,
5177
+ 196,
5178
+ 8,
5179
+ 11,
5180
+ 2
5181
+ ],
5182
+ [
5183
+ 18,
5184
+ 193,
5185
+ 6,
5186
+ 7,
5187
+ 3
5188
+ ],
5189
+ [
5190
+ 28,
5191
+ 198,
5192
+ 9,
5193
+ 13,
5194
+ 4
5195
+ ],
5196
+ [
5197
+ 40,
5198
+ 195,
5199
+ 7,
5200
+ 9,
5201
+ 5
5202
+ ],
5203
+ [
5204
+ 51,
5205
+ 199,
5206
+ 8,
5207
+ 12,
5208
+ 6
5209
+ ],
5210
+ [
5211
+ 62,
5212
+ 196,
5213
+ 6,
5214
+ 8,
5215
+ 7
5216
+ ],
5217
+ [
5218
+ 72,
5219
+ 199,
5220
+ 9,
5221
+ 14,
5222
+ 8
5223
+ ],
5224
+ [
5225
+ 83,
5226
+ 195,
5227
+ 7,
5228
+ 10,
5229
+ 9
5230
+ ],
5231
+ [
5232
+ 94,
5233
+ 198,
5234
+ 8,
5235
+ 12,
5236
+ 10
5237
+ ],
5238
+ [
5239
+ 105,
5240
+ 194,
5241
+ 7,
5242
+ 9,
5243
+ 11
5244
+ ]
5245
+ ];
5246
+ /**
5247
+ * Red's first row of palms, the trunks a runner can touch: each x, z and radius at the foot. The
5248
+ * map makes them solid and the scenery draws a palm on each; the forest behind is drawn only.
5249
+ * The first stands clear of the nose's flank.
5250
+ */
5251
+ var TRUNKS = Array.from({ length: 21 }, (_, i) => [
5252
+ FRAME.trees + 3 * hash(i, 1, 7),
5253
+ 109 + 4 * i + 2 * hash(i, 2, 7),
5254
+ .22 + .1 * hash(i, 3, 7)
5255
+ ]);
5256
+ var c1 = (t) => Math.min(Math.max(t, 0), 1);
5257
+ var sm = (t) => c1(t) * c1(t) * (3 - 2 * c1(t));
5258
+ var far = (a, b) => Math.sqrt(a * a + b * b);
5259
+ /**
5260
+ * Where the ground is level, x0, z0, x1, z1 (z in red's half) and the height: the way in to the
5261
+ * hold's door through the bank, the tip of the wing, the camp. Level for 6 m round each, so that
5262
+ * the lattice's triangles are, and back to the sand 6 m further; none within 12 m of the next.
5263
+ */
5264
+ var FLATS = [
5265
+ [
5266
+ 57,
5267
+ 107,
5268
+ 61,
5269
+ 113,
5270
+ HOLD.floor - .25
5271
+ ],
5272
+ [
5273
+ WING$1.tip[0],
5274
+ WING$1.tip[2] - 4,
5275
+ WING$1.tip[1],
5276
+ WING$1.tip[2],
5277
+ 1.3
5278
+ ],
5279
+ [
5280
+ 44,
5281
+ 164,
5282
+ 76,
5283
+ 184,
5284
+ CAMP
5285
+ ]
5286
+ ];
5287
+ /** The furrow the hull ploughed: how deep on its line, and how high the bank of sand thrown up on each side, 12 m off it. */
5288
+ var FURROW = [1.5, 1.2];
5289
+ /**
5290
+ * The height of the ground at a lattice node. The beach: the water's surface is y 0 and the sand
5291
+ * meets it at x 30, rises to 2.5 m at the trees and goes on up under them; the bed falls a metre
5292
+ * in ten, 3 m down at x 0, and keeps falling. Low dunes on the upper beach. The furrow along the
5293
+ * centre line from the waterline to the nose, a mound pushed up before the nose. The same on both
5294
+ * sides of the centre line. Only + - * /, Math.sqrt and the integer hash.
5295
+ */
5296
+ var at$2 = (x, z) => {
5297
+ const d = Math.abs(z - MID$1);
5298
+ const { shore, trees } = FRAME;
5299
+ let h = x > shore ? 2.5 * (x - shore) / (trees - shore) : (x - shore) / 10;
5300
+ h += .9 * sm((x - 46) / 24) * (noise(x / 13, d / 13, 5) - .45) * sm((d - 14) / 10);
5301
+ const k = sm((x - shore) / 14) * (1 - sm((x - 102) / 8));
5302
+ h += k * (FURROW[1] * c1(1 - Math.abs(d - 12) / 5) - FURROW[0] * (1 - sm((d - 2) / 7)));
5303
+ h += 1.8 * c1(1 - far(x - 110, d) / 9);
5304
+ for (const [x0, z0, x1, z1, y] of FLATS) {
5305
+ const off = far(Math.max(x0 - x, x - x1, 0), Math.max(z0 - MID$1 - d, MID$1 + d - z1, 0));
5306
+ h = y + (h - y) * sm((off - 6) / 6);
5307
+ }
5308
+ return h;
5309
+ };
5310
+ /** The ground as it is walked on: at()'s lattice in float32, each square two triangles, as ground() in relief.ts reads it. */
5311
+ var walked = (x, z) => {
5312
+ const [i, j] = [Math.floor(x / 4), Math.floor(z / 4)];
5313
+ const [fu, fv] = [x / 4 - i, z / 4 - j];
5314
+ const h = (u, v) => Math.fround(at$2(4 * (i + u), 4 * (j + v)));
5315
+ const [a, e] = [h(0, 0), h(1, 1)];
5316
+ 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;
5317
+ };
5318
+ var box = (x0, y0, z0, x1, y1, z1, top, tint) => ({
5319
+ min: [
5320
+ x0,
5321
+ y0,
5322
+ z0
5323
+ ],
5324
+ max: [
5325
+ x1,
5326
+ y1,
5327
+ z1
5328
+ ],
5329
+ top,
5330
+ side: top,
5331
+ ...tint ? { tint } : {}
5332
+ });
5333
+ var ghost = (b) => ({
5334
+ ...b,
5335
+ ghost: true
5336
+ });
5337
+ var flip$1 = (b) => ({
5338
+ ...b,
5339
+ min: [
5340
+ b.min[0],
5341
+ b.min[1],
5342
+ 200 - b.max[2]
5343
+ ],
5344
+ max: [
5345
+ b.max[0],
5346
+ b.max[1],
5347
+ 200 - b.min[2]
5348
+ ],
5349
+ ...b.tint ? { tint: b.tint === RED ? BLUE : b.tint } : {}
5350
+ });
5351
+ var flipPoint = ([x, y, z]) => [
5352
+ x,
5353
+ y,
5354
+ 200 - z
5355
+ ];
5356
+ var both = (l, ...mid) => [
5357
+ ...l,
5358
+ ...l.map(flipPoint),
5359
+ ...mid
5360
+ ];
5361
+ /** Red's pieces and the centre line's, as they are made: ghosts, collided with and drawn by the scenery (client/hulk.ts). */
5362
+ var mine = [];
5363
+ var line = [];
5364
+ var note = (l, kind, b) => {
5365
+ l.push({
5366
+ kind,
5367
+ min: b.min,
5368
+ max: b.max
5369
+ });
5370
+ return ghost(b);
5371
+ };
5372
+ /** The highest and the lowest ground under a rectangle. */
5373
+ var under$1 = (x0, z0, x1, z1) => {
5374
+ const l = [
5375
+ 0,
5376
+ .25,
5377
+ .5,
5378
+ .75,
5379
+ 1
5380
+ ].flatMap((u) => [
5381
+ 0,
5382
+ .25,
5383
+ .5,
5384
+ .75,
5385
+ 1
5386
+ ].map((v) => walked(x0 + (x1 - x0) * u, z0 + (z1 - z0) * v)));
5387
+ return [Math.max(...l), Math.min(...l)];
5388
+ };
5389
+ /**
5390
+ * A piece lying on the sand: its top `h` over the highest ground under it (to 1/32 m), its foot
5391
+ * half a metre under the lowest.
5392
+ */
5393
+ var lay = (kind, x0, z0, x1, z1, h, tex, tint) => {
5394
+ const [hi, lo] = under$1(x0, z0, x1, z1);
5395
+ return note(mine, kind, box(x0, lo - .5, z0, x1, Math.round((hi + h) * 32) / 32, z1, tex, tint));
5396
+ };
5397
+ /** The middle of a piece's top: where a pack or a rack stands on it. */
5398
+ var on = (b) => [
5399
+ (b.min[0] + b.max[0]) / 2,
5400
+ b.max[1],
5401
+ (b.min[2] + b.max[2]) / 2
5402
+ ];
5403
+ /** A solid section: its rings from x0 to x1, the first `skip` left out. */
5404
+ var rings = (n, skip = 0) => {
5405
+ const [x0, x1] = HULL.sections[n];
5406
+ const c = HULL.axis[n];
5407
+ return RINGS.slice(skip, -1).map(([y, half], k) => note(line, "hull", box(x0, c + y, MID$1 - half, x1, c + RINGS[k + skip + 1][0], MID$1 + half, METAL)));
5408
+ };
5409
+ var BACK$2 = HULL.axis.map((c) => c + HULL.r);
5410
+ /** The middle section, hollow under its axis: the hold's floor, its ends, its flanks with a door each, two bulkheads. */
5411
+ var hold = () => {
5412
+ const [x0, x1] = HULL.sections[1];
5413
+ const { floor, ceil, half, x, door, lintel, walls, way } = HOLD;
5414
+ const out = RINGS[0][1];
5415
+ const wall = (z0, z1) => [
5416
+ box(x[0], floor, z0, door[0], ceil, z1, METAL),
5417
+ box(door[1], floor, z0, x[1], ceil, z1, METAL),
5418
+ box(door[0], floor + lintel, z0, door[1], ceil, z1, STEEL)
5419
+ ];
5420
+ return [
5421
+ box(x0, HULL.axis[1] + RINGS[0][0], MID$1 - out, x1, floor, MID$1 + out, GRATE),
5422
+ box(x0, floor, MID$1 - out, x[0], ceil, MID$1 + out, METAL),
5423
+ box(x[1], floor, MID$1 - out, x1, ceil, MID$1 + out, METAL),
5424
+ ...wall(MID$1 + half, MID$1 + out),
5425
+ ...wall(MID$1 - out, MID$1 - half),
5426
+ ...walls.flatMap(([a, b]) => [
5427
+ box(a, floor, MID$1 - half, b, ceil, MID$1 - way / 2, STEEL),
5428
+ box(a, floor, MID$1 + way / 2, b, ceil, MID$1 + half, STEEL),
5429
+ box(a, floor + lintel, MID$1 - way / 2, b, ceil, MID$1 + way / 2, STEEL)
5430
+ ])
5431
+ ].map((b) => note(line, "hold", b));
5432
+ };
5433
+ /** A heap of ribs in the middle of each gap, a pack on it, and a fallen frame leaning on each broken end. */
5434
+ var GAPS = [40, 78].map((x) => {
5435
+ const [hi, lo] = under$1(x - 1.5, 98.5, x + 1.5, 101.5);
5436
+ const top = Math.round((Math.max(hi, FRAME.water) + .4) * 32) / 32;
5437
+ return {
5438
+ x,
5439
+ top,
5440
+ heap: box(x - 1.5, lo - .5, 98.5, x + 1.5, top, 101.5, STEEL, ORANGE)
5441
+ };
5442
+ });
5443
+ /** 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. */
5444
+ var FRAMES = [36, 74].flatMap((x) => {
5445
+ const [hi, lo] = under$1(x, 103, x + 1.2, 105.5);
5446
+ const b = box(x, lo - .5, 103, x + 1.2, Math.round((hi + 1.4) * 32) / 32, 105.5, STEEL);
5447
+ return [b, flip$1(b)];
5448
+ });
5449
+ /** The raft of the tail's skin afloat off its end, on the line: the middle of the way round. */
5450
+ var RAFT = box(.5, -.3, 96, 5, .4, 104, METAL);
5451
+ var centre = [
5452
+ ...rings(0),
5453
+ ...hold(),
5454
+ ...rings(1, 1),
5455
+ ...rings(2),
5456
+ ...GAPS.map((g) => note(line, "heap", g.heap)),
5457
+ ...FRAMES.map((b) => note(line, "frame", b)),
5458
+ note(line, "raft", RAFT),
5459
+ ghost(box(EDGE$1.east, -10, 0, EDGE$1.east + 2, 40, 200, STONE))
5460
+ ];
5461
+ /** The wing: steps from its tip on the sand to the hull's back, solid where a runner would not fit under it. */
5462
+ var wing = () => {
5463
+ const [tx0, tx1, tz] = WING$1.tip;
5464
+ const deep = (tz - (MID$1 + RINGS[3][1])) / STEPS;
5465
+ const span = (z) => {
5466
+ const t = c1((tz - z) / (tz - MID$1 - HULL.r));
5467
+ return [tx0 + (WING$1.root[0] - tx0) * t, tx1 + (WING$1.root[1] - tx1) * t];
5468
+ };
5469
+ const y0 = under$1(tx0, tz - deep, tx1, tz)[0] + .3;
5470
+ return Array.from({ length: STEPS }, (_, k) => {
5471
+ const [z1, z0] = [tz - k * deep, tz - (k + 1) * deep];
5472
+ const [x0, x1] = span((z0 + z1) / 2);
5473
+ const y = y0 + (BACK$2[1] - y0) * k / (STEPS - 1);
5474
+ const [hi, lo] = under$1(x0, z0, x1, z1);
5475
+ const slab = z1 <= MID$1 + HULL.r || y - THICK - hi >= 2.2;
5476
+ return note(mine, "wing", box(x0, z1 <= MID$1 + RINGS[2][1] ? HULL.axis[1] + RINGS[3][0] : slab ? y - THICK : lo - .5, z0, x1, y, z1, METAL));
5477
+ });
5478
+ };
5479
+ /** The nacelle on the sand, lying along z and run through: two flanks, a roof between them. */
5480
+ var nacelle = () => {
5481
+ const [x, z, r, l] = ENGINES[0];
5482
+ const [z0, z1] = [z - l / 2, z + l / 2];
5483
+ const [hi, lo] = under$1(x - r, z0, x + r, z1);
5484
+ const y = Math.round(hi * 32) / 32;
5485
+ return [
5486
+ box(x - r, lo - .5, z0, x - 1.3, y + 3, z1, METAL),
5487
+ box(x + 1.3, lo - .5, z0, x + r, y + 3, z1, METAL),
5488
+ box(x - 1.3, y + 2.4, z0, x + 1.3, y + 3.6, z1, METAL, ORANGE)
5489
+ ].map((b) => note(mine, "nacelle", b));
5490
+ };
5491
+ var NACELLE = nacelle();
5492
+ /** The engine in the lagoon off the tail's end, awash: its back 1.4 m over the water. */
5493
+ var ENGINE = (() => {
5494
+ const [x, z, r, l] = ENGINES[1];
5495
+ return note(mine, "engine", box(x - r, -5, z - l / 2, x + r, 1.4, z + l / 2, METAL, ORANGE));
5496
+ })();
5497
+ /** Skin afloat between the shallows and that engine: the first runs aground where the water is knee deep. */
5498
+ var FLOATS$2 = [note(mine, "float", box(16, -1.6, 116, 22, .35, 119, METAL)), note(mine, "float", box(10, -.2, 113, 13, .5, 116, METAL))];
5499
+ /** The camp: the pod, the flag's step by it, a crate under each rack with a tarpaulin over it. */
5500
+ var POD_BOX = note(mine, "pod", box(POD[0] - 3, .75, POD[1] - 3, POD[0] + 3, 4.25, POD[1] + 3, METAL));
5501
+ var DAIS = note(mine, "dais", box(POD[0] - 2, .75, POD[1] - 10, POD[0] + 2, 1.65, POD[1] - 6, PAINT, RED));
5502
+ var crate = (x, z, h = .4, tint) => lay("crate", x - 1.5, z - 1.5, x + 1.5, z + 1.5, h, WOOD, tint);
5503
+ /** 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. */
5504
+ 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));
5505
+ var [GUNS$1, BLADES] = [crate(49, 176), crate(71, 176)];
5506
+ var [RIFLES, RAILS] = [crate(84, 150, .4, RED), crate(33, 128, .4, RED)];
5507
+ /** The debris between the camp and the wing, a line to run: a panel, a container, the landing gear, the nacelle's roof, the wing. */
5508
+ var PANEL = lay("panel", 67, 159.5, 70.5, 163, .9, METAL);
5509
+ var CONTAINER = lay("container", 68.5, 151, 71.1, 157, 2, METAL, ORANGE);
5510
+ var GEAR = lay("gear", 68.6, 145.6, 71, 148, 2.9, STEEL, YELLOW);
5511
+ var BOGIE = lay("gear", 67.6, 144.6, 72, 145.6, 1.2, STEEL);
5512
+ /** What else lies about red's half, most with a pack on it. */
5513
+ var SCRAP = {
5514
+ camp: [crate(76, 168), crate(40, 172)],
5515
+ west: [
5516
+ lay("panel", 44.5, 156.5, 47.5, 159.5, .5, METAL),
5517
+ lay("container", 33, 148.7, 39, 151.3, 2.2, METAL, ORANGE),
5518
+ lay("panel", 46.5, 138.5, 49.5, 141.5, .4, METAL),
5519
+ lay("panel", 25.5, 134.5, 28.5, 137.5, .5, METAL),
5520
+ lay("panel", 50.5, 114.5, 53.5, 117.5, .4, METAL)
5521
+ ],
5522
+ east: [
5523
+ lay("panel", 62.5, 120.5, 65.5, 123.5, .4, METAL),
5524
+ crate(80, 146),
5525
+ crate(85.5, 140),
5526
+ crate(84, 128),
5527
+ lay("panel", 84.5, 110.5, 87.5, 113.5, .4, METAL)
5528
+ ],
5529
+ cover: [
5530
+ lay("panel", 43.6, 131, 44, 137, 2.6, METAL),
5531
+ lay("panel", 48.5, 146.6, 53.5, 147, 2.4, METAL),
5532
+ lay("panel", 78, 131.6, 83, 132, 2.6, METAL),
5533
+ lay("panel", 30, 141.6, 35, 142, 2.2, METAL),
5534
+ lay("container", 76, 155, 82, 157.6, 2.6, METAL, ORANGE)
5535
+ ]
5536
+ };
5537
+ /**
5538
+ * The boxes a headland rock collides with, inside what rockOf() draws: layers `tall` high, each cut
5539
+ * across x in strips `wide` wide that run from the rock's face toward the beach back to its far
5540
+ * side or to `back`. Coarser than moon.ts fitted(), which would make 3000 boxes of red's eleven
5541
+ * rocks: these stand at the end of the beach, behind the spawns.
5542
+ */
5543
+ var massed = (x, z, R, H, s, back) => {
5544
+ const { reach } = rockOf(s, R, H);
5545
+ const g = under$1(x - .8 * R, z - .8 * R, x + .8 * R, z + .8 * R);
5546
+ const mid = walked(x, z) + rockMid(H);
5547
+ const top = mid + reach([
5548
+ 0,
5549
+ 1,
5550
+ 0
5551
+ ]) - .1;
5552
+ const inside = (dx, dy, dz) => {
5553
+ const l = Math.sqrt(dx * dx + dy * dy + dz * dz) || 1;
5554
+ return l <= reach([
5555
+ dx / l,
5556
+ dy / l,
5557
+ dz / l
5558
+ ]);
5559
+ };
5560
+ /**
5561
+ * The rock's extent along z at (x, y) round its middle: where it starts and ends, or nothing
5562
+ * where the line misses it abreast of its middle (a lobe further along is left out: inside).
5563
+ */
5564
+ const cut = (dx, dy) => {
5565
+ if (!inside(dx, dy, 0)) return;
5566
+ const edge = (way) => {
5567
+ let [a, b] = [0, 1.6 * R];
5568
+ for (let k = 0; k < 9; k++) {
5569
+ const m = (a + b) / 2;
5570
+ if (inside(dx, dy, way * m)) a = m;
5571
+ else b = m;
5572
+ }
5573
+ return way * a;
5574
+ };
5575
+ return [edge(-1), edge(1)];
5576
+ };
5577
+ const out = [];
5578
+ const [wide, tall] = [2, 2];
5579
+ for (let y0 = g[1] - .5; y0 < top - .3; y0 += tall) {
5580
+ const y1 = Math.min(y0 + tall, top);
5581
+ for (let x0 = -1.5 * R; x0 < 1.5 * R; x0 += wide) {
5582
+ const cuts = [
5583
+ .1,
5584
+ .5,
5585
+ .9
5586
+ ].flatMap((u) => [Math.max(y0, g[1]) + .05, y1].map((y) => cut(x0 + wide * u, y - mid)));
5587
+ if (cuts.every((c) => c)) {
5588
+ const z0 = z + Math.max(...cuts.map((c) => c[0]));
5589
+ const z1 = Math.min(z + Math.min(...cuts.map((c) => c[1])), back);
5590
+ if (z1 - z0 > .4) out.push([
5591
+ x + x0,
5592
+ y0,
5593
+ z0,
5594
+ x + x0 + wide,
5595
+ y1,
5596
+ z1
5597
+ ]);
5598
+ }
5599
+ }
5600
+ }
5601
+ return out;
5602
+ };
5603
+ /** Red's headland: each rock where it stands (x, the ground's height, z), its radius, height and seed, and the boxes it collides with. */
5604
+ var CRAGS = ROCKS.map(([x, z, R, H, s]) => ({
5605
+ at: [
5606
+ x,
5607
+ walked(x, z),
5608
+ z
5609
+ ],
5610
+ R,
5611
+ H,
5612
+ s,
5613
+ parts: massed(x, z, R, H, s, 200 - EDGE$1.cape + 2)
5614
+ }));
5615
+ var half = [
5616
+ ...wing(),
5617
+ ...NACELLE,
5618
+ ENGINE,
5619
+ ...FLOATS$2,
5620
+ POD_BOX,
5621
+ DAIS,
5622
+ GUNS$1,
5623
+ BLADES,
5624
+ ...shelter(49, 176),
5625
+ ...shelter(71, 176),
5626
+ RIFLES,
5627
+ RAILS,
5628
+ PANEL,
5629
+ CONTAINER,
5630
+ GEAR,
5631
+ BOGIE,
5632
+ ...Object.values(SCRAP).flat(),
5633
+ ...TRUNKS.map(([x, z, r]) => {
5634
+ const y = walked(x, z);
5635
+ return ghost(box(x - r, y - 1, z - r, x + r, y + 9, z + r, WOOD));
5636
+ }),
5637
+ ...CRAGS.flatMap((c) => c.parts).map(([x0, y0, z0, x1, y1, z1]) => ghost(box(x0, y0, z0, x1, y1, z1, STONE))),
5638
+ ghost(box(-60, -10, 200 - EDGE$1.cape, EDGE$1.east + 2, 40, 200 - EDGE$1.cape + 2, STONE))
5639
+ ];
5640
+ HULL.sections.map(([x0, x1], n) => [
5641
+ x0,
5642
+ x1,
5643
+ HULL.axis[n]
5644
+ ]), [
5645
+ ...line,
5646
+ ...mine,
5647
+ ...mine.map(({ kind, min, max }) => ({
5648
+ kind,
5649
+ min: [
5650
+ min[0],
5651
+ min[1],
5652
+ 200 - max[2]
5653
+ ],
5654
+ max: [
5655
+ max[0],
5656
+ max[1],
5657
+ 200 - min[2]
5658
+ ]
5659
+ }))
5660
+ ], [...CRAGS, ...CRAGS.map((c) => ({
5661
+ ...c,
5662
+ at: [
5663
+ c.at[0],
5664
+ c.at[1],
5665
+ 200 - c.at[2]
5666
+ ],
5667
+ parts: c.parts.map(([x0, y0, z0, x1, y1, z1]) => [
5668
+ x0,
5669
+ y0,
5670
+ 200 - z1,
5671
+ x1,
5672
+ y1,
5673
+ 200 - z0
5674
+ ])
5675
+ }))];
5676
+ /** Eight, behind the pod, facing the other camp. */
5677
+ var SPAWNS = [
5678
+ 46,
5679
+ 54,
5680
+ 62,
5681
+ 70
5682
+ ].flatMap((x) => [[
5683
+ x,
5684
+ CAMP,
5685
+ 181,
5686
+ 0
5687
+ ], [
5688
+ x + 4,
5689
+ CAMP,
5690
+ 184,
5691
+ 0
5692
+ ]]);
5693
+ var team = (red) => {
5694
+ const side = (p) => red ? p : flipPoint(p);
5695
+ return {
5696
+ base: side(on(DAIS)),
5697
+ spawns: red ? SPAWNS : SPAWNS.map(([x, y, z]) => [
5698
+ x,
5699
+ y,
5700
+ 200 - z,
5701
+ Math.PI
5702
+ ]),
5703
+ rack: side(on(GUNS$1)),
5704
+ blade: side(on(BLADES)),
5705
+ rifle: side(on(RIFLES)),
5706
+ rail: side(on(RAILS))
5707
+ };
5708
+ };
5709
+ /** On the hull's shoulder east of the wing, red's side. */
5710
+ var SHOULDER = [
5711
+ 71,
5712
+ HULL.axis[1] + RINGS[3][0],
5713
+ 103.7
5714
+ ];
5715
+ var BEACH = {
5716
+ name: "Landfall",
5717
+ tag: "Beach · wreck",
5718
+ lore: "A ship came down across a Caribbean beach, its tail in the lagoon and its nose in the trees. The survivors camp at either end of the sand and fight over the wreck between them.",
5719
+ brushes: [
5720
+ ...half,
5721
+ ...half.map(flip$1),
5722
+ ...centre
5723
+ ],
5724
+ teams: [team(true), team(false)],
5725
+ packs: both([
5726
+ on(SCRAP.camp[0]),
5727
+ on(SCRAP.west[2]),
5728
+ on(SCRAP.west[4]),
5729
+ on(FLOATS$2[0]),
5730
+ on(SCRAP.east[3])
5731
+ ], ...GAPS.map(({ x, top }) => [
5732
+ x,
5733
+ top,
5734
+ MID$1
5735
+ ])),
5736
+ ammo: both([
5737
+ on(PANEL),
5738
+ on(CONTAINER),
5739
+ on(GEAR),
5740
+ on(SCRAP.west[0]),
5741
+ on(SCRAP.west[1]),
5742
+ on(SCRAP.west[3]),
5743
+ on(SCRAP.east[0]),
5744
+ on(SCRAP.east[1]),
5745
+ on(SCRAP.east[4])
5746
+ ], [
5747
+ 51,
5748
+ HOLD.floor,
5749
+ MID$1
5750
+ ], [
5751
+ 67,
5752
+ HOLD.floor,
5753
+ MID$1
5754
+ ]),
5755
+ cells: both([
5756
+ on(SCRAP.camp[1]),
5757
+ on(NACELLE[2]),
5758
+ on(FLOATS$2[1]),
5759
+ on(SCRAP.east[2]),
5760
+ SHOULDER
5761
+ ], [
5762
+ 59,
5763
+ HOLD.floor,
5764
+ MID$1
5765
+ ]),
5766
+ vests: both([on(ENGINE)], [
5767
+ 46.5,
5768
+ BACK$2[1],
5769
+ MID$1
5770
+ ]),
5771
+ floor: DEPTH,
5772
+ relief: {
5773
+ hole: [
5774
+ 0,
5775
+ 0,
5776
+ 0,
5777
+ 0
5778
+ ],
5779
+ bound: [
5780
+ 56,
5781
+ MID$1,
5782
+ 100,
5783
+ 160
5784
+ ],
5785
+ cell: 4,
5786
+ at: at$2
5787
+ },
5788
+ sun: {
5789
+ dir: [
5790
+ -.47,
5791
+ .83,
5792
+ .3
5793
+ ],
5794
+ color: [
5795
+ 3.2,
5796
+ 3,
5797
+ 2.6
5798
+ ]
5799
+ },
5800
+ sky: [[
5801
+ .1,
5802
+ .32,
5803
+ .75
5804
+ ], [
5805
+ .55,
5806
+ .75,
5807
+ .9
5808
+ ]],
5809
+ fog: [
5810
+ .6,
5811
+ .78,
5812
+ .9,
5813
+ .0012
5814
+ ],
5815
+ scenery: "beach"
5816
+ };
5041
5817
  // src/shared/routes.ts
5042
5818
  var go = (x, z, y, sprint = true) => ({
5043
5819
  k: "go",
@@ -5240,6 +6016,31 @@ var UP = {
5240
6016
  ]
5241
6017
  }
5242
6018
  };
6019
+ /**
6020
+ * Landfall's way round the wreck's tail, through the lagoon where the bed is out of depth (flown
6021
+ * by beach.test.ts): from `start` in red's shallows, walked west so the first jump is come at
6022
+ * along its line, onto the float aground there, to the second float, up onto the engine and down
6023
+ * to the raft on the centre line (`out`); and from the raft back by the same boxes to red's
6024
+ * shallows (`in`). Blue's are their mirror across z = 100, so a way round is `out` then the
6025
+ * mirror of `in`.
6026
+ */
6027
+ var LAGOON = {
6028
+ start: [26, 118],
6029
+ out: [
6030
+ leap([23, 117.5], [20, 117.5], .35, { sprint: false }),
6031
+ leap([16.4, 117.2], [12, 114.8], .5, { sprint: false }),
6032
+ leap([10.3, 114], [6, 112.5], 1.4, { sprint: false }),
6033
+ go(4, 108.8, 1.4, false),
6034
+ leap([3.5, 107.7], [3, 102], .4, { sprint: false })
6035
+ ],
6036
+ in: [
6037
+ go(3, 97, .4),
6038
+ leap([3, 103.5], [3.5, 108.5], 1.4, { sprint: false }),
6039
+ leap([6.5, 112.5], [11, 114.5], .5, { sprint: false }),
6040
+ leap([12.6, 115], [17, 117.3], .35, { sprint: false }),
6041
+ go(21, 117.5, .35, false)
6042
+ ]
6043
+ };
5243
6044
  // src/shared/nav.ts
5244
6045
  /** How a body goes through a portal: walks either way, drops down it, or jumps up onto a box. */
5245
6046
  var PASS = {
@@ -5271,6 +6072,8 @@ var KEEP = PLAYER_R + .05;
5271
6072
  var RUN_IN = 3;
5272
6073
  /** Metres the ends of a portal are drawn in, at most. */
5273
6074
  var EDGE = .7;
6075
+ /** Metres over the kill floor a bot keeps its feet: deeper water (Landfall's lagoon) is no floor. */
6076
+ var WADE = .3;
5274
6077
  /** The relief's squares merged into a rectangle at most, a side. */
5275
6078
  var MERGE = 8;
5276
6079
  /** Metres of grid cell. */
@@ -5423,11 +6226,12 @@ var merge = (rs) => {
5423
6226
  };
5424
6227
  /** The height of a rectangle's floor at (x, z). */
5425
6228
  var heightAt = (w, p, x, z) => p.r ? ground(w, x, z) : p.y;
5426
- /** The relief's ground as rectangles of whole squares, none over the hole, a pit or past the bound. */
6229
+ /** The relief's ground as rectangles of whole squares, none over the hole, a pit, past the bound or in too deep. */
5427
6230
  var lowlands = (w) => {
5428
6231
  const r = w.relief;
5429
6232
  if (!r) return [];
5430
6233
  const { x0, z0, cell, nx, nz, hole, pits, pitted, bound } = r;
6234
+ const dry = w.def.floor + WADE;
5431
6235
  const [cx, cz, ea, eb] = bound;
5432
6236
  const [mx, mz] = [nx - 1, nz - 1];
5433
6237
  const over = (q, h) => q[0] < h[2] && q[2] > h[0] && q[1] < h[3] && q[3] > h[1];
@@ -5445,7 +6249,7 @@ var lowlands = (w) => {
5445
6249
  [q[2], q[1]],
5446
6250
  [q[0], q[3]],
5447
6251
  [q[2], q[3]]
5448
- ]) inside &&= ((x - cx) / ea) ** 2 + ((z - cz) / eb) ** 2 <= 1;
6252
+ ]) inside &&= ((x - cx) / ea) ** 2 + ((z - cz) / eb) ** 2 <= 1 && ground(w, x, z) >= dry;
5449
6253
  free[i + j * mx] = +(inside && !over(q, hole) && !(pitted[i + j * nx] && pits.some((p) => over(q, p))));
5450
6254
  }
5451
6255
  const out = [];
@@ -5583,16 +6387,26 @@ var portals = (w, polys, grid) => {
5583
6387
  });
5584
6388
  return out;
5585
6389
  };
5586
- /** A rectangle with (x, z) on or within `m` of it and its floor the highest not over y + 0.6, else -1. */
6390
+ /**
6391
+ * A rectangle with (x, z) on or within `m` of it and its floor the highest not over y + 0.6, else
6392
+ * -1. One the point is on comes before one it is only near, unless that one is a step higher (a
6393
+ * ledge the body's edge is on): beside a sliver of floor, a body is on the sliver.
6394
+ */
5587
6395
  var under = (nav, w, x, y, z, m) => {
5588
6396
  let best = -1;
5589
6397
  let top = -Infinity;
6398
+ let on = false;
5590
6399
  for (const i of nav.grid.get(key(Math.floor(x / CELL), Math.floor(z / CELL))) ?? []) {
5591
6400
  const p = nav.polys[i];
5592
6401
  const q = p.q;
5593
6402
  if (x < q[0] - m || x > q[2] + m || z < q[1] - m || z > q[3] + m) continue;
5594
6403
  const h = heightAt(w, p, Math.min(Math.max(x, q[0]), q[2]), Math.min(Math.max(z, q[1]), q[3]));
5595
- if (h <= y + .6 && h > top) [best, top] = [i, h];
6404
+ const inside = x >= q[0] && x <= q[2] && z >= q[1] && z <= q[3];
6405
+ if (h <= y + .6 && h > top + (inside === on ? 0 : inside ? -.5 : .5)) [best, top, on] = [
6406
+ i,
6407
+ h,
6408
+ inside
6409
+ ];
5596
6410
  }
5597
6411
  return best;
5598
6412
  };
@@ -5690,7 +6504,8 @@ var build = (w) => {
5690
6504
  polys,
5691
6505
  out: portals(w, polys, grid),
5692
6506
  grid,
5693
- route
6507
+ route,
6508
+ ways: ROUTES.length
5694
6509
  };
5695
6510
  if (w.def === HIGHLINE) {
5696
6511
  const [red] = w.def.teams;
@@ -5731,6 +6546,26 @@ var build = (w) => {
5731
6546
  ], legs.map((l) => mirror(l, 280)), k, true);
5732
6547
  }
5733
6548
  }
6549
+ if (w.def === BEACH) {
6550
+ const [[, tail], [west, east]] = HULL.sections;
6551
+ nav.ways = 5;
6552
+ polys.forEach(({ q, y, r }, i) => {
6553
+ if (q[1] <= 100 && q[3] >= 100) {
6554
+ const x = (q[0] + q[2]) / 2;
6555
+ route[i] = !r && y > HULL.r ? 0 : x < tail ? 4 : x < west ? 2 : x < east ? 1 : 3;
6556
+ }
6557
+ });
6558
+ const [x, z] = LAGOON.start;
6559
+ for (const blue of [false, true]) {
6560
+ const legs = [...LAGOON.out, ...LAGOON.in.map((l) => mirror(l, 200))];
6561
+ const sz = blue ? 200 - z : z;
6562
+ links(nav, w, [
6563
+ x,
6564
+ ground(w, x, sz),
6565
+ sz
6566
+ ], blue ? legs.map((l) => mirror(l, 200)) : legs, 4, true);
6567
+ }
6568
+ }
5734
6569
  return nav;
5735
6570
  };
5736
6571
  var built = /* @__PURE__ */ new WeakMap();
@@ -5833,7 +6668,7 @@ var nearest = (a, b, x, z) => {
5833
6668
  };
5834
6669
  /**
5835
6670
  * The points a bot goes through from `a` to `b`, the last `b` or, when no way gets there, the
5836
- * nearest point it can get to. The links of the routes other than `prefer` (an index of ROUTES)
6671
+ * nearest point it can get to. The links of the routes other than `prefer` (a route under `ways`)
5837
6672
  * cost more, so bots that prefer different ones spread over the map. Off the mesh, `b` alone.
5838
6673
  */
5839
6674
  var path = (nav, w, a, b, prefer = -1) => {
@@ -7842,7 +8677,7 @@ var approach = ({ hull: [cx, , cz], post }, team) => {
7842
8677
  return [[
7843
8678
  x,
7844
8679
  y,
7845
- cz + s * (HULL.R + SORTIE.OUT)
8680
+ cz + s * (HULL$1.R + SORTIE.OUT)
7846
8681
  ], [
7847
8682
  x,
7848
8683
  post[0][1] + SHIP.DROP + .3,
@@ -7905,10 +8740,10 @@ var plan = (r, { def, home, go, team }) => {
7905
8740
  ];
7906
8741
  const out = [];
7907
8742
  if (inside(def, r.x, r.y, r.z)) out.push(a);
7908
- else if (r.y > low && flat$1(r.x, r.z, cx, cz) < HULL.R + SORTIE.OUT - 10) out.push([
8743
+ else if (r.y > low && flat$1(r.x, r.z, cx, cz) < HULL$1.R + SORTIE.OUT - 10) out.push([
7909
8744
  cx,
7910
8745
  r.y,
7911
- cz + (r.z < cz ? -1 : 1) * (HULL.R + SORTIE.OUT)
8746
+ cz + (r.z < cz ? -1 : 1) * (HULL$1.R + SORTIE.OUT)
7912
8747
  ]);
7913
8748
  const last = out.at(-1) ?? [
7914
8749
  r.x,
@@ -7966,7 +8801,7 @@ var Sortie = class {
7966
8801
  };
7967
8802
  return Math.abs(p.z - nz) > 1 ? walk(p, ship.x + 8, nz) : walk(p, nx + 3.5, nz);
7968
8803
  }
7969
- return walk(p, cx, p.z > cz ? cz + HULL.R + 5 : cz - HULL.R - 5);
8804
+ return walk(p, cx, p.z > cz ? cz + HULL$1.R + 5 : cz - HULL$1.R - 5);
7970
8805
  }
7971
8806
  if (go === "press" && ship.driver === 255 && !ship.wreck) {
7972
8807
  if (nearby(ship, p)) return {
@@ -8126,7 +8961,7 @@ var SWEEP = .35;
8126
8961
  */
8127
8962
  var round = (w, base, from) => {
8128
8963
  const nav = navOf(w);
8129
- const ins = [-1, ...ROUTES.keys()].map((r) => {
8964
+ const ins = Array.from({ length: nav.ways + 1 }, (_, k) => k - 1).map((r) => {
8130
8965
  return [from, ...path(nav, w, from, base, r).map((st) => st.to)].reverse().find((q) => flat(q[0], q[2], base[0], base[2]) > ENTRY) ?? from;
8131
8966
  });
8132
8967
  const out = [];
@@ -8227,8 +9062,6 @@ var keysFor = (yaw, dir) => {
8227
9062
  };
8228
9063
  var Bot = class {
8229
9064
  id;
8230
- /** The route it prefers, an index of nav.ts's ROUTES. */
8231
- prefer;
8232
9065
  /** Its way: the points it goes through, walking or on a leg; the last is its goal or as near as it gets. */
8233
9066
  steps = [];
8234
9067
  /** The goal of the way, and the tick it was planned. */
@@ -8303,7 +9136,6 @@ var Bot = class {
8303
9136
  steer = false;
8304
9137
  constructor(id, skill = 4) {
8305
9138
  this.id = id;
8306
- this.prefer = id % ROUTES.length;
8307
9139
  this.persona = personaOf(id, skill);
8308
9140
  this.seed = id * 2654435761 + 1;
8309
9141
  }
@@ -8650,9 +9482,13 @@ var Bot = class {
8650
9482
  plan(w, p, goal) {
8651
9483
  this.goal = goal;
8652
9484
  this.planned = this.ticks;
8653
- const prefer = this.why === "flag home" && !this.steer || this.why.endsWith(" rack") ? -1 : this.prefer;
8654
- this.steps = this.rackSteps ?? path(navOf(w), w, at(p), goal, prefer);
9485
+ const direct = this.why === "flag home" && !this.steer || this.why.endsWith(" rack");
9486
+ const nav = navOf(w);
9487
+ const prefer = direct ? -1 : this.id % nav.ways;
9488
+ this.steps = this.rackSteps ?? path(nav, w, at(p), goal, prefer);
8655
9489
  this.rackSteps = void 0;
9490
+ const [x, , z] = this.steps[0].to;
9491
+ if (this.steps.length === 1 && this.steps[0].to !== goal && flat(p.x, p.z, x, z) < 1) this.steps = [{ to: goal }];
8656
9492
  this.step = 0;
8657
9493
  this.flight = void 0;
8658
9494
  this.best = Infinity;
@@ -8757,7 +9593,7 @@ var Bot = class {
8757
9593
  for (let t = .5; t <= far; t += .5) {
8758
9594
  const [x, z] = [p.x + fx * t, p.z + fz * t];
8759
9595
  const y = p.y + HOP;
8760
- if (Math.max(floorAt(w, x, z, y), floorAt(w, x - fz * .4, z + fx * .4, y), floorAt(w, x + fz * .4, z - fx * .4, y)) < p.y - hurts) return false;
9596
+ if (Math.max(floorAt(w, x, z, y), floorAt(w, x - fz * .4, z + fx * .4, y), floorAt(w, x + fz * .4, z - fx * .4, y)) < Math.max(p.y - hurts, w.def.floor + .3)) return false;
8761
9597
  }
8762
9598
  const reach = Math.min(ahead, AHEAD);
8763
9599
  if (ray(w, [
@@ -8771,7 +9607,7 @@ var Bot = class {
8771
9607
  ], reach) < reach) return false;
8772
9608
  if (ray(w, [
8773
9609
  p.x,
8774
- p.y + .5 + .1,
9610
+ p.y + .5 + .05,
8775
9611
  p.z
8776
9612
  ], [
8777
9613
  fx,
@@ -9297,7 +10133,8 @@ var shut = (w) => w.doors?.forEach((s) => {
9297
10133
  // src/shared/maps.ts
9298
10134
  var MAPS = {
9299
10135
  highline: HIGHLINE,
9300
- tranquility: MOON
10136
+ tranquility: MOON,
10137
+ landfall: BEACH
9301
10138
  };
9302
10139
  /** The map of a key; an unknown or missing one is HIGHLINE. */
9303
10140
  var mapOf = (key) => key !== void 0 && MAPS[key] || HIGHLINE;