Преглед изворни кода

Enemy stats are shown. Struggling is much harder at negative HP.

tags/v0.2.8
Fen Dweller пре 8 година
родитељ
комит
bfb66cc0e5
5 измењених фајлова са 41 додато и 12 уклоњено
  1. +1
    -1
      combat.js
  2. +10
    -1
      feast.css
  3. +17
    -9
      feast.html
  4. +6
    -0
      feast.js
  5. +7
    -1
      vore.js

+ 1
- 1
combat.js Прегледај датотеку

@@ -344,7 +344,7 @@ function leer(attacker) {
desc: "Leer at something", desc: "Leer at something",
attackPlayer: function(defender) { attackPlayer: function(defender) {
attacker.leering = true; attacker.leering = true;
return attacker.description("The") + " leers at you.";
return [attacker.description("The") + " leers at you."];
}, },
requirements: [ requirements: [
function(attacker, defender) { return attacker.leering != true && attacker.flags.grappled != true; } function(attacker, defender) { return attacker.leering != true && attacker.flags.grappled != true; }


+ 10
- 1
feast.css Прегледај датотеку

@@ -106,11 +106,20 @@ button {
overflow: auto; overflow: auto;
} }


#stats {
.stats {
float: right; float: right;
flex: 1; flex: 1;
} }


#player-stats {
height: 50%;
}

#foe-stats {
display: none;
height: 50%;
}

.stat-line { .stat-line {


} }


+ 17
- 9
feast.html Прегледај датотеку

@@ -25,16 +25,24 @@
<div id="game"> <div id="game">
<div id="game-and-stats"> <div id="game-and-stats">
<div id="log"> <div id="log">
Welcome to Feast v0.1.1
Welcome to Feast v0.1.2
</div> </div>
<div id="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="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>
<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>
<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="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>
<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>
</div>
<div id="foe-stats">
FOE
<div class="stat-line" id="stat-foe-name">Vim: 21</div>
<div class="stat-line" id="stat-foe-health">Pulchritude: 21</div>
<div class="stat-line" id="stat-foe-stamina">Imagination: 66</div>
</div>
</div> </div>
</div> </div>
<div id="footer"> <div id="footer">


+ 6
- 0
feast.js Прегледај датотеку

@@ -155,6 +155,10 @@ function updateCombat() {
li.appendChild(button); li.appendChild(button);
list.appendChild(li); list.appendChild(li);
} }

document.getElementById("stat-foe-name").innerHTML = "Name: " + currentFoe.name;
document.getElementById("stat-foe-health").innerHTML = "Health: " + currentFoe.health + "/" + currentFoe.maxHealth;
document.getElementById("stat-foe-stamina").innerHTML = "Stamina: " + currentFoe.stamina + "/" + currentFoe.maxStamina;
} }


function updateDialog() { function updateDialog() {
@@ -348,6 +352,7 @@ function update(lines=[]) {
function changeMode(newMode) { function changeMode(newMode) {
mode = newMode; mode = newMode;
let body = document.querySelector("body"); let body = document.querySelector("body");
document.getElementById("foe-stats").style.display = "none";
body.className = ""; body.className = "";
switch(mode) { switch(mode) {
case "explore": case "explore":
@@ -356,6 +361,7 @@ function changeMode(newMode) {
break; break;
case "combat": case "combat":
body.classList.add("combat"); body.classList.add("combat");
document.getElementById("foe-stats").style.display = "block";
break; break;
case "eaten": case "eaten":
body.classList.add("eaten"); body.classList.add("eaten");


+ 7
- 1
vore.js Прегледај датотеку

@@ -144,7 +144,7 @@ function Anthro(name="Anthro") {
} }


function Fen() { function Fen() {
Anthro.call(this, name, 1000000, 1099900, 1000000);
Creature.call(this, name, 1000000, 1099900, 1000000);


this.build = "loomy"; this.build = "loomy";
this.species = "crux"; this.species = "crux";
@@ -354,6 +354,9 @@ function plead(predator) {
desc: "Ask very, very nicely for the predator to let you go. More effective if you haven't hurt your predator.", desc: "Ask very, very nicely for the predator to let you go. More effective if you haven't hurt your predator.",
struggle: function(player) { struggle: function(player) {
let escape = Math.random() < predator.health / predator.maxHealth && Math.random() < 0.33; let escape = Math.random() < predator.health / predator.maxHealth && Math.random() < 0.33;
if (player.health <= 0) {
escape = escape && Math.random() < 0.25;
}


if (escape) { if (escape) {
return { return {
@@ -376,6 +379,9 @@ function struggle(predator) {
desc: "Try to squirm free. More effective if you've hurt your predator.", desc: "Try to squirm free. More effective if you've hurt your predator.",
struggle: function(player) { struggle: function(player) {
let escape = Math.random() > predator.health / predator.maxHealth && Math.random() < 0.33; let escape = Math.random() > predator.health / predator.maxHealth && Math.random() < 0.33;
if (player.health <= 0) {
escape = escape && Math.random() < 0.25;
}


if (escape) { if (escape) {
return { return {


Loading…
Откажи
Сачувај