Frame 1 (1.86 KiB) ●
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.qualitySettings != undefined) {
if (InvasionSettings.data.qualitySettings == "HIGH") {
qualitySettings = "HIGH";
_quality = "HIGH";
} else if (InvasionSettings.data.qualitySettings == "MEDIUM") {
qualitySettings = "MEDIUM";
_quality = "MEDIUM";
} else if (InvasionSettings.data.qualitySettings == "LOW") {
qualitySettings = "LOW";
_quality = "LOW";
}
} else {
qualitySettings = "HIGH";
_quality = "HIGH";
}
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;
_root.onEnterFrame = function () {
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);
}
};
Instance of Symbol 16 MovieClip "sky" in Frame 2 (42 B)
onClipEvent (load) {
gotoAndPlay (600);
}
Instance of Symbol 22 MovieClip in Frame 2 (42 B)
onClipEvent (load) {
gotoAndPlay (600);
}
Instance of Symbol 52 MovieClip "windowBar1" in Frame 2 (48 B)
onClipEvent (load) {
windowName = "Invasion";
}
Frame 3 (2.11 KiB) ●
function loadGame() {
enemyArrows = new Array();
trebuchetArray = new Array();
infantryArray = new Array();
Arrows = new Array();
mangonelArray = new Array();
ramArray = new Array();
cavalryArray = new Array();
archerArray = new Array();
archFireChance = (infCost = 50);
archCost = 100;
archDamage = 0.1;
infSpeed = 1.5;
archSpeed = (ramSpeed = 0.75);
ramHP = 3;
enemyArrowType = (infDamage = 2);
ramCost = 500;
ramDamage = 20;
arrowType = 1;
gold = InvasionSettings.data.gold;
infAvailable = (archAvailable = (ramAvailable = true));
cavAvailable = (mangoAvailable = (trebAvailable = false));
enemyHP = InvasionSettings.data.level * 1000;
level = InvasionSettings.data.level;
archUpgrades = InvasionSettings.data.archUpgrades;
infUpgrades = InvasionSettings.data.infUpgrades;
ramUpgrades = InvasionSettings.data.infUpgrades;
infCount = InvasionSettings.data.infCount;
archCount = InvasionSettings.data.archCount;
ramCount = InvasionSettings.data.archCount;
arrowNum = (enemyArrowNum = (boltNumber = (cavCount = (ramCount = (mangoCount = (trebCount = (troopCount = (troopsAlive = (infantryNumber = (archerNumber = (cavalryNumber = (ramNumber = (mangonelNumber = (trebuchetNumber = 0))))))))))))));
enemyIntel = ((("Estimated Hit Points: " + (enemyHP - (random(10) * 10))) + newline) + "Estimated amount of Gold stashed: ") + ((level * 2000) - (random(10) * 10));
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.InvasionFrames != undefined) {
playTime = ("You've played for " + InvasionSettings.data.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 is: " + InvasionSettings.data.highestGold) + ".";
} else {
goldCount = "Your highest amount of gold has yet to be seen.";
}
Instance of Symbol 52 MovieClip "windowBar2" in Frame 3 (44 B)
onClipEvent (load) {
windowName = "Play";
}
Frame 4 (258 B)
_root.goldField.text = ("You have " + _root.gold) + " gold.";
_root.onEnterFrame = function () {
_root.goldField.text = ("You have " + _root.gold) + " gold.";
troopsLeft = ((((infCount + archCount) + cavCount) + ramCount) + mangoCount) + trebCount;
};
Instance of Symbol 92 MovieClip in Frame 4 (103 B)
onClipEvent (load) {
if (_root.infAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 97 MovieClip in Frame 4 (104 B)
onClipEvent (load) {
if (_root.archAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 102 MovieClip in Frame 4 (103 B)
onClipEvent (load) {
if (_root.cavAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 107 MovieClip in Frame 4 (103 B)
onClipEvent (load) {
if (_root.ramAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 112 MovieClip in Frame 4 (105 B)
onClipEvent (load) {
if (_root.mangoAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 117 MovieClip in Frame 4 (104 B)
onClipEvent (load) {
if (_root.trebAvailable) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 140 MovieClip in Frame 4 (42 B)
onClipEvent (load) {
_visible = false;
}
Frame 5 (12.73 KiB) ● ●
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 nextLevel() {
gotoAndStop (6);
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["newWater" + i]);
i++;
}
_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();
}
infDamage = infDamage + (0.03 * _root.infUpgrades);
archDamage = archDamage + (0.03 * _root.archUpgrades);
ramDamage = ramDamage + (0.04 * _root.ramUpgrades);
arrowFrameDelayInit = (arrowFrameDelay = 35);
_root.Water.stop();
_root.castle.gotoAndStop(100);
_root.archerArrow.duplicateMovieClip("newArrow" + _root.arrowNum, _root.depth++, {_x:-50, _y:-50});
_root.arrowNum++;
_root.Arrows[_root.arrowNum] = 1;
_root.enemyArrow.duplicateMovieClip("newEnemyArrow" + _root.enemyArrowNum, _root.depth++, {_x:-50, _y:-50});
_root.enemyArrowNum++;
_root.enemyArrows[_root.enemyArrowNum] = 1;
_root.enemyHPmax = _root.enemyHP;
_root.infantryClip.gotoAndStop(4);
_root.archerClip.gotoAndStop(4);
_root.ramClip.gotoAndStop(4);
_root.archerClip._visible = (_root.newArrow0._visible = (_root.Water._visible = (_root.archerArrow._visible = (_root.ramClip._visible = (_root.infantryClip._visible = false)))));
_root.onEnterFrame = function () {
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 {
nextLevel();
}
troopsLeft = ((((infCount + archCount) + cavCount) + ramCount) + mangoCount) + trebCount;
if (arrowFrameDelay <= 0) {
if (_root.castle._currentframe > 2) {
arrowFrameDelay = arrowFrameDelayInit;
_root.enemyArrow.duplicateMovieClip("newEnemyArrow" + _root.enemyArrowNum, _root.depth++, {_x:475, _y:230});
_root.enemyArrowNum++;
_root.enemyArrows[_root.enemyArrowNum] = 1;
}
}
if (_root.troopsLeft == 0) {
if (_root.troopsAlive == 0) {
gotoAndStop (7);
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["newWater" + i]);
i++;
}
_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.depth = (_root.troopsAlive = (_root.arrowNum = (_root.enemyArrowNum = (_root.infantryNumber = (_root.archerNumber = (_root.cavalryNumber = (_root.ramNumber = (_root.mangonelNumber = (_root.trebuchetNumber = 0)))))))));
}
}
i = 0;
while (i < (_root.infantryNumber + 1)) {
if (_root.infantryArray[i] == 1) {
if (!_root["infantry" + i].hitTest(_root.castle)) {
_root["infantry" + i]._x = _root["infantry" + i]._x + _root["infantry" + i].speed;
_root["infantry" + i]._y = _root["infantry" + i]._y - (Math.random() - 0.5);
} else {
_root["infantry" + i].gotoAndStop(2);
}
}
i++;
}
i = 0;
while (i < (_root.ramNumber + 1)) {
if (_root.ramArray[i] == 1) {
if (!_root["ram" + i].hitTest(_root.castle)) {
if (!_root["ram" + i].touching) {
_root["ram" + i]._x = _root["ram" + i]._x + _root["ram" + i].speed;
_root["ram" + i].wheel1._rotation = _root["ram" + i].wheel1._rotation + _root["ram" + i].speed;
_root["ram" + i].wheel2._rotation = _root["ram" + i].wheel2._rotation + _root["ram" + i].speed;
_root["ram" + i].wheel3._rotation = _root["ram" + i].wheel3._rotation + _root["ram" + i].speed;
}
} else {
_root["ram" + i].gotoAndStop(2);
_root["ram" + i].touching = true;
}
}
i++;
}
i = 0;
while (i < (_root.archerNumber + 1)) {
if (_root.archerArray[i] == 1) {
if ((_root["archer" + i].stopChance != _root.archFireChance) && (_root["archer" + i]._x < (250 - _root["archer" + i].decrement))) {
_root["archer" + i]._x = _root["archer" + i]._x + _root["archer" + i].speed;
_root["archer" + i]._y = _root["archer" + i]._y - (Math.random() - 0.5);
} else if (_root["archer" + i]._x > 100) {
_root["archer" + i].gotoAndStop(2);
} else {
_root["archer" + i]._x = _root["archer" + i]._x + _root["archer" + i].speed;
_root["archer" + i]._y = _root["archer" + i]._y - (Math.random() - 0.5);
}
}
i++;
}
i = 0;
while (i < _root.Arrows.length) {
if (_root.Arrows[i] == 1) {
if (!_root["newArrow" + i].hitTest(_root.castle)) {
if (!_root["newArrow" + i].toggleDown) {
if (_root["newArrow" + i].upspeed < _root["newArrow" + i].climbStop) {
_root["newArrow" + i].upspeed = _root["newArrow" + i].upspeed + 0.4;
_root["newArrow" + i].rightspeed = _root["newArrow" + i].rightspeed + 0.5;
} else {
_root["newArrow" + i].toggleDown = true;
}
}
if (_root["newArrow" + i].toggleDown) {
_root["newArrow" + i].rightspeed = _root["newArrow" + i].rightspeed - 0.02;
_root["newArrow" + i].upspeed = _root["newArrow" + i].upspeed - 0.2;
}
_root["newArrow" + i]._x = _root["newArrow" + i]._x + (_root["newArrow" + i].rightspeed * 2);
_root["newArrow" + i]._rotation = _root["newArrow" + i]._rotation + _root["newArrow" + i].rotate;
_root["newArrow" + i]._y = _root["newArrow" + i]._y - (_root["newArrow" + i].upspeed * 2);
} else {
_root["newArrow" + i].toggleDamage = true;
if (_root["newArrow" + i]._alpha > 0) {
_root["newArrow" + i]._alpha = _root["newArrow" + i]._alpha - 10;
} else {
_root.Arrows[i] = 0;
removeMovieClip(_root["newArrow" + i]);
}
}
if ((_root["newArrow" + i]._x > Stage.width) || (_root["newArrow" + i]._y > 330)) {
_root.Arrows[i] = 0;
removeMovieClip(_root["newArrow" + i]);
}
if (_root["newArrow" + i].toggleDamage) {
_root.enemyHP = _root.enemyHP - _root.archDamage;
}
}
i++;
}
i = 0;
while (i < _root.enemyArrows.length) {
if (_root.enemyArrows[i] == 1) {
if (!_root["newArrow" + i].hitPlayer) {
if (!_root["newEnemyArrow" + i].fadeStarted) {
if (!_root["newEnemyArrow" + i].toggleDown) {
if (_root["newEnemyArrow" + i].upspeed < _root["newEnemyArrow" + i].climbStop) {
_root["newEnemyArrow" + i].upspeed = _root["newEnemyArrow" + i].upspeed + 0.8;
_root["newEnemyArrow" + i].leftspeed = _root["newEnemyArrow" + i].leftspeed + 0.4;
} else {
_root["newEnemyArrow" + i].toggleDown = true;
}
}
if (_root["newEnemyArrow" + i].toggleDown) {
_root["newEnemyArrow" + i].leftspeed = _root["newEnemyArrow" + i].leftspeed - 0.06;
_root["newEnemyArrow" + i].upspeed = _root["newEnemyArrow" + i].upspeed - 0.4;
}
_root["newEnemyArrow" + i]._x = _root["newEnemyArrow" + i]._x - (_root["newEnemyArrow" + i].leftspeed * 3);
_root["newEnemyArrow" + i]._rotation = _root["newEnemyArrow" + i]._rotation + (_root["newEnemyArrow" + i].rotate * 2);
_root["newEnemyArrow" + i]._y = _root["newEnemyArrow" + i]._y - (_root["newEnemyArrow" + i].upspeed * 2);
j = 0;
while (j < (_root.infantryNumber + 1)) {
if (_root.infantryArray[j] == 1) {
if (!_root["newEnemyArrow" + i].fadeStarted) {
if (!_root["newEnemyArrow" + i].hitPlayer) {
if (_root["newEnemyArrow" + i].hitTest(_root["infantry" + j])) {
_root["infantry" + j].gotoAndStop(3);
_root.infantryArray[j] = 0;
_root["newEnemyArrow" + i].hitPlayer = true;
_root["newEnemyArrow" + i].startFade = true;
}
}
}
}
j++;
}
j = 0;
while (j < (_root.archerNumber + 1)) {
if (_root.archerArray[j] == 1) {
if (!_root["newEnemyArrow" + i].fadeStarted) {
if (!_root["newEnemyArrow" + i].hitPlayer) {
if (_root["newEnemyArrow" + i].hitTest(_root["archer" + j])) {
_root["archer" + j].gotoAndStop(3);
_root.archerArray[j] = 0;
_root["newEnemyArrow" + i].hitPlayer = true;
_root["newEnemyArrow" + i].startFade = true;
}
}
}
}
j++;
}
j = 0;
while (j < (_root.cavalryNumber + 1)) {
if (_root.cavalryArray[j] == 1) {
if (!_root["newEnemyArrow" + i].fadeStarted) {
if (!_root["newEnemyArrow" + i].hitPlayer) {
if (_root["newEnemyArrow" + i].hitTest(_root["cavalry" + j])) {
_root["cavalry" + j].gotoAndStop(3);
_root.cavalryArray[j] = 0;
_root["newEnemyArrow" + i].hitPlayer = true;
_root["newEnemyArrow" + i].startFade = true;
}
}
}
}
j++;
}
j = 0;
while (j < (_root.ramNumber + 1)) {
if (_root.ramArray[j] == 1) {
if (_root["newEnemyArrow" + i].hitTest(_root["ram" + j])) {
if (!_root["newEnemyArrow" + i].fadeStarted) {
if (!_root["newEnemyArrow" + i].hitPlayer) {
_root["newEnemyArrow" + i].hitPlayer = true;
_root["newEnemyArrow" + i].startFade = true;
_root["ram" + j].HP--;
if (_root["ram" + j].HP < 1) {
_root["ram" + j].gotoAndStop(3);
}
}
}
_root["newEnemyArrow" + i]._x = _root["newEnemyArrow" + i]._x + _root["ram" + j].speed;
}
}
j++;
}
j = 0;
while (j < (_root.mangonelNumber + 1)) {
if (_root.mangonelArray[j] == 1) {
if (!_root["newEnemyArrow" + i].fadeStarted) {
if (!_root["newEnemyArrow" + i].hitPlayer) {
if (_root["newEnemyArrow" + i].hitTest(_root["mangonel" + j])) {
_root["mangonel" + j].gotoAndStop(3);
_root.mangonelArray[j] = 0;
_root["newEnemyArrow" + i].hitPlayer = true;
_root["newEnemyArrow" + i].startFade = true;
}
}
}
}
j++;
}
j = 0;
while (j < (_root.trebuchetNumber + 1)) {
if (_root.trebuchetArray[j] == 1) {
if (!_root["newEnemyArrow" + i].fadeStarted) {
if (!_root["newEnemyArrow" + i].hitPlayer) {
if (_root["newEnemyArrow" + i].hitTest(_root["trebuchet" + j])) {
_root["trebuchet" + j].gotoAndStop(3);
_root.trebuchetArray[j] = 0;
_root["newEnemyArrow" + i].hitPlayer = true;
_root["newEnemyArrow" + i].startFade = true;
}
}
}
}
j++;
}
}
}
if (_root["newEnemyArrow" + i]._x < 0) {
_root.enemyArrows[i] = 0;
removeMovieClip(_root["newEnemyArrow" + i]);
}
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]);
}
}
}
i++;
}
}
};
Instance of Symbol 16 MovieClip "sky" in Frame 5 (96 B)
onClipEvent (load) {
if (_root.timeOn != false) {
gotoAndPlay (600);
} else {
stop();
}
}
Instance of Symbol 18 MovieClip in Frame 5 (109 B)
onClipEvent (load) {
if (_root.timeOn != false) {
play();
} else {
this.gotoAndStop(_totalframes);
}
}
Instance of Symbol 22 MovieClip "grass" in Frame 5 (96 B)
onClipEvent (load) {
if (_root.timeOn != false) {
gotoAndPlay (600);
} else {
stop();
}
}
Instance of Symbol 169 MovieClip "castle" in Frame 5 (42 B)
onClipEvent (load) {
gotoAndStop (100);
}
Instance of Symbol 178 MovieClip in Frame 5 (135 B)
onClipEvent (load) {
if (_root.timeOn != false) {
gotoAndStop(random(_totalframes) + 1);
} else {
gotoAndStop(_totalframes);
}
}
Instance of Symbol 216 MovieClip "ramClip" in Frame 5 (110 B)
onClipEvent (load) {
stop();
speed = _root.ramSpeed + Math.random();
touching = false;
HP = _root.ramHP;
}
Instance of Symbol 249 MovieClip "infantryClip" in Frame 5 (72 B)
onClipEvent (load) {
stop();
speed = _root.infSpeed + Math.random();
}
Instance of Symbol 285 MovieClip "archerClip" in Frame 5 (121 B)
onClipEvent (load) {
stop();
speed = _root.archSpeed + Math.random();
stopChance = 0;
decrement = random(100) + 25;
}
Instance of Symbol 259 MovieClip "archerArrow" in Frame 5 (225 B)
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 259 MovieClip "enemyArrow" in Frame 5 (263 B)
onClipEvent (load) {
gotoAndStop(_root.enemyArrowType);
rotate = -2;
climbStop = (2 + (random(6) / 10)) + Math.random();
upspeed = 0;
leftspeed = climbStop + Math.random();
toggleDamage = false;
toggleDown = false;
hitPlayer = false;
startFade = false;
}
Instance of Symbol 296 MovieClip "Water" in Frame 5 (36 B)
onClipEvent (load) {
hit = false;
}
Frame 6 (949 B)
stop();
stopAllSounds();
goldPlundered = ("You plundered " + (level * 2000)) + " gold from that castle!";
gold = gold + (level * 2000);
level++;
if (InvasionSettings.data.level != undefined) {
if (InvasionSettings.data.highestLevel < level) {
InvasionSettings.data.highestLevel = level;
InvasionSettings.data.flush();
}
} else {
InvasionSettings.data.highestLevel = level;
InvasionSettings.data.flush();
}
if (InvasionSettings.data.highestGold != undefined) {
if (InvasionSettings.data.highestGold < gold) {
InvasionSettings.data.highestGold = gold;
InvasionSettings.data.highestGold.flush();
}
} else {
InvasionSettings.data.highestGold = gold;
InvasionSettings.data.flush();
}
_root.depth = (_root.troopsAlive = (_root.arrowNum = (_root.enemyArrowNum = (_root.infantryNumber = (_root.archerNumber = (_root.cavalryNumber = (_root.ramNumber = (_root.mangonelNumber = (_root.trebuchetNumber = 0)))))))));
Instance of Symbol 319 MovieClip in Frame 6 (742 B)
onClipEvent (load) {
_root.InvasionSettings.data.InvasionFrames = _root.InvasionSettings.data.InvasionFrames + InvasionFrames;
_root.InvasionSettings.flush();
if (_root.autoSave) {
_root.InvasionSettings.data.infCount = infCount;
_root.InvasionSettings.data.archCount = archCount;
_root.InvasionSettings.data.ramCount = ramCount;
_root.InvasionSettings.data.gold = gold;
_root.InvasionSettings.data.infUpgrades = infUpgrades;
_root.InvasionSettings.data.archUpgrades = archUpgrades;
_root.InvasionSettings.data.ramUpgrades = ramUpgrades;
_root.InvasionSettings.data.arrowType = arrowType;
_root.InvasionSettings.data.level = level;
_root.InvasionSettings.flush();
_visible = false;
} else {
_visible = true;
}
}
Frame 7 (113 B)
stop();
stopAllSounds();
dang = ("Damn. You ran out of troops. You reached a final level of: " + level) + ".";
Instance of Symbol 16 MovieClip "sky" in Frame 8 (42 B)
onClipEvent (load) {
gotoAndPlay (600);
}
Instance of Symbol 22 MovieClip in Frame 8 (42 B)
onClipEvent (load) {
gotoAndPlay (600);
}
Instance of Symbol 340 MovieClip in Frame 9 (185 B)
onClipEvent (load) {
stop();
myBoolean = _root.weatherOn;
mySave = _root.InvasionSettings.data.weatherOn;
if (_root.weatherOn) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Instance of Symbol 340 MovieClip in Frame 9 (176 B)
onClipEvent (load) {
stop();
myBoolean = _root.timeOn;
mySave = _root.InvasionSettings.data.timeOn;
if (_root.timeOn) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Instance of Symbol 340 MovieClip in Frame 9 (179 B)
onClipEvent (load) {
stop();
myBoolean = _root.soundOn;
mySave = _root.InvasionSettings.data.soundOn;
if (_root.soundOn) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Instance of Symbol 340 MovieClip in Frame 9 (182 B)
onClipEvent (load) {
stop();
if (_root.autoSave) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
myBoolean = _root.autoSave;
mySave = _root.InvasionSettings.data.autoSave;
}
Instance of Symbol 349 MovieClip in Frame 9 (262 B)
onClipEvent (load) {
stop();
myBoolean = _root.qualitySettings;
if (_root.qualitySettings == "HIGH") {
gotoAndStop (1);
} else if (_root.qualitySettings == "MEDIUM") {
gotoAndStop (2);
} else if (_root.qualitySettings == "LOW") {
gotoAndStop (3);
}
}
Symbol 7 MovieClip Frame 1 (8 B)
stop();
Symbol 16 MovieClip Frame 800 (17 B)
gotoAndPlay (1);
Symbol 18 MovieClip Frame 799 (17 B)
gotoAndPlay (1);
Symbol 21 MovieClip Frame 1 (8 B)
stop();
Symbol 22 MovieClip Frame 800 (17 B)
gotoAndPlay (1);
Symbol 34 Button (39 B)
on (release) {
_root.gotoAndStop(3);
}
Symbol 37 Button (34 B)
on (release) {
gotoAndStop (2);
}
Symbol 40 Button (39 B)
on (release) {
_root.gotoAndStop(8);
}
Symbol 43 Button (39 B)
on (release) {
_root.gotoAndStop(9);
}
Symbol 48 Button (30 B)
on (release) {
prevFrame();
}
Symbol 49 MovieClip Frame 1 (8 B)
stop();
Symbol 61 Button (1.65 KiB) ●
on (release) {
_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.archFireChance = (_root.infCost = (_root.oilDamage = 50));
_root.ramHP = 3;
_root.archCost = (_root.cavCost = 100);
_root.ramCost = 500;
_root.mangoCost = 200;
_root.archSpeed = (_root.ramSpeed = 0.75);
_root.mangoSpeed = (_root.level = (_root.arrowType = 1));
_root.infSpeed = 1.5;
_root.cavSpeed = (_root.cavDamage = 3);
_root.trebSpeed = 0.5;
_root.infDamage = (_root.enemyArrowType = 2);
_root.archDamage = 0.1;
_root.mangoDamage = 4;
_root.ramDamage = 20;
_root.trebDamage = 7;
_root.gold = 2000;
_root.trebCost = 500;
_root.enemyArcherDamage = 25;
_root.infAvailable = (_root.archAvailable = (_root.ramAvailable = true));
_root.cavAvailable = (_root.mangoAvailable = (_root.trebAvailable = false));
_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.archerNumber = (_root.cavalryNumber = (_root.ramNumber = (_root.mangonelNumber = (_root.trebuchetNumber = 0)))))))))))))))))));
_root.enemyIntel = ((("Estimated Hit Points: " + (_root.enemyHP - (random(10) * 10))) + newline) + "Estimated amount of Gold stashed: ") + ((_root.level * 2000) - (random(50) * 10));
_root.gotoAndStop(4);
}
Symbol 64 Button (94 B)
on (release) {
if (_root.InvasionSettings.data.level != undefined) {
_root.loadGame();
}
}
Symbol 69 Button (36 B)
on (release) {
_root.loadGame(1);
}
Symbol 72 Button (36 B)
on (release) {
_root.loadGame(2);
}
Symbol 75 Button (36 B)
on (release) {
_root.loadGame(3);
}
Symbol 78 Button (36 B)
on (release) {
_root.loadGame(4);
}
Symbol 79 Button (34 B)
on (release) {
gotoAndStop (1);
}
Symbol 80 MovieClip Frame 1 (8 B)
stop();
Symbol 88 Button (121 B)
on (release) {
if (_root.gold >= _root.infCost) {
_root.infCount++;
_root.gold = _root.gold - _root.infCost;
}
}
Symbol 93 Button (124 B)
on (release) {
if (_root.gold >= _root.archCost) {
_root.archCount++;
_root.gold = _root.gold - _root.archCost;
}
}
Symbol 98 Button (121 B)
on (release) {
if (_root.gold >= _root.cavCost) {
_root.cavCount++;
_root.gold = _root.gold - _root.cavCost;
}
}
Symbol 103 Button (121 B)
on (release) {
if (_root.gold >= _root.ramCost) {
_root.ramCount++;
_root.gold = _root.gold - _root.ramCost;
}
}
Symbol 108 Button (127 B)
on (release) {
if (_root.gold >= _root.mangoCost) {
_root.mangoCount++;
_root.gold = _root.gold - _root.mangoCost;
}
}
Symbol 113 Button (124 B)
on (release) {
if (_root.gold >= _root.trebCost) {
_root.trebCount++;
_root.gold = _root.gold - _root.trebCost;
}
}
Symbol 131 Button (64 B)
on (release) {
if (troopsLeft > 0) {
gotoAndStop (5);
}
}
Symbol 132 Button (104 B)
on (release) {
if (_root.gold >= 200) {
_root.gold = _root.gold - 200;
_root.infUpgrades++;
}
}
Symbol 133 Button (105 B)
on (release) {
if (_root.gold >= 400) {
_root.gold = _root.gold - 400;
_root.archUpgrades++;
}
}
Symbol 142 Button (104 B)
on (release) {
if (_root.gold >= 500) {
_root.gold = _root.gold - 500;
_root.ramUpgrades++;
}
}
Symbol 159 MovieClip Frame 74 (113 B)
_root.Water.duplicateMovieClip("newWater" + _root.waterNum, _root.depth++, {_x:473, _y:184});
_root.waterNum++;
Symbol 169 MovieClip Frame 2 (19 B)
_root.nextLevel();
Symbol 171 MovieClip Frame 198 (17 B)
gotoAndPlay (1);
Symbol 178 MovieClip Frame 4 (38 B)
_root.grass.grassType.gotoAndStop(2);
Symbol 185 Button (159 B)
on (release) {
if (_quality == "HIGH") {
_quality = "MEDIUM";
} else if (_quality == "MEDIUM") {
_quality = "LOW";
} else {
_quality = "HIGH";
}
}
Symbol 190 Button (962 B)
on (release) {
gotoAndStop (7);
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["newWater" + i]);
i++;
}
_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.depth = (_root.troopsAlive = (_root.arrowNum = (_root.enemyArrowNum = (_root.infantryNumber = (_root.archerNumber = (_root.cavalryNumber = (_root.ramNumber = (_root.mangonelNumber = (_root.trebuchetNumber = 0)))))))));
}
Symbol 211 MovieClip Frame 9 (49 B)
_root.enemyHP = _root.enemyHP - _root.infDamage;
Symbol 215 MovieClip Frame 19 (48 B)
_root.troopsAlive--;
removeMovieClip(_parent);
Symbol 231 MovieClip Frame 4 (49 B)
_root.enemyHP = _root.enemyHP - _root.infDamage;
Symbol 248 MovieClip Frame 26 (48 B)
_root.troopsAlive--;
removeMovieClip(_parent);
Symbol 255 MovieClip Frame 5 (55 B)
_parent.stopChance = random(_root.archFireChance) + 1;
Instance of Symbol 259 MovieClip in Symbol 267 MovieClip Frame 1 (53 B)
onClipEvent (load) {
gotoAndStop(_root.arrowType);
}
Symbol 267 MovieClip Frame 2 (121 B)
if (_root.soundOn) {
arrowSound1 = new Sound(this);
arrowSound1.attachSound("arrowSound");
arrowSound1.start();
}
Instance of Symbol 259 MovieClip in Symbol 267 MovieClip Frame 2 (53 B)
onClipEvent (load) {
gotoAndStop(_root.arrowType);
}
Symbol 267 MovieClip Frame 7 (168 B)
_root.archerArrow.duplicateMovieClip("newArrow" + _root.arrowNum, _root.depth++, {_x:_parent._x, _y:_parent._y});
_root.arrowNum++;
_root.Arrows[_root.arrowNum] = 1;
Symbol 284 MovieClip Frame 26 (48 B)
_root.troopsAlive--;
removeMovieClip(_parent);
Symbol 296 MovieClip Frame 30 (840 B)
i = 0;
while (i < (_root.infantryNumber + 1)) {
if (!hit) {
if (_root.infantryArray[i] == 1) {
if (hitTest(_root["infantry" + i])) {
_root["infantry" + i].gotoAndStop(3);
_root.infantryArray[i] = 0;
hit = true;
}
}
}
i++;
}
i = 0;
while (i < (_root.cavalryNumber + 1)) {
if (!hit) {
if (_root.cavalryArray[i] == 1) {
if (hitTest(_root["cavalry" + i])) {
_root["cavalry" + i].gotoAndStop(3);
_root.cavalryArray[i] = 0;
hit = true;
}
}
}
i++;
}
i = 0;
while (i < (_root.ramNumber + 1)) {
if (!hit) {
if (_root.ramArray[i] == 1) {
if (hitTest(_root["ram" + i])) {
_root["ram" + i].HP--;
hit = true;
if (_root["ram" + i].HP < 1) {
_root["ram" + i].gotoAndStop(3);
_root.ramArray[i] = 0;
}
}
}
}
i++;
}
Symbol 296 MovieClip Frame 35 (23 B)
removeMovieClip(this);
Symbol 297 Button (91 B)
on (release) {
if (_root.infCount > 0) {
deploy("infantry");
_root.infCount--;
}
}
Symbol 298 Button (91 B)
on (release) {
if (_root.archCount > 0) {
deploy("archer");
_root.archCount--;
}
}
Symbol 299 Button (86 B)
on (release) {
if (_root.ramCount > 0) {
deploy("ram");
_root.ramCount--;
}
}
Symbol 314 Button (244 B)
on (release) {
gotoAndStop (4);
enemyHP = level * 800;
arrowFrameDelay--;
enemyIntel = ((("Estimated Hit Points: " + (enemyHP - (random(10) * 10))) + newline) + "Estimated amount of Gold stashed: ") + ((level * 2000) - (random(50) * 10));
}
Symbol 318 Button (509 B)
on (release) {
_root.InvasionSettings.data.infCount = infCount;
_root.InvasionSettings.data.archCount = archCount;
_root.InvasionSettings.data.ramCount = ramCount;
_root.InvasionSettings.data.gold = gold;
_root.InvasionSettings.data.infUpgrades = infUpgrades;
_root.InvasionSettings.data.archUpgrades = archUpgrades;
_root.InvasionSettings.data.ramUpgrades = ramUpgrades;
_root.InvasionSettings.data.arrowType = arrowType;
_root.InvasionSettings.data.level = level;
_root.InvasionSettings.flush();
}
Symbol 322 Button (34 B)
on (release) {
gotoAndStop (2);
}
Symbol 325 Button (34 B)
on (release) {
gotoAndStop (2);
}
Symbol 336 Button (28 B)
on (press) {
nextFrame();
}
Symbol 338 Button (28 B)
on (press) {
prevFrame();
}
Symbol 340 MovieClip Frame 1 (79 B)
this[myBoolean] = true;
this[mySave] = true;
_root.InvasionSettings.flush();
Symbol 340 MovieClip Frame 2 (81 B)
this[myBoolean] = false;
this[mySave] = false;
_root.InvasionSettings.flush();
Symbol 345 Button (32 B)
on (press) {
gotoAndStop (3);
}
Symbol 348 Button (32 B)
on (press) {
gotoAndStop (1);
}
Symbol 349 MovieClip Frame 1 (81 B)
this[myBoolean] = "HIGH";
_root.InvasionSettings.data.qualitySettings = "HIGH";
Symbol 349 MovieClip Frame 2 (85 B)
this[myBoolean] = "MEDIUM";
_root.InvasionSettings.data.qualitySettings = "MEDIUM";
Symbol 349 MovieClip Frame 3 (79 B)
this[myBoolean] = "LOW";
_root.InvasionSettings.data.qualitySettings = "LOW";