Frame 1
_root.cursor.gotoAndStop(1);
NewgroundsAPI.connectMovie(2175);
Instance of Symbol 23 MovieClip "cursor" in Frame 1
onClipEvent (enterFrame) {
Mouse.hide();
startDrag (this, true);
}
onClipEvent (enterFrame) {
this.swapDepths(2000);
}
Frame 2
stop();
turnnumber = 0;
var savefile = SharedObject.getLocal("Year2121");
a = 1;
while (a < 6) {
_root[("AI" + a) + "territoriesowned"] = 1;
_root[("AI" + a) + "gold"] = 1000;
_root[("AI" + a) + "food"] = 500;
_root[("AI" + a) + "metal"] = 500;
_root[("AI" + a) + "towerlevel"] = 1;
_root[("AI" + a) + "towerlevelcost"] = 200;
_root[("AI" + a) + "towerlevelmcost"] = 200;
_root[("AI" + a) + "towerfirerate"] = 20;
_root[("AI" + a) + "towerfireratecost"] = 200;
_root[("AI" + a) + "towerfireratemcost"] = 200;
_root[("AI" + a) + "towerdamage"] = 1;
_root[("AI" + a) + "towerdamagecost"] = 200;
_root[("AI" + a) + "towerdamagemcost"] = 200;
_root[("AI" + a) + "towerhealth"] = 100;
_root[("AI" + a) + "towerhealthcost"] = 200;
_root[("AI" + a) + "towerhealthmcost"] = 200;
u = 1;
while (u < 9) {
_root[((("AI" + a) + "unit") + u) + "owned"] = 0;
u++;
}
a++;
}
playergold = 1000;
playerfood = 500;
playermetal = 500;
playertowerfirerate = 20;
playertowerfireratecost = 200;
playertowerfireratemcost = 200;
playertowerdamage = 1;
playertowerdamagecost = 200;
playertowerdamagemcost = 200;
playertowerhealth = 100;
playertowerhealthcost = 200;
playertowerhealthmcost = 200;
i = 1;
while (i < 11) {
_root[("territory" + i) + "owned"] = 0;
_root[("territory" + i) + "upgradecost"] = 50;
_root[("territory" + i) + "farminglevel"] = 1;
_root[("territory" + i) + "infrastructurelevel"] = 1;
_root[("territory" + i) + "industrylevel"] = 1;
i++;
}
_root.unit1cost = 30;
_root.unit1speed = 5;
_root.unit1food = 30;
_root.unit1range = 0;
_root.unit1damage = 4;
_root.unit1hp = 5;
_root.unit1owned = 0;
_root.unit2cost = 50;
_root.unit2speed = 8;
_root.unit2food = 30;
_root.unit2range = 0;
_root.unit2damage = 3;
_root.unit2hp = 2;
_root.unit2owned = 0;
_root.unit3cost = 75;
_root.unit3speed = 2;
_root.unit3food = 50;
_root.unit3range = 0;
_root.unit3damage = 7;
_root.unit3hp = 8;
_root.unit3owned = 0;
_root.unit4cost = 200;
_root.unit4speed = 3;
_root.unit4food = 200;
_root.unit4range = 8;
_root.unit4damage = 6;
_root.unit4hp = 15;
_root.unit4owned = 0;
_root.unit5cost = 80;
_root.unit5speed = 5;
_root.unit5food = 60;
_root.unit5range = 7;
_root.unit5damage = 2;
_root.unit5hp = 6;
_root.unit5owned = 0;
_root.unit6cost = 100;
_root.unit6speed = 7;
_root.unit6food = 80;
_root.unit6range = 3;
_root.unit6damage = 1;
_root.unit6hp = 3;
_root.unit6owned = 0;
_root.unit7cost = 350;
_root.unit7speed = 4;
_root.unit7food = 500;
_root.unit7range = 6;
_root.unit7damage = 8;
_root.unit7hp = 15;
_root.unit7owned = 0;
_root.unit8cost = 500;
_root.unit8speed = 2;
_root.unit8food = 350;
_root.unit8range = 10;
_root.unit8damage = 10;
_root.unit8hp = 10;
_root.unit8owned = 0;
Frame 3
onEnterFrame = function () {
savefile.data.game1Name = _root.Name;
};
Instance of Symbol 110 MovieClip in Frame 3
on (press) {
nextFrame();
}
Instance of Symbol 114 MovieClip "lol" in Frame 3
on (press) {
_root.map.gotoAndStop("england");
_root.stats.gotoAndStop("england");
_root.countryselected = "England";
}
Instance of Symbol 114 MovieClip in Frame 3
on (press) {
_root.lol._x = _x;
_root.lol._y = _y;
_root.map.gotoAndStop("england");
_root.stats.gotoAndStop("england");
_root.countryselected = "England";
}
Instance of Symbol 117 MovieClip in Frame 3
on (press) {
_root.lol._x = _x;
_root.lol._y = _y;
_root.map.gotoAndStop("ireland");
_root.stats.gotoAndStop("ireland");
_root.countryselected = "Ireland";
}
Instance of Symbol 120 MovieClip in Frame 3
on (press) {
_root.lol._x = _x;
_root.lol._y = _y;
_root.map.gotoAndStop("germany");
_root.stats.gotoAndStop("germany");
_root.countryselected = "Germany";
}
Instance of Symbol 124 MovieClip in Frame 3
on (press) {
_root.lol._x = _x;
_root.lol._y = _y;
_root.map.gotoAndStop("spain");
_root.stats.gotoAndStop("spain");
_root.countryselected = "Spain";
}
Frame 4
function save() {
trace("Saved");
trace(turncount);
a = 1;
while (a < 5) {
savefile.data[("AI" + a) + "territoriesowned"] = _root[("AI" + a) + "territoriesowned"];
savefile.data[("AI" + a) + "gold"] = _root[("AI" + a) + "gold"];
savefile.data[("AI" + a) + "food"] = _root[("AI" + a) + "food"];
savefile.data[("AI" + a) + "metal"] = _root[("AI" + a) + "metal"];
savefile.data[("AI" + a) + "towerlevel"] = _root[("AI" + a) + "towerlevel"];
savefile.data[("AI" + a) + "towerlevelcost"] = _root[("AI" + a) + "towerlevelcost"];
savefile.data[("AI" + a) + "towerlevelmcost"] = _root[("AI" + a) + "towerlevelmcost"];
savefile.data[("AI" + a) + "towerfirerate"] = _root[("AI" + a) + "towerfirerate"];
savefile.data[("AI" + a) + "towerfireratecost"] = _root[("AI" + a) + "towerfireratecost"];
savefile.data[("AI" + a) + "towerfireratemcost"] = _root[("AI" + a) + "towerfireratemcost"];
savefile.data[("AI" + a) + "towerdamage"] = _root[("AI" + a) + "towerdamage"];
savefile.data[("AI" + a) + "towerdamagecost"] = _root[("AI" + a) + "towerdamagecost"];
savefile.data[("AI" + a) + "towerdamagemcost"] = _root[("AI" + a) + "towerdamagemcost"];
savefile.data[("AI" + a) + "towerhealth"] = _root[("AI" + a) + "towerhealth"];
savefile.data[("AI" + a) + "towerhealthcost"] = _root[("AI" + a) + "towerhealthcost"];
savefile.data[("AI" + a) + "towerhealthmcost"] = _root[("AI" + a) + "towerhealthmcost"];
u = 1;
while (u < 9) {
savefile.data[((("AI" + a) + "unit") + u) + "owned"] = _root[((("AI" + a) + "unit") + u) + "owned"];
u++;
}
a++;
}
savefile.data.playerturn = _root.playerturn;
savefile.data.turn = _root.turn;
savefile.data.turncount = _root.turncount;
savefile.data.playergold = playergold;
savefile.data.playerfood = playerfood;
savefile.data.playermetal = playermetal;
savefile.data.playertowerlevel = playertowerlevel;
savefile.data.playertowerlevelcost = playertowerlevelcost;
savefile.data.playertowerlevelmcost = playertowerlevelmcost;
savefile.data.playertowerfirerate = playertowerfirerate;
savefile.data.playertowerfireratecost = playertowerfireratecost;
savefile.data.playertowerfireratemcost = playertowerfireratemcost;
savefile.data.playertowerdamage = playertowerdamage;
savefile.data.playertowerdamagecost = playertowerdamagecost;
savefile.data.playertowerdamagemcost = playertowerdamagemcost;
savefile.data.playertowerhealth = playertowerhealth;
savefile.data.playertowerhealthcost = playertowerhealthcost;
savefile.data.playertowerhealthmcost = playertowerhealthmcost;
i = 1;
while (i < 11) {
savefile.data[("territory" + i) + "owned"] = _root[("territory" + i) + "owned"];
savefile.data[("territory" + i) + "upgradecost"] = _root[("territory" + i) + "upgradecost"];
savefile.data[("territory" + i) + "farminglevel"] = _root[("territory" + i) + "farminglevel"];
savefile.data[("territory" + i) + "infrastructurelevel"] = _root[("territory" + i) + "infrastructurelevel"];
savefile.data[("territory" + i) + "industrylevel"] = _root[("territory" + i) + "industrylevel"];
i++;
}
savefile.data.countryselected = _root.countryselected;
savefile.data.playercolour = _root.playercolour;
ai = 1;
while (ai < 5) {
if (_root[("ai" + ai) + "country"] != "undefined") {
savefile.data[("ai" + ai) + "country"] = _root[("ai" + ai) + "country"];
savefile.data[("AI" + ai) + "colour"] = _root[("AI" + ai) + "colour"];
}
ai++;
}
}
_root.cursor.gotoAndStop(1);
timer = 50;
dontdeploy = false;
wait = false;
_root.toolbar.Place = "Loland";
onEnterFrame = function () {
if (_root._currentframe == 4) {
if (turn == playerturn) {
if (!stopp) {
countaa = 0;
Ter = 1;
while (Ter < 11) {
if (_root[("territory" + Ter) + "owned"] == 1) {
countaa++;
_root.playergold = _root.playergold + (200 * _root[("territory" + Ter) + "infrastructurelevel"]);
_root.playerfood = _root.playerfood + (100 * _root[("territory" + Ter) + "farminglevel"]);
_root.playermetal = _root.playermetal + (100 * _root[("territory" + Ter) + "industrylevel"]);
}
Ter++;
}
if (countaa == 10) {
_root.win.gotoAndStop(2);
}
timer = 50;
_root.turncount++;
save();
stopp = true;
_root.toolbar.gotoAndStop(1);
}
} else {
if (!wait) {
_root.toolbar.gotoAndStop("wait");
if (timer > 0) {
timer--;
} else {
trace("AI TURN");
timer = 50;
stopp = false;
aino = turn;
trace("AINO = " + aino);
territorycount = 0;
tt = 1;
while (tt < 11) {
if (_root[("territory" + tt) + "owned"] == ("AI" + aino)) {
trace("ter ++");
territorycount++;
}
tt++;
}
trace("territory - " + territorycount);
Ter = 1;
while (Ter < 11) {
if (_root[("territory" + Ter) + "owned"] == ("AI" + aino)) {
_root[("AI" + aino) + "gold"] = _root[("AI" + aino) + "gold"] + (100 * _root[("territory" + Ter) + "infrastructurelevel"]);
_root[("AI" + aino) + "food"] = _root[("AI" + aino) + "food"] + (100 * _root[("territory" + Ter) + "farminglevel"]);
_root[("AI" + aino) + "metal"] = _root[("AI" + aino) + "metal"] + (100 * _root[("territory" + Ter) + "industrylevel"]);
}
Ter++;
}
trace("AITURN");
if (territorycount == 0) {
turn++;
trace("skip");
}
if (territorycount > 0) {
trace(("AI" + aino) + "'s turn ----------------");
_root.toolbar.gotoAndStop("wait");
whattodo = random(4);
if (whattodo >= 2) {
while (_root[("AI" + aino) + "gold"] >= 200) {
while (((_root[("AI" + aino) + "unit1owned"] < 10) && (_root[("AI" + aino) + "gold"] > _root.unit1cost)) && (_root[("AI" + aino) + "food"] > _root.unit1food)) {
_root[("AI" + aino) + "unit1owned"] = _root[("AI" + aino) + "unit1owned"] + 1;
trace(("AI" + aino) + " is buying unit 1");
_root[("AI" + aino) + "gold"] = _root[("AI" + aino) + "gold"] - _root.unit1cost;
_root[("AI" + aino) + "food"] = _root[("AI" + aino) + "food"] - _root.unit1food;
}
i = 8;
while (i > 0) {
if ((_root[("AI" + aino) + "gold"] > _root[("unit" + i) + "cost"]) && (_root[("AI" + aino) + "metal"] > _root[("unit" + i) + "food"])) {
_root[((("AI" + aino) + "unit") + i) + "owned"] = _root[((("AI" + aino) + "unit") + i) + "owned"] + 1;
_root[("AI" + aino) + "gold"] = _root[("AI" + aino) + "gold"] - _root[("unit" + i) + "cost"];
_root[("AI" + aino) + "food"] = _root[("AI" + aino) + "food"] - _root[("unit" + i) + "food"];
}
i--;
}
}
} else if (whattodo == 1) {
r = random(3);
mn = random(10) + 1;
while (_root[("territory" + mn) + "owned"] != ("AI" + aino)) {
mn = random(10) + 1;
}
if (_root[("AI" + aino) + "gold"] > _root[("territory" + mn) + "upgradecost"]) {
if (r == 0) {
_root[("territory" + mn) + "farminglevel"]++;
_root[("AI" + aino) + "gold"] = _root[("AI" + aino) + "gold"] - _root[("territory" + mn) + "upgradecost"];
_root[("territory" + mn) + "upgradecost"] = _root[("territory" + mn) + "upgradecost"] * 2;
} else if (r == 1) {
_root[("territory" + mn) + "industrylevel"]++;
_root[("AI" + aino) + "gold"] = _root[("AI" + aino) + "gold"] - _root[("territory" + mn) + "upgradecost"];
_root[("territory" + mn) + "upgradecost"] = _root[("territory" + mn) + "upgradecost"] * 2;
} else if (r == 2) {
_root[("territory" + mn) + "industrylevel"]++;
_root[("AI" + aino) + "gold"] = _root[("AI" + aino) + "gold"] - _root[("territory" + mn) + "upgradecost"];
_root[("territory" + mn) + "upgradecost"] = _root[("territory" + mn) + "upgradecost"] * 2;
}
}
} else {
trace("UPGRADING TOWER");
trace("TOWER HEALTH = " + _root[("AI" + aino) + "towerhealth"]);
trace("TOWER DAMAGE = " + _root[("AI" + aino) + "towerdamage"]);
trace("TOWER FIRERATE = " + _root[("AI" + aino) + "towerfirerate"]);
r = random(3);
if (r == 1) {
if ((_root[("AI" + aino) + "gold"] >= _root.AI1towerhealthcost) && (_root[("AI" + aino) + "metal"] >= _root.AI1towerhealthmcost)) {
_root[("AI" + aino) + "gold"] = _root[("AI" + aino) + "gold"] - _root.AI1towerhealthcost;
_root[("AI" + aino) + "metal"] = _root[("AI" + aino) + "metal"] - _root.AI1towerhealthmcost;
_root[("AI" + aino) + "towerhealth"] = _root[("AI" + aino) + "towerhealth"] + 50;
_root[("AI" + aino) + "towerhealthcost"] = _root[("AI" + aino) + "towerhealthcost"] * 2;
_root[("AI" + aino) + "towerhealthmcost"] = _root[("AI" + aino) + "towerhealthmcost"] * 2;
}
} else if (r == 2) {
if ((_root[("AI" + aino) + "gold"] >= _root.AI1towerdamagecost) && (_root[("AI" + aino) + "metal"] >= _root.AI1towerdamagemcost)) {
_root[("AI" + aino) + "gold"] = _root[("AI" + aino) + "gold"] - _root.AI1towerdamagecost;
_root[("AI" + aino) + "metal"] = _root[("AI" + aino) + "metal"] - _root.AI1towerdamagemcost;
_root[("AI" + aino) + "towerdamage"]++;
_root[("AI" + aino) + "towerdamagecost"] = _root[("AI" + aino) + "towerdamagecost"] * 2;
_root[("AI" + aino) + "towerdamagemcost"] = _root[("AI" + aino) + "towerdamagemcost"] * 2;
}
} else if (r == 0) {
if ((_root[("AI" + aino) + "gold"] >= _root.AI1towerfireratecost) && (_root[("AI" + aino) + "metal"] >= _root.AI1towerfireratemcost)) {
_root[("AI" + aino) + "gold"] = _root[("AI" + aino) + "gold"] - _root.AI1towerfireratecost;
_root[("AI" + aino) + "metal"] = _root[("AI" + aino) + "metal"] - _root.AI1towerfireratemcost;
_root[("AI" + aino) + "towerfirerate"] = _root[("AI" + aino) + "towerfirerate"] - 2;
_root[("AI" + aino) + "towerfireratecost"] = _root[("AI" + aino) + "towerfireratecost"] * 2;
_root[("AI" + aino) + "towerfireratemcost"] = _root[("AI" + aino) + "towerfireratemcost"] * 2;
}
}
trace("UPGRADED TOWER");
trace("TOWER HEALTH = " + _root[("AI" + aino) + "towerhealth"]);
trace("TOWER DAMAGE = " + _root[("AI" + aino) + "towerdamage"]);
trace("TOWER FIRERATE = " + _root[("AI" + aino) + "towerfirerate"]);
}
ug = 1;
while (ug < 9) {
_root[("unit" + ug) + "deployed"] = 0;
ug++;
}
unitsownedd = 0;
ugh = 9;
while (ugh > 0) {
_root["lol" + ugh] = _root[((("AI" + aino) + "unit") + ugh) + "owned"];
if (_root["lol" + ugh] > 0) {
_root["lol" + ugh]--;
trace("addedthing");
_root.unitsownedd = _root.unitsownedd + ugh;
}
ugh--;
}
if (unitsownedd > 4) {
trace("fight!");
a = random(10) + 1;
trace("AI" + aino);
trace("a is " + a);
if (_root[("territory" + a) + "owned"] == ("AI" + aino)) {
trace("dontattackself");
} else if (_root[("territory" + a) + "owned"] == 1) {
ud = 1;
while (ud < 9) {
while (_root[((("AI" + aino) + "unit") + ud) + "owned"] > 0) {
_root[("unit" + ud) + "deployed"]++;
_root[((("AI" + aino) + "unit") + ud) + "owned"] = _root[((("AI" + aino) + "unit") + ud) + "owned"] - 1;
}
ud++;
}
_root.toolbar.gotoAndStop("defend");
_root.attackplace = _root["territory" + a].Name;
_root.attacker = _root[("ai" + aino) + "country"];
_root.attackplace2 = _root["territory" + a];
B = 1;
while (B < 9) {
if (_root[((("AI" + aino) + "unit") + B) + "owned"] > 0) {
break;
}
if (B == 8) {
dontdeploy = true;
trace("LOL");
}
B++;
}
wait = true;
} else {
aiowned = false;
oa = 1;
while (oa < 5) {
if (_root[("territory" + a) + "owned"] == ("AI" + oa)) {
aiowned = true;
break;
}
oa++;
}
if (aiowned) {
trace(((("AI" + aino) + " vs ") + "AI") + oa);
trace("Fighting for " + _root["territory" + a]);
aiattackerpoints = 0;
aidefenderpoints = 0;
uf = 1;
while (uf < 9) {
while (_root[((("AI" + aino) + "unit") + uf) + "owned"] > 0) {
_root[((("AI" + aino) + "unit") + uf) + "owned"]--;
_root.aiattackerpoints = _root.aiattackerpoints + uf;
}
trace("uf = " + uf);
trace((("AI" + oa) + "unit1owned = ") + _root[("AI" + oa) + "unit1owned"]);
while (_root[((("AI" + oa) + "unit") + uf) + "owned"] > 0) {
trace("added one" + oa);
_root[((("AI" + oa) + "unit") + uf) + "owned"]--;
_root.aidefenderpoints = _root.aidefenderpoints + uf;
}
uf++;
}
trace((aiattackerpoints + "vs") + aidefenderpoints);
if (aiattackerpoints > aidefenderpoints) {
trace("won");
_root[("territory" + a) + "owned"] = "AI" + aino;
}
} else if (random(2) == 1) {
trace("Taken");
trace(_root[("territory" + a) + "owned"]);
trace(a);
_root[("territory" + a) + "owned"] = "AI" + aino;
trace(_root[("territory" + a) + "owned"]);
}
}
}
trace("End of GO --------------");
turn++;
}
}
}
if ((turn == 5) && (!wait)) {
turn = 1;
}
}
}
};
Instance of Symbol 134 MovieClip in Frame 4
onClipEvent (load) {
Name = "France";
number = 1;
_name = ("territory" + number);
}
onClipEvent (enterFrame) {
if (_root[("territory" + number) + "owned"] == 1) {
new Color(this).setRGB(_root.playercolour);
} else if (_root[("territory" + number) + "owned"] == "AI1") {
new Color(this).setRGB(_root.AI1colour);
} else if (_root[("territory" + number) + "owned"] == "AI2") {
new Color(this).setRGB(_root.AI2colour);
} else if (_root[("territory" + number) + "owned"] == "AI3") {
new Color(this).setRGB(_root.AI3colour);
} else if (_root[("territory" + number) + "owned"] == "AI4") {
new Color(this).setRGB(_root.AI4colour);
}
if (_root.toolbar.place == Name) {
_root[("territory" + number) + "upgradecost"] = _root.toolbar.upgradecost;
_root[("territory" + number) + "farminglevel"] = _root.toolbar.farminglevel;
_root[("territory" + number) + "infrastructurelevel"] = _root.toolbar.infrastructurelevel;
_root[("territory" + number) + "industrylevel"] = _root.toolbar.industrylevel;
_root.toolbar.moneyincome = _root[("territory" + number) + "infrastructurelevel"] * 100;
_root.toolbar.foodincome = _root[("territory" + number) + "farminglevel"] * 100;
_root.toolbar.metalincome = _root[("territory" + number) + "industrylevel"] * 100;
}
}
on (press) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.toolbar.gotoAndStop("upgrade");
_root.toolbar.place = Name;
_root.toolbar.upgradecost = _root[("territory" + number) + "upgradecost"];
_root.toolbar.farminglevel = _root[("territory" + number) + "farminglevel"];
_root.toolbar.infrastructurelevel = _root[("territory" + number) + "infrastructurelevel"];
_root.toolbar.industrylevel = _root[("territory" + number) + "industrylevel"];
} else {
_root.attackplace = Name;
_root.number = number;
if (_root[("territory" + number) + "owned"] == "AI1") {
_root.ownedd = 1;
} else if (_root[("territory" + number) + "owned"] == "AI2") {
_root.ownedd = 2;
} else if (_root[("territory" + number) + "owned"] == "AI3") {
_root.ownedd = 3;
} else if (_root[("territory" + number) + "owned"] == "AI4") {
_root.ownedd = 4;
} else {
_root.ownedd = 5;
}
_root.toolbar.gotoAndStop("attack");
}
}
on (rollOver) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.cursor.gotoAndStop("friendly");
} else {
_root.cursor.gotoAndStop("enemy");
}
}
on (rollOut) {
_root.cursor.gotoAndStop(1);
}
Instance of Symbol 136 MovieClip in Frame 4
onClipEvent (load) {
Name = "Spain";
number = 2;
_name = ("territory" + number);
}
onClipEvent (enterFrame) {
if (_root[("territory" + number) + "owned"] == 1) {
new Color(this).setRGB(_root.playercolour);
} else if (_root[("territory" + number) + "owned"] == "AI1") {
new Color(this).setRGB(_root.AI1colour);
} else if (_root[("territory" + number) + "owned"] == "AI2") {
new Color(this).setRGB(_root.AI2colour);
} else if (_root[("territory" + number) + "owned"] == "AI3") {
new Color(this).setRGB(_root.AI3colour);
} else if (_root[("territory" + number) + "owned"] == "AI4") {
new Color(this).setRGB(_root.AI4colour);
}
if (_root.toolbar.place == Name) {
_root[("territory" + number) + "upgradecost"] = _root.toolbar.upgradecost;
_root[("territory" + number) + "farminglevel"] = _root.toolbar.farminglevel;
_root[("territory" + number) + "infrastructurelevel"] = _root.toolbar.infrastructurelevel;
_root[("territory" + number) + "industrylevel"] = _root.toolbar.industrylevel;
_root.toolbar.moneyincome = _root[("territory" + number) + "infrastructurelevel"] * 100;
_root.toolbar.foodincome = _root[("territory" + number) + "farminglevel"] * 100;
_root.toolbar.metalincome = _root[("territory" + number) + "industrylevel"] * 100;
}
}
on (press) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.toolbar.gotoAndStop("upgrade");
_root.attackplace2 = number;
_root.toolbar.place = Name;
_root.toolbar.upgradecost = _root[("territory" + number) + "upgradecost"];
_root.toolbar.farminglevel = _root[("territory" + number) + "farminglevel"];
_root.toolbar.infrastructurelevel = _root[("territory" + number) + "infrastructurelevel"];
_root.toolbar.industrylevel = _root[("territory" + number) + "industrylevel"];
} else {
_root.attackplace = Name;
_root.number = number;
if (_root[("territory" + number) + "owned"] == "AI1") {
_root.ownedd = 1;
} else if (_root[("territory" + number) + "owned"] == "AI2") {
_root.ownedd = 2;
} else if (_root[("territory" + number) + "owned"] == "AI3") {
_root.ownedd = 3;
} else if (_root[("territory" + number) + "owned"] == "AI4") {
_root.ownedd = 4;
} else {
_root.ownedd = 5;
}
_root.toolbar.gotoAndStop("attack");
}
}
on (rollOver) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.cursor.gotoAndStop("friendly");
} else {
_root.cursor.gotoAndStop("enemy");
}
}
on (rollOut) {
_root.cursor.gotoAndStop(1);
}
Instance of Symbol 138 MovieClip in Frame 4
onClipEvent (load) {
Name = "Portugal";
number = 3;
_name = ("territory" + number);
}
onClipEvent (enterFrame) {
if (_root[("territory" + number) + "owned"] == 1) {
new Color(this).setRGB(_root.playercolour);
} else if (_root[("territory" + number) + "owned"] == "AI1") {
new Color(this).setRGB(_root.AI1colour);
} else if (_root[("territory" + number) + "owned"] == "AI2") {
new Color(this).setRGB(_root.AI2colour);
} else if (_root[("territory" + number) + "owned"] == "AI3") {
new Color(this).setRGB(_root.AI3colour);
} else if (_root[("territory" + number) + "owned"] == "AI4") {
new Color(this).setRGB(_root.AI4colour);
}
if (_root.toolbar.place == Name) {
_root[("territory" + number) + "upgradecost"] = _root.toolbar.upgradecost;
_root[("territory" + number) + "farminglevel"] = _root.toolbar.farminglevel;
_root[("territory" + number) + "infrastructurelevel"] = _root.toolbar.infrastructurelevel;
_root[("territory" + number) + "industrylevel"] = _root.toolbar.industrylevel;
_root.toolbar.moneyincome = _root[("territory" + number) + "infrastructurelevel"] * 100;
_root.toolbar.foodincome = _root[("territory" + number) + "farminglevel"] * 100;
_root.toolbar.metalincome = _root[("territory" + number) + "industrylevel"] * 100;
}
}
on (press) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.toolbar.gotoAndStop("upgrade");
_root.toolbar.place = Name;
_root.toolbar.upgradecost = _root[("territory" + number) + "upgradecost"];
_root.toolbar.farminglevel = _root[("territory" + number) + "farminglevel"];
_root.toolbar.infrastructurelevel = _root[("territory" + number) + "infrastructurelevel"];
_root.toolbar.industrylevel = _root[("territory" + number) + "industrylevel"];
} else {
_root.attackplace = Name;
_root.number = number;
if (_root[("territory" + number) + "owned"] == "AI1") {
_root.ownedd = 1;
} else if (_root[("territory" + number) + "owned"] == "AI2") {
_root.ownedd = 2;
} else if (_root[("territory" + number) + "owned"] == "AI3") {
_root.ownedd = 3;
} else if (_root[("territory" + number) + "owned"] == "AI4") {
_root.ownedd = 4;
} else {
_root.ownedd = 5;
}
_root.toolbar.gotoAndStop("attack");
}
}
on (rollOver) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.cursor.gotoAndStop("friendly");
} else {
_root.cursor.gotoAndStop("enemy");
}
}
on (rollOut) {
_root.cursor.gotoAndStop(1);
}
Instance of Symbol 140 MovieClip in Frame 4
onClipEvent (load) {
Name = "Italy";
number = 4;
_name = ("territory" + number);
}
onClipEvent (enterFrame) {
if (_root[("territory" + number) + "owned"] == 1) {
new Color(this).setRGB(_root.playercolour);
} else if (_root[("territory" + number) + "owned"] == "AI1") {
new Color(this).setRGB(_root.AI1colour);
} else if (_root[("territory" + number) + "owned"] == "AI2") {
new Color(this).setRGB(_root.AI2colour);
} else if (_root[("territory" + number) + "owned"] == "AI3") {
new Color(this).setRGB(_root.AI3colour);
} else if (_root[("territory" + number) + "owned"] == "AI4") {
new Color(this).setRGB(_root.AI4colour);
}
if (_root.toolbar.place == Name) {
_root[("territory" + number) + "upgradecost"] = _root.toolbar.upgradecost;
_root[("territory" + number) + "farminglevel"] = _root.toolbar.farminglevel;
_root[("territory" + number) + "infrastructurelevel"] = _root.toolbar.infrastructurelevel;
_root[("territory" + number) + "industrylevel"] = _root.toolbar.industrylevel;
_root.toolbar.moneyincome = _root[("territory" + number) + "infrastructurelevel"] * 100;
_root.toolbar.foodincome = _root[("territory" + number) + "farminglevel"] * 100;
_root.toolbar.metalincome = _root[("territory" + number) + "industrylevel"] * 100;
}
}
on (press) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.toolbar.gotoAndStop("upgrade");
_root.toolbar.place = Name;
_root.toolbar.upgradecost = _root[("territory" + number) + "upgradecost"];
_root.toolbar.farminglevel = _root[("territory" + number) + "farminglevel"];
_root.toolbar.infrastructurelevel = _root[("territory" + number) + "infrastructurelevel"];
_root.toolbar.industrylevel = _root[("territory" + number) + "industrylevel"];
} else {
_root.attackplace = Name;
_root.number = number;
if (_root[("territory" + number) + "owned"] == "AI1") {
_root.ownedd = 1;
} else if (_root[("territory" + number) + "owned"] == "AI2") {
_root.ownedd = 2;
} else if (_root[("territory" + number) + "owned"] == "AI3") {
_root.ownedd = 3;
} else if (_root[("territory" + number) + "owned"] == "AI4") {
_root.ownedd = 4;
} else {
_root.ownedd = 5;
}
_root.toolbar.gotoAndStop("attack");
}
}
on (rollOver) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.cursor.gotoAndStop("friendly");
} else {
_root.cursor.gotoAndStop("enemy");
}
}
on (rollOut) {
_root.cursor.gotoAndStop(1);
}
Instance of Symbol 142 MovieClip in Frame 4
onClipEvent (load) {
Name = "Switzerland";
number = 5;
_name = ("territory" + number);
}
onClipEvent (enterFrame) {
if (_root[("territory" + number) + "owned"] == 1) {
new Color(this).setRGB(_root.playercolour);
} else if (_root[("territory" + number) + "owned"] == "AI1") {
new Color(this).setRGB(_root.AI1colour);
} else if (_root[("territory" + number) + "owned"] == "AI2") {
new Color(this).setRGB(_root.AI2colour);
} else if (_root[("territory" + number) + "owned"] == "AI3") {
new Color(this).setRGB(_root.AI3colour);
} else if (_root[("territory" + number) + "owned"] == "AI4") {
new Color(this).setRGB(_root.AI4colour);
}
if (_root.toolbar.place == Name) {
_root[("territory" + number) + "upgradecost"] = _root.toolbar.upgradecost;
_root[("territory" + number) + "farminglevel"] = _root.toolbar.farminglevel;
_root[("territory" + number) + "infrastructurelevel"] = _root.toolbar.infrastructurelevel;
_root[("territory" + number) + "industrylevel"] = _root.toolbar.industrylevel;
_root.toolbar.moneyincome = _root[("territory" + number) + "infrastructurelevel"] * 100;
_root.toolbar.foodincome = _root[("territory" + number) + "farminglevel"] * 100;
_root.toolbar.metalincome = _root[("territory" + number) + "industrylevel"] * 100;
}
}
on (press) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.toolbar.gotoAndStop("upgrade");
_root.toolbar.place = Name;
_root.toolbar.upgradecost = _root[("territory" + number) + "upgradecost"];
_root.toolbar.farminglevel = _root[("territory" + number) + "farminglevel"];
_root.toolbar.infrastructurelevel = _root[("territory" + number) + "infrastructurelevel"];
_root.toolbar.industrylevel = _root[("territory" + number) + "industrylevel"];
} else {
_root.attackplace = Name;
_root.number = number;
if (_root[("territory" + number) + "owned"] == "AI1") {
_root.ownedd = 1;
} else if (_root[("territory" + number) + "owned"] == "AI2") {
_root.ownedd = 2;
} else if (_root[("territory" + number) + "owned"] == "AI3") {
_root.ownedd = 3;
} else if (_root[("territory" + number) + "owned"] == "AI4") {
_root.ownedd = 4;
} else {
_root.ownedd = 5;
}
_root.toolbar.gotoAndStop("attack");
}
}
on (rollOver) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.cursor.gotoAndStop("friendly");
} else {
_root.cursor.gotoAndStop("enemy");
}
}
on (rollOut) {
_root.cursor.gotoAndStop(1);
}
Instance of Symbol 144 MovieClip in Frame 4
onClipEvent (load) {
Name = "Germany";
number = 6;
_name = ("territory" + number);
}
onClipEvent (enterFrame) {
if (_root[("territory" + number) + "owned"] == 1) {
new Color(this).setRGB(_root.playercolour);
} else if (_root[("territory" + number) + "owned"] == "AI1") {
new Color(this).setRGB(_root.AI1colour);
} else if (_root[("territory" + number) + "owned"] == "AI2") {
new Color(this).setRGB(_root.AI2colour);
} else if (_root[("territory" + number) + "owned"] == "AI3") {
new Color(this).setRGB(_root.AI3colour);
} else if (_root[("territory" + number) + "owned"] == "AI4") {
new Color(this).setRGB(_root.AI4colour);
}
if (_root.toolbar.place == Name) {
_root[("territory" + number) + "upgradecost"] = _root.toolbar.upgradecost;
_root[("territory" + number) + "farminglevel"] = _root.toolbar.farminglevel;
_root[("territory" + number) + "infrastructurelevel"] = _root.toolbar.infrastructurelevel;
_root[("territory" + number) + "industrylevel"] = _root.toolbar.industrylevel;
_root.toolbar.moneyincome = _root[("territory" + number) + "infrastructurelevel"] * 100;
_root.toolbar.foodincome = _root[("territory" + number) + "farminglevel"] * 100;
_root.toolbar.metalincome = _root[("territory" + number) + "industrylevel"] * 100;
}
}
on (press) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.toolbar.gotoAndStop("upgrade");
_root.toolbar.place = Name;
_root.toolbar.upgradecost = _root[("territory" + number) + "upgradecost"];
_root.toolbar.farminglevel = _root[("territory" + number) + "farminglevel"];
_root.toolbar.infrastructurelevel = _root[("territory" + number) + "infrastructurelevel"];
_root.toolbar.industrylevel = _root[("territory" + number) + "industrylevel"];
} else {
_root.attackplace = Name;
_root.number = number;
if (_root[("territory" + number) + "owned"] == "AI1") {
_root.ownedd = 1;
} else if (_root[("territory" + number) + "owned"] == "AI2") {
_root.ownedd = 2;
} else if (_root[("territory" + number) + "owned"] == "AI3") {
_root.ownedd = 3;
} else if (_root[("territory" + number) + "owned"] == "AI4") {
_root.ownedd = 4;
} else {
_root.ownedd = 5;
}
_root.toolbar.gotoAndStop("attack");
}
}
on (rollOver) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.cursor.gotoAndStop("friendly");
} else {
_root.cursor.gotoAndStop("enemy");
}
}
on (rollOut) {
_root.cursor.gotoAndStop(1);
}
Instance of Symbol 146 MovieClip in Frame 4
onClipEvent (load) {
Name = "Holland";
number = 7;
_name = ("territory" + number);
}
onClipEvent (enterFrame) {
if (_root[("territory" + number) + "owned"] == 1) {
new Color(this).setRGB(_root.playercolour);
} else if (_root[("territory" + number) + "owned"] == "AI1") {
new Color(this).setRGB(_root.AI1colour);
} else if (_root[("territory" + number) + "owned"] == "AI2") {
new Color(this).setRGB(_root.AI2colour);
} else if (_root[("territory" + number) + "owned"] == "AI3") {
new Color(this).setRGB(_root.AI3colour);
} else if (_root[("territory" + number) + "owned"] == "AI4") {
new Color(this).setRGB(_root.AI4colour);
}
if (_root.toolbar.place == Name) {
_root[("territory" + number) + "upgradecost"] = _root.toolbar.upgradecost;
_root[("territory" + number) + "farminglevel"] = _root.toolbar.farminglevel;
_root[("territory" + number) + "infrastructurelevel"] = _root.toolbar.infrastructurelevel;
_root[("territory" + number) + "industrylevel"] = _root.toolbar.industrylevel;
_root.toolbar.moneyincome = _root[("territory" + number) + "infrastructurelevel"] * 100;
_root.toolbar.foodincome = _root[("territory" + number) + "farminglevel"] * 100;
_root.toolbar.metalincome = _root[("territory" + number) + "industrylevel"] * 100;
}
}
on (press) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.toolbar.gotoAndStop("upgrade");
_root.toolbar.place = Name;
_root.toolbar.upgradecost = _root[("territory" + number) + "upgradecost"];
_root.toolbar.farminglevel = _root[("territory" + number) + "farminglevel"];
_root.toolbar.infrastructurelevel = _root[("territory" + number) + "infrastructurelevel"];
_root.toolbar.industrylevel = _root[("territory" + number) + "industrylevel"];
} else {
_root.attackplace = Name;
_root.number = number;
if (_root[("territory" + number) + "owned"] == "AI1") {
_root.ownedd = 1;
} else if (_root[("territory" + number) + "owned"] == "AI2") {
_root.ownedd = 2;
} else if (_root[("territory" + number) + "owned"] == "AI3") {
_root.ownedd = 3;
} else if (_root[("territory" + number) + "owned"] == "AI4") {
_root.ownedd = 4;
} else {
_root.ownedd = 5;
}
_root.toolbar.gotoAndStop("attack");
}
}
on (rollOver) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.cursor.gotoAndStop("friendly");
} else {
_root.cursor.gotoAndStop("enemy");
}
}
on (rollOut) {
_root.cursor.gotoAndStop(1);
}
Instance of Symbol 148 MovieClip in Frame 4
onClipEvent (load) {
Name = "Belgium";
number = 8;
_name = ("territory" + number);
}
onClipEvent (enterFrame) {
if (_root[("territory" + number) + "owned"] == 1) {
new Color(this).setRGB(_root.playercolour);
} else if (_root[("territory" + number) + "owned"] == "AI1") {
new Color(this).setRGB(_root.AI1colour);
} else if (_root[("territory" + number) + "owned"] == "AI2") {
new Color(this).setRGB(_root.AI2colour);
} else if (_root[("territory" + number) + "owned"] == "AI3") {
new Color(this).setRGB(_root.AI3colour);
} else if (_root[("territory" + number) + "owned"] == "AI4") {
new Color(this).setRGB(_root.AI4colour);
}
if (_root.toolbar.place == Name) {
_root[("territory" + number) + "upgradecost"] = _root.toolbar.upgradecost;
_root[("territory" + number) + "farminglevel"] = _root.toolbar.farminglevel;
_root[("territory" + number) + "infrastructurelevel"] = _root.toolbar.infrastructurelevel;
_root[("territory" + number) + "industrylevel"] = _root.toolbar.industrylevel;
_root.toolbar.moneyincome = _root[("territory" + number) + "infrastructurelevel"] * 100;
_root.toolbar.foodincome = _root[("territory" + number) + "farminglevel"] * 100;
_root.toolbar.metalincome = _root[("territory" + number) + "industrylevel"] * 100;
}
}
on (press) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.toolbar.gotoAndStop("upgrade");
_root.toolbar.place = Name;
_root.toolbar.upgradecost = _root[("territory" + number) + "upgradecost"];
_root.toolbar.farminglevel = _root[("territory" + number) + "farminglevel"];
_root.toolbar.infrastructurelevel = _root[("territory" + number) + "infrastructurelevel"];
_root.toolbar.industrylevel = _root[("territory" + number) + "industrylevel"];
} else {
_root.attackplace = Name;
_root.number = number;
if (_root[("territory" + number) + "owned"] == "AI1") {
_root.ownedd = 1;
} else if (_root[("territory" + number) + "owned"] == "AI2") {
_root.ownedd = 2;
} else if (_root[("territory" + number) + "owned"] == "AI3") {
_root.ownedd = 3;
} else if (_root[("territory" + number) + "owned"] == "AI4") {
_root.ownedd = 4;
} else {
_root.ownedd = 5;
}
_root.toolbar.gotoAndStop("attack");
}
}
on (rollOver) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.cursor.gotoAndStop("friendly");
} else {
_root.cursor.gotoAndStop("enemy");
}
}
on (rollOut) {
_root.cursor.gotoAndStop(1);
}
Instance of Symbol 150 MovieClip in Frame 4
onClipEvent (load) {
Name = "England";
number = 9;
_name = ("territory" + number);
}
onClipEvent (enterFrame) {
if (_root[("territory" + number) + "owned"] == 1) {
new Color(this).setRGB(_root.playercolour);
} else if (_root[("territory" + number) + "owned"] == "AI1") {
new Color(this).setRGB(_root.AI1colour);
} else if (_root[("territory" + number) + "owned"] == "AI2") {
new Color(this).setRGB(_root.AI2colour);
} else if (_root[("territory" + number) + "owned"] == "AI3") {
new Color(this).setRGB(_root.AI3colour);
} else if (_root[("territory" + number) + "owned"] == "AI4") {
new Color(this).setRGB(_root.AI4colour);
}
if (_root.toolbar.place == Name) {
_root[("territory" + number) + "upgradecost"] = _root.toolbar.upgradecost;
_root[("territory" + number) + "farminglevel"] = _root.toolbar.farminglevel;
_root[("territory" + number) + "infrastructurelevel"] = _root.toolbar.infrastructurelevel;
_root[("territory" + number) + "industrylevel"] = _root.toolbar.industrylevel;
_root.toolbar.moneyincome = _root[("territory" + number) + "infrastructurelevel"] * 100;
_root.toolbar.foodincome = _root[("territory" + number) + "farminglevel"] * 100;
_root.toolbar.metalincome = _root[("territory" + number) + "industrylevel"] * 100;
}
}
on (press) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.toolbar.gotoAndStop("upgrade");
_root.toolbar.place = Name;
_root.toolbar.upgradecost = _root[("territory" + number) + "upgradecost"];
_root.toolbar.farminglevel = _root[("territory" + number) + "farminglevel"];
_root.toolbar.infrastructurelevel = _root[("territory" + number) + "infrastructurelevel"];
_root.toolbar.industrylevel = _root[("territory" + number) + "industrylevel"];
} else {
_root.attackplace = Name;
_root.number = number;
if (_root[("territory" + number) + "owned"] == "AI1") {
_root.ownedd = 1;
} else if (_root[("territory" + number) + "owned"] == "AI2") {
_root.ownedd = 2;
} else if (_root[("territory" + number) + "owned"] == "AI3") {
_root.ownedd = 3;
} else if (_root[("territory" + number) + "owned"] == "AI4") {
_root.ownedd = 4;
} else {
_root.ownedd = 5;
}
_root.toolbar.gotoAndStop("attack");
}
}
on (rollOver) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.cursor.gotoAndStop("friendly");
} else {
_root.cursor.gotoAndStop("enemy");
}
}
on (rollOut) {
_root.cursor.gotoAndStop(1);
}
Instance of Symbol 152 MovieClip in Frame 4
onClipEvent (load) {
Name = "Ireland";
number = 10;
_name = ("territory" + number);
upgradecost = _root[("territory" + number) + "upgradecost"];
farminglevel = _root[("territory" + number) + "farminglevel"];
infrastructurelevel = _root[("territory" + number) + "infrastructurelevel"];
industrylevel = _root[("territory" + number) + "industrylevel"];
}
onClipEvent (enterFrame) {
if (_root[("territory" + number) + "owned"] == 1) {
new Color(this).setRGB(_root.playercolour);
} else if (_root[("territory" + number) + "owned"] == "AI1") {
new Color(this).setRGB(_root.AI1colour);
} else if (_root[("territory" + number) + "owned"] == "AI2") {
new Color(this).setRGB(_root.AI2colour);
} else if (_root[("territory" + number) + "owned"] == "AI3") {
new Color(this).setRGB(_root.AI3colour);
} else if (_root[("territory" + number) + "owned"] == "AI4") {
new Color(this).setRGB(_root.AI4colour);
}
if (_root.toolbar.place == Name) {
_root[("territory" + number) + "upgradecost"] = _root.toolbar.upgradecost;
_root[("territory" + number) + "farminglevel"] = _root.toolbar.farminglevel;
_root[("territory" + number) + "infrastructurelevel"] = _root.toolbar.infrastructurelevel;
_root[("territory" + number) + "industrylevel"] = _root.toolbar.industrylevel;
_root.toolbar.moneyincome = _root[("territory" + number) + "infrastructurelevel"] * 200;
_root.toolbar.foodincome = _root[("territory" + number) + "farminglevel"] * 100;
_root.toolbar.metalincome = _root[("territory" + number) + "industrylevel"] * 100;
}
}
on (press) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.toolbar.gotoAndStop("upgrade");
_root.toolbar.place = Name;
_root.toolbar.upgradecost = _root[("territory" + number) + "upgradecost"];
_root.toolbar.farminglevel = _root[("territory" + number) + "farminglevel"];
_root.toolbar.infrastructurelevel = _root[("territory" + number) + "infrastructurelevel"];
_root.toolbar.industrylevel = _root[("territory" + number) + "industrylevel"];
} else {
_root.attackplace = Name;
_root.number = number;
if (_root[("territory" + number) + "owned"] == "AI1") {
_root.ownedd = 1;
} else if (_root[("territory" + number) + "owned"] == "AI2") {
_root.ownedd = 2;
} else if (_root[("territory" + number) + "owned"] == "AI3") {
_root.ownedd = 3;
} else if (_root[("territory" + number) + "owned"] == "AI4") {
_root.ownedd = 4;
} else {
_root.ownedd = 5;
}
_root.toolbar.gotoAndStop("attack");
}
}
on (rollOver) {
if (_root[("territory" + number) + "owned"] == 1) {
_root.cursor.gotoAndStop("friendly");
} else {
_root.cursor.gotoAndStop("enemy");
}
}
on (rollOut) {
_root.cursor.gotoAndStop(1);
}
Instance of Symbol 312 MovieClip in Frame 4
onClipEvent (enterFrame) {
gotoAndStop(_root.turn);
}
Instance of Symbol 326 MovieClip "tooltipss" in Frame 4
onClipEvent (load) {
if (_root.tooltips == 0) {
_visible = false;
}
}
onClipEvent (enterFrame) {
if (_root.tooltips == 0) {
_visible = false;
} else if (_root.tooltips == 1) {
_visible = true;
}
}
Instance of Symbol 335 MovieClip in Frame 4
onClipEvent (load) {
_visible = false;
}
onClipEvent (enterFrame) {
if (_root.options) {
_visible = true;
} else {
_visible = false;
}
}
Frame 5
unitcount = 0;
unitmin = 0;
damage = _root[("AI" + _root.ownedd) + "towerdamage"];
trace("DAMAGE" + damage);
ubc = 1050;
wbc = 1101;
Instance of Symbol 84 MovieClip "units1" in Frame 5
onClipEvent (load) {
unit = 1;
hp = _root[("unit" + unit) + "hp"];
spd = _root[("unit" + unit) + "speed"];
}
onClipEvent (enterFrame) {
if (_root._currentframe == 4) {
this.removeMovieClip();
}
if (_name == ("units" + unit)) {
} else if (!sploded) {
if (hp <= 0) {
gotoAndPlay (2);
sploded = true;
_root.unitmin++;
}
i = 1000;
while (i < 1011) {
if (this.hitTest(_root["b" + i])) {
hp = hp - _root.damage;
removeMovieClip(_root["b" + i]);
}
i++;
}
_x = (_x + _root[("unit" + unit) + "speed"]);
if (this.hitTest(_root.wall)) {
gotoAndPlay (2);
_root.wall.hp = _root.wall.hp - _root[("unit" + unit) + "damage"];
sploded = true;
_root.unitmin++;
}
}
}
Instance of Symbol 102 MovieClip "units2" in Frame 5
onClipEvent (load) {
unit = 2;
hp = _root[("unit" + unit) + "hp"];
spd = _root[("unit" + unit) + "speed"];
}
onClipEvent (enterFrame) {
if (_root._currentframe == 4) {
this.removeMovieClip();
}
if (_name == ("units" + unit)) {
} else if (!sploded) {
if (hp <= 0) {
gotoAndPlay (2);
sploded = true;
_root.unitmin++;
}
i = 1000;
while (i < 1011) {
if (this.hitTest(_root["b" + i])) {
hp = hp - _root.damage;
removeMovieClip(_root["b" + i]);
}
i++;
}
_x = (_x + _root[("unit" + unit) + "speed"]);
if (this.hitTest(_root.wall)) {
gotoAndPlay (2);
_root.wall.hp = _root.wall.hp - _root[("unit" + unit) + "damage"];
sploded = true;
_root.unitmin++;
}
}
}
Instance of Symbol 90 MovieClip "units3" in Frame 5
onClipEvent (load) {
unit = 3;
hp = _root[("unit" + unit) + "hp"];
spd = _root[("unit" + unit) + "speed"];
}
onClipEvent (enterFrame) {
if (_root._currentframe == 4) {
this.removeMovieClip();
}
if (_name == ("units" + unit)) {
} else if (!sploded) {
if (hp <= 0) {
gotoAndPlay (2);
sploded = true;
_root.unitmin++;
}
i = 1000;
while (i < 1011) {
if (this.hitTest(_root["b" + i])) {
hp = hp - _root.damage;
removeMovieClip(_root["b" + i]);
}
i++;
}
_x = (_x + _root[("unit" + unit) + "speed"]);
if (this.hitTest(_root.wall)) {
gotoAndPlay (2);
_root.wall.hp = _root.wall.hp - _root[("unit" + unit) + "damage"];
sploded = true;
_root.unitmin++;
}
}
}
Instance of Symbol 98 MovieClip "units4" in Frame 5
onClipEvent (load) {
unit = 4;
hp = _root[("unit" + unit) + "hp"];
spd = _root[("unit" + unit) + "speed"];
firerate = 0;
}
onClipEvent (enterFrame) {
if (_root._currentframe == 4) {
this.removeMovieClip();
}
if (_name == ("units" + unit)) {
} else {
trace(_name);
if (!sploded) {
if (hp <= 0) {
gotoAndPlay (2);
sploded = true;
_root.unitmin++;
}
i = 1000;
while (i < 1011) {
if (this.hitTest(_root["b" + i])) {
hp = hp - _root.damage;
removeMovieClip(_root["b" + i]);
}
i++;
}
if (_x > (_root.wall._x - (_root[("unit" + unit) + "range"] * 30))) {
if (!aimed) {
Xdiff = _root.Turret._x - _x;
Ydiff = _root.Turret._y - _y;
radAngle = Math.atan2(Ydiff, Xdiff);
targetrotation = Math.round(int(((radAngle * 360) / (Math.PI*2)) + 90) - 90);
if (turret._rotation != targetrotation) {
if (targetrotation > 0) {
this.turret._rotation = this.turret._rotation + 1;
} else if (targetrotation < 0) {
this.turret._rotation = this.turret._rotation - 1;
}
} else {
aimed = true;
}
}
if (aimed) {
if (firerate == 0) {
if (_root.ubc > 1100) {
_root.ubc = 1050;
}
duplicateMovieClip (_root.bullet, "b" + _root.ubc, _root.ubc);
_root["b" + _root.ubc]._x = _x;
_root["b" + _root.ubc]._y = _y;
_root["b" + _root.ubc]._rotation = (turret._rotation + _rotation) + 180;
_root["b" + _root.ubc].damage = _root[("unit" + unit) + "damage"];
_root.ubc++;
firerate = 18;
} else {
firerate--;
}
}
} else {
_x = (_x + _root[("unit" + unit) + "speed"]);
}
}
}
}
Instance of Symbol 199 MovieClip "units5" in Frame 5
onClipEvent (load) {
unit = 5;
hp = _root[("unit" + unit) + "hp"];
spd = _root[("unit" + unit) + "speed"];
firerate = 0;
}
onClipEvent (enterFrame) {
if (_root._currentframe == 4) {
this.removeMovieClip();
}
if (_name == ("units" + unit)) {
} else {
trace(_name);
if (!sploded) {
if (hp <= 0) {
gotoAndPlay (2);
sploded = true;
_root.unitmin++;
}
i = 1000;
while (i < 1011) {
if (this.hitTest(_root["b" + i])) {
hp = hp - _root.damage;
removeMovieClip(_root["b" + i]);
}
i++;
}
if (_x > (_root.wall._x - (_root[("unit" + unit) + "range"] * 30))) {
if (!aimed) {
Xdiff = _root.Turret._x - _x;
Ydiff = _root.Turret._y - _y;
radAngle = Math.atan2(Ydiff, Xdiff);
targetrotation = Math.round(int(((radAngle * 360) / (Math.PI*2)) + 90) - 90);
if (turret._rotation != targetrotation) {
if (targetrotation > this.turret._rotation) {
this.turret._rotation = this.turret._rotation + 1;
} else if (targetrotation < this.turret._rotation) {
this.turret._rotation = this.turret._rotation - 1;
}
} else {
aimed = true;
}
}
if (aimed) {
if (firerate == 0) {
if (_root.ubc > 1100) {
_root.ubc = 1050;
}
duplicateMovieClip (_root.bullet, "b" + _root.ubc, _root.ubc);
_root["b" + _root.ubc]._x = _x;
_root["b" + _root.ubc]._y = _y;
_root["b" + _root.ubc]._rotation = turret._rotation + _rotation;
_root["b" + _root.ubc].damage = _root[("unit" + unit) + "damage"];
_root.ubc++;
firerate = 20;
} else {
firerate--;
}
}
} else {
_x = (_x + _root[("unit" + unit) + "speed"]);
}
}
}
}
Instance of Symbol 205 MovieClip "units6" in Frame 5
onClipEvent (load) {
unit = 6;
hp = _root[("unit" + unit) + "hp"];
spd = _root[("unit" + unit) + "speed"];
firerate = 0;
}
onClipEvent (enterFrame) {
if (_root._currentframe == 4) {
this.removeMovieClip();
}
if (_name == ("units" + unit)) {
} else {
trace(_name);
if (!sploded) {
if (hp <= 0) {
gotoAndPlay (2);
sploded = true;
_root.unitmin++;
}
i = 1000;
while (i < 1011) {
if (this.hitTest(_root["b" + i])) {
hp = hp - _root.damage;
removeMovieClip(_root["b" + i]);
}
i++;
}
if (_x > (_root.wall._x - (_root[("unit" + unit) + "range"] * 30))) {
if (!aimed) {
Xdiff = _root.Turret._x - _x;
Ydiff = _root.Turret._y - _y;
radAngle = Math.atan2(Ydiff, Xdiff);
targetrotation = Math.round(int(((radAngle * 360) / (Math.PI*2)) + 90) - 90);
if (turret._rotation != targetrotation) {
if (targetrotation > 0) {
this.turret._rotation = this.turret._rotation + 1;
} else if (targetrotation < 0) {
this.turret._rotation = this.turret._rotation - 1;
}
} else {
aimed = true;
}
}
if (aimed) {
if (firerate == 0) {
if (_root.ubc > 1100) {
_root.ubc = 1050;
}
duplicateMovieClip (_root.bullet, "b" + _root.ubc, _root.ubc);
_root["b" + _root.ubc]._x = _x;
_root["b" + _root.ubc]._y = _y;
_root["b" + _root.ubc]._rotation = turret._rotation + _rotation;
_root["b" + _root.ubc].damage = _root[("unit" + unit) + "damage"];
_root.ubc++;
firerate = 20;
} else {
firerate--;
}
}
} else {
_x = (_x + _root[("unit" + unit) + "speed"]);
}
}
}
}
Instance of Symbol 209 MovieClip "units7" in Frame 5
onClipEvent (load) {
unit = 7;
hp = _root[("unit" + unit) + "hp"];
spd = _root[("unit" + unit) + "speed"];
firerate = 0;
}
onClipEvent (enterFrame) {
if (_root._currentframe == 4) {
this.removeMovieClip();
}
if (_name == ("units" + unit)) {
} else if (!sploded) {
if (hp <= 0) {
gotoAndPlay (2);
sploded = true;
_root.unitmin++;
}
i = 1000;
while (i < 1011) {
if (this.hitTest(_root["b" + i])) {
hp = hp - _root.damage;
removeMovieClip(_root["b" + i]);
}
i++;
}
if (_x > (_root.wall._x - (_root[("unit" + unit) + "range"] * 30))) {
aimed = true;
if (aimed) {
if (firerate == 0) {
if (_root.wbc > 1150) {
_root.wbc = 1101;
}
duplicateMovieClip (_root.bullet, "b" + _root.wbc, _root.wbc);
_root["b" + _root.wbc]._x = _x;
_root["b" + _root.wbc]._y = _y;
_root["b" + _root.wbc]._rotation = _rotation;
_root["b" + _root.wbc].damage = _root[("unit" + unit) + "damage"];
_root.wbc++;
firerate = 20;
} else {
firerate--;
}
}
} else {
_x = (_x + _root[("unit" + unit) + "speed"]);
}
}
}
Instance of Symbol 213 MovieClip "units8" in Frame 5
onClipEvent (load) {
unit = 8;
hp = _root[("unit" + unit) + "hp"];
spd = _root[("unit" + unit) + "speed"];
firerate = 0;
}
onClipEvent (enterFrame) {
if (_root._currentframe == 4) {
this.removeMovieClip();
}
if (_name == ("units" + unit)) {
} else if (!sploded) {
if (hp <= 0) {
gotoAndPlay (2);
sploded = true;
_root.unitmin++;
}
i = 1000;
while (i < 1011) {
if (this.hitTest(_root["b" + i])) {
hp = hp - _root.damage;
removeMovieClip(_root["b" + i]);
}
i++;
}
if (_x > (_root.wall._x - (_root[("unit" + unit) + "range"] * 30))) {
aimed = true;
if (aimed) {
if (firerate == 0) {
if (_root.wbc > 1150) {
_root.wbc = 1101;
}
duplicateMovieClip (_root.rocket, "b" + _root.wbc, _root.wbc);
_root["b" + _root.wbc]._x = _x;
_root["b" + _root.wbc]._y = _y;
_root["b" + _root.wbc]._rotation = _rotation;
_root["b" + _root.wbc].damage = _root[("unit" + unit) + "damage"];
_root.wbc++;
trace("BANG");
firerate = 50;
} else {
firerate--;
}
}
} else {
_x = (_x + _root[("unit" + unit) + "speed"]);
}
}
}
Instance of Symbol 212 MovieClip "rocket" in Frame 5
onClipEvent (load) {
spd = 20;
}
onClipEvent (enterFrame) {
if (_name == "rocket") {
_x = -1000;
} else if (_rotation > 180) {
_y = (_y + (spd * Math.cos((Math.PI/180) * _rotation)));
_x = (_x - (spd * Math.sin((Math.PI/180) * _rotation)));
} else {
_y = (_y - (spd * Math.cos((Math.PI/180) * _rotation)));
_x = (_x + (spd * Math.sin((Math.PI/180) * _rotation)));
}
if ((((_x > Stage.width) || (_x < 0)) || (_y < 0)) || (_y > Stage.height)) {
this.removeMovieClip();
}
}
Instance of Symbol 369 MovieClip "wall" in Frame 5
onClipEvent (load) {
hp = 100;
}
onClipEvent (enterFrame) {
if (hp <= 0) {
_root[("territory" + _root.number) + "owned"] = 1;
_root.gotoAndStop(4);
}
j = 1101;
while (j < 1150) {
if (this.hitTest(_root["b" + j])) {
hp = hp - _root["b" + j].damage;
_root["b" + j].removeMovieClip();
}
j++;
}
}
Instance of Symbol 376 MovieClip "Turret" in Frame 5
onClipEvent (load) {
gotoAndStop(_root.turret);
bc = 1000;
firerate = _root[("AI" + _root.ownedd) + "towerfirerate"];
hp = _root[("AI" + _root.ownedd) + "towerhealth"];
trace("FIRERATE = " + firerate);
trace("HEALTTH = " + hp);
}
onClipEvent (enterFrame) {
if (hp <= 0) {
_root[("territory" + _root.number) + "owned"] = 1;
_root.gotoAndStop(4);
}
j = 1050;
while (j < 1101) {
if (this.hitTest(_root["b" + j])) {
hp = hp - _root["b" + j].damage;
_root["b" + j].removeMovieClip();
}
j++;
}
t = 0;
while (t < _root.unitcount) {
Xdiff = (_root["unit" + t]._x + (_root["unit" + t]._width / 2)) - _x;
Ydiff = _root["unit" + t]._y - _y;
trace(Xdiff);
if ((Xdiff < 0) && (_root["unit" + t].sploded != true)) {
trace("broke");
fire = true;
break;
}
fire = false;
t++;
}
trace("LOL");
trace(t);
target = _root["unit" + t]._name;
if (_root.unitmin != _root.unitcount) {
radAngle = Math.atan2(Ydiff, Xdiff);
_rotation = int(((radAngle * 360) / (Math.PI*2)) + 90);
if (fire) {
if (firerate == 0) {
if (bc > 1010) {
bc = 1000;
}
duplicateMovieClip (_root.bullet, "b" + bc, bc);
_root["b" + bc]._x = _x;
_root["b" + bc]._y = _y;
_root["b" + bc]._rotation = _rotation;
bc++;
firerate = 20;
} else {
firerate--;
}
}
}
}
Instance of Symbol 380 MovieClip in Frame 5
onClipEvent (load) {
cooldown = 0;
}
onClipEvent (enterFrame) {
a = 1;
while (a < 9) {
if (_root[("unit" + a) + "deployed"] > 0) {
break;
}
if (a == 8) {
if ((_root.unitmin == _root.unitcount) && (_root.unitcount > 1)) {
_root.gotoAndStop(4);
}
}
a++;
}
this.cool.gotoAndStop(cooldown + 1);
if (cooldown == 0) {
if (Key.isDown(32)) {
if (firstspacepress) {
if (_root[("unit" + _root.Selected) + "deployed"] > 0) {
duplicateMovieClip (_root["units" + _root.Selected], "unit" + _root.unitcount, 50 + _root.unitcount);
_root["unit" + _root.unitcount]._y = _y;
_root.unitcount++;
firstspacepress = false;
cooldown = 25;
_root[("unit" + _root.Selected) + "deployed"] = _root[("unit" + _root.Selected) + "deployed"] - 1;
}
}
} else {
firstspacepress = true;
}
} else {
cooldown--;
}
_y = _root._ymouse;
}
Instance of Symbol 382 MovieClip "bullet" in Frame 5
onClipEvent (load) {
spd = 20;
}
onClipEvent (enterFrame) {
if (_name == "bullet") {
_x = -1000;
} else {
if ((_x < 0) || (_x > Stage.width)) {
this.removeMovieClip();
}
if (!sets) {
gotoAndPlay (2);
sets = true;
}
if (_rotation > 180) {
_y = (_y + (spd * Math.cos((Math.PI/180) * _rotation)));
_x = (_x - (spd * Math.sin((Math.PI/180) * _rotation)));
} else {
_y = (_y - (spd * Math.cos((Math.PI/180) * _rotation)));
_x = (_x + (spd * Math.sin((Math.PI/180) * _rotation)));
}
}
if ((((_x > Stage.width) || (_x < 0)) || (_y < 0)) || (_y > Stage.height)) {
this.removeMovieClip();
}
}
Instance of Symbol 333 MovieClip in Frame 5
on (press) {
gotoAndStop (4);
}
Frame 6
unitcount = 0;
unitmin = 0;
damage = _root.playertowerdamage;
ubc = 1050;
wbc = 1101;
_root.cursor.gotoAndStop("Crosshair");
Instance of Symbol 212 MovieClip "rocket" in Frame 6
onClipEvent (load) {
spd = 20;
}
onClipEvent (enterFrame) {
if (_name == "rocket") {
_x = -1000;
} else if (_rotation > 180) {
_y = (_y + (spd * Math.cos((Math.PI/180) * _rotation)));
_x = (_x - (spd * Math.sin((Math.PI/180) * _rotation)));
} else {
_y = (_y - (spd * Math.cos((Math.PI/180) * _rotation)));
_x = (_x + (spd * Math.sin((Math.PI/180) * _rotation)));
}
if ((((_x > Stage.width) || (_x < 0)) || (_y < 0)) || (_y > Stage.height)) {
this.removeMovieClip();
}
}
Instance of Symbol 369 MovieClip "wall" in Frame 6
onClipEvent (load) {
hp = 100;
}
onClipEvent (enterFrame) {
if (hp <= 0) {
_root.attackplace2owned = _root.ai1country;
}
j = 1101;
while (j < 1150) {
if (this.hitTest(_root["b" + j])) {
hp = hp - _root["b" + j].damage;
_root["b" + j].removeMovieClip();
}
j++;
}
}
Instance of Symbol 376 MovieClip "Turret" in Frame 6
onClipEvent (load) {
gotoAndStop(_root.playertowerlevel);
bc = 1000;
firerate = _root.playertowerfirerate;
hp = _root.playertowerhealth;
}
onClipEvent (enterFrame) {
if (hp <= 0) {
_root.attackplace2owned = _root.ai1country;
}
j = 1050;
while (j < 1101) {
if (this.hitTest(_root["b" + j])) {
hp = hp - _root["b" + j].damage;
_root["b" + j].removeMovieClip();
}
j++;
}
Xd = _root._xmouse - _x;
Yd = _root._ymouse - _y;
radAngle = Math.atan2(Yd, Xd);
_rotation = int(((radAngle * 360) / (Math.PI*2)) + 90);
if (firerate == 0) {
if (Key.isDown(1)) {
if (bc > 1010) {
bc = 1000;
}
duplicateMovieClip (_root.bullet, "b" + bc, bc);
_root["b" + bc]._x = _x;
_root["b" + bc]._y = _y;
_root["b" + bc]._rotation = _rotation;
bc++;
firerate = _root.playertowerfirerate;
}
} else {
firerate--;
}
}
Instance of Symbol 380 MovieClip in Frame 6
onClipEvent (load) {
cooldown = 0;
Direction = "down";
}
onClipEvent (enterFrame) {
if (cooldown > 0) {
cooldown--;
}
a = 1;
while (a < 9) {
if (_root[("unit" + a) + "deployed"] > 0) {
break;
}
if (a == 8) {
if (_root.unitmin == _root.unitcount) {
_root.gotoAndStop(4);
}
}
a++;
}
us = 1;
while (us < 9) {
if (_root[("unit" + us) + "deployed"] > 0) {
_root.Selected = us;
break;
}
us++;
}
this.cool.gotoAndStop(cooldown + 1);
if (cooldown == 0) {
if (_root[("unit" + _root.Selected) + "deployed"] > 0) {
duplicateMovieClip (_root["units" + _root.Selected], "unit" + _root.unitcount, 50 + _root.unitcount);
_root["unit" + _root.unitcount]._y = _y;
_root.unitcount++;
firstspacepress = false;
_root[("unit" + _root.Selected) + "deployed"] = _root[("unit" + _root.Selected) + "deployed"] - 1;
cooldown = 50;
trace("spawned");
}
}
if (Direction == "down") {
if (_y >= 400) {
Direction = "up";
}
_y = (_y + 2);
if (random(100) == 1) {
Direction = "up";
}
} else if (Direction == "up") {
if (_y <= 0) {
Direction = "down";
}
_y = (_y - 2);
if (random(100) == 1) {
Direction = "down";
}
}
}
Instance of Symbol 382 MovieClip "bullet" in Frame 6
onClipEvent (load) {
spd = 20;
}
onClipEvent (enterFrame) {
if (_name == "bullet") {
_x = -1000;
} else {
if (!sets) {
gotoAndPlay (2);
sets = true;
}
if (_rotation > 180) {
_y = (_y + (spd * Math.cos((Math.PI/180) * _rotation)));
_x = (_x - (spd * Math.sin((Math.PI/180) * _rotation)));
} else {
_y = (_y - (spd * Math.cos((Math.PI/180) * _rotation)));
_x = (_x + (spd * Math.sin((Math.PI/180) * _rotation)));
}
}
if ((((_x > Stage.width) || (_x < 0)) || (_y < 0)) || (_y > Stage.height)) {
this.removeMovieClip();
}
}
Frame 7
stop();
Symbol 15 MovieClip Frame 1
_root.stop();
stopAllSounds();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
bar._yscale = PercentLoaded;
} else {
gotoAndPlay ("LOADED");
}
Symbol 15 MovieClip Frame 2
gotoAndPlay (1);
Symbol 15 MovieClip Frame 75
_parent.nextFrame();
Symbol 23 MovieClip Frame 1
stop();
Symbol 397 MovieClip [__Packages.NewgroundsAPI] Frame 0
class NewgroundsAPI
{
static var tracker_id, host, version, debug, error_format, header_format, normal_format, link_format;
function NewgroundsAPI () {
}
static function connectMovie(id) {
if (!id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)");
} else if (!tracker_id) {
SendMessage("Connecting to API gateway...");
tracker_id = id;
host = _url.split("/")[2].toLowerCase();
if (host.length < 1) {
host = "localhost";
}
var _local2 = new Object();
SendEvent(MOVIE_VIEWS);
}
}
static function setMovieVersion(movie_version) {
if (!movie_version) {
SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)");
} else {
version = movie_version;
}
}
static function debugMode() {
debug = true;
}
static function addCustomEvent(stat_id, stat_name) {
if (!stat_id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else if (!stat_name) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
custom_events[stat_name] = CUSTOM_STATS + stat_id;
SendMessage("Created custom event: " + stat_name);
}
}
static function addCustomLink(stat_id, stat_name) {
if (!stat_id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else if (!stat_name) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
custom_links[stat_name] = CUSTOM_STATS + stat_id;
SendMessage((("Created custom link " + stat_id) + ": ") + stat_name);
}
}
static function loadMySite() {
SendLink(AUTHOR_SITE);
}
static function loadNewgrounds(special) {
if (special) {
var _local1 = {page:special};
}
SendLink(NEWGROUNDS, _local1);
}
static function logCustomEvent(event_name) {
if (!event_name) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)");
} else if (!custom_events[event_name]) {
SendError("Attempted to log undefined custom event: " + event_name);
} else {
SendEvent(custom_events[event_name]);
}
}
static function loadCustomLink(link_name) {
if (!link_name) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)");
} else if (!custom_links[link_name]) {
SendError("Attempted to open undefined custom link: " + link_name);
} else {
SendLink(custom_links[link_name]);
}
}
static function getAdURL() {
return(movie_options.ad_url);
}
static function getMovieURL() {
if (movie_options.movie_url) {
return(movie_options.movie_url);
}
return("Newgrounds.com");
}
static function getNewVersionURL() {
return((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + NEW_VERSION);
}
static function SendEvent(id) {
SendStat(id, false);
}
static function SendLink(id, extra) {
SendStat(id, true, extra);
}
static function ReadGatewayData(params) {
for (var _local2 in params) {
params[_local2] = unescape(params[_local2]);
movie_options[_local2] = params[_local2];
}
if (params.settings_loaded) {
SendMessage("You have successfully connected to the Newgrounds API gateway!");
SendMessage(("Movie Identified as '" + movie_options.movie_name) + "'");
if (movie_options.message) {
SendMessage(movie_options.message);
}
if (movie_options.ad_url) {
SendMessage("Your movie has been approved to run Flash Ads");
onAdsApproved(movie_options.ad_url);
}
if (movie_options.movie_version and (movie_options.movie_version.toString() != version.toString())) {
SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!");
onNewVersionAvailable(movie_options.movie_version, getMovieURL(), getNewVersionURL());
}
if (movie_options.deny_host) {
SendMessage("You have blocked 'localHost' in your API settings.");
SendMessage("If you wish to test your movie you will need to remove this block.");
onDenyHost(host, getMovieURL(), getNewVersionURL());
}
if (movie_options.request_portal_url == 1) {
var _local4 = (((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_url);
var _local3 = new XML();
_local3.ignoreWhite = true;
_local3.load(_local4);
}
} else if (!movie_options.settings_loaded) {
SendError("Could not establish connection to the API gateway.");
}
}
static function SendStat(stat_id, open_in_browser, extra) {
if (!tracker_id) {
SendError("API calls cannot be made without a valid movie id.");
SendError("Did you remember to add the \"NewgroundsAPI.connectMovie()\" code?");
} else {
var _local7 = (((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + stat_id;
for (var _local9 in extra) {
_local7 = _local7 + ((("&" + escape(_local9)) + "=") + escape(extra[_local9]));
}
trace(_local7);
if (debug) {
_local7 = _local7 + "&debug=1";
}
if (open_in_browser) {
getURL (_local7, "_blank");
} else {
var _local10 = new XML();
_local10.ignoreWhite = true;
_local10.onLoad = function (success) {
var _local6 = new Object();
var _local3 = 0;
while (_local3 < this.firstChild.childNodes.length) {
var _local4 = this.firstChild.childNodes[_local3];
var _local5 = _local4.nodeName;
var _local2 = _local4.attributes.value;
if (_local2 == Number(_local2)) {
_local2 = Number(_local2);
}
_local6[_local5] = _local2;
_local3++;
}
NewgroundsAPI.ReadGatewayData(_local6);
};
_local10.load(_local7);
}
}
}
static function SendError(msg) {
trace("[NEWGROUNDS API ERROR] :: " + msg);
}
static function SendMessage(msg) {
trace("[NEWGROUNDS API] :: " + msg);
}
static function InitTextFormats() {
if (!error_format) {
error_format = new TextFormat();
error_format.font = "Arial Black";
error_format.size = 48;
error_format.color = 16711680 /* 0xFF0000 */;
}
if (!header_format) {
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.size = 24;
header_format.color = 16777215 /* 0xFFFFFF */;
}
if (!normal_format) {
normal_format = new TextFormat();
normal_format.font = "Arial";
normal_format.bold = true;
normal_format.size = 12;
normal_format.color = 16777215 /* 0xFFFFFF */;
}
if (!link_format) {
link_format = new TextFormat();
link_format.color = 16776960 /* 0xFFFF00 */;
link_format.underline = true;
}
}
static function onNewVersionAvailable(version, movie_url, redirect_url) {
InitTextFormats();
var _local2 = new Object();
_local2.x = Stage.width / 2;
_local2.y = Stage.height / 2;
_root.createEmptyMovieClip("NGAPI_new_version_overlay", _root.getNextHighestDepth());
_root.NGAPI_new_version_overlay.lineStyle(1, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(0, 70);
_root.NGAPI_new_version_overlay.moveTo(-10, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, -10);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.lineStyle(10, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(51);
_root.NGAPI_new_version_overlay.moveTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.createEmptyMovieClip("exit", 1000);
_root.NGAPI_new_version_overlay.exit.lineStyle(2, 39423, 100);
_root.NGAPI_new_version_overlay.exit.beginFill(0, 50);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.endFill();
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 214, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 226, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 226, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 214, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.onMouseUp = function () {
if (_root.NGAPI_new_version_overlay.exit.hitTest(_root._xmouse, _root._ymouse)) {
_root.NGAPI_new_version_overlay.removeMovieClip();
}
};
var _local3 = (("Version " + version) + " is now available at:") + newline;
var _local5 = _local3.length;
_local3 = _local3 + movie_url;
var _local4 = _local3.length;
_root.NGAPI_new_version_overlay.createTextField("mouseblocker", 99, -10, -10, 1000, 1000);
_root.NGAPI_new_version_overlay.createTextField("newversion", 100, _local2.x - 210, _local2.y - 90, 400, 80);
_root.NGAPI_new_version_overlay.newversion.text = "New Version Available!";
_root.NGAPI_new_version_overlay.newversion.setTextFormat(header_format);
_root.NGAPI_new_version_overlay.createTextField("message", 101, (Stage.width - 400) / 2, Stage.height / 2, 400, 40);
_root.NGAPI_new_version_overlay.message.text = _local3;
_root.NGAPI_new_version_overlay.message.multiline = true;
_root.NGAPI_new_version_overlay.message.wordWrap = true;
_root.NGAPI_new_version_overlay.message.html = true;
_root.NGAPI_new_version_overlay.message.setTextFormat(normal_format);
link_format.url = redirect_url;
_root.NGAPI_new_version_overlay.message.setTextFormat(_local5, _local4, link_format);
}
static function onDenyHost(hostname, movie_url, redirect_url) {
InitTextFormats();
_root.createEmptyMovieClip("NGAPI_deny_host_overlay", _root.getNextHighestDepth());
_root.NGAPI_deny_host_overlay.lineStyle(20, 0, 100);
_root.NGAPI_deny_host_overlay.beginFill(6684672);
_root.NGAPI_deny_host_overlay.moveTo(0, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, 0);
_root.NGAPI_deny_host_overlay.endFill();
var _local2 = ("This movie has not been approved for use on " + hostname) + ".";
_local2 = _local2 + "\r\rFor an aproved copy, please visit:\r";
var _local4 = _local2.length;
_local2 = _local2 + movie_url;
var _local3 = _local2.length;
_root.NGAPI_deny_host_overlay.createTextField("mousekill", 100, 0, 0, Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.createTextField("error", 101, (Stage.width - 400) / 2, (Stage.height / 2) - 100, 400, 200);
_root.NGAPI_deny_host_overlay.error.text = "ERROR!";
_root.NGAPI_deny_host_overlay.error.setTextFormat(error_format);
_root.NGAPI_deny_host_overlay.createTextField("message", 102, (Stage.width - 400) / 2, Stage.height / 2, 400, 200);
_root.NGAPI_deny_host_overlay.message.text = _local2;
_root.NGAPI_deny_host_overlay.message.multiline = true;
_root.NGAPI_deny_host_overlay.message.wordWrap = true;
_root.NGAPI_deny_host_overlay.message.html = true;
_root.NGAPI_deny_host_overlay.message.setTextFormat(normal_format);
link_format.url = redirect_url;
_root.NGAPI_deny_host_overlay.message.setTextFormat(_local4, _local3, link_format);
}
static function isInstalled() {
return(true);
}
static function onAdsApproved(ad_url) {
}
static var movie_options = new Object();
static var custom_events = new Object();
static var custom_links = new Object();
static var MOVIE_VIEWS = 1;
static var AUTHOR_SITE = 2;
static var NEWGROUNDS = 3;
static var NEW_VERSION = 4;
static var CUSTOM_STATS = 50;
static var GATEWAY_URL = "http://www.ngads.com/gateway.php";
}
Symbol 26 Button
on (press) {
_root.nextFrame();
}
Symbol 27 Button
on (press) {
_root.gotoAndStop("load");
}
Symbol 28 Button
on (release) {
NewgroundsAPI.loadMySite();
}
Symbol 39 Button
on (press) {
_root.toolbar.gotoAndStop("buildunits");
}
Symbol 55 MovieClip Frame 1
stop();
Symbol 83 MovieClip Frame 33
stop();
Symbol 84 MovieClip Frame 1
stop();
Symbol 84 MovieClip Frame 35
this.removeMovieClip();
Symbol 90 MovieClip Frame 1
stop();
Symbol 90 MovieClip Frame 35
this.removeMovieClip();
Symbol 98 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 35
this.removeMovieClip();
Symbol 102 MovieClip Frame 1
stop();
Symbol 102 MovieClip Frame 35
this.removeMovieClip();
Symbol 105 MovieClip Frame 1
stop();
Symbol 110 MovieClip Frame 1
_root.tooltips = 1;
stop();
Symbol 110 MovieClip Frame 2
_root.tooltips = 0;
Symbol 110 MovieClip Frame 3
gotoAndStop (1);
Symbol 111 Button
on (press) {
if (_root.countryselected == "Select A Country") {
_root.countryerror.play();
} else {
_root.turncount = 0;
if (_root.countryselected == "England") {
_root.playercolour = "0xFF0909";
_root.territory9owned = 1;
_root.ai2country = "Ireland";
_root.AI2colour = "0x3AFF09";
_root.territory10owned = "AI2";
_root.ai3country = "Germany";
_root.AI3colour = "0x000000";
_root.territory6owned = "AI3";
_root.ai4country = "Spain";
_root.AI4colour = "0xFFFF09";
_root.territory2owned = "AI4";
_root.playerturn = 1;
_root.unit1owned = 5;
_root.unit3owned = 2;
_root.playertowerhealth = 200;
} else if (_root.countryselected == "Ireland") {
_root.playercolour = "0x3AFF09";
_root.territory10owned = 1;
_root.ai1country = "England";
_root.AI1colour = "0xFF0909";
_root.territory9owned = "AI1";
_root.ai3country = "Germany";
_root.AI3colour = "0x000000";
_root.territory6owned = "AI3";
_root.ai4country = "Spain";
_root.AI4colour = "0xFFFF09";
_root.territory2owned = "AI4";
_root.playerturn = 2;
_root.unit1owned = 2;
_root.unit4owned = 2;
_root.playergold = 2000;
} else if (_root.countryselected == "Germany") {
_root.playercolour = "0x000000";
_root.territory6owned = 1;
_root.ai1country = "England";
_root.AI1colour = "0xFF0909";
_root.territory9owned = "AI1";
_root.ai2country = "Ireland";
_root.AI2colour = "0x3AFF09";
_root.territory10owned = "AI2";
_root.ai4country = "Spain";
_root.AI4colour = "0xFFFF09";
_root.territory2owned = "AI4";
_root.playerturn = 3;
_root.unit1owned = 2;
_root.unit2owned = 6;
i = 1;
while (i < 9) {
_root[("unit" + i) + "hp"] = _root[("unit" + i) + "hp"] + 1;
i++;
}
} else if (_root.countryselected == "Spain") {
_root.playercolour = "0xFFFF09";
_root.territory2owned = 1;
_root.ai1country = "England";
_root.AI1colour = "0xFF0909";
_root.territory9owned = "AI1";
_root.ai2country = "Ireland";
_root.AI2colour = "0x3AFF09";
_root.territory10owned = "AI2";
_root.ai3country = "Germany";
_root.AI3colour = "0x000000";
_root.territory6owned = "AI3";
_root.playerturn = 4;
_root.unit1owned = 8;
i = 1;
while (i < 9) {
_root[("unit" + i) + "speed"] = _root[("unit" + i) + "speed"] + 1;
i++;
}
}
_root.nextFrame();
_root.turn = _root.playerturn;
}
}
Symbol 114 MovieClip Frame 1
stop();
Symbol 117 MovieClip Frame 1
stop();
Symbol 120 MovieClip Frame 1
stop();
Symbol 124 MovieClip Frame 1
stop();
Symbol 127 MovieClip Frame 1
stop();
Symbol 157 Button
on (press) {
_root.toolbar.gotoAndStop("tower");
}
Symbol 159 Button
on (press) {
_root.turn++;
}
Symbol 164 Button
on (press) {
_root.options = true;
}
Symbol 166 Button
on (press) {
gotoAndStop (1);
}
Symbol 169 Button
on (rollOver) {
effects.gotoAndStop(1);
effects._visible = true;
}
on (rollOut) {
effects._visible = false;
}
on (press) {
if (_root.playergold >= upgradecost) {
farminglevel = farminglevel + 1;
_root.playergold = _root.playergold - upgradecost;
upgradecost = upgradecost * 2;
}
}
Symbol 170 Button
on (rollOver) {
effects.gotoAndStop(2);
effects._visible = true;
}
on (rollOut) {
effects._visible = false;
}
on (press) {
if (_root.playergold >= upgradecost) {
infrastructurelevel = infrastructurelevel + 1;
_root.playergold = _root.playergold - upgradecost;
upgradecost = upgradecost * 2;
}
}
Symbol 171 Button
on (rollOver) {
effects.gotoAndStop(3);
effects._visible = true;
}
on (rollOut) {
effects._visible = false;
}
on (press) {
if (_root.playergold >= upgradecost) {
industrylevel = industrylevel + 1;
_root.playergold = _root.playergold - upgradecost;
upgradecost = upgradecost * 2;
}
}
Symbol 199 MovieClip Frame 1
stop();
Symbol 199 MovieClip Frame 35
this.removeMovieClip();
Symbol 205 MovieClip Frame 1
stop();
Symbol 205 MovieClip Frame 35
this.removeMovieClip();
Symbol 209 MovieClip Frame 1
stop();
Symbol 209 MovieClip Frame 35
this.removeMovieClip();
Symbol 213 MovieClip Frame 1
stop();
Symbol 213 MovieClip Frame 35
this.removeMovieClip();
Symbol 231 MovieClip Frame 1
stop();
Symbol 233 Button
on (press) {
i = 1;
while (i < 9) {
while (_root[("unit" + i) + "deployed"] > 0) {
_root[("unit" + i) + "owned"]++;
_root[("unit" + i) + "deployed"]--;
}
i++;
}
gotoAndStop (1);
}
Symbol 234 Button
on (press) {
count = 0;
i = 1;
while (i < 9) {
if (_root[("unit" + i) + "deployed"] > 0) {
count = count + 1;
}
i++;
}
if (count > 0) {
_root.turn++;
_root.ai = _root.ownedd;
_root.gotoAndStop("BattleAttacking");
} else {
attackerror.gotoAndPlay(2);
}
}
Symbol 268 MovieClip Frame 1
stop();
Symbol 268 MovieClip Frame 52
gotoAndStop (1);
Symbol 269 Button
on (press) {
if (_root.playergold > _root.playertowerfireratecost) {
_root.playertowerfirerate--;
_root.playergold = _root.playergold - _root.playertowerfireratecost;
_root.playermetal = _root.playermetal - _root.playertowerfireratemcost;
_root.playertowerfireratecost = _root.playertowerfireratecost * 2;
_root.playertowerfireratemcost = _root.playertowerfireratemcost * 2;
}
}
Symbol 270 Button
on (press) {
if (_root.playergold > _root.playertowerdamagecost) {
_root.playertowerdamage++;
_root.playergold = _root.playergold - _root.playertowerdamagecost;
_root.playermetal = _root.playermetal - _root.playertowerdamagemcost;
_root.playertowerdamagecost = _root.playertowerdamagecost * 2;
_root.playertowerdamagemcost = _root.playertowerdamagemcost * 2;
}
}
Symbol 271 Button
on (press) {
if (_root.playergold > _root.playertowerhealthcost) {
_root.playertowerhealth = _root.playertowerhealth + 100;
_root.playergold = _root.playergold - _root.playertowerhealthcost;
_root.playermetal = _root.playermetal - _root.playertowerhealthmcost;
_root.playertowerhealthcost = _root.playertowerhealthcost * 2;
_root.playertowerhealthmcost = _root.playertowerhealthmcost * 2;
}
}
Symbol 295 Button
on (press) {
_root.gotoAndStop("BattleDefending");
}
Symbol 305 MovieClip Frame 1
stop();
_root.tooltipss.gotoAndStop("main");
Instance of Symbol 180 MovieClip "effects" in Symbol 305 MovieClip Frame 2
onClipEvent (load) {
_visible = false;
}
Symbol 305 MovieClip Frame 3
_root.tooltipss.gotoAndStop("buildunits");
Instance of Symbol 98 MovieClip in Symbol 305 MovieClip Frame 3
onClipEvent (load) {
unit = 4;
}
on (rollOver) {
_parent.cost = _root[("unit" + unit) + "cost"];
_parent.food = _root[("unit" + unit) + "food"];
_parent.speed = _root[("unit" + unit) + "speed"];
_parent.range = _root[("unit" + unit) + "range"];
_parent.owned = _root[("unit" + unit) + "owned"];
_parent.damage = _root[("unit" + unit) + "damage"];
_parent.hp = _root[("unit" + unit) + "hp"];
_parent.unity._visible = true;
}
on (rollOut) {
_parent.unity._visible = false;
}
on (press) {
if ((_root.playergold >= _root[("unit" + unit) + "cost"]) && (_root.playerfood >= _root[("unit" + unit) + "food"])) {
_root.loll._x = _x;
_root.loll._y = _y;
_root.loll.gotoAndPlay(2);
_root.playergold = _root.playergold - _root[("unit" + unit) + "cost"];
_root.playerfood = _root.playerfood - _root[("unit" + unit) + "food"];
_root[("unit" + unit) + "owned"] = _root[("unit" + unit) + "owned"] + 1;
_parent.owned = _root[("unit" + unit) + "owned"];
}
}
Instance of Symbol 199 MovieClip in Symbol 305 MovieClip Frame 3
onClipEvent (load) {
unit = 5;
}
on (rollOver) {
_parent.cost = _root[("unit" + unit) + "cost"];
_parent.food = _root[("unit" + unit) + "food"];
_parent.speed = _root[("unit" + unit) + "speed"];
_parent.range = _root[("unit" + unit) + "range"];
_parent.owned = _root[("unit" + unit) + "owned"];
_parent.damage = _root[("unit" + unit) + "damage"];
_parent.hp = _root[("unit" + unit) + "hp"];
_parent.unity._visible = true;
}
on (rollOut) {
_parent.unity._visible = false;
}
on (press) {
if ((_root.playergold >= _root[("unit" + unit) + "cost"]) && (_root.playerfood >= _root[("unit" + unit) + "food"])) {
_root.loll._x = _x;
_root.loll._y = _y;
_root.loll.gotoAndPlay(2);
_root.playergold = _root.playergold - _root[("unit" + unit) + "cost"];
_root.playerfood = _root.playerfood - _root[("unit" + unit) + "food"];
_root[("unit" + unit) + "owned"] = _root[("unit" + unit) + "owned"] + 1;
_parent.owned = _root[("unit" + unit) + "owned"];
}
}
Instance of Symbol 205 MovieClip in Symbol 305 MovieClip Frame 3
onClipEvent (load) {
unit = 6;
}
on (rollOver) {
_parent.cost = _root[("unit" + unit) + "cost"];
_parent.food = _root[("unit" + unit) + "food"];
_parent.speed = _root[("unit" + unit) + "speed"];
_parent.range = _root[("unit" + unit) + "range"];
_parent.owned = _root[("unit" + unit) + "owned"];
_parent.damage = _root[("unit" + unit) + "damage"];
_parent.hp = _root[("unit" + unit) + "hp"];
_parent.unity._visible = true;
}
on (rollOut) {
_parent.unity._visible = false;
}
on (press) {
if ((_root.playergold >= _root[("unit" + unit) + "cost"]) && (_root.playerfood >= _root[("unit" + unit) + "food"])) {
_root.loll._x = _x;
_root.loll._y = _y;
_root.loll.gotoAndPlay(2);
_root.playergold = _root.playergold - _root[("unit" + unit) + "cost"];
_root.playerfood = _root.playerfood - _root[("unit" + unit) + "food"];
_root[("unit" + unit) + "owned"] = _root[("unit" + unit) + "owned"] + 1;
_parent.owned = _root[("unit" + unit) + "owned"];
}
}
Instance of Symbol 209 MovieClip in Symbol 305 MovieClip Frame 3
onClipEvent (load) {
unit = 7;
}
on (rollOver) {
_parent.cost = _root[("unit" + unit) + "cost"];
_parent.food = _root[("unit" + unit) + "food"];
_parent.speed = _root[("unit" + unit) + "speed"];
_parent.range = _root[("unit" + unit) + "range"];
_parent.owned = _root[("unit" + unit) + "owned"];
_parent.damage = _root[("unit" + unit) + "damage"];
_parent.hp = _root[("unit" + unit) + "hp"];
_parent.unity._visible = true;
}
on (rollOut) {
unity._visible = false;
}
on (press) {
if ((_root.playergold >= _root[("unit" + unit) + "cost"]) && (_root.playerfood >= _root[("unit" + unit) + "food"])) {
_root.loll._x = _x;
_root.loll._y = _y;
_root.loll.gotoAndPlay(2);
_root.playergold = _root.playergold - _root[("unit" + unit) + "cost"];
_root.playerfood = _root.playerfood - _root[("unit" + unit) + "food"];
_root[("unit" + unit) + "owned"] = _root[("unit" + unit) + "owned"] + 1;
_parent.owned = _root[("unit" + unit) + "owned"];
}
}
Instance of Symbol 213 MovieClip in Symbol 305 MovieClip Frame 3
onClipEvent (load) {
unit = 8;
}
on (rollOver) {
_parent.cost = _root[("unit" + unit) + "cost"];
_parent.food = _root[("unit" + unit) + "food"];
_parent.speed = _root[("unit" + unit) + "speed"];
_parent.range = _root[("unit" + unit) + "range"];
_parent.owned = _root[("unit" + unit) + "owned"];
_parent.damage = _root[("unit" + unit) + "damage"];
_parent.hp = _root[("unit" + unit) + "hp"];
_parent.unity._visible = true;
}
on (rollOut) {
unity._visible = false;
}
on (press) {
if ((_root.playergold >= _root[("unit" + unit) + "cost"]) && (_root.playerfood >= _root[("unit" + unit) + "food"])) {
_root.loll._x = _x;
_root.loll._y = _y;
_root.loll.gotoAndPlay(2);
_root.playergold = _root.playergold - _root[("unit" + unit) + "cost"];
_root.playerfood = _root.playerfood - _root[("unit" + unit) + "food"];
_root[("unit" + unit) + "owned"] = _root[("unit" + unit) + "owned"] + 1;
_parent.owned = _root[("unit" + unit) + "owned"];
}
}
Instance of Symbol 84 MovieClip in Symbol 305 MovieClip Frame 3
onClipEvent (load) {
unit = 1;
}
on (rollOver) {
_parent.cost = _root[("unit" + unit) + "cost"];
_parent.food = _root[("unit" + unit) + "food"];
_parent.speed = _root[("unit" + unit) + "speed"];
_parent.range = _root[("unit" + unit) + "range"];
_parent.owned = _root[("unit" + unit) + "owned"];
_parent.damage = _root[("unit" + unit) + "damage"];
_parent.hp = _root[("unit" + unit) + "hp"];
_parent.unity._visible = true;
}
on (rollOut) {
_parent.unity._visible = false;
}
on (press) {
if ((_root.playergold >= _root[("unit" + unit) + "cost"]) && (_root.playerfood >= _root[("unit" + unit) + "food"])) {
_root.loll._x = _x;
_root.loll._y = _y;
_root.loll.gotoAndPlay(2);
_root.playergold = _root.playergold - _root[("unit" + unit) + "cost"];
_root.playerfood = _root.playerfood - _root[("unit" + unit) + "food"];
_root[("unit" + unit) + "owned"] = _root[("unit" + unit) + "owned"] + 1;
_parent.owned = _root[("unit" + unit) + "owned"];
}
}
Instance of Symbol 102 MovieClip in Symbol 305 MovieClip Frame 3
onClipEvent (load) {
unit = 2;
}
on (rollOver) {
_parent.cost = _root[("unit" + unit) + "cost"];
_parent.food = _root[("unit" + unit) + "food"];
_parent.speed = _root[("unit" + unit) + "speed"];
_parent.range = _root[("unit" + unit) + "range"];
_parent.owned = _root[("unit" + unit) + "owned"];
_parent.damage = _root[("unit" + unit) + "damage"];
_parent.hp = _root[("unit" + unit) + "hp"];
_parent.unity._visible = true;
}
on (rollOut) {
_parent.unity._visible = false;
}
on (press) {
if ((_root.playergold >= _root[("unit" + unit) + "cost"]) && (_root.playerfood >= _root[("unit" + unit) + "food"])) {
_root.loll._x = _x;
_root.loll._y = _y;
_root.loll.gotoAndPlay(2);
_root.playergold = _root.playergold - _root[("unit" + unit) + "cost"];
_root.playerfood = _root.playerfood - _root[("unit" + unit) + "food"];
_root[("unit" + unit) + "owned"] = _root[("unit" + unit) + "owned"] + 1;
_parent.owned = _root[("unit" + unit) + "owned"];
}
}
Instance of Symbol 90 MovieClip in Symbol 305 MovieClip Frame 3
onClipEvent (load) {
unit = 3;
}
on (rollOver) {
_parent.cost = _root[("unit" + unit) + "cost"];
_parent.food = _root[("unit" + unit) + "food"];
_parent.speed = _root[("unit" + unit) + "speed"];
_parent.range = _root[("unit" + unit) + "range"];
_parent.owned = _root[("unit" + unit) + "owned"];
_parent.damage = _root[("unit" + unit) + "damage"];
_parent.hp = _root[("unit" + unit) + "hp"];
_parent.unity._visible = true;
}
on (rollOut) {
_parent.unity._visible = false;
}
on (press) {
if ((_root.playergold >= _root[("unit" + unit) + "cost"]) && (_root.playerfood >= _root[("unit" + unit) + "food"])) {
_root.loll._x = _x;
_root.loll._y = _y;
_root.loll.gotoAndPlay(2);
_root.playergold = _root.playergold - _root[("unit" + unit) + "cost"];
_root.playerfood = _root.playerfood - _root[("unit" + unit) + "food"];
_root[("unit" + unit) + "owned"] = _root[("unit" + unit) + "owned"] + 1;
_parent.owned = _root[("unit" + unit) + "owned"];
}
}
Instance of Symbol 229 MovieClip "unity" in Symbol 305 MovieClip Frame 3
onClipEvent (load) {
_visible = false;
}
Symbol 305 MovieClip Frame 4
i = 1;
while (i < 9) {
_root[("unit" + i) + "deployed"] = 0;
i++;
}
_root.tooltipss.gotoAndStop("deploy");
Instance of Symbol 84 MovieClip in Symbol 305 MovieClip Frame 4
onClipEvent (load) {
unit = 1;
}
on (rollOver) {
_parent.cost = _root[("unit" + unit) + "cost"];
_parent.food = _root[("unit" + unit) + "food"];
_parent.speed = _root[("unit" + unit) + "speed"];
_parent.range = _root[("unit" + unit) + "range"];
_parent.owned = _root[("unit" + unit) + "owned"];
_parent.damage = _root[("unit" + unit) + "damage"];
_parent.hp = _root[("unit" + unit) + "hp"];
_parent.unity._visible = true;
}
on (rollOut) {
_parent.unity._visible = false;
}
on (press) {
if (_root[("unit" + unit) + "owned"] > 0) {
_root[("unit" + unit) + "owned"] = _root[("unit" + unit) + "owned"] - 1;
_root[("unit" + unit) + "deployed"] = _root[("unit" + unit) + "deployed"] + 1;
}
}
Instance of Symbol 102 MovieClip in Symbol 305 MovieClip Frame 4
onClipEvent (load) {
unit = 2;
}
on (rollOver) {
_parent.cost = _root[("unit" + unit) + "cost"];
_parent.food = _root[("unit" + unit) + "food"];
_parent.speed = _root[("unit" + unit) + "speed"];
_parent.range = _root[("unit" + unit) + "range"];
_parent.owned = _root[("unit" + unit) + "owned"];
_parent.damage = _root[("unit" + unit) + "damage"];
_parent.hp = _root[("unit" + unit) + "hp"];
_parent.unity._visible = true;
}
on (rollOut) {
_parent.unity._visible = false;
}
on (press) {
if (_root[("unit" + unit) + "owned"] > 0) {
_root[("unit" + unit) + "owned"] = _root[("unit" + unit) + "owned"] - 1;
_root[("unit" + unit) + "deployed"] = _root[("unit" + unit) + "deployed"] + 1;
}
}
Instance of Symbol 90 MovieClip in Symbol 305 MovieClip Frame 4
onClipEvent (load) {
unit = 3;
}
on (rollOver) {
_parent.cost = _root[("unit" + unit) + "cost"];
_parent.food = _root[("unit" + unit) + "food"];
_parent.speed = _root[("unit" + unit) + "speed"];
_parent.range = _root[("unit" + unit) + "range"];
_parent.owned = _root[("unit" + unit) + "owned"];
_parent.damage = _root[("unit" + unit) + "damage"];
_parent.hp = _root[("unit" + unit) + "hp"];
_parent.unity._visible = true;
}
on (rollOut) {
_parent.unity._visible = false;
}
on (press) {
if (_root[("unit" + unit) + "owned"] > 0) {
_root[("unit" + unit) + "owned"] = _root[("unit" + unit) + "owned"] - 1;
_root[("unit" + unit) + "deployed"] = _root[("unit" + unit) + "deployed"] + 1;
}
}
Instance of Symbol 98 MovieClip in Symbol 305 MovieClip Frame 4
onClipEvent (load) {
unit = 4;
}
on (rollOver) {
_parent.cost = _root[("unit" + unit) + "cost"];
_parent.food = _root[("unit" + unit) + "food"];
_parent.speed = _root[("unit" + unit) + "speed"];
_parent.range = _root[("unit" + unit) + "range"];
_parent.owned = _root[("unit" + unit) + "owned"];
_parent.damage = _root[("unit" + unit) + "damage"];
_parent.hp = _root[("unit" + unit) + "hp"];
_parent.unity._visible = true;
}
on (rollOut) {
_parent.unity._visible = false;
}
on (press) {
if (_root[("unit" + unit) + "owned"] > 0) {
_root[("unit" + unit) + "owned"] = _root[("unit" + unit) + "owned"] - 1;
_root[("unit" + unit) + "deployed"] = _root[("unit" + unit) + "deployed"] + 1;
}
}
Instance of Symbol 199 MovieClip in Symbol 305 MovieClip Frame 4
onClipEvent (load) {
unit = 5;
}
on (rollOver) {
_parent.cost = _root[("unit" + unit) + "cost"];
_parent.food = _root[("unit" + unit) + "food"];
_parent.speed = _root[("unit" + unit) + "speed"];
_parent.range = _root[("unit" + unit) + "range"];
_parent.owned = _root[("unit" + unit) + "owned"];
_parent.damage = _root[("unit" + unit) + "damage"];
_parent.hp = _root[("unit" + unit) + "hp"];
_parent.unity._visible = true;
}
on (rollOut) {
_parent.unity._visible = false;
}
on (press) {
if (_root[("unit" + unit) + "owned"] > 0) {
_root[("unit" + unit) + "owned"] = _root[("unit" + unit) + "owned"] - 1;
_root[("unit" + unit) + "deployed"] = _root[("unit" + unit) + "deployed"] + 1;
}
}
Instance of Symbol 205 MovieClip in Symbol 305 MovieClip Frame 4
onClipEvent (load) {
unit = 6;
}
on (rollOver) {
_parent.cost = _root[("unit" + unit) + "cost"];
_parent.food = _root[("unit" + unit) + "food"];
_parent.speed = _root[("unit" + unit) + "speed"];
_parent.range = _root[("unit" + unit) + "range"];
_parent.owned = _root[("unit" + unit) + "owned"];
_parent.damage = _root[("unit" + unit) + "damage"];
_parent.hp = _root[("unit" + unit) + "hp"];
_parent.unity._visible = true;
}
on (rollOut) {
_parent.unity._visible = false;
}
on (press) {
if (_root[("unit" + unit) + "owned"] > 0) {
_root[("unit" + unit) + "owned"] = _root[("unit" + unit) + "owned"] - 1;
_root[("unit" + unit) + "deployed"] = _root[("unit" + unit) + "deployed"] + 1;
}
}
Instance of Symbol 209 MovieClip in Symbol 305 MovieClip Frame 4
onClipEvent (load) {
unit = 7;
}
on (rollOver) {
_parent.cost = _root[("unit" + unit) + "cost"];
_parent.food = _root[("unit" + unit) + "food"];
_parent.speed = _root[("unit" + unit) + "speed"];
_parent.range = _root[("unit" + unit) + "range"];
_parent.owned = _root[("unit" + unit) + "owned"];
_parent.damage = _root[("unit" + unit) + "damage"];
_parent.hp = _root[("unit" + unit) + "hp"];
_parent.unity._visible = true;
}
on (rollOut) {
_parent.unity._visible = false;
}
on (press) {
if (_root[("unit" + unit) + "owned"] > 0) {
_root[("unit" + unit) + "owned"] = _root[("unit" + unit) + "owned"] - 1;
_root[("unit" + unit) + "deployed"] = _root[("unit" + unit) + "deployed"] + 1;
}
}
Instance of Symbol 213 MovieClip in Symbol 305 MovieClip Frame 4
onClipEvent (load) {
unit = 8;
}
on (rollOver) {
_parent.cost = _root[("unit" + unit) + "cost"];
_parent.food = _root[("unit" + unit) + "food"];
_parent.speed = _root[("unit" + unit) + "speed"];
_parent.range = _root[("unit" + unit) + "range"];
_parent.owned = _root[("unit" + unit) + "owned"];
_parent.damage = _root[("unit" + unit) + "damage"];
_parent.hp = _root[("unit" + unit) + "hp"];
_parent.unity._visible = true;
}
on (rollOut) {
_parent.unity._visible = false;
}
on (press) {
if (_root[("unit" + unit) + "owned"] > 0) {
_root[("unit" + unit) + "owned"] = _root[("unit" + unit) + "owned"] - 1;
_root[("unit" + unit) + "deployed"] = _root[("unit" + unit) + "deployed"] + 1;
}
}
Instance of Symbol 261 MovieClip "unity" in Symbol 305 MovieClip Frame 4
onClipEvent (load) {
_visible = false;
}
Symbol 305 MovieClip Frame 5
_root.tooltipss.gotoAndStop("upgradetower");
Symbol 305 MovieClip Frame 7
_root.tooltipss.gotoAndStop("defend");
Symbol 318 Button
on (press) {
this.gotoAndStop(1);
}
Symbol 326 MovieClip Frame 1
stop();
Instance of Symbol 155 MovieClip in Symbol 326 MovieClip Frame 2
/* no clip actions */
Symbol 334 Button
on (press) {
_root.options = false;
}
Instance of Symbol 333 MovieClip in Symbol 335 MovieClip Frame 1
on (press) {
_quality = "HIGH";
}
Instance of Symbol 333 MovieClip in Symbol 335 MovieClip Frame 1
on (press) {
_quality = "MEDIUM";
}
Instance of Symbol 333 MovieClip in Symbol 335 MovieClip Frame 1
on (press) {
_quality = "LOW";
}
Instance of Symbol 110 MovieClip in Symbol 335 MovieClip Frame 1
onClipEvent (load) {
if (_root.tooltips == 1) {
gotoAndStop (1);
} else if (_root.tooltips == 0) {
gotoAndStop (2);
}
}
on (press) {
nextFrame();
}
Instance of Symbol 333 MovieClip in Symbol 335 MovieClip Frame 1
on (press) {
_root.gotoAndStop(1);
}
Symbol 339 Button
on (release) {
_root.gotoAndStop(2);
}
Symbol 341 MovieClip Frame 1
stop();
Symbol 366 MovieClip Frame 1
_root.Selected = 1;
Instance of Symbol 365 MovieClip "uni" in Symbol 366 MovieClip Frame 1
onClipEvent (enterFrame) {
i = 49;
while (i < 57) {
if (Key.isDown(i)) {
_root.Selected = i - 48;
}
i++;
}
this._x = _parent["unit" + _root.Selected]._x;
}
Symbol 376 MovieClip Frame 1
stop();
Symbol 382 MovieClip Frame 1
stop();
Symbol 382 MovieClip Frame 2
trace("BANG");
Symbol 382 MovieClip Frame 24
stop();
Symbol 387 Button
on (press) {
this._visible = false;
}
Instance of Symbol 155 MovieClip in Symbol 388 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 155 MovieClip in Symbol 391 MovieClip Frame 1
/* no clip actions */
Symbol 394 Button
on (press) {
a = 1;
while (a < 5) {
_root[("AI" + a) + "territoriesowned"] = savefile.data[("AI" + a) + "territoriesowned"];
_root[("AI" + a) + "gold"] = savefile.data[("AI" + a) + "gold"];
_root[("AI" + a) + "food"] = savefile.data[("AI" + a) + "food"];
_root[("AI" + a) + "metal"] = savefile.data[("AI" + a) + "metal"];
_root[("AI" + a) + "towerlevel"] = savefile.data[("AI" + a) + "towerlevel"];
_root[("AI" + a) + "towerlevelcost"] = savefile.data[("AI" + a) + "towerlevelcost"];
_root[("AI" + a) + "towerlevelmcost"] = savefile.data[("AI" + a) + "towerlevelmcost"];
_root[("AI" + a) + "towerfirerate"] = savefile.data[("AI" + a) + "towerfirerate"];
_root[("AI" + a) + "towerfireratecost"] = savefile.data[("AI" + a) + "towerfireratecost"];
_root[("AI" + a) + "towerfireratemcost"] = savefile.data[("AI" + a) + "towerfireratemcost"];
_root[("AI" + a) + "towerdamage"] = savefile.data[("AI" + a) + "towerdamage"];
_root[("AI" + a) + "towerdamagecost"] = savefile.data[("AI" + a) + "towerdamagecost"];
_root[("AI" + a) + "towerdamagemcost"] = savefile.data[("AI" + a) + "towerdamagemcost"];
_root[("AI" + a) + "towerhealth"] = savefile.data[("AI" + a) + "towerhealth"];
_root[("AI" + a) + "towerhealthcost"] = savefile.data[("AI" + a) + "towerhealthcost"];
_root[("AI" + a) + "towerhealthmcost"] = savefile.data[("AI" + a) + "towerhealthmcost"];
u = 1;
while (u < 9) {
_root[((("AI" + a) + "unit") + u) + "owned"] = savefile.data[((("AI" + a) + "unit") + u) + "owned"];
u++;
}
a++;
}
_root.playerturn = savefile.data.playerturn;
_root.turn = savefile.data.turn;
_root.turncount = savefile.data.turncount;
playergold = savefile.data.playergold;
playerfood = savefile.data.playerfood;
playermetal = savefile.data.playermetal;
playertowerlevel = savefile.data.playertowerlevel;
playertowerlevelcost = savefile.data.playertowerlevelcost;
playertowerlevelmcost = savefile.data.playertowerlevelmcost;
playertowerfirerate = savefile.data.playertowerfirerate;
playertowerfireratecost = savefile.data.playertowerfireratecost;
playertowerfireratemcost = savefile.data.playertowerfireratemcost;
playertowerdamage = savefile.data.playertowerdamage;
playertowerdamagecost = savefile.data.playertowerdamagecost;
playertowerdamagemcost = savefile.data.playertowerdamagemcost;
playertowerhealth = savefile.data.playertowerhealth;
playertowerhealthcost = savefile.data.playertowerhealthcost;
playertowerhealthmcost = savefile.data.playertowerhealthmcost;
i = 1;
while (i < 11) {
_root[("territory" + i) + "owned"] = savefile.data[("territory" + i) + "owned"];
_root[("territory" + i) + "upgradecost"] = savefile.data[("territory" + i) + "upgradecost"];
_root[("territory" + i) + "farminglevel"] = savefile.data[("territory" + i) + "farminglevel"];
_root[("territory" + i) + "infrastructurelevel"] = savefile.data[("territory" + i) + "infrastructurelevel"];
_root[("territory" + i) + "industrylevel"] = savefile.data[("territory" + i) + "industrylevel"];
i++;
}
_root.countryselected = savefile.data.countryselected;
_root.playercolour = savefile.data.playercolour;
ai = 1;
while (ai < 5) {
if (savefile.data[("ai" + ai) + "country"] != "undefined") {
_root[("ai" + ai) + "country"] = savefile.data[("ai" + ai) + "country"];
_root[("AI" + ai) + "colour"] = savefile.data[("AI" + ai) + "colour"];
}
ai++;
}
_root.gotoAndStop(4);
}
Symbol 396 Button
on (press) {
_root.gotoAndStop(2);
}