Frame 1
function enemyArrowFunc() {
_root.enemyArrow.duplicateMovieClip("newEnemyArrow" + _root.enemyArrowNum, _root.depth++, {_x:461, _y:230, here:true});
_root.enemyArrowNum++;
_root.enemyArrows[_root.enemyArrowNum] = 1;
}
function deploy(troop) {
_root.troopsAlive++;
_root[troop + "Number"]++;
_root[troop + "Array"][_root[troop + "Number"]] = 1;
if (troop != "ram") {
_root[troop + "Clip"].duplicateMovieClip(troop + _root[troop + "Number"], _root.depth++, {_x:_root[troop + "Clip"]._x + random(20), _y:_root[troop + "Clip"]._y - random(20)});
} else {
_root[troop + "Clip"].duplicateMovieClip(troop + _root[troop + "Number"], _root.depth++, {_x:_root[troop + "Clip"]._x + random(20), _y:_root[troop + "Clip"]._y});
}
}
function changeLevel(frame) {
clearScreen();
gotoAndStop(frame);
cursor._visible = true;
Mouse.hide();
}
function clearScreen() {
i = 1;
while (i <= _root.depth) {
removeMovieClip(_root["newEnemyArrow" + i]);
removeMovieClip(_root["newArrow" + i]);
removeMovieClip(_root["infantry" + i]);
removeMovieClip(_root["archer" + i]);
removeMovieClip(_root["cavalry" + i]);
removeMovieClip(_root["ram" + i]);
removeMovieClip(_root["mangonel" + i]);
removeMovieClip(_root["trebuchet" + i]);
removeMovieClip(_root["newWater" + i]);
removeMovieClip(_root["newExplosion" + i]);
removeMovieClip(_root["newCannonball" + i]);
removeMovieClip(_root["jedi" + i]);
i++;
}
_root.jediArray = new Array();
_root.enemyArrows = new Array();
_root.trebuchetArray = new Array();
_root.infantryArray = new Array();
_root.Arrows = new Array();
_root.mangonelArray = new Array();
_root.ramArray = new Array();
_root.cavalryArray = new Array();
_root.archerArray = new Array();
_root.cannonballs = new Array();
}
function loadGame() {
bulks = new Array("infBulk", "archBulk", "cavBulk", "ramBulk", "mangoBulk", "trebBulk", "barracksBulk", "fletcheryBulk", "alchemistBulk", "workshopBulk", "stableBulk", "quarryBulk");
cannonballs = new Array();
enemyArrows = new Array();
trebuchetArray = new Array();
infantryArray = new Array();
Arrows = new Array();
mangonelArray = new Array();
ramArray = new Array();
cavalryArray = new Array();
archerArray = new Array();
jediArray = new Array();
archFireChance = 50;
cavDamage = 80;
infCost = 200;
archCost = 200;
archDamage = 4.1;
cavCost = 300;
mangoCost = 500;
infSpeed = 1.5;
archSpeed = 1.75;
ramSpeed = (mangoSpeed = 0.75);
enemyArrowType = 2;
infDamage = 2.5;
ramCost = (trebCost = 500);
ramDamage = 10;
arrowType = 1;
cavSpeed = 3;
mangoDamage = 10;
trebDamage = 4.3;
trebSpeed = 3;
jediSpeed = 2.5;
jediDamage = 10;
gold = InvasionSettings.data.gold;
infAvailable = (cavAvailable = (archAvailable = (ramAvailable = (mangoAvailable = (trebAvailable = true)))));
enemyHP = InvasionSettings.data.level * _root.castleHP;
level = InvasionSettings.data.level;
archUpgrades = InvasionSettings.data.archUpgrades;
infUpgrades = InvasionSettings.data.infUpgrades;
ramUpgrades = InvasionSettings.data.ramUpgrades;
cavUpgrades = InvasionSettings.data.cavUpgrades;
mangoUpgrades = InvasionSettings.data.mangoUpgrades;
trebUpgrades = InvasionSettings.data.trebUpgrades;
infCount = InvasionSettings.data.infCount;
archCount = InvasionSettings.data.archCount;
ramCount = InvasionSettings.data.ramCount;
cavCount = InvasionSettings.data.cavCount;
mangoCount = InvasionSettings.data.mangoCount;
trebCount = InvasionSettings.data.trebCount;
arrowNum = (jediNumber = (enemyArrowNum = (boltNumber = (troopCount = (troopsAlive = (infantryNumber = (archerNumber = (cavalryNumber = (ramNumber = (mangonelNumber = (trebuchetNumber = (archBulk = (infBulk = (ramBulk = (cavBulk = (mangoBulk = (trebBulk = (explosionNum = 0))))))))))))))))));
nextFrame();
}
function sendScoreFunction(viewMethod) {
_root.gotoAndStop(16);
_root.view = viewMethod;
}
archerUnits = new Array("archer", "mangonel");
rangeShorts = new Array("arch", "mango");
missiles = new Array("Arrow", "Cannonball");
missileArrays = new Array("Arrows", "cannonballs");
multiHP = new Array("ram", "trebuchet", "mangonel");
singleHP = new Array("cavalry", "infantry", "archer");
unitsArray = new Array("infantry", "archer", "ram", "cavalry", "mangonel", "trebuchet");
shortNames = new Array("inf", "arch", "ram", "cav", "mango", "treb");
sameyUnits = new Array("infantry", "trebuchet", "cavalry");
hit = hitTest;
_root.onEnterFrame = function () {
if (_currentframe != 5) {
clearScreen();
_root.depth = (_root.troopsAlive = (_root.arrowNum = (_root.enemyArrowNum = (_root.jediNumber = (_root.infantryNumber = (_root.archerNumber = (_root.cavalryNumber = (_root.ramNumber = (_root.mangonelNumber = (_root.trebuchetNumber = 0))))))))));
}
if (_currentframe == 4) {
for (var i in bulks) {
if (_root[bulks[i]] == "") {
_root[bulks[i]] = 0;
}
}
maxPop = level * 10;
_root.goldField.text = ("You have " + _root.gold) + " gold.";
troopsLeft = ((((infCount + archCount) + cavCount) + ramCount) + mangoCount) + trebCount;
popLimit = (troopsLeft + " Out of: ") + maxPop;
} else if (_currentframe == 5) {
InvasionFrames++;
arrowFrameDelay--;
_root.hBar._width = (_root.enemyHP / _root.enemyHPmax) * 200;
if (((_root.enemyHP / _root.enemyHPmax) * 200) > 1) {
_root.castle.gotoAndStop(Math.round((_root.enemyHP / _root.enemyHPmax) * 100));
} else {
changeLevel(6);
}
for (var i in unitsArray) {
if (Key.isDown(49 - (-i))) {
if (_root[shortNames[i] + "Count"] > 0) {
deploy(_root.unitsArray[i]);
_root[shortNames[i] + "Count"]--;
}
}
}
troopsLeft = ((((infCount + archCount) + cavCount) + ramCount) + mangoCount) + trebCount;
if (arrowFrameDelay <= 0) {
arrowsDetected = 0;
for (var i in enemyArrows) {
if (_root["newEnemyArrow" + i].here) {
arrowsDetected++;
}
}
if (arrowsDetected == 0) {
enemyArrowNum = 1;
enemyArrows = new Array(1, 1);
spurt = true;
if (arrowsFired != arrowsToFire) {
_root.enemyArrowFunc();
arrowsFired++;
} else {
arrowFrameDelay = arrowFrameDelayInit;
arrowsFired = 0;
spurt = false;
}
} else if (spurt) {
if (arrowsFired != arrowsToFire) {
_root.enemyArrowFunc();
arrowsFired++;
} else {
arrowFrameDelay = arrowFrameDelayInit;
arrowsFired = 0;
spurt = false;
}
}
}
if (_root.troopsLeft == 0) {
if (_root.troopsAlive == 0) {
changeLevel(7);
}
}
if (jediOn == 1) {
singleHP = new Array("cavalry", "infantry", "archer", "jedi");
sameyUnits = new Array("jedi", "infantry", "trebuchet", "cavalry");
}
for (var x in sameyUnits) {
i = 0;
while (i <= _root[sameyUnits[x] + "Number"]) {
if (_root[sameyUnits[x] + "Array"][i] == 1) {
if (!_root[sameyUnits[x] + i].hit(_root.castle)) {
_root[sameyUnits[x] + i]._x = _root[sameyUnits[x] + i]._x - (-_root[sameyUnits[x] + i].speed);
_root[sameyUnits[x] + i]._y = _root[sameyUnits[x] + i]._y - (Math.random() - 0.5);
} else {
_root[sameyUnits[x] + i].gotoAndStop(2);
}
}
i++;
}
}
for (var x in archerUnits) {
i = 0;
while (i <= _root[archerUnits[x] + "Number"]) {
if (_root[archerUnits[x] + "Array"][i] == 1) {
if (_root[archerUnits[x] + i]._x < (250 - _root[archerUnits[x] + i].decrement)) {
_root[archerUnits[x] + i]._x = _root[archerUnits[x] + i]._x - (-_root[archerUnits[x] + i].speed);
_root[archerUnits[x] + i]._y = _root[archerUnits[x] + i]._y - (Math.random() - 0.5);
} else if (_root[archerUnits[x] + i]._x > 100) {
_root[archerUnits[x] + i].gotoAndStop(2);
} else {
_root[archerUnits[x] + i]._x = _root[archerUnits[x] + i]._x - (-_root[archerUnits[x] + i].speed);
_root[archerUnits[x] + i]._y = _root[archerUnits[x] + i]._y - (Math.random() - 0.5);
}
}
i++;
}
}
for (var i in ramArray) {
if (_root.ramArray[i] == 1) {
if (!_root["ram" + i].hit(_root.castle)) {
if (!_root["ram" + i].touching) {
_root["ram" + i]._x = _root["ram" + i]._x - (-_root["ram" + i].speed);
j = 0;
while (j < 4) {
_root["ram" + i]["wheel" + j]._rotation = _root["ram" + i]["wheel" + j]._rotation - (-_root["ram" + i].speed);
j++;
}
}
} else {
_root["ram" + i].gotoAndStop(2);
_root["ram" + i].touching = true;
}
}
}
for (var x in missileArrays) {
for (var i in _root[missileArrays[x]]) {
if (_root[missileArrays[x]][i] == 1) {
_root[("new" + missiles[x]) + i]._x = _root[("new" + missiles[x]) + i]._x - _root[("new" + missiles[x]) + i].xs;
if (!_root[("new" + missiles[x]) + i].damaged) {
_root[("new" + missiles[x]) + i]._y = _root[("new" + missiles[x]) + i]._y - (-((_root[("new" + missiles[x]) + i].ys = _root[("new" + missiles[x]) + i].ys - (-_root[("new" + missiles[x]) + i].g))));
}
_root[("new" + missiles[x]) + i]._rotation = ((_root[("new" + missiles[x]) + i]._x >= 455) ? (_root[("new" + missiles[x]) + i]._rotation) : ((Math.atan2(_root[("new" + missiles[x]) + i].ys, -_root[("new" + missiles[x]) + i].xs) * 180) / Math.PI));
if (_root[("new" + missiles[x]) + i]._x > 455) {
_root[("new" + missiles[x]) + i].xs = (_root[("new" + missiles[x]) + i].ys = 0);
if (!_root[("new" + missiles[x]) + i].damaged) {
_root.enemyHP = _root.enemyHP - _root[rangeShorts[x] + "Attack"];
_root[("new" + missiles[x]) + i].damaged = true;
}
if (missiles[x] == "Arrow") {
if (_root[("new" + missiles[x]) + i]._alpha > 0) {
_root[("new" + missiles[x]) + i]._alpha = _root[("new" + missiles[x]) + i]._alpha - 10;
} else {
_root[missileArrays[x]][i] = 0;
removeMovieClip(_root[("new" + missiles[x]) + i]);
}
} else if (_root[("new" + missiles[x]) + i]._currentframe == _root[("new" + missiles[x]) + i]._totalframes) {
_root[missileArrays[x]][i] = 0;
removeMovieClip(_root[("new" + missiles[x]) + i]);
} else {
_root[("new" + missiles[x]) + i].play();
}
}
}
}
}
for (var i in enemyArrows) {
if (_root.enemyArrows[i] == 1) {
if (!_root["newEnemyArrow" + i].hitPlayer) {
if (!_root["newEnemyArrow" + i].fadeStarted) {
_root["newEnemyArrow" + i]._x = _root["newEnemyArrow" + i]._x - (-_root["newEnemyArrow" + i].xs);
_root["newEnemyArrow" + i]._y = _root["newEnemyArrow" + i]._y - (-((_root["newEnemyArrow" + i].ys = _root["newEnemyArrow" + i].ys - (-_root["newEnemyArrow" + i].g))));
_root["newEnemyArrow" + i]._rotation = ((_root["newEnemyArrow" + i]._y >= 333) ? (_root["newEnemyArrow" + i]._rotation) : ((Math.atan2(_root["newEnemyArrow" + i].ys, _root["newEnemyArrow" + i].xs) * 180) / Math.PI));
if (_root["newEnemyArrow" + i]._y > 333) {
_root["newEnemyArrow" + i]._y = 333;
_root["newEnemyArrow" + i].xs = (_root["newEnemyArrow" + i].ys = 0);
}
for (var x in singleHP) {
j = 0;
while (j <= _root[_root.singleHP[x] + "Number"]) {
if (_root[_root.singleHP[x] + "Array"][j] == 1) {
if (_root[_root.singleHP[x] + j].hit(_root["newEnemyArrow" + i]._x, _root["newEnemyArrow" + i]._y)) {
if (!_root["newEnemyArrow" + i].fadeStarted) {
if (!_root["newEnemyArrow" + i].hitPlayer) {
_root["newEnemyArrow" + i].hitPlayer = true;
_root["newEnemyArrow" + i].startFade = true;
_root[_root.singleHP[x] + j].gotoAndStop(3);
_root[_root.singleHP[x] + "Array"][j] = 0;
}
}
}
}
j++;
}
}
for (var x in multiHP) {
j = 0;
while (j <= _root[_root.multiHP[x] + "Number"]) {
if (_root[_root.multiHP[x] + "Array"][j] == 1) {
if (_root[_root.multiHP[x] + j].hit(_root["newEnemyArrow" + i]._x, _root["newEnemyArrow" + i]._y)) {
if (!_root["newEnemyArrow" + i].fadeStarted) {
if (!_root["newEnemyArrow" + i].hitPlayer) {
_root["newEnemyArrow" + i].hitPlayer = true;
_root["newEnemyArrow" + i].startFade = true;
_root[_root.multiHP[x] + j].HP--;
if (_root[_root.multiHP[x] + j].HP < 1) {
_root[_root.multiHP[x] + j].gotoAndStop(3);
_root[_root.multiHP[x] + "Array"][j] = 0;
}
}
}
_root["newEnemyArrow" + i]._x = _root["newEnemyArrow" + i]._x - (-_root[_root.multiHP[x] + j].speed);
}
}
j++;
}
}
}
}
if ((_root["newEnemyArrow" + i]._y >= 300) || (_root["newEnemyArrow" + i].hitPlayer)) {
if (!_root["newEnemyArrow" + i].fadeStarted) {
_root["newEnemyArrow" + i].startFade = true;
}
}
if (_root["newEnemyArrow" + i].startFade) {
if (!_root["newEnemyArrow" + i].fadeStarted) {
_root["newEnemyArrow" + i].fadeStarted = true;
}
if (_root["newEnemyArrow" + i]._alpha > 0) {
_root["newEnemyArrow" + i]._alpha = _root["newEnemyArrow" + i]._alpha - 10;
} else {
_root.enemyArrows[i] = 0;
removeMovieClip(_root["newEnemyArrow" + i]);
}
}
}
}
}
};
jediOn = 0;
levelGold = 2500;
InvasionSettings = SharedObject.getLocal("InvasionSaveFile");
if (InvasionSettings.data.soundOn != undefined) {
if (InvasionSettings.data.soundOn) {
soundOn = true;
} else if (InvasionSettings.data.soundOn == false) {
soundOn = false;
}
} else {
soundOn = true;
}
if (InvasionSettings.data.InvasionFrames != undefined) {
InvasionFrames = InvasionSettings.data.InvasionFrames;
} else {
InvasionFrames = 0;
}
if (InvasionSettings.data.InvasionBoots != undefined) {
InvasionBoots = InvasionSettings.data.InvasionBoots + 1;
InvasionSettings.data.InvasionBoots++;
} else {
InvasionBoots = 1;
InvasionSettings.data.InvasionBoots++;
}
if (InvasionSettings.data.qualitySettings != undefined) {
if (InvasionSettings.data.qualitySettings == "HIGH") {
qualitySettings = "HIGH";
} else if (InvasionSettings.data.qualitySettings == "MEDIUM") {
qualitySettings = "MEDIUM";
} else if (InvasionSettings.data.qualitySettings == "LOW") {
qualitySettings = "LOW";
}
} else {
qualitySettings = "HIGH";
_quality = "HIGH";
}
if (InvasionSettings.data.levelsPlayed != undefined) {
levelsPlayed = InvasionSettings.data.levelsPlayed;
} else {
levelsPlayed = 0;
}
if (InvasionSettings.data.levelsWon != undefined) {
levelsWon = InvasionSettings.data.levelsWon;
} else {
levelsWon = 0;
}
if (InvasionSettings.data.levelsLost != undefined) {
levelsLost = InvasionSettings.data.levelsLost;
} else {
levelsLost = 0;
}
if (InvasionSettings.data.weatherOn != undefined) {
if (InvasionSettings.data.weatherOn) {
weatherOn = true;
} else if (InvasionSettings.data.weatherOn == false) {
weatherOn = false;
}
} else {
weatherOn = true;
}
if (InvasionSettings.data.autoSave != undefined) {
if (InvasionSettings.data.autoSave) {
autoSave = true;
} else if (InvasionSettings.data.autoSave == false) {
autoSave = false;
}
} else {
autoSave = false;
}
Stage.showMenu = false;
fscommand ("allowscale", false);
stop();
castleHP = 450;
InvasionVersion = 4;
Instance of Symbol 21 MovieClip "loader" in Frame 1
onClipEvent (load) {
_root.stop();
}
onClipEvent (enterFrame) {
_root.loadedbytes = getBytesLoaded();
_root.totalbytes = getBytesTotal();
_root.loadedkbytes = Math.ceil(_root.loadedbytes / 1024);
_root.totalkbytes = Math.ceil(_root.totalbytes / 1024);
if (_root.loadedbytes == _root.totalbytes) {
_root.gotoAndStop(2);
}
_root.percentage = int(_root.loadedbytes / (_root.totalbytes / 100));
this.gotoAndStop(_root.percentage);
}
Instance of Symbol 40 MovieClip "console" in Frame 1
onClipEvent (keyDown) {
if (Key.isDown(17)) {
if (Key.isDown(192)) {
if (slideIn._currentframe == 1) {
this.slideIn.gotoAndPlay(2);
} else {
this.gotoAndStop(2);
}
}
}
}
Instance of Symbol 42 MovieClip "cursor" in Frame 1
onClipEvent (load) {
Mouse.hide();
_x = _root._xmouse;
_y = _root._ymouse;
}
onClipEvent (mouseMove) {
_x = _root._xmouse;
_y = _root._ymouse;
}
Frame 3
if (InvasionSettings.data.highestLevel != undefined) {
levelScore = ("The highest level you've ever reached is: " + InvasionSettings.data.highestLevel) + ".";
} else {
levelScore = "The highest level you've ever reached is: 0. Shame on you.";
}
if (InvasionSettings.data.levelsPlayed != undefined) {
attendance = (((("Played: " + levelsPlayed) + " Won: ") + levelsWon) + " Lost: ") + levelsLost;
} else {
attendance = "Played: 0 Won: 0 Lost: 0";
}
if (InvasionSettings.data.InvasionFrames != undefined) {
playTime = ("You've played for " + InvasionFrames) + " frames on the battlefield.";
} else {
playTime = "You haven't entered any battles yet.";
}
if (InvasionSettings.data.highestGold != undefined) {
goldCount = ("Your highest amount of gold you've ever had is: " + InvasionSettings.data.highestGold) + ".";
} else {
goldCount = "Your highest amount of gold has yet to be seen.";
}
if (InvasionSettings.data.InvasionBoots != undefined) {
if (InvasionBoots == 1) {
Boots = ("This is your first time playing Invasion Version " + InvasionVersion) + "!";
} else {
Boots = ((("You've played Invasion Version " + InvasionVersion) + " a total of ") + InvasionBoots) + " times!";
}
}
Frame 4
_quality = "HIGH";
_root.goldField.text = ("You have " + _root.gold) + " gold.";
Instance of Symbol 112 MovieClip in Frame 4
onClipEvent (enterFrame) {
if (_root.infAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 117 MovieClip in Frame 4
onClipEvent (enterFrame) {
if (_root.archAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 123 MovieClip in Frame 4
onClipEvent (enterFrame) {
if (_root.cavAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 128 MovieClip in Frame 4
onClipEvent (enterFrame) {
if (_root.ramAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 133 MovieClip in Frame 4
onClipEvent (enterFrame) {
if (_root.mangoAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 138 MovieClip in Frame 4
onClipEvent (enterFrame) {
if (_root.trebAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 200 MovieClip in Frame 4
onClipEvent (load) {
if (_root.infAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 203 MovieClip in Frame 4
onClipEvent (load) {
if (_root.archAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 206 MovieClip in Frame 4
onClipEvent (load) {
if (_root.cavAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 209 MovieClip in Frame 4
onClipEvent (load) {
if (_root.ramAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 212 MovieClip in Frame 4
onClipEvent (load) {
if (_root.mangoAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 215 MovieClip in Frame 4
onClipEvent (load) {
if (_root.trebAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Frame 5
_quality = qualitySettings;
if (qualitySettings == "LOW") {
cursor._visible = false;
Mouse.show();
} else {
cursor._visible = true;
Mouse.hide();
}
i = 0;
while (i < shortNames.length) {
_root[shortNames[i] + "Attack"] = _root[shortNames[i] + "Damage"] + (0.3 * _root[shortNames[i] + "Upgrades"]);
i++;
}
i = 0;
while (i < unitsArray.length) {
_root[unitsArray[i] + "Clip"].gotoAndStop(4);
i++;
}
cannonball.gotoAndStop(7);
enemyArcherArrow.gotoAndStop(3);
archerArrow.gotoAndStop(3);
Water.gotoAndStop(3);
arrowFrameDelayInit = (arrowFrameDelay = 20 + level);
arrowsFired = 0;
arrowsToFire = Math.round((level * 3) / 2) - 1;
castle.gotoAndStop(100);
arrowNum++;
Arrows[arrowNum] = 1;
enemyArrowNum = 1;
enemyArrows[enemyArrowNum] = 1;
cannonballNum++;
cannonballs[cannonballNum] = 1;
enemyHPmax = enemyHP;
explosion.stop();
cannonball._visible = (mine._visible = (mineField._visible = (archerClip._visible = (jediClip._visible = (mangonelClip._visible = (explosion._visible = (enemyArcherArrow._visible = (Water._visible = (archerArrow._visible = (ramClip._visible = (infantryClip._visible = (cavalryClip._visible = (trebuchetClip._visible = false)))))))))))));
Instance of Symbol 244 MovieClip in Frame 5
onClipEvent (load) {
if (_root.timeOn) {
this.gotoAndPlay(600);
} else {
this.stop();
}
}
Instance of Symbol 259 MovieClip "grass" in Frame 5
onClipEvent (load) {
gotoAndStop(random(_totalframes) + 1);
}
Instance of Symbol 302 MovieClip "castle" in Frame 5
onClipEvent (load) {
gotoAndStop (100);
}
Instance of Symbol 305 MovieClip in Frame 5
onClipEvent (load) {
if (_root.weatherOn != false) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(_totalframes);
_visible = false;
}
}
Instance of Symbol 330 MovieClip "mangonelClip" in Frame 5
onClipEvent (load) {
stop();
speed = _root.mangoSpeed + Math.random();
hit = hitTest;
decrement = random(40) + 60;
HP = 3;
}
Instance of Symbol 361 MovieClip "trebuchetClip" in Frame 5
onClipEvent (load) {
stop();
speed = _root.trebSpeed + Math.random();
HP = 2;
hit = hitTest;
}
Instance of Symbol 378 MovieClip "ramClip" in Frame 5
onClipEvent (load) {
stop();
speed = _root.ramSpeed + Math.random();
touching = false;
HP = 3;
hit = hitTest;
}
Instance of Symbol 393 MovieClip "infantryClip" in Frame 5
onClipEvent (load) {
stop();
speed = (_root.infSpeed + 0.3) + Math.random();
hit = hitTest;
}
Instance of Symbol 411 MovieClip "archerClip" in Frame 5
onClipEvent (load) {
stop();
speed = (_root.archSpeed + 0.3) + Math.random();
decrement = random(40) + 60;
hit = hitTest;
}
Instance of Symbol 407 MovieClip "enemyArrow" in Frame 5
onClipEvent (load) {
gotoAndStop(_root.enemyArrowType);
xs = -13 + Math.random();
ys = -4 + Math.random();
g = 0.5;
toggleDamage = (hitPlayer = (startFade = (fadeStarted = false)));
hit = hitTest;
}
Instance of Symbol 407 MovieClip "archerArrow" in Frame 5
onClipEvent (load) {
gotoAndStop(_root.arrowType);
xs = -13 + Math.random();
ys = -10 + Math.random();
g = 0.5;
toggleDamage = (damaged = false);
}
Instance of Symbol 420 MovieClip "cannonball" in Frame 5
onClipEvent (load) {
_x = (_x - -23);
_y = (_y - 3);
xs = -13 + Math.random();
ys = -10 + Math.random();
g = 0.5;
toggleDamage = (damaged = false);
}
Instance of Symbol 460 MovieClip "jediClip" in Frame 5
onClipEvent (load) {
stop();
speed = _root.jediSpeed + Math.random();
hit = hitTest;
}
Instance of Symbol 479 MovieClip "cavalryClip" in Frame 5
onClipEvent (load) {
stop();
speed = _root.cavSpeed + Math.random();
hit = hitTest;
}
Instance of Symbol 515 MovieClip "Water" in Frame 5
onClipEvent (load) {
hit = null;
}
Frame 6
level++;
_quality = "HIGH";
stop();
stopAllSounds();
goldPlundered = ("You plundered " + (level * _root.levelGold)) + " gold from that castle!";
gold = gold + (level * _root.levelGold);
InvasionSettings.data.InvasionFrames = InvasionSettings.data.InvasionFrames + Number(InvasionFrames);
if (InvasionSettings.data.level != undefined) {
if (InvasionSettings.data.highestLevel < level) {
InvasionSettings.data.highestLevel = level;
}
} else {
InvasionSettings.data.highestLevel = level;
}
if (InvasionSettings.data.highestGold != undefined) {
if (InvasionSettings.data.highestGold < gold) {
InvasionSettings.data.highestGold = gold;
}
} else {
InvasionSettings.data.highestGold = gold;
}
if (InvasionSettings.data.levelsPlayed != undefined) {
InvasionSettings.data.levelsPlayed++;
} else {
InvasionSettings.data.levelsPlayed = 1;
}
if (InvasionSettings.data.levelsWon != undefined) {
InvasionSettings.data.levelsWon++;
} else {
InvasionSettings.data.levelsWon = 1;
}
_root.depth = (_root.troopsAlive = (_root.arrowNum = (_root.enemyArrowNum = (_root.infantryNumber = (_root.jediNumber = (_root.archerNumber = (_root.cavalryNumber = (_root.ramNumber = (_root.mangonelNumber = (_root.trebuchetNumber = (_root.InvasionFrames = 0)))))))))));
InvasionSettings.flush();
Instance of Symbol 534 MovieClip in Frame 6
onClipEvent (load) {
_root.InvasionSettings.data.InvasionFrames = _root.InvasionSettings.data.InvasionFrames + InvasionFrames;
_root.InvasionSettings.flush();
if (_root.autoSave) {
_root.InvasionSettings.data.infCount = _root.infCount;
_root.InvasionSettings.data.archCount = _root.archCount;
_root.InvasionSettings.data.ramCount = _root.ramCount;
_root.InvasionSettings.data.cavCount = _root.cavCount;
_root.InvasionSettings.data.mangoCount = _root.mangoCount;
_root.InvasionSettings.data.trebCount = _root.trebCount;
_root.InvasionSettings.data.gold = _root.gold;
_root.InvasionSettings.data.infUpgrades = _root.infUpgrades;
_root.InvasionSettings.data.archUpgrades = _root.archUpgrades;
_root.InvasionSettings.data.ramUpgrades = _root.ramUpgrades;
_root.InvasionSettings.data.cavUpgrades = _root.cavUpgrades;
_root.InvasionSettings.data.mangoUpgrades = _root.mangoUpgrades;
_root.InvasionSettings.data.trebUpgrades = _root.trebUpgrades;
_root.InvasionSettings.data.arrowType = _root.arrowType;
_root.InvasionSettings.data.level = _root.level;
_root.InvasionSettings.flush();
_visible = false;
} else {
_visible = true;
}
}
Frame 7
_quality = "HIGH";
stop();
stopAllSounds();
dang = ("Damn. You ran out of troops. You reached a final level of: " + level) + ".";
InvasionSettings.data.InvasionFrames = InvasionSettings.data.InvasionFrames + Number(InvasionFrames);
if (InvasionSettings.data.levelsPlayed != undefined) {
InvasionSettings.data.levelsPlayed++;
} else {
InvasionSettings.data.levelsPlayed = 1;
}
if (InvasionSettings.data.levelsLost != undefined) {
InvasionSettings.data.levelsLost++;
} else {
InvasionSettings.data.levelsLost = 1;
}
InvasionSettings.flush();
i = 1;
while (i <= _root.depth) {
removeMovieClip(_root["newEnemyArrow" + i]);
removeMovieClip(_root["newArrow" + i]);
removeMovieClip(_root["infantry" + i]);
removeMovieClip(_root["archer" + i]);
removeMovieClip(_root["cavalry" + i]);
removeMovieClip(_root["ram" + i]);
removeMovieClip(_root["mangonel" + i]);
removeMovieClip(_root["trebuchet" + i]);
removeMovieClip(_root["jedi" + i]);
removeMovieClip(_root["newWater" + i]);
removeMovieClip(_root["newExplosion" + i]);
removeMovieClip(_root["newCannonball" + i]);
i++;
}
_root.jediArray = new Array();
_root.enemyArrows = new Array();
_root.trebuchetArray = new Array();
_root.infantryArray = new Array();
_root.Arrows = new Array();
_root.mangonelArray = new Array();
_root.ramArray = new Array();
_root.cavalryArray = new Array();
_root.archerArray = new Array();
_root.cannonballs = new Array();
_root.depth = (_root.troopsAlive = (_root.arrowNum = (_root.enemyArrowNum = (_root.jediNumber = (_root.infantryNumber = (_root.archerNumber = (_root.cavalryNumber = (_root.ramNumber = (_root.mangonelNumber = (_root.trebuchetNumber = (_root.InvasionFrames = 0)))))))))));
Frame 9
if (autoSave) {
saveOnOff.gotoAndStop(1);
} else {
saveOnOff.gotoAndStop(2);
}
if (soundOn) {
soundOnOff.gotoAndStop(1);
} else {
soundOnOff.gotoAndStop(2);
}
if (weatherOn) {
weatherOnOff.gotoAndStop(1);
} else {
weatherOnOff.gotoAndStop(2);
}
Instance of Symbol 615 MovieClip in Frame 9
onClipEvent (load) {
stop();
if (_root.qualitySettings == "HIGH") {
this.gotoAndStop(1);
} else if (_root.qualitySettings == "MEDIUM") {
this.gotoAndStop(2);
} else if (_root.qualitySettings == "LOW") {
this.gotoAndStop(3);
}
}
Frame 11
if (InvasionSettings.data.highestLevel != undefined) {
levelScore = ("The highest level you've ever reached is: " + InvasionSettings.data.highestLevel) + ".";
} else {
levelScore = "The highest level you've ever reached is: 0. Shame on you.";
}
if (InvasionSettings.data.levelsPlayed != undefined) {
attendance = (((("Played: " + levelsPlayed) + " Won: ") + levelsWon) + " Lost: ") + levelsLost;
} else {
attendance = "Played: 0 Won: 0 Lost: 0";
}
if (InvasionSettings.data.InvasionFrames != undefined) {
playTime = ("You've played for " + InvasionFrames) + " frames on the battlefield.";
} else {
playTime = "You haven't entered any battles yet.";
}
if (InvasionSettings.data.highestGold != undefined) {
goldCount = ("Your highest amount of gold you've ever had is: " + InvasionSettings.data.highestGold) + ".";
} else {
goldCount = "Your highest amount of gold has yet to be seen.";
}
if (InvasionSettings.data.InvasionBoots != undefined) {
if (InvasionBoots == 1) {
Boots = ("This is your first time playing Invasion Version " + InvasionVersion) + "!";
} else {
Boots = ((("You've played Invasion Version " + InvasionVersion) + " a total of ") + InvasionBoots) + " times!";
}
}
Frame 12
breifing = missions[level];
Frame 13
_root.gotoAndStop(2);
Frame 16
_root.scoretable.filename = "scores/score.sco";
_root.scoretable.scoresize = 15;
if (view == 1) {
_root.scoretable.action = "INSERT";
} else {
_root.scoretable.action = "VIEW";
}
_root.scoretable.viewtype = "FLASH";
_root.scoretable.winname = name;
_root.scoretable.winlevel = level;
_root.scoretable.wingold = gold;
_root.scoretable.loadVariables("http://www.gamesgamesgames.co.uk/scores.php", "GET");
if (view == 1) {
gold = (InvasionSettings.data.gold = undefined);
level = (InvasionSettings.data.level = undefined);
archUpgrades = (InvasionSettings.data.archUpgrades = undefined);
infUpgrades = (InvasionSettings.data.infUpgrades = undefined);
ramUpgrades = (InvasionSettings.data.ramUpgrades = undefined);
cavUpgrades = (InvasionSettings.data.cavUpgrades = undefined);
mangoUpgrades = (InvasionSettings.data.mangoUpgrades = undefined);
trebUpgrades = (InvasionSettings.data.trebUpgrades = undefined);
infCount = (InvasionSettings.data.infCount = undefined);
archCount = (InvasionSettings.data.archCount = undefined);
ramCount = (InvasionSettings.data.ramCount = undefined);
cavCount = (InvasionSettings.data.cavCount = undefined);
mangoCount = (InvasionSettings.data.mangoCount = undefined);
trebCount = (InvasionSettings.data.trebCount = undefined);
}
Symbol 21 MovieClip Frame 1
stop();
Symbol 37 Button
on (release) {
_root[varChange.text] = Number(varChangeBy);
varChange.text = "";
varChangeBy = "";
}
Symbol 38 MovieClip Frame 1
stop();
_parent._visible = false;
Symbol 38 MovieClip Frame 2
_parent._visible = true;
Symbol 38 MovieClip Frame 10
stop();
Symbol 39 MovieClip Frame 10
_parent.gotoAndStop(1);
Symbol 40 MovieClip Frame 1
stop();
Symbol 55 Button
on (release) {
_root.gotoAndStop(3);
}
Symbol 58 Button
on (release) {
gotoAndStop (2);
}
Symbol 61 Button
on (release) {
_root.gotoAndStop(8);
}
Symbol 64 Button
on (release) {
_root.gotoAndStop(9);
}
Symbol 67 Button
on (release) {
_root.gotoAndStop("strategies");
}
Symbol 70 Button
on (release) {
_root.sendScoreFunction(0);
}
Symbol 73 Button
on (release) {
prevFrame();
}
Symbol 76 MovieClip Frame 1
stop();
Symbol 87 MovieClip Frame 1
stop();
Symbol 87 MovieClip Frame 30
gotoAndStop (1);
Symbol 90 Button
on (release) {
bulks = new Array("infBulk", "archBulk", "cavBulk", "ramBulk", "mangoBulk", "trebBulk", "barracksBulk", "fletcheryBulk", "alchemistBulk", "workshopBulk", "stableBulk", "quarryBulk");
_root.enemyArrows = new Array();
_root.trebuchetArray = new Array();
_root.infantryArray = new Array();
_root.Arrows = new Array();
_root.mangonelArray = new Array();
_root.ramArray = new Array();
_root.cavalryArray = new Array();
_root.archerArray = new Array();
_root.cannonballs = new Array();
_root.jediArray = new Array();
_root.archFireChance = (_root.oilDamage = 50);
_root.ramHP = 3;
_root.cavDamage = 60;
_root.infCost = 200;
_root.archCost = 200;
_root.ramCost = 500;
_root.mangoCost = 500;
_root.cavCost = 300;
_root.archSpeed = 1.75;
_root.ramSpeed = (_root.mangoSpeed = 0.75);
_root.level = (_root.arrowType = 1);
_root.infSpeed = 1.5;
_root.cavSpeed = (_root.trebSpeed = 3);
_root.jediSpeed = 2.5;
_root.jediDamage = 10;
_root.enemyArrowType = 2;
_root.infDamage = 2.5;
_root.archDamage = 4.1;
_root.mangoDamage = 10;
_root.ramDamage = 10;
_root.trebDamage = 4.3;
_root.gold = _root.levelGold;
_root.trebCost = 500;
_root.enemyArcherDamage = 25;
_root.mangoAvailable = (_root.infAvailable = (_root.cavAvailable = (_root.archAvailable = (_root.ramAvailable = (_root.trebAvailable = true)))));
_root.enemyHP = _root.castleHP;
_root.arrowNum = (_root.boltNumber = (_root.cavUpgrades = (_root.archUpgrades = (_root.infUpgrades = (_root.ramUpgrades = (_root.mangoUpgrades = (_root.trebUpgrades = (_root.enemyArrowNum = (_root.infCount = (_root.archCount = (_root.cavCount = (_root.ramCount = (_root.mangoCount = (_root.trebCount = (_root.troopCount = (_root.troopsAlive = (_root.infantryNumber = (_root.jediNumber = (_root.archerNumber = (_root.cavalryNumber = (_root.ramNumber = (_root.mangonelNumber = (_root.trebuchetNumber = (_root.archBulk = (_root.infBulk = (_root.ramBulk = (_root.cavBulk = (_root.mangoBulk = (_root.trebBulk = (_root.explosionNum = 0))))))))))))))))))))))))))))));
_root.nextFrame();
}
Symbol 94 Button
on (release) {
if (_root.InvasionSettings.data.level != undefined) {
_root.loadGame();
} else {
noSaveFile.play();
}
}
Symbol 95 MovieClip Frame 1
stop();
Symbol 103 MovieClip Frame 1
stop();
Symbol 103 MovieClip Frame 30
gotoAndStop (1);
Symbol 106 MovieClip Frame 1
stop();
Symbol 108 Button
on (release) {
if (_root.gold >= _root.infCost) {
if (_root.troopsLeft < _root.maxPop) {
_root.infCount++;
_root.gold = _root.gold - _root.infCost;
} else {
_root.popReached.gotoAndPlay(2);
}
}
}
Symbol 113 Button
on (release) {
if (_root.gold >= _root.archCost) {
if (_root.troopsLeft < _root.maxPop) {
_root.archCount++;
_root.gold = _root.gold - _root.archCost;
} else {
_root.popReached.gotoAndPlay(2);
}
}
}
Symbol 118 Button
on (release) {
if (_root.gold >= _root.cavCost) {
if (_root.troopsLeft < _root.maxPop) {
_root.cavCount++;
_root.gold = _root.gold - _root.cavCost;
} else {
_root.popReached.gotoAndPlay(2);
}
}
}
Symbol 124 Button
on (release) {
if (_root.gold >= _root.ramCost) {
if (_root.troopsLeft < _root.maxPop) {
_root.ramCount++;
_root.gold = _root.gold - _root.ramCost;
} else {
_root.popReached.gotoAndPlay(2);
}
}
}
Symbol 129 Button
on (release) {
if (_root.gold >= _root.mangoCost) {
if (_root.troopsLeft < _root.maxPop) {
_root.mangoCount++;
_root.gold = _root.gold - _root.mangoCost;
} else {
_root.popReached.gotoAndPlay(2);
}
}
}
Symbol 134 Button
on (release) {
if (_root.gold >= _root.trebCost) {
if (_root.troopsLeft < _root.maxPop) {
_root.trebCount++;
_root.gold = _root.gold - _root.trebCost;
} else {
_root.popReached.gotoAndPlay(2);
}
}
}
Symbol 148 Button
on (release) {
if (_root.gold >= 500) {
_root.gold = _root.gold - 500;
_root.infUpgrades++;
}
}
Symbol 149 Button
on (release) {
if (_root.gold >= 500) {
_root.gold = _root.gold - 500;
_root.archUpgrades++;
}
}
Symbol 152 Button
on (release) {
if (_root.gold >= 500) {
_root.gold = _root.gold - 500;
_root.trebUpgrades++;
}
}
Symbol 155 Button
on (release) {
if (_root.gold >= 500) {
_root.gold = _root.gold - 500;
_root.ramUpgrades++;
}
}
Symbol 162 Button
on (release) {
if ((((((_root.infBulk != "") && (_root.archBulk != "")) && (_root.ramBulk != "")) && (_root.cavBulk != "")) && (_root.mangoBulk != "")) && (_root.trebBulk != "")) {
if (((((((_root.infBulk * _root.infCost) + (_root.archBulk * _root.archCost)) + (_root.ramBulk * _root.ramCost)) + (_root.cavBulk * _root.cavCost)) + (_root.mangoBulk * _root.mangoCost)) + (_root.trebBulk * _root.trebCost)) != isNaN) {
if (_root.gold >= Number((((((_root.infBulk * _root.infCost) + (_root.archBulk * _root.archCost)) + (_root.ramBulk * _root.ramCost)) + (_root.cavBulk * _root.cavCost)) + (_root.mangoBulk * _root.mangoCost)) + (_root.trebBulk * _root.trebCost))) {
if (Number((((((Number(_root.infBulk) + Number(_root.archBulk)) + Number(_root.ramBulk)) + Number(_root.cavBulk)) + Number(_root.mangoBulk)) + Number(_root.trebBulk)) + Number(_root.troopsLeft)) <= _root.maxPop) {
_root.gold = _root.gold - Number((((((_root.infBulk * _root.infCost) + (_root.archBulk * _root.archCost)) + (_root.ramBulk * _root.ramCost)) + (_root.cavBulk * _root.cavCost)) + (_root.mangoBulk * _root.mangoCost)) + (_root.trebBulk * _root.trebCost));
_root.infCount = _root.infCount + Number(_root.infBulk);
_root.archCount = _root.archCount + Number(_root.archBulk);
_root.ramCount = _root.ramCount + Number(_root.ramBulk);
_root.cavCount = _root.cavCount + Number(_root.cavBulk);
_root.mangoCount = _root.mangoCount + Number(_root.mangoBulk);
_root.trebCount = _root.trebCount + Number(_root.trebBulk);
_root.archBulk = (_root.infBulk = (_root.ramBulk = (_root.cavBulk = (_root.mangoBulk = (_root.trebBulk = 0)))));
_parent.nextFrame();
_root.infAvailable = (_root.archAvailable = (_root.cavAvailable = (_root.ramAvailable = (_root.mangoAvailable = (_root.trebAvailable = true)))));
} else {
_root.popReached.gotoAndPlay(2);
}
}
}
}
}
Symbol 167 MovieClip Frame 1
infantry.restrict = "0-9";
Symbol 171 MovieClip Frame 1
archers.restrict = "0-9";
Symbol 175 MovieClip Frame 1
rams.restrict = "0-9";
Symbol 179 MovieClip Frame 1
saboteurs.restrict = "0-9";
Symbol 183 MovieClip Frame 1
cannons.restrict = "0-9";
Symbol 187 MovieClip Frame 1
cavalry.restrict = "0-9";
Symbol 189 MovieClip Frame 1
_root.infAvailable = (_root.archAvailable = (_root.cavAvailable = (_root.ramAvailable = (_root.mangoAvailable = (_root.trebAvailable = true)))));
_parent._visible = false;
stop();
Instance of Symbol 167 MovieClip in Symbol 189 MovieClip Frame 1
onClipEvent (load) {
if (_root.infAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 171 MovieClip in Symbol 189 MovieClip Frame 1
onClipEvent (load) {
if (_root.archAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 175 MovieClip in Symbol 189 MovieClip Frame 1
onClipEvent (load) {
if (_root.ramAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 179 MovieClip in Symbol 189 MovieClip Frame 1
onClipEvent (load) {
if (_root.cavAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 183 MovieClip in Symbol 189 MovieClip Frame 1
onClipEvent (load) {
if (_root.mangoAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 187 MovieClip in Symbol 189 MovieClip Frame 1
onClipEvent (load) {
if (_root.trebAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Symbol 189 MovieClip Frame 2
_parent._visible = true;
_root.startGame.gotoAndStop(2);
Symbol 189 MovieClip Frame 10
stop();
_root.infAvailable = (_root.archAvailable = (_root.cavAvailable = (_root.ramAvailable = (_root.mangoAvailable = (_root.trebAvailable = false)))));
Symbol 190 MovieClip Frame 1
_root.infAvailable = (_root.archAvailable = (_root.cavAvailable = (_root.ramAvailable = (_root.mangoAvailable = (_root.trebAvailable = true)))));
Instance of Symbol 167 MovieClip in Symbol 190 MovieClip Frame 1
onClipEvent (load) {
if (_root.infAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 171 MovieClip in Symbol 190 MovieClip Frame 1
onClipEvent (load) {
if (_root.archAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 175 MovieClip in Symbol 190 MovieClip Frame 1
onClipEvent (load) {
if (_root.ramAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 179 MovieClip in Symbol 190 MovieClip Frame 1
onClipEvent (load) {
if (_root.cavAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 183 MovieClip in Symbol 190 MovieClip Frame 1
onClipEvent (load) {
if (_root.mangoAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 187 MovieClip in Symbol 190 MovieClip Frame 1
onClipEvent (load) {
if (_root.trebAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Symbol 190 MovieClip Frame 10
stop();
_parent.prevFrame();
_root.startGame.gotoAndStop(1);
Symbol 191 MovieClip Frame 1
stop();
_root.startGame.gotoAndStop(1);
Symbol 194 Button
on (release) {
if (_root.gold >= 500) {
_root.gold = _root.gold - 500;
_root.cavUpgrades++;
}
}
Symbol 197 Button
on (release) {
if (_root.gold >= 500) {
_root.gold = _root.gold - 500;
_root.mangoUpgrades++;
}
}
Symbol 200 MovieClip Frame 1
barracks.restrict = "0-9";
Symbol 203 MovieClip Frame 1
fletchery.restrict = "0-9";
Symbol 206 MovieClip Frame 1
alchemist.restrict = "0-9";
Symbol 209 MovieClip Frame 1
workshop.restrict = "0-9";
Symbol 212 MovieClip Frame 1
quarry.restrict = "0-9";
Symbol 215 MovieClip Frame 1
stable.restrict = "0-9";
Symbol 217 Button
on (release) {
if ((((((barracksBulk != "") && (fletcheryBulk != "")) && (alchemistBulk != "")) && (workshopBulk != "")) && (stableBulk != "")) && (quarryBulk != "")) {
if (((((((_root.barracksBulk * 250) + (_root.fletcheryBulk * 300)) + (_root.workshopBulk * 500)) + (_root.alchemistBulk * 500)) + (_root.quarryBulk * 500)) + (_root.stableBulk * 500)) != isNaN) {
if (_root.gold >= Number((((((_root.barracksBulk * 250) + (_root.fletcheryBulk * 300)) + (_root.workshopBulk * 500)) + (_root.alchemistBulk * 500)) + (_root.quarryBulk * 500)) + (_root.stableBulk * 500))) {
_root.gold = _root.gold - Number((((((_root.barracksBulk * 250) + (_root.fletcheryBulk * 300)) + (_root.workshopBulk * 500)) + (_root.alchemistBulk * 500)) + (_root.quarryBulk * 500)) + (_root.stableBulk * 500));
_root.infUpgrades = _root.infUpgrades + Number(_root.barracksBulk);
_root.archUpgrades = _root.archUpgrades + Number(_root.fletcheryBulk);
_root.ramUpgrades = _root.ramUpgrades + Number(_root.workshopBulk);
_root.cavUpgrades = _root.cavUpgrades + Number(_root.alchemistBulk);
_root.mangoUpgrades = _root.mangoUpgrades + Number(_root.quarryBulk);
_root.trebUpgrades = _root.trebUpgrades + Number(_root.stableBulk);
_root.barracksBulk = (_root.fletcheryBulk = (_root.workshopBulk = (_root.quarryBulk = (_root.alchemistBulk = (_root.stableBulk = 0)))));
}
}
}
}
Symbol 226 Button
on (release) {
if (_root.bulkBuy._currentframe == 1) {
if (_root.bulkBuy.slideIn._currentframe == 1) {
_root.bulkBuy.slideIn.play();
} else {
_root.bulkBuy.nextFrame();
}
}
}
Symbol 240 Button
on (release) {
_root.InvasionFrames = 0;
if (_root.troopsLeft > 0) {
_root.gotoAndStop(5);
} else {
_root.noUnits.play();
}
}
Symbol 242 MovieClip Frame 1
stop();
Symbol 280 MovieClip Frame 62
_root.Water.duplicateMovieClip("newWater" + _root.waterNum, _root.depth++, {_x:453, _y:157});
_root.waterNum++;
Symbol 304 MovieClip Frame 1301
gotoAndPlay (1);
Symbol 305 MovieClip Frame 1
stop();
Symbol 326 MovieClip Frame 2
if (_root.soundOn) {
deathSound = new Sound(this);
deathSound.attachSound("cannonSound");
deathSound.start();
}
_root.cannonball.duplicateMovieClip("newCannonball" + _root.cannonballNum, _root.depth++, {_x:_parent._x, _y:_parent._y});
_root.cannonballNum++;
_root.cannonballs[_root.cannonballNum] = 1;
_root["newCannonball" + _root.cannonballNum].number = _root.cannonballNum;
Symbol 329 MovieClip Frame 16
_root.troopsAlive--;
removeMovieClip(_parent);
Symbol 337 Button
on (release, keyPress "q") {
if (_quality == "HIGH") {
_quality = "MEDIUM";
cursor._visible = true;
Mouse.hide();
} else if (_quality == "MEDIUM") {
_quality = "LOW";
cursor._visible = false;
Mouse.show();
} else {
_quality = "HIGH";
cursor._visible = true;
Mouse.hide();
}
}
Symbol 358 MovieClip Frame 1
if (_root.soundOn) {
deathSound = new Sound(this);
deathSound.attachSound("swordSound");
deathSound.start();
}
delete _parent.speed;
Symbol 358 MovieClip Frame 5
_root.enemyHP = _root.enemyHP - _root.trebAttack;
Symbol 360 MovieClip Frame 2
if (_root.soundOn) {
deathSound = new Sound(this);
deathSound.attachSound("horseDie");
deathSound.start();
}
Symbol 360 MovieClip Frame 10
_root.troopsAlive--;
removeMovieClip(_parent);
Symbol 373 MovieClip Frame 1
delete _parent.speed;
Symbol 373 MovieClip Frame 9
_root.enemyHP = _root.enemyHP - _root.ramAttack;
Symbol 377 MovieClip Frame 19
_root.troopsAlive--;
removeMovieClip(_parent);
Symbol 390 MovieClip Frame 1
delete _parent.speed;
Symbol 390 MovieClip Frame 3
if (_root.soundOn) {
deathSound = new Sound(this);
deathSound.attachSound("swordSound");
deathSound.start();
}
Symbol 390 MovieClip Frame 6
_root.enemyHP = _root.enemyHP - _root.infAttack;
Symbol 390 MovieClip Frame 13
gotoAndPlay (3);
Symbol 392 MovieClip Frame 2
if (_root.soundOn) {
deathSound = new Sound(this);
deathSound.attachSound("death" + (random(9) + 1));
deathSound.start();
}
Symbol 392 MovieClip Frame 26
_root.troopsAlive--;
removeMovieClip(_parent);
Instance of Symbol 407 MovieClip in Symbol 408 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_root.arrowType);
}
Symbol 408 MovieClip Frame 4
if (_root.soundOn) {
arrowSound1 = new Sound(this);
arrowSound1.attachSound("arrowSound");
arrowSound1.start();
}
Symbol 408 MovieClip Frame 9
_root.archerArrow.duplicateMovieClip("newArrow" + _root.arrowNum, _root.depth++, {_x:_parent._x, _y:_parent._y});
_root.arrowNum++;
_root.Arrows[_root.arrowNum] = 1;
Symbol 410 MovieClip Frame 2
if (_root.soundOn) {
deathSound = new Sound(this);
deathSound.attachSound("death" + (random(9) + 1));
deathSound.start();
}
Symbol 410 MovieClip Frame 26
_root.troopsAlive--;
removeMovieClip(_parent);
Symbol 413 MovieClip Frame 6
if (hitTest(_root.castle)) {
_root.enemyHP = _root.enemyHP - _root.cavAttack;
}
removeMovieClip(this);
Symbol 420 MovieClip Frame 1
stop();
Symbol 424 Button
on (release) {
changeLevel(7);
}
Symbol 442 MovieClip Frame 1
delete _parent.speed;
Symbol 442 MovieClip Frame 4
_root.enemyHP = _root.enemyHP - _root.jediAttack;
Symbol 459 MovieClip Frame 2
if (_root.soundOn) {
deathSound = new Sound(this);
deathSound.attachSound("death" + (random(9) + 1));
deathSound.start();
}
Symbol 459 MovieClip Frame 26
removeMovieClip(_parent);
Symbol 478 MovieClip Frame 1
_root.explosion.duplicateMovieClip("newExplosion" + _root.explosionNum, _root.depth++, {_x:_parent._x, _y:_parent._y});
_root.explosionNum++;
Symbol 478 MovieClip Frame 2
if (_root.soundOn) {
deathSound = new Sound(this);
deathSound.attachSound("explosionSound");
deathSound.start();
}
Symbol 478 MovieClip Frame 9
_root.troopsAlive--;
removeMovieClip(_parent);
Symbol 481 Button
on (release) {
if (_root.infCount > 0) {
deploy("infantry");
_root.infCount--;
}
}
Symbol 482 Button
on (release) {
if (_root.archCount > 0) {
deploy("archer");
_root.archCount--;
}
}
Symbol 483 Button
on (release) {
if (_root.ramCount > 0) {
deploy("ram");
_root.ramCount--;
}
}
Symbol 484 Button
on (release) {
if (_root.cavCount > 0) {
deploy("cavalry");
_root.cavCount--;
}
}
Symbol 485 Button
on (release) {
if (_root.mangoCount > 0) {
deploy("mangonel");
_root.mangoCount--;
}
}
Symbol 486 Button
on (release) {
if (_root.trebCount > 0) {
deploy("trebuchet");
_root.trebCount--;
}
}
on (keyPress ";") {
if (_root.jediOn == 1) {
deploy("jedi");
}
}
Symbol 515 MovieClip Frame 1
hitTimes = random(_root.level) + 1;
Symbol 515 MovieClip Frame 27
i = 0;
while (i <= _root.infantryNumber) {
if (hit < hitTimes) {
if (_root.infantryArray[i] == 1) {
if (hitTest(_root["infantry" + i])) {
_root["infantry" + i].gotoAndStop(3);
_root.infantryArray[i] = 0;
hit++;
}
}
}
i++;
}
i = 0;
while (i <= _root.cavalryNumber) {
if (hit < hitTimes) {
if (_root.cavalryArray[i] == 1) {
if (hitTest(_root["cavalry" + i])) {
_root["cavalry" + i].gotoAndStop(2);
_root.cavalryArray[i] = 0;
hit++;
}
}
}
i++;
}
i = 0;
while (i <= _root.trebuchetNumber) {
if (hit < hitTimes) {
if (_root.trebuchetArray[i] == 1) {
if (hitTest(_root["trebuchet" + i])) {
_root["trebuchet" + i].HP--;
hit++;
if (_root["trebuchet" + i].HP < 1) {
_root["trebuchet" + i].gotoAndStop(3);
_root.trebuchetArray[i] = 0;
}
}
}
}
i++;
}
i = 0;
while (i <= _root.ramNumber) {
if (hit < hitTimes) {
if (_root.ramArray[i] == 1) {
if (hitTest(_root["ram" + i])) {
_root["ram" + i].HP--;
hit++;
if (_root["ram" + i].HP < 1) {
_root["ram" + i].gotoAndStop(3);
_root.ramArray[i] = 0;
}
}
}
}
i++;
}
i = 0;
while (i <= _root.jediNumber) {
if (hit < hitTimes) {
if (_root.jediArray[i] == 1) {
if (hitTest(_root["jedi" + i])) {
if (hitTest(_root["jedi" + i])) {
_root["jedi" + i].gotoAndStop(3);
_root.jediArray[i] = 0;
hit++;
}
}
}
}
i++;
}
Symbol 515 MovieClip Frame 32
removeMovieClip(this);
Symbol 533 Button
on (release) {
_root.InvasionSettings.data.infCount = _root.infCount;
_root.InvasionSettings.data.archCount = _root.archCount;
_root.InvasionSettings.data.ramCount = _root.ramCount;
_root.InvasionSettings.data.cavCount = _root.cavCount;
_root.InvasionSettings.data.mangoCount = _root.mangoCount;
_root.InvasionSettings.data.trebCount = _root.trebCount;
_root.InvasionSettings.data.gold = _root.gold;
_root.InvasionSettings.data.infUpgrades = _root.infUpgrades;
_root.InvasionSettings.data.archUpgrades = _root.archUpgrades;
_root.InvasionSettings.data.ramUpgrades = _root.ramUpgrades;
_root.InvasionSettings.data.cavUpgrades = _root.cavUpgrades;
_root.InvasionSettings.data.mangoUpgrades = _root.mangoUpgrades;
_root.InvasionSettings.data.trebUpgrades = _root.trebUpgrades;
_root.InvasionSettings.data.arrowType = _root.arrowType;
_root.InvasionSettings.data.level = _root.level;
_root.InvasionSettings.flush();
}
Symbol 538 Button
on (release) {
gotoAndStop (4);
enemyHP = level * 1000;
}
Symbol 542 Button
on (release) {
_root.sendScore.play();
}
Symbol 549 Button
on (release) {
gotoAndStop (20);
}
Symbol 553 Button
on (release) {
play();
}
Symbol 557 Button
on (release) {
if (_root.name != "") {
_root.sendScoreFunction(1);
} else {
noName.gotoAndPlay(2);
}
}
Symbol 560 MovieClip Frame 1
stop();
Symbol 561 MovieClip Frame 1
stop();
Symbol 561 MovieClip Frame 10
stop();
Symbol 561 MovieClip Frame 19
gotoAndStop (1);
Symbol 567 Button
on (release) {
gotoAndStop (2);
}
Symbol 571 Button
on (release) {
gotoAndStop (2);
}
Symbol 584 Button
on (release) {
getURL ("http://www.gamesgamesgames.co.uk/", "_blank");
}
Symbol 587 Button
on (release) {
getURL ("http://www.wildfiredesigns.area526.net", _blank);
}
Symbol 593 Button
on (press) {
gotoAndStop (2);
}
Symbol 595 Button
on (press) {
gotoAndStop (1);
}
Symbol 597 MovieClip Frame 1
_root.InvasionSettings.data.weatherOn = true;
_root.weatherOn = true;
Symbol 597 MovieClip Frame 2
_root.InvasionSettings.data.weatherOn = false;
_root.weatherOn = false;
Symbol 598 Button
on (press) {
gotoAndStop (2);
}
Symbol 599 Button
on (press) {
gotoAndStop (1);
}
Symbol 601 MovieClip Frame 1
_root.soundOn = true;
_root.InvasionSettings.data.soundOn = true;
Symbol 601 MovieClip Frame 2
_root.soundOn = false;
_root.InvasionSettings.data.soundOn = false;
Symbol 602 Button
on (press) {
gotoAndStop (2);
}
Symbol 603 Button
on (press) {
gotoAndStop (1);
}
Symbol 605 MovieClip Frame 1
_root.autoSave = true;
_root.InvasionSettings.data.autoSave = true;
Symbol 605 MovieClip Frame 2
_root.autoSave = false;
_root.InvasionSettings.data.autoSave = false;
Symbol 610 Button
on (press) {
gotoAndStop (2);
}
Symbol 611 Button
on (press) {
gotoAndStop (3);
}
Symbol 613 Button
on (press) {
gotoAndStop (1);
}
Symbol 615 MovieClip Frame 1
_root.qualitySettings = "HIGH";
_root.InvasionSettings.data.qualitySettings = "HIGH";
Symbol 615 MovieClip Frame 2
_root.qualitySettings = "MEDIUM";
_root.InvasionSettings.data.qualitySettings = "MEDIUM";
Symbol 615 MovieClip Frame 3
_root.qualitySettings = "LOW";
_root.InvasionSettings.data.qualitySettings = "LOW";
Symbol 620 Button
on (release) {
_root.gotoAndStop(11);
}
Symbol 624 Button
on (release) {
_root.gotoAndStop(3);
}
Symbol 642 Button
on (release) {
_root.nextFrame();
}
Symbol 645 Button
on (release) {
_root.prevFrame();
}
Symbol 713 Button
on (release) {
_root.gotoAndStop(2);
}