@adatechnology/game-items-goods 0.7.1 → 0.7.2

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
@@ -11040,7 +11040,14 @@ var items_default = [
11040
11040
  stack: 6,
11041
11041
  shape: "cup",
11042
11042
  color: 14215408,
11043
- rarity: "common"
11043
+ rarity: "common",
11044
+ parts: [
11045
+ {
11046
+ id: "body",
11047
+ material: "glass",
11048
+ thickness: 3e-3
11049
+ }
11050
+ ]
11044
11051
  },
11045
11052
  {
11046
11053
  id: "cutlery",
@@ -18039,14 +18046,18 @@ var checkGoodsItems = (options = {}) => {
18039
18046
 
18040
18047
  // src/pack.ts
18041
18048
  var KINDS = createGoodsKinds();
18042
- var withSeal = (item) => {
18049
+ var withKind = (item) => {
18043
18050
  const kind = item.kind;
18044
- const seal = kind && KINDS.has(kind) ? KINDS.defaults(kind).seal : void 0;
18045
- return seal ? { ...item, seal: { ...seal, ...item.seal } } : item;
18051
+ if (!kind || !KINDS.has(kind)) return item;
18052
+ const defaults = KINDS.defaults(kind);
18053
+ const seal = defaults.seal;
18054
+ const parts2 = defaults.parts;
18055
+ const own = item.parts;
18056
+ return { ...item, ...seal ? { seal: { ...seal, ...item.seal } } : {}, ...!own && parts2 ? { parts: parts2 } : {} };
18046
18057
  };
18047
18058
  var goodsPack = {
18048
18059
  id: "goods",
18049
- items: GOODS_ITEMS.map(withSeal),
18060
+ items: GOODS_ITEMS.map(withKind),
18050
18061
  categories: GOODS_CATEGORIES,
18051
18062
  places: GOODS_PLACES,
18052
18063
  containers: GOODS_CONTAINERS,