Frame 1
function enemyArrowFunc() {
var _local1 = _root;
_local1.enemyArrow.duplicateMovieClip("newEnemyArrow" + _local1.enemyArrowNum, _local1.depth++, {_x:475, _y:230});
_local1.enemyArrowNum++;
_local1.enemyArrows[_local1.enemyArrowNum] = 1;
}
function deploy(troop) {
var _local1 = troop;
var _local2 = _root;
_local2.troopsAlive++;
_local2[_local1 + "Number"]++;
_local2[_local1 + "Array"][_local2[_local1 + "Number"]] = 1;
if (_local1 != "ram") {
_local2[_local1 + "Clip"].duplicateMovieClip(_local1 + _local2[_local1 + "Number"], _local2.depth++, {_x:_local2[_local1 + "Clip"]._x + random(20), _y:_local2[_local1 + "Clip"]._y - random(20)});
} else {
_local2[_local1 + "Clip"].duplicateMovieClip(_local1 + _local2[_local1 + "Number"], _local2.depth++, {_x:_local2[_local1 + "Clip"]._x + random(20), _y:_local2[_local1 + "Clip"]._y});
}
}
function changeLevel(frame) {
var _local1 = _root;
i = 1;
while (i < (_local1.depth + 1)) {
removeMovieClip(_local1["newEnemyArrow" + i]);
removeMovieClip(_local1["newArrow" + i]);
removeMovieClip(_local1["infantry" + i]);
removeMovieClip(_local1["archer" + i]);
removeMovieClip(_local1["cavalry" + i]);
removeMovieClip(_local1["ram" + i]);
removeMovieClip(_local1["mangonel" + i]);
removeMovieClip(_local1["trebuchet" + i]);
removeMovieClip(_local1["newWater" + i]);
removeMovieClip(_local1["newExplosion" + i]);
removeMovieClip(_local1["newCannonball" + i]);
removeMovieClip(_local1["jedi" + i]);
i++;
}
_local1.jediArray = new Array();
_local1.enemyArrows = new Array();
_local1.trebuchetArray = new Array();
_local1.infantryArray = new Array();
_local1.Arrows = new Array();
_local1.mangonelArray = new Array();
_local1.ramArray = new Array();
_local1.cavalryArray = new Array();
_local1.archerArray = new Array();
_local1.cannonballs = new Array();
gotoAndStop(frame);
cursor._visible = true;
Mouse.hide();
}
_root.onEnterFrame = function () {
var _local1 = _root;
if (_currentframe != 5) {
_local1.depth = (_local1.troopsAlive = (_local1.arrowNum = (_local1.enemyArrowNum = (_local1.jediNumber = (_local1.infantryNumber = (_local1.archerNumber = (_local1.cavalryNumber = (_local1.ramNumber = (_local1.mangonelNumber = (_local1.trebuchetNumber = 0))))))))));
i = 1;
while (i < (_local1.depth + 1)) {
removeMovieClip(_local1["newEnemyArrow" + i]);
removeMovieClip(_local1["newArrow" + i]);
removeMovieClip(_local1["infantry" + i]);
removeMovieClip(_local1["archer" + i]);
removeMovieClip(_local1["cavalry" + i]);
removeMovieClip(_local1["ram" + i]);
removeMovieClip(_local1["mangonel" + i]);
removeMovieClip(_local1["trebuchet" + i]);
removeMovieClip(_local1["jedi" + i]);
removeMovieClip(_local1["newWater" + i]);
removeMovieClip(_local1["newExplosion" + i]);
removeMovieClip(_local1["newCannonball" + i]);
i++;
}
_local1.jediArray = new Array();
_local1.enemyArrows = new Array();
_local1.trebuchetArray = new Array();
_local1.infantryArray = new Array();
_local1.Arrows = new Array();
_local1.mangonelArray = new Array();
_local1.ramArray = new Array();
_local1.cavalryArray = new Array();
_local1.archerArray = new Array();
_local1.cannonballs = new Array();
}
if (_currentframe == 1) {
if (!mLoaded) {
loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
loadedkbytes = Math.ceil(loadedbytes / 1024);
totalkbytes = Math.ceil(totalbytes / 1024);
if (loadedbytes == totalbytes) {
gotoAndStop (2);
mLoaded = true;
}
percentage = int(loadedbytes / (totalbytes / 100));
loader.gotoAndStop(percentage);
}
} else if (_currentframe == 4) {
i = 0;
while (i < (bulks.length + 1)) {
if (_local1[bulks[i]] == "") {
_local1[bulks[i]] = Number(0);
}
i++;
}
_local1.goldField.text = ("You have " + _local1.gold) + " gold.";
troopsLeft = ((((infCount + archCount) + cavCount) + ramCount) + mangoCount) + trebCount;
} else if (_currentframe == 5) {
InvasionFrames++;
arrowFrameDelay--;
_local1.hBar._width = (_local1.enemyHP / _local1.enemyHPmax) * 200;
if (((_local1.enemyHP / _local1.enemyHPmax) * 200) > 1) {
_local1.castle.gotoAndStop(Math.round((_local1.enemyHP / _local1.enemyHPmax) * 100));
} else {
changeLevel(6);
}
if (Key.isDown(112)) {
if (_local1.infCount > 0) {
deploy("infantry");
_local1.infCount--;
}
} else if (Key.isDown(113)) {
if (_local1.archCount > 0) {
deploy("archer");
_local1.archCount--;
}
} else if (Key.isDown(114)) {
if (_local1.ramCount > 0) {
deploy("ram");
_local1.ramCount--;
}
} else if (Key.isDown(115)) {
if (_local1.cavCount > 0) {
deploy("cavalry");
_local1.cavCount--;
}
} else if (Key.isDown(116)) {
if (_local1.mangoCount > 0) {
deploy("mangonel");
_local1.mangoCount--;
}
} else if (Key.isDown(117)) {
if (_local1.trebCount > 0) {
deploy("trebuchet");
_local1.trebCount--;
}
}
troopsLeft = ((((infCount + archCount) + cavCount) + ramCount) + mangoCount) + trebCount;
if (arrowFrameDelay <= 0) {
if (arrowsFired != arrowsToFire) {
_local1.enemyArrowFunc();
arrowsFired++;
} else {
arrowFrameDelay = arrowFrameDelayInit;
arrowsFired = 0;
}
}
if (_local1.troopsLeft == 0) {
if (_local1.troopsAlive == 0) {
changeLevel(7);
}
}
if (jediOn == 1) {
i = 0;
while (i < (_local1.jediNumber + 1)) {
if (_local1.jediArray[i] == 1) {
if (!_local1["jedi" + i].hitTest(_local1.castle)) {
_local1["jedi" + i]._x = _local1["jedi" + i]._x + _local1["jedi" + i].speed;
_local1["jedi" + i]._y = _local1["jedi" + i]._y - (Math.random() - 0.5);
} else {
_local1["jedi" + i].gotoAndStop(2);
}
}
i++;
}
}
i = 0;
while (i < (_local1.infantryNumber + 1)) {
if (_local1.infantryArray[i] == 1) {
if (!_local1["infantry" + i].hitTest(_local1.castle)) {
_local1["infantry" + i]._x = _local1["infantry" + i]._x + _local1["infantry" + i].speed;
_local1["infantry" + i]._y = _local1["infantry" + i]._y - (Math.random() - 0.5);
} else {
_local1["infantry" + i].gotoAndStop(2);
}
}
i++;
}
i = 0;
while (i < (_local1.trebuchetNumber + 1)) {
if (_local1.trebuchetArray[i] == 1) {
if (!_local1["trebuchet" + i].hitTest(_local1.castle)) {
_local1["trebuchet" + i]._x = _local1["trebuchet" + i]._x + _local1["trebuchet" + i].speed;
_local1["trebuchet" + i]._y = _local1["trebuchet" + i]._y - (Math.random() - 0.5);
} else {
_local1["trebuchet" + i].gotoAndStop(2);
}
}
i++;
}
i = 0;
while (i < (_local1.cavalryNumber + 1)) {
if (_local1.cavalryArray[i] == 1) {
if (!_local1["cavalry" + i].hitTest(_local1.castle)) {
_local1["cavalry" + i]._x = _local1["cavalry" + i]._x + _local1["cavalry" + i].speed;
_local1["cavalry" + i]._y = _local1["cavalry" + i]._y - (Math.random() - 0.5);
} else {
_local1["cavalry" + i].gotoAndStop(2);
}
}
i++;
}
i = 0;
while (i < (_local1.ramNumber + 1)) {
if (_local1.ramArray[i] == 1) {
if (!_local1["ram" + i].hitTest(_local1.castle)) {
if (!_local1["ram" + i].touching) {
_local1["ram" + i]._x = _local1["ram" + i]._x + _local1["ram" + i].speed;
_local1["ram" + i].wheel1._rotation = _local1["ram" + i].wheel1._rotation + _local1["ram" + i].speed;
_local1["ram" + i].wheel2._rotation = _local1["ram" + i].wheel2._rotation + _local1["ram" + i].speed;
_local1["ram" + i].wheel3._rotation = _local1["ram" + i].wheel3._rotation + _local1["ram" + i].speed;
}
} else {
_local1["ram" + i].gotoAndStop(2);
_local1["ram" + i].touching = true;
}
}
i++;
}
i = 0;
while (i < (_local1.archerNumber + 1)) {
if (_local1.archerArray[i] == 1) {
if ((_local1["archer" + i].stopChance != _local1.archFireChance) && (_local1["archer" + i]._x < (250 - _local1["archer" + i].decrement))) {
_local1["archer" + i]._x = _local1["archer" + i]._x + _local1["archer" + i].speed;
_local1["archer" + i]._y = _local1["archer" + i]._y - (Math.random() - 0.5);
} else if (_local1["archer" + i]._x > 100) {
_local1["archer" + i].gotoAndStop(2);
} else {
_local1["archer" + i]._x = _local1["archer" + i]._x + _local1["archer" + i].speed;
_local1["archer" + i]._y = _local1["archer" + i]._y - (Math.random() - 0.5);
}
}
i++;
}
i = 0;
while (i < (_local1.mangonelNumber + 1)) {
if (_local1.mangonelArray[i] == 1) {
if (_local1["mangonel" + i]._x < (250 - _local1["mangonel" + i].decrement)) {
_local1["mangonel" + i]._x = _local1["mangonel" + i]._x + _local1["mangonel" + i].speed;
_local1["mangonel" + i]._y = _local1["mangonel" + i]._y - (Math.random() - 0.5);
} else if (_local1["mangonel" + i]._x > 100) {
_local1["mangonel" + i].gotoAndStop(2);
} else {
_local1["mangonel" + i]._x = _local1["mangonel" + i]._x + _local1["mangonel" + i].speed;
_local1["mangonel" + i]._y = _local1["mangonel" + i]._y - (Math.random() - 0.5);
}
}
i++;
}
i = 0;
while (i < _local1.cannonballs.length) {
if (_local1.cannonballs[i] == 1) {
if (!_local1["newCannonball" + i].hitTest(_local1.castle)) {
if (!_local1["newCannonball" + i].toggleDown) {
if (_local1["newCannonball" + i].upspeed < _local1["newCannonball" + i].climbStop) {
_local1["newCannonball" + i].upspeed = _local1["newCannonball" + i].upspeed + 0.4;
_local1["newCannonball" + i].rightspeed = _local1["newCannonball" + i].rightspeed + 0.5;
} else {
_local1["newCannonball" + i].toggleDown = true;
}
}
if (_local1["newCannonball" + i].toggleDown) {
_local1["newCannonball" + i].rightspeed = _local1["newCannonball" + i].rightspeed - 0.02;
_local1["newCannonball" + i].upspeed = _local1["newCannonball" + i].upspeed - 0.2;
}
_local1["newCannonball" + i]._x = _local1["newCannonball" + i]._x + (_local1["newCannonball" + i].rightspeed * 2);
_local1["newCannonball" + i]._rotation = _local1["newCannonball" + i]._rotation + _local1["newCannonball" + i].rotate;
_local1["newCannonball" + i]._y = _local1["newCannonball" + i]._y - (_local1["newCannonball" + i].upspeed * 2);
} else {
_local1["newCannonball" + i].toggleDamage = true;
if (_local1["newCannonball" + i]._currentframe < _local1["newCannonball" + i]._totalframes) {
_local1["newCannonball" + i].play();
} else {
_local1.cannonballs[i] = 0;
removeMovieClip(_local1["newCannonball" + i]);
}
}
if ((_local1["newCannonball" + i]._x > Stage.width) || (_local1["newCannonball" + i]._y > 330)) {
_local1.cannonballs[i] = 0;
removeMovieClip(_local1["newCannonball" + i]);
}
if (_local1["newCannonball" + i].toggleDamage) {
_local1.enemyHP = _local1.enemyHP - _local1.mangoAttack;
}
}
i++;
}
i = 0;
while (i < _local1.Arrows.length) {
if (_local1.Arrows[i] == 1) {
if (!_local1["newArrow" + i].hitTest(_local1.castle)) {
if (!_local1["newArrow" + i].toggleDown) {
if (_local1["newArrow" + i].upspeed < _local1["newArrow" + i].climbStop) {
_local1["newArrow" + i].upspeed = _local1["newArrow" + i].upspeed + 0.4;
_local1["newArrow" + i].rightspeed = _local1["newArrow" + i].rightspeed + 0.5;
} else {
_local1["newArrow" + i].toggleDown = true;
}
}
if (_local1["newArrow" + i].toggleDown) {
_local1["newArrow" + i].rightspeed = _local1["newArrow" + i].rightspeed - 0.02;
_local1["newArrow" + i].upspeed = _local1["newArrow" + i].upspeed - 0.2;
}
_local1["newArrow" + i]._x = _local1["newArrow" + i]._x + (_local1["newArrow" + i].rightspeed * 2);
_local1["newArrow" + i]._rotation = _local1["newArrow" + i]._rotation + _local1["newArrow" + i].rotate;
_local1["newArrow" + i]._y = _local1["newArrow" + i]._y - (_local1["newArrow" + i].upspeed * 2);
} else {
_local1["newArrow" + i].toggleDamage = true;
if (_local1["newArrow" + i]._alpha > 0) {
_local1["newArrow" + i]._alpha = _local1["newArrow" + i]._alpha - 10;
} else {
_local1.Arrows[i] = 0;
removeMovieClip(_local1["newArrow" + i]);
}
}
if ((_local1["newArrow" + i]._x > Stage.width) || (_local1["newArrow" + i]._y > 330)) {
_local1.Arrows[i] = 0;
removeMovieClip(_local1["newArrow" + i]);
}
if (_local1["newArrow" + i].toggleDamage) {
_local1.enemyHP = _local1.enemyHP - _local1.archAttack;
}
}
i++;
}
i = 0;
while (i < _local1.enemyArrows.length) {
if (_local1.enemyArrows[i] == 1) {
if (!_local1["newArrow" + i].hitPlayer) {
if (!_local1["newEnemyArrow" + i].fadeStarted) {
if (!_local1["newEnemyArrow" + i].toggleDown) {
if (_local1["newEnemyArrow" + i].upspeed < _local1["newEnemyArrow" + i].climbStop) {
_local1["newEnemyArrow" + i].upspeed = _local1["newEnemyArrow" + i].upspeed + 0.8;
_local1["newEnemyArrow" + i].leftspeed = _local1["newEnemyArrow" + i].leftspeed + 0.4;
} else {
_local1["newEnemyArrow" + i].toggleDown = true;
}
}
if (_local1["newEnemyArrow" + i].toggleDown) {
_local1["newEnemyArrow" + i].leftspeed = _local1["newEnemyArrow" + i].leftspeed - 0.06;
_local1["newEnemyArrow" + i].upspeed = _local1["newEnemyArrow" + i].upspeed - 0.4;
}
_local1["newEnemyArrow" + i]._x = _local1["newEnemyArrow" + i]._x - (_local1["newEnemyArrow" + i].leftspeed * 3);
_local1["newEnemyArrow" + i]._rotation = _local1["newEnemyArrow" + i]._rotation + (_local1["newEnemyArrow" + i].rotate * 2);
_local1["newEnemyArrow" + i]._y = _local1["newEnemyArrow" + i]._y - (_local1["newEnemyArrow" + i].upspeed * 2);
j = 0;
while (j < (_local1.infantryNumber + 1)) {
if (_local1.infantryArray[j] == 1) {
if (!_local1["newEnemyArrow" + i].fadeStarted) {
if (!_local1["newEnemyArrow" + i].hitPlayer) {
if (_local1["newEnemyArrow" + i].hitTest(_local1["infantry" + j])) {
_local1["infantry" + j].gotoAndStop(3);
_local1.infantryArray[j] = 0;
_local1["newEnemyArrow" + i].hitPlayer = true;
_local1["newEnemyArrow" + i].startFade = true;
}
}
}
}
j++;
}
j = 0;
while (j < (_local1.jediNumber + 1)) {
if (_local1.jediArray[j] == 1) {
if (!_local1["newEnemyArrow" + i].fadeStarted) {
if (!_local1["newEnemyArrow" + i].hitPlayer) {
if (_local1["newEnemyArrow" + i].hitTest(_local1["jedi" + j])) {
_local1["jedi" + j].gotoAndStop(3);
_local1.jediArray[j] = 0;
_local1["newEnemyArrow" + i].hitPlayer = true;
_local1["newEnemyArrow" + i].startFade = true;
}
}
}
}
j++;
}
j = 0;
while (j < (_local1.archerNumber + 1)) {
if (_local1.archerArray[j] == 1) {
if (!_local1["newEnemyArrow" + i].fadeStarted) {
if (!_local1["newEnemyArrow" + i].hitPlayer) {
if (_local1["newEnemyArrow" + i].hitTest(_local1["archer" + j])) {
_local1["archer" + j].gotoAndStop(3);
_local1.archerArray[j] = 0;
_local1["newEnemyArrow" + i].hitPlayer = true;
_local1["newEnemyArrow" + i].startFade = true;
}
}
}
}
j++;
}
j = 0;
while (j < (_local1.cavalryNumber + 1)) {
if (_local1.cavalryArray[j] == 1) {
if (!_local1["newEnemyArrow" + i].fadeStarted) {
if (!_local1["newEnemyArrow" + i].hitPlayer) {
if (_local1["newEnemyArrow" + i].hitTest(_local1["cavalry" + j])) {
_local1["cavalry" + j].gotoAndStop(2);
_local1.cavalryArray[j] = 0;
_local1["newEnemyArrow" + i].hitPlayer = true;
_local1["newEnemyArrow" + i].startFade = true;
}
}
}
}
j++;
}
j = 0;
while (j < (_local1.ramNumber + 1)) {
if (_local1.ramArray[j] == 1) {
if (_local1["newEnemyArrow" + i].hitTest(_local1["ram" + j])) {
if (!_local1["newEnemyArrow" + i].fadeStarted) {
if (!_local1["newEnemyArrow" + i].hitPlayer) {
_local1["newEnemyArrow" + i].hitPlayer = true;
_local1["newEnemyArrow" + i].startFade = true;
_local1["ram" + j].HP--;
if (_local1["ram" + j].HP < 1) {
_local1["ram" + j].gotoAndStop(3);
}
}
}
_local1["newEnemyArrow" + i]._x = _local1["newEnemyArrow" + i]._x + _local1["ram" + j].speed;
}
}
j++;
}
j = 0;
while (j < (_local1.mangonelNumber + 1)) {
if (_local1.mangonelArray[j] == 1) {
if (!_local1["newEnemyArrow" + i].fadeStarted) {
if (!_local1["newEnemyArrow" + i].hitPlayer) {
if (_local1["newEnemyArrow" + i].hitTest(_local1["mangonel" + j])) {
_local1["mangonel" + j].gotoAndStop(3);
_local1.mangonelArray[j] = 0;
_local1["newEnemyArrow" + i].hitPlayer = true;
_local1["newEnemyArrow" + i].startFade = true;
}
}
}
}
j++;
}
j = 0;
while (j < (_local1.trebuchetNumber + 1)) {
if (_local1.trebuchetArray[j] == 1) {
if (!_local1["newEnemyArrow" + i].fadeStarted) {
if (!_local1["newEnemyArrow" + i].hitPlayer) {
if (_local1["newEnemyArrow" + i].hitTest(_local1["trebuchet" + j])) {
_local1["trebuchet" + j].gotoAndStop(3);
_local1.trebuchetArray[j] = 0;
_local1["newEnemyArrow" + i].hitPlayer = true;
_local1["newEnemyArrow" + i].startFade = true;
}
}
}
}
j++;
}
}
}
if (_local1["newEnemyArrow" + i]._x < 0) {
_local1.enemyArrows[i] = 0;
removeMovieClip(_local1["newEnemyArrow" + i]);
}
if ((_local1["newEnemyArrow" + i]._y >= 300) || (_local1["newEnemyArrow" + i].hitPlayer)) {
if (!_local1["newEnemyArrow" + i].fadeStarted) {
_local1["newEnemyArrow" + i].startFade = true;
}
}
if (_local1["newEnemyArrow" + i].startFade) {
if (!_local1["newEnemyArrow" + i].fadeStarted) {
_local1["newEnemyArrow" + i].fadeStarted = true;
}
if (_local1["newEnemyArrow" + i]._alpha > 0) {
_local1["newEnemyArrow" + i]._alpha = _local1["newEnemyArrow" + i]._alpha - 10;
} else {
_local1.enemyArrows[i] = 0;
removeMovieClip(_local1["newEnemyArrow" + i]);
}
}
}
i++;
}
}
};
jediOn = 0;
levelGold = 2000;
InvasionVersion = 3;
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.timeOn != undefined) {
if (InvasionSettings.data.timeOn) {
timeOn = true;
} else if (InvasionSettings.data.timeOn == false) {
timeOn = false;
}
} else {
timeOn = 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();
mLoaded = false;
Instance of Symbol 26 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
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 = (infCost = 50);
archCost = 100;
archDamage = 0.2;
cavCost = 300;
mangoCost = 1000;
infSpeed = 1.5;
archSpeed = (ramSpeed = (mangoSpeed = 0.75));
ramHP = 3;
enemyArrowType = (infDamage = 2);
ramCost = 500;
ramDamage = 20;
arrowType = 1;
cavSpeed = 3;
cavDamage = 100;
mangoDamage = 6;
trebDamage = 5;
trebSpeed = 3;
jediSpeed = 2.5;
jediDamage = 10;
gold = InvasionSettings.data.gold;
infAvailable = (cavAvailable = (archAvailable = (ramAvailable = (mangoAvailable = (trebAvailable = true)))));
enemyHP = InvasionSettings.data.level * 1000;
level = InvasionSettings.data.level;
archUpgrades = InvasionSettings.data.archUpgrades;
infUpgrades = InvasionSettings.data.infUpgrades;
ramUpgrades = InvasionSettings.data.ramUpgrades;
cavUpgrades = InvasionSettings.data.cavUpgrades;
infCount = InvasionSettings.data.infCount;
archCount = InvasionSettings.data.archCount;
ramCount = InvasionSettings.data.ramCount;
cavCount = InvasionSettings.data.cavCount;
mangoCount = InvasionSettings.data.cavCount;
arrowNum = (jediNumber = (enemyArrowNum = (boltNumber = (cavCount = (ramCount = (mangoCount = (trebCount = (troopCount = (troopsAlive = (infantryNumber = (archerNumber = (cavalryNumber = (ramNumber = (mangonelNumber = (trebuchetNumber = (archBulk = (infBulk = (ramBulk = (cavBulk = (mangoBulk = (trebBulk = (explosionNum = 0))))))))))))))))))))));
gotoAndStop (4);
}
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 115 MovieClip in Frame 4
onClipEvent (load) {
if (_root.infAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 120 MovieClip in Frame 4
onClipEvent (load) {
if (_root.archAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 126 MovieClip in Frame 4
onClipEvent (load) {
if (_root.cavAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 131 MovieClip in Frame 4
onClipEvent (load) {
if (_root.ramAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 136 MovieClip in Frame 4
onClipEvent (load) {
if (_root.mangoAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 141 MovieClip in Frame 4
onClipEvent (load) {
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 = _root.qualitySettings;
if (_root.qualitySettings == "LOW") {
cursor._visible = false;
Mouse.show();
} else {
cursor._visible = true;
Mouse.hide();
}
infAttack = infDamage + (0.2 * _root.infUpgrades);
archAttack = archDamage + (0.2 * _root.archUpgrades);
mangoAttack = mangoDamage + (0.2 * _root.mangoUpgrades);
ramAttack = ramDamage + (0.2 * _root.ramUpgrades);
cavAttack = cavDamage + (0.2 * _root.cavUpgrades);
trebAttack = trebDamage + (0.2 * _root.trebUpgrades);
jediAttack = jediDamage;
arrowFrameDelayInit = (arrowFrameDelay = 20);
arrowsFired = 0;
arrowsToFire = level;
_root.Water.stop();
_root.castle.gotoAndStop(100);
_root.arrowNum++;
_root.Arrows[_root.arrowNum] = 1;
_root.enemyArrowNum++;
_root.enemyArrows[_root.enemyArrowNum] = 1;
_root.cannonballNum++;
_root.cannonballs[_root.cannonballNum] = 1;
_root.enemyHPmax = _root.enemyHP;
_root.infantryClip.gotoAndStop(4);
_root.archerClip.gotoAndStop(4);
_root.ramClip.gotoAndStop(4);
_root.mangonelClip.gotoAndStop(4);
_root.jediClip.gotoAndStop(4);
_root.trebuchetClip.gotoAndStop(4);
_root.explosion.stop();
_root.archerClip._visible = (_root.jediClip._visible = (_root.mangonelClip._visible = (_root.explosion._visible = (enemyArcherArrow._visible = (_root.Water._visible = (_root.archerArrow._visible = (_root.ramClip._visible = (_root.infantryClip._visible = (_root.cavalryClip._visible = (_root.trebuchetClip._visible = false))))))))));
Instance of Symbol 235 MovieClip in Frame 5
onClipEvent (load) {
if (_root.timeOn) {
this.gotoAndPlay(600);
} else {
this.stop();
}
}
Instance of Symbol 237 MovieClip in Frame 5
onClipEvent (load) {
if (_root.timeOn) {
this.play();
} else {
_visible = false;
this.stop();
}
}
Instance of Symbol 241 MovieClip "grass" in Frame 5
onClipEvent (load) {
if (_root.timeOn) {
this.gotoAndPlay(600);
} else {
this.stop();
}
}
Instance of Symbol 283 MovieClip "castle" in Frame 5
onClipEvent (load) {
gotoAndStop (100);
}
Instance of Symbol 286 MovieClip in Frame 5
onClipEvent (load) {
if (_root.weatherOn != false) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(_totalframes);
_visible = false;
}
}
Instance of Symbol 319 MovieClip "ramClip" in Frame 5
onClipEvent (load) {
stop();
speed = _root.ramSpeed + Math.random();
touching = false;
HP = _root.ramHP;
}
Instance of Symbol 333 MovieClip "infantryClip" in Frame 5
onClipEvent (load) {
stop();
speed = _root.infSpeed + Math.random();
}
Instance of Symbol 350 MovieClip "archerClip" in Frame 5
onClipEvent (load) {
stop();
speed = _root.archSpeed + Math.random();
stopChance = 0;
decrement = random(100) + 25;
}
Instance of Symbol 347 MovieClip "archerArrow" in Frame 5
onClipEvent (load) {
_y = (_y - 9);
_x = (_x + 10);
gotoAndStop(_root.arrowType);
rotate = 1.6;
climbStop = 3 + (random(6) / 10);
upspeed = 0;
rightspeed = climbStop + 1;
toggleDamage = false;
toggleDown = false;
}
Instance of Symbol 347 MovieClip "enemyArrow" in Frame 5
onClipEvent (load) {
gotoAndStop(_root.enemyArrowType);
rotate = -2;
climbStop = 2 + (random(6) / 10);
upspeed = 0;
leftspeed = climbStop + Math.random();
toggleDamage = false;
toggleDown = false;
hitPlayer = false;
startFade = false;
}
Instance of Symbol 371 MovieClip "cavalryClip" in Frame 5
onClipEvent (load) {
stop();
speed = _root.cavSpeed + Math.random();
}
Instance of Symbol 397 MovieClip "mangonelClip" in Frame 5
onClipEvent (load) {
stop();
speed = _root.mangoSpeed + Math.random();
decrement = random(100) + 25;
}
Instance of Symbol 404 MovieClip "cannonball" in Frame 5
onClipEvent (load) {
_y = (_y - 4);
_x = (_x + 28);
rotate = 1.6;
climbStop = 3 + (random(6) / 10);
upspeed = 0;
rightspeed = climbStop + 1;
toggleDamage = false;
toggleDown = false;
}
Instance of Symbol 425 MovieClip "trebuchetClip" in Frame 5
onClipEvent (load) {
stop();
speed = _root.trebSpeed + Math.random();
}
Instance of Symbol 476 MovieClip "jediClip" in Frame 5
onClipEvent (load) {
stop();
speed = _root.jediSpeed + Math.random();
}
Instance of Symbol 486 MovieClip "Water" in Frame 5
onClipEvent (load) {
hit = null;
}
Instance of Symbol 501 MovieClip "console" in Frame 5
onClipEvent (keyDown) {
if (Key.getCode() == 192) {
if (slideIn._currentframe == 1) {
this.slideIn.gotoAndPlay(2);
} else {
this.gotoAndStop(2);
}
}
}
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 = 0))))))))));
InvasionSettings.flush();
Instance of Symbol 519 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.mangoCount;
_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.mangoUpgrades;
_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();
_root.depth = (_root.troopsAlive = (_root.arrowNum = (_root.enemyArrowNum = (_root.jediNumber = (_root.infantryNumber = (_root.archerNumber = (_root.cavalryNumber = (_root.ramNumber = (_root.mangonelNumber = (_root.trebuchetNumber = 0))))))))));
i = 1;
while (i < (_root.depth + 1)) {
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();
Frame 9
if (autoSave) {
saveOnOff.gotoAndStop(1);
} else {
saveOnOff.gotoAndStop(2);
}
if (soundOn) {
soundOnOff.gotoAndStop(1);
} else {
soundOnOff.gotoAndStop(2);
}
if (timeOn) {
dayNightOnOff.gotoAndStop(1);
} else {
dayNightOnOff.gotoAndStop(2);
}
if (weatherOn) {
weatherOnOff.gotoAndStop(1);
} else {
weatherOnOff.gotoAndStop(2);
}
Instance of Symbol 608 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);
}
}
Symbol 21 MovieClip Frame 1
stop();
Symbol 46 Button
on (release) {
_root.gotoAndStop(3);
}
Symbol 53 Button
on (release) {
gotoAndStop (2);
}
Symbol 57 Button
on (release) {
_root.gotoAndStop(8);
}
Symbol 61 Button
on (release) {
_root.gotoAndStop(9);
}
Symbol 66 Button
on (release) {
prevFrame();
}
Symbol 69 MovieClip Frame 1
stop();
Symbol 77 MovieClip Frame 1
stop();
Symbol 77 MovieClip Frame 30
gotoAndStop (1);
Symbol 81 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.infCost = (_root.oilDamage = 50));
_root.ramHP = 3;
_root.archCost = 100;
_root.ramCost = 500;
_root.mangoCost = 1000;
_root.cavCost = 300;
_root.archSpeed = (_root.ramSpeed = (_root.mangoSpeed = 0.75));
_root.level = (_root.arrowType = 1);
_root.infSpeed = 1.5;
_root.cavSpeed = 3;
_root.jediSpeed = 2.5;
_root.jediDamage = 10;
_root.cavDamage = 100;
_root.trebSpeed = 3;
_root.infDamage = (_root.enemyArrowType = 2);
_root.archDamage = 0.2;
_root.mangoDamage = 6;
_root.ramDamage = 20;
_root.trebDamage = 5;
_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 = 1000;
_root.arrowNum = (_root.boltNumber = (_root.cavUpgrades = (_root.archUpgrades = (_root.infUpgrades = (_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.gotoAndStop(4);
}
Symbol 85 Button
on (release) {
if (_root.InvasionSettings.data.level != undefined) {
_root.loadGame();
} else {
noSaveFile.play();
}
}
Symbol 89 Button
on (release) {
_root.loadGame(1);
}
Symbol 92 Button
on (release) {
_root.loadGame(2);
}
Symbol 95 Button
on (release) {
_root.loadGame(3);
}
Symbol 98 Button
on (release) {
_root.loadGame(4);
}
Symbol 99 Button
on (release) {
gotoAndStop (1);
}
Symbol 100 MovieClip Frame 1
stop();
Symbol 109 MovieClip Frame 1
stop();
Symbol 109 MovieClip Frame 30
gotoAndStop (1);
Symbol 111 Button
on (release) {
if (_root.gold >= _root.infCost) {
_root.infCount++;
_root.gold = _root.gold - _root.infCost;
}
}
Symbol 116 Button
on (release) {
if (_root.gold >= _root.archCost) {
_root.archCount++;
_root.gold = _root.gold - _root.archCost;
}
}
Symbol 121 Button
on (release) {
if (_root.gold >= _root.cavCost) {
_root.cavCount++;
_root.gold = _root.gold - _root.cavCost;
}
}
Symbol 127 Button
on (release) {
if (_root.gold >= _root.ramCost) {
_root.ramCount++;
_root.gold = _root.gold - _root.ramCost;
}
}
Symbol 132 Button
on (release) {
if (_root.gold >= _root.mangoCost) {
_root.mangoCount++;
_root.gold = _root.gold - _root.mangoCost;
}
}
Symbol 137 Button
on (release) {
if (_root.gold >= _root.trebCost) {
_root.trebCount++;
_root.gold = _root.gold - _root.trebCost;
}
}
Symbol 151 Button
on (release) {
if (_root.gold >= 200) {
_root.gold = _root.gold - 200;
_root.infUpgrades++;
}
}
Symbol 152 Button
on (release) {
if (_root.gold >= 400) {
_root.gold = _root.gold - 400;
_root.archUpgrades++;
}
}
Symbol 155 Button
on (release) {
if (_root.gold >= 1000) {
_root.gold = _root.gold - 1000;
_root.trebUpgrades++;
}
}
Symbol 158 Button
on (release) {
if (_root.gold >= 500) {
_root.gold = _root.gold - 500;
_root.ramUpgrades++;
}
}
Symbol 168 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))) {
_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();
}
}
}
}
Symbol 172 MovieClip Frame 1
infantry.restrict = "0-9";
Symbol 175 MovieClip Frame 1
archers.restrict = "0-9";
Symbol 178 MovieClip Frame 1
rams.restrict = "0-9";
Symbol 182 MovieClip Frame 1
saboteurs.restrict = "0-9";
Symbol 185 MovieClip Frame 1
cannons.restrict = "0-9";
Symbol 188 MovieClip Frame 1
cavalry.restrict = "0-9";
Symbol 190 MovieClip Frame 1
_parent._visible = false;
stop();
Instance of Symbol 172 MovieClip in Symbol 190 MovieClip Frame 1
onClipEvent (load) {
if (_root.infAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 175 MovieClip in Symbol 190 MovieClip Frame 1
onClipEvent (load) {
if (_root.archAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 178 MovieClip in Symbol 190 MovieClip Frame 1
onClipEvent (load) {
if (_root.ramAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 182 MovieClip in Symbol 190 MovieClip Frame 1
onClipEvent (load) {
if (_root.cavAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 185 MovieClip in Symbol 190 MovieClip Frame 1
onClipEvent (load) {
if (_root.mangoAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 188 MovieClip in Symbol 190 MovieClip Frame 1
onClipEvent (load) {
if (_root.trebAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Symbol 190 MovieClip Frame 2
_parent._visible = true;
Symbol 190 MovieClip Frame 10
stop();
Instance of Symbol 172 MovieClip in Symbol 191 MovieClip Frame 1
onClipEvent (load) {
if (_root.infAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 175 MovieClip in Symbol 191 MovieClip Frame 1
onClipEvent (load) {
if (_root.archAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 178 MovieClip in Symbol 191 MovieClip Frame 1
onClipEvent (load) {
if (_root.ramAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 182 MovieClip in Symbol 191 MovieClip Frame 1
onClipEvent (load) {
if (_root.cavAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 185 MovieClip in Symbol 191 MovieClip Frame 1
onClipEvent (load) {
if (_root.mangoAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 188 MovieClip in Symbol 191 MovieClip Frame 1
onClipEvent (load) {
if (_root.trebAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Symbol 191 MovieClip Frame 10
stop();
_parent.prevFrame();
Symbol 192 MovieClip Frame 1
stop();
Symbol 194 Button
on (release) {
if (_root.gold >= 500) {
_root.gold = _root.gold - 500;
_root.cavUpgrades++;
}
}
Symbol 197 Button
on (release) {
if (_root.gold >= 1000) {
_root.gold = _root.gold - 1000;
_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 * 200) + (_root.fletcheryBulk * 400)) + (_root.workshopBulk * 500)) + (_root.alchemistBulk * 500)) + (_root.quarryBulk * 1000)) + (_root.stableBulk * 600)) != isNaN) {
if (_root.gold >= Number((((((_root.barracksBulk * 200) + (_root.fletcheryBulk * 400)) + (_root.workshopBulk * 500)) + (_root.alchemistBulk * 500)) + (_root.quarryBulk * 1000)) + (_root.stableBulk * 600))) {
_root.gold = _root.gold - Number((((((_root.barracksBulk * 200) + (_root.fletcheryBulk * 400)) + (_root.workshopBulk * 500)) + (_root.alchemistBulk * 500)) + (_root.quarryBulk * 1000)) + (_root.stableBulk * 600));
_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 230 Button
on (release) {
if (troopsLeft > 0) {
gotoAndStop (5);
} else {
_root.noUnits.play();
}
}
Symbol 237 MovieClip Frame 799
gotoAndPlay (1);
Symbol 240 MovieClip Frame 1
stop();
Symbol 241 MovieClip Frame 800
gotoAndPlay (1);
Symbol 264 MovieClip Frame 74
_root.Water.duplicateMovieClip("newWater" + _root.waterNum, _root.depth++, {_x:456, _y:178});
_root.waterNum++;
Symbol 285 MovieClip Frame 1301
gotoAndPlay (1);
Symbol 286 MovieClip Frame 1
stop();
Symbol 292 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 296 Button
on (release) {
if (_root.infCount > 0) {
deploy("infantry");
_root.infCount--;
}
}
Symbol 297 Button
on (release) {
if (_root.archCount > 0) {
deploy("archer");
_root.archCount--;
}
}
Symbol 298 Button
on (release) {
if (_root.ramCount > 0) {
deploy("ram");
_root.ramCount--;
}
}
Symbol 299 Button
on (release) {
if (_root.cavCount > 0) {
deploy("cavalry");
_root.cavCount--;
}
}
Symbol 300 Button
on (release) {
if (_root.mangoCount > 0) {
deploy("mangonel");
_root.mangoCount--;
}
}
Symbol 301 Button
on (release) {
if (_root.trebCount > 0) {
deploy("trebuchet");
_root.trebCount--;
}
}
on (keyPress ";") {
if (_root.jediOn == 1) {
deploy("jedi");
}
}
Symbol 315 MovieClip Frame 9
_root.enemyHP = _root.enemyHP - _root.ramDamage;
Symbol 318 MovieClip Frame 19
_root.troopsAlive--;
removeMovieClip(_parent);
Symbol 331 MovieClip Frame 3
if (_root.soundOn) {
deathSound = new Sound(this);
deathSound.attachSound("swordSound");
deathSound.start();
}
Symbol 331 MovieClip Frame 6
_root.enemyHP = _root.enemyHP - _root.infDamage;
Symbol 331 MovieClip Frame 13
gotoAndPlay (3);
Symbol 332 MovieClip Frame 2
if (_root.soundOn) {
deathSound = new Sound(this);
deathSound.attachSound("death" + (random(9) + 1));
deathSound.start();
}
Symbol 332 MovieClip Frame 26
_root.troopsAlive--;
removeMovieClip(_parent);
Symbol 344 MovieClip Frame 17
_parent.stopChance = random(_root.archFireChance) + 1;
Instance of Symbol 347 MovieClip in Symbol 348 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_root.arrowType);
}
Symbol 348 MovieClip Frame 2
if (_root.soundOn) {
arrowSound1 = new Sound(this);
arrowSound1.attachSound("arrowSound");
arrowSound1.start();
}
Symbol 348 MovieClip Frame 7
_root.archerArrow.duplicateMovieClip("newArrow" + _root.arrowNum, _root.depth++, {_x:_parent._x, _y:_parent._y});
_root.arrowNum++;
_root.Arrows[_root.arrowNum] = 1;
Symbol 349 MovieClip Frame 2
if (_root.soundOn) {
deathSound = new Sound(this);
deathSound.attachSound("death" + (random(9) + 1));
deathSound.start();
}
Symbol 349 MovieClip Frame 26
_root.troopsAlive--;
removeMovieClip(_parent);
_root.troopsAlive--;
removeMovieClip(_parent);
Symbol 370 MovieClip Frame 1
_root.explosion.duplicateMovieClip("newExplosion" + _root.explosionNum, _root.depth++, {_x:_parent._x, _y:_parent._y});
_root.explosionNum++;
Symbol 370 MovieClip Frame 2
if (_root.soundOn) {
deathSound = new Sound(this);
deathSound.attachSound("explosionSound");
deathSound.start();
}
Symbol 370 MovieClip Frame 9
_root.troopsAlive--;
removeMovieClip(_parent);
Symbol 374 MovieClip Frame 6
i = 0;
while (i < (_root.infantryNumber + 1)) {
if (_root.infantryArray[i] == 1) {
if (hitTest(_root["infantry" + i])) {
_root["infantry" + i].gotoAndStop(3);
_root.infantryArray[i] = 0;
}
}
i++;
}
i = 0;
while (i < (_root.archerNumber + 1)) {
if (_root.archerArray[i] == 1) {
if (hitTest(_root["archer" + i])) {
_root["archer" + i].gotoAndStop(3);
_root.archerArray[i] = 0;
}
}
i++;
}
i = 0;
while (i < (_root.ramNumber + 1)) {
if (_root.ramArray[i] == 1) {
if (hitTest(_root["ram" + i])) {
_root["ram" + i].gotoAndStop(3);
_root.ramArray[i] = 0;
}
}
i++;
}
if (hitTest(_root.castle)) {
_root.enemyHP = _root.enemyHP - _root.cavAttack;
}
removeMovieClip(this);
Symbol 394 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;
Symbol 396 MovieClip Frame 16
_root.troopsAlive--;
removeMovieClip(_parent);
Symbol 404 MovieClip Frame 1
stop();
Symbol 404 MovieClip Frame 7
_root.cannonballs[number] = 0;
removeMovieClip(this);
Symbol 423 MovieClip Frame 5
_root.enemyHP = _root.enemyHP - _root.trebAttack;
Symbol 424 MovieClip Frame 2
if (_root.soundOn) {
deathSound = new Sound(this);
deathSound.attachSound("horseDie");
deathSound.start();
}
Symbol 424 MovieClip Frame 10
_root.troopsAlive--;
removeMovieClip(_parent);
Symbol 430 Button
on (release) {
changeLevel(7);
}
Symbol 458 MovieClip Frame 4
_root.enemyHP = _root.enemyHP - _root.jediAttack;
Symbol 475 MovieClip Frame 2
if (_root.soundOn) {
deathSound = new Sound(this);
deathSound.attachSound("death" + (random(9) + 1));
deathSound.start();
}
Symbol 475 MovieClip Frame 26
removeMovieClip(_parent);
Symbol 486 MovieClip Frame 1
hitTimes = random(_root.level) + 1;
Symbol 486 MovieClip Frame 30
i = 0;
while (i < (_root.infantryNumber + 1)) {
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 + 1)) {
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 + 1)) {
if (hit < hitTimes) {
if (_root.trebuchetArray[i] == 1) {
if (hitTest(_root["trebuchet" + i])) {
_root["trebuchet" + i].gotoAndStop(3);
_root.trebuchetArray[i] = 0;
hit++;
}
}
}
i++;
}
i = 0;
while (i < (_root.ramNumber + 1)) {
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 + 1)) {
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 486 MovieClip Frame 35
removeMovieClip(this);
Symbol 498 Button
on (release) {
_root[varChange.text] = Number(varChangeBy);
varChange.text = "";
varChangeBy = "";
}
Symbol 499 MovieClip Frame 1
stop();
_parent._visible = false;
Symbol 499 MovieClip Frame 2
_parent._visible = true;
Symbol 499 MovieClip Frame 10
stop();
Symbol 500 MovieClip Frame 10
_parent.gotoAndStop(1);
Symbol 501 MovieClip Frame 1
stop();
Symbol 518 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.mangoCount;
_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.mangoUpgrades;
_root.InvasionSettings.data.arrowType = _root.arrowType;
_root.InvasionSettings.data.level = _root.level;
_root.InvasionSettings.flush();
}
Symbol 523 Button
on (release) {
gotoAndStop (4);
enemyHP = level * 1000;
}
Symbol 533 Button
on (release) {
gotoAndStop (2);
}
Symbol 539 Button
on (release) {
gotoAndStop (2);
}
Symbol 549 Button
on (press) {
gotoAndStop (2);
}
Symbol 554 Button
on (press) {
gotoAndStop (1);
}
Symbol 556 MovieClip Frame 1
_root.InvasionSettings.data.weatherOn = true;
_root.weatherOn = true;
Symbol 556 MovieClip Frame 2
_root.InvasionSettings.data.weatherOn = false;
_root.weatherOn = false;
Symbol 560 Button
on (press) {
gotoAndStop (2);
}
Symbol 564 Button
on (press) {
gotoAndStop (1);
}
Symbol 566 MovieClip Frame 1
_root.InvasionSettings.data.timeOn = true;
_root.timeOn = true;
Symbol 566 MovieClip Frame 2
_root.InvasionSettings.data.timeOn = false;
_root.timeOn = false;
Symbol 570 Button
on (press) {
gotoAndStop (2);
}
Symbol 574 Button
on (press) {
gotoAndStop (1);
}
Symbol 576 MovieClip Frame 1
_root.soundOn = true;
_root.InvasionSettings.data.soundOn = true;
Symbol 576 MovieClip Frame 2
_root.soundOn = false;
_root.InvasionSettings.data.soundOn = false;
Symbol 580 Button
on (press) {
gotoAndStop (2);
}
Symbol 584 Button
on (press) {
gotoAndStop (1);
}
Symbol 586 MovieClip Frame 1
_root.autoSave = true;
_root.InvasionSettings.data.autoSave = true;
Symbol 586 MovieClip Frame 2
_root.autoSave = false;
_root.InvasionSettings.data.autoSave = false;
Symbol 593 Button
on (press) {
gotoAndStop (2);
}
Symbol 594 Button
on (press) {
gotoAndStop (3);
}
Symbol 601 Button
on (press) {
gotoAndStop (1);
}
Symbol 608 MovieClip Frame 1
_root.qualitySettings = "HIGH";
_root.InvasionSettings.data.qualitySettings = "HIGH";
Symbol 608 MovieClip Frame 2
_root.qualitySettings = "MEDIUM";
_root.InvasionSettings.data.qualitySettings = "MEDIUM";
Symbol 608 MovieClip Frame 3
_root.qualitySettings = "LOW";
_root.InvasionSettings.data.qualitySettings = "LOW";