game/_incl_data/class/priem/302.php

98 lines
3.6 KiB
PHP
Raw Normal View History

2023-03-31 18:42:06 +00:00
<?php
2022-06-06 21:30:34 +00:00
if(!defined('GAME')) {
die();
}
/*
2023-01-10 16:29:32 +00:00
Прием: Подлечить
2022-06-06 21:30:34 +00:00
*/
$pvr = array();
if( isset($pr_used_this) && isset($pr_moment) ) {
2023-01-10 16:29:32 +00:00
//Каждый ход
2022-06-06 21:30:34 +00:00
$fx_priem = function( $id , $at , $uid, $j_id ) {
2023-01-10 16:29:32 +00:00
// -- начало приема
2022-06-06 21:30:34 +00:00
global $u, $btl, $priem;
//
2023-01-10 16:29:32 +00:00
//Параметры приема
2022-06-06 21:30:34 +00:00
$pvr['used'] = 0;
//
$uid1 = $btl->atacks[$id]['uid1'];
$uid2 = $btl->atacks[$id]['uid2'];
if( $uid == $uid1 ) {
$a = 1;
$b = 2;
$u1 = ${'uid1'};
$u2 = ${'uid2'};
}elseif( $uid == $uid2 ) {
$a = 2;
$b = 1;
$u1 = ${'uid2'};
$u2 = ${'uid1'};
}
if( $a > 0 ) {
2023-01-10 16:29:32 +00:00
//Проверяем эффект
2022-06-06 21:30:34 +00:00
$prv['j_priem'] = $btl->stats[$btl->uids[$u1]]['u_priem'][$j_id][0];
$prv['priem_th'] = $btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['id'];
2023-01-10 16:29:32 +00:00
//действия
2022-06-06 21:30:34 +00:00
$pvr['hp'] = 20);
2023-01-10 16:29:32 +00:00
$pvr['hp'] = $priem->magatack( $btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['user_use'], $u1, $pvr['hp'], 'тьма', 1 );
2022-06-06 21:30:34 +00:00
$pvr['promah_type'] = $pvr['hp'][3];
$pvr['promah'] = $pvr['hp'][2];
$pvr['krit'] = $pvr['hp'][1];
$pvr['hp'] = $pvr['hp'][0];
$btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data'] = $pvr['redata'];
mysql_query('UPDATE `eff_users` SET `data` = "'.$pvr['redata'].'" WHERE `id` = "'.$btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['id'].'" LIMIT 1');
//
//$btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] = $pvr['hpNow'];
//$btl->users[$btl->uids[$this->ue['id']]]['hpNow'] = $pvr['hpNow'];
//
$sp81 = mysql_query('SELECT `id` FROM `users` WHERE `battle` = "'.$u->info['battle'].'"');
while( $pl81 = mysql_fetch_array($sp81) ) {
$pl82 = mysql_fetch_array(mysql_query('SELECT `id`,`hpNow`,`team` FROM `stats` WHERE `id` = "'.$pl81['id'].'" LIMIT 1'));
if($pl82['hpNow'] >= 1 && $btl->stats[$btl->uids[$pl82['id']]]['hpNow'] >= 1) {
$rand_user[] = $u->info['id'];
}
}
//
$pvr['hp'] = 20;
$pvr['hp'] = $btl->testYronPriem( $btl->stats[$btl->uids[$rand_user]]['effects'][$prv['j_priem']]['user_use'], $rand_user, 12, $pvr['hp'], -1, true , false , 0);
//
$pvr['rndu']['id'] = $rand_user;
$pvr['color'] = '006699';
$pvr['color2'] = '006699';
$pvr['hpSee'] = '--';
$pvr['hp'] = round($pvr['hp']/2);
if( $pvr['hp'] > 0 ) {
$pvr['hpSee'] = '+'.$pvr['hp'];
}else{
$pvr['hp'] = 0;
}
$btl->stats[$btl->uids[$pvr['rndu']['id']]]['hpNow'] += $pvr['hp'];
$btl->users[$btl->uids[$pvr['rndu']['id']]]['hpNow'] += $pvr['hp'];
mysql_query('UPDATE `stats` SET `hpNow` = "'.$btl->stats[$btl->uids[$pvr['rndu']['id']]]['hpNow'].'" WHERE `id` = "'.$pvr['rndu']['id'].'" LIMIT 1');
$pvr['hpNow'] = floor($btl->stats[$btl->uids[$pvr['rndu']['id']]]['hpNow']);
$pvr['hpAll'] = $btl->stats[$btl->uids[$pvr['rndu']['id']]]['hpAll'];
//
2023-01-10 16:29:32 +00:00
//$btl->priemAddLogFast( $pvr['rndu']['id'], 0, "<font color^^^^#".$pvr['color2'].">Темное ранение</font>",
2022-06-06 21:30:34 +00:00
// '{tm1} ... <font Color=#'.$pvr['color'].'><b>'.$pvr['hpSee'].'</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']',
//1, time() );
//
2023-01-10 16:29:32 +00:00
$prv['text2'] = '{tm1} {u1} подвергся действию &quot;<b>Подлечить</b>&quot; и восстановил здоровье. <font Color=#'.$pvr['color'].'><b>'.$pvr['hpSee'].'</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']';
2022-06-06 21:30:34 +00:00
//
$btl->priemAddLog( $id, 1, 2, $pvr['rndu']['id'], $u1,
2023-01-10 16:29:32 +00:00
'<font color^^^^#'.$prv['color2'].'>Подлечить</font>',
2022-06-06 21:30:34 +00:00
$prv['text2'],
($btl->hodID)
);
//
//
}
2023-01-10 16:29:32 +00:00
// -- конец приема
2022-06-06 21:30:34 +00:00
return $at;
};
unset( $pr_used_this );
}