@adatechnology/game-items-goods 0.3.1 → 0.3.3

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.
@@ -55,6 +55,7 @@ var GameItemsGoods = (() => {
55
55
  });
56
56
 
57
57
  // ../game-contracts/dist/index.js
58
+ var DEFAULT_COST_ALLOCATION_BYTES = 1024 * 1024;
58
59
  var STRUCTURE_ROLES = ["foundation", "column", "beam", "slab", "wall", "partition", "roof", "stair", "none"];
59
60
  var BEARS = [true, false, "a_on_b", "b_on_a"];
60
61
  var finite = (n) => typeof n === "number" && Number.isFinite(n);
@@ -157,6 +158,38 @@ var GameItemsGoods = (() => {
157
158
  }
158
159
  return { ok: problems.length === 0, problems, warnings };
159
160
  };
161
+ var DEFERRED_QUEUE_ID = {
162
+ DESTRUCTION_EVENTS: "destruction.events",
163
+ BREACH_PAINT: "floorplan.breach-paint",
164
+ AUDIO_VOICES: "audio.voices",
165
+ VEHICLE_CREASE: "vehicles.crease"
166
+ };
167
+ var DEFERRED_PRIORITY = {
168
+ [DEFERRED_QUEUE_ID.DESTRUCTION_EVENTS]: { priority: 300, phase: "present" },
169
+ [DEFERRED_QUEUE_ID.BREACH_PAINT]: { priority: 250, phase: "present" },
170
+ [DEFERRED_QUEUE_ID.AUDIO_VOICES]: { priority: 200, phase: "idle", reserveMs: 1 },
171
+ [DEFERRED_QUEUE_ID.VEHICLE_CREASE]: { priority: 100, phase: "idle" }
172
+ };
173
+ var WARNED_KEY = /* @__PURE__ */ Symbol.for("@adatechnology/game-contracts.warned");
174
+ var warnedKeys = () => {
175
+ const holder = globalThis;
176
+ return holder[WARNED_KEY] ?? (holder[WARNED_KEY] = /* @__PURE__ */ new Set());
177
+ };
178
+ var isProduction = () => {
179
+ try {
180
+ return process.env.NODE_ENV === "production";
181
+ } catch {
182
+ return false;
183
+ }
184
+ };
185
+ var isQuiet = () => globalThis.__GAME_KIT_QUIET__ === true;
186
+ var warnOnce = (key, message) => {
187
+ if (isQuiet() || isProduction()) return;
188
+ const seen = warnedKeys();
189
+ if (seen.has(key)) return;
190
+ seen.add(key);
191
+ console.warn(`[game-kit] ${message}`);
192
+ };
160
193
  var UNSAFE_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
161
194
  var isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && Object.getPrototypeOf(value) === Object.prototype;
162
195
  var deepMerge = (base, patch) => {
@@ -178,10 +211,13 @@ var GameItemsGoods = (() => {
178
211
  for (const [id, patch] of Object.entries(patches ?? {})) {
179
212
  const entry = entries.get(id);
180
213
  if (entry) entries.set(id, deepMerge(entry, patch));
214
+ else warnOnce(`registry.patch.${id}`, `patch for "${id}" ignored: no entry has that id`);
181
215
  }
182
216
  };
183
217
  var removeIds = (entries, ids) => {
184
- for (const id of ids ?? []) entries.delete(id);
218
+ for (const id of ids ?? []) {
219
+ if (!entries.delete(id)) warnOnce(`registry.remove.${id}`, `remove of "${id}" ignored: no entry has that id`);
220
+ }
185
221
  };
186
222
  var defineCategories = (defs, options = {}) => {
187
223
  const problems = [];
@@ -286,6 +322,42 @@ var GameItemsGoods = (() => {
286
322
  }
287
323
  return { ok: problems.length === 0, problems: [...new Set(problems)], allowed };
288
324
  };
325
+ var SURFACE_IDS = ["concrete", "asphalt", "wood", "tile", "dirt", "grass", "gravel", "sand", "metal", "water", "glass", "carpet"];
326
+ var GAIT_IDS = ["walk", "run"];
327
+ var LANDING_IDS = ["light", "heavy"];
328
+ var BODY_SOUND_IDS = [
329
+ "jump",
330
+ "cloth_rustle",
331
+ "body_fall",
332
+ "fall_damage",
333
+ "player_hurt",
334
+ "player_breath_run",
335
+ "player_death",
336
+ "bite",
337
+ "grab",
338
+ "punch_swing",
339
+ "punch_hit_body",
340
+ "punch_hit_face",
341
+ "punch_hit_object",
342
+ "kick_swing",
343
+ "kick_hit",
344
+ "kick_hit_object",
345
+ "shove_two_hands",
346
+ "knife_swing",
347
+ "knife_stab",
348
+ "knife_slash",
349
+ "knife_hit_object",
350
+ "blunt_swing",
351
+ "blunt_hit",
352
+ "blunt_hit_object",
353
+ "axe_swing",
354
+ "axe_chop",
355
+ "axe_hit_object"
356
+ ];
357
+ var footstepSoundId = (surface, gait) => `footstep_${surface}_${gait}`;
358
+ var FOOTSTEP_SOUND_IDS = SURFACE_IDS.flatMap((surface) => GAIT_IDS.map((gait) => footstepSoundId(surface, gait)));
359
+ var LAND_SOUND_IDS = SURFACE_IDS.flatMap((surface) => LANDING_IDS.map((landing) => `land_${surface}_${landing}`));
360
+ var BODY_FOLEY_IDS = [...FOOTSTEP_SOUND_IDS, ...LAND_SOUND_IDS, ...BODY_SOUND_IDS];
289
361
 
290
362
  // ../game-items/dist/index.js
291
363
  var ITEM_CATEGORIES = [