diff --git a/customs.js b/customs.js index c832d79..d7c4bbf 100644 --- a/customs.js +++ b/customs.js @@ -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. Ouch."; 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); diff --git a/feast.html b/feast.html index cee8ea7..07cdbd8 100644 --- a/feast.html +++ b/feast.html @@ -30,6 +30,7 @@
Time: to file a bug report, because you shouldn't see this!
+
Date: you'll have to buy me dinner first :v
Vim: 15
Spondulicks: 150000
Pulchritude: 44
diff --git a/feast.js b/feast.js index c3edac3..ef976ab 100644 --- a/feast.js +++ b/feast.js @@ -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); } diff --git a/objects.js b/objects.js index ba21a37..81b937a 100644 --- a/objects.js +++ b/objects.js @@ -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({ diff --git a/world.js b/world.js index 70f35f4..5da4565 100644 --- a/world.js +++ b/world.js @@ -31,7 +31,8 @@ let locationsSrc = [ } ], "objs": [ - Bed + Bed, + Journal ], }, {