Дополнительный файл конфигов. Разнесение конфигов на игровые и системные.

This commit is contained in:
lopar
2021-03-10 23:03:59 +02:00
parent 32573f3e8e
commit d78b2eda34
34 changed files with 181 additions and 275 deletions

View File

@@ -5,7 +5,7 @@ use Battles\Template;
session_start();
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, $u)
{
global $user;
@@ -204,7 +204,7 @@ function gotoroom($r, $redir = 1)
function redirectbyroom($r)
{
if (in_array($r, Config::$canalenters)) {
if (in_array($r, CANAL_ENTERS)) {
header("location: enter_cave.php");
exit;
}
@@ -286,7 +286,7 @@ function takeusage($x, $y)
function makedeath()
{
global $user, $floor, $loses, $x, $y, $dir;
$cavedata = Config::$cavedata ?? [];
$cavedata = CAVE_DATA ?? [];
if (!isset($cavedata[$user->getRoom()]['x' . $floor])) {
$floor = 1;
loadmap();
@@ -430,11 +430,11 @@ function loadmap()
function getslot($i, $user1 = 0)
{
global $user;
global $user, $userslots;
if (!$user1) {
$user1 = $user;
}
foreach (Config::$userslots as $k => $v) {
foreach ($userslots as $k => $v) {
if ($user1[$v] == $i) {
return $v;
}
@@ -482,7 +482,7 @@ if (@$_GET['kill'] && $user['id'] == $user['caveleader'] && $_GET['kill'] != $us
mysql_query("UPDATE `users` SET `room` = (`room`-1), `caveleader` = 0 WHERE `id` = '$v[user]' LIMIT 1");
$r = mysql_query("SELECT `id`, `dressed` FROM `inventory` WHERE `owner` = '$v[user]' AND `dressed` = 1 AND `foronetrip` = 1");
if (mysql_num_rows($r) > 0) {
$usr = mysql_fetch_array(mysql_query("SELECT " . implode(",", Config::$userslots) . " FROM `users` WHERE `id` = '$v[user]'"));
$usr = mysql_fetch_array(mysql_query("SELECT " . implode(",", $userslots) . " FROM `users` WHERE `id` = '$v[user]'"));
}
while ($rec = mysql_fetch_assoc($r)) {
$slot = getslot($rec['id'], $usr);
@@ -737,7 +737,7 @@ if ($ambushes[$y * 2][$x * 2 - 2] && $map[$y * 2][$x * 2 - 1] == 0) {
}
if ($ax && $ay && $user['hp'] > 0) {
$cavedata = Config::$cavedata ?? [];
$cavedata = CAVE_DATA ?? [];
if (!($cavedata[$user->getRoom()]['x' . $floor] == $x && $cavedata[$user->getRoom()]['y' . $floor] == $y)) {
if ($ax < $x) {
$dir1 = 0;