refactor
This commit is contained in:
+106
-235
@@ -5,16 +5,20 @@ namespace User;
|
||||
use Core\Config;
|
||||
use Core\Db;
|
||||
use Helper\Conversion;
|
||||
use Item\Data\Bonuses;
|
||||
use User;
|
||||
|
||||
class Stats
|
||||
{
|
||||
private User $u;
|
||||
private array $sysNames = [];
|
||||
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->u = $user;
|
||||
$this->sysNames = Db::getColumn('select sys_name from const_stats where is_bonus = true');
|
||||
$this->sysNames['hpAll'] = $this->sysNames['hpall'];
|
||||
$this->sysNames['mpAll'] = $this->sysNames['mpall'];
|
||||
unset($this->sysNames['hpall'], $this->sysNames['mpall']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,17 +119,6 @@ class Stats
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Присваиваем только разрешенные значения.
|
||||
*/
|
||||
private static function a(&$array, string $key, $value): void
|
||||
{
|
||||
if (!in_array($key, array_keys(Bonuses::getBonusSystemNames()))) {
|
||||
return;
|
||||
}
|
||||
$array[$key] = $value;
|
||||
}
|
||||
|
||||
public function getStats(int|array|null $uid = null, $i1 = 0, $res = 0, $reimg = false, $btl_cache = false): array
|
||||
{
|
||||
if (empty($uid) || $uid == $this->u->info['id'] && $res != 1) {
|
||||
@@ -141,30 +134,8 @@ class Stats
|
||||
return [];
|
||||
}
|
||||
|
||||
$st = [
|
||||
'maxves' => 0,
|
||||
'pzm' => 0,
|
||||
'yza' => 0,
|
||||
'yza1' => 0,
|
||||
'yza2' => 0,
|
||||
'yza3' => 0,
|
||||
'yza4' => 0,
|
||||
'yza5' => 0,
|
||||
'yza6' => 0,
|
||||
'yza7' => 0,
|
||||
'yzm' => 0,
|
||||
'yzm1' => 0,
|
||||
'yzm2' => 0,
|
||||
'yzm3' => 0,
|
||||
'yzm4' => 0,
|
||||
'yzm5' => 0,
|
||||
'yzm6' => 0,
|
||||
'yzm7' => 0,
|
||||
'yzma' => 0,
|
||||
'pbe' => 0,
|
||||
'os7' => 0,
|
||||
'' => 0,
|
||||
];
|
||||
$st = array_fill_keys($this->sysNames, 0);
|
||||
|
||||
$s_vi = [];
|
||||
$s_v = [];
|
||||
$u['clanpos'] = 0;
|
||||
@@ -229,7 +200,6 @@ class Stats
|
||||
item_id, inslot, useInBattle, btl_zd, iznosNOW, iznosMAX, magic_inci, name, items_users.id, img, `2h`
|
||||
from items_users left join items_main on items_main.id = item_id where inOdet != 0 and uid = ?', [$u['id']]);
|
||||
|
||||
$ia = Bonuses::getBonusSystemNames();
|
||||
$h = 0;
|
||||
$hnd1 = 0;
|
||||
$hnd2 = 0;
|
||||
@@ -266,20 +236,8 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
|
||||
} elseif ($wearedItem['inOdet'] == 14 && $wearedItem['type'] == 13) {
|
||||
$sht1 = 1;
|
||||
}
|
||||
$sts = explode('|', $wearedItem['data']);
|
||||
$i = 0;
|
||||
$sti = [];
|
||||
while ($i < count($sts)) {
|
||||
$ste = explode('=', $sts[$i]);
|
||||
if (isset($ste[1])) {
|
||||
if (!isset($sti[$ste[0]])) {
|
||||
$sti[$ste[0]] = 0;
|
||||
}
|
||||
$sti[$ste[0]] += intval($ste[1]);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
$sti = Conversion::dataStringToArray($wearedItem['data']);
|
||||
if ($wearedItem['inOdet'] <= 18 && $wearedItem['inOdet'] > 0) {
|
||||
$st['reting'] += 1;
|
||||
}
|
||||
@@ -436,24 +394,22 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
|
||||
$st['zona'] += $sti['zona'];
|
||||
}
|
||||
|
||||
|
||||
//Добавляем статы от данного предмета
|
||||
if (!isset($sti['restart_stats'])) {
|
||||
$i = 0;
|
||||
while ($i < count($ia)) {
|
||||
while ($i < count($this->sysNames)) {
|
||||
//Действует на (Действует на)
|
||||
if (isset($ia[$i]) && isset($sti['add_' . $ia[$i]])) {
|
||||
if ($ia[$i] != 'zmproc' && $ia[$i] != 'zaproc') {
|
||||
if (!isset($st[$ia[$i]])) {
|
||||
$st[$ia[$i]] = 0;
|
||||
}
|
||||
$st[$ia[$i]] += intval($sti['add_' . $ia[$i]]);
|
||||
if (isset($this->sysNames[$i]) && isset($sti['add_' . $this->sysNames[$i]])) {
|
||||
if (!isset($st[$this->sysNames[$i]])) {
|
||||
$st[$this->sysNames[$i]] = 0;
|
||||
}
|
||||
if ($this->sysNames[$i] != 'zmproc' && $this->sysNames[$i] != 'zaproc') {
|
||||
$st[$this->sysNames[$i]] += intval($sti['add_' . $this->sysNames[$i]]);
|
||||
} else {
|
||||
if (!isset($st[$ia[$i]])) {
|
||||
$st[$ia[$i]] = 0;
|
||||
}
|
||||
$st[$ia[$i]] = 100 - $st[$ia[$i]];
|
||||
$st[$ia[$i]] = $st[$ia[$i]] - $st[$ia[$i]] / 100 * intval($sti['add_' . $ia[$i]]);
|
||||
$st[$ia[$i]] = 100 - $st[$ia[$i]];
|
||||
$st[$this->sysNames[$i]] = 100 - $st[$this->sysNames[$i]];
|
||||
$st[$this->sysNames[$i]] = $st[$this->sysNames[$i]] - $st[$this->sysNames[$i]] / 100 * intval($sti['add_' . $this->sysNames[$i]]);
|
||||
$st[$this->sysNames[$i]] = 100 - $st[$this->sysNames[$i]];
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
@@ -461,15 +417,16 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
|
||||
} else {
|
||||
$reitm[] = $sti;
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
while ($i < count($ia)) {
|
||||
if (isset($ia[$i]) && isset($sti['sv_' . $ia[$i]])) {
|
||||
if (!isset($s_v[$ia[$i]])) {
|
||||
$s_v[$ia[$i]] = 0;
|
||||
$s_v['z'][$wearedItem['inOdet']][$ia[$i]] = 0;
|
||||
while ($i < count($this->sysNames)) {
|
||||
if (isset($this->sysNames[$i]) && isset($sti['sv_' . $this->sysNames[$i]])) {
|
||||
if (!isset($s_v[$this->sysNames[$i]])) {
|
||||
$s_v[$this->sysNames[$i]] = 0;
|
||||
$s_v['z'][$wearedItem['inOdet']][$this->sysNames[$i]] = 0;
|
||||
}
|
||||
$s_v[$ia[$i]] += intval($sti['sv_' . $ia[$i]]);
|
||||
$s_v['z'][$wearedItem['inOdet']][$ia[$i]] += intval($sti['sv_' . $ia[$i]]);
|
||||
$s_v[$this->sysNames[$i]] += intval($sti['sv_' . $this->sysNames[$i]]);
|
||||
$s_v['z'][$wearedItem['inOdet']][$this->sysNames[$i]] += intval($sti['sv_' . $this->sysNames[$i]]);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -598,49 +555,48 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
|
||||
if (isset($sts['add_silver'])) {
|
||||
$st['slvtm'] = $e['timeUse'] + $e['actionTime'];
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
while ($i < count($ia)) {
|
||||
if (isset($ia[$i])) {
|
||||
if (isset($sts['add_' . $ia[$i]])) {
|
||||
if (!isset($sti[$ia[$i]])) {
|
||||
$sti[$ia[$i]] = 0;
|
||||
while ($i < count($this->sysNames)) {
|
||||
if (isset($this->sysNames[$i])) {
|
||||
if (isset($sts['add_' . $this->sysNames[$i]])) {
|
||||
if (!isset($sti[$this->sysNames[$i]])) {
|
||||
$sti[$this->sysNames[$i]] = 0;
|
||||
}
|
||||
$sti[$ia[$i]] += intval($sts['add_' . $ia[$i]]);
|
||||
$sti[$this->sysNames[$i]] += intval($sts['add_' . $this->sysNames[$i]]);
|
||||
}
|
||||
if (isset($sts['add_' . $ia[$i]])) {
|
||||
if ($ia[$i] != 'zaproc' && $ia[$i] != 'zmproc') {
|
||||
if (!isset($st[$ia[$i]])) {
|
||||
$st[$ia[$i]] = 0;
|
||||
}
|
||||
$st[$ia[$i]] += intval($sts['add_' . $ia[$i]]);
|
||||
if (isset($sts['add_' . $this->sysNames[$i]])) {
|
||||
if (!isset($st[$this->sysNames[$i]])) {
|
||||
$st[$this->sysNames[$i]] = 0;
|
||||
}
|
||||
if ($this->sysNames[$i] != 'zaproc' && $this->sysNames[$i] != 'zmproc') {
|
||||
$st[$this->sysNames[$i]] += intval($sts['add_' . $this->sysNames[$i]]);
|
||||
} else {
|
||||
if (!isset($st[$ia[$i]])) {
|
||||
$st[$ia[$i]] = 0;
|
||||
}
|
||||
$st[$ia[$i]] = 100 - $st[$ia[$i]];
|
||||
$st[$ia[$i]] = $st[$ia[$i]] - $st[$ia[$i]] / 100 * intval(
|
||||
$sts['add_' . $ia[$i]]
|
||||
$st[$this->sysNames[$i]] = 100 - $st[$this->sysNames[$i]];
|
||||
$st[$this->sysNames[$i]] = $st[$this->sysNames[$i]] - $st[$this->sysNames[$i]] / 100 * intval(
|
||||
$sts['add_' . $this->sysNames[$i]]
|
||||
);
|
||||
$st[$ia[$i]] = 100 - $st[$ia[$i]];
|
||||
$st[$this->sysNames[$i]] = 100 - $st[$this->sysNames[$i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
while ($i < count($ia)) {
|
||||
if (isset($ia[$i])) {
|
||||
if (isset($sts['sv_' . $ia[$i]])) {
|
||||
if (!isset($s_vi[$ia[$i]])) {
|
||||
$s_vi[$ia[$i]] = 0;
|
||||
while ($i < count($this->sysNames)) {
|
||||
if (isset($this->sysNames[$i])) {
|
||||
if (isset($sts['sv_' . $this->sysNames[$i]])) {
|
||||
if (!isset($s_vi[$this->sysNames[$i]])) {
|
||||
$s_vi[$this->sysNames[$i]] = 0;
|
||||
}
|
||||
$s_vi[$ia[$i]] += intval($sts['sv_' . $ia[$i]]);
|
||||
$s_vi[$this->sysNames[$i]] += intval($sts['sv_' . $this->sysNames[$i]]);
|
||||
}
|
||||
if (isset($sts['sv_' . $ia[$i]])) {
|
||||
if (!isset($s_v[$ia[$i]])) {
|
||||
$s_v[$ia[$i]] = 0;
|
||||
if (isset($sts['sv_' . $this->sysNames[$i]])) {
|
||||
if (!isset($s_v[$this->sysNames[$i]])) {
|
||||
$s_v[$this->sysNames[$i]] = 0;
|
||||
}
|
||||
$s_v[$ia[$i]] += intval($sts['sv_' . $ia[$i]]);
|
||||
$s_v[$this->sysNames[$i]] += intval($sts['sv_' . $this->sysNames[$i]]);
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
@@ -792,43 +748,45 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
|
||||
$st['set_pog2'][$ctt]['m'] = $sts['add_pog2mp'];
|
||||
unset($ctt);
|
||||
}
|
||||
$i = 0;
|
||||
while ($i < count($ia)) {
|
||||
if (isset($ia[$i]) && isset($sts['add_' . $ia[$i]])) {
|
||||
if ($ia[$i] != 'zaproc' && $ia[$i] != 'zmproc') {
|
||||
if (!isset($sti[$ia[$i]])) {
|
||||
$sti[$ia[$i]] = 0;
|
||||
}
|
||||
$sti[$ia[$i]] += intval($sts['add_' . $ia[$i]]);
|
||||
if (!isset($st[$ia[$i]])) {
|
||||
$st[$ia[$i]] = 0;
|
||||
}
|
||||
$st[$ia[$i]] += intval($sts['add_' . $ia[$i]]);
|
||||
} else {
|
||||
$sti[$ia[$i]] = 100 - $sti[$ia[$i]];
|
||||
$sti[$ia[$i]] = $sti[$ia[$i]] - $sti[$ia[$i]] / 100 * intval(
|
||||
$sts['add_' . $ia[$i]]
|
||||
);
|
||||
$sti[$ia[$i]] = 100 - $sti[$ia[$i]];
|
||||
|
||||
$st[$ia[$i]] = 100 - $st[$ia[$i]];
|
||||
$st[$ia[$i]] = $st[$ia[$i]] - $st[$ia[$i]] / 100 * intval($sts['add_' . $ia[$i]]);
|
||||
$st[$ia[$i]] = 100 - $st[$ia[$i]];
|
||||
$i = 0;
|
||||
while ($i < count($this->sysNames)) {
|
||||
if (isset($this->sysNames[$i]) && isset($sts['add_' . $this->sysNames[$i]])) {
|
||||
if ($this->sysNames[$i] != 'zaproc' && $this->sysNames[$i] != 'zmproc') {
|
||||
if (!isset($sti[$this->sysNames[$i]])) {
|
||||
$sti[$this->sysNames[$i]] = 0;
|
||||
}
|
||||
$sti[$this->sysNames[$i]] += intval($sts['add_' . $this->sysNames[$i]]);
|
||||
if (!isset($st[$this->sysNames[$i]])) {
|
||||
$st[$this->sysNames[$i]] = 0;
|
||||
}
|
||||
$st[$this->sysNames[$i]] += intval($sts['add_' . $this->sysNames[$i]]);
|
||||
} else {
|
||||
$sti[$this->sysNames[$i]] = 100 - $sti[$this->sysNames[$i]];
|
||||
$sti[$this->sysNames[$i]] = $sti[$this->sysNames[$i]] - $sti[$this->sysNames[$i]] / 100 * intval(
|
||||
$sts['add_' . $this->sysNames[$i]]
|
||||
);
|
||||
$sti[$this->sysNames[$i]] = 100 - $sti[$this->sysNames[$i]];
|
||||
|
||||
$st[$this->sysNames[$i]] = 100 - $st[$this->sysNames[$i]];
|
||||
$st[$this->sysNames[$i]] = $st[$this->sysNames[$i]] - $st[$this->sysNames[$i]] / 100 * intval($sts['add_' . $this->sysNames[$i]]);
|
||||
$st[$this->sysNames[$i]] = 100 - $st[$this->sysNames[$i]];
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
while ($i < count($ia)) {
|
||||
if (isset($ia[$i]) && isset($sts['add_' . $ia[$i]])) {
|
||||
if (!isset($s_vi[$ia[$i]])) {
|
||||
$s_vi[$ia[$i]] = 0;
|
||||
while ($i < count($this->sysNames)) {
|
||||
if (isset($this->sysNames[$i]) && isset($sts['add_' . $this->sysNames[$i]])) {
|
||||
if (!isset($s_vi[$this->sysNames[$i]])) {
|
||||
$s_vi[$this->sysNames[$i]] = 0;
|
||||
}
|
||||
$s_vi[$ia[$i]] += intval($sts['sv_' . $ia[$i]]);
|
||||
if (!isset($s_v[$ia[$i]])) {
|
||||
$s_v[$ia[$i]] = 0;
|
||||
$s_vi[$this->sysNames[$i]] += intval($sts['sv_' . $this->sysNames[$i]]);
|
||||
if (!isset($s_v[$this->sysNames[$i]])) {
|
||||
$s_v[$this->sysNames[$i]] = 0;
|
||||
}
|
||||
$s_v[$ia[$i]] += intval($sts['sv_' . $ia[$i]]);
|
||||
$s_v[$this->sysNames[$i]] += intval($sts['sv_' . $this->sysNames[$i]]);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -842,90 +800,29 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
|
||||
|
||||
|
||||
//Характеристики от статов
|
||||
if (!isset($st['hpAll'])) {
|
||||
$st['hpAll'] = 0;
|
||||
}
|
||||
$st['hpAll'] += $st['s4'] * 5;
|
||||
|
||||
if (!isset($st['mpAll'])) {
|
||||
$st['mpAll'] = 0;
|
||||
}
|
||||
$st['mpAll'] += $st['s6'] * 10;
|
||||
|
||||
//Турнир
|
||||
if (!isset($st['m1'])) {
|
||||
$st['m1'] = 0;
|
||||
}
|
||||
$st['m1'] += $st['s3'] * 5;
|
||||
|
||||
|
||||
// мф.анти-крит = 2.5
|
||||
if (!isset($st['m2'])) {
|
||||
$st['m2'] = 0;
|
||||
}
|
||||
$st['m2'] += $st['s3'] * 5;
|
||||
|
||||
// мф.уворот = 2.5
|
||||
if (!isset($st['m4'])) {
|
||||
$st['m4'] = 0;
|
||||
}
|
||||
$st['m4'] += $st['s2'] * 5;
|
||||
|
||||
// мф.анти-уворот = 2.5
|
||||
if (!isset($st['m5'])) {
|
||||
$st['m5'] = 0;
|
||||
}
|
||||
$st['m5'] += $st['s2'] * 5;
|
||||
|
||||
if (!isset($st['za'])) {
|
||||
$st['za'] = 0;
|
||||
}
|
||||
$st['za'] += $st['s4'] * 1.0;
|
||||
|
||||
if (!isset($st['zm'])) {
|
||||
$st['zm'] = 0;
|
||||
}
|
||||
$st['zm'] += $st['s4'] * 0.0;
|
||||
|
||||
if (!isset($st['zaproc'])) { //Тут зм 'zaproc'=>'Защита от урона (%)','zmproc'=>'Защита от магии стихий (%)
|
||||
$st['zaproc'] = 0;
|
||||
}
|
||||
$st['zaproc'] += round($st['s5'] * 0);
|
||||
|
||||
if (!isset($st['m19'])) {
|
||||
$st['m19'] = 0;
|
||||
}
|
||||
$st['m19'] += round($st['s3'] * 0.03);
|
||||
|
||||
//Мощности
|
||||
//Мощность против "Мощность крит. урона". Гамс
|
||||
if (!isset($st['antm3'])) {
|
||||
$st['antm3'] = 0;
|
||||
}
|
||||
$st['antm3'] += $st['s5'] * 0.5;
|
||||
|
||||
|
||||
if (!isset($st['m10'])) {
|
||||
$st['m10'] = 0;
|
||||
}
|
||||
$st['m10'] += 0;
|
||||
|
||||
if (!isset($st['m11'])) {
|
||||
$st['m11'] = 0;
|
||||
}
|
||||
$st['m11'] += 0;
|
||||
|
||||
if (!isset($st['m11a'])) {
|
||||
$st['m11a'] = 0;
|
||||
}
|
||||
$st['m11a'] += 0;
|
||||
|
||||
|
||||
if (!isset($st['m8'])) {
|
||||
$st['m8'] = 0;
|
||||
}
|
||||
$st['m8'] += 0;
|
||||
|
||||
//Бонусы комплектов
|
||||
$i = 0;
|
||||
if (!empty($coms['new']) && is_array($coms['new'])) {
|
||||
@@ -942,9 +839,9 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
|
||||
//добавляем действия комплекта
|
||||
$ij = 0;
|
||||
$sti = Conversion::dataStringToArray($com['data']);
|
||||
while ($ij < count($ia)) {
|
||||
if (isset($ia[$ij]) && isset($sti[$ia[$ij]])) {
|
||||
$st[$ia[$ij]] += $sti[$ia[$ij]];
|
||||
while ($ij < count($this->sysNames)) {
|
||||
if (isset($this->sysNames[$ij]) && isset($sti[$this->sysNames[$ij]])) {
|
||||
$st[$this->sysNames[$ij]] += $sti[$this->sysNames[$ij]];
|
||||
}
|
||||
$ij++;
|
||||
}
|
||||
@@ -1014,20 +911,11 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
|
||||
if ($sht1 == 1) {
|
||||
$st['zonb']++;
|
||||
}/* Владения */
|
||||
|
||||
//mib1-mib4, mab1-mab4 armor??
|
||||
|
||||
$i = 1;
|
||||
while ($i <= 7) {
|
||||
if (!isset($st['pm' . $i])) {
|
||||
$st['pm' . $i] = 0;
|
||||
}
|
||||
if (!isset($st['a' . $i])) {
|
||||
$st['a' . $i] = 0;
|
||||
}
|
||||
if (!isset($st['mg' . $i])) {
|
||||
$st['mg' . $i] = 0;
|
||||
}
|
||||
if (!isset($st['zm' . $i])) {
|
||||
$st['zm' . $i] = 0;
|
||||
}
|
||||
if (isset($st['s5'])) {
|
||||
$st['pm' . $i] += $st['s5'] * 0.5;
|
||||
}
|
||||
@@ -1047,26 +935,6 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
|
||||
$st['zm' . $i] += $st['zma'];
|
||||
}
|
||||
if ($i <= 4) {
|
||||
if (!isset($st['mib' . $i])) {
|
||||
$st['mib' . $i] = 0;
|
||||
}
|
||||
if (!isset($st['mab' . $i])) {
|
||||
$st['mab' . $i] = 0;
|
||||
}
|
||||
if (!isset($st['mg' . $i])) {
|
||||
$st['mg' . $i] = 0;
|
||||
}
|
||||
if (!isset($st['pm' . $i])) {
|
||||
$st['pm' . $i] = 0;
|
||||
}
|
||||
if (!isset($st['pa' . $i])) {
|
||||
$st['pa' . $i] = 0;
|
||||
}
|
||||
if (!isset($st['za' . $i])) {
|
||||
$st['za' . $i] = 0;
|
||||
}
|
||||
$st['mib' . $i] += 0;
|
||||
$st['mab' . $i] += 0;
|
||||
if (isset($st['mall'])) {
|
||||
$st['mg' . $i] += $st['mall'];
|
||||
}
|
||||
@@ -1081,7 +949,9 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}//Уязвимость оружие и магиям
|
||||
}
|
||||
|
||||
//Уязвимость оружие и магиям
|
||||
$i = 1;
|
||||
while ($i <= 7) {
|
||||
$st['yzm' . $i] += $st['yzma'];
|
||||
@@ -1127,7 +997,9 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
|
||||
$st['mpNow'] = 0;
|
||||
} elseif ($st['mpNow'] > $st['mpAll']) {
|
||||
$st['mpNow'] = $st['mpAll'];
|
||||
}//зоны блока и удара
|
||||
}
|
||||
|
||||
//зоны блока и удара
|
||||
if ($st['zona'] < 1) {
|
||||
$st['zona'] = 1;
|
||||
}
|
||||
@@ -1140,6 +1012,7 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
|
||||
if ($st['zonb'] > 3) {
|
||||
$st['zonb'] = 3;
|
||||
}
|
||||
|
||||
$st['ozash'] = $oza;
|
||||
$st['ozmsh'] = $ozm;
|
||||
$st['weapon1'] = $hnd1;
|
||||
@@ -1154,18 +1027,14 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
|
||||
$st['y'] = $u['y'];
|
||||
$st['s'] = $u['s'];
|
||||
|
||||
$st['reting'] = 1 + ceil($st['reting']);
|
||||
|
||||
|
||||
$this->addDungeonsBonuses($u['id'], $st);
|
||||
|
||||
|
||||
//Добавочный подьем для игроков
|
||||
$st['maxves'] += 500;
|
||||
$st['maxves'] += 100;
|
||||
|
||||
if ($u['admin'] > 0) { // ускоренная регенерация и пробег по подземелью
|
||||
$st['speed_dungeon'] = 1000;
|
||||
$st['speedhp'] = 1000;
|
||||
$st['speed_dungeon'] = 500;
|
||||
$st['speedhp'] = 500;
|
||||
if ($u['battle']) {
|
||||
Db::sql("update stats set
|
||||
tactic1 = tactic2 = tactic3 = tactic4 = tactic5 = tactic6 = tactic7 = 25,
|
||||
@@ -1176,7 +1045,9 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
|
||||
|
||||
if (date('H') >= 22 && date('H') <= 10) {
|
||||
$st['exp'] += 25;
|
||||
}//Сохраняем рейтинг игрока
|
||||
}
|
||||
|
||||
//Сохраняем рейтинг игрока
|
||||
$st['reting'] = floor($st['reting']);
|
||||
|
||||
if (isset($st['btl_cof'], $st['prckr']) && $st['btl_cof'] != $st['prckr']) {
|
||||
@@ -1227,7 +1098,7 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
|
||||
$sts = Conversion::dataStringToArray($data);
|
||||
foreach ($sts as $paramName => $value) {
|
||||
//todo убедиться, что не могут прилететь параметры, которых нет в словарей бонусов предметов
|
||||
if (!str_contains(implode(',', Bonuses::getBonusSystemNames()), 'add_' . $paramName)) { // есть ли параметр в разрешенных?
|
||||
if (!str_contains(implode(',', $this->sysNames), 'add_' . $paramName)) { // есть ли параметр в разрешенных?
|
||||
continue;
|
||||
}
|
||||
if (empty($st['add_' . $paramName])) {
|
||||
|
||||
Reference in New Issue
Block a user