From fd7806d2bad8fbb192467508461387fee91b97cc Mon Sep 17 00:00:00 2001 From: "Igor Barkov (iwork)" Date: Mon, 20 Jul 2020 12:33:29 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D0=BE=D0=B5=20=D0=BE=D1=82?= =?UTF-8?q?=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BC?= =?UTF-8?q?=D0=BE=D0=B4=D0=B8=D1=84=D0=B8=D0=BA=D0=B0=D1=82=D0=BE=D1=80?= =?UTF-8?q?=D0=BE=D0=B2.=20=D0=A4=D0=B8=D0=BA=D1=81=D1=8B=20=D0=B8=D0=BD?= =?UTF-8?q?=D1=82=D0=B5=D1=80=D1=84=D0=B5=D0=B9=D1=81=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.php | 71 ++++++++++++++++++++++++-------------------------------- 1 file changed, 30 insertions(+), 41 deletions(-) diff --git a/main.php b/main.php index 0edb55f..7872b1b 100644 --- a/main.php +++ b/main.php @@ -322,7 +322,18 @@ function del_efs($uid, $id, $type) function countmf() { //TODO пересчитать модификаторы - global $user; + //global $user; + + // Защита от урона и сокрушение? + $zo = db::c()->query('SELECT 1 FROM `users_effects` WHERE `type` = 201 AND `owner_id` = ?i', $user['id'])->getNumRows(); + $sokr = db::c()->query('SELECT 1 FROM `users_effects` WHERE `type` = 202 AND `owner_id` = ?i', $user['id'])->getNumRows(); + + $user = new User($_SESSION['uid']); + $userDressedItems = new DressedItems($_SESSION['uid']); + if ($userDressedItems->getBonusesAmount()) { + $allBonuses = $userDressedItems->getBonusesAmount(); + } + function GetWeaponType($idwep) { @@ -346,8 +357,6 @@ function countmf() return $type; } - $zo = db::c()->query('SELECT 1 FROM `users_effects` WHERE `type` = 201 AND `owner_id` = ?i', $user['id'])->getNumRows(); - $sokr = db::c()->query('SELECT 1 FROM `users_effects` WHERE `type` = 202 AND `owner_id` = ?i', $user['id'])->getNumRows(); $bmfud = $bmfbron = 0; @@ -360,7 +369,8 @@ function countmf() $mf = []; - $user_dress = db::c()->query('SELECT SUM(`minu`), SUM(`maxu`), SUM(`mfkrit`), SUM(`mfakrit`), SUM(`mfuvorot`), SUM(`mfauvorot`), SUM(`bron1`), SUM(`bron2`), SUM(`bron3`), SUM(`bron4`) FROM `inventory` WHERE `dressed` = 1 AND `owner` = ?i', $user['id'])->fetch_row(); + //$user_dress = db::c()->query('SELECT SUM(`minu`), SUM(`maxu`), SUM(`mfkrit`), SUM(`mfakrit`), SUM(`mfuvorot`), SUM(`mfauvorot`), SUM(`bron1`), SUM(`bron2`), SUM(`bron3`), SUM(`bron4`) FROM `inventory` WHERE `dressed` = 1 AND `owner` = ?i', $user['id'])->fetch_row(); + $user_dress[6] = $bmfbron; $user_dress[7] = $bmfbron; $user_dress[8] = $bmfbron; @@ -402,7 +412,10 @@ function countmf() break; } - return ['minu' => $mf['me']['udar'] + $bmfud + $weap_b, 'maxu' => $mf['me']['maxudar'] + $bmfud + $weap_b, 'fkrit' => round($mykrit, 0), 'fakrit' => round($myakrit, 0), 'fuvorot' => round($myuvorot, 0), 'fauvorot' => round($myauvorot, 0), 'bron1' => $user_dress[6], 'bron2' => $user_dress[7], 'bron3' => $user_dress[8], 'bron4' => $user_dress[9]]; + $minu = $mf['me']['udar'] + $bmfud + $weap_b; + $maxu = $mf['me']['maxudar'] + $bmfud + $weap_b; + + return ['minu' => $minu, 'maxu' => $maxu, 'fkrit' => round($mykrit, 0), 'fakrit' => round($myakrit, 0), 'fuvorot' => round($myuvorot, 0), 'fauvorot' => round($myauvorot, 0), 'bron1' => $user_dress[6], 'bron2' => $user_dress[7], 'bron3' => $user_dress[8], 'bron4' => $user_dress[9]]; } // одеть предмет @@ -979,36 +992,12 @@ if (input::get('edit')) {
- Сила: strength ?> - stat_points): ?> - - -
- Ловкость: dexterity ?> - stat_points): ?> - - -
- Интуиция: intuition ?> - stat_points): ?> - - -
- Выносливость: endurance ?> - stat_points): ?> - - -
- Интеллект: intelligence ?> - stat_points): ?> - - -
- Мудрость: wisdom ?> - stat_points): ?> - - -
+ Сила: getStrength(1) ?>
+ Ловкость: getDexterity(1) ?>
+ Интуиция: getIntuition(1) ?>
+ Выносливость: getEndurance(1) ?>
+ Интеллект: getIntelligence(1) ?>
+ Мудрость: getWisdom(1) ?>
Возможных увеличений: stat_points ?>

@@ -1017,9 +1006,9 @@ if (input::get('edit')) { $min_dmg = 0; $max_dmg = 0; - $item_mf = db::c()->query('SELECT `id` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 1 AND `add_proc_mf` > 0', $_SESSION['uid'])->fetch_assoc(); - $item_damage = db::c()->query('SELECT `id` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 1 AND `add_proc_uron` > 0', $_SESSION['uid'])->fetch_assoc(); - $item_bron = db::c()->query('SELECT `id` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 1 AND `add_proc_bron` > 0', $_SESSION['uid'])->fetch_assoc(); + $item_mf = db::c()->query('SELECT `id` FROM `inventory` WHERE `owner` = ?i AND `dressed` > 0 AND `add_proc_mf` > 0', $_SESSION['uid'])->fetch_assoc(); + $item_damage = db::c()->query('SELECT `id` FROM `inventory` WHERE `owner` = ?i AND `dressed` > 0 AND `add_proc_uron` > 0', $_SESSION['uid'])->fetch_assoc(); + $item_bron = db::c()->query('SELECT `id` FROM `inventory` WHERE `owner` = ?i AND `dressed` > 0 AND `add_proc_bron` > 0', $_SESSION['uid'])->fetch_assoc(); if (isset($item_mf['id'])) { $max_mf = max_mf(); @@ -1198,9 +1187,9 @@ if (input::get('edit')) {