Frame 1
stop();
krajina = 0;
pocet_hracu = 2;
_quality = "HIGH";
debugging = true;
Frame 2
weapons = new Array();
weapons[0] = ["bmissile", "Small missile", 0, 0, "bmissile_g"];
weapons[1] = ["missile", "Missile", 2000, 10, "missile_g"];
weapons[2] = ["bnuke", "Small atom bomb", 5000, 2, "bnuke_g"];
weapons[3] = ["nuke", "Atom bomb", 13000, 1, "nuke_g"];
weapons[4] = ["funky", "Volcano bomb", 8000, 2, "funky_g"];
weapons[5] = ["mirv", "Shower", 9000, 2, "mirv_g"];
weapons[6] = ["death", "Hot shower", 30000, 1, "death_g"];
weapons[7] = ["broller", "Small ball", 5000, 5, "broller_g"];
weapons[8] = ["roller", "Ball", 6000, 2, "roller_g"];
weapons[9] = ["hroller", "Large ball", 15000, 1, "hroller_g"];
weapons[10] = ["broller2", "Small ball V2", 6500, 5, "broller2_g"];
weapons[11] = ["roller2", "Ball V2", 7500, 2, "roller2_g"];
weapons[12] = ["hroller2", "Large ball V2", 18000, 1, "hroller2_g"];
weapons[13] = ["astrike", "Air strike", 25000, 1, "astrike_g"];
specials = new Array();
specials[0] = ["par", "Parachutes", 5000, 5];
specials[1] = ["repair", "Repair kit", 4000, 5];
specials[2] = ["fuel", "Fuel", 3000, 50];
specials[3] = ["sshield", "Weak shield", 5000, 2, "weak_sh"];
specials[4] = ["shield", "Shield", 10000, 1, "shield_sh"];
specials[5] = ["stshield", "Strong shield", 15000, 1, "strong_sh"];
specials[6] = ["spshield", "Super shield", 20000, 1, "super_sh"];
specials[7] = ["teleport", "Teleport", 15000, 1];
specials[8] = ["upenergy", "Upgrade energy", 5000, 1];
specials[9] = ["uparmor", "Upgrade armor", 10000, 1];
specials[10] = ["upmove", "Upgrade engine", 7000, 1];
specials[11] = ["uphill", "Upgrade hill move", 5000, 1];
i = 1;
while (i < (pocet_hracu + 1)) {
_root["tank_" + i] = new Object();
_root["tank_" + i].guns = new Array();
_root["tank_" + i].specials = new Array();
x = 0;
while (x < weapons.length) {
_root["tank_" + i].guns[x] = 0;
x++;
}
x = 0;
while (x < specials.length) {
_root["tank_" + i].specials[x] = 0;
x++;
}
_root["tank_" + i].guns[0] = 99;
_root["tank_" + i].guns[4] = 100;
_root["tank_" + i].t_num = i;
_root["tank_" + i].cur_gun = 0;
_root["tank_" + i].energy = 100;
_root["tank_" + i].max_energy = 100;
_root["tank_" + i].shield = 1;
_root["tank_" + i].specials[0] = 8;
_root["tank_" + i].specials[1] = 8;
_root["tank_" + i].specials[3] = 8;
_root["tank_" + i].specials[4] = 8;
_root["tank_" + i].specials[5] = 8;
_root["tank_" + i].specials[6] = 8;
_root["tank_" + i].specials[2] = 250;
_root["tank_" + i].specials[7] = 8;
_root["tank_" + i].fuel = 500;
_root["tank_" + i].score = 5000;
_root["tank_" + i].total_score = 0;
_root["tank_" + i].live = true;
_root["tank_" + i].kills = 0;
_root["tank_" + i].col = 3355443 /* 0x333333 */;
_root["tank_" + i].name = "";
i++;
}
if (krajina == 0) {
rand_krajina = true;
}
game = 0;
uk = "Next player";
name = "";
cur = 1;
cislo = "Player " + cur;
firstgame = true;
type = "tank";
released = false;
dif = "normal";
Instance of Symbol 394 MovieClip in Frame 2
onClipEvent (load) {
_alpha = 0;
speed = 2;
}
onClipEvent (enterFrame) {
if ((_root.type == "ai") && (_alpha < 100)) {
_alpha = (_alpha + speed);
} else if ((_root.type == "tank") && (0 < _alpha)) {
_alpha = (_alpha - speed);
}
}
Frame 3
panel._visible = false;
i = 1;
while (pocet_hracu >= i) {
_root["tank_" + i].live = true;
_root["tank_" + i].max_energy = 100 + (_root["tank_" + i].specials[8] * 10);
_root["tank_" + i].energy = _root["tank_" + i].max_energy;
_root["tank_" + i].fuel = _root["tank_" + i].specials[2];
i++;
}
game++;
Instance of Symbol 399 MovieClip "uv" in Frame 3
onClipEvent (load) {
this.swapDepths(34567);
}
Frame 4
stop();
Instance of Symbol 401 MovieClip in Frame 4
onClipEvent (load) {
i = 0;
if (_root.rand_krajina) {
_root.krajina = random(3) + 1;
}
if (_root.krajina == 1) {
_root.vitrchange = 16;
rn = 0;
while (rn == 0) {
rn = random(3) - 1;
}
_root.vitr = (random(50) + 30) * rn;
_root.attachMovie("krajina1", "pozadi", 1);
_root.pozadi._x = 274;
_root.pozadi._y = 203.4;
_root.land._x = 500;
n2 = random(200) + 100;
n3 = random(300) + 50;
n4 = random(300) + 50;
ran = random(500);
pocet = random(5) + 2;
} else if (_root.krajina == 2) {
_root.vitrchange = 12;
rn = 0;
while (rn == 0) {
rn = random(3) - 1;
}
_root.vitr = (random(25) + 25) * rn;
_root.attachMovie("krajina2", "pozadi", 1);
_root.pozadi._x = 248.8;
_root.pozadi._y = 334.6;
_root.land._y = 536;
n2 = random(100) + 50;
n3 = random(200) + 50;
n4 = random(200) + 50;
ran = random(500);
pocet = random(6) + 2;
f = random(50) + 10;
} else if (_root.krajina == 3) {
_root.vitrchange = 6;
rn = 0;
while (rn == 0) {
rn = random(3) - 1;
}
_root.vitr = random(20) * rn;
_root.attachMovie("krajina3", "pozadi", 1);
_root.pozadi._x = 274;
_root.pozadi._y = 200.6;
_root.land._y = 615;
i = 0;
rand = (random(400) / 10) + 1;
rand2 = (random(15) + 1) / 10;
}
}
onClipEvent (enterFrame) {
if (i < 540) {
f = i + 40;
}
if (_root.krajina == 1) {
while (i < f) {
duplicateMovieClip (_root.land, "land" + i, i + 8000);
_root["land" + i]._x = i;
_root["land" + i]._y = _root["land" + i]._y + (((Math.sin((Math.PI / n3) * i) * Math.cos((Math.PI / n4) * i)) * (ran - i)) / 2);
col = new Color(_root["land" + i]);
col.setRGB(16777215);
i++;
}
}
if (_root.krajina == 2) {
while (i < f) {
duplicateMovieClip (_root.land, "land" + i, i + 8000);
_root["land" + i]._x = i;
_root["land" + i]._y = _root["land" + i]._y + ((((Math.sin((Math.PI/180) * i) * Math.cos((Math.PI / n4) * i)) * (ran - i)) / 4) / 2);
col = new Color(_root["land" + i]);
barv = _root["land" + i]._height / 12;
mycoltrans = new Object();
mycoltrans.ra = 100;
mycoltrans.rb = 120;
mycoltrans.ga = 100;
mycoltrans.gb = 130 + barv;
mycoltrans.ba = 100;
mycoltrans.bb = 0;
mycoltrans.aa = 100;
mycoltrans.ab = 0;
col.setTransform(mycoltrans);
i++;
}
}
if (_root.krajina == 3) {
while (i < f) {
duplicateMovieClip (_root.land, "land" + i, i + 8000);
_root["land" + i]._x = i;
_root["land" + i]._y = _root["land" + i]._y + ((Math.sin(((Math.PI/180) * i) * rand2) * rand) / 2);
col = new Color(_root["land" + i]);
barv = _root["land" + i]._height / 12;
mycoltrans = new Object();
mycoltrans.ra = 100;
mycoltrans.rb = 234;
mycoltrans.ga = 100;
mycoltrans.gb = 221;
mycoltrans.ba = 100;
mycoltrans.bb = 181;
mycoltrans.aa = 100;
mycoltrans.ab = 0;
col.setTransform(mycoltrans);
i++;
}
}
if (i >= 550) {
if (_root.krajina == 1) {
i = 0;
while (i < pocet) {
_root.attachMovie("strom_1", "strom" add i, 20000 + i);
i++;
}
}
if (_root.krajina == 2) {
f = 0;
i = 0;
while (i < 100) {
_root.attachMovie("strom_2", "strom" add i, 20000 + i);
_root["strom" + i]._x = f;
f = f + (random(30) + 8);
if (550 < f) {
break;
}
i++;
}
}
_root.uv.removeMovieClip();
_root.gotoAndPlay("hra");
}
if (500 >= i) {
_root.uv.percent._width = Math.round((i / 550) * 100) * 2;
_root.uv.percent._x = -95.3 + Math.round((i / 550) * 100);
} else {
_root.uv.percent._width = 200;
_root.uv.percent._x = 4.7;
}
}
Frame 5
function nextplayer() {
na_rade = next;
if ((na_rade.tank_number < pocet_hracu) && (1 < hracu)) {
next = eval ("tank" + Number(na_rade.tank_number + 1));
} else if (1 < hracu) {
next = tank1;
}
na_rade.playing = true;
if ((_root["tank_" + na_rade.tank_number].live == false) && (1 < hracu)) {
nextplayer();
} else if (1 < hracu) {
na_rade.blik();
}
vitr = vitr + ((-random(vitrchange)) + (vitrchange / 2));
panel.player_changed();
na_rade.na_rade();
}
function test() {
i = 1;
while (pocet_hracu >= i) {
_root["tank" + i].playing = false;
_root["tank" + i].testing = true;
_root["tank" + i].na_zemi = false;
i++;
}
testing = true;
}
i = 1;
while (i < (pocet_hracu + 1)) {
if (_root["tank_" + i].type == "tank") {
_root.attachMovie(_root["tank_" + i].type, "tank" + i, 10000 + i);
} else {
_root.attachMovie((_root["tank_" + i].type add "_") add _root["tank_" + i].dif, "tank" + i, 10000 + i);
}
tank = _root["tank" + i];
tank.type = _root["tank_" + i].type;
col = new Color(tank.col);
col.setRGB(_root["tank_" + i].col);
tank.tank_number = i;
tank._x = random(500) + 20;
while (400 < (_root["land" + tank._x]._y - (_root["land" + tank._x]._height / 2))) {
tank._x = random(500) + 20;
}
f = 1;
while (f < i) {
if ((tank._x < (_root["tank" + f]._x + (350 / _root.pocet_hracu))) && ((_root["tank" + f]._x - (350 / _root.pocet_hracu)) < tank._x)) {
tank._x = random(500) + 20;
while (400 < (_root["land" + tank._x]._y - (_root["land" + tank._x]._height / 2))) {
tank._x = random(500) + 20;
}
f = 0;
}
f++;
}
tank.playing = false;
i++;
}
_root.attachMovie("panel", "panel", 1000000);
panel._x = 442.6;
panel._y = 28.4;
fired = false;
power = 50;
next = tank1;
i = 1;
while (pocet_hracu >= i) {
if (_root["tank_" + i].total_score < _root["tank_" + next.tank_number].total_score) {
next = _root["tank" + i];
}
i++;
}
hracu = pocet_hracu;
panel._visible = true;
end = false;
fuel_c = 1 / (_root["tank_" + tank_number].specials[10] + 1);
Frame 6
test();
stop();
Instance of Symbol 402 MovieClip in Frame 6
onClipEvent (enterFrame) {
if (_root.testing) {
test = false;
i = 1;
while (_root.pocet_hracu >= i) {
if ((_root["tank" + i].testing != false) && (_root["tank_" + i].live == true)) {
test = true;
break;
}
i++;
}
if (!test) {
if (1 < _root.hracu) {
_root.nextplayer();
}
_root.testing = false;
}
if (((_root.hracu < 2) && (_root.end == false)) && (_root.testing == false)) {
_root.end = true;
play();
}
}
}
Symbol 2 MovieClip [strom_2] Frame 1
_y = (_root["land" + _x]._y - (_root["land" + _x]._height / 2));
fall = 0;
Symbol 2 MovieClip [strom_2] Frame 2
if (_y < (_root["land" + _x]._y - (_root["land" + _x]._height / 2))) {
_y = (_y + fall);
fall = fall + 1;
} else {
fall = 0;
}
Symbol 2 MovieClip [strom_2] Frame 3
gotoAndPlay (2);
Symbol 4 MovieClip [strom_1] Frame 1
_x = random(550);
_y = (_root["land" + _x]._y - (_root["land" + _x]._height / 2));
fall = 0;
Symbol 4 MovieClip [strom_1] Frame 2
if (Math.floor(_y) < Math.floor(_root["land" + _x]._y - (_root["land" + _x]._height / 2))) {
_y = (_y + fall);
fall = fall + 1;
} else {
fall = 0;
}
Symbol 4 MovieClip [strom_1] Frame 3
gotoAndPlay (2);
Symbol 16 MovieClip [ai_very_easy] Frame 1
function test_hill() {
calc_hill_up();
if (((_root["land" + Math.ceil(_x - (_width / 2))]._y - (_root["land" + Math.ceil(_x - (_width / 2))]._height / 2)) < (_y - hill_up)) || ((_root["land" + Math.floor(_x - (_width / 2))]._y - (_root["land" + Math.floor(_x - (_width / 2))]._height / 2)) < (_y - hill_up))) {
_x = (_x + 0.7);
test = false;
left = false;
right = false;
} else if (((_root["land" + Math.floor(_x + (_width / 2))]._y - (_root["land" + Math.floor(_x + (_width / 2))]._height / 2)) < (_y - hill_up)) || ((_root["land" + Math.ceil(_x + (_width / 2))]._y - (_root["land" + Math.ceil(_x + (_width / 2))]._height / 2)) < (_y - hill_up))) {
left = false;
right = false;
_x = (_x - 0.7);
test = false;
} else {
left = true;
right = true;
}
}
function blik() {
_root.attachMovie("blk", "blik", 10030);
_root.blik._x = _x;
_root.blik._y = _y - 10;
}
function calc_hill_up() {
hill_up = (0.5 + _root["tank_" + tank_number].specials[11]) - (fall * 10);
}
function move_left() {
_x = (_x - 0.5);
_root["tank_" + tank_number].fuel = _root["tank_" + tank_number].fuel - fuel_c;
moving = true;
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if (hitTest(_root["tank" + i]) && (i != tank_number)) {
_x = (_x + 0.6);
}
i++;
}
}
function move_right() {
_x = (_x + 0.5);
_root["tank_" + tank_number].fuel = _root["tank_" + tank_number].fuel - fuel_c;
moving = true;
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if (hitTest(_root["tank" + i]) && (i != tank_number)) {
_x = (_x - 0.6);
}
i++;
}
}
function activate_shield(shield) {
_root.attachMovie(_root.specials[2 + shield][4], "shield" + tank_number, 5040 + tank_number);
_root["shield" + tank_number].num = tank_number;
_root["tank_" + tank_number].specials[2 + shield]--;
sh_active = true;
_root["t" + tank_number] = _root["shield" + tank_number];
}
function disable_shield() {
_root["shield" + tank_number].disable();
sh_active = false;
_root["t" + tank_number] = _root["tank" + tank_number];
}
function p_m(par) {
if (0 < par) {
return(1);
}
return(-1);
}
function calc_first_shot() {
_root.z_ai_dif = "hard";
p_rotace = 90 + (p_m(target._x - _x) * 45);
p_x = _x;
p_power = Math.abs(_x - target._x) / (2 + (Math.abs(_x - target._x) / 120));
if (p_power >= _root["tank_" + tank_number].energy) {
p_power = _root["tank_" + tank_number].energy;
}
}
function calc_shot() {
last_shot_vzd = Math.sqrt(Math.abs((_x - last_shot_x) * (_x - last_shot_x)) + Math.abs((_y - last_shot_y) * (_y - last_shot_y)));
target_vzd = Math.sqrt(Math.abs((_x - target._x) * (_x - target._x)) + Math.abs((_y - target._y) * (_y - target._y)));
x_vzd = Math.abs(last_shot_x - target._x);
y_vzd = Math.abs(last_shot_y - target._y);
if ((power >= _root["tank_" + tank_number].energy) || (power == 100)) {
full_power = true;
} else {
full_power = false;
}
wind_change_koef = 7;
wind_koef_vzd_koef = 380;
vzd_koef = 10.9;
vzd_koef_k = 7 + (Math.abs(_x - last_shot_x) / 80);
y_vzd_koef = 30;
y_koef = 22;
rot_r = 100 - ((200 - Math.abs(_x - target._x)) / 30);
rot_l = 80 + ((200 - Math.abs(_x - target._x)) / 30);
if (_x < target._x) {
wind_koef_vzd_koef = wind_koef_vzd_koef - ((180 - rotace) * 3);
y_koef = y_koef + ((135 - rotace) * 1.7);
if (last_shot_x < _x) {
_root.z_f_used = "1.1";
p_rotace = p_rotace + ((((_x - last_shot_x) / 10) + ((target._x - _x) / 20)) - (_root.vitr / 50));
} else if (((60 < last_shot_vzd) || (target_vzd < 70)) || (power < 10)) {
_root.z_f_used = "1.2.1.failed";
if (last_shot_x >= target._x) {
if (20 < x_vzd) {
_root.z_f_used = "1.2.1.1.1";
p_power = p_power - (((x_vzd / ((vzd_koef + 2.5) - (Math.abs(135 - rotace) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - ((last_shot_y - target._y) / y_koef));
} else {
_root.z_f_used = "1.2.1.1.2";
p_power = p_power - ((x_vzd / ((vzd_koef - 1) - (Math.abs(135 - rotace) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (last_shot_y < target._y) {
if (target._y < _y) {
if (((((((80 < (_y - target._y)) && (y_vzd < 80)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (220 < target_vzd)) && (30 < power)) && ((rot_r - (_root.vitr / 7)) < rotace)) {
_root.z_f_used = "1.2.1.2.1.1.1";
p_rotace = p_rotace - ((((rotace - (rot_r - (_root.vitr / 7))) / 4) + (_root.vitr / 20)) - (target_vzd / 100));
} else if (rotace < (rot_r - (_root.vitr / 7))) {
_root.z_f_used = "1.2.1.2.1.1.2.";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "1.2.1.2.1.1.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if (((300 < (target._x - _x)) && (power < 50)) && (rotace < 110)) {
_root.z_f_used = "1.2.1.2.1.1.4.1";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else if ((rot_r - (_root.vitr / 7)) < rotace) {
if (135 >= p_rotace) {
_root.z_f_used = "1.2.1.2.1.1.4.2.1";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + ((135 - rotace) / 8)) - (_root.vitr / 15)) + ((rotace - (rot_r - (_root.vitr / 7))) / 8));
} else {
_root.z_f_used = "1.2.1.2.1.1.4.2.2";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) - (_root.vitr / 15));
}
p_rotace = p_rotace - (((rotace - (rot_r - (_root.vitr / 7))) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((((((target._y - _y) < 70) && (y_vzd < 100)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (250 < target_vzd)) && (30 < power)) && ((rot_r - (_root.vitr / 7)) < rotace)) {
_root.z_f_used = "1.2.1.2.1.2.1";
p_rotace = p_rotace - ((((rotace - (rot_r - (_root.vitr / 7))) / 4.5) + (_root.vitr / 20)) - (target_vzd / 100));
} else if (rotace < (rot_r - (_root.vitr / 7))) {
_root.z_f_used = "1.2.1.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "1.2.1.2.1.2.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if ((200 < (target._y - _y)) && (_y < last_shot_y)) {
_root.z_f_used = "1.2.1.2.1.2.4.1";
if (120 < p_rotace) {
_root.z_f_used = "1.2.1.2.1.2.4.1.1";
p_power = p_power + ((x_vzd / (vzd_koef / 1.5)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "1.2.1.2.1.2.4.1.2";
p_power = p_power + ((x_vzd / (vzd_koef / 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (((300 < (target._x - _x)) && (power < 50)) && (rotace < 110)) {
_root.z_f_used = "1.2.1.2.1.2.4.2.";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else if ((rot_r - (_root.vitr / 7)) < rotace) {
if (135 >= p_rotace) {
_root.z_f_used = "1.2.1.2.1.2.4.3.1.";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - (y_vzd / y_vzd_koef)) + ((135 - rotace) / 8)) - (_root.vitr / 15)) + ((rotace - (rot_r - (_root.vitr / 7))) / 8));
} else {
_root.z_f_used = "1.2.1.2.1.2.4.3.2.";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - (y_vzd / y_vzd_koef)) - (_root.vitr / 15));
}
p_rotace = p_rotace - (((rotace - (rot_r - (_root.vitr / 7))) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((last_shot_vzd < 150) && ((target._x - _x) < 170)) || (last_shot_vzd >= 100)) || ((last_shot_vzd < 100) && (power < 30))) {
if (target._y < _y) {
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
_root.z_f_used = "1.2.1.2.2.1.1";
} else if (100 < (target._y - _y)) {
_root.z_f_used = "1.2.1.2.2.1.2.1";
p_power = p_power + ((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "1.2.1.2.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
}
} else if (rotace < ((rot_r - 5) - (root.vitr / 7))) {
_root.z_f_used = "1.2.1.2.2.2";
p_rotace = p_rotace + ((((135 - rotace) / 10) + target._x) - (_x / 100));
} else {
_root.z_f_used = "1.2.1.2.2.3";
p_rotace = p_rotace - ((rotace - (rot_r - (_root.vitr / 7))) / 2);
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) / 1.5) + ((rotace - (rot_r - (_root.vitr / 7))) / 5));
}
} else if ((100 < (_y - target._y)) && ((target._x - _x) < 100)) {
_root.z_f_used = "1.2.2.1";
p_rotace = p_rotace - ((rotace - (rot_r - (_root.vitr / 7))) / 2);
} else {
_root.z_f_used = "1.2.2.2";
p_rotace = p_rotace - (((rotace - (rot_r - (_root.vitr / 7))) / 2) - ((target._x - _x) / 100));
}
} else {
wind_koef_vzd_koef = wind_koef_vzd_koef - (rotace * 3);
y_koef = y_koef + ((rotace - 45) * 1.7);
if (_x < last_shot_x) {
_root.z_f_used = "2.1";
p_rotace = p_rotace - ((((last_shot_x - _x) / 10) + ((_x - target._x) / 20)) + (_root.vitr / 50));
} else if (((60 < last_shot_vzd) || (target_vzd < 70)) || (power < 10)) {
_root.z_f_used = "2.2.1.failed";
if (target._x >= last_shot_x) {
if (20 < x_vzd) {
_root.z_f_used = "2.2.1.1.1";
p_power = p_power - (((x_vzd / ((vzd_koef + 2.5) - (Math.abs(45 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - ((last_shot_y - target._y) / y_koef));
} else {
_root.z_f_used = "2.2.1.1.2";
p_power = p_power - ((x_vzd / ((vzd_koef - 1) - (Math.abs(45 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (last_shot_y < target._y) {
if (target._y < _y) {
if (((((((80 < (_y - target._y)) && (y_vzd < 80)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (220 < target_vzd)) && (30 < power)) && ((rot_l + (_root.vitr / 7)) < rotace)) {
_root.z_f_used = "2.2.1.2.1.1.1";
p_rotace = p_rotace + (((((rot_l + (_root.vitr / 7)) - rotace) / 4) - (_root.vitr / 20)) - (target_vzd / 100));
} else if ((rot_l + (_root.vitr / 7)) < rotace) {
_root.z_f_used = "2.2.1.2.1.1.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "2.2.1.2.1.1.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if (((300 < (_x - target._x)) && (power < 50)) && (70 < rotace)) {
_root.z_f_used = "2.2.1.2.1.1.4.1";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef))));
} else if (rotace < (rot_l + (_root.vitr / 7))) {
if (p_rotace >= 45) {
_root.z_f_used = "2.2.1.2.1.1.4.2.1";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + ((rotace - 45) / 8)) + (_root.vitr / 15)) + (((rot_l + (_root.vitr / 7)) - rotace) / 8));
} else {
_root.z_f_used = "2.2.1.2.1.1.4.2.2";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + (_root.vitr / 15));
}
p_rotace = p_rotace + ((((rot_l + (_root.vitr / 7)) - rotace) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((((((target._y - _y) < 70) && (y_vzd < 100)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (250 < target_vzd)) && (30 < power)) && (rotace < (rot_l - (_root.vitr / 7)))) {
_root.z_f_used = "2.2.1.2.1.2.1";
p_rotace = p_rotace + (((((rot_l + (_root.vitr / 7)) - rotace) / 4.5) - (_root.vitr / 20)) - (target_vzd / 100));
} else if ((rot_l + (_root.vitr / 7)) < rotace) {
_root.z_f_used = "2.2.1.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "2.2.1.2.1.2.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(45 - rotace) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if ((200 < (target._y - _y)) && (_y < last_shot_y)) {
if (p_rotace < 60) {
_root.z_f_used = "2.2.1.2.1.2.4.1.1";
p_power = p_power + ((x_vzd / (vzd_koef / 1.5)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "2.2.1.2.1.2.4.1.2";
p_power = p_power + ((x_vzd / (vzd_koef / 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (((300 < (_x - target._x)) && (power < 50)) && (70 < rotace)) {
_root.z_f_used = "2.2.1.2.1.2.4.2";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else if (rotace < (rot_l + (_root.vitr / 7))) {
if (p_rotace >= 45) {
_root.z_f_used = "2.2.1.2.1.2.4.3.1";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + ((rotace - 45) / 8)) + (_root.vitr / 15)) + (((rot_l + (_root.vitr / 7)) - rotace) / 8));
} else {
_root.z_f_used = "2.2.1.2.1.2.4.3.2";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + (_root.vitr / 15));
}
p_rotace = p_rotace + ((((rot_l + (_root.vitr / 7)) - rotace) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((last_shot_vzd < 150) && ((_x - target._x) < 170)) || (last_shot_vzd >= 100)) || ((last_shot_vzd < 100) && (power < 30))) {
if (target._y < _y) {
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
_root.z_f_used = "2.2.1.2.2.1.1";
} else if (100 < (target._y - _y)) {
_root.z_f_used = "2.2.1.2.2.1.2.1";
p_power = p_power + ((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "2.2.1.2.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
}
} else if (rotace < ((rot_l + 5) + (root.vitr / 7))) {
_root.z_f_used = "2.2.1.2.2.2";
p_rotace = p_rotace - ((((rotace - 45) / 10) + _x) - (target._x / 100));
} else {
_root.z_f_used = "2.2.1.2.2.3";
p_rotace = p_rotace + (((rot_l + (_root.vitr / 7)) - rotace) / 3);
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) / 1.5) + (((rot_l + (_root.vitr / 7)) - rotace) / 5));
}
} else if ((100 < (_y - target._y)) && ((_x - target._x) < 100)) {
_root.z_f_used = "2.2.2.1";
p_rotace = p_rotace + (((rot_l + (_root.vitr / 7)) - rotace) / 2);
} else {
_root.z_f_used = "2.2.2.2";
p_rotace = p_rotace + ((((rot_l + (_root.vitr / 7)) - rotace) / 2) - ((target._x - _x) / 100));
}
}
if (100 < p_power) {
p_power = 100;
}
if (p_power >= _root["tank_" + tank_number].energy) {
p_power = _root["tank_" + tank_number].energy;
if (_x < target._x) {
if (p_rotace < 135) {
if (70 < p_power) {
p_power = p_power - ((135 - p_rotace) / 2.5);
}
p_rotace = p_rotace + ((135 - p_rotace) / 3);
}
} else if (45 < p_rotace) {
if (70 < p_power) {
p_power = p_power - ((p_rotace - 45) / 2.5);
}
p_rotace = p_rotace - ((p_rotace - 45) / 3);
}
}
if (p_power < 0) {
p_power = 0;
}
if (p_rotace < 0) {
p_rotace = 0;
} else if (180 < p_rotace) {
p_rotace = 180;
}
}
function prepare_shot() {
prep = true;
if ((Math.max(rotace, p_rotace) - Math.min(rotace, p_rotace)) < 10) {
sp = 1;
} else {
sp = Math.floor((Math.max(rotace, p_rotace) - Math.min(rotace, p_rotace)) / 10);
}
if (Math.ceil(rotace) != Math.ceil(p_rotace)) {
if ((Math.ceil(p_rotace) < Math.ceil(rotace)) && ((rotace - sp) >= 0)) {
prep = false;
rotace = rotace - sp;
_root.tur.play();
} else if (180 >= (rotace + sp)) {
prep = false;
rotace = rotace + sp;
_root.tur.play();
}
}
if (Math.ceil(power) != Math.ceil(p_power)) {
if ((Math.ceil(p_power) < Math.ceil(power)) && ((power - sp) >= 0)) {
prep = false;
power = power - sp;
} else if (180 >= (power + sp)) {
prep = false;
power = power + sp;
}
}
if (((Math.round(p_x) != Math.round(_x)) && (0 < _root["tank_" + tank_number].fuel)) && (p_move)) {
prep = false;
if (Math.round(p_x) < Math.round(_x)) {
move_right();
} else {
move_left();
}
}
if (prep) {
return(true);
}
}
function select_target() {
vzd = 1000;
i = 1;
while (_root.pocet_hracu >= i) {
vz = Math.abs(_x - _root["tank" + i]._x);
if (((vz < vzd) && (i != tank_number)) && (_root["tank_" + i].live)) {
vzd = vz;
target = _root["tank" + i];
target_ = _root["tank_" + i];
}
i++;
}
}
function na_rade() {
rounds++;
par_active = false;
calc_hill_up();
}
function damage(damag, attacker, par) {
armor = 1;
arm = 1;
i = 0;
while (i < _root["tank_" + tank_number].specials[9]) {
armor = armor / (1.12 / arm);
arm = arm / 1.0002;
i++;
}
if ((!sh_active) || (par)) {
_root["tank_" + tank_number].energy = _root["tank_" + tank_number].energy - (damag * armor);
} else {
_root["shield" + tank_number].damage(damag, attacker);
}
if (0 >= _root["tank_" + tank_number].energy) {
if (this != attacker) {
_root["tank_" + attacker.tank_number].kills = _root["tank_" + attacker.tank_number].kills + 1;
_root["tank_" + attacker.tank_number].score = _root["tank_" + attacker.tank_number].score + 5000;
_root["tank_" + attacker.tank_number].total_score = _root["tank_" + attacker.tank_number].total_score + 5000;
} else {
_root["tank_" + tank_number].kills = _root["tank_" + tank_number].kills - 1;
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - 2000;
_root["tank_" + tank_number].total_score = _root["tank_" + tank_number].total_score - 2000;
}
}
if (this != attacker) {
_root["tank_" + attacker.tank_number].score = _root["tank_" + attacker.tank_number].score + (damag * 100);
_root["tank_" + attacker.tank_number].total_score = _root["tank_" + attacker.tank_number].total_score + (damag * 100);
} else {
if (par) {
damag = damag / 3;
}
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - Math.round(damag * 50);
_root["tank_" + tank_number].total_score = _root["tank_" + tank_number].total_score - Math.round(damag * 50);
if (_root["tank_" + tank_number].score < 0) {
_root["tank_" + tank_number].score = 0;
}
}
}
function fire() {
if (_root.debugging) {
save_inf();
}
last_wind = _root.vitr;
first_frame = true;
_root.attachMovie(_root.weapons[_root["tank_" + tank_number].cur_gun][4], "strela", 1000);
if (_root["tank_" + tank_number].cur_gun != 0) {
_root["tank_" + tank_number].guns[_root["tank_" + tank_number].cur_gun]--;
if (_root["tank_" + tank_number].guns[_root["tank_" + tank_number].cur_gun] == 0) {
_root["tank_" + tank_number].cur_gun = 0;
}
}
_root.strela._rotation = rotace - 90;
_root.strela._x = _x;
_root.strela._y = _y - 1;
_root.strela.strela.vo = power;
_root.strela.strela.owner = _root[_name];
_root[_name + "_hlaven"].play();
playing = false;
}
function save_inf() {
_root.z_target = target;
_root.z_target_name = target_.name;
_root.z_target_energy = target_.energy;
_root.z_target_live = target_.live;
_root.z_name = _root["tank_" + tank_number].name;
_root.z_energy = _root["tank_" + tank_number].energy;
if (target._x < _x) {
_root.z_pos = "right";
} else {
_root.z_pos = "left";
}
_root.z_x = _x;
_root.z_y = _y;
_root.z_tar_x = target._x;
_root.z_tar_y = target._y;
_root.z_last_vitr = last_wind;
_root.z_vitr = _root.vitr;
_root.z_wind_koef_vzd_koef = wind_koef_vzd_koef;
_root.z_angle = rotace;
_root.z_power = power;
_root.z_y_koef = y_koef;
_root.z_vzd_koef_k = vzd_koef_k;
_root.z_last_shot_x = last_shot_x;
_root.z_last_shot_y = last_shot_y;
_root.z_last_shot_vzd = last_shot_vzd;
_root.z_last_shot_y_vzd = y_vzd;
_root.z_last_shot_x_vzd = x_vzd;
_root.z_dif = dif;
fscommand ("SAVE", ((((((("debug/" add _root.game) add "_") add rounds) add "_") add _root.z_pos) add "_") add _root["tank_" + tank_number].name) add ".txt");
}
dif = _root["tank_" + tank_number].dif;
_y = ((_root["land" + Math.round(_x)]._y - (_root["land" + Math.round(_x)]._height / 2)) - 4);
i = 0;
while (i < _width) {
cur = _root["land" + Math.floor((_x - (_width / 2)) + i)];
if (hitTest(cur)) {
cur._y = cur._y + ((_y + (_height / 2)) - (cur._y - (cur._height / 2)));
}
i++;
}
if (0 < _root["tank_" + tank_number].specials[0]) {
par = true;
}
_root.attachMovie("hlaven", _name + "_hlaven", 10010 + tank_number);
rotace = (random(67) * 2) + 46;
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
_root[_name + "_hlaven"]._rotation = rotace;
power = 50;
playing = false;
testing = false;
par_active = false;
par_out = false;
par_used = false;
sh_active = false;
_root["t" + tank_number] = _root["tank" + tank_number];
first_shot = true;
first_frame = true;
calc_frame = true;
fuel_c = 1 / (_root["tank_" + tank_number].specials[10] + 1);
rounds = 0;
p_move = false;
select_target();
Symbol 16 MovieClip [ai_very_easy] Frame 2
if (400 < _y) {
_root["tank_" + tank_number].live = false;
_root["tank_" + tank_number].energy = 0;
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - 2000;
_root.hracu--;
if (_root["tank_" + tank_number].score < 0) {
_root["tank_" + tank_number].score = 0;
}
gotoAndPlay (4);
}
if (0 >= _root["tank_" + tank_number].energy) {
_root["tank_" + tank_number].energy = 0;
_root["tank_" + tank_number].live = false;
gotoAndPlay (4);
}
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
if (sh_active) {
_root["shield" + tank_number]._x = _x;
_root["shield" + tank_number]._y = _y;
}
if (playing) {
if ((!target_.live) && (first_frame)) {
rounds = 1;
select_target();
}
if (rounds == 1) {
if (first_frame) {
i = 1;
while (_root.pocet_hracu >= i) {
if ((_root["tank" + i].playing && (i != tank_number)) && (_root["tank_" + i].live)) {
_root["tank" + i].playing = false;
_root.test();
}
i++;
}
first_shot = true;
calc_first_shot();
}
} else if (first_frame) {
calc_shot();
}
first_frame = false;
_root.rotace = rotace;
_root.power = power;
if (prepare_shot()) {
fire();
}
na_zemi = false;
left = true;
right = true;
i = 0;
min = 500;
gg = false;
test_hill();
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
if (pasy.hitTest(cur)) {
na_zemi = true;
if (par_out) {
par_out = false;
_root["parachute" + tank_number].removeMovieClip();
}
if (0.4 < fall) {
if (fall < 0.8) {
damage(Math.round(fall * 25), this, true);
} else {
damage(Math.round((fall * fall) * 3000), this, true);
}
}
fall = 0;
}
top = cur._y - (cur._height / 2);
if ((top < min) && (na_zemi)) {
gg = true;
min = top;
}
if ((((i + 1) >= _width) && (na_zemi)) && (gg)) {
_y = (min - 2);
gg = false;
}
if (!na_zemi) {
if ((fall >= 0.2) && (par)) {
if (!par_active) {
par_active = true;
_root["tank_" + i].specials[0] = _root["tank_" + i].specials[0] - 1;
}
if (!par_out) {
_root.attachMovie("parachute", "parachute" + tank_number, 9000 + tank_number);
}
par_out = true;
}
_y = (_y + fall);
if (!par_out) {
fall = fall + 0.01;
} else {
_root["parachute" + tank_number]._x = _x;
_root["parachute" + tank_number]._y = _y - 7.5;
fall = 0.2;
_x = (_x + (_root.vitr / 3000));
}
}
i++;
}
if (_root["tank_" + tank_number].energy < power) {
power = _root["tank_" + tank_number].energy;
}
_root[_name + "_hlaven"]._rotation = rotace;
}
if (testing) {
i = 0;
min = 500;
gg = false;
test_hill();
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
if (pasy.hitTest(cur)) {
if (0.4 < fall) {
if (fall < 0.8) {
damage(Math.round(fall * 25), this, true);
} else {
damage(Math.round((fall * fall) * 80), this, true);
}
}
if (par_out) {
par_out = false;
_root["parachute" + tank_number].removeMovieClip();
}
na_zemi = true;
fall = 0;
}
top = cur._y - (cur._height / 2);
if ((top < min) && (na_zemi)) {
gg = true;
min = top;
}
if ((((i + 1) >= _width) && (na_zemi)) && (gg)) {
_y = (min - 2);
gg = false;
}
if (0.001 < fall) {
test = false;
}
if (!na_zemi) {
if ((fall >= 0.2) && (par)) {
if (!par_active) {
par_active = true;
_root["tank_" + tank_number].specials[0] = _root["tank_" + tank_number].specials[0] - 1;
}
if (!par_out) {
_root.attachMovie("parachute", "parachute" + tank_number, 9000 + tank_number);
}
par_out = true;
}
_y = (_y + fall);
if (!par_out) {
fall = fall + 0.01;
} else {
_root["parachute" + tank_number]._x = _x;
_root["parachute" + tank_number]._y = _y - 7.5;
fall = 0.2;
_x = (_x + (_root.vitr / 3000));
}
}
i++;
}
if (0.001 < fall) {
test = false;
}
test_hill();
x3 = x2;
x2 = x1;
x1 = Math.round(_x);
y3 = y2;
y2 = y1;
y1 = Math.round(_y * 10) / 10;
if ((y1 == y3) && (x1 == x3)) {
test = true;
}
if (test) {
testing = false;
_root[_name + "test"] = false;
}
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
test = true;
}
Symbol 16 MovieClip [ai_very_easy] Frame 3
gotoAndPlay (2);
Symbol 16 MovieClip [ai_very_easy] Frame 4
_root[_name + "_hlaven"].removeMovieClip();
_root["parachute" + tank_number].removeMovieClip();
_root["shield" + tank_number].removeMovieClip();
_root.hracu--;
Symbol 16 MovieClip [ai_very_easy] Frame 9
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((_x - x) * (_x - x)) + ((_y - h) * (_y - h))) * (180 / _width)));
cur._height = cur._height - (30 * vzr);
cur._y = cur._y + (15 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (50 / Math.abs(_x - x));
cur._y = cur._y + ((50 / Math.abs(_x - x)) / 2);
}
i++;
}
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if ((hitTest(current) || (hitTest(_root["shield" + i]))) && (i != tank_number)) {
x = _x - current._x;
y = _y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / 14));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / 18));
}
current.damage(damg, this);
}
i++;
}
Symbol 16 MovieClip [ai_very_easy] Frame 15
if (playing) {
_root.test();
}
stop();
Symbol 19 MovieClip [ai_easy] Frame 1
function test_hill() {
calc_hill_up();
if (((_root["land" + Math.ceil(_x - (_width / 2))]._y - (_root["land" + Math.ceil(_x - (_width / 2))]._height / 2)) < (_y - hill_up)) || ((_root["land" + Math.floor(_x - (_width / 2))]._y - (_root["land" + Math.floor(_x - (_width / 2))]._height / 2)) < (_y - hill_up))) {
_x = (_x + 0.7);
test = false;
left = false;
right = false;
} else if (((_root["land" + Math.floor(_x + (_width / 2))]._y - (_root["land" + Math.floor(_x + (_width / 2))]._height / 2)) < (_y - hill_up)) || ((_root["land" + Math.ceil(_x + (_width / 2))]._y - (_root["land" + Math.ceil(_x + (_width / 2))]._height / 2)) < (_y - hill_up))) {
left = false;
right = false;
_x = (_x - 0.7);
test = false;
} else {
left = true;
right = true;
}
}
function blik() {
_root.attachMovie("blk", "blik", 10030);
_root.blik._x = _x;
_root.blik._y = _y - 10;
}
function calc_hill_up() {
hill_up = (0.5 + _root["tank_" + tank_number].specials[11]) - (fall * 10);
}
function move_left() {
_x = (_x - 0.5);
_root["tank_" + tank_number].fuel = _root["tank_" + tank_number].fuel - fuel_c;
moving = true;
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if (hitTest(_root["tank" + i]) && (i != tank_number)) {
_x = (_x + 0.6);
}
i++;
}
}
function move_right() {
_x = (_x + 0.5);
_root["tank_" + tank_number].fuel = _root["tank_" + tank_number].fuel - fuel_c;
moving = true;
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if (hitTest(_root["tank" + i]) && (i != tank_number)) {
_x = (_x - 0.6);
}
i++;
}
}
function activate_shield(shield) {
_root.attachMovie(_root.specials[2 + shield][4], "shield" + tank_number, 5040 + tank_number);
_root["shield" + tank_number].num = tank_number;
_root["tank_" + tank_number].specials[2 + shield]--;
sh_active = true;
_root["t" + tank_number] = _root["shield" + tank_number];
}
function disable_shield() {
_root["shield" + tank_number].disable();
sh_active = false;
_root["t" + tank_number] = _root["tank" + tank_number];
}
function p_m(par) {
if (0 < par) {
return(1);
}
return(-1);
}
function calc_first_shot() {
_root.z_ai_dif = "hard";
p_rotace = 90 + (p_m(target._x - _x) * 45);
p_x = _x;
p_power = Math.abs(_x - target._x) / (2 + (Math.abs(_x - target._x) / 120));
if (p_power >= _root["tank_" + tank_number].energy) {
p_power = _root["tank_" + tank_number].energy;
}
}
function calc_shot() {
last_shot_vzd = Math.sqrt(Math.abs((_x - last_shot_x) * (_x - last_shot_x)) + Math.abs((_y - last_shot_y) * (_y - last_shot_y)));
target_vzd = Math.sqrt(Math.abs((_x - target._x) * (_x - target._x)) + Math.abs((_y - target._y) * (_y - target._y)));
x_vzd = Math.abs(last_shot_x - target._x);
y_vzd = Math.abs(last_shot_y - target._y);
if ((power >= _root["tank_" + tank_number].energy) || (power == 100)) {
full_power = true;
} else {
full_power = false;
}
wind_change_koef = 99999 /* 0x01869F */;
wind_koef_vzd_koef = 380000 /* 0x05CC60 */;
vzd_koef = 25;
vzd_koef_k = 15 + (Math.abs(_x - last_shot_x) / 80);
y_vzd_koef = 3000;
y_koef = 22000;
rot_r = 100 - ((200 - Math.abs(_x - target._x)) / 30);
rot_l = 80 + ((200 - Math.abs(_x - target._x)) / 30);
if (_x < target._x) {
wind_koef_vzd_koef = wind_koef_vzd_koef - ((180 - rotace) * 3);
y_koef = y_koef + ((135 - rotace) * 1.7);
if (last_shot_x < _x) {
_root.z_f_used = "1.1";
p_rotace = p_rotace + ((((_x - last_shot_x) / 10) + ((target._x - _x) / 20)) - (_root.vitr / 50));
} else if (((60 < last_shot_vzd) || (target_vzd < 70)) || (power < 10)) {
_root.z_f_used = "1.2.1.failed";
if (last_shot_x >= target._x) {
if (20 < x_vzd) {
_root.z_f_used = "1.2.1.1.1";
p_power = p_power - (((x_vzd / ((vzd_koef + 2.5) - (Math.abs(135 - rotace) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - ((last_shot_y - target._y) / y_koef));
} else {
_root.z_f_used = "1.2.1.1.2";
p_power = p_power - ((x_vzd / ((vzd_koef - 1) - (Math.abs(135 - rotace) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (last_shot_y < target._y) {
if (target._y < _y) {
if (((((((80 < (_y - target._y)) && (y_vzd < 80)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (220 < target_vzd)) && (30 < power)) && ((rot_r - (_root.vitr / 7)) < rotace)) {
_root.z_f_used = "1.2.1.2.1.1.1";
p_rotace = p_rotace - ((((rotace - (rot_r - (_root.vitr / 7))) / 4) + (_root.vitr / 20)) - (target_vzd / 100));
} else if (rotace < (rot_r - (_root.vitr / 7))) {
_root.z_f_used = "1.2.1.2.1.1.2.";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "1.2.1.2.1.1.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if (((300 < (target._x - _x)) && (power < 50)) && (rotace < 110)) {
_root.z_f_used = "1.2.1.2.1.1.4.1";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else if ((rot_r - (_root.vitr / 7)) < rotace) {
if (135 >= p_rotace) {
_root.z_f_used = "1.2.1.2.1.1.4.2.1";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + ((135 - rotace) / 8)) - (_root.vitr / 15)) + ((rotace - (rot_r - (_root.vitr / 7))) / 8));
} else {
_root.z_f_used = "1.2.1.2.1.1.4.2.2";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) - (_root.vitr / 15));
}
p_rotace = p_rotace - (((rotace - (rot_r - (_root.vitr / 7))) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((((((target._y - _y) < 70) && (y_vzd < 100)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (250 < target_vzd)) && (30 < power)) && ((rot_r - (_root.vitr / 7)) < rotace)) {
_root.z_f_used = "1.2.1.2.1.2.1";
p_rotace = p_rotace - ((((rotace - (rot_r - (_root.vitr / 7))) / 4.5) + (_root.vitr / 20)) - (target_vzd / 100));
} else if (rotace < (rot_r - (_root.vitr / 7))) {
_root.z_f_used = "1.2.1.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "1.2.1.2.1.2.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if ((200 < (target._y - _y)) && (_y < last_shot_y)) {
_root.z_f_used = "1.2.1.2.1.2.4.1";
if (120 < p_rotace) {
_root.z_f_used = "1.2.1.2.1.2.4.1.1";
p_power = p_power + ((x_vzd / (vzd_koef / 1.5)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "1.2.1.2.1.2.4.1.2";
p_power = p_power + ((x_vzd / (vzd_koef / 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (((300 < (target._x - _x)) && (power < 50)) && (rotace < 110)) {
_root.z_f_used = "1.2.1.2.1.2.4.2.";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else if ((rot_r - (_root.vitr / 7)) < rotace) {
if (135 >= p_rotace) {
_root.z_f_used = "1.2.1.2.1.2.4.3.1.";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - (y_vzd / y_vzd_koef)) + ((135 - rotace) / 8)) - (_root.vitr / 15)) + ((rotace - (rot_r - (_root.vitr / 7))) / 8));
} else {
_root.z_f_used = "1.2.1.2.1.2.4.3.2.";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - (y_vzd / y_vzd_koef)) - (_root.vitr / 15));
}
p_rotace = p_rotace - (((rotace - (rot_r - (_root.vitr / 7))) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((last_shot_vzd < 150) && ((target._x - _x) < 170)) || (last_shot_vzd >= 100)) || ((last_shot_vzd < 100) && (power < 30))) {
if (target._y < _y) {
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
_root.z_f_used = "1.2.1.2.2.1.1";
} else if (100 < (target._y - _y)) {
_root.z_f_used = "1.2.1.2.2.1.2.1";
p_power = p_power + ((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "1.2.1.2.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
}
} else if (rotace < ((rot_r - 5) - (root.vitr / 7))) {
_root.z_f_used = "1.2.1.2.2.2";
p_rotace = p_rotace + ((((135 - rotace) / 10) + target._x) - (_x / 100));
} else {
_root.z_f_used = "1.2.1.2.2.3";
p_rotace = p_rotace - ((rotace - (rot_r - (_root.vitr / 7))) / 2);
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) / 1.5) + ((rotace - (rot_r - (_root.vitr / 7))) / 5));
}
} else if ((100 < (_y - target._y)) && ((target._x - _x) < 100)) {
_root.z_f_used = "1.2.2.1";
p_rotace = p_rotace - ((rotace - (rot_r - (_root.vitr / 7))) / 2);
} else {
_root.z_f_used = "1.2.2.2";
p_rotace = p_rotace - (((rotace - (rot_r - (_root.vitr / 7))) / 2) - ((target._x - _x) / 100));
}
} else {
wind_koef_vzd_koef = wind_koef_vzd_koef - (rotace * 3);
y_koef = y_koef + ((rotace - 45) * 1.7);
if (_x < last_shot_x) {
_root.z_f_used = "2.1";
p_rotace = p_rotace - ((((last_shot_x - _x) / 10) + ((_x - target._x) / 20)) + (_root.vitr / 50));
} else if (((60 < last_shot_vzd) || (target_vzd < 70)) || (power < 10)) {
_root.z_f_used = "2.2.1.failed";
if (target._x >= last_shot_x) {
if (20 < x_vzd) {
_root.z_f_used = "2.2.1.1.1";
p_power = p_power - (((x_vzd / ((vzd_koef + 2.5) - (Math.abs(45 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - ((last_shot_y - target._y) / y_koef));
} else {
_root.z_f_used = "2.2.1.1.2";
p_power = p_power - ((x_vzd / ((vzd_koef - 1) - (Math.abs(45 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (last_shot_y < target._y) {
if (target._y < _y) {
if (((((((80 < (_y - target._y)) && (y_vzd < 80)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (220 < target_vzd)) && (30 < power)) && ((rot_l + (_root.vitr / 7)) < rotace)) {
_root.z_f_used = "2.2.1.2.1.1.1";
p_rotace = p_rotace + (((((rot_l + (_root.vitr / 7)) - rotace) / 4) - (_root.vitr / 20)) - (target_vzd / 100));
} else if ((rot_l + (_root.vitr / 7)) < rotace) {
_root.z_f_used = "2.2.1.2.1.1.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "2.2.1.2.1.1.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if (((300 < (_x - target._x)) && (power < 50)) && (70 < rotace)) {
_root.z_f_used = "2.2.1.2.1.1.4.1";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef))));
} else if (rotace < (rot_l + (_root.vitr / 7))) {
if (p_rotace >= 45) {
_root.z_f_used = "2.2.1.2.1.1.4.2.1";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + ((rotace - 45) / 8)) + (_root.vitr / 15)) + (((rot_l + (_root.vitr / 7)) - rotace) / 8));
} else {
_root.z_f_used = "2.2.1.2.1.1.4.2.2";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + (_root.vitr / 15));
}
p_rotace = p_rotace + ((((rot_l + (_root.vitr / 7)) - rotace) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((((((target._y - _y) < 70) && (y_vzd < 100)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (250 < target_vzd)) && (30 < power)) && (rotace < (rot_l - (_root.vitr / 7)))) {
_root.z_f_used = "2.2.1.2.1.2.1";
p_rotace = p_rotace + (((((rot_l + (_root.vitr / 7)) - rotace) / 4.5) - (_root.vitr / 20)) - (target_vzd / 100));
} else if ((rot_l + (_root.vitr / 7)) < rotace) {
_root.z_f_used = "2.2.1.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "2.2.1.2.1.2.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(45 - rotace) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if ((200 < (target._y - _y)) && (_y < last_shot_y)) {
if (p_rotace < 60) {
_root.z_f_used = "2.2.1.2.1.2.4.1.1";
p_power = p_power + ((x_vzd / (vzd_koef / 1.5)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "2.2.1.2.1.2.4.1.2";
p_power = p_power + ((x_vzd / (vzd_koef / 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (((300 < (_x - target._x)) && (power < 50)) && (70 < rotace)) {
_root.z_f_used = "2.2.1.2.1.2.4.2";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else if (rotace < (rot_l + (_root.vitr / 7))) {
if (p_rotace >= 45) {
_root.z_f_used = "2.2.1.2.1.2.4.3.1";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + ((rotace - 45) / 8)) + (_root.vitr / 15)) + (((rot_l + (_root.vitr / 7)) - rotace) / 8));
} else {
_root.z_f_used = "2.2.1.2.1.2.4.3.2";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + (_root.vitr / 15));
}
p_rotace = p_rotace + ((((rot_l + (_root.vitr / 7)) - rotace) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((last_shot_vzd < 150) && ((_x - target._x) < 170)) || (last_shot_vzd >= 100)) || ((last_shot_vzd < 100) && (power < 30))) {
if (target._y < _y) {
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
_root.z_f_used = "2.2.1.2.2.1.1";
} else if (100 < (target._y - _y)) {
_root.z_f_used = "2.2.1.2.2.1.2.1";
p_power = p_power + ((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "2.2.1.2.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
}
} else if (((rot_l + 5) + (root.vitr / 7)) < rotace) {
_root.z_f_used = "2.2.1.2.2.2";
p_rotace = p_rotace - ((((rotace - 45) / 10) + _x) - (target._x / 100));
} else {
_root.z_f_used = "2.2.1.2.2.3";
p_rotace = p_rotace + (((rot_l + (_root.vitr / 7)) - rotace) / 3);
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) / 1.5) + (((rot_l + (_root.vitr / 7)) - rotace) / 5));
}
} else if ((100 < (_y - target._y)) && ((_x - target._x) < 100)) {
_root.z_f_used = "2.2.2.1";
p_rotace = p_rotace + (((rot_l + (_root.vitr / 7)) - rotace) / 2);
} else {
_root.z_f_used = "2.2.2.2";
p_rotace = p_rotace + ((((rot_l + (_root.vitr / 7)) - rotace) / 2) - ((target._x - _x) / 100));
}
}
if (100 < p_power) {
p_power = 100;
}
if (p_power >= _root["tank_" + tank_number].energy) {
p_power = _root["tank_" + tank_number].energy;
if (_x < target._x) {
if (p_rotace < 135) {
if (70 < p_power) {
p_power = p_power - ((135 - p_rotace) / 2.5);
}
p_rotace = p_rotace + ((135 - p_rotace) / 3);
}
} else if (45 < p_rotace) {
if (70 < p_power) {
p_power = p_power - ((p_rotace - 45) / 2.5);
}
p_rotace = p_rotace - ((p_rotace - 45) / 3);
}
}
if (p_power < 0) {
p_power = 0;
}
if (p_rotace < 0) {
p_rotace = 0;
} else if (180 < p_rotace) {
p_rotace = 180;
}
}
function prepare_shot() {
prep = true;
if ((Math.max(rotace, p_rotace) - Math.min(rotace, p_rotace)) < 10) {
sp = 1;
} else {
sp = Math.floor((Math.max(rotace, p_rotace) - Math.min(rotace, p_rotace)) / 10);
}
if (Math.ceil(rotace) != Math.ceil(p_rotace)) {
if ((Math.ceil(p_rotace) < Math.ceil(rotace)) && ((rotace - sp) >= 0)) {
prep = false;
rotace = rotace - sp;
_root.tur.play();
} else if (180 >= (rotace + sp)) {
prep = false;
rotace = rotace + sp;
_root.tur.play();
}
}
if (Math.ceil(power) != Math.ceil(p_power)) {
if ((Math.ceil(p_power) < Math.ceil(power)) && ((power - sp) >= 0)) {
prep = false;
power = power - sp;
} else if (180 >= (power + sp)) {
prep = false;
power = power + sp;
}
}
if (((Math.round(p_x) != Math.round(_x)) && (0 < _root["tank_" + tank_number].fuel)) && (p_move)) {
prep = false;
if (Math.round(p_x) < Math.round(_x)) {
move_right();
} else {
move_left();
}
}
if (prep) {
return(true);
}
}
function select_target() {
vzd = 1000;
i = 1;
while (_root.pocet_hracu >= i) {
vz = Math.abs(_x - _root["tank" + i]._x);
if (((vz < vzd) && (i != tank_number)) && (_root["tank_" + i].live)) {
vzd = vz;
target = _root["tank" + i];
target_ = _root["tank_" + i];
}
i++;
}
}
function na_rade() {
rounds++;
par_active = false;
calc_hill_up();
}
function damage(damag, attacker, par) {
armor = 1;
arm = 1;
i = 0;
while (i < _root["tank_" + tank_number].specials[9]) {
armor = armor / (1.12 / arm);
arm = arm / 1.0002;
i++;
}
if ((!sh_active) || (par)) {
_root["tank_" + tank_number].energy = _root["tank_" + tank_number].energy - (damag * armor);
} else {
_root["shield" + tank_number].damage(damag, attacker);
}
if (0 >= _root["tank_" + tank_number].energy) {
if (this != attacker) {
_root["tank_" + attacker.tank_number].kills = _root["tank_" + attacker.tank_number].kills + 1;
_root["tank_" + attacker.tank_number].score = _root["tank_" + attacker.tank_number].score + 5000;
_root["tank_" + attacker.tank_number].total_score = _root["tank_" + attacker.tank_number].total_score + 5000;
} else {
_root["tank_" + tank_number].kills = _root["tank_" + tank_number].kills - 1;
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - 2000;
_root["tank_" + tank_number].total_score = _root["tank_" + tank_number].total_score - 2000;
}
}
if (this != attacker) {
_root["tank_" + attacker.tank_number].score = _root["tank_" + attacker.tank_number].score + (damag * 100);
_root["tank_" + attacker.tank_number].total_score = _root["tank_" + attacker.tank_number].total_score + (damag * 100);
} else {
if (par) {
damag = damag / 3;
}
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - Math.round(damag * 50);
_root["tank_" + tank_number].total_score = _root["tank_" + tank_number].total_score - Math.round(damag * 50);
if (_root["tank_" + tank_number].score < 0) {
_root["tank_" + tank_number].score = 0;
}
}
}
function fire() {
if (_root.debugging) {
save_inf();
}
last_wind = _root.vitr;
first_frame = true;
_root.attachMovie(_root.weapons[_root["tank_" + tank_number].cur_gun][4], "strela", 1000);
if (_root["tank_" + tank_number].cur_gun != 0) {
_root["tank_" + tank_number].guns[_root["tank_" + tank_number].cur_gun]--;
if (_root["tank_" + tank_number].guns[_root["tank_" + tank_number].cur_gun] == 0) {
_root["tank_" + tank_number].cur_gun = 0;
}
}
_root.strela._rotation = rotace - 90;
_root.strela._x = _x;
_root.strela._y = _y - 1;
_root.strela.strela.vo = power;
_root.strela.strela.owner = _root[_name];
_root[_name + "_hlaven"].play();
playing = false;
}
function save_inf() {
_root.z_target = target;
_root.z_target_name = target_.name;
_root.z_target_energy = target_.energy;
_root.z_target_live = target_.live;
_root.z_name = _root["tank_" + tank_number].name;
_root.z_energy = _root["tank_" + tank_number].energy;
if (target._x < _x) {
_root.z_pos = "right";
} else {
_root.z_pos = "left";
}
_root.z_x = _x;
_root.z_y = _y;
_root.z_tar_x = target._x;
_root.z_tar_y = target._y;
_root.z_last_vitr = last_wind;
_root.z_vitr = _root.vitr;
_root.z_wind_koef_vzd_koef = wind_koef_vzd_koef;
_root.z_angle = rotace;
_root.z_power = power;
_root.z_y_koef = y_koef;
_root.z_vzd_koef_k = vzd_koef_k;
_root.z_last_shot_x = last_shot_x;
_root.z_last_shot_y = last_shot_y;
_root.z_last_shot_vzd = last_shot_vzd;
_root.z_last_shot_y_vzd = y_vzd;
_root.z_last_shot_x_vzd = x_vzd;
_root.z_dif = dif;
fscommand ("SAVE", ((((((("debug/" add _root.game) add "_") add rounds) add "_") add _root.z_pos) add "_") add _root["tank_" + tank_number].name) add ".txt");
}
dif = _root["tank_" + tank_number].dif;
_y = ((_root["land" + Math.round(_x)]._y - (_root["land" + Math.round(_x)]._height / 2)) - 4);
i = 0;
while (i < _width) {
cur = _root["land" + Math.floor((_x - (_width / 2)) + i)];
if (hitTest(cur)) {
cur._y = cur._y + ((_y + (_height / 2)) - (cur._y - (cur._height / 2)));
}
i++;
}
if (0 < _root["tank_" + tank_number].specials[0]) {
par = true;
}
_root.attachMovie("hlaven", _name + "_hlaven", 10010 + tank_number);
rotace = (random(67) * 2) + 46;
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
_root[_name + "_hlaven"]._rotation = rotace;
power = 50;
playing = false;
testing = false;
par_active = false;
par_out = false;
par_used = false;
sh_active = false;
_root["t" + tank_number] = _root["tank" + tank_number];
first_shot = true;
first_frame = true;
calc_frame = true;
fuel_c = 1 / (_root["tank_" + tank_number].specials[10] + 1);
rounds = 0;
p_move = false;
select_target();
Symbol 19 MovieClip [ai_easy] Frame 2
if (400 < _y) {
_root["tank_" + tank_number].live = false;
_root["tank_" + tank_number].energy = 0;
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - 2000;
_root.hracu--;
if (_root["tank_" + tank_number].score < 0) {
_root["tank_" + tank_number].score = 0;
}
gotoAndPlay (4);
}
if (0 >= _root["tank_" + tank_number].energy) {
_root["tank_" + tank_number].energy = 0;
_root["tank_" + tank_number].live = false;
gotoAndPlay (4);
}
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
if (sh_active) {
_root["shield" + tank_number]._x = _x;
_root["shield" + tank_number]._y = _y;
}
if (playing) {
if ((!target_.live) && (first_frame)) {
rounds = 1;
select_target();
}
if (rounds == 1) {
if (first_frame) {
i = 1;
while (_root.pocet_hracu >= i) {
if ((_root["tank" + i].playing && (i != tank_number)) && (_root["tank_" + i].live)) {
_root["tank" + i].playing = false;
_root.test();
}
i++;
}
first_shot = true;
calc_first_shot();
}
} else if (first_frame) {
calc_shot();
}
first_frame = false;
_root.rotace = rotace;
_root.power = power;
if (prepare_shot()) {
fire();
}
na_zemi = false;
left = true;
right = true;
i = 0;
min = 500;
gg = false;
test_hill();
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
if (pasy.hitTest(cur)) {
na_zemi = true;
if (par_out) {
par_out = false;
_root["parachute" + tank_number].removeMovieClip();
}
if (0.4 < fall) {
if (fall < 0.8) {
damage(Math.round(fall * 25), this, true);
} else {
damage(Math.round((fall * fall) * 3000), this, true);
}
}
fall = 0;
}
top = cur._y - (cur._height / 2);
if ((top < min) && (na_zemi)) {
gg = true;
min = top;
}
if ((((i + 1) >= _width) && (na_zemi)) && (gg)) {
_y = (min - 2);
gg = false;
}
if (!na_zemi) {
if ((fall >= 0.2) && (par)) {
if (!par_active) {
par_active = true;
_root["tank_" + i].specials[0] = _root["tank_" + i].specials[0] - 1;
}
if (!par_out) {
_root.attachMovie("parachute", "parachute" + tank_number, 9000 + tank_number);
}
par_out = true;
}
_y = (_y + fall);
if (!par_out) {
fall = fall + 0.01;
} else {
_root["parachute" + tank_number]._x = _x;
_root["parachute" + tank_number]._y = _y - 7.5;
fall = 0.2;
_x = (_x + (_root.vitr / 3000));
}
}
i++;
}
if (_root["tank_" + tank_number].energy < power) {
power = _root["tank_" + tank_number].energy;
}
_root[_name + "_hlaven"]._rotation = rotace;
}
if (testing) {
i = 0;
min = 500;
gg = false;
test_hill();
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
if (pasy.hitTest(cur)) {
if (0.4 < fall) {
if (fall < 0.8) {
damage(Math.round(fall * 25), this, true);
} else {
damage(Math.round((fall * fall) * 80), this, true);
}
}
if (par_out) {
par_out = false;
_root["parachute" + tank_number].removeMovieClip();
}
na_zemi = true;
fall = 0;
}
top = cur._y - (cur._height / 2);
if ((top < min) && (na_zemi)) {
gg = true;
min = top;
}
if ((((i + 1) >= _width) && (na_zemi)) && (gg)) {
_y = (min - 2);
gg = false;
}
if (0.001 < fall) {
test = false;
}
if (!na_zemi) {
if ((fall >= 0.2) && (par)) {
if (!par_active) {
par_active = true;
_root["tank_" + tank_number].specials[0] = _root["tank_" + tank_number].specials[0] - 1;
}
if (!par_out) {
_root.attachMovie("parachute", "parachute" + tank_number, 9000 + tank_number);
}
par_out = true;
}
_y = (_y + fall);
if (!par_out) {
fall = fall + 0.01;
} else {
_root["parachute" + tank_number]._x = _x;
_root["parachute" + tank_number]._y = _y - 7.5;
fall = 0.2;
_x = (_x + (_root.vitr / 3000));
}
}
i++;
}
if (0.001 < fall) {
test = false;
}
test_hill();
x3 = x2;
x2 = x1;
x1 = Math.round(_x);
y3 = y2;
y2 = y1;
y1 = Math.round(_y * 10) / 10;
if ((y1 == y3) && (x1 == x3)) {
test = true;
}
if (test) {
testing = false;
_root[_name + "test"] = false;
}
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
test = true;
}
Symbol 19 MovieClip [ai_easy] Frame 3
gotoAndPlay (2);
Symbol 19 MovieClip [ai_easy] Frame 4
_root[_name + "_hlaven"].removeMovieClip();
_root["parachute" + tank_number].removeMovieClip();
_root["shield" + tank_number].removeMovieClip();
_root.hracu--;
Symbol 19 MovieClip [ai_easy] Frame 9
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((_x - x) * (_x - x)) + ((_y - h) * (_y - h))) * (180 / _width)));
cur._height = cur._height - (30 * vzr);
cur._y = cur._y + (15 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (50 / Math.abs(_x - x));
cur._y = cur._y + ((50 / Math.abs(_x - x)) / 2);
}
i++;
}
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if ((hitTest(current) || (hitTest(_root["shield" + i]))) && (i != tank_number)) {
x = _x - current._x;
y = _y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / 14));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / 18));
}
current.damage(damg, this);
}
i++;
}
Symbol 19 MovieClip [ai_easy] Frame 15
if (playing) {
_root.test();
}
stop();
Symbol 22 MovieClip [ai_normal] Frame 1
function test_hill() {
calc_hill_up();
if (((_root["land" + Math.ceil(_x - (_width / 2))]._y - (_root["land" + Math.ceil(_x - (_width / 2))]._height / 2)) < (_y - hill_up)) || ((_root["land" + Math.floor(_x - (_width / 2))]._y - (_root["land" + Math.floor(_x - (_width / 2))]._height / 2)) < (_y - hill_up))) {
_x = (_x + 0.7);
test = false;
left = false;
right = false;
} else if (((_root["land" + Math.floor(_x + (_width / 2))]._y - (_root["land" + Math.floor(_x + (_width / 2))]._height / 2)) < (_y - hill_up)) || ((_root["land" + Math.ceil(_x + (_width / 2))]._y - (_root["land" + Math.ceil(_x + (_width / 2))]._height / 2)) < (_y - hill_up))) {
left = false;
right = false;
_x = (_x - 0.7);
test = false;
} else {
left = true;
right = true;
}
}
function blik() {
_root.attachMovie("blk", "blik", 10030);
_root.blik._x = _x;
_root.blik._y = _y - 10;
}
function calc_hill_up() {
hill_up = (0.5 + _root["tank_" + tank_number].specials[11]) - (fall * 10);
}
function move_left() {
_x = (_x - 0.5);
_root["tank_" + tank_number].fuel = _root["tank_" + tank_number].fuel - fuel_c;
moving = true;
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if (hitTest(_root["tank" + i]) && (i != tank_number)) {
_x = (_x + 0.6);
}
i++;
}
}
function move_right() {
_x = (_x + 0.5);
_root["tank_" + tank_number].fuel = _root["tank_" + tank_number].fuel - fuel_c;
moving = true;
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if (hitTest(_root["tank" + i]) && (i != tank_number)) {
_x = (_x - 0.6);
}
i++;
}
}
function activate_shield(shield) {
_root.attachMovie(_root.specials[2 + shield][4], "shield" + tank_number, 5040 + tank_number);
_root["shield" + tank_number].num = tank_number;
_root["tank_" + tank_number].specials[2 + shield]--;
sh_active = true;
_root["t" + tank_number] = _root["shield" + tank_number];
}
function disable_shield() {
_root["shield" + tank_number].disable();
sh_active = false;
_root["t" + tank_number] = _root["tank" + tank_number];
}
function p_m(par) {
if (0 < par) {
return(1);
}
return(-1);
}
function calc_first_shot() {
_root.z_ai_dif = "hard";
p_rotace = 90 + (p_m(target._x - _x) * 45);
p_x = _x;
p_power = Math.abs(_x - target._x) / (2 + (Math.abs(_x - target._x) / 110));
if (p_power >= _root["tank_" + tank_number].energy) {
p_power = _root["tank_" + tank_number].energy;
}
}
function calc_shot() {
last_shot_vzd = Math.sqrt(Math.abs((_x - last_shot_x) * (_x - last_shot_x)) + Math.abs((_y - last_shot_y) * (_y - last_shot_y)));
target_vzd = Math.sqrt(Math.abs((_x - target._x) * (_x - target._x)) + Math.abs((_y - target._y) * (_y - target._y)));
x_vzd = Math.abs(last_shot_x - target._x);
y_vzd = Math.abs(last_shot_y - target._y);
if ((power >= _root["tank_" + tank_number].energy) || (power == 100)) {
full_power = true;
} else {
full_power = false;
}
wind_change_koef = 15;
wind_koef_vzd_koef = 500;
vzd_koef = 18;
vzd_koef_k = 12 + (Math.abs(_x - last_shot_x) / 80);
y_vzd_koef = 50;
y_koef = 40;
rot_r = 106 - ((200 - Math.abs(_x - target._x)) / 30);
rot_l = 74 + ((200 - Math.abs(_x - target._x)) / 30);
if (_x < target._x) {
wind_koef_vzd_koef = wind_koef_vzd_koef - ((180 - rotace) * 3);
y_koef = y_koef + ((135 - rotace) * 1.7);
if (last_shot_x < _x) {
_root.z_f_used = "1.1";
p_rotace = p_rotace + ((((_x - last_shot_x) / 10) + ((target._x - _x) / 20)) - (_root.vitr / 50));
} else if ((((60 < last_shot_vzd) || (target_vzd < 70)) || (power < 10)) && ((power < 70) || (200 < last_shot_vzd))) {
_root.z_f_used = "1.2.1.failed";
if (last_shot_x >= target._x) {
if (20 < x_vzd) {
_root.z_f_used = "1.2.1.1.1";
p_power = p_power - (((x_vzd / ((vzd_koef + 2.5) - (Math.abs(135 - rotace) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - ((last_shot_y - target._y) / y_koef));
} else {
_root.z_f_used = "1.2.1.1.2";
p_power = p_power - ((x_vzd / ((vzd_koef - 1) - (Math.abs(135 - rotace) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (last_shot_y < target._y) {
if (target._y < _y) {
if (((((((80 < (_y - target._y)) && (y_vzd < 80)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (220 < target_vzd)) && (30 < power)) && ((rot_r - (_root.vitr / 7)) < rotace)) {
_root.z_f_used = "1.2.1.2.1.1.1";
p_rotace = p_rotace - ((((rotace - (rot_r - (_root.vitr / 7))) / 4) + (_root.vitr / 20)) - (target_vzd / 100));
} else if (rotace < (rot_r - (_root.vitr / 7))) {
_root.z_f_used = "1.2.1.2.1.1.2.";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "1.2.1.2.1.1.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if (((300 < (target._x - _x)) && (power < 50)) && (rotace < 110)) {
_root.z_f_used = "1.2.1.2.1.1.4.1";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else if ((rot_r - (_root.vitr / 7)) < rotace) {
if (135 >= p_rotace) {
_root.z_f_used = "1.2.1.2.1.1.4.2.1";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + ((135 - rotace) / 8)) - (_root.vitr / 15)) + ((rotace - (rot_r - (_root.vitr / 7))) / 8));
} else {
_root.z_f_used = "1.2.1.2.1.1.4.2.2";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) - (_root.vitr / 15));
}
p_rotace = p_rotace - (((rotace - (rot_r - (_root.vitr / 7))) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((((((target._y - _y) < 70) && (y_vzd < 100)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (250 < target_vzd)) && (30 < power)) && ((rot_r - (_root.vitr / 7)) < rotace)) {
_root.z_f_used = "1.2.1.2.1.2.1";
p_rotace = p_rotace - ((((rotace - (rot_r - (_root.vitr / 7))) / 4.5) + (_root.vitr / 20)) - (target_vzd / 100));
} else if (rotace < (rot_r - (_root.vitr / 7))) {
_root.z_f_used = "1.2.1.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "1.2.1.2.1.2.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if ((200 < (target._y - _y)) && (_y < last_shot_y)) {
_root.z_f_used = "1.2.1.2.1.2.4.1";
if (120 < p_rotace) {
_root.z_f_used = "1.2.1.2.1.2.4.1.1";
p_power = p_power + ((x_vzd / (vzd_koef / 1.5)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "1.2.1.2.1.2.4.1.2";
p_power = p_power + ((x_vzd / (vzd_koef / 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (((300 < (target._x - _x)) && (power < 50)) && (rotace < 110)) {
_root.z_f_used = "1.2.1.2.1.2.4.2.";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else if ((rot_r - (_root.vitr / 7)) < rotace) {
if (135 >= p_rotace) {
_root.z_f_used = "1.2.1.2.1.2.4.3.1.";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - (y_vzd / y_vzd_koef)) + ((135 - rotace) / 8)) - (_root.vitr / 15)) + ((rotace - (rot_r - (_root.vitr / 7))) / 8));
} else {
_root.z_f_used = "1.2.1.2.1.2.4.3.2.";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - (y_vzd / y_vzd_koef)) - (_root.vitr / 15));
}
p_rotace = p_rotace - (((rotace - (rot_r - (_root.vitr / 7))) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((last_shot_vzd < 150) && ((target._x - _x) < 170)) || (last_shot_vzd >= 100)) || ((last_shot_vzd < 100) && (power < 30))) {
if (target._y < _y) {
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
_root.z_f_used = "1.2.1.2.2.1.1";
} else if (100 < (target._y - _y)) {
_root.z_f_used = "1.2.1.2.2.1.2.1";
p_power = p_power + ((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "1.2.1.2.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
}
} else if (rotace < ((rot_r - 5) - (root.vitr / 7))) {
_root.z_f_used = "1.2.1.2.2.2";
p_rotace = p_rotace + ((((135 - rotace) / 10) + target._x) - (_x / 100));
} else {
_root.z_f_used = "1.2.1.2.2.3";
p_rotace = p_rotace - ((rotace - (rot_r - (_root.vitr / 7))) / 2);
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) / 1.5) + ((rotace - (rot_r - (_root.vitr / 7))) / 5));
}
} else if ((100 < (_y - target._y)) && ((target._x - _x) < 100)) {
_root.z_f_used = "1.2.2.1";
p_rotace = p_rotace - ((rotace - (rot_r - (_root.vitr / 7))) / 2);
} else {
_root.z_f_used = "1.2.2.2";
p_rotace = p_rotace - (((rotace - (rot_r - (_root.vitr / 7))) / 2) - ((target._x - _x) / 100));
}
} else {
wind_koef_vzd_koef = wind_koef_vzd_koef - (rotace * 3);
y_koef = y_koef + ((rotace - 45) * 1.7);
if (_x < last_shot_x) {
_root.z_f_used = "2.1";
p_rotace = p_rotace - ((((last_shot_x - _x) / 10) + ((_x - target._x) / 20)) + (_root.vitr / 50));
} else if ((((60 < last_shot_vzd) || (target_vzd < 70)) || (power < 10)) && ((power < 70) || (200 < last_shot_vzd))) {
_root.z_f_used = "2.2.1.failed";
if (target._x >= last_shot_x) {
if (20 < x_vzd) {
_root.z_f_used = "2.2.1.1.1";
p_power = p_power - (((x_vzd / ((vzd_koef + 2.5) - (Math.abs(45 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - ((last_shot_y - target._y) / y_koef));
} else {
_root.z_f_used = "2.2.1.1.2";
p_power = p_power - ((x_vzd / ((vzd_koef - 1) - (Math.abs(45 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (last_shot_y < target._y) {
if (target._y < _y) {
if (((((((80 < (_y - target._y)) && (y_vzd < 80)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (220 < target_vzd)) && (30 < power)) && ((rot_l + (_root.vitr / 7)) < rotace)) {
_root.z_f_used = "2.2.1.2.1.1.1";
p_rotace = p_rotace + (((((rot_l + (_root.vitr / 7)) - rotace) / 4) - (_root.vitr / 20)) - (target_vzd / 100));
} else if ((rot_l + (_root.vitr / 7)) < rotace) {
_root.z_f_used = "2.2.1.2.1.1.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "2.2.1.2.1.1.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if (((300 < (_x - target._x)) && (power < 50)) && (70 < rotace)) {
_root.z_f_used = "2.2.1.2.1.1.4.1";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef))));
} else if (rotace < (rot_l + (_root.vitr / 7))) {
if (p_rotace >= 45) {
_root.z_f_used = "2.2.1.2.1.1.4.2.1";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + ((rotace - 45) / 8)) + (_root.vitr / 15)) + (((rot_l + (_root.vitr / 7)) - rotace) / 8));
} else {
_root.z_f_used = "2.2.1.2.1.1.4.2.2";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + (_root.vitr / 15));
}
p_rotace = p_rotace + ((((rot_l + (_root.vitr / 7)) - rotace) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((((((target._y - _y) < 70) && (y_vzd < 100)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (250 < target_vzd)) && (30 < power)) && (rotace < (rot_l - (_root.vitr / 7)))) {
_root.z_f_used = "2.2.1.2.1.2.1";
p_rotace = p_rotace + (((((rot_l + (_root.vitr / 7)) - rotace) / 4.5) - (_root.vitr / 20)) - (target_vzd / 100));
} else if ((rot_l + (_root.vitr / 7)) < rotace) {
_root.z_f_used = "2.2.1.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "2.2.1.2.1.2.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(45 - rotace) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if ((200 < (target._y - _y)) && (_y < last_shot_y)) {
if (p_rotace < 60) {
_root.z_f_used = "2.2.1.2.1.2.4.1.1";
p_power = p_power + ((x_vzd / (vzd_koef / 1.5)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "2.2.1.2.1.2.4.1.2";
p_power = p_power + ((x_vzd / (vzd_koef / 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (((300 < (_x - target._x)) && (power < 50)) && (70 < rotace)) {
_root.z_f_used = "2.2.1.2.1.2.4.2";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else if (rotace < (rot_l + (_root.vitr / 7))) {
if (p_rotace >= 45) {
_root.z_f_used = "2.2.1.2.1.2.4.3.1";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + ((rotace - 45) / 8)) + (_root.vitr / 15)) + (((rot_l + (_root.vitr / 7)) - rotace) / 8));
} else {
_root.z_f_used = "2.2.1.2.1.2.4.3.2";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + (_root.vitr / 15));
}
p_rotace = p_rotace + ((((rot_l + (_root.vitr / 7)) - rotace) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((last_shot_vzd < 150) && ((_x - target._x) < 170)) || (last_shot_vzd >= 100)) || ((last_shot_vzd < 100) && (power < 30))) {
if (target._y < _y) {
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
_root.z_f_used = "2.2.1.2.2.1.1";
} else if (100 < (target._y - _y)) {
_root.z_f_used = "2.2.1.2.2.1.2.1";
p_power = p_power + ((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "2.2.1.2.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
}
} else if (((rot_l + 5) + (root.vitr / 7)) < rotace) {
_root.z_f_used = "2.2.1.2.2.2";
p_rotace = p_rotace - ((((rotace - 45) / 10) + _x) - (target._x / 100));
} else {
_root.z_f_used = "2.2.1.2.2.3";
p_rotace = p_rotace + (((rot_l + (_root.vitr / 7)) - rotace) / 3);
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) / 1.5) + (((rot_l + (_root.vitr / 7)) - rotace) / 5));
}
} else if ((100 < (_y - target._y)) && ((_x - target._x) < 100)) {
_root.z_f_used = "2.2.2.1";
p_rotace = p_rotace + (((rot_l + (_root.vitr / 7)) - rotace) / 2);
} else {
_root.z_f_used = "2.2.2.2";
p_rotace = p_rotace + ((((rot_l + (_root.vitr / 7)) - rotace) / 2) - ((target._x - _x) / 100));
}
}
if (100 < p_power) {
p_power = 100;
}
if (p_power >= _root["tank_" + tank_number].energy) {
p_power = _root["tank_" + tank_number].energy;
if (_x < target._x) {
if (p_rotace < 135) {
if (70 < p_power) {
p_power = p_power - ((135 - p_rotace) / 2.5);
}
p_rotace = p_rotace + ((135 - p_rotace) / 3);
}
} else if (45 < p_rotace) {
if (70 < p_power) {
p_power = p_power - ((p_rotace - 45) / 2.5);
}
p_rotace = p_rotace - ((p_rotace - 45) / 3);
}
}
if (p_power < 0) {
p_power = 0;
}
if (p_rotace < 0) {
p_rotace = 0;
} else if (180 < p_rotace) {
p_rotace = 180;
}
}
function prepare_shot() {
prep = true;
if ((Math.max(rotace, p_rotace) - Math.min(rotace, p_rotace)) < 10) {
sp = 1;
} else {
sp = Math.floor((Math.max(rotace, p_rotace) - Math.min(rotace, p_rotace)) / 10);
}
if (Math.ceil(rotace) != Math.ceil(p_rotace)) {
if ((Math.ceil(p_rotace) < Math.ceil(rotace)) && ((rotace - sp) >= 0)) {
prep = false;
rotace = rotace - sp;
_root.tur.play();
} else if (180 >= (rotace + sp)) {
prep = false;
rotace = rotace + sp;
_root.tur.play();
}
}
if (Math.ceil(power) != Math.ceil(p_power)) {
if ((Math.ceil(p_power) < Math.ceil(power)) && ((power - sp) >= 0)) {
prep = false;
power = power - sp;
} else if (180 >= (power + sp)) {
prep = false;
power = power + sp;
}
}
if (((Math.round(p_x) != Math.round(_x)) && (0 < _root["tank_" + tank_number].fuel)) && (p_move)) {
prep = false;
if (Math.round(p_x) < Math.round(_x)) {
move_right();
} else {
move_left();
}
}
if (prep) {
return(true);
}
}
function select_target() {
vzd = 1000;
i = 1;
while (_root.pocet_hracu >= i) {
vz = Math.abs(_x - _root["tank" + i]._x);
if (((vz < vzd) && (i != tank_number)) && (_root["tank_" + i].live)) {
vzd = vz;
target = _root["tank" + i];
target_ = _root["tank_" + i];
}
i++;
}
}
function na_rade() {
rounds++;
par_active = false;
calc_hill_up();
}
function damage(damag, attacker, par) {
armor = 1;
arm = 1;
i = 0;
while (i < _root["tank_" + tank_number].specials[9]) {
armor = armor / (1.12 / arm);
arm = arm / 1.0002;
i++;
}
if ((!sh_active) || (par)) {
_root["tank_" + tank_number].energy = _root["tank_" + tank_number].energy - (damag * armor);
} else {
_root["shield" + tank_number].damage(damag, attacker);
}
if (0 >= _root["tank_" + tank_number].energy) {
if (this != attacker) {
_root["tank_" + attacker.tank_number].kills = _root["tank_" + attacker.tank_number].kills + 1;
_root["tank_" + attacker.tank_number].score = _root["tank_" + attacker.tank_number].score + 5000;
_root["tank_" + attacker.tank_number].total_score = _root["tank_" + attacker.tank_number].total_score + 5000;
} else {
_root["tank_" + tank_number].kills = _root["tank_" + tank_number].kills - 1;
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - 2000;
_root["tank_" + tank_number].total_score = _root["tank_" + tank_number].total_score - 2000;
}
}
if (this != attacker) {
_root["tank_" + attacker.tank_number].score = _root["tank_" + attacker.tank_number].score + (damag * 100);
_root["tank_" + attacker.tank_number].total_score = _root["tank_" + attacker.tank_number].total_score + (damag * 100);
} else {
if (par) {
damag = damag / 3;
}
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - Math.round(damag * 50);
_root["tank_" + tank_number].total_score = _root["tank_" + tank_number].total_score - Math.round(damag * 50);
if (_root["tank_" + tank_number].score < 0) {
_root["tank_" + tank_number].score = 0;
}
}
}
function fire() {
if (_root.debugging) {
save_inf();
}
last_wind = _root.vitr;
first_frame = true;
_root.attachMovie(_root.weapons[_root["tank_" + tank_number].cur_gun][4], "strela", 1000);
if (_root["tank_" + tank_number].cur_gun != 0) {
_root["tank_" + tank_number].guns[_root["tank_" + tank_number].cur_gun]--;
if (_root["tank_" + tank_number].guns[_root["tank_" + tank_number].cur_gun] == 0) {
_root["tank_" + tank_number].cur_gun = 0;
}
}
_root.strela._rotation = rotace - 90;
_root.strela._x = _x;
_root.strela._y = _y - 1;
_root.strela.strela.vo = power;
_root.strela.strela.owner = _root[_name];
_root[_name + "_hlaven"].play();
playing = false;
}
function save_inf() {
_root.z_target = target;
_root.z_target_name = target_.name;
_root.z_target_energy = target_.energy;
_root.z_target_live = target_.live;
_root.z_name = _root["tank_" + tank_number].name;
_root.z_energy = _root["tank_" + tank_number].energy;
if (target._x < _x) {
_root.z_pos = "right";
} else {
_root.z_pos = "left";
}
_root.z_x = _x;
_root.z_y = _y;
_root.z_tar_x = target._x;
_root.z_tar_y = target._y;
_root.z_last_vitr = last_wind;
_root.z_vitr = _root.vitr;
_root.z_wind_koef_vzd_koef = wind_koef_vzd_koef;
_root.z_angle = rotace;
_root.z_power = power;
_root.z_y_koef = y_koef;
_root.z_vzd_koef_k = vzd_koef_k;
_root.z_last_shot_x = last_shot_x;
_root.z_last_shot_y = last_shot_y;
_root.z_last_shot_vzd = last_shot_vzd;
_root.z_last_shot_y_vzd = y_vzd;
_root.z_last_shot_x_vzd = x_vzd;
_root.z_dif = dif;
fscommand ("SAVE", ((((((("debug/" add _root.game) add "_") add rounds) add "_") add _root.z_pos) add "_") add _root["tank_" + tank_number].name) add ".txt");
}
dif = _root["tank_" + tank_number].dif;
_y = ((_root["land" + Math.round(_x)]._y - (_root["land" + Math.round(_x)]._height / 2)) - 4);
i = 0;
while (i < _width) {
cur = _root["land" + Math.floor((_x - (_width / 2)) + i)];
if (hitTest(cur)) {
cur._y = cur._y + ((_y + (_height / 2)) - (cur._y - (cur._height / 2)));
}
i++;
}
if (0 < _root["tank_" + tank_number].specials[0]) {
par = true;
}
_root.attachMovie("hlaven", _name + "_hlaven", 10010 + tank_number);
rotace = (random(67) * 2) + 46;
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
_root[_name + "_hlaven"]._rotation = rotace;
power = 50;
playing = false;
testing = false;
par_active = false;
par_out = false;
par_used = false;
sh_active = false;
_root["t" + tank_number] = _root["tank" + tank_number];
first_shot = true;
first_frame = true;
calc_frame = true;
fuel_c = 1 / (_root["tank_" + tank_number].specials[10] + 1);
rounds = 0;
p_move = false;
select_target();
Symbol 22 MovieClip [ai_normal] Frame 2
if (400 < _y) {
_root["tank_" + tank_number].live = false;
_root["tank_" + tank_number].energy = 0;
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - 2000;
_root.hracu--;
if (_root["tank_" + tank_number].score < 0) {
_root["tank_" + tank_number].score = 0;
}
gotoAndPlay (4);
}
if (0 >= _root["tank_" + tank_number].energy) {
_root["tank_" + tank_number].energy = 0;
_root["tank_" + tank_number].live = false;
gotoAndPlay (4);
}
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
if (sh_active) {
_root["shield" + tank_number]._x = _x;
_root["shield" + tank_number]._y = _y;
}
if (playing) {
if ((!target_.live) && (first_frame)) {
rounds = 1;
select_target();
}
if (rounds == 1) {
if (first_frame) {
i = 1;
while (_root.pocet_hracu >= i) {
if ((_root["tank" + i].playing && (i != tank_number)) && (_root["tank_" + i].live)) {
_root["tank" + i].playing = false;
_root.test();
}
i++;
}
first_shot = true;
calc_first_shot();
}
} else if (first_frame) {
calc_shot();
}
first_frame = false;
_root.rotace = rotace;
_root.power = power;
if (prepare_shot()) {
fire();
}
na_zemi = false;
left = true;
right = true;
i = 0;
min = 500;
gg = false;
test_hill();
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
if (pasy.hitTest(cur)) {
na_zemi = true;
if (par_out) {
par_out = false;
_root["parachute" + tank_number].removeMovieClip();
}
if (0.4 < fall) {
if (fall < 0.8) {
damage(Math.round(fall * 25), this, true);
} else {
damage(Math.round((fall * fall) * 3000), this, true);
}
}
fall = 0;
}
top = cur._y - (cur._height / 2);
if ((top < min) && (na_zemi)) {
gg = true;
min = top;
}
if ((((i + 1) >= _width) && (na_zemi)) && (gg)) {
_y = (min - 2);
gg = false;
}
if (!na_zemi) {
if ((fall >= 0.2) && (par)) {
if (!par_active) {
par_active = true;
_root["tank_" + i].specials[0] = _root["tank_" + i].specials[0] - 1;
}
if (!par_out) {
_root.attachMovie("parachute", "parachute" + tank_number, 9000 + tank_number);
}
par_out = true;
}
_y = (_y + fall);
if (!par_out) {
fall = fall + 0.01;
} else {
_root["parachute" + tank_number]._x = _x;
_root["parachute" + tank_number]._y = _y - 7.5;
fall = 0.2;
_x = (_x + (_root.vitr / 3000));
}
}
i++;
}
if (_root["tank_" + tank_number].energy < power) {
power = _root["tank_" + tank_number].energy;
}
_root[_name + "_hlaven"]._rotation = rotace;
}
if (testing) {
i = 0;
min = 500;
gg = false;
test_hill();
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
if (pasy.hitTest(cur)) {
if (0.4 < fall) {
if (fall < 0.8) {
damage(Math.round(fall * 25), this, true);
} else {
damage(Math.round((fall * fall) * 80), this, true);
}
}
if (par_out) {
par_out = false;
_root["parachute" + tank_number].removeMovieClip();
}
na_zemi = true;
fall = 0;
}
top = cur._y - (cur._height / 2);
if ((top < min) && (na_zemi)) {
gg = true;
min = top;
}
if ((((i + 1) >= _width) && (na_zemi)) && (gg)) {
_y = (min - 2);
gg = false;
}
if (0.001 < fall) {
test = false;
}
if (!na_zemi) {
if ((fall >= 0.2) && (par)) {
if (!par_active) {
par_active = true;
_root["tank_" + tank_number].specials[0] = _root["tank_" + tank_number].specials[0] - 1;
}
if (!par_out) {
_root.attachMovie("parachute", "parachute" + tank_number, 9000 + tank_number);
}
par_out = true;
}
_y = (_y + fall);
if (!par_out) {
fall = fall + 0.01;
} else {
_root["parachute" + tank_number]._x = _x;
_root["parachute" + tank_number]._y = _y - 7.5;
fall = 0.2;
_x = (_x + (_root.vitr / 3000));
}
}
i++;
}
if (0.001 < fall) {
test = false;
}
test_hill();
x3 = x2;
x2 = x1;
x1 = Math.round(_x);
y3 = y2;
y2 = y1;
y1 = Math.round(_y * 10) / 10;
if ((y1 == y3) && (x1 == x3)) {
test = true;
}
if (test) {
testing = false;
_root[_name + "test"] = false;
}
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
test = true;
}
Symbol 22 MovieClip [ai_normal] Frame 3
gotoAndPlay (2);
Symbol 22 MovieClip [ai_normal] Frame 4
_root[_name + "_hlaven"].removeMovieClip();
_root["parachute" + tank_number].removeMovieClip();
_root["shield" + tank_number].removeMovieClip();
_root.hracu--;
Symbol 22 MovieClip [ai_normal] Frame 9
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((_x - x) * (_x - x)) + ((_y - h) * (_y - h))) * (180 / _width)));
cur._height = cur._height - (30 * vzr);
cur._y = cur._y + (15 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (50 / Math.abs(_x - x));
cur._y = cur._y + ((50 / Math.abs(_x - x)) / 2);
}
i++;
}
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if ((hitTest(current) || (hitTest(_root["shield" + i]))) && (i != tank_number)) {
x = _x - current._x;
y = _y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / 14));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / 18));
}
current.damage(damg, this);
}
i++;
}
Symbol 22 MovieClip [ai_normal] Frame 15
if (playing) {
_root.test();
}
stop();
Symbol 25 MovieClip [ai_hard] Frame 1
function test_hill() {
calc_hill_up();
if (((_root["land" + Math.ceil(_x - (_width / 2))]._y - (_root["land" + Math.ceil(_x - (_width / 2))]._height / 2)) < (_y - hill_up)) || ((_root["land" + Math.floor(_x - (_width / 2))]._y - (_root["land" + Math.floor(_x - (_width / 2))]._height / 2)) < (_y - hill_up))) {
_x = (_x + 0.7);
test = false;
left = false;
right = false;
} else if (((_root["land" + Math.floor(_x + (_width / 2))]._y - (_root["land" + Math.floor(_x + (_width / 2))]._height / 2)) < (_y - hill_up)) || ((_root["land" + Math.ceil(_x + (_width / 2))]._y - (_root["land" + Math.ceil(_x + (_width / 2))]._height / 2)) < (_y - hill_up))) {
left = false;
right = false;
_x = (_x - 0.7);
test = false;
} else {
left = true;
right = true;
}
}
function blik() {
_root.attachMovie("blk", "blik", 10030);
_root.blik._x = _x;
_root.blik._y = _y - 10;
}
function calc_hill_up() {
hill_up = (0.5 + _root["tank_" + tank_number].specials[11]) - (fall * 10);
}
function move_left() {
_x = (_x - 0.5);
_root["tank_" + tank_number].fuel = _root["tank_" + tank_number].fuel - fuel_c;
moving = true;
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if (hitTest(_root["tank" + i]) && (i != tank_number)) {
_x = (_x + 0.6);
}
i++;
}
}
function move_right() {
_x = (_x + 0.5);
_root["tank_" + tank_number].fuel = _root["tank_" + tank_number].fuel - fuel_c;
moving = true;
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if (hitTest(_root["tank" + i]) && (i != tank_number)) {
_x = (_x - 0.6);
}
i++;
}
}
function activate_shield(shield) {
_root.attachMovie(_root.specials[2 + shield][4], "shield" + tank_number, 5040 + tank_number);
_root["shield" + tank_number].num = tank_number;
_root["tank_" + tank_number].specials[2 + shield]--;
sh_active = true;
_root["t" + tank_number] = _root["shield" + tank_number];
}
function disable_shield() {
_root["shield" + tank_number].disable();
sh_active = false;
_root["t" + tank_number] = _root["tank" + tank_number];
}
function p_m(par) {
if (0 < par) {
return(1);
}
return(-1);
}
function calc_first_shot() {
_root.z_ai_dif = "hard";
p_rotace = 90 + (p_m(target._x - _x) * 45);
p_x = _x;
p_power = Math.abs(_x - target._x) / (2 + (Math.abs(_x - target._x) / 80));
if (p_power >= _root["tank_" + tank_number].energy) {
p_power = _root["tank_" + tank_number].energy;
}
}
function calc_shot() {
last_shot_vzd = Math.sqrt(Math.abs((_x - last_shot_x) * (_x - last_shot_x)) + Math.abs((_y - last_shot_y) * (_y - last_shot_y)));
target_vzd = Math.sqrt(Math.abs((_x - target._x) * (_x - target._x)) + Math.abs((_y - target._y) * (_y - target._y)));
x_vzd = Math.abs(last_shot_x - target._x);
y_vzd = Math.abs(last_shot_y - target._y);
if ((power >= _root["tank_" + tank_number].energy) || (power == 100)) {
full_power = true;
} else {
full_power = false;
}
wind_change_koef = 11;
wind_koef_vzd_koef = 420;
vzd_koef = 14;
vzd_koef_k = 9 + (Math.abs(_x - last_shot_x) / 80);
y_vzd_koef = 40;
y_koef = 30;
rot_r = 102 - ((200 - Math.abs(_x - target._x)) / 30);
rot_l = 78 + ((200 - Math.abs(_x - target._x)) / 30);
if (_x < target._x) {
wind_koef_vzd_koef = wind_koef_vzd_koef - ((180 - rotace) * 3);
y_koef = y_koef + ((135 - rotace) * 1.7);
if (last_shot_x < _x) {
_root.z_f_used = "1.1";
p_rotace = p_rotace + ((((_x - last_shot_x) / 10) + ((target._x - _x) / 20)) - (_root.vitr / 50));
} else if ((((60 < last_shot_vzd) || (target_vzd < 70)) || (power < 10)) && ((power < 70) || (200 < last_shot_vzd))) {
_root.z_f_used = "1.2.1.failed";
if (last_shot_x >= target._x) {
if (20 < x_vzd) {
_root.z_f_used = "1.2.1.1.1";
p_power = p_power - (((x_vzd / ((vzd_koef + 2.5) - (Math.abs(135 - rotace) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - ((last_shot_y - target._y) / y_koef));
} else {
_root.z_f_used = "1.2.1.1.2";
p_power = p_power - ((x_vzd / ((vzd_koef - 1) - (Math.abs(135 - rotace) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (last_shot_y < target._y) {
if (target._y < _y) {
if (((((((80 < (_y - target._y)) && (y_vzd < 80)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (220 < target_vzd)) && (30 < power)) && ((rot_r - (_root.vitr / 7)) < rotace)) {
_root.z_f_used = "1.2.1.2.1.1.1";
p_rotace = p_rotace - ((((rotace - (rot_r - (_root.vitr / 7))) / 4) + (_root.vitr / 20)) - (target_vzd / 100));
} else if (rotace < (rot_r - (_root.vitr / 7))) {
_root.z_f_used = "1.2.1.2.1.1.2.";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "1.2.1.2.1.1.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if (((300 < (target._x - _x)) && (power < 50)) && (rotace < 110)) {
_root.z_f_used = "1.2.1.2.1.1.4.1";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else if ((rot_r - (_root.vitr / 7)) < rotace) {
if (135 >= p_rotace) {
_root.z_f_used = "1.2.1.2.1.1.4.2.1";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + ((135 - rotace) / 8)) - (_root.vitr / 15)) + ((rotace - (rot_r - (_root.vitr / 7))) / 8));
} else {
_root.z_f_used = "1.2.1.2.1.1.4.2.2";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) - (_root.vitr / 15));
}
p_rotace = p_rotace - (((rotace - (rot_r - (_root.vitr / 7))) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((((((target._y - _y) < 70) && (y_vzd < 100)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (250 < target_vzd)) && (30 < power)) && ((rot_r - (_root.vitr / 7)) < rotace)) {
_root.z_f_used = "1.2.1.2.1.2.1";
p_rotace = p_rotace - ((((rotace - (rot_r - (_root.vitr / 7))) / 4.5) + (_root.vitr / 20)) - (target_vzd / 100));
} else if (rotace < (rot_r - (_root.vitr / 7))) {
_root.z_f_used = "1.2.1.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "1.2.1.2.1.2.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if ((200 < (target._y - _y)) && (_y < last_shot_y)) {
_root.z_f_used = "1.2.1.2.1.2.4.1";
if (120 < p_rotace) {
_root.z_f_used = "1.2.1.2.1.2.4.1.1";
p_power = p_power + ((x_vzd / (vzd_koef / 1.5)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "1.2.1.2.1.2.4.1.2";
p_power = p_power + ((x_vzd / (vzd_koef / 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (((300 < (target._x - _x)) && (power < 50)) && (rotace < 110)) {
_root.z_f_used = "1.2.1.2.1.2.4.2.";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else if ((rot_r - (_root.vitr / 7)) < rotace) {
if (135 >= p_rotace) {
_root.z_f_used = "1.2.1.2.1.2.4.3.1.";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - (y_vzd / y_vzd_koef)) + ((135 - rotace) / 8)) - (_root.vitr / 15)) + ((rotace - (rot_r - (_root.vitr / 7))) / 8));
} else {
_root.z_f_used = "1.2.1.2.1.2.4.3.2.";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - (y_vzd / y_vzd_koef)) - (_root.vitr / 15));
}
p_rotace = p_rotace - (((rotace - (rot_r - (_root.vitr / 7))) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((last_shot_vzd < 150) && ((target._x - _x) < 170)) || (last_shot_vzd >= 100)) || ((last_shot_vzd < 100) && (power < 30))) {
if (target._y < _y) {
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
_root.z_f_used = "1.2.1.2.2.1.1";
} else if (100 < (target._y - _y)) {
_root.z_f_used = "1.2.1.2.2.1.2.1";
p_power = p_power + ((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "1.2.1.2.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
}
} else if (rotace < ((rot_r - 5) - (root.vitr / 7))) {
_root.z_f_used = "1.2.1.2.2.2";
p_rotace = p_rotace + ((((135 - rotace) / 10) + target._x) - (_x / 100));
} else {
_root.z_f_used = "1.2.1.2.2.3";
p_rotace = p_rotace - ((rotace - (rot_r - (_root.vitr / 7))) / 2);
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) / 1.5) + ((rotace - (rot_r - (_root.vitr / 7))) / 5));
}
} else if ((100 < (_y - target._y)) && ((target._x - _x) < 100)) {
_root.z_f_used = "1.2.2.1";
p_rotace = p_rotace - ((rotace - (rot_r - (_root.vitr / 7))) / 2);
} else {
_root.z_f_used = "1.2.2.2";
p_rotace = p_rotace - (((rotace - (rot_r - (_root.vitr / 7))) / 2) - ((target._x - _x) / 100));
}
} else {
wind_koef_vzd_koef = wind_koef_vzd_koef - (rotace * 3);
y_koef = y_koef + ((rotace - 45) * 1.7);
if (_x < last_shot_x) {
_root.z_f_used = "2.1";
p_rotace = p_rotace - ((((last_shot_x - _x) / 10) + ((_x - target._x) / 20)) + (_root.vitr / 50));
} else if ((((60 < last_shot_vzd) || (target_vzd < 70)) || (power < 10)) && ((power < 70) || (200 < last_shot_vzd))) {
_root.z_f_used = "2.2.1.failed";
if (target._x >= last_shot_x) {
if (20 < x_vzd) {
_root.z_f_used = "2.2.1.1.1";
p_power = p_power - (((x_vzd / ((vzd_koef + 2.5) - (Math.abs(45 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - ((last_shot_y - target._y) / y_koef));
} else {
_root.z_f_used = "2.2.1.1.2";
p_power = p_power - ((x_vzd / ((vzd_koef - 1) - (Math.abs(45 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (last_shot_y < target._y) {
if (target._y < _y) {
if (((((((80 < (_y - target._y)) && (y_vzd < 80)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (220 < target_vzd)) && (30 < power)) && ((rot_l + (_root.vitr / 7)) < rotace)) {
_root.z_f_used = "2.2.1.2.1.1.1";
p_rotace = p_rotace + (((((rot_l + (_root.vitr / 7)) - rotace) / 4) - (_root.vitr / 20)) - (target_vzd / 100));
} else if ((rot_l + (_root.vitr / 7)) < rotace) {
_root.z_f_used = "2.2.1.2.1.1.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "2.2.1.2.1.1.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if (((300 < (_x - target._x)) && (power < 50)) && (70 < rotace)) {
_root.z_f_used = "2.2.1.2.1.1.4.1";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef))));
} else if (rotace < (rot_l + (_root.vitr / 7))) {
if (p_rotace >= 45) {
_root.z_f_used = "2.2.1.2.1.1.4.2.1";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + ((rotace - 45) / 8)) + (_root.vitr / 15)) + (((rot_l + (_root.vitr / 7)) - rotace) / 8));
} else {
_root.z_f_used = "2.2.1.2.1.1.4.2.2";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + (_root.vitr / 15));
}
p_rotace = p_rotace + ((((rot_l + (_root.vitr / 7)) - rotace) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((((((target._y - _y) < 70) && (y_vzd < 100)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (250 < target_vzd)) && (30 < power)) && (rotace < (rot_l - (_root.vitr / 7)))) {
_root.z_f_used = "2.2.1.2.1.2.1";
p_rotace = p_rotace + (((((rot_l + (_root.vitr / 7)) - rotace) / 4.5) - (_root.vitr / 20)) - (target_vzd / 100));
} else if ((rot_l + (_root.vitr / 7)) < rotace) {
_root.z_f_used = "2.2.1.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "2.2.1.2.1.2.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(45 - rotace) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if ((200 < (target._y - _y)) && (_y < last_shot_y)) {
if (p_rotace < 60) {
_root.z_f_used = "2.2.1.2.1.2.4.1.1";
p_power = p_power + ((x_vzd / (vzd_koef / 1.5)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "2.2.1.2.1.2.4.1.2";
p_power = p_power + ((x_vzd / (vzd_koef / 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (((300 < (_x - target._x)) && (power < 50)) && (70 < rotace)) {
_root.z_f_used = "2.2.1.2.1.2.4.2";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else if (rotace < (rot_l + (_root.vitr / 7))) {
if (p_rotace >= 45) {
_root.z_f_used = "2.2.1.2.1.2.4.3.1";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + ((rotace - 45) / 8)) + (_root.vitr / 15)) + (((rot_l + (_root.vitr / 7)) - rotace) / 8));
} else {
_root.z_f_used = "2.2.1.2.1.2.4.3.2";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + (_root.vitr / 15));
}
p_rotace = p_rotace + ((((rot_l + (_root.vitr / 7)) - rotace) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((last_shot_vzd < 150) && ((_x - target._x) < 170)) || (last_shot_vzd >= 100)) || ((last_shot_vzd < 100) && (power < 30))) {
if (target._y < _y) {
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
_root.z_f_used = "2.2.1.2.2.1.1";
} else if (100 < (target._y - _y)) {
_root.z_f_used = "2.2.1.2.2.1.2.1";
p_power = p_power + ((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "2.2.1.2.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
}
} else if (((rot_l + 5) + (root.vitr / 7)) < rotace) {
_root.z_f_used = "2.2.1.2.2.2";
p_rotace = p_rotace - ((((rotace - 45) / 10) + _x) - (target._x / 100));
} else {
_root.z_f_used = "2.2.1.2.2.3";
p_rotace = p_rotace + (((rot_l + (_root.vitr / 7)) - rotace) / 3);
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) / 1.5) + (((rot_l + (_root.vitr / 7)) - rotace) / 5));
}
} else if ((100 < (_y - target._y)) && ((_x - target._x) < 100)) {
_root.z_f_used = "2.2.2.1";
p_rotace = p_rotace + (((rot_l + (_root.vitr / 7)) - rotace) / 2);
} else {
_root.z_f_used = "2.2.2.2";
p_rotace = p_rotace + ((((rot_l + (_root.vitr / 7)) - rotace) / 2) - ((target._x - _x) / 100));
}
}
if (100 < p_power) {
p_power = 100;
}
if (p_power >= _root["tank_" + tank_number].energy) {
p_power = _root["tank_" + tank_number].energy;
if (_x < target._x) {
if (p_rotace < 135) {
if (70 < p_power) {
p_power = p_power - ((135 - p_rotace) / 2.5);
}
p_rotace = p_rotace + ((135 - p_rotace) / 3);
}
} else if (45 < p_rotace) {
if (70 < p_power) {
p_power = p_power - ((p_rotace - 45) / 2.5);
}
p_rotace = p_rotace - ((p_rotace - 45) / 3);
}
}
if (p_power < 0) {
p_power = 0;
}
if (p_rotace < 0) {
p_rotace = 0;
} else if (180 < p_rotace) {
p_rotace = 180;
}
}
function prepare_shot() {
prep = true;
if ((Math.max(rotace, p_rotace) - Math.min(rotace, p_rotace)) < 10) {
sp = 1;
} else {
sp = Math.floor((Math.max(rotace, p_rotace) - Math.min(rotace, p_rotace)) / 10);
}
if (Math.ceil(rotace) != Math.ceil(p_rotace)) {
if ((Math.ceil(p_rotace) < Math.ceil(rotace)) && ((rotace - sp) >= 0)) {
prep = false;
rotace = rotace - sp;
_root.tur.play();
} else if (180 >= (rotace + sp)) {
prep = false;
rotace = rotace + sp;
_root.tur.play();
}
}
if (Math.ceil(power) != Math.ceil(p_power)) {
if ((Math.ceil(p_power) < Math.ceil(power)) && ((power - sp) >= 0)) {
prep = false;
power = power - sp;
} else if (180 >= (power + sp)) {
prep = false;
power = power + sp;
}
}
if (((Math.round(p_x) != Math.round(_x)) && (0 < _root["tank_" + tank_number].fuel)) && (p_move)) {
prep = false;
if (Math.round(p_x) < Math.round(_x)) {
move_right();
} else {
move_left();
}
}
if (prep) {
return(true);
}
}
function select_target() {
vzd = 1000;
i = 1;
while (_root.pocet_hracu >= i) {
vz = Math.abs(_x - _root["tank" + i]._x);
if (((vz < vzd) && (i != tank_number)) && (_root["tank_" + i].live)) {
vzd = vz;
target = _root["tank" + i];
target_ = _root["tank_" + i];
}
i++;
}
}
function na_rade() {
rounds++;
par_active = false;
calc_hill_up();
}
function damage(damag, attacker, par) {
armor = 1;
arm = 1;
i = 0;
while (i < _root["tank_" + tank_number].specials[9]) {
armor = armor / (1.12 / arm);
arm = arm / 1.0002;
i++;
}
if ((!sh_active) || (par)) {
_root["tank_" + tank_number].energy = _root["tank_" + tank_number].energy - (damag * armor);
} else {
_root["shield" + tank_number].damage(damag, attacker);
}
if (0 >= _root["tank_" + tank_number].energy) {
if (this != attacker) {
_root["tank_" + attacker.tank_number].kills = _root["tank_" + attacker.tank_number].kills + 1;
_root["tank_" + attacker.tank_number].score = _root["tank_" + attacker.tank_number].score + 5000;
_root["tank_" + attacker.tank_number].total_score = _root["tank_" + attacker.tank_number].total_score + 5000;
} else {
_root["tank_" + tank_number].kills = _root["tank_" + tank_number].kills - 1;
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - 2000;
_root["tank_" + tank_number].total_score = _root["tank_" + tank_number].total_score - 2000;
}
}
if (this != attacker) {
_root["tank_" + attacker.tank_number].score = _root["tank_" + attacker.tank_number].score + (damag * 100);
_root["tank_" + attacker.tank_number].total_score = _root["tank_" + attacker.tank_number].total_score + (damag * 100);
} else {
if (par) {
damag = damag / 3;
}
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - Math.round(damag * 50);
_root["tank_" + tank_number].total_score = _root["tank_" + tank_number].total_score - Math.round(damag * 50);
if (_root["tank_" + tank_number].score < 0) {
_root["tank_" + tank_number].score = 0;
}
}
}
function fire() {
if (_root.debugging) {
save_inf();
}
last_wind = _root.vitr;
first_frame = true;
_root.attachMovie(_root.weapons[_root["tank_" + tank_number].cur_gun][4], "strela", 1000);
if (_root["tank_" + tank_number].cur_gun != 0) {
_root["tank_" + tank_number].guns[_root["tank_" + tank_number].cur_gun]--;
if (_root["tank_" + tank_number].guns[_root["tank_" + tank_number].cur_gun] == 0) {
_root["tank_" + tank_number].cur_gun = 0;
}
}
_root.strela._rotation = rotace - 90;
_root.strela._x = _x;
_root.strela._y = _y - 1;
_root.strela.strela.vo = power;
_root.strela.strela.owner = _root[_name];
_root[_name + "_hlaven"].play();
playing = false;
}
function save_inf() {
_root.z_target = target;
_root.z_target_name = target_.name;
_root.z_target_energy = target_.energy;
_root.z_target_live = target_.live;
_root.z_name = _root["tank_" + tank_number].name;
_root.z_energy = _root["tank_" + tank_number].energy;
if (target._x < _x) {
_root.z_pos = "right";
} else {
_root.z_pos = "left";
}
_root.z_x = _x;
_root.z_y = _y;
_root.z_tar_x = target._x;
_root.z_tar_y = target._y;
_root.z_last_vitr = last_wind;
_root.z_vitr = _root.vitr;
_root.z_wind_koef_vzd_koef = wind_koef_vzd_koef;
_root.z_angle = rotace;
_root.z_power = power;
_root.z_y_koef = y_koef;
_root.z_vzd_koef_k = vzd_koef_k;
_root.z_last_shot_x = last_shot_x;
_root.z_last_shot_y = last_shot_y;
_root.z_last_shot_vzd = last_shot_vzd;
_root.z_last_shot_y_vzd = y_vzd;
_root.z_last_shot_x_vzd = x_vzd;
_root.z_dif = dif;
fscommand ("SAVE", ((((((("debug/" add _root.game) add "_") add rounds) add "_") add _root.z_pos) add "_") add _root["tank_" + tank_number].name) add ".txt");
}
dif = _root["tank_" + tank_number].dif;
_y = ((_root["land" + Math.round(_x)]._y - (_root["land" + Math.round(_x)]._height / 2)) - 4);
i = 0;
while (i < _width) {
cur = _root["land" + Math.floor((_x - (_width / 2)) + i)];
if (hitTest(cur)) {
cur._y = cur._y + ((_y + (_height / 2)) - (cur._y - (cur._height / 2)));
}
i++;
}
if (0 < _root["tank_" + tank_number].specials[0]) {
par = true;
}
_root.attachMovie("hlaven", _name + "_hlaven", 10010 + tank_number);
rotace = (random(67) * 2) + 46;
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
_root[_name + "_hlaven"]._rotation = rotace;
power = 50;
playing = false;
testing = false;
par_active = false;
par_out = false;
par_used = false;
sh_active = false;
_root["t" + tank_number] = _root["tank" + tank_number];
first_shot = true;
first_frame = true;
calc_frame = true;
fuel_c = 1 / (_root["tank_" + tank_number].specials[10] + 1);
rounds = 0;
p_move = false;
select_target();
Symbol 25 MovieClip [ai_hard] Frame 2
if (400 < _y) {
_root["tank_" + tank_number].live = false;
_root["tank_" + tank_number].energy = 0;
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - 2000;
_root.hracu--;
if (_root["tank_" + tank_number].score < 0) {
_root["tank_" + tank_number].score = 0;
}
gotoAndPlay (4);
}
if (0 >= _root["tank_" + tank_number].energy) {
_root["tank_" + tank_number].energy = 0;
_root["tank_" + tank_number].live = false;
gotoAndPlay (4);
}
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
if (sh_active) {
_root["shield" + tank_number]._x = _x;
_root["shield" + tank_number]._y = _y;
}
if (playing) {
if ((!target_.live) && (first_frame)) {
rounds = 1;
select_target();
}
if (rounds == 1) {
if (first_frame) {
i = 1;
while (_root.pocet_hracu >= i) {
if ((_root["tank" + i].playing && (i != tank_number)) && (_root["tank_" + i].live)) {
_root["tank" + i].playing = false;
_root.test();
}
i++;
}
first_shot = true;
calc_first_shot();
}
} else if (first_frame) {
calc_shot();
}
first_frame = false;
_root.rotace = rotace;
_root.power = power;
if (prepare_shot()) {
fire();
}
na_zemi = false;
left = true;
right = true;
i = 0;
min = 500;
gg = false;
test_hill();
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
if (pasy.hitTest(cur)) {
na_zemi = true;
if (par_out) {
par_out = false;
_root["parachute" + tank_number].removeMovieClip();
}
if (0.4 < fall) {
if (fall < 0.8) {
damage(Math.round(fall * 25), this, true);
} else {
damage(Math.round((fall * fall) * 3000), this, true);
}
}
fall = 0;
}
top = cur._y - (cur._height / 2);
if ((top < min) && (na_zemi)) {
gg = true;
min = top;
}
if ((((i + 1) >= _width) && (na_zemi)) && (gg)) {
_y = (min - 2);
gg = false;
}
if (!na_zemi) {
if ((fall >= 0.2) && (par)) {
if (!par_active) {
par_active = true;
_root["tank_" + i].specials[0] = _root["tank_" + i].specials[0] - 1;
}
if (!par_out) {
_root.attachMovie("parachute", "parachute" + tank_number, 9000 + tank_number);
}
par_out = true;
}
_y = (_y + fall);
if (!par_out) {
fall = fall + 0.01;
} else {
_root["parachute" + tank_number]._x = _x;
_root["parachute" + tank_number]._y = _y - 7.5;
fall = 0.2;
_x = (_x + (_root.vitr / 3000));
}
}
i++;
}
if (_root["tank_" + tank_number].energy < power) {
power = _root["tank_" + tank_number].energy;
}
_root[_name + "_hlaven"]._rotation = rotace;
}
if (testing) {
i = 0;
min = 500;
gg = false;
test_hill();
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
if (pasy.hitTest(cur)) {
if (0.4 < fall) {
if (fall < 0.8) {
damage(Math.round(fall * 25), this, true);
} else {
damage(Math.round((fall * fall) * 80), this, true);
}
}
if (par_out) {
par_out = false;
_root["parachute" + tank_number].removeMovieClip();
}
na_zemi = true;
fall = 0;
}
top = cur._y - (cur._height / 2);
if ((top < min) && (na_zemi)) {
gg = true;
min = top;
}
if ((((i + 1) >= _width) && (na_zemi)) && (gg)) {
_y = (min - 2);
gg = false;
}
if (0.001 < fall) {
test = false;
}
if (!na_zemi) {
if ((fall >= 0.2) && (par)) {
if (!par_active) {
par_active = true;
_root["tank_" + tank_number].specials[0] = _root["tank_" + tank_number].specials[0] - 1;
}
if (!par_out) {
_root.attachMovie("parachute", "parachute" + tank_number, 9000 + tank_number);
}
par_out = true;
}
_y = (_y + fall);
if (!par_out) {
fall = fall + 0.01;
} else {
_root["parachute" + tank_number]._x = _x;
_root["parachute" + tank_number]._y = _y - 7.5;
fall = 0.2;
_x = (_x + (_root.vitr / 3000));
}
}
i++;
}
if (0.001 < fall) {
test = false;
}
test_hill();
x3 = x2;
x2 = x1;
x1 = Math.round(_x);
y3 = y2;
y2 = y1;
y1 = Math.round(_y * 10) / 10;
if ((y1 == y3) && (x1 == x3)) {
test = true;
}
if (test) {
testing = false;
_root[_name + "test"] = false;
}
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
test = true;
}
Symbol 25 MovieClip [ai_hard] Frame 3
gotoAndPlay (2);
Symbol 25 MovieClip [ai_hard] Frame 4
_root[_name + "_hlaven"].removeMovieClip();
_root["parachute" + tank_number].removeMovieClip();
_root["shield" + tank_number].removeMovieClip();
_root.hracu--;
Symbol 25 MovieClip [ai_hard] Frame 9
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((_x - x) * (_x - x)) + ((_y - h) * (_y - h))) * (180 / _width)));
cur._height = cur._height - (30 * vzr);
cur._y = cur._y + (15 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (50 / Math.abs(_x - x));
cur._y = cur._y + ((50 / Math.abs(_x - x)) / 2);
}
i++;
}
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if ((hitTest(current) || (hitTest(_root["shield" + i]))) && (i != tank_number)) {
x = _x - current._x;
y = _y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / 14));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / 18));
}
current.damage(damg, this);
}
i++;
}
Symbol 25 MovieClip [ai_hard] Frame 15
if (playing) {
_root.test();
}
stop();
Symbol 28 MovieClip [ai_very_hard] Frame 1
function test_hill() {
calc_hill_up();
if (((_root["land" + Math.ceil(_x - (_width / 2))]._y - (_root["land" + Math.ceil(_x - (_width / 2))]._height / 2)) < (_y - hill_up)) || ((_root["land" + Math.floor(_x - (_width / 2))]._y - (_root["land" + Math.floor(_x - (_width / 2))]._height / 2)) < (_y - hill_up))) {
_x = (_x + 0.7);
test = false;
left = false;
right = false;
} else if (((_root["land" + Math.floor(_x + (_width / 2))]._y - (_root["land" + Math.floor(_x + (_width / 2))]._height / 2)) < (_y - hill_up)) || ((_root["land" + Math.ceil(_x + (_width / 2))]._y - (_root["land" + Math.ceil(_x + (_width / 2))]._height / 2)) < (_y - hill_up))) {
left = false;
right = false;
_x = (_x - 0.7);
test = false;
} else {
left = true;
right = true;
}
}
function blik() {
_root.attachMovie("blk", "blik", 10030);
_root.blik._x = _x;
_root.blik._y = _y - 10;
}
function calc_hill_up() {
hill_up = (0.5 + _root["tank_" + tank_number].specials[11]) - (fall * 10);
}
function move_left() {
_x = (_x - 0.5);
_root["tank_" + tank_number].fuel = _root["tank_" + tank_number].fuel - fuel_c;
moving = true;
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if (hitTest(_root["tank" + i]) && (i != tank_number)) {
_x = (_x + 0.6);
}
i++;
}
}
function move_right() {
_x = (_x + 0.5);
_root["tank_" + tank_number].fuel = _root["tank_" + tank_number].fuel - fuel_c;
moving = true;
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if (hitTest(_root["tank" + i]) && (i != tank_number)) {
_x = (_x - 0.6);
}
i++;
}
}
function activate_shield(shield) {
_root.attachMovie(_root.specials[2 + shield][4], "shield" + tank_number, 5040 + tank_number);
_root["shield" + tank_number].num = tank_number;
_root["tank_" + tank_number].specials[2 + shield]--;
sh_active = true;
_root["t" + tank_number] = _root["shield" + tank_number];
}
function disable_shield() {
_root["shield" + tank_number].disable();
sh_active = false;
_root["t" + tank_number] = _root["tank" + tank_number];
}
function p_m(par) {
if (0 < par) {
return(1);
}
return(-1);
}
function calc_first_shot() {
p_rotace = 90 + (p_m(target._x - _x) * 45);
p_x = _x;
p_power = ((Math.abs(_x - target._x) / (2 + (Math.abs(_x - target._x) / 80))) - ((p_m(target._x - _x) * _root.vitr) / 13)) + ((_y - target._y) / 20);
if (p_power >= _root["tank_" + tank_number].energy) {
p_power = _root["tank_" + tank_number].energy;
}
}
function calc_shot() {
last_shot_vzd = Math.sqrt(Math.abs((_x - last_shot_x) * (_x - last_shot_x)) + Math.abs((_y - last_shot_y) * (_y - last_shot_y)));
target_vzd = Math.sqrt(Math.abs((_x - target._x) * (_x - target._x)) + Math.abs((_y - target._y) * (_y - target._y)));
x_vzd = Math.abs(last_shot_x - target._x);
y_vzd = Math.abs(last_shot_y - target._y);
if ((power >= _root["tank_" + tank_number].energy) || (power == 100)) {
full_power = true;
} else {
full_power = false;
}
wind_change_koef = 7;
wind_koef_vzd_koef = 380;
vzd_koef = 10.9;
vzd_koef_k = 7 + (Math.abs(_x - last_shot_x) / 80);
y_vzd_koef = 30;
y_koef = 22;
rot_r = 100 - ((200 - Math.abs(_x - target._x)) / 30);
rot_l = 80 + ((200 - Math.abs(_x - target._x)) / 30);
if (_x < target._x) {
wind_koef_vzd_koef = wind_koef_vzd_koef - ((180 - rotace) * 3);
y_koef = y_koef + ((135 - rotace) * 1.7);
if (last_shot_x < _x) {
_root.z_f_used = "1.1";
p_rotace = p_rotace + ((((_x - last_shot_x) / 10) + ((target._x - _x) / 20)) - (_root.vitr / 50));
} else if ((((60 < last_shot_vzd) || (target_vzd < 70)) || (power < 10)) && ((power < 70) || (200 < last_shot_vzd))) {
_root.z_f_used = "1.2.1.failed";
if (last_shot_x >= target._x) {
if (20 < x_vzd) {
_root.z_f_used = "1.2.1.1.1";
p_power = p_power - (((x_vzd / ((vzd_koef + 2.5) - (Math.abs(135 - rotace) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - ((last_shot_y - target._y) / y_koef));
} else {
_root.z_f_used = "1.2.1.1.2";
p_power = p_power - ((x_vzd / ((vzd_koef - 1) - (Math.abs(135 - rotace) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (last_shot_y < target._y) {
if (target._y < _y) {
if (((((((80 < (_y - target._y)) && (y_vzd < 80)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (220 < target_vzd)) && (30 < power)) && ((rot_r - (_root.vitr / 7)) < rotace)) {
_root.z_f_used = "1.2.1.2.1.1.1";
p_rotace = p_rotace - ((((rotace - (rot_r - (_root.vitr / 7))) / 4) + (_root.vitr / 20)) - (target_vzd / 100));
} else if (rotace < (rot_r - (_root.vitr / 7))) {
_root.z_f_used = "1.2.1.2.1.1.2.";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "1.2.1.2.1.1.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if (((300 < (target._x - _x)) && (power < 50)) && (rotace < 110)) {
_root.z_f_used = "1.2.1.2.1.1.4.1";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else if ((rot_r - (_root.vitr / 7)) < rotace) {
if (135 >= p_rotace) {
_root.z_f_used = "1.2.1.2.1.1.4.2.1";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + ((135 - rotace) / 8)) - (_root.vitr / 15)) + ((rotace - (rot_r - (_root.vitr / 7))) / 8));
} else {
_root.z_f_used = "1.2.1.2.1.1.4.2.2";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) - (_root.vitr / 15));
}
p_rotace = p_rotace - (((rotace - (rot_r - (_root.vitr / 7))) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((((((target._y - _y) < 70) && (y_vzd < 100)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (250 < target_vzd)) && (30 < power)) && ((rot_r - (_root.vitr / 7)) < rotace)) {
_root.z_f_used = "1.2.1.2.1.2.1";
p_rotace = p_rotace - ((((rotace - (rot_r - (_root.vitr / 7))) / 4.5) + (_root.vitr / 20)) - (target_vzd / 100));
} else if (rotace < (rot_r - (_root.vitr / 7))) {
_root.z_f_used = "1.2.1.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "1.2.1.2.1.2.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if ((200 < (target._y - _y)) && (_y < last_shot_y)) {
_root.z_f_used = "1.2.1.2.1.2.4.1";
if (120 < p_rotace) {
_root.z_f_used = "1.2.1.2.1.2.4.1.1";
p_power = p_power + ((x_vzd / (vzd_koef / 1.5)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "1.2.1.2.1.2.4.1.2";
p_power = p_power + ((x_vzd / (vzd_koef / 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (((300 < (target._x - _x)) && (power < 50)) && (rotace < 110)) {
_root.z_f_used = "1.2.1.2.1.2.4.2.";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else if ((rot_r - (_root.vitr / 7)) < rotace) {
if (135 >= p_rotace) {
_root.z_f_used = "1.2.1.2.1.2.4.3.1.";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - (y_vzd / y_vzd_koef)) + ((135 - rotace) / 8)) - (_root.vitr / 15)) + ((rotace - (rot_r - (_root.vitr / 7))) / 8));
} else {
_root.z_f_used = "1.2.1.2.1.2.4.3.2.";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - (y_vzd / y_vzd_koef)) - (_root.vitr / 15));
}
p_rotace = p_rotace - (((rotace - (rot_r - (_root.vitr / 7))) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((last_shot_vzd < 150) && ((target._x - _x) < 170)) || (last_shot_vzd >= 100)) || ((last_shot_vzd < 100) && (power < 30))) {
if (target._y < _y) {
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
_root.z_f_used = "1.2.1.2.2.1.1";
} else if (100 < (target._y - _y)) {
_root.z_f_used = "1.2.1.2.2.1.2.1";
p_power = p_power + ((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "1.2.1.2.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
}
} else if (rotace < ((rot_r - 5) - (root.vitr / 7))) {
_root.z_f_used = "1.2.1.2.2.2";
p_rotace = p_rotace + ((((135 - rotace) / 10) + target._x) - (_x / 100));
} else {
_root.z_f_used = "1.2.1.2.2.3";
p_rotace = p_rotace - ((rotace - (rot_r - (_root.vitr / 7))) / 2);
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(135 - rotace) / vzd_koef_k))) / 1.5) + ((rotace - (rot_r - (_root.vitr / 7))) / 5));
}
} else if ((100 < (_y - target._y)) && ((target._x - _x) < 100)) {
_root.z_f_used = "1.2.2.1";
p_rotace = p_rotace - ((rotace - (rot_r - (_root.vitr / 7))) / 2);
} else {
_root.z_f_used = "1.2.2.2";
p_rotace = p_rotace - (((rotace - (rot_r - (_root.vitr / 7))) / 2) - ((target._x - _x) / 100));
}
} else {
wind_koef_vzd_koef = wind_koef_vzd_koef - (rotace * 3);
y_koef = y_koef + ((rotace - 45) * 1.7);
if (_x < last_shot_x) {
_root.z_f_used = "2.1";
p_rotace = p_rotace - ((((last_shot_x - _x) / 10) + ((_x - target._x) / 20)) + (_root.vitr / 50));
} else if ((((60 < last_shot_vzd) || (target_vzd < 70)) || (power < 10)) && ((power < 70) || (200 < last_shot_vzd))) {
_root.z_f_used = "2.2.1.failed";
if (target._x >= last_shot_x) {
if (20 < x_vzd) {
_root.z_f_used = "2.2.1.1.1";
p_power = p_power - (((x_vzd / ((vzd_koef + 2.5) - (Math.abs(45 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) - ((last_shot_y - target._y) / y_koef));
} else {
_root.z_f_used = "2.2.1.1.2";
p_power = p_power - ((x_vzd / ((vzd_koef - 1) - (Math.abs(45 - rotace) / vzd_koef_k))) - ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (last_shot_y < target._y) {
if (target._y < _y) {
if (((((((80 < (_y - target._y)) && (y_vzd < 80)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (220 < target_vzd)) && (30 < power)) && ((rot_l + (_root.vitr / 7)) < rotace)) {
_root.z_f_used = "2.2.1.2.1.1.1";
p_rotace = p_rotace + (((((rot_l + (_root.vitr / 7)) - rotace) / 4) - (_root.vitr / 20)) - (target_vzd / 100));
} else if ((rot_l + (_root.vitr / 7)) < rotace) {
_root.z_f_used = "2.2.1.2.1.1.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "2.2.1.2.1.1.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if (((300 < (_x - target._x)) && (power < 50)) && (70 < rotace)) {
_root.z_f_used = "2.2.1.2.1.1.4.1";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef))));
} else if (rotace < (rot_l + (_root.vitr / 7))) {
if (p_rotace >= 45) {
_root.z_f_used = "2.2.1.2.1.1.4.2.1";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + ((rotace - 45) / 8)) + (_root.vitr / 15)) + (((rot_l + (_root.vitr / 7)) - rotace) / 8));
} else {
_root.z_f_used = "2.2.1.2.1.1.4.2.2";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + (_root.vitr / 15));
}
p_rotace = p_rotace + ((((rot_l + (_root.vitr / 7)) - rotace) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((((((target._y - _y) < 70) && (y_vzd < 100)) && (20 < y_vzd)) && (last_shot_vzd < 100)) && (250 < target_vzd)) && (30 < power)) && (rotace < (rot_l - (_root.vitr / 7)))) {
_root.z_f_used = "2.2.1.2.1.2.1";
p_rotace = p_rotace + (((((rot_l + (_root.vitr / 7)) - rotace) / 4.5) - (_root.vitr / 20)) - (target_vzd / 100));
} else if ((rot_l + (_root.vitr / 7)) < rotace) {
_root.z_f_used = "2.2.1.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(_x - last_shot_x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if ((y_vzd < 30) && (x_vzd < 200)) {
_root.z_f_used = "2.2.1.2.1.2.3";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(45 - rotace) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
} else if (y_vzd >= 30) {
if ((200 < (target._y - _y)) && (_y < last_shot_y)) {
if (p_rotace < 60) {
_root.z_f_used = "2.2.1.2.1.2.4.1.1";
p_power = p_power + ((x_vzd / (vzd_koef / 1.5)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "2.2.1.2.1.2.4.1.2";
p_power = p_power + ((x_vzd / (vzd_koef / 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
}
} else if (((300 < (_x - target._x)) && (power < 50)) && (70 < rotace)) {
_root.z_f_used = "2.2.1.2.1.2.4.2";
p_power = p_power + ((x_vzd / (vzd_koef / 3)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else if (rotace < (rot_l + (_root.vitr / 7))) {
if (p_rotace >= 45) {
_root.z_f_used = "2.2.1.2.1.2.4.3.1";
p_power = p_power + ((((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + ((rotace - 45) / 8)) + (_root.vitr / 15)) + (((rot_l + (_root.vitr / 7)) - rotace) / 8));
} else {
_root.z_f_used = "2.2.1.2.1.2.4.3.2";
p_power = p_power + ((((x_vzd / (vzd_koef * 2)) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + (y_vzd / y_vzd_koef)) + (_root.vitr / 15));
}
p_rotace = p_rotace + ((((rot_l + (_root.vitr / 7)) - rotace) / 4.5) + (y_vzd / y_vzd_koef));
}
}
} else if ((((last_shot_vzd < 150) && ((_x - target._x) < 170)) || (last_shot_vzd >= 100)) || ((last_shot_vzd < 100) && (power < 30))) {
if (target._y < _y) {
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
_root.z_f_used = "2.2.1.2.2.1.1";
} else if (100 < (target._y - _y)) {
_root.z_f_used = "2.2.1.2.2.1.2.1";
p_power = p_power + ((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef))));
} else {
_root.z_f_used = "2.2.1.2.2.1.2.2";
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) + ((_root.vitr - last_wind) / (wind_change_koef - (Math.abs(last_shot_x - _x) / wind_koef_vzd_koef)))) + ((last_shot_y - target._y) / y_koef));
}
} else if (((rot_l + 5) + (root.vitr / 7)) < rotace) {
_root.z_f_used = "2.2.1.2.2.2";
p_rotace = p_rotace - ((((rotace - 45) / 10) + _x) - (target._x / 100));
} else {
_root.z_f_used = "2.2.1.2.2.3";
p_rotace = p_rotace + (((rot_l + (_root.vitr / 7)) - rotace) / 3);
p_power = p_power + (((x_vzd / (vzd_koef - (Math.abs(rotace - 45) / vzd_koef_k))) / 1.5) + (((rot_l + (_root.vitr / 7)) - rotace) / 5));
}
} else if ((100 < (_y - target._y)) && ((_x - target._x) < 100)) {
_root.z_f_used = "2.2.2.1";
p_rotace = p_rotace + (((rot_l + (_root.vitr / 7)) - rotace) / 2);
} else {
_root.z_f_used = "2.2.2.2";
p_rotace = p_rotace + ((((rot_l + (_root.vitr / 7)) - rotace) / 2) - ((target._x - _x) / 100));
}
}
if (100 < p_power) {
p_power = 100;
}
if (p_power >= _root["tank_" + tank_number].energy) {
p_power = _root["tank_" + tank_number].energy;
if (_x < target._x) {
if (p_rotace < 135) {
if (70 < p_power) {
p_power = p_power - ((135 - p_rotace) / 2.5);
}
p_rotace = p_rotace + ((135 - p_rotace) / 3);
}
} else if (45 < p_rotace) {
if (70 < p_power) {
p_power = p_power - ((p_rotace - 45) / 2.5);
}
p_rotace = p_rotace - ((p_rotace - 45) / 3);
}
}
if (p_power < 0) {
p_power = 0;
}
if (p_rotace < 0) {
p_rotace = 0;
} else if (180 < p_rotace) {
p_rotace = 180;
}
}
function prepare_shot() {
prep = true;
if ((Math.max(rotace, p_rotace) - Math.min(rotace, p_rotace)) < 10) {
sp = 1;
} else {
sp = Math.floor((Math.max(rotace, p_rotace) - Math.min(rotace, p_rotace)) / 10);
}
if (Math.ceil(rotace) != Math.ceil(p_rotace)) {
if ((Math.ceil(p_rotace) < Math.ceil(rotace)) && ((rotace - sp) >= 0)) {
prep = false;
rotace = rotace - sp;
_root.tur.play();
} else if (180 >= (rotace + sp)) {
prep = false;
rotace = rotace + sp;
_root.tur.play();
}
}
if (Math.ceil(power) != Math.ceil(p_power)) {
if ((Math.ceil(p_power) < Math.ceil(power)) && ((power - sp) >= 0)) {
prep = false;
power = power - sp;
} else if (180 >= (power + sp)) {
prep = false;
power = power + sp;
}
}
if (((Math.round(p_x) != Math.round(_x)) && (0 < _root["tank_" + tank_number].fuel)) && (p_move)) {
prep = false;
if (Math.round(p_x) < Math.round(_x)) {
move_right();
} else {
move_left();
}
}
if (prep) {
return(true);
}
}
function select_target() {
vzd = 1000;
i = 1;
while (_root.pocet_hracu >= i) {
vz = Math.abs(_x - _root["tank" + i]._x);
if (((vz < vzd) && (i != tank_number)) && (_root["tank_" + i].live)) {
vzd = vz;
target = _root["tank" + i];
target_ = _root["tank_" + i];
}
i++;
}
}
function na_rade() {
rounds++;
par_active = false;
calc_hill_up();
}
function damage(damag, attacker, par) {
armor = 1;
arm = 1;
i = 0;
while (i < _root["tank_" + tank_number].specials[9]) {
armor = armor / (1.12 / arm);
arm = arm / 1.0002;
i++;
}
if ((!sh_active) || (par)) {
_root["tank_" + tank_number].energy = _root["tank_" + tank_number].energy - (damag * armor);
} else {
_root["shield" + tank_number].damage(damag, attacker);
}
if (0 >= _root["tank_" + tank_number].energy) {
if (this != attacker) {
_root["tank_" + attacker.tank_number].kills = _root["tank_" + attacker.tank_number].kills + 1;
_root["tank_" + attacker.tank_number].score = _root["tank_" + attacker.tank_number].score + 5000;
_root["tank_" + attacker.tank_number].total_score = _root["tank_" + attacker.tank_number].total_score + 5000;
} else {
_root["tank_" + tank_number].kills = _root["tank_" + tank_number].kills - 1;
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - 2000;
_root["tank_" + tank_number].total_score = _root["tank_" + tank_number].total_score - 2000;
}
}
if (this != attacker) {
_root["tank_" + attacker.tank_number].score = _root["tank_" + attacker.tank_number].score + (damag * 100);
_root["tank_" + attacker.tank_number].total_score = _root["tank_" + attacker.tank_number].total_score + (damag * 100);
} else {
if (par) {
damag = damag / 3;
}
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - Math.round(damag * 50);
_root["tank_" + tank_number].total_score = _root["tank_" + tank_number].total_score - Math.round(damag * 50);
if (_root["tank_" + tank_number].score < 0) {
_root["tank_" + tank_number].score = 0;
}
}
}
function fire() {
if (_root.debugging) {
save_inf();
}
last_wind = _root.vitr;
first_frame = true;
_root.attachMovie(_root.weapons[_root["tank_" + tank_number].cur_gun][4], "strela", 1000);
if (_root["tank_" + tank_number].cur_gun != 0) {
_root["tank_" + tank_number].guns[_root["tank_" + tank_number].cur_gun]--;
if (_root["tank_" + tank_number].guns[_root["tank_" + tank_number].cur_gun] == 0) {
_root["tank_" + tank_number].cur_gun = 0;
}
}
_root.strela._rotation = rotace - 90;
_root.strela._x = _x;
_root.strela._y = _y - 1;
_root.strela.strela.vo = power;
_root.strela.strela.owner = _root[_name];
_root[_name + "_hlaven"].play();
playing = false;
}
function save_inf() {
_root.z_target = target;
_root.z_target_name = target_.name;
_root.z_target_energy = target_.energy;
_root.z_target_live = target_.live;
_root.z_name = _root["tank_" + tank_number].name;
_root.z_energy = _root["tank_" + tank_number].energy;
if (target._x < _x) {
_root.z_pos = "right";
} else {
_root.z_pos = "left";
}
_root.z_x = _x;
_root.z_y = _y;
_root.z_tar_x = target._x;
_root.z_tar_y = target._y;
_root.z_last_vitr = last_wind;
_root.z_vitr = _root.vitr;
_root.z_wind_koef_vzd_koef = wind_koef_vzd_koef;
_root.z_angle = rotace;
_root.z_power = power;
_root.z_y_koef = y_koef;
_root.z_vzd_koef_k = vzd_koef_k;
_root.z_last_shot_x = last_shot_x;
_root.z_last_shot_y = last_shot_y;
_root.z_last_shot_vzd = last_shot_vzd;
_root.z_last_shot_y_vzd = y_vzd;
_root.z_last_shot_x_vzd = x_vzd;
_root.z_dif = dif;
fscommand ("SAVE", ((((((("debug/" add _root.game) add "_") add rounds) add "_") add _root.z_pos) add "_") add _root["tank_" + tank_number].name) add ".txt");
}
dif = _root["tank_" + tank_number].dif;
_y = ((_root["land" + Math.round(_x)]._y - (_root["land" + Math.round(_x)]._height / 2)) - 4);
i = 0;
while (i < _width) {
cur = _root["land" + Math.floor((_x - (_width / 2)) + i)];
if (hitTest(cur)) {
cur._y = cur._y + ((_y + (_height / 2)) - (cur._y - (cur._height / 2)));
}
i++;
}
if (0 < _root["tank_" + tank_number].specials[0]) {
par = true;
}
_root.attachMovie("hlaven", _name + "_hlaven", 10010 + tank_number);
rotace = (random(67) * 2) + 46;
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
_root[_name + "_hlaven"]._rotation = rotace;
power = 50;
playing = false;
testing = false;
par_active = false;
par_out = false;
par_used = false;
sh_active = false;
_root["t" + tank_number] = _root["tank" + tank_number];
first_shot = true;
first_frame = true;
calc_frame = true;
fuel_c = 1 / (_root["tank_" + tank_number].specials[10] + 1);
rounds = 0;
p_move = false;
select_target();
Symbol 28 MovieClip [ai_very_hard] Frame 2
if (400 < _y) {
_root["tank_" + tank_number].live = false;
_root["tank_" + tank_number].energy = 0;
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - 2000;
_root.hracu--;
if (_root["tank_" + tank_number].score < 0) {
_root["tank_" + tank_number].score = 0;
}
gotoAndPlay (4);
}
if (0 >= _root["tank_" + tank_number].energy) {
_root["tank_" + tank_number].energy = 0;
_root["tank_" + tank_number].live = false;
gotoAndPlay (4);
}
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
if (sh_active) {
_root["shield" + tank_number]._x = _x;
_root["shield" + tank_number]._y = _y;
}
if (playing) {
if ((!target_.live) && (first_frame)) {
rounds = 1;
select_target();
}
if (rounds == 1) {
if (first_frame) {
i = 1;
while (_root.pocet_hracu >= i) {
if ((_root["tank" + i].playing && (i != tank_number)) && (_root["tank_" + i].live)) {
_root["tank" + i].playing = false;
_root.test();
}
i++;
}
first_shot = true;
calc_first_shot();
}
} else if (first_frame) {
calc_shot();
}
first_frame = false;
_root.rotace = rotace;
_root.power = power;
if (prepare_shot()) {
fire();
}
na_zemi = false;
left = true;
right = true;
i = 0;
min = 500;
gg = false;
test_hill();
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
if (pasy.hitTest(cur)) {
na_zemi = true;
if (par_out) {
par_out = false;
_root["parachute" + tank_number].removeMovieClip();
}
if (0.4 < fall) {
if (fall < 0.8) {
damage(Math.round(fall * 25), this, true);
} else {
damage(Math.round((fall * fall) * 3000), this, true);
}
}
fall = 0;
}
top = cur._y - (cur._height / 2);
if ((top < min) && (na_zemi)) {
gg = true;
min = top;
}
if ((((i + 1) >= _width) && (na_zemi)) && (gg)) {
_y = (min - 2);
gg = false;
}
if (!na_zemi) {
if ((fall >= 0.2) && (par)) {
if (!par_active) {
par_active = true;
_root["tank_" + i].specials[0] = _root["tank_" + i].specials[0] - 1;
}
if (!par_out) {
_root.attachMovie("parachute", "parachute" + tank_number, 9000 + tank_number);
}
par_out = true;
}
_y = (_y + fall);
if (!par_out) {
fall = fall + 0.01;
} else {
_root["parachute" + tank_number]._x = _x;
_root["parachute" + tank_number]._y = _y - 7.5;
fall = 0.2;
_x = (_x + (_root.vitr / 3000));
}
}
i++;
}
if (_root["tank_" + tank_number].energy < power) {
power = _root["tank_" + tank_number].energy;
}
_root[_name + "_hlaven"]._rotation = rotace;
}
if (testing) {
i = 0;
min = 500;
gg = false;
test_hill();
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
if (pasy.hitTest(cur)) {
if (0.4 < fall) {
if (fall < 0.8) {
damage(Math.round(fall * 25), this, true);
} else {
damage(Math.round((fall * fall) * 80), this, true);
}
}
if (par_out) {
par_out = false;
_root["parachute" + tank_number].removeMovieClip();
}
na_zemi = true;
fall = 0;
}
top = cur._y - (cur._height / 2);
if ((top < min) && (na_zemi)) {
gg = true;
min = top;
}
if ((((i + 1) >= _width) && (na_zemi)) && (gg)) {
_y = (min - 2);
gg = false;
}
if (0.001 < fall) {
test = false;
}
if (!na_zemi) {
if ((fall >= 0.2) && (par)) {
if (!par_active) {
par_active = true;
_root["tank_" + tank_number].specials[0] = _root["tank_" + tank_number].specials[0] - 1;
}
if (!par_out) {
_root.attachMovie("parachute", "parachute" + tank_number, 9000 + tank_number);
}
par_out = true;
}
_y = (_y + fall);
if (!par_out) {
fall = fall + 0.01;
} else {
_root["parachute" + tank_number]._x = _x;
_root["parachute" + tank_number]._y = _y - 7.5;
fall = 0.2;
_x = (_x + (_root.vitr / 3000));
}
}
i++;
}
if (0.001 < fall) {
test = false;
}
test_hill();
x3 = x2;
x2 = x1;
x1 = Math.round(_x);
y3 = y2;
y2 = y1;
y1 = Math.round(_y * 10) / 10;
if ((y1 == y3) && (x1 == x3)) {
test = true;
}
if (test) {
testing = false;
_root[_name + "test"] = false;
}
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
test = true;
}
Symbol 28 MovieClip [ai_very_hard] Frame 3
gotoAndPlay (2);
Symbol 28 MovieClip [ai_very_hard] Frame 4
_root[_name + "_hlaven"].removeMovieClip();
_root["parachute" + tank_number].removeMovieClip();
_root["shield" + tank_number].removeMovieClip();
_root.hracu--;
Symbol 28 MovieClip [ai_very_hard] Frame 9
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((_x - x) * (_x - x)) + ((_y - h) * (_y - h))) * (180 / _width)));
cur._height = cur._height - (30 * vzr);
cur._y = cur._y + (15 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (50 / Math.abs(_x - x));
cur._y = cur._y + ((50 / Math.abs(_x - x)) / 2);
}
i++;
}
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if ((hitTest(current) || (hitTest(_root["shield" + i]))) && (i != tank_number)) {
x = _x - current._x;
y = _y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / 14));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / 18));
}
current.damage(damg, this);
}
i++;
}
Symbol 28 MovieClip [ai_very_hard] Frame 15
if (playing) {
_root.test();
}
stop();
Symbol 31 MovieClip [tank] Frame 1
function test_hill() {
calc_hill_up();
if (((_root["land" + Math.ceil(_x - (_width / 2))]._y - (_root["land" + Math.ceil(_x - (_width / 2))]._height / 2)) < (_y - hill_up)) || ((_root["land" + Math.floor(_x - (_width / 2))]._y - (_root["land" + Math.floor(_x - (_width / 2))]._height / 2)) < (_y - hill_up))) {
_x = (_x + 0.7);
test = false;
left = false;
right = false;
} else if (((_root["land" + Math.floor(_x + (_width / 2))]._y - (_root["land" + Math.floor(_x + (_width / 2))]._height / 2)) < (_y - hill_up)) || ((_root["land" + Math.ceil(_x + (_width / 2))]._y - (_root["land" + Math.ceil(_x + (_width / 2))]._height / 2)) < (_y - hill_up))) {
left = false;
right = false;
_x = (_x - 0.7);
test = false;
} else {
left = true;
right = true;
}
}
function blik() {
_root.attachMovie("blk", "blik", 10030);
_root.blik._x = _x;
_root.blik._y = _y - 10;
}
function calc_hill_up() {
hill_up = (0.5 + _root["tank_" + tank_number].specials[11]) - (fall * 10);
}
function move_left() {
_x = (_x - 0.5);
_root["tank_" + tank_number].fuel = _root["tank_" + tank_number].fuel - fuel_c;
moving = true;
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if (hitTest(_root["tank" + i]) && (i != tank_number)) {
_x = (_x + 0.6);
}
i++;
}
}
function move_right() {
_x = (_x + 0.5);
_root["tank_" + tank_number].fuel = _root["tank_" + tank_number].fuel - fuel_c;
moving = true;
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if (hitTest(_root["tank" + i]) && (i != tank_number)) {
_x = (_x - 0.6);
}
i++;
}
}
function activate_shield(shield) {
_root.attachMovie(_root.specials[2 + shield][4], "shield" + tank_number, 5040 + tank_number);
_root["shield" + tank_number].num = tank_number;
_root["tank_" + tank_number].specials[2 + shield]--;
sh_active = true;
_root["t" + tank_number] = _root["shield" + tank_number];
}
function disable_shield() {
_root["shield" + tank_number].disable();
sh_active = false;
_root["t" + tank_number] = _root["tank" + tank_number];
}
function damage(damag, attacker, par) {
armor = 1;
arm = 1;
i = 0;
while (i < _root["tank_" + tank_number].specials[9]) {
armor = armor / (1.12 / arm);
arm = arm / 1.0002;
i++;
}
if ((!sh_active) || (par)) {
_root["tank_" + tank_number].energy = _root["tank_" + tank_number].energy - (damag * armor);
} else {
_root["shield" + tank_number].damage(damag, attacker);
}
if (0 >= _root["tank_" + tank_number].energy) {
if (this != attacker) {
_root["tank_" + attacker.tank_number].kills = _root["tank_" + attacker.tank_number].kills + 1;
_root["tank_" + attacker.tank_number].score = _root["tank_" + attacker.tank_number].score + 5000;
_root["tank_" + attacker.tank_number].total_score = _root["tank_" + attacker.tank_number].total_score + 5000;
} else {
_root["tank_" + tank_number].kills = _root["tank_" + tank_number].kills - 1;
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - 2000;
_root["tank_" + tank_number].total_score = _root["tank_" + tank_number].total_score - 2000;
}
}
if (this != attacker) {
_root["tank_" + attacker.tank_number].score = _root["tank_" + attacker.tank_number].score + (damag * 100);
_root["tank_" + attacker.tank_number].total_score = _root["tank_" + attacker.tank_number].total_score + (damag * 100);
} else {
if (par) {
damag = damag / 3;
}
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - Math.round(damag * 50);
_root["tank_" + tank_number].total_score = _root["tank_" + tank_number].total_score - Math.round(damag * 50);
if (_root["tank_" + tank_number].score < 0) {
_root["tank_" + tank_number].score = 0;
}
}
}
function na_rade() {
par_active = false;
calc_hill_up();
}
function fire() {
testing = true;
_root.attachMovie(_root.weapons[_root["tank_" + tank_number].cur_gun][4], "strela", 1000);
if (_root["tank_" + tank_number].cur_gun != 0) {
_root["tank_" + tank_number].guns[_root["tank_" + tank_number].cur_gun]--;
if (_root["tank_" + tank_number].guns[_root["tank_" + tank_number].cur_gun] == 0) {
_root["tank_" + tank_number].cur_gun = 0;
}
}
_root.strela._rotation = rotace - 90;
_root.strela._x = _x;
_root.strela._y = _y - 1;
_root.strela.strela.vo = power;
_root.strela.strela.owner = _root[_name];
_root[_name + "_hlaven"].play();
playing = false;
}
_y = ((_root["land" + Math.round(_x)]._y - (_root["land" + Math.round(_x)]._height / 2)) - 4);
i = 0;
while (i < _width) {
cur = _root["land" + Math.floor((_x - (_width / 2)) + i)];
if (hitTest(cur)) {
cur._y = cur._y + ((_y + (_height / 2)) - (cur._y - (cur._height / 2)));
}
i++;
}
if (0 < _root["tank_" + tank_number].specials[0]) {
par = true;
}
_root.attachMovie("hlaven", _name + "_hlaven", 10010 + tank_number);
rotace = (random(67) * 2) + 46;
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
_root[_name + "_hlaven"]._rotation = rotace;
power = 50;
playing = false;
testing = false;
par_active = false;
par_out = false;
par_used = false;
sh_active = false;
_root["t" + tank_number] = _root["tank" + tank_number];
fuel_c = 1 / (_root["tank_" + tank_number].specials[10] + 1);
Symbol 31 MovieClip [tank] Frame 2
if (400 < _y) {
_root["tank_" + tank_number].live = false;
_root["tank_" + tank_number].energy = 0;
_root["tank_" + tank_number].score = _root["tank_" + tank_number].score - 2000;
_root.hracu--;
if (_root["tank_" + tank_number].score < 0) {
_root["tank_" + tank_number].score = 0;
}
gotoAndPlay (4);
}
if (0 >= _root["tank_" + tank_number].energy) {
_root["tank_" + tank_number].energy = 0;
_root["tank_" + tank_number].live = false;
gotoAndPlay (4);
}
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
if (sh_active) {
_root["shield" + tank_number]._x = _x;
_root["shield" + tank_number]._y = _y;
}
if (playing) {
_root.rotace = rotace;
_root.power = power;
if (((Key.isDown(37) && (left)) && (0 < _root["tank_" + tank_number].fuel)) && (10 < _x)) {
move_left();
} else if (((Key.isDown(39) && (right)) && (0 < _root["tank_" + tank_number].fuel)) && (_x < 540)) {
move_right();
} else {
moving = false;
}
if (Key.isDown(32)) {
fire();
}
na_zemi = false;
left = true;
right = true;
i = 0;
min = 500;
gg = false;
test_hill();
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
if (pasy.hitTest(cur)) {
na_zemi = true;
if (par_out) {
par_out = false;
_root["parachute" + tank_number].removeMovieClip();
}
if (0.4 < fall) {
if (fall < 2) {
damage(Math.round(fall * 25), this, true);
} else {
damage(Math.round((fall * fall) * 3000), this, true);
}
}
fall = 0;
}
top = cur._y - (cur._height / 2);
if ((top < min) && (na_zemi)) {
gg = true;
min = top;
}
if ((((i + 1) >= _width) && (na_zemi)) && (gg)) {
_y = (min - 2);
gg = false;
}
if (!na_zemi) {
if ((fall >= 0.2) && (par)) {
if (!par_active) {
par_active = true;
_root["tank_" + i].specials[0] = _root["tank_" + i].specials[0] - 1;
}
if (!par_out) {
_root.attachMovie("parachute", "parachute" + tank_number, 9000 + tank_number);
}
par_out = true;
}
_y = (_y + fall);
if (!par_out) {
fall = fall + 0.01;
} else {
_root["parachute" + tank_number]._x = _x;
_root["parachute" + tank_number]._y = _y - 7.5;
fall = 0.2;
_x = (_x + (_root.vitr / 3000));
}
}
i++;
}
if ((Key.isDown(33) && (power < 100)) && (_root["tank_" + tank_number].energy >= power)) {
power = power + 1;
} else if (Key.isDown(34) && (0 < power)) {
power = power - 1;
}
if (_root["tank_" + tank_number].energy < power) {
power = _root["tank_" + tank_number].energy;
}
if (Key.isDown(38) && (rotace < 180)) {
rotace = rotace + 2;
_root.tur.play();
}
if (Key.isDown(40) && (0 < rotace)) {
rotace = rotace - 2;
_root.tur.play();
}
_root[_name + "_hlaven"]._rotation = rotace;
}
if (testing) {
i = 0;
min = 500;
gg = false;
test_hill();
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
if (pasy.hitTest(cur)) {
if (0.4 < fall) {
if (fall < 0.8) {
damage(Math.round(fall * 25), this, true);
} else {
damage(Math.round((fall * fall) * 80), this, true);
}
}
if (par_out) {
par_out = false;
_root["parachute" + tank_number].removeMovieClip();
}
na_zemi = true;
fall = 0;
}
top = cur._y - (cur._height / 2);
if ((top < min) && (na_zemi)) {
gg = true;
min = top;
}
if ((((i + 1) >= _width) && (na_zemi)) && (gg)) {
_y = (min - 2);
gg = false;
}
if (0.001 < fall) {
test = false;
}
if (!na_zemi) {
if ((fall >= 0.2) && (par)) {
if (!par_active) {
par_active = true;
_root["tank_" + tank_number].specials[0] = _root["tank_" + tank_number].specials[0] - 1;
}
if (!par_out) {
_root.attachMovie("parachute", "parachute" + tank_number, 9000 + tank_number);
}
par_out = true;
}
_y = (_y + fall);
if (!par_out) {
fall = fall + 0.01;
} else {
_root["parachute" + tank_number]._x = _x;
_root["parachute" + tank_number]._y = _y - 7.5;
fall = 0.2;
_x = (_x + (_root.vitr / 3000));
}
}
i++;
}
if (0.001 < fall) {
test = false;
}
test_hill();
x3 = x2;
x2 = x1;
x1 = Math.round(_x);
y3 = y2;
y2 = y1;
y1 = Math.round(_y * 10) / 10;
if ((y1 == y3) && (x1 == x3)) {
test = true;
}
if (test) {
testing = false;
_root[_name + "test"] = false;
}
_root[_name + "_hlaven"]._x = _x;
_root[_name + "_hlaven"]._y = _y - 1;
test = true;
}
Symbol 31 MovieClip [tank] Frame 3
gotoAndPlay (2);
Symbol 31 MovieClip [tank] Frame 4
_root[_name + "_hlaven"].removeMovieClip();
_root["parachute" + tank_number].removeMovieClip();
_root["shield" + tank_number].removeMovieClip();
_root.hracu--;
Symbol 31 MovieClip [tank] Frame 9
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_x - (_width / 2)) + i)];
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((_x - x) * (_x - x)) + ((_y - h) * (_y - h))) * (180 / _width)));
cur._height = cur._height - (30 * vzr);
cur._y = cur._y + (15 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (50 / Math.abs(_x - x));
cur._y = cur._y + ((50 / Math.abs(_x - x)) / 2);
}
i++;
}
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if ((hitTest(current) || (hitTest(_root["shield" + i]))) && (i != tank_number)) {
x = _x - current._x;
y = _y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / 14));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / 18));
}
current.damage(damg, this);
}
i++;
}
Symbol 31 MovieClip [tank] Frame 15
if (playing) {
_root.test();
}
stop();
Symbol 37 MovieClip Frame 1
function bum() {
par1 = 35;
par2 = 30;
par3 = 30;
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_parent._x - (_width / 2)) + i)];
xx = _parent._x;
yy = _parent._y;
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((xx - x) * (xx - x)) + ((yy - h) * (yy - h))) * (180 / _width)));
cur._height = cur._height - (par1 * vzr);
cur._y = cur._y + (par2 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width))));
cur._y = cur._y + ((par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width)))) / 2);
}
i++;
}
par4 = 22;
par5 = 40;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = false;
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if (hitTest(current) || (hitTest(_root["shield" + i]))) {
x = _parent._x - current._x;
y = _parent._y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / par4));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / par5));
}
current.damage(damg, owner);
}
i++;
}
}
stop();
Symbol 37 MovieClip Frame 6
bum();
f._rotation = f._rotation - _parent._rotation;
Symbol 37 MovieClip Frame 12
_root.test();
_parent.removeMovieClip();
Instance of Symbol 37 MovieClip "strela" in Symbol 38 MovieClip [nuke_g] Frame 1
onClipEvent (load) {
stop();
depth = 10040;
uhel = (-_parent._rotation) + 90;
g = 9.81;
t = 0;
x = _parent._x;
hit = true;
y = _parent._y;
vox = Math.cos((Math.PI/180) * uhel) * vo;
voy = Math.sin(0.017 * uhel) * vo;
_root.shot_flying = true;
}
onClipEvent (enterFrame) {
if (((_parent._x < 0) || (550 < _parent._x)) || (400 < _y)) {
_root.shot_flying = false;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = true;
_root.test();
_parent.removeMovieClip();
}
if (_currentframe == 1) {
_parent._x = x + (vox * t);
_parent._y = (y - (voy * t)) + ((g / 2) * (t * t));
vox = vox + (_root.vitr / 600);
}
if (hitTest(_root["land" + Math.round(_parent._x)])) {
play();
}
i = 1;
while (_root.pocet_hracu >= i) {
if (hitTest(_root["t" + i]) && (i != owner.tank_number)) {
play();
}
if ((hitTest(owner) || (hitTest(_root["shield" + owner.tank_number]))) && (hit == false)) {
play();
}
i++;
}
if ((!hitTest(owner)) && (hit)) {
_parent.swapDepths(depth);
}
if (((!hitTest(owner)) && (hitTest(_root["shield" + owner.tank_number]) == false)) && (hit == true)) {
hit = false;
}
t = t + 0.1;
}
Symbol 40 MovieClip Frame 1
function bum() {
par1 = 30;
par2 = 15;
par3 = 15;
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_parent._x - (_width / 2)) + i)];
xx = _parent._x;
yy = _parent._y;
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((xx - x) * (xx - x)) + ((yy - h) * (yy - h))) * (180 / _width)));
cur._height = cur._height - (par1 * vzr);
cur._y = cur._y + (par2 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width))));
cur._y = cur._y + ((par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width)))) / 2);
}
i++;
}
par4 = 17;
par5 = 24;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = false;
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if (hitTest(current) || (hitTest(_root["shield" + i]))) {
x = _parent._x - current._x;
y = _parent._y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / par4));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / par5));
}
current.damage(damg, owner);
}
i++;
}
}
stop();
Symbol 40 MovieClip Frame 6
bum();
f._rotation = f._rotation - _parent._rotation;
Symbol 40 MovieClip Frame 12
_root.test();
_parent.removeMovieClip();
Instance of Symbol 40 MovieClip "strela" in Symbol 41 MovieClip [bnuke_g] Frame 1
onClipEvent (load) {
stop();
depth = 10040;
uhel = (-_parent._rotation) + 90;
g = 9.81;
t = 0;
x = _parent._x;
hit = true;
y = _parent._y;
vox = Math.cos((Math.PI/180) * uhel) * vo;
voy = Math.sin(0.017 * uhel) * vo;
_root.shot_flying = true;
}
onClipEvent (enterFrame) {
if (((_parent._x < 0) || (550 < _parent._x)) || (400 < _y)) {
_root.shot_flying = false;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = true;
_root.test();
_parent.removeMovieClip();
}
if (_currentframe == 1) {
_parent._x = x + (vox * t);
_parent._y = (y - (voy * t)) + ((g / 2) * (t * t));
vox = vox + (_root.vitr / 600);
}
if (hitTest(_root["land" + Math.round(_parent._x)])) {
play();
}
i = 1;
while (_root.pocet_hracu >= i) {
if (hitTest(_root["t" + i]) && (i != owner.tank_number)) {
play();
}
if ((hitTest(owner) || (hitTest(_root["shield" + owner.tank_number]))) && (hit == false)) {
play();
}
i++;
}
if ((!hitTest(owner)) && (hit)) {
_parent.swapDepths(depth);
}
if (((!hitTest(owner)) && (hitTest(_root["shield" + owner.tank_number]) == false)) && (hit == true)) {
hit = false;
}
t = t + 0.1;
}
Symbol 42 MovieClip Frame 1
function bum() {
par1 = 15;
par2 = 7.5;
par3 = 15;
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_parent._x - (_width / 2)) + i)];
xx = _parent._x;
yy = _parent._y;
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((xx - x) * (xx - x)) + ((yy - h) * (yy - h))) * (180 / _width)));
cur._height = cur._height - (par1 * vzr);
cur._y = cur._y + (par2 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width))));
cur._y = cur._y + ((par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width)))) / 2);
}
i++;
}
par4 = 13;
par5 = 20;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = false;
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if (hitTest(current) || (hitTest(_root["shield" + i]))) {
x = _parent._x - current._x;
y = _parent._y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / par4));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / par5));
}
current.damage(damg, owner);
}
i++;
}
}
function bum2() {
i = 0;
while (i < 7) {
_root.attachMovie("bnuke_c", "strela" + i, 1001 + i);
_root["strela" + i].depth = 10041 + i;
_root["strela" + i]._rotation = _parent._rotation;
_root["strela" + i].strela.x = x + (_root.vitr / 7);
_root["strela" + i].strela.y = y;
_root["strela" + i].strela.t = t;
_root["strela" + i].strela.vox = vox;
_root["strela" + i].strela.voy = voy;
_root["strela" + i].strela.vo = vo;
_root["strela" + i].strela.owner = owner;
_root["strela" + i].strela.st_number = i;
_root["strela" + i].strela.inc = -3 + i;
i++;
}
}
stop();
Symbol 42 MovieClip Frame 6
bum();
f._rotation = f._rotation - _parent._rotation;
Symbol 42 MovieClip Frame 12
test_ = true;
i = 0;
while (i < 7) {
if (this["shot" + i] != true) {
test_ = false;
break;
}
i++;
}
if (test_ || (end)) {
gotoAndStop (14);
}
Symbol 42 MovieClip Frame 13
gotoAndPlay(_currentframe - 1);
Symbol 42 MovieClip Frame 14
_root.test();
_parent.removeMovieClip();
Instance of Symbol 42 MovieClip "strela" in Symbol 43 MovieClip [death_g] Frame 1
onClipEvent (load) {
stop();
depth = 10040;
uhel = (-_parent._rotation) + 90;
g = 9.81;
t = 0;
x = _parent._x;
hit = true;
y = _parent._y;
vox = Math.cos((Math.PI/180) * uhel) * vo;
voy = Math.sin(0.017 * uhel) * vo;
_root.shot_flying = true;
}
onClipEvent (enterFrame) {
if (((_parent._x < 0) || (550 < _parent._x)) || (400 < _y)) {
gotoAndPlay (12);
}
if (_currentframe == 1) {
_parent._x = x + (vox * t);
_parent._y = (y - (voy * t)) + ((g / 2) * (t * t));
vox = vox + (_root.vitr / 600);
}
if (hitTest(_root["land" + Math.round(_parent._x)])) {
play();
}
i = 1;
while (_root.pocet_hracu >= i) {
if (hitTest(_root["tank" + i]) && (i != owner.tank_number)) {
play();
}
if (hitTest(owner) && (hit == false)) {
play();
}
i++;
}
if (!hitTest(owner)) {
hit = false;
}
if ((Math.round(t * 10) / 10) == 3) {
if (_currentframe == 1) {
bum2();
} else {
end = true;
}
}
t = t + 0.1;
}
Symbol 44 MovieClip Frame 1
function bum() {
par1 = 15;
par2 = 7.5;
par3 = 15;
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_parent._x - (_width / 2)) + i)];
xx = _parent._x;
yy = _parent._y;
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((xx - x) * (xx - x)) + ((yy - h) * (yy - h))) * (180 / _width)));
cur._height = cur._height - (par1 * vzr);
cur._y = cur._y + (par2 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width))));
cur._y = cur._y + ((par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width)))) / 2);
}
i++;
}
par4 = 13;
par5 = 18;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = false;
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if (hitTest(current) || (hitTest(_root["shield" + i]))) {
x = _parent._x - current._x;
y = _parent._y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / par4));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / par5));
}
current.damage(damg, owner);
}
i++;
}
}
function bum2() {
i = 0;
while (i < 5) {
_root.attachMovie("missile_funky", "strela" + i, 1001 + i);
_root["strela" + i].depth = 10041 + i;
_root["strela" + i]._rotation = _parent._rotation;
_root["strela" + i].strela.x = x + (_root.vitr / 7);
_root["strela" + i].strela.y = y;
_root["strela" + i].strela.t = t;
_root["strela" + i].strela.vox = vox;
_root["strela" + i].strela.voy = voy;
_root["strela" + i].strela.vo = vo;
_root["strela" + i].strela.owner = owner;
_root["strela" + i].strela.st_number = i;
_root["strela" + i].strela.inc = -2 + i;
i++;
}
}
stop();
Symbol 44 MovieClip Frame 6
bum();
f._rotation = f._rotation - _parent._rotation;
Symbol 44 MovieClip Frame 12
test_ = true;
i = 0;
while (i < 5) {
if (this["shot" + i] != true) {
test_ = false;
break;
}
i++;
}
if (test_ || (end)) {
gotoAndStop (14);
}
Symbol 44 MovieClip Frame 13
gotoAndPlay(_currentframe - 1);
Symbol 44 MovieClip Frame 14
_root.test();
_parent.removeMovieClip();
Instance of Symbol 44 MovieClip "strela" in Symbol 45 MovieClip [mirv_g] Frame 1
onClipEvent (load) {
stop();
depth = 10040;
uhel = (-_parent._rotation) + 90;
g = 9.81;
t = 0;
x = _parent._x;
hit = true;
y = _parent._y;
vox = Math.cos((Math.PI/180) * uhel) * vo;
voy = Math.sin(0.017 * uhel) * vo;
_root.shot_flying = true;
}
onClipEvent (enterFrame) {
if (((_parent._x < 0) || (550 < _parent._x)) || (400 < _y)) {
gotoAndPlay (12);
}
if (_currentframe == 1) {
_parent._x = x + (vox * t);
_parent._y = (y - (voy * t)) + ((g / 2) * (t * t));
vox = vox + (_root.vitr / 600);
}
if (hitTest(_root["land" + Math.round(_parent._x)])) {
play();
}
i = 1;
while (_root.pocet_hracu >= i) {
if (hitTest(_root["tank" + i]) && (i != owner.tank_number)) {
play();
}
if (hitTest(owner) && (hit == false)) {
play();
}
i++;
}
if (!hitTest(owner)) {
hit = false;
}
if ((Math.round(t * 10) / 10) == 3) {
if (_currentframe == 1) {
bum2();
} else {
end = true;
}
}
t = t + 0.1;
}
Symbol 47 MovieClip Frame 1
function bum() {
par1 = 15;
par2 = 7.5;
par3 = 15;
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_parent._x - (_width / 2)) + i)];
xx = _parent._x;
yy = _parent._y;
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((xx - x) * (xx - x)) + ((yy - h) * (yy - h))) * (180 / _width)));
cur._height = cur._height - (par1 * vzr);
cur._y = cur._y + (par2 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width))));
cur._y = cur._y + ((par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width)))) / 2);
}
i++;
}
par4 = 13;
par5 = 18;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = false;
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if (hitTest(current) || (hitTest(_root["shield" + i]))) {
x = _parent._x - current._x;
y = _parent._y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / par4));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / par5));
}
current.damage(damg, owner);
}
i++;
}
}
stop();
Symbol 47 MovieClip Frame 4
i = 0;
while (i < 5) {
_root.attachMovie("missile_funky", "strela" + i, 1001 + i);
_root["strela" + i].depth = 10041 + i;
_root["strela" + i]._rotation = random(90) - 45;
_root["strela" + i]._x = _parent._x;
_root["strela" + i]._y = _parent._y - 5;
_root["strela" + i].strela.vo = random(30) + 15;
_root["strela" + i].strela.owner = owner;
_root["strela" + i].strela.st_number = i;
_root["strela" + i].strela.x = _root["strela" + i]._x;
_root["strela" + i].strela.y = _root["strela" + i]._y;
_root["strela" + i].strela.t = 0;
i++;
}
Symbol 47 MovieClip Frame 6
bum();
f._rotation = f._rotation - _parent._rotation;
Symbol 47 MovieClip Frame 12
test_ = true;
i = 0;
while (i < 5) {
if (this["shot" + i] != true) {
test_ = false;
break;
}
i++;
}
if (test_ == true) {
gotoAndStop (14);
}
Symbol 47 MovieClip Frame 13
gotoAndPlay(_currentframe - 1);
Symbol 47 MovieClip Frame 14
_root.test();
_parent.removeMovieClip();
Instance of Symbol 47 MovieClip "strela" in Symbol 48 MovieClip [funky_g] Frame 1
onClipEvent (load) {
stop();
depth = 10040;
uhel = (-_parent._rotation) + 90;
g = 9.81;
t = 0;
x = _parent._x;
hit = true;
y = _parent._y;
vox = Math.cos((Math.PI/180) * uhel) * vo;
voy = Math.sin(0.017 * uhel) * vo;
_root.shot_flying = true;
}
onClipEvent (enterFrame) {
if (((_parent._x < 0) || (550 < _parent._x)) || (400 < _y)) {
_root.shot_flying = false;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = true;
_root.test();
_parent.removeMovieClip();
}
if (_currentframe == 1) {
_parent._x = x + (vox * t);
_parent._y = (y - (voy * t)) + ((g / 2) * (t * t));
vox = vox + (_root.vitr / 600);
}
if (hitTest(_root["land" + Math.round(_parent._x)])) {
play();
}
i = 1;
while (_root.pocet_hracu >= i) {
if (hitTest(_root["t" + i]) && (i != owner.tank_number)) {
play();
}
if ((hitTest(owner) || (hitTest(_root["shield" + owner.tank_number]))) && (hit == false)) {
play();
}
i++;
}
if ((!hitTest(owner)) && (hit)) {
_parent.swapDepths(depth);
}
if (((!hitTest(owner)) && (hitTest(_root["shield" + owner.tank_number]) == false)) && (hit == true)) {
hit = false;
}
t = t + 0.1;
}
Symbol 49 MovieClip Frame 1
function bum() {
par1 = 30;
par2 = 15;
par3 = 15;
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_parent._x - (_width / 2)) + i)];
xx = _parent._x;
yy = _parent._y;
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((xx - x) * (xx - x)) + ((yy - h) * (yy - h))) * (180 / _width)));
cur._height = cur._height - (par1 * vzr);
cur._y = cur._y + (par2 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width))));
cur._y = cur._y + ((par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width)))) / 2);
}
i++;
}
par4 = 17;
par5 = 24;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = false;
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if (hitTest(current) || (hitTest(_root["shield" + i]))) {
x = _parent._x - current._x;
y = _parent._y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / par4));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / par5));
}
current.damage(damg, owner);
}
i++;
}
}
stop();
Symbol 49 MovieClip Frame 6
bum();
f._rotation = f._rotation - _parent._rotation;
Symbol 49 MovieClip Frame 12
_root.strela.strela["shot" + st_number] = true;
_parent.removeMovieClip();
Instance of Symbol 49 MovieClip "strela" in Symbol 50 MovieClip [bnuke_c] Frame 1
onClipEvent (load) {
stop();
uhel = (-_parent._rotation) + 90;
g = 9.81;
hit = true;
vox = Math.cos((Math.PI/180) * uhel) * vo;
voy = Math.sin(0.017 * uhel) * vo;
}
onClipEvent (enterFrame) {
if (((_parent._x < 0) || (550 < _parent._x)) || (400 < _y)) {
_root.strela.strela["shot" + st_number] = true;
_parent.removeMovieClip();
}
if (_currentframe == 1) {
_parent._x = x + (vox * t);
_parent._y = (y - (voy * t)) + ((g / 2) * (t * t));
vox = vox + (_root.vitr / 600);
vox = vox + (inc / 20);
}
if (hitTest(_root["land" + Math.round(_parent._x)])) {
play();
}
i = 1;
while (_root.pocet_hracu >= i) {
if (hitTest(_root["t" + i]) && (i != owner.tank_number)) {
play();
}
if ((hitTest(owner) || (hitTest(_root["shield" + owner.tank_number]))) && (hit == false)) {
play();
}
i++;
}
if ((!hitTest(owner)) && (hit)) {
_parent.swapDepths(depth);
}
if (((!hitTest(owner)) && (hitTest(_root["shield" + owner.tank_number]) == false)) && (hit == true)) {
hit = false;
}
t = t + 0.1;
}
Symbol 51 MovieClip Frame 1
function bum() {
par1 = 15;
par2 = 7.5;
par3 = 15;
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_parent._x - (_width / 2)) + i)];
xx = _parent._x;
yy = _parent._y;
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((xx - x) * (xx - x)) + ((yy - h) * (yy - h))) * (180 / _width)));
cur._height = cur._height - (par1 * vzr);
cur._y = cur._y + (par2 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width))));
cur._y = cur._y + ((par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width)))) / 2);
}
i++;
}
par4 = 13;
par5 = 18;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = false;
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if (hitTest(current) || (hitTest(_root["shield" + i]))) {
x = _parent._x - current._x;
y = _parent._y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / par4));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / par5));
}
current.damage(damg, owner);
}
i++;
}
}
stop();
Symbol 51 MovieClip Frame 6
bum();
f._rotation = f._rotation - _parent._rotation;
Symbol 51 MovieClip Frame 12
_root.strela.strela["shot" + st_number] = true;
_parent.removeMovieClip();
Instance of Symbol 51 MovieClip "strela" in Symbol 52 MovieClip [amissile] Frame 1
onClipEvent (load) {
stop();
y = -50;
if (uhel == 0) {
x = (x - 120) + (num * 20);
} else {
x = (x + 120) - (num * 20);
}
g = 9.81;
st_number = num;
vo = 10;
vox = Math.cos((Math.PI/180) * uhel) * vo;
voy = Math.sin(0.017 * uhel) * vo;
t = 0;
}
onClipEvent (enterFrame) {
if (400 < _parent._y) {
_root.strela.strela["shot" + st_number] = true;
_parent.removeMovieClip();
}
if (_currentframe == 1) {
_parent._x = x + (vox * t);
_parent._y = (y - (voy * t)) + ((g / 2) * (t * t));
}
if (hitTest(_root["land" + Math.round(_parent._x)])) {
play();
}
i = 1;
while (_root.pocet_hracu >= i) {
if (hitTest(_root["t" + i])) {
play();
}
i++;
}
t = t + 0.12;
}
Symbol 53 MovieClip Frame 1
function bum() {
par1 = 15;
par2 = 7.5;
par3 = 15;
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_parent._x - (_width / 2)) + i)];
xx = _parent._x;
yy = _parent._y;
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((xx - x) * (xx - x)) + ((yy - h) * (yy - h))) * (180 / _width)));
cur._height = cur._height - (par1 * vzr);
cur._y = cur._y + (par2 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width))));
cur._y = cur._y + ((par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width)))) / 2);
}
i++;
}
par4 = 13;
par5 = 18;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = false;
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if (hitTest(current) || (hitTest(_root["shield" + i]))) {
x = _parent._x - current._x;
y = _parent._y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / par4));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / par5));
}
current.damage(damg, owner);
}
i++;
}
}
stop();
Symbol 53 MovieClip Frame 6
bum();
f._rotation = f._rotation - _parent._rotation;
Symbol 53 MovieClip Frame 12
_root.strela.strela["shot" + st_number] = true;
_parent.removeMovieClip();
Instance of Symbol 53 MovieClip "strela" in Symbol 54 MovieClip [missile_funky] Frame 1
onClipEvent (load) {
stop();
uhel = (-_parent._rotation) + 90;
g = 9.81;
hit = true;
vox = Math.cos((Math.PI/180) * uhel) * vo;
voy = Math.sin(0.017 * uhel) * vo;
}
onClipEvent (enterFrame) {
if (((_parent._x < 0) || (550 < _parent._x)) || (400 < _y)) {
_root.strela.strela["shot" + st_number] = true;
_parent.removeMovieClip();
}
if (_currentframe == 1) {
_parent._x = x + (vox * t);
_parent._y = (y - (voy * t)) + ((g / 2) * (t * t));
vox = vox + (_root.vitr / 600);
vox = vox + (inc / 20);
}
if (hitTest(_root["land" + Math.round(_parent._x)])) {
play();
}
i = 1;
while (_root.pocet_hracu >= i) {
if (hitTest(_root["t" + i]) && (i != owner.tank_number)) {
play();
}
if ((hitTest(owner) || (hitTest(_root["shield" + owner.tank_number]))) && (hit == false)) {
play();
}
i++;
}
if ((!hitTest(owner)) && (hit)) {
_parent.swapDepths(depth);
}
if (((!hitTest(owner)) && (hitTest(_root["shield" + owner.tank_number]) == false)) && (hit == true)) {
hit = false;
}
t = t + 0.1;
}
Symbol 55 MovieClip Frame 1
function bum() {
par1 = 35;
par2 = 30;
par3 = 30;
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_parent._x - (_width / 2)) + i)];
xx = _parent._x;
yy = _parent._y;
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((xx - x) * (xx - x)) + ((yy - h) * (yy - h))) * (180 / _width)));
cur._height = cur._height - (par1 * vzr);
cur._y = cur._y + (par2 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width))));
cur._y = cur._y + ((par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width)))) / 2);
}
i++;
}
par4 = 19;
par5 = 36;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = false;
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if (hitTest(current) || (hitTest(_root["shield" + i]))) {
x = _parent._x - current._x;
y = _parent._y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / par4));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / par5));
}
current.damage(damg, owner);
}
i++;
}
}
stop();
Symbol 55 MovieClip Frame 6
bum();
f._rotation = f._rotation - _parent._rotation;
Symbol 55 MovieClip Frame 12
_root.test();
_parent.removeMovieClip();
Instance of Symbol 55 MovieClip "strela" in Symbol 56 MovieClip [hroller2_g] Frame 1
onClipEvent (load) {
stop();
first = true;
second = false;
start = true;
depth = 10040;
uhel = (-_parent._rotation) + 90;
g = 9.81;
t = 0;
x = _parent._x;
hit = true;
y = _parent._y;
vox = Math.cos((Math.PI/180) * uhel) * vo;
voy = Math.sin(0.017 * uhel) * vo;
_root.shot_flying = true;
}
onClipEvent (enterFrame) {
if (((_parent._x < 0) || (550 < _parent._x)) || (400 < _parent._y)) {
_root.shot_flying = false;
_root.test();
_parent.removeMovieClip();
}
i = 1;
while (_root.pocet_hracu >= i) {
if (hitTest(_root["t" + i]) && (i != owner.tank_number)) {
play();
first = false;
second = false;
}
if ((hitTest(owner) || (hitTest(_root["shield" + owner.tank_number]))) && (hit == false)) {
play();
first = false;
second = false;
}
i++;
}
if ((!hitTest(owner)) && (hitTest(_root["shield" + owner.tank_number]) == false)) {
hit = false;
}
if (first) {
_parent._x = x + (vox * t);
_parent._y = (y - (voy * t)) + ((g / 2) * (t * t));
vox = vox + (_root.vitr / 600);
if (hitTest(_root["land" + Math.round(_parent._x)])) {
first = false;
second = true;
}
t = t + 0.1;
}
if (second) {
lastx = Math.round(_parent._x);
if (start) {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curl = _root["land" + (Math.round(_parent._x) - 1)];
curly = curl._y - (curl._height / 2);
curp = _root["land" + (Math.round(_parent._x) + 1)];
curpy = curp._y - (curp._height / 2);
if ((cury >= curly) || (cury >= curpy)) {
if (curly >= cury) {
smer = "right";
} else if (curpy >= cury) {
smer = "left";
}
} else {
second = false;
play();
}
start = false;
}
if (smer == "left") {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curl = _root["land" + (Math.round(_parent._x) - 1)];
curly = curl._y - (curl._height / 2);
if (cury >= curly) {
_parent._x = _parent._x - 1;
} else {
second = false;
play();
}
} else if (smer == "right") {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curp = _root["land" + (Math.round(_parent._x) + 1)];
curpy = curp._y - (curp._height / 2);
if (cury >= curpy) {
_parent._x = _parent._x + 1;
} else {
second = false;
play();
}
}
if (Math.round(lastx) == Math.round(_parent._x)) {
if (owner._x < _parent._x) {
smer = "right";
} else {
smer = "left";
}
}
}
}
Instance of Symbol 55 MovieClip "strela" in Symbol 57 MovieClip [hroller_g] Frame 1
onClipEvent (load) {
stop();
first = true;
second = false;
start = true;
depth = 10040;
uhel = (-_parent._rotation) + 90;
g = 9.81;
t = 0;
x = _parent._x;
hit = true;
y = _parent._y;
vox = Math.cos((Math.PI/180) * uhel) * vo;
voy = Math.sin(0.017 * uhel) * vo;
_root.shot_flying = true;
}
onClipEvent (enterFrame) {
if (((_parent._x < 0) || (550 < _parent._x)) || (400 < _parent._y)) {
_root.shot_flying = false;
_root.test();
_parent.removeMovieClip();
}
i = 1;
while (_root.pocet_hracu >= i) {
if (hitTest(_root["t" + i]) && (i != owner.tank_number)) {
play();
first = false;
second = false;
}
if ((hitTest(owner) || (hitTest(_root["shield" + owner.tank_number]))) && (hit == false)) {
play();
first = false;
second = false;
}
i++;
}
if ((!hitTest(owner)) && (hitTest(_root["shield" + owner.tank_number]) == false)) {
hit = false;
}
if (first) {
_parent._x = x + (vox * t);
_parent._y = (y - (voy * t)) + ((g / 2) * (t * t));
vox = vox + (_root.vitr / 600);
if (hitTest(_root["land" + Math.round(_parent._x)])) {
first = false;
second = true;
}
t = t + 0.1;
}
if (second) {
lastx = Math.round(_parent._x);
if (start) {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curl = _root["land" + (Math.round(_parent._x) - 1)];
curly = curl._y - (curl._height / 2);
curp = _root["land" + (Math.round(_parent._x) + 1)];
curpy = curp._y - (curp._height / 2);
if ((curly >= cury) || (curpy >= cury)) {
if (curly >= cury) {
smer = "left";
} else if (curpy >= cury) {
smer = "right";
}
} else {
second = false;
play();
}
start = false;
}
if (smer == "left") {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curl = _root["land" + (Math.round(_parent._x) - 1)];
curly = curl._y - (curl._height / 2);
if (curly >= cury) {
_parent._x = _parent._x - 1;
} else {
second = false;
play();
}
} else if (smer == "right") {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curp = _root["land" + (Math.round(_parent._x) + 1)];
curpy = curp._y - (curp._height / 2);
if (curpy >= cury) {
_parent._x = _parent._x + 1;
} else {
second = false;
play();
}
}
if (Math.round(lastx) == Math.round(_parent._x)) {
if (owner._x < _parent._x) {
smer = right;
} else {
smer = left;
}
}
}
}
Symbol 58 MovieClip Frame 1
function bum() {
par1 = 30;
par2 = 15;
par3 = 15;
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_parent._x - (_width / 2)) + i)];
xx = _parent._x;
yy = _parent._y;
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((xx - x) * (xx - x)) + ((yy - h) * (yy - h))) * (180 / _width)));
cur._height = cur._height - (par1 * vzr);
cur._y = cur._y + (par2 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width))));
cur._y = cur._y + ((par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width)))) / 2);
}
i++;
}
par4 = 13;
par5 = 18;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = false;
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if (hitTest(current) || (hitTest(_root["shield" + i]))) {
x = _parent._x - current._x;
y = _parent._y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / par4));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / par5));
}
current.damage(damg, owner);
}
i++;
}
}
stop();
Symbol 58 MovieClip Frame 6
bum();
f._rotation = f._rotation - _parent._rotation;
Symbol 58 MovieClip Frame 12
_root.test();
_parent.removeMovieClip();
Instance of Symbol 58 MovieClip "strela" in Symbol 59 MovieClip [roller2_g] Frame 1
onClipEvent (load) {
stop();
first = true;
second = false;
start = true;
depth = 10040;
uhel = (-_parent._rotation) + 90;
g = 9.81;
t = 0;
x = _parent._x;
hit = true;
y = _parent._y;
vox = Math.cos((Math.PI/180) * uhel) * vo;
voy = Math.sin(0.017 * uhel) * vo;
_root.shot_flying = true;
}
onClipEvent (enterFrame) {
if (((_parent._x < 0) || (550 < _parent._x)) || (400 < _parent._y)) {
_root.shot_flying = false;
_root.test();
_parent.removeMovieClip();
}
i = 1;
while (_root.pocet_hracu >= i) {
if (hitTest(_root["t" + i]) && (i != owner.tank_number)) {
play();
first = false;
second = false;
}
if ((hitTest(owner) || (hitTest(_root["shield" + owner.tank_number]))) && (hit == false)) {
play();
first = false;
second = false;
}
i++;
}
if ((!hitTest(owner)) && (hitTest(_root["shield" + owner.tank_number]) == false)) {
hit = false;
}
if (first) {
_parent._x = x + (vox * t);
_parent._y = (y - (voy * t)) + ((g / 2) * (t * t));
vox = vox + (_root.vitr / 600);
if (hitTest(_root["land" + Math.round(_parent._x)])) {
first = false;
second = true;
}
t = t + 0.1;
}
if (second) {
lastx = Math.round(_parent._x);
if (start) {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curl = _root["land" + (Math.round(_parent._x) - 1)];
curly = curl._y - (curl._height / 2);
curp = _root["land" + (Math.round(_parent._x) + 1)];
curpy = curp._y - (curp._height / 2);
if ((cury >= curly) || (cury >= curpy)) {
if (curly >= cury) {
smer = "right";
} else if (curpy >= cury) {
smer = "left";
}
} else {
second = false;
play();
}
start = false;
}
if (smer == "left") {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curl = _root["land" + (Math.round(_parent._x) - 1)];
curly = curl._y - (curl._height / 2);
if (cury >= curly) {
_parent._x = _parent._x - 1;
} else {
second = false;
play();
}
} else if (smer == "right") {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curp = _root["land" + (Math.round(_parent._x) + 1)];
curpy = curp._y - (curp._height / 2);
if (cury >= curpy) {
_parent._x = _parent._x + 1;
} else {
second = false;
play();
}
}
if (Math.round(lastx) == Math.round(_parent._x)) {
if (owner._x < _parent._x) {
smer = "right";
} else {
smer = "left";
}
}
}
}
Instance of Symbol 58 MovieClip "strela" in Symbol 60 MovieClip [roller_g] Frame 1
onClipEvent (load) {
stop();
first = true;
second = false;
start = true;
depth = 10040;
uhel = (-_parent._rotation) + 90;
g = 9.81;
t = 0;
x = _parent._x;
hit = true;
y = _parent._y;
vox = Math.cos((Math.PI/180) * uhel) * vo;
voy = Math.sin(0.017 * uhel) * vo;
_root.shot_flying = true;
}
onClipEvent (enterFrame) {
if (((_parent._x < 0) || (550 < _parent._x)) || (400 < _parent._y)) {
_root.shot_flying = false;
_root.test();
_parent.removeMovieClip();
}
i = 1;
while (_root.pocet_hracu >= i) {
if (hitTest(_root["t" + i]) && (i != owner.tank_number)) {
play();
first = false;
second = false;
}
if ((hitTest(owner) || (hitTest(_root["shield" + owner.tank_number]))) && (hit == false)) {
play();
first = false;
second = false;
}
i++;
}
if ((!hitTest(owner)) && (hitTest(_root["shield" + owner.tank_number]) == false)) {
hit = false;
}
if (first) {
_parent._x = x + (vox * t);
_parent._y = (y - (voy * t)) + ((g / 2) * (t * t));
vox = vox + (_root.vitr / 600);
if (hitTest(_root["land" + Math.round(_parent._x)])) {
first = false;
second = true;
}
t = t + 0.1;
}
if (second) {
lastx = Math.round(_parent._x);
if (start) {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curl = _root["land" + (Math.round(_parent._x) - 1)];
curly = curl._y - (curl._height / 2);
curp = _root["land" + (Math.round(_parent._x) + 1)];
curpy = curp._y - (curp._height / 2);
if ((curly >= cury) || (curpy >= cury)) {
if (curly >= cury) {
smer = "left";
} else if (curpy >= cury) {
smer = "right";
}
} else {
second = false;
play();
}
start = false;
}
if (smer == "left") {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curl = _root["land" + (Math.round(_parent._x) - 1)];
curly = curl._y - (curl._height / 2);
if (curly >= cury) {
_parent._x = _parent._x - 1;
} else {
second = false;
play();
}
} else if (smer == "right") {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curp = _root["land" + (Math.round(_parent._x) + 1)];
curpy = curp._y - (curp._height / 2);
if (curpy >= cury) {
_parent._x = _parent._x + 1;
} else {
second = false;
play();
}
}
if (Math.round(lastx) == Math.round(_parent._x)) {
if (owner._x < _parent._x) {
smer = right;
} else {
smer = left;
}
}
}
}
Symbol 61 MovieClip Frame 1
function bum() {
par1 = 15;
par2 = 7.5;
par3 = 15;
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_parent._x - (_width / 2)) + i)];
xx = _parent._x;
yy = _parent._y;
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((xx - x) * (xx - x)) + ((yy - h) * (yy - h))) * (180 / _width)));
cur._height = cur._height - (par1 * vzr);
cur._y = cur._y + (par2 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width))));
cur._y = cur._y + ((par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width)))) / 2);
}
i++;
}
par4 = 13;
par5 = 20;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = false;
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if (hitTest(current) || (hitTest(_root["shield" + i]))) {
x = _parent._x - current._x;
y = _parent._y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / par4));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / par5));
}
current.damage(damg, owner);
}
i++;
}
}
stop();
Symbol 61 MovieClip Frame 6
bum();
f._rotation = f._rotation - _parent._rotation;
Symbol 61 MovieClip Frame 12
_root.test();
_parent.removeMovieClip();
Instance of Symbol 61 MovieClip "strela" in Symbol 62 MovieClip [broller2_g] Frame 1
onClipEvent (load) {
stop();
first = true;
second = false;
start = true;
depth = 10040;
uhel = (-_parent._rotation) + 90;
g = 9.81;
t = 0;
x = _parent._x;
hit = true;
y = _parent._y;
vox = Math.cos((Math.PI/180) * uhel) * vo;
voy = Math.sin(0.017 * uhel) * vo;
_root.shot_flying = true;
}
onClipEvent (enterFrame) {
if (((_parent._x < 0) || (550 < _parent._x)) || (400 < _parent._y)) {
_root.shot_flying = false;
_root.test();
_parent.removeMovieClip();
}
i = 1;
while (_root.pocet_hracu >= i) {
if (hitTest(_root["t" + i]) && (i != owner.tank_number)) {
play();
first = false;
second = false;
}
if ((hitTest(owner) || (hitTest(_root["shield" + owner.tank_number]))) && (hit == false)) {
play();
first = false;
second = false;
}
i++;
}
if ((!hitTest(owner)) && (hitTest(_root["shield" + owner.tank_number]) == false)) {
hit = false;
}
if (first) {
_parent._x = x + (vox * t);
_parent._y = (y - (voy * t)) + ((g / 2) * (t * t));
vox = vox + (_root.vitr / 600);
if (hitTest(_root["land" + Math.round(_parent._x)])) {
first = false;
second = true;
}
t = t + 0.1;
}
if (second) {
lastx = Math.round(_parent._x);
if (start) {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curl = _root["land" + (Math.round(_parent._x) - 1)];
curly = curl._y - (curl._height / 2);
curp = _root["land" + (Math.round(_parent._x) + 1)];
curpy = curp._y - (curp._height / 2);
if ((cury >= curly) || (cury >= curpy)) {
if (curly >= cury) {
smer = "right";
} else if (curpy >= cury) {
smer = "left";
}
} else {
second = false;
play();
}
start = false;
}
if (smer == "left") {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curl = _root["land" + (Math.round(_parent._x) - 1)];
curly = curl._y - (curl._height / 2);
if (cury >= curly) {
_parent._x = _parent._x - 1;
} else {
second = false;
play();
}
} else if (smer == "right") {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curp = _root["land" + (Math.round(_parent._x) + 1)];
curpy = curp._y - (curp._height / 2);
if (cury >= curpy) {
_parent._x = _parent._x + 1;
} else {
second = false;
play();
}
}
if (Math.round(lastx) == Math.round(_parent._x)) {
if (owner._x < _parent._x) {
smer = "right";
} else {
smer = "left";
}
}
}
}
Instance of Symbol 61 MovieClip "strela" in Symbol 63 MovieClip [broller_g] Frame 1
onClipEvent (load) {
stop();
first = true;
second = false;
start = true;
depth = 10040;
uhel = (-_parent._rotation) + 90;
g = 9.81;
t = 0;
x = _parent._x;
hit = true;
y = _parent._y;
vox = Math.cos((Math.PI/180) * uhel) * vo;
voy = Math.sin(0.017 * uhel) * vo;
_root.shot_flying = true;
}
onClipEvent (enterFrame) {
if (((_parent._x < 0) || (550 < _parent._x)) || (400 < _parent._y)) {
_root.shot_flying = false;
_root.test();
_parent.removeMovieClip();
}
i = 1;
while (_root.pocet_hracu >= i) {
if (hitTest(_root["t" + i]) && (i != owner.tank_number)) {
play();
first = false;
second = false;
}
if ((hitTest(owner) || (hitTest(_root["shield" + owner.tank_number]))) && (hit == false)) {
play();
first = false;
second = false;
}
i++;
}
if ((!hitTest(owner)) && (hitTest(_root["shield" + owner.tank_number]) == false)) {
hit = false;
}
if (first) {
_parent._x = x + (vox * t);
_parent._y = (y - (voy * t)) + ((g / 2) * (t * t));
vox = vox + (_root.vitr / 600);
if (hitTest(_root["land" + Math.round(_parent._x)])) {
first = false;
second = true;
}
t = t + 0.1;
}
if (second) {
lastx = Math.round(_parent._x);
if (start) {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curl = _root["land" + (Math.round(_parent._x) - 1)];
curly = curl._y - (curl._height / 2);
curp = _root["land" + (Math.round(_parent._x) + 1)];
curpy = curp._y - (curp._height / 2);
if ((curly >= cury) || (curpy >= cury)) {
if (curly >= cury) {
smer = "left";
} else if (curpy >= cury) {
smer = "right";
}
} else {
second = false;
play();
}
start = false;
}
if (smer == "left") {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curl = _root["land" + (Math.round(_parent._x) - 1)];
curly = curl._y - (curl._height / 2);
if (curly >= cury) {
_parent._x = _parent._x - 1;
} else {
second = false;
play();
}
} else if (smer == "right") {
cur = _root["land" + Math.round(_parent._x)];
cury = cur._y - (cur._height / 2);
_parent._y = cury;
curp = _root["land" + (Math.round(_parent._x) + 1)];
curpy = curp._y - (curp._height / 2);
if (curpy >= cury) {
_parent._x = _parent._x + 1;
} else {
second = false;
play();
}
}
if (Math.round(lastx) == Math.round(_parent._x)) {
if (owner._x < _parent._x) {
smer = right;
} else {
smer = left;
}
}
}
}
Symbol 64 MovieClip Frame 1
stop();
Symbol 64 MovieClip Frame 2
test_ = true;
i = 0;
while (i < 5) {
if (this["shot" + i] != true) {
test_ = false;
break;
}
i++;
}
if (test_) {
gotoAndStop (4);
}
Symbol 64 MovieClip Frame 3
gotoAndPlay(_currentframe - 1);
Symbol 64 MovieClip Frame 4
_root.shot_flying = false;
_root.test();
_parent.removeMovieClip();
Instance of Symbol 64 MovieClip "strela" in Symbol 65 MovieClip [astrike_g] Frame 1
onClipEvent (load) {
f = false;
_root[_root.na_rade._name + "_hlaven"].gotoAndStop(1);
stop();
Mouse.hide();
_root.attachMovie("astrikecur", "cursor", 1100000);
startDrag (_root.cursor, true);
uhel = 0;
}
onClipEvent (mouseUp) {
if (!f) {
f = true;
stopDrag();
_root.cursor._x = -20;
Mouse.show();
x = _root._xmouse;
i = 0;
while (i < 5) {
_root.attachMovie("amissile", "strela" + i, 1001 + i);
_root["strela" + i].strela.num = i;
_root["strela" + i].strela.x = x;
_root["strela" + i].strela.uhel = uhel;
_root["strela" + i].strela.owner = owner;
i++;
}
gotoAndPlay (2);
}
}
onClipEvent (keyDown) {
if (Key.getCode() == 37) {
uhel = 0;
_root.cursor._xscale = 100;
} else if (Key.getCode() == 39) {
uhel = 180;
_root.cursor._xscale = -100;
}
}
Symbol 66 MovieClip Frame 1
function bum() {
par1 = 15;
par2 = 7.5;
par3 = 15;
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_parent._x - (_width / 2)) + i)];
xx = _parent._x;
yy = _parent._y;
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((xx - x) * (xx - x)) + ((yy - h) * (yy - h))) * (180 / _width)));
cur._height = cur._height - (par1 * vzr);
cur._y = cur._y + (par2 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width))));
cur._y = cur._y + ((par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width)))) / 2);
}
i++;
}
par4 = 13;
par5 = 18;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = false;
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if (hitTest(current) || (hitTest(_root["shield" + i]))) {
x = _parent._x - current._x;
y = _parent._y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / par4));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / par5));
}
current.damage(damg, owner);
}
i++;
}
}
stop();
Symbol 66 MovieClip Frame 6
bum();
f._rotation = f._rotation - _parent._rotation;
Symbol 66 MovieClip Frame 12
_root.test();
_parent.removeMovieClip();
Instance of Symbol 66 MovieClip "strela" in Symbol 67 MovieClip [missile_g] Frame 1
onClipEvent (load) {
stop();
depth = 10040;
uhel = (-_parent._rotation) + 90;
g = 9.81;
t = 0;
x = _parent._x;
hit = true;
y = _parent._y;
vox = Math.cos((Math.PI/180) * uhel) * vo;
voy = Math.sin(0.017 * uhel) * vo;
_root.shot_flying = true;
}
onClipEvent (enterFrame) {
if (((_parent._x < 0) || (550 < _parent._x)) || (400 < _y)) {
_root.shot_flying = false;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = true;
_root.test();
_parent.removeMovieClip();
}
if (_currentframe == 1) {
_parent._x = x + (vox * t);
_parent._y = (y - (voy * t)) + ((g / 2) * (t * t));
vox = vox + (_root.vitr / 600);
}
if (hitTest(_root["land" + Math.round(_parent._x)])) {
play();
}
i = 1;
while (_root.pocet_hracu >= i) {
if (hitTest(_root["t" + i]) && (i != owner.tank_number)) {
play();
}
if ((hitTest(owner) || (hitTest(_root["shield" + owner.tank_number]))) && (hit == false)) {
play();
}
i++;
}
if ((!hitTest(owner)) && (hit)) {
_parent.swapDepths(depth);
}
if (((!hitTest(owner)) && (hitTest(_root["shield" + owner.tank_number]) == false)) && (hit == true)) {
hit = false;
}
t = t + 0.1;
}
Symbol 68 MovieClip Frame 1
function bum() {
par1 = 15;
par2 = 7.5;
par3 = 15;
i = 0;
while (i < _width) {
cur = _root["land" + Math.round((_parent._x - (_width / 2)) + i)];
xx = _parent._x;
yy = _parent._y;
x = cur._x;
y = cur._y;
h = cur._y - (cur._height / 2);
if (hitTest(x, h, true)) {
vzr = Math.cos(0.017 * (Math.sqrt(((xx - x) * (xx - x)) + ((yy - h) * (yy - h))) * (180 / _width)));
cur._height = cur._height - (par1 * vzr);
cur._y = cur._y + (par2 * vzr);
} else if (hitTest(_root["land" + Math.round((xx - (_width / 2)) + i)])) {
cur._height = cur._height - (par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width))));
cur._y = cur._y + ((par3 * Math.cos(0.017 * (Math.abs(xx - x) * (180 / _width)))) / 2);
}
i++;
}
par4 = 5;
par5 = 13;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = false;
i = 1;
while (_root.pocet_hracu >= i) {
current = _root["tank" + i];
if (hitTest(current) || (hitTest(_root["shield" + i]))) {
x = _parent._x - current._x;
y = _parent._y - current._y;
vzd = Math.sqrt((x * x) + (y * y));
if (!current.sh_active) {
damg = Math.round(_width / ((vzd + 1) / par4));
if (_root["tank_" + i].energy < damg) {
damg = _root["tank_" + i].energy;
}
} else {
damg = Math.round(_width / (((vzd / 2) + 1) / par5));
}
current.damage(damg, owner);
}
i++;
}
}
stop();
Symbol 68 MovieClip Frame 6
bum();
f._rotation = f._rotation - _parent._rotation;
Symbol 68 MovieClip Frame 12
_root.shot_flying = false;
_root.test();
_parent.removeMovieClip();
Instance of Symbol 68 MovieClip "strela" in Symbol 69 MovieClip [bmissile_g] Frame 1
onClipEvent (load) {
stop();
depth = 10040;
uhel = (-_parent._rotation) + 90;
g = 9.81;
t = 0;
x = _parent._x;
hit = true;
y = _parent._y;
vox = Math.cos((Math.PI/180) * uhel) * vo;
voy = Math.sin(0.017 * uhel) * vo;
_root.shot_flying = true;
}
onClipEvent (enterFrame) {
if (((_parent._x < 0) || (550 < _parent._x)) || (400 < _y)) {
_root.shot_flying = false;
owner.last_shot_x = _parent._x;
owner.last_shot_y = _parent._y;
owner.last_shot_out = true;
_root.test();
_parent.removeMovieClip();
}
if (_currentframe == 1) {
_parent._x = x + (vox * t);
_parent._y = (y - (voy * t)) + ((g / 2) * (t * t));
vox = vox + (_root.vitr / 600);
}
if (hitTest(_root["land" + Math.round(_parent._x)])) {
play();
}
i = 1;
while (_root.pocet_hracu >= i) {
if (hitTest(_root["t" + i]) && (i != owner.tank_number)) {
play();
}
if ((hitTest(owner) || (hitTest(_root["shield" + owner.tank_number]))) && (hit == false)) {
play();
}
i++;
}
if ((!hitTest(owner)) && (hit)) {
_parent.swapDepths(depth);
}
if (((!hitTest(owner)) && (hitTest(_root["shield" + owner.tank_number]) == false)) && (hit == true)) {
hit = false;
}
t = t + 0.1;
}
Symbol 73 MovieClip Frame 1
this._x = this._x + (_root.vitr / 80);
if (360 < this._x) {
this._x = -360;
}
if (this._x < -360) {
this._x = 360;
}
Symbol 73 MovieClip Frame 2
gotoAndPlay (1);
Symbol 82 MovieClip Frame 1
this._x = this._x + (_root.vitr / 80);
if (360 < this._x) {
this._x = -360;
}
if (this._x < -360) {
this._x = 360;
}
Symbol 82 MovieClip Frame 2
gotoAndPlay (1);
Instance of Symbol 82 MovieClip in Symbol 94 MovieClip [krajina3] Frame 1
onClipEvent (enterFrame) {
this._x = this._x + 0.2;
if (460 < this._x) {
this._x = -60;
}
}
Instance of Symbol 82 MovieClip in Symbol 94 MovieClip [krajina3] Frame 1
onClipEvent (enterFrame) {
this._x = this._x + 0.2;
if (460 < this._x) {
this._x = -60;
}
}
Symbol 96 MovieClip [hlaven] Frame 1
stop();
Symbol 122 Button
on (release, keyPress "q") {
if (_root.na_rade.type == "tank") {
view_backward();
}
}
Symbol 123 Button
on (release, keyPress "w") {
if (_root.na_rade.type == "tank") {
view_forward();
}
}
Symbol 126 MovieClip Frame 1
function change_icon() {
this.attachMovie(_root.weapons[_root["tank_" + _root.na_rade.tank_number].cur_gun][0], "gun_ico", 1000101);
gun_ico._x = -55;
gun_ico._y = 0;
name = _root.weapons[_root["tank_" + _root.na_rade.tank_number].cur_gun][1];
count = _root["tank_" + _root.na_rade.tank_number].guns[_root["tank_" + _root.na_rade.tank_number].cur_gun];
}
Symbol 129 Button
on (press) {
if (_root.na_rade.type == "tank") {
if (100 >= _root["tank_" + _root.na_rade.tank_number].energy) {
startDrag ("", false, 0, 100 - _root["tank_" + _root.na_rade.tank_number].energy, 0, 100);
} else {
startDrag ("", false, 0, 0, 0, 100);
}
_parent.sdrag = true;
}
}
on (release, releaseOutside) {
_parent.sdrag = false;
stopDrag();
}
Symbol 136 Button
on (press) {
if ((0 < _root["tank_" + _root.na_rade.tank_number].fuel) && (_root.na_rade.playing)) {
left = true;
}
}
on (release, releaseOutside) {
left = false;
}
Symbol 137 Button
on (press) {
if ((0 < _root["tank_" + _root.na_rade.tank_number].fuel) && (_root.na_rade.playing)) {
right = true;
}
}
on (release, releaseOutside) {
right = false;
}
Symbol 143 Button
on (press) {
if (_root.na_rade.type == "tank") {
startDrag ("", true, -90, 0, 90, 0);
_parent.sdrag = true;
}
}
on (release, releaseOutside) {
stopDrag();
_parent.sdrag = false;
}
Symbol 148 Button
on (release) {
if (_root.na_rade.playing && (_root.na_rade.type == "tank")) {
_root.na_rade.fire();
}
}
Symbol 151 MovieClip Frame 1
stop();
Symbol 151 MovieClip Frame 2
stop();
Symbol 153 Button
on (release) {
_quality = "HIGH";
quality = "HIGH";
rad1.gotoAndStop(2);
rad2.gotoAndStop(1);
rad3.gotoAndStop(1);
}
Symbol 154 Button
on (release) {
_quality = "MEDIUM";
quality = "MEDIUM";
rad1.gotoAndStop(1);
rad3.gotoAndStop(1);
rad2.gotoAndStop(2);
}
Symbol 155 Button
on (release) {
_quality = "LOW";
quality = "LOW";
rad1.gotoAndStop(1);
rad2.gotoAndStop(1);
rad3.gotoAndStop(2);
}
Symbol 166 Button
on (release) {
if (_root["tank_" + _root.na_rade.tank_number].max_energy >= (_root["tank_" + _root.na_rade.tank_number].energy + 10)) {
_root["tank_" + _root.na_rade.tank_number].energy = _root["tank_" + _root.na_rade.tank_number].energy + 10;
} else {
_root["tank_" + _root.na_rade.tank_number].energy = _root["tank_" + _root.na_rade.tank_number].max_energy;
}
_root["tank_" + _root.na_rade.tank_number].specials[1]--;
refresh();
}
Symbol 168 MovieClip Frame 1
stop();
Symbol 173 Button
on (release) {
_root.na_rade.par = true;
refresh();
}
Symbol 176 Button
on (release) {
_root.na_rade.par = false;
refresh();
}
Symbol 177 MovieClip Frame 1
stop();
Symbol 182 Button
on (release) {
_root["tank_" + _root.na_rade.tank_number].specials[7]--;
Mouse.hide();
_root.attachMovie("teleport_a", "tel", 10100);
startDrag ("_root.tel", true);
gotoAndStop (2);
}
Symbol 184 MovieClip Frame 1
stop();
Symbol 188 Button
on (release) {
gotoAndStop (2);
}
Symbol 194 Button
on (rollOver) {
gotoAndStop (2);
}
on (rollOut) {
gotoAndStop (1);
}
on (release) {
_root.na_rade.activate_shield(1);
_parent.refresh();
}
Symbol 197 MovieClip Frame 1
stop();
refresh();
Symbol 197 MovieClip Frame 2
count = _root["tank_" + _root.na_rade.tank_number].specials[3];
Symbol 198 Button
on (rollOver) {
gotoAndStop (2);
}
on (rollOut) {
gotoAndStop (1);
}
on (release) {
_root.na_rade.activate_shield(2);
_parent.refresh();
}
Symbol 201 MovieClip Frame 1
stop();
refresh();
Symbol 201 MovieClip Frame 2
count = _root["tank_" + _root.na_rade.tank_number].specials[4];
Symbol 206 Button
on (rollOver) {
gotoAndStop (2);
}
on (rollOut) {
gotoAndStop (1);
}
on (release) {
_root.na_rade.activate_shield(3);
_parent.refresh();
}
Symbol 209 MovieClip Frame 1
stop();
refresh();
Symbol 209 MovieClip Frame 2
count = _root["tank_" + _root.na_rade.tank_number].specials[5];
Symbol 213 Button
on (rollOver) {
gotoAndStop (2);
}
on (rollOut) {
gotoAndStop (1);
}
on (release) {
_root.na_rade.activate_shield(4);
_parent.refresh();
}
Symbol 215 MovieClip Frame 1
stop();
refresh();
Symbol 215 MovieClip Frame 2
count = _root["tank_" + _root.na_rade.tank_number].specials[6];
Symbol 219 Button
on (release) {
_root.na_rade.disable_shield();
_parent.refresh();
}
Symbol 220 MovieClip Frame 1
stop();
refresh();
Symbol 221 MovieClip Frame 1
stop();
_parent.sh_active = false;
Symbol 221 MovieClip Frame 2
_parent.sh_active = true;
Instance of Symbol 190 MovieClip in Symbol 221 MovieClip Frame 2
onClipEvent (mouseMove) {
if (((((_x + (_width / 2)) < _xmouse) || (_xmouse < (_x - (_width / 2)))) || ((_y + (_height / 2)) < _ymouse)) || (_ymouse < (_y - (_height / 2)))) {
_parent.gotoAndStop(1);
}
}
Instance of Symbol 197 MovieClip "sh1" in Symbol 221 MovieClip Frame 2
onClipEvent (load) {
function refresh() {
if ((0 < _root["tank_" + _root.na_rade.tank_number].specials[3]) && (_root.na_rade.sh_active == false)) {
gotoAndStop (1);
} else {
gotoAndStop (3);
}
}
}
Instance of Symbol 201 MovieClip "sh2" in Symbol 221 MovieClip Frame 2
onClipEvent (load) {
function refresh() {
if ((0 < _root["tank_" + _root.na_rade.tank_number].specials[4]) && (_root.na_rade.sh_active == false)) {
gotoAndStop (1);
} else {
gotoAndStop (3);
}
}
}
Instance of Symbol 209 MovieClip "sh3" in Symbol 221 MovieClip Frame 2
onClipEvent (load) {
function refresh() {
if ((0 < _root["tank_" + _root.na_rade.tank_number].specials[5]) && (_root.na_rade.sh_active == false)) {
gotoAndStop (1);
} else {
gotoAndStop (3);
}
}
}
Instance of Symbol 215 MovieClip "sh4" in Symbol 221 MovieClip Frame 2
onClipEvent (load) {
function refresh() {
if ((0 < _root["tank_" + _root.na_rade.tank_number].specials[6]) && (_root.na_rade.sh_active == false)) {
gotoAndStop (1);
} else {
gotoAndStop (3);
}
}
}
Instance of Symbol 220 MovieClip "sh_d" in Symbol 221 MovieClip Frame 2
onClipEvent (load) {
function refresh() {
if (_root.na_rade.sh_active) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
}
Symbol 221 MovieClip Frame 3
stop();
Symbol 222 MovieClip [panel] Frame 1
function player_changed() {
ico.change_icon();
sort_score();
refresh_icons();
}
function refresh_icons() {
repair.refresh();
parachutes.refresh();
teleport.refresh();
shields.refresh();
}
function sort_score() {
i = 1;
while (i < (_root.pocet_hracu + 1)) {
this["score" + i].score = _root["tank_" + i].total_score;
i++;
}
i = 1;
while (i < (_root.pocet_hracu + 1)) {
Set("t" + i, _root.pocet_hracu);
i++;
}
c = 1;
while (c < (_root.pocet_hracu + 1)) {
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if ((_root["tank_" + c].total_score >= _root["tank_" + i].total_score) && (c != i)) {
this["t" + c] = this["t" + c] - 1;
}
i++;
}
c++;
}
p1 = new Object();
p1.total_score = -1E18;
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if (p1.total_score < _root["tank_" + i].total_score) {
p1 = _root["tank_" + i];
this["score" + i]._y = 28.3;
}
i++;
}
p2 = new Object();
p2.total_score = -1E19;
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if ((p2.total_score < _root["tank_" + i].total_score) && (p1 != _root["tank_" + i])) {
p2 = _root["tank_" + i];
this["score" + i]._y = 42.45;
}
i++;
}
p3 = new Object();
p3.total_score = -1E19;
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if (((p3.total_score < _root["tank_" + i].total_score) && (p1 != _root["tank_" + i])) && (p2 != _root["tank_" + i])) {
p3 = _root["tank_" + i];
this["score" + i]._y = 56.6;
}
i++;
}
p4 = new Object();
p4.total_score = -1E19;
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if ((((p4.total_score < _root["tank_" + i].total_score) && (p1 != _root["tank_" + i])) && (p2 != _root["tank_" + i])) && (p3 != _root["tank_" + i])) {
p4 = _root["tank_" + i];
this["score" + i]._y = 70.75;
}
i++;
}
p5 = new Object();
p5.total_score = -1E19;
i = 1;
while (i < (_root.pocet_hracu + 1)) {
if (((((p5.total_score < _root["tank_" + i].total_score) && (p1 != _root["tank_" + i])) && (p2 != _root["tank_" + i])) && (p3 != _root["tank_" + i])) && (p4 != _root["tank_" + i])) {
p5 = _root["tank_" + i];
this["score" + i]._y = 84.9;
}
i++;
}
}
cl = new Color(name);
i = 1;
while (i < (_root.pocet_hracu + 1)) {
this.attachMovie("score_tab", "score" + i, 1090000 + i);
this["score" + i]._x = 36;
this["score" + i]._y = (14.15 * i) + 14.15;
this["score" + i].name = _root["tank_" + i].name;
this["score" + i].score = _root["tank_" + i].total_score;
this["col" + i] = new Color(this["score" + i]);
this["col" + i].setRGB(_root["tank_" + i].col);
i++;
}
player_changed();
Instance of Symbol 126 MovieClip "ico" in Symbol 222 MovieClip [panel] Frame 1
onClipEvent (load) {
function view_forward() {
d = false;
i = _root["tank_" + _root.na_rade.tank_number].cur_gun + 1;
while (_root.weapons.length >= i) {
if (0 < _root["tank_" + _root.na_rade.tank_number].guns[i]) {
_root["tank_" + _root.na_rade.tank_number].cur_gun = i;
d = true;
this.change_icon();
break;
}
i++;
}
if (d == false) {
i = 0;
while (_root.weapons.length >= i) {
if (0 < _root["tank_" + _root.na_rade.tank_number].guns[i]) {
_root["tank_" + _root.na_rade.tank_number].cur_gun = i;
this.change_icon();
return;
}
i++;
}
}
}
function view_backward() {
d = false;
i = _root["tank_" + _root.na_rade.tank_number].cur_gun - 1;
while (i >= 0) {
if (0 < _root["tank_" + _root.na_rade.tank_number].guns[i]) {
_root["tank_" + _root.na_rade.tank_number].cur_gun = i;
d = true;
this.change_icon();
break;
}
i--;
}
if (d == false) {
i = _root.weapons.length;
while (i >= 0) {
if (0 < _root["tank_" + _root.na_rade.tank_number].guns[i]) {
_root["tank_" + _root.na_rade.tank_number].cur_gun = i;
this.change_icon();
return;
}
i--;
}
}
}
}
Instance of Symbol 135 MovieClip "pow" in Symbol 222 MovieClip [panel] Frame 1
onClipEvent (load) {
sdrag = false;
}
onClipEvent (enterFrame) {
if (sdrag) {
_root.na_rade.power = 100 - Math.round(pow._y);
if (pow._y < 0) {
pow._y = 0;
}
} else {
pow._y = 100 - _root.na_rade.power;
}
shadow._y = -_root["tank_" + _root.na_rade.tank_number].energy;
}
Instance of Symbol 139 MovieClip "fuel_ar" in Symbol 222 MovieClip [panel] Frame 1
onClipEvent (enterFrame) {
if (_root.na_rade.type == "tank") {
if (left) {
_root.na_rade.move_left();
} else if (right) {
_root.na_rade.move_right();
}
if (_root["tank_" + _root.na_rade.tank_number].fuel == 0) {
left = false;
right = false;
}
}
}
Instance of Symbol 145 MovieClip in Symbol 222 MovieClip [panel] Frame 1
onClipEvent (enterFrame) {
if (sdrag) {
_root.na_rade.rotace = 90 + Math.round(drag._x);
_root.tur.play();
} else {
drag._x = -90 + _root.na_rade.rotace;
_root.tur.gotoAndStop(2);
}
}
Instance of Symbol 151 MovieClip "rad1" in Symbol 222 MovieClip [panel] Frame 1
onClipEvent (load) {
if (_quality == "HIGH") {
gotoAndStop (2);
} else if (_quality == "MEDIUM") {
_parent.rad2.gotoAndStop(2);
} else if (_quality == "LOW") {
_parent.rad3.gotoAndStop(2);
}
}
Instance of Symbol 168 MovieClip "repair" in Symbol 222 MovieClip [panel] Frame 1
onClipEvent (load) {
function refresh() {
if (((_root["tank_" + _root.na_rade.tank_number].energy < _root["tank_" + _root.na_rade.tank_number].max_energy) && (0 < _root["tank_" + _root.na_rade.tank_number].specials[1])) && (_root.na_rade.type == "tank")) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
count = _root["tank_" + _root.na_rade.tank_number].specials[1];
}
}
Instance of Symbol 177 MovieClip "parachutes" in Symbol 222 MovieClip [panel] Frame 1
onClipEvent (load) {
function refresh() {
count = _root["tank_" + _root.na_rade.tank_number].specials[0];
if (((count == 0) && (_root.na_rade.par_used == false)) || (_root.na_rade.type == "ai")) {
gotoAndStop (3);
} else if (_root.na_rade.par) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
}
}
Instance of Symbol 184 MovieClip "teleport" in Symbol 222 MovieClip [panel] Frame 1
onClipEvent (load) {
function refresh() {
count = _root["tank_" + _root.na_rade.tank_number].specials[7];
if ((0 < count) && (_root.na_rade.type == "tank")) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
}
Instance of Symbol 221 MovieClip "shields" in Symbol 222 MovieClip [panel] Frame 1
onClipEvent (load) {
function refresh() {
if (_root.na_rade.type == "tank") {
sh1.refresh();
sh2.refresh();
sh3.refresh();
sh4.refresh();
sh_d.refresh();
} else {
gotoAndStop (3);
}
}
}
Symbol 222 MovieClip [panel] Frame 2
if (sh_active) {
fuel_ar.gotoAndStop(2);
} else {
fuel_ar.gotoAndStop(1);
}
num = _root.na_rade.tank_number;
cl.setRGB(_root["tank_" + num].col);
power = _root.power;
rotation = _root.rotace;
energy = Math.round(_root["tank_" + num].energy);
fuel = Math.round(_root["tank_" + num].fuel);
kills = _root["tank_" + num].kills;
name.name = _root["tank_" + num].name;
score = _root["tank_" + num].score;
vitr = Math.abs(_root.vitr);
vitr_uk._xscale = _root.vitr;
tank.hlaven._rotation = _root.na_rade.rotace;
Symbol 222 MovieClip [panel] Frame 3
gotoAndPlay (2);
Symbol 225 MovieClip [blk] Frame 35
this.removeMovieClip();
Symbol 242 Button
on (release) {
_root.clona.next_player();
}
Symbol 247 MovieClip [clona] Frame 1
function next_player() {
if (cur < _root.pocet_hracu) {
cur++;
if (_root["tank_" + cur].type == "tank") {
view_weapons();
} else {
_root["tank_" + cur].buy();
next_player();
}
} else {
score._visible = false;
player._visible = false;
buymenu._y = -500;
remove_weapons();
_root.gotoAndStop(3);
stops = false;
projizdi = true;
}
st = false;
i = cur + 1;
while (_root.pocet_hracu >= i) {
if (_root["tank_" + i].type == "tank") {
st = true;
break;
}
i++;
}
if ((cur == _root.pocet_hracu) || (st == false)) {
buymenu.but_capt = "Start!";
}
}
function purchasing_fc() {
view_weapons();
score._visible = true;
clr = new Color(player);
player._visible = true;
clr.setRGB(_root["tank_" + cur].col);
buymenu._x = 140;
buymenu._y = 80;
if (cur == 0) {
next_player();
}
}
function view_weapons() {
i = 0;
while (i < _root.weapons.length) {
this["weapon" + i].removeMovieClip();
i++;
}
sc = _root["tank_" + cur].score;
score.score = sc;
player.player = _root["tank_" + cur].name;
clr.setRGB(_root["tank_" + cur].col);
i = 0;
while (i < _root.weapons.length) {
this.attachMovie("weapon", "weapon" + i, 1000060 + i);
this["weapon" + i].icon_link = _root.weapons[i][0];
this["weapon" + i].caption = _root.weapons[i][1];
this["weapon" + i].price = _root.weapons[i][2];
this["weapon" + i].count = _root.weapons[i][3];
this["weapon" + i].num = i;
this["weapon" + i]._x = -140;
this["weapon" + i]._y = -140 + (this["weapon" + i]._height * i);
i++;
}
i = 0;
while (i < _root.specials.length) {
this.attachMovie("special", "special" + i, 1000080 + i);
this["special" + i].icon_link = _root.specials[i][0];
this["special" + i].caption = _root.specials[i][1];
this["special" + i].price = _root.specials[i][2];
this["special" + i].count = _root.specials[i][3];
this["special" + i].num = i;
this["special" + i]._x = 140;
this["special" + i]._y = -140 + (this["special" + i]._height * i);
i++;
}
}
function purchase_weapon(num) {
_root["tank_" + cur].guns[num] = _root["tank_" + cur].guns[num] + _root.weapons[num][3];
_root["tank_" + cur].score = _root["tank_" + cur].score - _root.weapons[num][2];
view_weapons();
}
function purchase_special(num) {
_root["tank_" + cur].specials[num] = _root["tank_" + cur].specials[num] + _root.specials[num][3];
_root["tank_" + cur].score = _root["tank_" + cur].score - _root.specials[num][2];
view_weapons();
}
function remove_weapons() {
i = 0;
while (i < 20) {
this["weapon" + i].removeMovieClip();
this["special" + i].removeMovieClip();
i++;
}
}
if (ch != true) {
speed = 16;
k = 920;
}
cur = 0;
Instance of Symbol 232 MovieClip "l" in Symbol 247 MovieClip [clona] Frame 1
onClipEvent (load) {
speed = _parent.speed;
first = true;
x = _x;
k = _parent.k;
}
onClipEvent (enterFrame) {
if (_root.clona.projizdi) {
speed = speed - ((137.5 + Math.abs(_x)) / k);
if (-137.5 < _x) {
_x = -137.5;
_root.gotoAndStop(_parent.frame);
}
_x = (_x + speed);
if ((speed < 0) && (_x < x)) {
if (_parent.stops) {
_parent.removeMovieClip();
} else {
_root.play();
_parent.removeMovieClip();
}
}
} else if (_x < -137.5) {
speed = speed - ((137.5 + Math.abs(_x)) / k);
_x = (_x + speed);
} else {
_x = -137.5;
_root.pozadi.removeMovieClip();
_root.panel.removeMovieClip();
if (_parent.purchasing && (first)) {
first = false;
_parent.purchasing_fc();
}
}
}
Instance of Symbol 234 MovieClip "score" in Symbol 247 MovieClip [clona] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 236 MovieClip "player" in Symbol 247 MovieClip [clona] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 239 MovieClip "r" in Symbol 247 MovieClip [clona] Frame 1
onClipEvent (load) {
speed = _parent.speed;
k = _parent.k;
}
onClipEvent (enterFrame) {
if (_root.clona.projizdi) {
speed = speed - ((137.5 + Math.abs(_x)) / k);
_x = (_x - speed);
if (_x < 137.5) {
_x = 137.5;
}
} else if (137.5 < _x) {
speed = speed - ((137.5 + Math.abs(_x)) / k);
_x = (_x - speed);
} else {
_x = 137;
}
}
Symbol 250 Button
on (release) {
if (_root["tank_" + _root.clona.cur].score >= price) {
_root.clona.purchase_special(num);
}
}
Symbol 256 MovieClip [special] Frame 1
if (_root["tank_" + _root.clona.cur].score >= price) {
w_caption = caption;
w2_caption = "";
} else {
w2_caption = caption;
w_caption = "";
}
w_price = price;
w_count = count;
t_count = _root["tank_" + _root.clona.cur].specials[num];
this.attachMovie(icon_link, "icon", 1000120 + num);
icon._y = 0.4;
icon._x = -74;
Symbol 258 Button
on (release) {
if (_root["tank_" + _root.clona.cur].score >= price) {
_root.clona.purchase_weapon(num);
}
}
Symbol 264 MovieClip [weapon] Frame 1
if (_root["tank_" + _root.clona.cur].score >= price) {
w_caption = caption;
w2_caption = "";
} else {
w2_caption = caption;
w_caption = "";
}
w_price = price;
w_count = count;
t_count = _root["tank_" + _root.clona.cur].guns[num];
this.attachMovie(icon_link, "icon", 1000060 + num);
icon._y = 0.4;
icon._x = -74;
Symbol 305 MovieClip [teleport_a] Frame 1
stop();
_root.na_rade.playing = false;
Instance of Symbol 303 MovieClip in Symbol 305 MovieClip [teleport_a] Frame 1
onClipEvent (mouseDown) {
stopDrag();
_parent.play();
_parent.tary = _parent._y;
_parent.tarx = _parent._x;
}
Symbol 305 MovieClip [teleport_a] Frame 10
Mouse.show();
_x = _root.na_rade._x;
_y = _root.na_rade._y;
Symbol 305 MovieClip [teleport_a] Frame 17
_root.na_rade._visible = false;
_root["shield" + _root.na_rade.tank_number]._visible = false;
_root[("tank" + _root.na_rade.tank_number) + "_hlaven"]._visible = false;
Symbol 305 MovieClip [teleport_a] Frame 35
_x = tarx;
_y = tary;
Symbol 305 MovieClip [teleport_a] Frame 41
_root.na_rade._visible = true;
_root[("tank" + _root.na_rade.tank_number) + "_hlaven"]._visible = true;
_root.na_rade._x = _x;
_root.na_rade._y = _y;
_root[("tank" + _root.na_rade.tank_number) + "_hlaven"]._x = _x;
_root[("tank" + _root.na_rade.tank_number) + "_hlaven"]._y = _y - 1;
_root["shield" + _root.na_rade.tank_number]._visible = true;
_root["shield" + _root.na_rade.tank_number]._x = _x;
_root["shield" + _root.na_rade.tank_number]._y = _y;
Symbol 305 MovieClip [teleport_a] Frame 48
_root.test();
this.removeMovieClip();
Symbol 311 MovieClip [weak_sh] Frame 1
function damage(dam, attacker) {
en = en - dam;
_alpha = Math.round((en / en_max) * 100);
if (0 >= en) {
_root["tank" + num].sh_active = false;
_root["t" + num] = _root["tank" + num];
_root["tank" + num].damage(Math.abs(en) * 2, attacker);
this.removeMovieClip();
}
}
function disable() {
this.removeMovieClip();
}
en = 100;
en_max = 100;
Symbol 313 MovieClip [shield_sh] Frame 1
function damage(dam, attacker) {
en = en - dam;
_alpha = Math.round((en / en_max) * 100);
if (0 >= en) {
_root["tank" + num].sh_active = false;
_root["t" + num] = _root["tank" + num];
_root["tank" + num].damage(Math.abs(en) * 2, attacker);
this.removeMovieClip();
}
}
function disable() {
this.removeMovieClip();
}
en = 200;
en_max = 200;
Symbol 315 MovieClip [strong_sh] Frame 1
function damage(dam, attacker) {
en = en - dam;
_alpha = Math.round((en / en_max) * 100);
if (0 >= en) {
_root["tank" + num].sh_active = false;
_root["t" + num] = _root["tank" + num];
_root["tank" + num].damage(Math.abs(en) * 2, attacker);
this.removeMovieClip();
}
}
function disable() {
this.removeMovieClip();
}
en_max = 400;
en = 400;
Symbol 317 MovieClip [super_sh] Frame 1
function damage(dam, attacker) {
en = en - dam;
_alpha = Math.round((en / en_max) * 100);
if (0 >= en) {
_root["tank" + num].sh_active = false;
_root["t" + num] = _root["tank" + num];
_root["tank" + num].damage(Math.abs(en) * 2, attacker);
this.removeMovieClip();
}
}
function disable() {
this.removeMovieClip();
}
en = 600;
en_max = 600;
Symbol 327 Button
on (release) {
if (!_root.released) {
m1.gotoAndStop(2);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
_root.krajina = 1;
}
}
Symbol 328 Button
on (release) {
if (!_root.released) {
m1.gotoAndStop(1);
m2.gotoAndStop(2);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
_root.krajina = 2;
}
}
Symbol 329 Button
on (release) {
if (!_root.released) {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(2);
m4.gotoAndStop(1);
_root.krajina = 3;
}
}
Symbol 330 Button
on (release) {
if (!_root.released) {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(2);
_root.krajina = 0;
}
}
Instance of Symbol 151 MovieClip "m4" in Symbol 331 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (2);
}
Symbol 335 Button
on (release, keyPress "<Enter>") {
if (!released) {
_root.attachMovie("clona", "clona", 1000001);
_root.clona._x = 275;
_root.clona._y = 200;
_root.clona.projizdi = true;
_root.clona.frame = 2;
_root.clona.stops = true;
released = true;
}
}
Symbol 342 Button
on (release) {
if (_root.pocet_hracu < 5) {
_root.pocet_hracu++;
pocet = _root.pocet_hracu;
}
}
Symbol 343 Button
on (release) {
if (2 < _root.pocet_hracu) {
_root.pocet_hracu--;
pocet = _root.pocet_hracu;
}
}
Symbol 344 MovieClip Frame 1
pocet = _root.pocet_hracu;
Symbol 347 MovieClip Frame 1
stop();
Symbol 352 Button
on (release) {
getURL ("http://www.FreeGamesForYourWebsite.com", "_blank");
}
Symbol 356 Button
on (release) {
getURL ("http://www.2dplay.com", "_blank");
}
Symbol 360 Button
on (release) {
getURL ("http://www.2dplay.com", "_blank");
}
Symbol 361 MovieClip Frame 70
stop();
Symbol 365 MovieClip Frame 1
stop();
Symbol 366 Button
on (release) {
if (!_root.released) {
if (type == "tank") {
type = "ai";
check.gotoAndStop(2);
} else {
type = "tank";
check.gotoAndStop(1);
}
}
}
Symbol 371 Button
on (release) {
if (!_root.released) {
m1.gotoAndStop(2);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
_root.col = 15737856 /* 0xF02400 */;
}
}
Symbol 372 Button
on (release) {
if (!_root.released) {
m1.gotoAndStop(1);
m2.gotoAndStop(2);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
_root.col = 52275;
}
}
Symbol 373 Button
on (release) {
if (!_root.released) {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(2);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
_root.col = 13311;
}
}
Symbol 374 Button
on (release) {
if (!_root.released) {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(2);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
_root.col = 3355443 /* 0x333333 */;
}
}
Symbol 375 Button
on (release) {
if (!_root.released) {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(2);
m6.gotoAndStop(1);
_root.col = 15785743 /* 0xF0DF0F */;
}
}
Symbol 376 Button
on (release) {
if (!_root.released) {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(2);
_root.col = 15373056 /* 0xEA9300 */;
}
}
Instance of Symbol 151 MovieClip "m4" in Symbol 377 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (2);
}
Instance of Symbol 151 MovieClip "m5" in Symbol 377 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (1);
}
Instance of Symbol 151 MovieClip "m6" in Symbol 377 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (1);
}
Symbol 379 Button
on (release, keyPress "<Enter>") {
if (pocet_hracu >= cur) {
if (_root.name != "") {
_root["tank_" + cur].name = _root.name;
} else {
_root["tank_" + cur].name = "Player " + cur;
}
_root["tank_" + cur].col = _root.col;
_root["tank_" + cur].type = type;
if (type == "ai") {
_root["tank_" + cur].dif = dif;
}
_root.name = "";
cur++;
if (pocet_hracu >= cur) {
cislo = "Player " + cur;
} else {
gotoAndPlay (3);
}
if (cur == pocet_hracu) {
_root.uk = "START ! ";
}
}
}
Symbol 388 Button
on (release) {
if (!_root.released) {
m1.gotoAndStop(2);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
_root.dif = "Very_easy";
}
}
Symbol 389 Button
on (release) {
if (!_root.released) {
m1.gotoAndStop(1);
m2.gotoAndStop(2);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
_root.dif = "easy";
}
}
Symbol 390 Button
on (release) {
if (!_root.released) {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(2);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
_root.dif = "normal";
}
}
Symbol 391 Button
on (release) {
if (!_root.released) {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(2);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
_root.dif = "hard";
}
}
Symbol 392 Button
on (release) {
if (!_root.released) {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(2);
m6.gotoAndStop(1);
_root.dif = "very_hard";
}
}
Instance of Symbol 151 MovieClip "m3" in Symbol 393 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (2);
}
Instance of Symbol 151 MovieClip "m5" in Symbol 393 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (1);
}
Symbol 400 MovieClip Frame 1
stop();
Symbol 402 MovieClip Frame 1
stop();
Symbol 402 MovieClip Frame 36
i = 0;
while (550 >= i) {
_root["land" + i].removeMovieClip();
i++;
}
i = 0;
while (i < 100) {
_root["strom" + i].removeMovieClip();
i++;
}
i = 1;
while (_root.pocet_hracu >= i) {
_root["shield" + i].removeMovieClip();
_root["parachute" + i].removeMovieClip();
_root["tank" + i].removeMovieClip();
_root[("tank" + i) + "_hlaven"].removeMovieClip();
_root["tank_" + i].fuel = _root["tank_" + i].specials[2];
i++;
}
_root.strela.removeMovieClip();
_root.attachMovie("clona", "clona", 1000001);
_root.clona._x = 275;
_root.clona._y = 200;
_root.clona.purchasing = true;
_root.vitr = 0;
_root.pozadi.slunce.gotoAndStop(1);
_root.clona.ch = true;
_root.clona.speed = 10;
_root.clona.speed = 10;
_root.clona.k = 2340;
_root.clona.k = 2340;