game/logs.php

911 lines
37 KiB
PHP
Raw Normal View History

2022-06-06 21:30:34 +00:00
<?php
const GAME = true;
2022-06-06 21:30:34 +00:00
include('_incl_data/__config.php');
include('_incl_data/class/__db_connect.php');
2022-12-19 18:26:14 +00:00
$u = User::start();
$btl = mysql_fetch_array(
mysql_query('SELECT * FROM `battle` WHERE `id` = "' . mysql_real_escape_string((int)$_GET['log']) . '" LIMIT 1')
);
if (isset($btl['id'])) {
$allprice = mysql_fetch_array(
mysql_query(
'SELECT SUM(`price1`) FROM `battle_users` WHERE `battle` = "' . $btl['id'] . '" GROUP BY `uid` LIMIT 1'
)
);
$allprice = 0 + $allprice[0];
2023-07-27 22:25:38 +00:00
function typeBattle($x): array
2022-12-19 18:26:14 +00:00
{
2023-01-10 16:29:32 +00:00
$r = [0, 0, 'Обычный поединок', 'Кровавый Поединок'];
2023-07-27 22:25:38 +00:00
if ($x >= 50000 && $x < 100000) {
2023-01-10 16:29:32 +00:00
$r = [25, 50, 'Великая Битва', 'Кровавая Битва'];
2022-12-19 18:26:14 +00:00
} elseif ($x < 500000) {
2023-01-10 16:29:32 +00:00
$r = [50, 75, 'Величайшая Битва', 'Кровавая Резня'];
2022-12-19 18:26:14 +00:00
} elseif ($x < 1000000) {
2023-01-10 16:29:32 +00:00
$r = [75, 100, 'Историческая Битва', 'Кровавая Сеча'];
2022-12-19 18:26:14 +00:00
} elseif ($x < 2500000) {
2023-01-10 16:29:32 +00:00
$r = [100, 125, 'Эпохальная Битва', 'Кровавое Побоище'];
2022-12-19 18:26:14 +00:00
} elseif ($x >= 5000000) {
2023-01-10 16:29:32 +00:00
$r = [150, 150, 'Судный День', 'Судный День'];
2022-12-19 18:26:14 +00:00
}
return $r;
}
$allprice = typeBattle($allprice);
if ($btl['smert'] == 1) {
2023-01-10 16:29:32 +00:00
$allprice = [150, 150, 'Жесточайшее Сражение', 'Жесточайшее Сражение'];
2022-12-19 18:26:14 +00:00
}
if ($btl['type'] == 99) {
2023-07-27 22:25:38 +00:00
$allprice = '<span style="color: red;">' . str_replace(' ', '&nbsp;', $allprice[3]) . '</span>';
2022-12-19 18:26:14 +00:00
} else {
$allprice = str_replace(' ', '&nbsp;', $allprice[2]);
}
2022-06-06 21:30:34 +00:00
}
2023-01-10 16:29:32 +00:00
$fil = '<span style="margin-left: 25px;">Поиск : <form id="line_filter" style="display: inline;" onsubmit="return false;"> <input type="text" id="line_filter_input" autocomplete="off" style="padding:5px;" /> <input type="submit" id="line_filter_input_submit" class="btn" value="Фильтр" onclick="return false" /> <input type="button" id="line_filter_glow" class="btn" value="Подсветка" /></form></span>';
2022-12-19 18:26:14 +00:00
$r = '';
$p = '';
$b = '<table width="100%" cellpadding="0" cellspacing="0" border="0">
2022-06-06 21:30:34 +00:00
<tbody>
<tr valign="top">
<td valign="bottom" title="">
2023-01-10 16:29:32 +00:00
<input onClick="location=location;" type="submit" name="analiz2" class="btn" value="Обновить">'; //nowrap=""
2022-06-06 21:30:34 +00:00
2022-12-19 18:26:14 +00:00
if ($btl['team_win'] != -1) {
if (!isset($_GET['analiz'])) {
2023-01-10 16:29:32 +00:00
$b .= ' <input onClick="location=\'logs.php?log=' . ((int)$_GET['log']) . '&analiz=1\';" type="submit" name="analiz3" class="btn btn-success" value="Статистика">';
2022-12-19 18:26:14 +00:00
$b .= $fil;
} else {
2023-01-10 16:29:32 +00:00
$b .= ' <input onClick="location=\'logs.php?log=' . ((int)$_GET['log']) . '\';" type="submit" name="analiz3" class="btn btn-danger" value="Лог боя">';
2022-12-19 18:26:14 +00:00
}
2022-06-06 21:30:34 +00:00
}
$b .= '</td>
</tr>
</tbody>
</table>';
2022-12-19 18:26:14 +00:00
if (isset($btl['id']) && $btl['team_win'] != -1 && isset($_GET['analiz'])) {
2023-07-27 22:25:38 +00:00
function rzv($v): string
2022-12-19 18:26:14 +00:00
{
$v = explode('.', $v);
if (!isset($v[1])) {
$v = $v[0] . '.0';
} else {
$v = $v[0] . '.' . $v[1];
}
return $v;
}
$tmStart = floor(($btl['time_over'] - $btl['time_start']) / 6) / 10;
$tmStart = rzv($tmStart);
$tbtl = '<img src="//img.new-combats.tech/i/fighttype' . $btl['type'] . '.gif">';
2022-12-19 18:26:14 +00:00
if ($btl['invis'] > 0) {
$tbtl .= '<img src="//img.new-combats.tech/i/fighttypehidden0.gif">';
2022-12-19 18:26:14 +00:00
}
2023-07-27 22:25:38 +00:00
if ($btl['type'] == 1) {
2023-01-10 16:29:32 +00:00
$tbtl = 'Тип боя: ' . $tbtl . ' (кулачный поединок) &nbsp; &nbsp; ';
2022-12-19 18:26:14 +00:00
} else {
2023-01-10 16:29:32 +00:00
$tbtl = 'Тип боя: ' . $tbtl . ' (физический поединок) &nbsp; &nbsp; ';
2022-12-19 18:26:14 +00:00
}
if ($btl['izlom'] > 0) {
2023-01-10 16:29:32 +00:00
$tbtl .= 'Волна: ' . $btl['izlomRoundSee'] . ' &nbsp; &nbsp; ';
2022-12-19 18:26:14 +00:00
}
2023-01-10 16:29:32 +00:00
$tbtl .= 'Продолжительность боя: ' . $tmStart . ' мин.<br>';
2022-12-19 18:26:14 +00:00
2023-07-27 22:25:38 +00:00
$users = [];
$uids = [];
2022-12-19 18:26:14 +00:00
2023-07-27 22:25:38 +00:00
function con_login($us): string
2022-12-19 18:26:14 +00:00
{
$r = '';
if ($us['align'] > 0) {
$r .= '<img src="//img.new-combats.tech/i/align/align' . $us['align'] . '.gif" width="12" height="15">';
2022-12-19 18:26:14 +00:00
}
if ($us['clan'] > 0) {
$r .= '<a href="clans_info/' . $us['clan'] . '" target="_blank"><img src="//img.new-combats.tech/i/clan/' . $us['clan'] . '.gif" width="24" height="15"></a>';
2022-12-19 18:26:14 +00:00
}
$r .= '<b class="CSSteam' . $us['team'] . '">' . $us['login'] . ' [' . $us['level'] . ']</b>';
$r .= '<a href="info/' . $us['uid'] . '" target="_blank"><img src="//img.new-combats.tech/i/inf_capitalcity.gif" width="12" height="11"></a>';
2022-12-19 18:26:14 +00:00
return $r;
}
2023-01-10 16:29:32 +00:00
//Поулчаем инфо
2022-12-19 18:26:14 +00:00
$tpas = [
1 => 'X',
2023-07-27 22:25:38 +00:00
2 => '<span style="color: #AAAAEE; ">&bull;</span>',
2022-12-19 18:26:14 +00:00
3 => '<b>&bull;</b>',
2023-07-27 22:25:38 +00:00
4 => '<span style="color: #FF0000; ">&curren;</span>',
5 => '<span style="color: #FF0000; ">X</span>',
6 => '<span style="color: #AAAAEE; ">&bull;</span>',
7 => '<span style="color:#777777; "><B>&bull;</B></span>',
8 => '<span style="color: #AAAAEE; ">&bull;</span>',
2022-12-19 18:26:14 +00:00
];
$tpbs = [
0 => '',
1 => '<B>&bull;</B>',
2023-07-27 22:25:38 +00:00
2 => '<span style="color: #AAAAAA; "><B>&bull;</B></span>',
2022-12-19 18:26:14 +00:00
3 => 'X',
2023-07-27 22:25:38 +00:00
4 => '<span style="color: #FFEEEE; "><B>X</B></span>',
5 => '<span style="color: #FFEEEE; "><B>&bull;</B></span>',
6 => '<span style="color: #AAAAEE; "><B>&bull;</B></span>',
7 => '<span style="color: #777777; "><B>&bull;</B></span>',
8 => '<span style="color: #AAAAAA; "><B>&bull;</B></span>',
2022-12-19 18:26:14 +00:00
];
$sp = mysql_query('SELECT * FROM `battle_users` WHERE `battle` = "' . $btl['id'] . '"');
while ($pl = mysql_fetch_array($sp)) {
if (!isset($uids[$pl['id']])) {
$i = count($users);
$users[$i] = $pl;
$uids[$pl['uid']] = $i;
//
$users[$i]['value'] = [
2023-01-10 16:29:32 +00:00
'y' => 0, //уворотов+парирований+блоков щитом
'b' => 0, //успешных блоков
'p' => 0, //не успешных блоков, по персонажу попали
'zb' => [ //Список зон блока
2022-12-19 18:26:14 +00:00
],
2023-01-10 16:29:32 +00:00
'sa' => [ //Статистика ударов
2022-12-19 18:26:14 +00:00
0 => '',
1 => '',
2 => '',
3 => '',
4 => '',
5 => '',
],
2023-01-10 16:29:32 +00:00
'sb' => [ //Статистика блоков
2022-12-19 18:26:14 +00:00
0 => '',
1 => '',
2 => '',
3 => '',
4 => '',
5 => '',
],
];
$sp2 = mysql_query(
'SELECT * FROM `battle_stat` WHERE `battle` = "' . $btl['id'] . '" AND `uid1` = "' . $pl['uid'] . '" ORDER BY `id` ASC'
);
while ($pl2 = mysql_fetch_array($sp2)) {
2023-01-10 16:29:32 +00:00
//Обновляем данные
2022-12-19 18:26:14 +00:00
$users[$i]['yrn'] += $pl2['yrn'];
$users[$i]['yrn_krit'] += $pl2['yrn_krit'];
2023-01-10 16:29:32 +00:00
//Статистика далее
2022-12-19 18:26:14 +00:00
$users[$i]['gaa']++;
if ($users[$i]['yrn'] > 0) {
$users[$i]['ga']++;
}
if ($users[$i]['yrn_krit'] > 0) {
$users[$i]['gak']++;
}
2023-01-10 16:29:32 +00:00
//Получаем куда бил игрок
2022-12-19 18:26:14 +00:00
$j = 0;
while ($j < $pl2['ma']) {
$users[$i]['zona'][$pl2['a'][$j]]++;
//
$za = $pl2['a'][$j];
$k = 1;
while ($k <= 5) {
if ($za == $k) {
$tpa = $pl2['type_a'][$j];
$zag[$k] = true;
$users[$i]['value']['sa'][$k] .= $tpas[$tpa];
} else {
$zag[$k] = false;
}
$k++;
}
//
$j++;
}
$j = $pl2['b'];
$k = 0;
while ($k < $pl2['mb']) {
if ($j > 5) {
$j = 1;
}
$users[$i]['value']['zb'][] = [0 => $j, 1 => 0];
$users[$i]['zonb'][$j]++;
$j++;
$k++;
}
//
$k = 1;
while ($k <= 5) {
2023-07-27 22:25:38 +00:00
if (!$zag[$k]) {
2022-12-19 18:26:14 +00:00
$users[$i]['value']['sa'][$k] .= ' ';
}
$k++;
}
//
}
//
$sp2 = mysql_query(
'SELECT * FROM `battle_stat` WHERE `battle` = "' . $btl['id'] . '" AND `uid2` = "' . $pl['uid'] . '" ORDER BY `id` ASC'
);
$k = 0;
while ($pl2 = mysql_fetch_array($sp2)) {
2023-01-10 16:29:32 +00:00
//Обновляем данные
2022-12-19 18:26:14 +00:00
$users[$i]['_yrn'] -= $pl2['yrn'];
$users[$i]['_yrn_krit'] -= $pl2['yrn_krit'];
2023-01-10 16:29:32 +00:00
//Получаем куда били игрока
2022-12-19 18:26:14 +00:00
$j = 0;
$zag = [];
while ($j < $pl2['ma']) {
$users[$i]['value']['zb'][$k][1] = $pl2['type_a'][$j];
if ($pl2['type_a'][$j] == 2 || $pl2['type_a'][$j] == 6 || $pl2['type_a'][$j] == 7 || $pl2['type_a'][$j] == 8) {
$users[$i]['value']['y']++;
} elseif ($pl2['type_a'][$j] == 3) {
$users[$i]['value']['b']++;
} else {
$users[$i]['value']['p']++;
}
//
$j++;
}
//
$k++;
//
}
2023-01-10 16:29:32 +00:00
//Статистика блоков
2022-12-19 18:26:14 +00:00
$k = 0;
$h = 0;
$bjj = [];
while ($k < count($users[$i]['value']['zb'])) {
$zb = 0 + $users[$i]['value']['zb'][$k][0];
$zt = 0 + $users[$i]['value']['zb'][$k][1];
$bjj[$zb] = true;
$users[$i]['value']['sb'][$zb] .= '' . $tpbs[$zt] . '';
if ($h < 1) {
$h++;
} else {
$d = 1;
while ($d <= 5) {
2023-07-27 22:25:38 +00:00
if (!$bjj[$d]) {
2022-12-19 18:26:14 +00:00
$users[$i]['value']['sb'][$d] .= ' ';
}
$d++;
}
$bjj = [];
$h = 0;
}
$k++;
}
//
}
}
$usr = '';
$tm = [];
$tm_u = [];
$tm_v = [];
$i = 0;
while ($i < count($users)) {
if ($users[$i] > 0) {
$us = $users[$i];
if (!isset($tm[$us['team']])) {
$tm[$us['team']] = '';
$tm_v[] = $us['team'];
}
$tm_u[$us['team']][] = $i;
$tm[$us['team']] .= con_login($us);
$tm[$us['team']] .= ', ';
unset($us);
}
$i++;
}
$i = 0;
while ($i < count($tm_v)) {
$usr .= rtrim($tm[$tm_v[$i]], ', ');
if ($i < count($tm_v) - 1) {
2023-01-10 16:29:32 +00:00
$usr .= ' &nbsp; <b>против</b> &nbsp; ';
2022-12-19 18:26:14 +00:00
}
$i++;
}
//
2023-01-10 16:29:32 +00:00
$usr = '<H4>Участники поединка</H4>' . $usr . '<br><br>';
2022-12-19 18:26:14 +00:00
//
$r = '';
//
2023-01-10 16:29:32 +00:00
$r .= '<H4>Последовательность ударов</H4>';
2022-12-19 18:26:14 +00:00
$r .= '<TABLE border=1 cellspacing=0 cellpadding=4>
2023-01-10 16:29:32 +00:00
<TR><TD align=center>Логин</TD><TD>Удар в</TD><TD>Последовательность ударов</TD></TR>';
2022-12-19 18:26:14 +00:00
$i = 0;
while ($i <= count($tm_v)) {
$j = 0;
$team_data = ['g' => false];
while ($j < count($tm_u[$tm_v[$i]])) {
$us = $users[$tm_u[$tm_v[$i]][$j]];
if ($us['id'] > 0) {
$rh = '';
$rh .= '' . $us['value']['sa'][1] . '';
$rh .= '<br>' . $us['value']['sa'][2] . '';
$rh .= '<br>' . $us['value']['sa'][3] . '';
$rh .= '<br>' . $us['value']['sa'][4] . '';
$rh .= '<br>' . $us['value']['sa'][5] . '';
$r .= '<TR><TD align=center nowrap>' . con_login(
$us
2023-01-10 16:29:32 +00:00
) . '</TD><TD nowrap align="right"><pre>голову<br>грудь<br>живот<br>пояс<br>ноги</pre></TD><TD style="font-size:16px" nowrap><pre>' . $rh . '</pre></TD></TR>';
2022-12-19 18:26:14 +00:00
}
unset($us);
$j++;
}
$i++;
}
$r .= '</TABLE>';
2023-01-10 16:29:32 +00:00
$r .= '(<b>X</b>&nbsp;-&nbsp;удачный&nbsp;удар, <font color=red><B>&curren;</b></font> - критический удар пробив блок , <font color=red><B>X</B></font>&nbsp;-&nbsp;критический&nbsp;удар, <font color=red><B><code>&Xi;</code></B></font>&nbsp;-&nbsp;крит + инвалидность, <font color=006600><B>X</B></font>&nbsp;-&nbsp;доп.&nbsp;магический&nbsp;удар,<BR>
&nbsp;<B>&bull;</B>&nbsp;-&nbsp;противник&nbsp;блокировал&nbsp;удар, <font color=AAAAAA><B>&bull;</B></font>&nbsp;-&nbsp;увернулся, <font color=AAAAEE><B>&bull;</B></font>&nbsp;-&nbsp;парировал, <font color=777777><B>&bull;</B></font>&nbsp;-&nbsp;отбил удар щитом)';
2022-12-19 18:26:14 +00:00
//
2023-01-10 16:29:32 +00:00
$r .= '<H4>Последовательность блоков</H4>';
2022-12-19 18:26:14 +00:00
$r .= '<TABLE border=1 cellspacing=0 cellpadding=4>
2023-01-10 16:29:32 +00:00
<TR><TD align=center>Логин</TD><TD>Блок</TD><TD>Последовательность блоков</TD></TR>';
2022-12-19 18:26:14 +00:00
$i = 0;
while ($i <= count($tm_v)) {
$j = 0;
$team_data = ['g' => false];
while ($j < count($tm_u[$tm_v[$i]])) {
$us = $users[$tm_u[$tm_v[$i]][$j]];
if ($us['id'] > 0) {
$rh = '';
$rh .= '' . $us['value']['sb'][1] . '';
$rh .= '<br>' . $us['value']['sb'][2] . '';
$rh .= '<br>' . $us['value']['sb'][3] . '';
$rh .= '<br>' . $us['value']['sb'][4] . '';
$rh .= '<br>' . $us['value']['sb'][5] . '';
$r .= '<TR><TD align=center nowrap>' . con_login(
$us
2023-01-10 16:29:32 +00:00
) . '</TD><TD nowrap align="right"><pre>голова<br>грудь<br>живот<br>пояс<br>ноги</pre></TD><TD style="font-size:16px" nowrap><pre>' . $rh . '</pre></TD></TR>';
2022-12-19 18:26:14 +00:00
}
unset($us);
$j++;
}
$i++;
}
$r .= '</TABLE>';
2023-01-10 16:29:32 +00:00
$r .= '(<b>X</b>&nbsp;-&nbsp;удачный блок, <b><FONT COLOR=red>X</FONT></b>&nbsp;-&nbsp;пробили блок критом, <B>&bull;</B>&nbsp;-&nbsp;пропустил удар,
2023-07-27 22:25:38 +00:00
<span style="color: #AAAAAA; "><B>&bull;</B></span>&nbsp;-&nbsp;увернулся,
<span style="color: #AAAAEE; "><B>&bull;</B></span>&nbsp;-&nbsp;парировал,
<span style="color: #777777; "><B>&bull;</B></span>&nbsp;-&nbsp;отбил щитом)';
2022-12-19 18:26:14 +00:00
//
2023-01-10 16:29:32 +00:00
$r .= '<H4>Суммарно</H4>';
2022-12-19 18:26:14 +00:00
$r .= '<TABLE border=1 cellspacing=0 cellpadding=4>
2023-01-10 16:29:32 +00:00
<TR><TD align=center>&nbsp;</TD><TD align=center>Логин</TD><TD>Удары</TD><TD>Блоки</TD><TD>Попадания</TD><TD>Защита</TD><TD>Урон</TD><TD>Потери</TD><TD>Вылечено</TD></TR>';
2022-12-19 18:26:14 +00:00
//<TR><TD align=right>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD align=center>&nbsp;</TD><TD align=center>&nbsp;</TD><TD align=center>&nbsp;</TD><TD align=center>&nbsp;</TD><TD align=center>&nbsp;</TD></TR>
$i = 0;
while ($i <= count($tm_v)) {
$j = 0;
$team_data = ['g' => false];
while ($j < count($tm_u[$tm_v[$i]])) {
$us = $users[$tm_u[$tm_v[$i]][$j]];
if ($us['id'] > 0) {
$team_data['g'] = true;
$us['heal'] = ($us['hp'] - $us['hpAll']) - $us['_yrn'];
if ($us['heal'] < 0) {
$us['heal'] = 0;
}
if ($us['hp'] < 0) {
$us['hp'] = 0;
}
if ($us['yrn'] < 0) {
$us['yrn'] = 0;
}
if ($us['yrn_krit'] < 0) {
$us['yrn_krit'] = 0;
}
if ($us['_yrn'] > 0) {
$us['_yrn'] = 0;
}
if ($us['_yrn_krit'] > 0) {
$us['_yrn_krit'] = 0;
}
$team_data['ga'] += $us['ga'];
$team_data['gaa'] += $us['gaa'];
$team_data['gak'] += $us['gak'];
$team_data['hp'] += $us['hp'];
$team_data['hpAll'] += $us['hpAll'];
$team_data['yrn'] += $us['yrn'];
$team_data['yrn_krit'] += $us['yrn_krit'];
$team_data['_yrn'] += $us['_yrn'];
$team_data['_yrn_krit'] += $us['_yrn_krit'];
$team_data['val_b'] += $us['value']['b'];
$team_data['val_y'] += $us['value']['y'];
$team_data['val_p'] += $us['value']['p'];
$team_data['heal'] += $us['heal'];
$winw = '';
if ($us['hp'] < 1) {
2023-07-27 22:25:38 +00:00
$us['hp'] = '<span style="color: red; ">0</span>';
$winw = '<img title="Погиб" width="7" height="7" src="//img.new-combats.tech/i/ico/looses.gif">';
2022-12-19 18:26:14 +00:00
} else {
$winw = '<img title="Выжил" width="7" height="7" src="//img.new-combats.tech/i/ico/wins.gif">';
2022-12-19 18:26:14 +00:00
}
$r .= '<TR><TD valign=middle align=center>' . $winw . '</TD><TD align=right>' . con_login(
$us
) . ' [' . $us['hp'] . '/' . $us['hpAll'] . ']</TD><TD>' . (0 + $us['zona'][1]) . '/' . (0 + $us['zona'][2]) . '/' . (0 + $us['zona'][3]) . '/' . (0 + $us['zona'][4]) . '/' . (0 + $us['zona'][5]) . '</TD><TD>' . (0 + $us['zonb'][1]) . '/' . (0 + $us['zonb'][2]) . '/' . (0 + $us['zonb'][3]) . '/' . (0 + $us['zonb'][4]) . '/' . (0 + $us['zonb'][5]) . '</TD><TD align=center>' . (0 + $us['ga']) . '(<font color=red>' . (0 + $us['gak']) . '</font>)/' . ($us['gaa']) . '</TD><TD align=center>' . $us['value']['b'] . '/' . $us['value']['y'] . '/' . $us['value']['p'] . '</TD><TD align=center>' . $us['yrn'] . '/<font color=red>' . $us['yrn_krit'] . '</font></TD><TD align=center>' . (-$us['_yrn']) . '</TD><TD align=center>' . $us['heal'] . '</TD></TR>';
}
unset($us);
$j++;
}
if ($team_data['g'] == true) {
$winw = '--';
if ($team_data['hp'] < 1) {
$team_data['hp'] = '0';
} else {
$winw = '<img src="//img.new-combats.tech/i/flag.gif" width="20" height="20" title="Победитель">';
2022-12-19 18:26:14 +00:00
}
2023-01-10 16:29:32 +00:00
$r .= '<TR bgcolor=d2d0d0><TD align=center>' . $winw . '</TD><TD align=right><b class="CSSteam' . $tm_v[$i] . '">Всего [' . $team_data['hp'] . '/' . $team_data['hpAll'] . ']</b></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD align=center>' . (0 + $team_data['ga']) . '(<font color=red>' . (0 + $team_data['gak']) . '</font>)/' . ($team_data['gaa']) . '</TD><TD align=center>' . $team_data['val_b'] . '/' . $team_data['val_y'] . '/' . $team_data['val_p'] . '</TD><TD align=center>' . $team_data['yrn'] . '/<font color=red>' . $team_data['yrn_krit'] . '</font></TD><TD align=center>' . (-$team_data['_yrn']) . '</TD><TD align=center>' . $team_data['heal'] . '</TD></TR>';
2022-12-19 18:26:14 +00:00
}
$i++;
}
$r .= '</TABLE>';
//
$r .= '
2023-01-10 16:29:32 +00:00
Логин - имя персонажа и уровень жизни: [сейчас/всего]<br>
Удары - статистика ударов по областям: голова/грудь/живот/пояс/ноги<br>
Блоки - статистика блоков по областям: голова/грудь/живот/пояс/ноги<br>
Попадания - удачных попаданий <font color=red>(из них критов)</font> / всего ударов<br>
Защита - ударов заблокировано / уворотов / пропущено ударов<br>
Урон - выбито HP из противников / из них <font color=red>критами</font><br>
Потери - получено повреждений <br>
Вылечено - восстановлено HP<br>';
$r = '<div>' . $b . '</div><div><span style="float:left;">' . $tbtl . $p . '</span><span style="float:right;">Статус битвы: <i>' . $allprice . '</i></span></div><br><br>' . $usr . $r . '<div align="left">' . $p . '</div>';
2022-12-19 18:26:14 +00:00
//header('location: main.php');
} elseif (!isset($btl['id'])) {
2023-01-10 16:29:32 +00:00
$r = '<br><br><center>Скорее всего Архивариус снова потерял пергамент с хрониками боев ...</center>';
2022-12-19 18:26:14 +00:00
} else {
include('jx/battle/log_text.php');
function testlog($pl)
{
global $log_text;
if ($pl['type'] == 1 || $pl['type'] == 6) {
$dt = explode('||', $pl['vars']);
$i = 0;
$d = [];
while ($i < count($dt)) {
$r = explode('=', $dt[$i]);
if ($r[0] != '') {
$d[$r[0]] = $r[1];
}
$i++;
}
2023-01-10 16:29:32 +00:00
//обычный удар
2022-12-19 18:26:14 +00:00
$rt = $pl['text'];
2023-01-10 16:29:32 +00:00
//заменяем данные
2022-12-19 18:26:14 +00:00
$rt = str_replace(
'{u1}',
'<span onClick="top.addTo(\'' . $d['login1'] . '\',\'to\'); return false;" oncontextmenu="top.infoMenu(\'' . $d['login1'] . '\',event,\'chat\'); return false;" class="CSSteam' . $d['t1'] . '">' . $d['login1'] . '</span>',
$rt
);
$rt = str_replace(
'{u2}',
'<span onClick="top.addTo(\'' . $d['login2'] . '\',\'to\'); return false;" oncontextmenu="top.infoMenu(\'' . $d['login2'] . '\',event,\'chat\'); return false;" class="CSSteam' . $d['t2'] . '">' . $d['login2'] . '</span>',
$rt
);
$d['time1'] = intval($d['time1']);
$d['time2'] = intval($d['time2']);
$rt = str_replace('{pr}', '<b>' . $d['prm'] . '</b>', $rt);
$rt = str_replace('^^^^', '=', $rt);
$rt = str_replace('{tm1}', '<span class="date">' . date('H:i', $d['time1']) . '</span>', $rt);
$rt = str_replace('{tm2}', '<span class="date">' . date('H:i', $d['time2']) . '</span>', $rt);
$rt = str_replace('{tm3}', '<span class="date">' . date('d.m.y H:i', $d['time1']) . '</span>', $rt);
$rt = str_replace('{tm4}', '<span class="date">' . date('d.m.y H:i', $d['time2']) . '</span>', $rt);
$k01 = 1;
$zb1 = [1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0];
$zb2 = [1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0];
if ($d['bl2'] > 0) {
$b11 = 1;
$b12 = $d['bl1'];
while ($b11 <= $d['zb1']) {
$zb1[$b12] = 1;
if ($b12 >= 5 || $b12 < 0) {
$b12 = 0;
}
$b12++;
$b11++;
}
}
if ($d['bl2'] > 0) {
$b11 = 1;
$b12 = $d['bl2'];
while ($b11 <= $d['zb2']) {
$zb2[$b12] = 1;
if ($b12 >= 5 || $b12 < 0) {
$b12 = 0;
}
$b12++;
$b11++;
}
}
while ($k01 <= 5) {
$zns01 = '';
$zns02 = '';
$j01 = 1;
while ($j01 <= 5) {
$zab1 = '0';
$zab2 = '0';
if ($j01 == $k01) {
$zab1 = '1';
$zab2 = '1';
}
$zab1 .= $zb1[$j01];
$zab2 .= $zb2[$j01];
$zns01 .= '<img src="//img.new-combats.tech/i/zones/' . $d['t1'] . '/' . $d['t2'] . '' . $zab1 . '.gif">';
$zns02 .= '<img src="//img.new-combats.tech/i/zones/' . $d['t2'] . '/' . $d['t1'] . '' . $zab2 . '.gif">';
2022-12-19 18:26:14 +00:00
$j01++;
}
$rt = str_replace('{zn1_' . $k01 . '}', $zns01, $rt);
$rt = str_replace('{zn2_' . $k01 . '}', $zns02, $rt);
$k01++;
}
$j = 1;
while ($j <= 21) {
2023-01-10 16:29:32 +00:00
//замена R - игрок 1
2022-12-19 18:26:14 +00:00
$r = $log_text[$d['s1']][$j];
$k = 0;
if (is_array($r)) {
while ($k <= count($r)) {
if (isset($log_text[$d['s1']][$j][$k])) {
$rt = str_replace('{1x' . $j . 'x' . $k . '}', $log_text[$d['s1']][$j][$k], $rt);
}
$k++;
}
}
2023-01-10 16:29:32 +00:00
//замена R - игрок 2
2022-12-19 18:26:14 +00:00
$r = $log_text[$d['s2']][$j];
$k = 0;
if (is_array($r)) {
while ($k <= count($r)) {
if (isset($log_text[$d['s2']][$j][$k])) {
$rt = str_replace('{2x' . $j . 'x' . $k . '}', $log_text[$d['s2']][$j][$k], $rt);
}
$k++;
}
}
$j++;
}
2023-01-10 16:29:32 +00:00
//заменяем данные повторно
2022-12-19 18:26:14 +00:00
$rt = str_replace(
'{u1}',
'<span onClick="top.addTo(\'' . $d['login1'] . '\',\'to\'); return false;" oncontextmenu="top.infoMenu(\'' . $d['login1'] . '\',event,\'chat\'); return false;" class="CSSteam' . $d['t1'] . '">' . $d['login1'] . '</span>',
$rt
);
$rt = str_replace(
'{u2}',
'<span onClick="top.addTo(\'' . $d['login2'] . '\',\'to\'); return false;" oncontextmenu="top.infoMenu(\'' . $d['login2'] . '\',event,\'chat\'); return false;" class="CSSteam' . $d['t2'] . '">' . $d['login2'] . '</span>',
$rt
);
$rt = str_replace('{pr}', '<b>' . $d['prm'] . '</b>', $rt);
$rt = str_replace('^^^^', '=', $rt);
$rt = str_replace('{tm1}', '<span class="date">' . date('H:i', $d['time1']) . '</span>', $rt);
$rt = str_replace('{tm2}', '<span class="date">' . date('H:i', $d['time2']) . '</span>', $rt);
$rt = str_replace('{tm3}', '<span class="date">' . date('d.m.y H:i', $d['time1']) . '</span>', $rt);
$rt = str_replace('{tm4}', '<span class="date">' . date('d.m.y H:i', $d['time2']) . '</span>', $rt);
2023-01-10 16:29:32 +00:00
//закончили заменять
2022-12-19 18:26:14 +00:00
$pl['text'] = $rt;
}
return $pl['text'];
}
2023-01-10 16:29:32 +00:00
//Получаем логи
2022-12-19 18:26:14 +00:00
$min = round(12 * ((int)$_GET['p'] - 1));
if ($min < 1) {
$min = 0;
}
$max = $min + 11;
$based = 'battle_logs_save';
$sp_cnt = mysql_fetch_array(
mysql_query(
'SELECT COUNT(*) FROM `battle_logs_save` WHERE `battle` = "' . $btl['id'] . '" AND `id_hod` > ' . $min . ' AND `id_hod` <= ' . $max . ' ORDER BY `id_hod`, `time` ASC LIMIT 1'
)
);
if ($sp_cnt[0] < 1) {
$based = 'battle_logs';
}
2023-01-10 16:29:32 +00:00
//генерируем страницы
2022-12-19 18:26:14 +00:00
$pmax = mysql_fetch_array(
mysql_query(
'SELECT `id_hod`,`id` FROM `' . $based . '` WHERE `battle` = "' . $btl['id'] . '" ORDER BY `id_hod` DESC LIMIT 1'
)
);
$pmax = $pmax['id_hod'];
$pmax = ceil($pmax / 12);
if ($min > round(12 * ($pmax - 1))) {
$min = round(12 * ($pmax - 1));
$max = $min + 11;
}
$i = 1;
while ($i <= $pmax) {
if ((int)$_GET['p'] == $i || ((int)$_GET['p'] > $pmax && $i == $pmax) || ((int)$_GET['p'] < 1 && $i == 1)) {
$p .= ' <a style="color:maroon" href="?log=' . $btl['id'] . '&p=' . $i . '&rnd=' . $code . '">' . $i . '</a> ';
} else {
$p .= ' <a href="?log=' . $btl['id'] . '&p=' . $i . '&rnd=' . $code . '">' . $i . '</a> ';
}
$i++;
}
$h = 0;
$clr = 'f2e5e0';
$cclr = '';
$sp = mysql_query(
'SELECT * FROM `' . $based . '` WHERE `battle` = "' . $btl['id'] . '" AND `id_hod` > ' . $min . ' AND `id_hod` <= ' . ($max + 1) . ' ORDER BY `id_hod`, `id` ASC LIMIT 200'
);
while ($pl = mysql_fetch_array($sp)) {
$pl['text'] = testlog($pl);
$pl['text'] = str_replace('\"', '"', $pl['text']);
if ($h != $pl['id_hod']) {
if ($h > 0) {
if ($clr == 'f2e5e0') {
$clr = 'f2e5E5';
} else {
$clr = 'f2e5e0';
}
$cclr = 'border-top:1px solid #b1b1b1;';
}
$h = $pl['id_hod'];
}
$r .= '<div class="logs_php_line" style="background-color:#' . $clr . ';' . $cclr . 'padding:1px;">' . $pl['text'] . '</div>';
$cclr = '';
}
2023-01-10 16:29:32 +00:00
//собираем страницу
$p = 'Страницы: ' . $p;
2022-12-19 18:26:14 +00:00
$usr = '';
if ($btl['team_win'] == -1) {
$sp = mysql_query(
'SELECT
2022-06-06 21:30:34 +00:00
`u`.`id`,`u`.`login`,`u`.`level`,`u`.`sex`,`u`.`align`,`u`.`online`,`u`.`battle`,`u`.`clan`,
`s`.`hpNow`,`s`.`bot`,`s`.`team`,`u`.`city`
2022-12-19 18:26:14 +00:00
FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE `u`.`battle` = "' . $btl['id'] . '" AND `s`.`hpNow` >= 1'
);
$usrs = [-1 => []];
while ($pl = mysql_fetch_array($sp)) {
if (!isset($usrs[$pl['team']])) {
$usrs[$pl['team']] = '';
$usrs[-1][count($usrs[-1])] = $pl['team'];
}
if ($pl['align'] > 0) {
$usrs[$pl['team']] .= '<img src="//img.new-combats.tech/i/align/align' . $pl['align'] . '.gif" width="12" height="15">';
2022-12-19 18:26:14 +00:00
}
if ($pl['clan'] > 0) {
$usrs[$pl['team']] .= '<img src="//img.new-combats.tech/i/clan/' . $pl['clan'] . '.gif" width="24" height="15">';
2022-12-19 18:26:14 +00:00
}
$pl['stats_r'] = $u->getStats($pl['id']);
$usrs[$pl['team']] .= '<b class="CSSteam' . $pl['team'] . '">' . $pl['login'] . '</b> [' . ceil(
$pl['stats_r']['hpNow']
) . '/' . $pl['stats_r']['hpAll'] . '],';
}
if (count($usrs[-1]) > 0) {
$i = 0;
while ($i < count($usrs[-1])) {
$usr .= rtrim($usrs[$usrs[-1][$i]], ',');
if (count($usrs[-1]) > $i + 1) {
2023-01-10 16:29:32 +00:00
$usr .= ' &nbsp; <b><font color=black>против</font></b> &nbsp; ';
2022-12-19 18:26:14 +00:00
}
$i++;
}
}
if ($usr != '') {
$usr = '<div align="center">' . $usr . '</div><hr>';
}
}
$tbtl = '<img src="//img.new-combats.tech/i/fighttype' . $btl['type'] . '.gif" />';
2022-12-19 18:26:14 +00:00
if ($btl['invis'] > 0) {
$tbtl .= '<img src="//img.new-combats.tech/i/fighttypehidden0.gif" />';
2022-12-19 18:26:14 +00:00
}
if ($btl['type'] == 0) {
2023-01-10 16:29:32 +00:00
$tbtl = 'Тип боя: ' . $tbtl . ' (физический поединок) &nbsp; &nbsp; ';
2022-12-19 18:26:14 +00:00
} elseif ($btl['type'] == 1) {
2023-01-10 16:29:32 +00:00
$tbtl = 'Тип боя: ' . $tbtl . ' (кулачный поединок) &nbsp; &nbsp; ';
2022-12-19 18:26:14 +00:00
} elseif ($btl['type'] == 250) {
$tbtl = '<img src="//img.new-combats.tech/i/fighttype50.gif" />';
2023-01-10 16:29:32 +00:00
$tbtl = 'Тип боя: ' . $tbtl . ' (Война Кланов) &nbsp; &nbsp; ';
2022-12-19 18:26:14 +00:00
} elseif ($btl['smert'] == 1) {
$tbtl = '<img src="//img.new-combats.tech/i/fighttype9.gif" />';
2023-01-10 16:29:32 +00:00
$tbtl = 'Тип боя: ' . $tbtl . ' (Жесточайшее Сражение) &nbsp; &nbsp; ';
2022-12-19 18:26:14 +00:00
} else {
2023-01-10 16:29:32 +00:00
$tbtl = 'Тип боя: ' . $tbtl . ' (физический поединок) &nbsp; &nbsp; ';
2022-12-19 18:26:14 +00:00
}
if ($btl['izlom'] > 0) {
2023-01-10 16:29:32 +00:00
$tbtl .= 'Волна: ' . $btl['izlomRoundSee'] . ' &nbsp; &nbsp; ';
2022-12-19 18:26:14 +00:00
}
2023-01-10 16:29:32 +00:00
$r = '<div>' . $b . '</div><div><span style="float:left;">' . $tbtl . $p . '</span><span style="float:right;">Статус битвы: <i>' . $allprice . '</i></span></div><br><hr>' . $r . '<div id="not_found" style="display: none;"><i><center>Ничего не найдено. Совсем не найдено...</center></i></div><hr>' . $usr . '<div align="left">' . $p . '</div>';
2022-12-19 18:26:14 +00:00
}
2022-06-06 21:30:34 +00:00
?>
<!DOCTYPE html>
2023-07-27 22:25:38 +00:00
<html lang="ru">
2022-06-06 21:30:34 +00:00
<head>
2023-07-27 22:25:38 +00:00
2023-01-10 16:29:32 +00:00
<title>Архив: Поединки</title>
2022-12-19 18:26:14 +00:00
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jqueryrotate.js"></script>
<script type="text/javascript" src="js/jquery.zclip.js"></script>
<script type="text/javascript" src="js/jquery.cookie.js"></script>
<script type="text/javascript" src="js/title.js"></script>
<script src="//img.new-combats.tech/js/gameEngine.js" type="text/javascript"></script>
2022-12-19 18:26:14 +00:00
<script>
hi_no_fm = 1;
function maginfo(z, p, m, obj) {
2023-07-27 22:25:38 +00:00
let r = '';
2022-12-19 18:26:14 +00:00
r += '<b>' + $(obj).attr('magelogin') + '</b><br><br>';
2023-01-10 16:29:32 +00:00
r += 'Мощь: ' + m + ', ';
r += 'Защита: ' + z + ', ';
r += 'Подавление: ' + p + '';
2022-12-19 18:26:14 +00:00
return r;
}
</script>
<link href="//img.new-combats.tech/css/main.css" rel="stylesheet" type="text/css">
2022-12-19 18:26:14 +00:00
<style type="text/css">
body {
background: url(/i/battle_log_04.jpg) right 0 repeat-x,
url(/i/battle_log_16.jpg) left bottom repeat-x,
url(/i/battle_log_08.jpg) left 0 repeat-y,
url(/i/battle_log_11.jpg) right 0 repeat-y,
2022-12-19 18:26:14 +00:00
#f2e5e0;
min-height: 100vh;
min-width: 400px;
}
h3 {
text-align: center;
}
.ttl_css {
position: absolute;
2023-07-27 22:25:38 +00:00
padding: 2px 3px;
2022-12-19 18:26:14 +00:00
background-color: #ffffcc;
border: 1px solid #6F6B5E;
}
.CSSteam {
font-weight: bold;
cursor: pointer;
}
.CSSteam0 {
font-weight: bold;
cursor: pointer;
}
.CSSteam1 {
font-weight: bold;
color: #6666CC;
cursor: pointer;
}
.CSSteam2 {
font-weight: bold;
color: #B06A00;
cursor: pointer;
}
.CSSteam3 {
font-weight: bold;
color: #269088;
cursor: pointer;
}
.CSSteam4 {
font-weight: bold;
color: #A0AF20;
cursor: pointer;
}
.CSSteam5 {
font-weight: bold;
color: #0F79D3;
cursor: pointer;
}
.CSSteam6 {
font-weight: bold;
color: #D85E23;
cursor: pointer;
}
.CSSteam7 {
font-weight: bold;
color: #5C832F;
cursor: pointer;
}
.CSSteam8 {
font-weight: bold;
color: #842B61;
cursor: pointer;
}
.CSSteam9 {
font-weight: bold;
color: navy;
cursor: pointer;
}
.CSSvs {
font-weight: bold;
}
</style>
2022-06-06 21:30:34 +00:00
</head>
2022-12-19 18:26:14 +00:00
<body> <!--#E2E0E0 -->
2022-06-06 21:30:34 +00:00
<div style="max-width:95%; min-height: 100%; margin:0 auto;">
2022-12-19 18:26:14 +00:00
<br><br>
2023-07-27 22:25:38 +00:00
<div id="ttl" class="ttl_css" style="display:none;z-index:1111;"></div>
2022-12-19 18:26:14 +00:00
</div>
2022-06-06 21:30:34 +00:00
<div id="gi" class="gifin" style="display:none;z-index:1110;"></div>
2023-07-27 22:25:38 +00:00
<H3><IMG SRC="//img.new-combats.tech/i/fighttype2.gif" WIDTH=20 HEIGHT=20 alt=""> Бойцовский
2023-03-31 16:54:33 +00:00
Клуб<?php if ($based != 'battle_logs') {
2023-01-10 16:29:32 +00:00
echo ' (Архив поединков)';
2023-07-27 22:25:38 +00:00
} ?> &nbsp; <IMG SRC="//img.new-combats.tech/i/fighttype2.gif" WIDTH=20 HEIGHT=20 alt=""></H3>
2023-03-31 16:54:33 +00:00
<?= $r; ?>
2022-06-06 21:30:34 +00:00
<br><br><br>
</div>
2023-07-27 22:25:38 +00:00
<script>
2022-12-19 18:26:14 +00:00
$('#line_filter').submit(function () {
$('#line_filter_input_submit').trigger('click');
});
$('#line_filter_glow').click(function () {
var val = $('#line_filter_input').val();
$(".logs_php_line").stop().css('background-color', '').show();
$('#not_found').css('display', 'none');
if (val != '') {
$(".logs_php_line:contains('" + val + "')").css('background-color', '#f8f8ef'); //##f8f8ef ffff80
}
});
$('#line_filter_input_submit').click(function () {
$("#not_found").slideUp();
var val = $('#line_filter_input').val();
if (val == '') {
$(".logs_php_line").stop().css('background-color', '').show();
} else {
if ($.browser.msie || !1) {
$(".logs_php_line").stop().css('background-color', '').hide();
if (val != '') $(".logs_php_line:contains('" + val + "')").stop().show();
} else {
$(".logs_php_line").stop().css('background-color', '').slideUp();
$(".logs_php_line:contains('" + val + "')").stop().slideDown();
}
setInterval('if ($(".logs_php_line:visible").length == 0) $("#not_found").slideDown();', 300);
}
return false;
});
$('#line_filter_input').keyup(function () {
if ($('#line_filter_input').val() == '') {
$('#line_filter_input_submit').trigger('click');
}
});
jQuery.expr[":"].contains = function (elem, i, match, array) {
return (elem.textContent || elem.innerText || jQuery.text(elem) || "").toLowerCase().indexOf(match[3].toLowerCase()) >= 0;
}
2022-06-06 21:30:34 +00:00
</script>
</body>
2023-07-27 22:25:38 +00:00
</html>