battles/classes/ItemClass.php

54 lines
3.1 KiB
PHP
Raw Normal View History

2019-01-11 16:22:32 +00:00
<?php
/**
* Created by PhpStorm.
* User: Lopar
* Date: 11.01.2019
* Time: 18:21
*/
class ItemClass extends Item
{
2019-01-11 18:20:11 +00:00
private function wrap($number)
2019-01-11 17:51:35 +00:00
{
2019-01-11 18:20:11 +00:00
if ($number > 0) return ": <b>" . $number . "</b>";
else return ": <b style='color: maroon;'>-" . $number . "</b>";
2019-01-11 17:51:35 +00:00
}
2019-01-11 18:20:11 +00:00
2019-01-11 16:22:32 +00:00
public function printItemStats()
{
2019-01-11 18:20:11 +00:00
echo $this->name . " (Масса: " . $this->massa . ")";
2019-01-11 16:47:16 +00:00
if ($this->nalign) echo " <img src=i/align_{$this->nalign}.gif title='Этот предмет могут использовать только игроки с определённой склонностью.'> ";
if ($this->count > 0) echo "<br><small>(Осталось: {$this->count} штук)</small>";
2019-01-11 18:20:11 +00:00
if ($this->maxdur > 0) echo "<br>Долговечность: {$this->maxdur}";
if ($this->maxdur == -1) echo "<br>Долговечность: <i>неразрушимо</i>";
echo "<br>";
if ($this->nlevel > 0) echo "<br>Требуется уровень" . $this->wrap($this->nlevel);
if ($this->nnoj > 0) echo "<br>Требуется владение колющим оружиием" . $this->wrap($this->nnoj);
if ($this->ndubina > 0) echo "<br>Требуется владение дробящим оружием" . $this->wrap($this->ndubina);
if ($this->ntopor > 0) echo "<br>Требуется владение рубящим оружием" . $this->wrap($this->ntopor);
if ($this->nmech > 0) echo "<br>Требуется владение режущим оружием" . $this->wrap($this->nmech);
if ($this->nsila > 0) echo "<br>Требуется сила" . $this->wrap($this->nsila);
if ($this->nlovk > 0) echo "<br>Требуется ловкость" . $this->wrap($this->nlovk);
if ($this->ninta > 0) echo "<br>Требуется интуиция" . $this->wrap($this->ninta);
if ($this->nvinos > 0) echo "<br>Требуется выносливость" . $this->wrap($this->nvinos);
if ($this->nintel > 0) echo "<br>Требуется интеллект" . $this->wrap($this->nintel);
2019-01-11 17:51:35 +00:00
2019-01-11 18:20:11 +00:00
if ($this->gsila) echo "<br>Сила" . $this->wrap($this->gsila);
if ($this->glovk) echo "<br>Ловкость" . $this->wrap($this->glovk);
if ($this->ginta) echo "<br>Интуиция" . $this->wrap($this->ginta);
if ($this->gintel) echo "<br>Интеллект" . $this->wrap($this->gintel);
if ($this->minu AND $this->maxu) echo "<br>Урон: {$this->minu} - {$this->maxu}";
if ($this->ghp) echo "<br>Здоровье" . $this->wrap($this->ghp);
if ($this->gnoj) echo "<br>Владение колющим оружиием" . $this->wrap($this->gnoj);
if ($this->gdubina) echo "<br>Владение дробящим оружием" . $this->wrap($this->gdubina);
if ($this->gtopor) echo "<br>Владение рубящим оружием" . $this->wrap($this->gtopor);
if ($this->gmech) echo "<br>Владение режущим оружием" . $this->wrap($this->gmech);
2019-01-11 16:47:16 +00:00
echo "<br>";
}
public function printItemImage()
{
echo "<img src='/i/sh/{$this->img}'";
2019-01-11 16:22:32 +00:00
}
}