WIP: removing User::class public array $items for Stat()::class.

This commit is contained in:
2024-01-08 03:33:20 +02:00
parent 4a7535d67d
commit bd8761f240
22 changed files with 812 additions and 971 deletions
+12 -13
View File
@@ -4,6 +4,7 @@ use Core\Db;
use DarksLight2\Training\TrainingManager;
use Helper\Conversion;
use Helper\Math;
use Model\Constant\Stat;
use User\Effects;
/*
@@ -37,11 +38,12 @@ class Priems
self::AIR => '#0af',
];
public function __construct()
public function __construct(private readonly Stat $statnames = new Stat())
{
global $btl;
$this->btl = $btl;
$this->u = User::start();
$this->statnames->getRequirement();
}
/** Набив Статики
@@ -1433,9 +1435,8 @@ class Priems
}
$x = 0;
$t = $this->u->items['tr'];
while ($x < count($t)) {
$n = $t[$x];
while ($x < count($this->statnames->sysRequirementNames)) {
$n = $this->statnames->sysRequirementNames[$x];
if (isset($tr['tr_' . $n])) {
if ($n == 'lvl') {
if ($tr['tr_' . $n] > $this->u->info['level']) {
@@ -2212,24 +2213,22 @@ class Priems
public function priemInfo($pl, $t, $id = false)
{
global $u, $c, $code, $btl;
global $btl;
$pz = explode('|', $this->u->info['priems_z']);
$tr = Conversion::dataStringToArray($pl['tr']);
$trs = '';
$x = 0;
$notr = 0;
$t = $this->u->items['tr'];
while ($x < count($t)) {
$n = $t[$x];
while ($x < count($this->statnames->sysRequirementNames)) {
$n = $this->statnames->sysRequirementNames[$x];
if (isset($tr['tr_' . $n])) {
if ($tr['tr_' . $n] > $this->u->stats[$n]) {
$trs .= '<font color=red>';
$notr++;
$trs .= '<span style="color: red">';
}
$trs .= '<br>• ';
$trs .= $this->u->is[$n] . ': ' . $tr['tr_' . $n];
$trs .= $this->statnames->requirementNames[$n] . ': ' . $tr['tr_' . $n];
if ($tr['tr_' . $n] > $this->u->stats[$n]) {
$trs .= '</font>';
$trs .= '</span>';
}
}
$x++;