Frame 2
Sound_main_music1 = new Sound();
Sound_main_music1.attachSound("main_music1");
Sound_main_music2 = new Sound();
Sound_main_music2.attachSound("main_music2");
Sound_main_music1.start();
Sound_main_music1.onSoundComplete = function () {
Sound_main_music2.start(null, 999);
};
Frame 21
stop();
Frame 22
function CPU_findUnit(unit) {
var _local2;
var _local1 = 0;
while (_local1 < Mechs.length) {
if ((Mechs[_local1].Owner != unit.Owner) && (Mechs[_local1].HP > 0)) {
_local2 = _local1;
break;
}
_local1++;
}
return(_local2);
}
function CPU_pathToUnit(unit, x, y) {
if ((x == undefined) && (y == undefined)) {
return(undefined);
}
if (unit.unitID == 2) {
var _local7 = 2;
var _local6 = 2;
} else {
var _local7 = unit.viewX + Math.ceil(unit.viewX / 2);
var _local6 = unit.viewY + Math.ceil(unit.viewY / 2);
}
var _local4 = 0;
while (_local4 < 50) {
if ((Math.random() * 100) >= 50) {
if ((Math.random() * 100) >= 50) {
Game.selectedY = y + Math.floor(Math.random() * _local6);
Game.selectedX = x;
} else {
Game.selectedY = y;
Game.selectedX = x + Math.floor(Math.random() * _local7);
}
} else if ((Math.random() * 100) >= 50) {
Game.selectedY = y - Math.floor(Math.random() * _local6);
Game.selectedX = x;
} else {
Game.selectedY = y;
Game.selectedX = x - Math.floor(Math.random() * _local7);
}
if ((_root["HitMask" + Game.zone][Game.selectedY][Game.selectedX] == 0) && (!hitUnit(Game.selectedY, Game.selectedX))) {
break;
}
_local4++;
}
if (Game.selectedX > (unit.x + unit.viewX)) {
Game.selectedX = unit.x + unit.viewX;
} else if (Game.selectedX < (unit.x - unit.viewX)) {
Game.selectedX = unit.x - unit.viewX;
}
if (Game.selectedY > (unit.y + unit.viewY)) {
Game.selectedY = unit.y + unit.viewY;
} else if (Game.selectedY < (unit.y - unit.viewY)) {
Game.selectedY = unit.y - unit.viewY;
}
}
function CPU_hitUnit(unit) {
if (unit.unitID == 2) {
var _local7 = 2;
var _local6 = 2;
} else {
var _local7 = unit.viewX + Math.ceil(unit.viewX / 2);
var _local6 = unit.viewY + Math.ceil(unit.viewY / 2);
}
var _local5 = unit.x;
while (_local5 < (unit.x + _local7)) {
if ((_root["HitMask" + Game.zone][unit.y][_local5] == 0) && (!hitUnit(unit.y, _local5, "TEAM"))) {
var _local3 = 0;
while (_local3 < Mechs.length) {
if ((((Mechs[_local3].y == unit.y) && (Mechs[_local3].x == _local5)) && (Mechs[_local3].Owner != unit.Owner)) && (Mechs[_local3].HP > 0)) {
Game.selectedY = Mechs[_local3].y;
Game.selectedX = Mechs[_local3].x;
return(true);
}
_local3++;
}
} else {
break;
}
_local5++;
}
_local5 = unit.x;
while (_local5 > (unit.x - _local7)) {
if ((_root["HitMask" + Game.zone][unit.y][_local5] == 0) && (!hitUnit(unit.y, _local5, "TEAM"))) {
var _local3 = 0;
while (_local3 < Mechs.length) {
if ((((Mechs[_local3].y == unit.y) && (Mechs[_local3].x == _local5)) && (Mechs[_local3].Owner != unit.Owner)) && (Mechs[_local3].HP > 0)) {
Game.selectedY = Mechs[_local3].y;
Game.selectedX = Mechs[_local3].x;
return(true);
}
_local3++;
}
} else {
break;
}
_local5--;
}
var _local4 = unit.y;
while (_local4 < (unit.y + _local6)) {
if ((_root["HitMask" + Game.zone][_local4][unit.x] == 0) && (!hitUnit(_local4, unit.x, "TEAM"))) {
var _local3 = 0;
while (_local3 < Mechs.length) {
if ((((Mechs[_local3].y == _local4) && (Mechs[_local3].x == unit.x)) && (Mechs[_local3].Owner != unit.Owner)) && (Mechs[_local3].HP > 0)) {
Game.selectedY = Mechs[_local3].y;
Game.selectedX = Mechs[_local3].x;
return(true);
}
_local3++;
}
} else {
break;
}
_local4++;
}
_local4 = unit.y;
while (_local4 > (unit.y - _local6)) {
if ((_root["HitMask" + Game.zone][_local4][unit.x] == 0) && (!hitUnit(_local4, unit.x, "TEAM"))) {
var _local3 = 0;
while (_local3 < Mechs.length) {
if ((((Mechs[_local3].y == _local4) && (Mechs[_local3].x == unit.x)) && (Mechs[_local3].Owner != unit.Owner)) && (Mechs[_local3].HP > 0)) {
Game.selectedY = Mechs[_local3].y;
Game.selectedX = Mechs[_local3].x;
return(true);
}
_local3++;
}
} else {
break;
}
_local4--;
}
return(false);
}
function CPU_getAttack(unit) {
unit.Attack = 0;
if (CPU_hitUnit(unit)) {
if ((unit.EP >= (40 - Math.floor(40 * unit.GEN))) && (unit.Attack == 0)) {
unit.Attack = 3;
}
if ((unit.EP >= (10 - Math.floor(10 * unit.GEN))) && (unit.Attack == 0)) {
unit.Attack = 2;
}
if ((unit.EP >= (5 - Math.floor(5 * unit.GEN))) && (unit.Attack == 0)) {
unit.Attack = 1;
}
}
if (unit.Attack > 0) {
unit.Mode = "ATTACK";
} else {
unit.Mode = "BLOCK";
showAnimation(unit, null, "B");
doRotation();
}
}
function faceAngle(unit) {
var _local2 = "A" + unit.Attack;
if ((Game.selectedY == unit.y) && (Game.selectedX < unit.x)) {
if (unit.Direction != 3) {
showAnimation(unit, 3, _local2);
} else {
showAnimation(unit, null, _local2);
}
} else if ((Game.selectedY == unit.y) && (Game.selectedX > unit.x)) {
if (unit.Direction != 1) {
showAnimation(unit, 1, _local2);
} else {
showAnimation(unit, null, _local2);
}
} else if ((Game.selectedY < unit.y) && (Game.selectedX == unit.x)) {
if (unit.Direction != 4) {
showAnimation(unit, 4, _local2);
} else {
showAnimation(unit, null, _local2);
}
} else if ((Game.selectedY > unit.y) && (Game.selectedX == unit.x)) {
if (unit.Direction != 2) {
showAnimation(unit, 2, _local2);
} else {
showAnimation(unit, null, _local2);
}
}
}
function Attack(unit) {
var _local3 = new Object();
_local3.ID = "A" + unit.Attack;
_local3.Name = null;
_local3.Type = null;
_local3.Damage = 0;
if ((Game.selectedX != undefined) && (Game.selectedX != undefined)) {
if (unit.Owner == 0) {
closeMenu("ACTIONS");
}
switch (unit.Attack) {
case 1 :
unit.EP = unit.EP - (5 - Math.floor(5 * unit.GEN));
_local3.Name = Attacks[unit.unitID].A1;
_local3.Type = Attacks[unit.unitID].A1Type;
_local3.Damage = Attacks[unit.unitID].A1Damage;
break;
case 2 :
unit.EP = unit.EP - (10 - Math.floor(10 * unit.GEN));
_local3.Name = Attacks[unit.unitID].A2;
_local3.Type = Attacks[unit.unitID].A2Type;
_local3.Damage = Attacks[unit.unitID].A2Damage;
break;
case 3 :
unit.EP = unit.EP - (40 - Math.floor(40 * unit.GEN));
_local3.Name = Attacks[unit.unitID].A3;
_local3.Type = Attacks[unit.unitID].A3Type;
_local3.Damage = Attacks[unit.unitID].A3Damage;
}
if (unit.EP < 0) {
unit.EP = 0;
}
var _local4 = new Array();
if ((_local3.Type == 1) || (_local3.Type == 3)) {
var _local5 = 0;
while (_local5 < Mechs.length) {
if ((((Mechs[_local5].x == Game.selectedX) && (Mechs[_local5].y == Game.selectedY)) && (Mechs[_local5].HP > 0)) && (Mechs[_local5].Owner != unit.Owner)) {
_local4.push(Mechs[_local5].ID);
break;
}
_local5++;
}
} else if (_local3.Type == 2) {
var _local9 = unit.viewX + Math.ceil(unit.viewX / 2);
var _local8 = unit.viewY + Math.ceil(unit.viewY / 2);
var _local7 = unit.x;
while (_local7 < (unit.x + _local9)) {
if ((_root["HitMask" + Game.zone][unit.y][_local7] == 0) && (!hitUnit(unit.y, _local7, "TEAM"))) {
var _local5 = 0;
while (_local5 < Mechs.length) {
if ((((Mechs[_local5].y == unit.y) && (Mechs[_local5].x == _local7)) && (Mechs[_local5].Owner != unit.Owner)) && (Mechs[_local5].HP > 0)) {
_local4.push(Mechs[_local5].ID);
break;
}
_local5++;
}
} else {
break;
}
_local7++;
}
_local7 = unit.x;
while (_local7 > (unit.x - _local9)) {
if ((_root["HitMask" + Game.zone][unit.y][_local7] == 0) && (!hitUnit(unit.y, _local7, "TEAM"))) {
var _local5 = 0;
while (_local5 < Mechs.length) {
if ((((Mechs[_local5].y == unit.y) && (Mechs[_local5].x == _local7)) && (Mechs[_local5].Owner != unit.Owner)) && (Mechs[_local5].HP > 0)) {
_local4.push(Mechs[_local5].ID);
break;
}
_local5++;
}
} else {
break;
}
_local7--;
}
var _local6 = unit.y;
while (_local6 < (unit.y + _local8)) {
if ((_root["HitMask" + Game.zone][_local6][unit.x] == 0) && (!hitUnit(_local6, unit.x, "TEAM"))) {
var _local5 = 0;
while (_local5 < Mechs.length) {
if ((((Mechs[_local5].y == _local6) && (Mechs[_local5].x == unit.x)) && (Mechs[_local5].Owner != unit.Owner)) && (Mechs[_local5].HP > 0)) {
_local4.push(Mechs[_local5].ID);
break;
}
_local5++;
}
} else {
break;
}
_local6++;
}
_local6 = unit.y;
while (_local6 > (unit.y - _local8)) {
if ((_root["HitMask" + Game.zone][_local6][unit.x] == 0) && (!hitUnit(_local6, unit.x, "TEAM"))) {
var _local5 = 0;
while (_local5 < Mechs.length) {
if ((((Mechs[_local5].y == _local6) && (Mechs[_local5].x == unit.x)) && (Mechs[_local5].Owner != unit.Owner)) && (Mechs[_local5].HP > 0)) {
_local4.push(Mechs[_local5].ID);
break;
}
_local5++;
}
} else {
break;
}
_local6--;
}
}
switch (_local3.Type) {
case 1 :
faceAngle(unit);
break;
case 2 :
showAnimation(unit, null, _local3.ID);
break;
case 3 :
faceAngle(unit);
}
var _local10 = new Object();
_local10.min = int(_local3.Damage - (_local3.Damage * 0.1));
_local10.max = int(_local3.Damage + (_local3.Damage * 0.1));
_local3.Damage = random(_local10.max - _local10.min) + _local10.min;
_local3.Damage = int(_local3.Damage * unit.WPN);
var _local5 = 0;
while (_local5 < _local4.length) {
unit.XP = unit.XP + 25;
var _local7 = 0;
while (_local7 < Mechs[_local4[_local5]].AP) {
_local3.Damage = _local3.Damage - int(((Math.random() * 3) - 1) + 1);
_local7++;
}
if (_local3.Damage <= 0) {
_local3.Damage = 1;
}
if (Mechs[_local4[_local5]].Mode == "BLOCK") {
if (_local3.Type == 3) {
unit.HP = unit.HP + int(_local3.Damage / 2);
Mechs[_local4[_local5]].HP = Mechs[_local4[_local5]].HP - int(_local3.Damage / 2);
} else {
Mechs[_local4[_local5]].HP = Mechs[_local4[_local5]].HP - int(_local3.Damage / 2);
}
} else if (_local3.Type == 3) {
unit.HP = unit.HP + _local3.Damage;
Mechs[_local4[_local5]].HP = Mechs[_local4[_local5]].HP - _local3.Damage;
} else {
Mechs[_local4[_local5]].HP = Mechs[_local4[_local5]].HP - _local3.Damage;
}
if (_local3.Type == 3) {
if (unit.HP > unit.MaxHP) {
unit.HP = unit.MaxHP;
}
}
if (Mechs[_local4[_local5]].HP <= 0) {
switch (Mechs[_local4[_local5]].unitID) {
case 0 :
Game.Platinum = Game.Platinum + 15000;
break;
case 1 :
Game.Platinum = Game.Platinum + 20000;
break;
case 2 :
Game.Platinum = Game.Platinum + 25000;
}
unit.Kills++;
unit.XP = unit.XP + 100;
Mechs[_local4[_local5]].HP = 0;
showEffect(Mechs[_local4[_local5]], "DEAD");
GridHolder["Unit_" + Mechs[_local4[_local5]].ID].removeMovieClip();
updateHistory(((("<b>Team " + (unit.Owner + 1)) + "</b>: ") + _local3.Name) + " has killed an opponent.<br>");
} else {
showEffect(Mechs[_local4[_local5]], _local3.ID);
if (_local3.Type == 3) {
updateHistory(((((("<b>Team " + (unit.Owner + 1)) + "</b>: ") + _local3.Name) + " leeched ") + _local3.Damage) + " health.<br>");
} else if (Mechs[_local4[_local5]].Mode == "BLOCK") {
updateHistory(((((("<b>Team " + (unit.Owner + 1)) + "</b>: ") + _local3.Name) + " was blocked dealing only ") + int(_local3.Damage / 2)) + " damage.<br>");
} else {
updateHistory(((((("<b>Team " + (unit.Owner + 1)) + "</b>: ") + _local3.Name) + " hit for ") + _local3.Damage) + " damage.<br>");
}
}
_local5++;
}
unit.Mode = "STAND";
}
}
HitMask1 = new Array();
HitMask1[0] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
HitMask1[1] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask1[2] = [1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1];
HitMask1[3] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask1[4] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask1[5] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask1[6] = [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1];
HitMask1[7] = [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask1[8] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1];
HitMask1[9] = [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask1[10] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask1[11] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
Tile1 = new Array();
Tile1[0] = ["1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1"];
Tile1[1] = ["1/1", "4/6", "4/3", "4/5", "4/7", "6/4", "5/2", "4/3", "4/7", "4/8", "4/8", "1/1"];
Tile1[2] = ["1/1", "4/1", "7/1", "4/7", "7/2", "4/7", "5/1", "6/3", "4/7", "7/1", "4/9", "1/1"];
Tile1[3] = ["1/1", "4/5", "4/3", "3/3", "3/6", "3/6", "3/6", "3/1", "3/1", "4/6", "4/7", "1/1"];
Tile1[4] = ["1/1", "3/1", "3/2", "3/4", "3/1", "5/2", "5/4", "3/4", "3/4", "3/3", "3/2", "1/1"];
Tile1[5] = ["1/1", "3/4", "5/3", "3/2", "3/2", "6/4", "5/1", "4/9", "5/1", "3/5", "3/5", "1/1"];
Tile1[6] = ["1/1", "3/6", "3/4", "4/1", "7/2", "4/4", "4/2", "4/6", "7/2", "5/3", "3/4", "1/1"];
Tile1[7] = ["1/1", "4/5", "3/5", "4/1", "4/1", "4/4", "4/9", "4/7", "4/7", "3/3", "3/6", "1/1"];
Tile1[8] = ["1/1", "4/3", "3/3", "3/2", "4/6", "4/6", "4/1", "4/4", "3/4", "4/1", "7/2", "1/1"];
Tile1[9] = ["1/1", "4/1", "7/1", "4/9", "4/8", "4/5", "4/5", "3/3", "4/3", "4/7", "4/5", "1/1"];
Tile1[10] = ["1/1", "4/5", "4/7", "4/7", "4/4", "4/7", "3/3", "4/7", "4/3", "4/4", "4/9", "1/1"];
Tile1[11] = ["1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1"];
HitMask2 = new Array();
HitMask2[0] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
HitMask2[1] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask2[2] = [1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1];
HitMask2[3] = [1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1];
HitMask2[4] = [1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1];
HitMask2[5] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask2[6] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask2[7] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask2[8] = [1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1];
HitMask2[9] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask2[10] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask2[11] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
Tile2 = new Array();
Tile2[0] = ["1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1"];
Tile2[1] = ["1/1", "3/2", "3/6", "3/2", "4/6", "4/6", "4/6", "4/9", "4/2", "3/5", "3/1", "1/1"];
Tile2[2] = ["1/1", "6/4", "3/3", "4/5", "7/1", "7/2", "4/6", "4/2", "4/4", "4/4", "6/3", "1/1"];
Tile2[3] = ["1/1", "3/2", "3/4", "3/6", "4/6", "6/4", "4/4", "4/5", "7/1", "4/5", "4/4", "1/1"];
Tile2[4] = ["1/1", "3/5", "4/4", "3/2", "3/4", "4/5", "4/4", "4/2", "7/2", "7/2", "4/5", "1/1"];
Tile2[5] = ["1/1", "3/4", "4/7", "4/4", "3/5", "4/5", "4/4", "4/4", "4/7", "4/7", "4/2", "1/1"];
Tile2[6] = ["1/1", "3/3", "3/3", "4/7", "4/7", "3/6", "3/1", "4/1", "4/7", "4/1", "4/1", "1/1"];
Tile2[7] = ["1/1", "3/5", "3/1", "6/4", "5/2", "4/9", "4/2", "4/5", "4/9", "4/6", "3/1", "1/1"];
Tile2[8] = ["1/1", "3/5", "3/1", "7/1", "4/4", "3/5", "4/2", "7/2", "4/7", "3/1", "3/1", "1/1"];
Tile2[9] = ["1/1", "6/5", "6/6", "3/6", "4/6", "4/4", "4/7", "4/4", "4/5", "6/4", "3/4", "1/1"];
Tile2[10] = ["1/1", "4/1", "3/1", "3/5", "3/3", "3/5", "4/6", "4/6", "4/3", "6/2", "3/6", "1/1"];
Tile2[11] = ["1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1"];
HitMask3 = new Array();
HitMask3[0] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
HitMask3[1] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask3[2] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask3[3] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask3[4] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask3[5] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask3[6] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask3[7] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask3[8] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask3[9] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask3[10] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask3[11] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
Tile3 = new Array();
Tile3[0] = ["1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1"];
Tile3[1] = ["1/1", "3/4", "3/1", "3/3", "3/4", "3/5", "3/3", "3/3", "3/3", "3/5", "3/3", "1/1"];
Tile3[2] = ["1/1", "3/6", "3/5", "3/5", "3/3", "4/7", "4/7", "4/3", "3/3", "4/8", "4/5", "1/1"];
Tile3[3] = ["1/1", "4/6", "3/1", "4/8", "4/6", "6/4", "4/8", "4/2", "3/3", "3/6", "4/2", "1/1"];
Tile3[4] = ["1/1", "4/9", "3/3", "5/3", "4/9", "4/5", "6/6", "3/1", "4/7", "3/6", "3/1", "1/1"];
Tile3[5] = ["1/1", "4/9", "5/2", "3/1", "3/3", "4/2", "3/1", "3/1", "3/5", "3/6", "5/3", "1/1"];
Tile3[6] = ["1/1", "4/2", "3/3", "6/6", "3/1", "3/1", "3/1", "3/4", "3/3", "4/1", "4/1", "1/1"];
Tile3[7] = ["1/1", "3/4", "3/1", "6/4", "5/2", "3/1", "3/1", "3/6", "3/3", "3/4", "3/1", "1/1"];
Tile3[8] = ["1/1", "3/5", "3/3", "4/7", "4/3", "4/5", "4/3", "3/5", "3/6", "3/1", "3/2", "1/1"];
Tile3[9] = ["1/1", "3/1", "3/4", "3/4", "4/4", "4/8", "4/4", "3/4", "4/5", "4/7", "4/5", "1/1"];
Tile3[10] = ["1/1", "4/1", "3/1", "3/3", "3/4", "3/4", "3/6", "3/2", "4/7", "4/6", "4/2", "1/1"];
Tile3[11] = ["1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1"];
HitMask4 = new Array();
HitMask4[0] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
HitMask4[1] = [1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1];
HitMask4[2] = [1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1];
HitMask4[3] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask4[4] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask4[5] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask4[6] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask4[7] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask4[8] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask4[9] = [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask4[10] = [1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1];
HitMask4[11] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
Tile4 = new Array();
Tile4[0] = ["1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1"];
Tile4[1] = ["1/1", "8/1", "8/1", "4/5", "8/1", "8/1", "4/5", "8/1", "4/5", "8/1", "4/5", "1/1"];
Tile4[2] = ["1/1", "4/5", "4/7", "4/5", "4/2", "4/7", "4/7", "7/2", "4/5", "4/7", "4/5", "1/1"];
Tile4[3] = ["1/1", "3/1", "3/1", "4/8", "4/6", "6/4", "4/8", "4/4", "3/1", "4/5", "4/2", "1/1"];
Tile4[4] = ["1/1", "4/1", "3/3", "5/3", "4/9", "4/5", "6/6", "3/1", "4/7", "4/2", "3/1", "1/1"];
Tile4[5] = ["1/1", "4/1", "5/2", "3/1", "3/3", "4/2", "3/1", "3/1", "4/5", "4/1", "5/3", "1/1"];
Tile4[6] = ["1/1", "3/1", "3/3", "6/6", "3/1", "3/1", "3/1", "3/2", "4/1", "4/1", "4/1", "1/1"];
Tile4[7] = ["1/1", "4/9", "3/1", "6/4", "5/2", "3/1", "3/1", "3/3", "5/2", "3/2", "3/1", "1/1"];
Tile4[8] = ["1/1", "4/7", "3/1", "4/7", "6/2", "5/1", "4/3", "4/8", "4/3", "4/6", "3/1", "1/1"];
Tile4[9] = ["1/1", "7/2", "4/2", "4/5", "4/2", "4/8", "4/5", "4/7", "4/6", "4/5", "4/2", "1/1"];
Tile4[10] = ["1/1", "8/1", "8/1", "8/1", "4/5", "4/4", "4/7", "8/1", "4/5", "4/2", "8/1", "1/1"];
Tile4[11] = ["1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1"];
HitMask5 = new Array();
HitMask5[0] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
HitMask5[1] = [1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
HitMask5[2] = [1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1];
HitMask5[3] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask5[4] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask5[5] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask5[6] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask5[7] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask5[8] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask5[9] = [1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1];
HitMask5[10] = [1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
HitMask5[11] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
Tile5 = new Array();
Tile5[0] = ["1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1"];
Tile5[1] = ["1/1", "4/3", "7/2", "8/3", "8/2", "8/1", "8/4", "8/5", "8/5", "8/5", "8/5", "1/1"];
Tile5[2] = ["1/1", "4/9", "4/5", "7/1", "4/7", "7/1", "3/5", "8/5", "9/1", "9/1", "9/1", "1/1"];
Tile5[3] = ["1/1", "4/8", "4/8", "3/5", "4/5", "4/8", "3/4", "3/2", "9/1", "9/2", "9/2", "1/1"];
Tile5[4] = ["1/1", "3/6", "4/1", "4/1", "4/9", "4/8", "6/1", "3/1", "9/1", "9/1", "9/1", "1/1"];
Tile5[5] = ["1/1", "6/1", "3/6", "3/6", "3/5", "3/4", "3/6", "3/6", "9/2", "9/1", "9/1", "1/1"];
Tile5[6] = ["1/1", "6/2", "3/6", "3/1", "6/4", "3/4", "3/5", "3/3", "9/3", "9/1", "9/1", "1/1"];
Tile5[7] = ["1/1", "6/4", "3/4", "3/5", "4/4", "3/2", "6/3", "3/4", "9/3", "9/1", "9/3", "1/1"];
Tile5[8] = ["1/1", "4/4", "4/5", "4/5", "4/3", "3/6", "3/1", "3/6", "9/3", "9/1", "9/3", "1/1"];
Tile5[9] = ["1/1", "3/1", "4/8", "4/5", "7/1", "4/7", "7/1", "8/5", "9/1", "9/2", "9/1", "1/1"];
Tile5[10] = ["1/1", "3/5", "7/2", "8/1", "8/2", "8/3", "8/4", "8/5", "8/5", "8/5", "8/5", "1/1"];
Tile5[11] = ["1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1"];
HitMask6 = new Array();
HitMask6[0] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
HitMask6[1] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
HitMask6[2] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask6[3] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask6[4] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask6[5] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask6[6] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask6[7] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask6[8] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask6[9] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
HitMask6[10] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
HitMask6[11] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
Tile6 = new Array();
Tile6[0] = ["1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1"];
Tile6[1] = ["1/1", "8/5", "8/5", "8/5", "8/5", "8/5", "8/5", "8/5", "8/5", "8/5", "8/5", "1/1"];
Tile6[2] = ["1/1", "9/1", "9/1", "9/1", "9/1", "9/1", "9/3", "9/1", "9/1", "9/1", "9/2", "1/1"];
Tile6[3] = ["1/1", "9/3", "9/3", "9/1", "9/3", "9/1", "9/2", "9/2", "9/3", "9/2", "9/1", "1/1"];
Tile6[4] = ["1/1", "9/1", "9/1", "9/1", "9/1", "9/1", "9/2", "9/3", "9/1", "9/1", "9/3", "1/1"];
Tile6[5] = ["1/1", "9/3", "9/1", "9/2", "9/2", "9/2", "9/3", "9/1", "9/3", "9/3", "9/2", "1/1"];
Tile6[6] = ["1/1", "9/3", "9/3", "9/3", "9/2", "9/2", "9/2", "9/2", "9/1", "9/2", "9/2", "1/1"];
Tile6[7] = ["1/1", "9/3", "9/3", "9/2", "9/3", "9/3", "9/2", "9/2", "9/1", "9/3", "9/1", "1/1"];
Tile6[8] = ["1/1", "9/1", "9/3", "9/3", "9/1", "9/1", "9/2", "9/1", "9/1", "9/2", "9/2", "1/1"];
Tile6[9] = ["1/1", "9/1", "9/1", "9/1", "9/1", "9/1", "9/1", "9/3", "9/2", "9/3", "9/3", "1/1"];
Tile6[10] = ["1/1", "8/5", "8/5", "8/5", "8/5", "8/5", "8/5", "8/5", "8/5", "8/5", "8/5", "1/1"];
Tile6[11] = ["1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1", "1/1"];
BG_music = new Sound();
BG_music.attachSound("Ambience1");
BG_music.stop("Ambience1");
BG_music.start(null, 999);
Sound_walk_step1 = new Sound();
Sound_walk_step1.attachSound("mech_walk_step1");
Sound_walk_step2 = new Sound();
Sound_walk_step2.attachSound("mech_walk_step2");
Sound_walk_hover1 = new Sound();
Sound_walk_hover1.attachSound("mech_walk_hover1");
Sound_walk_hover2 = new Sound();
Sound_walk_hover2.attachSound("mech_walk_hover1");
Sound_arm_movement1 = new Sound();
Sound_arm_movement1.attachSound("arm_movement1");
Sound_arm_movement2 = new Sound();
Sound_arm_movement2.attachSound("arm_movement2");
Sound_arm_movement3 = new Sound();
Sound_arm_movement3.attachSound("arm_movement3");
Sound_gatling_gun = new Sound();
Sound_gatling_gun.attachSound("gatling_gun");
Sound_rocket_launcher = new Sound();
Sound_rocket_launcher.attachSound("rocket_launcher");
Sound_machine_gun = new Sound();
Sound_machine_gun.attachSound("machine_gun");
Sound_seismic_cannon = new Sound();
Sound_seismic_cannon.attachSound("seismic_cannon");
Sound_metal_stinger = new Sound();
Sound_metal_stinger.attachSound("metal_stinger");
Sound_powerdrain = new Sound();
Sound_powerdrain.attachSound("powerdrain");
Sound_bladesaw = new Sound();
Sound_bladesaw.attachSound("bladesaw");
Sound_object_explode = new Sound();
Sound_object_explode.attachSound("object_explode");
Sound_mech_explode = new Sound();
Sound_mech_explode.attachSound("mech_explode");
Sound_shockwave = new Sound();
Sound_shockwave.attachSound("shockwave_effect");
Sound_slash1 = new Sound();
Sound_slash1.attachSound("slash1");
Sound_slash2 = new Sound();
Sound_slash2.attachSound("slash2");
Sound_slash3 = new Sound();
Sound_slash3.attachSound("slash3");
Sound_slash_hit1 = new Sound();
Sound_slash_hit1.attachSound("slash_hit1");
Sound_slash_hit2 = new Sound();
Sound_slash_hit2.attachSound("slash_hit2");
Mechs = new Array();
Mechs[0] = {ID:0, unitID:1, Owner:0, nextx:null, nexty:null, Direction:1, height:78, viewX:5, viewY:5, x:1, y:4, Mode:"STAND", Kills:0, Attack:0, speed:0.125, XP:0, HP:475, MaxHP:475, EP:100, AP:15, GEN:0.05, WPN:0.9};
Mechs[1] = {ID:1, unitID:1, Owner:1, nextx:null, nexty:null, Direction:3, height:78, viewX:5, viewY:5, x:10, y:4, Mode:"STAND", Kills:0, Attack:0, speed:0.125, XP:0, HP:475, MaxHP:475, EP:100, AP:15, GEN:0.05, WPN:0.9};
Mechs[2] = {ID:2, unitID:0, Owner:0, nextx:null, nexty:null, Direction:1, height:78, viewX:5, viewY:4, x:1, y:5, Mode:"STAND", Kills:0, Attack:0, speed:0.125, XP:0, HP:565, MaxHP:565, EP:100, AP:11, GEN:0.05, WPN:0.9};
Mechs[4] = {ID:4, unitID:0, Owner:1, nextx:null, nexty:null, Direction:3, height:78, viewX:5, viewY:4, x:10, y:5, Mode:"STAND", Kills:0, Attack:0, speed:0.125, XP:0, HP:565, MaxHP:565, EP:100, AP:11, GEN:0.05, WPN:0.9};
Mechs[5] = {ID:5, unitID:2, Owner:0, nextx:null, nexty:null, Direction:1, height:78, viewX:5, viewY:4, x:1, y:6, Mode:"STAND", Kills:0, Attack:0, speed:0.125, XP:0, HP:500, MaxHP:500, EP:100, AP:16, GEN:0.05, WPN:0.9};
Mechs[6] = {ID:6, unitID:2, Owner:1, nextx:null, nexty:null, Direction:3, height:78, viewX:5, viewY:4, x:10, y:6, Mode:"STAND", Kills:0, Attack:0, speed:0.125, XP:0, HP:500, MaxHP:500, EP:100, AP:16, GEN:0.05, WPN:0.9};
History = new Array();
History[0] = "";
History[1] = "";
History[2] = "";
Attacks = new Array();
Attacks[0] = {A1:"Machine Gun", A1Type:1, A1Damage:35, A2:"Rocket Launcher", A2Type:1, A2Damage:60, A3:"Seismic Cannon", A3Type:1, A3Damage:132};
Attacks[1] = {A1:"Gatling Guns", A1Type:1, A1Damage:48, A2:"Cross-fire", A2Type:2, A2Damage:48, A3:"Metal Stinger", A3Type:1, A3Damage:160};
Attacks[2] = {A1:"Slasher", A1Type:1, A1Damage:65, A2:"Powerdrain", A2Type:3, A2Damage:80, A3:"Bladesaw", A3Type:1, A3Damage:140};
Game = new Object();
Game.Platinum = 0;
Game.targetx = null;
Game.targety = null;
Game.screenW = 900;
Game.screenH = 550;
Game.tileW = 45;
Game.disableMove = false;
Game.unitSelected = -1;
Game.oldX = undefined;
Game.oldY = undefined;
Game.selectedX = undefined;
Game.selectedY = undefined;
Game.zone = 1;
Game.targetID = 0;
Game.team = new Array();
Game.team[0] = {path:null, i:0};
Game.team[1] = {path:null, i:0};
Game.attackOver = false;
Game.effect = 100;
Game.difficulty = 1;
Difficulty = "NORMAL";
this.attachMovie("Pointer", "Pointer", 99999999);
Pointer.startDrag(true);
Mouse.hide();
Info._visible = false;
_global.setPositions = function () {
var _local3 = 1;
var _local2 = 0;
while (_local2 < Mechs.length) {
Mechs[_local2].HP = Mechs[_local2].MaxHP;
Mechs[_local2].EP = 100;
if (Mechs[_local2].Owner == 0) {
while (_root["HitMask" + Game.zone][_local3][1] != 0) {
_local3++;
}
Mechs[_local2].Direction = 1;
Mechs[_local2].y = _local3;
Mechs[_local2].x = 1;
}
_local3++;
_local2++;
}
_local3 = 1;
_local2 = 0;
while (_local2 < Mechs.length) {
if (Mechs[_local2].Owner == 1) {
while (_root["HitMask" + Game.zone][_local3][10] != 0) {
_local3++;
}
Mechs[_local2].Direction = 3;
Mechs[_local2].y = _local3;
Mechs[_local2].x = 10;
}
_local3++;
_local2++;
}
};
_global.buildMap = function () {
GridHolder._x = (Game.screenW / 2) - Game.tileW;
GridHolder._y = (Game.screenH / 2) - (Game.tileW * (_root["Tile" + Game.zone][0].length / 2));
var _local5 = 0;
while (_local5 < _root["Tile" + Game.zone].length) {
var _local3 = 0;
while (_local3 < _root["Tile" + Game.zone][0].length) {
var _local4 = (("Tile_" + _local3) + "_") + _local5;
var _local8 = (((((_local5 + _local3) * Game.tileW) / 2) * 300) + ((_local3 - _local5) * Game.tileW)) + 1;
GridHolder.attachMovie("Tile", _local4, _local8);
GridHolder[_local4]._x = (_local3 - _local5) * Game.tileW;
GridHolder[_local4]._y = ((_local3 + _local5) * Game.tileW) / 2;
GridHolder[_local4].x = _local3;
GridHolder[_local4].y = _local5;
var _local9 = _root["Tile" + Game.zone][_local5][_local3].split("/");
GridHolder[_local4].gotoAndStop(_local9[0]);
GridHolder[_local4].Highlight._visible = false;
GridHolder[_local4].Tile.gotoAndStop(_local9[1]);
var _local2 = 0;
while (_local2 < Mechs.length) {
if ((Mechs[_local2].x == _local3) && (Mechs[_local2].y == _local5)) {
_local4 = "Unit_" + Mechs[_local2].ID;
var _local7 = (_local3 - _local5) * Game.tileW;
var _local6 = ((_local3 + _local5) * Game.tileW) / 2;
_local8 = (((_local6 - ((Game.tileW - Mechs[_local2].height) / 2)) * 300) + _local7) + 1;
GridHolder.attachMovie("Mech" + Mechs[_local2].unitID, _local4, _local8);
GridHolder[_local4]._x = _local7;
GridHolder[_local4]._y = _local6;
GridHolder[_local4].ID = Mechs[_local2].ID;
GridHolder[_local4].Health.HP = Mechs[_local2].HP;
GridHolder[_local4].Health.MaxHP = Mechs[_local2].MaxHP;
GridHolder[_local4].Owner.gotoAndStop(Mechs[_local2].Owner + 1);
showAnimation(Mechs[_local2], null, "STAND");
}
_local2++;
}
_local3++;
}
_local5++;
}
Game.unitSelected = -1;
doRotation();
};
_global.doRotation = function () {
closeMenu("CONTROLS/ACTIONS");
Rotation();
};
_global.Rotation = function () {
do {
Game.unitSelected = Game.unitSelected + 1;
if (Game.unitSelected == Mechs.length) {
Game.unitSelected = 0;
}
var unit = Mechs[Game.unitSelected];
} while (unit.HP <= 0);
Game.selectedX = undefined;
Game.selectedY = undefined;
unit.Attack = 0;
Game.team[unit.Owner].path = undefined;
Game.team[unit.Owner].i = 0;
Game.disableMove = false;
if (unit.Owner == 1) {
switch (Game.difficulty) {
case 1 :
break;
case 2 :
unit.HP = unit.HP + (Math.floor((Math.random() * 20) - 5) + 5);
break;
case 3 :
unit.HP = unit.HP + (Math.floor((Math.random() * 100) - 80) + 80);
}
if (unit.HP >= unit.MaxHP) {
unit.HP = unit.MaxHP;
}
}
if (unit.Mode == "BLOCK") {
if (unit.Owner == 0) {
unit.EP = unit.EP + (Math.floor((Math.random() * 20) - 10) + 10);
} else {
switch (Game.difficulty) {
case 1 :
unit.EP = unit.EP + (Math.floor((Math.random() * 20) - 10) + 10);
break;
case 2 :
unit.EP = unit.EP + (Math.floor((Math.random() * 40) - 20) + 20);
break;
case 3 :
unit.EP = unit.EP + (Math.floor((Math.random() * 75) - 32) + 32);
}
}
} else if (unit.Owner == 0) {
if ((Math.random() * 100) <= 15) {
unit.EP = unit.EP + (Math.floor((Math.random() * 32) - 10) + 10);
} else {
unit.EP = unit.EP + (Math.floor((Math.random() * 10) - 5) + 5);
}
} else {
switch (Game.difficulty) {
case 1 :
var _local8 = 10;
break;
case 2 :
_local8 = 45;
break;
case 3 :
_local8 = 75;
}
if ((Math.random() * 100) <= _local8) {
switch (Game.difficulty) {
case 1 :
unit.EP = unit.EP + (Math.floor((Math.random() * 32) - 10) + 10);
break;
case 2 :
unit.EP = unit.EP + (Math.floor((Math.random() * 32) - 15) + 15);
break;
case 3 :
unit.EP = unit.EP + (Math.floor((Math.random() * 75) - 32) + 32);
}
} else {
unit.EP = unit.EP + (Math.floor((Math.random() * 10) - 5) + 5);
}
}
if (unit.EP > 100) {
unit.EP = 100;
}
if (unit.Mode == "BLOCK") {
unit.Mode = "STAND";
GridHolder["Unit_" + unit.ID].Mech.play();
}
if ((unit.Owner == 0) && (unit.HP > 0)) {
openMenu("CONTROLS");
} else if ((unit.Owner == 1) && (unit.HP > 0)) {
var _local7;
if ((((hitUnit(unit.y + 1, unit.x) || (_root["HitMask" + Game.zone][unit.y + 1][unit.x] == 1)) && (hitUnit(unit.y - 1, unit.x) || (_root["HitMask" + Game.zone][unit.y - 1][unit.x] == 1))) && (hitUnit(unit.y, unit.x + 1) || (_root["HitMask" + Game.zone][unit.y][unit.x + 1] == 1))) && (hitUnit(unit.y, unit.x - 1) || (_root["HitMask" + Game.zone][unit.y][unit.x - 1] == 1))) {
if (hitUnit(unit.y + 1, unit.x, "ENEMY")) {
Game.selectedY = unit.y + 1;
Game.selectedX = unit.x;
} else if (hitUnit(unit.y - 1, unit.x, "ENEMY")) {
Game.selectedY = unit.y - 1;
Game.selectedX = unit.x;
} else if (hitUnit(unit.y, unit.x + 1, "ENEMY")) {
Game.selectedY = unit.y;
Game.selectedX = unit.x + 1;
} else if (hitUnit(unit.y, unit.x - 1, "ENEMY")) {
Game.selectedY = unit.y;
Game.selectedX = unit.x - 1;
}
if ((Game.selectedY != undefined) && (Game.selectedX != undefined)) {
CPU_getAttack(unit);
} else {
unit.Mode = "BLOCK";
showAnimation(unit, null, "B");
doRotation();
}
} else if (CPU_hitUnit(unit)) {
CPU_getAttack(unit);
} else {
if (_local7 == undefined) {
_local7 = CPU_findUnit(unit);
}
if (_local7 != undefined) {
CPU_pathToUnit(unit, Mechs[_local7].x, Mechs[_local7].y);
if ((_root["HitMask" + Game.zone][Game.selectedY][Game.selectedX] == 1) || (hitUnit(Game.selectedY, Game.selectedX))) {
Game.team[1].path = null;
unit.Mode = "BLOCK";
showAnimation(unit, null, "B");
doRotation();
} else {
Game.team[1].path = findPath(_root["HitMask" + Game.zone], Game.selectedX, Game.selectedY, unit.x, unit.y);
unit.Mode = "MOVE";
}
}
}
}
var _local3 = 0;
var _local6 = 0;
var _local5 = 0;
var _local4 = 0;
var _local2 = 0;
while (_local2 < Mechs.length) {
if (Mechs[_local2].Owner == 1) {
_local3++;
if (Mechs[_local2].HP <= 0) {
_local6++;
}
} else {
_local5++;
if (Mechs[_local2].HP <= 0) {
_local4++;
}
}
_local2++;
}
if (_local3 == _local6) {
gotoAndPlay ("Profiles");
} else if (_local5 == _local4) {
gotoAndPlay ("Gameover");
}
};
_global.Targeting = function (type) {
var _local1 = 0;
while (_local1 < Mechs.length) {
if (type == "OFF") {
GridHolder["Unit_" + Mechs[_local1].ID].TargetMech._visible = false;
} else if (type == "ON") {
GridHolder["Unit_" + Mechs[_local1].ID].TargetMech._visible = true;
}
_local1++;
}
};
_global.openMenu = function (type) {
var _local3 = Mechs[Game.unitSelected].x;
var _local2 = Mechs[Game.unitSelected].y;
var _local6 = (_local3 - _local2) * Game.tileW;
var _local4 = ((_local3 + _local2) * Game.tileW) / 2;
if (type == "CONTROLS") {
var _local1 = "Controls";
var _local5 = 150000 /* 0x0249F0 */;
GridHolder.attachMovie("Controls", _local1, _local5);
if (Game.disableMove) {
GridHolder[_local1].gotoAndStop(4);
}
} else if (type == "ACTIONS") {
var _local1 = "ActionList";
var _local5 = 150100 /* 0x024A54 */;
GridHolder.attachMovie("ActionList", _local1, _local5);
}
GridHolder[_local1]._alpha = 0;
GridHolder[_local1]._x = _local6 + 45;
GridHolder[_local1]._y = _local4 + 5;
GridHolder[_local1].unit = Mechs[Game.unitSelected];
};
_global.closeMenu = function (type) {
if (type == "CONTROLS") {
GridHolder.Controls.removeMovieClip();
} else if (type == "ACTIONS") {
GridHolder.ActionList.removeMovieClip();
} else if (type == "CONTROLS/ACTIONS") {
GridHolder.Controls.removeMovieClip();
GridHolder.ActionList.removeMovieClip();
}
};
_global.showEffect = function (hit_unit, attack) {
var _local11 = Mechs[Game.unitSelected];
var _local5 = 80;
var _local7 = false;
if (attack == "DEAD") {
var _local8 = "Explosion2";
} else {
switch (_local11.unitID) {
case 0 :
if (attack == "A1") {
var _local8 = "Bullets";
} else if (attack == "A2") {
var _local8 = "Explosion1";
} else if (attack == "A3") {
_local5 = 0;
_local7 = true;
var _local8 = "Shockwave";
}
break;
case 1 :
if ((attack == "A1") || (attack == "A2")) {
var _local8 = "Bullets";
} else if (attack == "A3") {
var _local8 = "Laser1";
}
break;
case 2 :
if (!((attack == "A1") || (attack == "A3"))) {
break;
}
var _local8 = "Slashes";
}
}
var _local9 = (hit_unit.x - hit_unit.y) * Game.tileW;
var _local6 = ((hit_unit.x + hit_unit.y) * Game.tileW) / 2;
var _local10 = (((_local6 - (Game.tileW - ((_local5 + Game.effect) / 2))) * 300) + _local9) + 1;
var _local4 = "Effect_" + Game.effect;
GridHolder.attachMovie(_local8, _local4, _local10);
GridHolder[_local4]._x = _local9;
GridHolder[_local4]._y = _local6;
Game.effect++;
if (((_local7 && (_root["HitMask" + Game.zone][hit_unit.y + 1][hit_unit.x + 1] != 1)) && (_root["HitMask" + Game.zone][hit_unit.y + 1][hit_unit.x] != 1)) && (_root["HitMask" + Game.zone][hit_unit.y][hit_unit.x + 1] != 1)) {
_local9 = ((hit_unit.x + 1) - (hit_unit.y + 1)) * Game.tileW;
_local6 = (((hit_unit.x + 1) + (hit_unit.y + 1)) * Game.tileW) / 2;
_local10 = (((_local6 - (Game.tileW - ((_local5 + Game.effect) / 2))) * 300) + _local9) + 1;
_local4 = "Effect_" + Game.effect;
GridHolder.attachMovie(_local8, _local4, _local10);
GridHolder[_local4]._x = _local9;
GridHolder[_local4]._y = _local6;
}
if (Game.effect >= 200) {
Game.effect = 100;
} else {
Game.effect++;
}
};
_global.showAnimation = function (unit, facing, type) {
var _local1 = "Unit_" + unit.ID;
if ((unit.Direction != facing) || (facing == null)) {
if (facing != null) {
unit.Direction = facing;
}
switch (unit.Direction) {
case 1 :
if (type == "MOVE") {
GridHolder[_local1].Mech.gotoAndPlay("D-R");
GridHolder[_local1].Mech.Walk.play();
} else if (type == "STAND") {
GridHolder[_local1].Mech.gotoAndStop("D-R");
GridHolder[_local1].Mech.Walk.gotoAndStop(1);
} else if (type == "A1") {
GridHolder[_local1].Mech.gotoAndPlay("A1-D-R");
} else if (type == "A2") {
GridHolder[_local1].Mech.gotoAndPlay("A2-D-R");
} else if (type == "A3") {
GridHolder[_local1].Mech.gotoAndPlay("A3-D-R");
} else if (type == "B") {
GridHolder[_local1].Mech.gotoAndPlay("B-D-R");
}
break;
case 2 :
if (type == "MOVE") {
GridHolder[_local1].Mech.gotoAndPlay("D-L");
GridHolder[_local1].Mech.Walk.play();
} else if (type == "STAND") {
GridHolder[_local1].Mech.gotoAndStop("D-L");
GridHolder[_local1].Mech.Walk.gotoAndStop(1);
} else if (type == "A1") {
GridHolder[_local1].Mech.gotoAndPlay("A1-D-L");
} else if (type == "A2") {
GridHolder[_local1].Mech.gotoAndPlay("A2-D-L");
} else if (type == "A3") {
GridHolder[_local1].Mech.gotoAndPlay("A3-D-L");
} else if (type == "B") {
GridHolder[_local1].Mech.gotoAndPlay("B-D-L");
}
break;
case 3 :
if (type == "MOVE") {
GridHolder[_local1].Mech.gotoAndPlay("U-L");
GridHolder[_local1].Mech.Walk.play();
} else if (type == "STAND") {
GridHolder[_local1].Mech.gotoAndStop("U-L");
GridHolder[_local1].Mech.Walk.gotoAndStop(1);
} else if (type == "A1") {
GridHolder[_local1].Mech.gotoAndPlay("A1-U-L");
} else if (type == "A2") {
GridHolder[_local1].Mech.gotoAndPlay("A2-U-L");
} else if (type == "A3") {
GridHolder[_local1].Mech.gotoAndPlay("A3-U-L");
} else if (type == "B") {
GridHolder[_local1].Mech.gotoAndPlay("B-U-L");
}
break;
case 4 :
if (type == "MOVE") {
GridHolder[_local1].Mech.gotoAndPlay("U-R");
GridHolder[_local1].Mech.Walk.play();
} else if (type == "STAND") {
GridHolder[_local1].Mech.gotoAndStop("U-R");
GridHolder[_local1].Mech.Walk.gotoAndStop(1);
} else if (type == "A1") {
GridHolder[_local1].Mech.gotoAndPlay("A1-U-R");
} else if (type == "A2") {
GridHolder[_local1].Mech.gotoAndPlay("A2-U-R");
} else if (type == "A3") {
GridHolder[_local1].Mech.gotoAndPlay("A3-U-R");
} else {
if (type != "B") {
break;
}
GridHolder[_local1].Mech.gotoAndPlay("B-U-R");
}
}
}
};
_global.showArea = function (type, unit) {
if (type == "MOVE") {
var _local6 = "0x00CC00";
}
if (type == "ATTACK") {
var _local6 = "0xCC0000";
}
var _local3 = 0;
while (_local3 < _root["HitMask" + Game.zone].length) {
var _local4 = 0;
while (_local4 < _root["HitMask" + Game.zone][0].length) {
GridHolder[(("Tile_" + _local4) + "_") + _local3].Highlight.TileColor._alpha = 65;
tileColor = new Color(GridHolder[(("Tile_" + _local4) + "_") + _local3].Highlight.TileColor);
tileColor.setRGB(_local6);
if (type == null) {
GridHolder[(("Tile_" + _local4) + "_") + _local3].Highlight._visible = false;
} else if (type == "MOVE") {
if ((((_local3 >= (unit.y - unit.viewY)) && (_local3 <= (unit.y + unit.viewY))) && (_local4 >= (unit.x - unit.viewX))) && (_local4 <= (unit.x + unit.viewX))) {
if ((!hitUnit(_local3, _local4)) && (_root["HitMask" + Game.zone][_local3][_local4] != 1)) {
if ((unit.y == _local3) && (unit.x == _local4)) {
} else {
GridHolder[(("Tile_" + _local4) + "_") + _local3].Highlight._visible = true;
}
}
}
}
_local4++;
}
_local3++;
}
if (type == "ATTACK") {
switch (unit.unitID) {
case 2 :
var _local9 = false;
break;
default :
var _local9 = true;
}
if (_local9) {
var _local8 = unit.viewX + Math.ceil(unit.viewX / 2);
var _local7 = unit.viewX + Math.ceil(unit.viewX / 2);
} else {
var _local8 = 2;
var _local7 = 2;
}
var _local4 = unit.x + 1;
while (_local4 < (unit.x + _local8)) {
if ((_root["HitMask" + Game.zone][unit.y][_local4] == 0) && (!hitUnit(unit.y, _local4, "TEAM"))) {
GridHolder[(("Tile_" + _local4) + "_") + unit.y].Highlight._visible = true;
} else {
break;
}
_local4++;
}
_local4 = unit.x - 1;
while (_local4 > (unit.x - _local8)) {
if ((_root["HitMask" + Game.zone][unit.y][_local4] == 0) && (!hitUnit(unit.y, _local4, "TEAM"))) {
GridHolder[(("Tile_" + _local4) + "_") + unit.y].Highlight._visible = true;
} else {
break;
}
_local4--;
}
_local3 = unit.y + 1;
while (_local3 < (unit.y + _local7)) {
if ((_root["HitMask" + Game.zone][_local3][unit.x] == 0) && (!hitUnit(_local3, unit.x, "TEAM"))) {
GridHolder[(("Tile_" + unit.x) + "_") + _local3].Highlight._visible = true;
} else {
break;
}
_local3++;
}
_local3 = unit.y - 1;
while (_local3 > (unit.y - _local7)) {
if ((_root["HitMask" + Game.zone][_local3][unit.x] == 0) && (!hitUnit(_local3, unit.x, "TEAM"))) {
GridHolder[(("Tile_" + unit.x) + "_") + _local3].Highlight._visible = true;
} else {
break;
}
_local3--;
}
}
};
_global.hitUnit = function (y, x, type) {
var _local3 = Mechs[Game.unitSelected];
var _local1 = 0;
while (_local1 < Mechs.length) {
if ((((Mechs[_local1].y == y) && (Mechs[_local1].x == x)) && (Mechs[_local1].HP > 0)) && (Mechs[_local1].ID != Game.unitSelected)) {
if (type == undefined) {
return(true);
}
if (type == "ENEMY") {
if (Mechs[_local1].Owner != _local3.Owner) {
return(true);
}
} else if (type == "TEAM") {
if (Mechs[_local1].Owner == _local3.Owner) {
return(true);
}
}
}
_local1++;
}
return(false);
};
_global.undoMove = function () {
if ((Game.oldX != undefined) && (Game.oldY != undefined)) {
Mechs[Game.unitSelected].x = Game.oldX;
Mechs[Game.unitSelected].y = Game.oldY;
var _local1 = Mechs[Game.unitSelected];
var _local3 = "Unit_" + _local1.ID;
var _local4 = (_local1.x - _local1.y) * Game.tileW;
var _local2 = ((_local1.x + _local1.y) * Game.tileW) / 2;
GridHolder[_local3]._x = _local4;
GridHolder[_local3]._y = _local2;
var _local5 = (((_local2 - ((Game.tileW - _local1.height) / 2)) * 300) + _local4) + 1;
GridHolder[_local3].swapDepths(_local5);
Game.oldX = undefined;
Game.oldY = undefined;
Game.selectedX = undefined;
Game.selectedY = undefined;
Game.team[_local1.Owner].path = undefined;
Game.team[_local1.Owner].i = 0;
Game.disableMove = false;
GridHolder.Controls._x = _local4 + 45;
GridHolder.Controls._y = _local2 + 5;
}
};
_global.moveUnit = function (unit) {
if (((unit.nextx == null) || (unit.x == unit.nextx)) && ((unit.nexty == null) || (unit.y == unit.nexty))) {
unit.nextx = Game.team[unit.Owner].path[Game.team[unit.Owner].i][1];
unit.nexty = Game.team[unit.Owner].path[Game.team[unit.Owner].i][0];
if (Game.team[unit.Owner].i <= Game.team[unit.Owner].path.length) {
Game.team[unit.Owner].i++;
} else {
Game.selectedX = undefined;
Game.selectedY = undefined;
unit.Mode = "STAND";
showAnimation(unit, null, "STAND");
if (unit.Owner == 1) {
CPU_getAttack(unit);
} else {
Game.disableMove = true;
openMenu("CONTROLS");
}
}
} else {
var _local2 = "Unit_" + unit.ID;
GridHolder[_local2].Mech.Walk.play();
if (unit.x > unit.nextx) {
showAnimation(unit, 3, "MOVE");
unit.x = unit.x - unit.speed;
} else if (unit.x < unit.nextx) {
showAnimation(unit, 1, "MOVE");
unit.x = unit.x + unit.speed;
} else if (unit.y > unit.nexty) {
showAnimation(unit, 4, "MOVE");
unit.y = unit.y - unit.speed;
} else if (unit.y < unit.nexty) {
showAnimation(unit, 2, "MOVE");
unit.y = unit.y + unit.speed;
}
var _local4 = (unit.x - unit.y) * Game.tileW;
var _local3 = ((unit.x + unit.y) * Game.tileW) / 2;
GridHolder[_local2]._x = _local4;
GridHolder[_local2]._y = _local3;
var _local5 = (((_local3 - ((Game.tileW - unit.height) / 2)) * 300) + _local4) + 1;
GridHolder[_local2].swapDepths(_local5);
}
};
_global.getTarget = function () {
var _local2 = Mechs[Game.unitSelected];
if (_root["HitMask" + Game.zone][Game.selectedY][Game.selectedX] == 0) {
Game.team[0].path = findPath(_root["HitMask" + Game.zone], Game.selectedX, Game.selectedY, _local2.x, _local2.y);
if (Game.team[0].path != null) {
_local2.Mode = "MOVE";
} else {
doRotation();
}
}
};
_global.findPath = function (map, startX, startY, endX, endY) {
function hitUnit(y, x) {
var _local2 = false;
var _local1 = 0;
while (_local1 < Mechs.length) {
if ((((Mechs[_local1].y == y) && (Mechs[_local1].x == x)) && (Mechs[_local1].HP > 0)) && (Mechs[_local1].ID != Game.unitSelected)) {
_local2 = true;
break;
}
_local1++;
}
return(_local2);
}
var _local18 = 10;
var _local12 = 14;
var _local16 = false;
var _local15 = false;
isOpen = function (y, x) {
return(mapStatus[y][x].open);
};
isClosed = function (y, x) {
return(mapStatus[y][x].closed);
};
nearerSquare = function () {
var _local4 = 999999 /* 0x0F423F */;
var _local5 = 0;
var _local2;
var _local3;
var _local1 = openList.length;
while ((_local1--) > 0) {
_local3 = mapStatus[openList[_local1][0]][openList[_local1][1]];
_local2 = _local3.heuristic + _local3.movementCost;
if (_local2 <= _local4) {
_local4 = _local2;
_local5 = _local1;
}
}
return(_local5);
};
closeSquare = function (y, x) {
var _local2 = openList.length;
var _local1 = 0;
while (_local1 < _local2) {
if (openList[_local1][0] == y) {
if (openList[_local1][1] == x) {
openList.splice(_local1, 1);
break;
}
}
_local1++;
}
mapStatus[y][x].open = false;
mapStatus[y][x].closed = true;
};
openSquare = function (y, x, parent, movementCost, heuristic, replacing) {
if (!replacing) {
openList.push([y, x]);
mapStatus[y][x] = {heuristic:heuristic, open:true, closed:false};
}
mapStatus[y][x].parent = parent;
mapStatus[y][x].movementCost = movementCost;
};
var _local10 = map.length;
var _local17 = map[0].length;
var mapStatus = new Array();
var _local11 = 0;
while (_local11 < _local10) {
mapStatus[_local11] = new Array();
_local11++;
}
if ((startY == undefined) || (startX == undefined)) {
return(null);
}
if ((endY == undefined) || (endX == undefined)) {
return(null);
}
var openList = new Array();
openSquare(startY, startX, undefined, 0);
while ((openList.length > 0) && (!isClosed(endY, endX))) {
_local11 = nearerSquare();
var _local6 = openList[_local11][0];
var _local7 = openList[_local11][1];
closeSquare(_local6, _local7);
var _local2 = _local6 - 1;
while (_local2 < (_local6 + 2)) {
var _local1 = _local7 - 1;
while (_local1 < (_local7 + 2)) {
if (((((((_local2 >= 0) && (_local2 < _local10)) && (_local1 >= 0)) && (_local1 < _local17)) && (!((_local2 == _local6) && (_local1 == _local7)))) && ((_local16 || (_local2 == _local6)) || (_local1 == _local7))) && (((_local15 || (_local2 == _local6)) || (_local1 == _local7)) || ((map[_local2][_local7] != 0) && (map[_local6][_local1])))) {
if ((map[_local2][_local1] != 1) && (!hitUnit(_local2, _local1))) {
if (!isClosed(_local2, _local1)) {
var _local3 = mapStatus[_local6][_local7].movementCost + ((((_local2 == _local6) || (_local1 == _local7)) ? (_local18) : (_local12)) * map[_local2][_local1]);
if (isOpen(_local2, _local1)) {
if (_local3 < mapStatus[_local2][_local1].movementCost) {
openSquare(_local2, _local1, [_local6, _local7], _local3, undefined, true);
}
} else {
var _local5 = (Math.abs(_local2 - endY) + Math.abs(_local1 - endX)) * 10;
openSquare(_local2, _local1, [_local6, _local7], _local3, _local5, false);
}
}
}
}
_local1++;
}
_local2++;
}
}
var _local28 = isClosed(endY, endX);
delete isOpen;
delete isClosed;
delete nearerSquare;
delete closeSquare;
delete openSquare;
delete hitUnit;
if (_local28) {
var _local22 = new Array();
var _local6 = endY;
var _local7 = endX;
while ((_local6 != startY) || (_local7 != startX)) {
_local22.push([_local6, _local7]);
var _local19 = mapStatus[_local6][_local7].parent[0];
var _local20 = mapStatus[_local6][_local7].parent[1];
_local6 = _local19;
_local7 = _local20;
}
_local22.push([startY, startX]);
return(_local22);
}
return(null);
};
_global.updateHistory = function (string) {
History[0] = History[1];
History[1] = History[2];
History[2] = string;
testVar = "";
var _local1 = 0;
while (_local1 < History.length) {
testVar = testVar + History[_local1];
_local1++;
}
};
_global.Upgrade = function (type, mechID) {
if (type == "ARMOR") {
var _local2 = (Mechs[mechID].AP + 1) * 100;
if (Game.Platinum >= _local2) {
Mechs[mechID].AP++;
Game.Platinum = Game.Platinum - _local2;
}
} else if (type == "GENERATOR") {
var _local2 = ((Mechs[mechID].GEN * 100) + 1) * 100;
if (Game.Platinum >= _local2) {
Mechs[mechID].GEN = Mechs[mechID].GEN + 0.01;
Game.Platinum = Game.Platinum - _local2;
}
} else if (type == "WEAPONS") {
var _local2 = ((Mechs[mechID].WPN * 100) + 1) * 100;
if (Game.Platinum >= _local2) {
Mechs[mechID].WPN = Mechs[mechID].WPN + 0.01;
Game.Platinum = Game.Platinum - _local2;
}
}
if (type != undefined) {
Profiles("UPDATE");
}
};
_global.Profiles = function (type) {
if (type == "CREATE") {
var slot = 0;
var i = 0;
while (i < Mechs.length) {
if (Mechs[i].Owner == 0) {
attachMovie("Upgrade", "Upgrade" + i, 200000 + i);
eval ("Upgrade" + i)._x = 20;
eval ("Upgrade" + i)._y = 15 + (slot * 128);
eval ("Upgrade" + i).ID = i;
eval ("Upgrade" + i).Icon.gotoAndStop(Mechs[i].unitID + 1);
switch (Mechs[i].unitID) {
case 0 :
eval ("Upgrade" + i).Name = "<b>Shockbeast</b>";
break;
case 1 :
eval ("Upgrade" + i).Name = "<b>Razormetal</b>";
break;
case 2 :
eval ("Upgrade" + i).Name = "<b>Bloodchain</b>";
}
var level = 1;
var XP_toLevel = 0;
var x = 100;
while (x < 10000) {
XP_toLevel = XP_toLevel + (level * 100);
if (Mechs[i].XP >= XP_toLevel) {
level++;
}
x = x + 100;
}
eval ("Upgrade" + i).Name = eval ("Upgrade" + i).Name + ((((" - Level " + level) + " (") + Mechs[i].Kills) + " Kills)");
slot++;
}
i++;
}
type = "UPDATE";
}
if (type == "UPDATE") {
var i = 0;
while (i < Mechs.length) {
if (Mechs[i].Owner == 0) {
eval ("Upgrade" + i).Armor = Mechs[i].AP;
eval ("Upgrade" + i).Generator = (Mechs[i].GEN * 100) + "% Efficient";
eval ("Upgrade" + i).Weapons = (Mechs[i].WPN * 100) + "% Efficient";
eval ("Upgrade" + i).Armor_Upgrade = "$" + ((Mechs[i].AP + 1) * 100);
if (Mechs[i].GEN >= 0.95) {
eval ("Upgrade" + i).Generator_Upgrade = "";
} else {
eval ("Upgrade" + i).Generator_Upgrade = "$" + (((Mechs[i].GEN * 100) + 1) * 100);
}
if (Mechs[i].WPN >= 1) {
eval ("Upgrade" + i).Weapons_Upgrade = "";
} else {
eval ("Upgrade" + i).Weapons_Upgrade = "$" + (((Mechs[i].WPN * 100) + 1) * 100);
}
if (Game.Platinum >= ((Mechs[i].AP + 1) * 100)) {
eval ("Upgrade" + i).B1._visible = true;
} else {
eval ("Upgrade" + i).B1._visible = false;
}
if (Mechs[i].GEN >= 0.95) {
eval ("Upgrade" + i).B2._visible = false;
} else if (Game.Platinum >= (((Mechs[i].GEN * 100) + 1) * 100)) {
eval ("Upgrade" + i).B2._visible = true;
} else {
eval ("Upgrade" + i).B2._visible = false;
}
if (Mechs[i].WPN >= 1) {
eval ("Upgrade" + i).B3._visible = false;
} else if (Game.Platinum >= (((Mechs[i].WPN * 100) + 1) * 100)) {
eval ("Upgrade" + i).B3._visible = true;
} else {
eval ("Upgrade" + i).B3._visible = false;
}
}
i++;
}
Rank = "Optimus";
Platinum = "$" + Game.Platinum;
}
};
_global.Work = function () {
var _local1 = Mechs[Game.unitSelected];
switch (_local1.Mode) {
case "ATTACK" :
Attack(_local1);
break;
case "MOVE" :
moveUnit(_local1);
}
if (GridHolder.Controls._alpha < 100) {
GridHolder.Controls._alpha = GridHolder.Controls._alpha + 20;
}
if (GridHolder.ActionList._alpha < 100) {
GridHolder.ActionList._alpha = GridHolder.ActionList._alpha + 20;
}
if ((Info._alpha >= 0) && (Info._alpha < 100)) {
Info._alpha = Info._alpha + 20;
}
if ((Mechs[Game.unitSelected].Mode == "MOVE") || (Mechs[Game.unitSelected].Mode == "ATTACK")) {
Targeting("OFF");
} else {
Targeting("ON");
}
switch (Mechs[Game.targetID].unitID) {
case 0 :
Info.Name = ("<b>Team " + (Mechs[Game.targetID].Owner + 1)) + "</b> - Shockbeast";
break;
case 1 :
Info.Name = ("<b>Team " + (Mechs[Game.targetID].Owner + 1)) + "</b> - Razormetal";
break;
case 2 :
Info.Name = ("<b>Team " + (Mechs[Game.targetID].Owner + 1)) + "</b> - Bloodchain";
}
Info.Status1 = (Mechs[Game.targetID].HP + "/") + Mechs[Game.targetID].MaxHP;
Info.Status2 = Mechs[Game.targetID].EP + "%";
Info.Health.Bar._xscale = (Mechs[Game.targetID].HP / Mechs[Game.targetID].MaxHP) * 100;
Info.Energy.Bar._xscale = (Mechs[Game.targetID].EP / 100) * 100;
};
Instance of Symbol 1208 MovieClip "GridHolder" in Frame 22
onClipEvent (enterFrame) {
Work();
}
Frame 23
buildMap();
stop();
Frame 24
Profiles("CREATE");
stop();
Frame 25
stop();
Symbol 40 Button
on (release) {
_root.Game.oldX = _root.Mechs[_root.Game.unitSelected].x;
_root.Game.oldY = _root.Mechs[_root.Game.unitSelected].y;
_root.Game.selectedX = _parent.x;
_root.Game.selectedY = _parent.y;
if (_root.Mechs[_root.Game.unitSelected].Mode != "ATTACK") {
getTarget();
}
closeMenu("CONTROLS");
showArea(null, null);
}
Symbol 109 MovieClip Frame 5
if ((random(100) + 1) >= 50) {
_root.Sound_walk_step1.start();
} else {
_root.Sound_walk_step2.start();
}
Symbol 109 MovieClip Frame 16
if ((random(100) + 1) >= 50) {
_root.Sound_walk_step1.start();
} else {
_root.Sound_walk_step2.start();
}
Symbol 131 MovieClip Frame 6
if ((random(100) + 1) >= 50) {
_root.Sound_walk_step1.start();
} else {
_root.Sound_walk_step2.start();
}
Symbol 131 MovieClip Frame 16
if ((random(100) + 1) >= 50) {
_root.Sound_walk_step1.start();
} else {
_root.Sound_walk_step2.start();
}
Symbol 154 MovieClip Frame 1
_root.Sound_arm_movement3.start();
Symbol 154 MovieClip Frame 7
_root.Sound_machine_gun.start();
Symbol 177 MovieClip Frame 1
_root.Sound_arm_movement3.start();
Symbol 177 MovieClip Frame 8
_root.Sound_machine_gun.start();
Symbol 199 MovieClip Frame 1
_root.Sound_arm_movement2.start();
Symbol 199 MovieClip Frame 10
_root.Sound_rocket_launcher.start();
Symbol 221 MovieClip Frame 1
_root.Sound_arm_movement2.start();
Symbol 221 MovieClip Frame 10
_root.Sound_rocket_launcher.start();
Symbol 259 MovieClip Frame 1
_root.Sound_arm_movement1.start();
Symbol 259 MovieClip Frame 28
_root.Sound_seismic_cannon.start();
Symbol 296 MovieClip Frame 1
_root.Sound_arm_movement1.start();
Symbol 296 MovieClip Frame 28
_root.Sound_seismic_cannon.start();
Symbol 314 MovieClip Frame 12
stop();
Symbol 332 MovieClip Frame 12
stop();
Symbol 333 MovieClip Frame 1
Walk.gotoAndStop(1);
stop();
Symbol 333 MovieClip Frame 10
Walk.gotoAndStop(1);
stop();
Symbol 333 MovieClip Frame 20
Walk.gotoAndStop(1);
stop();
Symbol 333 MovieClip Frame 30
Walk.gotoAndStop(1);
stop();
Symbol 333 MovieClip Frame 61
doRotation();
gotoAndStop ("D-R");
Symbol 333 MovieClip Frame 83
doRotation();
gotoAndStop ("D-L");
Symbol 333 MovieClip Frame 105
doRotation();
gotoAndStop ("U-L");
Symbol 333 MovieClip Frame 127
doRotation();
gotoAndStop ("U-R");
Symbol 333 MovieClip Frame 149
doRotation();
gotoAndStop ("D-R");
Symbol 333 MovieClip Frame 171
doRotation();
gotoAndStop ("D-L");
Symbol 333 MovieClip Frame 193
doRotation();
gotoAndStop ("U-L");
Symbol 333 MovieClip Frame 215
doRotation();
gotoAndStop ("U-R");
Symbol 333 MovieClip Frame 257
doRotation();
gotoAndStop ("D-R");
Symbol 333 MovieClip Frame 299
doRotation();
gotoAndStop ("D-L");
Symbol 333 MovieClip Frame 341
doRotation();
gotoAndStop ("U-L");
Symbol 333 MovieClip Frame 383
doRotation();
gotoAndStop ("U-R");
Symbol 333 MovieClip Frame 395
Block.stop();
stop();
Symbol 333 MovieClip Frame 396
Block.play();
Symbol 333 MovieClip Frame 401
gotoAndStop ("D-R");
Symbol 333 MovieClip Frame 413
Block.stop();
stop();
Symbol 333 MovieClip Frame 414
Block.play();
Symbol 333 MovieClip Frame 419
gotoAndStop ("D-L");
Symbol 333 MovieClip Frame 431
Block.stop();
stop();
Symbol 333 MovieClip Frame 432
Block.play();
Symbol 333 MovieClip Frame 437
gotoAndStop ("U-L");
Symbol 333 MovieClip Frame 449
Block.stop();
stop();
Symbol 333 MovieClip Frame 450
Block.play();
Symbol 333 MovieClip Frame 455
gotoAndStop ("U-R");
Symbol 355 Button
on (rollOver) {
if (_root.Game.targetID != ID) {
_root.Game.targetID = ID;
}
_root.Info._alpha = 0;
_root.Info._visible = true;
}
on (rollOut) {
_root.Info._visible = false;
}
Symbol 370 Button
on (release) {
doRotation();
}
on (rollOver) {
Status = "WAIT";
}
on (rollOut) {
Status = "";
}
Symbol 375 Button
on (release) {
openMenu("ACTIONS");
gotoAndStop (3);
}
on (rollOver) {
Status = "ACTION";
}
on (rollOut) {
Status = "";
}
Symbol 380 Button
on (release) {
showArea("MOVE", unit);
gotoAndStop (2);
}
on (rollOver) {
Status = "MOVE";
}
on (rollOut) {
Status = "";
}
Symbol 386 MovieClip Frame 25
if ((random(100) + 1) >= 95) {
gotoAndPlay (1);
} else {
gotoAndPlay(_currentframe - 1);
}
Symbol 392 Button
on (release) {
if (unit.Mode == "ATTACK") {
unit.Mode = "STAND";
unit.Attack = 0;
openMenu("ACTIONS");
gotoAndStop (3);
}
showArea(null, null);
if (_root.Game.disableMove) {
gotoAndStop (4);
} else {
gotoAndStop (1);
}
}
on (rollOver) {
Status = "UNDO";
}
on (rollOut) {
Status = "";
}
Symbol 393 Button
on (release) {
undoMove();
gotoAndPlay (1);
}
on (rollOver) {
Status = "UNDO";
}
on (rollOut) {
Status = "";
}
Symbol 394 MovieClip [Controls] Frame 1
Status = "";
stop();
Symbol 394 MovieClip [Controls] Frame 2
Status = "";
stop();
Symbol 394 MovieClip [Controls] Frame 3
Status = "";
stop();
Symbol 394 MovieClip [Controls] Frame 4
Status = "";
stop();
Symbol 399 Button
on (release) {
unit.Mode = "BLOCK";
showAnimation(unit, null, "B");
doRotation();
}
Symbol 404 Button
on (release) {
showArea("ATTACK", unit);
unit.Mode = "ATTACK";
unit.Attack = 3;
_root.GridHolder.Controls.gotoAndStop(2);
closeMenu("ACTIONS");
}
Symbol 405 Button
on (release) {
unit.Mode = "ATTACK";
unit.Attack = 2;
showArea("ATTACK", unit);
_root.GridHolder.Controls.gotoAndStop(2);
closeMenu("ACTIONS");
}
Symbol 407 Button
on (release) {
showArea("ATTACK", unit);
unit.Mode = "ATTACK";
unit.Attack = 1;
_root.GridHolder.Controls.gotoAndStop(2);
closeMenu("ACTIONS");
}
Symbol 411 Button
on (release) {
if (_root.Game.disableMove) {
_root.GridHolder.Controls.gotoAndStop(4);
} else {
_root.GridHolder.Controls.gotoAndStop(1);
}
closeMenu("ACTIONS");
}
Symbol 413 MovieClip [ActionList] Frame 1
A1 = _root.Attacks[_root.Mechs[_root.Game.unitSelected].unitID].A1;
A2 = _root.Attacks[_root.Mechs[_root.Game.unitSelected].unitID].A2;
A3 = _root.Attacks[_root.Mechs[_root.Game.unitSelected].unitID].A3;
if (_root.Mechs[_root.Game.unitSelected].EP < 5) {
button1._visible = false;
}
if (_root.Mechs[_root.Game.unitSelected].EP < 10) {
button2._visible = false;
}
if (_root.Mechs[_root.Game.unitSelected].EP < 32) {
button3._visible = false;
}
Symbol 423 MovieClip [Bullets] Frame 16
this.removeMovieClip();
Symbol 432 MovieClip [Explosion1] Frame 15
_root.Sound_object_explode.start();
Symbol 432 MovieClip [Explosion1] Frame 23
this.removeMovieClip();
Symbol 458 MovieClip [Explosion2] Frame 1
_root.Sound_mech_explode.start();
Symbol 458 MovieClip [Explosion2] Frame 27
this.removeMovieClip();
Symbol 483 MovieClip [Shockwave] Frame 28
_root.Sound_shockwave.start();
Symbol 483 MovieClip [Shockwave] Frame 51
if (this._alpha > 0) {
this._alpha = this._alpha - 2;
gotoAndPlay(_currentframe - 1);
} else {
this.removeMovieClip();
}
Symbol 516 MovieClip Frame 2
if ((random(100) + 1) >= 50) {
_root.Sound_walk_hover1.start();
} else {
_root.Sound_walk_hover2.start();
}
Symbol 546 MovieClip Frame 2
if ((random(100) + 1) >= 50) {
_root.Sound_walk_hover1.start();
} else {
_root.Sound_walk_hover2.start();
}
Symbol 572 MovieClip Frame 1
_root.Sound_arm_movement2.start();
Symbol 572 MovieClip Frame 9
_root.Sound_gatling_gun.start();
Symbol 598 MovieClip Frame 1
_root.Sound_arm_movement2.start();
Symbol 598 MovieClip Frame 9
_root.Sound_gatling_gun.start();
Symbol 639 MovieClip Frame 1
_root.Sound_arm_movement3.start();
Symbol 639 MovieClip Frame 11
_root.Sound_gatling_gun.start();
Symbol 639 MovieClip Frame 16
_root.Sound_arm_movement3.start();
Symbol 639 MovieClip Frame 25
_root.Sound_gatling_gun.start();
Symbol 680 MovieClip Frame 1
_root.Sound_arm_movement3.start();
Symbol 680 MovieClip Frame 11
_root.Sound_gatling_gun.start();
Symbol 680 MovieClip Frame 16
_root.Sound_arm_movement3.start();
Symbol 680 MovieClip Frame 25
_root.Sound_gatling_gun.start();
Symbol 722 MovieClip Frame 2
_root.Sound_arm_movement2.start();
Symbol 764 MovieClip Frame 2
_root.Sound_arm_movement2.start();
Symbol 782 MovieClip Frame 11
stop();
Symbol 800 MovieClip Frame 11
stop();
Symbol 801 MovieClip Frame 1
Walk.gotoAndStop(1);
stop();
Symbol 801 MovieClip Frame 10
Walk.gotoAndStop(1);
stop();
Symbol 801 MovieClip Frame 20
Walk.gotoAndStop(1);
stop();
Symbol 801 MovieClip Frame 30
Walk.gotoAndStop(1);
stop();
Symbol 801 MovieClip Frame 64
doRotation();
gotoAndStop ("D-R");
Symbol 801 MovieClip Frame 89
doRotation();
gotoAndStop ("D-L");
Symbol 801 MovieClip Frame 114
doRotation();
gotoAndStop ("U-L");
Symbol 801 MovieClip Frame 139
doRotation();
gotoAndStop ("U-R");
Symbol 801 MovieClip Frame 179
doRotation();
gotoAndStop ("D-R");
Symbol 801 MovieClip Frame 219
doRotation();
gotoAndStop ("D-L");
Symbol 801 MovieClip Frame 259
doRotation();
gotoAndStop ("U-L");
Symbol 801 MovieClip Frame 299
doRotation();
gotoAndStop ("U-R");
Symbol 801 MovieClip Frame 341
doRotation();
gotoAndStop ("D-R");
Symbol 801 MovieClip Frame 382
doRotation();
gotoAndStop ("D-L");
Symbol 801 MovieClip Frame 423
doRotation();
gotoAndStop ("U-L");
Symbol 801 MovieClip Frame 464
doRotation();
gotoAndStop ("U-R");
Symbol 801 MovieClip Frame 475
Block.stop();
stop();
Symbol 801 MovieClip Frame 476
Block.play();
Symbol 801 MovieClip Frame 482
gotoAndStop ("D-R");
Symbol 801 MovieClip Frame 493
Block.stop();
stop();
Symbol 801 MovieClip Frame 494
Block.play();
Symbol 801 MovieClip Frame 500
gotoAndStop ("D-L");
Symbol 801 MovieClip Frame 511
Block.stop();
stop();
Symbol 801 MovieClip Frame 512
Block.play();
Symbol 801 MovieClip Frame 518
gotoAndStop ("U-L");
Symbol 801 MovieClip Frame 529
Block.stop();
stop();
Symbol 801 MovieClip Frame 530
Block.play();
Symbol 801 MovieClip Frame 536
gotoAndStop ("U-R");
Symbol 840 MovieClip [Laser1] Frame 1
_root.Sound_metal_stinger.start();
Symbol 840 MovieClip [Laser1] Frame 40
this.removeMovieClip();
Symbol 860 MovieClip Frame 6
if ((random(100) + 1) >= 50) {
_root.Sound_walk_step1.start();
} else {
_root.Sound_walk_step2.start();
}
Symbol 860 MovieClip Frame 14
if ((random(100) + 1) >= 50) {
_root.Sound_walk_step1.start();
} else {
_root.Sound_walk_step2.start();
}
Symbol 876 MovieClip Frame 6
if ((random(100) + 1) >= 50) {
_root.Sound_walk_step1.start();
} else {
_root.Sound_walk_step2.start();
}
Symbol 876 MovieClip Frame 14
if ((random(100) + 1) >= 50) {
_root.Sound_walk_step1.start();
} else {
_root.Sound_walk_step2.start();
}
Symbol 929 MovieClip Frame 2
_root.Sound_powerdrain.start();
Symbol 966 MovieClip Frame 2
_root.Sound_powerdrain.start();
Symbol 1018 MovieClip Frame 3
_root.Sound_bladesaw.start();
Symbol 1070 MovieClip Frame 3
_root.Sound_bladesaw.start();
Symbol 1088 MovieClip Frame 11
stop();
Symbol 1106 MovieClip Frame 11
stop();
Symbol 1107 MovieClip Frame 1
Walk.gotoAndStop(1);
stop();
Symbol 1107 MovieClip Frame 10
Walk.gotoAndStop(1);
stop();
Symbol 1107 MovieClip Frame 20
Walk.gotoAndStop(1);
stop();
Symbol 1107 MovieClip Frame 30
Walk.gotoAndStop(1);
stop();
Symbol 1107 MovieClip Frame 70
doRotation();
gotoAndStop ("D-R");
Symbol 1107 MovieClip Frame 101
doRotation();
gotoAndStop ("D-L");
Symbol 1107 MovieClip Frame 132
doRotation();
gotoAndStop ("U-L");
Symbol 1107 MovieClip Frame 163
doRotation();
gotoAndStop ("U-R");
Symbol 1107 MovieClip Frame 199
doRotation();
gotoAndStop ("D-R");
Symbol 1107 MovieClip Frame 235
doRotation();
gotoAndStop ("D-L");
Symbol 1107 MovieClip Frame 271
doRotation();
gotoAndStop ("U-L");
Symbol 1107 MovieClip Frame 307
doRotation();
gotoAndStop ("U-R");
Symbol 1107 MovieClip Frame 359
doRotation();
gotoAndStop ("D-R");
Symbol 1107 MovieClip Frame 411
doRotation();
gotoAndStop ("D-L");
Symbol 1107 MovieClip Frame 463
doRotation();
gotoAndStop ("U-L");
Symbol 1107 MovieClip Frame 515
doRotation();
gotoAndStop ("U-R");
Symbol 1107 MovieClip Frame 527
Block.stop();
stop();
Symbol 1107 MovieClip Frame 528
Block.play();
Symbol 1107 MovieClip Frame 533
gotoAndStop ("D-R");
Symbol 1107 MovieClip Frame 545
Block.stop();
stop();
Symbol 1107 MovieClip Frame 546
Block.play();
Symbol 1107 MovieClip Frame 551
gotoAndStop ("D-L");
Symbol 1107 MovieClip Frame 563
Block.stop();
stop();
Symbol 1107 MovieClip Frame 564
Block.play();
Symbol 1107 MovieClip Frame 569
gotoAndStop ("U-L");
Symbol 1107 MovieClip Frame 581
Block.stop();
stop();
Symbol 1107 MovieClip Frame 582
Block.play();
Symbol 1107 MovieClip Frame 587
gotoAndStop ("U-R");
Symbol 1110 MovieClip [Slashes] Frame 1
_root.Sound_slash1.start();
Symbol 1110 MovieClip [Slashes] Frame 3
_root.Sound_slash3.start();
Symbol 1110 MovieClip [Slashes] Frame 5
_root.Sound_slash_hit1.start();
Symbol 1110 MovieClip [Slashes] Frame 8
_root.Sound_slash2.start();
Symbol 1110 MovieClip [Slashes] Frame 10
_root.Sound_slash1.start();
Symbol 1110 MovieClip [Slashes] Frame 12
_root.Sound_slash_hit2.start();
Symbol 1110 MovieClip [Slashes] Frame 13
_root.Sound_slash3.start();
Symbol 1110 MovieClip [Slashes] Frame 15
_root.Sound_slash1.start();
Symbol 1110 MovieClip [Slashes] Frame 17
_root.Sound_slash_hit1.start();
Symbol 1110 MovieClip [Slashes] Frame 20
_root.Sound_slash2.start();
Symbol 1110 MovieClip [Slashes] Frame 22
_root.Sound_slash3.start();
Symbol 1110 MovieClip [Slashes] Frame 24
_root.Sound_slash_hit2.start();
Symbol 1110 MovieClip [Slashes] Frame 31
this.removeMovieClip();
Symbol 1121 Button
on (release) {
Upgrade("WEAPONS", ID);
}
Symbol 1122 Button
on (release) {
Upgrade("GENERATOR", ID);
}
Symbol 1124 Button
on (release) {
Upgrade("ARMOR", ID);
}
Symbol 1145 Button
on (release) {
_root.play();
}
Symbol 1146 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndStop ("loaded");
}
Symbol 1146 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1172 MovieClip Frame 20
gotoAndPlay (7);
Symbol 1175 MovieClip Frame 1
gotoAndPlay(random(58) + 2);
Symbol 1175 MovieClip Frame 59
gotoAndPlay(random(58) + 2);
Symbol 1181 Button
on (release) {
Sound_main_music1.stop("main_music1");
Sound_main_music2.stop("main_music2");
gotoAndPlay ("Start");
}
Symbol 1183 Button
on (release) {
if (Game.difficulty == 3) {
Game.difficulty = 1;
Difficulty = "NORMAL";
} else if (Game.difficulty == 1) {
Game.difficulty = 2;
Difficulty = "HARD";
} else if (Game.difficulty == 2) {
Game.difficulty = 3;
Difficulty = "EXTREMELY HARD";
}
}
Symbol 1211 Button
on (release) {
History[0] = "";
History[1] = "";
History[2] = "";
testVar = "";
if (Game.zone < 6) {
Game.zone++;
}
setPositions();
var i = 0;
while (i < Mechs.length) {
removeMovieClip("Upgrade" + i);
i++;
}
gotoAndPlay ("Game");
}
Symbol 1219 Button
on (release) {
History[0] = "";
History[1] = "";
History[2] = "";
testVar = "";
gotoAndPlay ("Start");
}
Symbol 1281 MovieClip Frame 61
stop();