Вход Регистрация
Файл: js/func_boi.js
Строк: 172
<?php
function hp_del(user,vrag) {
document.getElementById('hp_del_v').style.display ='none';
document.getElementById('hp_del_u').style.display ='none';
}

function 
size_boi() {
var 
width=window.innerWidth;
if(
width>=500){
document.getElementsByClassName('boi_name_vrag')[0].style.fontSize ='16px';
document.getElementsByClassName('boi_name_user')[0].style.fontSize ='16px';
}
else if(
width<500 && width>=315){
document.getElementsByClassName('boi_name_vrag')[0].style.fontSize ='14px';
document.getElementsByClassName('boi_name_user')[0].style.fontSize ='14px';
document.getElementsByClassName('hp_del2')[0].style.fontSize ='14px';
document.getElementsByClassName('hp_del2')[1].style.fontSize ='14px';
document.getElementsByClassName('hp_isc')[0].style.fontSize ='14px';
document.getElementById('stats_vrag').style.fontSize ='13px';
document.getElementById('stats_user').style.fontSize ='13px';
document.getElementById('img_user').style.width ='70px';
document.getElementById('img_vrag').style.width ='70px';
}
else{
document.getElementsByClassName('boi_name_vrag')[0].style.fontSize ='12px';
document.getElementsByClassName('boi_name_user')[0].style.fontSize ='12px';
document.getElementsByClassName('hp_del2')[0].style.fontSize ='13px';
document.getElementsByClassName('hp_del2')[1].style.fontSize ='13px';
document.getElementsByClassName('hp_isc')[0].style.fontSize ='13px';
document.getElementById('stats_vrag').style.fontSize ='10px';
document.getElementById('stats_user').style.fontSize ='10px';
document.getElementById('img_user').style.width ='40px';
document.getElementById('img_vrag').style.width ='42px';
document.getElementById('img_att_u').style.width ='12px';
document.getElementById('img_deff_u').style.width ='12px';
document.getElementById('img_hp_u').style.width ='12px';
document.getElementById('img_att_v').style.width ='12px';
document.getElementById('img_deff_v').style.width ='12px';
document.getElementById('img_hp_v').style.width ='12px';
document.getElementById('name_user_b').style.margin ='3px 0 0px 0';
document.getElementById('name_vrag_b').style.margin ='0px 0 0px 0';
}}


function 
run_s_time() {time_serv++;

if(
time_att<time_serv){
time_att_b.innerHTML ='';
}else{
ost=time_att+1-time_serv;
time_att_b.innerHTML ='('+ost+')';
}

}




function 
attack_fight(id) {
if(
time_att<time_serv){
var 
xhr = new XMLHttpRequest();
xhr.open('GET','/system/func.php?m=fight&id='+id+'&time='+time_logfalse);
xhr.send();
if (
xhr.status != 200) {
alert('Перезагрузите игру');
} else {
stats JSON.parse(xhr.responseText);
if(
stats.error!=0){
window.location "/fight";
}else{
time_att=stats.time_att;
time_log=time_serv;
time_serv=stats.time_serv;
document.getElementById('time_att').innerHTML ='(2)';
if(
typeof(stats.hp_regen) != "undefined" && stats.hp_regen !== null) {hp_user=stats.hp_regen;}
hp_user=stats.hp_user;
att_user=stats.att_user;
if(
typeof(stats.att_vrag) != "undefined" && stats.att_vrag !== null) {
att_vrag=stats.att_vrag;
hp_user=hp_user-att_vrag;
}
if(
hp_vrag>0){
hp_vrag=stats.hp_vrag-att_user;
if(
hp_user<1){hp_user=0;window.location "/fight";}
if(
hp_vrag<1){hp_vrag=0;
window.location "/fight";}

proc_user=(hp_user/hp_user_max)*100;if(proc_user>100){proc_user=100;}
proc_vrag=(hp_vrag/hp_vrag_max)*100;
document.getElementById('hp_proc_block2_v').style.width =proc_vrag+'%';
document.getElementById('hp_proc_block2_u').style.width =proc_user+'%';
document.getElementById('hp_proc_block2_small_v').style.width =proc_vrag+'%';
document.getElementById('hp_proc_block2_small_u').style.width =proc_user+'%';
document.getElementById('hp_small_v').innerHTML =hp_vrag;
document.getElementById('hp_small_u').innerHTML =hp_user;
document.getElementById('hp_del_v').innerHTML =stats.krit+'-'+att_user;
document.getElementById('hp_del_v').style.display ='block';
if(
typeof(stats.att_vrag) != "undefined" && stats.att_vrag !== null) {
document.getElementById('hp_del_u').innerHTML ='-'+att_vrag;
document.getElementById('hp_del_u').style.display ='block';
}
document.getElementById('log_boi').innerHTML='<div class="c8 t_13">Вы нанесли '+att_user+' урона</div>'+stats.log+document.getElementById('log_boi').innerHTML;
setTimeout("hp_del()"1000);
}else{
window.location "/fight";}}}}}
?>
Онлайн: 2
Реклама