40 lines
1.6 KiB
PHP
40 lines
1.6 KiB
PHP
<?php
|
||
/**
|
||
* Created by PhpStorm.
|
||
* User: Lopar
|
||
* Date: 11.01.2019
|
||
* Time: 18:21
|
||
*/
|
||
|
||
class ItemClass extends Item
|
||
{
|
||
private function plusOrMinus($number)
|
||
{
|
||
if ($number > 0) return "+".$number;
|
||
else return $number;
|
||
}
|
||
public function printItemStats()
|
||
{
|
||
echo $this->name ." (Масса: ". $this->massa .")";
|
||
if ($this->nalign) echo " <img src=i/align_{$this->nalign}.gif title='Этот предмет могут использовать только игроки с определённой склонностью.'> ";
|
||
if ($this->count > 0) echo "<br><small>(Осталось: {$this->count} штук)</small>";
|
||
if ($this->maxdur > 0) echo "<br>Долговечность: 0 / {$this->maxdur}";
|
||
if ($this->nsila) echo "<br>Требуется сила: {$this->nsila}";
|
||
if ($this->nlovk) echo "<br>Требуется ловкость: {$this->nlovk}";
|
||
if ($this->ninta) echo "<br>Требуется интуиция: {$this->ninta}";
|
||
if ($this->nvinos) echo "<br>Требуется выносливость: {$this->nvinos}";
|
||
|
||
if ($this->gsila) echo "<br>Сила: " .$this->plusOrMinus($this->gsila);
|
||
if ($this->glovk) echo "<br>Ловкость: " .$this->plusOrMinus($this->glovk);
|
||
if ($this->ginta) echo "<br>Интуиция: " .$this->plusOrMinus($this->ginta);
|
||
if ($this->gintel) echo "<br>Интеллект: " .$this->plusOrMinus($this->gintel);
|
||
|
||
|
||
echo "<br>";
|
||
}
|
||
|
||
public function printItemImage()
|
||
{
|
||
echo "<img src='/i/sh/{$this->img}'";
|
||
}
|
||
} |