Зачем-то инкапсулирем.
This commit is contained in:
@@ -287,15 +287,15 @@ function makedeath()
|
||||
{
|
||||
global $user, $floor, $loses, $x, $y, $dir;
|
||||
$cavedata = Config::$cavedata ?? [];
|
||||
if (!isset($cavedata[$user->room]['x' . $floor])) {
|
||||
if (!isset($cavedata[$user->getRoom()]['x' . $floor])) {
|
||||
$floor = 1;
|
||||
loadmap();
|
||||
}
|
||||
mysql_query("UPDATE `caveparties` SET `floor` = $floor, `x` = '" . $cavedata[$user->room]['x' . $floor] . "', `y` = '" . $cavedata[$user->room]['y' . $floor] . "', `dir` = '" . $cavedata[$user->room]['dir' . $floor] . "', `loses` = (`loses`+1) WHERE `user` = '$user[id]' LIMIT 1");
|
||||
mysql_query("UPDATE `caveparties` SET `floor` = $floor, `x` = '" . $cavedata[$user->getRoom()]['x' . $floor] . "', `y` = '" . $cavedata[$user->getRoom()]['y' . $floor] . "', `dir` = '" . $cavedata[$user->getRoom()]['dir' . $floor] . "', `loses` = (`loses`+1) WHERE `user` = '$user[id]' LIMIT 1");
|
||||
mysql_query('UPDATE `users` SET `hp` = 1 WHERE `id` = "' . $user['id'] . '" LIMIT 1');
|
||||
$x = $cavedata[$user->room]['x' . $floor];
|
||||
$y = $cavedata[$user->room]['y' . $floor];
|
||||
$dir = $cavedata[$user->room]['dir' . $floor];
|
||||
$x = $cavedata[$user->getRoom()]['x' . $floor];
|
||||
$y = $cavedata[$user->getRoom()]['y' . $floor];
|
||||
$dir = $cavedata[$user->getRoom()]['dir' . $floor];
|
||||
updparties();
|
||||
$loses++;
|
||||
}
|
||||
@@ -466,7 +466,7 @@ while ($rec = mysql_fetch_assoc($r)) {
|
||||
$party[] = $rec;
|
||||
}
|
||||
|
||||
if ($user->room == 621) {
|
||||
if ($user->getRoom() == 621) {
|
||||
$base = "/underdesigns/alchcave";
|
||||
}
|
||||
|
||||
@@ -547,8 +547,8 @@ if ($_GET['useitem']) {
|
||||
$ty = $y + 1;
|
||||
}
|
||||
if (@$_GET['useitem']) {
|
||||
if (file_exists("underground/objects/$user->room.php")) {
|
||||
include "underground/objects/$user->room.php";
|
||||
if (file_exists("underground/objects/$user->getRoom().php")) {
|
||||
include "underground/objects/$user->getRoom().php";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -644,7 +644,7 @@ if ($wander && !isset($_GET['attack'])) {
|
||||
$ty = $v['y'] + 2;
|
||||
}
|
||||
|
||||
if ($user->room == 74 || $user->room == 76) {
|
||||
if ($user->getRoom() == 74 || $user->getRoom() == 76) {
|
||||
if (strpos($map[$ty][$tx], 's/') !== false && !@$mapbots[$ty][$tx]) {
|
||||
break;
|
||||
}
|
||||
@@ -712,8 +712,8 @@ if ($moved && (substr($map[$y * 2][$x * 2], 0, 1) === "e" || substr($map[$y * 2]
|
||||
$tx = $x;
|
||||
$ty = $y;
|
||||
$tmp = explode("/", $map[$y * 2][$x * 2]);
|
||||
if (file_exists("underground/events/$user->room.php")) {
|
||||
include("underground/events/$user->room.php");
|
||||
if (file_exists("underground/events/$user->getRoom().php")) {
|
||||
include("underground/events/$user->getRoom().php");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -738,7 +738,7 @@ if ($ambushes[$y * 2][$x * 2 - 2] && $map[$y * 2][$x * 2 - 1] == 0) {
|
||||
|
||||
if ($ax && $ay && $user['hp'] > 0) {
|
||||
$cavedata = Config::$cavedata ?? [];
|
||||
if (!($cavedata[$user->room]['x' . $floor] == $x && $cavedata[$user->room]['y' . $floor] == $y)) {
|
||||
if (!($cavedata[$user->getRoom()]['x' . $floor] == $x && $cavedata[$user->getRoom()]['y' . $floor] == $y)) {
|
||||
if ($ax < $x) {
|
||||
$dir1 = 0;
|
||||
} elseif ($ax > $x) {
|
||||
@@ -902,7 +902,7 @@ if (@$_GET['exit']) {
|
||||
}
|
||||
}
|
||||
mysql_query("DELETE FROM `inventory` WHERE `owner` = '$user[id]' AND `foronetrip` = 1");
|
||||
gotoroom($user->room - 1);
|
||||
gotoroom($user->getRoom() - 1);
|
||||
}
|
||||
|
||||
$standingon = $map[$y * 2][$x * 2];
|
||||
@@ -1470,9 +1470,9 @@ function drawmap($map1, $players, $x, $y, $direction)
|
||||
$ret .= drawobject2($aMap[$yy][$xx], $x, $y);
|
||||
}
|
||||
|
||||
$rrm = $user->room;
|
||||
$rrm = $user->getRoom();
|
||||
|
||||
if (isset($dialogs[CaveBots::$bots[$data[1]]]) && (CaveBots::$bots[$data[1]] == 11147 && $user->room == 74)) {
|
||||
if (isset($dialogs[CaveBots::$bots[$data[1]]]) && (CaveBots::$bots[$data[1]] == 11147 && $user->getRoom() == 74)) {
|
||||
$ret .= "<img title=\"$botname" . ($cnt > 1 ? " ($cnt)" : "") . "\" " . ($y == 1 && $x == 3 ? "onclick=\"speakattackmenu(event);\"" : "") . " width=\"" . $imgdata[$x][$y]["wd"] . "\" height=\"" . $imgdata[$x][$y]["ht"] . "\" src=\"/i/dungeon/mobs/$rrm/$bot.gif\" style=\"position: absolute; left: " . $imgdata[$x][$y]["x"][$bn] . "px; top: " . $imgdata[$x][$y]["y"] . "px;" . ($x == 3 && $y == 1 ? "cursor: pointer;" : "") . ($x == 3 ? "z-index: " . (99 - ($y * 5)) . ";" : "") . "\" />";
|
||||
} else {
|
||||
$ret .= "<img title=\"$botname" . ($cnt > 1 ? " ($cnt)" : "") . "\" " . ($y == 1 && $x == 3 ? " onclick=\"document.location.href='cave.php?attack=1';\"" : "") . " width=\"" . $imgdata[$x][$y]["wd"] . "\" height=\"" . $imgdata[$x][$y]["ht"] . "\" src=\"/i/dungeon/mobs/$rrm/$bot.gif\" style=\"position: absolute; left: " . $imgdata[$x][$y]["x"][$bn] . "px; top: " . $imgdata[$x][$y]["y"] . "px;" . ($x == 3 && $y == 1 ? "cursor: pointer;" : "") . ($x == 3 ? "z-index: " . (99 - ($y * 5)) . ";" : "") . "\" />";
|
||||
@@ -1562,7 +1562,7 @@ function drawmap($map1, $players, $x, $y, $direction)
|
||||
$left = $imgdata[$x][$y]["x"][1];
|
||||
$top = $imgdata[$x][$y]["y"] + $ht;
|
||||
}
|
||||
$rrm = $user->room;
|
||||
$rrm = $user->getRoom();
|
||||
if (!isset($imgmap[$obj])) {
|
||||
|
||||
$ret .= "
|
||||
@@ -1607,7 +1607,7 @@ function drawmap($map1, $players, $x, $y, $direction)
|
||||
$left = $imgdata[$x][$y]["x"][1];
|
||||
$top = $imgdata[$x][$y]["y"] + $ht;
|
||||
}
|
||||
$rrm = $user->room;
|
||||
$rrm = $user->getRoom();
|
||||
if (!isset($imgmap[$obj])) {
|
||||
$ret .= "
|
||||
" . ($y == 1 && $x == 3 ? "<a href=\"cave.php?useitem=1\">" : "") . "
|
||||
@@ -1768,7 +1768,7 @@ function drawmap($map1, $players, $x, $y, $direction)
|
||||
}
|
||||
$objInWall = explode('/', $map[3][$wall]);
|
||||
if ($objInWall[1] == "o") {
|
||||
if ($user->room == 83 && !(!$direction && (($x == 13 && $y == 4) || ($x == 12 && $y == 4)))) { // исключение 2-ух клеток в комнате 82
|
||||
if ($user->getRoom() == 83 && !(!$direction && (($x == 13 && $y == 4) || ($x == 12 && $y == 4)))) { // исключение 2-ух клеток в комнате 82
|
||||
$ret .= drawobject('//' . $objInWall[2], 3, $i);
|
||||
}
|
||||
}
|
||||
@@ -1991,10 +1991,10 @@ progress_update();
|
||||
<td width=540>
|
||||
<div style="text-align:right;padding-right:30px">
|
||||
<font style='font-size:14px; color:#8f0000'><b><?
|
||||
$dMap = unserialize(mysql_result(mysql_query("SELECT `map` FROM `cavemaps` WHERE `floor` = $floor AND `room` = " . ($user->room - 1)), 0, 0));
|
||||
$dMap = unserialize(mysql_result(mysql_query("SELECT `map` FROM `cavemaps` WHERE `floor` = $floor AND `room` = " . ($user->getRoom() - 1)), 0, 0));
|
||||
$cPlace = $dMap[$y * 2][$x * 2];
|
||||
$tmp = explode("/", $cPlace);
|
||||
if ($user->room == 621) {
|
||||
if ($user->getRoom() == 621) {
|
||||
if ($floor == 1) {
|
||||
echo 'Проклятый Рудник, 1 этаж';
|
||||
} elseif ($floor == 2) {
|
||||
|
||||
Reference in New Issue
Block a user