Крупная уборка неиспользуемых файлов. Шаблонизатор заведёт во все файлы. Куча мелких правок.

This commit is contained in:
Igor Barkov (iwork)
2020-10-01 01:12:53 +03:00
parent c181c8eb1e
commit 6305bcef8c
1132 changed files with 988 additions and 9077 deletions

View File

@@ -535,7 +535,7 @@ if (@$_GET['useitem'] || @$_GET['usewallitem']) {
loadmap();
if (@$_GET['useitem']) {
if ($_GET['useitem']) {
if ($dir == 0) {
$tx = $x - 1;
$ty = $y;
@@ -915,21 +915,8 @@ $standingon = $map[$y * 2][$x * 2];
foreach ($party as $k => $v) {
$map[$v['y'] * 2][$v['x'] * 2] = "u/" . $v['user'];
}
Template::header('cave');
?>
<head>
<script LANGUAGE='JavaScript'>
document.ondragstart = test;
//запрет на перетаскивание
document.onselectstart = test;
//запрет на выделение элементов страницы
document.oncontextmenu = test;
//запрет на выведение контекстного меню
function test() {
return false
}
</SCRIPT>
<link rel=stylesheet type="text/css" href="/i/main.css">
<style>
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
@@ -955,7 +942,7 @@ foreach ($party as $k => $v) {
background-color: #484848;
color: #000000;
display: block;
font-family: Verdana, Arial;
font-family: Verdana, Arial, serif;
font-size: 8pt;
font-weight: bold;
padding: 2px 12px 2px 8px;
@@ -1332,36 +1319,7 @@ foreach ($party as $k => $v) {
el2.style.top = posy + 33 + "px";
el2.style.visibility = "visible";
}
var delay = 30, TimerOn = -1, tkHP, maxHP, speed = 300, stLen = 185, redHP = 0.33, yellowHP = 0.66;
function setHP(a, b, c) {
tkHP = a;
maxHP = b;
TimerOn >= 0 && (clearTimeout(TimerOn), TimerOn = -1);
speed = c;
setHPlocal()
}
function setHPlocal() {
tkHP > maxHP && (tkHP = maxHP);
var a = Math.round(tkHP) + "/" + maxHP, a = stLen - (a.length + 2) * 7,
b = Math.round((a - 1) / maxHP * tkHP);
a -= b;
HP = document.getElementById("hp_value");
HP1 = document.getElementById("HP1");
HP2 = document.getElementById("HP2");
if (HP) HP1.width = b, HP2.width = a, HP1.src = tkHP / maxHP < redHP ? "i/1red.gif" : tkHP / maxHP < yellowHP ? "i/1yellow.gif" : "i/1green.gif",
HP.innerHTML = Math.round(tkHP) + "/" + maxHP;
tkHP += maxHP / 60 / 20 * (speed / 100);
TimerOn = tkHP < maxHP ? setTimeout("setHPlocal()", delay * 100) : -1
}
setHP(<?=$user['hp'];?>, <?=$user['maxhp'];?>, 100);
</script>
</head>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor="#d7d7d7"
style=" background-image: url(/i/bagr.gif); width=100%; background-repeat:repeat;background-position:top">
<div id=hint3 class=ahint></div>
<div style="z-index: 100; background-color: #E4F2DF; border-style: solid; border-width: 2px; border-color: #77c3fc; position: absolute; left: 0; top: 0; visibility: hidden; cursor:pointer;"
id="oMenu"></div>
@@ -1372,10 +1330,11 @@ foreach ($party as $k => $v) {
if ($user['hp'] <= 0) {
makedeath();
}
$botNames = CaveBots::$botnames;
$botIds = CaveBots::$bots;
function drawmap($map1, $players, $x, $y, $direction)
{
global $base, $user, CaveBots::$botnames, $imgdata;
global $base, $user, $botNames, $imgdata;
$startx = max($x * 2 - 8, 0);
$starty = max($y * 2 - 8, 0);
@@ -1473,7 +1432,7 @@ function drawmap($map1, $players, $x, $y, $direction)
function drawbot($cell, $x, $y)
{
global CaveBots::$botnames, $imgdata, CaveBots::$bots, $dialogs, $user, $floor;
global $botNames, $imgdata, $botIds, $dialogs, $user, $floor;
$data = explode("/", $cell);
$i = 1;
$bc = (count($data) - 1) / 2;
@@ -1544,7 +1503,7 @@ function drawmap($map1, $players, $x, $y, $direction)
function drawuser($cell, $x, $y)
{
global CaveBots::$botnames, $imgdata, $party;
global $botNames, $imgdata, $party;
$data = explode("/", $cell);
$i = 1;
$bc = (count($data) - 1);