WIP: Info class
This commit is contained in:
+21
-20
@@ -4,6 +4,7 @@ use Core\Db;
|
||||
use DarksLight2\Training\TrainingManager;
|
||||
use Helper\Conversion;
|
||||
use Helper\Math;
|
||||
use User\Effects;
|
||||
|
||||
/*
|
||||
- доделать добавление приема в $btl->users[]['eff'] после использования, в противном случаи некотрые приемы используются через 1 ход
|
||||
@@ -114,7 +115,7 @@ class Priems
|
||||
$return_main = true;
|
||||
$ue = Db::getRow(
|
||||
'select * from users left join stats on (users.id = stats.id) where users.id = ? and battle = ? and hpnow > 0',
|
||||
[$eff['uid'], $btl->info['id']]
|
||||
[$eff['uid'], $btl->i->id]
|
||||
);
|
||||
|
||||
if (!empty($pr['file'])) {
|
||||
@@ -249,7 +250,7 @@ class Priems
|
||||
'||login2=' . $btl->users[$btl->uids[$uen]]['login'];
|
||||
$mas1 = [
|
||||
'time' => time(),
|
||||
'battle' => $btl->info['id'],
|
||||
'battle' => $btl->i->id,
|
||||
'id_hod' => ($btl->hodID + 1),
|
||||
'text' => '',
|
||||
'vars' => $vLog,
|
||||
@@ -349,7 +350,7 @@ class Priems
|
||||
$pm[2] = $s2['antm11'];
|
||||
}
|
||||
|
||||
if (isset($btl->info['id'])) {
|
||||
if (isset($btl->i->id)) {
|
||||
$pm[3] = $btl->zmgo($s2['zm' . $t]);
|
||||
$pm[3] = round($pm[3]);
|
||||
}
|
||||
@@ -947,13 +948,13 @@ class Priems
|
||||
}
|
||||
|
||||
// тяж травма для кровавых
|
||||
if ($btl->info['type'] == 99 and $hp2 == 0 and !$trawm_off) {
|
||||
if ($btl->i->type == 99 and $hp2 == 0 and !$trawm_off) {
|
||||
//$eff['user_use']
|
||||
//$sp1 = mysql_query('SELECT `e`.* FROM `eff_users` AS `e` WHERE `e`.`uid` = "'.$uen.'" AND `e`.`id_eff` = "22" AND `e`.`delete` = "0" AND `e`.`v1` = "priem" LIMIT 25');
|
||||
|
||||
$trawm_off = true;
|
||||
//$at[2][$i]['ttravm']='получил <font color=red><b>Тяжелую травму</b></font>.';
|
||||
$btl->addTravm($btl->users[$btl->uids[$uen]]['id'], 3, $btl->users[$btl->uids[$eff['user_use']]]['level']);
|
||||
Effects::addInjury($btl->users[$btl->uids[$uen]]['id'], 3, $btl->users[$btl->uids[$eff['user_use']]]['level']);
|
||||
}
|
||||
$upd = mysql_query(
|
||||
'UPDATE `stats` SET `hpNow` = ' . $hp2 . ',`last_hp` = "' . $btl->stats[$btl->uids[$uen]]['last_hp'] . '" WHERE `id` = "' . $uen . '" LIMIT 1'
|
||||
@@ -964,7 +965,7 @@ class Priems
|
||||
) . '||s1=' . $btl->users[$btl->uids[$usu]]['sex'] . '||t1=' . $btl->users[$btl->uids[$usu]]['team'] . '||login1=' . $btl->users[$btl->uids[$usu]]['login'] . '||s2=' . $btl->users[$btl->uids[$uen]]['sex'] . '||t2=' . $btl->users[$btl->uids[$uen]]['team'] . '||login2=' . $btl->users[$btl->uids[$uen]]['login'] . '';
|
||||
$mas1 = [
|
||||
'time' => time(),
|
||||
'battle' => $btl->info['id'],
|
||||
'battle' => $btl->i->id,
|
||||
'id_hod' => ($btl->hodID + 1),
|
||||
'text' => '',
|
||||
'vars' => $vLog,
|
||||
@@ -1088,7 +1089,7 @@ class Priems
|
||||
$u = $this->u; // Для присоедиянемых файлов.
|
||||
if ($id == 100500 && $this->u->info['animal'] > 0) {
|
||||
$use_lst = $this->u->testAction(
|
||||
'`uid` = "' . $this->u->info['id'] . '" AND `vars` = "animal_use' . $btl->info['id'] . '" LIMIT 1',
|
||||
'`uid` = "' . $this->u->info['id'] . '" AND `vars` = "animal_use' . $btl->i->id . '" LIMIT 1',
|
||||
1
|
||||
);
|
||||
if (!isset($use_lst['id'])) {
|
||||
@@ -1117,7 +1118,7 @@ class Priems
|
||||
'SELECT `id` FROM `test_bot` WHERE `login` = "' . $tp[$a['type']] . ' [' . $a['level'] . ']" LIMIT 1'
|
||||
)
|
||||
);
|
||||
if (isset($id['id']) && $btl->info['type'] != 500) {
|
||||
if (isset($id['id']) && $btl->i->type != 500) {
|
||||
$b = $this->u->addNewbot($id['id'], null, null);
|
||||
if ($b > 0 && $b) {
|
||||
$a['eda'] -= 4;
|
||||
@@ -1128,7 +1129,7 @@ class Priems
|
||||
$vLog = 'time1=' . time() . '||s1=' . $this->u->info['sex'] . '||t1=' . $this->u->info['team'] . '||login1=' . $this->u->info['login'] . '';
|
||||
$mas1 = [
|
||||
'time' => time(),
|
||||
'battle' => $btl->info['id'],
|
||||
'battle' => $btl->i->id,
|
||||
'id_hod' => $btl->hodID,
|
||||
'vars' => $vLog,
|
||||
'zona1' => '',
|
||||
@@ -1143,7 +1144,7 @@ class Priems
|
||||
$btl->add_log($mas1);
|
||||
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `login` = "' . $a['name'] . ' (зверь ' . $this->u->info['login'] . ')",`obraz` = "' . $a['obraz'] . '.gif",`battle` = "' . $btl->info['id'] . '" WHERE `id` = "' . $b['id'] . '" LIMIT 1'
|
||||
'UPDATE `users` SET `login` = "' . $a['name'] . ' (зверь ' . $this->u->info['login'] . ')",`obraz` = "' . $a['obraz'] . '.gif",`battle` = "' . $btl->i->id . '" WHERE `id` = "' . $b['id'] . '" LIMIT 1'
|
||||
);
|
||||
mysql_query(
|
||||
'UPDATE `stats` SET `team` = "' . $this->u->info['team'] . '" WHERE `id` = "' . $b['id'] . '" LIMIT 1'
|
||||
@@ -1151,7 +1152,7 @@ class Priems
|
||||
mysql_query(
|
||||
'UPDATE `users_animal` SET `eda` = "' . $a['eda'] . '" WHERE `id` = "' . $a['id'] . '" LIMIT 1'
|
||||
);
|
||||
$this->u->addAction(time(), 'animal_use' . $btl->info['id'], $a['level']);
|
||||
$this->u->addAction(time(), 'animal_use' . $btl->i->id, $a['level']);
|
||||
} else {
|
||||
echo 'Не удалось выпустить зверя...';
|
||||
}
|
||||
@@ -1212,7 +1213,7 @@ class Priems
|
||||
(
|
||||
`u`.`inUser` > 0 OR
|
||||
(
|
||||
`u`.`battle`="' . $btl->info['id'] . '" AND
|
||||
`u`.`battle`="' . $btl->i->id . '" AND
|
||||
`st`.`hpNow` > 0
|
||||
)
|
||||
) ORDER BY `u`.`id` DESC LIMIT 1'
|
||||
@@ -1233,7 +1234,7 @@ class Priems
|
||||
FROM `users` AS `u`
|
||||
LEFT JOIN `stats` AS `st` ON (`u`.`id`=`st`.`id`)
|
||||
WHERE
|
||||
`u`.`battle`="' . $btl->info['id'] . '" AND
|
||||
`u`.`battle`="' . $btl->i->id . '" AND
|
||||
`st`.`hpNow` > 0) AND
|
||||
`u`.`id` = "' . $this->ue['inUser'] . '" ORDER BY `u`.`id` ASC LIMIT 1'
|
||||
)
|
||||
@@ -1256,7 +1257,7 @@ class Priems
|
||||
} else {
|
||||
$ga = mysql_fetch_assoc(
|
||||
mysql_query(
|
||||
'SELECT * FROM `battle_act` WHERE `battle` = "' . $btl->info['id'] . '" AND `uid1` = "' . $this->u->info['id'] . '" AND `uid2` = "' . $this->u->info['enemy'] . '" LIMIT 1'
|
||||
'SELECT * FROM `battle_act` WHERE `battle` = "' . $btl->i->id . '" AND `uid1` = "' . $this->u->info['id'] . '" AND `uid2` = "' . $this->u->info['enemy'] . '" LIMIT 1'
|
||||
)
|
||||
);
|
||||
if (($this->u->info['enemy'] == 0 || isset($ga['id'])) && ($pl['tr_hod'] > 0 || $pl['trUser'] > 0)) {
|
||||
@@ -1423,7 +1424,7 @@ class Priems
|
||||
|
||||
if ($pl['xuse'] > 0) {
|
||||
$xu = $this->u->testAction(
|
||||
'`vars` = "use_priem_' . $btl->info['id'] . '_' . $this->u->info['id'] . '" AND `vals` = "' . $pl['id'] . '" LIMIT ' . $pl['xuse'],
|
||||
'`vars` = "use_priem_' . $btl->i->id . '_' . $this->u->info['id'] . '" AND `vals` = "' . $pl['id'] . '" LIMIT ' . $pl['xuse'],
|
||||
2
|
||||
);
|
||||
if ($xu[0] >= $pl['xuse']) {
|
||||
@@ -1535,7 +1536,7 @@ class Priems
|
||||
//требует чтобы пользователь с кем-то разменивался (при ожидании не пропадает, но не используется)
|
||||
$ga = mysql_fetch_assoc(
|
||||
mysql_query(
|
||||
'SELECT * FROM `battle_act` WHERE `battle` = "' . $btl->info['id'] . '" AND `uid1` = "' . $this->u->info['id'] . '" AND `uid2` = "' . $btl->users[$btl->uids[$this->u->info['id']]]['enemy'] . '" LIMIT 1'
|
||||
'SELECT * FROM `battle_act` WHERE `battle` = "' . $btl->i->id . '" AND `uid1` = "' . $this->u->info['id'] . '" AND `uid2` = "' . $btl->users[$btl->uids[$this->u->info['id']]]['enemy'] . '" LIMIT 1'
|
||||
)
|
||||
);
|
||||
if (isset($ga['id'])) {
|
||||
@@ -1960,7 +1961,7 @@ class Priems
|
||||
} else {
|
||||
$a1 = mysql_fetch_assoc(
|
||||
mysql_query(
|
||||
'SELECT * FROM `battle_act` WHERE `battle` = "' . $btl->info['id'] . '" AND `uid2` = "' . $this->u->info['id'] . '" AND `uid1` = "' . $this->u->info['enemy'] . '" LIMIT 1'
|
||||
'SELECT * FROM `battle_act` WHERE `battle` = "' . $btl->i->id . '" AND `uid2` = "' . $this->u->info['id'] . '" AND `uid1` = "' . $this->u->info['enemy'] . '" LIMIT 1'
|
||||
)
|
||||
);
|
||||
if (isset($a1['id'])) {
|
||||
@@ -1976,7 +1977,7 @@ class Priems
|
||||
} else {
|
||||
//бьем противника с пропуском хода
|
||||
mysql_query(
|
||||
'INSERT INTO `battle_act` (`battle`,`uid1`,`uid2`,`time`,`out1`,`type`,`tpo1`) VALUES ("' . $btl->info['id'] . '","' . $this->u->info['id'] . '","' . $this->u->info['enemy'] . '","' . time(
|
||||
'INSERT INTO `battle_act` (`battle`,`uid1`,`uid2`,`time`,`out1`,`type`,`tpo1`) VALUES ("' . $btl->i->id . '","' . $this->u->info['id'] . '","' . $this->u->info['enemy'] . '","' . time(
|
||||
) . '","1","1","2")'
|
||||
);
|
||||
}
|
||||
@@ -2191,7 +2192,7 @@ class Priems
|
||||
}
|
||||
if ($this->u->info['animal'] > 0 && $t == 2) {
|
||||
$use_lst = $this->u->testAction(
|
||||
'`uid` = "' . $this->u->info['id'] . '" AND `vars` = "animal_use' . $btl->info['id'] . '" LIMIT 1',
|
||||
'`uid` = "' . $this->u->info['id'] . '" AND `vars` = "animal_use' . $btl->i->id . '" LIMIT 1',
|
||||
1
|
||||
);
|
||||
if (!isset($use_lst['id'])) {
|
||||
@@ -2721,7 +2722,7 @@ class Priems
|
||||
$x++;
|
||||
}
|
||||
if ($pl['xuse'] > 0) {
|
||||
$this->u->addAction(time(), 'use_priem_' . $btl->info['id'] . '_' . $this->u->info['id'], $pl['id']);
|
||||
$this->u->addAction(time(), 'use_priem_' . $btl->i->id . '_' . $this->u->info['id'], $pl['id']);
|
||||
}
|
||||
$rt = ltrim($rt, ',');
|
||||
mysql_query('UPDATE `stats` SET ' . $rt . ' WHERE `id` = "' . $this->u->info['id'] . '" LIMIT 1');
|
||||
|
||||
Reference in New Issue
Block a user