@adatechnology/game-items-goods 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.
@@ -539,6 +539,11 @@ var GameItemsGoods = (() => {
539
539
  { id: "collectibles", name: "Collectibles" },
540
540
  { id: "keys", name: "Keys" }
541
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
+ };
542
547
  var consumableProblems = (spec) => {
543
548
  const problems = [];
544
549
  if (!(spec.amount > 0) || !Number.isFinite(spec.amount)) problems.push(`holds ${spec.amount} ${spec.unit} when new`);
@@ -575,6 +580,8 @@ var GameItemsGoods = (() => {
575
580
  if (item.durability && !DURABILITY_KINDS.includes(item.durability.kind)) issue(`has unknown durability kind "${item.durability.kind}"`);
576
581
  for (const tool of item.tools ?? []) if (!ITEM_TOOLS.includes(tool)) issue(`works as unknown tool "${tool}"`);
577
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)");
578
585
  const { protection } = item;
579
586
  if (protection) {
580
587
  for (const slot of protection.slots) if (!BODY_SLOTS.includes(slot)) issue(`protects unknown body slot "${slot}"`);
@@ -1828,6 +1835,19 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
1828
1835
  isTakeable: true,
1829
1836
  weight: 0.7,
1830
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
1831
1851
  }
1832
1852
  ],
1833
1853
  aereo: [
@@ -11650,15 +11670,28 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
11650
11670
  shape: "jar",
11651
11671
  color: 15786216,
11652
11672
  rarity: "common",
11673
+ parts: [
11674
+ {
11675
+ id: "body",
11676
+ material: "plastic",
11677
+ thickness: 6e-4
11678
+ }
11679
+ ],
11653
11680
  nutrition: {
11654
11681
  satiety: 10,
11655
11682
  hydration: 5
11656
11683
  },
11657
11684
  shelfLife: 28,
11658
11685
  estimated: [
11686
+ "parts",
11659
11687
  "nutrition",
11660
- "shelfLife"
11661
- ]
11688
+ "shelfLife",
11689
+ "fluid"
11690
+ ],
11691
+ fluid: {
11692
+ liquid: "yogurt",
11693
+ liters: 0.17
11694
+ }
11662
11695
  },
11663
11696
  {
11664
11697
  id: "apple",
@@ -11760,12 +11793,20 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
11760
11793
  shape: "jar",
11761
11794
  color: 15784160,
11762
11795
  rarity: "common",
11796
+ parts: [
11797
+ {
11798
+ id: "body",
11799
+ material: "plastic",
11800
+ thickness: 6e-4
11801
+ }
11802
+ ],
11763
11803
  nutrition: {
11764
11804
  satiety: 10,
11765
11805
  hydration: 4
11766
11806
  },
11767
11807
  shelfLife: 180,
11768
11808
  estimated: [
11809
+ "parts",
11769
11810
  "nutrition",
11770
11811
  "shelfLife"
11771
11812
  ]
@@ -11999,8 +12040,12 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
11999
12040
  }
12000
12041
  ],
12001
12042
  estimated: [
12043
+ "fluid",
12002
12044
  "parts"
12003
- ]
12045
+ ],
12046
+ fluid: {
12047
+ liquid: "shampoo"
12048
+ }
12004
12049
  },
12005
12050
  {
12006
12051
  id: "toothpaste",
@@ -12177,8 +12222,12 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
12177
12222
  ],
12178
12223
  estimated: [
12179
12224
  "parts",
12225
+ "fluid",
12180
12226
  "consumable"
12181
12227
  ],
12228
+ fluid: {
12229
+ liquid: "detergent"
12230
+ },
12182
12231
  consumable: {
12183
12232
  form: "liquid",
12184
12233
  unit: "ml",
@@ -12213,8 +12262,13 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
12213
12262
  }
12214
12263
  ],
12215
12264
  estimated: [
12216
- "parts"
12217
- ]
12265
+ "parts",
12266
+ "fluid"
12267
+ ],
12268
+ fluid: {
12269
+ liquid: "bleach",
12270
+ liters: 1
12271
+ }
12218
12272
  },
