Merge remote-tracking branch 'origin/dev-battle-fighterclass' into dev-battle-fighterclass
# Conflicts: # _incl_data/class/Battle.php
This commit is contained in:
+141
-101
@@ -1379,9 +1379,9 @@ class Priems
|
||||
return $r;
|
||||
}
|
||||
|
||||
public function testpriem($pl, $t = 1, $o = 0)
|
||||
private function testpriem($pl, $t = 1, $o = 0): int
|
||||
{
|
||||
global $c, $u, $code, $btl;
|
||||
global $btl;
|
||||
$tr = Conversion::dataStringToArray($pl['tr']);
|
||||
$d2 = Conversion::dataStringToArray($pl['date2']);
|
||||
$x = 1;
|
||||
@@ -2103,118 +2103,79 @@ class Priems
|
||||
|
||||
public function getTechniquesInfo(?int $id = null): array
|
||||
{
|
||||
# SELECT * FROM `priems` WHERE `level`<="' . $this->u->info['level'] . '" AND `activ` > "0" AND `id` = "' . $id . '" LIMIT 1
|
||||
|
||||
if (isset($id)) {
|
||||
return Db::getRow(
|
||||
'select * from techniques_categories left join priems on techniques_categories.technique_id = priems.id
|
||||
where priems.level <= ? and priems.activ > 0 and priems.id = ? order by priems.img,priems.level', [User::start()->info['level'], $id]
|
||||
);
|
||||
return Db::getRow('select * from priems where level <= ? and activ > 0 and id = ? order by img,level', [$this->u->info['level'], $id]);
|
||||
// return Db::getRow(
|
||||
// 'select * from techniques_categories left join priems on techniques_categories.technique_id = priems.id
|
||||
// where priems.level <= ? and priems.activ > 0 and priems.id = ? order by priems.img,priems.level', [User::start()->info['level'], $id]
|
||||
// );
|
||||
}
|
||||
|
||||
return Db::getRows(
|
||||
'select * from techniques_categories left join priems on techniques_categories.technique_id = priems.id
|
||||
where priems.level <= ? and priems.activ > 0 order by priems.img,priems.level', [User::start()->info['level']]
|
||||
);
|
||||
return Db::getRows('select * from priems where level <= ? and activ > 0 order by img,level', [$this->u->info['level']]);
|
||||
// return Db::getRows(
|
||||
// 'select * from techniques_categories left join priems on techniques_categories.technique_id = priems.id
|
||||
// where priems.level <= ? and priems.activ > 0 order by priems.img,priems.level', [User::start()->info['level']]
|
||||
// );
|
||||
}
|
||||
|
||||
public function seeMy($t)
|
||||
|
||||
public function seeMyPriems(): void
|
||||
{
|
||||
global $btl;
|
||||
$i = 0;
|
||||
$p = explode('|', $this->u->info['priems']);
|
||||
$lvar = '';
|
||||
$pr = '';
|
||||
$all = (int)$_GET['all'];
|
||||
while ($i < $this->u->info['priemslot']) {
|
||||
if ($p[$i] > 0) {
|
||||
$pl = mysql_fetch_assoc(
|
||||
mysql_query(
|
||||
'SELECT * FROM `priems` WHERE `level`<="' . $this->u->info['level'] . '" AND `activ` > "0" AND `id` = "' . mysql_real_escape_string(
|
||||
$p[$i]
|
||||
) . '" LIMIT 1'
|
||||
)
|
||||
);
|
||||
$lvar = $this->priemInfo($pl, $t, $i);
|
||||
$pz = $lvar[1];
|
||||
$pl = Db::getRow('select * from priems where level <= ? and activ > 0 and id = ?', [$this->u->info['level'], $p[$i]]);
|
||||
$lvar = $this->priemInfo($pl, $i);
|
||||
$lvar = $lvar[0];
|
||||
if ($t == 1) {
|
||||
if (isset($_GET['inv'])) {
|
||||
$cl = 'href="javascript:void(0)" onclick="location.href=\'main.php?all=' . ((int)$_GET['all']) . '&skills=1&rz=4&p_raz=all\'"';
|
||||
} else {
|
||||
$cl = 'href="javascript:void(0)" onclick="location.href=\'main.php?all=' . ((int)$_GET['all']) . '&skills=1&unuse_priem=' . $i . '&rz=4&p_raz=\' + p_raz"';
|
||||
}
|
||||
} else {
|
||||
if ($pl['type'] == 1) {
|
||||
//моментально
|
||||
if ($pl['onUser'] == 1) {
|
||||
$oninuser = '';
|
||||
if ($pl['team'] == 1) {
|
||||
if ($this->u->info['login2'] != '') {
|
||||
$oninuser = $this->u->info['login2'];
|
||||
} else {
|
||||
$oninuser = $this->u->info['login'];
|
||||
}
|
||||
} else {
|
||||
if ($btl->users[$btl->uids[$this->u->info['enemy']]]['login2'] != '') {
|
||||
$oninuser = $btl->users[$btl->uids[$this->u->info['enemy']]]['login2'];
|
||||
} else {
|
||||
$oninuser = $btl->users[$btl->uids[$this->u->info['enemy']]]['login'];
|
||||
}
|
||||
}
|
||||
$cl = 'href="javascript:void(0);" onClick="top.priemOnUser(' . $i . ',1,\'' . $pl['name'] . '\',\'' . $oninuser . '\',\'' . $pl['img'] . '\');"';
|
||||
unset($oninuser);
|
||||
} else {
|
||||
$cl = 'href="javascript:void(0);" onClick="usepriem(' . $i . ',1,\'' . $pl['img'] . '\');"';
|
||||
}
|
||||
} elseif ($pl['type'] == 2) {
|
||||
//длительное
|
||||
$cl = 'href="javascript:void(0);" onClick="usepriem(' . $i . ',1,\'' . $pl['img'] . '\');"';
|
||||
} elseif ($pl['type'] == 3) {
|
||||
$cl = 'href="javascript:void(0);" onClick="alert(\'Возможно используем?\');"';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$notr = $this->testpriem($pl, $t);
|
||||
|
||||
|
||||
$cl2 = '';
|
||||
$cli2 = '';
|
||||
if ((($pz[$i] > 0 || $notr > 0) && $t == 2) || (isset($this->u->stats['nopriems']) && $pl['nosh'] == 0) || $this->u->stats['notuse_last_pr'] == $pl['id']) {
|
||||
$cli2 = ' class="nopriemuse" ';
|
||||
}
|
||||
|
||||
$pr .= '<a onMouseOver="top.hi(this,\'<b>' . $pl['name'] . '</b><Br>' . $lvar . '\',event,3,0,1,1,\'width:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" ' . $cl . '><img ' . $cli2 . ' style="margin-top:3px; ' . $cl2 . ' margin-left:4px;" src="//img.new-combats.tech/i/eff/' . $pl['img'] . '.gif" width="55" height="35" /></a>';
|
||||
} else {
|
||||
|
||||
if (isset($_GET['inv'])) {
|
||||
$pr .= '<a title="Перейти к настройкам приемов" href="javascript:void(0)" onclick="location.href=\'main.php?all=' . ((int)$_GET['all']) . '&skills=1&rz=4&p_raz=all\'"><img style="margin-top:4px; margin-left:4px;" src="//img.new-combats.tech/i/items/w/clearPriem.gif" width="55" height="35" /></a>';
|
||||
$cl = "location.href='/main.php?all=$all&skills=1&rz=4&p_raz=all'";
|
||||
} else {
|
||||
$pr .= '<img style="margin-top:4px; margin-left:4px;" src="//img.new-combats.tech/i/items/w/clearPriem.gif" width="55" height="35" />';
|
||||
$cl = "location.href='/main.php?all=$all&skills=1&unuse_priem=$i&rz=4&p_raz=' + p_raz";
|
||||
}
|
||||
$cl = 'onclick="' . $cl . '"';
|
||||
|
||||
$cli2 = '';
|
||||
if ((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'];
|
||||
$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();" href="javascript:void(0)" $cl>
|
||||
<img $cli2 style="margin-top: 3px; margin-left: 4px;" src="//img.new-combats.tech/i/eff/$priemImg.gif" alt=""></a>
|
||||
</a>
|
||||
HTML;
|
||||
|
||||
} elseif (isset($_GET['inv'])) {
|
||||
$pr .= <<<HTML
|
||||
<a title="Перейти к настройкам приемов" href="javascript:void(0)" onclick="location.href='/main.php?all=$all&skills=1&rz=4&p_raz=all'">
|
||||
<img style="margin-top:4px; margin-left:4px;" src="//img.new-combats.tech/i/items/w/clearPriem.gif" alt="">
|
||||
</a>
|
||||
HTML;
|
||||
|
||||
} else {
|
||||
$pr .= '<img style="margin-top:4px; margin-left:4px;" src="//img.new-combats.tech/i/items/w/clearPriem.gif" alt="">';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if ($this->u->info['animal'] > 0 && $t == 2) {
|
||||
$use_lst = $this->u->testAction(
|
||||
'`uid` = "' . $this->u->info['id'] . '" AND `vars` = "animal_use' . $btl->i->id . '" LIMIT 1',
|
||||
1
|
||||
);
|
||||
if (!isset($use_lst['id'])) {
|
||||
$cl2 = '';
|
||||
$pr .= '<a onMouseOver="top.hi(this,\'<b>Выпустить зверя</b><Br>Ваш зверь вмешивается в поединок. Можно применять один раз за бой.\',event,3,0,1,1,\'width:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" href="javascript:void(0);" onClick="usepriem(100500,1,\'\');"><img style="margin-top:1px; ' . $cl2 . ' margin-left:3px;" src="//img.new-combats.tech/i/eff/pet_unleash.gif" width="40" height="25" /></a>';
|
||||
} else {
|
||||
$cl2 = '" class="nopriemuse';
|
||||
$pr .= '<img onMouseOver="top.hi(this,\'<b>Выпустить зверя</b><Br>Ваш зверь вмешивается в поединок. Можно применять один раз за бой.\',event,3,0,1,1,\'width:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" style="margin-top:1px; margin-left:2px;' . $cl2 . '" src="//img.new-combats.tech/i/eff/pet_unleash.gif" width="40" height="25" />';
|
||||
}
|
||||
}
|
||||
if ($t == 1) {
|
||||
echo '<div>' . $pr . '</div>';
|
||||
} elseif ($t == 2) {
|
||||
return str_replace('"', '\\"', $pr);
|
||||
}
|
||||
|
||||
echo '<div>' . $pr . '</div>';
|
||||
}
|
||||
|
||||
public function priemInfo($pl, $t, $id = false)
|
||||
/**
|
||||
* Летит в js, двойные кавычки не использовать.
|
||||
* @param array $pl
|
||||
* @param int $id
|
||||
* @return array
|
||||
*/
|
||||
private function priemInfo(array $pl, int $id = -1): array
|
||||
{
|
||||
global $btl;
|
||||
$pz = explode('|', $this->u->info['priems_z']);
|
||||
@@ -2226,7 +2187,7 @@ class Priems
|
||||
$n = $this->statnames->sysRequirementNames[$x];
|
||||
if (isset($tr['tr_' . $n])) {
|
||||
if ($tr['tr_' . $n] > $this->u->stats[$n]) {
|
||||
$trs .= '<span style="color: red">';
|
||||
$trs .= "<span style='color: red;'>";
|
||||
}
|
||||
$trs .= '<br>• ';
|
||||
$trs .= $this->statnames->requirementNames[$n] . ': ' . $tr['tr_' . $n];
|
||||
@@ -2242,10 +2203,7 @@ class Priems
|
||||
$nm = [1 => 'hit', 2 => 'krit', 3 => 'counter', 4 => 'block', 5 => 'parry', 6 => 'hp', 7 => 'spirit'];
|
||||
while ($j <= 6) {
|
||||
if ($pl['tt' . $j] > 0) {
|
||||
$lvar .= '<img src=//img.new-combats.tech/i/micro/' . $nm[$j] . '.gif width=8 height=8 /> ' . round(
|
||||
$pl['tt' . $j],
|
||||
2
|
||||
) . ' ';
|
||||
$lvar .= '<img src=//img.new-combats.tech/i/micro/' . $nm[$j] . '.gif> ' . round($pl['tt' . $j], 2) . ' ';
|
||||
}
|
||||
$j++;
|
||||
}
|
||||
@@ -2266,7 +2224,7 @@ class Priems
|
||||
if (isset($tr['tr_mpNow']) && $tr['tr_mpNow'] > 0) {
|
||||
$tr['tr_mpNow'] -= round($tr['tr_mpNow'] / 100 * $this->u->stats['min_use_mp']);
|
||||
if ($this->u->info['mpNow'] < $tr['tr_mpNow'] || (isset($btl->stats[$btl->uids[$this->u->info['id']]]) && $btl->stats[$btl->uids[$this->u->info['id']]]['mpNow'] < $tr['tr_mpNow'])) {
|
||||
$lvar .= '<font color=red>• Расход маны: ' . $tr['tr_mpNow'] . '</font><br>';
|
||||
$lvar .= '<span style="color: red;">• Расход маны: ' . $tr['tr_mpNow'] . '</span><br>';
|
||||
} else {
|
||||
$lvar .= '• Расход маны: ' . $tr['tr_mpNow'] . '<br>';
|
||||
}
|
||||
@@ -2285,6 +2243,90 @@ class Priems
|
||||
return [0 => $lvar, 1 => $pz];
|
||||
}
|
||||
|
||||
public function seeMy(): string
|
||||
{
|
||||
global $btl;
|
||||
$i = 0;
|
||||
$p = explode('|', $this->u->info['priems']);
|
||||
$pr = '';
|
||||
$all = (int)$_GET['all'];
|
||||
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]]);
|
||||
$cl = '';
|
||||
$lvar = $this->priemInfo($pl, $i);
|
||||
$pz = $lvar[1];
|
||||
$lvar = $lvar[0];
|
||||
|
||||
if ($pl['type'] == 1) {
|
||||
//моментально
|
||||
if ($pl['onUser'] == 1) {
|
||||
if ($pl['team'] == 1) {
|
||||
if ($this->u->info['login2'] != '') {
|
||||
$oninuser = $this->u->info['login2'];
|
||||
} else {
|
||||
$oninuser = $this->u->info['login'];
|
||||
}
|
||||
} else {
|
||||
if ($btl->users[$btl->uids[$this->u->info['enemy']]]['login2'] != '') {
|
||||
$oninuser = $btl->users[$btl->uids[$this->u->info['enemy']]]['login2'];
|
||||
} else {
|
||||
$oninuser = $btl->users[$btl->uids[$this->u->info['enemy']]]['login'];
|
||||
}
|
||||
}
|
||||
$cl = 'href="javascript:void(0);" onClick="top.priemOnUser(' . $i . ',1,\'' . $pl['name'] . '\',\'' . $oninuser . '\',\'' . $pl['img'] . '\');"';
|
||||
unset($oninuser);
|
||||
} else {
|
||||
$cl = 'href="javascript:void(0);" onClick="usepriem(' . $i . ',1,\'' . $pl['img'] . '\');"';
|
||||
}
|
||||
} elseif ($pl['type'] == 2) {
|
||||
//длительное
|
||||
$cl = 'href="javascript:void(0);" onClick="usepriem(' . $i . ',1,\'' . $pl['img'] . '\');"';
|
||||
} elseif ($pl['type'] == 3) {
|
||||
$cl = 'href="javascript:void(0);" onClick="alert(\'Возможно используем?\');"';
|
||||
}
|
||||
|
||||
$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']) {
|
||||
$cli2 = ' class="nopriemuse" ';
|
||||
}
|
||||
/// ТУТ!
|
||||
$priemName = $pl['name'];
|
||||
$priemImg = $pl['img'];
|
||||
$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>
|
||||
<img $cli2 style="margin-top: 3px; margin-left: 4px;" src="//img.new-combats.tech/i/eff/$priemImg.gif" alt=""></a>
|
||||
</a>
|
||||
HTML;
|
||||
|
||||
} else {
|
||||
|
||||
if (isset($_GET['inv'])) {
|
||||
$pr .= '<a title="Перейти к настройкам приемов" href="javascript:void(0)" onclick="location.href=\'main.php?all=' . $all . '&skills=1&rz=4&p_raz=all\'"><img style="margin-top:4px; margin-left:4px;" src="//img.new-combats.tech/i/items/w/clearPriem.gif" alt=""></a>';
|
||||
} else {
|
||||
$pr .= '<img style="margin-top:4px; margin-left:4px;" src="//img.new-combats.tech/i/items/w/clearPriem.gif" alt="">';
|
||||
}
|
||||
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if ($this->u->info['animal'] > 0) {
|
||||
$use_lst = $this->u->testAction(
|
||||
'`uid` = "' . $this->u->info['id'] . '" AND `vars` = "animal_use' . $btl->i->id . '" LIMIT 1',
|
||||
1
|
||||
);
|
||||
if (!isset($use_lst['id'])) {
|
||||
$pr .= '<a onMouseOver="top.hi(this,\'<b>Выпустить зверя</b><Br>Ваш зверь вмешивается в поединок. Можно применять один раз за бой.\',event,3,0,1,1,\'width:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" href="javascript:void(0);" onClick="usepriem(100500,1,\'\');"><img style="margin-top:1px; margin-left:3px;" src="//img.new-combats.tech/i/eff/pet_unleash.gif" width="40" height="25" /></a>';
|
||||
} else {
|
||||
$pr .= '<img onMouseOver="top.hi(this,\'<b>Выпустить зверя</b><Br>Ваш зверь вмешивается в поединок. Можно применять один раз за бой.\',event,3,0,1,1,\'width:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" style="margin-top:1px; margin-left:2px;" class="nopriemuse" src="//img.new-combats.tech/i/eff/pet_unleash.gif" width="40" height="25" />';
|
||||
}
|
||||
}
|
||||
|
||||
return str_replace('"', '\\"', $pr);
|
||||
}
|
||||
|
||||
//Мощность / подавление / сопротивление и т.д.
|
||||
|
||||
public function getByCategory(?int $category_id = null)
|
||||
@@ -2303,9 +2345,7 @@ class Priems
|
||||
echo
|
||||
<<< HTML
|
||||
<a href="javascript:void(0)" onclick="location.href='main.php?skills=1&rz=4&use_priem=$priem[id]';">
|
||||
<img class="pwq$priem[category_id] pwqall" onMouseOver="top.popup(this, '(#$priem[id]) <b>$priem[name]</b><Br>{$this->priemInfo(
|
||||
$priem, 1
|
||||
)[0]}');" onMouseOut="top.hic();" onMouseDown="top.hic();" style="display:none;margin-top:2px; $cl margin-left:1px;" src="//img.new-combats.tech/i/eff/$priem[img].gif" width="40" height="25" />
|
||||
<img class="pwq$priem[category_id] pwqall" onMouseOver="top.popup(this, '(#$priem[id]) <b>$priem[name]</b><Br>{$this->priemInfo($priem)[0]}');" onMouseOut="top.hic();" onMouseDown="top.hic();" style="display:none;margin-top:2px; $cl margin-left:1px;" src="//img.new-combats.tech/i/eff/$priem[img].gif" width="40" height="25" />
|
||||
</a>
|
||||
HTML;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user