make class greater

This commit is contained in:
Igor Barkov [iwork] 2019-01-14 16:31:42 +02:00
parent fa74a5a5b7
commit 77081db3a7

View File

@ -2,14 +2,19 @@
abstract class Item abstract class Item
{ {
public $id;
public $name; public $name;
public $massa;
public $nalign; public $nalign;
public $massa;
public $duration;
public $maxdur; public $maxdur;
public $img; public $img;
public $count;
public $razdel;
public $cost;
public $ecost;
public $type; # эти. что есть что нет... public $type; # эти. что есть что нет...
private $typename;
public $nlevel; public $nlevel;
public $nsila; public $nsila;
@ -60,9 +65,23 @@ abstract class Item
public $mfuvorot; public $mfuvorot;
public $mfauvorot; public $mfauvorot;
public $shshop;
public $dategoden;
public $goden;
public $needident;
public $magic; public $magic;
public $magic_name; public $magic_name;
public $magic_img; public $magic_img;
public $letter;
public $isrep;
public $gmp;
public $gmeshok;
public $zeton;
public $encicl;
public $onlyone;
public $koll;
public $prof;
public $prof1;
/** /**
* Item constructor. * Item constructor.
@ -71,10 +90,10 @@ abstract class Item
*/ */
public function __construct($row) public function __construct($row)
{ {
foreach ($this as $key=>$value) { foreach ($this as $key => $value) {
if (!empty($key)) {
$this->$key = $row[$key]; $this->$key = $row[$key];
}
} }
// ТА ЛААААДНО?! // ТА ЛААААДНО?!
@ -246,11 +265,11 @@ IMG;
protected function printMagic() protected function printMagic()
{ {
if ($this->magic) { if ($this->magic AND $this->type != 12) {
echo "<br>Магические свойства:"; echo "<br>Магические свойства:";
if ($this->magic_name) echo "<br><i style='color: dimgray;'>{$this->magic_name}</i>"; if ($this->magic_name) echo "<br><i style='color: dimgray;'>{$this->magic_name}</i>";
else echo "<br><i style='color: dimgray;'>Неопознанная магия</i>"; else echo "<br><i style='color: dimgray;'>Неопознанная магия</i>";
if ($this->magic_img) echo <<<IMG if ($this->magic_img AND $this->type != 50) echo <<<IMG
<br><img src="//{$_SERVER['SERVER_NAME']}/i/sh/{$this->magic_img}" class="item-wrap-normal"> <br><img src="//{$_SERVER['SERVER_NAME']}/i/sh/{$this->magic_img}" class="item-wrap-normal">
IMG; IMG;
} }