Przeglądaj źródła

Add a scene for getting grabbed

geta
Fen Dweller 5 lat temu
rodzic
commit
097fe55671
1 zmienionych plików z 121 dodań i 61 usunięć
  1. +121
    -61
      stories/geta-unaware.js

+ 121
- 61
stories/geta-unaware.js Wyświetl plik

@@ -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");
},


Ładowanie…
Anuluj
Zapisz