@adatechnology/game-interactables-household 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3028,9 +3028,16 @@ function powerMeter(c) {
3028
3028
  }
3029
3029
 
3030
3030
  // src/builders/kitchen.ts
3031
+ import { handUseOf } from "@adatechnology/game-items";
3031
3032
  import { GOODS_ITEMS } from "@adatechnology/game-items-goods";
3032
3033
  var STOVE_WALL_GAP = 0.04;
3033
3034
  var STEEL = 11843772;
3035
+ var HAND_WASH_SOAP_GRAMS = 0.4;
3036
+ function scrubSecondsOf(clip) {
3037
+ const use = handUseOf(clip);
3038
+ if (!use) throw new Error(`No hand use for the washing clip ${clip}`);
3039
+ return use.duration;
3040
+ }
3034
3041
  var CHROME = 13817562;
3035
3042
  var DISHES = ["plate", "bowl", "cup", "wine_glass", "cutlery", "knife", "pot", "pan"];
3036
3043
  var DISH_NEEDS = ["detergent", "sponge"];
@@ -3363,6 +3370,44 @@ function sinkBathroom(c) {
3363
3370
  slots: c.row(sh.ix0 + 0.15, sh.ix1 - 0.01, sh.iy0, (sh.iz0 + sh.iz1) / 2, 1, [0.3, 0.4, 0.3]),
3364
3371
  loot: "under_sink"
3365
3372
  });
3373
+ washbasinCounter(c, top, hw * 0.6);
3374
+ c.add("uses", { id: "wash_hands", do: "wash", fixture: "tap", surface: "hands", clip: "wash_hands", label: "use.wash_hands", needs: ["soap"], dose: { need: 0, amount: HAND_WASH_SOAP_GRAMS }, scrubSeconds: scrubSecondsOf("wash_hands") });
3375
+ c.add("uses", { id: "brush_teeth", do: "wash", fixture: "tap", surface: "mouth", clip: "brush_teeth", label: "use.brush_teeth", needs: ["toothbrush", "toothpaste"], dose: { need: 1 }, scrubSeconds: scrubSecondsOf("brush_teeth") });
3376
+ }
3377
+ function washbasinCounter(c, top, basinEdge) {
3378
+ const { hw, hd } = c;
3379
+ const side = round3((basinEdge + hw) / 2);
3380
+ c.container({
3381
+ id: "counter",
3382
+ from: [-hw, top, -hd],
3383
+ to: [hw, top + 0.12, hd],
3384
+ slots: [
3385
+ { pos: [-side, top, 0], max: [0.1, 0.04, 0.1] },
3386
+ { pos: [round3(side - 0.025), top, 0.02], max: [0.03, 0.03, 0.19], lay: "z" },
3387
+ { pos: [round3(side + 0.028), top, 0.02], max: [0.045, 0.04, 0.19], lay: "z" },
3388
+ { pos: [round3(-basinEdge + 0.01), top, round3(-hd + 0.065)], max: [0.09, 0.1, 0.09] }
3389
+ ],
3390
+ contents: [{ type: "soap", qty: 1 }, { type: "toothbrush", qty: 1 }, { type: "toothpaste", qty: 1 }, { type: "cup", qty: 1 }]
3391
+ });
3392
+ }
3393
+ function showerShelf(c) {
3394
+ const { hw, hd } = c;
3395
+ const y = 0.85;
3396
+ const x0 = -hw + 0.033;
3397
+ const x1 = round3(x0 + 0.3);
3398
+ const z0 = -hd + 0.033;
3399
+ const z1 = round3(z0 + 0.13);
3400
+ c.b("plain", x0, y - 0.025, z0, x1, y, z1, 15133162);
3401
+ c.container({
3402
+ id: "shelf",
3403
+ from: [x0, y, z0],
3404
+ to: [x1, y + 0.25, z1],
3405
+ slots: [
3406
+ { pos: [round3(x0 + 0.07), y, round3((z0 + z1) / 2)], max: [0.1, 0.04, 0.06] },
3407
+ { pos: [round3(x0 + 0.2), y, round3((z0 + z1) / 2)], max: [0.07, 0.21, 0.05] }
3408
+ ],
3409
+ contents: [{ type: "soap", qty: 1 }, { type: "shampoo", qty: 1 }]
3410
+ });
3366
3411
  }
3367
3412
  function utilitySink(c) {
3368
3413
  const { hw, hd } = c;
@@ -3428,6 +3473,9 @@ function shower(c) {
3428
3473
  c.add("emitters", { id: "shower_water", kind: "water", pos: outlet, dir: [0, -1, 0.15], source: "shower", size: 0.35 });
3429
3474
  c.add("emitters", { id: "shower_steam", kind: "steam", pos: [0, 1.4, 0], dir: [0, 1, 0], source: "shower", size: 0.8 });
3430
3475
  c.interact("use_shower", [0.25, 1.1, -hd + 0.08], { do: "toggle_fixture", fixture: "shower" }, "prompt.shower", 1.3);
3476
+ showerShelf(c);
3477
+ c.add("uses", { id: "lather_body", do: "wash", fixture: "shower", surface: "body", clip: "lather_body", label: "use.lather_body", needs: ["soap"], dose: { need: 0 }, opensFixture: false, requiresFlowing: true, scrubSeconds: scrubSecondsOf("lather_body") });
3478
+ c.add("uses", { id: "shampoo_hair", do: "wash", fixture: "shower", surface: "hair", clip: "shampoo_hair", label: "use.shampoo_hair", needs: ["shampoo"], dose: { need: 0 }, opensFixture: false, requiresFlowing: true, scrubSeconds: scrubSecondsOf("shampoo_hair") });
3431
3479
  const gl = 12573670;
3432
3480
  const zFront = hd - 0.015;
3433
3481
  const gh = h - 0.1;