@adatechnology/game-weapons-three 0.13.0 → 0.13.1

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.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { I as ItemModels, W as WeaponProps, a as WeaponItemModel, M as ModelKit, b as WeaponModel, c as ModelParts, d as ModelFamily, A as AttachmentModelRegistry, L as LaserRaycast } from './testing-BoxqhX_W.js';
2
- export { e as ARCHETYPE_MODELS, f as AttachmentBuildContext, g as AttachmentModel, h as AttachmentModelBuilder, C as CLASS_REFERENCE_ENERGY, i as COUNTER_ITEM_ID, j as CUES_IN_SAMPLE, k as CasingSound, l as CuePlayed, D as DEFAULT_ENERGY_CURVE, m as DEFAULT_EXPLOSIVES_SCENE, n as DistanceCurve, E as EXPLOSIVES_AREA_ID, o as EXPLOSIVES_TEXT, p as EnergyCurve, q as ExplosivesRoom, r as ExplosivesScene, s as ExplosivesTestModuleOptions, t as ExplosivesText, F as FlybySound, u as FxLayers, G as GAME_DISTANCE_CURVE, v as GAME_SOUND_CLASSES, w as GUNSHOT_PROFILES, x as GUNSHOT_SAMPLE, y as GUNSHOT_SAMPLE_IDS, z as Gunshot, B as GunshotInput, H as GunshotPlayed, J as ItemModelRequest, K as MECHANICAL_SOUNDS, N as MODEL_ENTRIES, O as MOUNTED_M134_ITEM_ID, P as MechanicalSoundId, Q as ModelEntry, R as ModelMaterials, S as ModelOptions, T as MountFrame, U as RELOAD_SAMPLE, V as RELOAD_SAMPLE_HITS, X as ShotExtras, Y as ShotSound, Z as ShotSoundClass, _ as ShotSoundInput, $ as ShotSoundOptions, a0 as SoundClassDef, a1 as SoundStep, a2 as WEAPON_ITEM_PREFIX, a3 as WEIGHT_INTENSITY, a4 as WeaponAudio, a5 as WeaponAudioOptions, a6 as WeaponFx, a7 as WeaponFxOptions, a8 as WeaponSampleOptions, a9 as WeaponsTestModuleOptions, aa as buildItemWeaponModel, ab as buildWeaponModel, ac as buildWeaponModelById, ad as computeCasingSound, ae as computeFlyby, af as computeGunshot, ag as computeShotSound, ah as createExplosivesTestModule, ai as createWeaponAudio, aj as createWeaponFx, ak as createWeaponsTestModule, al as defaultWeaponProps, am as deriveFrames, an as explosivesTextOf, ao as hasWeaponModel, ap as itemModelOfWeapon, aq as mechanicalSoundOf, ar as modelKit, as as mountFrame, at as registerWeaponItemModel, au as weaponSampleBank, av as weaponSampleDefaults, aw as weaponsLayout } from './testing-BoxqhX_W.js';
1
+ import { I as ItemModels, W as WeaponProps, a as WeaponItemModel, M as ModelKit, b as WeaponModel, c as ModelParts, d as ModelFamily, A as AttachmentModelRegistry, L as LaserRaycast } from './testing-DjtsFm2m.js';
2
+ export { e as ARCHETYPE_MODELS, f as AttachmentBuildContext, g as AttachmentModel, h as AttachmentModelBuilder, C as CLASS_REFERENCE_ENERGY, i as COUNTER_ITEM_ID, j as CUES_IN_SAMPLE, k as CasingSound, l as CuePlayed, D as DEFAULT_ENERGY_CURVE, m as DEFAULT_EXPLOSIVES_SCENE, n as DistanceCurve, E as EXPLOSIVES_AREA_ID, o as EXPLOSIVES_TEXT, p as EnergyCurve, q as ExplosivesRoom, r as ExplosivesScene, s as ExplosivesTestModuleOptions, t as ExplosivesText, F as FlybySound, u as FxLayers, G as GAME_DISTANCE_CURVE, v as GAME_SOUND_CLASSES, w as GUNSHOT_PROFILES, x as GUNSHOT_SAMPLE, y as GUNSHOT_SAMPLE_IDS, z as Gunshot, B as GunshotInput, H as GunshotPlayed, J as ItemModelRequest, K as MECHANICAL_SOUNDS, N as MODEL_ENTRIES, O as MOUNTED_M134_ITEM_ID, P as MechanicalSoundId, Q as ModelEntry, R as ModelMaterials, S as ModelOptions, T as MountFrame, U as RELOAD_SAMPLE, V as RELOAD_SAMPLE_HITS, X as ShotExtras, Y as ShotSound, Z as ShotSoundClass, _ as ShotSoundInput, $ as ShotSoundOptions, a0 as SoundClassDef, a1 as SoundStep, a2 as WEAPON_ITEM_PREFIX, a3 as WEIGHT_INTENSITY, a4 as WeaponAudio, a5 as WeaponAudioOptions, a6 as WeaponFx, a7 as WeaponFxOptions, a8 as WeaponSampleOptions, a9 as WeaponsTestModuleOptions, aa as buildItemWeaponModel, ab as buildWeaponModel, ac as buildWeaponModelById, ad as computeCasingSound, ae as computeFlyby, af as computeGunshot, ag as computeShotSound, ah as createExplosivesTestModule, ai as createWeaponAudio, aj as createWeaponFx, ak as createWeaponsTestModule, al as defaultWeaponProps, am as deriveFrames, an as explosivesTextOf, ao as hasWeaponModel, ap as itemModelOfWeapon, aq as mechanicalSoundOf, ar as modelKit, as as mountFrame, at as registerWeaponItemModel, au as weaponSampleBank, av as weaponSampleDefaults, aw as weaponsLayout } from './testing-DjtsFm2m.js';
3
3
  import * as THREE_NS from 'three';
