Sfoglia il codice sorgente

Add gas and basic sounds

mass-vore
Fen Dweller 6 anni fa
parent
commit
2af5279d16
1 ha cambiato i file con 45 aggiunte e 5 eliminazioni
  1. +45
    -5
      stories/mass-vore.js

+ 45
- 5
stories/mass-vore.js Vedi File

@@ -1,12 +1,14 @@
(() => { (() => {
function devour(state, count) { 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) { function digest(state, count) {
if (count === undefined) { if (count === undefined) {
count = state.player.stats.stomach.value / 10; count = state.player.stats.stomach.value / 10;
} }
state.player.stats.stomach.value -= count; state.player.stats.stomach.value -= count;
state.player.stats.gas.value += count;
} }
stories.push({ stories.push({
id: "mass-vore", id: "mass-vore",
@@ -17,7 +19,8 @@
"Digestion" "Digestion"
], ],
sounds: [ sounds: [

"sfx/belches/belch.ogg",
"sfx/swallows/swallow.ogg"
], ],
preload: [ preload: [


@@ -25,14 +28,51 @@
intro: { intro: {
start: "city", start: "city",
setup: state => { 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 = { state.player.stats.stomach = {
name: "Stomach", name: "Stomach",
type: "meter", type: "meter",
value: 0, value: 0,
min: 0, min: 0,
max: 10000, 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({ startTimer({
id: "digestion", id: "digestion",
@@ -74,7 +114,7 @@
desc: "Munch!", desc: "Munch!",
execute: (room, state) => { execute: (room, state) => {
print(["Munch!"]); print(["Munch!"]);
devour(state, 100);
devour(state, 500);
} }
} }
], ],


Loading…
Annulla
Salva