@adatechnology/game-destruction-three 0.16.0 → 0.17.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.d.ts +6 -1
- package/dist/index.global.js +81 -60
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +17 -5
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -3542,8 +3542,8 @@ var Renderer = class {
|
|
|
3542
3542
|
}
|
|
3543
3543
|
case "melt":
|
|
3544
3544
|
this.activate(ev.object, ev.part);
|
|
3545
|
-
if (this.time - (this.throttles.get(`melt:${ev.object}
|
|
3546
|
-
this.throttles.set(`melt:${ev.object}
|
|
3545
|
+
if (this.time - (this.throttles.get(`melt:${ev.object}`) ?? -9) > 1.5) {
|
|
3546
|
+
this.throttles.set(`melt:${ev.object}`, this.time);
|
|
3547
3547
|
this.sound("melt_sizzle", this.rootPoint(ev.object), 0.4);
|
|
3548
3548
|
}
|
|
3549
3549
|
break;
|
|
@@ -4635,7 +4635,7 @@ var BLAST_SOUND_OF = {
|
|
|
4635
4635
|
};
|
|
4636
4636
|
|
|
4637
4637
|
// src/audio/recipes.ts
|
|
4638
|
-
var scene = (id, layers, line, vars) => sceneRecipe2(id, layers, line, vars ? { vars } : {});
|
|
4638
|
+
var scene = (id, layers, line, vars, group) => sceneRecipe2(id, layers, line, { ...vars ? { vars } : {}, ...group ? { group } : {} });
|
|
4639
4639
|
var boomLayers = (big) => [
|
|
4640
4640
|
noise2({ f: 1200, f2: 120, d: 1.8, vol: 2, wet: 1.2 }),
|
|
4641
4641
|
tone2({ f: 65, f2: 24, d: 1, vol: 1.8 }),
|
|
@@ -4654,7 +4654,8 @@ var SCENE_SOUNDS = [
|
|
|
4654
4654
|
[noise2({ type: "bandpass", f: 850, q: 1, d: 0.25, vol: 0.9, wet: 0.3 }), tone2({ f: 210, f2: 90, d: 0.1, vol: 0.6 }), noise2({ type: "highpass", f: 2e3, d: 0.04, vol: 0.5 })],
|
|
4655
4655
|
"L1360 wood"
|
|
4656
4656
|
),
|
|
4657
|
-
|
|
4657
|
+
// many parts coming loose at once share the `debris_knock` voices (game-audio voice-groups.json)
|
|
4658
|
+
scene("thunk", [noise2({ type: "bandpass", f: 700, q: 2, d: 0.07, vol: 0.4 })], "L1361 thunk", void 0, "debris_knock"),
|
|
4658
4659
|
scene("ping", [tone2({ f: [2600, 3500], f2: 1400, d: 0.14, vol: 0.18, wet: 0.3 })], "L1362 ping"),
|
|
4659
4660
|
scene("clang", [tone2({ f: [520, 720], f2: 480, d: 0.5, vol: 0.35, wet: 0.4 }), tone2({ f: 1370, f2: 1300, d: 0.3, vol: 0.15 }), noise2({ type: "highpass", f: 2e3, d: 0.05, vol: 0.5 })], "L1363 clang"),
|
|
4660
4661
|
scene("chip", [noise2({ type: "bandpass", f: 1600, q: 1.2, d: 0.06, vol: 0.5 })], "L1364 chip"),
|
|
@@ -4666,7 +4667,8 @@ var SCENE_SOUNDS = [
|
|
|
4666
4667
|
// `thud(x, z, v)`: `v` is the `scale` param (default 1)
|
|
4667
4668
|
scene("thud", [tone2({ f: 75, f2: 38, d: 0.22, vol: { param: "scale", scale: 0.6 } }), noise2({ f: 420, d: 0.16, vol: { param: "scale", scale: 0.45 } })], "L1358 thud", { scale: 1 }),
|
|
4668
4669
|
// `hiss(x, z, d)`: `seconds` is the param `d` (default 1.2)
|
|
4669
|
-
|
|
4670
|
+
// every melting part shares one `sizzle` voice
|
|
4671
|
+
scene("hiss", [noise2({ type: "highpass", f: 3500, a: 0.05, d: { param: "seconds" }, vol: 0.35 })], "L1366 hiss", { seconds: 1.2 }, "sizzle"),
|
|
4670
4672
|
scene("boom", boomLayers(false), "L1367 boom"),
|
|
4671
4673
|
scene("boom_big", boomLayers(true), "L1367 boom (big)"),
|
|
4672
4674
|
scene("burst", [noise2({ f: 700, f2: 120, d: 0.7, vol: 1.4, wet: 0.5 }), noise2({ type: "highpass", f: 3e3, a: 0.05, d: 1.2, vol: 0.4, delay: 0.1 })], "L1357 burst"),
|
|
@@ -4822,6 +4824,15 @@ var IMPACT_SOUND_KEYS = {
|
|
|
4822
4824
|
break_paper: { sound: "paper_tear" },
|
|
4823
4825
|
break_plant: { sound: "branch_cut" }
|
|
4824
4826
|
};
|
|
4827
|
+
var impactSoundIds = (rules = IMPACT_SOUND_KEYS) => {
|
|
4828
|
+
const ids = /* @__PURE__ */ new Set();
|
|
4829
|
+
for (const rule of Object.values(rules)) {
|
|
4830
|
+
ids.add(rule.sound);
|
|
4831
|
+
if (rule.above) ids.add(rule.above.sound);
|
|
4832
|
+
if (rule.fallback) ids.add(rule.fallback);
|
|
4833
|
+
}
|
|
4834
|
+
return [...ids];
|
|
4835
|
+
};
|
|
4825
4836
|
var DESTRUCTION_SOUND_KEYS = {
|
|
4826
4837
|
art_scene: {
|
|
4827
4838
|
impact_metal: { sound: "clang" },
|
|
@@ -5107,6 +5118,7 @@ export {
|
|
|
5107
5118
|
heatColor,
|
|
5108
5119
|
impactFamily,
|
|
5109
5120
|
impactKey,
|
|
5121
|
+
impactSoundIds,
|
|
5110
5122
|
impactSoundKeys,
|
|
5111
5123
|
ricochetSoundKeys,
|
|
5112
5124
|
shotKey,
|