4
4
  import { TestableItem, Vec3, HostEvent, EffectSink, DestructibleSpec, DeepPartial, ToolClipSet } from '@adatechnology/game-contracts';
5
5
  import { ExplosiveDef, Arsenal, WeaponDef, CartridgeDims, CaliberDef, CaseType, ReloadFamily, FittedAttachment, AttachmentDef } from '@adatechnology/game-weapons';
@@ -36893,7 +36893,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
36893
36893
  };
36894
36894
  var accessoryTextOf = (locale) => ACCESSORY_TEXT[locale] ?? ACCESSORY_TEXT.en;
36895
36895
 
36896
- // ../game-audio/dist/chunk-7TLFY7VO.js
36896
+ // ../game-audio/dist/chunk-KBTUANNG.js
36897
36897
  var DISTANCE_CURVES = {
36898
36898
  /** The game's `sfx`: `vol / (1 + d² × 0.004)`, cutoff `/ (1 + d × 0.01)`, silent below 0.01 (jogo L62091–62092, L62101). */
36899
36899
  game_sfx: { model: "inverse_square", k: 4e-3, cutoffK: 0.01, minGain: 0.01 },
@@ -38762,10 +38762,12 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
38762
38762
  noise: () => noiseBuffer(store, audio, mix3.noise.seconds),
38763
38763
  time
38764
38764
  });
