@adatechnology/game-interactables-household 0.8.7 → 0.9.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.
@@ -12047,6 +12047,12 @@ var GameInteractablesHousehold = (() => {
12047
12047
  material: "glass",
12048
12048
  thickness: 3e-3
12049
12049
  }
12050
+ ],
12051
+ container: {
12052
+ capacityLiters: 0.3
12053
+ },
12054
+ estimated: [
12055
+ "container"
12050
12056
  ]
12051
12057
  },
12052
12058
  {
@@ -12298,8 +12304,17 @@ var GameInteractablesHousehold = (() => {
12298
12304
  }
12299
12305
  ],
12300
12306
  estimated: [
12301
- "parts"
12302
- ]
12307
+ "parts",
12308
+ "consumable"
12309
+ ],
12310
+ consumable: {
12311
+ form: "liquid",
12312
+ unit: "ml",
12313
+ amount: 450,
12314
+ dose: 5,
12315
+ emptyKg: 0.03,
12316
+ density: 1.03
12317
+ }
12303
12318
  },
12304
12319
  {
12305
12320
  id: "bleach",
@@ -13789,8 +13804,12 @@ var GameInteractablesHousehold = (() => {
13789
13804
  thickness: 2e-3
13790
13805
  }
13791
13806
  ],
13807
+ container: {
13808
+ capacityLiters: 0.35
13809
+ },
13792
13810
  estimated: [
13793
- "parts"
13811
+ "parts",
13812
+ "container"
13794
13813
  ]
13795
13814
  },
13796
13815
  {
@@ -13937,6 +13956,41 @@ var GameInteractablesHousehold = (() => {
13937
13956
  },
13938
13957
  weapon: "brass_knuckles",
13939
13958
  model: "brass_knuckles"
13959
+ },
13960
+ {
13961
+ id: "plunger",
13962
+ category: "tools",
13963
+ kind: "tool",
13964
+ tags: [
13965
+ "cleaning"
13966
+ ],
13967
+ tools: [
13968
+ "plunger"
13969
+ ],
13970
+ size: [
13971
+ 0.14,
13972
+ 0.55,
13973
+ 0.14
13974
+ ],
13975
+ weight: 0.45,
13976
+ stack: 1,
13977
+ shape: "tool",
13978
+ color: 11545120,
13979
+ rarity: "common",
13980
+ finds: {
13981
+ places: [
13982
+ "house",
13983
+ "apartment"
13984
+ ]
13985
+ },
13986
+ parts: [
13987
+ {
13988
+ id: "body",
13989
+ material: "rubber",
13990
+ thickness: 4e-3
13991
+ }
13992
+ ],
13993
+ model: "plunger"
13940
13994
  }
13941
13995
  ];
