50 lines
2.2 KiB
PHP
50 lines
2.2 KiB
PHP
<?php
|
||
/**
|
||
* Прием: Заряд: Поражение
|
||
* @var battleClass $btl
|
||
* @var $id
|
||
* @var $pl
|
||
*/
|
||
if (!$id) {
|
||
exit();
|
||
}
|
||
$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'])) {
|
||
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']);
|
||
$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']));
|
||
//Отнимаем тактики
|
||
$this->mintr($pl);
|
||
|
||
}
|
||
unset($params);
|