| @@ -285,7 +285,7 @@ function tranceGrapple(attacker) { | |||
| function tranceStomp(attacker) { | |||
| return { | |||
| attackPlayer: function(defender) { | |||
| let result = [attacker.description("The") + " shoves you to the ground, planting one foot on your chest and crushing your entire head beneath the other, crippling you and dealing " + attack(attacker, defender, attacker.str * 5) + " damage"]; | |||
| let result = [attacker.description("The") + " shoves you to the ground, planting one foot on your chest and crushing your head beneath the other, crippling you and dealing " + attack(attacker, defender, attacker.str * 5) + " damage"]; | |||
| if (defender.health <= 0) { | |||
| result[0] += ". Your skull breaks open as his crushing weight snuffs you out like a candle, smearing your brain across the ground and splitting your jaw in half. <i>Ouch.</i>"; | |||
| defender.health = -100; | |||
| @@ -332,6 +332,11 @@ function tranceGrappleMaul(attacker) { | |||
| return isNormal(attacker) && isGrappled(defender); | |||
| } | |||
| ], | |||
| conditions: [ | |||
| function(attacker, defender) { | |||
| return defender.prefs.gore; | |||
| } | |||
| ], | |||
| priority: 1, | |||
| weight: function(attacker, defender) { return defender.health / defender.maxHealth; } | |||
| }; | |||
| @@ -349,6 +354,11 @@ function tranceGrappleThroat(attacker) { | |||
| return ["The sergal lunges for your throat, but you manage to keep his terrifying jaws at bay."]; | |||
| } | |||
| }, | |||
| conditions: [ | |||
| function(attacker, defender) { | |||
| return defender.prefs.gore; | |||
| } | |||
| ], | |||
| requirements: [ | |||
| function(attacker, defender) { | |||
| return isNormal(attacker) && isGrappled(defender); | |||
| @@ -30,6 +30,7 @@ | |||
| <div class="stats"> | |||
| <div id="player-stats"> | |||
| <div class="stat-line" id="time">Time: to file a bug report, because you shouldn't see this!</div> | |||
| <div class="stat-line" id="date">Date: you'll have to buy me dinner first :v</div> | |||
| <div class="stat-line" id="stat-name">Vim: 15</div> | |||
| <div class="stat-line" id="stat-cash">Spondulicks: 150000</div> | |||
| <div class="stat-line" id="stat-health">Pulchritude: 44</div> | |||
| @@ -11,11 +11,15 @@ let actionButtons = []; | |||
| let mode = "explore"; | |||
| let actions = []; | |||
| let time = 9*60*60; | |||
| let date = 1; | |||
| let newline = " "; | |||
| let player = new Player(); | |||
| let playerAttacks = []; | |||
| let killingBlow = null; | |||
| let deaths = []; | |||
| let respawnRoom; | |||
| function join(things) { | |||
| @@ -210,6 +214,7 @@ function updateDisplay() { | |||
| } | |||
| document.getElementById("time").innerHTML = "Time: " + renderTime(time); | |||
| document.getElementById("date").innerHTML = "Day " + date; | |||
| 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-cash").innerHTML = "Cash: $" + round(player.cash,0); | |||
| @@ -223,7 +228,12 @@ function updateDisplay() { | |||
| } | |||
| function advanceTime(amount) { | |||
| time = (time + amount) % 86400; | |||
| time = (time + amount); | |||
| date += Math.floor(time / 86400); | |||
| time = time % 86400; | |||
| player.restoreHealth(amount); | |||
| player.restoreStamina(amount); | |||
| update(player.stomach.digest(amount)); | |||
| @@ -378,11 +388,23 @@ function changeMode(newMode) { | |||
| } | |||
| function respawn(respawnRoom) { | |||
| if (killingBlow.gameover == undefined) { | |||
| if (player.prefs.prey) { | |||
| deaths.push("Digested by " + currentFoe.description("a") + " at " + renderTime(time) + " on day " + date); | |||
| } else { | |||
| deaths.push("Defeated by " + currentFoe.description("a") + " at " + renderTime(time) + " on day " + date); | |||
| } | |||
| } | |||
| moveTo(respawnRoom,"You drift through space and time..."); | |||
| player.clear(); | |||
| player.stomach.contents = []; | |||
| player.butt.contents = []; | |||
| advanceTime(86400/2); | |||
| player.bowels.contents = []; | |||
| player.bowels.fullness = 0; | |||
| advanceTime(Math.floor(86400 / 2 * (Math.random() * 0.5 - 0.25 + 1))); | |||
| changeMode("explore"); | |||
| player.health = 100; | |||
| update(["You wake back up in your bed."]); | |||
| @@ -409,6 +431,7 @@ function attackClicked(index) { | |||
| update(attack.attackPlayer(player)); | |||
| if (player.health <= -100) { | |||
| killingBlow = attack; | |||
| update(["You die..."]); | |||
| respawn(respawnRoom); | |||
| } else if (player.health <= 0) { | |||
| @@ -416,6 +439,8 @@ function attackClicked(index) { | |||
| if (player.prefs.prey) { | |||
| changeMode("eaten"); | |||
| } else { | |||
| killingBlow = attack; | |||
| update(["You die..."]); | |||
| respawn(respawnRoom); | |||
| } | |||
| } | |||
| @@ -447,6 +472,7 @@ function struggleClicked(index) { | |||
| update([digest.digest(player)]); | |||
| if (player.health <= -100) { | |||
| killingBlow = digest; | |||
| update(currentFoe.finishDigest()); | |||
| respawn(respawnRoom); | |||
| } | |||
| @@ -96,6 +96,19 @@ function Bed() { | |||
| }); | |||
| } | |||
| function Journal() { | |||
| GameObject.call(this, "Journal"); | |||
| this.actions.push({ | |||
| "name": "Read Journal", | |||
| "action": function() { | |||
| if (deaths.length == 0) | |||
| update(["You pick up the journal and read it.",newline,"It's empty."]); | |||
| else | |||
| update(["You pick up the journal and read it.",newline].concat(deaths)); | |||
| } | |||
| }); | |||
| } | |||
| function Sofa() { | |||
| GameObject.call(this, "Sofa"); | |||
| this.actions.push({ | |||
| @@ -31,7 +31,8 @@ let locationsSrc = [ | |||
| } | |||
| ], | |||
| "objs": [ | |||
| Bed | |||
| Bed, | |||
| Journal | |||
| ], | |||
| }, | |||
| { | |||