13942
13996
  var kinds_default = [
@@ -15620,6 +15674,14 @@ var GameInteractablesHousehold = (() => {
15620
15674
  "alicate"
15621
15675
  ]
15622
15676
  },
15677
+ plunger: {
15678
+ created: true,
15679
+ idSource: "decision",
15680
+ sizeSource: "REF",
15681
+ vc3: [
15682
+ "desentupidor"
15683
+ ]
15684
+ },
15623
15685
  adjustable_wrench: {
15624
15686
  ite: "chave_inglesa",
15625
15687
  idSource: "decision",
@@ -19039,6 +19101,7 @@ var GameInteractablesHousehold = (() => {
19039
19101
  "item.toothbrush": "Toothbrush",
19040
19102
  "item.deodorant": "Deodorant",
19041
19103
  "item.toilet_paper": "Toilet paper",
19104
+ "item.plunger": "Toilet plunger",
19042
19105
  "item.towel": "Towel",
19043
19106
  "item.detergent": "Detergent",
19044
19107
  "item.bleach": "Bleach",
@@ -19547,6 +19610,7 @@ var GameInteractablesHousehold = (() => {
19547
19610
  "item.toothbrush": "Escova de dente",
19548
19611
  "item.deodorant": "Desodorante",
19549
19612
  "item.toilet_paper": "Papel higi\xEAnico",
19613
+ "item.plunger": "Desentupidor",
19550
19614
  "item.towel": "Toalha",
19551
19615
  "item.detergent": "Detergente",
19552
19616
  "item.bleach": "\xC1gua sanit\xE1ria",
@@ -19847,7 +19911,7 @@ var GameInteractablesHousehold = (() => {
19847
19911
  },
19848
19912
  toilet: {
19849
19913
  body: { material: "ceramic", joint: "bolt" },
19850
- parts: [["lid", door("plastic", "hinge", "lid")], ["flush_button", { material: "plastic", joint: "clip", piece: "button" }]]
19914
+ parts: [["lid", door("plastic", "hinge", "lid")], ["seat_ring", door("plastic", "hinge", "lid")], ["flush_button", { material: "plastic", joint: "clip", piece: "button" }]]
19851
19915
  },
19852
19916
  wall_socket: { body: { material: "plastic", joint: "screw" }, parts: [] },
19853
19917
  wall_switch: { body: { material: "plastic", joint: "screw" }, parts: [["rocker", { material: "plastic", joint: "clip", piece: "rocker" }]] },
@@ -20206,7 +20270,8 @@ var GameInteractablesHousehold = (() => {
20206
20270
  return out;
20207
20271
  }
20208
20272
  /**
20209
- * Container with its inner volume given by two corners. Explicit `item.contents[id]` wins over the loot table.
20273
+ * Container with its inner volume given by two corners. Explicit `item.contents[id]` wins over the loot table, slot by slot over the builder's own `contents`
20274
+ * (what the piece always comes with: the soap and shampoo on a shower's shelf), which stays in every slot the explicit list leaves empty.
20210
20275
  * Slots are validated lazily by the tests, not here.
20211
20276
  */
20212
20277
  container(o) {
@@ -20221,9 +20286,9 @@ var GameInteractablesHousehold = (() => {
20221
20286
  if (o.access) c.access = o.access;
20222
20287
  if (o.loot) c.loot = o.loot;
20223
20288
  const given = this.M.contents?.[o.id];
20224
- if (given) {
20289
+ if (given || o.contents) {
20225
20290
  c.contents = o.slots.map((_, i) => {
20226
- const g = given[i];
20291
+ const g = given?.[i] ?? o.contents?.[i];
20227
20292
  if (!g) return null;
20228
20293
  const s = { type: g.type, qty: g.qty };
20229
20294
  if (g.data) s.data = { ...g.data };
@@ -21160,6 +21225,9 @@ var GameInteractablesHousehold = (() => {
21160
21225
  "prompt.toilet_lid": "Toilet lid",
21161
21226
  "prompt.toilet_lid.open": "Close the lid",
21162
21227
  "prompt.toilet_lid.closed": "Lift the lid",
21228
+ "prompt.toilet_seat": "Toilet seat",
21229
+ "prompt.toilet_seat.open": "Lower the seat",
21230
+ "prompt.toilet_seat.closed": "Lift the seat",
21163
21231
  "prompt.switch": "Light switch",
21164
21232
  "prompt.switch.on": "Switch off",
21165
21233
  "prompt.switch.on.verb": "Switch off",
@@ -21420,6 +21488,9 @@ var GameInteractablesHousehold = (() => {
21420
21488
  "prompt.toilet_lid": "Tampa do vaso",
21421
21489
  "prompt.toilet_lid.open": "Fechar a tampa",
21422
21490
  "prompt.toilet_lid.closed": "Levantar a tampa",
21491
+ "prompt.toilet_seat": "Assento do vaso",
21492
+ "prompt.toilet_seat.open": "Abaixar o assento",
21493
+ "prompt.toilet_seat.closed": "Levantar o assento",
21423
21494
  "prompt.switch": "Interruptor",
21424
21495
  "prompt.switch.on": "Desligar a luz",
21425
21496
  "prompt.switch.on.verb": "Desligar",
@@ -22832,6 +22903,69 @@ var GameInteractablesHousehold = (() => {
22832
22903
  var STOVE_WALL_GAP = 0.04;
22833
22904
  var STEEL = 11843772;
22834
22905
  var CHROME = 13817562;
22906
+ var DISHES = ["plate", "bowl", "cup", "wine_glass", "cutlery", "knife", "pot", "pan"];
22907
+ var DISH_NEEDS = ["detergent", "sponge"];
22908
+ var DIRTY_PLATE = 0.8;
22909
+ var DIRTY_CUP = 0.5;
22910
+ var DIRTY_CUTLERY = 0.6;
22911
+ function goodsSize(id) {
22912
+ const item = GOODS_ITEMS.find((candidate) => candidate.id === id);
22913
+ if (!item) throw new Error(`game-interactables-household: the sinks lay "${id}", which the goods catalogue does not have`);
22914
+ return [item.size[0], item.size[1], item.size[2]];
22915
+ }
22916
+ var laid = (type, data) => ({ stack: { type, qty: 1, ...data ? { data } : {} }, size: goodsSize(type) });
22917
+ var LAY_GAP = 5e-3;
22918
+ function layOnFloor(area, things) {
22919
+ const slots = [];
22920
+ const contents = [];
22921
+ const left = [];
22922
+ let x = area.x0;
22923
+ let z = area.z0;
22924
+ let row = 0;
22925
+ const fits = (w, d, atX, atZ) => atX + w + 2 * LAY_GAP <= area.x1 + 1e-9 && atZ + d + 2 * LAY_GAP <= area.z1 + 1e-9;
22926
+ for (const thing of things) {
22927
+ const [w, h, d] = thing.size;
22928
+ if (!fits(w, d, x, z) && fits(w, d, area.x0, z + row)) [x, z, row] = [area.x0, z + row, 0];
22929
+ if (!fits(w, d, x, z)) {
22930
+ left.push(thing);
22931
+ continue;
22932
+ }
22933
+ const { stack } = thing;
22934
+ slots.push({ pos: [round3(x + LAY_GAP + w / 2), round3(area.y), round3(z + LAY_GAP + d / 2)], max: [w, h, d] });
22935
+ contents.push(stack);
22936
+ x += w + 2 * LAY_GAP;
22937
+ row = Math.max(row, d + 2 * LAY_GAP);
22938
+ }
22939
+ return { slots, contents, left };
22940
+ }
22941
+ var DIRTY_DISHES = [
22942
+ laid("plate", { dirt: DIRTY_PLATE }),
22943
+ laid("cup", { dirt: DIRTY_CUP }),
22944
+ laid("cutlery", { dirt: DIRTY_CUTLERY })
22945
+ ];
22946
+ var WASHING_THINGS = [
22947
+ laid("detergent"),
22948
+ laid("sponge"),
22949
+ laid("cup")
22950
+ ];
22951
+ function basinContents(c, basin, groups) {
22952
+ const laid2 = groups.map(({ things, area }) => layOnFloor({ ...area ?? { x0: basin.from[0], x1: basin.to[0], z0: basin.from[2], z1: basin.to[2] }, y: basin.from[1] }, things));
22953
+ c.container({ id: "in_basin", from: [...basin.from], to: [...basin.to], slots: laid2.flatMap((l) => l.slots), contents: laid2.flatMap((l) => l.contents) });
22954
+ return laid2.flatMap((l) => l.left);
22955
+ }
22956
+ function washDishes(c, basin, rack) {
22957
+ c.add("uses", {
22958
+ id: "wash_dishes",
22959
+ do: "wash",
22960
+ fixture: "tap",
22961
+ surface: "dishes",
22962
+ clip: "wash_dishes",
22963
+ label: "use.wash_dishes",
22964
+ needs: [...DISH_NEEDS],
22965
+ dose: { need: 0 },
22966
+ dishes: { ids: [...DISHES], basin: basin.id, rack }
22967
+ });
22968
+ }
22835
22969
  function tap2(c, x, y, z, id, partId, basin) {
22836
22970
  c.cyl("metal", x, y - 2e-3, z, 0.03, 0.022, STEEL, "cyl");
22837
22971
  c.cyl("metal", x, y + 0.02, z, 0.017, 0.19, CHROME, "cyl");
@@ -22853,6 +22987,8 @@ var GameInteractablesHousehold = (() => {
22853
22987
  c.add("fixtures", { id, kind: "tap", outlet, dir: [0, -1, 0], flow: 7, part: partId, tank: "auto" });
22854
22988
  c.add("emitters", { id: `${id}_water`, kind: "water", pos: outlet, dir: [0, -1, 0], source: id, size: 0.02, ...streamInto(basin, outlet) });
22855
22989
  c.interact(`use_${id}`, [round3(x + 0.05), round3(y + 0.126), round3(z)], { do: "toggle_fixture", fixture: id }, "prompt.tap", 1.3);
22990
+ c.add("uses", { id: `drink_${id}`, do: "drink", from: "vessel", fixture: id, clip: "drink", fillClip: "fill_cup", label: "use.drink_water" });
22991
+ c.add("uses", { id: `drink_hands_${id}`, do: "drink", from: "hands", fixture: id, clip: "drink_cupped_hands", label: "use.drink_from_hands" });
22856
22992
  return outlet;
22857
22993
  }
22858
22994
  function stove(c) {
@@ -23020,6 +23156,11 @@ var GameInteractablesHousehold = (() => {
23020
23156
  c.add("basins", basin);
23021
23157
  return basin;
23022
23158
  }
23159
+ function drainboardSpots(x0, x1, z0, z1, y) {
23160
+ const spots = [];
23161
+ for (const k of [0.7, 0.3]) for (const j of [0.2, 0.5, 0.8]) spots.push([round3(x0 + (x1 - x0) * j), round3(y), round3(z0 + (z1 - z0) * k)]);
23162
+ return spots;
23163
+ }
23023
23164
  var KITCHEN_BASIN_DEPTH = 0.2;
23024
23165
  var BATHROOM_BASIN_DEPTH = 0.14;
23025
23166
  var TAILPIECE_GAP = 2e-3;
@@ -23048,6 +23189,11 @@ var GameInteractablesHousehold = (() => {
23048
23189
  const basin = counterWithBasin(c, { top, bx0, bx1, bz0, bz1, depth: KITCHEN_BASIN_DEPTH, counter: 8157816, steel: true });
23049
23190
  for (let i = 0; i < 7; i++) c.b("metal", bx1 + 0.06, top, bz0 + 0.04 + i * 0.07, hw - 0.06, top + 4e-3, bz0 + 0.052 + i * 0.07, 10133154);
23050
23191
  tap2(c, (bx0 + bx1) / 2, top, -hd + 0.07, "tap", "tap_handle", basin);
23192
+ washDishes(c, basin, drainboardSpots(bx1 + 0.06, hw - 0.06, bz0 + 0.04, bz0 + 0.04 + 6 * 0.07 + 0.012, top + 5e-3));
23193
+ const counter = { x0: -hw, x1: round3(bx0 - 0.01), z0: -hd, z1: zf };
23194
+ const onCounter = layOnFloor({ ...counter, y: top }, WASHING_THINGS);
23195
+ c.container({ id: "counter", from: [counter.x0, top, counter.z0], to: [counter.x1, round3(top + 0.3), counter.z1], slots: onCounter.slots, contents: onCounter.contents });
23196
+ basinContents(c, basin, [{ things: [...DIRTY_DISHES, ...onCounter.left] }]);
23051
23197
  pipes(c, (bx0 + bx1) / 2, top - KITCHEN_BASIN_DEPTH, (bz0 + bz1) / 2);
23052
23198
  const mid = 15e-4;
23053
23199
  hingedDoor(c, { id: "door_1", x0: -hw + 3e-3, x1: -mid, y0: 0.103, y1: top - 0.043, zf, t, side: "left", color: front, inner: lining, handle: "bar_v", handleLen: 0.22, label: "prompt.door" });
@@ -23111,6 +23257,13 @@ var GameInteractablesHousehold = (() => {
23111
23257
  const tub = { id: "basin", from: [round3(x0 + 0.03), round3(tubTop - 0.276), round3(z0 + 0.03)], to: [round3(x1 - 0.03), tubTop, round3(z1 - 0.03)] };
23112
23258
  c.add("basins", tub);
23113
23259
  tap2(c, 0, tubTop + 0.08, -hd + 0.08, "tap", "tap_handle", tub);
23260
+ washDishes(c, tub, drainboardSpots(round3(x1 - 0.03 - (x1 - x0) * 0.4) + 0.01, round3(x1 - 0.05), round3(z0 + 0.05), round3(z1 - 0.23), round3(tubTop - 0.276 + 5e-3)));
23261
+ const rackX = round3(x1 - 0.03 - (x1 - x0) * 0.4);
23262
+ const washboardZ = round3(z1 - 0.2);
23263
+ basinContents(c, tub, [
23264
+ { things: DIRTY_DISHES.slice(0, 2), area: { x0: tub.from[0], x1: rackX, z0: tub.from[2], z1: washboardZ } },
23265
+ { things: WASHING_THINGS, area: { x0: round3(x0 + 0.04 + (x1 - x0) * 0.4), x1: tub.to[0], z0: washboardZ, z1: tub.to[2] } }
23266
+ ]);
23114
23267
  c.add("fixtures", { id: "basin", kind: "utility_sink", outlet: [0, round3(tubTop - 0.1), 0], dir: [0, -1, 0], flow: 12, tank: "auto" });
23115
23268
  }
23116
23269
  var SHOWER_DOOR = 0.72;
@@ -23209,8 +23362,16 @@ var GameInteractablesHousehold = (() => {
23209
23362
  c.b("plain", -0.195, ty + th, -hd - 0, 0.195, ty + th + 0.025, -hd + 0.205, sh);
23210
23363
  c.b("plain", -0.185, ty + 0.01, -hd + 0.2, 0.185, ty + 0.03, -hd + 0.215, sh);
23211
23364
  const seatY = 0.4;
23212
- c.lathe("plain", 0, 0, BOWL_Z, SEAT_PROFILE, 15659248);
23213
- c.b("plain", -0.17, seatY + 2e-3, -0.07, 0.17, seatY + 0.023, -0.03, 15659248);
23365
+ c.part(
23366
+ "seat_ring",
23367
+ [0, seatY, -0.05],
23368
+ { kind: "hinge", axis: [1, 0, 0], angle: -1.55 },
23369
+ () => {
23370
+ c.lathe("plain", 0, 0, BOWL_Z, SEAT_PROFILE, 15659248);
23371
+ c.b("plain", -0.165, seatY + 2e-3, -0.07, 0.165, seatY + 0.023, -0.03, 15659248);
23372
+ },
23373
+ { label: "prompt.toilet_seat", at: [0.16, seatY + 0.02, 0.2] }
23374
+ );
23214
23375
  c.part(
23215
23376
  "lid",
23216
23377
  [0, seatY + 0.025, -0.06],
@@ -23233,10 +23394,14 @@ var GameInteractablesHousehold = (() => {
23233
23394
  { label: "prompt.flush", at: false, noSweep: true }
23234
23395
  );
23235
23396
  c.add("fixtures", { id: "flush", kind: "flush", outlet: [0, 0.36, BOWL_Z], dir: [0, -1, 0], volume: 6, part: "flush_button", tank: "auto", cleans: "bowl" });
23236
- const bowl = { id: "bowl", from: [-0.12, 0.26, BOWL_Z - 0.12], to: [0.12, 0.36, BOWL_Z + 0.12], shape: "round", soils: true };
23397
+ const drain = { weir: 0.06, trap: 0.05, carries: 0.5, siphon: 3, prime: 0.02, refill: 20 };
23398
+ const bowl = { id: "bowl", from: [-0.12, 0.26, BOWL_Z - 0.12], to: [0.12, 0.36, BOWL_Z + 0.12], shape: "round", soils: true, drain };
23237
23399
  c.add("basins", bowl);
23238
- c.add("uses", { id: "pee", do: "relieve", basin: "bowl", kind: "urine", label: "use.relieve.urine" });
23239
- c.add("uses", { id: "poo", do: "relieve", basin: "bowl", kind: "feces", label: "use.relieve.feces" });
23400
+ c.add("seats", { id: "seat", pose: "sit", pos: [0, round3(seatY + 0.025), 0.06], ry: 0, exit: [0, 0, round3(hd + 0.3)] });
23401
+ const parts2 = { cover: "lid", ring: "seat_ring", seat: "seat" };
23402
+ c.add("uses", { id: "pee", do: "relieve", basin: "bowl", kind: "urine", label: "use.relieve.urine", seconds: 8, ...parts2, stand: [0, 0, round3(BOWL_Z + 0.5)] });
23403
+ c.add("uses", { id: "poo", do: "relieve", basin: "bowl", kind: "feces", label: "use.relieve.feces", seconds: 12, ...parts2 });
23404
+ c.add("uses", { id: "plunge", do: "plunge", basin: "bowl", label: "use.plunge", tool: "plunger", seconds: 4, stand: [0, 0, round3(BOWL_Z + 0.55)] });
23240
23405
  const rim = [0, 0.385, BOWL_Z];
23241
23406
  c.add("emitters", { id: "flush_water", kind: "water", pos: rim, dir: [0, -1, 0], source: "flush", size: 0.08, ...streamInto(bowl, rim) });
23242
23407
  c.interact("use_flush", [0, ty + th + 0.05, -hd + 0.1], { do: "toggle_fixture", fixture: "flush" }, "prompt.flush");