From 41f8416f802d515d4ac4d56335555e8602c831c8 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Fri, 15 Jun 2018 13:16:49 -0400 Subject: [PATCH] Added breath --- game.js | 98 ++++++++++++++++++++++++++++++++++++++++++ recursive-desc.js | 106 +++++++++++++++++++++++++++++++++++++++++++++- sounds.js | 4 +- stroll.html | 43 +++++++++++++++++++ 4 files changed, 249 insertions(+), 2 deletions(-) diff --git a/game.js b/game.js index 887aebc..77f92d7 100644 --- a/game.js +++ b/game.js @@ -872,6 +872,11 @@ let macro = "stages": 3 }, + "breathEnabled": false, + "baseBreathArea": 10, + "breathStyle": "cone", + get breathArea() { return this.scaling(this.baseBreathArea, this.scale, 2); }, + "pawVoreEnabled": false, "pawsVore": { @@ -3678,6 +3683,62 @@ function paw_vore() macro.arouse(5); } +function breath(type, style) { + let area = macro.breathArea; + let prey = new Container(); + + if (style == "line") { + area *= 10; + prey = getOnePrey(biome, area, true); + } else if (style == "cone") { + prey = getPrey(biome, area, true); + } + + let line = describe("breath-" + type, prey, macro, verbose); + let linesummary = summarize(prey.sum(), true); + let preyMass = prey.sum_property("mass"); + let sound = getSound("breath", preyMass); + + update([sound, line, linesummary, newline]); + add_victim_people("breath-" + type, prey); +} + +function breath_fire() { + breath("fire", macro.breathStyle); +} + +function breath_ice() { + breath("ice", macro.breathStyle); +} + +function breath_electric() { + breath("electric", macro.breathStyle); +} + +function breath_smoke() { + breath("smoke", macro.breathStyle); +} + +function breath_radiation() { + breath("radiation", macro.breathStyle); +} + +function breath_foul() { + breath("foul", macro.breathStyle); +} + +function breath_line() { + macro.breathStyle = "line"; + + update(["You prepare to exhale a focused line of breath!",newline]); +} + +function breath_cone() { + macro.breathStyle = "cone"; + + update(["You prepare to exhale a broad cone of breath!",newline]); +} + function cooldown_start(name) { let button = document.querySelector("#" + "button-action-" + name); let parent = button.parentElement; @@ -4417,6 +4478,43 @@ function startGame(e) { } } + if (macro.breathEnabled) { + enable_panel("breath"); + + enable_button("breath_line"); + enable_button("breath_cone"); + + if (macro.breathFire) { + enable_button("breath_fire"); + enable_victim("breath-fire","Incinerated by fiery breath"); + } + + if (macro.breathIce) { + enable_button("breath_ice"); + enable_victim("breath-ice","Frozen in icy breath"); + } + + if (macro.breathElectric) { + enable_button("breath_electric"); + enable_victim("breath-electric","Fried by an electric gale"); + } + + if (macro.breathSmoke) { + enable_button("breath_smoke"); + enable_victim("breath-smoke","Snuffed out by smoke"); + } + + if (macro.breathRadiation) { + enable_button("breath_radiation"); + enable_victim("breath-radiation","Vaporized by radioactive power"); + } + + if (macro.breathFoul) { + enable_button("breath_foul"); + enable_victim("breath-foul","Smothered in humid breath"); + } + } + document.getElementById("button-arousal").innerHTML = (macro.arousalEnabled ? "Arousal On" : "Arousal Off"); if (!macro.arousalEnabled) { document.getElementById("arousal").style.display = "none"; diff --git a/recursive-desc.js b/recursive-desc.js index 5b45775..8166d60 100644 --- a/recursive-desc.js +++ b/recursive-desc.js @@ -30,7 +30,8 @@ var actions = ["eat","chew","vomit","stomp","stomp-wedge","flex-toes","kick","an "soul-digest","wear-shoe","remove-shoe","wear-sock","remove-sock","stuff-shoe","dump-shoe","stuff-sock","dump-sock","piss","bladder-vore","scat", "sheath-toy","slit-toy","breast-toy","melt","solidify","flood","stomp-goo","goo-digest","ass-goo","goo-stomach-pull","goo-stomach-push", "goo-bowels-pull","goo-bowels-push","goo-womb-pull","goo-womb-push","goo-balls-pull","goo-balls-push","goo-breasts-pull","goo-breasts-push", -"goo-tail-pull","goo-tail-push","goo-paws-pull","goo-paws-push","paw-vore","paw-vore-toes","paws","crop-swallow","crop-transfer"]; +"goo-tail-pull","goo-tail-push","goo-paws-pull","goo-paws-push","paw-vore","paw-vore-toes","paws","crop-swallow","crop-transfer", +"breath-fire","breath-ice","breath-electric","breath-smoke","breath-radiation","breath-foul"]; for (let i=0; i 1 ? "They" : "It") + " shatters a heartbeat later, reduced to dust by your power."; + } + } + + return "ICE" + container.describe(verbose); +} + +function defaultBreathElectric(container, macro, verbose) { + if (isNonFatal(macro)) { + return nonFatalBreath(container, macro, verbose, "electricity", "shocking"); + } + + if (isFatal(macro)) { + if (macro.breathStyle == "line") { + return "A blinding lance of lightning blasts from your spread " + macro.jawDesc(true) + ", cooking a " + container.describe(verbose) + " from the inside out."; + } else if (macro.breathStyle == "cone") { + return "You exhale a brilliant, forking spray of lightning. The flickering bolts arc through " + container.describe(verbose) + ", cooking everything to a crisp."; + } + } + + return "ELECTRIC" + container.describe(verbose); +} + +function defaultBreathSmoke(container, macro, verbose) { + if (isNonFatal(macro)) { + return nonFatalBreath(container, macro, verbose, "smoke", "smothering"); + } + + if (isFatal(macro)) { + if (macro.breathStyle == "line") { + return "You part your " + macro.jawDesc(true) + " a touch and blow, casting a thin gout of smoke that envelops a " + container.describe(verbose) + ". Your prey is snuffed out like a candle."; + } else if (macro.breathStyle == "cone") { + return "You open wide and exhale. A rolling storm of smoke pours forth, smothering " + container.describe(verbose) + " in a pyroclastic flow."; + } + } + + return "SMOKE" + container.describe(verbose); +} + +function defaultBreathRadiation(container, macro, verbose) { + if (isNonFatal(macro)) { + return nonFatalBreath(container, macro, verbose, "radiation", "frying"); + } + + if (isFatal(macro)) { + if (macro.breathStyle == "line") { + return "Your depths pour out a narrow beam of crackling green energy, striking a " + container.describe(verbose) + " and frying it to a crisp, turning your prey to dust in the wind."; + } else if (macro.breathStyle == "cone") { + return "You part your " + macro.jawDesc(true) + ", roaring as a massive tide of radiation spews forth. It rolls over " + container.describe(verbose) + ", evaporating " + (container.count > 1 ? "them" : "it") + " in seconds."; + } + } + + return "RADIATION" + container.describe(verbose); +} + +function defaultBreathFoul(container, macro, verbose) { + if (isNonFatal(macro)) { + return nonFatalBreath(container, macro, verbose, "foul air", "withering"); + } + + if (isFatal(macro)) { + if (macro.breathStyle == "line") { + return "You blow a narrow stream of breath, withering " + container.describe(verbose) + " in a focused torrent of foul, humid fumes."; + } else if (macro.breathStyle == "cone") { + return "You yawn wide and sigh, snuffing out " + container.describe(verbose) + " under a tide of hot, humid breath."; + } + } + + return "FOUL" + container.describe(verbose); +} + // EATING rules["eat"].push({ diff --git a/sounds.js b/sounds.js index 373c062..705cf26 100644 --- a/sounds.js +++ b/sounds.js @@ -14,7 +14,9 @@ let sounds = { "goo": ["Splat.", "Squish.", "Squish!", "SQLCH!", "SQLLLLRCH!", "SQQQQUEEEEELLCH!"], "vomit": - ["Hurk.", "Hurrk.", "Bleugh.", "Bleugh!", "Bleeeugh!", "BLEEEUGHK!"] + ["Hurk.", "Hurrk.", "Bleugh.", "Bleugh!", "Bleeeugh!", "BLEEEUGHK!"], + "breath": + ["Woosh.","Fwoosh.","FWOOSH.","FWOOSH!","FWOOOOOOSH!"] }; function pickByMass(list, mass) { diff --git a/stroll.html b/stroll.html index 20fbf7b..0e2d397 100644 --- a/stroll.html +++ b/stroll.html @@ -208,6 +208,7 @@ + @@ -322,6 +323,17 @@ +
+ + + + + + + + +
+
@@ -1075,6 +1087,37 @@
+ +
+ + +
+
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
    +