diff --git a/stories/geta-unaware.js b/stories/geta-unaware.js index e6a5bab..ede9849 100644 --- a/stories/geta-unaware.js +++ b/stories/geta-unaware.js @@ -119,6 +119,7 @@ state.geta = {}; state.player.stats.health = { name: "Health", type: "meter", value: 100, min: 0, max: 100, color: "rgb(255,55,55)" }; + state.player.stats.stamina = { name: "Stamina", type: "meter", value: 100, min: 0, max: 100, color: "rgb(55,255,55)", hidden: true }; state.player.stats.suspicion = { name: "Suspicion", type: "meter", value: 0, min: 0, max: 100, color: "rgb(100,100,100)" }; state.player.stats.mawPos = { "name": "Struggle", "type": "meter", "value": 0.5, "min": 0, "max": 1, "color": "rgb(0,255,0)", hidden: true } state.info.time.value = 60 * 60 * 7 + 60 * 17; @@ -546,6 +547,7 @@ state.player.stats.suspicion.hidden = true; stopClassTimers("free"); + state.player.stats.stamina.hidden = false; state.player.stats.mawPos.hidden = false; state.geta.slurps = 0; @@ -555,6 +557,19 @@ print(["You slip into Geta's maw. He'll swallow you like the snack you are if you slip too far back, but crawl too far forward, and you'll meet his fangs..."]) + startTimer({ + id: "maw-stamina", + func: () => { + changeStat("stamina", 0.1); + return true; + }, + delay: 1000 / 60, + loop: true, + classes: [ + "maw-struggle" + ] + }); + startTimer({ id: "maw-random-movement", func: () => { @@ -742,15 +757,21 @@ }, "exit": (room) => { - + state.player.stats.stamina.hidden = true; }, "actions": [ { name: "Struggle", desc: "Pull yourself away from the fox's throat! Just don't go too far forward...", execute: (room) => { - print(["You drag yourself forward"]); - statLerp("mawPos", 0.15 + Math.random() * 0.05, 250); + if (getStat("stamina") < 25) { + print(["You're too tired..."]); + } else { + print(["You drag yourself forward"]); + changeStat("stamina", -25); + statLerp("mawPos", 0.15 + Math.random() * 0.05, 250); + } + }, show: [ @@ -763,7 +784,11 @@ name: "Slip Back", desc: "Slide back towards Geta's gullet", execute: (room) => { - if (Math.random() < 0.9) { + if (Math.random() * 25 > getStat("stamina")) { + print(["You try to shimmy back an inch or two, but your sore muscles give way; you slide back perilously far!"]); + statLerp("mawPos", -0.3 - Math.random() * 0.25, 250); + } + else if (Math.random() < 0.9) { print(["You let yourself slip back."]); statLerp("mawPos", -0.2 - Math.random() * 0.1, 250); } else { @@ -898,7 +923,7 @@ startTimer({ id: "digest-stages", func: () => { - if (100 - state.geta.digestionStage * 25 - 25> getStat("health")) { + if (100 - state.geta.digestionStage * 25 - 25 > getStat("health")) { state.geta.digestionStage = Math.floor((100 - getStat("health")) / 25); console.log(state.geta.digestionStage); switch (state.geta.digestionStage) {