@adatechnology/game-items-goods 0.8.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.global.js +260 -19
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +132 -20
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.global.js
CHANGED
|
@@ -203,6 +203,8 @@ var GameItemsGoods = (() => {
|
|
|
203
203
|
};
|
|
204
204
|
var MUST_DRAIN_QUEUE_IDS = /* @__PURE__ */ new Set([DEFERRED_QUEUE_ID.DESTRUCTION_EVENTS, DEFERRED_QUEUE_ID.BREACH_CUT]);
|
|
205
205
|
var ITEM_TOOLS = ["plunger"];
|
|
206
|
+
var BODY_FOAM_SURFACES = ["hands", "arms", "torso", "hair", "mouth"];
|
|
207
|
+
var WASH_SURFACES = [...BODY_FOAM_SURFACES, "brush"];
|
|
206
208
|
var WARNED_KEY = /* @__PURE__ */ Symbol.for("@adatechnology/game-contracts.warned");
|
|
207
209
|
var warnedKeys = () => {
|
|
208
210
|
const holder = globalThis;
|
|
@@ -537,6 +539,11 @@ var GameItemsGoods = (() => {
|
|
|
537
539
|
{ id: "collectibles", name: "Collectibles" },
|
|
538
540
|
{ id: "keys", name: "Keys" }
|
|
539
541
|
];
|
|
542
|
+
var consumableLiters = (spec) => spec?.form === "liquid" && spec.unit === "ml" ? spec.amount / 1e3 : void 0;
|
|
543
|
+
var itemFluid = (item) => {
|
|
544
|
+
if (!item.fluid) return void 0;
|
|
545
|
+
return { liquid: item.fluid.liquid, liters: consumableLiters(item.consumable) ?? item.fluid.liters ?? 0 };
|
|
546
|
+
};
|
|
540
547
|
var consumableProblems = (spec) => {
|
|
541
548
|
const problems = [];
|
|
542
549
|
if (!(spec.amount > 0) || !Number.isFinite(spec.amount)) problems.push(`holds ${spec.amount} ${spec.unit} when new`);
|
|
@@ -573,6 +580,8 @@ var GameItemsGoods = (() => {
|
|
|
573
580
|
if (item.durability && !DURABILITY_KINDS.includes(item.durability.kind)) issue(`has unknown durability kind "${item.durability.kind}"`);
|
|
574
581
|
for (const tool of item.tools ?? []) if (!ITEM_TOOLS.includes(tool)) issue(`works as unknown tool "${tool}"`);
|
|
575
582
|
if (item.consumable) for (const problem of consumableProblems(item.consumable)) issue(problem);
|
|
583
|
+
if (item.fluid?.liters !== void 0 && consumableLiters(item.consumable) !== void 0) issue("says its volume twice (fluid.liters and the liquid consumable): leave fluid.liters out");
|
|
584
|
+
if (item.fluid && item.fluid.liters === void 0 && consumableLiters(item.consumable) === void 0) issue("holds a liquid with no volume (fluid.liters, or a liquid consumable)");
|
|
576
585
|
const { protection } = item;
|
|
577
586
|
if (protection) {
|
|
578
587
|
for (const slot of protection.slots) if (!BODY_SLOTS.includes(slot)) issue(`protects unknown body slot "${slot}"`);
|
|
@@ -1826,6 +1835,19 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
1826
1835
|
isTakeable: true,
|
|
1827
1836
|
weight: 0.7,
|
|
1828
1837
|
isSupply: false
|
|
1838
|
+
},
|
|
1839
|
+
{
|
|
1840
|
+
type: "talheres",
|
|
1841
|
+
item: "cutlery",
|
|
1842
|
+
name: "Talheres",
|
|
1843
|
+
qty: [
|
|
1844
|
+
1,
|
|
1845
|
+
2
|
|
1846
|
+
],
|
|
1847
|
+
viewerCategory: "utensilio",
|
|
1848
|
+
isTakeable: true,
|
|
1849
|
+
weight: 1.5,
|
|
1850
|
+
isSupply: false
|
|
1829
1851
|
}
|
|
1830
1852
|
],
|
|
1831
1853
|
aereo: [
|
|
@@ -11648,15 +11670,28 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
11648
11670
|
shape: "jar",
|
|
11649
11671
|
color: 15786216,
|
|
11650
11672
|
rarity: "common",
|
|
11673
|
+
parts: [
|
|
11674
|
+
{
|
|
11675
|
+
id: "body",
|
|
11676
|
+
material: "plastic",
|
|
11677
|
+
thickness: 6e-4
|
|
11678
|
+
}
|
|
11679
|
+
],
|
|
11651
11680
|
nutrition: {
|
|
11652
11681
|
satiety: 10,
|
|
11653
11682
|
hydration: 5
|
|
11654
11683
|
},
|
|
11655
11684
|
shelfLife: 28,
|
|
11656
11685
|
estimated: [
|
|
11686
|
+
"parts",
|
|
11657
11687
|
"nutrition",
|
|
11658
|
-
"shelfLife"
|
|
11659
|
-
|
|
11688
|
+
"shelfLife",
|
|
11689
|
+
"fluid"
|
|
11690
|
+
],
|
|
11691
|
+
fluid: {
|
|
11692
|
+
liquid: "yogurt",
|
|
11693
|
+
liters: 0.17
|
|
11694
|
+
}
|
|
11660
11695
|
},
|
|
11661
11696
|
{
|
|
11662
11697
|
id: "apple",
|
|
@@ -11758,12 +11793,20 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
11758
11793
|
shape: "jar",
|
|
11759
11794
|
color: 15784160,
|
|
11760
11795
|
rarity: "common",
|
|
11796
|
+
parts: [
|
|
11797
|
+
{
|
|
11798
|
+
id: "body",
|
|
11799
|
+
material: "plastic",
|
|
11800
|
+
thickness: 6e-4
|
|
11801
|
+
}
|
|
11802
|
+
],
|
|
11761
11803
|
nutrition: {
|
|
11762
11804
|
satiety: 10,
|
|
11763
11805
|
hydration: 4
|
|
11764
11806
|
},
|
|
11765
11807
|
shelfLife: 180,
|
|
11766
11808
|
estimated: [
|
|
11809
|
+
"parts",
|
|
11767
11810
|
"nutrition",
|
|
11768
11811
|
"shelfLife"
|
|
11769
11812
|
]
|
|
@@ -11944,6 +11987,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
11944
11987
|
shape: "box",
|
|
11945
11988
|
color: 15790304,
|
|
11946
11989
|
rarity: "common",
|
|
11990
|
+
model: "soap",
|
|
11947
11991
|
parts: [
|
|
11948
11992
|
{
|
|
11949
11993
|
id: "body",
|
|
@@ -11979,6 +12023,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
11979
12023
|
shape: "bottle",
|
|
11980
12024
|
color: 4885200,
|
|
11981
12025
|
rarity: "common",
|
|
12026
|
+
model: "shampoo",
|
|
11982
12027
|
consumable: {
|
|
11983
12028
|
form: "liquid",
|
|
11984
12029
|
unit: "ml",
|
|
@@ -11986,6 +12031,20 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
11986
12031
|
dose: 8,
|
|
11987
12032
|
emptyKg: 0.044,
|
|
11988
12033
|
density: 1.02
|
|
12034
|
+
},
|
|
12035
|
+
parts: [
|
|
12036
|
+
{
|
|
12037
|
+
id: "body",
|
|
12038
|
+
material: "plastic",
|
|
12039
|
+
thickness: 8e-4
|
|
12040
|
+
}
|
|
12041
|
+
],
|
|
12042
|
+
estimated: [
|
|
12043
|
+
"fluid",
|
|
12044
|
+
"parts"
|
|
12045
|
+
],
|
|
12046
|
+
fluid: {
|
|
12047
|
+
liquid: "shampoo"
|
|
11989
12048
|
}
|
|
11990
12049
|
},
|
|
11991
12050
|
{
|
|
@@ -12005,13 +12064,24 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
12005
12064
|
shape: "tube",
|
|
12006
12065
|
color: 15790320,
|
|
12007
12066
|
rarity: "common",
|
|
12067
|
+
model: "toothpaste",
|
|
12008
12068
|
consumable: {
|
|
12009
12069
|
form: "paste",
|
|
12010
12070
|
unit: "g",
|
|
12011
12071
|
amount: 90,
|
|
12012
12072
|
dose: 1,
|
|
12013
12073
|
emptyKg: 0.01
|
|
12014
|
-
}
|
|
12074
|
+
},
|
|
12075
|
+
parts: [
|
|
12076
|
+
{
|
|
12077
|
+
id: "body",
|
|
12078
|
+
material: "plastic",
|
|
12079
|
+
thickness: 8e-4
|
|
12080
|
+
}
|
|
12081
|
+
],
|
|
12082
|
+
estimated: [
|
|
12083
|
+
"parts"
|
|
12084
|
+
]
|
|
12015
12085
|
},
|
|
12016
12086
|
{
|
|
12017
12087
|
id: "toothbrush",
|
|
@@ -12029,7 +12099,18 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
12029
12099
|
stack: 3,
|
|
12030
12100
|
shape: "tool",
|
|
12031
12101
|
color: 3840720,
|
|
12032
|
-
rarity: "common"
|
|
12102
|
+
rarity: "common",
|
|
12103
|
+
model: "toothbrush",
|
|
12104
|
+
parts: [
|
|
12105
|
+
{
|
|
12106
|
+
id: "body",
|
|
12107
|
+
material: "plastic",
|
|
12108
|
+
thickness: 5e-3
|
|
12109
|
+
}
|
|
12110
|
+
],
|
|
12111
|
+
estimated: [
|
|
12112
|
+
"parts"
|
|
12113
|
+
]
|
|
12033
12114
|
},
|
|
12034
12115
|
{
|
|
12035
12116
|
id: "deodorant",
|
|
@@ -12141,8 +12222,12 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
12141
12222
|
],
|
|
12142
12223
|
estimated: [
|
|
12143
12224
|
"parts",
|
|
12225
|
+
"fluid",
|
|
12144
12226
|
"consumable"
|
|
12145
12227
|
],
|
|
12228
|
+
fluid: {
|
|
12229
|
+
liquid: "detergent"
|
|
12230
|
+
},
|
|
12146
12231
|
consumable: {
|
|
12147
12232
|
form: "liquid",
|
|
12148
12233
|
unit: "ml",
|
|
@@ -12177,8 +12262,13 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
12177
12262
|
}
|
|
12178
12263
|
],
|
|
12179
12264
|
estimated: [
|
|
12180
|
-
"parts"
|
|
12181
|
-
|
|
12265
|
+
"parts",
|
|
12266
|
+
"fluid"
|
|
12267
|
+
],
|
|
12268
|
+
fluid: {
|
|
12269
|
+
liquid: "bleach",
|
|
12270
|
+
liters: 1
|
|
12271
|
+
}
|
|
12182
12272
|
},
|
|
12183
12273
|
{
|
|
12184
12274
|
id: "sponge",
|
|
@@ -12781,7 +12871,14 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
12781
12871
|
stack: 1,
|
|
12782
12872
|
shape: "can",
|
|
12783
12873
|
color: 15261904,
|
|
12784
|
-
rarity: "common"
|
|
12874
|
+
rarity: "common",
|
|
12875
|
+
estimated: [
|
|
12876
|
+
"fluid"
|
|
12877
|
+
],
|
|
12878
|
+
fluid: {
|
|
12879
|
+
liquid: "paint",
|
|
12880
|
+
liters: 3.6
|
|
12881
|
+
}
|
|
12785
12882
|
},
|
|
12786
12883
|
{
|
|
12787
12884
|
id: "ice_pack",
|
|
@@ -13141,8 +13238,13 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
13141
13238
|
}
|
|
13142
13239
|
],
|
|
13143
13240
|
estimated: [
|
|
13144
|
-
"parts"
|
|
13145
|
-
|
|
13241
|
+
"parts",
|
|
13242
|
+
"fluid"
|
|
13243
|
+
],
|
|
13244
|
+
fluid: {
|
|
13245
|
+
liquid: "disinfectant",
|
|
13246
|
+
liters: 0.5
|
|
13247
|
+
}
|
|
13146
13248
|
},
|
|
13147
13249
|
{
|
|
13148
13250
|
id: "seasoning",
|
|
@@ -13362,8 +13464,12 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
13362
13464
|
}
|
|
13363
13465
|
],
|
|
13364
13466
|
estimated: [
|
|
13365
|
-
"parts"
|
|
13366
|
-
|
|
13467
|
+
"parts",
|
|
13468
|
+
"powder"
|
|
13469
|
+
],
|
|
13470
|
+
powder: {
|
|
13471
|
+
color: 15659508
|
|
13472
|
+
}
|
|
13367
13473
|
},
|
|
13368
13474
|
{
|
|
13369
13475
|
id: "broom",
|
|
@@ -13475,8 +13581,13 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
13475
13581
|
}
|
|
13476
13582
|
],
|
|
13477
13583
|
estimated: [
|
|
13478
|
-
"parts"
|
|
13479
|
-
|
|
13584
|
+
"parts",
|
|
13585
|
+
"fluid"
|
|
13586
|
+
],
|
|
13587
|
+
fluid: {
|
|
13588
|
+
liquid: "fabric_softener",
|
|
13589
|
+
liters: 2
|
|
13590
|
+
}
|
|
13480
13591
|
},
|
|
13481
13592
|
{
|
|
13482
13593
|
id: "clothespins",
|
|
@@ -13905,9 +14016,8 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
13905
14016
|
shed: false
|
|
13906
14017
|
},
|
|
13907
14018
|
use: {
|
|
13908
|
-
clip: "
|
|
14019
|
+
clip: "eat_food",
|
|
13909
14020
|
sounds: [
|
|
13910
|
-
"can_open",
|
|
13911
14021
|
"chew"
|
|
13912
14022
|
]
|
|
13913
14023
|
},
|
|
@@ -14075,9 +14185,8 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
14075
14185
|
shed: false
|
|
14076
14186
|
},
|
|
14077
14187
|
use: {
|
|
14078
|
-
clip: "
|
|
14188
|
+
clip: "drink",
|
|
14079
14189
|
sounds: [
|
|
14080
|
-
"can_open",
|
|
14081
14190
|
"gulp"
|
|
14082
14191
|
]
|
|
14083
14192
|
},
|
|
@@ -18648,6 +18757,17 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
18648
18757
|
clip: "turn_key"
|
|
18649
18758
|
}
|
|
18650
18759
|
},
|
|
18760
|
+
{
|
|
18761
|
+
id: "eat_with_cutlery",
|
|
18762
|
+
effect: "eat_with",
|
|
18763
|
+
consumes: false,
|
|
18764
|
+
items: [
|
|
18765
|
+
"cutlery"
|
|
18766
|
+
],
|
|
18767
|
+
params: {
|
|
18768
|
+
clip: "eat_with_cutlery"
|
|
18769
|
+
}
|
|
18770
|
+
},
|
|
18651
18771
|
{
|
|
18652
18772
|
id: "swap_bag",
|
|
18653
18773
|
effect: "swap_bag",
|
|
@@ -18847,7 +18967,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
18847
18967
|
var liquidContainer = {
|
|
18848
18968
|
id: "liquid_container",
|
|
18849
18969
|
check: (item) => {
|
|
18850
|
-
const fluid = item
|
|
18970
|
+
const fluid = itemFluid(item);
|
|
18851
18971
|
if (fluid) {
|
|
18852
18972
|
const problems = [];
|
|
18853
18973
|
if (typeof fluid.liquid !== "string" || !SNAKE_CASE.test(fluid.liquid)) problems.push("fluid.liquid must be a liquid id");
|
|
@@ -20497,6 +20617,127 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20497
20617
|
tags: [
|
|
20498
20618
|
"brake_fluid"
|
|
20499
20619
|
]
|
|
20620
|
+
},
|
|
20621
|
+
{
|
|
20622
|
+
id: "detergent",
|
|
20623
|
+
color: 15916378,
|
|
20624
|
+
opacity: 0.6,
|
|
20625
|
+
stainColor: 14077068,
|
|
20626
|
+
viscosity: 400,
|
|
20627
|
+
density: 1030,
|
|
20628
|
+
dryTime: 1800,
|
|
20629
|
+
gloss: 0.95,
|
|
20630
|
+
leavesMark: true,
|
|
20631
|
+
drink: {
|
|
20632
|
+
thirst: 0,
|
|
20633
|
+
effects: [
|
|
20634
|
+
"poison"
|
|
20635
|
+
]
|
|
20636
|
+
},
|
|
20637
|
+
tags: [
|
|
20638
|
+
"soap"
|
|
20639
|
+
]
|
|
20640
|
+
},
|
|
20641
|
+
{
|
|
20642
|
+
id: "shampoo",
|
|
20643
|
+
color: 6069216,
|
|
20644
|
+
opacity: 0.75,
|
|
20645
|
+
stainColor: 9418462,
|
|
20646
|
+
viscosity: 4e3,
|
|
20647
|
+
density: 1020,
|
|
20648
|
+
dryTime: 3600,
|
|
20649
|
+
gloss: 0.9,
|
|
20650
|
+
leavesMark: true,
|
|
20651
|
+
drink: {
|
|
20652
|
+
thirst: 0,
|
|
20653
|
+
effects: [
|
|
20654
|
+
"poison"
|
|
20655
|
+
]
|
|
20656
|
+
},
|
|
20657
|
+
tags: [
|
|
20658
|
+
"soap",
|
|
20659
|
+
"sticky"
|
|
20660
|
+
]
|
|
20661
|
+
},
|
|
20662
|
+
{
|
|
20663
|
+
id: "fabric_softener",
|
|
20664
|
+
color: 9225452,
|
|
20665
|
+
opacity: 0.8,
|
|
20666
|
+
stainColor: 11061470,
|
|
20667
|
+
viscosity: 80,
|
|
20668
|
+
density: 1e3,
|
|
20669
|
+
dryTime: 1800,
|
|
20670
|
+
gloss: 0.8,
|
|
20671
|
+
leavesMark: true,
|
|
20672
|
+
drink: {
|
|
20673
|
+
thirst: 0,
|
|
20674
|
+
effects: [
|
|
20675
|
+
"poison"
|
|
20676
|
+
]
|
|
20677
|
+
},
|
|
20678
|
+
tags: [
|
|
20679
|
+
"soap"
|
|
20680
|
+
]
|
|
20681
|
+
},
|
|
20682
|
+
{
|
|
20683
|
+
id: "disinfectant",
|
|
20684
|
+
color: 14205040,
|
|
20685
|
+
opacity: 0.6,
|
|
20686
|
+
stainColor: 13154442,
|
|
20687
|
+
viscosity: 1.5,
|
|
20688
|
+
density: 1e3,
|
|
20689
|
+
dryTime: 600,
|
|
20690
|
+
gloss: 0.85,
|
|
20691
|
+
leavesMark: true,
|
|
20692
|
+
drink: {
|
|
20693
|
+
thirst: 0,
|
|
20694
|
+
effects: [
|
|
20695
|
+
"poison"
|
|
20696
|
+
]
|
|
20697
|
+
},
|
|
20698
|
+
tags: [
|
|
20699
|
+
"corrosive"
|
|
20700
|
+
]
|
|
20701
|
+
},
|
|
20702
|
+
{
|
|
20703
|
+
id: "yogurt",
|
|
20704
|
+
color: 15986404,
|
|
20705
|
+
opacity: 1,
|
|
20706
|
+
stainColor: 15130576,
|
|
20707
|
+
viscosity: 1500,
|
|
20708
|
+
density: 1040,
|
|
20709
|
+
dryTime: 7200,
|
|
20710
|
+
gloss: 0.5,
|
|
20711
|
+
leavesMark: true,
|
|
20712
|
+
drink: {
|
|
20713
|
+
thirst: 10,
|
|
20714
|
+
effects: []
|
|
20715
|
+
},
|
|
20716
|
+
tags: [
|
|
20717
|
+
"food",
|
|
20718
|
+
"sticky"
|
|
20719
|
+
]
|
|
20720
|
+
},
|
|
20721
|
+
{
|
|
20722
|
+
id: "toothpaste",
|
|
20723
|
+
color: 16054008,
|
|
20724
|
+
opacity: 1,
|
|
20725
|
+
stainColor: 15133935,
|
|
20726
|
+
viscosity: 1e5,
|
|
20727
|
+
density: 1300,
|
|
20728
|
+
dryTime: 7200,
|
|
20729
|
+
gloss: 0.6,
|
|
20730
|
+
leavesMark: true,
|
|
20731
|
+
drink: {
|
|
20732
|
+
thirst: 0,
|
|
20733
|
+
effects: [
|
|
20734
|
+
"poison"
|
|
20735
|
+
]
|
|
20736
|
+
},
|
|
20737
|
+
tags: [
|
|
20738
|
+
"soap",
|
|
20739
|
+
"paste"
|
|
20740
|
+
]
|
|
20500
20741
|
}
|
|
20501
20742
|
];
|
|
20502
20743
|
var LIQUIDS = liquids_default;
|
|
@@ -20690,7 +20931,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
20690
20931
|
|
|
20691
20932
|
// src/item-use.ts
|
|
20692
20933
|
var drinkHydrationOf = (item, liquids = LIQUIDS) => {
|
|
20693
|
-
const fluid = item
|
|
20934
|
+
const fluid = itemFluid(item);
|
|
20694
20935
|
const drink = fluid ? liquids.find((liquid) => liquid.id === fluid.liquid)?.drink : void 0;
|
|
20695
20936
|
if (!fluid || !drink) return void 0;
|
|
20696
20937
|
const doses = item.durability?.kind === "doses" ? Math.max(1, item.durability.amount ?? 1) : 1;
|