Сихронизация с актуальной версией.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use Insallah\Tournament;
|
||||
|
||||
require_once 'Core/Db.php';
|
||||
require_once 'Core/Math.php';
|
||||
require_once 'Core/Table.php';
|
||||
require_once 'Runes/Runes.php';
|
||||
require_once 'Tournament/Tournament.php';
|
||||
require_once 'Tournament/TournamentModel.php';
|
||||
require_once 'Achievements.php';
|
||||
|
||||
|
||||
//Âìåñòî êðîíà äëÿ òóðíèðà.
|
||||
if (Tournament::IS_ENABLED) {
|
||||
(new Tournament())->startAllBattles();
|
||||
}
|
||||
@@ -21,7 +21,12 @@ class Math
|
||||
{
|
||||
return [
|
||||
'min' => $number * ((100 - 20) / 100),
|
||||
'max' => $number * ((100 + 20) / 100)
|
||||
'max' => $number * ((100 + 20) / 100),
|
||||
];
|
||||
}
|
||||
|
||||
public static function addPercent($num, $percent)
|
||||
{
|
||||
return $num + (($percent / 100) * $num);
|
||||
}
|
||||
}
|
||||
@@ -207,6 +207,11 @@ class TournamentModel
|
||||
battle_users.battle = last_battle.id and
|
||||
battle_users.team != last_battle.team_win and
|
||||
battle_users.uid in (select uid from tournaments_users where death_time = 0)';
|
||||
|
||||
$query2 = 'select bu.uid from battle b
|
||||
inner join battle_users bu on b.team_win != bu.team and b.id = bu.battle
|
||||
inner join tournaments_users tu on bu.uid = tu.uid
|
||||
where typeBattle = 25000 and death_time = 0 order by b.time_start desc limit 1';
|
||||
$db = new Db;
|
||||
$row = $db::getRow($query);
|
||||
return $row['uid'];
|
||||
@@ -222,9 +227,9 @@ class TournamentModel
|
||||
public static function removeFighter($uid, $winner = false)
|
||||
{
|
||||
if (!$uid) return;
|
||||
$winner_timer_add = $winner? 500 : 0; # Ïîñëåäíûé ÄÎËÆÅÍ áûòü ïîñëåäíèì.
|
||||
//$winner_timer_add = $winner? 500 : 0; # Ïîñëåäíûé ÄÎËÆÅÍ áûòü ïîñëåäíèì.
|
||||
$db = new Db();
|
||||
$db::sql('update tournaments_users set death_time = unix_timestamp() + ? where death_time = 0 and uid = ?', [$winner_timer_add, $uid]);
|
||||
$db::sql('update tournaments_users set death_time = unix_timestamp() + 500 where death_time = 0 and uid = ?', [$uid]);
|
||||
self::teleport($uid, 9);
|
||||
//fixme: Êëàññû íå ïîäêëþ÷àþòñÿ äðóã ê äðóãó. Íóæíî ìåíÿòü àðõèòåêòóðó èãðû. :(
|
||||
Db::sql("update users_achiv set trn = trn + 1 where id = ?", [$uid]);
|
||||
|
||||
Reference in New Issue
Block a user