39 lines
1005 B
PHP
39 lines
1005 B
PHP
<?php
|
||
namespace Battles;
|
||
class InventoryItem extends Item
|
||
{
|
||
private $present;
|
||
|
||
public function __construct($row)
|
||
{
|
||
parent::__construct($row);
|
||
if (isset($row['present'])) {
|
||
$this->present = $row['present'];
|
||
}
|
||
}
|
||
|
||
public function printInfo()
|
||
{
|
||
parent::printAllInfo();
|
||
if ($this->present) {
|
||
echo "<p style='color: maroon; font-style: italic'>Это подарок от {$this->present}. Вы не можете передать его кому-либо ещё.</p>";
|
||
}
|
||
}
|
||
|
||
public function printImage()
|
||
{
|
||
if (in_array($this->item_type, range(1, 12))) {
|
||
echo <<<HTML
|
||
<a href=/main.php?edit=1&dress={$this->item_id} title='Надеть'>
|
||
<img src="/i/sh/{$this->image}" class="item-wrap-normal" alt="">
|
||
</a>
|
||
HTML;
|
||
} else {
|
||
echo <<<IMG
|
||
<img src="/i/sh/{$this->image}" class="item-wrap-normal" alt="">
|
||
IMG;
|
||
}
|
||
}
|
||
|
||
public function printControls() {}
|
||
} |