diff --git a/classes/User.php b/classes/User.php
index ba030e7..2d9ebdd 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -26,9 +26,11 @@ class User
public $block;
public $shadow;
// Пока несуществующие, для совместимости.
- public $married ='Someone или нет.';
- public $experience=200;
- public $stat_points =1;
+ public $married = 'Someone или нет.';
+ public $experience = 200;
+ public $stat_points = 1;
+ // Динамически рассчитываемые
+ public $health;
//Статусы того, кто смотрит на информацию.
public $watcher_id;
protected $watcherIsAdmin;
@@ -44,12 +46,17 @@ class User
$this->$key = $user_query[$key];
}
}
+ $this->health = round(($this->endurance * 3) + ($this->endurance / 2) * ($this->level - 1) + ($this->endurance / 5) * (($this->level - 1) * ($this->level - 2) / 2));
+
}
/**
* Отображает куклу персонажа (образ и слоты).
- * @param int $isBattle - установить 1, если куклу нужно отобразить в поединке (показывает параметры при наведении на образ).
- * @param int $isMain - установить 1, если куклу надо показать на странице игрока (по клику на предмет снимает его).
+ *
+ * @param int $isBattle - установить 1, если куклу нужно отобразить в поединке (показывает параметры при наведении
+ * на образ).
+ * @param int $isMain - установить 1, если куклу надо показать на странице игрока (по клику на предмет снимает
+ * его).
*
* @throws \Krugozor\Database\Mysql\Exception
*/
@@ -91,8 +98,8 @@ class User
$variables = $this->level . '
' . $this->getStrength() . '
' . $this->getDexterity() . '
' . $this->getIntuition() . '
' . $this->getEndurance() . '
' . $this->getIntelligence() . '
' . $this->getWisdom() . '
' . $this->getRoomName($this->room);
if ($isMainWindow) {
$this->Bank = new Bank($this->id);
- $captions = 'Уровень:
Сила:
Ловкость:
Интуиция:
Выносливость:
Интеллект:
Мудрость:
Опыт:
Очки характеристик:
Деньги:
Деньги в банке:';
- $variables = $this->level . '
' . $this->getStrength(1) . '
' . $this->getDexterity(1) . '
' . $this->getIntuition(1) . '
' . $this->getEndurance(1) . '
' . $this->getIntelligence(1) . '
' . $this->getWisdom(1) . '
' . $this->experience . '
' . $this->stat_points . '
' . $this->money . '
' . $this->Bank->money;
+ $captions = 'Уровень:
Здоровье:
Сила:
Ловкость:
Интуиция:
Выносливость:
Интеллект:
Мудрость:
Опыт:
Очки характеристик:
Деньги:
Деньги в банке:';
+ $variables = $this->level . '
' . $this->health . '
' . $this->getStrength(1) . '
' . $this->getDexterity(1) . '
' . $this->getIntuition(1) . '
' . $this->getEndurance(1) . '
' . $this->getIntelligence(1) . '
' . $this->getWisdom(1) . '
' . $this->experience . '
' . $this->stat_points . '
' . $this->money . '
' . $this->Bank->money;
}
if ($this->align) {
@@ -300,4 +307,9 @@ class User
}
return $sign ?? null;
}
+
+ public function getHealth(): int
+ {
+ return $this->health;
+ }
}
\ No newline at end of file