id); $this->bankMoney = $bank->getMoney(); } /** * Отображает куклу персонажа (образ и слоты). * * @param int $isBattle установить 1, если куклу нужно отобразить в поединке (показывает параметры при наведении * на образ). * @param int $isMain установить 1, если куклу надо показать на странице игрока (по клику на предмет снимает * его). */ private function UserInfoDoll(int $isBattle = 0, int $isMain = 0) { $di = new DressedItems($this->id); $dressedItems = $di->getItemsInSlots(); for ($i = 1; $i <= 12; $i++) { echo sprintf('
', $i); if (!empty($dressedItems->$i)) { if (!$isBattle && $isMain) { echo sprintf('%s', mt_rand(), $i, $dressedItems->$i->image, $dressedItems->$i->name, $dressedItems->$i->name); } else { echo sprintf('%s%s', $dressedItems->$i->image, $dressedItems->$i->name, $dressedItems->$i->name); } } else { echo sprintf('Пустой слот [%s]', $i, $i); } echo sprintf('
', $i); } echo '
'; if ($isBattle) { echo sprintf('%s%sУровень: %s
Сила: %s
Ловкость: %s
Интуиция: %s
Выносливость: %s
Интеллект: %s
Мудрость: %s
', $this->shadow, $this->login, $this->login, $this->level, $this->strength, $this->dexterity, $this->intuition, $this->endurance, $this->intelligence, $this->wisdom); unset($sh); } else { echo '' . $this->login . ''; } echo '
'; } private function ttz() { $stat = $this->getFullStats(); $arr = [ 'Уровень' => $this->level, 'Сила' => $this->printStat('strength'), 'Ловкость' => $this->printStat('dexterity'), 'Интуиция' => $this->printStat('intuition'), 'Выносливость' => $this->printStat('endurance'), 'Интеллект' => $this->printStat('intelligence'), 'Мудрость' => $this->printStat('wisdom'), 'Уворот' => $stat->evasion, 'Точность' => $stat->accuracy, 'Шанс крита' => $stat->criticals, 'Урон' => $stat->min_physical_damage . ' - ' . $stat->max_physical_damage, 'Локация' => Rooms::$roomNames[$this->room], ]; $str = null; $i = 0; foreach ($arr as $item => $value) { $str .= "
$item
$value
"; if (in_array($i,[6,9])) { $str .= "
"; } $i++; } $nameString = $this->align ? "Склонность" : ""; $nameString .= $this->block ? "$this->login" : "$this->login"; $nameString .= $this->clan ? "Клан" : ""; echo "
$nameString
"; echo "
$str
"; } private function printStat($statName): string { $stat = $this->getFullStats(); return $this->getFreeStatPoints() ? $this->getStat($statName, 1) . '(' . $stat->$statName . ')' : $stat->$statName; } //TODO вызывать из main.php private function UserInfoStats($isMainWindow = 0) { $stat = $this->getFullStats(); $captions = 'Уровень:
Сила:
Ловкость:
Интуиция:
Выносливость:
Интеллект:
Мудрость:
Местонахождение:'; $variables = $this->level . '
' . $stat->strength . '
' . $stat->dexterity . '
' . $stat->intuition . '
' . $stat->endurance . '
' . $stat->intelligence . '
' . $stat->wisdom . '
' . Rooms::$roomNames[$this->room]; if ($isMainWindow) { $captions = 'Уровень:
Здоровье:
Сила:
Ловкость:
Интуиция:
Выносливость:
Интеллект:
Мудрость:
Опыт:
Очки характеристик:
Деньги:
Деньги в банке:'; $variables = $this->level . '
' . $this->health . '
' . parent::getStat('strength', 1) . '
' . parent::getStat('dexterity', 1) . '
' . parent::getStat('intuition', 1) . '
' . parent::getStat('endurance', 1) . '
' . parent::getStat('intelligence', 1) . '
' . parent::getStat('wisdom', 1) . '
' . $this->experience . '
' . $this->free_stat_points . '
' . $this->money . '
' . $this->bankMoney; } $nameString = null; $nameString .= $this->align ? "Склонность" : ""; $nameString .= $this->block ? "$this->login" : "$this->login"; $nameString .= $this->clan ? "Клан" : ""; echo <<
$nameString
$captions
$variables
HTML; } /** * О персонаже для модераторов. * @return string|null */ private function showPrivateData(): ?string { $birthday = date('d.m.Y', strtotime($this->borndate)); $userLogs = GameLogs::getUserLogs($this->id); $log = null; while ($userLogRow = $userLogs->fetchArray(SQLITE3_ASSOC)) { $log .= sprintf('%s
', date('d.m.Y H:i ', strtotime($userLogRow['date'])) . $userLogRow['text']); } $adminData = $this->watcher->getAdmin() ? $this->showAdminOnlyData() : null; return << E-Mail: $this->email
ДР Игрока: $birthday
IP Регистрации: $this->ip
$adminData
Личное дело
$log
INFO; } /** * О персонаже для администраторов. * @return string|null */ private function showAdminOnlyData(): ?string { return <<id
⁑ ИД Комнаты: $this->room
⁑ Деньги: $this->money
⁑ Деньги в банке: $this->bankMoney
⁑ Опыт: $this->experience
⁑ Нераспределённые очки: $this->free_stat_points
INFO; } private function Info() { echo ''; echo '
'; echo ''; if ($this->watcher->getAdmin() || $this->watcher->getAlign() == 1) { echo $this->showPrivateData(); } } public function showUserInfo() { $effects = new EffectsModel($this->id); if ($this->block && (!$this->watcher->getAdmin() || !$this->watcher->getAlign() == 1)) { echo "Персонаж $this->login заблокирован!"; } elseif ($effects->getHideUserInfoStatus() && (!$this->watcher->getAdmin() || !$this->watcher->getAlign() == 1)) { if ($effects->getHideUserInfoStatus() == -1) { $date = 'навсегда'; } else { $date = 'до' . date('d.m.Y', strtotime($effects->getHideUserInfoStatus())); } echo "Персонаж $this->login обезличен $date."; } else { $this->Info(); } } public function showUserDoll($isBattle = 0, $isMain = 0) { echo ''; } public function showUserInfoMain() { echo ''; } public function showUserEffects(): string { $effs = DBPDO::INIT()->ofetchAll('SELECT * FROM users_effects WHERE owner_id = ?', $this->id); $img = UserEffects::$effectImage; $r = ''; foreach ($effs as $effect) { $timeleft = timeOut($effect->remaining_time - time()); $r .= "
$effect->name $effect->name
$timeleft
"; } return $r; } /** * @param mixed $watcher_id */ public function setWatcher(int $watcher_id): void { $this->watcher = new User($watcher_id); } }