Зимние правки. MVC/

Signed-off-by: lopar <lopar.4ever@gmail.com>
This commit is contained in:
lopar
2022-08-09 22:57:43 +03:00
parent 0f62ee20e7
commit b9b4c01cf0
104 changed files with 2254 additions and 2086 deletions
+5 -5
View File
@@ -5,18 +5,17 @@ use Battles\GameLogs;
use Battles\ShopItem;
use Battles\Template;
use Battles\User;
use Battles\UserEffect;
require_once 'functions.php';
//require_once 'cave/cave_bots.php';
$userslots = ['sergi', 'kulon', 'perchi', 'weap', 'bron', 'r1', 'r2', 'r3', 'helm', 'shit', 'boots', 'rybax', 'plaw', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8', 'm9', 'm10'];
function cancarry($m, $uid)
function cancarry($m, $uid): bool
{
if (!$uid) {
$uid = User::getInstance()->getId();
}
$weight = \Battles\Database\Db::getInstance()->execute('select sum(weight) from inventory where owner_id = ? and on_sale = 0', $uid)->fetchColumn();
$maxWeight = \Battles\Database\Db::getInstance()->execute('select strength * 4 from users where id = ?', $uid)->fetchColumn();
return $weight + $m > $maxWeight ? false : true;
return !UserEffect::isOverEncumbered($uid, $m);
}
function placeinbackpack($qty, $userid = null)
@@ -339,7 +338,7 @@ while ($rec = mysql_fetch_assoc($r)) {
}
if (User::getInstance()->getRoom() == 621) {
$base = "/underdesigns/alchcave";
$base = "/i/underdesigns/alchcave";
}
$maxloses = 3;
@@ -1194,6 +1193,7 @@ Template::header('cave');
if ($user['hp'] <= 0) {
makedeath();
}
$botNames = CaveBots::$botnames;
$botIds = CaveBots::$bots;
function drawmap($map1, $players, $x, $y, $direction)