Просмотр исходного кода

Add some random noise to struggle progress. Hide the stat bar after swallowing

geta
Fen Dweller 6 лет назад
Родитель
Сommit
74ddfdb5ca
1 измененных файлов: 22 добавлений и 5 удалений
  1. +22
    -5
      stories/geta-unaware.js

+ 22
- 5
stories/geta-unaware.js Просмотреть файл

@@ -466,15 +466,28 @@
state.geta.slurps = 0; state.geta.slurps = 0;
state.geta.chews = 0; state.geta.chews = 0;


startTimer({
id: "maw-random-movement",
func: state => {
changeStat("mawPos", Math.random()/50 - 0.01, state);
return true;
},
delay: 100,
loop: true,
classes: [
"maw-struggle"
]
}, state);
startTimer({ startTimer({
id: "maw-struggle", id: "maw-struggle",
func: state => { func: state => {


if (getStat("mawPos", state) <= 0) {
if (getStat("mawPos", state) <= 0.05) {
print(["Swallowed!"]); print(["Swallowed!"]);
goToRoom("throat", state); goToRoom("throat", state);
return false; return false;
} else if (getStat("mawPos", state) >= 1) {
} else if (getStat("mawPos", state) >= 0.95) {
print(["Chewed!"]); print(["Chewed!"]);
changeStat("health", -90, state); changeStat("health", -90, state);
goToRoom("stomach", state); goToRoom("stomach", state);
@@ -492,7 +505,7 @@
} }


if (choice == "swallow") { if (choice == "swallow") {
if (getStat("mawPos", state) < 0.3) {
if (getStat("mawPos", state) < 0.15) {
print(["Swallowed!"]); print(["Swallowed!"]);
goToRoom("throat", state); goToRoom("throat", state);
return false; return false;
@@ -510,7 +523,7 @@
state.geta.slurps += 1; state.geta.slurps += 1;
return Math.random() * 1000 + 1500; return Math.random() * 1000 + 1500;
} else if (choice == "chew") { } else if (choice == "chew") {
if (getStat("mawPos", state) > 0.7) {
if (getStat("mawPos", state) > 0.85) {
print(["Chewed!"]); print(["Chewed!"]);
changeStat("health", -90, state); changeStat("health", -90, state);
goToRoom("stomach", state); goToRoom("stomach", state);
@@ -526,7 +539,7 @@
delay: 0, delay: 0,
loop: true, loop: true,
classes: [ classes: [
"maw-struggle"
] ]
}, state); }, state);


@@ -588,6 +601,8 @@


state.player.stats.mawPos.hidden = true; state.player.stats.mawPos.hidden = true;


stopClassTimers("maw-struggle", state);

startTimer({ startTimer({
id: "throat-swallow", id: "throat-swallow",
func: state => { func: state => {
@@ -657,6 +672,8 @@
}, },
"enter": (room, state) => { "enter": (room, state) => {
playLoop("loop/stomach.ogg"); playLoop("loop/stomach.ogg");
stopClassTimers("maw-struggle", state);

startTimer({ startTimer({
id: "digest", id: "digest",
func: state => { func: state => {


Загрузка…
Отмена
Сохранить