Новые требования php7.4 и мелкие баги отрисовки.

This commit is contained in:
lopar
2021-08-22 21:51:00 +03:00
parent 5714ab83f3
commit 326d93f259
3 changed files with 38 additions and 45 deletions
+33 -31
View File
@@ -1,31 +1,33 @@
<?php
namespace Battles;
class Item
{
protected $item_id;
protected $name;
protected $item_type;
protected $durability;
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];
protected int $item_id;
protected string $name = '';
protected int $item_type = self::ITEM_TYPE_TRASH;
protected int $durability = 0;
protected int $need_strength = 0;
protected int $need_dexterity = 0;
protected int $need_intuition = 0;
protected int $need_endurance = 0;
protected int $need_intelligence = 0;
protected int $need_wisdom = 0;
protected int $add_strength = 0;
protected int $add_dexterity = 0;
protected int $add_intuition = 0;
protected int $add_endurance = 0;
protected int $add_intelligence = 0;
protected int $add_wisdom = 0;
protected int $add_accuracy = 0;
protected int $add_evasion = 0;
protected int $add_criticals = 0;
protected int $add_min_physical_damage = 0;
protected int $add_max_physical_damage = 0;
protected int $weight = 0;
protected string $image = '';
protected int $item_cost = 0;
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;
public const ITEM_TYPE_LEGS = 3;
@@ -39,7 +41,7 @@ class Item
public const ITEM_TYPE_CONSUMABLE = 20;
public const ITEM_TYPE_OTHER = 50;
public const ITEM_TYPE_TRASH = 100;
private $typename;
private string $typename;
/**
* Item constructor.
@@ -101,7 +103,7 @@ class Item
}
}
protected function wrap(int $number):string
protected function wrap(int $number): string
{
if ($number > 0) {
return ": <b>" . $number . "</b>";
@@ -114,11 +116,11 @@ class Item
{
$needsLines = [
"сила" => $this->need_strength,
"ловкость" =>$this->need_dexterity,
"интуиция" =>$this->need_intuition,
"выносливость" =>$this->need_endurance,
"интеллект" =>$this->need_intelligence,
"мудрость" =>$this->need_wisdom,
"ловкость" => $this->need_dexterity,
"интуиция" => $this->need_intuition,
"выносливость" => $this->need_endurance,
"интеллект" => $this->need_intelligence,
"мудрость" => $this->need_wisdom,
];
$addsLines = [
"Сила" => $this->add_strength,