It was a nice idea to explicitly pass state to everything,
but it didn't really provide any benefits (we only ever have one
game going at once), the rule was already violated (some places
used the global instance of state), and it added a lot of clutter.
Also removed the unused entity.js file.
["The crux strokes over his snarling gut, enjoying your dwindling squirms."],
["\"Enjoying yourself, meal?\"", "Your captor's oh-so-smug voice booms in your ears."]
@@ -46,11 +46,11 @@ stories.push({
classes: [
"alive"
]
}, state);
});
startTimer({
id: "movement",
func: state => {
func: () => {
const pinned = state.player.flags.pinned;
if (pinned) {
@@ -70,25 +70,25 @@ stories.push({
classes: [
"alive"
]
}, state);
});
startTimer({
id: "digestion",
func: state => {
func: () => {
const location = state.player.location;
let bonus = state.player.flags.submission ? 10 : 1;
if (location.startsWith("stomach")) {
changeStat("health", -1, state);
changeStat("health", -1);
}
if (location.startsWith("intestines")) {
changeStat("health", -0.75, state);
changeStat("health", -0.75);
}
if (location.startsWith("bowels")) {
changeStat("health", -0.5, state);
changeStat("health", -0.5);
}
@@ -113,7 +113,7 @@ stories.push({
startTimer({
id: "time-text",
func: state => {
func: () => {
print([time_text]);
return true;
},
@@ -122,19 +122,19 @@ stories.push({
classes: [
]
}, state);
});
if (location.startsWith("stomach")) {
goToRoom("digested-stomach", state);
goToRoom("digested-stomach");
}
if (location.startsWith("intestines")) {
goToRoom("digested-intestines", state);
goToRoom("digested-intestines");
}
if (location.startsWith("bowels")) {
goToRoom("digested-bowels", state);
goToRoom("digested-bowels");
}
return false;
@@ -146,24 +146,24 @@ stories.push({
classes: [
"alive"
]
}, state);
});
startTimer({
id: "stamina-regen",
func: state => {
func: () => {
const location = state.player.location;
let bonus = state.player.flags.submission ? -3 : 0;
bonus += state.player.flags.pinned ? -0.5 : 0;
if (location.startsWith("stomach")) {
changeStat("stamina", 0.75 + bonus, state);
changeStat("stamina", 0.75 + bonus);
}
if (location.startsWith("intestines")) {
changeStat("stamina", 1.25 + bonus, state);
changeStat("stamina", 1.25 + bonus);
}
if (location.startsWith("bowels")) {
changeStat("stamina", -0.5 + bonus, state);
changeStat("stamina", -0.5 + bonus);
}
return true;
},
@@ -172,11 +172,11 @@ stories.push({
classes: [
"alive"
]
}, state);
});
startTimer({
id: "clock",
func: state => {
func: () => {
state.info.time.value += 1;
state.info.time.value %= 86400;
@@ -187,14 +187,14 @@ stories.push({
classes: [
]
}, state);
});
},
intro: state => {
intro: () => {
print(["Hot, slimy walls ripple and squeeze, the stomach of your captor stewing you in a churning bath of chyme and acid. The purple crux made a late-night meal out of you with ease. You've only been trapped under the Fen's pelt for a few minutes...but it doesn't seem like you'll make it until midnight."]);
print(["The crux's stomach clenches around you, smothering you in the beast's slimy embrace."]);
playSfx("sfx/stomach-churn.ogg");
}
@@ -224,11 +224,11 @@ stories.push({
"alive",
"stomach"
]
}, state);
});
},
exit: (room, state) => {
exit: (room) => {
stopLoop("loop/fen-stomach.ogg");
stopClassTimers("stomach", state);
stopClassTimers("stomach");
},
hooks: [
@@ -237,17 +237,17 @@ stories.push({
{
name: "Rub",
desc: "Knead on the muscular folds that surround your tasty little body",
execute: (room, state) => {
changeStat("stamina", -15, state);
execute: (room) => {
changeStat("stamina", -15);
print(["You rub all over your prison's walls. Fen's stomach gurgles in response."]);
}
},
{
name: "Thrash",
desc: "Kick and struggle",
execute: (room, state) => {
changeStat("health", -10, state);
changeStat("stamina", -35, state);
execute: (room) => {
changeStat("health", -10);
changeStat("stamina", -35);
print(["Your thrash and kick and punch - and, for your insolence, you are rewarded with a crushing CLENCH. Fen's grinding guts smother and squeeze your softening body, nearly popping you like a grape."]);
playSfx("sfx/stomach-churn.ogg");
},
@@ -261,12 +261,12 @@ stories.push({
{
name: "Submit",
desc: "Let Fen digest you",
execute: (room, state) => {
execute: (room) => {
state.player.flags.submission = true;
print(["You slump back in the crux's stomach, allowing its powerful fluids to break you down..."]);
},
show: [
(room, state) => {
(room) => {
return !state.player.flags.submission;
}
]
@@ -277,31 +277,31 @@ stories.push({
"down": {
"target": "intestines",
"desc": "Push yourself deeper into the crux",
move: (room, state) => {
move: (room) => {
print(["You manage to push yourself down through the valve at the base of the crux's fetid stomach."]);
playSfx("sfx/stomach-to-intestines.ogg");
},
hooks: [
(room, exit, state) => {
(room, exit) => {
let stamina = state.player.stats.stamina.value;
let escape;
if (Math.random() > stamina/100) {
changeStat("stamina", -50, state);
changeStat("stamina", -50);
print(["Fen's stomach clenches and ripples, smothering your face in wet flesh and keeping you nice and trapped."]);
playSfx("sfx/stomach-to-intestines-fail.ogg");
escape = false;
} else {
changeStat("stamina", -25, state);
changeStat("stamina", -25);
escape = true;
}
return escape;
}
],
conditions: [
(room, state) => {
(room) => {
return !state.player.flags.submission;
},
(room, state) => {
(room) => {
return !state.player.flags.pinned;
}
]
@@ -317,30 +317,30 @@ stories.push({
id: "intestines",
name: "Intestines",
desc: "Labyrinthine guts, winding on and on...",
move: (room, state) => {
move: (room) => {
print(["Your squirming body glides into the crux's tight, snaking guts."]);
},
enter: (room, state) => {
enter: (room) => {
playLoop("loop/fen-intestines.ogg");
startTimer({
id: "intestines-churns",
func: state => {
func: () => {
if (Math.random() > 0.5) {
if (state.player.stats.stamina.value > 50) {
changeStat("stamina", -25, state);
changeStat("stamina", -25);
print(["Your prison's walls ripple and grind, shoving you against the valve leading to the crux's boiling stomach - but you manage to resist the powerful pull."]);
playSfx("sfx/intestines-churn-stay.ogg");
} else {
print(["Too exhausted to resist, your slimy body is crammed into the crux's churning stomach by a powerful wave of peristalsis."]);
playSfx("sfx/intestines-to-stomach-forced.ogg");
goToRoom("stomach", state);
goToRoom("stomach");
}
} else {
changeStat("stamina", -25, state);
changeStat("stamina", -25);
print(["Overwhelming peristalsis grips your body and crams it into the beast's hot, life-sapping bowels."]);
playSfx("sfx/intestines-to-stomach-forced.ogg");
goToRoom("bowels", state);
goToRoom("bowels");
}
return 10000 + Math.random() * 5000;
},
@@ -350,25 +350,25 @@ stories.push({
"alive",
"intestines"
]
}, state);
});
},
exit: (room, state) => {
exit: (room) => {
stopLoop("loop/fen-intestines.ogg");
stopClassTimers("intestines", state);
stopClassTimers("intestines");
},
exits: {
"up": {
target: "stomach",
desc: "Writhe back into Fen's roiling stomach",
move: (room, state) => {
move: (room) => {
print(["You push yourself back into the crux's fatal stomach."]);
playSfx("sfx/intestines-to-stomach.ogg");
},
conditions: [
(room, state) => {
(room) => {
return !state.player.flags.submission;
},
(room, state) => {
(room) => {
return !state.player.flags.pinned;
}
]
@@ -376,15 +376,15 @@ stories.push({
"down": {
target: "bowels",
desc: "Push yourself even deeper into your predator's body",
move: (room, state) => {
move: (room) => {
print(["You wriggle into the beast's bowels."]);
playSfx("sfx/intestines-to-bowels.ogg");
},
conditions: [
(room, state) => {
(room) => {
return !state.player.flags.submission;
},
(room, state) => {
(room) => {
return !state.player.flags.pinned;
}
]
@@ -397,20 +397,20 @@ stories.push({
{
name: "Rub",
desc: "Knead on the muscular folds that surround your tasty little body",
execute: (room, state) => {
changeStat("stamina", -20, state);
execute: (room) => {
changeStat("stamina", -20);
print(["You rub all over your prison's walls. Fen's intestines quiver and clench in response."]);
}
},
{
name: "Submit",
desc: "Let Fen digest you",
execute: (room, state) => {
execute: (room) => {
state.player.flags.submission = true;
print(["You go limp in the crux's intestines, letting the winding guts take you in..."]);
},
show: [
(room, state) => {
(room) => {
return !state.player.flags.submission;
}
]
@@ -427,27 +427,27 @@ stories.push({
id: "bowels",
name: "Bowels",
desc: "Cavernous bowels, rippling and squeezing over your bare skin",
move: (room, state) => {
move: (room) => {
print(["You enter the beast's humid bowels, taking shallow, stifled breaths of the musky air. The sauna-like atmosphere sucks the strength from your tired limbs."]);
},
enter: (room, state) => {
enter: (room) => {
playLoop("loop/fen-bowels.ogg");
startTimer({
id: "bowels-churns",
func: state => {
func: () => {
if (state.player.stats.stamina.value > 50) {
changeStat("stamina", -25, state);
changeStat("stamina", -25);
print(["Fen's bowels clench and churn, grinding you into their musky walls."]);
playSfx("sfx/bowels-churn-safe.ogg");
} else {
changeStat("stamina", -100, state);
changeStat("stamina", -100);
startTimer({
id: "digestion",
func: state => {
func: () => {
let bonus = state.player.flags.submission ? 10 : 1;
changeStat("health", -1, state);
changeStat("health", -1);
return 500 / bonus;
},
delay: 1000,
@@ -456,7 +456,7 @@ stories.push({
"alive",
"bowels"
]
}, state);
});
print(["Drained of stamina, you can do little to resist as Fen's bowels grind you away."]);
playSfx("sfx/bowels-churn-danger.ogg");
@@ -470,30 +470,30 @@ stories.push({
"alive",
"bowels"
]
}, state);
});
},
exit: (room, state) => {
exit: (room) => {
stopLoop("loop/fen-bowels.ogg");
stopClassTimers("bowels", state);
stopClassTimers("bowels");
},
exits: {
"up": {
target: "intestines",
desc: "Squirm up higher",
move: (room, state) => {
move: (room) => {
print(["You squirm out from Fen's bowels, working your way back into his cramped guts."]);
playSfx("sfx/bowels-to-intestines.ogg");
},
conditions: [
(room, state) => {
(room) => {
return !state.player.flags.submission;
},
(room, state) => {
(room) => {
return !state.player.flags.pinned;
}
],
hooks: [
(room, exit, state) => {
(room, exit) => {
if (state.player.stats.stamina.value < 25) {
print(["You're too tired to move..."]);
playSfx("sfx/bowels-churn-safe.ogg");
@@ -510,21 +510,21 @@ stories.push({
],
"conditions": [
(room, state) => {
(room) => {
return !state.player.flags.submission;
},
(room, state) => {
(room) => {
return !state.player.flags.pinned;
},
(room, state) => {
(room) => {
return state.player.stats.stamina.value > 25;
}
],
"hooks": [
(room, exit, state) => {
(room, exit) => {
print(["You make a desperate bid for freedom, grasping at the walls of Fen's sweltering bowels and dragging yourself forward. The predator growls in pleasure...and, after humoring your squirms for a long minute, crushes you within an inch of your life with a swift, staggeringly-strong clench. Every inch of escape is erased in a heartbeat...as is any hope of ending the evening as anything other than a permanent contribution to the crux's body."]);
changeStat("stamina", -100, state);
changeStat("stamina", -100);
return false;
}
]
@@ -537,20 +537,20 @@ stories.push({
{
name: "Rub",
desc: "Knead on the muscular folds that surround your tasty little body",
execute: (room, state) => {
changeStat("stamina", -25, state);
execute: (room) => {
changeStat("stamina", -25);
print(["You rub all over your prison's walls. Fen's bowels clench in on you as he rurrs with pleasure."]);
}
},
{
name: "Submit",
desc: "Let Fen digest you",
execute: (room, state) => {
execute: (room) => {
state.player.flags.submission = true;
print(["You slump back in the crux's bowels, yielding to their immense pressure..."]);
},
show: [
(room, state) => {
(room) => {
return !state.player.flags.submission;
}
]
@@ -567,13 +567,13 @@ stories.push({
"id": "freedom",
"name": "Freedom",
"desc": "A place you'll never reach!",
"move": (room, state) => {
"move": (room) => {
},
"enter": (room, state) => {
"enter": (room) => {
},
"exit": (room, state) => {
"exit": (room) => {
},
"actions": [
@@ -595,11 +595,11 @@ stories.push({
id: "digested-stomach",
name: "Fen's Belly",
desc: "You look good on him, at least~",
enter: (room, state) => {
enter: (room) => {
playLoop("loop/fen-intestines.ogg");
playSfx("sfx/digested-test.ogg");
playSfx("sfx/bowels-churn-safe.ogg");
stopClassTimers("alive", state);
stopClassTimers("alive");
print(["You slump down in the acidic pit, curling up as it begins to churn you down to chyme. Fen's stomach snarls and bubbles for the next few minutes...and then you're gone~",newline,"Nothing's left but a bit of padding on your predator's gut..."]);
},
"data": {
@@ -612,11 +612,11 @@ stories.push({
id: "digested-intestines",
name: "Fen's Belly",
desc: "Just a little addition to the crux's belly - one that won't last for long.",
enter: (room, state) => {
enter: (room) => {
playLoop("loop/fen-intestines.ogg");
playSfx("sfx/digested-test.ogg");
playSfx("sfx/bowels-churn-safe.ogg");
stopClassTimers("alive", state);
stopClassTimers("alive");
print(["Fen's intestines clench and squeeze, melting you down into slop and soaking you up like a sponge.",newline,"Nothing's left but a bit of padding on your predator's hips..."]);
},
"data": {
@@ -629,11 +629,11 @@ stories.push({
id: "digested-bowels",
name: "Fen's Ass",
desc: "A little extra heft on the predator's posterior.",
enter: (room, state) => {
enter: (room) => {
playLoop("loop/fen-bowels.ogg");
playSfx("sfx/digested-test.ogg");
playSfx("sfx/bowels-churn-danger.ogg");
stopClassTimers("alive", state);
stopClassTimers("alive");
print(["A powerful ripple of muscle pins you in a vice-grip of flesh. Your exhausted form is molded like putty..and then, over the course of no more than seconds, Fen's bowels assimilate you. Numbness races through your body as you're absorbed like water into a sponge.",newline,"Nothing's left of you beyond some heft on his ass..."]);