refactor
This commit is contained in:
+198
-177
@@ -462,6 +462,7 @@ class Battle
|
||||
$st = $this->stats[$this->uids[$id]];
|
||||
$itm = $this->stats[$this->uids[$id]]['items'];
|
||||
$eff = $this->stats[$this->uids[$id]]['effects'];
|
||||
|
||||
$i = 0;
|
||||
$img = Config::img();
|
||||
|
||||
@@ -470,171 +471,175 @@ class Battle
|
||||
$armor3 = '<br>Броня пояса: ';
|
||||
$armor4 = '<br>Броня ног: ';
|
||||
|
||||
if ($u->info['seff'] < 1) {
|
||||
# Передаётся в js, переносы строк всё ломают!
|
||||
$ef = <<<HTML
|
||||
if (empty($eff)) {
|
||||
$ef = '';
|
||||
} else {
|
||||
if ($u->info['seff'] < 1) {
|
||||
# Передаётся в js, переносы строк всё ломают!
|
||||
$ef = <<<HTML
|
||||
<div class="pimg" pog="0" col="0" stl="0" stt="Свернуть"><img src="$img/i/eff/effs_hide.gif" alt="" onclick="top.useMagicBattle('Свернуть',7777,'effs_show.gif',1,2);" onmouseover="top.hi(this,'<strong>Свернуть</strong>',event,3,1,1,1);" onmouseout="top.hic();" onmousedown="top.hic();"></div>
|
||||
HTML;
|
||||
|
||||
while ($i != -1) {
|
||||
$nseef = 0;
|
||||
if (
|
||||
$this->users[$this->uids[$ur['id']]]['id'] != $u->info['id'] &&
|
||||
$ur['id'] != 0 && $this->stats[$this->uids[$ur['id']]]['seeAllEff'] != 1
|
||||
) {
|
||||
$nseef = 1;
|
||||
if (isset($eff[$i]['v1']) && $eff[$i]['v1'] == 'priem') {
|
||||
$eff[$i]['priem'] = Db::getRow('select * from priems where id = ?', [$eff[$i]['v2']]);
|
||||
while ($i != -1) {
|
||||
$nseef = 0;
|
||||
if (
|
||||
$this->users[$this->uids[$ur['id']]]['id'] != $u->info['id'] &&
|
||||
$ur['id'] != 0 && $this->stats[$this->uids[$ur['id']]]['seeAllEff'] != 1
|
||||
) {
|
||||
$nseef = 1;
|
||||
if (isset($eff[$i]['v1']) && $eff[$i]['v1'] == 'priem') {
|
||||
$eff[$i]['priem'] = Db::getRow('select * from priems where id = ?', [$eff[$i]['v2']]);
|
||||
|
||||
}
|
||||
if (isset($eff[$i]['priem']['id']) && $eff[$i]['priem']['neg'] == 1) {
|
||||
$nseef = 0;
|
||||
}
|
||||
}
|
||||
if (isset($eff[$i]['priem']['id']) && $eff[$i]['priem']['neg'] == 1) {
|
||||
$nseef = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($eff[$i]) && $eff[$i] != 'delete') {
|
||||
if ($nseef == 0) {
|
||||
$ei = '<strong><u>' . $eff[$i]['name'] . '</u></strong>';
|
||||
if ($eff[$i]['x'] > 1) {
|
||||
$ei .= ' x' . $eff[$i]['x'] . ' ';
|
||||
}
|
||||
|
||||
$ei .= match ($eff[$i]['type1']) {
|
||||
1, 2, 3, 4, 5, 6 => ' (Эликсир)',
|
||||
7, 8, 9, 10, 16 => ' (Заклятие)',
|
||||
14 => ' (Прием)',
|
||||
15 => ' (Изучение)',
|
||||
17 => ' (Проклятие)',
|
||||
18, 19 => ' (Травма)',
|
||||
20 => ' (Пристрастие)',
|
||||
22 => ' (Ожидание)',
|
||||
default => ' (Эффект)'
|
||||
};
|
||||
|
||||
$ei .= '<br>';
|
||||
|
||||
$time_still = ($eff[$i]['timeUse'] + ($eff[$i]['timeAce'] - $eff[$i]['timeUse']) + $eff[$i]['actionTime']);
|
||||
if ($eff[$i]['timeAce'] == 0) {
|
||||
$time_still += $eff[$i]['timeUse'];
|
||||
}
|
||||
$time_still -= time();
|
||||
if ($eff[$i]['bp'] == 0 && $eff[$i]['timeUse'] != 77) {
|
||||
if ($eff[$i]['type1'] != 13) {
|
||||
$ei .= 'Осталось: ' . Conversion::secondsToTimeout($time_still);
|
||||
if (isset($eff[$i]) && $eff[$i] != 'delete') {
|
||||
if ($nseef == 0) {
|
||||
$ei = '<strong><u>' . $eff[$i]['name'] . '</u></strong>';
|
||||
if ($eff[$i]['x'] > 1) {
|
||||
$ei .= ' x' . $eff[$i]['x'] . ' ';
|
||||
}
|
||||
} else {
|
||||
if ($eff[$i]['timeUse'] != 77 && $eff[$i]['hod'] < 1) {
|
||||
$ei .= 'Осталось: ' . Conversion::secondsToTimeout($time_still);
|
||||
} elseif ($eff[$i]['hod'] >= 0) {
|
||||
$ei .= 'Зарядов: ' . $eff[$i]['hod'];
|
||||
|
||||
$ei .= match ($eff[$i]['type1']) {
|
||||
1, 2, 3, 4, 5, 6 => ' (Эликсир)',
|
||||
7, 8, 9, 10, 16 => ' (Заклятие)',
|
||||
14 => ' (Прием)',
|
||||
15 => ' (Изучение)',
|
||||
17 => ' (Проклятие)',
|
||||
18, 19 => ' (Травма)',
|
||||
20 => ' (Пристрастие)',
|
||||
22 => ' (Ожидание)',
|
||||
default => ' (Эффект)'
|
||||
};
|
||||
|
||||
$ei .= '<br>';
|
||||
|
||||
$time_still = ($eff[$i]['timeUse'] + ($eff[$i]['timeAce'] - $eff[$i]['timeUse']) + $eff[$i]['actionTime']);
|
||||
if ($eff[$i]['timeAce'] == 0) {
|
||||
$time_still += $eff[$i]['timeUse'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($eff[$i]['user_use'] != '') {
|
||||
$str = '<br>Автор: <strong>%s</strong>';
|
||||
if ($this->users[$this->uids[$eff[$i]['user_use']]]['login2'] != '') {
|
||||
$ei .= sprintf($str, $this->users[$this->uids[$eff[$i]['user_use']]]['login2']);
|
||||
} elseif ($this->users[$this->uids[$eff[$i]['user_use']]]['login'] != '') {
|
||||
$ei .= sprintf($str, $this->users[$this->uids[$eff[$i]['user_use']]]['login']);
|
||||
}
|
||||
unset($str);
|
||||
}
|
||||
|
||||
//Действие эффекта
|
||||
$tr = '';
|
||||
|
||||
$x = 0;
|
||||
$ed = Conversion::dataStringToArray($eff[$i]['data']);
|
||||
while ($x < count($this->statnames->sysBonusNames)) {
|
||||
$n = $this->statnames->sysBonusNames[$x];
|
||||
if (isset($ed['add_' . $n]) && $n != 'pog') {
|
||||
$z = '';
|
||||
if ($ed['add_' . $n] > 0) {
|
||||
$z = '+';
|
||||
$time_still -= time();
|
||||
if ($eff[$i]['bp'] == 0 && $eff[$i]['timeUse'] != 77) {
|
||||
if ($eff[$i]['type1'] != 13) {
|
||||
$ei .= 'Осталось: ' . Conversion::secondsToTimeout($time_still);
|
||||
}
|
||||
$tr .= '<br>' . $this->statnames->bonusNames[$n] . ': ' . $z . $ed['add_' . $n];
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
|
||||
if (isset($ed['add_mib1']) && $ed['add_mib1'] != 0) {
|
||||
if ($ed['add_mab1'] != 0) {
|
||||
$tr .= $armor1 . $ed['add_mib1'] . '-' . $ed['add_mab1'];
|
||||
} else {
|
||||
$m1l = $ed['add_mib1'];
|
||||
if ($m1l > 0) {
|
||||
$m1l = '+' . $m1l;
|
||||
if ($eff[$i]['timeUse'] != 77 && $eff[$i]['hod'] < 1) {
|
||||
$ei .= 'Осталось: ' . Conversion::secondsToTimeout($time_still);
|
||||
} elseif ($eff[$i]['hod'] >= 0) {
|
||||
$ei .= 'Зарядов: ' . $eff[$i]['hod'];
|
||||
}
|
||||
$tr .= $armor1 . $m1l;
|
||||
}
|
||||
}
|
||||
if (isset($ed['add_mib2']) && $ed['add_mib2'] != 0) {
|
||||
if ($ed['add_mab2'] != 0) {
|
||||
$tr .= $armor2 . $ed['add_mib2'] . '-' . $ed['add_mab2'];
|
||||
} else {
|
||||
$m1l = $ed['add_mib2'];
|
||||
if ($m1l > 0) {
|
||||
$m1l = '+' . $m1l;
|
||||
}
|
||||
$tr .= $armor2 . $m1l;
|
||||
}
|
||||
}
|
||||
if (isset($ed['add_mib3']) && $ed['add_mib3'] != 0) {
|
||||
if ($ed['add_mab3'] != 0) {
|
||||
$tr .= $armor3 . $ed['add_mib3'] . '-' . $ed['add_mab3'];
|
||||
} else {
|
||||
$m1l = $ed['add_mib3'];
|
||||
if ($m1l > 0) {
|
||||
$m1l = '+' . $m1l;
|
||||
}
|
||||
$tr .= $armor3 . $m1l;
|
||||
}
|
||||
}
|
||||
if (isset($ed['add_mib4']) && $ed['add_mib4'] != 0) {
|
||||
if ($ed['add_mab4'] != 0) {
|
||||
$tr .= $armor4 . $ed['add_mib4'] . '-' . $ed['add_mab4'];
|
||||
} else {
|
||||
$m1l = $ed['add_mib4'];
|
||||
if ($m1l > 0) {
|
||||
$m1l = '+' . $m1l;
|
||||
}
|
||||
$tr .= $armor4 . $m1l;
|
||||
}
|
||||
}
|
||||
|
||||
$efix = 0;
|
||||
if (isset($ed['add_pog2']) && $ed['add_pog2'] > 0) {
|
||||
$efix = $ed['add_pog2'];
|
||||
}
|
||||
if (isset($ed['add_pog'])) {
|
||||
$tr .= '<br>Магический барьер способен поглотить еще <strong>' . $ed['add_pog'] . '</strong> ед. урона';
|
||||
}
|
||||
if (isset($ed['add_pog2'])) {
|
||||
$tr .= '<br>Магический барьер способен поглотить еще <strong>' . $ed['add_pog2'] . '</strong> ед. урона <small>(' . $ed['add_pog2p'] . '%)</small>';
|
||||
}
|
||||
if ($eff[$i]['user_use'] != '') {
|
||||
$str = '<br>Автор: <strong>%s</strong>';
|
||||
if ($this->users[$this->uids[$eff[$i]['user_use']]]['login2'] != '') {
|
||||
$ei .= sprintf($str, $this->users[$this->uids[$eff[$i]['user_use']]]['login2']);
|
||||
} elseif ($this->users[$this->uids[$eff[$i]['user_use']]]['login'] != '') {
|
||||
$ei .= sprintf($str, $this->users[$this->uids[$eff[$i]['user_use']]]['login']);
|
||||
}
|
||||
unset($str);
|
||||
}
|
||||
|
||||
if ($tr != '') {
|
||||
$ei .= $tr;
|
||||
}
|
||||
if ($eff[$i]['info'] != '') {
|
||||
$ei .= '<br><i>Информация:</i><br>' . $eff[$i]['info'];
|
||||
}
|
||||
//Действие эффекта
|
||||
$tr = '';
|
||||
|
||||
$efcol = $eff[$i]['x'];
|
||||
$efimg = $eff[$i]['img'];
|
||||
$ef .= <<<HTML
|
||||
$x = 0;
|
||||
$ed = Conversion::dataStringToArray($eff[$i]['data']);
|
||||
while ($x < count($this->statnames->sysBonusNames)) {
|
||||
$n = $this->statnames->sysBonusNames[$x];
|
||||
if (isset($ed['add_' . $n]) && $n != 'pog') {
|
||||
$z = '';
|
||||
if ($ed['add_' . $n] > 0) {
|
||||
$z = '+';
|
||||
}
|
||||
$tr .= '<br>' . $this->statnames->bonusNames[$n] . ': ' . $z . $ed['add_' . $n];
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
|
||||
if (isset($ed['add_mib1']) && $ed['add_mib1'] != 0) {
|
||||
if ($ed['add_mab1'] != 0) {
|
||||
$tr .= $armor1 . $ed['add_mib1'] . '-' . $ed['add_mab1'];
|
||||
} else {
|
||||
$m1l = $ed['add_mib1'];
|
||||
if ($m1l > 0) {
|
||||
$m1l = '+' . $m1l;
|
||||
}
|
||||
$tr .= $armor1 . $m1l;
|
||||
}
|
||||
}
|
||||
if (isset($ed['add_mib2']) && $ed['add_mib2'] != 0) {
|
||||
if ($ed['add_mab2'] != 0) {
|
||||
$tr .= $armor2 . $ed['add_mib2'] . '-' . $ed['add_mab2'];
|
||||
} else {
|
||||
$m1l = $ed['add_mib2'];
|
||||
if ($m1l > 0) {
|
||||
$m1l = '+' . $m1l;
|
||||
}
|
||||
$tr .= $armor2 . $m1l;
|
||||
}
|
||||
}
|
||||
if (isset($ed['add_mib3']) && $ed['add_mib3'] != 0) {
|
||||
if ($ed['add_mab3'] != 0) {
|
||||
$tr .= $armor3 . $ed['add_mib3'] . '-' . $ed['add_mab3'];
|
||||
} else {
|
||||
$m1l = $ed['add_mib3'];
|
||||
if ($m1l > 0) {
|
||||
$m1l = '+' . $m1l;
|
||||
}
|
||||
$tr .= $armor3 . $m1l;
|
||||
}
|
||||
}
|
||||
if (isset($ed['add_mib4']) && $ed['add_mib4'] != 0) {
|
||||
if ($ed['add_mab4'] != 0) {
|
||||
$tr .= $armor4 . $ed['add_mib4'] . '-' . $ed['add_mab4'];
|
||||
} else {
|
||||
$m1l = $ed['add_mib4'];
|
||||
if ($m1l > 0) {
|
||||
$m1l = '+' . $m1l;
|
||||
}
|
||||
$tr .= $armor4 . $m1l;
|
||||
}
|
||||
}
|
||||
|
||||
$efix = 0;
|
||||
if (isset($ed['add_pog2']) && $ed['add_pog2'] > 0) {
|
||||
$efix = $ed['add_pog2'];
|
||||
}
|
||||
if (isset($ed['add_pog'])) {
|
||||
$tr .= '<br>Магический барьер способен поглотить еще <strong>' . $ed['add_pog'] . '</strong> ед. урона';
|
||||
}
|
||||
if (isset($ed['add_pog2'])) {
|
||||
$tr .= '<br>Магический барьер способен поглотить еще <strong>' . $ed['add_pog2'] . '</strong> ед. урона <small>(' . $ed['add_pog2p'] . '%)</small>';
|
||||
}
|
||||
|
||||
if ($tr != '') {
|
||||
$ei .= $tr;
|
||||
}
|
||||
if ($eff[$i]['info'] != '') {
|
||||
$ei .= '<br><i>Информация:</i><br>' . $eff[$i]['info'];
|
||||
}
|
||||
|
||||
$efcol = $eff[$i]['x'];
|
||||
$efimg = $eff[$i]['img'];
|
||||
$ef .= <<<HTML
|
||||
<div class="pimg" pog="$efix" col="$efcol" stl="0" stt="$ei"><img src="$img/i/eff/$efimg" alt=""></div>
|
||||
HTML;
|
||||
|
||||
unset($efix, $efcol, $efimg);
|
||||
unset($efix, $efcol, $efimg);
|
||||
}
|
||||
} elseif ($eff[$i] != 'delete') {
|
||||
$i = -2;
|
||||
}
|
||||
} elseif ($eff[$i] != 'delete') {
|
||||
$i = -2;
|
||||
$i++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
$ef = <<<HTML
|
||||
|
||||
} else {
|
||||
$ef = <<<HTML
|
||||
<div class="pimg" pog="0" col="0" stl="0" stt="Развернуть">
|
||||
<img src="$img/i/eff/effs_show.gif" alt=""
|
||||
onclick="top.useMagicBattle('Развернуть',5555,'effs_hide.gif',1,2)"
|
||||
@@ -643,8 +648,8 @@ class Battle
|
||||
>
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
}
|
||||
|
||||
$ca = '';
|
||||
|
||||
if ($ur['clan'] > 0) {
|
||||
@@ -712,9 +717,9 @@ JS;
|
||||
|
||||
$i = 0;
|
||||
if (is_array($itm)) {
|
||||
|
||||
while ($i < count($itm)) {
|
||||
//
|
||||
if (isset($st['items_img'][$tpImg[$itm[$i]['inOdet']]])) {
|
||||
if (isset($tpImg[$itm[$i]['inOdet']], $st['items_img'][$tpImg[$itm[$i]['inOdet']]])) {
|
||||
$itm[$i]['img'] = $st['items_img'][$tpImg[$itm[$i]['inOdet']]];
|
||||
}
|
||||
//генерируем предметы
|
||||
@@ -782,7 +787,7 @@ JS;
|
||||
}
|
||||
|
||||
$var1 = (int)$t;
|
||||
$var2 = (int)$itm[$i]['uid'];
|
||||
$var2 = (int)$id;
|
||||
$var3 = (int)$itm[$i]['id'];
|
||||
$var4 = (int)$itm[$i]['inOdet'];
|
||||
$var5 = $itm[$i]['name'];
|
||||
@@ -808,7 +813,6 @@ JS;
|
||||
public function testUsersLive(): bool
|
||||
{
|
||||
$tl = 0;
|
||||
|
||||
for ($i = 0; $i < count($this->uids); $i++) {
|
||||
if (empty($this->stats[$i]['id'])) {
|
||||
continue;
|
||||
@@ -1455,7 +1459,7 @@ JS;
|
||||
*/
|
||||
private function testExp($y, $s2): int
|
||||
{
|
||||
if ($s2['levels'] == 'undefined' || $this->users[$this->uids[$s2['id']]]['pass'] == 'saintlucia') {
|
||||
if ($s2['levels'] == 'undefined' || $this->users[$this->uids[$s2['id']]]['bot'] > 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1860,16 +1864,17 @@ JS;
|
||||
mysql_query('DELETE FROM `battle_act` WHERE `id` = "' . $pl['id'] . '"');
|
||||
}
|
||||
}
|
||||
}
|
||||
//тест удара
|
||||
if ($this->uAtc['id'] > 0) {
|
||||
if ($pl['out1'] == 0 && $pl['out2'] == 0) {
|
||||
//Может разменяться только тот кто бил
|
||||
if ($pl['uid1'] == $u->info['id'] || $pl['uid2'] == $u->info['id']) {
|
||||
|
||||
//тест удара
|
||||
if ($this->uAtc['id'] > 0) {
|
||||
if ($pl['out1'] == 0 && $pl['out2'] == 0) {
|
||||
//Может разменяться только тот кто бил
|
||||
if ($pl['uid1'] == $u->info['id'] || $pl['uid2'] == $u->info['id']) {
|
||||
$this->addNewAtack($u);
|
||||
}
|
||||
} else {
|
||||
$this->addNewAtack($u);
|
||||
}
|
||||
} else {
|
||||
$this->addNewAtack($u);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1879,10 +1884,9 @@ JS;
|
||||
if (
|
||||
isset($bot) &&
|
||||
$this->stats[$this->uids[$bot]]['hpNow'] >= 1 &&
|
||||
$this->stats[$this->uids[$bot]]['pass'] != 'saintlucia'
|
||||
$this->users[$this->uids[$bot]]['bot'] != 1
|
||||
) { //Тут проверка на бота saintlucia
|
||||
$j = 0;
|
||||
|
||||
while ($j < count($this->users)) {
|
||||
if ($this->i->razdel == 0) {
|
||||
$tnbot = time() + rand(1, 1);
|
||||
@@ -1955,25 +1959,28 @@ JS;
|
||||
$this->users[$j]['hpnow'] >= 1 &&
|
||||
$this->users[$this->uids[$bot]]['hpnow'] >= 1
|
||||
) {
|
||||
$this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['a1'] =
|
||||
rand(1, 5) . '' . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5);
|
||||
if (isset($this->ga[$bot][$this->users[$j]['id']])) {
|
||||
$this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['a1'] =
|
||||
rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5);
|
||||
|
||||
$this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['b1'] = rand(1, 5);
|
||||
$this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['b1'] = rand(1, 5);
|
||||
|
||||
$this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['a2'] =
|
||||
rand(1, 5) . '' . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5);
|
||||
$this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['a2'] =
|
||||
rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5);
|
||||
|
||||
$this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['b2'] = rand(1, 5);
|
||||
$this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['b2'] = rand(1, 5);
|
||||
}
|
||||
if (isset($this->ag[$bot][$this->users[$j]['id']])) {
|
||||
$this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['a1'] =
|
||||
rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5);
|
||||
|
||||
$this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['a1'] =
|
||||
rand(1, 5) . '' . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5);
|
||||
$this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['b1'] = rand(1, 5);
|
||||
|
||||
$this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['b1'] = rand(1, 5);
|
||||
$this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['a2'] =
|
||||
rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5);
|
||||
|
||||
$this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['a2'] =
|
||||
rand(1, 5) . '' . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5);
|
||||
|
||||
$this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['b2'] = rand(1, 5);
|
||||
$this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['b2'] = rand(1, 5);
|
||||
}
|
||||
|
||||
if (
|
||||
isset($this->ga[$bot][$this->users[$j]['id']]) &&
|
||||
@@ -2022,7 +2029,16 @@ JS;
|
||||
}
|
||||
}
|
||||
|
||||
//Приемы которые используются моментально (в конце хода)
|
||||
/**
|
||||
* Массово встречается в подключаемых файлах приёмов.
|
||||
* @param array $arr
|
||||
* @return void
|
||||
* @deprecated
|
||||
*/
|
||||
public function add_log(array $arr): void
|
||||
{
|
||||
Log::add($arr);
|
||||
}
|
||||
|
||||
private function botAtack($uid, $pl, $tp): void
|
||||
{
|
||||
@@ -2217,7 +2233,7 @@ JS;
|
||||
|
||||
// Заносим в логи + записываем статистику боя
|
||||
$this->addlogRazmen($id, $at);
|
||||
var_dump($at);
|
||||
|
||||
//Запускаем магию предметов
|
||||
$this->magicItems($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], $id);
|
||||
$this->magicItems($this->atacks[$id]['uid2'], $this->atacks[$id]['uid1'], $id);
|
||||
@@ -3867,7 +3883,7 @@ JS;
|
||||
Log::add($mas);
|
||||
$j++;
|
||||
}
|
||||
var_dump($at);
|
||||
|
||||
}
|
||||
|
||||
//Добавляем статистику + записываем в баттл_юзерс НР игроков
|
||||
@@ -4414,6 +4430,8 @@ JS;
|
||||
return;
|
||||
}
|
||||
|
||||
var_dump($_POST);
|
||||
|
||||
//atack: '3_2_0_0_0' (length=9)
|
||||
//block: '5' (length=1)
|
||||
|
||||
@@ -4441,6 +4459,7 @@ JS;
|
||||
}
|
||||
$this->uAtc = $na;
|
||||
$js .= 'testClearZone();';
|
||||
var_dump($this->uAtc);
|
||||
}
|
||||
|
||||
public function teamsTake(User $u): void
|
||||
@@ -4769,6 +4788,7 @@ JS;
|
||||
while ($i < count($this->uids)) {
|
||||
if ($this->stats[$i]['hpNow'] > 0) {
|
||||
if (!isset($teams[$this->users[$i]['team']])) {
|
||||
$teams[$this->users[$i]['team']] = '';
|
||||
$tms[$j] = $this->users[$i]['team'];
|
||||
$j++;
|
||||
}
|
||||
@@ -4821,6 +4841,7 @@ JS;
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
//генерируем команды
|
||||
$i = 0;
|
||||
while ($i < count($tms)) {
|
||||
|
||||
@@ -2243,13 +2243,17 @@ class Priems
|
||||
return [0 => $lvar, 1 => $pz];
|
||||
}
|
||||
|
||||
/**
|
||||
* Генерирует html строку для вставки в JS $("#priems").html(" сюда ");
|
||||
* @return string
|
||||
*/
|
||||
public function seeMy(): string
|
||||
{
|
||||
global $btl;
|
||||
$i = 0;
|
||||
$p = explode('|', $this->u->info['priems']);
|
||||
$pr = '';
|
||||
$all = (int)$_GET['all'];
|
||||
$all = $_GET['all'] ??= '0';
|
||||
while ($i < $this->u->info['priemslot']) {
|
||||
if ($p[$i] > 0) {
|
||||
$pl = Db::getRow('select * from priems where level <= ? and activ > 0 and id = ?', [$this->u->info['level'], $p[$i]]);
|
||||
@@ -2289,14 +2293,20 @@ class Priems
|
||||
$notr = $this->testpriem($pl, 2);
|
||||
|
||||
$cli2 = '';
|
||||
if (($pz[$i] > 0 || $notr > 0) || (isset($this->u->stats['nopriems']) && $pl['nosh'] == 0) || $this->u->stats['notuse_last_pr'] == $pl['id']) {
|
||||
if (($pz[$i] > 0 || $notr > 0) || (isset($this->u->stats['nopriems']) && $pl['nosh'] == 0) || isset($this->u->stats['notuse_last_pr']) && $this->u->stats['notuse_last_pr'] == $pl['id']) {
|
||||
$cli2 = ' class="nopriemuse" ';
|
||||
}
|
||||
/// ТУТ!
|
||||
$priemName = $pl['name'];
|
||||
$priemImg = $pl['img'];
|
||||
|
||||
// Слава StackOverflow! https://stackoverflow.com/a/43631576
|
||||
$var = json_encode("<b>$priemName</b><br>$lvar");
|
||||
$jsOnmouseover = "top.hi(this,$var,event,3,0,1,1,'width: 240px;')";
|
||||
$htmlJs = htmlspecialchars($jsOnmouseover, ENT_QUOTES);
|
||||
|
||||
$pr .= <<<HTML
|
||||
<a onmouseover="let a = `<b>$priemName</b><br>$lvar`; top.hi(this,a,event,3,0,1,1,'width: 240px;')" onmouseout="top.hic();" onmousedown="top.hic();" $cl>
|
||||
<a onmouseover="$htmlJs" onmouseout="top.hic();" onmousedown="top.hic();" $cl>
|
||||
<img $cli2 style="margin-top: 3px; margin-left: 4px;" src="//img.new-combats.tech/i/eff/$priemImg.gif" alt=""></a>
|
||||
</a>
|
||||
HTML;
|
||||
|
||||
@@ -171,9 +171,9 @@ class Stats
|
||||
$st['items'] = [];
|
||||
$st['effects'] = [];
|
||||
|
||||
|
||||
|
||||
$st['vip'] = $u['vip'];
|
||||
if (!empty($u['vip'])) {
|
||||
$st['vip'] = $u['vip'];
|
||||
}
|
||||
|
||||
foreach (Conversion::dataStringToArray($u['stats']) as $stat => $value) {
|
||||
//fixme несуществующие статы mg5 mg6 a6 s8-s15
|
||||
@@ -297,7 +297,7 @@ class Stats
|
||||
|
||||
|
||||
//Бонусы комплектов
|
||||
if (is_iterable($coms['new'])) {
|
||||
if (isset($coms['new']) && is_iterable($coms['new'])) {
|
||||
foreach ($coms['new'] as $complect) {
|
||||
$com = Db::getValue(
|
||||
'select data from complects where com = ? and x <= ? order by x desc limit 1',
|
||||
|
||||
@@ -15,7 +15,7 @@ class WearedScrolls
|
||||
public static function ScrollsChange(array &$u): void
|
||||
{
|
||||
//Замена свитков
|
||||
if ($u['autospell'] == 0 || $u['battle'] != 0) {
|
||||
if (empty($u['autospell']) || !empty($u['battle'])) {
|
||||
return;
|
||||
}
|
||||
//проверяем свитки
|
||||
|
||||
Reference in New Issue
Block a user