38765
+ const recipeBank = registry.bankOf(plan.id);
38765
38766
  announce({
38766
38767
  id: plan.id,
38767
38768
  kind: "recipe",
38768
38769
  ...fallbackOf ? { fallbackOf } : {},
38770
+ ...recipeBank ? { bank: recipeBank } : {},
38769
38771
  requestedAt,
38770
38772
  startAt: time,
38771
38773
  outputLatency: latencyOf(audio),
@@ -38867,9 +38869,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
38867
38869
  const time = requestedAt + (playOptions.delay ?? 0);
38868
38870
  const chokeList = sample.choke ? choked(sample.id) : void 0;
38869
38871
  const realized = realizeSample(plan, { context: audio, output: sampleOutput(plan.bus), buffer: (url2) => sampleStore.buffer(url2), time });
38872
+ const sampleBank = registry.bankOf(plan.id);
38870
38873
  announce({
38871
38874
  id: plan.id,
38872
38875
  kind: "sample",
38876
+ ...sampleBank ? { bank: sampleBank } : {},
38873
38877
  requestedAt,
38874
38878
  startAt: time,
38875
38879
  outputLatency: latencyOf(audio),
@@ -39190,7 +39194,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
39190
39194
  ["casing_drop_terra_pistol", 1],
39191
39195
  ["casing_drop_terra_rifle", 1],
39192
39196
  ["casing_drop_terra_shell", 1],
39193
- ["rocket_fire", 2]
39197
+ ["rocket_fire", 2],
39198
+ ["smg_45_auto", 2, "sfx_pistol"],
39199
+ ["weapon_draw", 2],
39200
+ ["suppressor_attach", 3],
39201
+ ["suppressor_detach", 3]
39194
39202
  ]),
39195
39203
  ...entries("explosoes-fogo", [
39196
39204
  ["explosion_grenade", 1, "boom"],
@@ -39204,7 +39212,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
39204
39212
  ["fire_loop_large", 1],
39205
39213
  ["fire_extinguish", 2, "hiss"],
39206
39214
  ["gas_leak_hiss", 2],
39207
- ["structure_collapse", 2, "crumble"]
39215
+ ["structure_collapse", 2, "crumble"],
39216
+ ["grenade_bounce", 1],
39217
+ ["c4_plant", 2],
39218
+ ["c4_beep", 2],
39219
+ ["c4_disarm", 2]
39208
39220
  ]),
39209
39221
  ...entries("personagem", [
39210
39222
  ["footstep_concrete_walk", 1, "sfx_step"],
@@ -39220,7 +39232,19 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
39220
39232
  ["blunt_hit", 1],
39221
39233
  ["bite", 1, "sfx_flesh"],
39222
39234
  ["body_fall", 1],
39223
- ["player_hurt", 2]
39235
+ ["player_hurt", 2],
39236
+ ["footstep_tile_walk", 1, "sfx_step"],
39237
+ ["footstep_water_walk", 1, "sfx_step"],
39238
+ ["footstep_grate_walk", 2, "sfx_step"],
39239
+ ["footstep_duct_walk", 3, "sfx_step"],
39240
+ ["ladder_climb", 2],
39241
+ ["swim", 2],
39242
+ ["zombie_groan", 1],
39243
+ ["zombie_alert", 1],
39244
+ ["zombie_attack", 1],
39245
+ ["zombie_pain", 1],
39246
+ ["zombie_claw_hit", 1, "sfx_flesh"],
39247
+ ["zombie_claw_miss", 2]
39224
39248
  ]),
39225
39249
  ...entries("veiculos", [
39226
39250
  ["engine_loop_car", 1],
@@ -39248,7 +39272,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
39248
39272
  ["wind_loop", 2],
39249
39273
  ["thunder_near", 2],
39250
39274
  ["thunder_far", 2],
39251
- ["water_splash", 2]
39275
+ ["water_splash", 2],
39276
+ ["helicopter_loop", 3]
39252
39277
  ])
39253
39278
  ];
39254
39279
  var SFX_MATERIALS = [
@@ -39330,6 +39355,60 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
39330
39355
  burst: 20,
39331
39356
  burstSpacing: 0.06
39332
39357
  };
39358
+ var SFX_TIERS = { light: 0, medium: 0.34, heavy: 0.67 };
39359
+ function splitTier(id) {
39360
+ const match = /^(.*)_(light|medium|heavy)$/.exec(id);
39361
+ return match ? { base: match[1], tier: match[2] } : { base: id };
39362
+ }
39363
+ var refsOf = (entries2, baseUrl) => (entries2 ?? []).map((entry2) => ({ url: `${baseUrl}${entry2.file}` }));
39364
+ function sampleBankFromManifest(manifest, options) {
39365
+ const baseUrl = options.baseUrl ?? "";
39366
+ const samples = [];
39367
+ const tiersOf = /* @__PURE__ */ new Map();
39368
+ for (const sound3 of manifest.sounds) {
39369
+ const { base, tier } = splitTier(sound3.id);
39370
+ if (tier) tiersOf.set(base, [...tiersOf.get(base) ?? [], sound3]);
39371
+ }
39372
+ const bases = /* @__PURE__ */ new Map();
39373
+ for (const sound3 of manifest.sounds) {
39374
+ if (!splitTier(sound3.id).tier) bases.set(sound3.id, sound3);
39375
+ }
39376
+ for (const [base, tiers] of tiersOf) {
39377
+ if (!bases.has(base)) bases.set(base, { id: base, category: tiers[0]?.category ?? "", layers: { close: tiers[0]?.layers.close ?? [] } });
39378
+ }
39379
+ for (const sound3 of bases.values()) {
39380
+ const numbers = options.sounds?.[sound3.id] ?? options.defaults?.(sound3);
39381
+ const close = refsOf(sound3.layers.close, baseUrl);
39382
+ if (!numbers || close.length === 0) continue;
39383
+ const tiers = (tiersOf.get(sound3.id) ?? []).map((tier) => {
39384
+ const name = splitTier(tier.id).tier;
39385
+ const tierFar = refsOf(tier.layers.far, baseUrl);
39386
+ return { name, from: SFX_TIERS[name] ?? 0, close: refsOf(tier.layers.close, baseUrl), ...tierFar.length > 0 ? { far: tierFar } : {} };
39387
+ }).sort((a, b) => a.from - b.from);
39388
+ const far = refsOf(sound3.layers.far, baseUrl);
39389
+ const indoor = refsOf(sound3.layers.tail_in, baseUrl);
39390
+ const outdoor = refsOf(sound3.layers.tail_out, baseUrl);
39391
+ const files = [sound3, ...tiersOf.get(sound3.id) ?? []].flatMap((entry2) => Object.values(entry2.layers).flatMap((entries2) => entries2 ?? []));
39392
+ samples.push({
39393
+ id: sound3.id,
39394
+ bus: numbers.bus,
39395
+ close,
39396
+ ...far.length > 0 ? { far } : {},
39397
+ ...tiers.length > 0 ? { tiers } : {},
39398
+ ...numbers.crossover ? { crossover: numbers.crossover } : {},
39399
+ ...indoor.length > 0 || outdoor.length > 0 ? { tail: { ...indoor.length > 0 ? { indoor } : {}, ...outdoor.length > 0 ? { outdoor } : {}, ...numbers.tailGain === void 0 ? {} : { gain: numbers.tailGain } } } : {},
39400
+ ...numbers.pitch === void 0 ? {} : { pitch: numbers.pitch },
39401
+ ...numbers.gain === void 0 ? {} : { gain: numbers.gain },
39402
+ ...numbers.falloff ? { falloff: numbers.falloff } : {},
39403
+ ...numbers.cutoffK === void 0 ? {} : { cutoffK: numbers.cutoffK },
39404
+ ...numbers.group ? { group: numbers.group } : {},
39405
+ ...numbers.priority === void 0 ? {} : { priority: numbers.priority },
39406
+ ...numbers.fallback ? { fallback: numbers.fallback } : {},
39407
+ sources: files.map((file) => `${file.file}: ${file.source} ${file.author} ${file.license}`)
39408
+ });
39409
+ }
39410
+ return { id: options.id, samples };
39411
+ }
39333
39412
  var PT = {
39334
39413
  group: "Som",
39335
39414
  name: "Painel de som (arquivos e C1\u2013C10)",
@@ -39337,6 +39416,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
39337
39416
  category: "1 \xB7 Categoria",
39338
39417
  sound: "1 \xB7 Som",
39339
39418
  play: "1 \xB7 \u25B6 Tocar",
39419
+ play_user: "1 \xB7 \u25B6 Tocar o seu",
39340
39420
  material: "2 \xB7 Material",
39341
39421
  blow: "2 \xB7 Golpe",
39342
39422
  strike: "2 \xB7 \u25B6 Tocar golpe",
@@ -39358,6 +39438,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
39358
39438
  approve: "5 \xB7 Aprovo (C10)"
39359
39439
  },
39360
39440
  hints: {
39441
+ play_user: "Toca a sua grava\xE7\xE3o deste som (dos seus pacotes, fora do git), mesmo quando o SDK tem uma melhor e toca na frente.",
39361
39442
  sound: "A = arquivo, S = sintetizado, F = faltando. O que tem arquivo toca o arquivo; o resto toca o som atual.",
39362
39443
  strike: "Toca impact_<material>_<golpe>: o arquivo se existir, sen\xE3o o som atual daquele material.",
39363
39444
  wall: "P\xF5e a parede de casa entre voc\xEA e a fonte: o som fica abafado (C4).",
@@ -39402,9 +39483,10 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
39402
39483
  strengths: { light: "leve", medium: "m\xE9dio", heavy: "forte" },
39403
39484
  states: { file: "A", synth: "S", missing: "F" },
39404
39485
  criteria: { C1: "C1 Sincronia", C2: "C2 Certo p/ a\xE7\xE3o", C3: "C3 Dist\xE2ncia", C4: "C4 Posi\xE7\xE3o", C5: "C5 Varia\xE7\xE3o", C6: "C6 Volume", C7: "C7 Intensidade", C8: "C8 Cauda", C9: "C9 Rajada", C10: "C10 Escuta" },
39405
- metrics: { chosen: "1 \xB7 Escolhido", matrix: "2 \xB7 Matriz", last: "\xDAltimo tocado", ab: "4 \xB7 A \xD7 B", blind: "4 \xB7 X", verdicts: "4 \xB7 Prefer\xEAncias", state: "5 \xB7 Medi\xE7\xE3o", count: "1 \xB7 Cat\xE1logo" },
39486
+ metrics: { source: "1 \xB7 Fonte do que tocou", chosen: "1 \xB7 Escolhido", matrix: "2 \xB7 Matriz", last: "\xDAltimo tocado", ab: "4 \xB7 A \xD7 B", blind: "4 \xB7 X", verdicts: "4 \xB7 Prefer\xEAncias", state: "5 \xB7 Medi\xE7\xE3o", count: "1 \xB7 Cat\xE1logo" },
39406
39487
  run: { idle: "parada", measuring: "medindo\u2026", done: "pronta", failed: "falhou", recording: "gravando\u2026", recorded: "grava\xE7\xE3o baixada" },
39407
39488
  words: { none: "\u2014", hidden: "? (revele)", prefers: "prefere", approved: "aprovado pelo dono" },
39489
+ sources: { sdk: "SDK", user: "seu som", synth: "sintetizado" },
39408
39490
  probe: "Fonte do som",
39409
39491
  wall: "Parede (oclus\xE3o)",
39410
39492
  scenarios: { pipeline: "Arquivo \u2192 decodifica \u2192 toca (round-robin, cauda)", criteria: "Crit\xE9rios C1\u2013C9 no som de calibra\xE7\xE3o", loop: "Loop de arquivo: emenda sem buraco (crossfade)", panel: "Painel: categorias, matriz, A/B e parede" }
@@ -39417,6 +39499,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
39417
39499
  category: "1 \xB7 Category",
39418
39500
  sound: "1 \xB7 Sound",
39419
39501
  play: "1 \xB7 \u25B6 Play",
39502
+ play_user: "1 \xB7 \u25B6 Play yours",
39420
39503
  material: "2 \xB7 Material",
39421
39504
  blow: "2 \xB7 Blow",
39422
39505
  strike: "2 \xB7 \u25B6 Play blow",
@@ -39438,6 +39521,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
39438
39521
  approve: "5 \xB7 Approve (C10)"
39439
39522
  },
39440
39523
  hints: {
39524
+ play_user: "Plays your own take of this sound (from your packs, kept out of git), even where the SDK has a better one that plays first.",
39441
39525
  sound: "A = file, S = synthesized, F = missing. A file plays the file; the rest plays the current sound.",
39442
39526
  strike: "Plays impact_<material>_<blow>: the file if there is one, else the current sound of that material.",
39443
39527
  wall: "Puts the house wall between you and the source: the sound is muffled (C4).",
@@ -39472,69 +39556,16 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
39472
39556
  environments: { indoor: "indoor", outdoor: "outdoor" },
39473
39557
  strengths: { light: "light", medium: "medium", heavy: "heavy" },
39474
39558
  criteria: { C1: "C1 Sync", C2: "C2 Right sound", C3: "C3 Distance", C4: "C4 Position", C5: "C5 Variation", C6: "C6 Level", C7: "C7 Strength", C8: "C8 Tail", C9: "C9 Burst", C10: "C10 Listening" },
39475
- metrics: { chosen: "1 \xB7 Chosen", matrix: "2 \xB7 Matrix", last: "Last played", ab: "4 \xB7 A \xD7 B", blind: "4 \xB7 X", verdicts: "4 \xB7 Preferences", state: "5 \xB7 Measurement", count: "1 \xB7 Catalogue" },
39559
+ metrics: { source: "1 \xB7 Source of what played", chosen: "1 \xB7 Chosen", matrix: "2 \xB7 Matrix", last: "Last played", ab: "4 \xB7 A \xD7 B", blind: "4 \xB7 X", verdicts: "4 \xB7 Preferences", state: "5 \xB7 Measurement", count: "1 \xB7 Catalogue" },
39476
39560
  run: { idle: "idle", measuring: "measuring\u2026", done: "done", failed: "failed", recording: "recording\u2026", recorded: "recording downloaded" },
39477
39561
  words: { none: "\u2014", hidden: "? (reveal)", prefers: "prefers", approved: "approved by the owner" },
39562
+ sources: { sdk: "SDK", user: "your sound", synth: "synthesized" },
39478
39563
  probe: "Sound source",
39479
39564
  wall: "Wall (occlusion)",
39480
39565
  scenarios: { pipeline: "File \u2192 decode \u2192 play (round-robin, tail)", criteria: "Criteria C1\u2013C9 on the calibration sound", loop: "File loop: seamless joins (crossfade)", panel: "Panel: categories, matrix, A/B and wall" }
39481
39566
  };
39482
39567
 
39483
39568
  // ../game-audio/dist/index.js
39484
- var SFX_TIERS = { light: 0, medium: 0.34, heavy: 0.67 };
39485
- function splitTier(id) {
39486
- const match = /^(.*)_(light|medium|heavy)$/.exec(id);
39487
- return match ? { base: match[1], tier: match[2] } : { base: id };
39488
- }
39489
- var refsOf = (entries2, baseUrl) => (entries2 ?? []).map((entry2) => ({ url: `${baseUrl}${entry2.file}` }));
39490
- function sampleBankFromManifest(manifest, options) {
39491
- const baseUrl = options.baseUrl ?? "";
39492
- const samples = [];
39493
- const tiersOf = /* @__PURE__ */ new Map();
39494
- for (const sound3 of manifest.sounds) {
39495
- const { base, tier } = splitTier(sound3.id);
39496
- if (tier) tiersOf.set(base, [...tiersOf.get(base) ?? [], sound3]);
39497
- }
39498
- const bases = /* @__PURE__ */ new Map();
39499
- for (const sound3 of manifest.sounds) {
39500
- if (!splitTier(sound3.id).tier) bases.set(sound3.id, sound3);
39501
- }
39502
- for (const [base, tiers] of tiersOf) {
39503
- if (!bases.has(base)) bases.set(base, { id: base, category: tiers[0]?.category ?? "", layers: { close: tiers[0]?.layers.close ?? [] } });
39504
- }
39505
- for (const sound3 of bases.values()) {
39506
- const numbers = options.sounds?.[sound3.id] ?? options.defaults?.(sound3);
39507
- const close = refsOf(sound3.layers.close, baseUrl);
39508
- if (!numbers || close.length === 0) continue;
39509
- const tiers = (tiersOf.get(sound3.id) ?? []).map((tier) => {
39510
- const name = splitTier(tier.id).tier;
39511
- const tierFar = refsOf(tier.layers.far, baseUrl);
39512
- return { name, from: SFX_TIERS[name] ?? 0, close: refsOf(tier.layers.close, baseUrl), ...tierFar.length > 0 ? { far: tierFar } : {} };
39513
- }).sort((a, b) => a.from - b.from);
39514
- const far = refsOf(sound3.layers.far, baseUrl);
39515
- const indoor = refsOf(sound3.layers.tail_in, baseUrl);
39516
- const outdoor = refsOf(sound3.layers.tail_out, baseUrl);
39517
- const files = [sound3, ...tiersOf.get(sound3.id) ?? []].flatMap((entry2) => Object.values(entry2.layers).flatMap((entries2) => entries2 ?? []));
39518
- samples.push({
39519
- id: sound3.id,
39520
- bus: numbers.bus,
39521
- close,
39522
- ...far.length > 0 ? { far } : {},
39523
- ...tiers.length > 0 ? { tiers } : {},
39524
- ...numbers.crossover ? { crossover: numbers.crossover } : {},
39525
- ...indoor.length > 0 || outdoor.length > 0 ? { tail: { ...indoor.length > 0 ? { indoor } : {}, ...outdoor.length > 0 ? { outdoor } : {}, ...numbers.tailGain === void 0 ? {} : { gain: numbers.tailGain } } } : {},
39526
- ...numbers.pitch === void 0 ? {} : { pitch: numbers.pitch },
39527
- ...numbers.gain === void 0 ? {} : { gain: numbers.gain },
39528
- ...numbers.falloff ? { falloff: numbers.falloff } : {},
39529
- ...numbers.cutoffK === void 0 ? {} : { cutoffK: numbers.cutoffK },
39530
- ...numbers.group ? { group: numbers.group } : {},
39531
- ...numbers.priority === void 0 ? {} : { priority: numbers.priority },
39532
- ...numbers.fallback ? { fallback: numbers.fallback } : {},
39533
- sources: files.map((file) => `${file.file}: ${file.source} ${file.author} ${file.license}`)
39534
- });
39535
- }
39536
- return { id: options.id, samples };
39537
- }
39538
39569
  var ATTACK = 2e-3;
39539
39570
  function lengthOf(d, attack) {
39540
39571
  if (typeof d === "number") return attack + d;