From b5c6c5ca12813ba0830017a4c8150e3df78299de Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sun, 18 Feb 2018 19:27:28 -0500 Subject: [PATCH] Rearranged layout. Added stroll/stand info. Fixed plural kills. Fixed verbose setting for containers --- game.js | 11 ++++++++--- recursive-macro.js | 6 +++--- stroll.html | 14 +++++++------- style.css | 8 +++++++- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/game.js b/game.js index 2ac1d48..7310d90 100644 --- a/game.js +++ b/game.js @@ -12,6 +12,11 @@ victims = {}; function toggle_auto() { strolling = !strolling; + document.getElementById("strolling-indicator").innerHTML = strolling ? "Strolling" : "Standing"; + if (strolling) + update(["You start walking."]); + else + update(["You stop walking."]); } function initVictims() { @@ -32,7 +37,7 @@ function initVictims() // lists out total people function summarize(sum, fatal = true) { - return "(" + sum["Person"] + " " + (fatal ? "kills" : "people") + ")"; + return "(" + sum["Person"] + " " + (fatal ? (sum["Person"] > 1 ? "kills" : "kill") : (sum["Person"] > 1 ? "people" : "person")) + ")"; } var stomach = [] @@ -245,9 +250,9 @@ function doDigest(containerName) } if (containerName == "stomach") - update(["Your stomach gurgles as it digests " + container.describe() + " " + summarize(container.sum())]); + update(["Your stomach gurgles as it digests " + container.describe(false) + " " + summarize(container.sum())]); else if (containerName == "bowels") - update(["Your bowels churn as they absorb " + container.describe() + " " + summarize(container.sum())]); + update(["Your bowels churn as they absorb " + container.describe(false) + " " + summarize(container.sum())]); if (digestType.length > 0) { setTimeout(function() { diff --git a/recursive-macro.js b/recursive-macro.js index 6e9838c..61fb09b 100644 --- a/recursive-macro.js +++ b/recursive-macro.js @@ -144,11 +144,11 @@ var masses = // describes everything in the container -function describe_all(contents) { +function describe_all(contents,verbose=true) { var things = []; for (var key in contents) { if (contents.hasOwnProperty(key)) { - things.push(contents[key].describe()); + things.push(contents[key].describe(verbose)); } } return merge_things(things); @@ -360,7 +360,7 @@ function Container(contents = []) { } this.describe = function(verbose = true) { - return describe_all(this.contents) + return describe_all(this.contents,false) } return this; diff --git a/stroll.html b/stroll.html index 26802f4..3ca1e7a 100644 --- a/stroll.html +++ b/stroll.html @@ -8,9 +8,14 @@ +
+

Stats

+
+
+
-
Welcome to Stroll 0.1.1
+
Welcome to Stroll 0.1.2
It's a nice day for a walk
@@ -19,13 +24,8 @@
- +
Standing
-
-

Stats

-
-
-

Stomped

diff --git a/style.css b/style.css index 27f5ca3..c1d790d 100644 --- a/style.css +++ b/style.css @@ -13,6 +13,12 @@ body { float:left; } +.stat-header-self { + font-weight: bold; + font-size: 150%; + min-width:250px; + float:left; +} .stat-header { font-weight: bold; font-size: 150%; @@ -30,5 +36,5 @@ body { } .action-button { - + }