From 484695af10b2707ba9a9249cd588975f3cab0c89 Mon Sep 17 00:00:00 2001 From: lopar Date: Thu, 11 Mar 2021 20:14:41 +0200 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=B1?= =?UTF-8?q?=D0=BE=D0=BD=D1=83=D1=81=20=D0=B2=D0=BC=D0=B5=D1=81=D1=82=D0=BE?= =?UTF-8?q?=20=D1=87=D0=B8=D1=81=D1=82=D0=BE=D0=B3=D0=BE=20=D1=81=D1=82?= =?UTF-8?q?=D0=B0=D1=82=D0=B0=20=D1=82=D0=B0=D0=BC,=20=D0=B3=D0=B4=D0=B5?= =?UTF-8?q?=20=D1=8D=D1=82=D0=BE=20=D0=BD=D0=B5=D0=BE=D0=B1=D1=85=D0=BE?= =?UTF-8?q?=D0=B4=D0=B8=D0=BC=D0=BE.=20=D0=A3=D0=BD=D0=B8=D1=84=D0=B8?= =?UTF-8?q?=D0=BA=D0=B0=D1=86=D0=B8=D1=8F=20=D0=B7=D0=B0=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D1=81=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD?= =?UTF-8?q?=D0=BE=D0=B9.=20#18?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/Battles/DressedItems.php | 30 ------------------------------ classes/Battles/UserInfo.php | 12 ++++++------ classes/Battles/UserStats.php | 12 ++++++------ main.php | 26 +++++++++++++------------- 4 files changed, 25 insertions(+), 55 deletions(-) diff --git a/classes/Battles/DressedItems.php b/classes/Battles/DressedItems.php index 5fcb770..b429f08 100644 --- a/classes/Battles/DressedItems.php +++ b/classes/Battles/DressedItems.php @@ -60,36 +60,6 @@ SQL; return self::$db->fetch($query, $this->USERID); } - public function getStrengthBonus(): ?int - { - return self::getBonuses()['sum_strength']; - } - - public function getDexterityBonus(): ?int - { - return self::getBonuses()['sum_dexterity']; - } - - public function getIntuitionBonus(): ?int - { - return self::getBonuses()['sum_intuition']; - } - - public function getEnduranceBonus(): ?int - { - return self::getBonuses()['sum_endurance']; - } - - public function getIntelliganceBonus(): ?int - { - return self::getBonuses()['sum_intelligence']; - } - - public function getWisdomBonus(): ?int - { - return self::getBonuses()['sum_wisdom']; - } - public function getAccuracyBonus(): ?int { return self::getBonuses()['sum_accuracy'] ?? 0; diff --git a/classes/Battles/UserInfo.php b/classes/Battles/UserInfo.php index 26a8c0f..0794276 100644 --- a/classes/Battles/UserInfo.php +++ b/classes/Battles/UserInfo.php @@ -53,12 +53,12 @@ class UserInfo extends UserStats $captions = 'Уровень:
Сила:
Ловкость:
Интуиция:
Выносливость:
Интеллект:
Мудрость:
Местонахождение:'; $variables = $this->level . '
' . - parent::getStat('strength') . '
' . - parent::getStat('dexterity') . '
' . - parent::getStat('intuition') . '
' . - parent::getStat('endurance') . '
' . - parent::getStat('intelligence') . '
' . - parent::getStat('wisdom') . '
' . + parent::getFullStats()->strength . '
' . + parent::getFullStats()->dexterity . '
' . + parent::getFullStats()->intuition . '
' . + parent::getFullStats()->endurance . '
' . + parent::getFullStats()->intelligence . '
' . + parent::getFullStats()->wisdom . '
' . Rooms::$roomNames[$this->room]; if ($isMainWindow) { $this->Bank = new Bank($this->id); diff --git a/classes/Battles/UserStats.php b/classes/Battles/UserStats.php index 74a5055..09ce3d9 100644 --- a/classes/Battles/UserStats.php +++ b/classes/Battles/UserStats.php @@ -221,12 +221,12 @@ class UserStats extends User { $query = " select - sum(greatest(strength + (ifnull((select sum(add_strength) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as allStrength, - sum(greatest(dexterity + (ifnull((select sum(add_dexterity) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as allDexterity, - sum(greatest(intuition + (ifnull((select sum(add_intuition) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as allIntuition, - sum(greatest(endurance + (ifnull((select sum(add_endurance) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as allEndurance, - sum(greatest(intelligence + (ifnull((select sum(add_intelligence) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as allIntelligence, - sum(greatest(wisdom + (ifnull((select sum(add_wisdom) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as allWisdom + sum(greatest(strength + (ifnull((select sum(add_strength) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as strength, + sum(greatest(dexterity + (ifnull((select sum(add_dexterity) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as dexterity, + sum(greatest(intuition + (ifnull((select sum(add_intuition) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as intuition, + sum(greatest(endurance + (ifnull((select sum(add_endurance) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as endurance, + sum(greatest(intelligence + (ifnull((select sum(add_intelligence) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as intelligence, + sum(greatest(wisdom + (ifnull((select sum(add_wisdom) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as wisdom from users where id = $this->id"; return self::$db->ofetch($query); } diff --git a/main.php b/main.php index 4d115b5..04e240b 100644 --- a/main.php +++ b/main.php @@ -164,12 +164,12 @@ function dressitem($id) $error = DRESSITEM_ERROR['ITEM_NOT_FOUND']; } else { $selectedItem = $selectedItemRow->fetch_object(); - if ($selectedItem->need_strength > $userStats->getFullStats()->allStrength - || $selectedItem->need_dexterity > $userStats->getFullStats()->allDexterity - || $selectedItem->need_intuition > $userStats->getFullStats()->allIntuition - || $selectedItem->need_endurance > $userStats->getFullStats()->allEndurance - || $selectedItem->need_intelligence > $userStats->getFullStats()->allIntelligence - || $selectedItem->need_wisdom > $userStats->getFullStats()->allWisdom) { + if ($selectedItem->need_strength > $userStats->getFullStats()->strength + || $selectedItem->need_dexterity > $userStats->getFullStats()->dexterity + || $selectedItem->need_intuition > $userStats->getFullStats()->intuition + || $selectedItem->need_endurance > $userStats->getFullStats()->endurance + || $selectedItem->need_intelligence > $userStats->getFullStats()->intelligence + || $selectedItem->need_wisdom > $userStats->getFullStats()->wisdom) { $error = DRESSITEM_ERROR['REQUIREMENTS_NOT_MET']; } else { $itemInSlotRow = db::c()->query('SELECT dressed_slot FROM inventory WHERE owner_id = ?i AND dressed_slot > 0 AND item_type = ?i', $_SESSION['uid'], $selectedItem->item_type); @@ -381,17 +381,17 @@ Template::header('Игра');
- Сила: getFreeStatPoints() ? $userStats->getStat('strength', 1) . '(' . strval($userStats->getStrength() + $getItemsBonuses->getStrengthBonus()) . ')' : $userStats->getStrength() + $getItemsBonuses->getStrengthBonus()) ?> + Сила: getFreeStatPoints() ? $userStats->getStat('strength', 1) . '(' . strval($userStats->getFullStats()->strength) . ')' : $userStats->getFullStats()->strength) ?>
- Ловкость: getFreeStatPoints() ? $userStats->getStat('dexterity', 1) . '(' . strval($userStats->getDexterity() + $getItemsBonuses->getDexterityBonus()) . ')' : $userStats->getDexterity() + $getItemsBonuses->getDexterityBonus()) ?> + Ловкость: getFreeStatPoints() ? $userStats->getStat('dexterity', 1) . '(' . strval($userStats->getFullStats()->dexterity) . ')' : $userStats->getFullStats()->dexterity) ?>
- Интуиция: getFreeStatPoints() ? $userStats->getStat('intuition', 1) . '(' . strval($userStats->getIntuition() + $getItemsBonuses->getIntuitionBonus()) . ')' : $userStats->getIntuition() + $getItemsBonuses->getIntuitionBonus()) ?> + Интуиция: getFreeStatPoints() ? $userStats->getStat('intuition', 1) . '(' . strval($userStats->getFullStats()->intuition) . ')' : $userStats->getFullStats()->intuition) ?>
- Выносливость: getFreeStatPoints() ? $userStats->getStat('endurance', 1) . '(' . strval($userStats->getEndurance() + $getItemsBonuses->getEnduranceBonus()) . ')' : $userStats->getEndurance() + $getItemsBonuses->getEnduranceBonus()) ?> + Выносливость: getFreeStatPoints() ? $userStats->getStat('endurance', 1) . '(' . strval($userStats->getFullStats()->endurance) . ')' : $userStats->getFullStats()->endurance) ?>
- Интеллект: getFreeStatPoints() ? $userStats->getStat('intelligence', 1) . '(' . strval($userStats->getIntelligence() + $getItemsBonuses->getIntelliganceBonus()) . ')' : $userStats->getIntelligence() + $getItemsBonuses->getIntelliganceBonus()) ?> + Интеллект: getFreeStatPoints() ? $userStats->getStat('intelligence', 1) . '(' . strval($userStats->getFullStats()->intelligence) . ')' : $userStats->getFullStats()->intelligence) ?>
- Мудрость: getFreeStatPoints() ? $userStats->getStat('wisdom', 1) . '(' . strval($userStats->getWisdom() + $getItemsBonuses->getWisdomBonus()) . ')' : $userStats->getWisdom() + $getItemsBonuses->getWisdomBonus()) ?> + Мудрость: getFreeStatPoints() ? $userStats->getStat('wisdom', 1) . '(' . strval($userStats->getFullStats()->wisdom) . ')' : $userStats->getFullStats()->wisdom) ?>
getFreeStatPoints()): ?> Возможных @@ -438,7 +438,7 @@ Template::header('Игра');
Рюкзак - (масса: getStrength() * 4 ?>) + (масса: getStrength() * 4 ?>)