| @@ -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); | |||
| } | |||
| } | |||
| ], | |||