This commit is contained in:
Igor Barkov [iwork] 2019-01-11 18:47:16 +02:00
parent 642fb82938
commit 0336ef47fa
2 changed files with 23 additions and 4 deletions

View File

@ -8,11 +8,23 @@
class ItemClass extends Item
{
/**
*
*/
public function printItemStats()
{
echo $this->name ." (Масса: ". $this->massa .")<br>";
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}";
echo "<br>";
}
public function printItemImage()
{
echo "<img src='/i/sh/{$this->img}'";
}
}

View File

@ -20,6 +20,13 @@ while ($row = $result->fetch_assoc()) {
$iteminfo[] = new ItemClass($row);
}
echo "<table><tr>";
foreach ($iteminfo as $iinfo) {
echo "<td>";
$iinfo->printItemImage();
echo "</td>";
echo "<td>";
$iinfo->printItemStats();
echo "<td>";
}
echo "</tr></table>";