From afcf47d77dad8e7e6ed29d6c472125610d52c480 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Fri, 23 Feb 2018 10:14:16 -0500 Subject: [PATCH] Added chewing. Adjusted layout, again. --- game.js | 40 ++++++++++++++++++++++++++++++++++++++++ recursive-desc.js | 6 ++++++ stroll.html | 3 ++- style.css | 6 +++--- 4 files changed, 51 insertions(+), 4 deletions(-) diff --git a/game.js b/game.js index ba65885..72412d2 100644 --- a/game.js +++ b/game.js @@ -873,6 +873,42 @@ function feed() update([sound,line,linesummary,newline]); } +function chew() +{ + var area = macro.handArea; + var prey = getPrey(biome, area); + + var line = describe("chew", prey, macro, verbose) + var linesummary = summarize(prey.sum(), false); + + var people = get_living_prey(prey.sum()); + var sound = ""; + if (people == 0) { + sound = ""; + } else if (people < 3) { + sound = "Snap."; + } else if (people < 10) { + sound = "Crunch."; + } else if (people < 50) { + sound = "Crack!"; + } else if (people < 500) { + sound = "CRUNCH!"; + } else if (people < 5000) { + sound = "CRRRUNCH!"; + } else { + sound = "Oh the humanity!"; + } + + var preyMass = prey.sum_property("mass"); + + macro.addGrowthPoints(preyMass); + + macro.arouse(10); + + updateVictims("digested",prey); + update([sound,line,linesummary,newline]); +} + function stomp() { var area = macro.pawArea; @@ -1812,6 +1848,9 @@ function startGame(e) { victimTypes.push("splooged"); } + if (macro.brutality < 1) { + document.getElementById("button-chew").style.display = 'none'; + } var table = document.getElementById("victim-table"); var tr = document.createElement('tr'); @@ -1887,6 +1926,7 @@ window.addEventListener('load', function(event) { document.getElementById("button-look").addEventListener("click",look); document.getElementById("button-feed").addEventListener("click",feed); + document.getElementById("button-chew").addEventListener("click",chew); document.getElementById("button-stomp").addEventListener("click",stomp); document.getElementById("button-anal_vore").addEventListener("click",anal_vore); document.getElementById("button-tail_slap").addEventListener("click",tail_slap); diff --git a/recursive-desc.js b/recursive-desc.js index abfde51..c14be4f 100644 --- a/recursive-desc.js +++ b/recursive-desc.js @@ -1,6 +1,7 @@ rules = {}; rules["eat"] = []; +rules["chew"] = []; rules["stomp"] = []; rules["kick"] = []; rules["anal-vore"] = []; @@ -112,6 +113,7 @@ function describe(action, container, macro, verbose=true) { function describeDefault(action, container, macro, verbose=true) { switch(action) { case "eat": return defaultEat(container, macro, verbose); + case "chew": return defaultChew(container, macro, verbose); case "stomp": return defaultStomp(container, macro, verbose); case "kick": return defaultKick(container, macro, verbose); case "anal-vore": return defaultAnalVore(container, macro, verbose); @@ -142,6 +144,10 @@ function defaultEat(container, macro, verbose) { return "You scoop up " + container.describe(verbose) + " and swallow " + (container.count > 1 ? "them" : "it") + " whole."; } +function defaultChew(container, macro, verbose) { + return "You scoop up " + container.describe(verbose) + " and crunch " + (container.count > 1 ? "them" : "it") + " in your powerful jaws, then swallow them down."; +} + function defaultStomp(container, macro, verbose) { if (isFatal(macro)) return "You crush " + container.describe(verbose) + " underfoot."; diff --git a/stroll.html b/stroll.html index 5ed6fe9..9d23d35 100644 --- a/stroll.html +++ b/stroll.html @@ -72,6 +72,7 @@
+ @@ -89,7 +90,7 @@ - +
diff --git a/style.css b/style.css index 534479d..aa1f28b 100644 --- a/style.css +++ b/style.css @@ -27,7 +27,7 @@ body { } #log { - height: 600px; + height: 900px; overflow: auto; background-color: #fff; } @@ -90,8 +90,8 @@ body { .action-button { font-size: 24px; - width: 120px; - height: 60px; + width: 150px; + height: 75px; } #victim-table {