diff --git a/satiate.js b/satiate.js index 74d2b9f..18ecfb3 100644 --- a/satiate.js +++ b/satiate.js @@ -22,6 +22,11 @@ function print(lines) { log.scrollTop = log.scrollHeight; } +function printRandom(list) { + let choice = Math.floor(Math.random() * list.length) + print(list[choice]) +} + function refresh() { updateRoom(state); updateStatDisplay(state.info, "world"); diff --git a/stories/fen-snack.js b/stories/fen-snack.js index 29078fb..93f4cc2 100644 --- a/stories/fen-snack.js +++ b/stories/fen-snack.js @@ -32,6 +32,22 @@ stories.push({ state.player.stats.health = {name: "Health", type: "meter", value: 100, min: 0, max: 100, color: "rgb(255,0,0)"}; state.player.stats.stamina = {name: "Stamina", type: "meter", value: 100, min: 0, max: 100, color: "rgb(100,255,0)"}; + startTimer({ + id: "taunting", + func: state => { + printRandom([ + ["The crux strokes over his snarling gut, enjoying your dwindling squirms."], + ["\"Enjoying yourself, meal?\"", "Your captor's oh-so-smug voice booms in your ears."] + ]) + return 25000 + Math.random() * 10000; + }, + delay: 5000, + loop: true, + classes: [ + "alive" + ] + }, state); + startTimer({ id: "movement", func: state => { @@ -144,7 +160,7 @@ stories.push({ }, state); }, intro: state => { - print(["Hot, slimy walls ripple and squeeze, the stomach of your captor stewing you in a churning bath of chyme and acid. The blue crux made a late-night meal out of you with ease. You've only been trapped under the Fen's pelt for a few minutes...and it doesn't seem like you'll last much longer than that, either."]); + print(["Hot, slimy walls ripple and squeeze, the stomach of your captor stewing you in a churning bath of chyme and acid. The purple crux made a late-night meal out of you with ease. You've only been trapped under the Fen's pelt for a few minutes...but it doesn't seem like you'll make it until midnight."]); playSfx("sfx/stomach-churn.ogg"); } },