From 2af5279d164d74d91b1a1adf432ef0f8d88b67f1 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Wed, 7 Aug 2019 16:03:01 -0400 Subject: [PATCH] Add gas and basic sounds --- stories/mass-vore.js | 50 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/stories/mass-vore.js b/stories/mass-vore.js index 79f2246..3ba3e7d 100644 --- a/stories/mass-vore.js +++ b/stories/mass-vore.js @@ -1,12 +1,14 @@ (() => { function devour(state, count) { - state.player.stats.stomach.value += 100; + state.player.stats.stomach.value += count; + playSfx("sfx/swallows/swallow.ogg") } function digest(state, count) { if (count === undefined) { count = state.player.stats.stomach.value / 10; } state.player.stats.stomach.value -= count; + state.player.stats.gas.value += count; } stories.push({ id: "mass-vore", @@ -17,7 +19,8 @@ "Digestion" ], sounds: [ - + "sfx/belches/belch.ogg", + "sfx/swallows/swallow.ogg" ], preload: [ @@ -25,14 +28,51 @@ intro: { start: "city", setup: state => { + state.player.stats.fullness = { + name: "Fullness", + type: "meter", + get value() { + return state.player.stats.gas.value + state.player.stats.stomach.value; + }, + min: 0, + max: 10000, + color: "rgb(200,20,100)" + }; + state.player.stats.gas = { + name: "Gas", + type: "meter", + value: 0, + min: 0, + get max() { + return 10000 - state.player.stats.stomach.value; + }, + color: "rgb(10,200,100)" + } state.player.stats.stomach = { name: "Stomach", type: "meter", value: 0, min: 0, max: 10000, - color: "rgb(200,20,100)" - }; + color: "rgb(255,10,150)" + } + + startTimer({ + id: "belch", + func: state => { + if (state.player.stats.gas.value > state.player.stats.gas.max) { + print(["BUURRRRRP!"]); + playSfx("sfx/belches/belch.ogg"); + state.player.stats.gas.value /= 3; + } + return true; + }, + delay: 100, + loop: true, + classes: [ + + ] + }, state); startTimer({ id: "digestion", @@ -74,7 +114,7 @@ desc: "Munch!", execute: (room, state) => { print(["Munch!"]); - devour(state, 100); + devour(state, 500); } } ],