Frame 1
stop();
fscommand ("allowscale", "false");
fscommand ("showMenu", "false");
Stage.showMenu = false;
onEnterFrame = function () {
_root.bytesLoaded = _root.getBytesLoaded();
_root.bytesTotal = _root.getBytesTotal();
_root.percentLoaded = Math.round(100 * (_root.bytesLoaded / _root.bytesTotal));
_root.percentLoadedText = _root.percentLoaded + "%";
_root.bar.gotoAndStop(percentLoaded);
if (bar._currentframe == 100) {
savefile = SharedObject.getLocal("Commando3");
save = savefile.data;
saveResult = savefile.flush();
if (saveResult) {
gotoAndStop (2);
} else if (saveResult == false) {
gotoAndStop (21);
} else {
savefile.onStatus = function (status) {
if (status.code == "SharedObject.Flush.Failed") {
gotoAndStop (21);
}
if (status.code == "SharedObject.Flush.Success") {
gotoAndStop (2);
}
};
}
onEnterFrame = null;
}
};
Frame 2
function makeBox(x, y, scale, b, drawGrid, colour) {
b.moveTo(x, y);
if (drawGrid) {
b.lineStyle(1, 0, 100);
}
b.beginFill(colour, 100);
b.lineTo(x + scale, y);
b.lineTo(x + scale, y + scale);
b.lineTo(x, y + scale);
b.lineTo(x, y);
b.endFill();
b.col = colour;
}
function loadFlag() {
flagArray = save.flagArray.split(", ", 100000);
iteration = 0;
j = 0;
while (j < ySquares) {
var i = 0;
while (i < xSquares) {
s = squares[(("square_" + i) + "_") + j];
paintColour = parseInt("0x" + flagArray[iteration]);
paint(s);
iteration++;
i++;
}
j++;
}
paintColour = colourFeedback.col;
}
function paint(obj) {
if (obj._parent == squares) {
obj.clear();
if (flagMode == 1) {
makeBox(gridX + (obj.x * globalScale), gridY + (obj.y * globalScale), globalScale, obj, false, paintColour);
} else {
makeBox(gridX + (obj.x * globalScale), gridY + (obj.y * globalScale), globalScale, obj, true, paintColour);
}
} else {
col = new Color(obj);
col.setRGB(paintColour);
obj.col = paintColour;
}
}
function p1RandomTeam() {
team1Units = [false, false, false, false, false, false, false, false, false, false];
prices = [[250, 0], [300, 1], [650, 2], [550, 3], [600, 4], [400, 5], [700, 6], [500, 7], [1000, 8], [800, 9]];
recursions = 10;
campaignGold = 1000 + ((save.level - 1) * 200);
antiAir = false;
var i = 0;
while (i <= recursions) {
if (antiAir) {
priceVar = random(campaignGold);
} else {
antiAir = true;
tempVar = random(3);
if (tempVar == 0) {
priceVar = 300;
} else if (tempVar == 1) {
priceVar = 500;
} else {
priceVar = 600;
}
}
dist = 10000;
unit = null;
element = null;
for (j in prices) {
p = prices[j];
distance = priceVar - p[0];
if (p[0] <= campaignGold) {
if (distance >= 0) {
if (distance < dist) {
dist = distance;
unit = p;
element = j;
}
}
}
}
if (unit != null) {
team1Units[unit[1]] = true;
campaignGold = campaignGold - unit[0];
prices.splice(element, 1);
}
i++;
}
c = false;
for (var i in team1Units) {
if (team1Units[i]) {
c = true;
break;
}
}
if (c == false) {
team1Units = [true, false, true, false, false, false, false, false, false, false];
}
team1PossibleUpgrades = [false, false, false, false, false, false, false, false];
prices = [[500, 0], [700, 1], [800, 2], [500, 3], [500, 4], [1000, 5], [1000, 6], [1000, 7]];
if ((!team1Units[5]) && (!team1Units[6])) {
prices.splice(4, 1);
}
if (((((!team1Units[0]) && (!team1Units[3])) && (!team1Units[4])) && (!team1Units[7])) && (!team1Units[2])) {
prices.splice(3, 1);
}
if (!team1Units[1]) {
prices.splice(2, 1);
}
if (!team1Units[4]) {
prices.splice(1, 1);
}
if (!team1Units[2]) {
prices.splice(0, 1);
}
recursions = 20;
campaignUpgradeGold = 1000 + ((save.level - 1) * 200);
var i = 0;
while (i <= recursions) {
upgradeChoice = null;
upgradeChoice = random(prices.length);
if (upgradeChoice != null) {
if (prices[upgradeChoice[0]] <= campaignUpgradeGold) {
team1PossibleUpgrades[prices[upgradeChoice][1]] = true;
campaignUpgradeGold = campaignUpgradeGold - prices[upgradeChoice][0];
if (prices[upgradeChoice][1] == 0) {
c = true;
for (j in prices) {
p = prices[j];
if (p[1] == 3) {
c = false;
}
}
if (c) {
if (!team1PossibleUpgrades[3]) {
prices.push([500, 3]);
}
}
}
if (prices[upgradeChoice][1] == 1) {
c = true;
for (j in prices) {
p = prices[j];
if (p[1] == 2) {
c = false;
}
}
if (c) {
if (!team1PossibleUpgrades[2]) {
prices.push([800, 2]);
}
}
}
prices.splice(upgradeChoice, 1);
for (j in prices) {
p = prices[j];
if (p[0] > campaignUpgradeGold) {
prices.splice(j, 1);
}
}
}
}
i++;
}
c = false;
for (var i in team1PossibleUpgrades) {
if (team1PossibleUpgrades[i]) {
c = true;
break;
}
}
if (c == false) {
team1PossibleUpgrades = [];
}
team1CanUpgrade = [];
team1CanUpgrade.push(team1PossibleUpgrades[2]);
team1CanUpgrade.push(team1PossibleUpgrades[3]);
team1CanUpgrade.push(team1PossibleUpgrades[4]);
team1CanUpgrade.push(team1PossibleUpgrades[1]);
team1CanUpgrade.push(team1PossibleUpgrades[0]);
nukesOn = team1PossibleUpgrades[5];
habisLasersOn = team1PossibleUpgrades[6];
troopFreezeOn = team1PossibleUpgrades[7];
team1CanUpgrade.splice(5, 3);
}
function p2RandomTeam() {
team2TempUnits = [false, false, false, false, false, false, false, false, false, false];
prices = [[250, 0], [300, 1], [650, 2], [550, 3], [600, 4], [400, 5], [700, 6], [500, 7], [1000, 8], [800, 9]];
recursions = 20;
p2CampaignGold = 1000 + ((save.level - 1) * 200);
antiAir = false;
var i = 0;
while (i <= recursions) {
if (antiAir) {
priceVar = random(p2campaignGold);
} else {
antiAir = true;
tempVar = random(3);
if (tempVar == 0) {
priceVar = 300;
} else if (tempVar == 1) {
priceVar = 500;
} else {
priceVar = 600;
}
}
dist = 10000;
unit = null;
element = null;
for (j in prices) {
p = prices[j];
distance = priceVar - p[0];
if (p[0] <= p2CampaignGold) {
if (distance >= 0) {
if (distance < dist) {
dist = distance;
unit = p;
element = j;
}
}
}
}
if (unit != null) {
team2TempUnits[unit[1]] = true;
p2CampaignGold = p2CampaignGold - unit[0];
prices.splice(element, 1);
}
i++;
}
c = false;
for (var i in team2TempUnits) {
if (team2TempUnits[i]) {
c = true;
break;
}
}
if (c == false) {
team2TempUnits = team1Units;
}
team2PossibleUpgrades = [false, false, false, false, false, false, false, false];
prices = [[700, 0], [800, 1], [500, 2], [500, 3], [1000, 4], [1000, 5], [1000, 6]];
if ((!team2Units[5]) && (!team2Units[6])) {
prices.splice(4, 1);
}
if (((((!team2Units[0]) && (!team2Units[3])) && (!team2Units[4])) && (!team2Units[7])) && (!team2Units[2])) {
prices.splice(3, 1);
}
if (!team2Units[1]) {
prices.splice(2, 1);
}
if (!team2Units[4]) {
prices.splice(1, 1);
}
if (!team2Units[2]) {
prices.splice(0, 1);
}
recursions = 10;
p2campaignUpgradeGold = 1000 + ((save.level - 1) * 200);
var i = 0;
while (i <= recursions) {
upgradeChoice = null;
upgradeChoice = random(prices.length);
if (upgradeChoice != null) {
if (prices[upgradeChoice[0]] <= p2campaignUpgradeGold) {
team2PossibleUpgrades[prices[upgradeChoice][1]] = true;
p2campaignUpgradeGold = p2campaignUpgradeGold - prices[upgradeChoice][0];
if (prices[upgradeChoice][1] == 0) {
c = true;
for (j in prices) {
p = prices[j];
if (p[1] == 3) {
c = false;
}
}
if (c) {
if (!team2PossibleUpgrades[3]) {
prices.push([500, 3]);
}
}
}
if (prices[upgradeChoice][1] == 1) {
c = true;
for (j in prices) {
p = prices[j];
if (p[1] == 2) {
c = false;
}
}
if (c) {
if (!team2PossibleUpgrades[2]) {
prices.push([800, 2]);
}
}
}
prices.splice(upgradeChoice, 1);
for (j in prices) {
p = prices[j];
if (p[0] > p2campaignUpgradeGold) {
prices.splice(j, 1);
}
}
}
}
i++;
}
c = false;
for (var i in team2PossibleUpgrades) {
if (team2PossibleUpgrades[i]) {
c = true;
break;
}
}
if (c == false) {
team2PossibleUpgrades = team1CanUpgrade;
}
team2CanUpgrade = [];
team2CanUpgrade.push(team2PossibleUpgrades[2]);
team2CanUpgrade.push(team2PossibleUpgrades[3]);
team2CanUpgrade.push(team2PossibleUpgrades[4]);
team2CanUpgrade.push(team2PossibleUpgrades[1]);
team2CanUpgrade.push(team2PossibleUpgrades[0]);
p2nukesOn = team2PossibleUpgrades[5];
p2habisLasersOn = team2PossibleUpgrades[6];
p2troopFreezeOn = team2PossibleUpgrades[7];
team2CanUpgrade.splice(5, 3);
}
if (save.team1Units == undefined) {
save.team1Units = "0,0,0,0,0,0,0,0,0,0";
}
if (save.team2Units == undefined) {
save.team2Units = "0,0,0,0,0,0,0,0,0,0";
}
if (save.team1UpgradeChoices == undefined) {
save.team1UpgradeChoices = "0,0,0,0,0,0,0,0";
}
if (save.team2UpgradeChoices == undefined) {
save.team2UpgradeChoices = "0,0,0,0,0,0,0,0";
}
if (save.p1poplimit == undefined) {
save.p1poplimit = 10;
}
if (save.p2poplimit == undefined) {
save.p2poplimit = 10;
}
if (save.team1Budget == undefined) {
save.team1Budget = 2500;
}
if (save.team2Budget == undefined) {
save.team2Budget = 2500;
}
if (save.gameMode == undefined) {
save.gameMode = "classic";
}
if (save.matchVariable == undefined) {
save.matchVariable = 3;
}
if (save.optionsFrame == undefined) {
save.optionsFrame = 1;
}
if (save.cashBounty == undefined) {
save.cashBounty = false;
}
if (save.bountyQuantity == undefined) {
save.bountyQuantity = 3;
}
if (save.level == undefined) {
level = 1;
save.level = level;
savefile.flush();
} else {
level = save.level;
}
if (save.musicVolume == undefined) {
save.musicVolume = 50;
}
if (save.soundFXVolume == undefined) {
save.soundFXVolume = 50;
}
if (save.voiceVolume == undefined) {
save.voiceVolume = 50;
}
if (save.quality == undefined) {
save.quality = "HIGH";
}
Frame 3
function attachMouse() {
removeMovieClip(cursor);
MacUser = System.capabilities.os.indexOf("Mac") == "0";
cursorName = "cursor" + (MacUser ? "1" : "2");
attachMovie(cursorName, cursorName, 1000000, {_x:_xmouse, _y:_ymouse});
Mouse.hide();
}
quickMatch = false;
z = 0;
_quality = "HIGH";
attachMouse();
campaignMode = false;
_root[cursorName].onEnterFrame = function () {
Mouse.hide();
this._x = _xmouse;
this._y = _ymouse;
};
playButton.onRollOver = (playButton.onDragOver = (creditsButton.onRollOver = (creditsButton.onDragOver = (howToPlayButton.onRollOver = (howToPlayButton.onDragOver = (settingsButton.onRollOver = (settingsButton.onDragOver = (quickMatchButton.onRollOver = (quickMatchButton.onDragOver = (logoButton.onRollOver = (logoButton.onDragOver = (backButton.onRollOver = (backButton.onDragOver = (bugButton.onRollOver = (bugButton.onDragOver = (campaignModeButton.onRollOver = (campaignModeButton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})))))))))))))))));
playButton.onRollOut = (playButton.onDragOut = (creditsButton.onRollOut = (creditsButton.onDragOut = (howToPlayButton.onRollOut = (howToPlayButton.onDragOut = (settingsButton.onRollOut = (settingsButton.onDragOut = (quickMatchButton.onRollOut = (quickMatchButton.onDragOut = (logoButton.onRollOut = (logoButton.onDragOut = (backButton.onRollOut = (backButton.onDragOut = (bugButton.onRollOut = (bugButton.onDragOut = (campaignModeButton.onRollOut = (campaignModeButton.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
})))))))))))))))));
playButton.onRelease = function () {
gotoAndStop (10);
};
creditsButton.onRelease = function () {
gotoAndStop (28);
};
bugButton.onRelease = function () {
gotoAndStop (8);
};
campaignModeButton.onRelease = function () {
gotoAndStop (11);
campaignMode = true;
};
logoButton.onRelease = function () {
getURL ("http://www.armorgames.com", "_blank");
};
howToPlayButton.onRelease = function () {
gotoAndStop (23);
};
quickmatchButton.onRelease = function () {
gM = random(5);
if (gM == 1) {
gameMode = "deathmatch";
matchVariable = 2 + (random(9) * 2);
} else if (gM == 2) {
gameMode = "kingofthehill";
matchVariable = 1 + random(5);
} else if (gM == 3) {
gameMode = "capturetheflag";
matchVariable = 1 + random(5);
} else if (gM == 4) {
gameMode = "powerball";
matchVariable = 1 + random(5);
} else {
gameMode = "classic";
matchVariable = 1 + random(5);
}
quickMatch = true;
p1RandomTeam();
cB = random(2);
cashBounty = cB == 0;
if (cashBounty) {
bountyQuantity = 1 + random(5);
}
enemyChooseMode = 1;
playerChooseMode = 2;
gotoAndStop (9);
};
settingsButton.onRelease = function () {
gotoAndStop (20);
};
Frame 4
function changeQuality() {
if (_quality == "HIGH") {
qualityChangeText.gotoAndStop(3);
qualityChangeText.timer = 30;
qualityChangeText._alpha = 100;
_quality = ((save.quality = "MEDIUM"));
qualityChangeText.onEnterFrame = function () {
this.timer--;
if (this.timer <= 0) {
this._alpha = this._alpha - 10;
if (this._alpha <= 0) {
this.gotoAndStop(1);
this.onEnterFrame = null;
}
}
};
} else if (_quality == "MEDIUM") {
qualityChangeText.gotoAndStop(4);
qualityChangeText.timer = 30;
qualityChangeText._alpha = 100;
_quality = ((save.quality = "LOW"));
qualityChangeText.onEnterFrame = function () {
this.timer--;
if (this.timer <= 0) {
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
this.gotoAndStop(1);
this.onEnterFrame = null;
}
}
};
} else if (_quality == "LOW") {
qualityChangeText.gotoAndStop(2);
qualityChangeText.timer = 30;
this._alpha = 100;
_quality = ((save.quality = "HIGH"));
qualityChangeText.onEnterFrame = function () {
this.timer--;
if (this.timer <= 0) {
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
this.gotoAndStop(1);
this.onEnterFrame = null;
}
}
};
}
}
function stopAllMovies(instance) {
instance.stop();
for (var n in instance) {
if (typeof(instance[n]) == "movieclip") {
arguments.callee(instance[n]);
}
}
}
function startAllMovies(instance) {
instance.play();
for (var n in instance) {
if (typeof(instance[n]) == "movieclip") {
arguments.callee(instance[n]);
}
}
}
function selectAll() {
for (var i in p1) {
p1[i].aura.gotoAndStop(3);
}
for (var i in p1Vehicles) {
p1Vehicles[i].aura.gotoAndStop(3);
}
for (var i in p1Helis) {
p1Helis[i].aura.gotoAndStop(3);
}
reFocus();
}
function noShiftDeselect() {
if (!Key.isDown(16)) {
for (var j in p1) {
p = p1[j];
p.aura.gotoAndStop(1);
}
for (var j in p1Vehicles) {
p = p1Vehicles[j];
p.aura.gotoAndStop(1);
}
for (var j in p1Helis) {
p = p1Helis[j];
p.aura.gotoAndStop(1);
}
}
}
function deathmatchHPDeduct(p) {
if (gameMode == "deathmatch") {
damage = p.maxHP * (matchVariable / 10);
if (((p._parent._name == "p2") || (p._parent._name == "p2Vehicles")) || (p._parent._name == "p2Helis")) {
p2currentHPUnrounded = p2currentHPUnrounded - damage;
} else {
currentHPUnrounded = currentHPUnrounded - damage;
}
}
if (cashBounty) {
if (((p._parent._name == "p2") || (p._parent._name == "p2Vehicles")) || (p._parent._name == "p2Helis")) {
c = cashBounties.attachMovie("cashBountyText", "cashBountyText" + z, z++, {_x:p._x, _y:p._y});
c.bounty = Math.round(p.unitValue * (bountyQuantity / 10));
goldDecimal = goldDecimal - (-c.bounty);
c.onEnterFrame = function () {
this._y = this._y - 2;
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
this.onEnterFrame = null;
removeMovieClip(this);
}
};
goldDecimal = Math.min(goldDecimal, startingGold);
} else {
c = cashBounties.attachMovie("p2cashBountyText", "p2cashBountyText" + z, z++, {_x:p._x, _y:p._y});
c.bounty = Math.round(p.unitValue * (bountyQuantity / 10));
p2GoldDecimal = p2GoldDecimal - (-c.bounty);
c.onEnterFrame = function () {
this._y = this._y - 2;
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
this.onEnterFrame = null;
removeMovieClip(this);
}
};
p2GoldDecimal = Math.min(p2GoldDecimal, p2StartingGold);
}
}
}
function reFocus(noSound) {
b = [];
for (var k in p1) {
q = p1[k];
if (q.aura._currentframe == 3) {
b.push(q);
}
}
for (var k in p1Vehicles) {
q = p1Vehicles[k];
if (q.aura._currentframe == 3) {
b.push(q);
}
}
for (var k in p1Helis) {
q = p1Helis[k];
if (q.aura._currentframe == 3) {
b.push(q);
}
}
if (b.length <= 0) {
return(undefined);
}
c = false;
for (var i in b) {
q = b[i];
if (!c) {
minX = q._x;
minY = q._y;
maxX = q._x;
maxY = q._y;
c = true;
} else {
if (q._x < minX) {
minX = q._x;
}
if (q._y < minY) {
minY = q._y;
}
if (q._x > maxX) {
maxX = q._x;
}
if (q._y > maxY) {
maxY = q._y;
}
}
}
d = 100000 /* 0x0186A0 */;
xdist = maxX - minX;
ydist = maxY - minY;
middle = {x:minX + (xdist / 2), y:minY + (ydist / 2)};
focusedUnit = null;
for (var i in p1) {
q = p1[i];
if (q.aura._currentframe == 3) {
var xdist = (middle.x - q._x);
var ydist = (middle.y - q._y);
var dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < d) {
d = dist;
focusedUnit = q;
}
}
}
for (var i in p1Vehicles) {
q = p1Vehicles[i];
if (q.aura._currentframe == 3) {
var xdist = (middle.x - q._x);
var ydist = (middle.y - q._y);
var dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < d) {
d = dist;
focusedUnit = q;
}
}
}
for (var i in p1Helis) {
q = p1Helis[i];
if (q.aura._currentframe == 3) {
var xdist = (middle.x - q._x);
var ydist = (middle.y - q._y);
var dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < d) {
d = dist;
focusedUnit = q;
}
}
}
if (!noSound) {
if (focusSound) {
if (focusedUnit.unit != undefined) {
voices["mySound" + channels] = new Sound(voices);
voices["mySound" + channels].attachSound("LInfS" + (random(2) + 1));
voices["mySound" + channels].start();
voices["mySound" + channels].setVolume(save.voiceVolume);
channels++;
}
focusSound = false;
}
}
changeHUDSelectFrame();
}
function outOfMoney() {
playSoundFX("populationBeep");
HUD.moneyPointer.timer = 30;
HUD.moneyPointer.onEnterFrame = function () {
this.timer--;
if (this.timer <= 0) {
if (this._alpha > 0) {
this._alpha = this._alpha - 10;
} else if (this._alpha == 0) {
this.onEnterFrame = null;
}
} else if (this._alpha < 100) {
this._alpha = this._alpha - -10;
}
};
}
function outOfPop() {
playSoundFX("populationBeep");
HUD.populationPointer.timer = 30;
HUD.populationPointer.onEnterFrame = function () {
this.timer--;
if (this.timer <= 0) {
if (this._alpha > 0) {
this._alpha = this._alpha - 10;
} else if (this._alpha == 0) {
this.onEnterFrame = null;
}
} else if (this._alpha < 100) {
this._alpha = this._alpha - -10;
}
};
}
function screenShake(force) {
n = createEmptyMovieClip("shaker" + z, z++);
n.i = force;
n.j = force;
n.onEnterFrame = function () {
shakeX = ((-this.i) / 2) + (Math.random() * this.i);
shakeY = ((-this.j) / 2) + (Math.random() * this.j);
this.j--;
this.i--;
if (this.i == 0) {
shakeX = 0;
shakeY = 0;
this.onEnterFrame = null;
removeMovieClip(this);
}
};
}
function changeHUDSelectFrame() {
if (focusedUnit != undefined) {
if (focusedUnit.unit == "lInf") {
HUD.bIcon.gotoAndStop(9);
} else if (focusedUnit.unit == "RPG") {
HUD.bIcon.gotoAndStop(10);
} else if (focusedUnit.unit == "hTank") {
HUD.bIcon.gotoAndStop(11);
} else if (focusedUnit.unit == "gTank") {
HUD.bIcon.gotoAndStop(12);
} else if (focusedUnit.unit == "comanche") {
HUD.bIcon.gotoAndStop(13);
} else if (focusedUnit.unit == "lTroop") {
HUD.bIcon.gotoAndStop(14);
} else if (focusedUnit.unit == "lTank") {
HUD.bIcon.gotoAndStop(15);
} else if (focusedUnit.unit == "sniper") {
HUD.bIcon.gotoAndStop(16);
} else if (focusedUnit.unit == "helix") {
HUD.bIcon.gotoAndStop(17);
} else if (focusedUnit.unit == "ambulance") {
HUD.bIcon.gotoAndStop(18);
}
}
}
function launchNuke(team) {
if (team == 1) {
nukes.attachMovie("nuke", "nuke" + z, z++, {_x:319, _y:200});
} else {
n = nukes.attachMovie("nuke", "nuke" + z, z++, {_xscale:-100, _x:280, _y:200});
n._x = n._x - -45;
}
}
function useTroopFreeze(team) {
if (team == 1) {
if (troopFreezeOn) {
troopFreezeClicked = 1;
_root[cursorName].troopFreezeCursor._visible = true;
troopFreezeRing._visible = true;
troopFreeze.onMouseDown = function () {
if (troopFreezePercent >= 1) {
if ((!Key.isDown(17)) && (!HUD.hitTest(_xmouse, _ymouse, true))) {
troopFreezeClicked = 1;
troopFreeze.onMouseUp = function () {
_root[cursorName].troopFreezeCursor._visible = false;
troopFreezeRing._visible = false;
troopFreezePercent = 0;
t = freezeCandy.attachMovie("freezeCircle", "freezeCircle" + z, z++, {_x:_xmouse, _y:_ymouse});
t.a = [];
for (var i in p2) {
p = p2[i];
xdist = p._x - t._x;
ydist = p._y - t._y;
distance = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (distance <= 200) {
t.a.push(p);
}
}
for (var i in p2Vehicles) {
p = p2Vehicles[i];
xdist = p._x - t._x;
ydist = p._y - t._y;
distance = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (distance <= 200) {
t.a.push(p);
if (p.unit == "ambulance") {
removeMovieClip(p.pulse);
}
}
}
for (var i in p2Helis) {
p = p2Helis[i];
xdist = p._x - t._x;
ydist = p._y - t._y;
distance = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (distance <= 200) {
t.a.push(p);
}
}
t.onEnterFrame = function () {
for (var i in this.a) {
p = this.a[i];
this.t = {rb:-255, gb:-255, bb:-255};
this.tColor = new Color(p);
this.tColor.setTransform(this.t);
p.frozen = true;
}
};
t.onUnload = function () {
for (var i in this.a) {
p = this.a[i];
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(p);
this.tColor.setTransform(this.t);
p.frozen = false;
if (p.unit == "ambulance") {
c = p1ambulancePulses.attachMovie("ambulancePulse", p._name + "_ambulancePulse", z++, {targ:p, _x:p._x, _y:p._y});
c.onEnterFrame = function () {
this._x = this.targ._x;
this._y = this.targ._y;
if (this.targ.HP < 0) {
removeMovieClip(this);
}
};
p.pulse = c;
}
}
};
troopFreeze.onMouseUp = null;
troopFreezeClicked = 0;
};
} else {
_root[cursorName].troopFreezeCursor._visible = false;
troopFreezeRing._visible = false;
troopFreezeClicked = 0;
}
troopFreeze.onMouseDown = null;
}
};
}
} else {
b = [];
for (var i in p1) {
p = p1[i];
if (p.HP > 0) {
if (!p.frozen) {
b.push(p);
}
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
if (p.HP > 0) {
if (!p.frozen) {
b.push(p);
}
}
}
for (var i in p1Helis) {
p = p1Helis[i];
if (p.HP > 0) {
if (!p.frozen) {
b.push(p);
}
}
}
if (b.length > 0) {
choice = b[random(b.length)];
p2troopFreezePercent = 0;
rangle = random(360) * degToRad;
rdist = 20 + random(180);
tempvar1 = Math.sin(rangle);
tempvar2 = Math.cos(rangle);
t = freezeCandy.attachMovie("freezeCircle", "freezeCircle" + z, z++, {_x:Math.max(0, Math.min(1280, (rdist * tempvar1) + choice._x)), _y:Math.max(0, Math.min(489, (rdist * tempvar2) + choice._y))});
t.a = [];
for (var i in p1) {
p = p1[i];
xdist = p._x - t._x;
ydist = p._y - t._y;
distance = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (distance <= 200) {
t.a.push(p);
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
xdist = p._x - t._x;
ydist = p._y - t._y;
distance = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (distance <= 200) {
t.a.push(p);
if (p.unit == "ambulance") {
removeMovieClip(p.pulse);
}
}
}
for (var i in p1Helis) {
p = p1Helis[i];
xdist = p._x - t._x;
ydist = p._y - t._y;
distance = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (distance <= 200) {
t.a.push(p);
}
}
t.onEnterFrame = function () {
for (var i in this.a) {
p = this.a[i];
this.t = {rb:-255, gb:-255, bb:-255};
this.tColor = new Color(p);
this.tColor.setTransform(this.t);
p.frozen = true;
}
};
t.onUnload = function () {
for (var i in this.a) {
p = this.a[i];
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(p);
this.tColor.setTransform(this.t);
p.frozen = false;
if (p.unit == "ambulance") {
c = p1ambulancePulses.attachMovie("ambulancePulse", p._name + "_ambulancePulse", z++, {targ:p});
c.onEnterFrame = function () {
this._x = this.targ._x;
this._y = this.targ._y;
if (this.targ.HP < 0) {
removeMovieClip(this);
}
};
p.pulse = c;
}
}
};
}
}
}
function fireHabisLaser(team) {
if (team == 1) {
_root[cursorName].superPowerCursor._visible = true;
habisLasers.onMouseDown = function () {
if (habisLaserPercent >= 1) {
if ((!Key.isDown(17)) && (!HUD.hitTest(_xmouse, _ymouse, true))) {
laserClicked = 1;
laserCoords = {x:_xmouse, y:_ymouse};
createEmptyMovieClip("laserGuideArrow", z++);
laserGuideArrow.lineStyle(4, 16711680, 100);
laserGuideArrow.lineTo(0, -40);
laserGuideArrow.lineTo(-7, -33);
laserGuideArrow.moveTo(0, -40);
laserGuideArrow.lineTo(7, -33);
laserGuideArrow._x = _xmouse;
laserGuideArrow._y = _ymouse;
habisLasers.onMouseUp = function () {
if (habisLaserPercent >= 1) {
habisLasers.onMouseUp = null;
habisLaserPercent = 0;
laserClicked = 0;
habisFlash.alpha = 100;
habisFlash.onEnterFrame = function () {
this.alpha = this.alpha - 5;
this.clear();
if (this.alpha <= 0) {
this.onEnterFrame = null;
} else {
this.beginFill(16777215, this.alpha);
this.moveTo(-50, -50);
this.lineTo(1380, -50);
this.lineTo(1380, 860);
this.lineTo(-50, 860);
this.lineTo(-50, -50);
this.endFill();
}
};
laser = habisLasers.createEmptyMovieClip("habisLaser" + z, z++);
laser.particlesize = 75;
laser.particlesize2 = 150;
laser._x = laserCoords.x + (laser.particlesize / 2);
laser._y = laserCoords.y + (laser.particlesize / 2);
laser.pulse1Temp = 0;
laser.pulse2Temp = 45;
laser.pulse3Temp = 90;
laser.scale = 100;
laser.speed = 2;
laser.xspeed = Math.sin(laserGuideArrow._rotation * degToRad);
laser.yspeed = Math.cos(laserGuideArrow._rotation * degToRad);
laser.gap = (laser.gap2 = 20);
laser.ticker = 250;
laser.onEnterFrame = function () {
this.ticker--;
if (this.ticker <= 0) {
this._alpha = this._alpha - 10;
if (this._alpha <= 0) {
removeMovieClip(this);
}
}
a = [];
for (var i in p1) {
a.push(p1[i]);
}
for (var i in p1Vehicles) {
a.push(p1Vehicles[i]);
}
for (var i in p1Helis) {
a.push(p1Helis[i]);
}
for (var i in p2) {
a.push(p2[i]);
}
for (var i in p2Vehicles) {
a.push(p2Vehicles[i]);
}
for (var i in p2Helis) {
a.push(p2Helis[i]);
}
for (var i in a) {
p = a[i];
if (p.HP > 0) {
xdist = (laser._x - 39) - p._x;
ydist = (laser._y - 39) - p._y;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
distanceRequired = (((p._parent._name == "p1") || (p._parent._name == "p2")) ? 42 : 60);
if (dist <= distanceRequired) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - 1;
p.HP = Math.max(0, p.HP);
}
}
}
this._x = this._x - ((-this.xspeed) * this.speed);
this._y = this._y - (this.yspeed * this.speed);
this.pulse1Temp = this.pulse1Temp + 12;
this.pulse2Temp = this.pulse2Temp + 12;
this.pulse3Temp = this.pulse3Temp + 12;
this.pulse1Sin = Math.sin(this.pulse1Temp * degToRad) * 15;
this.pulse2Sin = Math.sin(this.pulse2Temp * degToRad) * 15;
this.pulse3Sin = Math.sin(this.pulse3Temp * degToRad) * 10;
this.pulse1 = 100 + this.pulse1Sin;
this.pulse2 = 180 + this.pulse2Sin;
this.pulse3 = 235 + this.pulse3Sin;
this.clear();
this.beginGradientFill("radial", [16777215, 16777215, 26367, 26367], [100, 100, 100, 0], [0, this.pulse1, this.pulse2, this.pulse3], {matrixType:"box", x:-this.particlesize, y:-this.particlesize, w:this.particlesize, h:this.particlesize, r:0});
this.curveTo(this.particlesize, 0, this.particlesize, -this.particlesize);
this.curveTo(this.particlesize, -this.particlesize2, 0, -this.particlesize2);
this.curveTo(-this.particlesize, -this.particlesize2, -this.particlesize, -this.particlesize);
this.curveTo(-this.particlesize, this.particlesize, 0, 0);
this.endFill();
particle = habisLaserEyeCandy.createEmptyMovieClip("particle" + z, z++);
particle.particlesize = 20;
particle.particlesize2 = 40;
tempvar1 = Math.sin(random(360) * degToRad);
tempvar2 = Math.cos(random(360) * degToRad);
particle.yspeed = tempvar1 * 5;
particle.xspeed = tempvar2 * 5;
particle._x = this._x - 25;
particle._y = this._y - (25 + (this.yspeed * this.speed));
particle.moveTo(0, 0);
particle.beginGradientFill("radial", [16777215, 26367], [100, 0], [0, 255], {matrixType:"box", x:-particle.particlesize, y:-particle.particlesize, w:particle.particlesize, h:particle.particlesize, r:0});
particle.curveTo(particle.particlesize, 0, particle.particlesize, -particle.particlesize);
particle.curveTo(particle.particlesize, -particle.particlesize2, 0, -particle.particlesize2);
particle.curveTo(-particle.particlesize, -particle.particlesize2, -particle.particlesize, -particle.particlesize);
particle.curveTo(-particle.particlesize, particle.particlesize, 0, 0);
particle.endFill();
this.gap--;
if (this.gap == 0) {
this.gap = this.gap2;
h = habisLaserEyeCandyLow.createEmptyMovieClip("scorch" + z, z++);
h._x = this._x;
h._y = this._y;
h.beginGradientFill("radial", [0, 0], [100, 0], [0, 255], {matrixType:"box", x:-this.particlesize, y:-this.particlesize, w:this.particlesize, h:this.particlesize, r:0});
h.curveTo(this.particlesize, 0, this.particlesize, -this.particlesize);
h.curveTo(this.particlesize, -this.particlesize2, 0, -this.particlesize2);
h.curveTo(-this.particlesize, -this.particlesize2, -this.particlesize, -this.particlesize);
h.curveTo(-this.particlesize, this.particlesize, 0, 0);
h.endFill();
h.onEnterFrame = function () {
this._alpha = this._alpha - 0.2;
if (this._alpha <= 0) {
removeMovieClip(this);
}
};
}
if ((((this._x >= (1280 + this.particlesize)) || (this._y >= (760 + this.particlesize))) || (this._y <= (-this.particlesize))) || (this._x <= (-this.particlesize))) {
this.clear();
this.wait = 20;
this.onEnterFrame = function () {
this.wait--;
if (this.wait <= 0) {
removeMovieClip(this);
}
};
}
};
laserGuideArrow.onEnterFrame = function () {
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
removeMovieClip(this);
}
};
} else {
habisLasers.onMouseUp = null;
}
};
habisLasers.onMouseDown = null;
_root[cursorName].superPowerCursor._visible = false;
} else {
_root[cursorName].superPowerCursor._visible = false;
habisLasers.onMouseDown = null;
habisLasers.onMouseUp = null;
}
}
};
} else {
b = [];
for (var i in p1) {
b.push(p1[i]);
}
for (var i in p1Vehicles) {
b.push(p1Vehicles[i]);
}
for (var i in p1Helis) {
b.push(p1Helis[i]);
}
if (b.length > 0) {
habisFlash.alpha = 100;
habisFlash.onEnterFrame = function () {
this.alpha = this.alpha - 5;
this.clear();
if (this.alpha <= 0) {
this.onEnterFrame = null;
} else {
this.beginFill(16777215, this.alpha);
this.lineTo(1280, 0);
this.lineTo(1280, 760);
this.lineTo(0, 760);
this.lineTo(0, 0);
this.endFill();
}
};
m = b[random(b.length)];
laserCoords = {x:Math.max(70, Math.min((m._x - 100) + (200 * Math.random()), 1210)), y:Math.max(70, Math.min((m._y - 100) + (200 * Math.random()), 710))};
laser = habisLasers.createEmptyMovieClip("habisLaser" + z, z++);
laser.particlesize = 75;
laser.particlesize2 = 150;
laser._x = laserCoords.x + (laser.particlesize / 2);
laser._y = laserCoords.y + (laser.particlesize / 2);
laser.pulse1Temp = 0;
laser.pulse2Temp = 45;
laser.pulse3Temp = 90;
laser.scale = 100;
laser.speed = 2;
angle = random(360);
if (b.length > 1) {
k = random(b.length);
r = b[k];
if (r == m) {
if (b[k + 1]._alpha == undefined) {
r = b[k - 1];
} else {
r = b[k + 1];
}
}
if (r == undefined) {
angle = random(360);
} else {
xdist = laserCoords.x - r._x;
ydist = laserCoords.y - r._y;
angle = (-Math.atan2(xdist, ydist)) * radToDeg;
}
}
laser.xspeed = Math.sin(angle * degToRad);
laser.yspeed = Math.cos(angle * degToRad);
laser.gap = (laser.gap2 = 20);
laser.ticker = 250;
laser.onEnterFrame = function () {
this.ticker--;
if (this.ticker <= 0) {
this._alpha = this._alpha - 10;
if (this._alpha <= 0) {
removeMovieClip(this);
}
}
a = [];
for (var i in p1) {
a.push(p1[i]);
}
for (var i in p1Vehicles) {
a.push(p1Vehicles[i]);
}
for (var i in p1Helis) {
a.push(p1Helis[i]);
}
for (var i in p2) {
a.push(p2[i]);
}
for (var i in p2Vehicles) {
a.push(p2Vehicles[i]);
}
for (var i in p2Helis) {
a.push(p2Helis[i]);
}
for (var i in a) {
p = a[i];
if (p.HP > 0) {
xdist = (laser._x - 39) - p._x;
ydist = (laser._y - 39) - p._y;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
distanceRequired = (((p._parent._name == "p1") || (p._parent._name == "p2")) ? 42 : 60);
if (dist <= distanceRequired) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - 1;
p.HP = Math.max(0, p.HP);
}
}
}
this._x = this._x - ((-this.xspeed) * this.speed);
this._y = this._y - (this.yspeed * this.speed);
this.pulse1Temp = this.pulse1Temp + 12;
this.pulse2Temp = this.pulse2Temp + 12;
this.pulse3Temp = this.pulse3Temp + 12;
this.pulse1Sin = Math.sin(this.pulse1Temp * degToRad) * 15;
this.pulse2Sin = Math.sin(this.pulse2Temp * degToRad) * 15;
this.pulse3Sin = Math.sin(this.pulse3Temp * degToRad) * 10;
this.pulse1 = 100 + this.pulse1Sin;
this.pulse2 = 180 + this.pulse2Sin;
this.pulse3 = 235 + this.pulse3Sin;
this.clear();
this.beginGradientFill("radial", [16777215, 16777215, 26367, 26367], [100, 100, 100, 0], [0, this.pulse1, this.pulse2, this.pulse3], {matrixType:"box", x:-this.particlesize, y:-this.particlesize, w:this.particlesize, h:this.particlesize, r:0});
this.curveTo(this.particlesize, 0, this.particlesize, -this.particlesize);
this.curveTo(this.particlesize, -this.particlesize2, 0, -this.particlesize2);
this.curveTo(-this.particlesize, -this.particlesize2, -this.particlesize, -this.particlesize);
this.curveTo(-this.particlesize, this.particlesize, 0, 0);
this.endFill();
particle = habisLaserEyeCandy.createEmptyMovieClip("particle" + z, z++);
particle.particlesize = 20;
particle.particlesize2 = 40;
tempvar1 = Math.sin(random(360) * degToRad);
tempvar2 = Math.cos(random(360) * degToRad);
particle.yspeed = tempvar1 * 5;
particle.xspeed = tempvar2 * 5;
particle._x = this._x - 25;
particle._y = this._y - (25 + (this.yspeed * this.speed));
particle.moveTo(0, 0);
particle.beginGradientFill("radial", [16777215, 26367], [100, 0], [0, 255], {matrixType:"box", x:-particle.particlesize, y:-particle.particlesize, w:particle.particlesize, h:particle.particlesize, r:0});
particle.curveTo(particle.particlesize, 0, particle.particlesize, -particle.particlesize);
particle.curveTo(particle.particlesize, -particle.particlesize2, 0, -particle.particlesize2);
particle.curveTo(-particle.particlesize, -particle.particlesize2, -particle.particlesize, -particle.particlesize);
particle.curveTo(-particle.particlesize, particle.particlesize, 0, 0);
particle.endFill();
this.gap--;
if (this.gap == 0) {
this.gap = this.gap2;
h = habisLaserEyeCandyLow.createEmptyMovieClip("scorch" + z, z++);
h._x = this._x;
h._y = this._y;
h.beginGradientFill("radial", [0, 0], [100, 0], [0, 255], {matrixType:"box", x:-this.particlesize, y:-this.particlesize, w:this.particlesize, h:this.particlesize, r:0});
h.curveTo(this.particlesize, 0, this.particlesize, -this.particlesize);
h.curveTo(this.particlesize, -this.particlesize2, 0, -this.particlesize2);
h.curveTo(-this.particlesize, -this.particlesize2, -this.particlesize, -this.particlesize);
h.curveTo(-this.particlesize, this.particlesize, 0, 0);
h.endFill();
h.onEnterFrame = function () {
this._alpha = this._alpha - 0.2;
if (this._alpha <= 0) {
removeMovieClip(this);
}
};
}
if (!this.hitTest(theMap)) {
this.clear();
this.wait = 20;
this.onEnterFrame = function () {
this.wait--;
if (this.wait <= 0) {
removeMovieClip(this);
}
};
}
};
p2HabisLaserPercent = 0;
}
}
}
function deselectAll() {
for (var i in p1) {
p1[i].aura.gotoAndStop(1);
}
for (var i in p1Vehicles) {
p1Vehicles[i].aura.gotoAndStop(1);
}
for (var i in p1Helis) {
p1Helis[i].aura.gotoAndStop(1);
}
focusedUnit = null;
HUD.bIcon.gotoAndStop(previousHUD);
}
function OnMouseDown() {
}
function OnMouseUp() {
}
function playSoundFX(soundID) {
soundFX["mySound" + channels] = new Sound(soundFX);
soundFX["mySound" + channels].attachSound(soundID);
soundFX["mySound" + channels].start();
soundFX["mySound" + channels].setVolume(save.soundFXVolume);
channels++;
}
function OnEnterFrame() {
_root[cursorName].shiftCursor._visible = Key.isDown(16);
doubleClickTick--;
if (Key.isDown(65)) {
if (Key.isDown(17)) {
selectAll();
}
}
if (Key.isDown(17)) {
if (Key.isDown(65)) {
selectAll();
}
}
if (Key.isDown(39) || (Key.isDown(68))) {
if (Key.isDown(38) || (Key.isDown(87))) {
xScreenOffset = xScreenOffset - diagonalScrollSpeed;
yScreenOffset = yScreenOffset - (-diagonalScrollSpeed);
} else if (Key.isDown(40) || (Key.isDown(83))) {
xScreenOffset = xScreenOffset - diagonalScrollSpeed;
yScreenOffset = yScreenOffset - diagonalScrollSpeed;
} else {
xScreenOffset = xScreenOffset - scrollSpeed;
}
} else if (Key.isDown(37)) {
if (Key.isDown(38) || (Key.isDown(87))) {
xScreenOffset = xScreenOffset - (-diagonalScrollSpeed);
yScreenOffset = yScreenOffset - (-diagonalScrollSpeed);
} else if (Key.isDown(40) || (Key.isDown(83))) {
xScreenOffset = xScreenOffset - (-diagonalScrollSpeed);
yScreenOffset = yScreenOffset - diagonalScrollSpeed;
} else {
xScreenOffset = xScreenOffset - (-scrollSpeed);
}
} else if (!Key.isDown(17)) {
if (Key.isDown(65)) {
if (Key.isDown(38) || (Key.isDown(87))) {
xScreenOffset = xScreenOffset - (-diagonalScrollSpeed);
yScreenOffset = yScreenOffset - (-diagonalScrollSpeed);
} else if (Key.isDown(40) || (Key.isDown(83))) {
xScreenOffset = xScreenOffset - (-diagonalScrollSpeed);
yScreenOffset = yScreenOffset - diagonalScrollSpeed;
} else {
xScreenOffset = xScreenOffset - (-scrollSpeed);
}
} else if (Key.isDown(38) || (Key.isDown(87))) {
yScreenOffset = yScreenOffset - (-scrollSpeed);
} else if (Key.isDown(40) || (Key.isDown(83))) {
yScreenOffset = yScreenOffset - scrollSpeed;
}
}
s = HUD.minimap.screenHighlight;
if (s.dragging) {
s._x = Math.max(0, Math.min(50, HUD.minimap._xmouse - 12.5));
s._y = Math.max(0, Math.min(30, HUD.minimap._ymouse - 7.5));
xScreenOffset = s._x * -12.8;
yScreenOffset = s._y * -12.8;
}
xScreenOffset = Math.min(xScreenOffset, 0);
xScreenOffset = Math.max(xScreenOffset, -640);
yScreenOffset = Math.min(yScreenOffset, 0);
yScreenOffset = Math.max(yScreenOffset, -378);
_x = (_x - ((-(xScreenOffset - _x)) / 2));
_y = (_y - ((-(yScreenOffset - _y)) / 2));
_x = (_x - (-oldShakeX));
_y = (_y - (-oldShakeY));
_x = (_x - shakeX);
_y = (_y - shakeY);
if (shakeX == 0) {
if (shakeY == 0) {
_x = Math.round(_x);
_y = Math.round(_y);
}
}
oldShakeX = shakeX;
oldShakeY = shakeY;
theMap.lighting._x = ((-_x) - shakeX) + oldShakeX;
theMap.lighting._y = ((-_y) - shakeY) + oldShakeY;
HUD._x = (startBattleText._x = (qualityChangeText._x = theMap.lighting._x));
HUD._y = (startBattleText._y = (qualityChangeText._y = theMap.lighting._y));
startBattleText._x = startBattleText._x - -197;
startBattleText._y = startBattleText._y - -10;
qualityChangeText._x = qualityChangeText._x - -198;
qualityChangeText._y = qualityChangeText._y - -206.5;
_root[cursorName]._x = (troopFreezeRing._x = _xmouse);
_root[cursorName]._y = (troopFreezeRing._y = _ymouse);
s._x = _x / -12.8;
s._y = _y / -12.8;
pulseSize = 200;
healGap--;
if (healGap == 0) {
healGap = healGapInit;
for (var i in p1) {
p = p1[i];
p.healing = false;
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
p.healing = false;
}
for (var i in p1Helis) {
p = p1Helis[i];
p.healing = false;
}
for (var i in p2) {
p = p2[i];
p.healing = false;
}
for (var i in p2Vehicles) {
p = p2Vehicles[i];
p.healing = false;
}
for (var i in p2Helis) {
p = p2Helis[i];
p.healing = false;
}
for (var i in p1ambulancePulses) {
p = p1ambulancePulses[i];
for (j in p1) {
k = p1[j];
xdist = k._x - p._x;
ydist = k._y - p._y;
if (Math.sqrt((xdist * xdist) + (ydist * ydist)) <= pulseSize) {
if (k.HP > 0) {
k.healing = true;
k.HP = k.HP - -0.1;
k.HP = Math.min(k.HP, k.maxHP);
}
}
}
for (j in p1Vehicles) {
k = p1Vehicles[j];
xdist = k._x - p._x;
ydist = k._y - p._y;
if (Math.sqrt((xdist * xdist) + (ydist * ydist)) <= pulseSize) {
if (k.HP > 0) {
k.healing = true;
k.HP = k.HP - -0.1;
k.HP = Math.min(k.HP, k.maxHP);
}
}
}
for (j in p1Helis) {
k = p1Helis[j];
xdist = k._x - p._x;
ydist = k._y - p._y;
if (Math.sqrt((xdist * xdist) + (ydist * ydist)) <= pulseSize) {
if (k.HP > 0) {
k.healing = true;
k.HP = k.HP - -0.1;
k.HP = Math.min(k.HP, k.maxHP);
}
}
}
}
for (var i in p2ambulancePulses) {
p = p2ambulancePulses[i];
for (var j in p2) {
k = p2[j];
xdist = k._x - p._x;
ydist = k._y - p._y;
if (Math.sqrt((xdist * xdist) + (ydist * ydist)) <= pulseSize) {
if (k.HP > 0) {
k.healing = true;
k.HP = k.HP - -0.1;
k.HP = Math.min(k.HP, k.maxHP);
}
}
}
for (j in p2Vehicles) {
k = p2Vehicles[j];
xdist = k._x - p._x;
ydist = k._y - p._y;
if (Math.sqrt((xdist * xdist) + (ydist * ydist)) <= pulseSize) {
if (k.HP > 0) {
k.healing = true;
k.HP = k.HP - -0.1;
k.HP = Math.min(k.HP, k.maxHP);
}
}
}
for (j in p2Helis) {
k = p2Helis[j];
xdist = k._x - p._x;
ydist = k._y - p._y;
if (Math.sqrt((xdist * xdist) + (ydist * ydist)) <= pulseSize) {
if (k.HP > 0) {
k.healing = true;
k.HP = k.HP - -0.1;
k.HP = Math.min(k.HP, k.maxHP);
}
}
}
}
}
if (laserGuideArrow._alpha == 100) {
xdist = laserGuideArrow._x - _xmouse;
ydist = laserGuideArrow._y - _ymouse;
laserGuideArrow._rotation = (-Math.atan2(xdist, ydist)) * radToDeg;
}
for (var i in habisLaserEyeCandy) {
p = habisLaserEyeCandy[i];
p._alpha = p._alpha - 5;
p._y = p._y - (-p.yspeed);
p._x = p._x - (-p.xspeed);
if (p._alpha <= 3) {
removeMovieClip(p);
}
}
habisLaserShakeGap--;
if (habisLaserShakeGap <= 0) {
habisLaserShakeGap = habisLaserShakeGapInit;
habisShakeForce = 0;
for (var i in habisLasers) {
if (typeof(habisLasers[i]) == "movieclip") {
habisShakeForce = habisShakeForce - -2;
}
}
if (habisShakeForce > 0) {
screenShake(habisShakeForce);
}
}
if (enemyCanBuy) {
nukePercent = nukePercent - -0.0005;
p2NukePercent = p2NukePercent - -0.0005;
nukePercent = Math.min(1, nukePercent);
p2NukePercent = Math.min(1, p2NukePercent);
habisLaserPercent = habisLaserPercent - -0.002;
p2habisLaserPercent = p2habisLaserPercent - -0.002;
habisLaserPercent = Math.min(1, habisLaserPercent);
p2habisLaserPercent = Math.min(1, p2habisLaserPercent);
troopFreezePercent = troopFreezePercent - -0.0025;
p2troopFreezePercent = p2troopFreezePercent - -0.0025;
troopFreezePercent = Math.min(1, troopFreezePercent);
p2troopFreezePercent = Math.min(1, p2troopFreezePercent);
}
healthBarWidth = (currentHP / maxHP) * 185;
HUD.healthBar.clear();
HUD.healthBar.lineStyle(1, 65280, 100);
HUD.healthBar.beginFill(65280, 100);
HUD.healthBar.moveTo(0, -4);
HUD.healthBar.lineTo(healthBarWidth, -4);
HUD.healthBar.lineTo(healthBarWidth, 4);
HUD.healthBar.lineTo(0, 4);
HUD.healthBar.lineTo(0, -4);
HUD.healthBar.endFill();
healthBarWidth = (p2currentHP / p2maxHP) * 185;
HUD.p2healthBar.clear();
HUD.p2healthBar.lineStyle(1, 65280, 100);
HUD.p2healthBar.beginFill(65280, 100);
HUD.p2healthBar.moveTo(0, -4);
HUD.p2healthBar.lineTo(healthBarWidth, -4);
HUD.p2healthBar.lineTo(healthBarWidth, 4);
HUD.p2healthBar.lineTo(0, 4);
HUD.p2healthBar.lineTo(0, -4);
HUD.p2healthBar.endFill();
if (enemyCanBuy) {
enemyWait--;
if (enemyWait == 0) {
enemyWait = enemyWaitInit;
enemyBrain();
}
}
selectedUnits = 0;
unitsOnField = 0;
for (var i in p1) {
p = p1[i];
if (typeof(p) == "movieclip") {
if (p.HP > 0) {
unitsOnField++;
}
unitBrain();
if (p.aura._currentframe == 3) {
selectedUnits++;
}
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
if (typeof(p) == "movieclip") {
if (p.HP > 0) {
unitsOnField++;
}
unitBrain();
for (var j in p2) {
q = p2[j];
if (p.hitTest(q._x, q._y, true)) {
q.HP = 0;
}
}
if (p.order == "attack") {
if (p.targ.unit != undefined) {
p.targ.unitx = p.targ.unit._x;
p.targ.unity = p.targ.unit._y;
}
}
if (p.aura._currentframe == 3) {
selectedUnits++;
}
}
}
for (var i in p1Helis) {
p = p1Helis[i];
if (typeof(p) == "movieclip") {
if (p.HP > 0) {
unitsOnField++;
}
unitBrain();
if (p.aura._currentframe == 3) {
selectedUnits++;
}
}
}
if (selectedUnits == 0) {
focusedUnit = null;
HUD.bIcon.gotoAndStop(previousHUD);
}
if (click != null) {
clickEnd = {x:Math.max(0.5, Math.min(1279, _xmouse)), y:Math.max(0.5, Math.min(756, _ymouse))};
var xdist = Math.abs(clickEnd.x - click.x);
var ydist = Math.abs(clickEnd.y - click.y);
cursorLines.clear();
if ((xdist + ydist) > 10) {
cursorLines.lineStyle(1, 16777215, 60);
cursorLines.beginFill(16777215, 25);
cursorLines.moveTo(click.x, click.y);
cursorLines.lineTo(clickEnd.x, click.y);
cursorLines.lineTo(clickEnd.x, clickEnd.y);
cursorLines.lineTo(click.x, clickEnd.y);
cursorLines.lineTo(click.x, click.y);
cursorLines.endFill();
for (var i in p1) {
p = p1[i];
if (cursorLines.hitTest(p._x, p._y, false)) {
p.aura.gotoAndStop(2);
} else if (!Key.isDown(16)) {
p.aura.gotoAndStop(1);
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
if (cursorLines.hitTest(p._x, p._y, false)) {
p.aura.gotoAndStop(2);
} else if (!Key.isDown(16)) {
p.aura.gotoAndStop(1);
}
}
for (var i in p1Helis) {
p = p1Helis[i];
if (cursorLines.hitTest(p._x, p._y, false)) {
p.aura.gotoAndStop(2);
} else if (!Key.isDown(16)) {
p.aura.gotoAndStop(1);
}
}
}
}
if (!Key.isDown(17)) {
if (singleClicking) {
if (click != null) {
var xdist = Math.abs(_xmouse - click.x);
var ydist = Math.abs(_ymouse - click.y);
if ((xdist + ydist) <= 10) {
middle = {x:_xmouse, y:_ymouse};
if (depressedUnit.HP > 0) {
xdist = _xmouse - depressedUnit._x;
ydist = _ymouse - depressedUnit._y;
d = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (d < ((10 * p.aura._xscale) / 100)) {
depressedUnit.aura.gotoAndStop(2);
}
}
} else {
singleClicking = false;
}
}
}
}
p2UnitsOnField = 0;
for (var i in p2) {
p = p2[i];
unitBrain();
if (p.HP > 0) {
p2unitsOnField++;
}
}
for (var i in p2Vehicles) {
p = p2Vehicles[i];
unitBrain();
if (p.HP > 0) {
p2unitsOnField++;
}
for (var j in p1) {
q = p1[j];
if (p.hitTest(q._x, q._y, true)) {
q.HP = 0;
}
}
}
for (var i in p2Helis) {
p = p2Helis[i];
unitBrain();
if (p.HP > 0) {
p2unitsOnField++;
}
}
HUD.minimap.z = 0;
for (var i in HUD.minimap.minimapBlips) {
m = HUD.minimap.minimapBlips[i];
removeMovieClip(m);
}
if (gameMode == "kingofthehill") {
k = HUD.minimap.minimapBlips.attachMovie("kingRing", "kingRing", z++, {_x:640, _y:378});
k._rotation = kingRing._rotation;
}
p1units = 0;
p2units = 0;
for (var i in freezeCandy) {
p = freezeCandy[i];
if (typeof(p) == "movieclip") {
f = HUD.minimap.minimapBlips.attachMovie("freezeCircle", "freezeCircle" + HUD.minimap.z, HUD.minimap.z++, {_x:p._x, _y:p._y});
f.gotoAndStop(p._currentframe);
}
}
for (var i in p1) {
p = p1[i];
if (p.HP > 0) {
p1units++;
if (p.frozen) {
HUD.minimap.minimapBlips.attachMovie("blackCrosshair", "blackCrosshair" + HUD.minimap.z, HUD.minimap.z++, {_x:p._x, _y:p._y, _alpha:(p.HP / p.maxHP) * 100});
} else if (p.aura._currentframe == 3) {
HUD.minimap.minimapBlips.attachMovie("whiteCrosshair", "whiteCrosshair" + HUD.minimap.z, HUD.minimap.z++, {_x:p._x, _y:p._y, _alpha:(p.HP / p.maxHP) * 100});
} else {
HUD.minimap.minimapBlips.attachMovie("greenCrosshair", "greenCrosshair" + HUD.minimap.z, HUD.minimap.z++, {_x:p._x, _y:p._y, _alpha:(p.HP / p.maxHP) * 100});
}
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
if (p.HP > 0) {
p1units++;
if (p.frozen) {
HUD.minimap.minimapBlips.attachMovie("blackCrosshair", "blackCrosshair" + HUD.minimap.z, HUD.minimap.z++, {_x:p._x, _y:p._y, _alpha:(p.HP / p.maxHP) * 100});
} else if (p.aura._currentframe == 3) {
HUD.minimap.minimapBlips.attachMovie("whiteCrosshair", "whiteCrosshair" + HUD.minimap.z, HUD.minimap.z++, {_x:p._x, _y:p._y, _alpha:(p.HP / p.maxHP) * 100});
} else {
HUD.minimap.minimapBlips.attachMovie("greenCrosshair", "greenCrosshair" + HUD.minimap.z, HUD.minimap.z++, {_x:p._x, _y:p._y, _alpha:(p.HP / p.maxHP) * 100});
}
}
}
for (var i in p1Helis) {
p = p1Helis[i];
if (p.HP > 0) {
p1units++;
if (p.frozen) {
HUD.minimap.minimapBlips.attachMovie("blackCrosshair", "blackCrosshair" + HUD.minimap.z, HUD.minimap.z++, {_x:p._x, _y:p._y, _alpha:(p.HP / p.maxHP) * 100});
} else if (p.aura._currentframe == 3) {
HUD.minimap.minimapBlips.attachMovie("whiteCrosshair", "whiteCrosshair" + HUD.minimap.z, HUD.minimap.z++, {_x:p._x, _y:p._y, _alpha:(p.HP / p.maxHP) * 100});
} else {
HUD.minimap.minimapBlips.attachMovie("greenCrosshair", "greenCrosshair" + HUD.minimap.z, HUD.minimap.z++, {_x:p._x, _y:p._y, _alpha:(p.HP / p.maxHP) * 100});
}
}
}
for (var i in p2) {
p = p2[i];
if (p.HP > 0) {
p2units++;
if (p.frozen) {
HUD.minimap.minimapBlips.attachMovie("blackCrosshair", "blackCrosshair" + HUD.minimap.z, HUD.minimap.z++, {_x:p._x, _y:p._y, _alpha:(p.HP / p.maxHP) * 100});
} else {
HUD.minimap.minimapBlips.attachMovie("crosshair", "crosshair" + HUD.minimap.z, HUD.minimap.z++, {_x:p._x, _y:p._y, _alpha:(p.HP / p.maxHP) * 100});
}
}
}
for (var i in p2Vehicles) {
p = p2Vehicles[i];
if (p.HP > 0) {
p2units++;
if (p.frozen) {
HUD.minimap.minimapBlips.attachMovie("blackCrosshair", "blackCrosshair" + HUD.minimap.z, HUD.minimap.z++, {_x:p._x, _y:p._y, _alpha:(p.HP / p.maxHP) * 100});
} else {
HUD.minimap.minimapBlips.attachMovie("crosshair", "crosshair" + HUD.minimap.z, HUD.minimap.z++, {_x:p._x, _y:p._y, _alpha:(p.HP / p.maxHP) * 100});
}
}
}
for (var i in p2Helis) {
p = p2Helis[i];
if (p.HP > 0) {
p2units++;
if (p.frozen) {
HUD.minimap.minimapBlips.attachMovie("blackCrosshair", "blackCrosshair" + HUD.minimap.z, HUD.minimap.z++, {_x:p._x, _y:p._y, _alpha:(p.HP / p.maxHP) * 100});
} else {
HUD.minimap.minimapBlips.attachMovie("crosshair", "crosshair" + HUD.minimap.z, HUD.minimap.z++, {_x:p._x, _y:p._y, _alpha:(p.HP / p.maxHP) * 100});
}
}
}
for (var i in habisLasers) {
p = habisLasers[i];
if (typeof(p) == "movieclip") {
HUD.minimap.minimapBlips.attachMovie("habisLaserIcon", "habisLaserIcon" + HUD.minimap.z, HUD.minimap.z++, {_x:p._x, _y:p._y});
}
}
if (gameMode == "kingofthehill") {
kingRing._rotation = kingRing._rotation - 1;
p1Ring = false;
a = [];
for (var i in p1) {
a.push(p1[i]);
}
for (var i in p1Vehicles) {
a.push(p1Vehicles[i]);
}
for (var i in p1Helis) {
a.push(p1Helis[i]);
}
for (var i in a) {
p = a[i];
if (p.HP > 0) {
xdist = p._x - kingRing._x;
ydist = p._y - kingRing._y;
distance = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (distance < kingRing.radius) {
p1Ring = true;
break;
}
}
}
p2Ring = false;
a = [];
for (var i in p2) {
a.push(p2[i]);
}
for (var i in p2Vehicles) {
a.push(p2Vehicles[i]);
}
for (var i in p2Helis) {
a.push(p2Helis[i]);
}
for (var i in a) {
p = a[i];
if (p.HP > 0) {
xdist = p._x - kingRing._x;
ydist = p._y - kingRing._y;
distance = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (distance < kingRing.radius) {
p2Ring = true;
break;
}
}
}
if (p1Ring) {
if (p2Ring) {
tColor = new Color(kingRing);
tColor.setRGB(0);
if (gameMode == "kingofthehill") {
tColor2 = new Color(HUD.minimap.minimapBlips.kingRing);
tColor2.setRGB(0);
}
} else {
p2currentHPUnRounded = p2currentHPUnRounded - (matchVariable / 10);
tColor = new Color(kingRing);
tColor.setRGB(65280);
if (gameMode == "kingofthehill") {
tColor2 = new Color(HUD.minimap.minimapBlips.kingRing);
tColor2.setRGB(65280);
}
}
} else if (p2Ring) {
currentHPUnRounded = currentHPUnRounded - (matchVariable / 10);
tColor = new Color(kingRing);
tColor.setRGB(16711680);
if (gameMode == "kingofthehill") {
tColor2 = new Color(HUD.minimap.minimapBlips.kingRing);
tColor2.setRGB(16711680);
}
} else {
tColor = new Color(kingRing);
tColor.setRGB(16777215);
if (gameMode == "kingofthehill") {
tColor2 = new Color(HUD.minimap.minimapBlips.kingRing);
tColor2.setRGB(16777215);
}
}
}
if (gameMode == "capturetheflag") {
if (flag.targ.HP > 0) {
flag._x = flag.targ._x;
flag._y = flag.targ._y;
flag._xscale = 100;
flag._yscale = 100;
if (flag.hitTest(flagArea)) {
if (((flag.targ._parent._name == "p1") || (flag.targ._parent._name == "p1Vehicles")) || (flag.targ._parent._name == "p1Helis")) {
p2currentHPUnRounded = p2currentHPUnRounded - (Math.ceil(p2maxHP / matchVariable) + 1);
flag._x = 640;
flag._y = 378;
flag.targ = null;
flag._xscale = 150;
flag._yscale = 150;
}
} else if (flag.hitTest(flagArea2)) {
if (((flag.targ._parent._name == "p2") || (flag.targ._parent._name == "p2Vehicles")) || (flag.targ._parent._name == "p2Helis")) {
currentHPUnRounded = currentHPUnRounded - (Math.ceil(maxHP / matchVariable) + 1);
flag._x = 640;
flag._y = 378;
flag.targ = null;
flag._xscale = 150;
flag._yscale = 150;
}
}
} else {
flag._xscale = 150;
flag._yscale = 150;
a = [];
for (var i in p1) {
a.push(p1[i]);
}
for (var i in p1Vehicles) {
a.push(p1Vehicles[i]);
}
for (var i in p1Helis) {
a.push(p1Helis[i]);
}
for (var i in p2) {
a.push(p2[i]);
}
for (var i in p2Vehicles) {
a.push(p2Vehicles[i]);
}
for (var i in p2Helis) {
a.push(p2Helis[i]);
}
bestDist = 10000;
for (var i in a) {
p = a[i];
if (p.HP > 0) {
xdist = p._x - flag._x;
ydist = p._y - flag._y;
distance = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (distance < bestDist) {
bestDist = distance;
if (bestDist < 50) {
flag.targ = p;
}
}
}
}
}
HUD.minimap.minimapBlips.attachMovie("flag", "flag", z++, {_x:flag._x, _y:flag._y, _xscale:640, _yscale:640});
} else if (gameMode == "powerball") {
powerBall.coolThing._rotation = powerBall.coolThing._rotation - 2;
if (powerBall.targ.HP > 0) {
powerBall._x = powerBall.targ._x;
powerBall._y = powerBall.targ._y;
powerBall._xscale = 100;
powerBall._yscale = 100;
if (((powerBall.targ._parent._name == "p1") || (powerBall.targ._parent._name == "p1Vehicles")) || (powerBall.targ._parent._name == "p1Helis")) {
p2currentHPUnRounded = p2currentHPUnRounded - (matchVariable / 10);
} else if (((powerBall.targ._parent._name == "p2") || (powerBall.targ._parent._name == "p2Vehicles")) || (powerBall.targ._parent._name == "p2Helis")) {
currentHPUnRounded = currentHPUnRounded - (matchVariable / 10);
}
} else {
powerBall._xscale = 150;
powerBall._yscale = 150;
a = [];
for (var i in p1) {
a.push(p1[i]);
}
for (var i in p1Vehicles) {
a.push(p1Vehicles[i]);
}
for (var i in p1Helis) {
a.push(p1Helis[i]);
}
for (var i in p2) {
a.push(p2[i]);
}
for (var i in p2Vehicles) {
a.push(p2Vehicles[i]);
}
for (var i in p2Helis) {
a.push(p2Helis[i]);
}
bestDist = 10000;
for (var i in a) {
p = a[i];
if (p.HP > 0) {
xdist = p._x - powerBall._x;
ydist = p._y - powerBall._y;
distance = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (distance < bestDist) {
bestDist = distance;
if (bestDist < 50) {
powerBall.targ = p;
}
}
}
}
}
HUD.minimap.minimapBlips.attachMovie("powerBall", "powerBall", z++, {_x:powerBall._x, _y:powerBall._y, _xscale:320, _yscale:320});
HUD.minimap.minimapBlips.powerBall._rotation = powerBall._rotation;
}
unitsSelected = false;
_root[cursorName].unshootableCursor._visible = false;
for (var i in p1) {
w = p1[i];
if (w.aura._currentframe == 3) {
unitsSelected = true;
break;
}
}
for (var i in p1Vehicles) {
w = p1Vehicles[i];
if (w.aura._currentframe == 3) {
unitsSelected = true;
break;
}
}
for (var i in p1Helis) {
w = p1Helis[i];
if (w.aura._currentframe == 3) {
unitsSelected = true;
break;
}
}
if (unitsSelected) {
if (_root[cursorName]._currentframe == 2) {
c = false;
heliVar = false;
for (var i in p1) {
w = p1[i];
if (w.aura._currentframe == 3) {
if ((w.unit != "lInf") && (w.unit != "sniper")) {
heliVar = true;
break;
}
}
}
for (var i in p1Vehicles) {
w = p1Vehicles[i];
if (w.aura._currentframe == 3) {
if ((w.unit != "hTank") && (w.unit != "ambulance")) {
heliVar = true;
break;
}
}
}
for (var i in p1Helis) {
w = p1Helis[i];
if (w.aura._currentframe == 3) {
if (w.unit != "helix") {
heliVar = true;
break;
}
}
}
nearest = null;
distance = 10000;
for (j in p2) {
e = p2[j];
if (e.HP > 0) {
xdist = e._x - _xmouse;
ydist = e._y - _ymouse;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < distance) {
distance = dist;
nearest = e;
}
}
}
for (j in p2Vehicles) {
e = p2Vehicles[j];
if (e.HP > 0) {
xdist = e._x - _xmouse;
ydist = e._y - _ymouse;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < distance) {
distance = dist;
nearest = e;
}
}
}
for (j in p2Helis) {
e = p2Helis[j];
if (e.HP > 0) {
xdist = e._x - _xmouse;
ydist = e._y - _ymouse;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < distance) {
distance = dist;
nearest = e;
}
}
}
if (distance <= 30) {
if (!heliVar) {
if (nearest._parent._name == "p2Helis") {
_root[cursorName].unshootableCursor._visible = true;
} else {
_root[cursorName].unshootableCursor._visible = false;
}
}
c = true;
}
if (!c) {
_root[cursorName].gotoAndStop(1);
}
}
if (_root[cursorName]._currentframe == 1) {
c = false;
heliVar = false;
for (var i in p1) {
w = p1[i];
if (w.aura._currentframe == 3) {
if ((w.unit != "lInf") || (w.unit != "sniper")) {
heliVar = true;
break;
}
}
}
for (var i in p1Vehicles) {
w = p1Vehicles[i];
if (w.aura._currentframe == 3) {
if ((w.unit != "hTank") && (w.unit != "ambulance")) {
heliVar = true;
break;
}
}
}
for (var i in p1Helis) {
w = p1Helis[i];
if (w.aura._currentframe == 3) {
if (w.unit != "helix") {
heliVar = true;
break;
}
}
}
nearest = null;
distance = 10000;
for (j in p2) {
e = p2[j];
if (e.HP > 0) {
xdist = e._x - _xmouse;
ydist = e._y - _ymouse;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < distance) {
distance = dist;
nearest = e;
}
}
}
for (j in p2Vehicles) {
e = p2Vehicles[j];
if (e.HP > 0) {
xdist = e._x - _xmouse;
ydist = e._y - _ymouse;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < distance) {
distance = dist;
nearest = e;
}
}
}
for (j in p2Helis) {
e = p2Helis[j];
if (e.HP > 0) {
xdist = e._x - _xmouse;
ydist = e._y - _ymouse;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < distance) {
distance = dist;
nearest = e;
}
}
}
if (distance <= 30) {
if (!heliVar) {
if (nearest._parent._name == "p2Helis") {
_root[cursorName].unshootableCursor._visible = true;
} else {
_root[cursorName].unshootableCursor._visible = false;
}
}
c = true;
_root[cursorName].gotoAndStop(2);
}
}
} else {
_root[cursorName].gotoAndStop(1);
}
goldDecimal = goldDecimal - Math.max(-2, -0.5 + ((-unitsOnField) / 2));
gold = Math.round(goldDecimal);
p2GoldDecimal = p2GoldDecimal - Math.max(-2, -0.5 + ((-p2UnitsOnField) / 2));
p2Gold = Math.round(p2GoldDecimal);
goldDecimal = Math.min(goldDecimal, StartingGold);
gold = Math.min(gold, StartingGold);
p2GoldDecimal = Math.min(p2GoldDecimal, p2StartingGold);
p2Gold = Math.min(p2Gold, p2StartingGold);
if (gameMode == "classic") {
if (unitsOnField <= 0) {
if (p2UnitsOnField >= 1) {
currentHPUnRounded = currentHPUnRounded - (matchVariable / 10);
}
} else if (unitsOnField >= 1) {
if (p2UnitsOnField <= 0) {
p2currentHPUnRounded = p2currentHPUnRounded - (matchVariable / 10);
}
}
} else if (gameMode == "deathmatch") {
if (unitsOnField <= 0) {
if (p2UnitsOnField >= 1) {
currentHPUnRounded = currentHPUnRounded - 0.3;
}
} else if (unitsOnField >= 1) {
if (p2UnitsOnField <= 0) {
p2currentHPUnRounded = p2currentHPUnRounded - 0.3;
}
}
}
currentHP = currentHP - ((currentHP - currentHPUnRounded) / 4);
p2currentHP = p2currentHP - ((p2currentHP - p2currentHPUnRounded) / 4);
currentHPDisplayed = Math.round(currentHP);
p2currentHPDisplayed = Math.round(p2currentHP);
if (int(currentHP) <= 0) {
stopAllSounds();
_root._x = (_root._y = 0);
onMouseDown = null;
onMouseUp = null;
gotoAndStop (6);
_quality = "MEDIUM";
onEnterFrame = null;
for (var i in _root) {
removeMovieClip(_root[i]);
}
}
if (int(p2CurrentHP) <= 0) {
stopAllSounds();
_root._x = (_root._y = 0);
onMouseDown = null;
onMouseUp = null;
gotoAndStop (5);
_quality = "MEDIUM";
onEnterFrame = null;
for (var i in _root) {
removeMovieClip(_root[i]);
}
} else if (p2CurrentHP <= 30) {
if (p2NukesOn) {
if (p2NukePercent >= 1) {
var tempVar = random(30);
if (tempVar == 0) {
launchNuke(2);
p2NukePercent = 0;
}
}
}
}
if (Key.isDown(96)) {
noShiftDeselect();
for (var j in p1) {
p = p1[j];
if (p.unit == "lInf") {
p.aura.gotoAndStop(3);
}
}
reFocus();
}
if (Key.isDown(97)) {
noShiftDeselect();
for (var j in p1) {
p = p1[j];
if (p.unit == "RPG") {
p.aura.gotoAndStop(3);
}
}
reFocus();
}
if (Key.isDown(98)) {
noShiftDeselect();
for (var j in p1) {
p = p1[j];
if (p.unit == "lTroop") {
p.aura.gotoAndStop(3);
}
}
reFocus();
}
if (Key.isDown(99)) {
noShiftDeselect();
for (var j in p1) {
p = p1[j];
if (p.unit == "sniper") {
p.aura.gotoAndStop(3);
}
}
reFocus();
}
if (Key.isDown(100)) {
noShiftDeselect();
for (var j in p1Vehicles) {
p = p1Vehicles[j];
if (p.unit == "gTank") {
p.aura.gotoAndStop(3);
}
}
reFocus();
}
if (Key.isDown(101)) {
noShiftDeselect();
for (var j in p1Vehicles) {
p = p1Vehicles[j];
if (p.unit == "hTank") {
p.aura.gotoAndStop(3);
}
}
reFocus();
}
if (Key.isDown(102)) {
noShiftDeselect();
for (var j in p1Vehicles) {
p = p1Vehicles[j];
if (p.unit == "lTank") {
p.aura.gotoAndStop(3);
}
}
reFocus();
}
if (Key.isDown(103)) {
noShiftDeselect();
for (var j in p1Vehicles) {
p = p1Vehicles[j];
if (p.unit == "ambulance") {
p.aura.gotoAndStop(3);
}
}
reFocus();
}
if (Key.isDown(104)) {
noShiftDeselect();
for (var j in p1Helis) {
p = p1Helis[j];
if (p.unit == "comanche") {
p.aura.gotoAndStop(3);
}
}
reFocus();
}
if (Key.isDown(105)) {
noShiftDeselect();
for (var j in p1Helis) {
p = p1Helis[j];
if (p.unit == "helix") {
p.aura.gotoAndStop(3);
}
}
reFocus();
}
}
function targetNearest(team) {
var a = [];
for (var i in _root["p" + team]) {
p = _root["p" + team][i];
if (p.aura._currentframe == 3) {
a.push(p);
}
}
for (var i in _root[("p" + team) + "Vehicles"]) {
p = _root[("p" + team) + "Vehicles"][i];
if (p.aura._currentframe == 3) {
a.push(p);
}
}
for (var i in _root[("p" + team) + "Helis"]) {
p = _root[("p" + team) + "Helis"][i];
if (p.aura._currentframe == 3) {
a.push(p);
}
}
for (var i in a) {
p = a[i];
nearest = null;
distance = 10000;
for (j in _root["p" + ((1 - team) + 2)]) {
e = _root["p" + ((1 - team) + 2)][j];
if (e.HP > 0) {
xdist = e._x - p._x;
ydist = e._y - p._y;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < distance) {
distance = dist;
nearest = e;
}
}
}
for (j in _root[("p" + ((1 - team) + 2)) + "Vehicles"]) {
e = _root[("p" + ((1 - team) + 2)) + "Vehicles"][j];
if (e.HP > 0) {
xdist = e._x - p._x;
ydist = e._y - p._y;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < distance) {
distance = dist;
nearest = e;
}
}
}
if (((((p.unit != "lInf") && (p.unit != "sniper")) && (p.unit != "helix")) && (p.unit != "hTank")) && (p.unit != "ambulance")) {
for (j in _root[("p" + ((1 - team) + 2)) + "Helis"]) {
e = _root[("p" + ((1 - team) + 2)) + "Helis"][j];
if (e.HP > 0) {
xdist = e._x - p._x;
ydist = e._y - p._y;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < distance) {
distance = dist;
nearest = e;
}
}
}
}
if (nearest != null) {
p.order = "attack";
p.targ = {unit:nearest};
}
}
voices["mySound" + channels] = new Sound(voices);
voices["mySound" + channels].attachSound("LInfA" + (random(3) + 1));
voices["mySound" + channels].start();
voices["mySound" + channels].setVolume(save.voiceVolume);
channels++;
}
function reformSelected() {
a = [];
b = [];
for (var k in p1) {
q = p1[k];
if (q.aura._currentframe == 3) {
b.push(q);
a.push(q);
}
}
for (var k in p1Vehicles) {
q = p1Vehicles[k];
if (q.aura._currentframe == 3) {
b.push(q);
a.push(q);
}
}
for (var k in p1Helis) {
q = p1Helis[k];
if (q.aura._currentframe == 3) {
b.push(q);
a.push(q);
}
}
if (b.length <= 0) {
return(undefined);
}
c = false;
for (var i in b) {
q = b[i];
if (!c) {
minX = q._x;
minY = q._y;
maxX = q._x;
maxY = q._y;
c = true;
} else {
if (q._x < minX) {
minX = q._x;
}
if (q._y < minY) {
minY = q._y;
}
if (q._x > maxX) {
maxX = q._x;
}
if (q._y > maxY) {
maxY = q._y;
}
}
}
xdist = maxX - minX;
ydist = maxY - minY;
middle = {x:minX + (xdist / 2), y:minY + (ydist / 2)};
offset = 0;
b = 7.5;
bVehicle = 25;
bHeli = 30;
distance = 0;
for (var i in a) {
w = a[i];
if (w._parent._name == "p1") {
distance = distance - (-b);
} else if (w._parent._name == "p1Vehicles") {
distance = distance - (-bVehicle);
} else if (w._parent._name == "p1Helis") {
distance = distance - (-bHeli);
}
}
while ((distance * 2) > 680) {
distance = 0;
b = b - 0.1;
bVehicle = bVehicle - 0.1;
bHeli = bHeli - 0.1;
for (var i in a) {
w = a[i];
if (w._parent._name == "p1") {
distance = distance - (-b);
} else if (w._parent._name == "p1Vehicles") {
distance = distance - (-bVehicle);
} else if (w._parent._name == "p1Helis") {
distance = distance - (-bHeli);
}
}
}
while (((middle.y - offset) + distance) > 720) {
offset = offset + 5;
}
while (((middle.y - offset) - distance) < 5) {
offset = offset - 0.5;
}
n = [];
var i = 0;
while (i < a.length) {
p = a[i];
if (i == 0) {
if (p._parent._name == "p1Vehicles") {
n.push(bVehicle);
} else if (p._parent._name == "p1") {
n.push(b);
} else if (p._parent._name == "p1Helis") {
n.push(bHeli);
}
} else if (p._parent._name == "p1Vehicles") {
n.push(n[i - 1] + (bVehicle * 2));
} else if (p._parent._name == "p1") {
n.push(n[i - 1] + (b * 2));
} else if (p._parent._name == "p1Helis") {
n.push(n[i - 1] + (bHeli * 2));
}
i++;
}
var i = 0;
while (i < a.length) {
a[i].order = "walk";
a[i].targ = {unit:null, x:middle.x, y:((middle.y - offset) - distance) + n[i]};
a[i].angleFace = 90;
i++;
}
}
function shoot(shotType, angle, startX, startY, team, firer, comancheSide) {
if (shotType == 1) {
playSoundFX("9mm");
var lineLength = 75;
var lineSpeed = 75;
x = eyeCandy.createEmptyMovieClip("shot" + z, z++);
x.xspeed = Math.sin(angle * degToRad);
x.yspeed = Math.cos(angle * degToRad);
x.angle = angle;
x.firer = firer;
x._x = startX + (x.xspeed * 15);
x._y = startY - (x.yspeed * 15);
x.lineStyle(1, 16777215, 100);
x.lineTo(x.xspeed * lineLength, x.yspeed * (-lineLength));
x.thingTrue = false;
x.onEnterFrame = function () {
if (this.thingTrue) {
this._x = this._x - ((-this.xspeed) * lineSpeed);
this._y = this._y - (this.yspeed * lineSpeed);
}
for (var i in _root["p" + ((1 - team) + 2)]) {
p = _root["p" + ((1 - team) + 2)][i];
if (p.HP > 0) {
if (this.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - (_root[("team" + team) + "APBullets"] ? 1.2 : 0.8);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.removeNextFrame = true;
this.onEnterFrame = null;
removeMovieClip(this);
}
}
}
for (var i in _root[("p" + ((1 - team) + 2)) + "Vehicles"]) {
p = _root[("p" + ((1 - team) + 2)) + "Vehicles"][i];
if (p.HP > 0) {
if (this.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - (_root[("team" + team) + "APBullets"] ? 0.3 : 0.15);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.onEnterFrame = null;
removeMovieClip(this);
}
}
}
if (!this.thingTrue) {
this._x = this._x - ((-this.xspeed) * lineSpeed);
this._y = this._y - (this.yspeed * lineSpeed);
}
this.thingTrue = true;
if (!this.hitTest(theMap)) {
this.onEnterFrame = null;
removeMovieClip(this);
}
};
// unexpected jump
}
if (shotType == 2) {
playSoundFX("rocketSound");
x = eyeCandy.attachMovie("rocket", "rocket" + z, z++);
x.firer = firer;
x.targ = firer.targ.unit;
x.speed = 10;
x.xspeed = Math.sin(angle * degToRad);
x.yspeed = Math.cos(angle * degToRad);
x._x = startX + (Math.sin((angle + 10) * degToRad) * 20);
x._y = startY - (Math.cos((angle + 10) * degToRad) * 20);
x.team = team;
x._rotation = angle;
x.c = 3;
x.onEnterFrame = function () {
this.light.gotoAndStop(_root[("team" + this.team) + "homingMissiles"]);
this.c--;
if (this.c == 0) {
this.c = 3;
y = eyeCandy.attachMovie("clearSmoke", "clearSmoke" + z, z++, {_xscale:120, _yscale:120, _x:this._x, _y:this._y, xspeed:-Math.random(), yspeed:-Math.random(), speed:(-this.speed) / 4});
y.onEnterFrame = function () {
this._x = this._x - ((-this.xspeed) * this.speed);
this._y = this._y - ((-this.yspeed) * this.speed);
this._xscale = this._xscale / 1.2;
this.speed = this.speed / 1.2;
this._xscale = Math.round(this._xscale);
this._yscale = (this._alpha = this._xscale);
if (this._alpha <= 10) {
this.onEnterFrame = null;
removeMovieClip(this);
}
};
}
if (((this.targ.HP != undefined) && (_root[("team" + this.team) + "homingMissiles"])) && (this.targ.HP > 0)) {
var ydist = (this._y - this.targ._y);
var xdist = (this._x - this.targ._x);
var rot = (-Math.atan2(xdist, ydist));
this.targRot = rot * radToDeg;
this._rotation = this._rotation - ((-(this.targRot - this._rotation)) / 2);
this.xspeed = Math.sin(this._rotation * degToRad);
this.yspeed = Math.cos(this._rotation * degToRad);
this._x = this._x - ((-this.xspeed) * this.speed);
this._y = this._y - (this.yspeed * this.speed);
} else if (_root[("team" + this.team) + "homingMissiles"]) {
dist = 10000;
a = [];
var tempVar = _root["p" + ((1 - this.team) + 2)];
for (var w in tempVar) {
if (tempVar[w].HP > 0) {
a.push(tempVar[w]);
}
}
tempVar = _root[("p" + ((1 - this.team) + 2)) + "Vehicles"];
for (var w in tempVar) {
if (tempVar[w].HP > 0) {
a.push(tempVar[w]);
}
}
tempVar = _root[("p" + ((1 - this.team) + 2)) + "Helis"];
for (var w in tempVar) {
if (tempVar[w].HP > 0) {
a.push(tempVar[w]);
}
}
if (a.length == 0) {
this.xspeed = Math.sin(this._rotation * degToRad);
this.yspeed = Math.cos(this._rotation * degToRad);
this._x = this._x - ((-this.xspeed) * this.speed);
this._y = this._y - (this.yspeed * this.speed);
} else {
for (var w in a) {
p = a[w];
var ydist = (this._y - p._y);
var xdist = (this._x - p._x);
distance = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (distance < dist) {
dist = distance;
this.targ = p;
}
}
}
} else {
this.xspeed = Math.sin(this._rotation * degToRad);
this.yspeed = Math.cos(this._rotation * degToRad);
this._x = this._x - ((-this.xspeed) * this.speed);
this._y = this._y - (this.yspeed * this.speed);
}
this.speed = this.speed - -0.5;
r = false;
tehP = null;
for (var i in _root["p" + ((1 - team) + 2)]) {
p = _root["p" + ((1 - team) + 2)][i];
if (p.HP > 0) {
if (this.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
if (tehP == null) {
tehP = p;
}
p.HP = p.HP - (_root[("team" + team) + "homingMissiles"] ? 2.2 : 2);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.onEnterFrame = null;
r = true;
}
}
}
for (var i in _root[("p" + ((1 - team) + 2)) + "Vehicles"]) {
p = _root[("p" + ((1 - team) + 2)) + "Vehicles"][i];
if (p.HP > 0) {
if (this.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
if (tehP == null) {
tehP = p;
}
p.HP = p.HP - (_root[("team" + team) + "homingMissiles"] ? 5 : 4);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.onEnterFrame = null;
r = true;
}
}
}
for (var i in _root[("p" + ((1 - team) + 2)) + "Helis"]) {
p = _root[("p" + ((1 - team) + 2)) + "Helis"][i];
if (p.HP > 0) {
if (this.hitTest(p.hit)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
if (tehP == null) {
tehP = p;
}
p.HP = p.HP - (_root[("team" + team) + "homingMissiles"] ? 3 : 2);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.onEnterFrame = null;
r = true;
}
}
}
if (r) {
removeMovieClip(this);
screenShake(4);
eyeCandy.attachMovie("missileBlast", "missileBlast" + z, z++, {_x:tehP._x, _y:tehP._y});
lowEyeCandy.attachMovie("missileHole", "missileHole" + z, z++, {_x:tehP._x, _y:tehP._y});
}
if (!this.hitTest(theMap)) {
this.onEnterFrame = null;
removeMovieClip(this);
}
};
} else if (shotType == 3) {
xspeed = Math.sin(angle * degToRad);
yspeed = Math.cos(angle * degToRad);
startX = firer._x + (Math.sin((angle + 3) * degToRad) * 100);
startY = firer._y - (Math.cos((angle + 3) * degToRad) * 100);
y = eyeCandy.attachMovie("shell", "shell" + z, z++, {_rotation:angle, _x:startX, _y:startY, firer:firer, startX:startX, startY:startY, xspeed:xspeed, yspeed:yspeed, speed:70});
if (firer.targ.unit.HP > 0) {
y.endX = firer.targ.unit._x;
y.endY = firer.targ.unit._y;
} else {
y.endX = firer.targ.unitx;
y.endY = firer.targ.unity;
}
xdist = y.endX - startX;
ydist = y.endY - startY;
y.distanceToCover = Math.sqrt((xdist * xdist) + (ydist * ydist));
y.onEnterFrame = function () {
this._x = this._x - ((-this.xspeed) * this.speed);
this._y = this._y - (this.yspeed * this.speed);
this.distanceToCover = this.distanceToCover - this.speed;
if (this.distanceToCover <= 0) {
this._x = this.endX;
this._y = this.endY;
screenShake(8);
playSoundFX("shellSound");
blast = eyeCandy.attachMovie("missileBlast", "missileBlast" + z, z++, {_x:this.endX, _y:this.endY, _xscale:175, _yscale:175});
blast.firer = this.firer;
lowEyeCandy.attachMovie("missileHole", "missileHole" + z, z++, {_x:this.endX, _y:this.endY, _xscale:175, _yscale:175});
shrapnel = shrapnels.createEmptyMovieClip("shrapnel" + z, z++);
shrapnel._x = this.endX;
shrapnel._y = this.endY;
shrapnel.z = 0;
shrapnel.c = 60;
shrapnel.createShrapnel = createShrapnel;
shrapnel.onEnterFrame = function () {
if (this.c >= 57) {
var j = 0;
while (j <= 10) {
this.createShrapnel();
j++;
}
}
if (this.c == 0) {
removeMovieClip(this);
}
this.c--;
for (var shrap in this) {
p = this[shrap];
if (typeof(p) == "movieclip") {
p._x = p._x - (p.xspeed * p.xs);
p._y = p._y - (p.yspeed * p.xs);
p._xscale = p._xscale - (-((p.ys = p.ys - (-gravity))));
p._yscale = p._xscale;
if (int(p._xscale) >= 10) {
removeMovieClip(p);
}
}
}
};
for (var i in _root["p" + ((1 - team) + 2)]) {
p = _root["p" + ((1 - team) + 2)][i];
if (blast.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - 2.5;
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
removeMovieClip(this);
}
}
for (var i in _root[("p" + ((1 - team) + 2)) + "Vehicles"]) {
p = _root[("p" + ((1 - team) + 2)) + "Vehicles"][i];
if (blast.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - 6;
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
removeMovieClip(this);
}
}
removeMovieClip(this);
}
};
} else if (shotType == 4) {
playSoundFX("gattlingSound");
var lineLength = 50;
var lineSpeed = 50;
x = eyeCandy.createEmptyMovieClip("shot" + z, z++);
x.firer = firer;
x.xspeed = Math.sin(angle * degToRad);
x.yspeed = Math.cos(angle * degToRad);
x._x = startX + (Math.sin((angle + 10) * degToRad) * 45);
x._y = startY - (Math.cos((angle + 10) * degToRad) * 45);
x.lineStyle(2, 16777215, 100);
x.lineTo(x.xspeed * lineLength, x.yspeed * (-lineLength));
x.thingTrue = false;
x.onEnterFrame = function () {
if (this.thingTrue) {
this._x = this._x - ((-this.xspeed) * lineSpeed);
this._y = this._y - (this.yspeed * lineSpeed);
}
for (var i in _root["p" + ((1 - team) + 2)]) {
p = _root["p" + ((1 - team) + 2)][i];
if (p.HP > 0) {
if (this.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - (_root[("team" + team) + "APBullets"] ? 1.2 : 1);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.onEnterFrame = null;
removeMovieClip(this);
}
}
}
for (var i in _root[("p" + ((1 - team) + 2)) + "Vehicles"]) {
p = _root[("p" + ((1 - team) + 2)) + "Vehicles"][i];
if (p.HP > 0) {
if (this.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - (_root[("team" + team) + "APBullets"] ? 1.2 : 1);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.onEnterFrame = null;
removeMovieClip(this);
}
}
}
if (!this.thingTrue) {
this._x = this._x - ((-this.xspeed) * lineSpeed);
this._y = this._y - (this.yspeed * lineSpeed);
}
this.thingTrue = true;
if (!this.hitTest(theMap)) {
this.onEnterFrame = null;
removeMovieClip(this);
}
};
} else if (shotType == 5) {
playSoundFX("gattlingSound");
var lineLength = 50;
var lineSpeed = 50;
x = eyeCandy.createEmptyMovieClip("shot" + z, z++);
x.firer = firer;
x.xspeed = Math.sin(angle * degToRad);
x.yspeed = Math.cos(angle * degToRad);
x._x = startX + (Math.sin(angle * degToRad) * 19);
x._y = startY - (Math.cos(angle * degToRad) * 19);
x.lineStyle(1, 16777215, 100);
x.lineTo(x.xspeed * lineLength, x.yspeed * (-lineLength));
x.thingTrue = false;
x.onEnterFrame = function () {
if (this.thingTrue) {
this._x = this._x - ((-this.xspeed) * lineSpeed);
this._y = this._y - (this.yspeed * lineSpeed);
}
for (var i in _root["p" + ((1 - team) + 2)]) {
p = _root["p" + ((1 - team) + 2)][i];
if (p.HP > 0) {
if (this.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - (_root[("team" + team) + "APBullets"] ? 0.7 : 0.5);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.onEnterFrame = null;
removeMovieClip(this);
}
}
}
for (var i in _root[("p" + ((1 - team) + 2)) + "Vehicles"]) {
p = _root[("p" + ((1 - team) + 2)) + "Vehicles"][i];
if (p.HP > 0) {
if (this.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - (_root[("team" + team) + "APBullets"] ? 0.75 : 0.35);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.onEnterFrame = null;
removeMovieClip(this);
}
}
}
for (var i in _root[("p" + ((1 - team) + 2)) + "Helis"]) {
p = _root[("p" + ((1 - team) + 2)) + "Helis"][i];
if (p.HP > 0) {
if (this.hitTest(p.hit)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - (_root[("team" + team) + "APBullets"] ? 1 : 0.7);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.onEnterFrame = null;
removeMovieClip(this);
}
}
}
if (!this.thingTrue) {
this._x = this._x - ((-this.xspeed) * lineSpeed);
this._y = this._y - (this.yspeed * lineSpeed);
}
this.thingTrue = true;
if (!this.hitTest(theMap)) {
this.onEnterFrame = null;
removeMovieClip(this);
}
};
} else if (shotType == 6) {
playSoundFX("gattlingSound");
var lineLength = 50;
var lineSpeed = 50;
x = eyeCandy.createEmptyMovieClip("shot" + z, z++);
x.firer = firer;
x.xspeed = Math.sin(angle * degToRad);
x.yspeed = Math.cos(angle * degToRad);
x._x = startX + (Math.sin(angle * degToRad) * 47);
x._y = startY - (Math.cos(angle * degToRad) * 47);
x.lineStyle(2, 16777215, 100);
x.lineTo(x.xspeed * lineLength, x.yspeed * (-lineLength));
x.thingTrue = false;
x.onEnterFrame = function () {
if (this.thingTrue) {
this._x = this._x - ((-this.xspeed) * lineSpeed);
this._y = this._y - (this.yspeed * lineSpeed);
}
for (var i in _root["p" + ((1 - team) + 2)]) {
p = _root["p" + ((1 - team) + 2)][i];
if (p.HP > 0) {
if (this.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - (_root[("team" + team) + "APBullets"] ? 1.7 : 1.5);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.onEnterFrame = null;
removeMovieClip(this);
}
}
}
for (var i in _root[("p" + ((1 - team) + 2)) + "Vehicles"]) {
p = _root[("p" + ((1 - team) + 2)) + "Vehicles"][i];
if (p.HP > 0) {
if (this.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - (_root[("team" + team) + "APBullets"] ? 0.75 : 0.35);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.onEnterFrame = null;
removeMovieClip(this);
}
}
}
for (var i in _root[("p" + ((1 - team) + 2)) + "Helis"]) {
p = _root[("p" + ((1 - team) + 2)) + "Helis"][i];
if (p.HP > 0) {
if (this.hitTest(p.hit)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - (_root[("team" + team) + "APBullets"] ? 1 : 0.7);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.onEnterFrame = null;
removeMovieClip(this);
}
}
}
if (!this.thingTrue) {
this._x = this._x - ((-this.xspeed) * lineSpeed);
this._y = this._y - (this.yspeed * lineSpeed);
}
this.thingTrue = true;
if (!this.hitTest(theMap)) {
this.onEnterFrame = null;
removeMovieClip(this);
}
};
} else if (shotType == 7) {
x = eyeCandy.attachMovie("rocketPod", "rocketPod" + z, z++);
playSoundFX("rocketPodSound");
x.targ = firer.targ.unit;
x.firer = firer;
x.speed = 10;
x.xspeed = Math.sin(angle * degToRad);
x.yspeed = Math.cos(angle * degToRad);
if (comancheSide == 1) {
x._x = startX + (Math.sin((angle + 90) * degToRad) * 18);
x._y = startY - (Math.cos((angle + 90) * degToRad) * 18);
} else {
x._x = startX + (Math.sin((angle - 90) * degToRad) * 18);
x._y = startY - (Math.cos((angle - 90) * degToRad) * 18);
}
x.team = team;
x._rotation = angle;
x.c = 2;
x.onEnterFrame = function () {
this.light.gotoAndStop(_root[("team" + this.team) + "homingMissiles"]);
this.c--;
if (this.c == 0) {
this.c = 2;
y = eyeCandy.attachMovie("clearSmoke", "clearSmoke" + z, z++, {_xscale:70, _yscale:70, _x:this._x, _y:this._y, xspeed:-Math.random(), yspeed:-Math.random(), speed:(-this.speed) / 4});
y.onEnterFrame = function () {
this._x = this._x - ((-this.xspeed) * this.speed);
this._y = this._y - ((-this.yspeed) * this.speed);
this._xscale = this._xscale / 1.2;
this.speed = this.speed / 1.2;
this._xscale = Math.round(this._xscale);
this._yscale = (this._alpha = this._xscale);
if (this._alpha <= 10) {
this.onEnterFrame = null;
removeMovieClip(this);
}
};
}
if (((this.targ.HP != undefined) && (_root[("team" + this.team) + "homingMissiles"])) && (this.targ.HP > 0)) {
var ydist = (this._y - this.targ._y);
var xdist = (this._x - this.targ._x);
var rot = (-Math.atan2(xdist, ydist));
this.targRot = rot * radToDeg;
this._rotation = this._rotation - ((-(this.targRot - this._rotation)) / 3);
this.xspeed = Math.sin(this._rotation * degToRad);
this.yspeed = Math.cos(this._rotation * degToRad);
this._x = this._x - ((-this.xspeed) * this.speed);
this._y = this._y - (this.yspeed * this.speed);
} else if (_root[("team" + this.team) + "homingMissiles"]) {
dist = 10000;
a = [];
var tempVar = _root["p" + ((1 - this.team) + 2)];
for (var w in tempVar) {
if (tempVar[w].HP > 0) {
a.push(tempVar[w]);
}
}
tempVar = _root[("p" + ((1 - this.team) + 2)) + "Vehicles"];
for (var w in tempVar) {
if (tempVar[w].HP > 0) {
a.push(tempVar[w]);
}
}
tempVar = _root[("p" + ((1 - this.team) + 2)) + "Helis"];
for (var w in tempVar) {
if (tempVar[w].HP > 0) {
a.push(tempVar[w]);
}
}
if (a.length == 0) {
this.xspeed = Math.sin(this._rotation * degToRad);
this.yspeed = Math.cos(this._rotation * degToRad);
this._x = this._x - ((-this.xspeed) * this.speed);
this._y = this._y - (this.yspeed * this.speed);
} else {
for (var w in a) {
p = a[w];
var ydist = (this._y - p._y);
var xdist = (this._x - p._x);
distance = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (distance < dist) {
dist = distance;
this.targ = p;
}
}
}
} else {
this.xspeed = Math.sin(this._rotation * degToRad);
this.yspeed = Math.cos(this._rotation * degToRad);
this._x = this._x - ((-this.xspeed) * this.speed);
this._y = this._y - (this.yspeed * this.speed);
}
this.speed = this.speed - -0.5;
r = false;
tehP = null;
for (var i in _root["p" + ((1 - team) + 2)]) {
p = _root["p" + ((1 - team) + 2)][i];
if (p.HP > 0) {
if (this.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
if (tehP == null) {
tehP = p;
}
p.HP = p.HP - (_root[("team" + team) + "homingMissiles"] ? 1.5 : 1);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.onEnterFrame = null;
r = true;
}
}
}
for (var i in _root[("p" + ((1 - team) + 2)) + "Vehicles"]) {
p = _root[("p" + ((1 - team) + 2)) + "Vehicles"][i];
if (p.HP > 0) {
if (this.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
if (tehP == null) {
tehP = p;
}
p.HP = p.HP - (_root[("team" + team) + "homingMissiles"] ? 1 : 0.5);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.onEnterFrame = null;
r = true;
}
}
}
for (var i in _root[("p" + ((1 - team) + 2)) + "Helis"]) {
p = _root[("p" + ((1 - team) + 2)) + "Helis"][i];
if (p.HP > 0) {
if (this.hitTest(p.hit)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
if (tehP == null) {
tehP = p;
}
p.HP = p.HP - (_root[("team" + team) + "homingMissiles"] ? 2 : 1);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.onEnterFrame = null;
r = true;
}
}
}
if (r) {
removeMovieClip(this);
screenShake(4);
eyeCandy.attachMovie("missileBlast", "missileBlast" + z, z++, {_x:tehP._x, _y:tehP._y});
lowEyeCandy.attachMovie("missileHole", "missileHole" + z, z++, {_x:tehP._x, _y:tehP._y});
}
if (!this.hitTest(theMap)) {
this.onEnterFrame = null;
removeMovieClip(this);
}
};
} else if (shotType == 8) {
x = eyeCandy.createEmptyMovieClip("shot" + z, z++);
x.team = team;
x.firer = firer;
x.targ = firer.targ.unit;
x.angle = angle;
x.fromTank = comancheSide;
if (comancheSide) {
x.radius = 30;
} else {
x.radius = 15;
}
x.x = firer._x + (Math.sin(angle * degToRad) * x.radius);
x.y = firer._y - (Math.cos(angle * degToRad) * x.radius);
x.moveTo(x.x, x.y);
if (_root[("team" + team) + "laserUpgrade"]) {
x.lineStyle(1, 26367, 100);
} else {
x.lineStyle(2, 16711680, 100);
}
if (firer.targ.unit.HP > 0) {
x.endLineX = firer.targ.unit._x;
x.endLineY = firer.targ.unit._y;
x.lineTo(x.endLineX, x.endLineY);
} else {
x.firer.order = "stand";
}
x.c = 50;
x.onEnterFrame = function () {
this.clear();
this.x = this.firer._x + (Math.sin(angle * degToRad) * this.radius);
this.y = this.firer._y - (Math.cos(angle * degToRad) * this.radius);
if ((this.c <= 0) || (this.firer.order != "attack")) {
this.onEnterFrame = null;
removeMovieClip(this);
return(undefined);
}
if (_root[("team" + this.team) + "laserUpgrade"]) {
x.lineStyle(1, 26367, 100);
} else {
x.lineStyle(2, 16711680, 100);
}
this.moveTo(this.x, this.y);
if (this.targ.HP > 0) {
this.endLineX = this.targ._x;
this.endLineY = this.targ._y;
}
this.lineTo(this.endLineX, this.endLineY);
if (!this.fromTank) {
this.c--;
}
for (var i in _root["p" + ((1 - team) + 2)]) {
p = _root["p" + ((1 - team) + 2)][i];
if (p.HP > 0) {
if (p == this.firer.targ.unit) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - (_root[("team" + team) + "laserUpgrade"] ? 0.1 : 0.05);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.clear();
if (_root[("team" + this.team) + "laserUpgrade"]) {
x.lineStyle(1, 26367, 100);
} else {
x.lineStyle(2, 16711680, 100);
}
this.moveTo(this.x, this.y);
this.lineTo(p._x, p._y);
return(undefined);
}
}
}
for (var i in _root[("p" + ((1 - team) + 2)) + "Vehicles"]) {
p = _root[("p" + ((1 - team) + 2)) + "Vehicles"][i];
if (p.HP > 0) {
if (p == this.firer.targ.unit) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - (_root[("team" + team) + "laserUpgrade"] ? 0.1 : 0.05);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.clear();
if (_root[("team" + this.team) + "laserUpgrade"]) {
x.lineStyle(1, 26367, 100);
} else {
x.lineStyle(2, 16711680, 100);
}
this.moveTo(this.x, this.y);
this.lineTo(p._x, p._y);
return(undefined);
}
}
}
for (var i in _root[("p" + ((1 - team) + 2)) + "Helis"]) {
p = _root[("p" + ((1 - team) + 2)) + "Helis"][i];
if (p.HP > 0) {
if (p == this.firer.targ.unit) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - (_root[("team" + team) + "laserUpgrade"] ? 0.15 : 0.1);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.clear();
if (_root[("team" + this.team) + "laserUpgrade"]) {
x.lineStyle(1, 26367, 100);
} else {
x.lineStyle(2, 16711680, 100);
}
this.moveTo(this.x, this.y);
this.lineTo(p._x, p._y);
return(undefined);
}
}
}
};
} else if (shotType == 9) {
_root.playSoundFX("snipeSound");
x = eyeCandy.createEmptyMovieClip("shot" + z, z++);
x.firer = firer;
x.targ = firer.targ.unit;
x.angle = angle;
x.fromTank = false;
x.x = firer._x + (Math.sin(angle * degToRad) * 15);
x.y = firer._y - (Math.cos(angle * degToRad) * 15);
x.moveTo(x.x, x.y);
x.lineStyle(1, 16777215, 100);
if (firer.targ.unit.HP > 0) {
x.endLineX = firer.targ.unit._x;
x.endLineY = firer.targ.unit._y;
x.lineTo(x.endLineX, x.endLineY);
} else {
x.endLineX = firer._x + (Math.sin(angle * degToRad) * 640);
x.endLineY = firer._y - (Math.cos(angle * degToRad) * 480);
x.lineTo(x.endLineX, x.endLineY);
}
x.c = 1;
x.onEnterFrame = function () {
if ((this.c <= 0) || (this.firer.order != "attack")) {
this.onEnterFrame = null;
removeMovieClip(this);
return(undefined);
}
this.clear();
this.lineStyle(1, 16777215, 50);
this.moveTo(this.x, this.y);
if (this.targ.HP > 0) {
this.endLineX = this.targ._x;
this.endLineY = this.targ._y;
}
this.lineTo(this.endLineX, this.endLineY);
if (!this.fromTank) {
this.c--;
}
for (var i in _root["p" + ((1 - team) + 2)]) {
p = _root["p" + ((1 - team) + 2)][i];
if (p.HP > 0) {
if (p == this.firer.targ.unit) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - (_root[("team" + team) + "APBullets"] ? 4 : 3);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.clear();
this.lineStyle(1, 16777215, 50);
this.moveTo(this.x, this.y);
this.lineTo(p._x, p._y);
return(undefined);
}
}
}
for (var i in _root[("p" + ((1 - team) + 2)) + "Vehicles"]) {
p = _root[("p" + ((1 - team) + 2)) + "Vehicles"][i];
if (p.HP > 0) {
if (p == this.firer.targ.unit) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - (_root[("team" + team) + "APBullets"] ? 3 : 2.5);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.clear();
this.lineStyle(1, 16777215, 50);
this.moveTo(this.x, this.y);
this.lineTo(p._x, p._y);
return(undefined);
}
}
}
};
} else if (shotType == 10) {
screenShake(10);
b = landEyeCandy.attachMovie("missileBlast", "missileBlast" + z, z++, {_x:firer._x, _y:firer._y, _xscale:250, _yscale:250});
lowEyeCandy.attachMovie("missileHole", "missileHole" + z, z++, {_x:firer._x, _y:firer._y, _xscale:250, _yscale:250});
shrapnel = shrapnels.createEmptyMovieClip("shrapnel" + z, z++);
shrapnel._xscale = 250;
shrapnel._yscale = 250;
shrapnel._x = firer._x;
shrapnel._y = firer._y;
shrapnel.z = 0;
shrapnel.c = 62;
shrapnel.createShrapnel = createShrapnel;
shrapnel.onEnterFrame = function () {
if (this.c >= 57) {
var j = 0;
while (j <= 15) {
createShrapnel();
j++;
}
}
if (this.c == 0) {
removeMovieClip(this);
}
this.c--;
for (var shrap in this) {
p = this[shrap];
if (typeof(p) == "movieclip") {
p._x = p._x - (p.xspeed * p.xs);
p._y = p._y - (p.yspeed * p.xs);
p._xscale = p._xscale - (-((p.ys = p.ys - (-gravity))));
p._yscale = p._xscale;
if (int(p._xscale) >= 10) {
removeMovieClip(p);
}
}
}
};
for (var i in p1) {
p = p1[i];
if (p.HP > 0) {
if (b.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
if (tehP == null) {
tehP = p;
}
p.HP = p.HP - 10;
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
}
}
}
for (var i in p2) {
p = p2[i];
if (p.HP > 0) {
if (b.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
if (tehP == null) {
tehP = p;
}
p.HP = p.HP - 10;
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
}
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
if (p.HP > 0) {
if (b.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
if (tehP == null) {
tehP = p;
}
p.HP = p.HP - 6;
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
}
}
}
for (var i in p2Vehicles) {
p = p2Vehicles[i];
if (p.HP > 0) {
if (b.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
if (tehP == null) {
tehP = p;
}
p.HP = p.HP - 6;
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
}
}
}
} else if (shotType == 11) {
var lineLength = 75;
var lineSpeed = 75;
x = eyeCandy.createEmptyMovieClip("shot" + z, z++);
x.firer = firer;
x.xspeed = Math.sin(angle * degToRad);
x.yspeed = Math.cos(angle * degToRad);
x._x = startX + (Math.sin(angle * degToRad) * 7);
x._y = startY - (Math.cos(angle * degToRad) * 7);
x.lineStyle(1, 16777215, 100);
x.lineTo(x.xspeed * lineLength, x.yspeed * (-lineLength));
x.thingTrue = false;
x.onEnterFrame = function () {
if (this.thingTrue) {
this._x = this._x - ((-this.xspeed) * lineSpeed);
this._y = this._y - (this.yspeed * lineSpeed);
}
for (var i in _root["p" + ((1 - team) + 2)]) {
p = _root["p" + ((1 - team) + 2)][i];
if (p.HP > 0) {
if (this.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - (_root[("team" + team) + "APBullets"] ? 1.2 : 0.8);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.onEnterFrame = null;
removeMovieClip(this);
}
}
}
for (var i in _root[("p" + ((1 - team) + 2)) + "Vehicles"]) {
p = _root[("p" + ((1 - team) + 2)) + "Vehicles"][i];
if (p.HP > 0) {
if (this.hitTest(p)) {
h = createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.c = 0;
h.onEnterFrame = function () {
if (this.c != 0) {
this.t = {rb:0, gb:0, bb:0};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.onEnterFrame = null;
removeMovieClip(this);
} else {
this.t = {rb:255, gb:255, bb:255};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
this.c--;
}
};
p.HP = p.HP - (_root[("team" + team) + "APBullets"] ? 0.45 : 0.3);
p.HP = Math.max(0, p.HP);
if (p.order == "stand") {
p.order = "attack";
p.targ = {unit:this.firer};
}
this.onEnterFrame = null;
removeMovieClip(this);
}
}
}
if (!this.thingTrue) {
this._x = this._x - ((-this.xspeed) * lineSpeed);
this._y = this._y - (this.yspeed * lineSpeed);
}
this.thingTrue = true;
if (!this.hitTest(theMap)) {
this.onEnterFrame = null;
removeMovieClip(this);
}
};
}
}
function unitBrain() {
if ((p.unit == "lInf") || (p.unit == "RPG")) {
if (p.HP <= 0) {
p.aura.gotoAndStop(1);
if (p == focusedUnit) {
reFocus(true);
}
p.order = "die";
p.h.onEnterFrame = null;
removeMovieClip(p.h);
}
if (p.frozen) {
if (p.order != "die") {
p.order = "stand";
}
}
if (p.order == "stand") {
p.gotoAndStop(1);
p.targRot = p.angleFace;
p._rotation = p._rotation - ((-(p.targRot - p._rotation)) / 3);
} else if (p.order == "walk") {
p.gotoAndStop(2);
var ydist = (p._y - p.targ.y);
var xdist = (p._x - p.targ.x);
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p._rotation = p._rotation - ((-(p.targRot - p._rotation)) / 3);
if (Math.sqrt((ydist * ydist) + (xdist * xdist)) >= p.speed) {
var yspeed = (Math.cos(rot) * p.speed);
var xspeed = (Math.sin(rot) * p.speed);
p._y = p._y - yspeed;
p._x = p._x - (-xspeed);
} else {
p._y = p.targ.y;
p._x = p.targ.x;
p.order = "stand";
p.gotoAndStop(1);
}
} else if (p.order == "attack") {
if (p.targ.unit.HP <= 0) {
p.order = "stand";
p.gotoAndStop(1);
} else if (p.unit == "lInf") {
if ((p.targ.unit._parent._name == "p1Helis") || (p.targ.unit._parent._name == "p2Helis")) {
p.order = "stand";
} else {
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var distance = Math.sqrt((ydist * ydist) + (xdist * xdist));
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p._rotation = p._rotation - ((-(p.targRot - p._rotation)) / 3);
d = ((p.unit == "lInf") ? 400 : 600);
if (distance <= d) {
p.gotoAndStop(3);
} else {
p.gotoAndStop(2);
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p._rotation = p._rotation - ((-(p.targRot - p._rotation)) / 3);
if (Math.sqrt((ydist * ydist) + (xdist * xdist)) >= p.speed) {
var yspeed = (Math.cos(rot) * p.speed);
var xspeed = (Math.sin(rot) * p.speed);
p._y = p._y - yspeed;
p._x = p._x - (-xspeed);
} else {
p._y = p.targ.y;
p._x = p.targ.x;
p.order = "stand";
p.gotoAndStop(1);
}
}
}
} else {
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var distance = Math.sqrt((ydist * ydist) + (xdist * xdist));
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p._rotation = p._rotation - ((-(p.targRot - p._rotation)) / 3);
d = ((p.unit == "lInf") ? 400 : 600);
if (distance <= d) {
p.gotoAndStop(3);
} else {
p.gotoAndStop(2);
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p._rotation = p._rotation - ((-(p.targRot - p._rotation)) / 3);
if (Math.sqrt((ydist * ydist) + (xdist * xdist)) >= p.speed) {
var yspeed = (Math.cos(rot) * p.speed);
var xspeed = (Math.sin(rot) * p.speed);
p._y = p._y - yspeed;
p._x = p._x - (-xspeed);
} else {
p._y = p.targ.y;
p._x = p.targ.x;
p.order = "stand";
p.gotoAndStop(1);
}
}
}
} else if (p.order == "die") {
p.gotoAndStop(4);
}
} else if (p.unit == "hTank") {
if (p.HP <= 0) {
p.aura.gotoAndStop(1);
if (p == focusedUnit) {
reFocus(true);
}
p.order = "die";
p.h.onEnterFrame = null;
removeMovieClip(p.h);
}
if (p.frozen) {
if (p.order != "die") {
p.order = "stand";
}
}
if (p.order == "stand") {
p.turret.gotoAndStop(1);
p.turret.gattle.gotoAndStop(1);
p.targRot = p.angleFace;
p.turret._rotation = p.turret._rotation - ((-(p.targRot - p.turret._rotation)) / 4);
p.base._rotation = p.base._rotation - ((-(p.targRot - p.base._rotation)) / 8);
} else if (p.order == "walk") {
p.turret.gotoAndStop(1);
p.turret.gattle.gotoAndStop(1);
var ydist = (p._y - p.targ.y);
var xdist = (p._x - p.targ.x);
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p.turret._rotation = p.turret._rotation - ((-(p.targRot - p.turret._rotation)) / 4);
p.base._rotation = p.base._rotation - ((-(p.targRot - p.base._rotation)) / 8);
p.speed = 2 - ((Math.abs(p.targRot - p.base._rotation) / 180) * 2);
if (Math.sqrt((ydist * ydist) + (xdist * xdist)) >= p.speed) {
var yspeed = (Math.cos(rot) * p.speed);
var xspeed = (Math.sin(rot) * p.speed);
p._y = p._y - yspeed;
p._x = p._x - (-xspeed);
} else {
p._y = p.targ.y;
p._x = p.targ.x;
p.order = "stand";
p.gotoAndStop(1);
}
} else if (p.order == "attack") {
if ((p.targ.unit.unit == "comanche") || (p.targ.unit.unit == "helix")) {
p.order = "stand";
} else if (p.targ.unit.HP <= 0) {
p.order = "stand";
p.gotoAndStop(1);
p.turret.gotoAndStop(1);
p.turret.gattle.gotoAndStop(1);
} else {
if (p._parent._name == "p1Vehicles") {
if (team1tankGattling) {
p.turret.gattle.play();
}
} else if (team2tankGattling) {
p.turret.gattle.play();
}
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var distance = Math.sqrt((ydist * ydist) + (xdist * xdist));
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p.turret._rotation = p.turret._rotation - ((-(p.targRot - p.turret._rotation)) / 4);
p.speed = 2 - ((Math.abs(p.targRot - p.base._rotation) / 180) * 2);
p.base._rotation = p.base._rotation - ((-(p.targRot - p.base._rotation)) / 8);
if (distance <= 700) {
p.turret.play();
} else {
p.turret.gotoAndStop(1);
p.turret.gattle.gotoAndStop(1);
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p.turret._rotation = p.turret._rotation - ((-(p.targRot - p.turret._rotation)) / 4);
p.base._rotation = p.base._rotation - ((-(p.targRot - p.base._rotation)) / 8);
p.speed = 2 - ((Math.abs(p.targRot - p.base._rotation) / 180) * 2);
if (Math.sqrt((ydist * ydist) + (xdist * xdist)) >= p.speed) {
var yspeed = (Math.cos(rot) * p.speed);
var xspeed = (Math.sin(rot) * p.speed);
p._y = p._y - yspeed;
p._x = p._x - (-xspeed);
} else {
p._y = p.targ.y;
p._x = p.targ.x;
p.order = "stand";
p.gotoAndStop(1);
}
}
}
} else if (p.order == "die") {
p.turret.gattle.gotoAndStop(1);
p.turret.gotoAndStop(1);
if (p.tankExplosion._currentframe == p.tankExplosion._totalframes) {
p.tankExplosion.stop();
p._alpha = p._alpha - 3;
if (p._alpha <= 5) {
deathmatchHPDeduct(p);
removeMovieClip(p);
}
} else {
p.tankExplosion.play();
}
}
} else if (((p.unit == "gTank") || (p.unit == "lTank")) || (p.unit == "ambulance")) {
if (p.HP <= 0) {
p.aura.gotoAndStop(1);
if (p == focusedUnit) {
reFocus(true);
}
p.order = "die";
p.h.onEnterFrame = null;
removeMovieClip(p.h);
}
if (p.frozen) {
if (p.order != "die") {
p.order = "stand";
}
}
if (p.order == "stand") {
p.base.treads.stop();
p.turret.gotoAndStop(1);
p.targRot = p.angleFace;
p.turret._rotation = p.turret._rotation - ((-(p.targRot - p.turret._rotation)) / 4);
if (Math.abs(p.targRot - p.turret._rotation) < 1) {
p.turret._rotation = p.targRot;
}
p.base._rotation = p.base._rotation - ((-(p.targRot - p.base._rotation)) / 8);
if (Math.abs(p.targRot - p.base._rotation) < 1) {
p.base._rotation = p.targRot;
}
} else if (p.order == "walk") {
p.base.treads.play();
p.turret.gotoAndStop(1);
var ydist = (p._y - p.targ.y);
var xdist = (p._x - p.targ.x);
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p.turret._rotation = p.turret._rotation - ((-(p.targRot - p.turret._rotation)) / 4);
if (Math.abs(p.targRot - p.turret._rotation) < 1) {
p.turret._rotation = p.targRot;
}
p.base._rotation = p.base._rotation - ((-(p.targRot - p.base._rotation)) / 8);
if (Math.abs(p.targRot - p.base._rotation) < 1) {
p.base._rotation = p.targRot;
}
p.speed = 4 - ((Math.abs(p.targRot - p.base._rotation) / 180) * 4);
if (Math.sqrt((ydist * ydist) + (xdist * xdist)) >= p.speed) {
var yspeed = (Math.cos(rot) * p.speed);
var xspeed = (Math.sin(rot) * p.speed);
p._y = p._y - yspeed;
p._x = p._x - (-xspeed);
} else {
p._y = p.targ.y;
p._x = p.targ.x;
p.order = "stand";
p.gotoAndStop(1);
}
} else if (p.order == "attack") {
p.base.treads.stop();
if (p.unit == "ambulance") {
if ((p.targ.unit._parent._name == "p1Helis") || (p.targ.unit._parent._name == "p2Helis")) {
p.order = "stand";
} else if (p.targ.unit.HP <= 0) {
p.order = "stand";
p.turret.gotoAndStop(1);
p.gotoAndStop(1);
} else {
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var distance = Math.sqrt((ydist * ydist) + (xdist * xdist));
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p.turret._rotation = p.turret._rotation - ((-(p.targRot - p.turret._rotation)) / 2);
if (p.unit == "gTank") {
d = 500;
} else if (p.unit == "lTank") {
d = 550;
} else {
d = 400;
}
if (distance <= d) {
p.turret.play();
} else {
p.base.treads.play();
p.turret.gotoAndStop(1);
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p.turret._rotation = p.turret._rotation - ((-(p.targRot - p.turret._rotation)) / 4);
if (Math.abs(p.targRot - p.turret._rotation) < 1) {
p.turret._rotation = p.targRot;
}
p.base._rotation = p.base._rotation - ((-(p.targRot - p.base._rotation)) / 8);
if (Math.abs(p.targRot - p.base._rotation) < 1) {
p.base._rotation = p.targRot;
}
p.speed = 4 - ((Math.abs(p.targRot - p.base._rotation) / 180) * 4);
if (Math.sqrt((ydist * ydist) + (xdist * xdist)) >= p.speed) {
var yspeed = (Math.cos(rot) * p.speed);
var xspeed = (Math.sin(rot) * p.speed);
p._y = p._y - yspeed;
p._x = p._x - (-xspeed);
} else {
p._y = p.targ.y;
p._x = p.targ.x;
p.order = "stand";
p.gotoAndStop(1);
}
}
}
} else if (p.targ.unit.HP <= 0) {
p.order = "stand";
p.turret.gotoAndStop(1);
p.gotoAndStop(1);
} else {
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var distance = Math.sqrt((ydist * ydist) + (xdist * xdist));
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p.turret._rotation = p.turret._rotation - ((-(p.targRot - p.turret._rotation)) / 2);
if (p.unit == "gTank") {
d = 500;
} else if (p.unit == "lTank") {
d = 550;
} else {
d = 400;
}
if (distance <= d) {
p.turret.play();
} else {
p.base.treads.play();
p.turret.gotoAndStop(1);
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p.turret._rotation = p.turret._rotation - ((-(p.targRot - p.turret._rotation)) / 4);
if (Math.abs(p.targRot - p.turret._rotation) < 1) {
p.turret._rotation = p.targRot;
}
p.base._rotation = p.base._rotation - ((-(p.targRot - p.base._rotation)) / 8);
if (Math.abs(p.targRot - p.base._rotation) < 1) {
p.base._rotation = p.targRot;
}
p.speed = 4 - ((Math.abs(p.targRot - p.base._rotation) / 180) * 4);
if (Math.sqrt((ydist * ydist) + (xdist * xdist)) >= p.speed) {
var yspeed = (Math.cos(rot) * p.speed);
var xspeed = (Math.sin(rot) * p.speed);
p._y = p._y - yspeed;
p._x = p._x - (-xspeed);
} else {
p._y = p.targ.y;
p._x = p.targ.x;
p.order = "stand";
p.gotoAndStop(1);
}
}
}
} else if (p.order == "die") {
p.turret.gotoAndStop(1);
if (p.tankExplosion._currentframe == p.tankExplosion._totalframes) {
p.tankExplosion.stop();
p.base.treads.stop();
p._alpha = p._alpha - 3;
if (p._alpha <= 5) {
deathmatchHPDeduct(p);
removeMovieClip(p);
}
} else {
p.tankExplosion.play();
}
}
} else if (p.unit == "comanche") {
if (p.HP <= 0) {
p.aura.gotoAndStop(1);
if (p == focusedUnit) {
reFocus(true);
}
p.order = "die";
p.h.onEnterFrame = null;
removeMovieClip(p.h);
}
if (p.frozen) {
if (p.order != "die") {
p.order = "stand";
}
}
if (p.order == "stand") {
p.base.gattle.gotoAndStop(1);
p.base.r1.pod.gotoAndStop(1);
p.base.r2.pod.gotoAndStop(1);
p.targRot = p.angleFace;
p.base._rotation = p.base._rotation - ((-(p.targRot - p.base._rotation)) / 8);
if (Math.abs(p.targRot - p.base._rotation) < 1) {
p.base._rotation = p.targRot;
}
} else if (p.order == "walk") {
p.base.gattle.gotoAndStop(1);
p.base.r1.pod.gotoAndStop(1);
p.base.r2.pod.gotoAndStop(1);
var ydist = (p._y - p.targ.y);
var xdist = (p._x - p.targ.x);
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p.base._rotation = p.base._rotation - ((-(p.targRot - p.base._rotation)) / 8);
if (Math.abs(p.targRot - p.base._rotation) < 1) {
p.base._rotation = p.targRot;
}
p.speed = 6 - ((Math.abs(p.targRot - p.base._rotation) / 180) * 6);
if (Math.sqrt((ydist * ydist) + (xdist * xdist)) >= p.speed) {
if (Math.abs(p.targRot - p.base._rotation) < 90) {
var yspeed = (Math.cos(rot) * p.speed);
var xspeed = (Math.sin(rot) * p.speed);
p._y = p._y - yspeed;
p._x = p._x - (-xspeed);
}
} else {
p._y = p.targ.y;
p._x = p.targ.x;
p.order = "stand";
p.gotoAndStop(1);
}
} else if (p.order == "attack") {
if (p.targ.unit.HP <= 0) {
p.order = "stand";
p.gotoAndStop(1);
} else {
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var distance = Math.sqrt((ydist * ydist) + (xdist * xdist));
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p.base._rotation = p.base._rotation - ((-(p.targRot - p.base._rotation)) / 2);
if (distance <= 500) {
p.base.gattle.play();
p.base.r1.pod.play();
p.base.r2.pod.play();
} else {
p.base.gattle.gotoAndStop(1);
p.base.r1.pod.gotoAndStop(1);
p.base.r2.pod.gotoAndStop(1);
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p.base._rotation = p.base._rotation - ((-(p.targRot - p.base._rotation)) / 8);
if (Math.abs(p.targRot - p.base._rotation) < 1) {
p.base._rotation = p.targRot;
}
p.speed = 6 - ((Math.abs(p.targRot - p.base._rotation) / 180) * 6);
if (Math.sqrt((ydist * ydist) + (xdist * xdist)) >= p.speed) {
if (Math.abs(p.targRot - p.base._rotation) < 90) {
var yspeed = (Math.cos(rot) * p.speed);
var xspeed = (Math.sin(rot) * p.speed);
p._y = p._y - yspeed;
p._x = p._x - (-xspeed);
}
} else {
p._y = p.targ.y;
p._x = p.targ.x;
p.order = "stand";
p.gotoAndStop(1);
}
}
}
} else if (p.order == "die") {
if (p.heliExplosion._currentframe < 26) {
p._xscale--;
p._yscale--;
p.base._rotation = p.base._rotation - (p.base._rotation / 60);
p.blades._rotation = p.blades._rotation - -18;
}
p.swapDepths((-1000 * int(100 - p._xscale)) + p.num);
p.blades._rotation = p.blades._rotation - -20;
if (p.heliExplosion._currentframe == p.heliExplosion._totalframes) {
p.heliExplosion.stop();
p.base.gattle.gotoAndStop(1);
p.base.r1.pod.gotoAndStop(1);
p.base.r2.pod.gotoAndStop(1);
p._alpha = p._alpha - 4;
if (p._alpha <= 5) {
p.swapDepths(999999);
deathmatchHPDeduct(p);
removeMovieClip(p);
}
} else {
p.heliExplosion.play();
}
}
} else if (p.unit == "helix") {
if (p.HP <= 0) {
p.aura.gotoAndStop(1);
if (p == focusedUnit) {
reFocus(true);
}
p.order = "die";
p.h.onEnterFrame = null;
removeMovieClip(p.h);
}
if (p.frozen) {
if (p.order != "die") {
p.order = "stand";
}
}
if (p.order == "stand") {
p.base.napalmMC.gotoAndStop(1);
p.targRot = p.angleFace;
p.base._rotation = p.base._rotation - ((-(p.targRot - p.base._rotation)) / 12);
if (Math.abs(p.targRot - p.base._rotation) < 1) {
p.base._rotation = p.targRot;
}
} else if (p.order == "walk") {
p.base.napalmMC.gotoAndStop(1);
p.base.gattle.gotoAndStop(1);
p.base.r1.pod.gotoAndStop(1);
p.base.r2.pod.gotoAndStop(1);
var ydist = (p._y - p.targ.y);
var xdist = (p._x - p.targ.x);
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p.base._rotation = p.base._rotation - ((-(p.targRot - p.base._rotation)) / 12);
if (Math.abs(p.targRot - p.base._rotation) < 1) {
p.base._rotation = p.targRot;
}
p.speed = 6 - ((Math.abs(p.targRot - p.base._rotation) / 180) * 6);
if (Math.sqrt((ydist * ydist) + (xdist * xdist)) >= p.speed) {
if (Math.abs(p.targRot - p.base._rotation) < 90) {
var yspeed = (Math.cos(rot) * p.speed);
var xspeed = (Math.sin(rot) * p.speed);
p._y = p._y - yspeed;
p._x = p._x - (-xspeed);
}
} else {
p._y = p.targ.y;
p._x = p.targ.x;
p.order = "stand";
p.gotoAndStop(1);
}
} else if (p.order == "attack") {
if ((p.targ.unit.unit == "comanche") || (p.targ.unit.unit == "helix")) {
p.order = "stand";
} else if (p.targ.unit.HP <= 0) {
p.order = "stand";
p.gotoAndStop(1);
} else {
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var distance = Math.sqrt((ydist * ydist) + (xdist * xdist));
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p.base._rotation = p.base._rotation - ((-(p.targRot - p.base._rotation)) / 2);
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p.base._rotation = p.base._rotation - ((-(p.targRot - p.base._rotation)) / 12);
if (Math.abs(p.targRot - p.base._rotation) < 1) {
p.base._rotation = p.targRot;
}
p.speed = 6 - ((Math.abs(p.targRot - p.base._rotation) / 180) * 6);
if (distance >= p.speed) {
if (Math.abs(p.targRot - p.base._rotation) < 90) {
var yspeed = (Math.cos(rot) * p.speed);
var xspeed = (Math.sin(rot) * p.speed);
p._y = p._y - yspeed;
p._x = p._x - (-xspeed);
}
} else {
p._y = p.targ.y;
p._x = p.targ.x;
if ((p.targ._parent._name == "p1") || (p.targ._parent._name == "p2")) {
p.base._rotation = p.targ._rotation;
} else {
p.base._rotation = p.targ.base._rotation;
}
}
if (distance <= 10) {
p.base.napalmMC.play();
} else {
p.base.napalmMC.gotoAndStop(1);
}
}
} else if (p.order == "die") {
p.base.napalmMC.gotoAndStop(1);
if (p.heliExplosion._currentframe < 20) {
p._xscale--;
p._yscale--;
p.base._rotation = p.base._rotation - (p.base._rotation / 60);
p.blade1._rotation = p.blade1._rotation - 16;
p.blade2._rotation = p.blade2._rotation - -16;
}
p.swapDepths((-1000 * int(100 - p._xscale)) + p.num);
p.blade1._rotation = p.blade1._rotation - 18;
p.blade2._rotation = p.blade2._rotation - -18;
if (p.heliExplosion._currentframe == p.heliExplosion._totalframes) {
p.heliExplosion.stop();
p.base.gattle.gotoAndStop(1);
p.base.r1.pod.gotoAndStop(1);
p.base.r2.pod.gotoAndStop(1);
p._alpha = p._alpha - 4;
if (p._alpha <= 5) {
p.swapDepths(999999);
deathmatchHPDeduct(p);
removeMovieClip(p);
}
} else {
p.heliExplosion.play();
}
}
} else if ((p.unit == "lTroop") || (p.unit == "sniper")) {
if (p.HP <= 0) {
p.aura.gotoAndStop(1);
if (p == focusedUnit) {
reFocus(true);
}
p.order = "die";
p.h.onEnterFrame = null;
removeMovieClip(p.h);
}
if (p.frozen) {
if (p.order != "die") {
p.order = "stand";
}
}
if (p.order == "stand") {
p.gotoAndStop(1);
p.targRot = p.angleFace;
p._rotation = p._rotation - ((-(p.targRot - p._rotation)) / 3);
} else if (p.order == "walk") {
p.gotoAndStop(2);
var ydist = (p._y - p.targ.y);
var xdist = (p._x - p.targ.x);
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p._rotation = p._rotation - ((-(p.targRot - p._rotation)) / 3);
if (Math.sqrt((ydist * ydist) + (xdist * xdist)) >= p.speed) {
var yspeed = (Math.cos(rot) * p.speed);
var xspeed = (Math.sin(rot) * p.speed);
p._y = p._y - yspeed;
p._x = p._x - (-xspeed);
} else {
p._y = p.targ.y;
p._x = p.targ.x;
p.order = "stand";
p.gotoAndStop(1);
}
} else if (p.order == "attack") {
if (p.targ.unit.HP <= 0) {
p.order = "stand";
p.gotoAndStop(1);
} else if (p.unit == "sniper") {
if ((p.targ.unit._parent._name == "p1Helis") || (p.targ.unit._parent._name == "p2Helis")) {
p.order = "stand";
} else {
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var distance = Math.sqrt((ydist * ydist) + (xdist * xdist));
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p._rotation = p._rotation - ((-(p.targRot - p._rotation)) / 2);
d = 800;
if (distance <= d) {
p.gotoAndStop(3);
} else {
p.gotoAndStop(2);
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p._rotation = p._rotation - ((-(p.targRot - p._rotation)) / 3);
if (Math.sqrt((ydist * ydist) + (xdist * xdist)) >= p.speed) {
var yspeed = (Math.cos(rot) * p.speed);
var xspeed = (Math.sin(rot) * p.speed);
p._y = p._y - yspeed;
p._x = p._x - (-xspeed);
} else {
p._y = p.targ.y;
p._x = p.targ.x;
p.order = "stand";
p.gotoAndStop(1);
}
}
}
} else {
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var distance = Math.sqrt((ydist * ydist) + (xdist * xdist));
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p._rotation = p._rotation - ((-(p.targRot - p._rotation)) / 2);
d = 550;
if (distance <= d) {
p.gotoAndStop(3);
} else {
p.gotoAndStop(2);
var ydist = (p._y - p.targ.unit._y);
var xdist = (p._x - p.targ.unit._x);
var rot = (-Math.atan2(xdist, ydist));
p.targRot = rot * radToDeg;
p._rotation = p._rotation - ((-(p.targRot - p._rotation)) / 3);
if (Math.sqrt((ydist * ydist) + (xdist * xdist)) >= p.speed) {
var yspeed = (Math.cos(rot) * p.speed);
var xspeed = (Math.sin(rot) * p.speed);
p._y = p._y - yspeed;
p._x = p._x - (-xspeed);
} else {
p._y = p.targ.y;
p._x = p.targ.x;
p.order = "stand";
p.gotoAndStop(1);
}
}
}
} else if (p.order == "die") {
p.gotoAndStop(4);
}
}
}
function buy(unit) {
if (p1units < p1poplimit) {
if (enemyCanBuy == null) {
enemyCanBuy = true;
startBattleText.onEnterFrame = function () {
this._alpha = this._alpha - 10;
if (this._alpha <= 0) {
removeMovieClip(this);
}
};
}
if (unit == "lInf") {
if (team1Units[0]) {
if (goldDecimal >= lInfPrice) {
units++;
goldDecimal = goldDecimal - lInfPrice;
tempY = 100 + random(550);
p = p1.attachMovie("lInf1", "lInf" + z, z++, {unitValue:lInfPrice, frozen:false, healing:false, num:units, angleFace:90, HP:5, maxHP:5, speed:3, order:"walk", _x:-25, _y:tempY, _rotation:90, targ:{unit:null, x:25, y:tempY}, unit:"lInf"});
healthBarFunction(p);
} else {
outOfMoney();
}
}
} else if (unit == "RPG1") {
if (team1Units[1]) {
if (goldDecimal >= RPGPrice) {
units++;
goldDecimal = goldDecimal - RPGPrice;
tempY = 100 + random(550);
p = p1.attachMovie("RPG1", "RPG" + z, z++, {unitValue:RPGPrice, frozen:false, healing:false, num:units, angleFace:90, HP:6, maxHP:6, speed:3, order:"walk", _x:-25, _y:tempY, _rotation:90, targ:{unit:null, x:25, y:tempY}, unit:"RPG"});
healthBarFunction(p);
} else {
outOfMoney();
}
}
} else if (unit == "hTank") {
if (team1Units[2]) {
if (goldDecimal >= hTankPrice) {
units++;
goldDecimal = goldDecimal - hTankPrice;
tempY = 100 + random(550);
p = p1Vehicles.attachMovie("hTank", "hTank" + z, z++, {unitValue:hTankPrice, frozen:false, healing:false, num:units, angleFace:90, HP:25, maxHP:25, speed:2, order:"walk", _x:-25, _y:tempY, targ:{unit:null, x:25, y:tempY}, unit:"hTank"});
p.turret._rotation = (p.base._rotation = 90);
h = p.createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.onEnterFrame = function () {
if (!this.p.frozen) {
var b = (50 - ((this.p.HP / this.p.maxHP) * 50));
this.t = {rb:-b, gb:-b, bb:-b};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
}
};
healthBarFunction(p);
} else {
outOfMoney();
}
}
} else if (unit == "gTank") {
if (team1Units[3]) {
if (goldDecimal >= gTankPrice) {
units++;
goldDecimal = goldDecimal - gTankPrice;
tempY = 100 + random(550);
p = p1Vehicles.attachMovie("gTank", "gTank" + z, z++, {unitValue:gTankPrice, frozen:false, healing:false, num:units, angleFace:90, HP:15, maxHP:15, speed:4, order:"walk", _x:-25, _y:tempY, targ:{unit:null, x:25, y:tempY}, unit:"gTank"});
p.turret._rotation = (p.base._rotation = 90);
h = p.createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.onEnterFrame = function () {
if (!this.p.frozen) {
var b = (50 - ((this.p.HP / this.p.maxHP) * 50));
this.t = {rb:-b, gb:-b, bb:-b};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
}
};
healthBarFunction(p);
} else {
outOfMoney();
}
}
} else if (unit == "comanche") {
if (team1Units[4]) {
if (goldDecimal >= comanchePrice) {
units++;
goldDecimal = goldDecimal - comanchePrice;
tempY = 100 + random(550);
p = p1Helis.attachMovie("comanche", "comanche" + z, z++, {unitValue:comanchePrice, frozen:false, healing:false, num:units, angleFace:90, HP:10, maxHP:10, speed:4, order:"walk", _x:-25, _y:tempY, targ:{unit:null, x:75, y:tempY}, unit:"comanche"});
p.base._rotation = 90;
h = p.createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.onEnterFrame = function () {
if (!this.p.frozen) {
var b = (50 - ((this.p.HP / this.p.maxHP) * 50));
this.t = {rb:-b, gb:-b, bb:-b};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
}
};
healthBarFunction(p);
} else {
outOfMoney();
}
}
} else if (unit == "lTroop") {
if (team1Units[5]) {
if (goldDecimal >= lTroopPrice) {
units++;
goldDecimal = goldDecimal - lTroopPrice;
tempY = 100 + random(550);
p = p1.attachMovie("lTroop", "lTroop" + z, z++, {unitValue:lTroopPrice, frozen:false, healing:false, num:units, angleFace:90, HP:6, maxHP:6, speed:3, order:"walk", _x:-25, _y:tempY, _rotation:90, targ:{unit:null, x:25, y:tempY}, unit:"lTroop"});
healthBarFunction(p);
} else {
outOfMoney();
}
}
} else if (unit == "lTank") {
if (team1Units[6]) {
if (goldDecimal >= lTankPrice) {
units++;
goldDecimal = goldDecimal - lTankPrice;
tempY = 100 + random(550);
p = p1Vehicles.attachMovie("lTank", "lTank" + z, z++, {unitValue:lTankPrice, frozen:false, healing:false, num:units, angleFace:90, HP:20, maxHP:20, speed:4, order:"walk", _x:-25, _y:tempY, targ:{unit:null, x:25, y:tempY}, unit:"lTank"});
p.turret._rotation = (p.base._rotation = 90);
h = p.createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.onEnterFrame = function () {
if (!this.p.frozen) {
var b = (50 - ((this.p.HP / this.p.maxHP) * 50));
this.t = {rb:-b, gb:-b, bb:-b};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
}
};
healthBarFunction(p);
} else {
outOfMoney();
}
}
} else if (unit == "sniper") {
if (team1Units[7]) {
if (goldDecimal >= sniperPrice) {
units++;
goldDecimal = goldDecimal - sniperPrice;
tempY = 100 + random(550);
p = p1.attachMovie("sniper", "sniper" + z, z++, {unitValue:sniperPrice, frozen:false, healing:false, num:units, angleFace:90, HP:5, maxHP:5, speed:3, order:"walk", _x:-25, _y:tempY, _rotation:90, targ:{unit:null, x:25, y:tempY}, unit:"sniper"});
healthBarFunction(p);
} else {
outOfMoney();
}
}
} else if (unit == "helix") {
if (team1Units[8]) {
if (goldDecimal >= helixPrice) {
units++;
goldDecimal = goldDecimal - helixPrice;
tempY = 100 + random(550);
p = p1Helis.attachMovie("helix", "helix" + z, z++, {unitValue:helixPrice, frozen:false, healing:false, num:units, angleFace:90, HP:20, maxHP:20, speed:0.5, order:"walk", _x:-50, _y:tempY, targ:{unit:null, x:110, y:tempY}, unit:"helix"});
p.base._rotation = 90;
h = p.createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.onEnterFrame = function () {
if (!this.p.frozen) {
var b = (50 - ((this.p.HP / this.p.maxHP) * 50));
this.t = {rb:-b, gb:-b, bb:-b};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
}
};
healthBarFunction(p);
} else {
outOfMoney();
}
}
} else if (unit == "ambulance") {
if (team1Units[9]) {
if (goldDecimal >= ambulancePrice) {
units++;
goldDecimal = goldDecimal - ambulancePrice;
tempY = 100 + random(550);
p = p1Vehicles.attachMovie("ambulance", "ambulance" + z, z++, {unitValue:ambulancePrice, frozen:false, healing:false, num:units, angleFace:90, HP:10, maxHP:10, speed:7, order:"walk", _x:-25, _y:tempY, targ:{unit:null, x:25, y:tempY}, unit:"ambulance"});
a = p1ambulancePulses.attachMovie("ambulancePulse", p._name + "_ambulancePulse", z++, {targ:p, _x:p._x, _y:p._y});
a.onEnterFrame = function () {
this._x = this.targ._x;
this._y = this.targ._y;
if (this.targ.HP <= 0) {
removeMovieClip(this);
}
};
p.pulse = a;
p.turret._rotation = (p.base._rotation = 90);
h = p.createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.onEnterFrame = function () {
if (!this.p.frozen) {
var b = (50 - ((this.p.HP / this.p.maxHP) * 50));
this.t = {rb:-b, gb:-b, bb:-b};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
}
};
healthBarFunction(p);
} else {
outOfMoney();
}
}
} else if (unit == "homingMissileUpgrade") {
if (goldDecimal >= 800) {
goldDecimal = goldDecimal - 800;
team1HomingMissiles = true;
} else {
outOfMoney();
}
} else if (unit == "rocketPodsUpgrade") {
if (goldDecimal >= 700) {
goldDecimal = goldDecimal - 700;
team1RocketPods = true;
for (var i in p1Helis) {
p = p1Helis[i];
if (p.unit == "comanche") {
p.base.r1.gotoAndStop(2);
p.base.r2.gotoAndStop(2);
}
}
} else {
outOfMoney();
}
} else if (unit == "APBulletsUpgrade") {
if (goldDecimal >= 500) {
goldDecimal = goldDecimal - 500;
team1APBullets = true;
} else {
outOfMoney();
}
} else if (unit == "laserUpgrade") {
if (goldDecimal >= 500) {
goldDecimal = goldDecimal - 500;
team1laserUpgrade = true;
} else {
outOfMoney();
}
} else if (unit == "tankUpgrade") {
if (goldDecimal >= 500) {
goldDecimal = goldDecimal - 500;
team1TankGattling = true;
} else {
outOfMoney();
}
}
} else {
outOfPop();
}
}
function buy2(unit) {
if (p2units < p2poplimit) {
if (enemyQueuedPurchase != null) {
unit = enemyQueuedPurchase;
}
if (unit == 0) {
if (p2goldDecimal >= lInfPrice) {
units++;
p2goldDecimal = p2goldDecimal - lInfPrice;
tempY = 100 + random(550);
p = p2.attachMovie("lInf2", "lInf" + z, z++, {unitValue:lInfPrice, frozen:false, healing:false, num:units, angleFace:-90, HP:5, maxHP:5, speed:3, selected:false, order:"walk", _x:1305, _y:tempY, _rotation:270, targ:{unit:null, x:1255, y:tempY}, unit:"lInf"});
healthBarFunction(p);
} else {
enemyQueuedPurchase = unit;
}
} else if (unit == 1) {
if (p2goldDecimal >= RPGPrice) {
units++;
p2goldDecimal = p2goldDecimal - RPGPrice;
tempY = 100 + random(550);
p = p2.attachMovie("RPG2", "RPG" + z, z++, {unitValue:RPGPrice, frozen:false, healing:false, num:units, angleFace:-90, HP:6, maxHP:6, speed:2, selected:false, order:"walk", _x:1305, _y:tempY, _rotation:270, targ:{unit:null, x:1255, y:tempY}, unit:"RPG"});
healthBarFunction(p);
} else {
enemyQueuedPurchase = unit;
}
} else if (unit == 2) {
if (p2goldDecimal >= hTankPrice) {
units++;
p2goldDecimal = p2goldDecimal - hTankPrice;
tempY = 100 + random(550);
p = p2Vehicles.attachMovie("hTank2", "hTank2" + z, z++, {unitValue:hTankPrice, frozen:false, healing:false, num:units, angleFace:-90, HP:25, maxHP:25, speed:3, selected:false, order:"walk", _x:1305, _y:tempY, targ:{unit:null, x:1255, y:tempY}, unit:"hTank"});
p.turret._rotation = (p.base._rotation = -90);
h = p.createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.onEnterFrame = function () {
if (!this.p.frozen) {
var b = (50 - ((this.p.HP / this.p.maxHP) * 50));
this.t = {rb:-b, gb:-b, bb:-b};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
}
};
healthBarFunction(p);
} else {
enemyQueuedPurchase = unit;
}
} else if (unit == 3) {
if (p2goldDecimal >= gTankPrice) {
units++;
p2goldDecimal = p2goldDecimal - gTankPrice;
tempY = 100 + random(550);
p = p2Vehicles.attachMovie("gTank2", "gTank2" + z, z++, {unitValue:gTankPrice, frozen:false, healing:false, num:units, angleFace:-90, HP:15, maxHP:15, speed:4, selected:false, order:"walk", _x:1305, _y:tempY, targ:{unit:null, x:1255, y:tempY}, unit:"gTank"});
p.turret._rotation = (p.base._rotation = -90);
h = p.createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.onEnterFrame = function () {
if (!this.p.frozen) {
var b = (50 - ((this.p.HP / this.p.maxHP) * 50));
this.t = {rb:-b, gb:-b, bb:-b};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
}
};
healthBarFunction(p);
} else {
enemyQueuedPurchase = unit;
}
} else if (unit == 4) {
if (p2goldDecimal >= comanchePrice) {
units++;
p2goldDecimal = p2goldDecimal - comanchePrice;
tempY = 100 + random(550);
p = p2Helis.attachMovie("comanche2", "comanche2" + z, z++, {unitValue:comanchePrice, frozen:false, healing:false, num:units, angleFace:-90, HP:10, maxHP:10, speed:4, selected:false, order:"walk", _x:1305, _y:tempY, targ:{unit:null, x:1255, y:tempY}, unit:"comanche"});
p.base._rotation = -90;
h = p.createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.onEnterFrame = function () {
if (!this.p.frozen) {
var b = (50 - ((this.p.HP / this.p.maxHP) * 50));
this.t = {rb:-b, gb:-b, bb:-b};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
}
};
healthBarFunction(p);
} else {
enemyQueuedPurchase = unit;
}
} else if (unit == 5) {
if (p2goldDecimal >= lTroopPrice) {
units++;
p2goldDecimal = p2goldDecimal - lTroopPrice;
tempY = 100 + random(550);
p = p2.attachMovie("lTroop2", "lTroop" + z, z++, {unitValue:lTroopPrice, frozen:false, healing:false, num:units, angleFace:-90, HP:6, maxHP:6, speed:3, selected:false, order:"walk", _x:1305, _y:tempY, _rotation:270, targ:{unit:null, x:1255, y:tempY}, unit:"lTroop"});
healthBarFunction(p);
} else {
enemyQueuedPurchase = unit;
}
} else if (unit == 6) {
if (p2goldDecimal >= lTankPrice) {
units++;
p2goldDecimal = p2goldDecimal - lTankPrice;
tempY = 100 + random(550);
p = p2Vehicles.attachMovie("lTank2", "lTank2" + z, z++, {unitValue:lTankPrice, frozen:false, healing:false, num:units, angleFace:-90, HP:20, maxHP:20, speed:4, selected:false, order:"walk", _x:1305, _y:tempY, targ:{unit:null, x:1255, y:tempY}, unit:"gTank"});
p.turret._rotation = (p.base._rotation = -90);
h = p.createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.onEnterFrame = function () {
if (!this.p.frozen) {
var b = (50 - ((this.p.HP / this.p.maxHP) * 50));
this.t = {rb:-b, gb:-b, bb:-b};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
}
};
healthBarFunction(p);
} else {
enemyQueuedPurchase = unit;
}
} else if (unit == 7) {
if (p2goldDecimal >= sniperPrice) {
units++;
p2goldDecimal = p2goldDecimal - sniperPrice;
tempY = 100 + random(550);
p = p2.attachMovie("sniper2", "sniper" + z, z++, {unitValue:sniperPrice, frozen:false, healing:false, num:units, angleFace:-90, HP:5, maxHP:5, speed:3, selected:false, order:"walk", _x:1305, _y:tempY, _rotation:270, targ:{unit:null, x:1255, y:tempY}, unit:"sniper"});
healthBarFunction(p);
} else {
enemyQueuedPurchase = unit;
}
} else if (unit == 8) {
if (p2goldDecimal >= helixPrice) {
units++;
p2goldDecimal = p2goldDecimal - helixPrice;
tempY = 100 + random(550);
p = p2Helis.attachMovie("helix2", "helix2" + z, z++, {unitValue:helixPrice, frozen:false, healing:false, num:units, angleFace:-90, HP:20, maxHP:20, speed:0.5, selected:false, order:"walk", _x:1330, _y:tempY, targ:{unit:null, x:1170, y:tempY}, unit:"helix"});
p.base._rotation = -90;
h = p.createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.onEnterFrame = function () {
if (!this.p.frozen) {
var b = (50 - ((this.p.HP / this.p.maxHP) * 50));
this.t = {rb:-b, gb:-b, bb:-b};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
}
};
healthBarFunction(p);
} else {
enemyQueuedPurchase = unit;
}
} else if (unit == 9) {
if (p2goldDecimal >= ambulancePrice) {
units++;
p2goldDecimal = p2goldDecimal - ambulancePrice;
tempY = 100 + random(550);
p = p2Vehicles.attachMovie("ambulance2", "ambulance2" + z, z++, {unitValue:ambulancePrice, frozen:false, healing:false, num:units, angleFace:-90, HP:15, maxHP:15, speed:7, selected:false, order:"walk", _x:1305, _y:tempY, targ:{unit:null, x:1255, y:tempY}, unit:"ambulance"});
a = p2ambulancePulses.attachMovie("ambulancePulse", p._name + "_ambulancePulse", z++, {targ:p, _x:p._x, _y:p._y});
a.onEnterFrame = function () {
this._x = this.targ._x;
this._y = this.targ._y;
if (this.targ.HP <= 0) {
removeMovieClip(this);
}
};
p.pulse = a;
p.turret._rotation = (p.base._rotation = -90);
h = p.createEmptyMovieClip("flasher" + z, z++);
h.p = p;
h.onEnterFrame = function () {
if (!this.p.frozen) {
var b = (50 - ((this.p.HP / this.p.maxHP) * 50));
this.t = {rb:-b, gb:-b, bb:-b};
this.tColor = new Color(this.p);
this.tColor.setTransform(this.t);
}
};
healthBarFunction(p);
} else {
enemyQueuedPurchase = unit;
}
} else if (unit == 10) {
if (p2goldDecimal >= 800) {
p2goldDecimal = p2goldDecimal - 800;
team2HomingMissiles = true;
} else {
enemyQueuedPurchase = unit;
}
} else if (unit == 11) {
if (p2goldDecimal >= 700) {
p2goldDecimal = p2goldDecimal - 700;
team2RocketPods = true;
for (var i in p2Helis) {
p = p2Helis[i];
if (p.unit == "comanche") {
p.base.r1.gotoAndStop(2);
p.base.r2.gotoAndStop(2);
}
}
} else {
enemyQueuedPurchase = unit;
}
} else if (unit == 12) {
if (p2goldDecimal >= 500) {
p2goldDecimal = p2goldDecimal - 500;
team2APBullets = true;
} else {
enemyQueuedPurchase = unit;
}
} else if (unit == 13) {
if (p2goldDecimal >= 500) {
p2goldDecimal = p2goldDecimal - 500;
team2laserUpgrade = true;
} else {
enemyQueuedPurchase = unit;
}
} else if (unit == 14) {
if (p2goldDecimal >= 500) {
p2goldDecimal = p2goldDecimal - 500;
team2tankGattling = true;
} else {
enemyQueuedPurchase = unit;
}
}
}
}
function healthBarFunction(p) {
p.h = healthBars.createEmptyMovieClip(p._name + "_healthBar", z++);
redCross = healthBars.attachMovie("redCross", p._name + "_redCross", z++, {_visible:false, targ:p});
p.redCross = redCross;
p.h.redCross = redCross;
redCross.onEnterFrame = function () {
this._visible = this.targ.healing;
if (this._visible) {
this._x = this.targ._x;
this._y = this.targ._y;
}
};
p.h.targ = p;
p.h.HP = p.maxHP;
p.h.onEnterFrame = function () {
this.clear();
this.moveTo(this.targ._x - 10, this.targ._y - 20);
this.lineStyle(2, 65280, 100);
if (this.targ.HP == this.targ.maxHP) {
this.lineTo(this.targ._x + 10, this.targ._y - 20);
} else {
targHP = this.targ.HP;
tempVar = this.HP / this.targ.maxHP;
tempVar2 = (this.targ._x - 10) + (tempVar * 20);
this.lineTo(tempVar2, this.targ._y - 20);
this.lineStyle(2, 16711680, 100);
this.lineTo(tempVar2 + ((1 - tempVar) * 20), this.targ._y - 20);
tempVar3 = (this.targ.HP - this.HP) / 4;
if (tempVar3 <= 0.3) {
Math.round(this.HP);
}
this.HP = this.HP - (-tempVar3);
}
};
p.h.onUnload = function () {
removeMovieClip(this.redCross);
};
}
createShrapnel = function () {
mc = this.createEmptyMovieClip("shrapnel" + this.z, this.z++);
mc.r = random(2) + 4;
mc.ex = 0;
mc.why = 0;
mc.speed = 2;
mc.targScale = 10;
mc.angle = 75 + (Math.random() * 3);
mc.xs = Math.cos(mc.angle * radToDeg) * (-mc.speed);
mc.ys = Math.sin(mc.angle * radToDeg) * mc.speed;
mc.rot = random(360);
mc._xscale = (mc._yscale = -100);
mc.xspeed = Math.sin(mc.rot * degToRad);
mc.yspeed = Math.cos(mc.rot * degToRad);
mc.moveTo(mc.ex + mc.r, mc.why);
col = ((("6" + random(10)) + 3) + random(10)) + "00";
mc.beginFill(parseInt("0x" + col), 100);
mc.curveTo(mc.r + mc.ex, (tm8 * mc.r) + mc.why, (sm4 * mc.r) + mc.ex, (sm4 * mc.r) + mc.why);
mc.curveTo((tm8 * mc.r) + mc.ex, mc.r + mc.why, mc.ex, mc.r + mc.why);
mc.curveTo(((-tm8) * mc.r) + mc.ex, mc.r + mc.why, ((-sm4) * mc.r) + mc.ex, (sm4 * mc.r) + mc.why);
mc.curveTo((-mc.r) + mc.ex, (tm8 * mc.r) + mc.why, (-mc.r) + mc.ex, mc.why);
mc.curveTo((-mc.r) + mc.ex, ((-tm8) * mc.r) + mc.why, ((-sm4) * mc.r) + mc.ex, ((-sm4) * mc.r) + mc.why);
mc.curveTo(((-tm8) * mc.r) + mc.ex, (-mc.r) + mc.why, mc.ex, (-mc.r) + mc.why);
mc.curveTo((tm8 * mc.r) + mc.ex, (-mc.r) + mc.why, (sm4 * mc.r) + mc.ex, ((-sm4) * mc.r) + mc.why);
mc.curveTo(mc.r + mc.ex, ((-tm8) * mc.r) + mc.why, mc.r + mc.ex, mc.why);
mc.endFill();
};
gravity = 0.5;
m8 = 0.392699081698724;
m4 = (Math.PI/4);
tm8 = Math.tan(m8);
sm4 = Math.sin(m4);
_quality = save.quality;
doubleClickTick = (doubleClickTickInit = 15);
lastDepressed = null;
oldLastDepressed = null;
singleClicking = false;
powerBallTeam = (flagTeam = 0);
theFlagHolder = (theBallHolder = null);
healGap = (healGapInit = 3);
nukePercent = 0;
p2nukePercent = 0;
habisLaserPercent = 0;
p2habisLaserPercent = 0;
troopFreezePercent = 0;
p2troopFreezePercent = 0;
hotKeySelections = [[], [], [], [], [], [], [], [], [], []];
runDown = (runDownInit = 90);
firetAtWillPc = 0;
units = 0;
shakeX = 0;
shakeY = 0;
oldShakeX = 0;
oldShakeY = 0;
formation = 1;
p2formation = 1;
habisLaserShakeGap = (habisLaserShakeGapInit = 3);
click = null;
radToDeg = 57.2957795130823;
degToRad = (Math.PI/180);
lInfPrice = 250;
RPGPrice = 300;
lTroopPrice = 400;
hTankPrice = 650;
gTankPrice = 550;
ambulancePrice = 800;
lTankPrice = 700;
sniperPrice = 500;
comanchePrice = 600;
helixPrice = 1000;
startingGold = team1Budget;
p2StartingGold = team2Budget;
gold = startingGold;
goldDecimal = startingGold;
p2gold = p2StartingGold;
p2goldDecimal = p2StartingGold;
xscreenOffset = 0;
YscreenOffset = 0;
pop = 0;
maxPop = 10;
p2Pop = 0;
focusSound = true;
currentHP = (currentHPUnrounded = (maxHP = 100));
p2CurrentHP = (p2currentHPUnrounded = (p2MaxHP = 100));
channels = 0;
focusedUnit = null;
enemyCanBuy = null;
previousHUD = 1;
enemyQueuedPurchase = null;
team2Units = [];
particlesize = 75;
particlesize2 = particlesize * 2;
laserClicked = 0;
troopFreezeClicked = 0;
scrollSpeed = 40;
diagonalScrollSpeed = scrollSpeed / Math.SQRT2;
lastX = 0;
lastY = 0;
depressedUnit = null;
if (team2TempUnits[0]) {
var i = 0;
while (i <= 3) {
team2Units.push(0);
i++;
}
}
if (team2TempUnits[1]) {
var i = 0;
while (i <= 2) {
team2Units.push(1);
i++;
}
}
if (team2TempUnits[2]) {
team2Units.push(2);
}
if (team2TempUnits[3]) {
var i = 0;
while (i <= 2) {
team2Units.push(3);
i++;
}
}
if (team2TempUnits[4]) {
var i = 0;
while (i <= 2) {
team2Units.push(4);
i++;
}
}
if (team2TempUnits[5]) {
var i = 0;
while (i <= 2) {
team2Units.push(5);
i++;
}
}
if (team2TempUnits[6]) {
team2Units.push(6);
}
if (team2TempUnits[7]) {
team2Units.push(7);
}
if (team2TempUnits[8]) {
team2Units.push(8);
}
if (team2TempUnits[9]) {
var i = 0;
while (i <= 2) {
team2Units.push(9);
i++;
}
}
theMap.texture.gotoAndStop(random(theMap.texture._totalframes) + 1);
createEmptyMovieClip("music", z++);
createEmptyMovieClip("soundFX", z++);
createEmptyMovieClip("voices", z++);
music.gameSound = new Sound(music);
music.gameSound.attachSound("battleMusic");
music.gameSound.start(0, 0);
music.gameSound.setVolume(save.musicVolume);
music.gameSound.onSoundComplete = function () {
delete music.gameSound;
music.gameSound = new Sound(music);
music.gameSound.attachSound("battleMusic");
music.gameSound.start(0, 0);
music.gameSound.setVolume(save.musicVolume);
};
attachMovie("startBattleText", "startBattleText", z++);
createEmptyMovieClip("lowEyeCandy", z++);
createEmptyMovieClip("habisLaserEyeCandyLow", z++);
if (gameMode == "kingofthehill") {
attachMovie("kingRing", "kingRing", z++, {_x:640, _y:378});
kingRing.radius = kingRing._width / 2;
} else if (gameMode == "capturetheflag") {
attachMovie("flagArea", "flagArea", z++, {_x:0, _y:0});
attachMovie("flagArea2", "flagArea2", z++, {_x:1280, _y:0});
}
createEmptyMovieClip("p1", z++);
createEmptyMovieClip("p2", z++);
createEmptyMovieClip("p1Vehicles", z++);
createEmptyMovieClip("p2Vehicles", z++);
createEmptyMovieClip("p1ambulancePulses", z++);
createEmptyMovieClip("p2ambulancePulses", z++);
createEmptyMovieClip("landEyeCandy", z++);
createEmptyMovieClip("p1Helis", z++);
createEmptyMovieClip("p2Helis", z++);
if (gameMode == "capturetheflag") {
attachMovie("flag", "flag", z++, {_x:640, _y:378, targ:null});
} else if (gameMode == "powerball") {
attachMovie("powerBall", "powerBall", z++, {_x:640, _y:378, targ:null});
}
createEmptyMovieClip("troopFreeze", z++);
createEmptyMovieClip("eyeCandy", z++);
createEmptyMovieClip("shrapnels", z++);
createEmptyMovieClip("habisLaserEyeCandy", z++);
createEmptyMovieClip("habisLasers", z++);
createEmptyMovieClip("freezeCandy", z++);
createEmptyMovieClip("healthBars", z++);
createEmptyMovieClip("hotkeyHovers", z++);
createEmptyMovieClip("cursorLines", z++);
createEmptyMovieClip("nukes", z++);
createEmptyMovieClip("nukeCandy", z++);
nukes._xscale = (nukes._yscale = (nukeCandy._xscale = (nukeCandy._yscale = 200)));
attachMovie("troopFreezeRing", "troopFreezeRing", z++, {_visible:false});
createEmptyMovieClip("habisFlash", z++);
if (cashBounty) {
createEmptyMovieClip("cashBounties", z++);
}
attachMovie("HUD", "HUD", z++);
attachMovie("qualityChangeText", "qualityChangeText", z++);
HUD.minimap.gotoAndStop(theMap.texture._currentframe);
HUD.minimap.createEmptyMovieClip("minimapBlips", z++);
HUD.minimap.createEmptyMovieClip("minimapBlipsMask", z++);
_root[cursorName].attachMovie("superPowerCursor", "superPowerCursor", z++, {_visible:false, _x:-5, _y:-5});
_root[cursorName].attachMovie("troopFreezeCursor", "troopFreezeCursor", z++, {_visible:false, _x:-5, _y:-5});
_root[cursorName].attachMovie("unshootableCursor", "unshootableCursor", z++, {_visible:false, _x:-5, _y:-5});
_root[cursorName].attachMovie("shiftCursor", "shiftCursor", z++, {_visible:false, _x:10, _y:9});
_root[cursorName].shiftCursor.gotoAndStop((MacUser ? 2 : 1));
s = HUD.minimap.screenHighlight;
s.dragging = false;
HUD.minimap.minimapBlips._xscale = 7.8;
HUD.minimap.minimapBlips._yscale = 7.8;
HUD.minimap.minimapBlipsMask.lineStyle(1, 0, 100);
HUD.minimap.minimapBlipsMask.beginFill(0, 100);
HUD.minimap.minimapBlipsMask.moveTo(1, 0);
HUD.minimap.minimapBlipsMask.lineTo(99, 0);
HUD.minimap.minimapBlipsMask.lineTo(99, 58);
HUD.minimap.minimapBlipsMask.lineTo(1, 58);
HUD.minimap.minimapBlipsMask.lineTo(1, 0);
HUD.minimap.minimapBlipsMask.endFill();
HUD.minimap.minimapBlips.setMask(HUD.minimap.minimapBlipsMask);
HUD.healthBar.setMask(HUD.healthBarMask1);
HUD.p2healthBar.setMask(HUD.healthBarMask2);
s.onPress = (s.onDragOver = (s.onDragOut = function () {
this.dragging = true;
}));
s.onRelease = (s.onReleaseOutside = function () {
this.dragging = false;
});
selectedBuilding = "Buildings";
enemyWait = (enemyWaitInit = difficulty);
onMouseMove = function () {
Mouse.hide();
};
HUD.b1.onRelease = function () {
HUD.bIcon.gotoAndStop(6);
};
onMouseDown = function () {
if (laserClicked != 1) {
if (troopFreezeClicked != 1) {
if (!HUD.hitTest(_xmouse, _ymouse, true)) {
click = {x:_xmouse, y:_ymouse};
selectedUnits = 0;
for (var i in p1) {
p = p1[i];
if (p.aura._currentframe == 3) {
selectedUnits++;
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
if (p.aura._currentframe == 3) {
selectedUnits++;
}
}
for (var i in p1Helis) {
p = p1Helis[i];
if (p.aura._currentframe == 3) {
selectedUnits++;
}
}
if (selectedUnits == 0) {
if (!Key.isDown(17)) {
singleClicking = true;
d = 100000 /* 0x0186A0 */;
u = null;
for (var i in p1) {
p = p1[i];
if (p.HP > 0) {
xdist = _xmouse - p._x;
ydist = _ymouse - p._y;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < ((10 * p.aura._xscale) / 100)) {
if (dist < d) {
d = dist;
u = p;
}
}
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
if (p.HP > 0) {
xdist = _xmouse - p._x;
ydist = _ymouse - p._y;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < ((10 * p.aura._xscale) / 100)) {
if (dist < d) {
d = dist;
u = p;
}
}
}
}
for (var i in p1Helis) {
p = p1Helis[i];
if (p.HP > 0) {
xdist = _xmouse - p._x;
ydist = _ymouse - p._y;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < ((10 * p.aura._xscale) / 100)) {
if (dist < d) {
d = dist;
u = p;
}
}
}
}
if (u != null) {
u.aura.gotoAndStop(2);
depressedUnit = u;
}
}
} else if (Key.isDown(16)) {
if (!Key.isDown(17)) {
singleClicking = true;
d = 100000 /* 0x0186A0 */;
u = null;
for (var i in p1) {
p = p1[i];
if (p.HP > 0) {
xdist = _xmouse - p._x;
ydist = _ymouse - p._y;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < ((10 * p.aura._xscale) / 100)) {
if (dist < d) {
d = dist;
u = p;
}
}
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
if (p.HP > 0) {
xdist = _xmouse - p._x;
ydist = _ymouse - p._y;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < ((10 * p.aura._xscale) / 100)) {
if (dist < d) {
d = dist;
u = p;
}
}
}
}
for (var i in p1Helis) {
p = p1Helis[i];
if (p.HP > 0) {
xdist = _xmouse - p._x;
ydist = _ymouse - p._y;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < ((10 * p.aura._xscale) / 100)) {
if (dist < d) {
d = dist;
u = p;
}
}
}
}
if (u != null) {
u.aura.gotoAndStop(2);
depressedUnit = u;
}
}
}
}
}
}
};
onMouseUp = function () {
if (laserClicked != 1) {
if (troopFreezeClicked != 1) {
focusSound = true;
var xdist = Math.abs(_xmouse - click.x);
var ydist = Math.abs(_ymouse - click.y);
if ((xdist + ydist) <= 10) {
selectedUnits = 0;
for (var i in p1) {
p = p1[i];
if (p.aura._currentframe == 3) {
selectedUnits++;
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
if (p.aura._currentframe == 3) {
selectedUnits++;
}
}
for (var i in p1Helis) {
p = p1Helis[i];
if (p.aura._currentframe == 3) {
selectedUnits++;
}
}
if (((!p1.hitTest(_xmouse, _ymouse, true)) && (!p1Vehicles.hitTest(_xmouse, _ymouse, true))) && (!p1Helis.hitTest(_xmouse, _ymouse, true))) {
dist = 10000;
clickedEnemy = null;
a = [];
for (var i in p2) {
a.push(p2[i]);
}
for (var i in p2Vehicles) {
a.push(p2Vehicles[i]);
}
for (var i in p2Helis) {
a.push(p2Helis[i]);
}
for (var i in a) {
p = a[i];
var xdist2 = (p._x - _xmouse);
var ydist2 = (p._y - _ymouse);
var distance = Math.sqrt((xdist2 * xdist2) + (ydist2 * ydist2));
if (distance <= 30) {
if (distance < dist) {
dist = distance;
clickedEnemy = p;
}
}
}
if (Key.isDown(17)) {
HUD.bIcon.gotoAndStop(previousHUD);
deselectAll();
} else if (clickedEnemy == null) {
if (!Key.isDown(32)) {
var a = [];
for (var i in p1) {
p = p1[i];
if (p.aura._currentframe == 3) {
a.push(p);
p.order = "walk";
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
if (p.aura._currentframe == 3) {
a.push(p);
p.order = "walk";
}
}
for (var i in p1Helis) {
p = p1Helis[i];
if (p.aura._currentframe == 3) {
a.push(p);
p.order = "walk";
}
}
if (formation == 1) {
offset = 0;
b = 7.5;
bVehicle = 25;
bHeli = 30;
distance = 0;
for (var i in a) {
w = a[i];
if (w._parent._name == "p1") {
distance = distance - (-b);
} else if (w._parent._name == "p1Vehicles") {
distance = distance - (-bVehicle);
} else if (w._parent._name == "p1Helis") {
distance = distance - (-bHeli);
}
}
while ((distance * 2) > 680) {
distance = 0;
b = b - 0.1;
bVehicle = bVehicle - 0.1;
bHeli = bHeli - 0.1;
for (var i in a) {
w = a[i];
if (w._parent._name == "p1") {
distance = distance - (-b);
} else if (w._parent._name == "p1Vehicles") {
distance = distance - (-bVehicle);
} else if (w._parent._name == "p1Helis") {
distance = distance - (-bHeli);
}
}
}
while (((_ymouse - offset) + distance) > 720) {
offset = offset + 5;
}
while (((_ymouse - offset) - distance) < 5) {
offset = offset - 0.5;
}
n = [];
var i = 0;
while (i < a.length) {
p = a[i];
if (i == 0) {
if (p._parent._name == "p1Vehicles") {
n.push(bVehicle);
} else if (p._parent._name == "p1") {
n.push(b);
} else if (p._parent._name == "p1Helis") {
n.push(bHeli);
}
} else if (p._parent._name == "p1Vehicles") {
n.push(n[i - 1] + (bVehicle * 2));
} else if (p._parent._name == "p1") {
n.push(n[i - 1] + (b * 2));
} else if (p._parent._name == "p1Helis") {
n.push(n[i - 1] + (bHeli * 2));
}
i++;
}
var i = 0;
while (i < a.length) {
a[i].targ = {unit:null, x:_xmouse, y:((_ymouse - offset) - distance) + n[i]};
a[i].angleFace = 90;
i++;
}
} else if (formation == 2) {
vehicles = 0;
var i = 0;
while (i < a.length) {
k = a[i];
if (k._parent != p1) {
vehicles++;
}
i++;
}
degreesPerDude = 360 / a.length;
b = 4;
radius = (4 + (vehicles * 3)) * a.length;
var i = 0;
while (i < a.length) {
tempVar2 = degreesPerDude * i;
tempVar = tempVar2 * degToRad;
a[i].targ = {unit:null, x:Math.max(20, Math.min(1260, _xmouse + (Math.sin(tempVar) * radius))), y:Math.max(5, Math.min(_ymouse + (Math.cos(tempVar) * radius), 720))};
a[i].angleFace = 180 - tempVar2;
i++;
}
}
if (selectedUnits > 0) {
voices["mySound" + channels] = new Sound(voices);
voices["mySound" + channels].attachSound("LInfW" + (random(3) + 1));
voices["mySound" + channels].start();
voices["mySound" + channels].setVolume(save.voiceVolume);
channels++;
}
}
} else {
for (var i in p1) {
p = p1[i];
if (p.aura._currentframe == 3) {
p.order = "attack";
p.targ = {unit:clickedEnemy};
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
if (p.aura._currentframe == 3) {
p.order = "attack";
p.targ = {unit:clickedEnemy, unitx:clickedEnemy._x, unity:clickedEnemy._y};
}
}
for (var i in p1Helis) {
p = p1Helis[i];
if (p.aura._currentframe == 3) {
p.order = "attack";
p.targ = {unit:clickedEnemy};
}
}
if (selectedUnits > 0) {
voices["mySound" + channels] = new Sound(voices);
voices["mySound" + channels].attachSound("LInfA" + (random(3) + 1));
voices["mySound" + channels].start();
voices["mySound" + channels].setVolume(save.voiceVolume);
channels++;
}
}
} else if (!HUD.hitTest(_xmouse, _ymouse, true)) {
if (depressedUnit.HP > 0) {
oldLastDepressed = lastDepressed;
lastDepressed = depressedUnit;
if (lastDepressed == oldLastDepressed) {
if (doubleClickTick > 0) {
par = depressedUnit._parent;
noShiftDeselect();
for (var j in par) {
p = par[j];
if (p.unit == depressedUnit.unit) {
p.aura.gotoAndStop(3);
}
}
reFocus();
}
} else {
if (!Key.isDown(16)) {
focusedUnit = depressedUnit;
changeHUDSelectFrame();
}
depressedUnit.aura.gotoAndStop(3);
if (selectedUnits > 0) {
voices["mySound" + channels] = new Sound(voices);
voices["mySound" + channels].attachSound("LInfS" + (random(2) + 1));
voices["mySound" + channels].start();
voices["mySound" + channels].setVolume(save.voiceVolume);
channels++;
}
}
}
}
} else {
d = 100000 /* 0x0186A0 */;
middle = {x:click.x + (xdist / 2), y:click.y + (ydist / 2)};
focusedUnit = null;
for (var i in p1) {
p = p1[i];
if (cursorLines.hitTest(p._x, p._y, false)) {
p.aura.gotoAndStop(3);
var xdist = (middle.x - p._x);
var ydist = (middle.y - p._y);
var dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < d) {
d = dist;
focusedUnit = p;
}
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
if (cursorLines.hitTest(p._x, p._y, false)) {
p.aura.gotoAndStop(3);
var xdist = (middle.x - p._x);
var ydist = (middle.y - p._y);
var dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < d) {
d = dist;
focusedUnit = p;
}
}
}
for (var i in p1Helis) {
p = p1Helis[i];
if (cursorLines.hitTest(p._x, p._y, false)) {
p.aura.gotoAndStop(3);
var xdist = (middle.x - p._x);
var ydist = (middle.y - p._y);
var dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (dist < d) {
d = dist;
focusedUnit = p;
}
}
}
if (focusedUnit != null) {
if (selectedUnits > 0) {
voices["mySound" + channels] = new Sound(voices);
voices["mySound" + channels].attachSound("LInfS" + (random(2) + 1));
voices["mySound" + channels].start();
voices["mySound" + channels].setVolume(save.voiceVolume);
channels++;
}
}
changeHUDSelectFrame();
}
cursorLines.clear();
click = null;
clickEnd = null;
}
}
singleClicking = false;
doubleClickTick = doubleClickTickInit;
};
onEnterFrame = OnEnterFrame;
enemyBrain = function () {
if (gameMode == "classic") {
var es = 0;
for (var i in p2) {
if (p2[i].HP > 0) {
es++;
}
}
for (var i in p2Vehicles) {
if (p2Vehicles[i].HP > 0) {
es++;
}
}
for (var i in p2Helis) {
if (p2Helis[i].HP > 0) {
es++;
}
}
if (es == 0) {
enemyMove = 0;
} else {
enemyMove = random(7);
}
if (p2habisLasersOn) {
if (p2habisLaserPercent >= 1) {
kah = random(100);
if (kah == 0) {
fireHabisLaser(2);
}
}
}
if (p2troopFreezeOn) {
if (p2troopFreezePercent >= 1) {
kah = random(100);
if (kah == 0) {
useTroopFreeze(2);
}
}
}
if (enemyMove == 0) {
if (es >= 6) {
b = [];
enemyUpgrades = [[team2homingMissiles, 1], [team2RocketPods, 2], [team2APBullets, 3], [team2laserUpgrade, 4], [team2tankGattling, 5]];
var q = 0;
while (q < enemyUpgrades.length) {
if ((enemyUpgrades[q][0] == false) && (team2CanUpgrade[q])) {
b.push(enemyUpgrades[q]);
}
q++;
}
if (b.length > 0) {
upgradeChoice = b[random(b.length)][1];
buy2(9 + upgradeChoice);
} else {
if (enemyQueuedPurchase >= 10) {
enemyQueuedPurchase = null;
}
buy2(team2Units[random(team2Units.length)]);
}
} else {
if (enemyQueuedPurchase >= 10) {
enemyQueuedPurchase = null;
}
buy2(team2Units[random(team2Units.length)]);
}
} else if (enemyMove == 1) {
a = [];
c = 0;
for (var i in p2) {
k = p2[i];
if ((k.order != "attack") && (k.order != "walk")) {
if (c == 0) {
a.push(k);
k.order = "walk";
}
c = random(2);
}
}
for (var i in p2Vehicles) {
k = p2Vehicles[i];
if ((k.order != "attack") && (k.order != "walk")) {
if (c == 0) {
a.push(k);
k.order = "walk";
}
c = random(2);
}
}
for (var i in p2Helis) {
k = p2Helis[i];
if ((k.order != "attack") && (k.order != "walk")) {
if (c == 0) {
a.push(k);
k.order = "walk";
}
c = random(2);
}
}
subMove = 0;
if (subMove == 0) {
xCoord = 200 + random(960);
yCoord = 80 + random(440);
distance = 0;
offset = 0;
b = 7.5;
bVehicle = 25;
bHeli = 30;
for (var i in a) {
w = a[i];
if (w._parent._name == "p2") {
distance = distance - (-b);
} else if (w._parent._name == "p2Vehicles") {
distance = distance - (-bVehicle);
} else if (w._parent._name == "p2Helis") {
distance = distance - (-bHeli);
}
}
while ((distance * 2) > 680) {
distance = 0;
b = b - 0.1;
bVehicle = bVehicle - 0.1;
for (var i in a) {
w = a[i];
if (w._parent._name == "p2") {
distance = distance - (-b);
} else if (w._parent._name == "p2Vehicles") {
distance = distance - (-bVehicle);
} else if (w._parent._name == "p2Helis") {
distance = distance - (-bHeli);
}
}
}
while (((yCoord - offset) + distance) > 720) {
offset = offset + 5;
}
while (((yCoord - offset) - distance) < 5) {
offset = offset - 0.5;
}
n = [];
var i = 0;
while (i < a.length) {
p = a[i];
if (i == 0) {
if (p._parent._name == "p2Vehicles") {
n.push(bVehicle);
} else if (p._parent._name == "p2") {
n.push(b);
} else if (p._parent._name == "p2Helis") {
n.push(bHeli);
}
} else if (p._parent._name == "p2Vehicles") {
n.push(n[i - 1] + (bVehicle * 2));
} else if (p._parent._name == "p2") {
n.push(n[i - 1] + (b * 2));
} else if (p._parent._name == "p2Helis") {
n.push(n[i - 1] + (bHeli * 2));
}
i++;
}
var i = 0;
while (i < a.length) {
a[i].targ = {unit:null, x:Math.max(20, Math.min(1260, xCoord)), y:Math.max(5, Math.min(((yCoord - offset) - distance) + n[i], 720))};
a[i].angleFace = -90;
i++;
}
}
} else if ((enemyMove >= 2) && (enemyMove <= 7)) {
a = [];
for (var i in p1) {
p = p1[i];
if (typeof(p) == "movieclip") {
a.push(p);
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
if (typeof(p) == "movieclip") {
a.push(p);
}
}
for (var i in p1Helis) {
p = p1Helis[i];
if (typeof(p) == "movieclip") {
a.push(p);
}
}
clickedEnemy = a[random(a.length)];
b = [];
for (var i in p2) {
k = p2[i];
if (typeof(k) == "movieclip") {
if ((k.order != "attack") && (k.order != "walk")) {
b.push(k);
}
}
}
for (var i in p2Vehicles) {
k = p2Vehicles[i];
if (typeof(k) == "movieclip") {
if ((k.order != "attack") && (k.order != "walk")) {
b.push(k);
}
}
}
for (var i in p2Helis) {
k = p2Helis[i];
if (typeof(k) == "movieclip") {
if ((k.order != "attack") && (k.order != "walk")) {
b.push(k);
}
}
}
c = 0;
if (a.length > 0) {
for (var i in b) {
p = b[i];
if (c != 0) {
p.order = "attack";
p.targ = {unit:clickedEnemy, unitx:clickedEnemy._x, unity:clickedEnemy._y};
}
c = random(4);
}
}
}
} else if (gameMode == "kingofthehill") {
var es = 0;
for (var i in p2) {
if (p2[i].HP > 0) {
es++;
}
}
for (var i in p2Vehicles) {
if (p2Vehicles[i].HP > 0) {
es++;
}
}
for (var i in p2Helis) {
if (p2Helis[i].HP > 0) {
es++;
}
}
if (es == 0) {
enemyMove = 0;
} else {
enemyMove = random(7);
}
var ps = 0;
for (var i in p1) {
if (p1[i].HP > 0) {
ps++;
}
}
for (var i in p1Vehicles) {
if (p1Vehicles[i].HP > 0) {
ps++;
}
}
for (var i in p1Helis) {
if (p1Helis[i].HP > 0) {
ps++;
}
}
if (ps == 0) {
if (es > 0) {
enemyMove = 1;
}
}
if (p2habisLasersOn) {
if (p2habisLaserPercent >= 1) {
kah = random(100);
if (kah == 0) {
fireHabisLaser(2);
}
}
}
if (p2troopFreezeOn) {
if (p2troopFreezePercent >= 1) {
kah = random(100);
if (kah == 0) {
useTroopFreeze(2);
}
}
}
if (enemyMove == 0) {
if (es >= 6) {
b = [];
enemyUpgrades = [[team2homingMissiles, 1], [team2RocketPods, 2], [team2APBullets, 3], [team2laserUpgrade, 4], [team2tankGattling, 5]];
var q = 0;
while (q < enemyUpgrades.length) {
if ((enemyUpgrades[q][0] == false) && (team2CanUpgrade[q])) {
b.push(enemyUpgrades[q]);
}
q++;
}
if (b.length > 0) {
upgradeChoice = b[random(b.length)][1];
buy2(9 + upgradeChoice);
} else {
if (enemyQueuedPurchase >= 10) {
enemyQueuedPurchase = null;
}
buy2(team2Units[random(team2Units.length)]);
}
} else {
if (enemyQueuedPurchase >= 10) {
enemyQueuedPurchase = null;
}
buy2(team2Units[random(team2Units.length)]);
}
} else if (enemyMove == 1) {
a = [];
c = 0;
for (var i in p2) {
k = p2[i];
if ((k.order != "attack") && (k.order != "walk")) {
if (c == 0) {
a.push(k);
k.order = "walk";
}
c = random(2);
}
}
for (var i in p2Vehicles) {
k = p2Vehicles[i];
if ((k.order != "attack") && (k.order != "walk")) {
if (c == 0) {
a.push(k);
k.order = "walk";
}
c = random(2);
}
}
for (var i in p2Helis) {
k = p2Helis[i];
if ((k.order != "attack") && (k.order != "walk")) {
if (c == 0) {
a.push(k);
k.order = "walk";
}
c = random(2);
}
}
subMove = 0;
if (subMove == 0) {
rangle = random(360) * degToRad;
rdist = random(200);
tempvar1 = Math.sin(rangle);
tempvar2 = Math.cos(rangle);
xCoord = (rdist * tempvar1) + 640;
yCoord = (rdist * tempvar2) + 378;
distance = 0;
offset = 0;
b = 7.5;
bVehicle = 25;
bHeli = 30;
for (var i in a) {
w = a[i];
if (w._parent._name == "p2") {
distance = distance - (-b);
} else if (w._parent._name == "p2Vehicles") {
distance = distance - (-bVehicle);
} else if (w._parent._name == "p2Helis") {
distance = distance - (-bHeli);
}
}
while ((distance * 2) > 680) {
distance = 0;
b = b - 0.1;
bVehicle = bVehicle - 0.1;
for (var i in a) {
w = a[i];
if (w._parent._name == "p2") {
distance = distance - (-b);
} else if (w._parent._name == "p2Vehicles") {
distance = distance - (-bVehicle);
} else if (w._parent._name == "p2Helis") {
distance = distance - (-bHeli);
}
}
}
while (((yCoord - offset) + distance) > 720) {
offset = offset + 5;
}
while (((yCoord - offset) - distance) < 5) {
offset = offset - 0.5;
}
n = [];
var i = 0;
while (i < a.length) {
p = a[i];
if (p._parent._name == "p2Vehicles") {
n.push(n[i - 1] + (bVehicle * 2));
} else if (p._parent._name == "p2") {
n.push(n[i - 1] + (b * 2));
} else if (p._parent._name == "p2Helis") {
n.push(n[i - 1] + (bHeli * 2));
}
i++;
}
var i = 0;
while (i < a.length) {
a[i].targ = {unit:null, x:Math.max(20, Math.min(1260, xCoord)), y:Math.max(5, Math.min(((yCoord - offset) - distance) + n[i], 720))};
a[i].angleFace = -90;
i++;
}
}
} else if ((enemyMove >= 2) && (enemyMove <= 7)) {
a = [];
for (var i in p1) {
p = p1[i];
if (typeof(p) == "movieclip") {
a.push(p);
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
if (typeof(p) == "movieclip") {
a.push(p);
}
}
for (var i in p1Helis) {
p = p1Helis[i];
if (typeof(p) == "movieclip") {
a.push(p);
}
}
clickedEnemy = a[random(a.length)];
b = [];
for (var i in p2) {
k = p2[i];
if (typeof(k) == "movieclip") {
if ((k.order != "attack") && (k.order != "walk")) {
b.push(k);
}
}
}
for (var i in p2Vehicles) {
k = p2Vehicles[i];
if (typeof(k) == "movieclip") {
if ((k.order != "attack") && (k.order != "walk")) {
b.push(k);
}
}
}
for (var i in p2Helis) {
k = p2Helis[i];
if (typeof(k) == "movieclip") {
if ((k.order != "attack") && (k.order != "walk")) {
b.push(k);
}
}
}
c = 0;
if (a.length > 0) {
for (var i in b) {
p = b[i];
if (c != 0) {
p.order = "attack";
p.targ = {unit:clickedEnemy, unitx:clickedEnemy._x, unity:clickedEnemy._y};
}
c = random(4);
}
}
}
} else if (gameMode == "capturetheflag") {
var es = 0;
if (flag.targ.HP > 0) {
theFlagHolder = flag.targ;
if (((flag.targ._parent._name == "p1") || (flag.targ._parent._name == "p1Vehicles")) || (flag.targ._parent._name == "p1Helis")) {
flagTeam = 1;
} else {
flagTeam = 2;
}
} else {
theFlagHolder = null;
flagTeam = null;
}
for (var i in p2) {
if (p2[i].HP > 0) {
es++;
}
}
for (var i in p2Vehicles) {
if (p2Vehicles[i].HP > 0) {
es++;
}
}
for (var i in p2Helis) {
if (p2Helis[i].HP > 0) {
es++;
}
}
if (es == 0) {
enemyMove = 0;
} else {
enemyMove = random(7);
}
if (p2habisLasersOn) {
if (p2habisLaserPercent >= 1) {
kah = random(100);
if (kah == 0) {
fireHabisLaser(2);
}
}
}
if (p2troopFreezeOn) {
if (p2troopFreezePercent >= 1) {
kah = random(100);
if (kah == 0) {
useTroopFreeze(2);
}
}
}
if (enemyMove == 0) {
if (es >= 6) {
b = [];
enemyUpgrades = [[team2homingMissiles, 1], [team2RocketPods, 2], [team2APBullets, 3], [team2laserUpgrade, 4], [team2tankGattling, 5]];
var q = 0;
while (q < enemyUpgrades.length) {
if ((enemyUpgrades[q][0] == false) && (team2CanUpgrade[q])) {
b.push(enemyUpgrades[q]);
}
q++;
}
if (b.length > 0) {
upgradeChoice = b[random(b.length)][1];
buy2(9 + upgradeChoice);
} else {
if (enemyQueuedPurchase >= 10) {
enemyQueuedPurchase = null;
}
buy2(team2Units[random(team2Units.length)]);
}
} else {
if (enemyQueuedPurchase >= 10) {
enemyQueuedPurchase = null;
}
buy2(team2Units[random(team2Units.length)]);
}
} else if (enemyMove == 1) {
a = [];
c = 0;
for (var i in p2) {
k = p2[i];
if ((k.order != "attack") && (k.order != "walk")) {
if (c == 0) {
a.push(k);
k.order = "walk";
}
c = random(2);
}
}
for (var i in p2Vehicles) {
k = p2Vehicles[i];
if ((k.order != "attack") && (k.order != "walk")) {
if (c == 0) {
a.push(k);
k.order = "walk";
}
c = random(2);
}
}
for (var i in p2Helis) {
k = p2Helis[i];
if ((k.order != "attack") && (k.order != "walk")) {
if (c == 0) {
a.push(k);
k.order = "walk";
}
c = random(2);
}
}
subMove = 0;
if (subMove == 0) {
if (flagTeam == 1) {
rangle = random(360) * degToRad;
rdist = 200 + random(100);
tempvar1 = Math.sin(rangle);
tempvar2 = Math.cos(rangle);
xCoord = (rdist * tempvar1) + flag.targ._x;
yCoord = (rdist * tempvar2) + flag.targ._y;
} else if (flagTeam == 2) {
xCoord = 1230;
yCoord = 80 + random(440);
} else {
xCoord = flag._x;
yCoord = flag._y;
}
distance = 0;
offset = 0;
b = 7.5;
bVehicle = 25;
bHeli = 30;
for (var i in a) {
w = a[i];
if (w._parent._name == "p2") {
distance = distance - (-b);
} else if (w._parent._name == "p2Vehicles") {
distance = distance - (-bVehicle);
} else if (w._parent._name == "p2Helis") {
distance = distance - (-bHeli);
}
}
while ((distance * 2) > 680) {
distance = 0;
b = b - 0.1;
bVehicle = bVehicle - 0.1;
for (var i in a) {
w = a[i];
if (w._parent._name == "p2") {
distance = distance - (-b);
} else if (w._parent._name == "p2Vehicles") {
distance = distance - (-bVehicle);
} else if (w._parent._name == "p2Helis") {
distance = distance - (-bHeli);
}
}
}
while (((yCoord - offset) + distance) > 720) {
offset = offset + 5;
}
while (((yCoord - offset) - distance) < 5) {
offset = offset - 0.5;
}
n = [];
var i = 0;
while (i < a.length) {
p = a[i];
if (p._parent._name == "p2Vehicles") {
n.push(n[i - 1] + (bVehicle * 2));
} else if (p._parent._name == "p2") {
n.push(n[i - 1] + (b * 2));
} else if (p._parent._name == "p2Helis") {
n.push(n[i - 1] + (bHeli * 2));
}
i++;
}
var i = 0;
while (i < a.length) {
a[i].targ = {unit:null, x:Math.max(20, Math.min(1260, xCoord)), y:Math.max(5, Math.min(((yCoord - offset) - distance) + n[i], 720))};
a[i].angleFace = -90;
i++;
}
}
} else if ((enemyMove >= 2) && (enemyMove <= 7)) {
a = [];
if (flagTeam != 2) {
moveh = random(3);
} else {
moveh = 0;
}
if (moveh == 0) {
for (var i in p1) {
p = p1[i];
if (typeof(p) == "movieclip") {
a.push(p);
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
if (typeof(p) == "movieclip") {
a.push(p);
}
}
for (var i in p1Helis) {
p = p1Helis[i];
if (typeof(p) == "movieclip") {
a.push(p);
}
}
clickedEnemy = a[random(a.length)];
} else {
clickedEnemy = theFlagHolder;
}
b = [];
for (var i in p2) {
k = p2[i];
if (typeof(k) == "movieclip") {
if ((k.order != "attack") && (k.order != "walk")) {
b.push(k);
}
}
}
for (var i in p2Vehicles) {
k = p2Vehicles[i];
if (typeof(k) == "movieclip") {
if ((k.order != "attack") && (k.order != "walk")) {
b.push(k);
}
}
}
for (var i in p2Helis) {
k = p2Helis[i];
if (typeof(k) == "movieclip") {
if ((k.order != "attack") && (k.order != "walk")) {
b.push(k);
}
}
}
c = 0;
if (a.length > 0) {
for (var i in b) {
p = b[i];
if (c != 0) {
p.order = "attack";
p.targ = {unit:clickedEnemy, unitx:clickedEnemy._x, unity:clickedEnemy._y};
}
c = random(4);
}
}
}
} else if (gameMode == "powerball") {
var es = 0;
if (powerBall.targ.HP > 0) {
theBallHolder = powerBall.targ;
if (((powerBall.targ._parent._name == "p1") || (powerBall.targ._parent._name == "p1Vehicles")) || (powerBall.targ._parent._name == "p1Helis")) {
powerBallTeam = 1;
} else {
powerBallTeam = 2;
}
} else {
theBallHolder = null;
powerBallTeam = null;
}
for (var i in p2) {
if (p2[i].HP > 0) {
es++;
}
}
for (var i in p2Vehicles) {
if (p2Vehicles[i].HP > 0) {
es++;
}
}
for (var i in p2Helis) {
if (p2Helis[i].HP > 0) {
es++;
}
}
if (es == 0) {
enemyMove = 0;
} else {
enemyMove = random(7);
}
if (p2habisLasersOn) {
if (p2habisLaserPercent >= 1) {
kah = random(100);
if (kah == 0) {
fireHabisLaser(2);
}
}
}
if (p2troopFreezeOn) {
if (p2troopFreezePercent >= 1) {
kah = random(100);
if (kah == 0) {
useTroopFreeze(2);
}
}
}
if (enemyMove == 0) {
if (es >= 6) {
b = [];
enemyUpgrades = [[team2homingMissiles, 1], [team2RocketPods, 2], [team2APBullets, 3], [team2laserUpgrade, 4], [team2tankGattling, 5]];
var q = 0;
while (q < enemyUpgrades.length) {
if ((enemyUpgrades[q][0] == false) && (team2CanUpgrade[q])) {
b.push(enemyUpgrades[q]);
}
q++;
}
if (b.length > 0) {
upgradeChoice = b[random(b.length)][1];
buy2(9 + upgradeChoice);
} else {
if (enemyQueuedPurchase >= 10) {
enemyQueuedPurchase = null;
}
buy2(team2Units[random(team2Units.length)]);
}
} else {
if (enemyQueuedPurchase >= 10) {
enemyQueuedPurchase = null;
}
buy2(team2Units[random(team2Units.length)]);
}
} else if (enemyMove == 1) {
a = [];
c = 0;
for (var i in p2) {
k = p2[i];
if ((k.order != "attack") && (k.order != "walk")) {
if (c == 0) {
a.push(k);
k.order = "walk";
}
c = random(2);
}
}
for (var i in p2Vehicles) {
k = p2Vehicles[i];
if ((k.order != "attack") && (k.order != "walk")) {
if (c == 0) {
a.push(k);
k.order = "walk";
}
c = random(2);
}
}
for (var i in p2Helis) {
k = p2Helis[i];
if ((k.order != "attack") && (k.order != "walk")) {
if (c == 0) {
a.push(k);
k.order = "walk";
}
c = random(2);
}
}
subMove = 0;
if (subMove == 0) {
if (powerBallTeam == 1) {
xCoord = 200 + random(960);
yCoord = 80 + random(440);
} else if (powerBallTeam == 2) {
rangle = random(360) * degToRad;
rdist = 200 + random(100);
tempvar1 = Math.sin(rangle);
tempvar2 = Math.cos(rangle);
xCoord = (rdist * tempvar1) + powerBall.targ._x;
yCoord = (rdist * tempvar2) + powerBall.targ._y;
} else {
xCoord = powerBall._x;
yCoord = powerBall._y;
}
distance = 0;
offset = 0;
b = 7.5;
bVehicle = 25;
bHeli = 30;
for (var i in a) {
w = a[i];
if (w._parent._name == "p2") {
distance = distance - (-b);
} else if (w._parent._name == "p2Vehicles") {
distance = distance - (-bVehicle);
} else if (w._parent._name == "p2Helis") {
distance = distance - (-bHeli);
}
}
while ((distance * 2) > 680) {
distance = 0;
b = b - 0.1;
bVehicle = bVehicle - 0.1;
for (var i in a) {
w = a[i];
if (w._parent._name == "p2") {
distance = distance - (-b);
} else if (w._parent._name == "p2Vehicles") {
distance = distance - (-bVehicle);
} else if (w._parent._name == "p2Helis") {
distance = distance - (-bHeli);
}
}
}
while (((yCoord - offset) + distance) > 720) {
offset = offset + 5;
}
while (((yCoord - offset) - distance) < 5) {
offset = offset - 0.5;
}
n = [];
var i = 0;
while (i < a.length) {
p = a[i];
if (p._parent._name == "p2Vehicles") {
n.push(n[i - 1] + (bVehicle * 2));
} else if (p._parent._name == "p2") {
n.push(n[i - 1] + (b * 2));
} else if (p._parent._name == "p2Helis") {
n.push(n[i - 1] + (bHeli * 2));
}
i++;
}
var i = 0;
while (i < a.length) {
a[i].targ = {unit:null, x:Math.max(20, Math.min(1260, xCoord)), y:Math.max(5, Math.min(((yCoord - offset) - distance) + n[i], 720))};
a[i].angleFace = -90;
i++;
}
}
} else if ((enemyMove >= 2) && (enemyMove <= 7)) {
a = [];
if (powerBallTeam != 2) {
moveh = random(3);
} else {
moveh = 0;
}
if (moveh == 0) {
for (var i in p1) {
p = p1[i];
if (typeof(p) == "movieclip") {
a.push(p);
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
if (typeof(p) == "movieclip") {
a.push(p);
}
}
for (var i in p1Helis) {
p = p1Helis[i];
if (typeof(p) == "movieclip") {
a.push(p);
}
}
clickedEnemy = a[random(a.length)];
} else {
clickedEnemy = theBallHolder;
}
b = [];
for (var i in p2) {
k = p2[i];
if (typeof(k) == "movieclip") {
if ((k.order != "attack") && (k.order != "walk")) {
b.push(k);
}
}
}
for (var i in p2Vehicles) {
k = p2Vehicles[i];
if (typeof(k) == "movieclip") {
if ((k.order != "attack") && (k.order != "walk")) {
b.push(k);
}
}
}
for (var i in p2Helis) {
k = p2Helis[i];
if (typeof(k) == "movieclip") {
if ((k.order != "attack") && (k.order != "walk")) {
b.push(k);
}
}
}
c = 0;
if (a.length > 0) {
for (var i in b) {
p = b[i];
if (c != 0) {
p.order = "attack";
p.targ = {unit:clickedEnemy, unitx:clickedEnemy._x, unity:clickedEnemy._y};
}
c = random(4);
}
}
}
} else if (gameMode == "deathmatch") {
var es = 0;
for (var i in p2) {
if (p2[i].HP > 0) {
es++;
}
}
for (var i in p2Vehicles) {
if (p2Vehicles[i].HP > 0) {
es++;
}
}
for (var i in p2Helis) {
if (p2Helis[i].HP > 0) {
es++;
}
}
if (es == 0) {
enemyMove = 0;
} else {
enemyMove = random(7);
}
if (p2habisLasersOn) {
if (p2habisLaserPercent >= 1) {
kah = random(100);
if (kah == 0) {
fireHabisLaser(2);
}
}
}
if (p2troopFreezeOn) {
if (p2troopFreezePercent >= 1) {
kah = random(100);
if (kah == 0) {
useTroopFreeze(2);
}
}
}
if (enemyMove == 0) {
if (es >= 6) {
b = [];
enemyUpgrades = [[team2homingMissiles, 1], [team2RocketPods, 2], [team2APBullets, 3], [team2laserUpgrade, 4], [team2tankGattling, 5]];
var q = 0;
while (q < enemyUpgrades.length) {
if ((enemyUpgrades[q][0] == false) && team2CanUpgrade[q]) {
b.push(enemyUpgrades[q]);
}
q++;
}
if (b.length > 0) {
upgradeChoice = b[random(b.length)][1];
buy2(9 + upgradeChoice);
} else {
if (enemyQueuedPurchase >= 10) {
enemyQueuedPurchase = null;
}
buy2(team2Units[random(team2Units.length)]);
}
} else {
if (enemyQueuedPurchase >= 10) {
enemyQueuedPurchase = null;
}
buy2(team2Units[random(team2Units.length)]);
}
} else {
a = [];
for (var i in p1) {
p = p1[i];
if (typeof(p) == "movieclip") {
a.push(p);
}
}
for (var i in p1Vehicles) {
p = p1Vehicles[i];
if (typeof(p) == "movieclip") {
a.push(p);
}
}
for (var i in p1Helis) {
p = p1Helis[i];
if (typeof(p) == "movieclip") {
a.push(p);
}
}
clickedEnemy = a[random(a.length)];
b = [];
for (var i in p2) {
k = p2[i];
if (typeof(k) == "movieclip") {
if ((k.order != "attack") && (k.order != "walk")) {
b.push(k);
}
}
}
for (var i in p2Vehicles) {
k = p2Vehicles[i];
if (typeof(k) == "movieclip") {
if ((k.order != "attack") && (k.order != "walk")) {
b.push(k);
}
}
}
for (var i in p2Helis) {
k = p2Helis[i];
if (typeof(k) == "movieclip") {
if ((k.order != "attack") && (k.order != "walk")) {
b.push(k);
}
}
}
c = 0;
if (a.length > 0) {
for (var i in b) {
p = b[i];
if (c != 0) {
p.order = "attack";
p.targ = {unit:clickedEnemy, unitx:clickedEnemy._x, unity:clickedEnemy._y};
}
c = random(4);
}
}
}
}
};
keyable = true;
keyObject = {};
Key.addListener(keyObject);
keyObject.onKeyDown = function () {
if (Key.isDown(32)) {
var i = 0;
while (i <= 9) {
if (Key.isDown(i + 48)) {
hotKeySelections[i] = [];
for (var j in hotKeyHovers) {
u = hotKeyHovers[j];
if (u.i == i) {
removeMovieClip(u);
}
}
for (var j in p1) {
p = p1[j];
if (p.aura._currentframe == 3) {
if (p.hKey != undefined) {
removeMovieClip(p.hKey);
}
hotKeySelections[i].push(p);
k = hotKeyHovers.createEmptyMovieClip("tHolder" + z, z++);
p.hKey = k;
k.i = i;
k.targ = p;
k.createTextField("tField", z++, 0, 0, 100, 20);
k.tField.html = true;
k.tField.htmlText = ("<P><FONT COLOR=\"#FFFFFF\"><B>" + i) + "</B></FONT></P>";
k._x = k.targ._x - 15;
k._y = k.targ._y - 15;
k.onEnterFrame = function () {
if (this.targ.HP <= 0) {
removeMovieClip(this);
} else {
this._x = this.targ._x - 15;
this._y = this.targ._y - 15;
}
};
}
}
for (var j in p1Vehicles) {
p = p1Vehicles[j];
if (p.aura._currentframe == 3) {
if (p.hKey != undefined) {
removeMovieClip(p.hKey);
}
hotKeySelections[i].push(p);
k = hotKeyHovers.createEmptyMovieClip("tHolder" + z, z++);
p.hKey = k;
k.i = i;
k.targ = p;
k.createTextField("tField", z++, 0, 0, 100, 20);
k.tField.html = true;
k.tField.htmlText = ("<P><FONT COLOR=\"#FFFFFF\"><B>" + i) + "</B></FONT></P>";
k._x = k.targ._x - 15;
k._y = k.targ._y - 15;
k.onEnterFrame = function () {
if (this.targ.HP <= 0) {
removeMovieClip(this);
} else {
this._x = this.targ._x - 15;
this._y = this.targ._y - 15;
}
};
}
}
for (var j in p1Helis) {
p = p1Helis[j];
if (p.aura._currentframe == 3) {
if (p.hKey != undefined) {
removeMovieClip(p.hKey);
}
hotKeySelections[i].push(p);
k = hotKeyHovers.createEmptyMovieClip("tHolder" + z, z++);
p.hKey = k;
k.i = i;
k.targ = p;
k.createTextField("tField", z++, 0, 0, 100, 20);
k.tField.html = true;
k.tField.htmlText = ("<P><FONT COLOR=\"#FFFFFF\"><B>" + i) + "</B></FONT></P>";
k._x = k.targ._x - 15;
k._y = k.targ._y - 15;
k.onEnterFrame = function () {
if (this.targ.HP <= 0) {
removeMovieClip(this);
} else {
this._x = this.targ._x - 15;
this._y = this.targ._y - 15;
}
};
}
}
}
i++;
}
} else {
var i = 0;
while (i <= 9) {
if (x == (i + 48)) {
noShiftDeselect();
for (var j in hotKeySelections[i]) {
p = hotKeySelections[i][j];
p.aura.gotoAndStop(3);
}
reFocus();
}
i++;
}
}
if (keyable) {
x = Key.getCode();
if (x == 78) {
targetNearest(1);
}
if (x == 81) {
changeQuality();
}
if (x == 82) {
reformSelected();
}
if (x == 77) {
if (team1Units[9]) {
buy("ambulance");
}
}
if (x == 71) {
if (team1Units[3]) {
buy("gTank");
}
}
if (x == 72) {
if (team1Units[2]) {
buy("hTank");
}
}
if (x == 73) {
if (team1Units[0]) {
buy("lInf");
}
}
if (x == 66) {
if (team1Units[1]) {
buy("RPG1");
}
}
if (x == 67) {
if (team1Units[4]) {
buy("comanche");
}
}
if (x == 76) {
if (team1Units[5]) {
buy("lTroop");
}
}
if (x == 80) {
if (team1Units[7]) {
buy("sniper");
}
}
if (x == 84) {
if (team1Units[6]) {
buy("lTank");
}
}
if (x == 69) {
if (team1Units[8]) {
buy("helix");
}
}
}
keyable = false;
};
keyObject.onKeyUp = function () {
keyable = true;
};
Frame 5
stopAllSounds();
z = 0;
attachMovie(cursorName, cursorName, 1000000, {_x:_xmouse, _y:_ymouse});
_root[cursorName].onEnterFrame = function () {
Mouse.hide();
this._x = _xmouse;
this._y = _ymouse;
updateAfterEvent();
};
playAgain.onRelease = function () {
if (campaignMode) {
level++;
gotoAndStop (7);
} else {
removeMovieClip(cursorName);
gotoAndStop (3);
}
};
playAgain.onRollOver = (playAgain.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
});
playAgain.onRollOut = (playAgain.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
});
Frame 6
stopAllSounds();
z = 0;
attachMovie(cursorName, cursorName, 1000000, {_x:_xmouse, _y:_ymouse});
_root[cursorName].onEnterFrame = function () {
Mouse.hide();
this._x = _xmouse;
this._y = _ymouse;
updateAfterEvent();
};
playAgain.onRelease = function () {
if (campaignMode) {
gotoAndStop (7);
} else {
removeMovieClip(cursorName);
gotoAndStop (3);
}
};
playAgain.onRollOver = (playAgain.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
});
playAgain.onRollOut = (playAgain.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
});
Frame 7
function viewFlagMode() {
flagMode = 1;
globalScale = 1;
var i = 0;
while (i < xSquares) {
var j = 0;
while (j < ySquares) {
s = squares.createEmptyMovieClip((("square_" + i) + "_") + j, z++);
s.x = i;
s.y = j;
makeBox(gridX + (i * globalScale), gridY + (j * globalScale), globalScale, s, false, 16777215);
j++;
}
i++;
}
if (save.flagArray != undefined) {
loadFlag();
}
}
function recurseFlags(flag) {
shortestDistance = 10000;
closestFlag = null;
element = 0;
for (var i in tehFlags) {
t = tehFlags[i];
if (typeof(t) == "movieclip") {
xdist = t._x - flag._x;
ydist = t._y - flag._y;
distance = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (distance < shortestDistance) {
shortestDistance = distance;
closestFlag = (obj = t);
element = i;
}
}
}
orderedFlags.push(closestFlag);
tehFlags.splice(element, 1);
}
save.level = level;
radToDeg = 57.2957795130823;
degToRad = (Math.PI/180);
if (flagX == undefined) {
flagX = save.flagX;
flagY = save.flagY;
}
gridX = 0;
gridY = 0;
z = 0;
xSquares = 13;
ySquares = 9;
paintColour = 0;
_quality = "HIGH";
createEmptyMovieClip("blips", z++);
attachMovie("flagHolder", "flags", z++);
createEmptyMovieClip("squares", z++);
blips._y = 20;
flags._y = 20;
squares._y = 20;
viewFlagMode();
squares._x = flagX;
squares._y = flagY;
_root[cursorName].gotoAndStop(1);
backButton.onRollOver = (backButton.onDragOver = (flags["flag" + level].flagButton.onRollOver = (flags["flag" + level].flagButton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})));
backButton.onRollOut = (backButton.onDragOut = (flags["flag" + level].flagButton.onRollOut = (flags["flag" + level].flagButton.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
})));
backButton.onRelease = function () {
removeMovieClip(blips);
removeMovieClip(flags);
removeMovieClip(arrow);
removeMovieClip(squares);
gotoAndStop (3);
};
orderedFlags = [];
tehFlags = [];
var i = 1;
while (i <= 25) {
f = flags["flag" + i];
if (typeof(f) == "movieclip") {
f._visible = false;
tehFlags.push(f);
}
i++;
}
obj = squares;
while (tehFlags.length > 0) {
recurseFlags(obj);
}
var i = 0;
while (i < orderedFlags.length) {
o = orderedFlags[i];
o._name = "flag" + (i + 1);
i++;
}
flags["flag" + level].flagButton.onRelease = function () {
removeMovieClip(squares);
if (level == 1) {
p1poplimit = 5;
p2poplimit = 5;
gameMode = "classic";
matchVariable = 3;
team1Units = [true, false, false, false, false, false, false, false, false, false];
team2TempUnits = [true, false, false, false, false, false, false, false, false, false];
team1CanUpgrade = [false, false, false, false, false];
team2CanUpgrade = [false, false, false, false, false];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = false;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 1000;
team2Budget = 1000;
difficulty = 20;
} else if (level == 2) {
p1poplimit = 7;
p2poplimit = 3;
gameMode = "deathmatch";
matchVariable = 3;
team1Units = [true, true, false, false, false, false, false, false, false, false];
team2TempUnits = [false, false, true, false, false, false, false, false, false, false];
team1CanUpgrade = [false, false, false, false, false];
team2CanUpgrade = [false, false, false, false, false];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = false;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 1000;
team2Budget = 1000;
difficulty = 5;
} else if (level == 3) {
p1poplimit = 7;
p2poplimit = 7;
gameMode = "classic";
matchVariable = 3;
team1Units = [true, true, true, false, false, false, false, false, false, false];
team2TempUnits = [true, true, true, false, false, false, false, false, false, false];
team1CanUpgrade = [false, false, false, false, false];
team2CanUpgrade = [false, false, false, false, false];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = false;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 1000;
team2Budget = 1000;
difficulty = 20;
} else if (level == 4) {
p1poplimit = 5;
p2poplimit = 15;
gameMode = "kingofthehill";
matchVariable = 3;
team1Units = [false, false, false, false, false, false, false, true, false, false];
team2TempUnits = [true, false, false, false, false, false, false, false, false, false];
team1CanUpgrade = [false, false, false, false, false];
team2CanUpgrade = [false, false, false, false, false];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = false;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 1500;
team2Budget = 1500;
difficulty = 15;
} else if (level == 5) {
p1poplimit = 5;
p2poplimit = 15;
gameMode = "classic";
matchVariable = 3;
team1Units = [true, true, true, true, false, false, false, true, false, false];
team2TempUnits = [false, false, false, false, true, false, false, false, false, false];
team1CanUpgrade = [false, false, false, false, false];
team2CanUpgrade = [false, false, false, false, false];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = false;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 1500;
team2Budget = 2000;
difficulty = 10;
} else if (level == 6) {
p1poplimit = 10;
p2poplimit = 10;
gameMode = "capturetheflag";
matchVariable = 3;
team1Units = [true, true, true, true, false, false, false, true, false, true];
team2TempUnits = [true, true, true, true, false, false, false, true, false, true];
team1CanUpgrade = [false, false, false, false, false];
team2CanUpgrade = [false, false, false, false, false];
cashBounty = true;
bountyQuantity = 2;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = false;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 1500;
team2Budget = 1500;
difficulty = 10;
} else if (level == 7) {
p1poplimit = 10;
p2poplimit = 10;
gameMode = "deathmatch";
matchVariable = 3;
team1Units = [true, true, true, true, false, false, false, true, false, true];
team2TempUnits = [true, true, true, true, false, false, false, true, false, true];
team1CanUpgrade = [false, false, false, false, false];
team2CanUpgrade = [false, false, false, false, false];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = false;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 1500;
team2Budget = 2000;
difficulty = 10;
} else if (level == 8) {
p1poplimit = 9;
p2poplimit = 15;
gameMode = "powerball";
matchVariable = 3;
team1Units = [true, true, true, true, false, false, false, true, false, true];
team2TempUnits = [true, true, true, true, false, false, false, true, false, true];
team1CanUpgrade = [false, true, false, false, false];
team2CanUpgrade = [false, false, false, false, false];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = true;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 1500;
team2Budget = 1500;
difficulty = 20;
} else if (level == 9) {
p1poplimit = 10;
p2poplimit = 10;
gameMode = "classic";
matchVariable = 3;
team1Units = [true, true, true, true, false, false, false, true, false, true];
team2TempUnits = [true, true, true, true, true, false, false, true, false, true];
team1CanUpgrade = [false, true, false, false, false];
team2CanUpgrade = [false, true, false, false, false];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = true;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 2000;
team2Budget = 2000;
difficulty = 10;
} else if (level == 10) {
p1poplimit = 10;
p2poplimit = 10;
gameMode = "capturetheflag";
matchVariable = 3;
team1Units = [true, true, true, true, false, false, false, true, false, true];
team2TempUnits = [true, true, true, true, false, false, false, true, false, true];
team1CanUpgrade = [false, false, false, false, false];
team2CanUpgrade = [false, false, false, false, false];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = false;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 2000;
team2Budget = 2000;
difficulty = 10;
} else if (level == 11) {
p1poplimit = 10;
p2poplimit = 10;
gameMode = "deathmatch";
matchVariable = 3;
team1Units = [true, true, true, true, true, false, false, true, false, true];
team2TempUnits = [true, true, true, true, true, false, false, true, false, true];
team1CanUpgrade = [false, true, false, false, false];
team2CanUpgrade = [false, true, false, false, false];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = true;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 2000;
team2Budget = 2000;
difficulty = 10;
} else if (level == 12) {
p1poplimit = 10;
p2poplimit = 5;
gameMode = "kingofthehill";
matchVariable = 3;
team1Units = [true, true, false, false, true, false, false, false, false, true];
team2TempUnits = [false, false, true, false, false, false, false, true, false, false];
team1CanUpgrade = [true, true, false, false, false];
team2CanUpgrade = [false, true, false, false, false];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = true;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 1500;
team2Budget = 1500;
difficulty = 15;
} else if (level == 13) {
p1poplimit = 10;
p2poplimit = 15;
gameMode = "classic";
matchVariable = 3;
team1Units = [true, true, true, true, true, false, false, true, true, true];
team2TempUnits = [true, true, true, true, true, false, false, false, false, false];
team1CanUpgrade = [true, true, false, false, false];
team2CanUpgrade = [false, true, false, false, false];
cashBounty = true;
bountyQuantity = 5;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = true;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 3000;
team2Budget = 2500;
difficulty = 10;
} else if (level == 14) {
p1poplimit = 10;
p2poplimit = 15;
gameMode = "classic";
matchVariable = 3;
team1Units = [false, false, false, true, true, false, false, false, true, true];
team2TempUnits = [true, true, true, true, true, true, false, true, false, false];
team1CanUpgrade = [true, true, false, false, true];
team2CanUpgrade = [true, true, true, false, false];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = true;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 3000;
team2Budget = 3000;
difficulty = 5;
} else if (level == 15) {
p1poplimit = 10;
p2poplimit = 10;
gameMode = "powerball";
matchVariable = 3;
team1Units = [true, true, true, true, true, false, false, true, true, true];
team2TempUnits = [true, true, true, true, false, false, false, true, false, false];
team1CanUpgrade = [true, true, false, false, true];
team2CanUpgrade = [true, true, false, false, true];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = true;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 3000;
team2Budget = 3000;
difficulty = 5;
} else if (level == 16) {
p1poplimit = 10;
p2poplimit = 10;
gameMode = "deathmatch";
matchVariable = 3;
team1Units = [false, false, false, false, false, true, false, false, false, false];
team2TempUnits = [true, true, false, false, false, false, false, true, false, true];
team1CanUpgrade = [true, true, false, false, true];
team2CanUpgrade = [true, true, false, false, true];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = true;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 3000;
team2Budget = 2000;
difficulty = 15;
} else if (level == 17) {
p1poplimit = 10;
p2poplimit = 10;
gameMode = "classic";
matchVariable = 3;
team1Units = [true, true, true, true, true, true, true, true, true, true];
team2TempUnits = [true, true, true, true, true, false, false, true, true, true];
team1CanUpgrade = [true, true, true, false, true];
team2CanUpgrade = [true, true, false, false, true];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = true;
techTowerOn = true;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 3500;
team2Budget = 3000;
difficulty = 15;
} else if (level == 18) {
p1poplimit = 10;
p2poplimit = 10;
gameMode = "kingofthehill";
matchVariable = 3;
team1Units = [true, true, true, true, true, true, true, true, true, true];
team2TempUnits = [true, true, true, true, true, false, false, true, true, true];
team1CanUpgrade = [true, true, true, true, true];
team2CanUpgrade = [true, true, false, false, true];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = true;
habisLasersOn = false;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = true;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 3500;
team2Budget = 3500;
difficulty = 10;
} else if (level == 19) {
p1poplimit = 12;
p2poplimit = 12;
gameMode = "classic";
matchVariable = 3;
team1Units = [true, true, true, true, true, true, true, true, true, true];
team2TempUnits = [true, true, true, true, true, false, false, true, true, true];
team1CanUpgrade = [true, true, true, true, true];
team2CanUpgrade = [true, true, false, false, false];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = true;
p2habisLasersOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = true;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 3500;
team2Budget = 3500;
difficulty = 10;
} else if (level == 20) {
p1poplimit = 7;
p2poplimit = 15;
gameMode = "classic";
matchVariable = 3;
team1Units = [true, true, true, true, true, true, true, true, true, true];
team2TempUnits = [false, false, false, false, false, true, true, false, false, false];
team1CanUpgrade = [true, true, true, true, true];
team2CanUpgrade = [false, false, true, false, false];
cashBounty = true;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = false;
p2habisLasersOn = true;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = true;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = true;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 3500;
team2Budget = 5000;
difficulty = 5;
} else if (level == 21) {
p1poplimit = 12;
p2poplimit = 10;
gameMode = "deathmatch";
matchVariable = 3;
team1Units = [true, true, true, true, true, true, true, true, true, true];
team2TempUnits = [true, true, true, true, true, true, true, true, true, true];
team1CanUpgrade = [true, true, true, true, true];
team2CanUpgrade = [true, true, false, false, true];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = true;
p2habisLasersOn = false;
troopFreezeOn = true;
p2troopFreezeOn = true;
techTowerOn = true;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 3500;
team2Budget = 4000;
difficulty = 4;
} else if (level == 22) {
p1poplimit = 10;
p2poplimit = 11;
gameMode = "classic";
matchVariable = 3;
team1Units = [true, true, true, true, true, true, true, true, true, true];
team2TempUnits = [true, true, true, true, true, false, false, true, true, true];
team1CanUpgrade = [true, true, true, true, true];
team2CanUpgrade = [true, true, false, false, true];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = true;
p2habisLasersOn = false;
troopFreezeOn = true;
p2troopFreezeOn = true;
techTowerOn = true;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 4000;
team2Budget = 4000;
difficulty = 3;
} else if (level == 23) {
p1poplimit = 12;
p2poplimit = 12;
gameMode = "classic";
matchVariable = 3;
team1Units = [true, true, true, true, true, true, true, true, true, true];
team2TempUnits = [true, true, true, true, true, false, false, true, true, true];
team1CanUpgrade = [true, true, true, true, true];
team2CanUpgrade = [true, true, false, false, false];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = true;
p2habisLasersOn = true;
troopFreezeOn = true;
p2troopFreezeOn = true;
techTowerOn = true;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 4000;
team2Budget = 4000;
difficulty = 2;
} else if (level == 24) {
p1poplimit = 12;
p2poplimit = 12;
gameMode = "powerball";
matchVariable = 3;
team1Units = [false, false, true, true, false, true, true, false, true, true];
team2TempUnits = [true, true, true, true, true, false, false, true, true, true];
team1CanUpgrade = [true, true, true, true, true];
team2CanUpgrade = [true, true, false, false, false];
cashBounty = false;
bountyQuantity = 3;
nukesOn = false;
p2nukesOn = false;
habisLasersOn = true;
p2habisLasersOn = true;
troopFreezeOn = true;
p2troopFreezeOn = true;
techTowerOn = true;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 4000;
team2Budget = 4500;
difficulty = 1;
} else if (level == 25) {
p1poplimit = 15;
p2poplimit = 15;
gameMode = "classic";
matchVariable = 3;
team1Units = [true, true, true, true, true, true, true, true, true, true];
team2TempUnits = [true, true, true, true, true, true, true, true, true, true];
team1CanUpgrade = [true, true, true, true, true];
team2CanUpgrade = [true, true, false, false, false];
cashBounty = true;
bountyQuantity = 5;
nukesOn = true;
p2nukesOn = true;
habisLasersOn = true;
p2habisLasersOn = true;
troopFreezeOn = true;
p2troopFreezeOn = true;
techTowerOn = true;
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
team1Budget = 5000;
team2Budget = 5000;
difficulty = 1;
}
removeMovieClip(blips);
removeMovieClip(flags);
removeMovieClip(arrow);
gotoAndStop (4);
};
var i = 1;
while (i <= 25) {
f = flags["flag" + i];
if (level < i) {
f._visible = false;
} else if (level == i) {
f.quad = 4;
f._visible = false;
} else {
f._visible = true;
f.gotoAndStop(2);
}
i++;
}
if (level > 1) {
tempLevel = 0;
while (tempLevel < (level - 1)) {
if (tempLevel == 0) {
blipStart = {x:squares._x + (squares._width / 2), y:(-20 + squares._y) + (squares._height / 2)};
} else {
blipStart = {x:flags["flag" + tempLevel]._x, y:flags["flag" + tempLevel]._y};
}
blipEnd = {x:flags["flag" + (tempLevel + 1)]._x, y:flags["flag" + (tempLevel + 1)]._y};
xdist = blipStart.x - blipEnd.x;
ydist = blipStart.y - blipEnd.y;
distanceToCover = Math.sqrt((xdist * xdist) + (ydist * ydist));
angle = -Math.atan2(xdist, ydist);
xspeed = Math.sin(angle);
yspeed = Math.cos(angle);
speed = 10;
steps = int(distanceToCover / speed);
step = 0;
while (step < steps) {
step++;
b = blips.attachMovie("blip", "blip" + z, z++, {_x:blipStart.x + ((step * xspeed) * speed), _y:blipStart.y - ((step * yspeed) * speed), _xscale:90, _yscale:90, quad:-4});
}
tempLevel++;
}
}
blipFrames = (blipFramesInit = 10);
if (level == 1) {
blipStart = {x:squares._x + (squares._width / 2), y:(-20 + squares._y) + (squares._height / 2)};
} else {
blipStart = {x:flags["flag" + (level - 1)]._x, y:flags["flag" + (level - 1)]._y};
}
blipEnd = {x:flags["flag" + level]._x, y:flags["flag" + level]._y};
xdist = blipStart.x - blipEnd.x;
ydist = blipStart.y - blipEnd.y;
distanceToCover = Math.sqrt((xdist * xdist) + (ydist * ydist));
angle = -Math.atan2(xdist, ydist);
xspeed = Math.sin(angle);
yspeed = Math.cos(angle);
speed = 10;
steps = int(distanceToCover / speed) - 1;
step = 0;
d = 0;
onEnterFrame = function () {
if (d == 1) {
country = flags["flag" + level].nation;
prevCountry = flags["flag" + (level - 1)].nation;
prevPrevCountry = flags["flag" + (level - 2)].nation;
level1Briefing = ("Commander, we share your vision of uniting all the countries of Earth under one rule, and have gathered the necessary troops to begin your conquest. Our first target is " + country) + " While the more experienced commanders attack on one front, you will support them with an assault in the other, to divide their defenses.";
level2Briefing = ((("You did an excellent job attacking " + prevCountry) + "- the other commanders commend your work. As a token of their grattitude, they have gifted you with a squad of bazooka troopers. These are devastating against vehicles, but do not stand up well against bullets. We have received intelligence that ") + country) + " has sent a convoy of tanks to retaliate against our other generals. You must intercept and destroy them, with minimal loss of life.";
level3Briefing = ((("Some of our elite troops captured a factory on the border of " + prevCountry) + " for us, meaning that we can now produce tanks! Unfortunately, supplying the factory with raw materials is a long and risky business, so they are expensive. We suggest that you try them out on our new target, ") + country) + ".";
level4Briefing = "In light of your recent success, your budget has been increased. You can now save up to $1500 during battles. The other commanders have just returned from a recent conquest, and there have been many riots as a result. They will be joining us soon, but until then, you must hold the ground at the top of the hill to prevent the partisans from uniting. To aid you in this task, we have hired some mercenaries to snipe for us. They have a long range, and are very accurate.";
level5Briefing = ((("Congratulations on your interception- you have been thanked. We have now eliminated the majority of " + prevPrevCountry) + "'s forces. As a token of their thanks, the commanders have provided you with blueprints for the gattling tank- a unit much more capable for dealing with riots than snipers. They are highly effective against infantry and air units- which is fortunate, given our latest assignment. ") + country) + " has recently caused us a lot of trouble, and this is a mission for revenge. They don't stand a chance.";
level6Briefing = ("You have been advised to take a training course at one of our headquarters in " + country) + ". You must command a unit to pick up the flag in the middle and bring it back to the highlighted area. I suggest that you identify your fastest units for this task. You will receive money for incapacitating enemy soldiers- bear this in mind as well. One more thing- we've decided to test out out new ambulances in the field. Have fun! ";
level7Briefing = ("We have been overwhelmed by " + country) + "! The commanders have few troops left, and are in full retreat. You must ensure their safe escape at all costs. It will be a hard fight, but we must persevere! We could take only those who could be ready in time, so keep your men alive.";
level8Briefing = ("Phenomenal work, commander! You have just been entrusted with the task of delivering a message to one of our men in " + country) + ". This message is of great importance, and must be protected well. We may be ambushed on the journey, so make sure your men hold on to the note with their lives. As a precaution, we have been given a supply of armour piercing bullets.";
level9Briefing = ("It turns out that the message detailed the plans for some sort of heat beam, to be projected from space. This should serve useful in time. Our presence is required in " + country) + ", where we have launched another full-scale attack. Our budget has been upped to $2000, but do not expect an easy victory nonetheless.";
level10Briefing = ("You have done well, commander- another country is now under our reign. We are currently holding another Capture the Flag game in " + country) + " to inspire generals with new tactics... Okay, so it's just for fun. Tell your troops it's a morale-boosting event or something. Be warned- our new opponent has more experience than the last one.";
level11Briefing = ((("The UN has finally taken serious action against us! While it was naturally anticipated, we must be careful- they have launched an attack to try and recapture our latest prize- " + country) + ". Fortunately, our requests for an airfield have finally been approved, so we now how access to comanches! Our force is limited, so we must be careful with the lives of our troops while reclaiming ") + country) + ".";
level12Briefing = ("Many of the troops the UN sent against us were from " + country) + ", so we are taking our revenge. We both have few forces left from our last attack, so try to keep the strategic point illustrated on the map we've provided you with. Also, given our small numbers, we've decided to invest in the technology concerning heat-seeking missiles. Our budget will be lower for this match, but it should pay off.";
level13Briefing = ("We have been given an extra $1000 to spend during matches, so we can make more use of air units. We've added Helix helicopters to our arsenal- They can only fight land-based foes, but they pack a punch. The main reason for the payrise is that we have been hired as mercenaries by a neutral country to attack their enemy- " + country) + ". They will also give us money for individual kills, for compensation if we face a larger army. Consider this, and you will do well.";
level14Briefing = ("Now we intend to settle an old score. " + country) + " has long plagued us by denying us backup when we've needed it the most. We have installed gattling guns on our heavy tanks to ensure victory, and temporarily taken infantry out of our lineup so we can travel fast and powerfully.";
level15Briefing = ((("We did not expect " + prevCountry) + " to be so well equipped! I mean, laser troops... We are currently attempting to find out where the laser weapons are produced, but that may take a while. In the meantime, we have arranged a powerball match in ") + country) + ", which has recently been turned to our cause.";
level16Briefing = ("Good news! We have acquired the laser technology, and have begun training laser troops. They have not learnt to focus their weapons on one part of the body yet, so killing is currently a slow business. We're going to train them against a small infantry division in " + country) + ". They are primarily an infantry force, and we need to find out how effective their lasers are against foot soldiers. Be careful with your troops, since they are currently the most experienced laser troops we have.";
level17Briefing = "We have further developed the laser technology, and we now have now fitted them into a new vehicle we call the laser tank. Your budget has increased by $500, which should help you train the laser troops to focus their weapons via the new Beam Concentration technique. But now, you must again keep a country's troops at bay while the other commanders return from their conquest.";
level18Briefing = ("Yet again, we have overestimated the enemy's resources. How on Earth did they disable our troops? Perhaps an electromagnetic pulse of some sort, or maybe gas... It produced the same effect as a flashbang grenade, but with darkness. Our scientists are looking into this, but for the moment we should concern ourselves with our new upgrade- comanche rocket pods. These were used to great effect by our comrades a few days ago, and led to the conquering of " + country) + ". It is our job to destroy any rebels left behind. Hold the line, and let noone get through.";
level19Briefing = ("This is insane. They were using missiles on the battlefield. Do they have no concern for the safety of their soldiers? We will stock up on missiles just in case, but it will still take great preparation to do it without attracting too much attention. But I digress- we have developed an Ion Cannon! The interface is simple- click on the battlefield and drag in the direction you want it to go. You want the arrowhead to point towards the enemy, of course. Our next target is " + country) + ".";
level20Briefing = ("As jealously as we have guarded the secret of lasers we obtained, it has gotten out to the enemy. " + country) + " love the technology- their latest platoon exclusively uses lasers. Find a unit which can beat lasers, and we will win. Please note that our Ion Cannon is down for repairs, after damaging itself in its first test.";
level21Briefing = ("Our scientists have discovered how to freeze troops! Now we should have enough power to take on " + country) + ". We're sending our entire supply of troops in, but don't waste them, or we won't be able to continue our campaign.";
level22Briefing = ("One of our commanders has been killed, following an attack on " + country) + ". We must avenge his death, and destroy all those who oppose us. You have inherited some of his budget, bringing you up to $4000.";
level23Briefing = "One of our main advantages- knowledge of Ion Cannons- has been rendered useless. The remaining countries in our path are now capable of constructing them, so we must be more careful from now on. Good luck, commander.";
level24Briefing = "You must escort our missiles cargo to the next country for a final attack, even if it means fighting a few nations on your way. Vehicles only, for speed's sake.";
level25Briefing = ("The last hurdle. If we give " + country) + " a big enough air strike, people should finally see who's boss. But first you need to take out their defenses. Have fun with your new budget, and feel free to help yourself to a few missiles as well.";
briefings = [null, level1Briefing, level2Briefing, level3Briefing, level4Briefing, level5Briefing, level6Briefing, level7Briefing, level8Briefing, level9Briefing, level10Briefing, level11Briefing, level12Briefing, level13Briefing, level14Briefing, level15Briefing, level16Briefing, level17Briefing, level18Briefing, level19Briefing, level20Briefing, level21Briefing, level22Briefing, level23Briefing, level24Briefing, level25Briefing];
missionInstructions = briefings[level];
}
d++;
blipFrames--;
if (blipFrames == 0) {
step++;
blipFrames = blipFramesInit;
b = blips.attachMovie("blip", "blip" + z, z++, {_x:blipStart.x + ((step * xspeed) * speed), _y:blipStart.y - ((step * yspeed) * speed), _xscale:100, _yscale:100, quad:4});
if (step >= (steps + 1)) {
f = flags["flag" + level];
f._visible = true;
f.onEnterFrame = function () {
if (this.quad != -4) {
this._xscale = Math.max(60, Math.min(90, 30 + ((this.quad * this.quad) * 10)));
this._yscale = this._xscale;
this.quad--;
} else {
a = attachMovie("arrowPointer", "arrow", z++, {_alpha:0, _x:flags["flag" + level]._x, _y:flags["flag" + level]._y + 10});
a.onEnterFrame = function () {
this._alpha = this._alpha - -10;
if (this._alpha == 100) {
this.onEnterFrame = null;
}
};
this.onEnterFrame = null;
}
};
onEnterFrame = null;
}
}
};
blips.onEnterFrame = function () {
for (var i in blips) {
b = blips[i];
if (b.quad != -4) {
b._xscale = Math.max(60, Math.min(90, 30 + ((b.quad * b.quad) * 10)));
b._yscale = b._xscale;
b.quad--;
}
}
};
if (level >= 26) {
removeMovieClip(blips);
removeMovieClip(flags);
removeMovieClip(arrow);
removeMovieClip(squares);
gotoAndStop (28);
}
Frame 8
qwertyuiop = "BACK";
_root[cursorName].gotoAndStop(1);
bugbutton.onRollOver = (bugbutton.onDragOver = (backbutton.onRollOver = (backbutton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})));
bugbutton.onRollOut = (bugbutton.onDragOut = (backbutton.onRollOut = (backbutton.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
})));
bugbutton.onRelease = function () {
qwertyuiop = "GIVE UP";
loadVariables (((((("C3Suggestions.php?message=" + message) + "&subject=") + subject) + "&email=") + email) + "&securityVar=0001", _root);
_root.onData = function () {
gotoAndStop (3);
};
};
backbutton.onRelease = function () {
gotoAndStop (3);
};
Instance of Symbol 1036 MovieClip [FScrollBarSymbol] in Frame 8
//component parameters
onClipEvent (initialize) {
_targetInstanceName = "messageBox";
horizontal = false;
}
Frame 9
function sliderCallback() {
difficulty = (save.difficulty = mySlider.getValue());
movesPerSecond = Math.round(30 / difficulty);
saveFile.flush();
}
_root[cursorName].gotoAndStop(1);
playButton.onRollOver = (playButton.onDragOver = (backButton.onRollOver = (backButton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})));
playButton.onRollOut = (playButton.onDragOut = (backButton.onRollOut = (backButton.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
})));
playButton.onRelease = function () {
p1poplimit = save.p1poplimit;
p2poplimit = save.p2poplimit;
if (playerChooseMode == 1) {
s = save.team1UpgradeChoices.split(",", 10000);
team1CanUpgrade = [];
team1CanUpgrade.push(s[2] == "1");
team1CanUpgrade.push(s[3] == "1");
team1CanUpgrade.push(s[4] == "1");
team1CanUpgrade.push(s[1] == "1");
team1CanUpgrade.push(s[0] == "1");
nukesOn = s[5] == "1";
habisLasersOn = s[6] == "1";
troopFreezeOn = s[7] == "1";
tempVar = save.team1Units.split(",", 100);
team1Units = [];
var i = 0;
while (i < tempVar.length) {
team1Units.push(tempVar[i] == "1");
i++;
}
}
techTowerOn = (team1CanUpgrade[0] || (team1CanUpgrade[1])) || (team1CanUpgrade[2]);
if (enemyChooseMode == 1) {
p2RandomTeam();
} else if (enemyChooseMode == 2) {
team2TempUnits = team1Units;
team2CanUpgrade = team1CanUpgrade;
p2nukesOn = nukesOn;
p2habisLasersOn = habisLasersOn;
p2troopFreezeOn = troopFreezeOn;
} else {
tempVar = save.team2Units.split(",", 100);
team2TempUnits = [];
var i = 0;
while (i < tempVar.length) {
team2TempUnits.push(tempVar[i] == "1");
i++;
}
s = save.team2UpgradeChoices.split(",", 10000);
team2CanUpgrade = [];
team2CanUpgrade.push(s[2] == "1");
team2CanUpgrade.push(s[3] == "1");
team2CanUpgrade.push(s[4] == "1");
team2CanUpgrade.push(s[1] == "1");
team2CanUpgrade.push(s[0] == "1");
p2nukesOn = s[5] == "1";
p2habisLasersOn = s[6] == "1";
p2troopFreezeOn = s[7] == "1";
}
team1RocketPods = false;
team2RocketPods = false;
team1HomingMissiles = false;
team2HomingMissiles = false;
team1laserUpgrade = false;
team2laserUpgrade = false;
team1APBullets = false;
team2APBullets = false;
team1tankGattling = false;
team2tankGattling = false;
gotoAndStop (4);
};
backButton.onRelease = function () {
if (quickMatch) {
quickMatch = false;
gotoAndStop (3);
} else if (enemyChooseMode == 3) {
gotoAndStop (18);
} else {
gotoAndStop (16);
}
};
if (save.difficulty == undefined) {
difficulty = 15;
save.difficulty = difficulty;
} else {
difficulty = save.difficulty;
}
mySlider.slide._x = (30 - difficulty) * 3.57;
movesPerSecond = Math.round(30 / difficulty);
mySlider.setChangeHandler(sliderCallback);
Instance of Symbol 1240 MovieClip [SliderComponent] "mySlider" in Frame 9
//component parameters
onClipEvent (initialize) {
min = 30;
max = 1;
col = 51;
cchangeHandler = "";
}
Frame 10
classicDescription = "In Classic mode, if you have troops on the battlefield and the enemy doesn't (ie, you have control of the field), the enemy will lose health.";
kingOfTheHillDescription = "In King of the Hill, the two teams fight for possession of a ring in the middle of the battlefield. While only one team is inside it, the other team's base will lose health.";
captureTheFlagDescription = "In Capture the Flag, each team will endeavour to take the flag from the middle of the map and place it into their base's flag holder. Each time they do this, it will damage the other team, and after 3 flags have been captured, the enemy will be dead.";
powerBallDescription = "Whichever team holds the Power Ball saps the HP of the other team. Hold onto it for as long as possible to win the match!";
deathmatchDescription = "Whenever you kill an enemy, it will damage their base as well (the stronger the units was, the more HP the enemy will lose). Your base will lose health when the enemy controls the battlefield, too, like in Classic mode.";
gameTypeDescription = "Please choose a game type.";
advancedOptions._visible = false;
basicOptions._visible = true;
cashBounty = save.cashBounty;
bountyValue = save.bountyQuantity;
advancedOptions.b6.gotoAndStop(2);
gameMode = save.gameMode;
if (gameMode == "deathmatch") {
b5.gotoAndStop(2);
gameTypeDescription = deathmatchDescription;
} else if (gameMode == "kingofthehill") {
b2.gotoAndStop(2);
gameTypeDescription = kingOfTheHillDescription;
} else if (gameMode == "capturetheflag") {
b3.gotoAndStop(2);
gameTypeDescription = captureTheFlagDescription;
} else if (gameMode == "powerball") {
b4.gotoAndStop(2);
gameTypeDescription = powerBallDescription;
} else {
b1.gotoAndStop(2);
gameTypeDescription = classicDescription;
}
if (save.cashBounty) {
advancedOptions.b6.gotoAndStop(2);
advancedOptions.b7.gotoAndStop(1);
} else {
advancedOptions.b7.gotoAndStop(2);
advancedOptions.b6.gotoAndStop(1);
}
_root[cursorName].gotoAndStop(1);
nextButton.onRollOver = (nextButton.onDragOver = (backButton.onRollOver = (backButton.onDragOver = (advancedOptions.basicSettingsButton.onRollOver = (advancedOptions.basicSettingsButton.onDragOver = (basicOptions.advancedSettingsButton.onRollOver = (basicOptions.advancedSettingsButton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})))))));
nextButton.onRollOut = (nextButton.onDragOut = (backButton.onRollOut = (backButton.onDragOut = (advancedOptions.basicSettingsButton.onRollOut = (advancedOptions.basicSettingsButton.onDragOut = (basicOptions.advancedSettingsButton.onRollOut = (basicOptions.advancedSettingsButton.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
})))))));
nextButton.onRelease = function () {
save.gameMode = gameMode;
save.matchVariable = matchVariable;
save.cashBounty = cashBounty;
gotoAndStop (15);
};
backButton.onRelease = function () {
save.optionsFrame = advancedOptions.matchVariableMC._currentframe;
save.matchVariable = matchVariable;
save.cashBounty = cashBounty;
gotoAndStop (3);
};
advancedOptions.matchVariableMC.gotoAndStop(save.optionsFrame);
matchVariable = save.matchVariable;
Frame 11
_root[cursorName].gotoAndStop(1);
if (save.flagX == undefined) {
loadCampaignMC.gotoAndStop(2);
} else {
loadCampaignMC.gotoAndStop(1);
}
backButton.onRollOver = (backButton.onDragOver = (newCampaignButton.onRollOver = (newCampaignButton.onDragOver = (loadCampaignMC.loadCampaignButton.onRollOver = (loadCampaignMC.loadCampaignButton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})))));
backButton.onRollOut = (backButton.onDragOut = (newCampaignButton.onRollOut = (newCampaignButton.onDragOut = (loadCampaignMC.loadCampaignButton.onRollOut = (loadCampaignMC.loadCampaignButton.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
})))));
backButton.onRelease = function () {
gotoAndStop (3);
};
newCampaignButton.onRelease = function () {
gotoAndStop (12);
};
loadCampaignMC.loadCampaignButton.onRelease = function () {
gotoAndStop (7);
};
Frame 12
function editFlagMode() {
flagMode = 0;
globalScale = 20;
var i = 0;
while (i < xSquares) {
var j = 0;
while (j < ySquares) {
s = squares.createEmptyMovieClip((("square_" + i) + "_") + j, z++);
s.col = 16777215 /* 0xFFFFFF */;
s.x = i;
s.y = j;
makeBox(gridX + (i * globalScale), gridY + (j * globalScale), globalScale, s, true, 16777215);
j++;
}
i++;
}
if (save.flagArray != undefined) {
loadFlag();
} else {
saveFlag();
}
}
function findTileCoords(obj) {
tempVar = obj._name.split("_", 10);
return({x:tempVar[1], y:tempVar[2]});
}
function findTile(x, y) {
return(squares[(("square_" + x) + "_") + y]);
}
function recurseSurroundings(x, y) {
recurse(x, y + 1);
recurse(x + 1, y);
recurse(x, y - 1);
recurse(x - 1, y);
}
function recurse(x, y) {
r = findTile(x, y);
if (r._name != undefined) {
tilesDone.push(r);
if (r.col != origCol) {
return(undefined);
}
paint(r);
recurseSurroundings(x, y);
}
}
function mouseToPixel(xmouse, ymouse, x, y, scale) {
tempX = xmouse - x;
tempY = ymouse - y;
tempX = tempX / scale;
tempY = tempY / scale;
tempX = int(tempX);
tempY = int(tempY);
tempX = Math.min(xSquares - 1, tempX);
tempY = Math.min(ySquares - 1, tempY);
return({x:tempX, y:tempY});
}
function decimalToHexadecimal(number) {
hexHi = int(number / 16);
hexLo = number % 16;
hexLookup = "0123456789ABCDEF";
hexHiChar = hexLookup.charAt(hexHi);
hexLoChar = hexLookup.charAt(hexLo);
return(hexHiChar + hexLoChar);
}
function saveFlag() {
save.flagArray = "";
j = 0;
while (j < ySquares) {
var i = 0;
while (i < xSquares) {
s = squares[(("square_" + i) + "_") + j];
bb = decimalToHexadecimal(s.col & 255);
gg = decimalToHexadecimal((s.col / 256) & 255);
rr = decimalToHexadecimal((s.col / 65536) & 255);
save.flagArray = save.flagArray + (((rr + gg) + bb) + ", ");
i++;
}
j++;
}
dataBox = save.flagArray;
}
lastTool = 0;
backButton.onRollOver = (backButton.onDragOver = (m1.onRollOver = (m1.onDragOver = (m2.onRollOver = (m2.onDragOver = (m3.onRollOver = (m3.onDragOver = (pointer1.onRollOver = (pointer1.onDragOver = (pointer2.onRollOver = (pointer2.onDragOver = (pointer3.onRollOver = (pointer3.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})))))))))))));
backButton.onRollOut = (backButton.onDragOut = (m1.onRollOver = (m1.onDragOver = (m2.onRollOver = (m2.onDragOver = (m3.onRollOver = (m3.onDragOver = (pointer1.onRollOver = (pointer1.onDragOver = (pointer2.onRollOver = (pointer2.onDragOver = (pointer3.onRollOver = (pointer3.onDragOver = function () {
_root[cursorName].gotoAndStop(1);
})))))))))))));
backButton.onRelease = function () {
removeMovieClip(squares);
removeMovieClip(squareLines);
gotoAndStop (11);
};
lineClick = false;
squareClick = false;
penClick = false;
gridX = 60;
gridY = 60;
tool = 0;
flagMode = 0;
gridOn = true;
clicking = false;
z = 0;
xSquares = 13;
ySquares = 9;
hexColour = "000000";
paintColour = 0;
pointer1.colValue = 0;
pointer2.colValue = 0;
pointer3.colValue = 0;
clickStart = {x:0, y:0};
hexMode = false;
createEmptyMovieClip("squares", z++);
createEmptyMovieClip("squareLines", z++);
Mouse.hide();
_root[cursorName].onEnterFrame = function () {
Mouse.hide();
if ((tool == 2) || (tool == 3)) {
if (squares.hitTest(_xmouse, _ymouse, false)) {
var i = 0;
while (i < xSquares) {
j = 0;
while (j < ySquares) {
s = squares[(("square_" + i) + "_") + j];
if (s.hitTest(_xmouse, _ymouse, false)) {
this._x = (gridX + (s.x * globalScale)) + (globalScale / 2);
this._y = (gridX + (s.y * globalScale)) + (globalScale / 2);
break;
}
j++;
}
i++;
}
if (lineClick) {
squareLines.clear();
squareLines.lineStyle(1, paintColour, 100);
pee1 = {x:Math.max(gridX + (globalScale / 2), Math.min((gridX + (xSquares * globalScale)) - (globalScale / 2), clickStart.x)), y:Math.max(gridY + (globalScale / 2), Math.min((gridY + (ySquares * globalScale)) - (globalScale / 2), clickStart.y))};
pee2 = {x:Math.max(gridX + (globalScale / 2), Math.min((gridX + (xSquares * globalScale)) - (globalScale / 2), _root[cursorName]._x)), y:Math.max(gridY + (globalScale / 2), Math.min((gridY + (ySquares * globalScale)) - (globalScale / 2), _root[cursorName]._y))};
squareLines.moveTo(pee1.x, pee1.y);
squareLines.lineTo(pee2.x, pee2.y);
} else if (squareClick) {
squareLines.clear();
squarelines.beginFill(paintColour, 50);
squareLines.lineStyle(1, paintColour, 100);
pee1 = {x:Math.max(gridX + (globalScale / 2), Math.min((gridX + (xSquares * globalScale)) - (globalScale / 2), clickStart.x)), y:Math.max(gridY + (globalScale / 2), Math.min((gridY + (ySquares * globalScale)) - (globalScale / 2), clickStart.y))};
pee2 = {x:Math.max(gridX + (globalScale / 2), Math.min((gridX + (xSquares * globalScale)) - (globalScale / 2), _root[cursorName]._x)), y:Math.max(gridY + (globalScale / 2), Math.min((gridY + (ySquares * globalScale)) - (globalScale / 2), _root[cursorName]._y))};
squareLines.moveTo(pee1.x, pee1.y);
squareLines.lineTo(pee2.x, pee1.y);
squareLines.lineTo(pee2.x, pee2.y);
squareLines.lineTo(pee1.x, pee2.y);
squareLines.lineTo(pee1.x, pee1.y);
squarelines.endFill();
}
} else {
this._x = _xmouse;
this._y = _ymouse;
}
} else {
this._x = _xmouse;
this._y = _ymouse;
}
};
squares.onMouseDown = function () {
penClick = false;
if (squares.hitTest(_xmouse, _ymouse, false)) {
penClick = true;
}
clicking = false;
if (!squares.hitTest(_xmouse, _ymouse, false)) {
clicking = true;
}
clickStart = {x:_root[cursorName]._x, y:_root[cursorName]._y};
if (tool == 1) {
if (squares.hitTest(_xmouse, _ymouse, false)) {
t = mouseToPixel(_xmouse, _ymouse, gridX, gridY, globalScale);
s = squares[(("square_" + t.x) + "_") + t.y];
if (s.col != paintColour) {
origCol = s.col;
paint(s);
recurseSurroundings(t.x, t.y);
}
}
} else if (tool == 2) {
if (squares.hitTest(_xmouse, _ymouse, false)) {
lineClick = true;
}
} else if (tool == 3) {
if (squares.hitTest(_xmouse, _ymouse, false)) {
squareClick = true;
}
} else if (tool == 4) {
if (squares.hitTest(_xmouse, _ymouse, false)) {
t = mouseToPixel(_xmouse, _ymouse, gridX, gridY, globalScale);
s = squares[(("square_" + t.x) + "_") + t.y];
paintColour = s.col;
paint(colourFeedback);
bb = decimalToHexadecimal(paintColour & 255);
gg = decimalToHexadecimal((paintColour / 256) & 255);
rr = decimalToHexadecimal((paintColour / 65536) & 255);
hexColour = (("" + rr) + gg) + bb;
red = hexColour.charAt(0) + hexColour.charAt(1);
green = hexColour.charAt(2) + hexColour.charAt(3);
blue = hexColour.charAt(4) + hexColour.charAt(5);
pointer1._y = (m1._y + 255) - parseInt("0x" + red);
pointer2._y = (m2._y + 255) - parseInt("0x" + green);
pointer3._y = (m3._y + 255) - parseInt("0x" + blue);
red = Math.round(255 - (pointer1._y - m1._y));
green = Math.round(255 - (pointer2._y - m2._y));
blue = Math.round(255 - (pointer3._y - m3._y));
pointer1.colValue = red;
pointer2.colValue = green;
pointer3.colValue = blue;
tool = lastTool;
_root[cursorName].gotoAndStop(3 + tool);
flagDesignPointer.gotoAndStop(tool + 1);
}
}
};
squares.onMouseUp = function () {
if (lineClick) {
squareLines.clear();
xdist = pee2.x - pee1.x;
ydist = pee2.y - pee1.y;
if (Math.abs(xdist) > Math.abs(ydist)) {
if (xdist < 0) {
tmp = pee1;
pee1 = pee2;
pee2 = tmp;
xdist = pee2.x - pee1.x;
ydist = pee2.y - pee1.y;
}
} else if (ydist < 0) {
tmp = pee1;
pee1 = pee2;
pee2 = tmp;
xdist = pee2.x - pee1.x;
ydist = pee2.y - pee1.y;
}
m = ydist / xdist;
c = pee1.y - (m * pee1.x);
if (xdist == 0) {
i = 0;
while (i < (int(ydist / globalScale) + 1)) {
y = pee1.y + (globalScale * i);
x = pee1.x;
t = mouseToPixel(x, y, gridX, gridY, globalScale);
paint(findTile(t.x, t.y));
i++;
}
} else if (ydist == 0) {
i = 0;
while (i < (int(xdist / globalScale) + 1)) {
x = pee1.x + (globalScale * i);
y = pee1.y;
t = mouseToPixel(x, y, gridX, gridY, globalScale);
paint(findTile(t.x, t.y));
i++;
}
} else if (Math.abs(xdist) > Math.abs(ydist)) {
i = 0;
while (i < (int(xdist / globalScale) + 1)) {
x = pee1.x + (globalScale * i);
y = (m * x) + c;
t = mouseToPixel(x, y, gridX, gridY, globalScale);
paint(findTile(t.x, t.y));
i++;
}
} else {
i = 0;
while (i < (int(ydist / globalScale) + 1)) {
y = pee1.y + (globalScale * i);
x = (y - c) / m;
t = mouseToPixel(x, y, gridX, gridY, globalScale);
paint(findTile(t.x, t.y));
i++;
}
}
saveFlag();
} else if (squareClick) {
for (var i in squares) {
s = squares[i];
if (s.hitTest(squareLines)) {
paint(s);
}
}
squareLines.clear();
saveFlag();
} else if (penClick) {
saveFlag();
}
lineClick = false;
penClick = false;
squareClick = false;
clicking = false;
};
squares.onEnterFrame = function () {
if (penClick) {
if (tool == 0) {
t = mouseToPixel(_xmouse, _ymouse, gridX, gridY, globalScale);
s = squares[(("square_" + t.x) + "_") + t.y];
paint(s);
}
}
};
hexBox.onKillFocus = function () {
hexMode = false;
};
hexBox.onSetFocus = function () {
hexMode = true;
};
onEnterFrame = function () {
if (clicking) {
if (m1.hitTest(clickStart.x, clickStart.y, true) || (pointer1.hitTest(clickStart.x, clickStart.y, true))) {
pointer1._y = Math.min((m1._y + m1._height) - 1, Math.max(m1._y, _ymouse));
}
if (m2.hitTest(clickStart.x, clickStart.y, true) || (pointer2.hitTest(clickStart.x, clickStart.y, true))) {
pointer2._y = Math.min((m2._y + m2._height) - 1, Math.max(m2._y, _ymouse));
}
if (m3.hitTest(clickStart.x, clickStart.y, true) || (pointer3.hitTest(clickStart.x, clickStart.y, true))) {
pointer3._y = Math.min((m3._y + m3._height) - 1, Math.max(m3._y, _ymouse));
}
red = Math.round(255 - (pointer1._y - m1._y));
green = Math.round(255 - (pointer2._y - m2._y));
blue = Math.round(255 - (pointer3._y - m3._y));
pointer1.colValue = red;
pointer2.colValue = green;
pointer3.colValue = blue;
paintColour = ((red << 16) | (green << 8)) | blue;
paint(colourFeedback);
hexColour = (decimalToHexadecimal(red) + decimalToHexadecimal(green)) + decimalToHexadecimal(blue);
}
if (hexMode) {
paintColour = parseInt("0x" + hexColour);
red = hexColour.charAt(0) + hexColour.charAt(1);
green = hexColour.charAt(2) + hexColour.charAt(3);
blue = hexColour.charAt(4) + hexColour.charAt(5);
pointer1._y = (m1._y + 255) - parseInt("0x" + red);
pointer2._y = (m2._y + 255) - parseInt("0x" + green);
pointer3._y = (m3._y + 255) - parseInt("0x" + blue);
red = Math.round(255 - (pointer1._y - m1._y));
green = Math.round(255 - (pointer2._y - m2._y));
blue = Math.round(255 - (pointer3._y - m3._y));
pointer1.colValue = red;
pointer2.colValue = green;
pointer3.colValue = blue;
paint(colourFeedback);
}
};
_root[cursorName].gotoAndStop(1);
pencilButton.onRollOver = (pencilButton.onDragOver = (paintbucketButton.onRollOver = (paintbucketButton.onDragOver = (lineToolButton.onRollOver = (lineToolButton.onDragOver = (squareButton.onRollOver = (squareButton.onDragOver = (saveFlagButton.onRollOver = (saveFlagButton.onDragOver = (loadFlagButton.onRollOver = (loadFlagButton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})))))))))));
pencilButton.onRollOut = (pencilButton.onDragOut = (paintbucketButton.onRollOut = (paintbucketButton.onDragOut = (lineToolButton.onRollOut = (lineToolButton.onDragOut = (squareButton.onDragOut = (squareButton.onRollOut = (saveFlagButton.onDragOut = (saveFlagButton.onRollOut = (loadFlagButton.onDragOut = (loadFlagButton.onRollOut = function () {
_root[cursorName].gotoAndStop(1);
})))))))))));
squares.onRollOver = (squares.onDragOver = function () {
_root[cursorName].gotoAndStop(3 + tool);
});
squares.onRollOut = (squares.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
});
pencilButton.onRelease = function () {
flagDesignPointer.gotoAndStop(1);
tool = 0;
};
paintbucketButton.onRelease = function () {
flagDesignPointer.gotoAndStop(2);
tool = 1;
};
lineToolButton.onRelease = function () {
flagDesignPointer.gotoAndStop(3);
tool = 2;
};
squareButton.onRelease = function () {
flagDesignPointer.gotoAndStop(4);
tool = 3;
};
eyeDropperToolButton.onRelease = function () {
lastTool = tool;
flagDesignPointer.gotoAndStop(5);
tool = 4;
};
saveFlagButton.onRelease = function () {
saveFlag();
removeMovieClip(squares);
removeMovieClip(squareLines);
gotoAndStop (13);
};
loadFlagButton.onRelease = function () {
loadFlag();
};
editFlagMode();
InstanceName_0.onKillFocus = function () {
save.flagArray = dataBox;
if (save.flagArray != undefined) {
loadFlag();
}
};
if (save.flagArray != undefined) {
dataBox = save.flagArray;
}
Instance of Symbol 1036 MovieClip [FScrollBarSymbol] in Frame 12
//component parameters
onClipEvent (initialize) {
_targetInstanceName = "InstanceName_0";
horizontal = false;
}
Frame 13
function viewFlagMode() {
flagMode = 1;
globalScale = 1;
var i = 0;
while (i < xSquares) {
var j = 0;
while (j < ySquares) {
s = squares.createEmptyMovieClip((("square_" + i) + "_") + j, z++);
s.x = i;
s.y = j;
makeBox(gridX + (i * globalScale), gridY + (j * globalScale), globalScale, s, false, 16777215);
j++;
}
i++;
}
if (save.flagArray != undefined) {
loadFlag();
}
}
gridX = 0;
gridY = 0;
flagMode = 0;
gridOn = true;
clickable = false;
z = 0;
xSquares = 13;
ySquares = 9;
paintColour = 0;
createEmptyMovieClip("squares", z++);
viewFlagMode();
squares.onEnterFrame = (sFunc = function () {
this._x = _xmouse - Math.ceil(xSquares / 2);
this._y = _ymouse - Math.ceil(ySquares / 2);
clickable = true;
for (var i in flagHolder) {
f = flagHolder[i];
if (f.hitTest(this)) {
clickable = false;
break;
}
}
if (clickable) {
if (!map.hitTest(_xmouse, _ymouse, true)) {
clickable = false;
}
}
if (clickable) {
b = 0;
t = {rb:b, gb:b, bb:b};
col = new Color(this);
col.setTransform(t);
_root[cursorName].gotoAndStop(2);
} else {
b = -128;
t = {rb:b, gb:b, bb:b};
col = new Color(this);
col.setTransform(t);
_root[cursorName].gotoAndStop(1);
}
});
squares.onRelease = (squares.onReleaseOutside = (sFunc2 = function () {
if (!backNextMC.hitTest(_xmouse, _ymouse, false)) {
if (clickable) {
this.onEnterFrame = null;
_root[cursorName].gotoAndStop(1);
backNextMC.gotoAndStop(2);
squares.onRollOver = (squares.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
});
squares.onRollOut = (squares.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
});
squares.onRelease = (squares.onReleaseOutside = function () {
squares.onEnterFrame = sFunc;
backNextMC.gotoAndStop(1);
squares.onRollOver = (squares.onDragOver = null);
squares.onRollOut = (squares.onDragOut = null);
squares.onRelease = (squares.onReleaseOutside = sFunc2);
});
}
}
}));
_root[cursorName].onEnterFrame = function () {
this._x = _xmouse;
this._y = _ymouse;
};
Frame 14
tankGattleTicked = false;
rocketPodsTicked = false;
_root[cursorName].gotoAndStop(1);
nextButton.onRollOver = (nextButton.onDragOver = (backButton.onRollOver = (backButton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})));
nextButton.onRollOut = (nextButton.onDragOut = (backButton.onRollOut = (backButton.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
})));
backButton.onRelease = function () {
save.team1Units = "";
save.team1Units = save.team1Units + ((z1.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z2.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z5.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z6.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z9.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z3.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z7.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z4.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z10.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z8.tickOrCross._currentframe == 1) ? "0" : "1");
gotoAndStop (19);
};
nextButton.onRelease = function () {
save.team1Units = "";
save.team1Units = save.team1Units + ((z1.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z2.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z5.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z6.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z9.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z3.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z7.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z4.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z10.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1Units = save.team1Units + ((z8.tickOrCross._currentframe == 1) ? "0" : "1");
team1Units = save.team1Units.split(",", 1000);
c = false;
var i = 1;
while (i <= 10) {
if (_root["z" + i].tickOrCross._currentframe == 2) {
c = true;
gotoAndStop (16);
break;
}
i++;
}
if (!c) {
message.play();
}
};
if ((save.level == undefined) || (save.level < 1)) {
campaignGold = 1000;
} else {
campaignGold = 1000 + ((save.level - 1) * 200);
}
team1Units = save.team1Units.split(",", 1000);
z1.tickOrCross.gotoAndStop(((team1Units[0] == "0") ? 1 : 2));
z2.tickOrCross.gotoAndStop(((team1Units[1] == "0") ? 1 : 2));
z3.tickOrCross.gotoAndStop(((team1Units[5] == "0") ? 1 : 2));
z4.tickOrCross.gotoAndStop(((team1Units[7] == "0") ? 1 : 2));
z5.tickOrCross.gotoAndStop(((team1Units[2] == "0") ? 1 : 2));
z6.tickOrCross.gotoAndStop(((team1Units[3] == "0") ? 1 : 2));
z7.tickOrCross.gotoAndStop(((team1Units[6] == "0") ? 1 : 2));
z8.tickOrCross.gotoAndStop(((team1Units[9] == "0") ? 1 : 2));
z9.tickOrCross.gotoAndStop(((team1Units[4] == "0") ? 1 : 2));
z10.tickOrCross.gotoAndStop(((team1Units[8] == "0") ? 1 : 2));
Instance of Symbol 933 MovieClip [UnitComponent] "z10" in Frame 14
//component parameters
onClipEvent (initialize) {
unitType = "Helix";
unitFrame = 10;
price = 1000;
team = 1;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z9" in Frame 14
//component parameters
onClipEvent (initialize) {
unitType = "Comanche";
unitFrame = 9;
price = 600;
team = 1;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z8" in Frame 14
//component parameters
onClipEvent (initialize) {
unitType = "Ambulance";
unitFrame = 8;
price = 800;
team = 1;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z7" in Frame 14
//component parameters
onClipEvent (initialize) {
unitType = "Laser Tank";
unitFrame = 7;
price = 700;
team = 1;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z6" in Frame 14
//component parameters
onClipEvent (initialize) {
unitType = "Gattling Tank";
unitFrame = 6;
price = 500;
team = 1;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z5" in Frame 14
//component parameters
onClipEvent (initialize) {
unitType = "Heavy Tank";
unitFrame = 5;
price = 650;
team = 1;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z4" in Frame 14
//component parameters
onClipEvent (initialize) {
unitType = "Sniper";
unitFrame = 4;
price = 500;
team = 1;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z3" in Frame 14
//component parameters
onClipEvent (initialize) {
unitType = "Laser Trooper";
unitFrame = 3;
price = 400;
team = 1;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z2" in Frame 14
//component parameters
onClipEvent (initialize) {
unitType = "Bazooka Trooper";
unitFrame = 2;
price = 300;
team = 1;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z1" in Frame 14
//component parameters
onClipEvent (initialize) {
unitType = "Light Infantry";
unitFrame = 1;
price = 250;
team = 1;
}
Frame 15
_root[cursorName].gotoAndStop(1);
playerChooseMode = 1;
backButton.onRollOver = (backButton.onDragOver = (b1.onRollOver = (b1.onDragOver = (b2.onRollOver = (b2.onDragOver = (b3.onRollOver = (b3.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})))))));
backButton.onRollOut = (backButton.onDragOut = (b1.onRollOut = (b1.onDragOut = (b2.onRollOut = (b2.onDragOut = (b3.onRollOut = (b3.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
})))))));
backButton.onRelease = function () {
gotoAndStop (10);
};
b1.onRelease = function () {
playerChooseMode = 1;
gotoAndStop (19);
};
b2.onRelease = function () {
playerChooseMode = 2;
gotoAndStop (19);
};
Frame 16
tankGattleTicked = false;
rocketPodsTicked = false;
_root[cursorName].gotoAndStop(1);
nextButton.onRollOver = (nextButton.onDragOver = (backButton.onRollOver = (backButton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})));
nextButton.onRollOut = (nextButton.onDragOut = (backButton.onRollOut = (backButton.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
})));
nextButton.onRelease = function () {
save.team1UpgradeChoices = "";
save.team1UpgradeChoices = save.team1UpgradeChoices + ((z1.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1UpgradeChoices = save.team1UpgradeChoices + ((z2.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1UpgradeChoices = save.team1UpgradeChoices + ((z3.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1UpgradeChoices = save.team1UpgradeChoices + ((z4.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1UpgradeChoices = save.team1UpgradeChoices + ((z5.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1UpgradeChoices = save.team1UpgradeChoices + ((z6.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1UpgradeChoices = save.team1UpgradeChoices + ((z7.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1UpgradeChoices = save.team1UpgradeChoices + ((z8.tickOrCross._currentframe == 1) ? "0," : "1");
if (enemyChooseMode == 3) {
gotoAndStop (17);
} else {
gotoAndStop (9);
}
};
backButton.onRelease = function () {
save.team1UpgradeChoices = "";
save.team1UpgradeChoices = save.team1UpgradeChoices + ((z1.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1UpgradeChoices = save.team1UpgradeChoices + ((z2.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1UpgradeChoices = save.team1UpgradeChoices + ((z3.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1UpgradeChoices = save.team1UpgradeChoices + ((z4.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1UpgradeChoices = save.team1UpgradeChoices + ((z5.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1UpgradeChoices = save.team1UpgradeChoices + ((z6.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1UpgradeChoices = save.team1UpgradeChoices + ((z7.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team1UpgradeChoices = save.team1UpgradeChoices + ((z8.tickOrCross._currentframe == 1) ? "0," : "1");
gotoAndStop (14);
};
if (save.level == undefined) {
campaignUpgradeGold = 1000;
} else {
campaignUpgradeGold = 1000 + ((save.level - 1) * 200);
}
team1UpgradeChoices = save.team1UpgradeChoices.split(",", 1000);
z1.tickOrCross.gotoAndStop(((team1UpgradeChoices[0] == "0") ? 1 : 2));
z2.tickOrCross.gotoAndStop(((team1UpgradeChoices[1] == "0") ? 1 : 2));
z3.tickOrCross.gotoAndStop(((team1UpgradeChoices[2] == "0") ? 1 : 2));
z4.tickOrCross.gotoAndStop(((team1UpgradeChoices[3] == "0") ? 1 : 2));
z5.tickOrCross.gotoAndStop(((team1UpgradeChoices[4] == "0") ? 1 : 2));
z6.tickOrCross.gotoAndStop(((team1UpgradeChoices[5] == "0") ? 1 : 2));
z7.tickOrCross.gotoAndStop(((team1UpgradeChoices[6] == "0") ? 1 : 2));
z8.tickOrCross.gotoAndStop(((team1UpgradeChoices[7] == "0") ? 1 : 2));
if (z1.tickOrCross._currentframe == 2) {
tankGattleTicked = true;
}
if (z2.tickOrCross._currentframe == 2) {
rocketPodsTicked = true;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z8" in Frame 16
//component parameters
onClipEvent (initialize) {
unitType = "Troop Freeze Power";
unitFrame = 18;
price = 1000;
team = 1;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z7" in Frame 16
//component parameters
onClipEvent (initialize) {
unitType = "Ion Beam Power";
unitFrame = 17;
price = 1000;
team = 1;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z6" in Frame 16
//component parameters
onClipEvent (initialize) {
unitType = "Nuclear Missile Power";
unitFrame = 16;
price = 1000;
team = 1;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z5" in Frame 16
//component parameters
onClipEvent (initialize) {
unitType = "Beam Concentration";
unitFrame = 15;
price = 500;
team = 1;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z4" in Frame 16
//component parameters
onClipEvent (initialize) {
unitType = "Armour Piercing Bullets";
unitFrame = 14;
price = 500;
team = 1;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z3" in Frame 16
//component parameters
onClipEvent (initialize) {
unitType = "Heat-seeking Rockets";
unitFrame = 13;
price = 800;
team = 1;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z2" in Frame 16
//component parameters
onClipEvent (initialize) {
unitType = "Comanche Rocket Pods";
unitFrame = 12;
price = 700;
team = 1;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z1" in Frame 16
//component parameters
onClipEvent (initialize) {
unitType = "Turret Upgrade";
unitFrame = 11;
price = 500;
team = 1;
}
Frame 17
tankGattleTicked = false;
rocketPodsTicked = false;
_root[cursorName].gotoAndStop(1);
nextButton.onRollOver = (nextButton.onDragOver = (backButton.onRollOver = (backButton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})));
nextButton.onRollOut = (nextButton.onDragOut = (backButton.onRollOut = (backButton.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
})));
nextButton.onRelease = function () {
save.team2Units = "";
save.team2Units = save.team2Units + ((z1.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z2.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z5.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z6.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z9.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z3.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z7.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z4.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z10.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z8.tickOrCross._currentframe == 1) ? "0" : "1");
team2Units = save.team2Units.split(",", 1000);
c = false;
var i = 1;
while (i <= 10) {
if (_root["z" + i].tickOrCross._currentframe == 2) {
c = true;
gotoAndStop (18);
break;
}
i++;
}
if (!c) {
message.play();
}
};
backButton.onRelease = function () {
save.team2Units = "";
save.team2Units = save.team2Units + ((z1.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z2.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z5.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z6.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z9.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z3.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z7.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z4.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z10.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2Units = save.team2Units + ((z8.tickOrCross._currentframe == 1) ? "0" : "1");
gotoAndStop (16);
};
if ((save.level == undefined) || (save.level < 1)) {
p2campaignGold = 1000;
} else {
p2campaignGold = 1000 + ((save.level - 1) * 200);
}
team2Units = save.team2Units.split(",", 1000);
z1.tickOrCross.gotoAndStop(((team2Units[0] == "0") ? 1 : 2));
z2.tickOrCross.gotoAndStop(((team2Units[1] == "0") ? 1 : 2));
z3.tickOrCross.gotoAndStop(((team2Units[5] == "0") ? 1 : 2));
z4.tickOrCross.gotoAndStop(((team2Units[7] == "0") ? 1 : 2));
z5.tickOrCross.gotoAndStop(((team2Units[2] == "0") ? 1 : 2));
z6.tickOrCross.gotoAndStop(((team2Units[3] == "0") ? 1 : 2));
z7.tickOrCross.gotoAndStop(((team2Units[6] == "0") ? 1 : 2));
z8.tickOrCross.gotoAndStop(((team2Units[9] == "0") ? 1 : 2));
z9.tickOrCross.gotoAndStop(((team2Units[4] == "0") ? 1 : 2));
z10.tickOrCross.gotoAndStop(((team2Units[8] == "0") ? 1 : 2));
Instance of Symbol 933 MovieClip [UnitComponent] "z10" in Frame 17
//component parameters
onClipEvent (initialize) {
unitType = "Helix";
unitFrame = 10;
price = 1000;
team = 2;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z9" in Frame 17
//component parameters
onClipEvent (initialize) {
unitType = "Comanche";
unitFrame = 9;
price = 600;
team = 2;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z8" in Frame 17
//component parameters
onClipEvent (initialize) {
unitType = "Ambulance";
unitFrame = 8;
price = 800;
team = 2;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z7" in Frame 17
//component parameters
onClipEvent (initialize) {
unitType = "Laser Tank";
unitFrame = 7;
price = 700;
team = 2;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z6" in Frame 17
//component parameters
onClipEvent (initialize) {
unitType = "Gattling Tank";
unitFrame = 6;
price = 500;
team = 2;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z5" in Frame 17
//component parameters
onClipEvent (initialize) {
unitType = "Heavy Tank";
unitFrame = 5;
price = 650;
team = 2;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z4" in Frame 17
//component parameters
onClipEvent (initialize) {
unitType = "Sniper";
unitFrame = 4;
price = 500;
team = 2;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z3" in Frame 17
//component parameters
onClipEvent (initialize) {
unitType = "Laser Trooper";
unitFrame = 3;
price = 400;
team = 2;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z2" in Frame 17
//component parameters
onClipEvent (initialize) {
unitType = "Bazooka Trooper";
unitFrame = 2;
price = 300;
team = 2;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z1" in Frame 17
//component parameters
onClipEvent (initialize) {
unitType = "Light Infantry";
unitFrame = 1;
price = 250;
team = 2;
}
Frame 18
tankGattleTicked = false;
rocketPodsTicked = false;
_root[cursorName].gotoAndStop(1);
nextButton.onRollOver = (nextButton.onDragOver = (backButton.onRollOver = (backButton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})));
nextButton.onRollOut = (nextButton.onDragOut = (backButton.onRollOut = (backButton.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
})));
nextButton.onRelease = function () {
save.team2UpgradeChoices = "";
save.team2UpgradeChoices = save.team2UpgradeChoices + ((z1.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2UpgradeChoices = save.team2UpgradeChoices + ((z2.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2UpgradeChoices = save.team2UpgradeChoices + ((z3.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2UpgradeChoices = save.team2UpgradeChoices + ((z4.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2UpgradeChoices = save.team2UpgradeChoices + ((z5.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2UpgradeChoices = save.team2UpgradeChoices + ((z6.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2UpgradeChoices = save.team2UpgradeChoices + ((z7.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2UpgradeChoices = save.team2UpgradeChoices + ((z8.tickOrCross._currentframe == 1) ? "0" : "1");
gotoAndStop (9);
};
backButton.onRelease = function () {
save.team2UpgradeChoices = "";
save.team2UpgradeChoices = save.team2UpgradeChoices + ((z1.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2UpgradeChoices = save.team2UpgradeChoices + ((z2.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2UpgradeChoices = save.team2UpgradeChoices + ((z3.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2UpgradeChoices = save.team2UpgradeChoices + ((z4.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2UpgradeChoices = save.team2UpgradeChoices + ((z5.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2UpgradeChoices = save.team2UpgradeChoices + ((z6.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2UpgradeChoices = save.team2UpgradeChoices + ((z7.tickOrCross._currentframe == 1) ? "0," : "1,");
save.team2UpgradeChoices = save.team2UpgradeChoices + ((z8.tickOrCross._currentframe == 1) ? "0" : "1");
gotoAndStop (17);
};
if (save.level == undefined) {
p2campaignUpgradeGold = 1000;
} else {
p2campaignUpgradeGold = 1000 + ((save.level - 1) * 200);
}
team2UpgradeChoices = save.team2UpgradeChoices.split(",", 1000);
z1.tickOrCross.gotoAndStop(((team2UpgradeChoices[0] == "0") ? 1 : 2));
z2.tickOrCross.gotoAndStop(((team2UpgradeChoices[1] == "0") ? 1 : 2));
z3.tickOrCross.gotoAndStop(((team2UpgradeChoices[2] == "0") ? 1 : 2));
z4.tickOrCross.gotoAndStop(((team2UpgradeChoices[3] == "0") ? 1 : 2));
z5.tickOrCross.gotoAndStop(((team2UpgradeChoices[4] == "0") ? 1 : 2));
z6.tickOrCross.gotoAndStop(((team2UpgradeChoices[5] == "0") ? 1 : 2));
z7.tickOrCross.gotoAndStop(((team2UpgradeChoices[6] == "0") ? 1 : 2));
z8.tickOrCross.gotoAndStop(((team2UpgradeChoices[7] == "0") ? 1 : 2));
if (z1.tickOrCross._currentframe == 2) {
tankGattleTicked = true;
}
if (z2.tickOrCross._currentframe == 2) {
rocketPodsTicked = true;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z8" in Frame 18
//component parameters
onClipEvent (initialize) {
unitType = "Troop Freeze Power";
unitFrame = 18;
price = 1000;
team = 2;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z7" in Frame 18
//component parameters
onClipEvent (initialize) {
unitType = "Ion Beam Power";
unitFrame = 17;
price = 1000;
team = 2;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z6" in Frame 18
//component parameters
onClipEvent (initialize) {
unitType = "Nuclear Missile Power";
unitFrame = 16;
price = 1000;
team = 2;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z5" in Frame 18
//component parameters
onClipEvent (initialize) {
unitType = "Beam Concentration";
unitFrame = 15;
price = 500;
team = 2;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z4" in Frame 18
//component parameters
onClipEvent (initialize) {
unitType = "Armour Piercing Bullets";
unitFrame = 14;
price = 500;
team = 2;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z3" in Frame 18
//component parameters
onClipEvent (initialize) {
unitType = "Heat-seeking Rockets";
unitFrame = 13;
price = 800;
team = 2;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z2" in Frame 18
//component parameters
onClipEvent (initialize) {
unitType = "Comanche Rocket Pods";
unitFrame = 12;
price = 700;
team = 2;
}
Instance of Symbol 933 MovieClip [UnitComponent] "z1" in Frame 18
//component parameters
onClipEvent (initialize) {
unitType = "Turret Upgrade";
unitFrame = 11;
price = 500;
team = 2;
}
Frame 19
team1CanUpgrade = [false, false, false, false, false];
team2CanUpgrade = [false, false, false, false, false];
habisLasersOn = false;
p2habisLasersOn = false;
nukesOn = false;
p2nukesOn = false;
troopFreezeOn = false;
p2troopFreezeOn = false;
techTowerOn = false;
mc1.gotoAndStop(2);
_root[cursorName].gotoAndStop(1);
enemyChooseMode = 1;
backButton.onRollOver = (backButton.onDragOver = (b1.onRollOver = (b1.onDragOver = (b2.onRollOver = (b2.onDragOver = (b3.onRollOver = (b3.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})))))));
backButton.onRollOut = (backButton.onDragOut = (b1.onRollOut = (b1.onDragOut = (b2.onRollOut = (b2.onDragOut = (b3.onRollOut = (b3.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
})))))));
backButton.onRelease = function () {
gotoAndStop (15);
};
if (playerChooseMode == 2) {
p1RandomTeam();
}
b1.onRelease = function () {
enemyChooseMode = 1;
if (playerChooseMode == 2) {
gotoAndStop (9);
} else {
gotoAndStop (14);
}
};
b2.onRelease = function () {
enemyChooseMode = 2;
if (playerChooseMode == 2) {
gotoAndStop (9);
} else {
gotoAndStop (14);
}
};
b3.onRelease = function () {
enemyChooseMode = 3;
if (playerChooseMode == 2) {
gotoAndStop (17);
} else {
gotoAndStop (14);
}
};
Frame 20
_root[cursorName].gotoAndStop(1);
backButton.onRollOver = (backButton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
});
backButton.onRollOut = (backButton.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
});
backButton.onRelease = function () {
gotoAndStop (3);
};
Instance of Symbol 410 MovieClip "pointyThingy2" in Frame 20
onClipEvent (load) {
if (_quality == "HIGH") {
this.gotoAndStop(1);
} else if (_quality == "MEDIUM") {
this.gotoAndStop(2);
} else if (_quality == "LOW") {
this.gotoAndStop(3);
}
}
Frame 23
_root[cursorName].gotoAndStop(1);
backButton.onRollOver = (backButton.onDragOver = (nextButton.onRollOver = (nextButton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})));
backButton.onRollOut = (backButton.onDragOut = (nextButton.onRollOut = (nextButton.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
})));
backButton.onRelease = function () {
gotoAndStop (3);
};
nextButton.onRelease = function () {
nextFrame();
};
Frame 24
_root[cursorName].gotoAndStop(1);
backButton.onRollOver = (backButton.onDragOver = (nextButton.onRollOver = (nextButton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})));
backButton.onRollOut = (backButton.onDragOut = (nextButton.onRollOut = (nextButton.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
})));
backButton.onRelease = function () {
prevFrame();
};
nextButton.onRelease = function () {
nextFrame();
};
Frame 25
_root[cursorName].gotoAndStop(1);
backButton.onRollOver = (backButton.onDragOver = (nextButton.onRollOver = (nextButton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})));
backButton.onRollOut = (backButton.onDragOut = (nextButton.onRollOut = (nextButton.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
})));
backButton.onRelease = function () {
prevFrame();
};
nextButton.onRelease = function () {
nextFrame();
};
tehCursor.gotoAndStop((MacUser ? 2 : 1));
tehCursor.cursor.gotoAndStop(1);
Frame 26
_root[cursorName].gotoAndStop(1);
backButton.onRollOver = (backButton.onDragOver = (nextButton.onRollOver = (nextButton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})));
backButton.onRollOut = (backButton.onDragOut = (nextButton.onRollOut = (nextButton.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
})));
backButton.onRelease = function () {
prevFrame();
};
nextButton.onRelease = function () {
nextFrame();
};
tehCursor.gotoAndStop((MacUser ? 2 : 1));
tehCursor.cursor.gotoAndStop(2);
Frame 27
_root[cursorName].gotoAndStop(1);
backButton.onRollOver = (backButton.onDragOver = (nextButton.onRollOver = (nextButton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
})));
backButton.onRollOut = (backButton.onDragOut = (nextButton.onRollOut = (nextButton.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
})));
backButton.onRelease = function () {
prevFrame();
};
finishButton.onRelease = function () {
gotoAndStop (3);
};
Instance of Symbol 503 MovieClip in Frame 27
onClipEvent (load) {
if (_root.p2troopFreezeOn) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 503 MovieClip in Frame 27
onClipEvent (load) {
if (_root.p2habisLasersOn) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 503 MovieClip in Frame 27
onClipEvent (load) {
if (_root.p2nukesOn) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 503 MovieClip in Frame 27
onClipEvent (load) {
_visible = _root.troopFreezeOn;
}
Instance of Symbol 503 MovieClip in Frame 27
onClipEvent (load) {
_visible = _root.habisLasersOn;
}
Instance of Symbol 503 MovieClip in Frame 27
onClipEvent (load) {
_visible = _root.nukesOn;
}
Frame 28
_root[cursorName].gotoAndStop(1);
skipCreditsButton.onRollOver = (skipCreditsButton.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
});
skipCreditsButton.onRollOut = (skipCreditsButton.onDragOut = function () {
_root[cursorName].gotoAndStop(1);
});
skipCreditsButton.onRelease = function () {
gotoAndStop (3);
};
Symbol 5 MovieClip [tile] Frame 1
stop();
Symbol 18 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 28 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 37 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "foregroundDisabled");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 38 MovieClip [UpArrow] Frame 1
stop();
Symbol 38 MovieClip [UpArrow] Frame 2
stop();
Symbol 38 MovieClip [UpArrow] Frame 3
stop();
Symbol 44 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(highlight3D_mc, "highlight3D");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
Symbol 51 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 57 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 58 MovieClip [ScrollThumb] Frame 1
stop();
Symbol 66 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 74 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 82 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "foregroundDisabled");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 83 MovieClip [DownArrow] Frame 1
stop();
Symbol 83 MovieClip [DownArrow] Frame 2
stop();
Symbol 83 MovieClip [DownArrow] Frame 3
stop();
Symbol 87 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "background");
Symbol 94 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 97 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "backgroundDisabled");
Symbol 99 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "backgroundDisabled");
Symbol 102 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(check_mc, "foregroundDisabled");
Symbol 105 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(check_mc, "check");
Symbol 106 MovieClip [fcb_states] Frame 1
stop();
Symbol 106 MovieClip [fcb_states] Frame 2
stop();
Symbol 106 MovieClip [fcb_states] Frame 3
stop();
Symbol 106 MovieClip [fcb_states] Frame 4
stop();
Symbol 106 MovieClip [fcb_states] Frame 5
stop();
Symbol 106 MovieClip [fcb_states] Frame 6
stop();
Symbol 109 MovieClip [FLabelSymbol] Frame 1
#initclip 3
_global.FLabelClass = function () {
if (this.hostComponent == undefined) {
this.hostComponent = ((this._parent.controller == undefined) ? (this._parent) : (this._parent.controller));
}
if (this.customTextStyle == undefined) {
if (this.hostComponent.textStyle == undefined) {
this.hostComponent.textStyle = new TextFormat();
}
this.textStyle = this.hostComponent.textStyle;
this.enable = true;
}
};
FLabelClass.prototype = new MovieClip();
Object.registerClass("FLabelSymbol", FLabelClass);
FLabelClass.prototype.setLabel = function (label) {
var val = this.hostComponent.styleTable.embedFonts.value;
if (val != undefined) {
this.labelField.embedFonts = val;
}
this.labelField.setNewTextFormat(this.textStyle);
this.labelField.text = label;
this.labelField._height = this.labelField.textHeight + 2;
};
FLabelClass.prototype.setSize = function (width) {
this.labelField._width = width;
};
FLabelClass.prototype.setEnabled = function (enable) {
this.enable = enable;
var tmpColor = this.hostComponent.styleTable[(enable ? "textColor" : "textDisabled")].value;
if (tmpColor == undefined) {
tmpColor = (enable ? 0 : 8947848);
}
this.setColor(tmpColor);
};
FLabelClass.prototype.getLabel = function () {
return(this.labelField.text);
};
FLabelClass.prototype.setColor = function (col) {
this.labelField.textColor = col;
};
#endinitclip
Symbol 114 MovieClip [FBoundingBoxSymbol] Frame 1
var component = _parent;
component.registerSkinElement(boundingBox, "background");
stop();
Symbol 114 MovieClip [FBoundingBoxSymbol] Frame 2
component.registerSkinElement(boundingBox2, "backgroundDisabled");
stop();
Symbol 115 MovieClip [FCheckBoxSymbol] Frame 1
#initclip 5
function FCheckBoxClass() {
this.init();
}
FCheckBoxClass.prototype = new FUIComponentClass();
Object.registerClass("FCheckBoxSymbol", FCheckBoxClass);
FCheckBoxClass.prototype.init = function () {
super.setSize(this._width, this._height);
this.boundingBox_mc.unloadMovie();
this.attachMovie("fcb_hitArea", "fcb_hitArea_mc", 1);
this.attachMovie("fcb_states", "fcb_states_mc", 2);
this.attachMovie("FLabelSymbol", "fLabel_mc", 3);
super.init();
this.setChangeHandler(this.changeHandler);
this._xscale = 100;
this._yscale = 100;
this.setSize(this.width, this.height);
if (this.initialValue == undefined) {
this.setCheckState(false);
} else {
this.setCheckState(this.initialValue);
}
if (this.label != undefined) {
this.setLabel(this.label);
}
this.ROLE_SYSTEM_CHECKBUTTON = 44;
this.STATE_SYSTEM_CHECKED = 16;
this.EVENT_OBJECT_STATECHANGE = 32778;
this.EVENT_OBJECT_NAMECHANGE = 32780;
this._accImpl.master = this;
this._accImpl.stub = false;
this._accImpl.get_accRole = this.get_accRole;
this._accImpl.get_accName = this.get_accName;
this._accImpl.get_accState = this.get_accState;
this._accImpl.get_accDefaultAction = this.get_accDefaultAction;
this._accImpl.accDoDefaultAction = this.accDoDefaultAction;
};
FCheckBoxClass.prototype.setLabelPlacement = function (pos) {
this.setLabel(this.getLabel());
this.txtFormat(pos);
var halfLabelH = (this.fLabel_mc._height / 2);
var halfFrameH = (this.fcb_states_mc._height / 2);
var vertCenter = (halfFrameH - halfLabelH);
var checkWidth = this.fcb_states_mc._width;
var frame = this.fcb_states_mc;
var label = this.fLabel_mc;
var w = 0;
if (frame._width > this.width) {
w = 0;
} else {
w = this.width - frame._width;
}
this.fLabel_mc.setSize(w);
if ((pos == "right") || (pos == undefined)) {
this.labelPlacement = "right";
this.fcb_states_mc._x = 0;
this.fLabel_mc._x = checkWidth;
this.txtFormat("left");
} else if (pos == "left") {
this.labelPlacement = "left";
this.fLabel_mc._x = 0;
this.fcb_states_mc._x = this.width - checkWidth;
this.txtFormat("right");
}
this.fLabel_mc._y = vertCenter;
this.fcb_hitArea_mc._y = vertCenter;
};
FCheckBoxClass.prototype.txtFormat = function (pos) {
var txtS = this.textStyle;
var sTbl = this.styleTable;
txtS.align = ((sTbl.textAlign.value == undefined) ? ((txtS.align = pos)) : undefined);
txtS.leftMargin = ((sTbl.textLeftMargin.value == undefined) ? ((txtS.leftMargin = 0)) : undefined);
txtS.rightMargin = ((sTbl.textRightMargin.value == undefined) ? ((txtS.rightMargin = 0)) : undefined);
if (this.flabel_mc._height > this.height) {
super.setSize(this.width, this.flabel_mc._height);
} else {
super.setSize(this.width, this.height);
}
this.fLabel_mc.labelField.setTextFormat(this.textStyle);
this.setEnabled(this.enable);
};
FCheckBoxClass.prototype.setHitArea = function (w, h) {
var hit = this.fcb_hitArea_mc;
this.hitArea = hit;
if (this.fcb_states_mc._width > w) {
hit._width = this.fcb_states_mc._width;
} else {
hit._width = w;
}
hit._visible = false;
if (arguments.length > 1) {
hit._height = h;
}
};
FCheckBoxClass.prototype.setSize = function (w) {
this.setLabel(this.getLabel());
this.setLabelPlacement(this.labelPlacement);
if (this.fcb_states_mc._height < this.flabel_mc.labelField._height) {
super.setSize(w, this.flabel_mc.labelField._height);
}
this.setHitArea(this.width, this.height);
this.setLabelPlacement(this.labelPlacement);
};
FCheckBoxClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this._width + 6, this._height - 1);
};
FCheckBoxClass.prototype.onPress = function () {
this.pressFocus();
_root.focusRect.removeMovieClip();
var states = this.fcb_states_mc;
if (this.getValue()) {
states.gotoAndStop("checkedPress");
} else {
states.gotoAndStop("press");
}
};
FCheckBoxClass.prototype.onRelease = function () {
this.fcb_states_mc.gotoAndStop("up");
this.setValue(!this.checked);
};
FCheckBoxClass.prototype.onReleaseOutside = function () {
var states = this.fcb_states_mc;
if (this.getValue()) {
states.gotoAndStop("checkedEnabled");
} else {
states.gotoAndStop("up");
}
};
FCheckBoxClass.prototype.onDragOut = function () {
var states = this.fcb_states_mc;
if (this.getValue()) {
states.gotoAndStop("checkedEnabled");
} else {
states.gotoAndStop("up");
}
};
FCheckBoxClass.prototype.onDragOver = function () {
var states = this.fcb_states_mc;
if (this.getValue()) {
states.gotoAndStop("checkedPress");
} else {
states.gotoAndStop("press");
}
};
FCheckBoxClass.prototype.setValue = function (checkedValue) {
if (checkedValue || (checkedValue == undefined)) {
this.setCheckState(checkedValue);
} else if (checkedValue == false) {
this.setCheckState(checkedValue);
}
this.executeCallBack();
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_STATECHANGE, true);
}
};
FCheckBoxClass.prototype.setCheckState = function (checkedValue) {
var states = this.fcb_states_mc;
if (this.enable) {
this.flabel_mc.setEnabled(true);
if (checkedValue || (checkedValue == undefined)) {
states.gotoAndStop("checkedEnabled");
this.enabled = true;
this.checked = true;
} else {
states.gotoAndStop("up");
this.enabled = true;
this.checked = false;
}
} else {
this.flabel_mc.setEnabled(false);
if (checkedValue || (checkedValue == undefined)) {
states.gotoAndStop("checkedDisabled");
this.enabled = false;
this.checked = true;
} else {
states.gotoAndStop("uncheckedDisabled");
this.enabled = false;
this.checked = false;
this.focusRect.removeMovieClip();
}
}
};
FCheckBoxClass.prototype.getValue = function () {
return(this.checked);
};
FCheckBoxClass.prototype.setEnabled = function (enable) {
if ((enable == true) || (enable == undefined)) {
this.enable = true;
Super.setEnabled(true);
} else {
this.enable = false;
Super.setEnabled(false);
}
this.setCheckState(this.checked);
};
FCheckBoxClass.prototype.getEnabled = function () {
return(this.enable);
};
FCheckBoxClass.prototype.setLabel = function (label) {
this.fLabel_mc.setLabel(label);
this.txtFormat();
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_NAMECHANGE);
}
};
FCheckBoxClass.prototype.getLabel = function () {
return(this.fLabel_mc.labelField.text);
};
FCheckBoxClass.prototype.setTextColor = function (color) {
this.fLabel_mc.labelField.textColor = color;
};
FCheckBoxClass.prototype.myOnKeyDown = function () {
if (((Key.getCode() == 32) && (this.pressOnce == undefined)) && (this.enabled == true)) {
this.setValue(!this.getValue());
this.pressOnce = true;
}
};
FCheckBoxClass.prototype.myOnKeyUp = function () {
if (Key.getCode() == 32) {
this.pressOnce = undefined;
}
};
FCheckBoxClass.prototype.get_accRole = function (childId) {
return(this.master.ROLE_SYSTEM_CHECKBUTTON);
};
FCheckBoxClass.prototype.get_accName = function (childId) {
return(this.master.getLabel());
};
FCheckBoxClass.prototype.get_accState = function (childId) {
if (this.master.getValue()) {
return(this.master.STATE_SYSTEM_CHECKED);
}
return(0);
};
FCheckBoxClass.prototype.get_accDefaultAction = function (childId) {
if (this.master.getValue()) {
return("UnCheck");
}
return("Check");
};
FCheckBoxClass.prototype.accDoDefaultAction = function (childId) {
this.master.setValue(!this.master.getValue());
};
#endinitclip
boundingBox_mc._visible = false;
deadPreview._visible = false;
Symbol 117 MovieClip [fireParticle] Frame 10
removeMovieClip(this);
Symbol 118 MovieClip Frame 1
radToDeg = 57.2957795130823;
degToRad = (Math.PI/180);
z = 0;
onEnterFrame = function () {
if (_parent.particlesOn) {
scaleStart = _root.nukeParticleScale;
i = 0;
while (i <= Math.max(3, scaleStart / 15)) {
angle = -65 + (360 - random(40));
xs = Math.sin(angle * degToRad);
ys = -Math.cos(angle * degToRad);
scale = scaleStart + random(50);
attachMovie("fireParticle", "fireParticle" + z, z++, {_x:xs * random(90), _y:ys * random(100), _rotation:angle, _xscale:scale, _yscale:scale});
i++;
}
}
};
Symbol 155 MovieClip [nuke] Frame 1
particlesOn = true;
_root.nukeParticleScale = 100;
_root.playSoundFX("nukeFly");
Symbol 155 MovieClip [nuke] Frame 9
onEnterFrame = function () {
_root.nukeParticleScale = Math.max(10, _root.nukeParticleScale - 20);
if (_root.nukeParticleScale <= 10) {
onEnterFrame = null;
}
};
Symbol 155 MovieClip [nuke] Frame 17
particlesOn = false;
Symbol 155 MovieClip [nuke] Frame 19
_root.screenShake(50);
Symbol 155 MovieClip [nuke] Frame 20
_root.playSoundFX("nukeBlast");
onEnterFrame = function () {
a = [];
for (var i in _root.p1) {
a.push(_root.p1[i]);
}
for (var i in _root.p1Vehicles) {
a.push(_root.p1Vehicles[i]);
}
for (var i in _root.p1Helis) {
a.push(_root.p1Helis[i]);
}
for (var i in _root.p2) {
a.push(_root.p2[i]);
}
for (var i in _root.p2Vehicles) {
a.push(_root.p2Vehicles[i]);
}
for (var i in _root.p2Helis) {
a.push(_root.p2Helis[i]);
}
for (var i in a) {
p = a[i];
xdist = p._x - 640;
ydist = p._y - 400;
distance = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (distance < dome._width) {
p.HP = 0;
}
}
b = Math.min(((_currentframe - 20) / 25) * 75, 75);
t = {rb:-this.b, gb:-this.b, bb:-this.b};
tColor = new Color(_root.theMap);
tColor.setTransform(t);
if (b == 75) {
onEnterFrame = null;
}
};
Symbol 155 MovieClip [nuke] Frame 58
c = 0;
_root.nukeCandy.attachMovie("fog", "fog" + _root.z, _root.z++, {_alpha:25});
Symbol 155 MovieClip [nuke] Frame 70
_root.createEmptyMovieClip("mapShade", _root.z++);
_root.mapShade.c = 75;
_root.mapShade.onEnterFrame = function () {
this.c = this.c - 0.5;
this.b = (this.c / 75) * 75;
this.t = {rb:-this.b, gb:-this.b, bb:-this.b};
this.tColor = new Color(_root.theMap);
this.tColor.setTransform(this.t);
if (this.c <= 0) {
this.removeMovieClip();
}
};
Symbol 155 MovieClip [nuke] Frame 233
removeMovieClip(this);
Symbol 156 MovieClip [FUIComponentSymbol] Frame 1
#initclip 1
function FUIComponentClass() {
this.init();
}
FUIComponentClass.prototype = new MovieClip();
FUIComponentClass.prototype.init = function () {
this.enable = true;
this.focused = false;
this.useHandCursor = false;
this._accImpl = new Object();
this._accImpl.stub = true;
this.styleTable = new Array();
if (_global.globalStyleFormat == undefined) {
_global.globalStyleFormat = new FStyleFormat();
globalStyleFormat.isGlobal = true;
_global._focusControl = new Object();
_global._focusControl.onSetFocus = function (oldFocus, newFocus) {
oldFocus.myOnKillFocus();
newFocus.myOnSetFocus();
};
Selection.addListener(_global._focusControl);
}
if (this._name != undefined) {
this._focusrect = false;
this.tabEnabled = true;
this.focusEnabled = true;
this.tabChildren = false;
this.tabFocused = true;
if (this.hostStyle == undefined) {
globalStyleFormat.addListener(this);
} else {
this.styleTable = this.hostStyle;
}
this.deadPreview._visible = false;
this.deadPreview._width = (this.deadPreview._height = 1);
this.methodTable = new Object();
this.keyListener = new Object();
this.keyListener.controller = this;
this.keyListener.onKeyDown = function () {
this.controller.myOnKeyDown();
};
this.keyListener.onKeyUp = function () {
this.controller.myOnKeyUp();
};
for (var i in this.styleFormat_prm) {
this.setStyleProperty(i, this.styleFormat_prm[i]);
}
}
};
FUIComponentClass.prototype.setEnabled = function (enabledFlag) {
this.enable = ((arguments.length > 0) ? (enabledFlag) : true);
this.tabEnabled = (this.focusEnabled = enabledFlag);
if ((!this.enable) && (this.focused)) {
Selection.setFocus(undefined);
}
};
FUIComponentClass.prototype.getEnabled = function () {
return(this.enable);
};
FUIComponentClass.prototype.setSize = function (w, h) {
this.width = w;
this.height = h;
this.focusRect.removeMovieClip();
};
FUIComponentClass.prototype.setChangeHandler = function (chng, obj) {
this.handlerObj = ((obj == undefined) ? (this._parent) : (obj));
this.changeHandler = chng;
};
FUIComponentClass.prototype.invalidate = function (methodName) {
this.methodTable[methodName] = true;
this.onEnterFrame = this.cleanUI;
};
FUIComponentClass.prototype.cleanUI = function () {
if (this.methodTable.setSize) {
this.setSize(this.width, this.height);
} else {
this.cleanUINotSize();
}
this.methodTable = new Object();
delete this.onEnterFrame;
};
FUIComponentClass.prototype.cleanUINotSize = function () {
for (var funct in this.methodTable) {
this[funct]();
}
};
FUIComponentClass.prototype.drawRect = function (x, y, w, h) {
var inner = this.styleTable.focusRectInner.value;
var outer = this.styleTable.focusRectOuter.value;
if (inner == undefined) {
inner = 16777215 /* 0xFFFFFF */;
}
if (outer == undefined) {
outer = 0;
}
this.createEmptyMovieClip("focusRect", 1000);
this.focusRect.controller = this;
this.focusRect.lineStyle(1, outer);
this.focusRect.moveTo(x, y);
this.focusRect.lineTo(x + w, y);
this.focusRect.lineTo(x + w, y + h);
this.focusRect.lineTo(x, y + h);
this.focusRect.lineTo(x, y);
this.focusRect.lineStyle(1, inner);
this.focusRect.moveTo(x + 1, y + 1);
this.focusRect.lineTo((x + w) - 1, y + 1);
this.focusRect.lineTo((x + w) - 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, y + 1);
};
FUIComponentClass.prototype.pressFocus = function () {
this.tabFocused = false;
this.focusRect.removeMovieClip();
Selection.setFocus(this);
};
FUIComponentClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this.width + 4, this.height + 4);
};
FUIComponentClass.prototype.myOnSetFocus = function () {
this.focused = true;
Key.addListener(this.keyListener);
if (this.tabFocused) {
this.drawFocusRect();
}
};
FUIComponentClass.prototype.myOnKillFocus = function () {
this.tabFocused = true;
this.focused = false;
this.focusRect.removeMovieClip();
Key.removeListener(this.keyListener);
};
FUIComponentClass.prototype.executeCallBack = function () {
this.handlerObj[this.changeHandler](this);
};
FUIComponentClass.prototype.updateStyleProperty = function (styleFormat, propName) {
this.setStyleProperty(propName, styleFormat[propName], styleFormat.isGlobal);
};
FUIComponentClass.prototype.setStyleProperty = function (propName, value, isGlobal) {
if (value == "") {
return(undefined);
}
var tmpValue = parseInt(value);
if (!isNaN(tmpValue)) {
value = tmpValue;
}
var global = ((arguments.length > 2) ? (isGlobal) : false);
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].useGlobal || (!global)) {
this.styleTable[propName].value = value;
if (this.setCustomStyleProperty(propName, value)) {
} else if (propName == "embedFonts") {
this.invalidate("setSize");
} else if (propName.subString(0, 4) == "text") {
if (this.textStyle == undefined) {
this.textStyle = new TextFormat();
}
var textProp = propName.subString(4, propName.length);
this.textStyle[textProp] = value;
this.invalidate("setSize");
} else {
for (var j in this.styleTable[propName].coloredMCs) {
var myColor = new Color(this.styleTable[propName].coloredMCs[j]);
if (this.styleTable[propName].value == undefined) {
var myTObj = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
myColor.setTransform(myTObj);
} else {
myColor.setRGB(value);
}
}
}
this.styleTable[propName].useGlobal = global;
}
};
FUIComponentClass.prototype.registerSkinElement = function (skinMCRef, propName) {
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].coloredMCs == undefined) {
this.styleTable[propName].coloredMCs = new Object();
}
this.styleTable[propName].coloredMCs[skinMCRef] = skinMCRef;
if (this.styleTable[propName].value != undefined) {
var myColor = new Color(skinMCRef);
myColor.setRGB(this.styleTable[propName].value);
}
};
_global.FStyleFormat = function () {
this.nonStyles = {listeners:true, isGlobal:true, isAStyle:true, addListener:true, removeListener:true, nonStyles:true, applyChanges:true};
this.listeners = new Object();
this.isGlobal = false;
if (arguments.length > 0) {
for (var i in arguments[0]) {
this[i] = arguments[0][i];
}
}
};
_global.FStyleFormat.prototype = new Object();
FStyleFormat.prototype.addListener = function () {
var arg = 0;
while (arg < arguments.length) {
var mcRef = arguments[arg];
this.listeners[arguments[arg]] = mcRef;
for (var i in this) {
if (this.isAStyle(i)) {
mcRef.updateStyleProperty(this, i.toString());
}
}
arg++;
}
};
FStyleFormat.prototype.removeListener = function (component) {
this.listeners[component] = undefined;
for (var prop in this) {
if (this.isAStyle(prop)) {
if (component.styleTable[prop].useGlobal == this.isGlobal) {
component.styleTable[prop].useGlobal = true;
var value = (this.isGlobal ? undefined : (globalStyleFormat[prop]));
component.setStyleProperty(prop, value, true);
}
}
}
};
FStyleFormat.prototype.applyChanges = function () {
var count = 0;
for (var i in this.listeners) {
var component = this.listeners[i];
if (arguments.length > 0) {
var j = 0;
while (j < arguments.length) {
if (this.isAStyle(arguments[j])) {
component.updateStyleProperty(this, arguments[j]);
}
j++;
}
} else {
for (var j in this) {
if (this.isAStyle(j)) {
component.updateStyleProperty(this, j.toString());
}
}
}
}
};
FStyleFormat.prototype.isAStyle = function (name) {
return((this.nonStyles[name] ? false : true));
};
#endinitclip
Symbol 163 MovieClip Frame 1
stop();
Symbol 163 MovieClip Frame 2
_root.playSoundFX("comancheSpiral");
Symbol 163 MovieClip Frame 15
_root.playSoundFX("tankDie");
Symbol 163 MovieClip Frame 26
_root.screenShake(12);
Symbol 163 MovieClip Frame 30
for (var i in _root.p1) {
p = _root.p1[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 3;
}
}
for (var i in _root.p1Vehicles) {
p = _root.p1Vehicles[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 10;
}
}
for (var i in _root.p2) {
p = _root.p2[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 3;
}
}
for (var i in _root.p2Vehicles) {
p = _root.p2Vehicles[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 10;
}
}
Symbol 163 MovieClip Frame 33
for (var i in _root.p1) {
p = _root.p1[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 1;
}
}
for (var i in _root.p1Vehicles) {
p = _root.p1Vehicles[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 3;
}
}
for (var i in _root.p2) {
p = _root.p2[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 1;
}
}
for (var i in _root.p2Vehicles) {
p = _root.p2Vehicles[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 3;
}
}
Symbol 171 MovieClip Frame 1
stop();
wait = random(5);
Symbol 171 MovieClip Frame 3
if (wait > 0) {
wait--;
gotoAndPlay (2);
} else {
_root.shoot(6, _parent._rotation, _parent._parent._x, _parent._parent._y, 2, _parent._parent);
}
Symbol 177 MovieClip Frame 1
stop();
Symbol 177 MovieClip Frame 15
_root.shoot(7, _parent._parent._rotation, _parent._parent._parent._x, _parent._parent._parent._y, 2, _parent._parent._parent, ((_parent._name == "r1") ? 1 : 2));
Symbol 178 MovieClip Frame 1
stop();
if (_root.team2RocketPods) {
gotoAndStop (2);
}
Instance of Symbol 166 MovieClip "blades" in Symbol 182 MovieClip [comanche2] Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation - 20);
}
Instance of Symbol 181 MovieClip "hit" in Symbol 182 MovieClip [comanche2] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 193 MovieClip Frame 1
stop();
Symbol 193 MovieClip Frame 28
_root.shoot(10, null, _parent._parent._x, _parent._parent._y, 2, _parent._parent);
Instance of Symbol 186 MovieClip "blade1" in Symbol 199 MovieClip [helix2] Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation - -18);
}
Instance of Symbol 186 MovieClip "blade2" in Symbol 199 MovieClip [helix2] Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation - 18);
}
Instance of Symbol 181 MovieClip "hit" in Symbol 199 MovieClip [helix2] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 200 MovieClip Frame 1
stop();
Symbol 200 MovieClip Frame 2
_root.playSoundFX("comancheSpiral");
Symbol 200 MovieClip Frame 15
_root.playSoundFX("tankDie");
Symbol 200 MovieClip Frame 20
_root.screenShake(12);
Symbol 200 MovieClip Frame 24
for (var i in _root.p1) {
p = _root.p1[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 3;
}
}
for (var i in _root.p1Vehicles) {
p = _root.p1Vehicles[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 10;
}
}
for (var i in _root.p2) {
p = _root.p2[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 3;
}
}
for (var i in _root.p2Vehicles) {
p = _root.p2Vehicles[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 10;
}
}
Symbol 200 MovieClip Frame 27
for (var i in _root.p1) {
p = _root.p1[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 1;
}
}
for (var i in _root.p1Vehicles) {
p = _root.p1Vehicles[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 3;
}
}
for (var i in _root.p2) {
p = _root.p2[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 1;
}
}
for (var i in _root.p2Vehicles) {
p = _root.p2Vehicles[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 3;
}
}
Symbol 202 MovieClip Frame 1
stop();
Symbol 202 MovieClip Frame 28
_root.shoot(10, null, _parent._parent._x, _parent._parent._y, 1, _parent._parent);
Symbol 208 MovieClip Frame 1
stop();
Instance of Symbol 186 MovieClip "blade1" in Symbol 209 MovieClip [helix] Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation - -18);
}
Instance of Symbol 186 MovieClip "blade2" in Symbol 209 MovieClip [helix] Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation - 18);
}
Instance of Symbol 181 MovieClip "hit" in Symbol 209 MovieClip [helix] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 214 MovieClip Frame 1
stop();
wait = random(5);
Symbol 214 MovieClip Frame 3
if (wait > 0) {
wait--;
gotoAndPlay (2);
} else {
_root.shoot(6, _parent._rotation, _parent._parent._x, _parent._parent._y, 1, _parent._parent);
}
Symbol 217 MovieClip Frame 1
stop();
Symbol 217 MovieClip Frame 15
_root.shoot(7, _parent._parent._rotation, _parent._parent._parent._x, _parent._parent._parent._y, 1, _parent._parent._parent, ((_parent._name == "r1") ? 1 : 2));
Symbol 218 MovieClip Frame 1
stop();
if (_root.team1RocketPods) {
gotoAndStop (2);
}
Instance of Symbol 166 MovieClip "blades" in Symbol 220 MovieClip [comanche] Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation - 20);
}
Instance of Symbol 181 MovieClip "hit" in Symbol 220 MovieClip [comanche] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 222 MovieClip [arrowPointer] Frame 9
gotoAndPlay (1);
Symbol 233 Button
on (release) {
_parent.gotoAndStop(5);
}
Symbol 241 Button
on (release) {
_parent.gotoAndStop(4);
}
Symbol 248 Button
on (release) {
_parent.gotoAndStop(3);
}
Symbol 256 Button
on (release) {
_parent.gotoAndStop(2);
}
Symbol 266 Button
on (release, keyPress "k") {
gotoAndStop (1);
}
Symbol 274 Button
on (release) {
_root.buy("sniper");
}
Symbol 282 Button
on (release) {
_root.buy("lTroop");
}
Symbol 290 Button
on (release) {
_root.buy("RPG1");
}
Symbol 298 Button
on (release) {
_root.buy("lInf");
}
Symbol 309 Button
on (release) {
_root.buy("ambulance");
}
Symbol 319 Button
on (release) {
_root.buy("tankUpgrade");
if (_root.team1TankGattling) {
gotoAndStop (1);
}
}
Symbol 320 MovieClip Frame 1
stop();
if (!_root.team1tankGattling) {
if (_root.team1CanUpgrade[4]) {
gotoAndStop (2);
}
}
Symbol 327 Button
on (release) {
_root.buy("lTank");
}
Symbol 336 Button
on (release) {
_root.buy("gTank");
}
Symbol 346 Button
on (release) {
_root.buy("hTank");
}
Symbol 353 Button
on (release) {
_root.buy("homingMissileUpgrade");
if (_root.team1HomingMissiles) {
gotoAndStop (1);
}
}
Symbol 354 MovieClip Frame 1
stop();
if (!_root.team1HomingMissiles) {
if (_root.team1CanUpgrade[0]) {
gotoAndStop (2);
}
}
Symbol 359 Button
on (release) {
_root.buy("laserUpgrade");
if (_root.team1laserUpgrade) {
gotoAndStop (1);
}
}
Symbol 360 MovieClip Frame 1
stop();
if (!_root.team1laserUpgrade) {
if (_root.team1CanUpgrade[2]) {
gotoAndStop (2);
}
}
Symbol 364 Button
on (release) {
_root.buy("APBulletsUpgrade");
if (_root.team1APBullets) {
gotoAndStop (1);
}
}
Symbol 365 MovieClip Frame 1
stop();
if (!_root.team1APBullets) {
if (_root.team1CanUpgrade[1]) {
gotoAndStop (2);
}
}
Symbol 373 Button
on (release) {
_root.buy("helix");
}
Instance of Symbol 376 MovieClip in Symbol 378 MovieClip Frame 1
onClipEvent (load) {
_visible = _root.team1RocketPods;
}
onClipEvent (enterFrame) {
_visible = _root.team1RocketPods;
}
Symbol 383 Button
on (release) {
_root.buy("comanche");
}
Symbol 388 Button
on (release) {
_root.buy("rocketPodsUpgrade");
if (_root.team1RocketPods) {
gotoAndStop (1);
}
}
Symbol 389 MovieClip Frame 1
stop();
if (!_root.team1RocketPods) {
if (_root.team1CanUpgrade[3]) {
gotoAndStop (2);
}
}
Symbol 395 Button
on (release) {
_root.currentHPUnRounded = 0;
}
Symbol 400 Button
on (release) {
gotoAndStop (7);
}
Symbol 407 Button
on (release) {
_quality = ((_root.save.quality = "LOW"));
pointyThingy2.gotoAndStop(3);
}
Symbol 410 MovieClip Frame 1
stop();
Symbol 414 Button
on (release) {
_quality = ((_root.save.quality = "HIGH"));
pointyThingy2.gotoAndStop(1);
}
Symbol 418 Button
on (release) {
_quality = ((_root.save.quality = "MEDIUM"));
pointyThingy2.gotoAndStop(2);
}
Symbol 419 Button
on (release, keyPress "k") {
gotoAndStop (6);
}
Symbol 426 Button
on (press) {
_parent.startSlider(true);
onEnterFrame = function () {
this._x = Math.max(0, Math.min(200, _parent._xmouse));
};
}
on (release, releaseOutside) {
_parent.startSlider(false);
this.onEnterFrame = null;
_root[_root.cursorName].gotoAndStop(1);
}
Symbol 432 MovieClip Frame 1
function startSlider(active) {
if (active) {
this.onMouseMove = function () {
myVar = Math.max(0, Math.min(100, int(pos._x / 2)));
_root.save.voiceVolume = myVar;
updateAfterEvent();
};
} else {
this.onMouseMove = null;
}
}
myVar = _root.save.voiceVolume;
pos._x = myVar * 2;
myVar = Math.max(0, Math.min(100, int(pos._x / 2)));
_root.save.voiceVolume = myVar;
Instance of Symbol 429 MovieClip "maskeh" in Symbol 432 MovieClip Frame 1
onClipEvent (enterFrame) {
_x = _parent.pos._x;
}
Symbol 434 MovieClip Frame 1
function startSlider(active) {
if (active) {
this.onMouseMove = function () {
myVar = Math.max(0, Math.min(100, int(pos._x / 2)));
_root.save.soundFXVolume = myVar;
updateAfterEvent();
};
} else {
this.onMouseMove = null;
}
}
myVar = _root.save.soundFXVolume;
pos._x = myVar * 2;
myVar = Math.max(0, Math.min(100, int(pos._x / 2)));
_root.save.soundFXVolume = myVar;
Instance of Symbol 429 MovieClip "maskeh" in Symbol 434 MovieClip Frame 1
onClipEvent (enterFrame) {
_x = _parent.pos._x;
}
Symbol 436 MovieClip Frame 1
function startSlider(active) {
if (active) {
this.onMouseMove = function () {
myVar = Math.max(0, Math.min(100, int(pos._x / 2)));
_root.music.gameSound.setVolume(myVar);
_root.save.musicVolume = myVar;
updateAfterEvent();
};
} else {
this.onMouseMove = null;
}
}
myVar = _root.save.musicVolume;
pos._x = myVar * 2;
myVar = Math.max(0, Math.min(100, int(pos._x / 2)));
_root.music.gameSound.setVolume(myVar);
Instance of Symbol 429 MovieClip "maskeh" in Symbol 436 MovieClip Frame 1
onClipEvent (enterFrame) {
_x = _parent.pos._x;
}
Symbol 438 Button
on (release, keyPress "a") {
if (!Key.isDown(17)) {
gotoAndStop (6);
}
}
Symbol 439 Button
on (release) {
_quality = "LOW";
pointyThingy2.gotoAndStop(3);
}
Symbol 440 Button
on (release) {
_quality = "HIGH";
pointyThingy2.gotoAndStop(1);
}
Symbol 441 Button
on (release) {
_quality = "MEDIUM";
pointyThingy2.gotoAndStop(2);
}
Symbol 449 Button
on (release) {
_root.targetNearest(1);
}
Symbol 450 Button
on (release, keyPress "k") {
gotoAndStop(_root.previousHUD);
}
Symbol 456 Button
on (release) {
_root.reformSelected();
}
Instance of Symbol 463 MovieClip in Symbol 465 MovieClip Frame 1
onClipEvent (load) {
_visible = _root.team1RocketPods;
}
Symbol 476 MovieClip Frame 1
stop();
_root.selectedBuilding = "Buildings";
_root.previousHUD = _currentframe;
Instance of Symbol 234 MovieClip in Symbol 476 MovieClip Frame 1
onClipEvent (load) {
_visible = (_root.team1Units[4] || (_root.team1Units[8]));
}
Instance of Symbol 242 MovieClip in Symbol 476 MovieClip Frame 1
onClipEvent (load) {
_visible = _root.techTowerOn;
}
Instance of Symbol 249 MovieClip in Symbol 476 MovieClip Frame 1
onClipEvent (load) {
_visible = (((_root.team1Units[2] || (_root.team1Units[3])) || (_root.team1Units[6])) || (_root.team1Units[9]));
}
Instance of Symbol 257 MovieClip in Symbol 476 MovieClip Frame 1
onClipEvent (load) {
_visible = (((_root.team1Units[0] || (_root.team1Units[1])) || (_root.team1Units[5])) || (_root.team1Units[7]));
}
Symbol 476 MovieClip Frame 2
_root.selectedBuilding = "Barracks";
_root.previousHUD = _currentframe;
Instance of Symbol 275 MovieClip in Symbol 476 MovieClip Frame 2
onClipEvent (load) {
_visible = _root.team1Units[7];
}
Instance of Symbol 283 MovieClip in Symbol 476 MovieClip Frame 2
onClipEvent (load) {
_visible = _root.team1Units[5];
}
Instance of Symbol 291 MovieClip in Symbol 476 MovieClip Frame 2
onClipEvent (load) {
_visible = _root.team1Units[1];
}
Instance of Symbol 299 MovieClip in Symbol 476 MovieClip Frame 2
onClipEvent (load) {
_visible = _root.team1Units[0];
}
Symbol 476 MovieClip Frame 3
_root.selectedBuilding = "Factory";
_root.previousHUD = _currentframe;
Instance of Symbol 310 MovieClip in Symbol 476 MovieClip Frame 3
onClipEvent (load) {
_visible = _root.team1Units[9];
}
Instance of Symbol 328 MovieClip in Symbol 476 MovieClip Frame 3
onClipEvent (load) {
_visible = _root.team1Units[6];
}
Instance of Symbol 337 MovieClip in Symbol 476 MovieClip Frame 3
onClipEvent (load) {
_visible = _root.team1Units[3];
}
Instance of Symbol 347 MovieClip in Symbol 476 MovieClip Frame 3
onClipEvent (load) {
_visible = _root.team1Units[2];
}
Symbol 476 MovieClip Frame 4
_root.selectedBuilding = "Tech Tower";
_root.previousHUD = _currentframe;
Symbol 476 MovieClip Frame 5
_root.selectedBuilding = "Airfield";
_root.previousHUD = _currentframe;
Instance of Symbol 374 MovieClip in Symbol 476 MovieClip Frame 5
onClipEvent (load) {
_visible = _root.team1Units[8];
}
Instance of Symbol 384 MovieClip in Symbol 476 MovieClip Frame 5
onClipEvent (load) {
_visible = _root.team1Units[4];
}
Symbol 476 MovieClip Frame 6
_root.selectedBuilding = "Menu";
_root.previousHUD = _currentframe;
Instance of Symbol 410 MovieClip "pointyThingy2" in Symbol 476 MovieClip Frame 6
onClipEvent (load) {
if (_quality == "HIGH") {
this.gotoAndStop(1);
} else if (_quality == "MEDIUM") {
this.gotoAndStop(2);
} else if (_quality == "LOW") {
this.gotoAndStop(3);
}
}
Symbol 476 MovieClip Frame 7
_root.selectedBuilding = "Menu";
_root.previousHUD = _currentframe;
Symbol 476 MovieClip Frame 8
_root.selectedBuilding = "Options";
_root.previousHUD = _currentframe;
Instance of Symbol 410 MovieClip "pointyThingy2" in Symbol 476 MovieClip Frame 8
onClipEvent (load) {
if (_quality == "HIGH") {
this.gotoAndStop(1);
} else if (_quality == "MEDIUM") {
this.gotoAndStop(2);
} else if (_quality == "LOW") {
this.gotoAndStop(3);
}
}
Symbol 476 MovieClip Frame 9
_root.selectedBuilding = "Light Infantry";
Symbol 476 MovieClip Frame 10
_root.selectedBuilding = "Bazooka Trooper";
Symbol 476 MovieClip Frame 11
_root.selectedBuilding = "Heavy Tank";
Symbol 476 MovieClip Frame 12
_root.selectedBuilding = "Gattling Tank";
Symbol 476 MovieClip Frame 13
_root.selectedBuilding = (_root.p1RocketPods ? "Rocket Comanche" : "Comanche");
Symbol 476 MovieClip Frame 14
_root.selectedBuilding = "Laser Trooper";
Symbol 476 MovieClip Frame 15
_root.selectedBuilding = "Laser Tank";
Symbol 476 MovieClip Frame 16
_root.selectedBuilding = "Sniper";
Symbol 476 MovieClip Frame 17
_root.selectedBuilding = "Helix";
Symbol 476 MovieClip Frame 18
_root.selectedBuilding = "Ambulance";
Symbol 486 Button
on (release) {
_root.useTroopFreeze(1);
}
Symbol 487 MovieClip Frame 1
stop();
Symbol 488 MovieClip Frame 1
if (_root.p2troopFreezeOn) {
radToDeg = 57.2957795130823;
degToRad = (Math.PI/180);
createEmptyMovieClip("mask", 1);
mask._y = 1;
mask._x = 1;
mask.beginFill(0, 50);
mask.lineTo(50, 0);
mask.lineTo(50, 50);
mask.lineTo(0, 50);
mask.lineTo(0, 0);
mask.endFill(0, 50);
createEmptyMovieClip("API", 2);
API._y = 1;
API._x = 1;
API.setMask(mask);
API.angle = 0;
API.onEnterFrame = function () {
this.angle = Math.round(_root.p2troopFreezePercent * 360);
this.clear();
if (this.angle <= 360) {
this.beginFill(0, 75);
this.moveTo(25, 25);
this.lineTo(25 + (Math.sin(this.angle * degToRad) * 50), 25 + (Math.cos(this.angle * degToRad) * -50));
if (this.angle <= 90) {
this.lineTo(50, 0);
this.lineTo(50, 50);
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
this.endFill();
} else if ((this.angle > 90) && (this.angle <= 180)) {
this.lineTo(50, 50);
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
} else if ((this.angle > 180) && (this.angle <= 270)) {
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
} else {
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
}
}
};
} else {
gotoAndStop (2);
}
stop();
Symbol 492 Button
on (release) {
_root.fireHabisLaser(1);
}
Symbol 493 MovieClip Frame 1
stop();
Symbol 494 MovieClip Frame 1
if (_root.p2habisLasersOn) {
radToDeg = 57.2957795130823;
degToRad = (Math.PI/180);
createEmptyMovieClip("mask", 1);
mask._y = 1;
mask._x = 1;
mask.beginFill(0, 50);
mask.lineTo(50, 0);
mask.lineTo(50, 50);
mask.lineTo(0, 50);
mask.lineTo(0, 0);
mask.endFill(0, 50);
createEmptyMovieClip("API", 2);
API._y = 1;
API._x = 1;
API.setMask(mask);
API.angle = 0;
API.onEnterFrame = function () {
this.angle = Math.round(_root.p2habisLaserPercent * 360);
this.clear();
if (this.angle <= 360) {
this.beginFill(0, 75);
this.moveTo(25, 25);
this.lineTo(25 + (Math.sin(this.angle * degToRad) * 50), 25 + (Math.cos(this.angle * degToRad) * -50));
if (this.angle <= 90) {
this.lineTo(50, 0);
this.lineTo(50, 50);
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
this.endFill();
} else if ((this.angle > 90) && (this.angle <= 180)) {
this.lineTo(50, 50);
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
} else if ((this.angle > 180) && (this.angle <= 270)) {
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
} else {
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
}
}
};
} else {
gotoAndStop (2);
}
stop();
Symbol 498 Button
on (release) {
_root.launchNuke(1);
_root.nukePercent = 0;
}
Symbol 499 MovieClip Frame 1
stop();
Symbol 500 MovieClip Frame 1
if (_root.p2nukesOn) {
radToDeg = 57.2957795130823;
degToRad = (Math.PI/180);
createEmptyMovieClip("mask", 1);
mask._y = 1;
mask._x = 1;
mask.beginFill(0, 50);
mask.lineTo(50, 0);
mask.lineTo(50, 50);
mask.lineTo(0, 50);
mask.lineTo(0, 0);
mask.endFill(0, 50);
createEmptyMovieClip("API", 2);
API._y = 1;
API._x = 1;
API.setMask(mask);
API.angle = 0;
API.onEnterFrame = function () {
this.angle = Math.round(_root.p2nukePercent * 360);
this.clear();
if (this.angle <= 360) {
this.beginFill(0, 75);
this.moveTo(25, 25);
this.lineTo(25 + (Math.sin(this.angle * degToRad) * 50), 25 + (Math.cos(this.angle * degToRad) * -50));
if (this.angle <= 90) {
this.lineTo(50, 0);
this.lineTo(50, 50);
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
this.endFill();
} else if ((this.angle > 90) && (this.angle <= 180)) {
this.lineTo(50, 50);
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
} else if ((this.angle > 180) && (this.angle <= 270)) {
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
} else {
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
}
}
};
} else {
gotoAndStop (2);
}
stop();
Symbol 504 MovieClip Frame 1
if (_root.troopFreezeOn) {
radToDeg = 57.2957795130823;
degToRad = (Math.PI/180);
createEmptyMovieClip("mask", 1);
mask._y = 0;
mask._x = 1;
mask.beginFill(0, 50);
mask.lineTo(50, 0);
mask.lineTo(50, 50);
mask.lineTo(0, 50);
mask.lineTo(0, 0);
mask.endFill(0, 50);
createEmptyMovieClip("API", 2);
API._y = 0;
API._x = 1;
API.setMask(mask);
API.angle = 0;
API.onEnterFrame = function () {
this.angle = Math.round(_root.troopFreezePercent * 360);
onOff.gotoAndStop(((this.angle >= 360) ? 2 : 1));
this.clear();
if (this.angle <= 360) {
this.beginFill(0, 75);
this.moveTo(25, 25);
this.lineTo(25 + (Math.sin(this.angle * degToRad) * 50), 25 + (Math.cos(this.angle * degToRad) * -50));
if (this.angle <= 90) {
this.lineTo(50, 0);
this.lineTo(50, 50);
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
this.endFill();
} else if ((this.angle > 90) && (this.angle <= 180)) {
this.lineTo(50, 50);
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
} else if ((this.angle > 180) && (this.angle <= 270)) {
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
} else {
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
}
}
};
} else {
gotoAndStop (2);
}
stop();
Symbol 505 MovieClip Frame 1
if (_root.habisLasersOn) {
radToDeg = 57.2957795130823;
degToRad = (Math.PI/180);
createEmptyMovieClip("mask", 1);
mask._y = 0;
mask._x = 1;
mask.beginFill(0, 50);
mask.lineTo(50, 0);
mask.lineTo(50, 50);
mask.lineTo(0, 50);
mask.lineTo(0, 0);
mask.endFill(0, 50);
createEmptyMovieClip("API", 2);
API._y = 0;
API._x = 1;
API.setMask(mask);
API.angle = 0;
API.onEnterFrame = function () {
this.angle = Math.round(_root.habisLaserPercent * 360);
onOff.gotoAndStop(((this.angle >= 360) ? 2 : 1));
this.clear();
if (this.angle <= 360) {
this.beginFill(0, 75);
this.moveTo(25, 25);
this.lineTo(25 + (Math.sin(this.angle * degToRad) * 50), 25 + (Math.cos(this.angle * degToRad) * -50));
if (this.angle <= 90) {
this.lineTo(50, 0);
this.lineTo(50, 50);
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
this.endFill();
} else if ((this.angle > 90) && (this.angle <= 180)) {
this.lineTo(50, 50);
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
} else if ((this.angle > 180) && (this.angle <= 270)) {
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
} else {
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
}
}
};
} else {
gotoAndStop (2);
}
stop();
Symbol 506 MovieClip Frame 1
if (_root.nukesOn) {
radToDeg = 57.2957795130823;
degToRad = (Math.PI/180);
createEmptyMovieClip("mask", 1);
mask._y = 0;
mask._x = 0;
mask.beginFill(0, 50);
mask.lineTo(50, 0);
mask.lineTo(50, 50);
mask.lineTo(0, 50);
mask.lineTo(0, 0);
mask.endFill(0, 50);
createEmptyMovieClip("API", 2);
API._y = 0;
API._x = 0;
API.setMask(mask);
API.angle = 0;
API.onEnterFrame = function () {
this.angle = Math.round(_root.nukePercent * 360);
onOff.gotoAndStop(((this.angle >= 360) ? 2 : 1));
this.clear();
if (this.angle <= 360) {
this.beginFill(0, 75);
this.moveTo(25, 25);
this.lineTo(25 + (Math.sin(this.angle * degToRad) * 50), 25 + (Math.cos(this.angle * degToRad) * -50));
if (this.angle <= 90) {
this.lineTo(50, 0);
this.lineTo(50, 50);
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
this.endFill();
} else if ((this.angle > 90) && (this.angle <= 180)) {
this.lineTo(50, 50);
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
} else if ((this.angle > 180) && (this.angle <= 270)) {
this.lineTo(0, 50);
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
} else {
this.lineTo(0, 0);
this.lineTo(25, 0);
this.lineTo(25, 25);
}
}
};
} else {
gotoAndStop (2);
}
stop();
Symbol 543 MovieClip Frame 1
stop();
Instance of Symbol 503 MovieClip in Symbol 553 MovieClip [HUD] Frame 1
onClipEvent (load) {
if (_root.p2troopFreezeOn) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 503 MovieClip in Symbol 553 MovieClip [HUD] Frame 1
onClipEvent (load) {
if (_root.p2habisLasersOn) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 503 MovieClip in Symbol 553 MovieClip [HUD] Frame 1
onClipEvent (load) {
if (_root.p2nukesOn) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 503 MovieClip in Symbol 553 MovieClip [HUD] Frame 1
onClipEvent (load) {
_visible = _root.troopFreezeOn;
}
Instance of Symbol 503 MovieClip in Symbol 553 MovieClip [HUD] Frame 1
onClipEvent (load) {
_visible = _root.habisLasersOn;
}
Instance of Symbol 503 MovieClip in Symbol 553 MovieClip [HUD] Frame 1
onClipEvent (load) {
_visible = _root.nukesOn;
}
Symbol 565 MovieClip Frame 1
wait = random(7);
ammo = 4;
Symbol 565 MovieClip Frame 8
if (wait > 0) {
wait--;
gotoAndPlay (5);
}
Symbol 565 MovieClip Frame 9
_root.playSoundFX("9mm");
_root.shoot(1, _parent._rotation, _parent._x, _parent._y, 2, _parent);
Symbol 565 MovieClip Frame 13
ammo--;
if (ammo <= 0) {
play();
} else {
gotoAndPlay (5);
}
Symbol 567 MovieClip Frame 20
_root.deathmatchHPDeduct(_parent);
removeMovieClip(_parent);
Symbol 568 MovieClip [lInf2] Frame 1
stop();
Symbol 583 MovieClip Frame 1
wait = random(7);
Symbol 583 MovieClip Frame 24
_root.playSoundFX("rocketSound");
if (wait > 0) {
wait--;
gotoAndPlay (21);
} else {
_root.shoot(2, _parent._rotation, _parent._x, _parent._y, 2, _parent);
}
Symbol 583 MovieClip Frame 54
_parent.gotoAndStop(1);
_parent.order = "stand";
Symbol 585 MovieClip Frame 20
_root.deathmatchHPDeduct(_parent);
removeMovieClip(_parent);
Symbol 586 MovieClip [RPG2] Frame 1
stop();
Symbol 598 MovieClip Frame 1
wait = random(7);
Symbol 598 MovieClip Frame 24
if (wait > 0) {
wait--;
gotoAndPlay (21);
} else {
_root.shoot(2, _parent._rotation, _parent._x, _parent._y, 1, _parent);
}
Symbol 598 MovieClip Frame 54
_parent.gotoAndStop(1);
_parent.order = "stand";
Symbol 600 MovieClip Frame 20
_root.deathmatchHPDeduct(_parent);
removeMovieClip(_parent);
Symbol 601 MovieClip [RPG1] Frame 1
stop();
Symbol 608 MovieClip Frame 1
wait = random(7);
ammo = 1;
Symbol 608 MovieClip Frame 8
if (wait > 0) {
wait--;
gotoAndPlay (5);
}
Symbol 608 MovieClip Frame 9
_root.shoot(8, _parent._rotation, _parent._x, _parent._y, 2, _parent);
Symbol 608 MovieClip Frame 10
stop();
blargh = 50;
onEnterFrame = function () {
blargh--;
if (blargh == 0) {
play();
}
};
Symbol 610 MovieClip Frame 20
_root.deathmatchHPDeduct(_parent);
removeMovieClip(_parent);
Symbol 611 MovieClip [lTroop2] Frame 1
stop();
Symbol 617 MovieClip Frame 1
wait = random(7);
ammo = 1;
Symbol 617 MovieClip Frame 8
if (wait > 0) {
wait--;
gotoAndPlay (5);
}
Symbol 617 MovieClip Frame 9
_root.shoot(8, _parent._rotation, _parent._x, _parent._y, 1, _parent);
Symbol 617 MovieClip Frame 10
stop();
blargh = 50;
onEnterFrame = function () {
blargh--;
if (blargh == 0) {
play();
}
};
Symbol 619 MovieClip Frame 20
_root.deathmatchHPDeduct(_parent);
removeMovieClip(_parent);
Symbol 620 MovieClip [lTroop] Frame 1
stop();
Symbol 631 MovieClip Frame 1
wait = 15 + random(15);
ammo = 1;
Symbol 631 MovieClip Frame 15
if (wait > 0) {
wait--;
gotoAndPlay (14);
}
Symbol 631 MovieClip Frame 16
_root.shoot(9, _parent._rotation, _parent._x, _parent._y, 1, _parent);
Symbol 631 MovieClip Frame 25
ammo--;
if (ammo <= 0) {
play();
} else {
gotoAndPlay (5);
}
Symbol 633 MovieClip Frame 20
_root.deathmatchHPDeduct(_parent);
removeMovieClip(_parent);
Symbol 634 MovieClip [sniper] Frame 1
stop();
Symbol 642 MovieClip Frame 1
wait = random(7);
ammo = 4;
Symbol 642 MovieClip Frame 8
if (wait > 0) {
wait--;
gotoAndPlay (5);
}
Symbol 642 MovieClip Frame 9
_root.shoot(1, _parent._rotation, _parent._x, _parent._y, 1, _parent);
Symbol 642 MovieClip Frame 13
ammo--;
if (ammo <= 0) {
play();
} else {
gotoAndPlay (5);
}
Symbol 644 MovieClip Frame 20
_root.deathmatchHPDeduct(_parent);
removeMovieClip(_parent);
Symbol 645 MovieClip [lInf1] Frame 1
stop();
Symbol 649 MovieClip Frame 1
stop();
Symbol 653 MovieClip [missileHole] Frame 56
removeMovieClip(this);
Symbol 655 MovieClip [missileBlast] Frame 17
removeMovieClip(this);
Symbol 656 MovieClip Frame 1
stop();
Symbol 656 MovieClip Frame 2
_root.playSoundFX("tankDie");
Symbol 656 MovieClip Frame 26
_root.screenShake(12);
Symbol 656 MovieClip Frame 33
for (var i in _root.p1) {
p = _root.p1[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 2;
}
}
for (var i in _root.p1Vehicles) {
p = _root.p1Vehicles[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 4;
}
}
for (var i in _root.p2) {
p = _root.p2[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 2;
}
}
for (var i in _root.p2Vehicles) {
p = _root.p2Vehicles[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 4;
}
}
Symbol 662 MovieClip Frame 1
stop();
wait = random(5);
Symbol 662 MovieClip Frame 3
if (wait > 0) {
wait--;
gotoAndPlay (2);
} else {
_root.shoot(4, _parent._rotation, _parent._parent._x, _parent._parent._y, 2);
}
Symbol 667 MovieClip Frame 1
stop();
wait = random(7);
Symbol 667 MovieClip Frame 7
if (wait > 0) {
wait--;
gotoAndPlay (2);
} else {
_root.shoot(3, _rotation, _parent._x, _parent._y, 2, _parent);
}
Symbol 673 MovieClip Frame 1
stop();
Symbol 673 MovieClip Frame 2
_root.playSoundFX("tankDie");
Symbol 673 MovieClip Frame 26
_root.screenShake(10);
Symbol 673 MovieClip Frame 30
for (var i in _root.p1) {
p = _root.p1[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 1.5;
}
}
for (var i in _root.p1Vehicles) {
p = _root.p1Vehicles[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 3;
}
}
for (var i in _root.p2) {
p = _root.p2[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 1.5;
}
}
for (var i in _root.p2Vehicles) {
p = _root.p2Vehicles[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 3;
}
}
Symbol 680 MovieClip Frame 1
stop();
Symbol 680 MovieClip Frame 2
_root.shoot(5, _rotation, _parent._x, _parent._y, 2, _parent);
_root.playSoundFX("gattlingSound");
Symbol 686 MovieClip Frame 1
stop();
Symbol 692 MovieClip Frame 1
stop();
Symbol 692 MovieClip Frame 2
_root.playSoundFX("tankDie");
Symbol 692 MovieClip Frame 26
_root.screenShake(10);
Symbol 692 MovieClip Frame 30
for (var i in _root.p1) {
p = _root.p1[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 1.5;
}
}
for (var i in _root.p1Vehicles) {
p = _root.p1Vehicles[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 3;
}
}
for (var i in _root.p2) {
p = _root.p2[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 1.5;
}
}
for (var i in _root.p2Vehicles) {
p = _root.p2Vehicles[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 3;
}
}
Symbol 697 MovieClip Frame 1
stop();
Symbol 697 MovieClip Frame 10
_root.shoot(8, _rotation, _parent._x, _parent._y, 2, _parent, true);
stop();
Symbol 703 MovieClip Frame 1
stop();
Symbol 713 MovieClip Frame 1
stop();
Symbol 713 MovieClip Frame 10
_root.shoot(8, _rotation, _parent._x, _parent._y, 1, _parent, true);
stop();
Symbol 713 MovieClip Frame 19
gotoAndPlay (11);
Symbol 716 MovieClip Frame 1
stop();
Symbol 716 MovieClip Frame 2
_root.playSoundFX("tankDie");
Symbol 716 MovieClip Frame 26
_root.screenShake(10);
Symbol 716 MovieClip Frame 30
for (var i in _root.p1) {
p = _root.p1[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 1.5;
}
}
for (var i in _root.p1Vehicles) {
p = _root.p1Vehicles[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 3;
}
}
for (var i in _root.p2) {
p = _root.p2[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 1.5;
}
}
for (var i in _root.p2Vehicles) {
p = _root.p2Vehicles[i];
if (p.hitTest(_parent)) {
p.HP = p.HP - 3;
}
}
Symbol 721 MovieClip Frame 1
stop();
Symbol 721 MovieClip Frame 6
_root.shoot(11, _rotation, _parent._x, _parent._y, 2, _parent);
Symbol 729 MovieClip Frame 1
stop();
Symbol 735 MovieClip Frame 1
stop();
Symbol 735 MovieClip Frame 6
_root.shoot(11, _rotation, _parent._x, _parent._y, 1, _parent);
Symbol 741 MovieClip Frame 1
stop();
Symbol 741 MovieClip Frame 2
_root.shoot(5, _rotation, _parent._x, _parent._y, 1, _parent);
_root.playSoundFX("gattlingSound");
Symbol 750 MovieClip Frame 1
stop();
wait = random(5);
Symbol 750 MovieClip Frame 3
if (wait > 0) {
wait--;
gotoAndPlay (2);
} else {
_root.shoot(4, _parent._rotation, _parent._parent._x, _parent._parent._y, 1);
}
Symbol 751 MovieClip Frame 1
stop();
wait = random(7);
Symbol 751 MovieClip Frame 7
if (wait > 0) {
wait--;
gotoAndPlay (2);
} else {
_root.shoot(3, _rotation, _parent._x, _parent._y, 1, _parent);
}
Symbol 763 MovieClip [radiation] Frame 30
stop();
Symbol 765 MovieClip [fog] Frame 120
removeMovieClip(this);
Symbol 772 MovieClip [qualityChangeText] Frame 1
stop();
Symbol 779 MovieClip [shiftCursor] Frame 1
stop();
Symbol 806 MovieClip [freezeCircle] Frame 320
removeMovieClip(this);
Symbol 871 MovieClip [cursor1] Frame 1
stop();
Symbol 875 MovieClip [cursor2] Frame 1
stop();
Symbol 906 MovieClip Frame 1
stop();
Symbol 919 MovieClip Frame 1
stop();
_root.campaignGold = _root.campaignGold - (-_parent.price);
_root.campaignUpgradeGold = _root.campaignUpgradeGold - (-_parent.price);
_root.p2campaignGold = _root.p2campaignGold - (-_parent.price);
_root.p2campaignUpgradeGold = _root.p2campaignUpgradeGold - (-_parent.price);
Symbol 919 MovieClip Frame 2
_root.campaignGold = _root.campaignGold - _parent.price;
_root.campaignUpgradeGold = _root.campaignUpgradeGold - _parent.price;
_root.p2campaignGold = _root.p2campaignGold - _parent.price;
_root.p2campaignUpgradeGold = _root.p2campaignUpgradeGold - _parent.price;
Symbol 932 MovieClip Frame 1
stop();
Symbol 933 MovieClip [UnitComponent] Frame 1
#initclip 2
function Holder() {
}
Holder.prototype = new MovieClip();
Holder.prototype.onLoad = function () {
if (this.unitFrame == 11) {
if (this.team == 1) {
if (_root.team1Units[2]) {
this._visible = true;
} else {
this._visible = false;
this.tickOrCross.gotoAndStop(2);
this.tickOrCross.gotoAndStop(1);
}
} else if (_root.team2Units[2]) {
this._visible = true;
} else {
this._visible = false;
this.tickOrCross.gotoAndStop(2);
this.tickOrCross.gotoAndStop(1);
}
} else if (this.unitFrame == 12) {
if (this.team == 1) {
if (_root.team1Units[4]) {
this._visible = true;
} else {
this._visible = false;
this.tickOrCross.gotoAndStop(2);
this.tickOrCross.gotoAndStop(1);
}
} else if (_root.team2Units[4]) {
this._visible = true;
} else {
this._visible = false;
this.tickOrCross.gotoAndStop(2);
this.tickOrCross.gotoAndStop(1);
}
} else if (this.unitFrame == 15) {
if (this.team == 1) {
if (_root.team1Units[5] || (_root.team1Units[6])) {
this._visible = true;
} else {
this._visible = false;
this.tickOrCross.gotoAndStop(2);
this.tickOrCross.gotoAndStop(1);
}
} else if (_root.team2Units[5] || (_root.team2Units[6])) {
this._visible = true;
} else {
this._visible = false;
this.tickOrCross.gotoAndStop(2);
this.tickOrCross.gotoAndStop(1);
}
} else if (this.unitFrame == 14) {
if (this.team == 1) {
if (((((_root.team1Units[0] || (_root.team1Units[3])) || (_root.team1Units[4])) || (_root.team1Units[7])) || (_root.team1Units[2])) || (_root.tankGattleTicked)) {
this._visible = true;
} else {
this._visible = false;
this.tickOrCross.gotoAndStop(2);
this.tickOrCross.gotoAndStop(1);
}
} else if (((((_root.team2Units[0] || (_root.team2Units[3])) || (_root.team2Units[4])) || (_root.team2Units[7])) || (_root.team2Units[2])) || (_root.tankGattleTicked)) {
this._visible = true;
} else {
this._visible = false;
this.tickOrCross.gotoAndStop(2);
this.tickOrCross.gotoAndStop(1);
}
} else if (this.unitFrame == 12) {
if (this.team == 1) {
if (_root.team1Units[1] || (_root.homingRocketTicked)) {
this._visible = true;
} else {
this._visible = false;
this.tickOrCross.gotoAndStop(2);
this.tickOrCross.gotoAndStop(1);
}
} else if (_root.team2Units[1] || (_root.homingRocketTicked)) {
this._visible = true;
} else {
this._visible = false;
this.tickOrCross.gotoAndStop(2);
this.tickOrCross.gotoAndStop(1);
}
}
_root.campaignGold = _root.campaignGold - this.price;
_root.campaignUpgradeGold = _root.campaignUpgradeGold - this.price;
_root.p2campaignGold = _root.p2campaignGold - this.price;
_root.p2campaignUpgradeGold = _root.p2campaignUpgradeGold - this.price;
this.avatar.gotoAndStop(this.unitFrame);
this.avatar.onPress = function () {
b = -33;
t = {rb:b, gb:b, bb:b};
col = new Color(this);
col.setTransform(t);
};
this.avatar.onRelease = function () {
if (_root._currentframe == 14) {
if (this._parent.tickOrCross._currentframe == 2) {
this._parent.tickOrCross.gotoAndStop(1);
if (this._parent.unitFrame == 1) {
_root.team1Units[0] = false;
} else if (this._parent.unitFrame == 2) {
_root.team1Units[1] = false;
} else if (this._parent.unitFrame == 3) {
_root.team1Units[5] = false;
} else if (this._parent.unitFrame == 4) {
_root.team1Units[7] = false;
} else if (this._parent.unitFrame == 5) {
_root.team1Units[2] = false;
} else if (this._parent.unitFrame == 6) {
_root.team1Units[3] = false;
} else if (this._parent.unitFrame == 7) {
_root.team1Units[6] = false;
} else if (this._parent.unitFrame == 8) {
_root.team1Units[9] = false;
} else if (this._parent.unitFrame == 9) {
_root.team1Units[4] = false;
} else if (this._parent.unitFrame == 10) {
_root.team1Units[8] = false;
}
} else if (this._parent.price <= _root.campaignGold) {
this._parent.tickOrCross.gotoAndStop(2);
if (this._parent.unitFrame == 1) {
_root.team1Units[0] = true;
} else if (this._parent.unitFrame == 2) {
_root.team1Units[1] = true;
} else if (this._parent.unitFrame == 3) {
_root.team1Units[5] = true;
} else if (this._parent.unitFrame == 4) {
_root.team1Units[7] = true;
} else if (this._parent.unitFrame == 5) {
_root.team1Units[2] = true;
} else if (this._parent.unitFrame == 6) {
_root.team1Units[3] = true;
} else if (this._parent.unitFrame == 7) {
_root.team1Units[6] = true;
} else if (this._parent.unitFrame == 8) {
_root.team1Units[9] = true;
} else if (this._parent.unitFrame == 9) {
_root.team1Units[4] = true;
} else if (this._parent.unitFrame == 10) {
_root.team1Units[8] = true;
}
}
} else if (_root._currentframe == 16) {
if (this._parent.tickOrCross._currentframe == 2) {
this._parent.tickOrCross.gotoAndStop(1);
if (this._parent.unitFrame == 11) {
_root.team1CanUpgrade[4] = false;
} else if (this._parent.unitFrame == 12) {
_root.team1CanUpgrade[3] = false;
} else if (this._parent.unitFrame == 13) {
_root.team1CanUpgrade[0] = false;
} else if (this._parent.unitFrame == 14) {
_root.team1CanUpgrade[1] = false;
} else if (this._parent.unitFrame == 15) {
_root.team1CanUpgrade[2] = false;
} else if (this._parent.unitFrame == 16) {
_root.nukesOn = false;
} else if (this._parent.unitFrame == 17) {
_root.habisLasersOn = false;
} else if (this._parent.unitFrame == 18) {
_root.troopFreezeOn = false;
}
} else if (_root.campaignUpgradeGold >= this._parent.price) {
this._parent.tickOrCross.gotoAndStop(2);
if (this._parent.unitFrame == 11) {
_root.team1CanUpgrade[4] = true;
} else if (this._parent.unitFrame == 12) {
_root.team1CanUpgrade[3] = true;
} else if (this._parent.unitFrame == 13) {
_root.team1CanUpgrade[0] = true;
} else if (this._parent.unitFrame == 14) {
_root.team1CanUpgrade[1] = true;
} else if (this._parent.unitFrame == 15) {
_root.team1CanUpgrade[2] = true;
} else if (this._parent.unitFrame == 16) {
_root.nukesOn = true;
} else if (this._parent.unitFrame == 17) {
_root.habisLasersOn = true;
} else if (this._parent.unitFrame == 18) {
_root.troopFreezeOn = true;
}
}
} else if (_root._currentframe == 17) {
if (this._parent.tickOrCross._currentframe == 2) {
this._parent.tickOrCross.gotoAndStop(1);
if (this._parent.unitFrame == 1) {
_root.team2Units[0] = false;
} else if (this._parent.unitFrame == 2) {
_root.team2Units[1] = false;
} else if (this._parent.unitFrame == 3) {
_root.team2Units[5] = false;
} else if (this._parent.unitFrame == 4) {
_root.team2Units[7] = false;
} else if (this._parent.unitFrame == 5) {
_root.team2Units[2] = false;
} else if (this._parent.unitFrame == 6) {
_root.team2Units[3] = false;
} else if (this._parent.unitFrame == 7) {
_root.team2Units[6] = false;
} else if (this._parent.unitFrame == 8) {
_root.team2Units[9] = false;
} else if (this._parent.unitFrame == 9) {
_root.team2Units[4] = false;
} else if (this._parent.unitFrame == 10) {
_root.team2Units[8] = false;
}
} else if (this._parent.price <= _root.p2campaignGold) {
this._parent.tickOrCross.gotoAndStop(2);
if (this._parent.unitFrame == 1) {
_root.team2Units[0] = true;
} else if (this._parent.unitFrame == 2) {
_root.team2Units[1] = true;
} else if (this._parent.unitFrame == 3) {
_root.team2Units[5] = true;
} else if (this._parent.unitFrame == 4) {
_root.team2Units[7] = true;
} else if (this._parent.unitFrame == 5) {
_root.team2Units[2] = true;
} else if (this._parent.unitFrame == 6) {
_root.team2Units[3] = true;
} else if (this._parent.unitFrame == 7) {
_root.team2Units[6] = true;
} else if (this._parent.unitFrame == 8) {
_root.team2Units[9] = true;
} else if (this._parent.unitFrame == 9) {
_root.team2Units[4] = true;
} else if (this._parent.unitFrame == 10) {
_root.team2Units[8] = true;
}
}
} else if (_root._currentframe == 18) {
if (this._parent.tickOrCross._currentframe == 2) {
this._parent.tickOrCross.gotoAndStop(1);
if (this._parent.unitFrame == 11) {
_root.team2CanUpgrade[4] = false;
} else if (this._parent.unitFrame == 12) {
_root.team2CanUpgrade[3] = false;
} else if (this._parent.unitFrame == 13) {
_root.team2CanUpgrade[0] = false;
} else if (this._parent.unitFrame == 14) {
_root.team2CanUpgrade[1] = false;
} else if (this._parent.unitFrame == 15) {
_root.team2CanUpgrade[2] = false;
} else if (this._parent.unitFrame == 16) {
_root.p2nukesOn = false;
} else if (this._parent.unitFrame == 17) {
_root.p2habisLasersOn = false;
} else if (this._parent.unitFrame == 18) {
_root.p2troopFreezeOn = false;
}
} else if (this._parent.price <= _root.p2campaignUpgradeGold) {
this._parent.tickOrCross.gotoAndStop(2);
if (this._parent.unitFrame == 11) {
_root.team2CanUpgrade[4] = true;
} else if (this._parent.unitFrame == 12) {
_root.team2CanUpgrade[3] = true;
} else if (this._parent.unitFrame == 13) {
_root.team2CanUpgrade[0] = true;
} else if (this._parent.unitFrame == 14) {
_root.team2CanUpgrade[1] = true;
} else if (this._parent.unitFrame == 15) {
_root.team2CanUpgrade[2] = true;
} else if (this._parent.unitFrame == 16) {
_root.p2nukesOn = true;
} else if (this._parent.unitFrame == 17) {
_root.p2habisLasersOn = true;
} else if (this._parent.unitFrame == 18) {
_root.p2troopFreezeOn = true;
}
}
}
b = 0;
t = {rb:b, gb:b, bb:b};
col = new Color(this);
col.setTransform(t);
};
this.avatar.onRollOver = (this.avatar.onDragOver = function () {
_root[cursorName].gotoAndStop(2);
b = 33;
t = {rb:b, gb:b, bb:b};
col = new Color(this);
col.setTransform(t);
this._parent.description.gotoAndStop(this._parent.unitFrame + 1);
});
this.avatar.onRollOut = (this.avatar.onDragOut = function () {
this._parent.description.gotoAndStop(1);
_root[cursorName].gotoAndStop(1);
b = 0;
t = {rb:b, gb:b, bb:b};
col = new Color(this);
col.setTransform(t);
});
this.onEnterFrame = function () {
if (this.unitFrame == 14) {
if (this.team == 1) {
if ((((_root.team1Units[0] || (_root.team1Units[3])) || (_root.team1Units[4])) || (_root.team1Units[7])) || (_root.tankGattleTicked)) {
this._visible = true;
} else {
this._visible = false;
this.tickOrCross.gotoAndStop(1);
}
} else if ((((_root.team2Units[0] || (_root.team2Units[3])) || (_root.team2Units[4])) || (_root.team2Units[7])) || (_root.tankGattleTicked)) {
this._visible = true;
} else {
this._visible = false;
this.tickOrCross.gotoAndStop(1);
}
} else if (this.unitFrame == 13) {
if (this.team == 1) {
if (_root.team1Units[1] || (_root.rocketPodsTicked)) {
this._visible = true;
} else {
this._visible = false;
this.tickOrCross.gotoAndStop(1);
}
} else if (_root.team2Units[1] || (_root.rocketPodsTicked)) {
this._visible = true;
} else {
this._visible = false;
this.tickOrCross.gotoAndStop(1);
}
} else if (this.unitFrame == 12) {
_root.rocketPodsTicked = this.tickOrCross._currentframe == 2;
} else if (this.unitFrame == 11) {
_root.tankGattleTicked = this.tickOrCross._currentframe == 2;
}
if (this.tickOrCross._currentframe == 1) {
if (_root._currentframe == 14) {
this._alpha = ((this.price > _root.campaignGold) ? 33 : 100);
} else if (_root._currentframe == 16) {
this._alpha = ((this.price > _root.campaignUpgradeGold) ? 33 : 100);
} else if (_root._currentframe == 17) {
this._alpha = ((this.price > _root.p2campaignGold) ? 33 : 100);
} else if (_root._currentframe == 18) {
this._alpha = ((this.price > _root.p2campaignUpgradeGold) ? 33 : 100);
}
} else {
this._alpha = 100;
}
};
};
Object.registerClass("UnitComponent", Holder);
#endinitclip
Symbol 937 MovieClip Frame 1
stop();
Symbol 941 MovieClip Frame 1
stop();
Symbol 944 MovieClip Frame 1
stop();
Symbol 948 MovieClip Frame 1
stop();
Symbol 952 MovieClip Frame 1
stop();
Symbol 956 MovieClip Frame 1
stop();
Symbol 960 MovieClip Frame 1
stop();
Symbol 964 MovieClip Frame 1
stop();
Symbol 968 MovieClip Frame 1
stop();
Symbol 972 MovieClip Frame 1
stop();
Symbol 976 MovieClip Frame 1
stop();
Symbol 980 MovieClip Frame 1
stop();
Symbol 984 MovieClip Frame 1
stop();
Symbol 988 MovieClip Frame 1
stop();
Symbol 992 MovieClip Frame 1
stop();
Symbol 996 MovieClip Frame 1
stop();
Symbol 1000 MovieClip Frame 1
stop();
Symbol 1004 MovieClip Frame 1
stop();
Symbol 1008 MovieClip Frame 1
stop();
Symbol 1012 MovieClip Frame 1
stop();
Symbol 1016 MovieClip Frame 1
stop();
Symbol 1020 MovieClip Frame 1
stop();
Symbol 1024 MovieClip Frame 1
stop();
Symbol 1028 MovieClip Frame 1
stop();
Symbol 1032 MovieClip Frame 1
stop();
Instance of Symbol 937 MovieClip "flag25" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Mongolia";
}
Instance of Symbol 941 MovieClip "flag24" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Mexico";
}
Instance of Symbol 944 MovieClip "flag23" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Nigeria";
}
Instance of Symbol 948 MovieClip "flag22" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Saudi Arabia";
}
Instance of Symbol 952 MovieClip "flag21" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Sweden";
}
Instance of Symbol 956 MovieClip "flag20" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Central African Republic";
}
Instance of Symbol 960 MovieClip "flag19" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Botswana";
}
Instance of Symbol 964 MovieClip "flag18" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Peru";
}
Instance of Symbol 968 MovieClip "flag17" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Argentina";
}
Instance of Symbol 972 MovieClip "flag16" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Algeria";
}
Instance of Symbol 976 MovieClip "flag15" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Brazil";
}
Instance of Symbol 980 MovieClip "flag14" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Canada";
}
Instance of Symbol 984 MovieClip "flag13" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Malaysia";
}
Instance of Symbol 988 MovieClip "flag12" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Indonesia";
}
Instance of Symbol 992 MovieClip "flag11" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Australia";
}
Instance of Symbol 996 MovieClip "flag1" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Japan";
}
Instance of Symbol 1000 MovieClip "flag2" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "China";
}
Instance of Symbol 1004 MovieClip "flag3" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "India";
}
Instance of Symbol 1008 MovieClip "flag4" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Russia";
}
Instance of Symbol 1012 MovieClip "flag5" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Israel";
}
Instance of Symbol 1016 MovieClip "flag6" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Italy";
}
Instance of Symbol 1020 MovieClip "flag7" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "Germany";
}
Instance of Symbol 1024 MovieClip "flag8" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "France";
}
Instance of Symbol 1028 MovieClip "flag9" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "United Kingdom";
}
Instance of Symbol 1032 MovieClip "flag10" in Symbol 1033 MovieClip [flagHolder] Frame 1
onClipEvent (load) {
nation = "United States of America";
}
Symbol 1035 MovieClip Frame 1
var component = _parent;
component.registerSkinElement(track_mc, "scrollTrack");
Symbol 1036 MovieClip [FScrollBarSymbol] Frame 1
#initclip 4
FScrollBarClass = function () {
if (this._height == 4) {
return(undefined);
}
this.init();
this.minPos = (this.maxPos = (this.pageSize = (this.largeScroll = 0)));
this.smallScroll = 1;
this.width = (this.horizontal ? (this._width) : (this._height));
this._xscale = (this._yscale = 100);
this.setScrollPosition(0);
this.tabEnabled = false;
if (this._targetInstanceName.length > 0) {
this.setScrollTarget(this._parent[this._targetInstanceName]);
}
this.tabChildren = false;
this.setSize(this.width);
};
FScrollBarClass.prototype = new FUIComponentClass();
FScrollBarClass.prototype.setHorizontal = function (flag) {
if (this.horizontal && (!flag)) {
this._xscale = 100;
this._rotation = 0;
} else if (flag && (!this.horizontal)) {
this._xscale = -100;
this._rotation = -90;
}
this.horizontal = flag;
};
FScrollBarClass.prototype.setScrollProperties = function (pSize, mnPos, mxPos) {
if (!this.enable) {
return(undefined);
}
this.pageSize = pSize;
this.minPos = Math.max(mnPos, 0);
this.maxPos = Math.max(mxPos, 0);
this.scrollPosition = Math.max(this.minPos, this.scrollPosition);
this.scrollPosition = Math.min(this.maxPos, this.scrollPosition);
if ((this.maxPos - this.minPos) <= 0) {
this.scrollThumb_mc.removeMovieClip();
this.upArrow_mc.gotoAndStop(3);
this.downArrow_mc.gotoAndStop(3);
this.downArrow_mc.onPress = (this.downArrow_mc.onRelease = (this.downArrow_mc.onDragOut = null));
this.upArrow_mc.onPress = (this.upArrow_mc.onRelease = (this.upArrow_mc.onDragOut = null));
this.scrollTrack_mc.onPress = (this.scrollTrack_mc.onRelease = null);
this.scrollTrack_mc.onDragOut = (this.scrollTrack_mc.onRollOut = null);
this.scrollTrack_mc.useHandCursor = false;
} else {
var tmp = this.getScrollPosition();
this.upArrow_mc.gotoAndStop(1);
this.downArrow_mc.gotoAndStop(1);
this.upArrow_mc.onPress = (this.upArrow_mc.onDragOver = this.startUpScroller);
this.upArrow_mc.onRelease = (this.upArrow_mc.onDragOut = this.stopScrolling);
this.downArrow_mc.onPress = (this.downArrow_mc.onDragOver = this.startDownScroller);
this.downArrow_mc.onRelease = (this.downArrow_mc.onDragOut = this.stopScrolling);
this.scrollTrack_mc.onPress = (this.scrollTrack_mc.onDragOver = this.startTrackScroller);
this.scrollTrack_mc.onRelease = this.stopScrolling;
this.scrollTrack_mc.onDragOut = this.stopScrolling;
this.scrollTrack_mc.onRollOut = this.stopScrolling;
this.scrollTrack_mc.useHandCursor = false;
this.attachMovie("ScrollThumb", "scrollThumb_mc", 3);
this.scrollThumb_mc._x = 0;
this.scrollThumb_mc._y = this.upArrow_mc._height;
this.scrollThumb_mc.onPress = this.startDragThumb;
this.scrollThumb_mc.controller = this;
this.scrollThumb_mc.onRelease = (this.scrollThumb_mc.onReleaseOutside = this.stopDragThumb);
this.scrollThumb_mc.useHandCursor = false;
this.thumbHeight = (this.pageSize / ((this.maxPos - this.minPos) + this.pageSize)) * this.trackSize;
this.thumbMid_mc = this.scrollThumb_mc.mc_sliderMid;
this.thumbTop_mc = this.scrollThumb_mc.mc_sliderTop;
this.thumbBot_mc = this.scrollThumb_mc.mc_sliderBot;
this.thumbHeight = Math.max(this.thumbHeight, 6);
this.midHeight = (this.thumbHeight - this.thumbTop_mc._height) - this.thumbBot_mc._height;
this.thumbMid_mc._yScale = (this.midHeight * 100) / this.thumbMid_mc._height;
this.thumbMid_mc._y = this.thumbTop_mc._height;
this.thumbBot_mc._y = this.thumbTop_mc._height + this.midHeight;
this.scrollTop = this.scrollThumb_mc._y;
this.trackHeight = this.trackSize - this.thumbHeight;
this.scrollBot = this.trackHeight + this.scrollTop;
tmp = Math.min(tmp, this.maxPos);
this.setScrollPosition(Math.max(tmp, this.minPos));
}
};
FScrollBarClass.prototype.getScrollPosition = function () {
return(this.scrollPosition);
};
FScrollBarClass.prototype.setScrollPosition = function (pos) {
this.scrollPosition = pos;
if (this.scrollThumb_mc != undefined) {
pos = Math.min(pos, this.maxPos);
pos = Math.max(pos, this.minPos);
}
this.scrollThumb_mc._y = (((pos - this.minPos) * this.trackHeight) / (this.maxPos - this.minPos)) + this.scrollTop;
this.executeCallBack();
};
FScrollBarClass.prototype.setLargeScroll = function (lScroll) {
this.largeScroll = lScroll;
};
FScrollBarClass.prototype.setSmallScroll = function (sScroll) {
this.smallScroll = sScroll;
};
FScrollBarClass.prototype.setEnabled = function (enabledFlag) {
var wasEnabled = this.enable;
if (enabledFlag && (!wasEnabled)) {
this.enable = enabledFlag;
if (this.textField != undefined) {
this.setScrollTarget(this.textField);
} else {
this.setScrollProperties(this.pageSize, this.cachedMinPos, this.cachedMaxPos);
this.setScrollPosition(this.cachedPos);
}
this.clickFilter = undefined;
} else if ((!enabledFlag) && (wasEnabled)) {
this.textField.removeListener(this);
this.cachedPos = this.getScrollPosition();
this.cachedMinPos = this.minPos;
this.cachedMaxPos = this.maxPos;
if (this.clickFilter == undefined) {
this.setScrollProperties(this.pageSize, 0, 0);
} else {
this.clickFilter = true;
}
this.enable = enabledFlag;
}
};
FScrollBarClass.prototype.setSize = function (hgt) {
if (this._height == 1) {
return(undefined);
}
this.width = hgt;
this.scrollTrack_mc._yscale = 100;
this.scrollTrack_mc._yscale = (100 * this.width) / this.scrollTrack_mc._height;
if (this.upArrow_mc == undefined) {
this.attachMovie("UpArrow", "upArrow_mc", 1);
this.attachMovie("DownArrow", "downArrow_mc", 2);
this.downArrow_mc.controller = (this.upArrow_mc.controller = this);
this.upArrow_mc.useHandCursor = (this.downArrow_mc.useHandCursor = false);
this.upArrow_mc._x = (this.upArrow_mc._y = 0);
this.downArrow_mc._x = 0;
}
this.scrollTrack_mc.controller = this;
this.downArrow_mc._y = this.width - this.downArrow_mc._height;
this.trackSize = this.width - (2 * this.downArrow_mc._height);
if (this.textField != undefined) {
this.onTextChanged();
} else {
this.setScrollProperties(this.pageSize, this.minPos, this.maxPos);
}
};
FScrollBarClass.prototype.scrollIt = function (inc, mode) {
var delt = this.smallScroll;
if (inc != "one") {
delt = ((this.largeScroll == 0) ? (this.pageSize) : (this.largeScroll));
}
var newPos = (this.getScrollPosition() + (mode * delt));
if (newPos > this.maxPos) {
newPos = this.maxPos;
} else if (newPos < this.minPos) {
newPos = this.minPos;
}
this.setScrollPosition(newPos);
};
FScrollBarClass.prototype.startDragThumb = function () {
this.lastY = this._ymouse;
this.onMouseMove = this.controller.dragThumb;
};
FScrollBarClass.prototype.dragThumb = function () {
this.scrollMove = this._ymouse - this.lastY;
this.scrollMove = this.scrollMove + this._y;
if (this.scrollMove < this.controller.scrollTop) {
this.scrollMove = this.controller.scrollTop;
} else if (this.scrollMove > this.controller.scrollBot) {
this.scrollMove = this.controller.scrollBot;
}
this._y = this.scrollMove;
var c = this.controller;
c.scrollPosition = Math.round(((c.maxPos - c.minPos) * (this._y - c.scrollTop)) / c.trackHeight) + c.minPos;
this.controller.isScrolling = true;
updateAfterEvent();
this.controller.executeCallBack();
};
FScrollBarClass.prototype.stopDragThumb = function () {
this.controller.isScrolling = false;
this.onMouseMove = null;
};
FScrollBarClass.prototype.startTrackScroller = function () {
this.controller.trackScroller();
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "page", -1);
};
FScrollBarClass.prototype.scrollInterval = function (inc, mode) {
clearInterval(this.scrolling);
if (inc == "page") {
this.trackScroller();
} else {
this.scrollIt(inc, mode);
}
this.scrolling = setInterval(this, "scrollInterval", 35, inc, mode);
};
FScrollBarClass.prototype.trackScroller = function () {
if ((this.scrollThumb_mc._y + this.thumbHeight) < this._ymouse) {
this.scrollIt("page", 1);
} else if (this.scrollThumb_mc._y > this._ymouse) {
this.scrollIt("page", -1);
}
};
FScrollBarClass.prototype.stopScrolling = function () {
this.controller.downArrow_mc.gotoAndStop(1);
this.controller.upArrow_mc.gotoAndStop(1);
clearInterval(this.controller.scrolling);
};
FScrollBarClass.prototype.startUpScroller = function () {
this.controller.upArrow_mc.gotoAndStop(2);
this.controller.scrollIt("one", -1);
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "one", -1);
};
FScrollBarClass.prototype.startDownScroller = function () {
this.controller.downArrow_mc.gotoAndStop(2);
this.controller.scrollIt("one", 1);
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "one", 1);
};
FScrollBarClass.prototype.setScrollTarget = function (tF) {
if (tF == undefined) {
this.textField.removeListener(this);
delete this.textField[(this.horizontal ? "hScroller" : "vScroller")];
if ((this.textField.hScroller != undefined) && (this.textField.vScroller != undefined)) {
this.textField.unwatch("text");
this.textField.unwatch("htmltext");
}
}
this.textField = undefined;
if (!(tF instanceof TextField)) {
return(undefined);
}
this.textField = tF;
this.textField[(this.horizontal ? "hScroller" : "vScroller")] = this;
this.onTextChanged();
this.onChanged = function () {
this.onTextChanged();
};
this.onScroller = function () {
if (!this.isScrolling) {
if (!this.horizontal) {
this.setScrollPosition(this.textField.scroll);
} else {
this.setScrollPosition(this.textField.hscroll);
}
}
};
this.textField.addListener(this);
this.textField.watch("text", this.callback);
this.textField.watch("htmlText", this.callback);
};
FScrollBarClass.prototype.callback = function (prop, oldVal, newVal) {
clearInterval(this.hScroller.synchScroll);
clearInterval(this.vScroller.synchScroll);
this.hScroller.synchScroll = setInterval(this.hScroller, "onTextChanged", 50);
this.vScroller.synchScroll = setInterval(this.vScroller, "onTextChanged", 50);
return(newVal);
};
FScrollBarClass.prototype.onTextChanged = function () {
if ((!this.enable) || (this.textField == undefined)) {
return(undefined);
}
clearInterval(this.synchScroll);
if (this.horizontal) {
var pos = this.textField.hscroll;
this.setScrollProperties(this.textField._width, 0, this.textField.maxhscroll);
this.setScrollPosition(Math.min(pos, this.textField.maxhscroll));
} else {
var pos = this.textField.scroll;
var pageSize = (this.textField.bottomScroll - this.textField.scroll);
this.setScrollProperties(pageSize, 1, this.textField.maxscroll);
this.setScrollPosition(Math.min(pos, this.textField.maxscroll));
}
};
FScrollBarClass.prototype.executeCallBack = function () {
if (this.textField == undefined) {
super.executeCallBack();
} else if (this.horizontal) {
this.textField.hscroll = this.getScrollPosition();
} else {
this.textField.scroll = this.getScrollPosition();
}
};
Object.registerClass("FScrollBarSymbol", FScrollBarClass);
#endinitclip
Symbol 1053 MovieClip Frame 32
stop();
Symbol 1055 Button
on (release) {
_root.gotoAndStop(29);
}
Symbol 1060 MovieClip Frame 1
function camControl() {
parentColor.setTransform(camColor.getTransform());
var scaleX = (sX / this._width);
var scaleY = (sY / this._height);
_parent._x = cX - (this._x * scaleX);
_parent._y = cY - (this._y * scaleY);
_parent._xscale = 100 * scaleX;
_parent._yscale = 100 * scaleY;
}
function resetStage() {
var resetTrans = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
parentColor.setTransform(resetTrans);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
parentColor.setTransform(camColor.getTransform());
this.frame._visible = false;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
camControl();
this.onUnload = resetStage;
Symbol 1099 MovieClip Frame 23
_root.level = (_root.save.level = 25);
Symbol 1099 MovieClip Frame 349
_root.gotoAndStop(29);
Symbol 1160 MovieClip Frame 400
gotoAndPlay (1);
Symbol 1164 MovieClip Frame 400
gotoAndPlay (1);
Symbol 1206 MovieClip Frame 1
stop();
_root.p2poplimit = _root.save.p2poplimit;
b1.b1.onRelease = function () {
_root.p2poplimit++;
_root.save.p2poplimit = _root.p2poplimit;
};
b1.b1.onRollOver = (b1.b1.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b1.b1.onRollOut = (b1.b1.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b2.b2.onRelease = function () {
_root.p2poplimit--;
_root.save.p2poplimit = _root.p2poplimit;
};
b2.b2.onRollOver = (b2.b2.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b2.b2.onRollOut = (b2.b2.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b1.onEnterFrame = function () {
this._visible = _root.p2poplimit != 15;
};
b2.onEnterFrame = function () {
this._visible = _root.p2poplimit != 3;
};
Symbol 1209 MovieClip Frame 1
stop();
_root.p1poplimit = _root.save.p1poplimit;
b1.b1.onRelease = function () {
_root.p1poplimit++;
_root.save.p1poplimit = _root.p1poplimit;
};
b1.b1.onRollOver = (b1.b1.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b1.b1.onRollOut = (b1.b1.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b2.b2.onRelease = function () {
_root.p1poplimit--;
_root.save.p1poplimit = _root.p1poplimit;
};
b2.b2.onRollOver = (b2.b2.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b2.b2.onRollOut = (b2.b2.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b1.onEnterFrame = function () {
this._visible = _root.p1poplimit != 15;
};
b2.onEnterFrame = function () {
this._visible = _root.p1poplimit != 3;
};
Symbol 1213 MovieClip Frame 1
stop();
_root.team2Budget = _root.save.team2Budget;
b1.b1.onRelease = function () {
_root.team2Budget = _root.team2Budget - -250;
_root.save.team2Budget = _root.team2Budget;
};
b1.b1.onRollOver = (b1.b1.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b1.b1.onRollOut = (b1.b1.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b2.b2.onRelease = function () {
_root.team2Budget = _root.team2Budget - 250;
_root.save.team2Budget = _root.team2Budget;
};
b2.b2.onRollOver = (b2.b2.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b2.b2.onRollOut = (b2.b2.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b1.onEnterFrame = function () {
this._visible = _root.team2Budget != 5000;
};
b2.onEnterFrame = function () {
this._visible = _root.team2Budget != 1000;
};
Symbol 1216 MovieClip Frame 1
stop();
_root.team1Budget = _root.save.team1Budget;
b1.b1.onRelease = function () {
_root.team1Budget = _root.team1Budget - -250;
_root.save.team1Budget = _root.team1Budget;
};
b1.b1.onRollOver = (b1.b1.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b1.b1.onRollOut = (b1.b1.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b2.b2.onRelease = function () {
_root.team1Budget = _root.team1Budget - 250;
_root.save.team1Budget = _root.team1Budget;
};
b2.b2.onRollOver = (b2.b2.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b2.b2.onRollOut = (b2.b2.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b1.onEnterFrame = function () {
this._visible = _root.team1Budget != 5000;
};
b2.onEnterFrame = function () {
this._visible = _root.team1Budget != 1000;
};
Symbol 1240 MovieClip [SliderComponent] Frame 1
#initclip 6
function Slider() {
this.colObj = new Color(this.slide.slideColor);
this.colObj.setRGB(this.col);
}
Slider.prototype = new MovieClip();
Slider.prototype.changeHandler = null;
Slider.prototype.onLoad = function () {
if (_root._currentframe != 9) {
this.swapDepths(9999);
removeMovieClip(this);
}
this.slide.onRollOver = (this.slide.dragOver = function () {
_root[cursorName].gotoAndStop(2);
});
this.slide.onRollOut = (this.slide.dragOut = function () {
_root[cursorName].gotoAndStop(1);
});
this.slide.onPress = function () {
_root.thing = true;
};
this.slide.onMouseMove = function () {
if (_root.thing) {
var r = this._parent.range._width;
this._x = Math.max(0, Math.min(this._parent._xmouse, r));
if (this._parent.changeHandler != null) {
this._parent.changeHandler();
}
}
};
this.slide.onRelease = (this.slide.onReleaseOutside = function () {
_root.thing = false;
if (this._parent.changeHandler != null) {
this._parent.changeHandler();
}
});
};
Slider.prototype.getValue = function () {
var r = (this.max - this.min);
var v = (((this.slide._x / this.range._width) * r) + this.min);
return(Math.round(v));
};
Slider.prototype.setMin = function (min) {
this.min = min;
};
Slider.prototype.setMax = function (max) {
this.max = max;
};
Slider.prototype.setColor = function (col) {
this.colObj.setRGB(col);
};
Slider.prototype.setChangeHandler = function (funct) {
this.changeHandler = funct;
};
Object.registerClass("SliderComponent", Slider);
#endinitclip
Symbol 1252 MovieClip Frame 1
advancedSettingsButton.onRelease = function () {
_visible = false;
_root.advancedOptions._visible = true;
};
Symbol 1267 MovieClip Frame 1
stop();
offButton.onRelease = function () {
_root.cashBounty = (_root.save.cashBounty = false);
gotoAndStop (2);
_root.advancedOptions.b6.gotoAndStop(1);
_root[_root.cursorName].gotoAndStop(2);
};
offButton.onRollOver = (offButton.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
offButton.onRollOut = (offButton.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
Symbol 1278 MovieClip Frame 1
stop();
onButton.onRelease = function () {
_root.cashBounty = (_root.save.cashBounty = true);
gotoAndStop (2);
_root.advancedOptions.b7.gotoAndStop(1);
_root[_root.cursorName].gotoAndStop(2);
};
onButton.onRollOver = (onButton.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
onButton.onRollOut = (onButton.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
Symbol 1278 MovieClip Frame 2
_root.bountyQuantity = _root.save.bountyQuantity;
b1.b1.onRelease = function () {
_root.bountyQuantity++;
_root.save.bountyQuantity = _root.bountyQuantity;
};
b1.b1.onRollOver = (b1.b1.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b1.b1.onRollOut = (b1.b1.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b2.b2.onRelease = function () {
_root.bountyQuantity--;
_root.save.bountyQuantity = _root.bountyQuantity;
};
b2.b2.onRollOver = (b2.b2.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b2.b2.onRollOut = (b2.b2.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b1.onEnterFrame = function () {
this._visible = _root.bountyQuantity != 5;
};
b2.onEnterFrame = function () {
this._visible = _root.bountyQuantity != 1;
};
Symbol 1292 MovieClip Frame 1
stop();
_root.save.optionsFrame = _currentframe;
if (_root.save.gameMode == _root.gameMode) {
_root.matchVariable = _root.save.matchVariable;
_root.save.gameMode = _root.gameMode;
} else {
_root.matchVariable = 3;
_root.save.matchVariable = _root.matchVariable;
_root.save.gameMode = _root.gameMode;
}
b1.b1.onRelease = function () {
_root.matchVariable++;
};
b1.b1.onRollOver = (b1.b1.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b1.b1.onRollOut = (b1.b1.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b2.b2.onRelease = function () {
_root.matchVariable--;
};
b2.b2.onRollOver = (b2.b2.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b2.b2.onRollOut = (b2.b2.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b1.onEnterFrame = function () {
this._visible = _root.matchVariable != 5;
};
b2.onEnterFrame = function () {
this._visible = _root.matchVariable != 1;
};
Symbol 1292 MovieClip Frame 2
_root.save.optionsFrame = _currentframe;
if (_root.save.gameMode == _root.gameMode) {
_root.matchVariable = _root.save.matchVariable;
_root.save.gameMode = _root.gameMode;
} else {
_root.matchVariable = 3;
_root.save.matchVariable = _root.matchVariable;
_root.save.gameMode = _root.gameMode;
}
b1.b1.onRelease = function () {
_root.matchVariable++;
};
b1.b1.onRollOver = (b1.b1.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b1.b1.onRollOut = (b1.b1.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b2.b2.onRelease = function () {
_root.matchVariable--;
};
b2.b2.onRollOver = (b2.b2.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b2.b2.onRollOut = (b2.b2.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b1.onEnterFrame = function () {
this._visible = _root.matchVariable != 5;
};
b2.onEnterFrame = function () {
this._visible = _root.matchVariable != 1;
};
Symbol 1292 MovieClip Frame 3
_root.save.optionsFrame = _currentframe;
if (_root.save.gameMode == _root.gameMode) {
_root.matchVariable = _root.save.matchVariable;
_root.save.gameMode = _root.gameMode;
} else {
_root.matchVariable = 3;
_root.save.matchVariable = _root.matchVariable;
_root.save.gameMode = _root.gameMode;
}
_root.save.optionsFrame = _currentframe;
b1.b1.onRelease = function () {
_root.matchVariable++;
};
b1.b1.onRollOver = (b1.b1.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b1.b1.onRollOut = (b1.b1.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b2.b2.onRelease = function () {
_root.matchVariable--;
};
b2.b2.onRollOver = (b2.b2.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b2.b2.onRollOut = (b2.b2.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b1.onEnterFrame = function () {
this._visible = _root.matchVariable != 5;
};
b2.onEnterFrame = function () {
this._visible = _root.matchVariable != 1;
};
Symbol 1292 MovieClip Frame 4
_root.save.optionsFrame = _currentframe;
if (_root.save.gameMode == _root.gameMode) {
_root.matchVariable = _root.save.matchVariable;
_root.save.gameMode = _root.gameMode;
} else {
_root.matchVariable = 3;
_root.save.matchVariable = _root.matchVariable;
_root.save.gameMode = _root.gameMode;
}
b1.b1.onRelease = function () {
_root.matchVariable++;
};
b1.b1.onRollOver = (b1.b1.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b1.b1.onRollOut = (b1.b1.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b2.b2.onRelease = function () {
_root.matchVariable--;
};
b2.b2.onRollOver = (b2.b2.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b2.b2.onRollOut = (b2.b2.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b1.onEnterFrame = function () {
this._visible = _root.matchVariable != 5;
};
b2.onEnterFrame = function () {
this._visible = _root.matchVariable != 1;
};
Symbol 1292 MovieClip Frame 5
_root.save.optionsFrame = _currentframe;
if (_root.save.gameMode == _root.gameMode) {
_root.matchVariable = _root.save.matchVariable;
_root.save.gameMode = _root.gameMode;
} else {
_root.matchVariable = 10;
_root.save.matchVariable = _root.matchVariable;
_root.save.gameMode = _root.gameMode;
}
b1.b1.onRelease = function () {
_root.matchVariable = _root.matchVariable - -2;
};
b1.b1.onRollOver = (b1.b1.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b1.b1.onRollOut = (b1.b1.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b2.b2.onRelease = function () {
_root.matchVariable = _root.matchVariable - 2;
};
b2.b2.onRollOver = (b2.b2.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
b2.b2.onRollOut = (b2.b2.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
b1.onEnterFrame = function () {
this._visible = _root.matchVariable != 20;
};
b2.onEnterFrame = function () {
this._visible = _root.matchVariable != 2;
};
Symbol 1293 MovieClip Frame 1
basicSettingsButton.onRelease = function () {
_visible = false;
_root.basicOptions._visible = true;
};
Symbol 1300 MovieClip Frame 1
stop();
deathmatchButton.onRelease = function () {
_root.gameMode = "deathmatch";
_root.gameTypeDescription = _root.deathmatchDescription;
_root.b1.gotoAndStop(1);
_root.b2.gotoAndStop(1);
_root.b3.gotoAndStop(1);
_root.b4.gotoAndStop(1);
gotoAndStop (2);
_root.advancedOptions.matchVariableMC.gotoAndStop(5);
_root[_root.cursorName].gotoAndStop(1);
};
deathmatchButton.onRollOver = (deathmatchButton.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
deathmatchButton.onRollOut = (deathmatchButton.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
Symbol 1308 MovieClip Frame 1
stop();
powerBallButton.onRelease = function () {
_root.gameMode = "powerball";
_root.gameTypeDescription = _root.powerBallDescription;
_root.b1.gotoAndStop(1);
_root.b2.gotoAndStop(1);
_root.b3.gotoAndStop(1);
gotoAndStop (2);
_root.b5.gotoAndStop(1);
_root.advancedOptions.matchVariableMC.gotoAndStop(4);
_root[_root.cursorName].gotoAndStop(1);
};
powerBallButton.onRollOver = (powerBallButton.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
powerBallButton.onRollOut = (powerBallButton.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
Symbol 1315 MovieClip Frame 1
stop();
captureTheFlagButton.onRelease = function () {
_root.gameMode = "capturetheflag";
_root.gameTypeDescription = _root.captureTheFlagDescription;
_root.b1.gotoAndStop(1);
_root.b2.gotoAndStop(1);
gotoAndStop (2);
_root.b4.gotoAndStop(1);
_root.b5.gotoAndStop(1);
_root.advancedOptions.matchVariableMC.gotoAndStop(3);
_root[_root.cursorName].gotoAndStop(1);
};
captureTheFlagButton.onRollOver = (captureTheFlagButton.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
captureTheFlagButton.onRollOut = (captureTheFlagButton.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
Symbol 1322 MovieClip Frame 1
stop();
kingOfTheHillButton.onRelease = function () {
_root.gameMode = "kingofthehill";
_root.gameTypeDescription = _root.kingOfTheHillDescription;
_root.b1.gotoAndStop(1);
gotoAndStop (2);
_root.b3.gotoAndStop(1);
_root.b4.gotoAndStop(1);
_root.b5.gotoAndStop(1);
_root.advancedOptions.matchVariableMC.gotoAndStop(2);
_root[_root.cursorName].gotoAndStop(1);
};
kingOfTheHillButton.onRollOver = (kingOfTheHillButton.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
kingOfTheHillButton.onRollOut = (kingOfTheHillButton.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
Symbol 1328 MovieClip Frame 1
stop();
classicButton.onRelease = function () {
_root.gameMode = "classic";
_root.gameTypeDescription = _root.classicDescription;
gotoAndStop (2);
_root.b2.gotoAndStop(1);
_root.b3.gotoAndStop(1);
_root.b4.gotoAndStop(1);
_root.b5.gotoAndStop(1);
_root.advancedOptions.matchVariableMC.gotoAndStop(1);
_root[_root.cursorName].gotoAndStop(1);
};
classicButton.onRollOver = (classicButton.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
classicButton.onRollOut = (classicButton.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
Symbol 1342 MovieClip Frame 1
stop();
Symbol 1368 MovieClip Frame 1
stop();
Symbol 1387 MovieClip Frame 1
stop();
Symbol 1387 MovieClip Frame 2
nextButton.onRollOver = (nextButton.onDragOver = function () {
_root[_root.cursorName].gotoAndStop(2);
});
nextButton.onRollOut = (nextButton.onDragOut = function () {
_root[_root.cursorName].gotoAndStop(1);
});
nextButton.onRelease = function () {
_root.save.level = (_root.level = 1);
_root.save.flagX = (_root.flagX = _root.squares._x);
_root.save.flagY = (_root.flagY = _root.squares._y + 20);
_root.gotoAndStop(7);
};
Symbol 1392 MovieClip Frame 1
stop();
Symbol 1427 Button
on (release) {
save.quality = "LOW";
pointyThingy2.gotoAndStop(3);
}
Symbol 1428 Button
on (release) {
save.quality = "HIGH";
pointyThingy2.gotoAndStop(1);
}
Symbol 1429 Button
on (release) {
save.quality = "MEDIUM";
pointyThingy2.gotoAndStop(2);
}
Symbol 1437 Button
on (release) {
System.showSettings(1);
gotoAndStop (11);
}
Symbol 1442 Button
on (release) {
_root.savefile = SharedObject.getLocal("Commando3");
_root.save = _root.savefile.data;
saveResult = _root.savefile.flush();
if (saveResult) {
_root.gotoAndStop(2);
} else if (saveResult == false) {
_root.gotoAndStop(22);
}
}
Symbol 1443 MovieClip Frame 10
stop();
Symbol 1444 Button
on (release) {
System.showSettings(1);
gotoAndStop (11);
}
Symbol 1446 MovieClip Frame 10
stop();
Symbol 1495 MovieClip Frame 1
stop();
Symbol 1531 MovieClip Frame 2049
stop();
Symbol 1553 MovieClip Frame 1
stopAllSounds();
Symbol 1553 MovieClip Frame 2
stopAllSounds();
_root.gotoAndStop(3);