From 0e8ae215ed692e5afd6876681353e215783ae164 Mon Sep 17 00:00:00 2001 From: "Igor Barkov [iwork]" Date: Mon, 14 Jan 2019 17:54:12 +0200 Subject: [PATCH] make class greater --- classes/Item.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/classes/Item.php b/classes/Item.php index 2c3605e..f550338 100644 --- a/classes/Item.php +++ b/classes/Item.php @@ -9,12 +9,11 @@ abstract class Item public $maxdur; public $img; - public $cost; public $artefact; - public $type; # эти. что есть что нет... + public $type; public $nlevel; public $nsila; @@ -65,7 +64,6 @@ abstract class Item public $mfuvorot; public $mfauvorot; - public $dategoden; public $goden; public $needident; @@ -225,16 +223,19 @@ IMG; protected function printRequirements() { - if ($this->nlevel > 0) echo "
Требуется уровень" . $this->wrap($this->nlevel); - if ($this->nnoj > 0) echo "
Требуется владение колющим оружиием" . $this->wrap($this->nnoj); - if ($this->ndubina > 0) echo "
Требуется владение дробящим оружием" . $this->wrap($this->ndubina); - if ($this->ntopor > 0) echo "
Требуется владение рубящим оружием" . $this->wrap($this->ntopor); - if ($this->nmech > 0) echo "
Требуется владение режущим оружием" . $this->wrap($this->nmech); - if ($this->nsila > 0) echo "
Требуется сила" . $this->wrap($this->nsila); - if ($this->nlovk > 0) echo "
Требуется ловкость" . $this->wrap($this->nlovk); - if ($this->ninta > 0) echo "
Требуется интуиция" . $this->wrap($this->ninta); - if ($this->nvinos > 0) echo "
Требуется выносливость" . $this->wrap($this->nvinos); - if ($this->nintel > 0) echo "
Требуется интеллект" . $this->wrap($this->nintel); + if (!empty($this->$modifier)) { + echo "
Требования:"; + if ($this->nlevel > 0) echo "
Требуется уровень" . $this->wrap($this->nlevel); + if ($this->nnoj > 0) echo "
Требуется владение колющим оружиием" . $this->wrap($this->nnoj); + if ($this->ndubina > 0) echo "
Требуется владение дробящим оружием" . $this->wrap($this->ndubina); + if ($this->ntopor > 0) echo "
Требуется владение рубящим оружием" . $this->wrap($this->ntopor); + if ($this->nmech > 0) echo "
Требуется владение режущим оружием" . $this->wrap($this->nmech); + if ($this->nsila > 0) echo "
Требуется сила" . $this->wrap($this->nsila); + if ($this->nlovk > 0) echo "
Требуется ловкость" . $this->wrap($this->nlovk); + if ($this->ninta > 0) echo "
Требуется интуиция" . $this->wrap($this->ninta); + if ($this->nvinos > 0) echo "
Требуется выносливость" . $this->wrap($this->nvinos); + if ($this->nintel > 0) echo "
Требуется интеллект" . $this->wrap($this->nintel); + } } protected function printBonuses()