$value) { if (isset($row[$key])) { $this->$key = $row[$key]; } } switch ($this->type) { case 1: $this->typename = 'Серьги'; break; case 2: $this->typename = 'Ожерелье'; break; case 3: $this->typename = 'Оружие'; break; case 4: $this->typename = 'Броня'; break; case 5: $this->typename = 'Кольцо'; break; case 8: $this->typename = 'Шлем'; break; case 9: $this->typename = 'Перчатки'; break; case 10: $this->typename = 'Щит'; break; case 11: $this->typename = 'Обувь'; break; case 12: $this->typename = 'Магический свиток'; break; case 22: $this->typename = 'Рубашка'; break; case 50: $this->typename = 'Волшебное зелье'; break; case 200: $this->typename = 'Сувенир'; break; default: $this->typename = 'Хлам'; } } abstract public function printInfo(); public function printImage() { echo << IMG; } protected function wrap($number) { if ($number > 0) return ": " . $number . ""; else return ": " . $number . ""; } protected function printBaseInfo() { echo "" . $this->name . " (Масса: " . $this->massa . ")"; if ($this->nalign) echo " nalign}.gif title='Этот предмет могут использовать только игроки с определённой склонностью.'> "; if ($this->maxdur > 0) echo "
Долговечность: {$this->maxdur}"; if ($this->maxdur == -1) echo "
Долговечность: неразрушимо"; echo "
{$this->typename}"; } protected function printRequirements() { if ($this->nlevel > 0) echo "
Требуется уровень" . $this->wrap($this->nlevel); if ($this->nnoj > 0) echo "
Требуется владение колющим оружиием" . $this->wrap($this->nnoj); if ($this->ndubina > 0) echo "
Требуется владение дробящим оружием" . $this->wrap($this->ndubina); if ($this->ntopor > 0) echo "
Требуется владение рубящим оружием" . $this->wrap($this->ntopor); if ($this->nmech > 0) echo "
Требуется владение режущим оружием" . $this->wrap($this->nmech); if ($this->nsila > 0) echo "
Требуется сила" . $this->wrap($this->nsila); if ($this->nlovk > 0) echo "
Требуется ловкость" . $this->wrap($this->nlovk); if ($this->ninta > 0) echo "
Требуется интуиция" . $this->wrap($this->ninta); if ($this->nvinos > 0) echo "
Требуется выносливость" . $this->wrap($this->nvinos); if ($this->nintel > 0) echo "
Требуется интеллект" . $this->wrap($this->nintel); } protected function printBonuses() { if ($this->gsila) echo "
Сила" . $this->wrap($this->gsila); if ($this->glovk) echo "
Ловкость" . $this->wrap($this->glovk); if ($this->ginta) echo "
Интуиция" . $this->wrap($this->ginta); if ($this->gintel) echo "
Интеллект" . $this->wrap($this->gintel); if ($this->minu AND $this->maxu) echo "
Урон: {$this->minu} - {$this->maxu}"; if ($this->ghp) echo "
Здоровье" . $this->wrap($this->ghp); if ($this->gnoj) echo "
Владение колющим оружиием" . $this->wrap($this->gnoj); if ($this->gdubina) echo "
Владение дробящим оружием" . $this->wrap($this->gdubina); if ($this->gtopor) echo "
Владение рубящим оружием" . $this->wrap($this->gtopor); if ($this->gmech) echo "
Владение режущим оружием" . $this->wrap($this->gmech); if ($this->gfire) echo "
Владение магией огня" . $this->wrap($this->gfire); if ($this->gwater) echo "
Владение магией воды" . $this->wrap($this->gwater); if ($this->gair) echo "
Владение магией воздуха" . $this->wrap($this->gair); if ($this->gearth) echo "
Владение магией земли" . $this->wrap($this->gearth); if ($this->glight) echo "
Владение магией света" . $this->wrap($this->glight); if ($this->ggray) echo "
Владение магией серости" . $this->wrap($this->ggray); if ($this->gdark) echo "
Владение магией тьмы" . $this->wrap($this->gdark); if ($this->mfkrit) echo "
Шанс крита" . $this->wrap($this->mfkrit); if ($this->mfakrit) echo "
Шанс антикрита" . $this->wrap($this->mfakrit); if ($this->mfuvorot) echo "
Шанс уворота" . $this->wrap($this->mfuvorot); if ($this->mfauvorot) echo "
Шанс антиуворота" . $this->wrap($this->mfauvorot); if ($this->bron1) echo "
Броня головы" . $this->wrap($this->bron1); if ($this->bron2) echo "
Броня корпуса" . $this->wrap($this->bron2); if ($this->bron3) echo "
Броня пояса" . $this->wrap($this->bron3); if ($this->bron4) echo "
Броня ног" . $this->wrap($this->bron4); if ($this->magic AND $this->type != 12) { echo "
Магические свойства:"; if ($this->magic_name) echo "
{$this->magic_name}"; else echo "
Неопознанная магия"; if ($this->magic_img AND $this->type != 50) echo << IMG; } } }