@adatechnology/game-items-three 0.10.7 → 0.11.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/{chunk-S4UUQQOL.js → chunk-64JEKMFT.js} +18 -10
- package/dist/chunk-64JEKMFT.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.global.js +416 -105
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{testing-CBYX7wTL.d.ts → testing-D2tqWTG4.d.ts} +4 -2
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +15 -13
- package/dist/chunk-S4UUQQOL.js.map +0 -1
package/dist/index.global.js
CHANGED
|
@@ -93,7 +93,7 @@ var GameItemsThree = (() => {
|
|
|
93
93
|
wearableMaterials: () => wearableMaterials
|
|
94
94
|
});
|
|
95
95
|
|
|
96
|
-
// ../game-shapes/dist/chunk-
|
|
96
|
+
// ../game-shapes/dist/chunk-QETSTM6M.js
|
|
97
97
|
function canonicalJson(value) {
|
|
98
98
|
if (value === null) return "null";
|
|
99
99
|
if (typeof value === "number") return Object.is(value, -0) ? "-0" : Number.isFinite(value) ? String(value) : JSON.stringify(String(value));
|
|
@@ -1793,6 +1793,12 @@ var GameItemsThree = (() => {
|
|
|
1793
1793
|
const flame = flameBase * (1 - rules.flameFillInfluence * (1 - k));
|
|
1794
1794
|
return 1 - (1 - Math.min(1, Math.max(0, spark))) * (1 - Math.min(1, Math.max(0, flame)));
|
|
1795
1795
|
};
|
|
1796
|
+
var sealBlock = (seal, state) => {
|
|
1797
|
+
if (seal.spoilsWhenBreached && state.breached) return "breached";
|
|
1798
|
+
if (seal.spoilsWhenBreached && state.leaked) return "leaked";
|
|
1799
|
+
if (!state.opened) return "sealed";
|
|
1800
|
+
return void 0;
|
|
1801
|
+
};
|
|
1796
1802
|
var DEFERRED_QUEUE_ID = {
|
|
1797
1803
|
DESTRUCTION_EVENTS: "destruction.events",
|
|
1798
1804
|
BREACH_PAINT: "floorplan.breach-paint",
|
|
@@ -1941,6 +1947,7 @@ var GameItemsThree = (() => {
|
|
|
1941
1947
|
};
|
|
1942
1948
|
return registry;
|
|
1943
1949
|
};
|
|
1950
|
+
var resolveEntry = (registry, entry2, kindField = "kind") => deepMerge(registry.defaults(String(entry2[kindField])), entry2);
|
|
1944
1951
|
var KIT_ORIGIN_KEY = "kitOrigin";
|
|
1945
1952
|
function markKitOrigin(object2, origin) {
|
|
1946
1953
|
const node = object2;
|
|
@@ -8167,13 +8174,13 @@ var GameItemsThree = (() => {
|
|
|
8167
8174
|
const hole = metal(1842463);
|
|
8168
8175
|
const corners = [[2.5, 1.8], [-2.5, 1.8], [2.5, -1.8], [-2.5, -1.8]];
|
|
8169
8176
|
return G(
|
|
8170
|
-
mesh2(bx(
|
|
8171
|
-
mesh2(bx(6, 0.
|
|
8172
|
-
mesh2(bx(6, 0.
|
|
8173
|
-
mesh2(bx(0.16, 0.
|
|
8174
|
-
mesh2(bx(0.16, 0.
|
|
8175
|
-
mesh2(bx(1.2, 0.
|
|
8176
|
-
...corners.map(([x, z]) => mesh2(cyl(0.12, 0.12, 0.
|
|
8177
|
+
mesh2(bx(5.68, 6e-3, 4.18), zinc, [0, 0, 0]),
|
|
8178
|
+
mesh2(bx(6, 0.03, 0.16), edge, [0, 0, 2.17]),
|
|
8179
|
+
mesh2(bx(6, 0.03, 0.16), edge, [0, 0, -2.17]),
|
|
8180
|
+
mesh2(bx(0.16, 0.03, 4.18), edge, [2.92, 0, 0]),
|
|
8181
|
+
mesh2(bx(0.16, 0.03, 4.18), edge, [-2.92, 0, 0]),
|
|
8182
|
+
mesh2(bx(1.2, 0.03, 0.8), metal(8014380), [-0.8, 0, -0.4]),
|
|
8183
|
+
...corners.map(([x, z]) => mesh2(cyl(0.12, 0.12, 0.03, 8), hole, [x, 0, z]))
|
|
8177
8184
|
);
|
|
8178
8185
|
};
|
|
8179
8186
|
|
|
@@ -9173,7 +9180,8 @@ var GameItemsThree = (() => {
|
|
|
9173
9180
|
// src/models/laptop.ts
|
|
9174
9181
|
var laptop = ({ mesh: mesh2, cyl, bx, G, metal, plastic }) => G(
|
|
9175
9182
|
mesh2(bx(0.36, 0.012, 0.25), metal(9277588), [0, 6e-3, 0]),
|
|
9176
|
-
mesh2(bx(0.
|
|
9183
|
+
mesh2(bx(0.356, 0.012, 0.246), metal(2895667), [0, 0.017, 0]),
|
|
9184
|
+
// the lid 2 mm inside the base's sides (CLAUDE.md §13)
|
|
9177
9185
|
mesh2(cyl(6e-3, 6e-3, 0.2, 8), plastic(1842204), [0, 0.0125, -0.12], [0, 0, Math.PI / 2]),
|
|
9178
9186
|
mesh2(bx(0.05, 42e-4, 0.03), metal(11843514), [0, 0.0231, 0])
|
|
9179
9187
|
);
|
|
@@ -11245,7 +11253,7 @@ var GameItemsThree = (() => {
|
|
|
11245
11253
|
K.cyl("metal", 0, y - 0.06, 0, 0.14, 0.015, gold);
|
|
11246
11254
|
for (let i = 0; i < 6; i++) {
|
|
11247
11255
|
const an = i * Math.PI / 3, cx = Math.cos(an), cz = Math.sin(an);
|
|
11248
|
-
K.box("metal", cx * 0.14, y - 0.06, cz * 0.14, 0.28, 0.012, 0.012, gold, -an);
|
|
11256
|
+
K.box("metal", cx * 0.14, y - (M.visorScene ? 0.06 : 0.062), cz * 0.14, 0.28, 0.012, 0.012, gold, -an);
|
|
11249
11257
|
K.cyl("plain", cx * 0.28, y - 0.06, cz * 0.28, 0.02, 0.09, 15787720);
|
|
11250
11258
|
K.cyl(on ? "emissive" : "plain", cx * 0.28, y + 0.03, cz * 0.28, 0.012, 0.03, on ? 16767120 : 15128752, 0, 0, "sphere");
|
|
11251
11259
|
K.box("glass", cx * 0.3, y - 0.2, cz * 0.3, 0.025, 0.14, 0.025, 16777215, -an);
|
|
@@ -11308,10 +11316,17 @@ var GameItemsThree = (() => {
|
|
|
11308
11316
|
B.sofa_l = (M, a) => {
|
|
11309
11317
|
const K = kit(M, a), { w, d } = K.dim("sofa_l"), c = K.fabric(pick(K, [7237752, 9075304, 4544618])), cd = shade2(c, 0.82), zb = -d / 2, pf = 0.95, ac = K.accent(13146698), cw = 0.95;
|
|
11310
11318
|
for (const sx of [-1, 1]) for (const sz of [-1, 1]) K.box("wood", sx * (w / 2 - 0.1), 0, sz * (d / 2 - 0.1), 0.05, 0.08, 0.05, K.wood(2759956));
|
|
11311
|
-
|
|
11312
|
-
|
|
11319
|
+
if (M.visorScene) {
|
|
11320
|
+
K.box("fabric", -(cw / 2), 0.08, zb + pf / 2, w - cw, 0.26, pf, cd);
|
|
11321
|
+
K.box("fabric", w / 2 - cw / 2, 0.08, 0, cw, 0.26, d, cd);
|
|
11322
|
+
} else {
|
|
11323
|
+
const zf = zb + 0.22, xs = -w / 2 + 0.18;
|
|
11324
|
+
K.box("fabric", (xs + w / 2 - cw) / 2, 0.08, (zf + zb + pf) / 2, w / 2 - cw - xs, 0.26, zb + pf - zf, cd);
|
|
11325
|
+
K.box("fabric", w / 2 - cw / 2, 0.08, (zf + d / 2) / 2, cw, 0.26, d / 2 - zf, cd);
|
|
11326
|
+
}
|
|
11313
11327
|
K.box("fabric", 0, 0.08, zb + 0.11, w, 0.72, 0.22, cd);
|
|
11314
|
-
K.box("fabric", -w / 2 + 0.09, 0.08, zb + pf / 2, 0.18, 0.55, pf, cd);
|
|
11328
|
+
if (M.visorScene) K.box("fabric", -w / 2 + 0.09, 0.08, zb + pf / 2, 0.18, 0.55, pf, cd);
|
|
11329
|
+
else K.box("fabric", -w / 2 + 0.09, 0.08, (zb + 0.22 + zb + pf) / 2, 0.18, 0.55, pf - 0.22, cd);
|
|
11315
11330
|
const nm = 2, mw = (w - cw - 0.18) / nm;
|
|
11316
11331
|
for (let i = 0; i < nm; i++) K.box("fabric", -w / 2 + 0.18 + (i + 0.5) * mw, 0.34, zb + 0.12 + 0.39, mw - 0.02, 0.16, 0.78, c);
|
|
11317
11332
|
K.box("fabric", w / 2 - cw / 2, 0.34, 0.035, cw - 0.04, 0.16, d - 0.2, c);
|
|
@@ -11330,7 +11345,7 @@ var GameItemsThree = (() => {
|
|
|
11330
11345
|
K.box("fabric", 0, 0.55, -d / 2 + 0.5, 0.4, 0.16, 0.12, accent, 0, 0.5);
|
|
11331
11346
|
const hw = w + 0.5, n = Math.round(hw / 0.11);
|
|
11332
11347
|
K.box("wood", 0, 0.2, -d / 2 - 0.05, hw, 1, 0.04, shade2(wood, 0.7));
|
|
11333
|
-
for (let i = 0; i < n; i++) K.box("wood", -hw / 2 + (i + 0.5) * hw / n, 0.25, -d / 2 - 0.02, hw / n - 0.025, 0.95, 0.04, i % 2 ? wood : shade2(wood, 1.12));
|
|
11348
|
+
for (let i = 0; i < n; i++) K.box("wood", -hw / 2 + (i + 0.5) * hw / n, 0.25, -d / 2 - 0.02, hw / n - 0.025, M.visorScene ? 0.95 : 0.948, 0.04, i % 2 ? wood : shade2(wood, 1.12));
|
|
11334
11349
|
for (const s of [-1, 1]) {
|
|
11335
11350
|
K.box("wood", s * (w / 2 + 0.3), 0.35, -d / 2 + 0.22, 0.4, 0.16, 0.36, shade2(wood, 1.05));
|
|
11336
11351
|
K.cyl("plain", s * (w / 2 + 0.3), 0.51, -d / 2 + 0.2, 0.06, 0.03, 15262940);
|
|
@@ -11342,8 +11357,8 @@ var GameItemsThree = (() => {
|
|
|
11342
11357
|
const K = kit(M, a), { w, d } = K.dim("home_office"), wood = K.wood(13808780), zb = -d / 2;
|
|
11343
11358
|
K.box("wood", 0, 0.72, 0, w, 0.035, d, wood);
|
|
11344
11359
|
for (const s of [-1, 1]) K.box("metal", s * (w / 2 - 0.04), 0, 0, 0.035, 0.72, d - 0.1, 2236966);
|
|
11345
|
-
K.box("metal", 0, 0.3, zb + 0.05, w - 0.1, 0.03, 0.02, 2236966);
|
|
11346
|
-
K.box("plain", w / 2 - 0.25, 0.28, 0, 0.4, 0.44, d - 0.08, 15262940);
|
|
11360
|
+
K.box("metal", 0, 0.3, zb + (M.visorScene ? 0.05 : 0.055), w - (M.visorScene ? 0.1 : 0.11), 0.03, 0.02, 2236966);
|
|
11361
|
+
K.box("plain", w / 2 - 0.25, 0.28, 0, 0.4, M.visorScene ? 0.44 : 0.436, d - 0.08, 15262940);
|
|
11347
11362
|
for (let i = 0; i < 2; i++) {
|
|
11348
11363
|
K.box("plain", w / 2 - 0.25, 0.3 + i * 0.2, d / 2 - 0.04, 0.37, 0.18, 0.01, 15920870);
|
|
11349
11364
|
K.box("metal", w / 2 - 0.25, 0.39 + i * 0.2, d / 2 - 0.03, 0.12, 0.012, 0.012, 10132122);
|
|
@@ -11362,10 +11377,11 @@ var GameItemsThree = (() => {
|
|
|
11362
11377
|
const zc = d / 2 + 0.3, cc = K.fabric(2763310);
|
|
11363
11378
|
K.box("plain", 0, 0.44, zc, 0.48, 0.07, 0.46, cc);
|
|
11364
11379
|
K.box("plain", 0, 0.52, zc + 0.22, 0.44, 0.52, 0.07, cc, 0, 0.12);
|
|
11365
|
-
K.cyl("metal", 0, 0.06, zc, 0.025, 0.38, 2763306);
|
|
11380
|
+
K.cyl("metal", 0, M.visorScene ? 0.06 : 0.07, zc, 0.025, M.visorScene ? 0.38 : 0.37, 2763306);
|
|
11366
11381
|
for (let i = 0; i < 5; i++) {
|
|
11367
11382
|
const an = i * 1.2566, x = Math.cos(an) * 0.17, z = zc + Math.sin(an) * 0.17;
|
|
11368
|
-
|
|
11383
|
+
const lo = M.visorScene ? 0 : i * 15e-4;
|
|
11384
|
+
K.box("metal", Math.cos(an) * 0.085, 0.06 - lo, zc + Math.sin(an) * 0.085, 0.18, 0.025 + 2 * lo, 0.03, 2763306, -an);
|
|
11369
11385
|
K.cyl("plain", x, 0, z, 0.03, 0.05, 1710618);
|
|
11370
11386
|
}
|
|
11371
11387
|
};
|
|
@@ -11375,9 +11391,10 @@ var GameItemsThree = (() => {
|
|
|
11375
11391
|
K.box("plain", 0, 0, -d / 2 + 0.01, inner, M.visorScene ? h : h - 0.03, 0.02, shade2(wood, 0.95));
|
|
11376
11392
|
for (const s of [-1, 1]) K.box("plain", s * (w / 2 - 0.015), 0, 0, 0.03, h, d, wood);
|
|
11377
11393
|
K.box("plain", 0, h - 0.03, 0, inner, 0.03, d, wood);
|
|
11378
|
-
K.box("plain", 0, 0.06, 0, w - 0.06, 0.02, d - 0.02, wood);
|
|
11379
|
-
K.box("plain", 0, 0, 0, w - 0.04, 0.06, d - 0.06, 2763306);
|
|
11380
|
-
K.box("plain", dv, 0.06, 0, 0.025, h - 0.09, d - 0.02, wood);
|
|
11394
|
+
K.box("plain", 0, 0.06, M.visorScene ? 0 : 5e-3, w - 0.06, 0.02, M.visorScene ? d - 0.02 : d - 0.03, wood);
|
|
11395
|
+
K.box("plain", 0, 0, 0, M.visorScene ? w - 0.04 : w - 0.06, 0.06, d - 0.06, 2763306);
|
|
11396
|
+
if (M.visorScene) K.box("plain", dv, 0.06, 0, 0.025, h - 0.09, d - 0.02, wood);
|
|
11397
|
+
else K.box("plain", dv, 0.08, 0.01, 0.025, h - 0.11, d - 0.04, wood);
|
|
11381
11398
|
const rod = h * 0.76;
|
|
11382
11399
|
K.cyl("metal", (-w / 2 + dv) / 2, rod, 0, 0.012, dv + w / 2 - 0.06, 11580600, 0, Math.PI / 2);
|
|
11383
11400
|
K.box("plain", (-w / 2 + dv) / 2, rod + 0.05, 0, dv + w / 2 - 0.05, 0.02, d - 0.04, wood);
|
|
@@ -11404,7 +11421,7 @@ var GameItemsThree = (() => {
|
|
|
11404
11421
|
};
|
|
11405
11422
|
B.vanity = (M, a) => {
|
|
11406
11423
|
const K = kit(M, a), { w, d } = K.dim("vanity"), zb = -d / 2, br = 16053488;
|
|
11407
|
-
K.cyl("plain", 0, 0, zb + 0.12, 0.08, 0.7, br);
|
|
11424
|
+
K.cyl("plain", 0, M.visorScene ? 0 : 0.03, zb + 0.12, 0.08, M.visorScene ? 0.7 : 0.67, br);
|
|
11408
11425
|
K.cyl("plain", 0, 0, zb + 0.12, 0.1, 0.03, br);
|
|
11409
11426
|
K.box("plain", 0, 0.74, 0, w, 0.12, d, br);
|
|
11410
11427
|
K.box("plain", 0, 0.865, 0.02, w - 0.1, 0.012, d - 0.1, 13949146);
|
|
@@ -11415,8 +11432,8 @@ var GameItemsThree = (() => {
|
|
|
11415
11432
|
K.box("plain", 0, 1.1, zb + 0.012, 0.52, 0.72, 0.024, K.color("metal", 14999768));
|
|
11416
11433
|
K.plane("atlas_picture", 0, 1.46, zb + 0.026, 0.46, 0.66, 16777215, 0, 0, 0, atlas("picture").mirror());
|
|
11417
11434
|
K.box("metal", -w / 2 - 0.02, 0.95, zb + 0.06, 0.03, 0.03, 0.03, 11580600);
|
|
11418
|
-
K.box("metal", -w / 2 - 0.02, 0.95, zb + 0.06, 0.28, 0.014, 0.014, 11580600);
|
|
11419
|
-
K.box("fabric", -w / 2 - 0.02, 0.62, zb + 0.065, 0.26, 0.34, 0.02, K.accent(3042942));
|
|
11435
|
+
K.box("metal", -w / 2 - 0.02, M.visorScene ? 0.95 : 0.958, zb + 0.06, 0.28, 0.014, 0.014, 11580600);
|
|
11436
|
+
K.box("fabric", -w / 2 - 0.02, 0.62, zb + (M.visorScene ? 0.065 : 0.064), 0.26, 0.34, M.visorScene ? 0.02 : 0.018, K.accent(3042942));
|
|
11420
11437
|
};
|
|
11421
11438
|
B.tv_stand = (M, a) => {
|
|
11422
11439
|
const K = kit(M, a), { w, d } = K.dim("tv_stand"), wood = K.wood(13148272), br = K.color("fabric_main", 15789542);
|
|
@@ -11460,7 +11477,7 @@ var GameItemsThree = (() => {
|
|
|
11460
11477
|
K.box("plain", w * 0.38, 0, z0 + 0.35, 0.5, 0.4, 0.4, 12098154, 0.2);
|
|
11461
11478
|
K.box("plain", w * 0.4, 0.4, z0 + 0.33, 0.45, 0.35, 0.38, 11044954, -0.3);
|
|
11462
11479
|
for (let i = 0; i < 4; i++) {
|
|
11463
|
-
K.box("wood", 0, 0.45 + i * 0.3, z0 + 0.62, w + 0.3, 0.14, 0.04, [8017460, 9071172, 7031338, 8018488][i], 0, 0, (i % 2 ? 1 : -1) * (0.06 + K.rnd() * 0.08));
|
|
11480
|
+
K.box("wood", 0, 0.45 + i * 0.3, z0 + 0.62 + (M.visorScene ? 0 : i % 2 * 3e-3), w + 0.3, 0.14, 0.04, [8017460, 9071172, 7031338, 8018488][i], 0, 0, (i % 2 ? 1 : -1) * (0.06 + K.rnd() * 0.08));
|
|
11464
11481
|
for (const s of [-1, 1]) K.cyl("metal", s * w * 0.4, 0.45 + i * 0.3, z0 + 0.65, 0.012, 0.02, 5921374, Math.PI / 2, 0);
|
|
11465
11482
|
}
|
|
11466
11483
|
K.box("wood", -w * 0.4, 0, z0 + 0.9, 0.4, 0.04, 0.4, wood, 0.3, 0, 0.4);
|
|
@@ -11519,10 +11536,10 @@ var GameItemsThree = (() => {
|
|
|
11519
11536
|
const K = kit(M, a), y = M.y || 0, cs = [13148208, 11549226, 4880954, 14209200, 9058858], rw = [4, 3, 2];
|
|
11520
11537
|
rw.forEach((n, r) => {
|
|
11521
11538
|
for (let i = 0; i < n; i++) {
|
|
11522
|
-
const x = (i - (n - 1) / 2) * 0.072, c = cs[(i + r * 2) % cs.length];
|
|
11523
|
-
K.cyl("plain", x,
|
|
11524
|
-
K.cyl("plain", x,
|
|
11525
|
-
K.cyl("metal", x,
|
|
11539
|
+
const x = (i - (n - 1) / 2) * 0.072, c = cs[(i + r * 2) % cs.length], ry = y + r * (M.visorScene ? 0.1 : 0.104);
|
|
11540
|
+
K.cyl("plain", x, ry, 0, 0.033, 0.1, c);
|
|
11541
|
+
K.cyl("plain", x, ry + 0.02, 0, 0.0345, 0.055, 15262936);
|
|
11542
|
+
K.cyl("metal", x, ry + 0.1, 0, 0.031, 4e-3, 12106944);
|
|
11526
11543
|
}
|
|
11527
11544
|
});
|
|
11528
11545
|
K.cyl("plain", 0.3, y + 0.033, 0.1, 0.033, 0.1, 13148208, 0, Math.PI / 2);
|
|
@@ -11541,10 +11558,11 @@ var GameItemsThree = (() => {
|
|
|
11541
11558
|
const K = kit(M, a), { w, d } = K.dim("floor_mattress"), h = 0.17, c = K.fabric(13156528), ac = K.accent(6965818);
|
|
11542
11559
|
K.box("fabric", 0, 0, 0, w, h, d, c);
|
|
11543
11560
|
for (let i = 0; i < 4; i++) K.box("fabric", -w / 2 + (i + 0.5) * w / 4, h, 0, w / 8, 3e-3, d - 0.04, shade2(c, 0.86));
|
|
11544
|
-
|
|
11545
|
-
K.box("fabric", 0
|
|
11546
|
-
K.box("fabric", 0.
|
|
11547
|
-
K.box("fabric",
|
|
11561
|
+
const v = M.visorScene ? 0 : 1;
|
|
11562
|
+
K.box("fabric", 0, h - v * 2e-3, -d / 2 + 0.28, w * 0.7, 0.1 + v * 2e-3, 0.38, 15789280, 0.05);
|
|
11563
|
+
K.box("fabric", 0.03, h - v * 4e-3, 0.3, w * 0.95, 0.05 + v * 4e-3, d * 0.55, ac, 0.05);
|
|
11564
|
+
K.box("fabric", 0.15, h + 0.05 - v * 2e-3, 0, w * 0.5, 0.05, 0.4, shade2(ac, 1.2), 0.3);
|
|
11565
|
+
K.box("fabric", -0.2, h + 0.05 - v * 4e-3, 0.5, w * 0.3, 0.06 + v * 4e-3, 0.3, shade2(ac, 0.8), -0.4);
|
|
11548
11566
|
};
|
|
11549
11567
|
B.lantern = (M, a) => {
|
|
11550
11568
|
const K = kit(M, a), y = M.y || 0;
|
|
@@ -11563,7 +11581,7 @@ var GameItemsThree = (() => {
|
|
|
11563
11581
|
K.cyl("plain", x, y + 0.012, z, 0.017, h, 15787720);
|
|
11564
11582
|
K.cyl("emissive", x, y + 0.012 + h, z, 8e-3, 0.03, i % 2 ? 16760928 : 16767120, 0, 0, "sphere");
|
|
11565
11583
|
});
|
|
11566
|
-
K.cyl("plain", 0.02, y + 0.012, 0, 0.05, 8e-3, 15787720);
|
|
11584
|
+
K.cyl("plain", 0.02, y + (M.visorScene ? 0.012 : 0.01), 0, 0.05, M.visorScene ? 8e-3 : 0.01, 15787720);
|
|
11567
11585
|
if (M.lit !== false) K.light(0, y + 0.22, 0, 16756832, 5, "candles");
|
|
11568
11586
|
};
|
|
11569
11587
|
B.open_suitcases = (M, a) => {
|
|
@@ -11572,7 +11590,7 @@ var GameItemsThree = (() => {
|
|
|
11572
11590
|
const lx = x, hz = z - dd / 2;
|
|
11573
11591
|
K.box("plain", lx, 0, z, ww, 0.16, dd, c, ry);
|
|
11574
11592
|
K.box("fabric", lx, 0.12, z, ww - 0.06, 0.05, dd - 0.06, 14209216, ry);
|
|
11575
|
-
for (let i = 0; i < 5; i++) K.box("fabric", lx + (K.rnd() - 0.5) * (ww - 0.2), 0.16, z + (K.rnd() - 0.5) * (dd - 0.2), 0.14 + K.rnd() * 0.1, 0.04 + K.rnd() * 0.04, 0.12 + K.rnd() * 0.1, rs[i % 4], K.rnd() * 3);
|
|
11593
|
+
for (let i = 0; i < 5; i++) K.box("fabric", lx + (K.rnd() - 0.5) * (ww - 0.2), M.visorScene ? 0.16 : 0.16 - i * 15e-4, z + (K.rnd() - 0.5) * (dd - 0.2), 0.14 + K.rnd() * 0.1, 0.04 + K.rnd() * 0.04, 0.12 + K.rnd() * 0.1, rs[i % 4], K.rnd() * 3);
|
|
11576
11594
|
K.ramp("plain", lx, 0.16, hz, ww, 0.07, dd, c, al);
|
|
11577
11595
|
K.box("metal", lx + ww * 0.3, 0.1, z + dd / 2, 0.04, 0.03, 0.01, 12632256);
|
|
11578
11596
|
};
|
|
@@ -11581,18 +11599,31 @@ var GameItemsThree = (() => {
|
|
|
11581
11599
|
};
|
|
11582
11600
|
B.clothes_on_floor = (M, a) => {
|
|
11583
11601
|
const K = kit(M, a), { w, d } = K.dim("clothes_on_floor"), cs = [13156520, 4876938, 11028538, 14736592, 6982234, 2763312, K.accent(13146698)];
|
|
11602
|
+
let k = 0;
|
|
11603
|
+
const tops = [];
|
|
11604
|
+
const lay = (m, x, y, z, bw, h, bd, c, r) => {
|
|
11605
|
+
if (M.visorScene) {
|
|
11606
|
+
K.box(m, x, y, z, bw, h, bd, c, r);
|
|
11607
|
+
return;
|
|
11608
|
+
}
|
|
11609
|
+
const y0 = 4e-3 + k++ * 15e-4;
|
|
11610
|
+
let top = y0 + h;
|
|
11611
|
+
while (tops.some((t) => Math.abs(t - top) < 13e-4)) top += 13e-4;
|
|
11612
|
+
tops.push(top);
|
|
11613
|
+
K.box(m, x, y0, z, bw, top - y0, bd, c, r);
|
|
11614
|
+
};
|
|
11584
11615
|
for (let i = 0; i < 9; i++) {
|
|
11585
11616
|
const x = (K.rnd() - 0.5) * (w - 0.3), z = (K.rnd() - 0.5) * (d - 0.3), r = K.rnd() * 6, c = cs[i % cs.length], y = 0.012 + i * 3e-3;
|
|
11586
11617
|
if (i % 3 === 0) {
|
|
11587
|
-
|
|
11588
|
-
for (const s of [-1, 1])
|
|
11618
|
+
lay("fabric", x, y, z, 0.3, 0.012, 0.36, c, r);
|
|
11619
|
+
for (const s of [-1, 1]) lay("fabric", x + Math.cos(r) * s * 0.2, y, z - Math.sin(r) * s * 0.2, 0.2, 0.012, 0.09, shade2(c, 0.9), r + s * 0.5);
|
|
11589
11620
|
} else if (i % 3 === 1) {
|
|
11590
|
-
for (const s of [-1, 1])
|
|
11591
|
-
} else
|
|
11621
|
+
for (const s of [-1, 1]) lay("fabric", x + s * 0.06, y, z, 0.13, 0.014, 0.5, 3820138, r + s * 0.15);
|
|
11622
|
+
} else lay("fabric", x, y, z, 0.14, 0.01, 0.07, c, r);
|
|
11592
11623
|
}
|
|
11593
11624
|
const sx = (K.rnd() - 0.5) * (w - 0.4), sz = (K.rnd() - 0.5) * (d - 0.4);
|
|
11594
|
-
|
|
11595
|
-
|
|
11625
|
+
lay("plain", sx, 0.012, sz, 0.09, 0.07, 0.27, 2763306, 0.4);
|
|
11626
|
+
lay("plain", sx + 0.15, 0.012, sz + 0.05, 0.09, 0.07, 0.27, 2763306, 0.9);
|
|
11596
11627
|
};
|
|
11597
11628
|
B.fallen_chair = (M, a) => {
|
|
11598
11629
|
const g = Math.PI / 2, dy = 0.23, api = { box: (Mm, mat, x, y, z, w, h, d, color2, ry, rx, rz) => {
|
|
@@ -11606,17 +11637,30 @@ var GameItemsThree = (() => {
|
|
|
11606
11637
|
};
|
|
11607
11638
|
B.blood_stains = (M, a) => {
|
|
11608
11639
|
const K = kit(M, a), { w, d } = K.dim("blood_stains");
|
|
11609
|
-
|
|
11640
|
+
let n = 0;
|
|
11641
|
+
const film = () => {
|
|
11642
|
+
const y0 = 0.011 - n * 11e-4, y1 = 0.0125 + n * 11e-4;
|
|
11643
|
+
n++;
|
|
11644
|
+
return { y: y0, h: y1 - y0 };
|
|
11645
|
+
};
|
|
11646
|
+
for (let k = 0; k < 7; k++) {
|
|
11647
|
+
const f = film();
|
|
11648
|
+
K.cyl("plain", (K.rnd() - 0.5) * w * 0.3 + n * 4e-3, f.y, (K.rnd() - 0.5) * d * 0.3, 0.12 + K.rnd() * 0.18 + n * 13e-4, f.h, k < 2 ? 3803142 : 5902348);
|
|
11649
|
+
}
|
|
11610
11650
|
for (let k = 0; k < 8; k++) {
|
|
11611
|
-
const an = K.rnd() * 6.28, r = 0.3 + K.rnd() * Math.min(w, d) * 0.4;
|
|
11612
|
-
K.cyl("plain", Math.cos(an) * r,
|
|
11651
|
+
const an = K.rnd() * 6.28, r = 0.3 + K.rnd() * Math.min(w, d) * 0.4, f = film();
|
|
11652
|
+
K.cyl("plain", Math.cos(an) * r, f.y, Math.sin(an) * r, 0.02 + K.rnd() * 0.05 + n * 13e-4, f.h, 4852232);
|
|
11653
|
+
}
|
|
11654
|
+
if (M.drag !== false) for (let k = 1; k < 6; k++) {
|
|
11655
|
+
const f = film();
|
|
11656
|
+
K.box("plain", 0.3 + k * 0.1, f.y, 0.15 + k * 0.17, 0.16 - k * 0.015, f.h, 0.2, 4852746, 0.5);
|
|
11613
11657
|
}
|
|
11614
|
-
if (M.drag !== false) for (let k = 1; k < 6; k++) K.box("plain", 0.3 + k * 0.1, 0.012, 0.15 + k * 0.17, 0.16 - k * 0.015, 3e-3, 0.2, 4852746, 0.5);
|
|
11615
11658
|
};
|
|
11616
11659
|
B.open_door = (M, a) => {
|
|
11617
11660
|
const K = kit(M, a), { w, d, h } = K.dim("open_door"), wood = K.wood(6965804), angle = M.angle != null ? M.angle : 1.2, L = w - 0.06, hx = -w / 2 + 0.03;
|
|
11618
|
-
|
|
11619
|
-
K.box("wood", w / 2
|
|
11661
|
+
const jh = M.visorScene ? h + 0.06 : h;
|
|
11662
|
+
K.box("wood", -w / 2 - 0.03, 0, 0, 0.06, jh, d, shade2(wood, 0.8));
|
|
11663
|
+
K.box("wood", w / 2 + 0.03, 0, 0, 0.06, jh, d, shade2(wood, 0.8));
|
|
11620
11664
|
K.box("wood", 0, h, 0, w + 0.12, 0.06, d, shade2(wood, 0.8));
|
|
11621
11665
|
K.box("wood", hx + Math.cos(angle) * L / 2, 0, Math.sin(angle) * L / 2, L, h - 0.02, 0.04, wood, -angle);
|
|
11622
11666
|
K.cyl("metal", hx + Math.cos(angle) * (L - 0.08), 1, Math.sin(angle) * (L - 0.08) + 0.04, 0.025, 0.06, 13152368, Math.PI / 2, 0);
|
|
@@ -11736,9 +11780,9 @@ var GameItemsThree = (() => {
|
|
|
11736
11780
|
for (const s of [-1, 1]) K.box("plain", s * (w / 2 + t / 2), 0, 0, t, 0.1, d, bo);
|
|
11737
11781
|
cover(a, M, "pool_tile", { w, d, y: 0.035, size: 1 });
|
|
11738
11782
|
K.plane("water", 0, 0.075, 0, w, d, 9426158, 0, -Math.PI / 2, 0);
|
|
11739
|
-
for (let i = 0; i < 3; i++) K.box("plain", w / 2 - 0.35 + i * 0, 0.035 + i * 0.01, d / 2 - 0.2 - i * 0.28, 0.7 - i * 0.05, 0.03, 0.26, 14675698);
|
|
11783
|
+
for (let i = 0; i < 3; i++) K.box("plain", w / 2 - 0.35 + i * 0, 0.035 + i * 0.01 - (M.visorScene || i !== 1 ? 0 : 2e-3), d / 2 - 0.2 - i * 0.28, 0.7 - i * 0.05, 0.03, 0.26, 14675698);
|
|
11740
11784
|
for (const s of [-1, 1]) {
|
|
11741
|
-
K.box("metal", -w / 4 + s * 0.2, 0, d / 2 + t * 0.6, 0.03, 0.85, 0.03, 13159632);
|
|
11785
|
+
K.box("metal", -w / 4 + s * 0.2, M.visorScene ? 0 : 2e-3, d / 2 + t * 0.6, 0.03, M.visorScene ? 0.85 : 0.848, 0.03, 13159632);
|
|
11742
11786
|
K.box("metal", -w / 4 + s * 0.2, 0.85, d / 2 + t * 0.6 - 0.1, 0.03, 0.03, 0.22, 13159632);
|
|
11743
11787
|
K.box("metal", -w / 4 + s * 0.2, 0, d / 2 - 0.25, 0.03, 0.88, 0.03, 13159632, 0, 0);
|
|
11744
11788
|
}
|
|
@@ -11748,20 +11792,22 @@ var GameItemsThree = (() => {
|
|
|
11748
11792
|
const K = kit(M, a), { w, d } = K.dim("deck"), h = 0.2, wood = K.wood(6965808);
|
|
11749
11793
|
K.box("wood", 0, 0, 0, w - 0.05, h, d - 0.05, shade2(wood, 0.7));
|
|
11750
11794
|
cover(a, M, "deck_floor", { w, d, y: h + 0.012, size: 1.2, color: M.color });
|
|
11751
|
-
for (const [x, z, ww, dd] of [[0, -d / 2, w, 0.05], [0, d / 2, w, 0.05], [-w / 2, 0, 0.05, d], [w / 2, 0, 0.05, d]]) K.box("wood", x, 0, z, ww, h + 0.02, dd, wood);
|
|
11752
|
-
|
|
11753
|
-
K.box("wood", 0, 0
|
|
11795
|
+
for (const [x, z, ww, dd] of [[0, -d / 2, w, 0.05], [0, d / 2, w, 0.05], [-w / 2, 0, 0.05, d], [w / 2, 0, 0.05, d]]) K.box("wood", x, 0, z, ww, h + 0.02, M.visorScene || dd !== d ? dd : d - 0.05, wood);
|
|
11796
|
+
const sz = M.visorScene ? d / 2 + 0.17 : d / 2 + 0.025 + 0.1575, sd = M.visorScene ? 0.34 : 0.315;
|
|
11797
|
+
K.box("wood", 0, 0, sz, 1.4, 0.1, sd, wood);
|
|
11798
|
+
K.box("wood", 0, 0.1, sz, 1.4, 0.012, sd, shade2(wood, 1.2));
|
|
11754
11799
|
};
|
|
11755
11800
|
B.sun_lounger = (M, a) => {
|
|
11756
11801
|
const K = kit(M, a), { w } = K.dim("sun_lounger"), fr = K.metal(15263972), al = 0.95, cu = K.fabric(3828378), stripe = K.accent(15789280);
|
|
11757
11802
|
for (const s of [-1, 1]) {
|
|
11758
11803
|
K.box("metal", s * (w / 2 - 0.03), 0.17, -0.3, 0.035, 0.035, 1.35, fr);
|
|
11759
|
-
|
|
11760
|
-
K.box("metal", s * (w / 2 - 0.03), 0,
|
|
11804
|
+
const lw = M.visorScene ? 0.035 : 0.025;
|
|
11805
|
+
K.box("metal", s * (w / 2 - 0.03), 0, 0.95, lw, 0.2, 0.035, fr);
|
|
11806
|
+
K.box("metal", s * (w / 2 - 0.03), 0, -0.3, lw, 0.2, 0.035, fr);
|
|
11761
11807
|
K.cyl("plain", s * (w / 2 - 0.03), 0.07, -0.3, 0.07, 0.03, 2763306, 0, Math.PI / 2);
|
|
11762
11808
|
}
|
|
11763
11809
|
K.box("fabric", 0, 0.21, 0.35, w - 0.1, 0.06, 1.3, cu);
|
|
11764
|
-
K.ramp("fabric", 0, 0.2, -0.3, w - 0.1, 0.06, 0.8, cu, al);
|
|
11810
|
+
K.ramp("fabric", 0, 0.2, -0.3, M.visorScene ? w - 0.1 : w - 0.104, 0.06, 0.8, cu, al);
|
|
11765
11811
|
for (let i = 0; i < 4; i++) {
|
|
11766
11812
|
K.box("fabric", 0, M.visorScene ? 0.265 : 0.268, 0 + i * 0.3, M.visorScene ? w - 0.098 : w - 0.096, 4e-3, 0.08, stripe);
|
|
11767
11813
|
}
|
|
@@ -11837,7 +11883,7 @@ var GameItemsThree = (() => {
|
|
|
11837
11883
|
for (const s of [-1, 1]) {
|
|
11838
11884
|
K.box("plain", s * 0.35, py + 0.05, pz, 0.04, 0.42, 0.74, az);
|
|
11839
11885
|
}
|
|
11840
|
-
K.box("plain", 0, py + 0.05, pz - 0.35, 0.74, 0.42, 0.04, az);
|
|
11886
|
+
K.box("plain", 0, py + 0.05, pz - 0.35, M.visorScene ? 0.74 : 0.66, 0.42, 0.04, az);
|
|
11841
11887
|
const run = d / 2 - pz - 0.4, al = Math.atan2(py - 0.1, run);
|
|
11842
11888
|
K.ramp("plain", 0, py, pz + 0.37, 0.5, 0.04, Math.hypot(run, py - 0.1) + 0.1, 14209216, -al + 0 + 0);
|
|
11843
11889
|
for (const s of [-1, 1]) K.ramp("plain", s * 0.27, py + 0.03, pz + 0.37, 0.04, 0.12, Math.hypot(run, py - 0.1) + 0.1, az, -al);
|
|
@@ -11847,7 +11893,7 @@ var GameItemsThree = (() => {
|
|
|
11847
11893
|
};
|
|
11848
11894
|
B.swing = (M, a) => {
|
|
11849
11895
|
const K = kit(M, a), { w, d, h } = K.dim("swing"), mt = K.color("metal", 3828400), L = Math.hypot(h, d / 2), an = Math.atan2(d / 2, h);
|
|
11850
|
-
for (const sx of [-1, 1]) for (const sz of [-1, 1]) K.box("metal", sx * w / 2, h / 2 - L / 2 + 0, sz * d / 4, 0.07, L, 0.07, mt, 0, -sz * an, 0);
|
|
11896
|
+
for (const sx of [-1, 1]) for (const sz of [-1, 1]) K.box("metal", sx * w / 2, h / 2 - L / 2 + 0, sz * d / 4, M.visorScene || sz < 0 ? 0.07 : 0.066, L, 0.07, mt, 0, -sz * an, 0);
|
|
11851
11897
|
K.box("metal", 0, h - 0.04, 0, w + 0.1, 0.1, 0.1, shade2(mt, 0.85));
|
|
11852
11898
|
const cs = [K.accent(13123642), 2763306];
|
|
11853
11899
|
for (let i = 0; i < 2; i++) {
|
|
@@ -11859,11 +11905,11 @@ var GameItemsThree = (() => {
|
|
|
11859
11905
|
B.bbq_simple = (M, a) => {
|
|
11860
11906
|
const K = kit(M, a), { w, d } = K.dim("bbq_simple"), br = K.color("exterior_floor", 11688512), hb = 0.78;
|
|
11861
11907
|
K.box("plain", 0, 0, 0, w, 0.45, d, br);
|
|
11862
|
-
for (const [x, z, ww, dd] of [[0, -d / 2 + 0.06, w, 0.12], [0, d / 2 - 0.06, w, 0.12], [-w / 2 + 0.06, 0, 0.12, d - 0.2], [w / 2 - 0.06, 0, 0.12, d - 0.2]]) K.box("plain", x, 0.45, z, ww, hb - 0.45, dd, br);
|
|
11863
|
-
K.box("plain", 0, 0.45, 0, w - 0.22, 0.04, d - 0.22, 2762276);
|
|
11908
|
+
for (const [x, z, ww, dd] of [[0, -d / 2 + 0.06, w, 0.12], [0, d / 2 - 0.06, w, 0.12], [-w / 2 + 0.06, 0, 0.12, d - 0.2], [w / 2 - 0.06, 0, 0.12, d - 0.2]]) K.box("plain", x, 0.45, z, ww, hb - 0.45, M.visorScene || dd !== d - 0.2 ? dd : d - 0.24, br);
|
|
11909
|
+
K.box("plain", 0, 0.45, 0, w - (M.visorScene ? 0.22 : 0.24), 0.04, d - (M.visorScene ? 0.22 : 0.24), 2762276);
|
|
11864
11910
|
for (let i = 0; i < 10; i++) K.box("plain", (K.rnd() - 0.5) * (w - 0.3), M.visorScene ? 0.49 : 0.49 + i * 22e-4, (K.rnd() - 0.5) * (d - 0.3), 0.08, 0.02, 0.07, i % 3 ? 13126170 : 3811876, K.rnd() * 3);
|
|
11865
11911
|
for (let i = 0; i < 7; i++) K.box("metal", -w / 2 + 0.16 + i * (w - 0.32) / 6, hb + 0.01, 0, 0.012, 0.012, d - 0.1, 5921374);
|
|
11866
|
-
K.box("metal", 0, hb + 0.01, -d / 2 + 0.2, w - 0.1, 0.012, 0.02, 5921374);
|
|
11912
|
+
K.box("metal", 0, hb + (M.visorScene ? 0.01 : 8e-3), -d / 2 + 0.2, w - 0.1, M.visorScene ? 0.012 : 0.016, 0.02, 5921374);
|
|
11867
11913
|
for (let i = 0; i < 3; i++) {
|
|
11868
11914
|
const z = (i - 1) * 0.15;
|
|
11869
11915
|
K.cyl("metal", 0, hb + 0.05, z, 6e-3, w + 0.12, 11580600, 0, Math.PI / 2);
|
|
@@ -11879,7 +11925,7 @@ var GameItemsThree = (() => {
|
|
|
11879
11925
|
const cz = -0.35;
|
|
11880
11926
|
for (const sx of [-1, 1]) for (const sz of [-1, 1]) K.box("plain", sx * (w / 2 - 0.1), 0.76, cz + sz * 0.8, 0.07, 0.5, 0.07, shade2(c, 0.9));
|
|
11881
11927
|
K.box("plain", 0, 1.26, cz, w - 0.1, 0.05, 1.75, shade2(c, 1.04));
|
|
11882
|
-
K.box("glass", 0, 0.76, cz, w - 0.06, 0.5, 1.6, 16777215);
|
|
11928
|
+
K.box("glass", 0, M.visorScene ? 0.76 : 0.762, cz, w - 0.06, M.visorScene ? 0.5 : 0.496, 1.6, 16777215);
|
|
11883
11929
|
K.box("glass", 0, 0.76, cz + 0.8, w - 0.12, 0.5, 0.04, 16777215, 0, 0.5);
|
|
11884
11930
|
for (const s of [-1, 1]) {
|
|
11885
11931
|
K.box("plain", s * 0.4, 0.55, cz + 0.4, 0.4, 0.3, 0.4, 2763310);
|
|
@@ -11905,10 +11951,9 @@ var GameItemsThree = (() => {
|
|
|
11905
11951
|
K.box("plain", xa, 0, zc, 1.6, 0.85, 0.7, br);
|
|
11906
11952
|
for (let i = 1; i < 4; i++) K.box("plain", xa, i * 0.2, zc + 0.351, 1.6, 0.012, 4e-3, shade2(br, 0.7));
|
|
11907
11953
|
K.box("plain", xa, 0.12, zc + (M.visorScene ? 0.352 : 0.355), 0.7, 0.4, 4e-3, 1709586);
|
|
11908
|
-
|
|
11909
|
-
|
|
11910
|
-
|
|
11911
|
-
for (let i = 0; i < 6; i++) K.box("plain", xa + (K.rnd() - 0.5) * 1.2, M.visorScene ? 0.88 : 0.88 + i * 22e-4, zc + (K.rnd() - 0.5) * 0.3, 0.1, 0.02, 0.08, i % 2 ? 13126170 : 3811876, K.rnd() * 3);
|
|
11954
|
+
const sd = M.visorScene ? 0.7 : 0.4, sz = M.visorScene ? zc : zc + 0.05;
|
|
11955
|
+
for (const [x, z, ww, dd] of [[xa, zc - 0.25, 1.6, 0.2], [xa, zc + 0.3, 1.6, 0.1], [xa - 0.75, sz, 0.1, sd], [xa + 0.75, sz, 0.1, sd]]) K.box("plain", x, 0.85, z, ww, 0.12, dd, br);
|
|
11956
|
+
K.box("plain", xa, M.visorScene ? 0.85 : 0.852, zc + 0.02, 1.4, 0.025, 0.4, 2762276);
|
|
11912
11957
|
K.box("plain", xa, 1.5, zc - 0.07, 1.5, 0.4, 0.56, br);
|
|
11913
11958
|
K.box("plain", xa, 1.5, zc + 0.215, 1.5, 0.4, 0.01, 1709586);
|
|
11914
11959
|
K.box("plain", xa, 1.9, zc - 0.12, 0.62, 1, 0.46, br);
|
|
@@ -11916,9 +11961,10 @@ var GameItemsThree = (() => {
|
|
|
11916
11961
|
K.box("plain", xa, 2.98, zc - 0.12, 0.5, 0.06, 0.4, shade2(br, 0.75));
|
|
11917
11962
|
K.box("plain", xb, 0, zc, 1.44, 0.85, 0.7, cab);
|
|
11918
11963
|
for (let i = 0; i < 3; i++) K.box("wood", xb - 0.48 + i * 0.48, 0.08, zc + 0.355, 0.44, 0.7, 0.012, wood);
|
|
11919
|
-
|
|
11964
|
+
const ct0 = M.visorScene ? xb - 0.74 : xa + 0.802, ct1 = xc + 0.67;
|
|
11965
|
+
K.box("plain", M.visorScene ? (xb + xc) / 2 : (ct0 + ct1) / 2, 0.85, zc, M.visorScene ? 0.72 * 2 + 0.65 + 0.04 : ct1 - ct0, 0.04, 0.74, gr);
|
|
11920
11966
|
K.box("metal", xb, 0.89, zc, 0.5, 0.01, 0.38, 11580600);
|
|
11921
|
-
K.box("metal", xb, M.visorScene ? 0.895 : 0.
|
|
11967
|
+
K.box("metal", xb, M.visorScene ? 0.895 : 0.893, zc, 0.44, M.visorScene ? 6e-3 : 4e-3, 0.32, 7370362);
|
|
11922
11968
|
K.box("plain", xc, 0, zc, 1.3, 0.85, 0.7, cab);
|
|
11923
11969
|
for (let i = 0; i < 2; i++) K.box("wood", xc - 0.32 + i * 0.64, 0.08, zc + 0.355, 0.6, 0.7, 0.012, wood);
|
|
11924
11970
|
K.cyl("plain", xc, 0.89, zc, 0.1, 0.05, 15790314);
|
|
@@ -11941,7 +11987,7 @@ var GameItemsThree = (() => {
|
|
|
11941
11987
|
const K = kit(M, a), { w, d, h } = K.dim("sauna"), t = 0.08, wood = K.wood(12618324), shade1 = shade2(wood, 0.88), dw = 0.7, dx = w / 2 - 0.55;
|
|
11942
11988
|
K.box("wood", 0, 0, 0, w, 0.05, d, shade2(wood, 0.75));
|
|
11943
11989
|
K.box("wood", 0, 0.05, -d / 2 + t / 2, w, h - 0.11, t, wood);
|
|
11944
|
-
for (const s of [-1, 1]) K.box("wood", s * (w / 2 - t / 2), 0.05, 0, t, h - 0.11, d - 2 * t
|
|
11990
|
+
for (const s of [-1, 1]) K.box("wood", s * (w / 2 - t / 2), 0.05, 0, t, h - 0.11, M.visorScene ? d : d - 2 * t, wood);
|
|
11945
11991
|
K.box("wood", 0, h - 0.06, 0, w + 0.12, 0.06, d + 0.12, shade2(wood, 0.75));
|
|
11946
11992
|
const lx0 = -w / 2, lx1 = dx - dw / 2;
|
|
11947
11993
|
K.box("wood", (lx0 + lx1) / 2, 0.05, d / 2 - t / 2, lx1 - lx0, h - 0.11, t, wood);
|
|
@@ -11952,8 +11998,9 @@ var GameItemsThree = (() => {
|
|
|
11952
11998
|
K.box("wood", x, 0.05, d / 2 + 3e-3, 0.012, h - 0.11, 5e-3, shade2(wood, 0.6));
|
|
11953
11999
|
}
|
|
11954
12000
|
const jamb = M.visorScene ? 0.025 : 0;
|
|
11955
|
-
|
|
11956
|
-
K.box("wood", dx
|
|
12001
|
+
const jy = M.visorScene ? 0.05 : 0.048;
|
|
12002
|
+
K.box("wood", dx - dw / 2 - jamb, jy, d / 2 - 0.02, 0.05, 1.87 - jy, 0.06, shade1);
|
|
12003
|
+
K.box("wood", dx + dw / 2 + jamb, jy, d / 2 - 0.02, 0.05, 1.87 - jy, 0.06, shade1);
|
|
11957
12004
|
K.box("glass", dx, 0.06, d / 2 - 0.02, dw, 1.75, 0.02, 16777215);
|
|
11958
12005
|
K.box("metal", dx - dw / 2 + 0.08, 0.7, d / 2 + 0.03, 0.02, 0.5, 0.03, 13159632);
|
|
11959
12006
|
K.box("wood", 0, 0.85, -d / 2 + t + 0.25, w - 2 * t, 0.05, 0.5, shade2(wood, 1.1));
|
|
@@ -12378,7 +12425,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
12378
12425
|
box: (M, material, x, y, z, w, h, d, color2, ry, rx, rz) => void primitives.push({ kind: "box", M, material, x, y, z, w, h, d, color: color2, ry, rx, rz }),
|
|
12379
12426
|
cylinder: (M, material, x, y, z, r, h, color2, rx, rz, shape) => void primitives.push({ kind: "cylinder", M, material, x, y, z, r, h, color: color2, rx, rz, shape }),
|
|
12380
12427
|
leaf: (M, x, y, z, w, h, color2, ry, rx) => void primitives.push({ kind: "leaf", M, x, y, z, w, h, color: color2, ry, rx }),
|
|
12381
|
-
plane: (M, material, x, y, z, w, h, color2, ry, rx, rz, uv) => void primitives.push({ kind: "plane", M, material, x, y, z, w, h, color: color2, ry, rx, rz, uv })
|
|
12428
|
+
plane: (M, material, x, y, z, w, h, color2, ry, rx, rz, uv) => void primitives.push({ kind: "plane", M, material, x, y, z, w, h, color: color2, ry, rx, rz, uv }),
|
|
12429
|
+
lathe: (M, material, x, y, z, points, color2) => void primitives.push({ kind: "lathe", M, material, x, y, z, points, color: color2 })
|
|
12382
12430
|
};
|
|
12383
12431
|
if (options.light !== false) {
|
|
12384
12432
|
api.light = (M, x, y, z, color2, range2, lightKind) => void primitives.push({ kind: "light", M, x, y, z, color: color2, range: range2, lightKind });
|
|
@@ -12447,6 +12495,9 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
12447
12495
|
list2.push({ kind: "cylinder", radiusTop: 1, radiusBottom: 1, height: 1, radialSegments: cyl, ...place });
|
|
12448
12496
|
}
|
|
12449
12497
|
},
|
|
12498
|
+
lathe(M, material, x, y, z, points, color2) {
|
|
12499
|
+
into(M).push({ kind: "lathe", material, color: color2, position: [x, y, z], points: points.map(([r, py]) => [r, py]), segments: cyl });
|
|
12500
|
+
},
|
|
12450
12501
|
leaf(M, x, y, z, w, h, color2, ry, rx) {
|
|
12451
12502
|
into(M).push({ kind: "mesh", ...LEAF, material: "plant", color: color2, position: [x, y, z], rotation: [rx, ry, 0], rotationOrder: "YXZ", scale: [w, h, 1] });
|
|
12452
12503
|
},
|
|
@@ -13074,6 +13125,33 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
13074
13125
|
return out;
|
|
13075
13126
|
};
|
|
13076
13127
|
var granules = (inp, box4, count) => bsp(box4, count, [0, 1, 2], inp.rnd).map((b) => ({ center: b.c, size: b.s, q: quat.identity(), shape: "chunk", weight: b.s[0] * b.s[1] * b.s[2] }));
|
|
13128
|
+
var SLAB_MIN = 0.03;
|
|
13129
|
+
var splitAtHit = (root, hit, axes, count, rnd) => {
|
|
13130
|
+
let pieces = [root];
|
|
13131
|
+
for (const ax of axes) {
|
|
13132
|
+
const half = root.s[ax] / 2;
|
|
13133
|
+
if (hit[ax] - -half < SLAB_MIN || half - hit[ax] < SLAB_MIN) continue;
|
|
13134
|
+
const next = [];
|
|
13135
|
+
for (const b of pieces) {
|
|
13136
|
+
const lo = b.c[ax] - b.s[ax] / 2;
|
|
13137
|
+
const hi = b.c[ax] + b.s[ax] / 2;
|
|
13138
|
+
for (const [from, to] of [[lo, hit[ax]], [hit[ax], hi]]) {
|
|
13139
|
+
const c = [b.c[0], b.c[1], b.c[2]];
|
|
13140
|
+
const s = [b.s[0], b.s[1], b.s[2]];
|
|
13141
|
+
c[ax] = (from + to) / 2;
|
|
13142
|
+
s[ax] = to - from;
|
|
13143
|
+
next.push({ c, s });
|
|
13144
|
+
}
|
|
13145
|
+
}
|
|
13146
|
+
pieces = next;
|
|
13147
|
+
}
|
|
13148
|
+
while (pieces.length < count) {
|
|
13149
|
+
pieces.sort((a, b) => b.s[axes[0]] * b.s[axes[1]] - a.s[axes[0]] * a.s[axes[1]]);
|
|
13150
|
+
const [big, ...rest2] = pieces;
|
|
13151
|
+
pieces = [...bsp(big, 2, axes, rnd), ...rest2];
|
|
13152
|
+
}
|
|
13153
|
+
return pieces;
|
|
13154
|
+
};
|
|
13077
13155
|
var CRUMBS = 6;
|
|
13078
13156
|
var severAt = (inp, root, at2, gap) => {
|
|
13079
13157
|
const dims = root.s;
|
|
@@ -13136,7 +13214,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
13136
13214
|
if (inp.cut) return severAt(inp, root, inp.cut.at, inp.cut.gap);
|
|
13137
13215
|
if (inp.form === "plies") return plyBreak(inp, root, maxFragments);
|
|
13138
13216
|
const n2 = Math.min(maxFragments, 2 + Math.floor(rnd() * 3));
|
|
13139
|
-
|
|
13217
|
+
const slabs = inp.form === "granules" && dims[t] < Math.min(dims[u], dims[v]) / 4 ? splitAtHit(root, inp.hit, [u, v], n2, rnd) : bsp(root, n2, [0, 1, 2], rnd);
|
|
13218
|
+
for (const b of slabs) out.push({ center: b.c, size: b.s, q: idq, shape: "slab", weight: b.s[0] * b.s[1] * b.s[2] });
|
|
13140
13219
|
if (inp.form !== "granules") return out;
|
|
13141
13220
|
const crumbs = Math.min(CRUMBS, maxFragments - out.length);
|
|
13142
13221
|
if (crumbs <= 0) return out;
|
|
@@ -21469,6 +21548,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
21469
21548
|
}).events;
|
|
21470
21549
|
},
|
|
21471
21550
|
state: (id) => objects.get(id)?.st ?? impls.get(id)?.impl.state() ?? null,
|
|
21551
|
+
anchoredParts: (id) => objects.get(id)?.parts.filter((p) => p.anchored && !isLost(p)).map((p) => p.spec.id) ?? [],
|
|
21552
|
+
fixedInPlace: (id) => {
|
|
21553
|
+
const o = objects.get(id);
|
|
21554
|
+
return !!o && o.spec.fixed === true && o.parts.some((p) => p.anchored && !isLost(p));
|
|
21555
|
+
},
|
|
21472
21556
|
snapshot: (id) => {
|
|
21473
21557
|
const st = objects.get(id)?.st ?? impls.get(id)?.impl.state();
|
|
21474
21558
|
return st ? clone(st) : null;
|
|
@@ -24174,6 +24258,30 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
24174
24258
|
if (ratio >= rules.freshness.stale) return "stale";
|
|
24175
24259
|
return "fresh";
|
|
24176
24260
|
};
|
|
24261
|
+
var FRESH_NUTRITION = { satietyFactor: 1, poisonChance: 0, morale: 0, isEdible: true };
|
|
24262
|
+
var nutritionOf = (item, context, rules) => {
|
|
24263
|
+
const state = context.freshness ?? "fresh";
|
|
24264
|
+
const effect = state === "fresh" ? FRESH_NUTRITION : rules.use.freshness[state];
|
|
24265
|
+
const poisonShare = context.isCooked ? rules.use.cookedPoisonFactor : 1;
|
|
24266
|
+
return {
|
|
24267
|
+
satiety: (item.nutrition?.satiety ?? 0) * effect.satietyFactor,
|
|
24268
|
+
hydration: item.nutrition?.hydration ?? 0,
|
|
24269
|
+
morale: effect.morale,
|
|
24270
|
+
poisonChance: effect.poisonChance * poisonShare,
|
|
24271
|
+
isEdible: effect.isEdible
|
|
24272
|
+
};
|
|
24273
|
+
};
|
|
24274
|
+
var findEffect = (item, effects) => effects.find((entry2) => entry2.items?.includes(item.id)) ?? effects.find((entry2) => entry2.category?.includes(item.category));
|
|
24275
|
+
var resolveUse = (item, effects, context = {}, rules = DEFAULT_RULES) => {
|
|
24276
|
+
const def = findEffect(item, effects);
|
|
24277
|
+
if (!def) return void 0;
|
|
24278
|
+
const base = { useId: def.id, effect: def.effect, params: def.params ?? {}, consumes: def.consumes };
|
|
24279
|
+
if (def.effect !== "consume_nutrition") return base;
|
|
24280
|
+
const nutrition = nutritionOf(item, context, rules);
|
|
24281
|
+
const blocked = item.seal && context.seal ? sealBlock(item.seal, context.seal) : void 0;
|
|
24282
|
+
if (blocked) return { ...base, consumes: false, nutrition: { ...nutrition, isEdible: false }, blocked };
|
|
24283
|
+
return { ...base, consumes: def.consumes && nutrition.isEdible, nutrition };
|
|
24284
|
+
};
|
|
24177
24285
|
var countOf = (context, id) => context.inventory.get(id) ?? 0;
|
|
24178
24286
|
var candidatesOf = (input, context) => {
|
|
24179
24287
|
if (input.item !== void 0) return [input.item];
|
|
@@ -37994,6 +38102,12 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
37994
38102
|
impact: {
|
|
37995
38103
|
response: "dent",
|
|
37996
38104
|
pushImpulse: true
|
|
38105
|
+
},
|
|
38106
|
+
use: {
|
|
38107
|
+
clip: "use_hygiene",
|
|
38108
|
+
sounds: [
|
|
38109
|
+
"scrub"
|
|
38110
|
+
]
|
|
37997
38111
|
}
|
|
37998
38112
|
}
|
|
37999
38113
|
}
|
|
@@ -41581,6 +41695,22 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
41581
41695
|
items: [
|
|
41582
41696
|
"alcohol_70",
|
|
41583
41697
|
"povidone_iodine"
|
|
41698
|
+
],
|
|
41699
|
+
params: {
|
|
41700
|
+
clip: "apply_dressing"
|
|
41701
|
+
}
|
|
41702
|
+
},
|
|
41703
|
+
{
|
|
41704
|
+
id: "wash",
|
|
41705
|
+
effect: "wash",
|
|
41706
|
+
consumes: false,
|
|
41707
|
+
items: [
|
|
41708
|
+
"soap",
|
|
41709
|
+
"shampoo",
|
|
41710
|
+
"toothpaste",
|
|
41711
|
+
"toothbrush",
|
|
41712
|
+
"deodorant",
|
|
41713
|
+
"towel"
|
|
41584
41714
|
]
|
|
41585
41715
|
},
|
|
41586
41716
|
{
|
|
@@ -42903,6 +43033,29 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
42903
43033
|
"kind.hygiene.description": "Sabonete, pasta de dente, papel higi\xEAnico e toalha."
|
|
42904
43034
|
};
|
|
42905
43035
|
var GOODS_STRINGS = { en: en_default2, "pt-BR": pt_BR_default2 };
|
|
43036
|
+
var drinkHydrationOf = (item, liquids = LIQUIDS) => {
|
|
43037
|
+
const fluid = item.fluid;
|
|
43038
|
+
const drink = fluid ? liquids.find((liquid) => liquid.id === fluid.liquid)?.drink : void 0;
|
|
43039
|
+
if (!fluid || !drink) return void 0;
|
|
43040
|
+
const doses = item.durability?.kind === "doses" ? Math.max(1, item.durability.amount ?? 1) : 1;
|
|
43041
|
+
return drink.thirst * fluid.liters / doses;
|
|
43042
|
+
};
|
|
43043
|
+
var createGoodsItemUse = (options = {}) => {
|
|
43044
|
+
const kinds = options.kinds ?? createGoodsKinds();
|
|
43045
|
+
const effects = options.effects ?? GOODS_USE_EFFECTS;
|
|
43046
|
+
const liquids = options.liquids ?? LIQUIDS;
|
|
43047
|
+
return (item) => {
|
|
43048
|
+
if (item.kind === void 0 || !kinds.has(item.kind)) return void 0;
|
|
43049
|
+
const result = resolveUse(item, effects);
|
|
43050
|
+
const { clip: effectClip, ...params } = result?.params ?? {};
|
|
43051
|
+
const clip = typeof effectClip === "string" ? effectClip : resolveEntry(kinds, item).use?.clip;
|
|
43052
|
+
if (clip === void 0) return void 0;
|
|
43053
|
+
if (!result) return { clip, consumes: false };
|
|
43054
|
+
const nutrition = result.nutrition ? { satiety: result.nutrition.satiety, hydration: drinkHydrationOf(item, liquids) ?? result.nutrition.hydration } : {};
|
|
43055
|
+
return { clip, consumes: result.consumes, effect: { id: result.effect, ...Object.keys(params).length > 0 ? { params } : {}, ...nutrition } };
|
|
43056
|
+
};
|
|
43057
|
+
};
|
|
43058
|
+
var goodsItemUse = createGoodsItemUse();
|
|
42906
43059
|
|
|
42907
43060
|
// ../game-interactables-household/dist/index.js
|
|
42908
43061
|
var door = (material, joint = "hinge", piece2 = "door") => ({ material, joint, piece: piece2 });
|
|
@@ -42914,6 +43067,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
42914
43067
|
var fridgeLike = { body: { material: "steel", joint: "weld" }, parts: [[/^door/, door("steel")]] };
|
|
42915
43068
|
var bin = { body: { material: "plastic", joint: "fused" }, parts: [["lid", door("plastic", "hinge", "lid")]] };
|
|
42916
43069
|
var upholstery = { material: "fabric", joint: "glue" };
|
|
43070
|
+
var POLE_CAGE = { material: "steel", spacing: 0.1, diameter: 0.01 };
|
|
42917
43071
|
var DESTRUCTION = {
|
|
42918
43072
|
fridge: fridgeLike,
|
|
42919
43073
|
fridge_compact: fridgeLike,
|
|
@@ -42939,7 +43093,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
42939
43093
|
},
|
|
42940
43094
|
wall_socket: { body: { material: "plastic", joint: "screw" }, parts: [] },
|
|
42941
43095
|
wall_switch: { body: { material: "plastic", joint: "screw" }, parts: [["rocker", { material: "plastic", joint: "clip", piece: "rocker" }]] },
|
|
42942
|
-
|
|
43096
|
+
// a cast concrete pole (NBR 8451: CA-50 bars in the concrete), its segments held by the bars; the meter box, the cross arm and the bracket are bolted to it
|
|
43097
|
+
service_entrance: { body: { material: "concrete", joint: "rebar", reinforcement: POLE_CAGE }, parts: [["meter_door", door("steel")]] },
|
|
42943
43098
|
conduit_run: { body: { material: "plastic", joint: "clip" }, parts: [] },
|
|
42944
43099
|
service_mast: { body: { material: "steel", joint: "clip" }, parts: [] },
|
|
42945
43100
|
electrical_panel: {
|
|
@@ -43603,7 +43758,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
43603
43758
|
h: 0.7,
|
|
43604
43759
|
y: 1.4,
|
|
43605
43760
|
solid: true,
|
|
43606
|
-
massKg: 15
|
|
43761
|
+
massKg: 15,
|
|
43762
|
+
fixed: true
|
|
43607
43763
|
},
|
|
43608
43764
|
{
|
|
43609
43765
|
id: "pantry",
|
|
@@ -43688,7 +43844,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
43688
43844
|
h: 1.2,
|
|
43689
43845
|
y: 0,
|
|
43690
43846
|
solid: true,
|
|
43691
|
-
massKg: 40
|
|
43847
|
+
massKg: 40,
|
|
43848
|
+
fixed: true
|
|
43692
43849
|
},
|
|
43693
43850
|
{
|
|
43694
43851
|
id: "sink_bathroom",
|
|
@@ -43698,7 +43855,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
43698
43855
|
h: 1.05,
|
|
43699
43856
|
y: 0,
|
|
43700
43857
|
solid: true,
|
|
43701
|
-
massKg: 25
|
|
43858
|
+
massKg: 25,
|
|
43859
|
+
fixed: true
|
|
43702
43860
|
},
|
|
43703
43861
|
{
|
|
43704
43862
|
id: "shower",
|
|
@@ -43708,7 +43866,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
43708
43866
|
h: 2.1,
|
|
43709
43867
|
y: 0,
|
|
43710
43868
|
solid: true,
|
|
43711
|
-
massKg: 90
|
|
43869
|
+
massKg: 90,
|
|
43870
|
+
fixed: true
|
|
43712
43871
|
},
|
|
43713
43872
|
{
|
|
43714
43873
|
id: "toilet",
|
|
@@ -43718,7 +43877,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
43718
43877
|
h: 0.8,
|
|
43719
43878
|
y: 0,
|
|
43720
43879
|
solid: true,
|
|
43721
|
-
massKg: 30
|
|
43880
|
+
massKg: 30,
|
|
43881
|
+
fixed: true
|
|
43722
43882
|
},
|
|
43723
43883
|
{
|
|
43724
43884
|
id: "utility_sink",
|
|
@@ -43728,7 +43888,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
43728
43888
|
h: 1.2,
|
|
43729
43889
|
y: 0,
|
|
43730
43890
|
solid: true,
|
|
43731
|
-
massKg: 25
|
|
43891
|
+
massKg: 25,
|
|
43892
|
+
fixed: true
|
|
43732
43893
|
},
|
|
43733
43894
|
{
|
|
43734
43895
|
id: "wall_socket",
|
|
@@ -43758,7 +43919,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
43758
43919
|
h: 6.5,
|
|
43759
43920
|
y: 0,
|
|
43760
43921
|
solid: true,
|
|
43761
|
-
massKg:
|
|
43922
|
+
massKg: 320,
|
|
43923
|
+
fixed: true
|
|
43762
43924
|
},
|
|
43763
43925
|
{
|
|
43764
43926
|
id: "service_mast",
|
|
@@ -46710,7 +46872,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
46710
46872
|
}
|
|
46711
46873
|
var residentialTower = residentialTowerTemplate();
|
|
46712
46874
|
|
|
46713
|
-
// ../game-floorplan-three/dist/chunk-
|
|
46875
|
+
// ../game-floorplan-three/dist/chunk-Z3IBCX7E.js
|
|
46714
46876
|
var __defProp3 = Object.defineProperty;
|
|
46715
46877
|
var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp3(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
|
|
46716
46878
|
var __publicField = (obj, key2, value) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
|
|
@@ -54380,7 +54542,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
54380
54542
|
w = Math.min(w, 0.5);
|
|
54381
54543
|
d = Math.min(d, 0.5);
|
|
54382
54544
|
}
|
|
54383
|
-
inter().objs.push({ f: M.floor, cx: m.x, cz: m.z, c: Math.cos(M.ry), s: Math.sin(M.ry), hw: w / 2, hd: d / 2, type: m.type });
|
|
54545
|
+
inter().objs.push({ f: M.floor, cx: m.x, cz: m.z, c: Math.cos(M.ry), s: Math.sin(M.ry), hw: w / 2, hd: d / 2, h, type: m.type });
|
|
54384
54546
|
}
|
|
54385
54547
|
function objectDistance(o, x, z) {
|
|
54386
54548
|
const dx = x - o.cx, dz = z - o.cz, lx = dx * o.c - dz * o.s, lz = dx * o.s + dz * o.c, ex = Math.abs(lx) - o.hw, ez = Math.abs(lz) - o.hd;
|
|
@@ -57172,11 +57334,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
57172
57334
|
drop(partId) {
|
|
57173
57335
|
const hosts = [...new Set([views.get(partId), ...[...views.values()].filter((view) => view.parts.includes(partId))].filter((v) => !!v))];
|
|
57174
57336
|
if (!hosts.length && lod === 0 && riders(partId).length > 0) {
|
|
57175
|
-
const
|
|
57176
|
-
if (
|
|
57177
|
-
cut(
|
|
57178
|
-
views.set(partId,
|
|
57179
|
-
hosts.push(
|
|
57337
|
+
const made2 = newView(partId);
|
|
57338
|
+
if (made2) {
|
|
57339
|
+
cut(made2);
|
|
57340
|
+
views.set(partId, made2);
|
|
57341
|
+
hosts.push(made2);
|
|
57180
57342
|
}
|
|
57181
57343
|
}
|
|
57182
57344
|
for (const host of hosts) {
|
|
@@ -58338,11 +58500,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
58338
58500
|
let batcher = null;
|
|
58339
58501
|
let changedAt = Number.NEGATIVE_INFINITY;
|
|
58340
58502
|
const make3 = () => {
|
|
58341
|
-
const
|
|
58342
|
-
|
|
58343
|
-
|
|
58344
|
-
markKitOrigin(
|
|
58345
|
-
return
|
|
58503
|
+
const made2 = createStaticBatcher(THREE, root, { shadowOnly: true, queue, budgetMs: HOUSE_SHADOW_BUDGET_MS, maxVertices: HOUSE_SHADOW_BATCH_VERTICES, include: (mesh2) => mesh2.userData.noShadowBatch !== true });
|
|
58504
|
+
made2.group.name = "house-shadow-batches";
|
|
58505
|
+
made2.group.userData.noSurfaceRay = true;
|
|
58506
|
+
markKitOrigin(made2.group, { owner: "game-floorplan-three", kind: "structure", id: root.name || "house" });
|
|
58507
|
+
return made2;
|
|
58346
58508
|
};
|
|
58347
58509
|
return {
|
|
58348
58510
|
update() {
|
|
@@ -58606,7 +58768,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
58606
58768
|
c.aabb = [c.x0, c.z0, c.x1, c.z1];
|
|
58607
58769
|
if (c.type === "wall") c.damageable = tagDamage("masonry");
|
|
58608
58770
|
}
|
|
58609
|
-
const colliders = shared2.ctx.colliders.concat(shared2.inter.objs.map((o) => ({ type: "furniture", f: o.f, obb: { cx: o.cx, cz: o.cz, hw: o.hw, hd: o.hd, c: o.c, s: o.s }, item: o.type, off: false })));
|
|
58771
|
+
const colliders = shared2.ctx.colliders.concat(shared2.inter.objs.map((o) => ({ type: "furniture", f: o.f, obb: { cx: o.cx, cz: o.cz, hw: o.hw, hd: o.hd, c: o.c, s: o.s }, item: o.type, off: false, ...o.h !== void 0 ? { h: o.h } : {} })));
|
|
58610
58772
|
const parts2 = {}, setOpen = (def, t) => {
|
|
58611
58773
|
def.target = t;
|
|
58612
58774
|
def.t = t;
|
|
@@ -59159,8 +59321,51 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59159
59321
|
installBuildBuild(K, shared2);
|
|
59160
59322
|
return buildApi(K, shared2);
|
|
59161
59323
|
}
|
|
59324
|
+
var STRUCTURE_SKIN = {
|
|
59325
|
+
wood_hard: 0.018,
|
|
59326
|
+
wood_soft: 0.018,
|
|
59327
|
+
plywood: 0.015,
|
|
59328
|
+
mdf: 0.018,
|
|
59329
|
+
plastic: 4e-3,
|
|
59330
|
+
rubber: 5e-3,
|
|
59331
|
+
steel: 12e-4,
|
|
59332
|
+
aluminium: 2e-3,
|
|
59333
|
+
cast_iron: 6e-3,
|
|
59334
|
+
copper: 1e-3,
|
|
59335
|
+
glass: 5e-3,
|
|
59336
|
+
tempered_glass: 6e-3,
|
|
59337
|
+
ceramic: 8e-3
|
|
59338
|
+
};
|
|
59339
|
+
var FOAM_DENSITY = 30;
|
|
59340
|
+
var FABRIC_DENSITY = 400;
|
|
59341
|
+
var UPHOLSTERY_COVER = 3e-3;
|
|
59342
|
+
var shellFraction = (shape, skin) => {
|
|
59343
|
+
if (shape.kind === "box") {
|
|
59344
|
+
const [a, b, c] = shape.size;
|
|
59345
|
+
const inner = Math.max(0, a - 2 * skin) * Math.max(0, b - 2 * skin) * Math.max(0, c - 2 * skin);
|
|
59346
|
+
return 1 - inner / (a * b * c);
|
|
59347
|
+
}
|
|
59348
|
+
if (shape.kind === "cylinder") {
|
|
59349
|
+
const { radius: r, height: h } = shape;
|
|
59350
|
+
const inner = Math.max(0, r - skin) ** 2 * Math.max(0, h - 2 * skin);
|
|
59351
|
+
return 1 - inner / (r * r * h);
|
|
59352
|
+
}
|
|
59353
|
+
return 1 - (Math.max(0, shape.radius - skin) / shape.radius) ** 3;
|
|
59354
|
+
};
|
|
59355
|
+
var thinnest = (shape) => shape.kind === "box" ? Math.min(...shape.size) : shape.kind === "cylinder" ? Math.min(shape.radius * 2, shape.height) : shape.radius * 2;
|
|
59356
|
+
function structureFill(material, shape) {
|
|
59357
|
+
if (material === "fabric") {
|
|
59358
|
+
if (thinnest(shape) <= 4 * UPHOLSTERY_COVER) return 1;
|
|
59359
|
+
const cover = shellFraction(shape, UPHOLSTERY_COVER);
|
|
59360
|
+
return cover + (1 - cover) * (FOAM_DENSITY / FABRIC_DENSITY);
|
|
59361
|
+
}
|
|
59362
|
+
const skin = STRUCTURE_SKIN[material];
|
|
59363
|
+
if (skin === void 0 || thinnest(shape) <= 3 * skin) return 1;
|
|
59364
|
+
return shellFraction(shape, skin);
|
|
59365
|
+
}
|
|
59162
59366
|
var HOLD_REACH2 = 0.05;
|
|
59163
59367
|
var BACK_TOUCH = 0.02;
|
|
59368
|
+
var AGAINST_WALL = 0.1;
|
|
59164
59369
|
var SOFT = /* @__PURE__ */ new Set(["fabric", "paper", "foliage"]);
|
|
59165
59370
|
var gapOf = (a, b) => Math.max(0, ...[0, 1, 2].map((k) => Math.max(a.min[k] - b.max[k], b.min[k] - a.max[k])));
|
|
59166
59371
|
function groupsOf(parts2, joints) {
|
|
@@ -59204,10 +59409,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59204
59409
|
const groups = groupsOf(parts2, joints).map((ids) => ids.map((id) => byId.get(id))).sort((a, b) => b.length - a.length);
|
|
59205
59410
|
const [main, ...rest2] = groups;
|
|
59206
59411
|
if (!main) return;
|
|
59412
|
+
const mainHeld = main.some((part) => part.anchored);
|
|
59207
59413
|
for (const group of rest2) {
|
|
59208
59414
|
if (standsAlone(group, boxOf3)) continue;
|
|
59209
59415
|
const joint = nearestJoint(group, main, boxOf3, Infinity);
|
|
59210
|
-
if (joint) joints.push(joint);
|
|
59416
|
+
if (joint) joints.push(mainHeld && group.some((part) => part.anchored) ? { ...joint, tears: true } : joint);
|
|
59211
59417
|
}
|
|
59212
59418
|
}
|
|
59213
59419
|
function holdLooseGroups(params) {
|
|
@@ -59230,7 +59436,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59230
59436
|
changed = true;
|
|
59231
59437
|
continue;
|
|
59232
59438
|
}
|
|
59233
|
-
const
|
|
59439
|
+
const againstWall = held.length === 0 || held.some((part) => boxOf3(part.id).min[2] <= back + AGAINST_WALL);
|
|
59440
|
+
const onWall = againstWall ? group.filter((part) => !SOFT.has(part.material) && boxOf3(part.id).min[2] <= back + BACK_TOUCH) : [];
|
|
59234
59441
|
if (onWall.length === 0) continue;
|
|
59235
59442
|
for (const part of onWall) part.anchored = true;
|
|
59236
59443
|
changed = true;
|
|
@@ -59270,7 +59477,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59270
59477
|
if (carcassed) return tops;
|
|
59271
59478
|
for (let i = drawn.length - 1; i >= 0; i--) {
|
|
59272
59479
|
const p = drawn[i];
|
|
59273
|
-
if (p.key !== "wood" || materialOf.wood !== "wood_hard" || p.shape.kind !== "box" || p.rotation) continue;
|
|
59480
|
+
if (p.material || p.key !== "wood" || materialOf.wood !== "wood_hard" || p.shape.kind !== "box" || p.rotation) continue;
|
|
59274
59481
|
const [sx, sy, sz] = p.shape.size;
|
|
59275
59482
|
const across2 = sx < sz ? 0 : 2;
|
|
59276
59483
|
const width = Math.min(sx, sz);
|
|
@@ -59293,14 +59500,106 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59293
59500
|
}
|
|
59294
59501
|
return tops;
|
|
59295
59502
|
}
|
|
59296
|
-
|
|
59297
|
-
|
|
59503
|
+
var CASES = /^(tv_unit|tv_unit_small|tv_unit_large|sideboard|china_cabinet|pantry|laundry_cabinet|wardrobe|wardrobe_small|wardrobe_large|closet_wardrobe|kitchen_cabinet|kitchen_cabinet_large|kitchen_cabinet_small|display_stand|dresser|nightstand|console_table|vanity_table)$/;
|
|
59504
|
+
var DRAWER_CASES = /^(dresser|nightstand|console_table|vanity_table)$/;
|
|
59505
|
+
var CASE_BODY_MIN = 0.2;
|
|
59506
|
+
var FRONT_THICK = 0.03;
|
|
59507
|
+
var FRONT_REACH = 0.03;
|
|
59508
|
+
var CASE_BOARD = 0.018;
|
|
59509
|
+
var CASE_BACK = 6e-3;
|
|
59510
|
+
var DRAWER_SIDE = 0.012;
|
|
59511
|
+
var DRAWER_BOTTOM = 6e-3;
|
|
59512
|
+
var SHELF_PITCH = 0.45;
|
|
59513
|
+
var WARDROBES = /wardrobe/;
|
|
59514
|
+
var HANGING_SHELF_DROP = 0.35;
|
|
59515
|
+
function board(body, suffix, material, min, max, color2 = body.color) {
|
|
59516
|
+
const size = [max[0] - min[0], max[1] - min[1], max[2] - min[2]];
|
|
59517
|
+
const position = [(min[0] + max[0]) / 2, (min[1] + max[1]) / 2, (min[2] + max[2]) / 2];
|
|
59518
|
+
return { id: `${body.id}_${suffix}`, key: body.key, material, shape: { kind: "box", size }, position, rotation: null, color: color2, min, max };
|
|
59519
|
+
}
|
|
59520
|
+
function hollowCases(drawn, type) {
|
|
59521
|
+
const made2 = /* @__PURE__ */ new Set();
|
|
59522
|
+
if (!CASES.test(type)) return made2;
|
|
59523
|
+
const drawers = DRAWER_CASES.test(type);
|
|
59524
|
+
for (let i = drawn.length - 1; i >= 0; i--) {
|
|
59525
|
+
const body = drawn[i];
|
|
59526
|
+
if (body.key !== "wood" && body.key !== "plain" || body.shape.kind !== "box" || body.rotation) continue;
|
|
59527
|
+
const [sx, sy, sz] = body.shape.size;
|
|
59528
|
+
if (Math.min(sx, sy, sz) < CASE_BODY_MIN) continue;
|
|
59529
|
+
const fronts = drawn.filter((p) => {
|
|
59530
|
+
if (p === body || p.shape.kind !== "box" || p.rotation || p.key !== "wood" && p.key !== "plain") return false;
|
|
59531
|
+
const thick = p.max[2] - p.min[2];
|
|
59532
|
+
if (thick > FRONT_THICK || thick >= p.max[0] - p.min[0] || thick >= p.max[1] - p.min[1]) return false;
|
|
59533
|
+
const cx = (p.min[0] + p.max[0]) / 2;
|
|
59534
|
+
const cy = (p.min[1] + p.max[1]) / 2;
|
|
59535
|
+
return Math.abs(p.min[2] - body.max[2]) <= FRONT_REACH && cx > body.min[0] && cx < body.max[0] && cy > body.min[1] && cy < body.max[1];
|
|
59536
|
+
});
|
|
59537
|
+
if (fronts.length === 0) continue;
|
|
59538
|
+
const [x0, y0, z0] = body.min;
|
|
59539
|
+
const [x1, y1, z1] = body.max;
|
|
59540
|
+
const T2 = CASE_BOARD;
|
|
59541
|
+
const zi = z0 + CASE_BACK;
|
|
59542
|
+
const inner = 0.92;
|
|
59543
|
+
const tone = (k) => {
|
|
59544
|
+
const c = (s) => Math.min(255, Math.round((body.color >> s & 255) * k)) << s;
|
|
59545
|
+
return c(16) | c(8) | c(0);
|
|
59546
|
+
};
|
|
59547
|
+
const boards = [
|
|
59548
|
+
board(body, "back", "plywood", [x0, y0, z0], [x1, y1, zi], tone(0.8)),
|
|
59549
|
+
board(body, "side_l", "mdf", [x0, y0, zi], [x0 + T2, y1, z1]),
|
|
59550
|
+
board(body, "side_r", "mdf", [x1 - T2, y0, zi], [x1, y1, z1]),
|
|
59551
|
+
board(body, "top", "mdf", [x0 + T2, y1 - T2, zi], [x1 - T2, y1, z1]),
|
|
59552
|
+
board(body, "bottom", "mdf", [x0 + T2, y0, zi], [x1 - T2, y0 + T2, z1], tone(inner))
|
|
59553
|
+
];
|
|
59554
|
+
const ix0 = x0 + T2;
|
|
59555
|
+
const ix1 = x1 - T2;
|
|
59556
|
+
const iy0 = y0 + T2;
|
|
59557
|
+
const iy1 = y1 - T2;
|
|
59558
|
+
if (drawers) {
|
|
59559
|
+
const stack = [...fronts].sort((a, b) => a.min[1] - b.min[1]);
|
|
59560
|
+
stack.forEach((front, k) => {
|
|
59561
|
+
const dy0 = Math.max(front.min[1] + 0.01, iy0 + 2e-3);
|
|
59562
|
+
const dy1 = Math.min(front.max[1] - 0.02, iy1 - 2e-3);
|
|
59563
|
+
const dz0 = zi + 0.01;
|
|
59564
|
+
const dz1 = front.min[2];
|
|
59565
|
+
if (dy1 - dy0 < 0.04 || dz1 - dz0 < 0.1) return;
|
|
59566
|
+
const a = ix0 + 2e-3;
|
|
59567
|
+
const b = ix1 - 2e-3;
|
|
59568
|
+
boards.push(
|
|
59569
|
+
board(body, `drawer${k}_side_l`, "mdf", [a, dy0, dz0], [a + DRAWER_SIDE, dy1, dz1], tone(inner)),
|
|
59570
|
+
board(body, `drawer${k}_side_r`, "mdf", [b - DRAWER_SIDE, dy0, dz0], [b, dy1, dz1], tone(inner)),
|
|
59571
|
+
board(body, `drawer${k}_back`, "mdf", [a + DRAWER_SIDE, dy0, dz0], [b - DRAWER_SIDE, dy1, dz0 + DRAWER_SIDE], tone(inner)),
|
|
59572
|
+
board(body, `drawer${k}_bottom`, "mdf", [a + DRAWER_SIDE, dy0, dz0 + DRAWER_SIDE], [b - DRAWER_SIDE, dy0 + DRAWER_BOTTOM, dz1], tone(inner))
|
|
59573
|
+
);
|
|
59574
|
+
const above = stack[k + 1];
|
|
59575
|
+
if (!above) return;
|
|
59576
|
+
const mid = (front.max[1] + above.min[1]) / 2;
|
|
59577
|
+
if (above.min[1] - front.max[1] < T2 || mid - T2 / 2 < dy1 || mid + T2 / 2 > iy1) return;
|
|
59578
|
+
boards.push(board(body, `rail${k}`, "mdf", [ix0, mid - T2 / 2, zi], [ix1, mid + T2 / 2, z1], tone(inner)));
|
|
59579
|
+
});
|
|
59580
|
+
} else {
|
|
59581
|
+
const height = iy1 - iy0;
|
|
59582
|
+
const count = Math.max(0, Math.round(height / SHELF_PITCH) - 1);
|
|
59583
|
+
const levels = WARDROBES.test(type) ? [iy1 - HANGING_SHELF_DROP] : Array.from({ length: count }, (_, k) => iy0 + (k + 1) * height / (count + 1));
|
|
59584
|
+
levels.forEach((y, k) => boards.push(board(body, `shelf${k}`, "mdf", [ix0, y - T2 / 2, zi], [ix1, y + T2 / 2, z1 - 0.02], tone(inner))));
|
|
59585
|
+
}
|
|
59586
|
+
for (const front of fronts) front.material = "mdf";
|
|
59587
|
+
drawn.splice(i, 1, ...boards);
|
|
59588
|
+
for (const b of boards) made2.add(b.id);
|
|
59589
|
+
}
|
|
59590
|
+
return made2;
|
|
59591
|
+
}
|
|
59592
|
+
function shadeBoard(color2, board2) {
|
|
59593
|
+
const k = [1, 0.94, 1.05, 0.97, 1.03][board2 % 5];
|
|
59298
59594
|
const channel = (shift) => Math.min(255, Math.round((color2 >> shift & 255) * k)) << shift;
|
|
59299
59595
|
return channel(16) | channel(8) | channel(0);
|
|
59300
59596
|
}
|
|
59301
59597
|
var FLOOR_TOUCH2 = 5e-3;
|
|
59302
59598
|
var LOOSE = /* @__PURE__ */ new Set(["paper"]);
|
|
59303
|
-
var PLANTED = /* @__PURE__ */ new Set(["mailbox", "correio", "clothesline", "tree_small", "bbq_simple"]);
|
|
59599
|
+
var PLANTED = /* @__PURE__ */ new Set(["mailbox", "correio", "clothesline", "tree_small", "fruit_tree", "bbq_simple"]);
|
|
59600
|
+
var INSTALLED = /* @__PURE__ */ new Set(["toilet", "washbasin", "pedestal_basin", "shower", "shower_large", "laundry_tub"]);
|
|
59601
|
+
var WEIGHTED_FOOT = /* @__PURE__ */ new Set(["floor_lamp"]);
|
|
59602
|
+
var FOOT_MATERIAL = "cast_iron";
|
|
59304
59603
|
var BASE_MATERIAL = {
|
|
59305
59604
|
wood: "wood_hard",
|
|
59306
59605
|
metal: "steel",
|
|
@@ -59376,13 +59675,18 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59376
59675
|
};
|
|
59377
59676
|
run(A);
|
|
59378
59677
|
if (!drawn.length) throw new Error(`game-floorplan-three: the builder of "${name}" drew no box or cylinder`);
|
|
59678
|
+
hollowCases(drawn, name);
|
|
59379
59679
|
const boardsOf = splitTopsIntoBoards(drawn, materialOf, Boolean(opts.carcass));
|
|
59380
59680
|
const parts2 = drawn.map((p) => {
|
|
59381
59681
|
const thin = Math.min(...p.shape.kind === "box" ? p.shape.size : p.shape.kind === "cylinder" ? [p.shape.radius * 2, p.shape.height] : [p.shape.radius * 2]);
|
|
59382
|
-
let material = materialOf[p.key] ?? "plastic";
|
|
59383
|
-
if (p.
|
|
59682
|
+
let material = p.material ?? materialOf[p.key] ?? "plastic";
|
|
59683
|
+
if (p.material) {
|
|
59684
|
+
} else if (p.key === "wood" && material === "wood_hard" && opts.carcass && !opts.materials?.wood) material = "mdf";
|
|
59384
59685
|
else if (p.key === "wood" && material === "wood_hard" && thin < WOOD_THIN) material = "wood_soft";
|
|
59686
|
+
if (WEIGHTED_FOOT.has(name) && p.key === "metal" && p.min[1] <= FLOOR_TOUCH2) material = FOOT_MATERIAL;
|
|
59385
59687
|
const part = { id: p.id, material, shape: p.shape, position: p.position };
|
|
59688
|
+
const fill2 = structureFill(material, p.shape);
|
|
59689
|
+
if (fill2 < 1) part.fill = Math.round(fill2 * 1e4) / 1e4;
|
|
59386
59690
|
if (p.rotation) part.rotation = p.rotation;
|
|
59387
59691
|
if (!LOOSE.has(material) && p.min[1] <= FLOOR_TOUCH2) part.anchored = true;
|
|
59388
59692
|
if (opts.carcass && LOOSE.has(material)) {
|
|
@@ -59412,7 +59716,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59412
59716
|
const wallMounted = parts2.some((part) => part.anchored && low(part) > FLOOR_TOUCH2);
|
|
59413
59717
|
const sunk = parts2.some((part) => low(part) < -FLOOR_TOUCH2);
|
|
59414
59718
|
const rooted = parts2.some((part) => part.material === "foliage") && parts2.some((part) => part.material.startsWith("wood") && low(part) <= FLOOR_TOUCH2);
|
|
59415
|
-
const fixed = wallMounted || sunk || rooted || PLANTED.has(name);
|
|
59719
|
+
const fixed = wallMounted || sunk || rooted || PLANTED.has(name) || INSTALLED.has(name);
|
|
59416
59720
|
const all = drawn.reduce(
|
|
59417
59721
|
(m, p) => ({ x0: Math.min(m.x0, p.min[0]), x1: Math.max(m.x1, p.max[0]), z0: Math.min(m.z0, p.min[2]), z1: Math.max(m.z1, p.max[2]) }),
|
|
59418
59722
|
{ x0: Infinity, x1: -Infinity, z0: Infinity, z1: -Infinity }
|
|
@@ -59481,7 +59785,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59481
59785
|
const root = { x: seed, z: 0, ry: 0, w, d, h, y: 0, base: 0, palette: o.palette, seed: `furniture_${type}_${seed}` };
|
|
59482
59786
|
const { K, shared: shared2 } = renderer.internals;
|
|
59483
59787
|
const before = K.PARTS.length;
|
|
59484
|
-
const
|
|
59788
|
+
const made2 = recordSpec(
|
|
59485
59789
|
THREE,
|
|
59486
59790
|
type,
|
|
59487
59791
|
root,
|
|
@@ -59500,7 +59804,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59500
59804
|
);
|
|
59501
59805
|
const spouts = K.PARTS.slice(before).filter((p) => p.type === "water_tap").map((p) => [p.pos[0] - root.x, p.pos[1], p.pos[2] - root.z]);
|
|
59502
59806
|
K.PARTS.length = before;
|
|
59503
|
-
return { spec:
|
|
59807
|
+
return { spec: made2.spec, build: made2.build, top: made2.top, size: { w, d, h }, spouts, fixed: made2.fixed };
|
|
59504
59808
|
}
|
|
59505
59809
|
|
|
59506
59810
|
// src/area-layout.ts
|
|
@@ -59794,12 +60098,19 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59794
60098
|
const spec = model === void 0 || !itemMakeup(model) ? void 0 : makeupSpec(model);
|
|
59795
60099
|
return spec ? { spec: () => structuredClone(spec) } : {};
|
|
59796
60100
|
};
|
|
60101
|
+
const usesOf = (def) => {
|
|
60102
|
+
const use = options.itemUse?.(def);
|
|
60103
|
+
const liquid = sealOf(def, fluidOf({ ...def.model === void 0 ? {} : { model: def.model }, size: def.size, weight: def.weight }));
|
|
60104
|
+
if (!use) return liquid;
|
|
60105
|
+
const edible2 = def.category === "food" || def.category === "drink";
|
|
60106
|
+
return { ...liquid, ...liquid.fluid && !edible2 ? { fluid: { ...liquid.fluid, uses: ["pour", "pour_out"] } } : {}, use };
|
|
60107
|
+
};
|
|
59797
60108
|
const itemOf = (def) => ({
|
|
59798
60109
|
id: `${ITEM_PREFIX}${def.id}`,
|
|
59799
60110
|
name: nameOf(def),
|
|
59800
60111
|
movable: true,
|
|
59801
60112
|
thumbnail: itemThumbnailSvg(drawable(def)),
|
|
59802
|
-
...
|
|
60113
|
+
...usesOf(def),
|
|
59803
60114
|
// an item with a make-up (a shovel: ash handle riveted to a steel blade) is that spec, not the parts guessed from its meshes
|
|
59804
60115
|
...makeupSpecOf(def.model),
|
|
59805
60116
|
// an item that is also a tool of the arsenal (a shovel) is picked up as that tool
|