| @@ -30,7 +30,8 @@ | |||||
| <div class="stat-line" id="time">Time: to get a watch</div> | <div class="stat-line" id="time">Time: to get a watch</div> | ||||
| <div class="stat-line" id="stat-name">Vim: 15</div> | <div class="stat-line" id="stat-name">Vim: 15</div> | ||||
| <div class="stat-line" id="stat-health">Pulchritude: 44</div> | <div class="stat-line" id="stat-health">Pulchritude: 44</div> | ||||
| <div class="stat-line" id="stat-fullness">Imagination: 97</div> | |||||
| <div class="stat-line" id="stat-stamina">Imagination: 97</div> | |||||
| <div class="stat-line" id="stat-fullness">Candy Corn: 3</div> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div id="footer"> | <div id="footer"> | ||||
| @@ -165,6 +165,7 @@ function updateDisplay() { | |||||
| document.getElementById("time").innerHTML = "Time: " + renderTime(time); | document.getElementById("time").innerHTML = "Time: " + renderTime(time); | ||||
| document.getElementById("stat-name").innerHTML = "Name: " + player.name; | document.getElementById("stat-name").innerHTML = "Name: " + player.name; | ||||
| document.getElementById("stat-health").innerHTML = "Health: " + round(player.health,0) + "/" + round(player.maxHealth,0); | document.getElementById("stat-health").innerHTML = "Health: " + round(player.health,0) + "/" + round(player.maxHealth,0); | ||||
| document.getElementById("stat-stamina").innerHTML = "Stamina: " + round(player.stamina,0) + "/" + round(player.maxStamina,0); | |||||
| document.getElementById("stat-fullness").innerHTML = "Fullness: " + round(player.fullness(),0); | document.getElementById("stat-fullness").innerHTML = "Fullness: " + round(player.fullness(),0); | ||||
| } | } | ||||
| @@ -20,8 +20,10 @@ function Creature(name = "Creature", str=10, dex=10, con=10) { | |||||
| this.dex = dex; | this.dex = dex; | ||||
| this.con = con; | this.con = con; | ||||
| Object.defineProperty(this, "maxHealth", {get: function() { return this.con * 10 }}); | |||||
| Object.defineProperty(this, "maxHealth", {get: function() { return this.str * 5 + this.con * 10 }}); | |||||
| this.health = this.maxHealth; | this.health = this.maxHealth; | ||||
| Object.defineProperty(this, "maxStamina", {get: function() { return this.dex * 5 + this.con * 10 }}); | |||||
| this.stamina = this.maxStamina; | |||||
| } | } | ||||
| function Player(name = "Player") { | function Player(name = "Player") { | ||||