Преглед на файлове

Adding health/stamina percent functions to master

tags/v0.2.8
Fen Dweller преди 7 години
родител
ревизия
63c2653871
променени са 1 файла, в които са добавени 8 реда и са изтрити 0 реда
  1. +8
    -0
      vore.js

+ 8
- 0
vore.js Целия файл

@@ -67,6 +67,14 @@ function Creature(name = "Creature", str = 10, dex = 10, con = 10) {
this.healthRate = 1 / 86400 * 4;
this.staminaRate = 1 / 86400 * 6;

this.healthPercentage = function() {
return this.health / this.maxHealth;
};

this.staminaPercentage = function() {
return this.stamina / this.maxStamina;
};

this.restoreHealth = function(time) {
this.health = Math.min(this.maxHealth, this.health + this.maxHealth * time * this.healthRate);
};


Loading…
Отказ
Запис