2019-01-11 21:57:15 +00:00
|
|
|
|
<?php
|
2020-10-28 20:21:08 +00:00
|
|
|
|
namespace Battles;
|
2019-01-11 21:57:15 +00:00
|
|
|
|
class InventoryItem extends Item
|
|
|
|
|
{
|
2019-01-12 09:47:23 +00:00
|
|
|
|
private $present;
|
|
|
|
|
|
|
|
|
|
public function __construct($row)
|
|
|
|
|
{
|
|
|
|
|
parent::__construct($row);
|
2020-07-22 09:55:27 +00:00
|
|
|
|
if (isset($row['present'])) {
|
|
|
|
|
$this->present = $row['present'];
|
|
|
|
|
}
|
2019-01-12 09:47:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-01-11 21:57:15 +00:00
|
|
|
|
public function printInfo()
|
|
|
|
|
{
|
2020-07-21 15:03:46 +00:00
|
|
|
|
parent::printAllInfo();
|
|
|
|
|
if ($this->present) {
|
|
|
|
|
echo "<p style='color: maroon; font-style: italic'>Это подарок от {$this->present}. Вы не можете передать его кому-либо ещё.</p>";
|
|
|
|
|
}
|
2019-01-11 21:57:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-01-11 22:18:18 +00:00
|
|
|
|
public function printImage()
|
|
|
|
|
{
|
2020-07-22 14:04:15 +00:00
|
|
|
|
if (in_array($this->item_type, range(1,12))) {
|
2020-07-22 10:04:17 +00:00
|
|
|
|
echo "<a href=/main.php?edit=1&dress={$this->item_id} title='Надеть'>";
|
2019-01-11 22:30:12 +00:00
|
|
|
|
parent::printImage();
|
|
|
|
|
echo "</a>";
|
2020-07-21 15:03:46 +00:00
|
|
|
|
} else {
|
|
|
|
|
parent::printImage();
|
2019-01-11 22:30:12 +00:00
|
|
|
|
}
|
2019-01-11 22:18:18 +00:00
|
|
|
|
}
|
2021-01-28 23:58:07 +00:00
|
|
|
|
|
|
|
|
|
public function printControls() {}
|
2019-01-11 21:57:15 +00:00
|
|
|
|
}
|