diff --git a/functions.php b/functions.php index f20f171..08234a4 100644 --- a/functions.php +++ b/functions.php @@ -358,7 +358,6 @@ $rooms = [ 52 => "Квартал Законников", 53 => "Библиотека", - 101 => "Противостояние сил", 200 => "Турнир", 401 => "Врата Ада", diff --git a/magic/attack_t.php b/magic/attack_t.php index ee3f112..3e27c43 100644 --- a/magic/attack_t.php +++ b/magic/attack_t.php @@ -65,12 +65,6 @@ elseif (!$us['online']) { echo "Вы не можете напасть на погибшего!"; } elseif ($us_battle['type'] ==4 || $us_battle['type'] ==5) { echo "Вы можете вмешаться только в физический поединок!"; -} elseif (($us['room']==101)&&($us['battle']=0)) { - echo "Не вам начинать сражение Тьмы и Света!"; -} elseif (($us['room']==101)&&($us['battle']>0) && ($user['align']!=2.1 && $user['align']!=2.2 && $user['align']!=6 && $user['align']!=3 && $user['align']!=2)) { - echo "Вы не можете вступить в противостояние Тьмы и Света!"; -} elseif ((($us['room']==101)&&($us['battle']>0))&&(((($user['align']==3)||($user['align']==2.2)) && ($us['align']!=6 && $us['align']!=2.1)) || ((($user['align']==6)||($user['align']==2.1)) && ($us['align']!=3 && $us['align']!=2.2)))) { - echo "Не атакуйте своих союзников!"; } else { if ($user['sex'] == 1) {$action="напал";} else {$action="напала";} diff --git a/magic/attackk.php b/magic/attackk.php index f8e7d88..3100947 100644 --- a/magic/attackk.php +++ b/magic/attackk.php @@ -56,12 +56,6 @@ elseif (!$us['online']) { echo "Вы слишком ослаблены для нападения!"; } elseif ($us['hp'] < 1 && $us['battle']) { echo "Вы не можете напасть на погибшего!"; -} elseif (($us['room']==101)&&($us['battle']=0)) { - echo "Не вам начинать сражение Тьмы и Света!"; -} elseif (($us['room']==101)&&($us['battle']>0) && ($user['align']!=2.1 && $user['align']!=2.2 && $user['align']!=6 && $user['align']!=3 && $user['align']!=2)) { - echo "Вы не можете вступить в противостояние Тьмы и Света!"; -} elseif ((($us['room']==101)&&($us['battle']>0))&&(((($user['align']==3)||($user['align']==2.2)) && ($us['align']!=6 && $us['align']!=2.1)) || ((($user['align']==6)||($user['align']==2.1)) && ($us['align']!=3 && $us['align']!=2.2)))) { - echo "Не атакуйте своих союзников!"; } elseif (mt_rand(1,100) < $int) { if ($user['sex'] == 1) {$action="напал";} else {$action="напала";} diff --git a/magic/battack.php b/magic/battack.php index 65ebade..0a26f0b 100644 --- a/magic/battack.php +++ b/magic/battack.php @@ -65,12 +65,6 @@ elseif (!$us['online']) { echo "Вы не можете напасть на погибшего!"; } elseif (in_array($us['battle'],$forb_battle)) { echo "Вы не можете вступать в бой за силы Хаоса!!"; -} elseif (($us['room']==101)&&($us['battle']=0)) { - echo "Не вам начинать сражение Тьмы и Света!"; -} elseif (($us['room']==101)&&($us['battle']>0) && ($user['align']!=2.1 && $user['align']!=2.2 && $user['align']!=6 && $user['align']!=3 && $user['align']!=2)) { - echo "Вы не можете вступить в противостояние Тьмы и Света!"; -} elseif ((($us['room']==101)&&($us['battle']>0))&&(((($user['align']==3)||($user['align']==2.2)) && ($us['align']!=6 && $us['align']!=2.1)) || ((($user['align']==6)||($user['align']==2.1)) && ($us['align']!=3 && $us['align']!=2.2)))) { - echo "Не атакуйте своих союзников!"; } elseif (rand(1,100) < $int) { if ($user['sex'] == 1) {$action="напал";} else {$action="напала";} diff --git a/magic/cpattack.php b/magic/cpattack.php index 94b3278..0ab8438 100644 --- a/magic/cpattack.php +++ b/magic/cpattack.php @@ -65,12 +65,6 @@ elseif (!$us['online']) { echo "Вы не можете напасть на погибшего!"; } elseif (in_array($us['battle'],$forb_battle)) { echo "Вы не можете вступать в бой за силы Хаоса!!"; -} elseif (($us['room']==101)&&($us['battle']=0)) { - echo "Не вам начинать сражение Тьмы и Света!"; -} elseif (($us['room']==101)&&($us['battle']>0) && ($user['align']!=2.1 && $user['align']!=2.2 && $user['align']!=6 && $user['align']!=3 && $user['align']!=2)) { - echo "Вы не можете вступить в противостояние Тьмы и Света!"; -} elseif ((($us['room']==101)&&($us['battle']>0))&&(((($user['align']==3)||($user['align']==2.2)) && ($us['align']!=6 && $us['align']!=2.1)) || ((($user['align']==6)||($user['align']==2.1)) && ($us['align']!=3 && $us['align']!=2.2)))) { - echo "Не атакуйте своих союзников!"; } elseif (true) { if ($user['sex'] == 1) {$action="напал";} else {$action="напала";} diff --git a/zayavka.php b/zayavka.php index aa95f32..ef3961f 100644 --- a/zayavka.php +++ b/zayavka.php @@ -47,9 +47,10 @@ class zayavka } /** - * @param int $razdel - тип поединка (1-нубы,2-физы,4-группы,5-хаос) - * @param null $level - показывать заявки только N уровня + * @param int $razdel - тип поединка (1-нубы,2-физы,4-группы,5-хаос) + * @param null $level - показывать заявки только N уровня * @param null $id + * * @return mixed * @throws \Krugozor\Database\Mysql\Exception */ @@ -81,7 +82,7 @@ class zayavka } } } - $zay[$row['id']] = array("team1" => $this->fteam($row['team1']), "team2" => $this->fteam($row['team2']), "coment" => $row['coment'], "type" => $row['type'], "timeout" => $row['timeout'], "start" => $row['start'], "t1min" => $row['t1min'], "t1max" => $row['t1max'], "t2min" => $row['t2min'], "t2max" => $row['t2max'], "t1c" => $row['t1c'], "t2c" => $row['t2c'], "podan" => $row['podan'], "id" => $row['id'], "level" => $row['level'], "blood" => $row['blood'], "bots" => $row['bots']); + $zay[$row['id']] = ["team1" => $this->fteam($row['team1']), "team2" => $this->fteam($row['team2']), "coment" => $row['coment'], "type" => $row['type'], "timeout" => $row['timeout'], "start" => $row['start'], "t1min" => $row['t1min'], "t1max" => $row['t1max'], "t2min" => $row['t2min'], "t2max" => $row['t2max'], "t1c" => $row['t1c'], "t2c" => $row['t2c'], "podan" => $row['podan'], "id" => $row['id'], "level" => $row['level'], "blood" => $row['blood'], "bots" => $row['bots']]; } return $zay; } @@ -413,7 +414,7 @@ class zayavka $bot = 0; if ($z['bots'] > 0 && $count_users > 0) { - $bots_raw = array(7 => array(10962, 10964, 10965), 8 => array(10124, 10125, 10126), 13 => array(10124, 10125, 10126)); + $bots_raw = [7 => [10962, 10964, 10965], 8 => [10124, 10125, 10126], 13 => [10124, 10125, 10126]]; $i = 0; while ($i <= count($bots_raw[$z['bots']])) { $bot_id = $bots_raw[$z['bots']][$i]; @@ -471,7 +472,7 @@ class zayavka $gamer = db::c()->query('SELECT (`level`*50)+`sila`+`lovk`+`inta`+`vinos`+`intel`+`stats`+IFNULL((SELECT SUM(`cost`) FROM `inventory` WHERE `owner` = `users`.`id` AND `dressed` = 1), 0) FROM `users` WHERE `id` = ?i', $bt['prototype'])->fetch_assoc(); } - $cost[] = array($z['team1'][$i], $gamer[0]); + $cost[] = [$z['team1'][$i], $gamer[0]]; } $z['team1'] = null; $z['team2'] = null; @@ -502,17 +503,17 @@ class zayavka } } - $teams = array(); + $teams = []; foreach ($z['team1'] as $k => $v) { foreach ($z['team2'] as $kk => $vv) { - $teams[$v][$vv] = array(0, 0, time()); + $teams[$v][$vv] = [0, 0, time()]; } } foreach ($z['team2'] as $k => $v) { foreach ($z['team1'] as $kk => $vv) { - $teams[$v][$vv] = array(0, 0, time()); + $teams[$v][$vv] = [0, 0, time()]; } } @@ -690,9 +691,26 @@ if (!empty($_POST['open'])) { } echo ""; echo ''; - $vs_test = mysql_fetch_array(mysql_query("SELECT * FROM zayavka where id='{$z[$_POST['gocombat']]['id']}' limit 1 ")); + $raid_t = mysql_fetch_array(mysql_query("SELECT * FROM variables WHERE var='raid_on_status' limit 1;")); + if ($z[$_POST['gocombat']]['team1'][0] != 1000 && $z[$_POST['gocombat']]['team1'][0] != 1001) + echo ''; + else echo ''; - - if ($user['room'] != 101) { - if ($vs_test['versus'] == 0) { - $raid_t = mysql_fetch_array(mysql_query("SELECT * FROM variables WHERE var='raid_on_status' limit 1;")); - if ($z[$_POST['gocombat']]['team1'][0] != 1000 && $z[$_POST['gocombat']]['team1'][0] != 1001) - echo ''; - else echo ''; - } else echo ''; - } else { - if (($user['align'] == 6) || ($user['align'] == 2.1) || ($user['align'] == 2.99) || (($user['align'] > 7) && ($user['align'] < 8)) || ($user['align'] == 2)) { - echo ''; - }; - if (($user['align'] == 2.1) || ($user['align'] == 6)) { - echo ''; - }; - }; - - if ($user['room'] != 101) { - if ($vs_test['versus'] == 0) { - echo ''; - } else echo ''; - } else { - if (($user['align'] == 2.2) || ($user['align'] == 3)) { - echo ''; - }; - if (($user['align'] == 3) || ($user['align'] == 2.2) || ($user['align'] == 2.99) || (($user['align'] > 7) && ($user['align'] < 8)) || ($user['align'] == 2)) { - echo ''; - }; - }; - - echo '
'; - if ($zay->user_status($user['id']) == 0) { - echo '
Подать заявку на бой Таймаут Тип боя  
'; - } + if ($zay->user_status($user['id']) == 0) { ?> +
+ Подать заявку на бой + Таймаут + + Тип боя + + +
+ getlist(2, null, $user['zayavka']); if ($zay->user_status($user['id']) == 1) { if (count($z[$user['zayavka']]['team2']) > 0) { @@ -711,10 +729,10 @@ if (!empty($_POST['open'])) { mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) values ('" . $user['login'] . " (Клон 1)','" . $user['id'] . "','','" . $user['maxhp'] . "');"); $bot = mysql_insert_id(); - $teams = array(); + $teams = []; - $teams[$user['id']][$bot] = array(0, 0, time()); - $teams[$bot][$user['id']] = array(0, 0, time()); + $teams[$user['id']][$bot] = [0, 0, time()]; + $teams[$bot][$user['id']] = [0, 0, time()]; mysql_query("INSERT INTO `battle` (`teams`,`timeout`,`type`,`status`,`t1`,`t2`,`to1`,`to2`, `clone` @@ -735,7 +753,7 @@ if (!empty($_POST['open'])) { $timeFigth = fread($f, filesize($Path)); fclose($f); - if ($user['level'] < 7 || $user['admin'] == 1) { + if ($user['admin'] == 1) { echo " или "; } @@ -757,11 +775,9 @@ if (!empty($_POST['open'])) { } if ($get == 'group') { - if ($user['level'] < 2) { - die("


Групповые бои доступны с 2 уровня.
"); - } + if (!empty($_POST['open1']) AND empty($user['zayavka'])) { - // room 101 - противостояние сил + echo ' @@ -822,7 +827,6 @@ if (!empty($_POST['open'])) {

Подать заявку на групповой бой

Начало боя через бойцов
'; - if ($user['room'] != 101) - echo 'Уровни союзников   
'; - die(); } @@ -850,39 +854,12 @@ if (!empty($_POST['open'])) { } echo '
Силы ХаосаСилы ХаосаВойдите в комнату "Противостояние", чтобы принять эту заявку!
'; + echo ''; die(); } @@ -985,11 +962,7 @@ if (!empty($_POST['open'])) { echo ""; echo '
'; if ($zay->user_status($user['id']) == 0) - if (($user['room'] == 101) && ($user['align'] != 2.2) && ($user['align'] != 2.1)) { - echo "
Свет и Тьма не снизойдут к вашей просьбе начать новый бой
"; - } else { - echo ''; - } + echo ''; if ($zay->user_status($user['id']) != 0) { $z = $zay->getlist(4, null, $user['zayavka']); if ($z[$user['zayavka']]['level'] == 4) { @@ -1002,19 +975,10 @@ if (!empty($_POST['open'])) { if ($z = $zay->getlist(4, $_SESSION['view'])) foreach ($z as $k => $v) { - $ok = 0; - if ($user['room'] == 101) { - $vs_test = mysql_fetch_array(mysql_query("SELECT * FROM zayavka where id='{$z[$k]['id']}' limit 1 ")); - if ($vs_test['versus'] == 1) $ok = 1; - else $ok = 0; - } else $ok = 0; - - if (($ok == 0 && $user['room'] != 101) || ($ok == 1 && $user['room'] == 101)) { - if ((($z[$k]['start'] - time()) < 0) || (($z[$k]['t1c'] == count($z[$k]['team1'])) && ($z[$k]['t2c'] == count($z[$k]['team2'])))) { - $zay->battlestart("CHAOS", $k, 4); - } - echo $zay->showgroup($v); + if ((($z[$k]['start'] - time()) < 0) || (($z[$k]['t1c'] == count($z[$k]['team1'])) && ($z[$k]['t2c'] == count($z[$k]['team2'])))) { + $zay->battlestart("CHAOS", $k, 4); } + echo $zay->showgroup($v); } echo '
'; }