battles/main.php

605 lines
26 KiB
PHP
Raw Normal View History

2018-01-28 16:40:49 +00:00
<?php
2020-06-23 19:34:52 +00:00
ob_start("ob_gzhandler");
2018-01-28 16:40:49 +00:00
session_start();
2019-02-15 22:31:18 +00:00
$get = filter_input(INPUT_SERVER, 'QUERY_STRING');
if ($get === 'exit') {
2019-02-15 22:33:58 +00:00
session_destroy();
header("Location: fight.php");
}
2020-06-23 08:49:49 +00:00
if (!isset($_SESSION['uid'])) {
header("Location: index.php");
}
2020-06-23 19:34:52 +00:00
2020-06-23 18:19:52 +00:00
require_once 'functions.php';
2020-06-23 19:34:52 +00:00
2020-06-23 13:13:25 +00:00
try {
db::c()->query('UPDATE `online` SET `real_time` = ?i WHERE `user_id` = ?i', time(), $user->id);
2020-06-23 13:13:25 +00:00
} catch (\Krugozor\Database\Mysql\Exception $e) {
echo "<div class='debug' '>Ошибка: " . $e->getMessage() . "<br> Стек: " . $e->getTraceAsString() . "</div>";
2018-03-02 14:33:58 +00:00
}
if ($user->battle) {
2020-07-06 20:17:49 +00:00
header('location: fbattle.php');
exit();
2020-07-06 20:17:49 +00:00
}
2020-07-06 19:54:50 +00:00
//БС
if ($user->in_tower == 1) {
2020-07-06 19:54:50 +00:00
header('Location: towerin.php');
exit();
}
// Инициализируем входящие GET\POST переменные.
$goto = $_GET['goto'] ?? null;
$obraz = $_GET['obraz'] ?? null;
$del = $_GET['del'] ?? null;
$effectId = $_GET['efid'] ?? null;
$brons = $_GET['modif_bron'] ?? null;
$stats = $_GET['modif_stat'] ?? null;
$mfs = $_GET['modif_mf'] ?? null;
$ids = $_GET['ids'] ?? null;
$setShadow = $_POST['setshadow'] ?? null;
$edit = $_GET['edit'] ?? null;
// Подготавливаем отображение инфы и предметов.
$userInfo = new UserInfo($user->id);
$getItemsBonuses = new DressedItems($_SESSION['uid']);
$data_query = 'SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot = 0 AND on_sale = 0';
$data = db::c()->query($data_query, $_SESSION['uid']);
$iteminfo = [];
while ($row = $data->fetch_assoc()) {
$iteminfo[] = new InventoryItem($row);
2020-07-06 19:54:50 +00:00
}
2018-01-28 16:40:49 +00:00
//Обработчики нажатий на кнопки.
2020-09-28 14:44:33 +00:00
if (isset($_POST['battlefield'])) {
header('Location: zayavka.php');
exit();
}
/* === проверяем соответствие комнаты и скрипта === */
if (in_array($user->room, [20, 21, 26, 48, 51, 52, 651, 2655, 2601, 2701, 2702, 2111], 1)) {
header('Location: city.php');
exit();
}
if ($user->room == 22) {
header('Location: shop.php');
exit();
}
if ($user->room == 23) {
header('Location: repair.php');
exit();
}
if ($user->room == 25) {
header('Location: comission.php');
exit();
}
if ($user->room == 27) {
header('Location: post.php');
exit();
}
if ($user->room == 29) {
header('Location: bank.php');
exit();
}
if ($user->room == 31) {
header('Location: tower.php');
exit();
}
if ($user->room == 30) {
header('Location: clan_create.php');
exit();
}
if ($user->room == 34) {
header('Location: fshop.php');
exit();
}
if ($user->room == 45) {
header('Location: clan_castle.php');
exit();
}
if ($user->room == 50) {
header('Location: ashop.php');
exit();
}
if ($user->room == 53) {
header('Location: library.php');
exit();
}
if ($user->room == 61) {
header('Location: akadem.php');
exit();
}
if ($user->room == 650) {
header('Location: ul_clans.php');
exit();
}
//ЦХ
if ($user->room == 600) {
header('Location: c_haos.php');
exit();
}
if ($user->room == 601) {
header('Location: c_haos_in.php');
exit();
}
if ($user->room == 602) {
header('Location: c_park.php');
exit();
}
if ($user->room == 603) {
header('Location: aren_of_angels.php');
exit();
}
if ($user->room == 620) {
header('Location: enter_cave.php');
exit();
}
if ($user->room == 621) {
header('Location: cave.php');
exit();
}
if ($user->room == 660) {
header('Location: hostel.php');
exit();
}
if ($user->room == 661) {
header('Location: hostel_room.php');
exit();
}
if ($user->room == 662) {
header('Location: quest_room.php');
exit();
}
if ($user->room == 760) {
header('Location: c_forest.php');
exit();
}
if ($user->room == 1000) {
header('Location: solib/enterbezdna.php');
exit();
}
if ($user->room == 1001) {
header('Location: solib/dungeon.php');
exit();
}
if ($user->room == 1051) {
header('Location: lab_enter.php');
exit();
}
if ($user->room == 1052) {
header('Location: labirint.php');
exit();
}
if ($user->room == 402) {
header('Location: vxod.php');
exit();
}
if ($user->room == 403) {
header('Location: canalizaciya.php');
exit();
}
if ($user->room == 1055) {
header('Location: group_arena.php');
exit();
}
if ($user->room == 666) {
header('Location: jail.php');
exit();
}
function del_efs($id, $type)
{
if ($id && !in_array($type, [2, 3, 4, 5, 8, 10, 11, 12, 13, 14, 20])) {
db::c()->query('DELETE FROM users_effects WHERE owner_id = ?i AND effect_id = ?i', $_SESSION['uid'], $id);
if ($type == 1022) {
db::c()->query('UPDATE `users` SET `invis` = 0 WHERE `id` = ?i', $_SESSION['uid']);
}
return 'Эффект удалён.';
} else {
return 'Эффект нельзя удалить.';
}
}
// одеть предмет
function dressitem($id)
{
//FIXME Предметы не должны одеваться, если не соответствуют требованиям!
define('HELMET', 1);
define('ARMOR', 2);
define('LEGS', 3);
define('BOOTS', 4);
define('GLOVES', 5);
define('WEAPON', 6);
define('SHIELD', 7);
define('BELT', 8);
define('RING', 9);
define('AMULET', 10);
define('DRESSITEM_ERROR', [
'TOO_MANY_ITEMS_IN_SLOTS' => 'Критическая ошибка: Переполнение слота!',
'UNKNOWN_ITEM_TYPE' => 'Неизвестный тип предмета!',
'ITEM_NOT_FOUND' => 'Предмет не найден!',
]);
$itemInSlot = [];
$selectedItemRow = db::c()->query('SELECT item_type FROM `inventory` WHERE item_id = ?i AND owner_id = ?i AND `dressed_slot` = 0', $id, $_SESSION['uid']);
if ($selectedItemRow->getNumRows()) {
$selectedItem = $selectedItemRow->fetch_object();
$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);
$itemInSlotQuantity = $itemInSlotRow->getNumRows();
if ($itemInSlotQuantity) {
while ($row = $itemInSlotRow->fetch_object()) {
$itemInSlot[] = $row->dressed_slot;
}
}
if (in_array($selectedItem->item_type, [HELMET, ARMOR, LEGS, BOOTS, GLOVES, WEAPON, SHIELD, BELT, AMULET])) {
//работаем с нормальными слотами
if (!$itemInSlotQuantity) {
// просто одеваем предмет
db::c()->query('UPDATE inventory SET dressed_slot = item_type WHERE item_id = ?i', $id);
} elseif ($itemInSlotQuantity === 1) {
// снимаем предмет и одеваем вместо
db::c()->query('UPDATE inventory SET dressed_slot = 0 WHERE dressed_slot = ?i', $itemInSlot[0]);
db::c()->query('UPDATE inventory SET dressed_slot = item_type WHERE item_id = ?i', $id);
} else {
// невозможная ситуация - два предмета в одиночном слоте. критическая ошибка, запись в лог, раздевание.
$error = DRESSITEM_ERROR['TOO_MANY_ITEMS_IN_SLOTS'];
db::c()->query('UPDATE inventory SET dressed_slot = 0 WHERE dressed_slot BETWEEN 1 AND 12 AND owner_id = ?i', $_SESSION['uid']);
}
} elseif ($selectedItem->item_type == RING) {
// работаем с кольцами
if ($itemInSlotQuantity < 3) {
// Сравниваем массив колец и массив слотов для колец.
$emptyRingSlots = array_diff([9, 10, 11], $itemInSlot);
// Сортируем массив свободных слотов по возрастанию.
sort($emptyRingSlots);
// Одеваем предмет в первый свободный слот.
db::c()->query('UPDATE inventory SET dressed_slot = ?i WHERE item_id = ?i', $emptyRingSlots[0], $id);
} elseif ($itemInSlotQuantity === 3) {
db::c()->query('UPDATE inventory SET dressed_slot = 0 WHERE dressed_slot = 11');
db::c()->query('UPDATE inventory SET dressed_slot = 11 WHERE item_id = ?i', $id);
// снимаем предмет из слота 11 и одеваем вместо
} else {
// невозможная ситуация - больше трёх предметов на три слота. критическая ошибка, запись в лог, раздевание.
$error = DRESSITEM_ERROR['TOO_MANY_ITEMS_IN_SLOTS'];
db::c()->query('UPDATE inventory SET dressed_slot = 0 WHERE dressed_slot BETWEEN 1 AND 12 AND owner_id = ?i', $_SESSION['uid']);
}
2020-06-23 08:49:49 +00:00
} else {
//предмет вообще не должен одеваться, ошибка
$error = DRESSITEM_ERROR['UNKNOWN_ITEM_TYPE'];
}
2020-06-23 08:49:49 +00:00
} else {
//с предметом что-то сильно не ок, ошибка.
$error = DRESSITEM_ERROR['ITEM_NOT_FOUND'];
2020-06-23 08:49:49 +00:00
}
if (isset($error)) {
return $error;
2020-06-23 08:49:49 +00:00
} else {
return null;
2020-06-23 08:49:49 +00:00
}
}
2019-09-17 14:37:44 +00:00
// Входим и выходим если можем.
if ($goto) {
2019-09-17 14:37:44 +00:00
$imove = true;
$d = db::c()->query('SELECT SUM(weight) AS sum_weight FROM inventory WHERE owner_id = ?i AND on_sale = 0', $user->id)->fetch_assoc();
$eff = db::c()->query('SELECT 1 FROM `users_effects` WHERE `owner_id` = ?i AND (`type` = 14 OR `type` = 13)', $user->id);
//(масса: <?= $getItemsBonuses->getItemsWeight() . '/' . $user->strength * 4
if ($d['sum_weight'] > $user->strength * 4 && $goto) {
2019-09-17 14:37:44 +00:00
err('У вас переполнен рюкзак, вы не можете передвигаться...');
$imove = false;
}
if ($eff->getNumRows() && $goto) {
2019-09-17 14:37:44 +00:00
err('У вас тяжелая травма, вы не можете передвигатся...');
$imove = false;
}
if ($goto == 'plo' && !$user->zayavka && $imove === true) {
db::c()->query('UPDATE users, online SET users.room = 20, online.room = 20 WHERE online.user_id = users.id AND online.users_id = ?i', $_SESSION['uid']);
2019-09-17 14:37:44 +00:00
header('Location: city.php');
exit("<i>Топ-топ-топ...</i>");
2020-06-23 08:49:49 +00:00
} else {
err('Подали заявку на бой и убегаете из клуба? Нехорошо...');
}
if ($goto == 'arena' && $user->room === 20 && $imove === true) {
db::c()->query('UPDATE users, online SET users.room = 1, online.room = 1 WHERE online.user_id = users.id AND online.user_id = ?i', $_SESSION['uid']);
2019-09-17 14:37:44 +00:00
header('Location: main.php');
exit("<i>Топ-топ-топ...</i>");
2019-09-17 14:37:44 +00:00
}
}
if (isset($_GET['use'])) {
usemagic($_GET['use'], $_POST['target']);
}
2018-03-23 20:36:35 +00:00
function setShadow($image)
{
global $user;
$shadows = [
'm01', 'm02', 'm03', 'm04', 'm05', 'm06', 'm07', 'm08', 'm09', 'm10',
'f01', 'f02', 'f03', 'f04', 'f05', 'f06', 'f07', 'f08', 'f09', 'f10',
2020-07-06 19:54:50 +00:00
'person',
2018-03-23 20:36:35 +00:00
];
if (in_array($image, $shadows)) {
2018-03-23 20:36:35 +00:00
$i = $image . '.png';
db::c()->query('UPDATE `users` SET `shadow` = "?s" WHERE `id` = ?i', $i, $user->id);
2020-06-23 08:49:49 +00:00
} else {
err('Ошибка!');
}
2018-01-28 16:40:49 +00:00
}
if ($obraz && ($user->shadow == 'g0.gif' || $user->shadow == 'man0.gif')) {
2018-03-23 20:36:35 +00:00
setShadow($obraz);
}
2018-01-28 16:40:49 +00:00
if ($del == 1 && $effectId > 0) {
$pl = db::c()->query('SELECT type FROM users_effects WHERE owner_id = ?i AND effect_id = ?i', $user->id, $effectId)->fetch_assoc();
if (isset($pl['type'])) {
echo del_efs($effectId, $pl['type']);
2020-06-23 08:49:49 +00:00
} else {
2020-06-23 09:13:55 +00:00
echo "<span class='error'>Эффект не найден!</span>";
2018-01-28 16:40:49 +00:00
}
}
if ($brons && $ids) {
2020-06-23 13:31:58 +00:00
try {
$cur = db::c()->query('SELECT free_bron, bron1, bron2, bron3, bron4 FROM inventory WHERE owner = ?i AND id = ?i', $user->id, $ids)->fetch_assoc();
2020-07-06 19:54:50 +00:00
} catch (\Krugozor\Database\Mysql\Exception $e) {
2020-06-23 13:31:58 +00:00
echo "<div style='background-color: #ffaaaa;'>Ошибка: " . $e->getMessage() . "<br> В файле: " . $e->getFile() . " (" . $e->getLine() . ")</div>";
}
if ($cur['free_bron'] > 0 && $cur[$brons] > 0) {
db::c()->query('UPDATE inventory SET free_bron = free_bron - 1, ?f = ?f +1 WHERE owner_id = ?i AND item_id = ?i', $brons, $brons, $user->id, $ids);
2020-06-23 09:13:55 +00:00
echo "<span class='success'>Параметр брони увеличен!</span>";
2018-03-02 14:33:58 +00:00
}
2018-01-28 16:40:49 +00:00
}
if ($stats && $ids) {
$cur = db::c()->query('SELECT free_stat, gsila, glovk, ginta, gintel FROM inventory WHERE owner_id = ?i AND item_id = ?i', $user->id, $ids);
if ($cur['free_stat'] > 0 && $cur[$stats] > 0) {
db::c()->query('UPDATE inventory SET free_stat = free_stat - 1, ?f = ?f +1 WHERE owner_id = ?i AND item_id = ?i', $stats, $stats, $user->id, $ids);
2020-06-23 09:13:55 +00:00
echo "<span class='success'>Параметр увеличен!</span>";
2018-01-28 16:40:49 +00:00
}
}
if ($mfs && $ids) {
$cur = db::c()->query('SELECT free_mf, mfkrit, mfuvorot, mfakrit, mfauvorot FROM inventory WHERE owner_id = ?i AND item_id = ?i', $user->id, $ids);
2020-06-23 08:49:49 +00:00
if (isset($cur['id']) && $cur['free_mf'] > 0 && $cur[$mfs] > 0) {
db::c()->query('UPDATE inventory SET free_mf = free_mf - 1, ?f = ?f +1 WHERE owner_id = ?i AND item_id = ?i', $mfs, $mfs, $user->id, $ids);
2020-06-23 09:13:55 +00:00
echo "<span class='success'>Параметр увеличен!</span>";
2018-01-28 16:40:49 +00:00
}
}
if ($setShadow) {
2018-03-02 14:33:58 +00:00
?>
2020-06-23 08:49:49 +00:00
<!doctype html>
2019-09-17 14:37:44 +00:00
<html lang="ru">
<head>
2018-03-02 15:31:43 +00:00
<link rel=stylesheet href="css/main.css">
<link rel=stylesheet href="css/btn.css">
2018-03-02 15:31:43 +00:00
<meta charset="utf-8">
2019-09-17 14:37:44 +00:00
<title></title>
</head>
2018-03-02 15:31:43 +00:00
<body>
2020-07-21 09:20:44 +00:00
<div style="text-align: right;">
<input type=button value="Вернуться" onClick="location.href='main.php?edit=<?= mt_rand() ?>';" class="button">
2020-07-21 09:20:44 +00:00
</div>
<table style="padding:5px; margin:auto;">
2020-07-21 09:20:44 +00:00
<caption><b style="color: red;">Внимание! Образ персонажа выбирается только один раз.</b></caption>
<tr>
2020-07-21 09:20:44 +00:00
<td><a href="?edit=1&obraz=m1"><img alt="m01" src="i/shadow/m1.gif"></a>
<td><a href="?edit=1&obraz=m2"><img alt="m02" src="i/shadow/m2.gif"></a>
<td><a href="?edit=1&obraz=m3"><img alt="m03" src="i/shadow/m3.gif"></a>
<td><a href="?edit=1&obraz=m4"><img alt="m04" src="i/shadow/m4.gif"></a>
<td><a href="?edit=1&obraz=m5"><img alt="m05" src="i/shadow/m5.gif"></a>
<td><a href="?edit=1&obraz=m6"><img alt="m06" src="i/shadow/m6.gif"></a>
<td><a href="?edit=1&obraz=m7"><img alt="m07" src="i/shadow/m7.gif"></a>
<td><a href="?edit=1&obraz=m8"><img alt="m08" src="i/shadow/m8.gif"></a>
<td><a href="?edit=1&obraz=m9"><img alt="m09" src="i/shadow/m9.gif"></a>
<td><a href="?edit=1&obraz=m10"><img alt="m10" src="i/shadow/m10.gif"></a>
<tr>
2020-07-21 09:20:44 +00:00
<td><a href="?edit=1&obraz=f1"><img alt="f01" src="i/shadow/f1.gif"></a>
<td><a href="?edit=1&obraz=f2"><img alt="f02" src="i/shadow/f2.gif"></a>
<td><a href="?edit=1&obraz=f3"><img alt="f03" src="i/shadow/f3.gif"></a>
<td><a href="?edit=1&obraz=f4"><img alt="f04" src="i/shadow/f4.gif"></a>
<td><a href="?edit=1&obraz=f5"><img alt="f05" src="i/shadow/f5.gif"></a>
<td><a href="?edit=1&obraz=f6"><img alt="f06" src="i/shadow/f6.gif"></a>
<td><a href="?edit=1&obraz=f7"><img alt="f07" src="i/shadow/f7.gif"></a>
<td><a href="?edit=1&obraz=f8"><img alt="f08" src="i/shadow/f8.gif"></a>
<td><a href="?edit=1&obraz=f9"><img alt="f09" src="i/shadow/f9.gif"></a>
<td><a href="?edit=1&obraz=f10"><img alt="f10" src="i/shadow/f10.gif"></a>
2018-03-02 14:33:58 +00:00
</table>
</body>
</html>
<?php
exit();
2018-03-02 14:33:58 +00:00
}
if ($edit) {
$ups = $_GET['ups'] ?? null;
$upm = $_GET['upm'] ?? null;
$use = $_GET['use'] ?? null;
$useTarget = $_POST['target'] ?? null;
$drop = $_GET['drop'] ?? null;
$dress = $_GET['dress'] ?? null;
$undress = $_GET['undress'] ?? null;
$destruct = $_GET['destruct'] ?? null;
2018-01-28 16:40:49 +00:00
if ($ups) {
$user->addOnePointToStat($ups);
2020-06-23 08:49:49 +00:00
}
if ($upm) {
addOnePoint($upm, 'mastery');
2020-06-23 08:49:49 +00:00
}
if ($drop) {
$items = new DressedItems($_SESSION['uid']);
$items->undressItem($drop);
2018-03-02 14:33:58 +00:00
}
//Пока что одеваем предмет отсюда.
if ($dress) {
echo dressitem($dress);
2018-03-02 14:33:58 +00:00
}
if ($destruct) {
$q = db::c()->query('SELECT `id`, `dressed`, `name`, `duration`, `maxdur` FROM `inventory` WHERE `owner` = ?i AND `id` = ?i', $_SESSION['uid'], $destruct);
if ($q->getNumRows()) {
$q = $q->fetch_assoc();
if (empty($q['dressed'])) {
destructitem($q['id']);
addToDelo($user->login . " выбросил предмет " . $q['name'] . " id:(cap" . $q['id'] . ")");
err('Предмет ' . $q['name'] . ' выброшен.');
2020-06-23 08:49:49 +00:00
} else {
err('Ошибка: нельзя выбросить одетый предмет!');
}
} else {
err('Ошибка: предмет не найден!');
}
2018-03-02 14:33:58 +00:00
}
if ($use) {
usemagic($use, $useTarget);
2018-03-02 14:33:58 +00:00
}
if ($undress) {
undressall($_SESSION['uid']);
2018-03-02 14:33:58 +00:00
}
}
?>
2018-03-02 14:33:58 +00:00
<!doctype html>
<HTML lang="ru">
<HEAD>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/tooltip.css">
<link rel="stylesheet" href="css/btn.css">
<script src="js/tooltip.js"></script>
<script src="js/funcs.js"></script>
<script>
$(function () {
$(".tooltip").tipTip({maxWidth: "auto", edgeOffset: 0, fadeIn: 300, fadeOut: 500});
});
2018-03-02 14:33:58 +00:00
let Hint3Name = '';
2020-07-06 19:54:50 +00:00
function okno(title, script, name, errk) {
let errkom = '';
let com = '';
if (errk === 1) {
errkom = 'Нельзя использовать символы: /\:*?"<>|+%<br>';
}
document.getElementById("hint3").innerHTML = '<table width=100% cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>' + title + '</td><td width=20 align=right valign=top style="cursor: pointer" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>' +
'<form action="' + script + '" method=POST><table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><INPUT TYPE=hidden name=sd4 value="6"><td colspan=2><span class="error">' +
errkom + '</span>введите название предмета</TD></TR><TR><TD width=50% align=right><INPUT TYPE=text NAME="' + name + '" value="' + com + '"></TD><TD width=50%><INPUT TYPE="submit" value=" »» "></TD></TR></TABLE></FORM></td></tr></table>';
document.getElementById("hint3").style.visibility = "visible";
document.getElementById("hint3").style.left = '100';
document.getElementById("hint3").style.top = '100';
document.getElementById(name).focus();
Hint3Name = name;
}
</script>
<title>Окно игры</title>
</HEAD>
<body>
<div id=hint3 class=ahint></div>
<div id="hint4" style="position: absolute;"></div>
<div id="chpassbank" style="display:none; position:absolute; top:50px; left:250px;"></div>
<table width=100%>
<TR>
<td style="vertical-align: top; width: 350px">
2020-08-30 10:47:22 +00:00
<?php $userInfo->showUserDoll(0, 1); ?> <!-- Первый столбец -->
2018-12-11 16:23:21 +00:00
<div align="center">
2020-08-30 01:09:52 +00:00
<a href='main.php?edit=1&undress=all' class="button">Снять все</a><BR>
2018-12-11 17:40:12 +00:00
<div class="effectList" style="padding-top: 15px; max-height: 150px; width: 220px;">
<?= show_eff_inf($user->id, 2) ?>
2018-12-11 17:40:12 +00:00
</div>
</div>
<br>
2018-03-02 14:33:58 +00:00
</td>
<td style="vertical-align: top; width: 250px"> <!-- Второй столбец -->
2018-12-11 17:40:12 +00:00
<div>
<br>Уровень: <strong><?= $user->level ?></strong>
<br>Опыт: <strong><?= $user->experience ?></strong>
<br>Побед: <strong>??</strong>
<br>Поражений: <strong>??</strong>
<br>Ничьих: <strong>??</strong>
<br>Деньги: <strong><?= $user->money ?></strong> кр.
2018-12-11 17:40:12 +00:00
<HR>
</div>
2018-03-02 14:33:58 +00:00
<!--Параметры-->
2018-12-11 17:40:12 +00:00
<div>
<div class="container">
Сила: <?= ($user->free_stat_points ? $user->getStat('strength', 1) . '(' . strval($user->strength + $getItemsBonuses->getStrengthBonus()) . ')' : $user->strength + $getItemsBonuses->getStrengthBonus()) ?>
2020-07-22 14:08:40 +00:00
<br>
Ловкость: <?= ($user->free_stat_points ? $user->getStat('dexterity', 1) . '(' . strval($user->dexterity + $getItemsBonuses->getDexterityBonus()) . ')' : $user->dexterity + $getItemsBonuses->getDexterityBonus()) ?>
<br>
Интуиция: <?= ($user->free_stat_points ? $user->getStat('intuition', 1) . '(' . strval($user->intuition + $getItemsBonuses->getIntuitionBonus()) . ')' : $user->intuition + $getItemsBonuses->getIntuitionBonus()) ?>
<br>
Выносливость: <?= ($user->free_stat_points ? $user->getStat('endurance', 1) . '(' . strval($user->endurance + $getItemsBonuses->getEnduranceBonus()) . ')' : $user->endurance + $getItemsBonuses->getEnduranceBonus()) ?>
2020-07-22 14:18:25 +00:00
<br>
Интеллект: <?= ($user->free_stat_points ? $user->getStat('intelligence', 1) . '(' . strval($user->intelligence + $getItemsBonuses->getIntelliganceBonus()) . ')' : $user->intelligence + $getItemsBonuses->getIntelliganceBonus()) ?>
2020-07-22 14:18:25 +00:00
<br>
Мудрость: <?= ($user->free_stat_points ? $user->getStat('wisdom', 1) . '(' . strval($user->wisdom + $getItemsBonuses->getWisdomBonus()) . ')' : $user->wisdom + $getItemsBonuses->getWisdomBonus()) ?>
<br>
<?php if ($user->free_stat_points): ?>
2020-07-22 14:08:40 +00:00
<small style="color: darkgreen;">Возможных
увеличений: <?= $user->free_stat_points ?></small><br>
2020-07-22 14:08:40 +00:00
<?php endif; ?>
<br>
Здоровье: <?= $user->getHealth() ?><br>
Пыль: <?= $user->getMana() ?><br>
Уворот: <?= $getItemsBonuses->getEvasionBonus() ?><br>
Точность: <?= $getItemsBonuses->getAccuracyBonus() ?><br>
Шанс крита: <?= $getItemsBonuses->getCriticalsBonus() ?><br>
Урон: <?= $user->minDamage + $getItemsBonuses->getMinPhysDamage() ?>
- <?= $user->maxDamage + $getItemsBonuses->getMaxPhysDamage() ?> <br>
<br>
Защита от огня: ?? <br>
Защита от воды: ?? <br>
Защита от вохдуха: ?? <br>
Защита от земли: ?? <br>
Защита от яда: ?? <br>
Броня головы: <?= $user->headArmor ?> <br>
Броня корпуса: <?= $user->chestArmor ?> <br>
Броня ног: <?= $user->legArmor ?> <br>
</div>
2018-12-11 17:40:12 +00:00
</div>
</td>
<td valign=top>
<div class="button-container"> <!--Меню-кнопки-->
<FORM METHOD=POST ACTION="?edit=1" name=f1>
<?php if ($user->shadow == '0.gif' || $user->admin == 1): ?>
2020-07-22 14:08:40 +00:00
<INPUT class="button primary icon user" TYPE="submit" name="setshadow" value="Образы"
title="Образы">
<?php endif; ?>
<div class="button-group">
2020-09-28 14:44:33 +00:00
<input class="button primary" type="submit" name="battlefield" value="Поединки">
<button class="button" onclick="window.location.href='module_quest.php';">Активные задания
</button>
<?php if ($user->room === 20): ?>
2020-09-28 14:44:33 +00:00
<button class="button icon move" onclick="parent.frames[´main´].location.href='main.php?goto=arena';">Войти
внутрь
</button>
<?php else: ?>
<button class="button icon move" onclick="window.location.href='main.php?goto=plo';">Выйти
на улицу
</button>
<?php endif; ?>
<button class="button icon loop" onclick="window.location.href='main.php';">Обновить страницу
</button>
</div>
</div>
<div> <!--рюкзак-->
2018-03-02 14:33:58 +00:00
<table BORDER=0 WIDTH=100% CELLSPACING="1" CELLPADDING="2" BGCOLOR="#A5A5A5">
<caption>Рюкзак
(масса: <?= '?? /' . $user->strength * 4 ?>)
</caption>
<?php
foreach ($iteminfo as $ii) {
echo "<tr><td width='100' align='center' bgcolor='#d3d3d3'>";
$ii->printImage();
$ii->printControls();
echo "<td valign='top' bgcolor='#d3d3d3'>";
$ii->printInfo();
}
2020-06-23 08:49:49 +00:00
if ($data->getNumRows() == 0) {
2020-07-21 09:20:44 +00:00
echo "<tr><th colspan='3' align=center bgcolor=#C7C7C7>Пусто";
2020-06-23 08:49:49 +00:00
}
2018-03-02 14:33:58 +00:00
?>
</table>
2020-07-06 19:54:50 +00:00
</div>
</td>
2018-03-02 14:33:58 +00:00
</tr>
2018-01-28 16:40:49 +00:00
</table>
</body>
</html>