12219
12273
  {
12220
12274
  id: "sponge",
@@ -12817,7 +12871,14 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
12817
12871
  stack: 1,
12818
12872
  shape: "can",
12819
12873
  color: 15261904,
12820
- rarity: "common"
12874
+ rarity: "common",
12875
+ estimated: [
12876
+ "fluid"
12877
+ ],
12878
+ fluid: {
12879
+ liquid: "paint",
12880
+ liters: 3.6
12881
+ }
12821
12882
  },
12822
12883
  {
12823
12884
  id: "ice_pack",
@@ -13177,8 +13238,13 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
13177
13238
  }
13178
13239
  ],
13179
13240
  estimated: [
13180
- "parts"
13181
- ]
13241
+ "parts",
13242
+ "fluid"
13243
+ ],
13244
+ fluid: {
13245
+ liquid: "disinfectant",
13246
+ liters: 0.5
13247
+ }
13182
13248
  },
13183
13249
  {
13184
13250
  id: "seasoning",
@@ -13398,8 +13464,12 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
13398
13464
  }
13399
13465
  ],
13400
13466
  estimated: [
13401
- "parts"
13402
- ]
13467
+ "parts",
13468
+ "powder"
13469
+ ],
13470
+ powder: {
13471
+ color: 15659508
13472
+ }
13403
13473
  },
13404
13474
  {
13405
13475
  id: "broom",
@@ -13511,8 +13581,13 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
13511
13581
  }
13512
13582
  ],
13513
13583
  estimated: [
13514
- "parts"
13515
- ]
13584
+ "parts",
13585
+ "fluid"
13586
+ ],
13587
+ fluid: {
13588
+ liquid: "fabric_softener",
13589
+ liters: 2
13590
+ }
13516
13591
  },
13517
13592
  {
13518
13593
  id: "clothespins",
@@ -13941,9 +14016,8 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
13941
14016
  shed: false
13942
14017
  },
13943
14018
  use: {
13944
- clip: "open_can_eat",
14019
+ clip: "eat_food",
13945
14020
  sounds: [
13946
- "can_open",
13947
14021
  "chew"
13948
14022
  ]
13949
14023
  },
@@ -14111,9 +14185,8 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
14111
14185
  shed: false
14112
14186
  },
14113
14187
  use: {
14114
- clip: "open_can_drink",
14188
+ clip: "drink",
14115
14189
  sounds: [
14116
- "can_open",
14117
14190
  "gulp"
14118
14191
  ]
14119
14192
  },
@@ -18684,6 +18757,17 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
18684
18757
  clip: "turn_key"
18685
18758
  }
18686
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
+ },
18687
18771
  {
18688
18772
  id: "swap_bag",
18689
18773
  effect: "swap_bag",
@@ -18883,7 +18967,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
18883
18967
  var liquidContainer = {
18884
18968
  id: "liquid_container",
18885
18969
  check: (item) => {
18886
- const fluid = item.fluid;
18970
+ const fluid = itemFluid(item);
18887
18971
  if (fluid) {
18888
18972
  const problems = [];
18889
18973
  if (typeof fluid.liquid !== "string" || !SNAKE_CASE.test(fluid.liquid)) problems.push("fluid.liquid must be a liquid id");
@@ -20534,6 +20618,26 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
20534
20618
  "brake_fluid"
20535
20619
  ]
20536
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
+ },
20537
20641
  {
20538
20642
  id: "shampoo",
20539
20643
  color: 6069216,
@@ -20555,6 +20659,65 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
20555
20659
  "sticky"
20556
20660
  ]
20557
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
+ },
20558
20721
  {
20559
20722
  id: "toothpaste",
20560
20723
  color: 16054008,
@@ -20768,7 +20931,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
20768
20931
 
20769
20932
  // src/item-use.ts
20770
20933
  var drinkHydrationOf = (item, liquids = LIQUIDS) => {
20771
- const fluid = item.fluid;
20934
+ const fluid = itemFluid(item);
20772
20935
  const drink = fluid ? liquids.find((liquid) => liquid.id === fluid.liquid)?.drink : void 0;
20773
20936
  if (!fluid || !drink) return void 0;
20774
20937
  const doses = item.durability?.kind === "doses" ? Math.max(1, item.durability.amount ?? 1) : 1;