Browse Source

Added a status display

tags/v0.2.8
Fen Dweller 7 years ago
parent
commit
387c674327
4 changed files with 73 additions and 4 deletions
  1. +7
    -0
      feast.css
  2. +3
    -2
      feast.html
  3. +59
    -0
      feast.js
  4. +4
    -2
      vore.js

+ 7
- 0
feast.css View File

@@ -50,6 +50,13 @@ button {
);
}

.stat-button {
width: 100px;
height: 50px;
font-size: 18px;
user-select: none;
}

.compass-button {
width: 100px;
height: 100px;


+ 3
- 2
feast.html View File

@@ -26,7 +26,7 @@
<div id="game-and-stats">
<div id="log">
<div>
Welcome to Feast v0.2.0
Welcome to Feast v0.2.1
</div>
<div>
&nbsp;
@@ -45,6 +45,7 @@
<div class="stat-line" id="stat-stamina">Imagination: 97</div>
<div class="stat-line" id="stat-fullness">Candy Corn: 3</div>
<div class="stat-line" id="stat-bowels">Emotions: 35/100</div>
<button class="stat-button" id="stat-button-status">Status</button>
</div>
<div id="foe-stats">
FOE
@@ -156,7 +157,7 @@
</div>
<div id="create">
<p>
Welcome to Feast v0.2.0
Welcome to Feast v0.2.1
</p>

<p>


+ 59
- 0
feast.js View File

@@ -306,6 +306,7 @@ function start() {
applySettings(generateSettings());
document.getElementById("create").style.display = "none";
document.getElementById("game").style.display = "block";
document.getElementById("stat-button-status").addEventListener("click", status, false);
loadActions();
loadCompass();
loadDialog();
@@ -591,6 +592,64 @@ function look() {
update([currentRoom.description]);
}

function status() {
let lines = [];

lines.push("You are a " + player.species);

lines.push(newline);

if (player.stomach.contents.length > 0) {
lines.push("Your stomach bulges with prey.");

player.stomach.contents.map(function(prey) {
let state = "";
let healthRatio = prey.health / prey.maxHealth;

if (healthRatio > 0.75) {
state = "is thrashing in your gut";
} else if (healthRatio > 0.5) {
state = "is squirming in your belly";
} else if (healthRatio > 0.25) {
state = "is pressing out at your stomach walls";
} else if (healthRatio > 0) {
state = "is weakly squirming";
} else {
state = "has stopped moving";
}

lines.push(prey.description("A") + " " + state);
});
lines.push(newline);
}

if (player.butt.contents.length > 0) {
lines.push("Your bowels churn with prey.");

player.butt.contents.map(function(prey) {
let state = "";
let healthRatio = prey.health / prey.maxHealth;

if (healthRatio > 0.75) {
state = "is writhing in your bowels";
} else if (healthRatio > 0.5) {
state = "is struggling against your intestines";
} else if (healthRatio > 0.25) {
state = "is bulging out of your lower belly";
} else if (healthRatio > 0) {
state = "is squirming weakly, slipping deeper and deeper";
} else {
state = "has succumbed to your bowels";
}

lines.push(prey.description("A") + " " + state);
});
lines.push(newline);
}

update(lines);
}

let toSave = ["str","dex","con","name","species"];

function saveGame() {


+ 4
- 2
vore.js View File

@@ -212,6 +212,8 @@ class Container {
this.contents = [];
// health/sec
this.damageRate = 15*100/86400;
// health percent/sec
this.damageRatePercent = 1/86400;

// kg/sec
this.digestRate = 80/8640;
@@ -221,9 +223,9 @@ class Container {
let lines = [];
this.contents.forEach(function(prey) {
if (prey.health > 0) {
let damage = Math.min(prey.health, this.damageRate * time);
let damage = Math.min(prey.health, this.damageRate * time + this.damageRatePercent * prey.maxHealth * time);
prey.health -= damage;
time -= damage / this.damageRate;
time -= damage / (this.damageRate + this.damageRatePercent * prey.maxHealth);

if (prey.health + damage > 50 && prey.health <= 50) {
lines.push(this.describeDamage(prey));


Loading…
Cancel
Save