From 2c75fb228ab2f6d0deadfff8916c1ef3efa4a944 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Mon, 14 Jan 2019 16:31:28 -0500 Subject: [PATCH] Some story tweaks, including timers in timers! --- stories/fen-snack.js | 65 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 14 deletions(-) diff --git a/stories/fen-snack.js b/stories/fen-snack.js index d9d4c58..3085990 100644 --- a/stories/fen-snack.js +++ b/stories/fen-snack.js @@ -81,7 +81,20 @@ stories.push({ startTimer({ id: "stamina-regen", func: state => { - state.player.stats.stamina.value += 1; + const location = state.player.location; + let bonus = state.player.flags.submission ? -3 : 0; + + if (location.startsWith("stomach")) { + state.player.stats.stamina.value += 1 + bonus; + } + + if (location.startsWith("intestines")) { + state.player.stats.stamina.value += 0.5 + bonus; + } + + if (location.startsWith("bowels")) { + state.player.stats.stamina.value += -0.5 + bonus; + } if (state.player.stats.stamina.value > 100) { state.player.stats.stamina.value = 100; @@ -300,7 +313,7 @@ stories.push({ desc: "Let Fen digest you", execute: (room, state) => { state.player.flags.submission = true; - print(["You slump back in the crux's intestines, letting the winding, worryingly-tight guts take you in..."]); + print(["You go limp in the crux's intestines, letting the winding, worryingly-tight guts take you in..."]); }, show: [ (room, state) => { @@ -316,7 +329,7 @@ stories.push({ name: "Bowels", desc: "Cavernous bowels, rippling and squeezing over your bare skin", move: (room, state) => { - print(["You enter the beast's humid bowels, taking shallow, stifled breaths of the musky air."]); + print(["You enter the beast's humid bowels, taking shallow, stifled breaths of the musky air. The sauna-like atmosphere sucks the strength from your tired limbs."]); }, enter: (room, state) => { playLoop("loop/fen-bowels.ogg"); @@ -324,17 +337,31 @@ stories.push({ startTimer({ id: "bowels-churns", func: state => { - if (Math.random() > 0.6) { - if (state.player.stats.stamina.value > 50) { - state.player.stats.stamina.value -= 25; - state.player.stats.stamina.value = Math.max(0, state.player.stats.stamina.value); - print(["Fen's bowels clench and churn, grinding you into their musky walls."]); - playSfx("sfx/bowels-churn-safe.ogg"); - } else { - state.player.stats.health.value /= 4; - print(["Drained of stamina, you can do little to resist as Fen's bowels grind you away."]); - playSfx("sfx/bowels-churn-danger.ogg"); - } + if (state.player.stats.stamina.value > 50) { + state.player.stats.stamina.value -= 25; + state.player.stats.stamina.value = Math.max(0, state.player.stats.stamina.value); + print(["Fen's bowels clench and churn, grinding you into their musky walls."]); + playSfx("sfx/bowels-churn-safe.ogg"); + } else { + startTimer({ + id: "digestion", + func: state => { + let bonus = state.player.flags.submission ? 10 : 1; + + state.player.stats.health.value -= 1; + return 500 / bonus; + }, + delay: 1000, + loop: true, + room: "bowels", + classes: [ + "alive" + ] + }, state); + + print(["Drained of stamina, you can do little to resist as Fen's bowels grind you away."]); + playSfx("sfx/bowels-churn-danger.ogg"); + return false; } return true; }, @@ -362,6 +389,16 @@ stories.push({ (room, state) => { return !state.player.flags.submission; } + ], + hooks: [ + (room, exit, state) => { + if (state.player.stats.stamina.value < 25) { + print(["You're too tired to move..."]); + playSfx("sfx/bowels-churn-safe.ogg"); + return false; + } + return true; + } ] } },