diff options
Diffstat (limited to 'inc/Item.inc')
-rw-r--r-- | inc/Item.inc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/inc/Item.inc b/inc/Item.inc index 907872e..f01b709 100644 --- a/inc/Item.inc +++ b/inc/Item.inc @@ -1,16 +1,29 @@ <?php +require_once("perso.inc"); + class Item { public $name = ""; public $cost = 0; public $icon = ""; public $desc = ""; + public $feat = array(); - function __construct($name, $cost, $icon, $desc) { + function __construct($name, $cost, $icon, $desc, $feat) { $this->name = $name; $this->cost = $cost; $this->icon = $icon; $this->desc = $desc; + $this->feat = $feat; + } + + function consume() { + foreach($this->feat as $k => $v) { + switch($k) { + case "hp": increasePerso("hp", +$v); break; + case "power": break; + } + } } function addToXML($root, $count) { |