From 64e76b2c5d850f59a7e1d24153afa865d0529de8 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Wed, 7 Aug 2019 16:34:00 -0400 Subject: [PATCH] Add randomized swallow sounds --- stories/mass-vore.js | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/stories/mass-vore.js b/stories/mass-vore.js index bfe2209..13d5910 100644 --- a/stories/mass-vore.js +++ b/stories/mass-vore.js @@ -1,8 +1,9 @@ (() => { function devour(state, count) { state.player.stats.stomach.value += count; - playSfx("sfx/swallows/swallow.ogg") + playRandomSfx("swallow"); } + function digest(state, count) { if (count === undefined) { count = state.player.stats.stomach.value / 200; @@ -10,6 +11,24 @@ state.player.stats.stomach.value -= count; state.player.stats.gas.value += count; } + + sfxGroups = { + "swallow": [ + "sfx/swallows/swallow-1.ogg", + "sfx/swallows/swallow-2.ogg", + "sfx/swallows/swallow-3.ogg", + "sfx/swallows/swallow-4.ogg", + "sfx/swallows/swallow-5.ogg", + "sfx/swallows/swallow-6.ogg", + "sfx/swallows/swallow-7.ogg", + ] + } + + function playRandomSfx(category) { + const choice = Math.floor(Math.random() * sfxGroups[category].length); + playSfx(sfxGroups[category][choice]); + } + stories.push({ id: "mass-vore", name: "Mass Vore", @@ -20,7 +39,13 @@ ], sounds: [ "sfx/belches/belch.ogg", - "sfx/swallows/swallow.ogg", + "sfx/swallows/swallow-1.ogg", + "sfx/swallows/swallow-2.ogg", + "sfx/swallows/swallow-3.ogg", + "sfx/swallows/swallow-4.ogg", + "sfx/swallows/swallow-5.ogg", + "sfx/swallows/swallow-6.ogg", + "sfx/swallows/swallow-7.ogg", "loop/stomach/stomach.ogg" ], preload: [