Преглед на файлове

Add a scene for getting grabbed

geta
Fen Dweller преди 5 години
родител
ревизия
097fe55671
променени са 1 файла, в които са добавени 121 реда и са изтрити 61 реда
  1. +121
    -61
      stories/geta-unaware.js

+ 121
- 61
stories/geta-unaware.js Целия файл

@@ -31,18 +31,18 @@
return !status; return !status;
}).length; }).length;
} }
function pickRandom(list) { function pickRandom(list) {
return list[Math.floor(Math.random() * list.length)]; return list[Math.floor(Math.random() * list.length)];
} }


const word = { const word = {
get swallow() { return pickRandom(["swallow", "gulp"]); }, 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) { function statLerp(stat, change, duration) {
@@ -121,13 +121,16 @@


state.geta = {}; 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; state.info.time.value = 60 * 60 * 7 + 60 * 17;


@@ -296,8 +299,12 @@
id: "pepper-investigate", id: "pepper-investigate",
func: () => { func: () => {
if (state.player.location == "pepper-grinder") { 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 { } else {
print(["You evaded the fox."]); 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": { "maw": {
"id": "maw", "id": "maw",
"name": "Geta's Maw", "name": "Geta's Maw",
@@ -862,20 +922,20 @@
state.player.stats.throatPos.hidden = false; state.player.stats.throatPos.hidden = false;


startTimer({ 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; state.geta.throatStage = 1;
startTimer({ startTimer({
id: "throat-stages", id: "throat-stages",
func: () => { func: () => {
@@ -934,7 +994,7 @@


const choice = Math.random(); const choice = Math.random();


if (choice < 0.7 ) {
if (choice < 0.7) {
print(["Geta's throat pumps you deeper"]); print(["Geta's throat pumps you deeper"]);
playSfx(pickRandom([ playSfx(pickRandom([
"sfx/gulp-1.ogg", "sfx/gulp-1.ogg",
@@ -951,14 +1011,14 @@
} else { } else {
return Math.random() * 200 + 200; return Math.random() * 200 + 200;
} }
} else { } else {
print(["A crushing swallow grips your body and crams you down deep."]); print(["A crushing swallow grips your body and crams you down deep."]);
playSfx("sfx/big-gulp.ogg"); playSfx("sfx/big-gulp.ogg");
statLerp("throatPos", 0.3, 1500); statLerp("throatPos", 0.3, 1500);
return Math.random() * 2000 + 2000; return Math.random() * 2000 + 2000;
} }
}, },
delay: 2000, delay: 2000,
loop: true, loop: true,
@@ -990,7 +1050,7 @@
}, },
show: [ show: [
(room) => { (room) => {
return !state.player.flags.throatSurrender;
return !state.player.flags.throatSurrender;
} }
], ],
conditions: [ conditions: [
@@ -1006,7 +1066,7 @@
}, },
show: [ show: [
(room) => { (room) => {
return !state.player.flags.throatSurrender;
return !state.player.flags.throatSurrender;
} }
], ],
conditions: [ conditions: [
@@ -1301,35 +1361,35 @@
state.info.time.value %= 86000; state.info.time.value %= 86000;
return true; return true;
}, },
delay: 1000/60,
delay: 1000 / 60,
loop: true, loop: true,
classes: [ classes: [
] ]
}); });
startTimer({ 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({ startTimer({
id: "absorbption-random",
func: () => {
const result = pickRandom([
id: "absorbption-random",
func: () => {
const result = pickRandom([
() => { () => {
print(["The fox kneads on his flattening belly"]); print(["The fox kneads on his flattening belly"]);
statLerp("absorption", 0.1, 1000); 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"]); print(["Geta's guts writhe and squeeze, soaking up your digested body and crushing your acid-pitted bones"]);
statLerp("absorption", 0.2, 1000); 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"); playSfx("sfx/digest.ogg");
}, },


Loading…
Отказ
Запис