@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.js
CHANGED
|
@@ -54,6 +54,7 @@ import { checkCategorized, defineCategories } from "@adatechnology/game-contract
|
|
|
54
54
|
|
|
55
55
|
// src/contracts.ts
|
|
56
56
|
import { checkSpec } from "@adatechnology/game-contracts";
|
|
57
|
+
import { itemFluid } from "@adatechnology/game-items";
|
|
57
58
|
|
|
58
59
|
// src/data/ammo-boxes.json
|
|
59
60
|
var ammo_boxes_default = [
|
|
@@ -990,6 +991,19 @@ var house_pools_default = {
|
|
|
990
991
|
isTakeable: true,
|
|
991
992
|
weight: 0.7,
|
|
992
993
|
isSupply: false
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
type: "talheres",
|
|
997
|
+
item: "cutlery",
|
|
998
|
+
name: "Talheres",
|
|
999
|
+
qty: [
|
|
1000
|
+
1,
|
|
1001
|
+
2
|
|
1002
|
+
],
|
|
1003
|
+
viewerCategory: "utensilio",
|
|
1004
|
+
isTakeable: true,
|
|
1005
|
+
weight: 1.5,
|
|
1006
|
+
isSupply: false
|
|
993
1007
|
}
|
|
994
1008
|
],
|
|
995
1009
|
aereo: [
|
|
@@ -10812,15 +10826,28 @@ var items_default = [
|
|
|
10812
10826
|
shape: "jar",
|
|
10813
10827
|
color: 15786216,
|
|
10814
10828
|
rarity: "common",
|
|
10829
|
+
parts: [
|
|
10830
|
+
{
|
|
10831
|
+
id: "body",
|
|
10832
|
+
material: "plastic",
|
|
10833
|
+
thickness: 6e-4
|
|
10834
|
+
}
|
|
10835
|
+
],
|
|
10815
10836
|
nutrition: {
|
|
10816
10837
|
satiety: 10,
|
|
10817
10838
|
hydration: 5
|
|
10818
10839
|
},
|
|
10819
10840
|
shelfLife: 28,
|
|
10820
10841
|
estimated: [
|
|
10842
|
+
"parts",
|
|
10821
10843
|
"nutrition",
|
|
10822
|
-
"shelfLife"
|
|
10823
|
-
|
|
10844
|
+
"shelfLife",
|
|
10845
|
+
"fluid"
|
|
10846
|
+
],
|
|
10847
|
+
fluid: {
|
|
10848
|
+
liquid: "yogurt",
|
|
10849
|
+
liters: 0.17
|
|
10850
|
+
}
|
|
10824
10851
|
},
|
|
10825
10852
|
{
|
|
10826
10853
|
id: "apple",
|
|
@@ -10922,12 +10949,20 @@ var items_default = [
|
|
|
10922
10949
|
shape: "jar",
|
|
10923
10950
|
color: 15784160,
|
|
10924
10951
|
rarity: "common",
|
|
10952
|
+
parts: [
|
|
10953
|
+
{
|
|
10954
|
+
id: "body",
|
|
10955
|
+
material: "plastic",
|
|
10956
|
+
thickness: 6e-4
|
|
10957
|
+
}
|
|
10958
|
+
],
|
|
10925
10959
|
nutrition: {
|
|
10926
10960
|
satiety: 10,
|
|
10927
10961
|
hydration: 4
|
|
10928
10962
|
},
|
|
10929
10963
|
shelfLife: 180,
|
|
10930
10964
|
estimated: [
|
|
10965
|
+
"parts",
|
|
10931
10966
|
"nutrition",
|
|
10932
10967
|
"shelfLife"
|
|
10933
10968
|
]
|
|
@@ -11108,6 +11143,7 @@ var items_default = [
|
|
|
11108
11143
|
shape: "box",
|
|
11109
11144
|
color: 15790304,
|
|
11110
11145
|
rarity: "common",
|
|
11146
|
+
model: "soap",
|
|
11111
11147
|
parts: [
|
|
11112
11148
|
{
|
|
11113
11149
|
id: "body",
|
|
@@ -11143,6 +11179,7 @@ var items_default = [
|
|
|
11143
11179
|
shape: "bottle",
|
|
11144
11180
|
color: 4885200,
|
|
11145
11181
|
rarity: "common",
|
|
11182
|
+
model: "shampoo",
|
|
11146
11183
|
consumable: {
|
|
11147
11184
|
form: "liquid",
|
|
11148
11185
|
unit: "ml",
|
|
@@ -11150,6 +11187,20 @@ var items_default = [
|
|
|
11150
11187
|
dose: 8,
|
|
11151
11188
|
emptyKg: 0.044,
|
|
11152
11189
|
density: 1.02
|
|
11190
|
+
},
|
|
11191
|
+
parts: [
|
|
11192
|
+
{
|
|
11193
|
+
id: "body",
|
|
11194
|
+
material: "plastic",
|
|
11195
|
+
thickness: 8e-4
|
|
11196
|
+
}
|
|
11197
|
+
],
|
|
11198
|
+
estimated: [
|
|
11199
|
+
"fluid",
|
|
11200
|
+
"parts"
|
|
11201
|
+
],
|
|
11202
|
+
fluid: {
|
|
11203
|
+
liquid: "shampoo"
|
|
11153
11204
|
}
|
|
11154
11205
|
},
|
|
11155
11206
|
{
|
|
@@ -11169,13 +11220,24 @@ var items_default = [
|
|
|
11169
11220
|
shape: "tube",
|
|
11170
11221
|
color: 15790320,
|
|
11171
11222
|
rarity: "common",
|
|
11223
|
+
model: "toothpaste",
|
|
11172
11224
|
consumable: {
|
|
11173
11225
|
form: "paste",
|
|
11174
11226
|
unit: "g",
|
|
11175
11227
|
amount: 90,
|
|
11176
11228
|
dose: 1,
|
|
11177
11229
|
emptyKg: 0.01
|
|
11178
|
-
}
|
|
11230
|
+
},
|
|
11231
|
+
parts: [
|
|
11232
|
+
{
|
|
11233
|
+
id: "body",
|
|
11234
|
+
material: "plastic",
|
|
11235
|
+
thickness: 8e-4
|
|
11236
|
+
}
|
|
11237
|
+
],
|
|
11238
|
+
estimated: [
|
|
11239
|
+
"parts"
|
|
11240
|
+
]
|
|
11179
11241
|
},
|
|
11180
11242
|
{
|
|
11181
11243
|
id: "toothbrush",
|
|
@@ -11193,7 +11255,18 @@ var items_default = [
|
|
|
11193
11255
|
stack: 3,
|
|
11194
11256
|
shape: "tool",
|
|
11195
11257
|
color: 3840720,
|
|
11196
|
-
rarity: "common"
|
|
11258
|
+
rarity: "common",
|
|
11259
|
+
model: "toothbrush",
|
|
11260
|
+
parts: [
|
|
11261
|
+
{
|
|
11262
|
+
id: "body",
|
|
11263
|
+
material: "plastic",
|
|
11264
|
+
thickness: 5e-3
|
|
11265
|
+
}
|
|
11266
|
+
],
|
|
11267
|
+
estimated: [
|
|
11268
|
+
"parts"
|
|
11269
|
+
]
|
|
11197
11270
|
},
|
|
11198
11271
|
{
|
|
11199
11272
|
id: "deodorant",
|
|
@@ -11305,8 +11378,12 @@ var items_default = [
|
|
|
11305
11378
|
],
|
|
11306
11379
|
estimated: [
|
|
11307
11380
|
"parts",
|
|
11381
|
+
"fluid",
|
|
11308
11382
|
"consumable"
|
|
11309
11383
|
],
|
|
11384
|
+
fluid: {
|
|
11385
|
+
liquid: "detergent"
|
|
11386
|
+
},
|
|
11310
11387
|
consumable: {
|
|
11311
11388
|
form: "liquid",
|
|
11312
11389
|
unit: "ml",
|
|
@@ -11341,8 +11418,13 @@ var items_default = [
|
|
|
11341
11418
|
}
|
|
11342
11419
|
],
|
|
11343
11420
|
estimated: [
|
|
11344
|
-
"parts"
|
|
11345
|
-
|
|
11421
|
+
"parts",
|
|
11422
|
+
"fluid"
|
|
11423
|
+
],
|
|
11424
|
+
fluid: {
|
|
11425
|
+
liquid: "bleach",
|
|
11426
|
+
liters: 1
|
|
11427
|
+
}
|
|
11346
11428
|
},
|
|
11347
11429
|
{
|
|
11348
11430
|
id: "sponge",
|
|
@@ -11945,7 +12027,14 @@ var items_default = [
|
|
|
11945
12027
|
stack: 1,
|
|
11946
12028
|
shape: "can",
|
|
11947
12029
|
color: 15261904,
|
|
11948
|
-
rarity: "common"
|
|
12030
|
+
rarity: "common",
|
|
12031
|
+
estimated: [
|
|
12032
|
+
"fluid"
|
|
12033
|
+
],
|
|
12034
|
+
fluid: {
|
|
12035
|
+
liquid: "paint",
|
|
12036
|
+
liters: 3.6
|
|
12037
|
+
}
|
|
11949
12038
|
},
|
|
11950
12039
|
{
|
|
11951
12040
|
id: "ice_pack",
|
|
@@ -12305,8 +12394,13 @@ var items_default = [
|
|
|
12305
12394
|
}
|
|
12306
12395
|
],
|
|
12307
12396
|
estimated: [
|
|
12308
|
-
"parts"
|
|
12309
|
-
|
|
12397
|
+
"parts",
|
|
12398
|
+
"fluid"
|
|
12399
|
+
],
|
|
12400
|
+
fluid: {
|
|
12401
|
+
liquid: "disinfectant",
|
|
12402
|
+
liters: 0.5
|
|
12403
|
+
}
|
|
12310
12404
|
},
|
|
12311
12405
|
{
|
|
12312
12406
|
id: "seasoning",
|
|
@@ -12526,8 +12620,12 @@ var items_default = [
|
|
|
12526
12620
|
}
|
|
12527
12621
|
],
|
|
12528
12622
|
estimated: [
|
|
12529
|
-
"parts"
|
|
12530
|
-
|
|
12623
|
+
"parts",
|
|
12624
|
+
"powder"
|
|
12625
|
+
],
|
|
12626
|
+
powder: {
|
|
12627
|
+
color: 15659508
|
|
12628
|
+
}
|
|
12531
12629
|
},
|
|
12532
12630
|
{
|
|
12533
12631
|
id: "broom",
|
|
@@ -12639,8 +12737,13 @@ var items_default = [
|
|
|
12639
12737
|
}
|
|
12640
12738
|
],
|
|
12641
12739
|
estimated: [
|
|
12642
|
-
"parts"
|
|
12643
|
-
|
|
12740
|
+
"parts",
|
|
12741
|
+
"fluid"
|
|
12742
|
+
],
|
|
12743
|
+
fluid: {
|
|
12744
|
+
liquid: "fabric_softener",
|
|
12745
|
+
liters: 2
|
|
12746
|
+
}
|
|
12644
12747
|
},
|
|
12645
12748
|
{
|
|
12646
12749
|
id: "clothespins",
|
|
@@ -13069,9 +13172,8 @@ var kinds_default = [
|
|
|
13069
13172
|
shed: false
|
|
13070
13173
|
},
|
|
13071
13174
|
use: {
|
|
13072
|
-
clip: "
|
|
13175
|
+
clip: "eat_food",
|
|
13073
13176
|
sounds: [
|
|
13074
|
-
"can_open",
|
|
13075
13177
|
"chew"
|
|
13076
13178
|
]
|
|
13077
13179
|
},
|
|
@@ -13239,9 +13341,8 @@ var kinds_default = [
|
|
|
13239
13341
|
shed: false
|
|
13240
13342
|
},
|
|
13241
13343
|
use: {
|
|
13242
|
-
clip: "
|
|
13344
|
+
clip: "drink",
|
|
13243
13345
|
sounds: [
|
|
13244
|
-
"can_open",
|
|
13245
13346
|
"gulp"
|
|
13246
13347
|
]
|
|
13247
13348
|
},
|
|
@@ -17812,6 +17913,17 @@ var use_effects_default = [
|
|
|
17812
17913
|
clip: "turn_key"
|
|
17813
17914
|
}
|
|
17814
17915
|
},
|
|
17916
|
+
{
|
|
17917
|
+
id: "eat_with_cutlery",
|
|
17918
|
+
effect: "eat_with",
|
|
17919
|
+
consumes: false,
|
|
17920
|
+
items: [
|
|
17921
|
+
"cutlery"
|
|
17922
|
+
],
|
|
17923
|
+
params: {
|
|
17924
|
+
clip: "eat_with_cutlery"
|
|
17925
|
+
}
|
|
17926
|
+
},
|
|
17815
17927
|
{
|
|
17816
17928
|
id: "swap_bag",
|
|
17817
17929
|
effect: "swap_bag",
|
|
@@ -18011,7 +18123,7 @@ var preparation = (options) => {
|
|
|
18011
18123
|
var liquidContainer = {
|
|
18012
18124
|
id: "liquid_container",
|
|
18013
18125
|
check: (item) => {
|
|
18014
|
-
const fluid = item
|
|
18126
|
+
const fluid = itemFluid(item);
|
|
18015
18127
|
if (fluid) {
|
|
18016
18128
|
const problems = [];
|
|
18017
18129
|
if (typeof fluid.liquid !== "string" || !SNAKE_CASE.test(fluid.liquid)) problems.push("fluid.liquid must be a liquid id");
|
|
@@ -19166,9 +19278,9 @@ var goodsText = (key, locale) => GOODS_STRINGS[pickGoodsLocale(locale)][key] ??
|
|
|
19166
19278
|
// src/item-use.ts
|
|
19167
19279
|
import { resolveEntry } from "@adatechnology/game-contracts";
|
|
19168
19280
|
import { LIQUIDS } from "@adatechnology/game-fluids";
|
|
19169
|
-
import { resolveUse } from "@adatechnology/game-items";
|
|
19281
|
+
import { itemFluid as itemFluid2, resolveUse } from "@adatechnology/game-items";
|
|
19170
19282
|
var drinkHydrationOf = (item, liquids = LIQUIDS) => {
|
|
19171
|
-
const fluid = item
|
|
19283
|
+
const fluid = itemFluid2(item);
|
|
19172
19284
|
const drink = fluid ? liquids.find((liquid) => liquid.id === fluid.liquid)?.drink : void 0;
|
|
19173
19285
|
if (!fluid || !drink) return void 0;
|
|
19174
19286
|
const doses = item.durability?.kind === "doses" ? Math.max(1, item.durability.amount ?? 1) : 1;
|