WIP: перед введенимем класса Fighter.php
This commit is contained in:
+3
-17
@@ -19,21 +19,9 @@ if ($u->info['battle'] == 0 || isset($_GET['bend'])) {
|
||||
die('<script>top.frames[\'main\'].location = "main.php";</script>');
|
||||
}
|
||||
|
||||
$thisBattle = Db::getRow('select * from battle where id = ?', [$u->info['battle']]);
|
||||
$thisBattle = Battle::get($u->info['battle']);
|
||||
$allprice = Db::getValue('select sum(price1) from battle_users where battle = ?', [$u->info['battle']]);
|
||||
|
||||
function typeBattle($x): array
|
||||
{
|
||||
return match (true) {
|
||||
$x >= 5000000 => [150, 150, 'Судный День', 'Судный День'],
|
||||
$x >= 2500000 => [100, 125, 'Эпохальная Битва', 'Кровавое Побоище'],
|
||||
$x >= 1000000 => [75, 100, 'Историческая Битва', 'Кровавая Сеча'],
|
||||
$x >= 500000 => [50, 75, 'Величайшая Битва', 'Кровавая Резня'],
|
||||
$x >= 100000 => [25, 50, 'Великая Битва', 'Кровавая Битва'],
|
||||
default => [0, 0, 'Поединок', 'Кровавый Поединок'],
|
||||
};
|
||||
}
|
||||
|
||||
function finish(User $u): void
|
||||
{
|
||||
if (!isset($_GET['finish'])) {
|
||||
@@ -72,11 +60,9 @@ function normJsonStr($str)
|
||||
);
|
||||
}
|
||||
|
||||
$allprice = typeBattle($allprice);
|
||||
$allprice = Battle::getType($allprice, $thisBattle['smert'] == 1);
|
||||
|
||||
|
||||
if ($thisBattle['smert'] == 1) {
|
||||
$allprice = [150, 150, 'Жесточайшее Сражение', 'Жесточайшее Сражение'];
|
||||
}
|
||||
?>
|
||||
|
||||
<script src="/js/jquery.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user