game/_incl_data/class/Priem/237.php

131 lines
4.1 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
Прием: Разведка боем
Показывает все активные приемы на противнике 5 ходов
2022-06-06 21:30:34 +00:00
*/
$pvr = array();
if( isset($pr_tested_this) ) {
$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;
//
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;
2023-11-05 02:46:07 +00:00
$u1 = $uid1;
$u2 = $uid2;
2022-06-06 21:30:34 +00:00
}elseif( $uid == $uid2 ) {
$a = 2;
$b = 1;
2023-11-05 02:46:07 +00:00
$u1 = $uid2;
$u2 = $uid1;
2022-06-06 21:30:34 +00:00
}
if( isset($at['p'][$a]['priems']['kill'][$uid][$j_id]) ) {
mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$btl->stats[$btl->uids[$uid]]['u_priem'][$j_id][3].'" AND `uid` = "'.$uid.'" LIMIT 1');
unset($btl->stats[$btl->uids[$uid]]['u_priem'][$j_id]);
}
//
2023-01-10 16:29:32 +00:00
// -- конец приема
2022-06-06 21:30:34 +00:00
return $at;
};
unset( $pr_used_this );
}elseif( isset($pr_used_this) ) {
$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'];
//echo '['.$uid1.'|'.$uid2.'|*'.$uid.'*]';
if( $uid == $uid1 ) {
$a = 1;
$b = 2;
2023-11-05 02:46:07 +00:00
$u1 = $uid1;
$u2 = $uid2;
2022-06-06 21:30:34 +00:00
$uid1 = $btl->atacks[$id]['uid1'];
$uid2 = $btl->atacks[$id]['uid2'];
}elseif( $uid == $uid2 ) {
$a = 2;
$b = 1;
2023-11-05 02:46:07 +00:00
$u1 = $uid2;
$u2 = $uid1;
2022-06-06 21:30:34 +00:00
$uid1 = $btl->atacks[$id]['uid2'];
$uid2 = $btl->atacks[$id]['uid1'];
}
if( $a > 0 ) {
$j = 0; $k = 0; $wp = 3;
$pvrt = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$uid2.'" AND `v2` = "45" AND `delete` = 0 LIMIT 1'));
while($j < count($at['p'][$a]['atack'])) {
if( isset($at['p'][$a]['atack'][$j]['yron']) && (
$at['p'][$a]['atack'][$j][1] == 1 ||
$at['p'][$a]['atack'][$j][1] == 4 ||
$at['p'][$a]['atack'][$j][1] == 5 ))
{
$pvr['hp'] =6 * $btl->users[$btl->uids[$u1]]['level'];
$pvr['hp'] = $btl->testYronPriem( $u1, $u2, 12, $pvr['hp'], -1, true, false, 0 );
$pvr['mg'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$uid2.'" AND `v2` = "249" AND `delete` = 0 LIMIT 1'));
if( $pvr['hp'] <= 1 && !isset($pvr['mg']))
{
$pvr['hp'] = 0;
$at['p'][$a]['atack'][$j]['yron']['y'] = 1;
$at['p'][$a]['atack'][$j]['yron']['r'] = -1;
$at['p'][$a]['atack'][$j]['yron']['k'] = 1;
$at['p'][$a]['atack'][$j]['yron']['m_k'] = 1;
$at['p'][$a]['atack'][$j]['yron']['m_y'] = 1;
}
if( $pvr['used'] == 0 && !isset($at['p'][$a]['priems']['kill'][$uid][$j_id]) ) {
//
2023-01-10 16:29:32 +00:00
$btl->priemAddLogFast( $uid1, 0, "Разведка боем",
2022-06-06 21:30:34 +00:00
'{tm1} '.$btl->addlt(1 , 17 , $btl->users[$btl->uids[$uid1]]['sex'] , NULL).'',
1, time() );
//
//mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$btl->stats[$btl->uids[$uid1]]['u_priem'][$j_id][3].'" AND `uid` = "'.$uid1.'" LIMIT 1');
mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `delete` = "0" AND `uid` = "'.$uid1.'" AND `v2`= "237" LIMIT 1');
unset($btl->stats[$btl->uids[$uid1]]['u_priem'][$j_id]);
mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `v2` = "238" AND `uid` = "'.$uid2.'" ');
2023-01-10 16:29:32 +00:00
$priem->addPriem($uid2,238,'add_seeAllEff=1',0,77,6,$uid1,5,'разведкабоем',0,0,0,0,0,1);
2022-06-06 21:30:34 +00:00
$at['p'][$a]['priems']['kill'][$uid][$j_id] = true;
if(isset($pvrt['id']))
{
$pvr['hp'] = 0;
$at['p'][$a]['atack'][$j]['yron']['y'] = 1;
$at['p'][$a]['atack'][$j]['yron']['r'] = -1;
$at['p'][$a]['atack'][$j]['yron']['k'] = 1;
$at['p'][$a]['atack'][$j]['yron']['m_k'] = 1;
$at['p'][$a]['atack'][$j]['yron']['m_y'] = 1;
}
//
}
}
$j++;
}
}
2023-01-10 16:29:32 +00:00
// -- конец приема
2022-06-06 21:30:34 +00:00
return $at;
};
unset( $pr_used_this );
}else{
2023-01-10 16:29:32 +00:00
//Действие при клике
2022-06-06 21:30:34 +00:00
$this->addEffPr($pl,$id);
}
unset($pvr);
?>