From 18aa9839b53bcd330ebfda0860c5a316f57dfcc2 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Wed, 15 Apr 2020 11:17:12 -0400 Subject: [PATCH] Flesh out the maw text a bit. Fix head-tilting not resetting maw movement when over --- stories/geta-unaware.js | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/stories/geta-unaware.js b/stories/geta-unaware.js index d107424..3467063 100644 --- a/stories/geta-unaware.js +++ b/stories/geta-unaware.js @@ -32,6 +32,16 @@ }).length; } + function synonym(word) { + const choices = { + "slippery": ["slippery", "slimy", "slick", "glistening"], + "chews": ["chews", "crunches"], + "crushes": ["crushes", "pulverizes", "shatters", "smashes"] + } + + return choices[word][Math.floor(Math.random() * choices[word].length)]; + } + function statLerp(stat, change, duration) { // pretty sure this'll be a random id... const id = new Date().getTime() + Math.random(); @@ -595,11 +605,15 @@ if (choice == "swallow") { if (getStat("mawPos") < 0.15) { - print(["Swallowed!"]); + print(["You're too far back. The fox swallows a mouthful of cereal, taking you with it."]); goToRoom("throat"); return false; } else { - print(["Swallows"]); + printRandom([ + ["A light swallow drags a lump of chewed-up cereal into Geta's depths."], + ["Geta swallows, dragging you closer to your demise."], + ["Your captor's throat ripples as he gulps down his breakfast."] + ]); statLerp("mawPos", -0.25, 500); state.geta.slurps = 0; state.geta.chews = 0; @@ -609,7 +623,11 @@ } else if (choice == "slurp") { statLerp("mawPos", -0.1, 250); - print(["Slurps"]); + printRandom([ + ["A spoonful of cereal slips into the fox's " + synonym("slippery") + " maw."], + ["Geta slurps up some more of his breakfast."], + ["You're shoved back a bit as Geta slurps up more cereal."] + ]); state.geta.slurps += 1; return Math.random() * 1000 + 1500; } else if (choice == "chew") { @@ -619,17 +637,21 @@ const limbName = limbs[limb]; if (limb == "head") { - print(["He chewed your head :((("]); + print(["Geta's jaws crush down on your head. You die."]); changeStat("health", -100); goToRoom("stomach"); } else { - print(["He chewed your " + limbName + " :("]); + print(["You scream in pain as your " + limbName + " is shattered by the fox's jaws"]); changeStat("health", -40); return true; } } else { - print(["Chews"]); + printRandom([ + ["Cruel fangs crush down on the food around you."], + ["Geta chews on his breakfast."], + ["The fox's fangs close with a crackle-crunch of cereal."] + ]); state.geta.chews += 1; return Math.random() * 500 + 1000; } @@ -659,6 +681,7 @@ startTimer({ id: "maw-tilt-text", func: () => { + state.geta.mawMovement = 1; print(["The fox's muzzle tilts back down as he SWALLOWS hard."]); statLerp("mawPos", -0.3, 500); state.geta.swallowsLeft -= 1;