Рефакторинг заявок на поединок.

This commit is contained in:
2023-04-15 22:17:40 +03:00
parent 92318be837
commit f92aa003ac
17 changed files with 1733 additions and 4491 deletions
+19 -1
View File
@@ -2599,7 +2599,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
public function addNewbot($id, $botDate, $clon, $logins_bot = null, $luser = null, $round = null)
{
if ($clon != null) {
$r = false;
$r = 0;
if (!is_array($clon)) {
$clon = $this->getUserInfoById((int)$clon);
}
@@ -11887,4 +11887,22 @@ LIMIT 1'
Db::sql('update users set online = unix_timestamp() where id = ?', [$uid]);
}
public function isModerator(): bool
{
return $this->isAdmin() || $this->info['align'] > 3 && $this->info['align'] < 4;
}
public function isAdmin(): bool
{
return $this->info['admin'] > 0;
}
/** Игрок имеет меньше 30% хп.
* @return bool
*/
public function isWeakened(): bool
{
return $this->stats['hpNow'] < ceil($this->stats['hpMax'] / 100 * 30);
}
}