From 94e1dccaef16499df6707d98b4f2586b2af390aa Mon Sep 17 00:00:00 2001 From: "Igor Barkov (iwork)" Date: Mon, 20 Jul 2020 12:32:51 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D1=82=D0=B0=D1=82=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B0=D0=B6=D0=B0?= =?UTF-8?q?=D0=BB=D0=BE=20=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20=D1=81?= =?UTF-8?q?=D0=B8=D0=BB=D1=83.=20=D0=A2=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20?= =?UTF-8?q?=D0=BA=20=D1=81=D1=82=D0=B0=D1=82=D0=B0=D0=BC=20=D0=BC=D0=BE?= =?UTF-8?q?=D0=B6=D0=BD=D0=BE=20=D0=BE=D0=B1=D1=80=D0=B0=D1=89=D0=B0=D1=82?= =?UTF-8?q?=D1=8C=D1=81=D1=8F=20=D0=BD=D0=B0=D0=BF=D1=80=D1=8F=D0=BC=D0=B8?= =?UTF-8?q?=D0=BA.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/User.php | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/classes/User.php b/classes/User.php index 2d9ebdd..1cb1265 100644 --- a/classes/User.php +++ b/classes/User.php @@ -25,10 +25,15 @@ class User public $room; public $block; public $shadow; + + public const STAT_MAXIMUM_AMOUNT = 40; // Пока несуществующие, для совместимости. public $married = 'Someone или нет.'; public $experience = 200; public $stat_points = 1; + public $headArmor; + public $chestArmor; + public $legArmor; // Динамически рассчитываемые public $health; //Статусы того, кто смотрит на информацию. @@ -129,52 +134,55 @@ class User echo ''; } - private function getStrength($isMainWindow = 0) + public function getStrength($isMainWindow = 0) { - if ($this->stat_points && $isMainWindow) { + if ($this->stat_points && $isMainWindow && $this->strength < self::STAT_MAXIMUM_AMOUNT) { + //main.php?edit=1&ups=sila return sprintf('%s [+]', $this->strength); } return $this->strength; } - private function getDexterity($isMainWindow = 0) + public function getDexterity($isMainWindow = 0) { - if ($this->stat_points && $isMainWindow) { + if ($this->stat_points && $isMainWindow && $this->dexterity < self::STAT_MAXIMUM_AMOUNT) { + //main.php?edit=1&ups=lovk return sprintf('%s [+]', $this->dexterity); } - return $this->strength; + return $this->dexterity; } - private function getIntuition($isMainWindow = 0) + public function getIntuition($isMainWindow = 0) { - if ($this->stat_points && $isMainWindow) { + if ($this->stat_points && $isMainWindow && $this->intuition < self::STAT_MAXIMUM_AMOUNT) { + //main.php?edit=1&ups=inta... return sprintf('%s [+]', $this->intuition); } - return $this->strength; + return $this->intuition; } - private function getEndurance($isMainWindow = 0) + public function getEndurance($isMainWindow = 0) { - if ($this->stat_points && $isMainWindow) { + if ($this->stat_points && $isMainWindow && $this->endurance < self::STAT_MAXIMUM_AMOUNT) { return sprintf('%s [+]', $this->endurance); } - return $this->strength; + return $this->endurance; } - private function getIntelligence($isMainWindow = 0) + public function getIntelligence($isMainWindow = 0) { - if ($this->stat_points && $isMainWindow) { + if ($this->stat_points && $isMainWindow && $this->intelligence < self::STAT_MAXIMUM_AMOUNT) { return sprintf('%s [+]', $this->intelligence); } - return $this->strength; + return $this->intelligence; } - private function getWisdom($isMainWindow = 0) + public function getWisdom($isMainWindow = 0) { - if ($this->stat_points && $isMainWindow) { + if ($this->stat_points && $isMainWindow && $this->wisdom < self::STAT_MAXIMUM_AMOUNT) { return sprintf('%s [+]', $this->wisdom); } - return $this->strength; + return $this->wisdom; } private function UserInfo()