@adatechnology/game-interactables 0.13.0 → 0.14.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.d.ts +8 -3
- package/dist/index.global.js +25 -2
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +23 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -353,9 +353,14 @@ function fitsSize(size, max) {
|
|
|
353
353
|
if (size[1] > max[1] + eps) return false;
|
|
354
354
|
return size[0] <= max[0] + eps && size[2] <= max[2] + eps || size[2] <= max[0] + eps && size[0] <= max[2] + eps;
|
|
355
355
|
}
|
|
356
|
+
function laidSize(size, lay) {
|
|
357
|
+
if (lay === "x") return [size[1], size[0], size[2]];
|
|
358
|
+
if (lay === "z") return [size[0], size[2], size[1]];
|
|
359
|
+
return size;
|
|
360
|
+
}
|
|
356
361
|
function fitsSlot(type, slot, items) {
|
|
357
362
|
const def = items?.[type];
|
|
358
|
-
return def ? fitsSize(def.size, slot.max) : true;
|
|
363
|
+
return def ? fitsSize(laidSize(def.size, slot.lay), slot.max) : true;
|
|
359
364
|
}
|
|
360
365
|
function generateLoot(tables, tableId, slots, seed, items) {
|
|
361
366
|
const table = tables?.[tableId];
|
|
@@ -445,6 +450,10 @@ var locales = {
|
|
|
445
450
|
"use.wash_dishes": "Wash the dishes",
|
|
446
451
|
"use.drink_water": "Drink water from the glass",
|
|
447
452
|
"use.drink_from_hands": "Drink water from your hands",
|
|
453
|
+
"use.lather_body": "Soap yourself",
|
|
454
|
+
"use.shampoo_hair": "Shampoo your hair",
|
|
455
|
+
"use.wash_hands": "Wash your hands",
|
|
456
|
+
"use.brush_teeth": "Brush your teeth",
|
|
448
457
|
needs_in_hand: "Pick up {item} first",
|
|
449
458
|
needs_vessel: "You need a glass",
|
|
450
459
|
vessel_not_empty: "Empty {item} first",
|
|
@@ -534,6 +543,10 @@ var locales = {
|
|
|
534
543
|
"use.wash_dishes": "Lavar a lou\xE7a",
|
|
535
544
|
"use.drink_water": "Beber \xE1gua no copo",
|
|
536
545
|
"use.drink_from_hands": "Beber \xE1gua com a m\xE3o",
|
|
546
|
+
"use.lather_body": "Ensaboar-se",
|
|
547
|
+
"use.shampoo_hair": "Passar shampoo",
|
|
548
|
+
"use.wash_hands": "Lavar as m\xE3os",
|
|
549
|
+
"use.brush_teeth": "Escovar os dentes",
|
|
537
550
|
needs_in_hand: "Pegue {item} antes",
|
|
538
551
|
needs_vessel: "Precisa de um copo",
|
|
539
552
|
vessel_not_empty: "Esvazie {item} antes",
|
|
@@ -3115,7 +3128,14 @@ function createSinkRoutines(options) {
|
|
|
3115
3128
|
};
|
|
3116
3129
|
const tap = tapPhases(use);
|
|
3117
3130
|
const dosed = use.dose ? items[use.dose.need] : void 0;
|
|
3118
|
-
const
|
|
3131
|
+
const waterForDose = waterOf(use);
|
|
3132
|
+
const dose = (dt) => {
|
|
3133
|
+
const flow = waterForDose(dt);
|
|
3134
|
+
if (flow === null) {
|
|
3135
|
+
fail({ key: "no_water", ok: false });
|
|
3136
|
+
return true;
|
|
3137
|
+
}
|
|
3138
|
+
if (flow <= 0) return false;
|
|
3119
3139
|
if (dosed && body.takeDose?.(dosed.objectId, use.dose?.amount).taken === 0) fail({ key: "item_spent", ok: false, vars: { item: dosed.name } });
|
|
3120
3140
|
return true;
|
|
3121
3141
|
};
|
|
@@ -3595,6 +3615,7 @@ export {
|
|
|
3595
3615
|
generateLoot,
|
|
3596
3616
|
hangTail,
|
|
3597
3617
|
hashString,
|
|
3618
|
+
laidSize,
|
|
3598
3619
|
localToWorld,
|
|
3599
3620
|
locales,
|
|
3600
3621
|
mergeColliders,
|