EMPTY_SLOT; use Rooms; public function __construct($user) { $user_query = db::c()->query('SELECT * FROM users WHERE id = "?s" OR login = "?s"', $user, $user)->fetch_assoc(); foreach ($this as $key => $value) { if (isset($user_query[$key])) { $this->$key = $user_query[$key]; } } } protected function showItem($item = 0) { $itemSlot = $item['dressed_slot'] ?? 0; $itemName = $item['name'] ?? ''; $itemImage = $item['image'] ?? ''; if ($itemSlot) { echo << {$itemName} SLOT; } else { echo << EMPTY_SLOT; } } public function showUserInfo() { $starSign = star_sign($this->borndate); $dressed_item = []; $dressed_items = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->id); while ($row = $dressed_items->fetch_assoc()) { $dressed_item[$row['dressed_slot']] = $row; } echo <<
USERINFO; if ($this->align) { echo sprintf('Склонность', $this->align); } if ($this->block) { echo sprintf('%s', $this->login); } else { echo sprintf('%s', $this->login); } if ($this->clan) { echo sprintf('%s', $this->clan, $this->clan); } echo <<
добавить здоровье
'; echo <<
USERINFO; if (isset($dressed_item[1])) { $this->showItem($dressed_item[1]); } else { $this->showItem(1); } echo '
'; if (isset($dressed_item[2])) { $this->showItem($dressed_item[2]); } else { $this->showItem(2); } echo '
'; if (isset($dressed_item[3])) { $this->showItem($dressed_item[3]); } else { $this->showItem(3); } echo '
'; if (isset($dressed_item[4])) { $this->showItem($dressed_item[4]); } else { $this->showItem(4); } echo '
USERINFO; if (isset($dressed_item[5])) { $this->showItem($dressed_item[5]); } else { $this->showItem(5); } echo '
'; if (isset($dressed_item[6])) { $this->showItem($dressed_item[6]); } else { $this->showItem(6); } echo '
'; if (isset($dressed_item[7])) { $this->showItem($dressed_item[7]); } else { $this->showItem(7); } echo '
'; if (isset($dressed_item[8])) { $this->showItem($dressed_item[8]); } else { $this->showItem(8); } echo '
'; if (isset($dressed_item[9])) { $this->showItem($dressed_item[9]); } else { $this->showItem(9); } if (isset($dressed_item[10])) { $this->showItem($dressed_item[10]); } else { $this->showItem(10); } if (isset($dressed_item[11])) { $this->showItem($dressed_item[11]); } else { $this->showItem(11); } echo <<
Уровень {$this->level}
Сила {$this->strength}
Ловкость {$this->dexterity}
Интуиция {$this->intuition}
Выносливость {$this->endurance}
Интеллект {$this->intelligence}
Мудрость {$this->wisdom}
Находится в {$this->getRoomName($this->room)}
Родовой знак
USERINFO; if ($this->married) { echo sprintf('В браке с %s', $this->married, $this->married, $this->married); } ///////////////////////// } public function showUserInfo2() { $dressed_items = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->id); while ($row = $dressed_items->fetch_assoc()) { $dressed_item[$row['dressed_slot']] = $row; } echo ''; } }