Bläddra i källkod

Passage of time heals you. Fixed a wrong requirement for the leer move

tags/v0.2.8
Fen Dweller 7 år sedan
förälder
incheckning
32e186e5b2
2 ändrade filer med 5 tillägg och 3 borttagningar
  1. +1
    -1
      combat.js
  2. +4
    -2
      feast.js

+ 1
- 1
combat.js Visa fil

@@ -58,7 +58,7 @@ function leer(attacker) {
return "The " + attacker.description() + " leers at you."; return "The " + attacker.description() + " leers at you.";
}, },
requirements: [ requirements: [
function(attacker, defender) { return attack.leering != true; }
function(attacker, defender) { return attacker.leering != true; }
] ]
}; };
} }


+ 4
- 2
feast.js Visa fil

@@ -153,12 +153,13 @@ 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: " + player.health + "/" + player.maxHealth;
document.getElementById("stat-health").innerHTML = "Health: " + round(player.health,0) + "/" + round(player.maxHealth,0);
document.getElementById("stat-fullness").innerHTML = "Fullness: " + round(player.fullness(),0); document.getElementById("stat-fullness").innerHTML = "Fullness: " + round(player.fullness(),0);
} }


function advanceTime(amount) { function advanceTime(amount) {
time = (time + amount) % 86400; time = (time + amount) % 86400;
player.health = Math.min(amount * player.maxHealth / 86400 * 12 + player.health, player.maxHealth);
update(player.stomach.digest(amount)); update(player.stomach.digest(amount));
} }


@@ -315,7 +316,7 @@ function attackClicked(index) {
attacks = attacks.filter(attack => attack.requirements == undefined || attack.requirements.reduce((result, test) => result && test(currentFoe, player), true)); attacks = attacks.filter(attack => attack.requirements == undefined || attack.requirements.reduce((result, test) => result && test(currentFoe, player), true));


let attack = pick(attacks); let attack = pick(attacks);
if (attack == null) { if (attack == null) {
attack = currentFoe.backupAttack; attack = currentFoe.backupAttack;
} }
@@ -349,6 +350,7 @@ function struggleClicked(index) {
if (player.health <= -100) { if (player.health <= -100) {
update(["You digest in the depths of the " + currentFoe.description()]); update(["You digest in the depths of the " + currentFoe.description()]);
moveTo(respawnRoom,"You drift through space and time..."); moveTo(respawnRoom,"You drift through space and time...");
advanceTime(86400/2);
changeMode("explore"); changeMode("explore");
player.health = 100; player.health = 100;
update(["You wake back up in your bed."]); update(["You wake back up in your bed."]);


Laddar…
Avbryt
Spara