game/_incl_data/class/Priem/261.php

50 lines
2.2 KiB
PHP
Raw Normal View History

<?php
/**
2023-01-10 16:29:32 +00:00
* Прием: Заряд: Поражение
2022-12-19 20:16:24 +00:00
* @var battleClass $btl
* @var $id
* @var $pl
*/
if (!$id) {
exit();
2022-06-06 21:30:34 +00:00
}
$params = [
'maxLimitbyStatic' => [1 => 90, 2 => 140, 3 => 175, 4 => 200, 5 => 244],
'query' => 'select x from eff_users where v2 = 260 and user_use = %s and uid = %s',
'query_remove_static' => 'delete from eff_users where v2 = 260 and user_use = %s and uid = %s',
'hpNow' => $btl->stats[$btl->uids[$this->ue['id']]]['hpNow'],
'hpAll' => $btl->stats[$btl->uids[$this->ue['id']]]['hpAll'],
'color' => '#0af',
'logtext' => '{tm1} ' . $btl->addlt(1, 19, $btl->users[$btl->uids[$this->u->info['id']]]['sex'], null),
];
$params = array_merge($params, [
'x' => mysql_fetch_array(mysql_query(sprintf($params['query'], $this->u->info['id'], $this->ue['id']))),
'damage' => '',
]);
$params['damage'] = mt_rand(1, $params['maxLimitbyStatic'][$params['x'][0]]);
if (empty($params['x'])) {
2023-01-10 16:29:32 +00:00
echo '<b style="color: red">На персонаже нет вашего заклятия Статики</b>';
$cup = true;
} else {
$params['damage'] = $btl->testYronPriem($this->u->info['id'], $this->ue['id'], 21, $params['damage'], 6, true);
$btl->priemYronSave($this->u->info['id'], $this->ue['id'], $params['damage'], 0);
$params['hpNow'] -= $params['damage'];
if ($params['hpNow'] > $params['hpAll']) {
$params['hpNow'] = $params['hpAll'];
} elseif ($params['hpNow'] < 0) {
$params['hpNow'] = 0;
}
$params['logtext'] .= sprintf("<b style='color: %s;'>-%s</b> [%s/%s]", $params['color'], $params['damage'], $params['hpNow'], $params['hpAll']);
$btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] = $params['hpNow'];
mysql_query('UPDATE `stats` SET `hpNow` = ' . $params['hpNow'] . ' WHERE `id` = ' . $this->ue['id']);
2023-01-10 16:29:32 +00:00
$btl->priemAddLog($id, 1, 2, $this->u->info['id'], $this->ue['id'], "<span style='color: {$params['color']}'>Заряд: Поражение</span>",
$params['logtext'], ($btl->hodID + 1));
mysql_query(sprintf($params['query_remove_static'], $this->u->info['id'], $this->ue['id']));
2023-01-10 16:29:32 +00:00
//Отнимаем тактики
$this->mintr($pl);
2022-06-06 21:30:34 +00:00
}
unset($params);