Sfoglia il codice sorgente

Let Geta tilt back his muzzle d uring the maw struggle. Remove the id argument from statLerp

statLerp now generates a random id, which should prevent collisions.
geta
Fen Dweller 6 anni fa
parent
commit
1e1f002f96
1 ha cambiato i file con 37 aggiunte e 8 eliminazioni
  1. +37
    -8
      stories/geta-unaware.js

+ 37
- 8
stories/geta-unaware.js Vedi File

@@ -32,7 +32,9 @@
}).length;
}

function statLerp(id, stat, change, duration) {
function statLerp(stat, change, duration) {
// pretty sure this'll be a random id...
const id = new Date().getTime() + Math.random();
const iterations = duration / 1000 * 60;
startTimer({
id: id,
@@ -569,8 +571,12 @@

let choice;

if (Math.random() < 0.1) {
choice = "slosh";
if (Math.random() < 0.2) {
const choices = [
"slosh",
"tilt-back"
];
choice = choices[Math.floor(Math.random() * choices.length)];
} else if (Math.random() > state.geta.slurps / 3) {
choice = "slurp";
} else if (state.geta.chews - Math.floor(Math.random() * 3) < state.geta.slurps) {
@@ -586,7 +592,7 @@
return false;
} else {
print(["Swallows"]);
statLerp("maw-swallow", "mawPos", -0.25, 500);
statLerp("mawPos", -0.25, 500);
state.geta.slurps = 0;
state.geta.chews = 0;
state.geta.swallowsLeft -= 1;
@@ -594,7 +600,7 @@
}

} else if (choice == "slurp") {
statLerp("maw-swallow", "mawPos", -0.1, 250);
statLerp("mawPos", -0.1, 250);
print(["Slurps"]);
state.geta.slurps += 1;
return Math.random() * 1000 + 1500;
@@ -637,6 +643,29 @@
});

return Math.random() * 1500 + 4500;
} else if (choice == "tilt-back") {
print(["Geta tilts his head back, sending rivults of slobber flowing down into that yawning gullet."]);
state.geta.mawMovement = 0.2;
statLerp("mawPos", -1, 4000);

startTimer({
id: "maw-tilt-text",
func: () => {
print(["The fox's muzzle tilts back down as he SWALLOWS hard."]);
statLerp("mawPos", -0.3, 500);
state.geta.swallowsLeft -= 1;
state.geta.slurps = 0;
state.geta.chews = 0;
return true;
},
delay: 4000,
loop: false,
classes: [
]
});
return 5000 + Math.random() * 1000;
}
},
delay: 0,
@@ -675,7 +704,7 @@
desc: "Pull yourself away from the fox's throat! Just don't go too far forward...",
execute: (room) => {
print(["You drag yourself forward"]);
statLerp("maw-swallow", "mawPos", 0.15 + Math.random() * 0.05, 250);
statLerp("mawPos", 0.15 + Math.random() * 0.05, 250);
},
show: [

@@ -690,10 +719,10 @@
execute: (room) => {
if (Math.random() < 0.9){
print(["You let yourself slip back."]);
statLerp("maw-swallow", "mawPos", -0.2 - Math.random() * 0.1, 250);
statLerp("mawPos", -0.2 - Math.random() * 0.1, 250);
} else {
print(["You lose your grip, sliding back quite far!"]);
statLerp("maw-swallow", "mawPos", -0.3 - Math.random() * 0.15, 250);
statLerp("mawPos", -0.3 - Math.random() * 0.15, 250);
}
},


Loading…
Annulla
Salva