From 8ac42dc5f8b654a7483fd7a55f94593bbd50e9a4 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Tue, 7 Jan 2020 15:59:06 -0500 Subject: [PATCH] Add magic to pause digestion --- features.js | 12 ++++++++++++ game.js | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/features.js b/features.js index a2e3ab6..17628af 100644 --- a/features.js +++ b/features.js @@ -469,6 +469,10 @@ const panels = { { "name": "Fast Digestion", "target": "magic_fast_digestion" + }, + { + "name": "Pause Digestion", + "target": "magic_pause_digestion" } ] }, @@ -2105,6 +2109,14 @@ options = [ "default": true, "tooltip": "Fast Digestion allows you to speed up your digestion for a short duration." }, + { + "name": "Pause digestion", + "id": "magicPauseDigestion", + "type": "checkbox", + "buttons": ["magic_pause_digestion"], + "default": true, + "tooltip": "Pause Digestion allows you to halt digestion until you cast it again." + } ] }, { diff --git a/game.js b/game.js index f8aceb5..fe4e9fe 100644 --- a/game.js +++ b/game.js @@ -70,6 +70,7 @@ let macro = //macro controls every customizable part of the players body "shrunkPrey": null, "fastDigestFactor": 1, "fastDigestTimer": null, + "pauseDigest": false, "walkSpeed": 1, "growthPoints": 0, @@ -560,6 +561,10 @@ let macro = //macro controls every customizable part of the players body setTimeout(function() { owner.digest(owner, organ, time); }, time * 1000 / organ.stages / macro.fastDigestFactor); } + if (macro.pauseDigest) { + return; + } + let count = Math.min(organ.contents.length, organ.maxDigest); let container = organ.contents.pop(); @@ -4329,6 +4334,20 @@ function magic_fast_digestion() update([line, newline]); } +function magic_pause_digestion() +{ + let line; + + if (macro.pauseDigest) { + line = "You end the spell, and your body resumes its work."; + } else { + line = "Your magic halts your digestive processes."; + } + + macro.pauseDigest = !macro.pauseDigest; + + update([line, newline]); +} function wings_flap() { let area = macro.wingArea * 2;