From 097fe5567163314ac0f8cc8f106200e8021d61c4 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sun, 19 Apr 2020 13:23:42 -0400 Subject: [PATCH] Add a scene for getting grabbed --- stories/geta-unaware.js | 182 ++++++++++++++++++++++++++-------------- 1 file changed, 121 insertions(+), 61 deletions(-) diff --git a/stories/geta-unaware.js b/stories/geta-unaware.js index ce3f8d7..f608276 100644 --- a/stories/geta-unaware.js +++ b/stories/geta-unaware.js @@ -31,18 +31,18 @@ return !status; }).length; } - + function pickRandom(list) { return list[Math.floor(Math.random() * list.length)]; } const word = { get swallow() { return pickRandom(["swallow", "gulp"]); }, - get slimy() { return pickRandom(["slimy", "sloppy", "slick", "glistening"])}, - get disgusting() { return pickRandom(["disgusting", "abhorrent", "rank", "horrific", "nauseating", "sickening", "wretched"])}, - get foul() { return pickRandom(["foul", "rank", "gross"])}, - get fatal() { return pickRandom(["fatal", "deadly"])}, - get painful() { return pickRandom(["painful", "agonizing", "unbearable"])} + get slimy() { return pickRandom(["slimy", "sloppy", "slick", "glistening"]) }, + get disgusting() { return pickRandom(["disgusting", "abhorrent", "rank", "horrific", "nauseating", "sickening", "wretched"]) }, + get foul() { return pickRandom(["foul", "rank", "gross"]) }, + get fatal() { return pickRandom(["fatal", "deadly"]) }, + get painful() { return pickRandom(["painful", "agonizing", "unbearable"]) } } function statLerp(stat, change, duration) { @@ -121,13 +121,16 @@ state.geta = {}; - state.player.stats.health = { name: "Health", type: "meter", value: 100, min: 0, max: 100, get color() { return "rgb(" + (155+this.value) + "," + (this.value/2) + "," + (this.value/2) + ")" }}; - state.player.stats.stamina = { name: "Stamina", type: "meter", value: 100, min: 0, max: 100, get color() { return "rgb(55," + (155+this.value) + ",55)"}, hidden: true }; - state.player.stats.suspicion = { name: "Suspicion", type: "meter", value: 0, min: 0, max: 100, get color() { return "rgb(" + (155+this.value) + ",100,100)" }}; - state.player.stats.mawPos = { "name": "Struggle", "type": "meter", "value": 0.5, "min": 0, "max": 1, get color() { - return (this.value <= 0.15 || this.value >= 0.85) ? "rgb(255,100,0)" : "rgb(0,255,0)"}, hidden: true } - state.player.stats.throatPos = { "name": "Descent", "type": "meter", "value": 0.25, "min": 0, "max": 1, get color() { return "rgb(" + (100+155*this.value) + ",0,0)"}, hidden: true } - state.player.stats.absorption = { "name": "Absorption", "type": "meter", "value": 0, "min": 0, "max": 1, get color() { return "rgb(" + (100+155*this.value) + ",0,0)"}, hidden: true } + state.player.stats.health = { name: "Health", type: "meter", value: 100, min: 0, max: 100, get color() { return "rgb(" + (155 + this.value) + "," + (this.value / 2) + "," + (this.value / 2) + ")" } }; + state.player.stats.stamina = { name: "Stamina", type: "meter", value: 100, min: 0, max: 100, get color() { return "rgb(55," + (155 + this.value) + ",55)" }, hidden: true }; + state.player.stats.suspicion = { name: "Suspicion", type: "meter", value: 0, min: 0, max: 100, get color() { return "rgb(" + (155 + this.value) + ",100,100)" } }; + state.player.stats.mawPos = { + "name": "Struggle", "type": "meter", "value": 0.5, "min": 0, "max": 1, get color() { + return (this.value <= 0.15 || this.value >= 0.85) ? "rgb(255,100,0)" : "rgb(0,255,0)" + }, hidden: true + } + state.player.stats.throatPos = { "name": "Descent", "type": "meter", "value": 0.25, "min": 0, "max": 1, get color() { return "rgb(" + (100 + 155 * this.value) + ",0,0)" }, hidden: true } + state.player.stats.absorption = { "name": "Absorption", "type": "meter", "value": 0, "min": 0, "max": 1, get color() { return "rgb(" + (100 + 155 * this.value) + ",0,0)" }, hidden: true } state.info.time.value = 60 * 60 * 7 + 60 * 17; @@ -296,8 +299,12 @@ id: "pepper-investigate", func: () => { if (state.player.location == "pepper-grinder") { - print(["He catches you.", newline, "You're tossed into the fox's jaws."]); - goToRoom("maw"); + print([ + "A massive hand grasps the grinder and shoves it aside; you fall back and land hard, knocking the wind from your lungs. Stars dance in your corners of your vision as Geta's muzzle looms above, his dull-green eyes fixated on your bite-sized body.", + newline, + "He frowns and scoops you up, squeezing you between tree-trunk fingers as he raises you up to his slavering maw." + ]); + goToRoom("hand"); } else { print(["You evaded the fox."]); } @@ -548,6 +555,59 @@ } } }, + "hand": { + "id": "hand", + "name": "Geta's Hand", + "desc": "You've been grabbed!", + "move": (room) => { + + }, + "enter": (room) => { + stopClassTimers("free"); + state.player.stats.suspicion.hidden = true; + + state.geta.handTicksLeft = 2 + Math.floor(Math.random() * 2); + + startTimer({ + id: "geta-hand-actions", + func: () => { + if (state.geta.handTicksLeft == 0) { + print(["In you go!"]); + goToRoom("maw"); + return false; + } else { + print(["Geta teases you"]); + state.geta.handTicksLeft -= 1; + return Math.random() * 2000 + 4000; + } + + }, + delay: 5000, + loop: true, + classes: [ + + ] + }); + + }, + "exit": (room) => { + + }, + "actions": [ + + ], + "exits": { + + }, + "hooks": [ + + ], + "data": { + "stats": { + + } + } + }, "maw": { "id": "maw", "name": "Geta's Maw", @@ -862,20 +922,20 @@ state.player.stats.throatPos.hidden = false; startTimer({ - id: "throat-stamina", - func: () => { - changeStat("stamina", 0.03); - return true; - }, - delay: 1000/60, - loop: true, - classes: [ - "throat-struggle" - ] + id: "throat-stamina", + func: () => { + changeStat("stamina", 0.03); + return true; + }, + delay: 1000 / 60, + loop: true, + classes: [ + "throat-struggle" + ] }); state.geta.throatStage = 1; - + startTimer({ id: "throat-stages", func: () => { @@ -934,7 +994,7 @@ const choice = Math.random(); - if (choice < 0.7 ) { + if (choice < 0.7) { print(["Geta's throat pumps you deeper"]); playSfx(pickRandom([ "sfx/gulp-1.ogg", @@ -951,14 +1011,14 @@ } else { return Math.random() * 200 + 200; } - + } else { print(["A crushing swallow grips your body and crams you down deep."]); playSfx("sfx/big-gulp.ogg"); statLerp("throatPos", 0.3, 1500); return Math.random() * 2000 + 2000; } - + }, delay: 2000, loop: true, @@ -990,7 +1050,7 @@ }, show: [ (room) => { - return !state.player.flags.throatSurrender; + return !state.player.flags.throatSurrender; } ], conditions: [ @@ -1006,7 +1066,7 @@ }, show: [ (room) => { - return !state.player.flags.throatSurrender; + return !state.player.flags.throatSurrender; } ], conditions: [ @@ -1301,35 +1361,35 @@ state.info.time.value %= 86000; return true; }, - delay: 1000/60, + delay: 1000 / 60, loop: true, classes: [ - + ] }); - + startTimer({ - id: "passive-absorb", - func: () => { - changeStat("absorption", 0.0004); + id: "passive-absorb", + func: () => { + changeStat("absorption", 0.0004); - if (getStat("absorption") >= 1) { - goToRoom("absorbed"); - return false; - } - return true; - }, - delay: 1000/60, - loop: true, - classes: [ - "absorption" - ] + if (getStat("absorption") >= 1) { + goToRoom("absorbed"); + return false; + } + return true; + }, + delay: 1000 / 60, + loop: true, + classes: [ + "absorption" + ] }); startTimer({ - id: "absorbption-random", - func: () => { - const result = pickRandom([ + id: "absorbption-random", + func: () => { + const result = pickRandom([ () => { print(["The fox kneads on his flattening belly"]); statLerp("absorption", 0.1, 1000); @@ -1342,18 +1402,18 @@ print(["Geta's guts writhe and squeeze, soaking up your digested body and crushing your acid-pitted bones"]); statLerp("absorption", 0.2, 1000); } - ])(); + ])(); - return result ? result : Math.random() * 3000 + 4000; - }, - delay: 2000, - loop: true, - classes: [ - "absorption" - ] + return result ? result : Math.random() * 3000 + 4000; + }, + delay: 2000, + loop: true, + classes: [ + "absorption" + ] }); - - + + playSfx("sfx/digest.ogg"); },