summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Eisenmann <esperantanaso@gmail.com>2018-05-05 23:46:59 -0400
committerJohn Eisenmann <esperantanaso@gmail.com>2018-05-05 23:46:59 -0400
commit016cafd0826ebc41e7d58dd17a44725579b629c8 (patch)
tree37ad1c709efa172db776dea0ab2977f2b8eec886
parent45b2f7219140e2bb3047816203d58b1771b2d710 (diff)
Enhanced bread stats
-rw-r--r--public/javascript/game.js10
-rw-r--r--views/game.html7
2 files changed, 17 insertions, 0 deletions
diff --git a/public/javascript/game.js b/public/javascript/game.js
index aeb04ca..43ab772 100644
--- a/public/javascript/game.js
+++ b/public/javascript/game.js
@@ -433,7 +433,17 @@ function performSetInventoryCommand(command) {
index += 1;
}
localPlayer.breadCount = getInventoryItemByTile(breadTile).count;
+ var tempFlourCount = getInventoryItemByTile(flourTile).count;
+ var tempWaterCount = getInventoryItemByTile(waterTile).count;
+ var tempPowderCount = getInventoryItemByTile(powderTile).count;
+ var tempUnbakedBreadCount = Math.min(tempFlourCount, tempWaterCount, tempPowderCount);
+ var tempEffectiveBreadCount = localPlayer.breadCount + tempUnbakedBreadCount;
document.getElementById("breadCount").innerHTML = localPlayer.breadCount;
+ document.getElementById("flourCount").innerHTML = tempFlourCount;
+ document.getElementById("waterCount").innerHTML = tempWaterCount;
+ document.getElementById("powderCount").innerHTML = tempPowderCount;
+ document.getElementById("unbakedBreadCount").innerHTML = tempUnbakedBreadCount;
+ document.getElementById("effectiveBreadCount").innerHTML = tempEffectiveBreadCount;
}
function performPlaceTileCommand(command) {
diff --git a/views/game.html b/views/game.html
index 5148057..4edf22d 100644
--- a/views/game.html
+++ b/views/game.html
@@ -66,6 +66,13 @@
Bread: <span id="breadCount"></span>
</div>
<div style="margin-bottom: 5px;">
+ Unbaked Bread: <span id="unbakedBreadCount"></span>
+ (<span id="flourCount" style="color: rgb(160, 160, 32);"></span>, <span id="waterCount" style="color: rgb(64, 64, 255);"></span>, <span id="powderCount" style="color: rgb(255, 64, 64);"></span>)
+ </div>
+ <div style="margin-bottom: 5px;">
+ Effective Bread: <span id="effectiveBreadCount"></span>
+ </div>
+ <div style="margin-bottom: 5px;">
HP: <span id="hp"></span> / <span id="maximumHp"></span><br />
<div class="statusBarContainer">
<div id="hpBar" class="statusBar" style="background: #FF0000;"></div>