This commit is contained in:
Igor Barkov (iwork)
2020-07-22 17:04:15 +03:00
parent f0bf7069de
commit 35031f1296
5 changed files with 135 additions and 135 deletions
+47 -33
View File
@@ -2,30 +2,44 @@
abstract class Item
{
public $item_id;
public $name;
public $item_type;
public $durability;
public $price;
public $need_strength;
public $need_dexterity;
public $need_intuition;
public $need_endurance;
public $need_intelligence;
public $need_wisdom;
public $add_strength;
public $add_dexterity;
public $add_intuition;
public $add_endurance;
public $add_intelligence;
public $add_wisdom;
public $add_accuracy;
public $add_evasion;
public $add_criticals;
public $add_min_physical_damage;
public $add_max_physical_damage;
public $weight;
public $image;
protected $item_id;
protected $name;
protected $item_type;
protected $durability;
protected $price;
protected $need_strength;
protected $need_dexterity;
protected $need_intuition;
protected $need_endurance;
protected $need_intelligence;
protected $need_wisdom;
protected $add_strength;
protected $add_dexterity;
protected $add_intuition;
protected $add_endurance;
protected $add_intelligence;
protected $add_wisdom;
protected $add_accuracy;
protected $add_evasion;
protected $add_criticals;
protected $add_min_physical_damage;
protected $add_max_physical_damage;
protected $weight;
protected $image;
public const ITEM_TYPES_ALLOWED_IN_SLOTS = [1,2,3,4,5,6,7,8,9,10,11,12];
public const ITEM_TYPE_HELMET = 1;
public const ITEM_TYPE_ARMOR = 2;
const ITEM_TYPE_LEGS = 3;
const ITEM_TYPE_BOOTS = 4;
const ITEM_TYPE_GLOVES = 5;
const ITEM_TYPE_WEAPON = 6;
const ITEM_TYPE_SHIELD = 7;
const ITEM_TYPE_BELT = 8;
public const ITEM_TYPE_RING = 9;
const ITEM_TYPE_AMULET = 10;
const ITEM_TYPE_CONSUMABLE = 20;
const ITEM_TYPE_OTHER = 50;
const ITEM_TYPE_TRASH = 100;
/**
* Item constructor.
@@ -41,28 +55,28 @@ abstract class Item
}
switch ($this->item_type) {
case 1:
case self::ITEM_TYPE_HELMET:
$this->typename = 'Шлем';
break;
case 2:
case self::ITEM_TYPE_ARMOR:
$this->typename = 'Броня';
break;
case 3:
case self::ITEM_TYPE_LEGS:
$this->typename = 'Поножи';
break;
case 4:
case self::ITEM_TYPE_BOOTS:
$this->typename = 'Сапоги';
break;
case 5:
case self::ITEM_TYPE_GLOVES:
$this->typename = 'Перчатки';
break;
case 6:
case self::ITEM_TYPE_WEAPON:
$this->typename = 'Оружие';
break;
case 7:
case self::ITEM_TYPE_SHIELD:
$this->typename = 'Щит';
break;
case 8:
case self::ITEM_TYPE_BELT:
$this->typename = 'Пояс';
break;
case 9:
@@ -83,7 +97,7 @@ abstract class Item
public function printImage()
{
echo <<<IMG
<img src="/i/sh/{$this->image}" class="item-wrap-normal">
<img src="/i/sh/{$this->image}" class="item-wrap-normal" alt="">
IMG;
}