2022-06-06 21:30:34 +00:00
|
|
|
|
top.goSit(1);
|
2023-11-02 13:57:39 +00:00
|
|
|
|
var zas = [];
|
2022-06-06 21:30:34 +00:00
|
|
|
|
var priem_use = 0;
|
|
|
|
|
var magic_use = 0;
|
|
|
|
|
var use_on_pers = 'none';
|
|
|
|
|
var smena_login = 'none';
|
|
|
|
|
var leader_login = 'none';
|
|
|
|
|
var leader_type = 1;
|
|
|
|
|
|
2023-11-02 13:57:39 +00:00
|
|
|
|
zas[1] = 0;
|
|
|
|
|
zas[2] = 0;
|
|
|
|
|
zas[3] = 0;
|
|
|
|
|
zas[4] = 0;
|
|
|
|
|
zas[5] = 0;
|
|
|
|
|
var zbs = [];
|
|
|
|
|
zbs[1] = 0;
|
2022-06-06 21:30:34 +00:00
|
|
|
|
var sel_atack = 1;
|
|
|
|
|
var nos = 0;
|
|
|
|
|
var noconnect = 5;
|
|
|
|
|
var connect = 0;
|
|
|
|
|
var eatk = 0;
|
|
|
|
|
var ggcode = '2014';
|
|
|
|
|
var irn = 0;
|
|
|
|
|
|
|
|
|
|
function magic_div(id, name, img, title) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function testClearZone() {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (top.slcbrc[4] === 0) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
all_radio_off();
|
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2024-05-10 11:32:06 +00:00
|
|
|
|
async function usepriem(id) {
|
|
|
|
|
irn++;
|
|
|
|
|
await $.post(`jx/battle/refresh.php?rnd=${ggcode}&irn=${irn}`, {
|
|
|
|
|
idlog: top.id_log,
|
|
|
|
|
usepriem: id,
|
|
|
|
|
useon: use_on_pers
|
|
|
|
|
}, function (data) {
|
|
|
|
|
$("#ref").html(data);
|
|
|
|
|
});
|
|
|
|
|
use_on_pers = 'none';
|
|
|
|
|
top.goSit(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function useitem(id, use_item_on) {
|
|
|
|
|
irn++;
|
|
|
|
|
if (top.c.noEr === 0) {
|
|
|
|
|
top.c.noEr = 1;
|
|
|
|
|
clearTimeout(top.c.noErTmr);
|
|
|
|
|
top.c.noErTmr = setTimeout('top.c.noEr = 0;', 1000);
|
2024-02-10 01:12:05 +00:00
|
|
|
|
await $.post(`jx/battle/refresh.php?rnd=${ggcode}&irn=${irn}`, {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
idlog: top.id_log,
|
2024-05-10 11:32:06 +00:00
|
|
|
|
useitem: id,
|
|
|
|
|
useitemon: use_item_on
|
2023-11-02 13:57:39 +00:00
|
|
|
|
}, function (data) {
|
|
|
|
|
$("#ref").html(data);
|
|
|
|
|
});
|
|
|
|
|
}
|
2024-05-10 11:32:06 +00:00
|
|
|
|
return top.goSit(1);
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function volna(id) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
document.getElementById('volna').innerHTML = `Волна: ${id}`;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-10 11:32:06 +00:00
|
|
|
|
function change_radioKeys(id = 0) {
|
|
|
|
|
let jo;
|
|
|
|
|
let radio;
|
|
|
|
|
let z = 0, t = '';
|
|
|
|
|
let i = 1, j = 1;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
while (i <= za) {
|
|
|
|
|
j = 1;
|
|
|
|
|
jo = 0;
|
|
|
|
|
while (j <= 5) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
radio = document.getElementById(`atack_${i}_${j}`);
|
|
|
|
|
if (radio) {
|
|
|
|
|
if (radio.className != null && radio.className === "radio_on") jo++;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
}
|
|
|
|
|
j++;
|
|
|
|
|
}
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (jo === 0 && z === 0) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
z = i;
|
|
|
|
|
t = 'atack';
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (z === 0) {
|
|
|
|
|
i = 1;
|
|
|
|
|
jo = 0;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
while (i <= 5) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
radio = document.getElementById(`block_1_${i}`);
|
|
|
|
|
if (radio) {
|
|
|
|
|
if (radio.className != null && radio.className === "radio_on") jo++;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
}
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (jo === 0 && z === 0) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
z = 1;
|
|
|
|
|
t = 'block';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (z === 0 || id === 0) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
all_radio_off();
|
|
|
|
|
refleshPoints();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (z > 0) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (id === 0) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
//автовыставление
|
|
|
|
|
} else change_radio(z, id, t, 1)
|
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function change_radio(id, zone, type, r) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
radio_off(id, zone, type);
|
2024-05-10 11:32:06 +00:00
|
|
|
|
const radio = document.getElementById(`${type}_${id}_${zone}`);
|
2023-11-02 13:57:39 +00:00
|
|
|
|
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (radio.className === "radio_on" && r === 0) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
radio.className = "radio_off";
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (type === 'atack') zas[id] = 0;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
else zbs[id] = 0;
|
|
|
|
|
} else {
|
|
|
|
|
radio.className = "radio_on";
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (type === 'atack') zas[id] = zone;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
else zbs[id] = zone;
|
|
|
|
|
}
|
|
|
|
|
refleshPoints();
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function tactic(id, value) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
document.getElementById(`tac${id}`).innerHTML = value;
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function refleshPoints() {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
clearZone();
|
2024-05-10 11:32:06 +00:00
|
|
|
|
let i = 5;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
while (i >= 1) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (zas[i] === 0) lineAtack(i);
|
2023-11-02 13:57:39 +00:00
|
|
|
|
i--;
|
|
|
|
|
}
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (zbs[1] === 0) lineBlock();
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function lineAtack(id) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
nos++;
|
2024-05-10 11:32:06 +00:00
|
|
|
|
let j = 1;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
while (j <= 5) {
|
|
|
|
|
document.getElementById(`zatack${id}_${j}`).className = 'zoneCh_yes';
|
|
|
|
|
j++;
|
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function lineBlock() {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
nos++;
|
2024-05-10 11:32:06 +00:00
|
|
|
|
let j = 1;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
while (j <= 5) {
|
|
|
|
|
document.getElementById(`zblock1_${j}`).className = 'zoneCh_yes';
|
|
|
|
|
j++;
|
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function clearZone() {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
nos = 0;
|
2024-05-10 11:32:06 +00:00
|
|
|
|
let i = 1;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
while (i <= 5) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
let j = 1;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
while (j <= 5) {
|
|
|
|
|
document.getElementById(`zatack${i}_${j}`).className = 'zoneCh_no';
|
|
|
|
|
j++;
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
}
|
2024-05-10 11:32:06 +00:00
|
|
|
|
i = 1;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
while (i <= 5) {
|
|
|
|
|
document.getElementById(`zblock1_${i}`).className = 'zoneCh_no';
|
|
|
|
|
i++;
|
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function select_atack(id, r) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
let i = 5;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
while (i >= 1) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (zas[i] === 0) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
if (i <= za) sel_atack = i
|
|
|
|
|
}
|
|
|
|
|
i--;
|
|
|
|
|
}
|
|
|
|
|
if (sel_atack > za) sel_atack = 1;
|
2022-06-06 21:30:34 +00:00
|
|
|
|
|
2023-11-02 13:57:39 +00:00
|
|
|
|
change_radio(sel_atack, id, 'atack', r);
|
|
|
|
|
sel_atack++;
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function radio_off(id, zone, type) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
let i = 1;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
while (i <= 5) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (document.getElementById(`${type}_${id}_${i}`) && i !== zone) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
document.getElementById(`${type}_${id}_${i}`).className = "radio_off";
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (type === 'atack') zas[id] = 0;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
else zbs[id] = 0;
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
2023-11-02 13:57:39 +00:00
|
|
|
|
|
2022-06-06 21:30:34 +00:00
|
|
|
|
function all_radio_off() {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
let i = 1;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
while (i <= 5) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
let j = 1;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
while (j <= 5) {
|
|
|
|
|
document.getElementById(`atack_${j}_${i}`).className = "radio_off";
|
|
|
|
|
j++;
|
|
|
|
|
}
|
|
|
|
|
document.getElementById(`block_1_${i}`).className = "radio_off";
|
|
|
|
|
zas[i] = 0;
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
zbs[1] = 0;
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
2023-11-02 13:57:39 +00:00
|
|
|
|
|
2022-06-06 21:30:34 +00:00
|
|
|
|
function genZoneBlock() {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
let i = 1;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
while (i <= 5) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
let j = 1;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
while (j <= 3) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (j === zb) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
document.getElementById(`txtb${i}_${j}`).style.display = '';
|
|
|
|
|
} else {
|
|
|
|
|
document.getElementById(`txtb${i}_${j}`).style.display = 'none';
|
|
|
|
|
}
|
|
|
|
|
j++;
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function genZoneAtack() {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
let i = 1;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
while (i <= 5) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
let j = 1;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
while (j <= 5) {
|
|
|
|
|
if (i <= za) {
|
|
|
|
|
document.getElementById(`zatack${i}_${j}`).style.display = '';
|
|
|
|
|
} else {
|
|
|
|
|
document.getElementById(`zatack${i}_${j}`).style.display = 'none';
|
|
|
|
|
}
|
|
|
|
|
j++;
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
|
|
|
|
|
|
function genteam(team) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
document.getElementById('teams').innerHTML = team;
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2024-05-10 11:32:06 +00:00
|
|
|
|
async function reflesh() {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
irn++;
|
|
|
|
|
|
|
|
|
|
if (battleFinishData != -1) mainstatus(0);
|
|
|
|
|
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (battleFinishData == -1) {
|
|
|
|
|
if (top.c.noEr === 0) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
top.c.noEr = 1;
|
|
|
|
|
clearTimeout(top.c.noErTmr);
|
|
|
|
|
top.c.noErTmr = setTimeout('top.c.noEr = 0;', 1000);
|
2024-02-10 01:12:05 +00:00
|
|
|
|
await $.post(`jx/battle/refresh.php?irn=${irn}&rnd=${ggcode}`, {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
id: 'reflesh',
|
|
|
|
|
idlog: top.id_log,
|
|
|
|
|
idpr: priem_use,
|
|
|
|
|
mgid: magic_use,
|
|
|
|
|
useon: use_on_pers,
|
|
|
|
|
smn: smena_login,
|
|
|
|
|
ldrl: leader_login,
|
|
|
|
|
ldrt: leader_type
|
|
|
|
|
}, function (data) {
|
|
|
|
|
$("#ref").html(data);
|
|
|
|
|
});
|
|
|
|
|
}
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (g_iCount !== 45) g_iCount = 45;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function autobattle() {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
let i = 1;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
while (i <= za) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (zas[i] === 0 || top.slcbrc[4] === 1) {
|
|
|
|
|
zas[i] = Math.floor(Math.random() * 5 + 1);
|
2023-11-02 13:57:39 +00:00
|
|
|
|
change_radio(i, zas[i], 'atack', 1);
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
}
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (zbs[1] === 0 || top.slcbrc[4] === 1) {
|
|
|
|
|
zbs[1] = Math.floor(Math.random() * 5 + 1);
|
2023-11-02 13:57:39 +00:00
|
|
|
|
change_radio(1, zbs[1], 'block', 1);
|
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// sleep time expects milliseconds
|
|
|
|
|
function sleep(time) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
return new Promise((resolve) => setTimeout(resolve, time));
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-01-08 01:33:20 +00:00
|
|
|
|
// Действите при выставлении хода и нажатии на Вперёд!
|
2022-06-06 21:30:34 +00:00
|
|
|
|
async function atack() {
|
2024-02-10 01:12:05 +00:00
|
|
|
|
if (top.slcbrc[3] === 1) autobattle();
|
2023-11-02 13:57:39 +00:00
|
|
|
|
|
2024-02-10 01:12:05 +00:00
|
|
|
|
const ago = `${zas[1]}_${zas[2]}_${zas[3]}_${zas[4]}_${zas[5]}`;
|
|
|
|
|
const bgo = zbs[1];
|
2023-11-02 13:57:39 +00:00
|
|
|
|
|
|
|
|
|
irn++;
|
2024-02-10 01:12:05 +00:00
|
|
|
|
if (top.c.noEr === 0) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
top.c.noEr = 1;
|
|
|
|
|
clearTimeout(top.c.noErTmr);
|
|
|
|
|
top.c.noErTmr = setTimeout('top.c.noEr = 0;', 1000);
|
2024-02-10 01:12:05 +00:00
|
|
|
|
await $.post(`jx/battle/refresh.php?irn=${irn}&rnd=${ggcode}`, {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
atack: ago,
|
|
|
|
|
block: bgo,
|
|
|
|
|
idlog: top.id_log,
|
|
|
|
|
idpr: priem_use,
|
|
|
|
|
mgid: magic_use,
|
|
|
|
|
useon: use_on_pers,
|
|
|
|
|
smn: smena_login,
|
|
|
|
|
ldrl: leader_login,
|
|
|
|
|
ldrt: leader_type
|
|
|
|
|
}, function (data) {
|
|
|
|
|
$("#ref").html(data);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-06 21:30:34 +00:00
|
|
|
|
var g_iCount = 45;
|
2024-05-10 11:32:06 +00:00
|
|
|
|
let tmr0057 = null;
|
2022-06-06 21:30:34 +00:00
|
|
|
|
|
|
|
|
|
// 1.1
|
|
|
|
|
function startCountdown() {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (tmr0057 !== null) clearTimeout(tmr0057);
|
2023-11-02 13:57:39 +00:00
|
|
|
|
if ((g_iCount - 1) >= 0) {
|
|
|
|
|
g_iCount -= 1;
|
2024-05-10 11:32:06 +00:00
|
|
|
|
return tmr0057 = setTimeout(startCountdown, 1000);
|
2023-11-02 13:57:39 +00:00
|
|
|
|
}
|
|
|
|
|
reflesh();
|
2024-05-10 11:32:06 +00:00
|
|
|
|
return tmr0057 = setTimeout(startCountdown, 1000);
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2024-05-10 11:32:06 +00:00
|
|
|
|
let img_battle = `<img alt="" src='https://${top.c.img}/i/battle/1.jpg'>`;
|
2022-06-06 21:30:34 +00:00
|
|
|
|
|
|
|
|
|
function mainstatus(id) {
|
|
|
|
|
|
2024-05-10 11:32:06 +00:00
|
|
|
|
id = +id;
|
|
|
|
|
if (isNaN(id)) id = 0;
|
|
|
|
|
|
2023-11-02 13:57:39 +00:00
|
|
|
|
if (smnpty <= 0) {
|
|
|
|
|
$('#btn_down_img2').css({'display': 'none'});
|
|
|
|
|
} else {
|
|
|
|
|
$('#btn_down_img2').css({'display': ''});
|
|
|
|
|
$('#btn_down_img2').attr('title', `Смена противника (${smnpty})`);
|
|
|
|
|
}
|
|
|
|
|
if (battleFinishData != -1) { // хуй знает че такое
|
|
|
|
|
document.getElementById('mainpanel2').style.display = ''; // 4
|
|
|
|
|
document.getElementById('go_btn').style.display = 'none'; // 4
|
|
|
|
|
document.getElementById('mainpanel').style.display = 'none'; // 4
|
|
|
|
|
document.getElementById('mainpanel222').style.display = 'none'; // 4
|
|
|
|
|
document.getElementById('reflesh_btn').style.display = 'none'; // 3
|
|
|
|
|
document.getElementById('back_menu_down').style.display = ''; // 2
|
|
|
|
|
|
|
|
|
|
document.getElementById('btn_down_img1').style.display = ''; // 2
|
|
|
|
|
document.getElementById('btn_down_img2').style.display = 'none'; // 2
|
|
|
|
|
|
|
|
|
|
document.getElementById("ref").innerHTML = `<center><font color='red'><b>${battleFinishData}</b></font></center>`;
|
|
|
|
|
rand_img();
|
|
|
|
|
document.getElementById("player2").innerHTML = `<div style='margin-top:18px;' align='right'>${img_battle}</div>`;
|
|
|
|
|
document.getElementById('player2_login').style.display = 'none';
|
2024-05-10 11:32:06 +00:00
|
|
|
|
} else if (id === 1) //Можно ударить противника ( доступный удар )
|
2023-11-02 13:57:39 +00:00
|
|
|
|
{
|
|
|
|
|
document.getElementById('mainpanel').style.display = ''; // 4
|
|
|
|
|
document.getElementById('player2_login').style.display = '';
|
|
|
|
|
document.getElementById('mainpanel222').style.display = ''; // 4
|
|
|
|
|
document.getElementById('mainpanel2').style.display = 'none'; // 4
|
|
|
|
|
document.getElementById('go_btn').style.display = ''; // 4
|
|
|
|
|
document.getElementById('btn_down_img1').setAttribute("onclick", "reflesh();");
|
|
|
|
|
document.getElementById('go_btn').setAttribute("class", "buttons btnnew btnnew2");
|
|
|
|
|
document.getElementById('go_btn').setAttribute("onclick", "atackt();");
|
|
|
|
|
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (document.getElementById('reflesh_btn')) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
document.getElementById('reflesh_btn').style.display = 'none';
|
|
|
|
|
}
|
2024-05-10 11:32:06 +00:00
|
|
|
|
} else if (id === 2) //Ожидаем хода противника ( обновить )
|
2023-11-02 13:57:39 +00:00
|
|
|
|
{
|
|
|
|
|
document.getElementById('mainpanel').style.display = 'none'; // 4
|
|
|
|
|
document.getElementById('mainpanel222').style.display = 'none'; // 4
|
|
|
|
|
document.getElementById('mainpanel2').style.display = ''; // 4
|
|
|
|
|
document.getElementById('go_btn').style.display = 'none'; // 4
|
|
|
|
|
document.getElementById('reflesh_btn').style.display = ''; // 3
|
|
|
|
|
rand_img();
|
|
|
|
|
document.getElementById("player2").innerHTML = `<div style='margin-top:18px;' align='right'>${img_battle}</div>`;
|
|
|
|
|
document.getElementById('player2_login').style.display = 'none';
|
|
|
|
|
document.getElementById('btn_down_img1').setAttribute("onclick", "reflesht();");
|
|
|
|
|
document.getElementById('reflesh_btn').setAttribute("class", "buttons btnnew btnnew2");
|
|
|
|
|
document.getElementById('reflesh_btn').setAttribute("onclick", "reflesht();");
|
2024-05-10 11:32:06 +00:00
|
|
|
|
} else if (id === 3) // Проиграли. Ожидаем завершения поединка ( кнопка вернутся с поединка )
|
2023-11-02 13:57:39 +00:00
|
|
|
|
{
|
|
|
|
|
document.getElementById('mainpanel2').style.display = ''; // 4
|
|
|
|
|
document.getElementById('go_btn').style.display = 'none'; // 4
|
|
|
|
|
document.getElementById('mainpanel').style.display = 'none'; // 4
|
|
|
|
|
document.getElementById('mainpanel222').style.display = 'none'; // 4
|
|
|
|
|
document.getElementById('back_menu_down').style.display = 'none'; // 2
|
|
|
|
|
document.getElementById('reflesh_btn').style.display = ''; // 3
|
|
|
|
|
document.getElementById('reflesh_btn').setAttribute("class", "buttons inpBtl btnnew");
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
document.getElementById('btn_down_img1').setAttribute("onclick", "reflesh();");
|
|
|
|
|
|
|
|
|
|
document.getElementById('btn_down_img1').style.display = ''; // 2
|
|
|
|
|
document.getElementById('btn_down_img2').style.display = 'none'; // 2
|
|
|
|
|
|
|
|
|
|
document.getElementById("ref").innerHTML = "<font color='red'><b>Вы повержены. Ожидайте пока поединок завершат другие бойцы...</b></font>";
|
|
|
|
|
document.getElementById("player2").innerHTML = `<div style='margin-top:18px;' align='right'>${img_battle}</div>`;
|
|
|
|
|
document.getElementById('player2_login').style.display = 'none';
|
|
|
|
|
}
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (!document.getElementById('mainpanel').style.display) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
document.getElementById('mainpanel2').style.display = 'none';
|
|
|
|
|
}
|
|
|
|
|
top.goSit(1);
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
2023-11-02 13:57:39 +00:00
|
|
|
|
|
2022-06-06 21:30:34 +00:00
|
|
|
|
function rand_img() {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
img_battle = `<img alt="" src='//img.new-combats.tech/i/battle/${(Math.floor(Math.random() * 29))}.jpg'>`;
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var fstlh = 0;
|
|
|
|
|
var lsti = 0;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
var lsthd = [];
|
|
|
|
|
var id_log_ar = [];
|
2022-06-06 21:30:34 +00:00
|
|
|
|
var id_log;
|
|
|
|
|
var type_log = top.type_log;
|
2023-11-02 13:57:39 +00:00
|
|
|
|
|
2024-05-10 11:32:06 +00:00
|
|
|
|
function add_log(id, text, hod_id, vars) {
|
|
|
|
|
if (top.des === 1) type_log = 0
|
2023-11-02 13:57:39 +00:00
|
|
|
|
else type_log = 1;
|
|
|
|
|
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (type_log === 1) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
chsee = 'chsee2';
|
2024-05-10 11:32:06 +00:00
|
|
|
|
|
2023-11-02 13:57:39 +00:00
|
|
|
|
//if(id_log_ar[id]!=id)
|
|
|
|
|
//{
|
|
|
|
|
text = looklogrep(text, vars);
|
|
|
|
|
id_log_ar[id] = id;
|
|
|
|
|
id_log = id;
|
|
|
|
|
// if (top.frames['main'].document.getElementById("battle_log_" + hod_id + "") == undefined && hod_id != 1) {
|
|
|
|
|
if (!top.frames['main'].document.getElementById(`battle_log_${hod_id}`) && hod_id != 1) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (fstlh === 0) fstlh = hod_id
|
2023-11-02 13:57:39 +00:00
|
|
|
|
lsthd[lsti] = hod_id;
|
|
|
|
|
lsti++;
|
|
|
|
|
$(top.frames['main'].document.getElementById('battle_logg')).prepend(`<div style="padding-top:2px;padding-bottom:2px;" id="battle_log_'${hod_id}" class="battle_hod_style"></div>`);
|
|
|
|
|
} else if (!top.frames['main'].document.getElementById(`battle_log_${hod_id}`)) {
|
|
|
|
|
top.frames['main'].document.getElementById('battle_logg').innerHTML = top.frames['main'].document.getElementById('battle_logg').innerHTML + `<div style="padding-top:2px;padding-bottom:2px;" id="battle_log_${hod_id}"></div>`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!top.frames['main'].document.getElementById(`log_id_${id}`)) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
$(top.frames['main'].document.getElementById(`battle_log_${hod_id}`)).prepend(`<span id="log_id_${id}" class="foryou0">${text}</span><br>`);
|
2023-11-02 13:57:39 +00:00
|
|
|
|
}
|
|
|
|
|
//}
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (top.frames['main'].document.getElementById(`battle_log_${hod_id - 25}`)) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
top.rmve(`#battle_log_${hod_id - 25}`);
|
|
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
chsee = 'chsee2';
|
2024-05-10 11:32:06 +00:00
|
|
|
|
|
2023-11-02 13:57:39 +00:00
|
|
|
|
text = looklogrep(text, vars);
|
|
|
|
|
id_log_ar[id] = id;
|
|
|
|
|
id_log = id;
|
|
|
|
|
if (!top.document.getElementById(`battle_log_${hod_id}`) && hod_id != 1) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (fstlh === 0) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
fstlh = hod_id;
|
|
|
|
|
}
|
|
|
|
|
lsthd[lsti] = hod_id;
|
|
|
|
|
lsti++;
|
|
|
|
|
$(top.document.getElementById('battle_logg')).prepend(`<div style="padding-top:2px;padding-bottom:2px;" id="battle_log_${hod_id}" tabindex="${0 - hod_id}" class="battle_hod_style"></div>`);
|
2024-05-10 11:32:06 +00:00
|
|
|
|
} else if (!top.document.getElementById("battle_log_" + hod_id + "")) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
top.document.getElementById('battle_logg').innerHTML = top.document.getElementById('battle_logg').innerHTML + `<div style="padding-top:2px;padding-bottom:2px;" id="battle_log_${hod_id}"></div>`;
|
|
|
|
|
}
|
|
|
|
|
if (!top.document.getElementById(`log_id_${id}`)) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
$(top.document.getElementById(`battle_log_${hod_id}`)).prepend(`<span id="log_id_${id}" class="foryou0">${text}</span><br>`);
|
2023-11-02 13:57:39 +00:00
|
|
|
|
}
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (top.document.getElementById(`battle_log_${hod_id - 7}`)) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
top.rmve(`#battle_log_${hod_id - 7}`);
|
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
2023-11-02 13:57:39 +00:00
|
|
|
|
|
2023-01-10 16:29:32 +00:00
|
|
|
|
//-- Мой лог--------------------------------
|
2022-06-06 21:30:34 +00:00
|
|
|
|
//-------------------------------------------
|
2024-05-10 11:32:06 +00:00
|
|
|
|
function add_mlog(id, text, hod_id, vars) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
chsee = 'chsee7';
|
|
|
|
|
text = looklogrep(text, vars);
|
|
|
|
|
id_log_ar[id] = id;
|
|
|
|
|
id_log = id;
|
|
|
|
|
if (!top.document.getElementById(`battle_mlog_${hod_id}`) && hod_id != 1) {
|
|
|
|
|
$(top.document.getElementById('battle_mlogg')).prepend(`<div style="padding-top:2px;padding-bottom:2px;" id="battle_mlog_${hod_id}" tabindex="${0 - hod_id}" class="battle_hod_style"></div>`);
|
|
|
|
|
|
|
|
|
|
} else if (!top.document.getElementById(`battle_mlog_${hod_id}`)) {
|
|
|
|
|
top.document.getElementById('battle_mlogg').innerHTML = top.document.getElementById('battle_mlogg').innerHTML + `<div style="padding-top:2px;padding-bottom:2px;" id="battle_mlog_${hod_id}"></div>`;
|
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
|
|
2023-11-02 13:57:39 +00:00
|
|
|
|
if (!top.document.getElementById(`mlog_id_${id}`)) {
|
2024-05-10 11:32:06 +00:00
|
|
|
|
$(top.document.getElementById(`battle_mlog_${hod_id}`)).prepend(`<span id="mlog_id_${id}" class="foryou0">${text}</span><br>`);
|
2022-06-06 21:30:34 +00:00
|
|
|
|
|
2023-11-02 13:57:39 +00:00
|
|
|
|
}
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (top.document.getElementById(`battle_mlog_${hod_id - 14}`)) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
top.rmve(`#battle_mlog_${hod_id - 14}`);
|
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
2023-11-02 13:57:39 +00:00
|
|
|
|
|
2022-06-06 21:30:34 +00:00
|
|
|
|
//-------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var moveState = false;
|
2023-01-10 16:29:32 +00:00
|
|
|
|
// Переменные координат мыши в начале перемещения, пока неизвестны
|
2022-06-06 21:30:34 +00:00
|
|
|
|
var x0, y0;
|
2023-01-10 16:29:32 +00:00
|
|
|
|
// Начальные координаты элемента, пока неизвестны
|
2022-06-06 21:30:34 +00:00
|
|
|
|
var divX0, divY0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function defPosition(event) {
|
|
|
|
|
var x = y = 0;
|
|
|
|
|
if (document.attachEvent != null) { // Internet Explorer & Opera
|
|
|
|
|
x = window.event.clientX + documentElement.scrollLeft + document.body.scrollLeft;
|
|
|
|
|
y = window.event.clientY + documentElement.scrollTop + document.body.scrollTop;
|
|
|
|
|
}
|
|
|
|
|
if (!document.attachEvent && document.addEventListener) { // Gecko
|
|
|
|
|
x = event.clientX + window.scrollX;
|
|
|
|
|
y = event.clientY + window.scrollY;
|
|
|
|
|
}
|
2023-11-02 13:57:39 +00:00
|
|
|
|
return {x: x, y: y};
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-11-02 13:57:39 +00:00
|
|
|
|
document.onmouseup = function () {
|
2022-06-06 21:30:34 +00:00
|
|
|
|
moveState = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function usePriem(id) {
|
2023-11-02 13:57:39 +00:00
|
|
|
|
priem_use = id;
|
2024-05-10 11:32:06 +00:00
|
|
|
|
if (id) reflesh();
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|