Frame 1
if (_framesloaded >= _totalframes) {
gotoAndStop (2);
} else {
gotoAndPlay (1);
}
Frame 2
stop();
_global.StartingPoints = 20000;
_global.GameSpeed = 1;
_global.CurrentPoints = StartingPoints;
_global.TotalPoints = 0;
_global.CurrentRound = 1;
_global.bHelp = true;
_global.DragActive = false;
_global.DragObject = null;
_global.RoundActive = false;
_global.ShipSpeed = 8;
_global.WarShipSpeed = 5;
_global.RaiderSpeed = 5;
_global.CannonBallSpeed = 10;
_global.CannonBallDelay = 5;
_global.WarriorSpeed = 7;
_global.ShipValue = 100;
_global.ShipLoadValue = 500;
_global.RunnerValue = 100;
_global.MasonValue = 200;
_global.DemoValue = 300;
_global.AssassinValue = 400;
_global.WarShipValue = 500;
_global.MarshDepth = 100;
_global.TidalPoolDepth = 200;
_global.CannonBallDepth = 300;
_global.ECannonBallDepth = 400;
_global.CannonDepth = 500;
_global.WallDepth = 600;
_global.ShipDepth = 700;
_global.WarShipDepth = 800;
_global.RaiderDepth = 900;
_global.DamageDepth = 1000;
_global.WDamageDepth = 1100;
_global.WarriorTargetDepth = 1200;
_global.WarriorDepth = 1300;
_global.MessageBoxDepth = 1400;
_global.MarshPrice = 1000;
_global.WallPrice = 2000;
_global.WarriorPrice = 3000;
_global.TidalPoolPrice = 1500;
_global.CannonPrice = 15000;
_global.CannonBallArray = [];
_global.CannonBallArrayUBound = -1;
_global.ECannonBallArray = [];
_global.ECannonBallArrayUBound = -1;
_global.ShipArray = [];
_global.ShipArrayUBound = -1;
_global.RaiderArray = [];
_global.RaiderArrayUBound = -1;
_global.CannonArray = [];
_global.CannonArrayUBound = -1;
_global.WallArray = [];
_global.WallArrayUBound = -1;
_global.TargetArray = [];
_global.TargetArrayUBound = -1;
_global.ETargetArray = [];
_global.ETargetArrayUBound = -1;
_global.WarriorArray = [];
_global.WarriorArrayUBound = -1;
_global.WarShipArray = [];
_global.WarShipArrayUBound = -1;
_global.MarshArray = [];
_global.MarshArrayUBound = -1;
_global.TidalPoolArray = [];
_global.TidalPoolArrayUBound = -1;
_global.Keyboard = new Object();
Key.addListener(Keyboard);
_global.Keyboard.onKeyDown = function () {
if (Key.isDown(82) && (DragActive)) {
if (DragObject._name.indexOf("TidalPool") < 0) {
DragObject._rotation = DragObject._rotation + 90;
}
}
if (Key.isDown(69) && (DragActive)) {
if (DragObject._name.indexOf("TidalPool") < 0) {
DragObject._rotation = DragObject._rotation - 90;
}
}
};
_global.OnLand = function (TestObject) {
if (((((((TestObject.hitTest(_root.Land.HotSpot1) || (TestObject.hitTest(_root.Land.HotSpot2))) || (TestObject.hitTest(_root.Land.HotSpot3))) || (TestObject.hitTest(_root.Land.HotSpot4))) && (!TestObject.hitTest(_root.Land.WaterSpot1))) && (!TestObject.hitTest(_root.Land.WaterSpot2))) && (!TestObject.hitTest(_root.Land.WaterSpot3))) && (!TestObject.hitTest(_root.Land.WaterSpot4))) {
return(true);
}
return(false);
};
_global.ShipOnLand = function (TestObject) {
if (((TestObject.hitTest(_root.Land.HotSpot1) || (TestObject.hitTest(_root.Land.HotSpot2))) || (TestObject.hitTest(_root.Land.HotSpot3))) || (TestObject.hitTest(_root.Land.HotSpot4))) {
return(true);
}
return(false);
};
_global.ProcessGameLoop = function () {
PackCannonBallArray();
PackECannonBallArray();
PackShipArray();
PackWarShipArray();
PackRaiderArray();
PackWallArray();
PackWarriorArray();
PackCannonArray();
PackMarshArray();
PackTidalPoolArray();
if (CannonArrayUBound == -1) {
EndGame("All your cannons were destroyed.");
}
TrackTargets();
if (((TargetArrayUBound == -1) && (ShipArrayUBound == -1)) && (WarShipArrayUBound == -1)) {
EndRound();
return(undefined);
}
HandleWarriors();
HandleCannons();
HandleCannonBalls();
HandleECannonBalls();
HandleTransportShips();
HandleWarShips();
HandleRaiders();
};
_global.ToDegrees = function (radians) {
return(57.2957795130823 * radians);
};
_global.ToRadians = function (degrees) {
return((Math.PI/180) * degrees);
};
_global.RotateObject = function (oObject, Target, bPlus90) {
if (bPlus90 == true) {
oObject._rotation = 15 - ToDegrees(Math.atan2(Target._x - oObject._x, Target._y - oObject._y));
} else {
oObject._rotation = -ToDegrees(Math.atan2(oObject._x - Target._x, oObject._y - Target._y));
}
};
_global.WallHit = function (Wall, Hitter) {
if (Wall._currentframe == Wall._totalframes) {
Wall.removeMovieClip();
}
Wall.gotoAndStop(Wall._currentframe + 1);
Hitter.removeMovieClip();
};
_global.CannonHit = function (Cannon, Hitter) {
if (Cannon._currentframe == Cannon._totalframes) {
Cannon.removeMovieClip();
}
Cannon.gotoAndStop(Cannon._currentframe + 1);
Hitter.removeMovieClip();
};
_global.WarriorHit = function (Warrior, Hitter) {
if (Warrior._currentframe == Warrior._totalframes) {
Warrior.StartingTarget.removeMovieClip();
Warrior.removeMovieClip();
}
Warrior.gotoAndStop(Warrior._currentframe + 1);
Hitter.removeMovieClip();
};
_global.RaiderHit = function (Raider, Hitter, bRemoveHitter) {
switch (Raider.RType) {
case "RUNNER" :
CurrentPoints = CurrentPoints + RunnerValue;
TotalPoints = TotalPoints + RunnerValue;
break;
case "MASON" :
CurrentPoints = CurrentPoints + MasonValue;
TotalPoints = TotalPoints + MasonValue;
break;
case "DEMO" :
CurrentPoints = CurrentPoints + DemoValue;
TotalPoints = TotalPoints + DemoValue;
break;
case "ASSASSIN" :
CurrentPoints = CurrentPoints + AssassinValue;
TotalPoints = TotalPoints + AssassinValue;
}
Raider.removeMovieClip();
if (bRemoveHitter == true) {
Hitter.removeMovieClip();
}
};
_global.ShipHit = function (Ship, Hitter, Damage, bRemoveHitter) {
Ship.Damage.gotoAndStop(Ship.Damage._currentframe + Damage);
if (Ship.Damage._currentframe >= Ship.Damage._totalframes) {
if (Ship._name.indexOf("War") >= 0) {
TotalPoints = TotalPoints + WarShipValue;
CurrentPoints = CurrentPoints + WarShipValue;
} else {
TotalPoints = TotalPoints + ShipValue;
CurrentPoints = CurrentPoints + ShipValue;
if (Ship.Load != 0) {
TotalPoints = TotalPoints + ShipLoadValue;
CurrentPoints = CurrentPoints + ShipLoadValue;
}
}
Ship.Damage.removeMovieClip();
Ship.removeMovieClip();
}
if (bRemoveHitter == true) {
Hitter.removeMovieClip();
}
};
_global.PackCannonBallArray = function () {
var i = 0;
var NewArray = [];
var NewUBound = -1;
i = 0;
while (i <= CannonBallArrayUBound) {
if (eval ("_root.CannonBall" + i)._name != undefined) {
NewUBound++;
NewArray[NewUBound] = eval ("_root.CannonBall" + i);
NewArray[NewUBound]._name = "CannonBall" + NewUBound;
NewArray[NewUBound].swapDepths(CannonBallDepth + NewUBound);
}
i++;
}
CannonBallArray = NewArray;
CannonBallArrayUBound = NewUBound;
};
_global.PackECannonBallArray = function () {
var i = 0;
var NewArray = [];
var NewUBound = -1;
i = 0;
while (i <= ECannonBallArrayUBound) {
if (eval ("_root.ECannonBall" + i)._name != undefined) {
NewUBound++;
NewArray[NewUBound] = eval ("_root.ECannonBall" + i);
NewArray[NewUBound]._name = "ECannonBall" + NewUBound;
NewArray[NewUBound].swapDepths(ECannonBallDepth + NewUBound);
}
i++;
}
ECannonBallArray = NewArray;
ECannonBallArrayUBound = NewUBound;
};
_global.PackWarriorArray = function () {
var i = 0;
var NewArray = [];
var NewUBound = -1;
i = 0;
while (i <= WarriorArrayUBound) {
if (eval ("_root.Warrior" + i)._name != undefined) {
NewUBound++;
NewArray[NewUBound] = eval ("_root.Warrior" + i);
NewArray[NewUBound]._name = "Warrior" + NewUBound;
NewArray[NewUBound].swapDepths(WarriorDepth + NewUBound);
}
i++;
}
WarriorArray = NewArray;
WarriorArrayUBound = NewUBound;
};
_global.PackMarshArray = function () {
var i = 0;
var NewArray = [];
var NewUBound = -1;
i = 0;
while (i <= MarshArrayUBound) {
if (eval ("_root.Marsh" + i)._name != undefined) {
NewUBound++;
NewArray[NewUBound] = eval ("_root.Marsh" + i);
NewArray[NewUBound]._name = "Marsh" + NewUBound;
NewArray[NewUBound].swapDepths(MarshDepth + NewUBound);
}
i++;
}
MarshArray = NewArray;
MarshArrayUBound = NewUBound;
};
_global.PackTidalPoolArray = function () {
var i = 0;
var NewArray = [];
var NewUBound = -1;
i = 0;
while (i <= TidalPoolArrayUBound) {
if (eval ("_root.TidalPool" + i)._name != undefined) {
NewUBound++;
NewArray[NewUBound] = eval ("_root.TidalPool" + i);
NewArray[NewUBound]._name = "TidalPool" + NewUBound;
NewArray[NewUBound].swapDepths(TidalPoolDepth + NewUBound);
}
i++;
}
TidalPoolArray = NewArray;
TidalPoolArrayUBound = NewUBound;
};
_global.PackShipArray = function () {
var i = 0;
var NewArray = [];
var NewUBound = -1;
i = 0;
while (i <= ShipArrayUBound) {
if (eval ("_root.Ship" + i)._name != undefined) {
NewUBound++;
NewArray[NewUBound] = eval ("_root.Ship" + i);
NewArray[NewUBound]._name = "Ship" + NewUBound;
}
i++;
}
ShipArray = NewArray;
ShipArrayUBound = NewUBound;
};
_global.PackWarShipArray = function () {
var i = 0;
var NewArray = [];
var NewUBound = -1;
i = 0;
while (i <= WarShipArrayUBound) {
if (eval ("_root.WShip" + i)._name != undefined) {
NewUBound++;
NewArray[NewUBound] = eval ("_root.WShip" + i);
NewArray[NewUBound]._name = "WShip" + NewUBound;
}
i++;
}
WarShipArray = NewArray;
WarShipArrayUBound = NewUBound;
};
_global.PackRaiderArray = function () {
var i = 0;
var j = 0;
var NewArray = [];
var NewUBound = -1;
var oldRaiderName = "";
i = 0;
while (i <= RaiderArrayUBound) {
if (eval ("_root.Raider" + i)._name != undefined) {
NewUBound++;
NewArray[NewUBound] = eval ("_root.Raider" + i);
oldRaiderName = NewArray[NewArrayUBound];
NewArray[NewUBound]._name = "Raider" + NewUBound;
NewArray[NewUBound].swapDepths(RaiderDepth + NewUBound);
j = 0;
while (j <= WarriorArrayUBound) {
if (WarriorArray[j].Target == oldRaiderName) {
WarriorArray[j].Target = NewArray[NewArrayUBound];
}
j++;
}
} else {
j = 0;
while (j <= WarriorArrayUBound) {
if ((WarriorArray[j].Target = eval ("_root.Raider" + i))) {
WarriorArray[j].Target = undefined;
}
j++;
}
}
i++;
}
RaiderArray = NewArray;
RaiderArrayUBound = NewUBound;
};
_global.PackWallArray = function () {
var i = 0;
var NewArray = [];
var NewUBound = -1;
i = 0;
while (i <= WallArrayUBound) {
if (eval ("_root.Wall" + i)._name != undefined) {
NewUBound++;
NewArray[NewUBound] = eval ("_root.Wall" + i);
NewArray[NewUBound]._name = "Wall" + NewUBound;
NewArray[NewUBound].swapDepths(WallDepth + NewUBound);
}
i++;
}
WallArray = NewArray;
WallArrayUBound = NewUBound;
};
_global.PackCannonArray = function () {
var i = 0;
var NewArray = [];
var NewUBound = -1;
i = 0;
while (i <= CannonArrayUBound) {
if (eval ("_root.Cannon" + i)._name != undefined) {
NewUBound++;
NewArray[NewUBound] = eval ("_root.Cannon" + i);
NewArray[NewUBound]._name = "Cannon" + NewUBound;
NewArray[NewUBound].swapDepths(CannonDepth + NewUBound);
}
i++;
}
CannonArray = NewArray;
CannonArrayUBound = NewUBound;
};
_global.HandleECannonBalls = function () {
var i = 0;
var j = 0;
i = 0;
while (i <= ECannonBallArrayUBound) {
if (((ECannonBallArray[i]._x <= 0) || (ECannonBallArray[i]._y > Stage.height)) || (ECannonBallArray[i]._y < 0)) {
ECannonBallArray[i].removeMovieClip();
}
ECannonBallArray[i]._x = ECannonBallArray[i]._x + ECannonBallArray[i].XSpeed;
ECannonBallArray[i]._y = ECannonBallArray[i]._y + ECannonBallArray[i].YSpeed;
j = 0;
while (j <= CannonArrayUBound) {
if (ECannonBallArray[i].hitTest(CannonArray[j])) {
CannonHit(CannonArray[j], ECannonBallArray[i]);
}
j++;
}
j = 0;
while (j <= WarriorArrayUBound) {
if (ECannonBallArray[i].hitTest(WarriorArray[j])) {
WarriorHit(WarriorArray[j], ECannonBallArray[i]);
}
j++;
}
j = 0;
while (j <= WallArrayUBound) {
if (ECannonBallArray[i].hitTest(WallArray[j])) {
WallHit(WallArray[j], ECannonBallArray[i]);
}
j++;
}
j = 0;
while (j <= ShipArrayUBound) {
if (ECannonBallArray[i].hitTest(ShipArray[j])) {
ShipHit(ShipArray[j], ECannonBallArray[i], 2, true);
}
j++;
}
j = 0;
while (j <= RaiderArrayUBound) {
if (ECannonBallArray[i].hitTest(RaiderArray[j])) {
RaiderHit(RaiderArray[j], ECannonBallArray[i], true);
}
j++;
}
i++;
}
};
_global.HandleCannonBalls = function () {
var i = 0;
var j = 0;
i = 0;
while (i <= CannonBallArrayUBound) {
if (((CannonBallArray[i]._x > Stage.width) || (CannonBallArray[i]._y > Stage.height)) || (CannonBallArray[i]._y < 0)) {
CannonBallArray[i].removeMovieClip();
}
CannonBallArray[i]._x = CannonBallArray[i]._x + CannonBallArray[i].XSpeed;
CannonBallArray[i]._y = CannonBallArray[i]._y + CannonBallArray[i].YSpeed;
j = 0;
while (j <= ShipArrayUBound) {
if (CannonBallArray[i].hitTest(ShipArray[j])) {
ShipHit(ShipArray[j], CannonBallArray[i], 2, true);
}
j++;
}
j = 0;
while (j <= WarShipArrayUBound) {
if (CannonBallArray[i].hitTest(WarShipArray[j])) {
ShipHit(WarShipArray[j], CannonBallArray[i], 1, true);
}
j++;
}
j = 0;
while (j <= RaiderArrayUBound) {
if (CannonBallArray[i].hitTest(RaiderArray[j])) {
RaiderHit(RaiderArray[j], CannonBallArray[i], true);
}
j++;
}
j = 0;
while (j <= WallArrayUBound) {
if (CannonBallArray[i].hitTest(WallArray[j])) {
WallHit(WallArray[j], CannonBallArray[i]);
}
j++;
}
j = 0;
while (j <= WarriorArrayUBound) {
if (CannonBallArray[i].hitTest(WarriorArray[j])) {
WarriorHit(WarriorArray[j], CannonBallArray[i]);
}
j++;
}
i++;
}
};
_global.FireCannon = function (Cannon, CannonTarget) {
RotateObject(Cannon, CannonTarget, false);
CannonBallArrayUBound++;
_root.MasterCannonBall.duplicateMovieClip("CannonBall" + CannonBallArrayUBound, CannonBallDepth + CannonBallArrayUBound);
CannonBallArray[CannonBallArrayUBound] = eval ("_root.CannonBall" + CannonBallArrayUBound);
CannonBallArray[CannonBallArrayUBound]._x = Cannon._x;
CannonBallArray[CannonBallArrayUBound]._y = Cannon._y;
SetDirectionalSpeed(CannonBallArray[CannonBallArrayUBound], CannonTarget, CannonBallSpeed);
Cannon.FireDelay = CannonBallDelay;
};
_global.HandleTransportShips = function () {
var i = 0;
var j = 0;
i = 0;
while (i <= ShipArrayUBound) {
j = 0;
while (j <= TidalPoolArrayUBound) {
if (ShipArray[i].hitTest(TidalPoolArray[j])) {
ShipHit(ShipArray[i], TidalPoolArray[j], 20, false);
}
j++;
}
if (ShipOnLand(ShipArray[i])) {
if ((ShipArray[i].RaiderLoad > 0) && ((ShipArray[i].DropLoad <= 0) || (ShipArray[i].DropLoad == undefined))) {
CreateRaider(ShipArray[i]);
ShipArray[i].RaiderLoad--;
ShipArray[i].DropLoad = 5;
} else {
ShipArray[i].DropLoad--;
}
} else if (ShipArray[i].LaunchDelay <= 0) {
ShipArray[i]._x = ShipArray[i]._x - ShipArray[i].Speed;
ShipArray[i].Damage._x = ShipArray[i].Damage._x - ShipArray[i].Speed;
} else {
ShipArray[i].LaunchDelay--;
}
i++;
}
};
_global.HandleWarShips = function () {
var i = 0;
i = 0;
while (i <= WarShipArrayUBound) {
j = 0;
while (j <= TidalPoolArrayUBound) {
if (WarShipArray[i].hitTest(TidalPoolArray[j])) {
ShipHit(WarShipArray[i], TidalPoolArray[j], 20, false);
}
j++;
}
if (WarShipArray[i].LaunchDelay <= 0) {
if (WarShipArray[i]._x > (Stage.width * 0.75)) {
WarShipArray[i]._x = WarShipArray[i]._x - WarShipArray[i].Speed;
WarShipArray[i].Damage._x = WarShipArray[i].Damage._x - WarShipArray[i].Speed;
} else if (WarShipArray[i].FireDelay <= 0) {
ECannonBallArrayUBound++;
_root.MasterECannonBall.duplicateMovieClip("ECannonBall" + ECannonBallArrayUBound, ECannonBallDepth + ECannonBallArrayUBound);
ECannonBallArray[ECannonBallArrayUBound] = eval ("_root.ECannonBall" + ECannonBallArrayUBound);
ECannonBallArray[ECannonBallArrayUBound]._x = WarShipArray[i]._x - WarShipArray[i].width;
ECannonBallArray[ECannonBallArrayUBound]._y = WarShipArray[i]._y;
SetDirectionalSpeed(ECannonBallArray[ECannonBallArrayUBound], ETargetArray[Math.round(Math.random() * ETargetArrayUBound)], CannonBallSpeed);
if (Math.round(Math.random()) == 0) {
WarShipArray[i]._y = WarShipArray[i]._y - WarShipSpeed;
} else {
WarShipArray[i]._y = WarShipArray[i]._y + WarShipSpeed;
}
WarShipArray[i].FireDelay = CannonBallDelay;
} else {
WarShipArray[i].FireDelay--;
}
} else {
WarShipArray[i].LaunchDelay--;
}
i++;
}
};
_global.HandleRaiders = function () {
var i = 0;
var j = 0;
i = 0;
while (i <= RaiderArrayUBound) {
if (RaiderArray[i].Target._name == undefined) {
RaiderArray[i].Target = GetRaiderTarget(RaiderArray[i]);
}
SetDirectionalSpeed(RaiderArray[i], RaiderArray[i].Target, RaiderSpeed);
RotateObject(RaiderArray[i], RaiderArray[i].Target, true);
if (eval ("_root.Raider" + i).hitTest(_root.MasterFlag)) {
EndGame("Your flag was captured by the invading raiders.");
}
j = 0;
while (j <= CannonArrayUBound) {
if (RaiderArray[i].hitTest(CannonArray[j]) && (RaiderArray[i].RType == "DEMO")) {
CannonHit(CannonArray[j], RaiderArray[i]);
}
j++;
}
j = 0;
while (j <= WarriorArrayUBound) {
if (RaiderArray[i].hitTest(WarriorArray[j]) && (RaiderArray[i].RType == "ASSASSIN")) {
WarriorHit(WarriorArray[j], RaiderArray[i]);
}
j++;
}
j = 0;
while (j <= WallArrayUBound) {
if (RaiderArray[i].hitTest(WallArray[j])) {
if (RaiderArray[i].RType == "MASON") {
WallHit(WallArray[j], RaiderArray[i]);
} else {
RaiderArray[i].XSpeed = 0;
RaiderArray[i].YSpeed = 0;
}
}
j++;
}
j = 0;
while (j <= MarshArrayUBound) {
if (RaiderArray[i].hitTest(MarshArray[j])) {
RaiderArray[i].XSpeed = RaiderArray[i].XSpeed * 0.5;
RaiderArray[i].YSpeed = RaiderArray[i].YSpeed * 0.5;
}
j++;
}
RaiderArray[i]._x = RaiderArray[i]._x + RaiderArray[i].XSpeed;
RaiderArray[i]._y = RaiderArray[i]._y + RaiderArray[i].YSpeed;
i++;
}
};
_global.HandleWarriors = function () {
var i = 0;
var j = 0;
var oldX = 0;
var oldY = 0;
i = 0;
while (i <= WarriorArrayUBound) {
if (RaiderArrayUBound == -1) {
WarriorArray[i].Target = WarriorArray[i].StartingTarget;
} else if ((WarriorArray[i].Target._name == undefined) || (WarriorArray[i].Target == WarriorArray[i].StartingTarget)) {
WarriorArray[i].Target = RaiderArray[Math.round(Math.random() * RaiderArrayUBound)];
}
if ((WarriorArray[i].Target == WarriorArray[i].StartingTarget) && (WarriorArray[i].hitTest(WarriorArray[i].StartingTarget.HotSpot))) {
WarriorArray[i].XSpeed = 0;
WarriorArray[i].YSpeed = 0;
} else {
SetDirectionalSpeed(WarriorArray[i], WarriorArray[i].Target, WarriorSpeed);
}
j = 0;
while (j <= RaiderArrayUBound) {
if (WarriorArray[i].hitTest(RaiderArray[j])) {
RaiderHit(RaiderArray[j], WarriorArray[i], false);
}
j++;
}
oldX = WarriorArray[i]._x;
oldY = WarriorArray[i]._y;
WarriorArray[i]._x = WarriorArray[i]._x + WarriorArray[i].XSpeed;
WarriorArray[i]._y = WarriorArray[i]._y + WarriorArray[i].YSpeed;
j = 0;
while (j <= WallArrayUBound) {
if (WarriorArray[i].hitTest(WallArray[j])) {
WarriorArray[i]._x = oldX;
WarriorArray[i]._y = oldY;
WarriorArray[i].XSpeed = 0;
WarriorArray[i].YSpeed = 0;
WarriorArray[i].Target = RaiderArray[Math.round(Math.random() * RaiderArrayUBound)];
}
j++;
}
i++;
}
};
_global.HandleCannons = function () {
var i = 0;
i = 0;
while (i <= CannonArrayUBound) {
if ((CannonArray[i].FireDelay <= 0) && (TargetArrayUBound >= 0)) {
CannonTarget = TargetArray[Math.round(Math.random() * TargetArrayUBound)];
FireCannon(CannonArray[i], CannonTarget);
} else {
CannonArray[i].FireDelay--;
}
i++;
}
};
_global.TrackTargets = function () {
var i = 0;
TargetArray = [];
TargetArrayUBound = -1;
ETargetArray = [];
ETargetArrayUBound = -1;
i = 0;
while (i <= ShipArrayUBound) {
if (ShipArray[i].LaunchDelay == 0) {
TargetArrayUBound++;
TargetArray[TargetArrayUBound] = ShipArray[i];
}
i++;
}
i = 0;
while (i <= WarShipArrayUBound) {
if (WarShipArray[i].LaunchDelay == 0) {
TargetArrayUBound++;
TargetArray[TargetArrayUBound] = WarShipArray[i];
}
i++;
}
i = 0;
while (i <= RaiderArrayUBound) {
TargetArrayUBound++;
TargetArray[TargetArrayUBound] = RaiderArray[i];
i++;
}
i = 0;
while (i <= CannonArrayUBound) {
ETargetArrayUBound++;
ETargetArray[ETargetArrayUBound] = CannonArray[i];
i++;
}
i = 0;
while (i <= WarriorArrayUBound) {
ETargetArrayUBound++;
ETargetArray[ETargetArrayUBound] = WarriorArray[i];
i++;
}
i = 0;
while (i <= WallArrayUBound) {
ETargetArrayUBound++;
ETargetArray[ETargetArrayUBound] = WallArray[i];
i++;
}
};
_global.CreateRaider = function (FromShip) {
var RaiderType = "";
var RndRaider = 0;
RaiderArrayUBound++;
if (CurrentRound < 5) {
RndRaider = 1;
} else if (CurrentRound < 10) {
RndRaider = Math.round(Math.random() * 1) + 1;
} else if (CurrentRound < 15) {
RndRaider = Math.round(Math.random() * 2) + 1;
} else {
RndRaider = Math.round(Math.random() * 3) + 1;
}
switch (RndRaider) {
case 1 :
_root.MasterRunner.duplicateMovieClip("Raider" + RaiderArrayUBound, RaiderDepth + RaiderArrayUBound);
RaiderType = "RUNNER";
break;
case 2 :
_root.MasterMason.duplicateMovieClip("Raider" + RaiderArrayUBound, RaiderDepth + RaiderArrayUBound);
RaiderType = "MASON";
break;
case 3 :
_root.MasterDemo.duplicateMovieClip("Raider" + RaiderArrayUBound, RaiderDepth + RaiderArrayUBound);
RaiderType = "DEMO";
break;
case 4 :
_root.MasterAssassin.duplicateMovieClip("Raider" + RaiderArrayUBound, RaiderDepth + RaiderArrayUBound);
RaiderType = "ASSASSIN";
}
RaiderArray[RaiderArrayUBound] = eval ("_root.Raider" + RaiderArrayUBound);
RaiderArray[RaiderArrayUBound]._x = FromShip._x - (_root.MasterShip._width / 2);
RaiderArray[RaiderArrayUBound]._y = (FromShip._y + (_root.MasterShip._height / 2)) - (_root.MasterRaider._height / 2);
RaiderArray[RaiderArrayUBound].RType = RaiderType;
RaiderArray[RaiderArrayUBound].Target = GetRaiderTarget(RaiderArray[RaiderArrayUBound]);
};
_global.GetRaiderTarget = function (Raider) {
switch (Raider.RType) {
case "RUNNER" :
return(_root.MasterFlag);
case "MASON" :
if (WallArrayUBound >= 0) {
return(WallArray[Math.round(Math.random() * WallArrayUBound)]);
}
return(_root.MasterFlag);
case "DEMO" :
if (CannonArrayUBound >= 0) {
return(CannonArray[Math.round(Math.random() * CannonArrayUBound)]);
}
return(_root.MasterFlag);
case "ASSASSIN" :
if (WarriorArrayUBound >= 0) {
return(WarriorArray[Math.round(Math.random() * WarriorArrayUBound)]);
}
return(_root.MasterFlag);
}
};
_global.SetDirectionalSpeed = function (Object1, Object2, Speed) {
var A = 0;
var C = 0;
A = Math.atan2(Object1._x - Object2._x, Object1._y - Object2._y);
C = (Math.PI/2) - A;
Object1.XSpeed = (-Speed) * Math.sin(A);
Object1.YSpeed = (-Speed) * Math.sin(C);
};
_global.PurchaseCannon = function () {
if ((CurrentPoints >= CannonPrice) && (DragActive != true)) {
if (CannonArrayUBound >= 9) {
_root.MessageBox.MessageText.text = "You may only purchase 10 cannons.";
_root.MessageBox._visible = true;
} else {
CannonArrayUBound++;
CurrentPoints = CurrentPoints - CannonPrice;
RefreshPurchaseScreen();
duplicateMovieClip ("_root.MasterCannon", "Cannon" + CannonArrayUBound, CannonDepth + CannonArrayUBound);
CannonArray[CannonArrayUBound] = eval ("_root.Cannon" + CannonArrayUBound);
CannonArray[CannonArrayUBound].startDrag(true);
CannonArray[CannonArrayUBound].FireDelay = 0;
DragActive = true;
DragObject = CannonArray[CannonArrayUBound];
}
}
};
_global.PurchaseWall = function () {
if ((CurrentPoints >= WallPrice) && (DragActive != true)) {
if (WallArrayUBound >= 99) {
_root.MessageBox.MessageText.text = "You may only purchase 100 walls.";
_root.MessageBox._visible = true;
} else {
WallArrayUBound++;
CurrentPoints = CurrentPoints - WallPrice;
RefreshPurchaseScreen();
duplicateMovieClip ("_root.MasterWall", "Wall" + WallArrayUBound, WallDepth + WallArrayUBound);
WallArray[WallArrayUBound] = eval ("_root.Wall" + WallArrayUBound);
WallArray[WallArrayUBound].startDrag(true);
DragActive = true;
DragObject = WallArray[WallArrayUBound];
}
}
};
_global.PurchaseTidalPool = function () {
if ((CurrentPoints >= TidalPoolPrice) && (DragActive != true)) {
if (TidalPoolArrayUBound >= 1) {
_root.MessageBox.MessageText.text = "You may only purchase 2 tidal pools per round.";
_root.MessageBox._visible = true;
} else {
TidalPoolArrayUBound++;
CurrentPoints = CurrentPoints - TidalPoolPrice;
RefreshPurchaseScreen();
duplicateMovieClip ("_root.MasterTidalPool", "TidalPool" + TidalPoolArrayUBound, TidalPoolDepth + TidalPoolArrayUBound);
TidalPoolArray[TidalPoolArrayUBound] = eval ("_root.TidalPool" + TidalPoolArrayUBound);
TidalPoolArray[TidalPoolArrayUBound].startDrag(true);
DragActive = true;
DragObject = TidalPoolArray[TidalPoolArrayUBound];
}
}
};
_global.PurchaseWarrior = function () {
if ((CurrentPoints >= WarriorPrice) && (DragActive != true)) {
if (WarriorArrayUBound >= 99) {
_root.MessageBox.MessageText.text = "You may only purchase 100 warriors.";
_root.MessageBox._visible = true;
} else {
WarriorArrayUBound++;
CurrentPoints = CurrentPoints - WarriorPrice;
RefreshPurchaseScreen();
duplicateMovieClip ("_root.MasterWarrior", "Warrior" + WarriorArrayUBound, WarriorDepth + WarriorArrayUBound);
WarriorArray[WarriorArrayUBound] = eval ("_root.Warrior" + WarriorArrayUBound);
WarriorArray[WarriorArrayUBound].startDrag(true);
DragActive = true;
DragObject = WarriorArray[WarriorArrayUBound];
}
}
};
_global.PurchaseMarsh = function () {
if ((CurrentPoints >= MarshPrice) && (DragActive != true)) {
if (MarshArrayUBound >= 99) {
_root.MessageBox.MessageText.text = "You may only purchase 100 marshes.";
_root.MessageBox._visible = true;
} else {
MarshArrayUBound++;
CurrentPoints = CurrentPoints - MarshPrice;
RefreshPurchaseScreen();
duplicateMovieClip ("_root.MasterMarsh", "Marsh" + MarshArrayUBound, MarshDepth + MarshArrayUBound);
MarshArray[MarshArrayUBound] = eval ("_root.Marsh" + MarshArrayUBound);
MarshArray[MarshArrayUBound].startDrag(true);
DragActive = true;
DragObject = MarshArray[MarshArrayUBound];
}
}
};
_global.MoveMessageBox = function (oMessageBox) {
if (DragActive == true) {
stopDrag();
DragActive = false;
DragObject = null;
} else {
DragActive = true;
DragObect = oMessageBox;
oMessageBox.startDrag(true);
}
};
_global.MoveObject = function (mObject) {
if (DragActive == true) {
if ((OnLand(mObject) && (DragObject._name.indexOf("TidalPool") < 0)) || (((OnLand(mObject) == false) && (DragObject._name.indexOf("TidalPool") >= 0)) && (DragObject.hitTest("_root.PurchaseScreen") == false))) {
stopDrag();
DragActive = false;
DragObject = null;
} else if (DragObject.hitTest("_root.PurchaseScreen")) {
if (DragObject._name.indexOf("Cannon") >= 0) {
CurrentPoints = CurrentPoints + (CannonPrice * 0.75);
stopDrag();
DragActive = false;
DragObject.removeMovieClip();
DragObject = null;
PackCannonArray();
} else if (DragObject._name.indexOf("Wall") >= 0) {
CurrentPoints = CurrentPoints + (WallPrice * 0.75);
stopDrag();
DragActive = false;
DragObject.removeMovieClip();
DragObject = null;
PackWallArray();
} else if (DragObject._name.indexOf("Warrior") >= 0) {
CurrentPoints = CurrentPoints + (WarriorPrice * 0.75);
stopDrag();
DragActive = false;
DragObject.removeMovieClip();
DragObject = null;
PackWarriorArray();
} else if (DragObject._name.indexOf("Marsh") >= 0) {
CurrentPoints = CurrentPoints + (MarshPrice * 0.75);
stopDrag();
DragActive = false;
DragObject.removeMovieClip();
DragObject = null;
PackMarshArray();
} else if (DragObject._name.indexOf("TidalPool") >= 0) {
CurrentPoints = CurrentPoints + (TidalPoolPrice * 0.75);
stopDrag();
DragActive = false;
DragObject.removeMovieClip();
DragObject = null;
PackTidalPoolArray();
} else if (DragObject._name.indexOf("MasterFlag") >= 0) {
_root.MessageBox.MessageText.text = "You cannot sell your flag.";
_root.MessageBox._visible = true;
}
RefreshPurchaseScreen();
}
} else {
mObject.startDrag(true);
DragActive = true;
DragObject = mObject;
}
};
_global.RoundOne = function () {
gotoAndStop (3);
_root.PurchaseScreen.duplicateMovieClip("tmpPurchaseScreen", MessageBoxDepth + 1);
_root.PurchaseScreen.swapDepths(_root.tmpPurchaseScreen);
_root.tmpPurchaseScreen.removeMovieClip();
_root.PurchaseScreen._x = ((Stage.width / 2) + (_root.PurchaseScreen._width / 2)) + 10;
_root.PurchaseScreen._y = (Stage.height / 2) - (_root.PurchaseScreen._height / 2);
_root.PurchaseScreen.BuyMarsh._visible = false;
_root.PurchaseScreen.txtMarsh._visible = false;
_root.PurchaseScreen.BuyWarrior._visible = false;
_root.PurchaseScreen.txtWarrior._visible = false;
_root.PurchaseScreen.BuyTidalPool._visible = false;
_root.PurchaseScreen.txtTidalPool._visible = false;
_root.PurchaseScreen._visible = true;
_root.MessageBox.duplicateMovieClip("tmpMessageBox", MessageBoxDepth);
_root.MessageBox.swapDepths(_root.tmpMessageBox);
_root.tmpMessageBox.removeMovieClip();
_root.MessageBox.MessageScrollBar.setScrollTarget(_root.MessageBox.MessageText);
_root.MessageBox._x = ((Stage.width / 2) - (_root.MessageBox._width / 2)) - 10;
_root.MessageBox._y = (Stage.height / 2) - (_root.MessageBox._height / 2);
_root.MessageBox.Title.text = "Defend!";
_root.MessageBox.MessageText.text = "";
_root.MessageBox.MessageText.text = "Hint: This window scrolls down.";
_root.MessageBox.MessageText.text = _root.MessageBox.MessageText.text + "\r\rThe objective is simple: protect your flag. There are only two ways to lose. 1) Let an enemy raider touch your flag, or 2) Let all your cannons be destroyed. ";
_root.MessageBox.MessageText.text = _root.MessageBox.MessageText.text + "\r\rPurchase items by clicking on them and placing them on your land. Use the 'E' and 'R' keys to rotate items before placing them. You can sell items for 75% of their value by removing them from the land and placing them on the purchase window. However, when selling items, click on an empty space on the purchase window and not another item.";
_root.MessageBox.MessageText.text = _root.MessageBox.MessageText.text + "\r\rThere's a new item this round: Cannons. Cannons randomly shoot at any target on the screen. Watch out, because cannon balls don't discriminate at what they hit. Cannons will destroy anything in their path except other cannons. You may only own 10 cannons at a time.";
_root.MessageBox.MessageText.text = _root.MessageBox.MessageText.text + "\r\rThere's a new item this round: Walls. Use walls to stop raiders from reaching your flag.";
_root.MessageBox.MessageText.text = _root.MessageBox.MessageText.text + "\r\rThere's a new enemy this round: Transport Ships. Try to destroy the transport ship before it reaches land. Once it lands, it will release raiders who will attempt to capture your flag.";
_root.MessageBox.MessageText.text = _root.MessageBox.MessageText.text + "\r\rThere's a new enemy this round: Runners. Runners are bent on one thing, capturing your flag. Purchase walls to stop to them in their tracks.";
_root.MessageBox._visible = true;
};
_global.TogglePurchaseWindow = function () {
if (CannonArrayUBound == -1) {
_root.MessageBox.Title = "Defend!";
_root.MessageBox.MessageText.text = "You must own at least one Cannon.";
_root.MessageBox._visible = true;
} else if (DragActive != true) {
_root.PurchaseScreen._visible = false;
_root.MessageBox._visible = false;
_global.RoundActive = true;
_global.InitalizeRound();
}
};
_global.EndRound = function () {
var i = 0;
i = 0;
while (i <= CannonBallArrayUBound) {
CannonBallArray[i].removeMovieClip();
i++;
}
i = 0;
while (i <= TidalPoolArrayUBound) {
TidalPoolArray[i].removeMovieClip();
i++;
}
i = 0;
while (i <= WarriorArrayUBound) {
WarriorArray[i].StartingTarget.removeMovieClip();
i++;
}
PackTidalPoolArray();
_global.RoundActive = false;
CurrentRound++;
RefreshPurchaseScreen();
_root.PurchaseScreen._visible = true;
switch (CurrentRound) {
case 2 :
_root.MessageBox.MessageText.text = "Hint: you can move the items on your land (even your flag) in between rounds.";
_root.MessageBox._visible = true;
return;
case 3 :
_root.MessageBox.MessageText.text = "Hint: you can move windows by clicking on their title bars.";
_root.MessageBox._visible = true;
return;
case 4 :
_root.MessageBox.MessageText.text = "There's a new item this round: Marshes. Place Marshes in the path to your flag to slow raiders down. The speed of a raider will be reduced by a 50% when crossing a marsh.";
_root.MessageBox._visible = true;
return;
case 5 :
_root.MessageBox.MessageText.text = "There's a new enemy this round: Masons. Masons seek to damage your walls, and they will if allowed to touch one. If there are no walls on your land, Masons will attempt to capture your flag.";
_root.MessageBox._visible = true;
return;
case 6 :
_root.MessageBox.MessageText.text = "There's a new item this round: Warriors. Warriors will attack any raider on your land and destroy them. If a wall comes between a warrior and his intended victim, he will go after a different raider. Take care to keep them away from your cannons. Marshes will not slow down a Warrior. If there are no raiders for a Warrior to attach, he will return to where he was placed at the beginning of the round. This location is marked with an 'X'.";
_root.MessageBox._visible = true;
return;
case 10 :
_root.MessageBox.MessageText.text = "There's a new enemy this round: Demolitionist. Demolitionists seek to destroy your cannons, and they will if allowed to touch one. Once all cannons are destroyed, Demolitionists will attempt to capture your flag.";
_root.MessageBox._visible = true;
return;
case 15 :
_root.MessageBox.MessageText.text = "There's a new enemy this round: Assassins. Assassins are on the hunt for your warriors. They're the only raider that can kill a warrior. If you posses no warriors, Assassins will attempt to capture your flag.";
_root.MessageBox._visible = true;
return;
case 17 :
_root.MessageBox.MessageText.text = "There's a new item this round: Tidal Pool. Place tidal pools in the water. Any ship that enters a tidal pool will be destroyed. Tidal Pools cannot be destroyed. However, this great power comes at a price; tidal pools are removed between every round. Tidal Pools cannot be rotated. Also, you may only purchase two tidal pools per round. Don't forget that you can move the purchase window. Be careful when placing tidal pools that you don't accidently sell them.";
_root.MessageBox._visible = true;
return;
case 20 :
_root.MessageBox.MessageText.text = "There's a new enemy this round: War Ships. War Ships don't deliver raiders to your land. Instead, they fire cannon balls at your walls, cannons, and warriors. Also, War Ships are more difficult to destroy than Transport Ships.";
_root.MessageBox._visible = true;
return;
case 25 :
_root.MessageBox.MessageText.text = "There's a new enemy this round: Pestilence. Pestilence will destroy your possession every round. There is nothing you can do to prevent this. This round one item will be destroyed and every round thereafter, one item more than the previos round will be destroyed.";
_root.MessageBox._visible = true;
}
};
_global.EndGame = function (EndMessage) {
_root.MessageBox.MessageText.text = EndMessage;
_root.MessageBox._visible = true;
_root.HighScores._visible = true;
gotoAndStop (4);
};
_global.RefreshPurchaseScreen = function () {
_root.PurchaseScreen.txtRound.text = "Round " + CurrentRound;
_root.PurchaseScreen.txtSpendablePoints.text = "Spendable Points: " + FormatNumber(CurrentPoints);
_root.PurchaseScreen.txtOverallPoints.text = "Current Score: " + FormatNumber(TotalPoints);
_root.PurchaseScreen.txtCannon.text = "Cannon - " + FormatNumber(CannonPrice);
_root.PurchaseScreen.txtWall.text = "Wall - " + FormatNumber(WallPrice);
_root.PurchaseScreen.txtWarrior.text = "Warrior - " + FormatNumber(WarriorPrice);
_root.PurchaseScreen.txtMarsh.text = "Marsh - " + FormatNumber(MarshPrice);
_root.PurchaseScreen.txtTidalPool.text = "Tidal Pool - " + FormatNumber(TidalPoolPrice);
if (CurrentRound >= 4) {
_root.PurchaseScreen.BuyMarsh._visible = true;
_root.PurchaseScreen.txtMarsh._visible = true;
}
if (CurrentRound >= 6) {
_root.PurchaseScreen.BuyWarrior._visible = true;
_root.PurchaseScreen.txtWarrior._visible = true;
}
if (CurrentRound >= 17) {
_root.PurchaseScreen.BuyTidalPool._visible = true;
_root.PurchaseScreen.txtTidalPool._visible = true;
}
};
_global.FormatNumber = function (oNumber) {
var i = 0;
var j = 1;
var sReturn = "";
var tReturn = "";
i = oNumber.toString().length - 1;
while (i >= 0) {
sReturn = sReturn + oNumber.toString().charAt(i);
if (((j % 3) == 0) && (i != 0)) {
sReturn = sReturn + ",";
}
j++;
i--;
}
i = sReturn.length - 1;
while (i >= 0) {
tReturn = tReturn + sReturn.charAt(i);
i--;
}
return(tReturn);
};
_global.InitalizeRound = function () {
var i = 0;
CannonBallArrayUBound = -1;
ShipArrayUBound = CurrentRound;
WarShipArrayUBound = CurrentRound - 19;
RaiderCount = 0;
i = 0;
while (i < (CurrentRound - 26)) {
Pestilence();
i++;
}
i = 0;
while (i < WarShipArrayUBound) {
_root.MasterWarShip.duplicateMovieClip("WShip" + i, WarShipDepth + i);
_root.MasterDamage.duplicateMovieClip("WShipDamage" + i, WDamageDepth + i);
WarShipArray[i] = eval ("_root.WShip" + i);
WarShipArray[i].Damage = eval ("_root.WShipDamage" + i);
WarShipArray[i]._x = Stage.width + _root.MasterWarShip._width;
WarShipArray[i]._y = _root.MasterWarShip._height + (Math.random() * (Stage.height - (_root.MasterWarShip._height * 2)));
WarShipArray[i].Damage._x = WarShipArray[i]._x;
WarShipArray[i].Damage._y = WarShipArray[i]._y + (WarShipArray[i]._height / 2);
WarShipArray[i].Speed = WarShipSpeed;
WarShipArray[i].LaunchDelay = WShipArray[i - 1].LaunchDelay + Math.round(Math.random() * CurrentRound);
WarShipArray[i].FireDelay = 0;
i++;
}
i = 0;
while (i < ShipArrayUBound) {
_root.MasterShip.duplicateMovieClip("Ship" + i, ShipDepth + i);
_root.MasterDamage.duplicateMovieClip("ShipDamage" + i, DamageDepth + i);
ShipArray[i] = eval ("_root.Ship" + i);
ShipArray[i].Damage = eval ("_root.ShipDamage" + i);
ShipArray[i]._x = Stage.width + _root.MasterShip._width;
ShipArray[i]._y = _root.MasterShip._height + (Math.random() * (Stage.height - (_root.MasterShip._height * 2)));
ShipArray[i].Damage._x = ShipArray[i]._x;
ShipArray[i].Damage._y = (ShipArray[i]._y + (ShipArray[i]._height / 2)) - 5;
ShipArray[i].Speed = ShipSpeed;
ShipArray[i].LaunchDelay = ShipArray[i - 1].LaunchDelay + Math.round(Math.random() * CurrentRound);
ShipArray[i].RaiderLoad = 5;
ShipArray[i].DropLoad = 0;
i++;
}
i = 0;
while (i <= WarriorArrayUBound) {
duplicateMovieClip ("_root.MasterWarriorTarget", "WarriorTarget" + i, WarriorTargetDepth + i);
WarriorArray[i].StartingTarget = eval ("_root.WarriorTarget" + i);
WarriorArray[i].StartingTarget._x = WarriorArray[i]._x;
WarriorArray[i].StartingTarget._y = WarriorArray[i]._y;
i++;
}
};
_global.Pestilence = function () {
var i = 0;
var PestilenceArray = [];
var PestilenceArrayUBound = -1;
i = 0;
while (i <= CannonArrayUBound) {
PestilenceArrayUBound++;
PestilenceArray[PestilenceArrayUBound] = CannonArray[i];
i++;
}
i = 0;
while (i <= WarriorArrayUBound) {
PestilenceArrayUBound++;
PestilenceArray[PestilenceArrayUBound] = WarriorArray[i];
i++;
}
i = 0;
while (i <= WallArrayUBound) {
PestilenceArrayUBound++;
PestilenceArray[PestilenceArrayUBound] = WallArray[i];
i++;
}
i = 0;
while (i <= MarshArrayUBound) {
PestilenceArrayUBound++;
PestilenceArray[PestilenceArrayUBound] = MarshArray[i];
i++;
}
i = 0;
while (i <= TidalPoolArrayUBound) {
PestilenceArrayUBound++;
PestilenceArray[PestilenceArrayUBound] = TidalPoolArray[i];
i++;
}
PestilenceArray[Math.round(Math.random() * PestilenceArrayUBound)].removeMovieClip();
};
_global.LoadCurrentScore = function () {
_root.HighScores.txtNewHSRound.text = CurrentRound;
_root.HighScores.txtNewHSScore.text = FormatNumber(TotalPoints);
if ((TotalPoints > _root.HighScores.HSScore4) && (_root.HighScores.bScoreRegistered == undefined)) {
_root.HighScores.btnSubmitHS._visible = true;
_root.HighScores.txtTryAgain._visible = false;
} else {
_root.HighScores.btnSubmitHS._visible = false;
_root.HighScores.txtTryAgain._visible = true;
}
};
_global.StripNonNumeric = function (sString) {
var sReturn = "";
var i = 0;
while (i < sString.length) {
if ((sString.charCodeAt(i) >= 48) && (sString.charCodeAt(i) <= 57)) {
sReturn = sReturn + sString.charAt(i);
}
i++;
}
return(sReturn);
};
Instance of Symbol 111 MovieClip "MasterFlag" in Frame 2
on (press) {
if (RoundActive == false) {
MoveObject(this);
}
}
Frame 3
stop();
Instance of Symbol 123 MovieClip "MasterTidalPool" in Frame 3
on (press) {
if (RoundActive == false) {
MoveObject(this);
}
}
Instance of Symbol 125 MovieClip "MasterMarsh" in Frame 3
on (press) {
if (RoundActive == false) {
MoveObject(this);
}
}
Instance of Symbol 152 MovieClip "PurchaseScreen" in Frame 3
onClipEvent (load) {
RefreshPurchaseScreen();
}
Instance of Symbol 109 MovieClip "MasterCannon" in Frame 3
on (press) {
if (RoundActive == false) {
MoveObject(this);
}
}
Instance of Symbol 107 MovieClip "MasterWall" in Frame 3
on (press) {
if (_global.RoundActive == false) {
MoveObject(this);
}
}
Instance of Symbol 133 MovieClip "MasterWarrior" in Frame 3
on (press) {
if (RoundActive == false) {
MoveObject(this);
}
}
Frame 4
_root.HighScores.duplicateMovieClip("tmpHighScores", MessageBoxDepth + 2);
_root.HighScores.swapDepths(_root.tmpHighScores);
_root.tmpHighScores.removeMovieClip();
_root.HighScores._x = ((Stage.width / 2) + (_root.HighScores._width / 2)) + 30;
_root.HighScores._y = (Stage.height / 2) - (_root.HighScores._height / 2);
var i = 0;
i = 0;
while (i <= CannonBallArrayUBound) {
CannonBallArray[i].removeMovieClip();
i++;
}
i = 0;
while (i <= ECannonBallArrayUBound) {
ECannonBallArray[i].removeMovieClip();
i++;
}
i = 0;
while (i <= CannonArrayUBound) {
CannonArray[i].removeMovieClip();
i++;
}
i = 0;
while (i <= WallArrayUBound) {
WallArray[i].removeMovieClip();
i++;
}
i = 0;
while (i <= WarriorArrayUBound) {
WarriorArray[i].StartingTarget.removeMovieClip();
WarriorArray[i].removeMovieClip();
i++;
}
i = 0;
while (i <= MarshArrayUBound) {
MarshArray[i].removeMovieClip();
i++;
}
i = 0;
while (i <= TidalPoolArrayUBound) {
TidalPoolArray[i].removeMovieClip();
i++;
}
i = 0;
while (i <= RaiderArrayUBound) {
RaiderArray[i].removeMovieClip();
i++;
}
i = 0;
while (i <= ShipArrayUBound) {
ShipArray[i].Damage.removeMovieClip();
ShipArray[i].removeMovieClip();
i++;
}
i = 0;
while (i <= WarShipArrayUBound) {
WarShipArray[i].Damage.removeMovieClip();
WarShipArray[i].removeMovieClip();
i++;
}
CannonBallArrayUBound = -1;
ECannonBallArrayUBound = -1;
CannonArrayUBound = -1;
WallArrayUBound = -1;
WarriorArrayUBound = -1;
MarshArrayUBound = -1;
TidalPoolArrayUBound = -1;
RaiderArrayUBound = -1;
ShipArrayUBound = -1;
WarShipArrayUBound = -1;
stop();
Symbol 1 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 14 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 24 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 33 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 34 MovieClip [UpArrow] Frame 1
stop();
Symbol 34 MovieClip [UpArrow] Frame 2
stop();
Symbol 34 MovieClip [UpArrow] Frame 3
stop();
Symbol 41 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 48 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 53 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 54 MovieClip [ScrollThumb] Frame 1
stop();
Symbol 62 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 70 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 78 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 79 MovieClip [DownArrow] Frame 1
stop();
Symbol 79 MovieClip [DownArrow] Frame 2
stop();
Symbol 79 MovieClip [DownArrow] Frame 3
stop();
Symbol 82 MovieClip Frame 1
var component = _parent;
component.registerSkinElement(track_mc, "scrollTrack");
Symbol 83 MovieClip [FScrollBarSymbol] Frame 1
#initclip 2
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 107 MovieClip Frame 1
stop();
Symbol 109 MovieClip Frame 1
stop();
Symbol 115 Button
on (press) {
RoundOne();
}
Symbol 120 MovieClip Frame 1
if (_global.RoundActive == true) {
_global.ProcessGameLoop();
}
Symbol 120 MovieClip Frame 2
if (_global.GameSpeed == 1) {
gotoAndPlay (1);
}
Symbol 120 MovieClip Frame 3
if (_global.GameSpeed == 2) {
gotoAndPlay (1);
}
Symbol 120 MovieClip Frame 4
if (_global.GameSpeed == 3) {
gotoAndPlay (1);
}
Symbol 120 MovieClip Frame 5
if (_global.GameSpeed == 4) {
gotoAndPlay (1);
}
Symbol 120 MovieClip Frame 6
gotoAndPlay (1);
Symbol 132 MovieClip Frame 16
gotoAndPlay (2);
Symbol 133 MovieClip Frame 1
stop();
Symbol 133 MovieClip Frame 2
stop();
Symbol 133 MovieClip Frame 3
stop();
Symbol 133 MovieClip Frame 4
stop();
Symbol 135 Button
on (press) {
MoveMessageBox(this);
}
Symbol 139 Button
on (press) {
TogglePurchaseWindow();
}
Symbol 142 Button
on (press) {
TogglePurchaseWindow();
}
Instance of Symbol 109 MovieClip "BuyCannon" in Symbol 152 MovieClip Frame 1
on (press) {
PurchaseCannon();
}
Instance of Symbol 107 MovieClip "BuyWall" in Symbol 152 MovieClip Frame 1
on (press) {
PurchaseWall();
}
Instance of Symbol 125 MovieClip "BuyMarsh" in Symbol 152 MovieClip Frame 1
on (press) {
PurchaseMarsh();
}
Instance of Symbol 133 MovieClip "BuyWarrior" in Symbol 152 MovieClip Frame 1
on (press) {
PurchaseWarrior();
}
Instance of Symbol 123 MovieClip "BuyTidalPool" in Symbol 152 MovieClip Frame 1
on (press) {
PurchaseTidalPool();
}
Symbol 159 MovieClip Frame 1
stop();
Symbol 165 Button
on (press) {
MoveMessageBox(this);
}
Symbol 166 Button
on (press) {
this._visible = false;
}
Instance of Symbol 83 MovieClip [FScrollBarSymbol] "MessageScrollBar" in Symbol 169 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
_targetInstanceName = "MessageText";
horizontal = false;
}
Symbol 172 Button
on (press) {
CurrentPoints = StartingPoints;
TotalPoints = 0;
CurrentRound = 1;
_root.MessageBox._visible = false;
_root.HighScores._visible = false;
Key.removeListener(Keyboard);
gotoAndStop (2);
}
Symbol 178 Button
on (press) {
NewHSName = txtNewHSName.text;
NewHSScore = StripNonNumeric(txtNewHSScore.text);
NewHSRound = StripNonNumeric(txtNewHSRound.text);
gotoAndPlay (4);
}
Symbol 211 MovieClip Frame 1
if (StartTime == undefined) {
StartTime = getTimer();
}
if ((getTimer() - StartTime) >= 30000) {
gotoAndStop (6);
}
if (ItemCount == undefined) {
ItemCount = -1;
loadVariables ("http://www.ghettocustoms.com/defend/GetDefendHS.asp", this);
}
Symbol 211 MovieClip Frame 2
if (ItemCount > -1) {
gotoAndPlay (3);
} else {
gotoAndPlay (1);
}
Symbol 211 MovieClip Frame 3
txtHS1Name.text = HSName0;
txtHS2Name.text = HSName1;
txtHS3Name.text = HSName2;
txtHS4Name.text = HSName3;
txtHS5Name.text = HSName4;
txtHS1Score.text = FormatNumber(HSScore0);
txtHS2Score.text = FormatNumber(HSScore1);
txtHS3Score.text = FormatNumber(HSScore2);
txtHS4Score.text = FormatNumber(HSScore3);
txtHS5Score.text = FormatNumber(HSScore4);
txtHS1Round.text = HSRound0;
txtHS2Round.text = HSRound1;
txtHS3Round.text = HSRound2;
txtHS4Round.text = HSRound3;
txtHS5Round.text = HSRound4;
LoadCurrentScore();
StartTime = undefined;
stop();
Symbol 211 MovieClip Frame 4
if (StartTime == undefined) {
StartTime = getTimer();
}
if ((getTimer() - StartTime) >= 30000) {
gotoAndStop (6);
}
if (bFinished == undefined) {
bFinished = false;
ItemCount = undefined;
loadVariables ((((("http://www.ghettocustoms.com/Defend/PostDefendHS.asp?HSName=" + NewHSName) + "&HSScore=") + NewHSScore) + "&HSRound=") + NewHSRound, this);
}
Symbol 211 MovieClip Frame 5
if (bFinished == false) {
gotoAndPlay (4);
} else {
bScoreRegistered = true;
gotoAndPlay (1);
}
Symbol 211 MovieClip Frame 6
stop();