Parcourir la source

Update the synonym picker

geta
Fen Dweller il y a 5 ans
Parent
révision
8f3cc4deaf
1 fichiers modifiés avec 16 ajouts et 13 suppressions
  1. +16
    -13
      stories/geta-unaware.js

+ 16
- 13
stories/geta-unaware.js Voir le fichier

@@ -31,15 +31,18 @@
return !status; return !status;
}).length; }).length;
} }
function pickRandom(list) {
return list[Math.floor(Math.random() * list.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)];
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"])}
} }


function statLerp(stat, change, duration) { function statLerp(stat, change, duration) {
@@ -541,7 +544,7 @@
"maw": { "maw": {
"id": "maw", "id": "maw",
"name": "Geta's Maw", "name": "Geta's Maw",
"desc": "You've been slurped up into the fox's jaws",
"desc": "You've been slurped up into the fox's " + word.foul + " jaws",
"move": (room) => { "move": (room) => {


}, },
@@ -557,7 +560,7 @@
state.geta.swallowsLeft = 3 + Math.floor(Math.random() * 3); state.geta.swallowsLeft = 3 + Math.floor(Math.random() * 3);
state.geta.mawMovement = 1; state.geta.mawMovement = 1;


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..."])
print(["You slip into Geta's maw; the atmosphere is " + word.disgusting + ". He'll swallow you alive if you slip too far back, but crawl too far forward, and you'll meet his fangs..."])


startTimer({ startTimer({
id: "maw-stamina", id: "maw-stamina",
@@ -638,7 +641,7 @@
return false; return false;
} else { } else {
printRandom([ printRandom([
["A light swallow drags a lump of chewed-up cereal into Geta's depths."],
["A light swallow drags a lump of chewed-up cereal into Geta's " + word.fatal + " depths."],
["Geta swallows, dragging you closer to your demise."], ["Geta swallows, dragging you closer to your demise."],
["Your captor's throat ripples as he gulps down his breakfast."] ["Your captor's throat ripples as he gulps down his breakfast."]
]); ]);
@@ -652,7 +655,7 @@
} else if (choice == "slurp") { } else if (choice == "slurp") {
statLerp("mawPos", -0.1, 250); statLerp("mawPos", -0.1, 250);
printRandom([ printRandom([
["A spoonful of cereal slips into the fox's " + synonym("slippery") + " maw."],
["A spoonful of cereal slips into the fox's sloppy maw."],
["Geta slurps up some more of his breakfast."], ["Geta slurps up some more of his breakfast."],
["You're shoved back a bit as Geta slurps up more cereal."] ["You're shoved back a bit as Geta slurps up more cereal."]
]); ]);
@@ -1101,7 +1104,7 @@
changeStat("health", -0.3 * state.geta.acidStrength); changeStat("health", -0.3 * state.geta.acidStrength);


if (getStat("health") <= 0) { if (getStat("health") <= 0) {
print(["You're digested before too long."]);
print(["You're gradually digested, merciful oblivion ending your torment in the " + word.disgusting + " depths of your captor..."]);
goToRoom("digested"); goToRoom("digested");
return false; return false;
} }


Chargement…
Annuler
Enregistrer