Frame 1
sndGame = new Sound(snd_game);
sndGame.start();
snd_game.play();
_global.mosaic_quality = 1;
function addMon(_level, _wave, _portal, _kind, _amount, _cluster, _delay, _pause, _keepPos) {
if (monSet[_level] == undefined) {
monSet[_level] = new Array();
}
if (monSet[_level][_wave] == undefined) {
monSet[_level][_wave] = new Array();
}
monSet[_level][_wave][_portal] = new Object();
monSet[_level][_wave][_portal].amount = _amount;
monSet[_level][_wave][_portal].kind = _kind;
monSet[_level][_wave][_portal].spwnDlay = _delay;
monSet[_level][_wave][_portal].pause = _pause;
monSet[_level][_wave][_portal].cluster = _cluster;
monSet[_level][_wave][_portal].keepPos = _keepPos;
}
function getDist(unitA, unitB) {
lx = unitA._x - unitB._x;
ly = unitA._y - unitB._y;
dist = Math.sqrt((lx * lx) + (ly * ly));
return(dist);
}
function getAngTo(unitB, unitA) {
lx = unitA._x - unitB._x;
ly = unitA._y - unitB._y;
ang = (Math.atan2(lx, ly) * 180) / Math.PI;
ang = ang * -1;
return(ang);
}
function rotateTo(useMe, toAngle, _speed) {
keepRot = true;
useMe._rotation = useMe._rotation - toAngle;
if (useMe._rotation < 0) {
useMe._rotation = Math.min(0, useMe._rotation + _speed);
} else {
useMe._rotation = Math.max(0, useMe._rotation - _speed);
}
if (useMe._rotation == 0) {
keepRot = false;
}
useMe._rotation = useMe._rotation + toAngle;
return(keepRot);
}
function drawRect(drawMe, x1, y1, width, height, _color, Alpha, lineColo, lineAlph) {
drawMe.lineStyle(0, lineColo, lineAlph);
drawMe.beginFill(_color, Alpha);
drawMe.moveTo(x1, y1);
drawMe.lineTo(x1 + width, y1);
drawMe.lineTo(x1 + width, y1 + height);
drawMe.lineTo(x1, y1 + height);
drawMe.lineTo(x1, y1);
drawMe.endFill();
}
function splatter(x1, y1, _amount, _radius) {
i = 0;
while (i < _amount) {
temp = _radius * Math.random();
tempAng = ((360 * Math.random()) * Math.PI) / 180;
duplicateMovieClip (bloods.meatpack, "effct" + effects, 30 + effects);
bloods["effct" + effects]._x = x1 + (Math.sin(tempAng) * temp);
bloods["effct" + effects]._y = y1 + (Math.cos(tempAng) * temp);
bloods["effct" + effects].xForce = Math.sin(tempAng) * Math.min(14, temp * 0.2);
bloods["effct" + effects].yForce = Math.cos(tempAng) * Math.min(14, temp * 0.4);
effects = effects + 1;
i++;
}
}
function drops(x1, y1, _amount, _radius) {
i = 0;
while (i < _amount) {
temp = _radius * Math.random();
tempAng = ((360 * Math.random()) * Math.PI) / 180;
duplicateMovieClip (bloods.blood, "effct" + effects, 30 + effects);
bloods["effct" + effects]._x = x1 + (Math.sin(tempAng) * temp);
bloods["effct" + effects]._y = y1 + (Math.cos(tempAng) * temp);
bloods["effct" + effects].xForce = Math.sin(tempAng) * Math.min(16, temp * 0.2);
bloods["effct" + effects].yForce = Math.cos(tempAng) * Math.min(16, temp * 0.2);
effects = effects + 1;
i++;
}
}
function explo(x1, y1, _Size, _Type) {
duplicateMovieClip (bloods["explo" + _Type], "effct" + effects, 30 + effects);
bloods["effct" + effects]._x = x1;
bloods["effct" + effects]._y = y1;
bloods["effct" + effects]._xscale = (bloods["effct" + effects]._yscale = _Size);
effects = effects + 1;
}
function splashO(x1, y1, _Size, _Type) {
duplicateMovieClip (bloods["splash" + _Type], "effct" + effects, 30 + effects);
bloods["effct" + effects]._x = x1;
bloods["effct" + effects]._y = y1;
bloods["effct" + effects]._xscale = (bloods["effct" + effects]._yscale = _Size * 10);
effects = effects + 1;
}
function sparks(x1, y1, _amount, _radius) {
i = 0;
while (i < _amount) {
temp = _radius * Math.random();
tempAng = ((360 * Math.random()) * Math.PI) / 180;
duplicateMovieClip (bloods.sparkY1, "effct" + effects, 30 + effects);
bloods["effct" + effects]._x = x1 + (Math.sin(tempAng) * temp);
bloods["effct" + effects]._y = y1 + (Math.cos(tempAng) * temp);
bloods["effct" + effects]._xscale = (bloods["effct" + effects]._yscale = 50 + (300 * (1 - (temp / _radius))));
effects = effects + 1;
i++;
}
}
function splashW(x1, y1, _size) {
duplicateMovieClip (bloods.splashW1, "effct" + effects, 30 + effects);
bloods["effct" + effects]._x = x1;
bloods["effct" + effects]._y = y1;
bloods["effct" + effects]._xscale = (bloods["effct" + effects]._yscale = _Size);
effects = effects + 1;
}
function flyngObj(x1, y1, _z1, _Objct, _forcPow, _forcAng) {
tempAng = (_forcAng * Math.PI) / 180;
duplicateMovieClip (bloods[_Objct], "effct" + effects, 30 + effects);
bloods["effct" + effects]._x = x1;
bloods["effct" + effects]._y = y1;
bloods["effct" + effects]._z = _z1;
bloods["effct" + effects].xForce = (Math.sin(tempAng) * _forcPow) * 0.2;
bloods["effct" + effects].yForce = (Math.cos(tempAng) * _forcPow) * 0.2;
effects = effects + 1;
}
function impactFX(Ttype, X, Y) {
if (Ttype == "fireStne") {
explo(X, Y, 100, "R1");
}
}
function removeMe(_spawner, monNum, kill) {
if (kill == true) {
_spawner._parent.money = _spawner._parent.money + _spawner._parent.monsters[_spawner.monsters[monNum].unitType].money;
if (upgButtn._visible == true) {
if (placer.selected.length == 1) {
if (money >= towers[placer.selected[0].turrtype][placer.selected[0].level + 1].price) {
upgButtn.bg.gotoAndStop(1);
upgButtn.bgF = 1;
}
}
}
} else {
_spawner._parent.lifes = Math.max(0, _spawner._parent.lifes - 1);
_spawner._parent.lifesTXT.text = _spawner._parent.lifes;
cumshot = true;
if (_spawner._parent.lifes == 0) {
_spawner._parent.GameOver.gotoAndPlay("game_over");
_spawner._parent.GameOver._visible = true;
_spawner.run = false;
}
}
_temp = _spawner.speedLog.length;
_spliced = false;
_j = 0;
while (_j < _temp) {
if (_spawner.speedLog[_j].speed == _spawner.monsters[monNum].speed) {
_spawner.speedLog[_j].amount = _spawner.speedLog[_j].amount - 1;
if (_spawner.speedLog[_j].amount == 0) {
_spawner.speedLog.splice(_j, 1);
_spliced = true;
}
_j = _temp;
}
_j++;
}
if (_spliced == true) {
_temp = _temp - 1;
_spawner.maxSpeed = 1;
_j = 0;
while (_j < _temp) {
if (Math.floor(_spawner.speedLog[j].speed / _spawner._parent.precis) > _spawner.maxSpeed) {
_spawner.maxSpeed = Math.floor(_spawner.speedLog[j].speed / _spawner._parent.precis);
}
_j++;
}
}
_temp = _spawner.tList.length;
_j = 0;
while (_j < _temp) {
if ((_spawner.tList[_j].myTarget == monNum) || (_spawner.tList[_j].myAim == monNum)) {
_spawner.tList[_j].myTarget = -1;
_spawner.tList[_j].myAim = -1;
_spawner.tList[_j].cool = 0;
} else {
if (_spawner.tList[_j].myTarget > monNum) {
_spawner.tList[_j].myTarget = _spawner.tList[_j].myTarget - 1;
}
if (_spawner.tList[_j].myAim > monNum) {
_spawner.tList[_j].myAim = _spawner.tList[_j].myAim - 1;
}
}
_j++;
}
_temp = _spawner.missiles.length;
_j = 0;
while (_j < _temp) {
if (_spawner.missiles[_j].aimFor == monNum) {
_spawner.missiles[_j].aimFor = -1;
_spawner.missiles[_j].aimX = _spawner.monsters[monNum]._x;
_spawner.missiles[_j].aimY = _spawner.monsters[monNum]._y;
} else if (_spawner.missiles[_j].aimFor > monNum) {
_spawner.missiles[_j].aimFor = _spawner.missiles[_j].aimFor - 1;
}
_j++;
}
if (_spawner._parent.placer.selected[0] == _spawner.monsters[monNum]) {
_spawner._parent.placer.selected = new Array();
_spawner._parent.placer.selMon = false;
}
removeMovieClip(_spawner.monsters[monNum]);
_spawner.monsters[monNum] = null;
_spawner.monsters.splice(monNum, 1);
_spawner.monLen = _spawner.monLen - 1;
_spawner.i = _spawner.i - 1;
}
function removeMi(misslNum) {
_temp = spawner.speedLog.length;
_spliced = false;
_j = 0;
while (_j < _temp) {
if (spawner.speedLog[_j].speed == Math.floor(towers[spawner.missiles[misslNum].turrtype][spawner.missiles[misslNum].level].bulltSpd / 3)) {
spawner.speedLog[_j].amount = spawner.speedLog[_j].amount - 1;
if (spawner.speedLog[_j].amount == 0) {
spawner.speedLog.splice(_j, 1);
_spliced = true;
}
_j = _temp;
}
_j++;
}
if (_spliced == true) {
_temp = _temp - 1;
spawner.maxSpeed = 1;
_j = 0;
while (_j < _temp) {
if (Math.floor(spawner.speedLog[j].speed / precis) > spawner.maxSpeed) {
spawner.maxSpeed = Math.floor(spawner.speedLog[j].speed / precis);
}
_j++;
}
}
if (towers[spawner.missiles[misslNum].turrtype][spawner.missiles[misslNum].level].splash > 0) {
splashO(spawner.missiles[misslNum]._x, spawner.missiles[misslNum]._y, towers[spawner.missiles[misslNum].turrtype][spawner.missiles[misslNum].level].splash, towers[spawner.missiles[misslNum].turrtype][spawner.missiles[misslNum].level].explo);
}
explo(spawner.missiles[misslNum]._x, spawner.missiles[misslNum]._y, towers[spawner.missiles[misslNum].turrtype][spawner.missiles[misslNum].level].explSize, towers[spawner.missiles[misslNum].turrtype][spawner.missiles[misslNum].level].explo);
removeMovieClip(spawner.missiles[misslNum]);
spawner.missiles.splice(misslNum, 1);
}
effects = 0;
cumshot = false;
magic = false;
goNext = false;
monSet = new Array();
timer = 0;
level = 0;
wave = 0;
effects = 0;
towers = new Array();
towers.fireStne = new Array();
tempMax = 3;
i = 0;
while (i < tempMax) {
towers.fireStne[i] = new Object();
towers.fireStne[i].price = Math.round(25 - (i * 3));
towers.fireStne[i].range = 48 + (i * 7);
towers.fireStne[i].delay = 35 - (i * 4);
towers.fireStne[i].splash = 0;
towers.fireStne[i].rounds = 2;
towers.fireStne[i].rnddelay = 7;
towers.fireStne[i].damage = 4 + i;
towers.fireStne[i].turnspd = Math.round(12 + (i * 3));
towers.fireStne[i].spclDmg = 10 + (i * 5);
towers.fireStne[i].spclDur = 0;
towers.fireStne[i].bulltSpd = 0;
towers.fireStne[i].bulltRot = 0;
towers.fireStne[i].bulltLif = 0;
towers.fireStne[i].air = true;
towers.fireStne[i].ground = true;
towers.fireStne[i].chargeT = 0;
i++;
}
towers.fireStne[0].squares = 1;
towers.fireStne[0].spclType = "Fire";
towers.fireStne[2].rounds = 3;
towers.fireStne[0].maxLevel = tempMax - 1;
towers.fireStne[0].dispName = "Firestone";
towers.fireStne[0].buildT = 60;
function monfect(_mon) {
if (_mon.unitType == "slime1") {
explo(_mon._x, _mon._y, 180, "C1");
} else {
explo((_mon._x + 6) - (Math.random() * 12), (_mon._y + 6) - (Math.random() * 12), 100, "C1");
explo((_mon._x + 6) - (Math.random() * 12), (_mon._y + 6) - (Math.random() * 12), 100, "C1");
explo((_mon._x + 6) - (Math.random() * 12), (_mon._y + 6) - (Math.random() * 12), 100, "C1");
}
}
monsters = new Array();
monsters.slime1 = new Object();
monsters.slime1.speed = 4;
monsters.slime1.health = 44;
monsters.slime1.armor = 0;
monsters.slime1.money = 2;
monsters.slime1._size = 8;
monsters.slime1.ground = true;
monsters.slime1.air = false;
monsters.slime1.strength = "none";
monsters.slime1.weakness = "Fire";
monsters.slime1.dispName = "Cum slime";
monsters.bigslime = new Object();
monsters.bigslime.speed = 3;
monsters.bigslime.health = 90;
monsters.bigslime.armor = 5;
monsters.bigslime.money = 3;
monsters.bigslime._size = 14;
monsters.bigslime.ground = true;
monsters.bigslime.air = false;
monsters.bigslime.strength = "Ice";
monsters.bigslime.weakness = "none";
monsters.bigslime.dispName = "Big cum slime";
tempwave = 0;
addMon(0, tempwave, 0, "slime1", 8, 1, 80, 250, false);
tempwave = tempwave + 1;
addMon(0, tempwave, 0, "slime1", 15, 1, 50, 150, false);
tempwave = tempwave + 1;
addMon(0, tempwave, 0, "slime1", 6, 1, 50, 150, false);
tempwave = tempwave + 1;
addMon(0, tempwave, 0, "slime1", 15, 1, 35, 80, false);
tempwave = tempwave + 1;
addMon(0, tempwave, 0, "slime1", 3, 2, 45, 80, false);
tempwave = tempwave + 1;
addMon(0, tempwave, 0, "slime1", 13, 1, 45, 60, false);
tempwave = tempwave + 1;
addMon(0, tempwave, 0, "slime1", 13, 1, 25, 60, false);
tempwave = tempwave + 1;
addMon(0, tempwave, 0, "slime1", 3, 2, 45, 80, false);
tempwave = tempwave + 1;
addMon(0, tempwave, 0, "slime1", 8, 3, 35, 60, false);
tempwave = tempwave + 1;
addMon(0, tempwave, 0, "slime1", 13, 2, 45, 60, false);
tempwave = tempwave + 1;
addMon(0, tempwave, 0, "slime1", 5, 3, 15, 70, false);
tempwave = tempwave + 1;
addMon(0, tempwave, 0, "slime1", 3, 7, 15, 270, false);
tempwave = tempwave + 1;
function infoText(unit, tower, extra) {
txtBox.upgBar._visible = false;
txtBox.upgButtn._visible = false;
txtBox.indicatr._visible = false;
power._visible = false;
if (extra == "clear") {
txtBox.title.text = "";
txtBox.info1.text = "";
txtBox.timeCnt = 0;
} else {
txtBox.info1.autoSize = "left";
if (extra == "error") {
if (unit == "Upg2x") {
txtBox.title.text = "Warning";
txtBox.info1.text = " \nYou can build only one upgrade building for each power type.";
}
} else if (extra == "menu") {
txtBox.title.text = towers[unit][0].dispName;
if (towers[unit][0].ability == "energizr") {
txtBox.info1.text = ((("\nPrice " + towers[unit][0].price) + "\nType ") + towers[unit][0].indicatr) + "\n \nThis will power towers of its energy type in range.";
txtBox.indicatr.gotoAndStop(towers[unit][0].indicatr);
txtBox.indicatr._visible = true;
} else if (towers[unit][0].ability == "upgrader") {
txtBox.info1.text = (((("\nPrice " + towers[unit][0].price) + " -> ") + towers[unit][1].price) + "\nPower ") + towers[unit][0].power;
if (towers[unit][0].indicatr != undefined) {
txtBox.indicatr.gotoAndStop(towers[unit][0].indicatr);
txtBox.indicatr._visible = true;
}
txtBox.info1.text = txtBox.info1.text + "\n \nUpgrades towers of same power.";
power.gotoAndStop(towers[unit][0].power);
power._visible = true;
} else {
tempPow = false;
if (towers[unit][0].power == undefined) {
tempLvl = 0;
} else {
tempPow = true;
tempLvl = spawner.upgrades[towers[unit][0].power];
}
if (tempLvl < towers[unit][0].maxLevel) {
txtBox.info1.text = (((((("Level - " + (tempLvl + 1)) + newline) + "Damage ") + towers[unit][tempLvl].damage) + " -> ") + towers[unit][tempLvl + 1].damage) + newline;
if (towers[unit][tempLvl].spclDmg > 0) {
txtBox.info1.text = txtBox.info1.text + ((((((" +" + towers[unit][0].spclType) + " damage ") + towers[unit][tempLvl].spclDmg) + " -> ") + towers[unit][tempLvl + 1].spclDmg) + newline);
}
txtBox.info1.text = txtBox.info1.text + (((((((((((((("Range " + towers[unit][tempLvl].range) + " -> ") + towers[unit][tempLvl + 1].range) + newline) + "Reload ") + towers[unit][tempLvl].delay) + " -> ") + towers[unit][tempLvl + 1].delay) + newline) + "TurnSpd ") + towers[unit][tempLvl].turnspd) + " -> ") + towers[unit][tempLvl + 1].turnspd) + newline);
if (tempPow == false) {
txtBox.info1.text = txtBox.info1.text + ((("Price " + towers[unit][tempLvl].price) + " -> ") + towers[unit][tempLvl + 1].price);
} else {
txtBox.info1.text = txtBox.info1.text + ("Price " + towers[unit][tempLvl].price);
}
} else {
txtBox.info1.text = (((("Level - " + (tempLvl + 1)) + newline) + "Damage ") + towers[unit][tempLvl].damage) + newline;
if (towers[unit][tempLvl].spclDmg > 0) {
txtBox.info1.text = txtBox.info1.text + ((((" +" + towers[unit][0].spclType) + " damage ") + towers[unit][tempLvl].spclDmg) + newline);
}
txtBox.info1.text = txtBox.info1.text + (((((((((("Range " + towers[unit][tempLvl].range) + newline) + "Reload ") + towers[unit][tempLvl].delay) + newline) + "TurnSpd ") + towers[unit][tempLvl].turnspd) + newline) + "Price ") + towers[unit][tempLvl].price);
}
if ((towers[unit][tempLvl].ground == true) && (towers[unit][tempLvl].air == true)) {
txtBox.info1.text = txtBox.info1.text + "\nGround/Air";
} else if (towers[unit][tempLvl].air == true) {
txtBox.info1.text = txtBox.info1.text + "\nAir only";
} else if (towers[unit][tempLvl].ground == true) {
txtBox.info1.text = txtBox.info1.text + "\nGround only";
}
if (towers[unit][0].power != undefined) {
power.gotoAndStop(towers[unit][0].power);
power._visible = true;
}
if (towers[unit][0].indicatr != undefined) {
txtBox.indicatr.gotoAndStop(towers[unit][0].indicatr);
txtBox.indicatr._visible = true;
}
}
} else if (extra == "manyTurr") {
tempPow = true;
tempMax = true;
tempLen = placer.selected.length;
i = 0;
while (i < tempLen) {
if (towers[placer.selected[i].turrtype][0].power == undefined) {
tempPow = false;
if (placer.selected[i].level < towers[placer.selected[i].turrtype][0].maxLevel) {
tempMax = false;
}
}
i++;
}
txtBox.title.text = ("Magics (" + tempLen) + ")";
if (tempPow == true) {
txtBox.info1.text = "To upgrade these towers build an upgrader of the same power.";
} else if (tempMax == true) {
txtBox.info1.text = "The selected towers are at max level.";
} else {
txtBox.info1.text = "Upgrading will upgrade as many towers as possible.";
txtBox.upgButtn.labelF = 2;
txtBox.upgButtn.bgF = 1;
txtBox.upgButtn.label.gotoAndStop(2);
txtBox.upgButtn.bg.gotoAndStop(1);
txtBox.upgButtn.gotoAndStop(1);
txtBox.upgButtn._visible = true;
}
} else if (tower == true) {
txtBox.title.text = towers[unit.turrtype][0].dispName;
if (towers[unit.turrtype][0].ability == "energizr") {
txtBox.info1.text = ("\nType " + towers[unit.turrtype][0].indicatr) + "\n \nThis will power towers of its energy type in range.";
txtBox.indicatr.gotoAndStop(towers[unit.turrtype][0].indicatr);
txtBox.indicatr._visible = true;
} else if (towers[unit.turrtype][0].ability == "upgrader") {
tempLvl = spawner.upgrades[towers[unit.turrtype][0].power];
if (unit.level < towers[unit.turrtype][0].maxLevel) {
txtBox.info1.text = "Level - " + (tempLvl + 1);
txtBox.info1.text = txtBox.info1.text + (("\nDuration " + Math.round(towers[unit.turrtype][unit.level + 1].delay / 21)) + "sec");
txtBox.info1.text = txtBox.info1.text + ("\nUpgrade price " + towers[unit.turrtype][unit.level + 1].price);
if (unit.upgradng == false) {
txtBox.upgButtn.label.gotoAndStop(1);
txtBox.upgButtn.labelF = 1;
if (money < towers[unit.turrtype][unit.level + 1].price) {
txtBox.upgButtn.bg.gotoAndStop(2);
txtBox.upgButtn.bgF = 2;
} else {
txtBox.upgButtn.bg.gotoAndStop(1);
txtBox.upgButtn.bgF = 1;
}
txtBox.upgButtn.gotoAndStop(1);
txtBox.upgButtn._visible = true;
} else {
txtBox.upgBar.bar._xscale = (towers[unit.turrtype][0].counter / towers[unit.turrtype][unit.level + 1].delay) * 100;
txtBox.upgBar._visible = true;
}
} else {
txtBox.info1.text = ("Level - " + (tempLvl + 1)) + " max\n";
}
txtBox.info1.text = txtBox.info1.text + ("\nPower " + towers[unit.turrtype][0].power);
txtBox.info1.text = txtBox.info1.text + "\n \nUpgrades towers of same power.";
power.gotoAndStop(towers[unit.turrtype][0].power);
power._visible = true;
if (towers[unit.turrtype][0].indicatr != undefined) {
txtBox.indicatr.gotoAndStop(towers[unit.turrtype][0].indicatr);
txtBox.indicatr._visible = true;
}
} else {
if (towers[unit.turrtype][0].power == undefined) {
tempLvl = unit.level;
} else {
tempLvl = spawner.upgrades[towers[unit.turrtype][0].power];
}
if (unit.level < towers[unit.turrtype][0].maxLevel) {
txtBox.info1.text = (((((("Level - " + (tempLvl + 1)) + newline) + "Damage ") + towers[unit.turrtype][tempLvl].damage) + " -> ") + towers[unit.turrtype][tempLvl + 1].damage) + newline;
if (towers[unit.turrtype][0].spclDmg > 0) {
txtBox.info1.text = txtBox.info1.text + ((((((" +" + towers[unit.turrtype][0].spclType) + " damage ") + towers[unit.turrtype][tempLvl].spclDmg) + " -> ") + towers[unit.turrtype][tempLvl + 1].spclDmg) + newline);
}
txtBox.info1.text = txtBox.info1.text + ((((((((((((("Range " + towers[unit.turrtype][tempLvl].range) + " -> ") + towers[unit.turrtype][tempLvl + 1].range) + newline) + "Reload ") + towers[unit.turrtype][tempLvl].delay) + " -> ") + towers[unit.turrtype][tempLvl + 1].delay) + newline) + "TurnSpd ") + towers[unit.turrtype][tempLvl].turnspd) + " -> ") + towers[unit.turrtype][tempLvl + 1].turnspd);
if ((towers[unit.turrtype][tempLvl].ground == true) && (towers[unit.turrtype][tempLvl].air == true)) {
txtBox.info1.text = txtBox.info1.text + "\nGround/Air";
} else if (towers[unit.turrtype][tempLvl].air == true) {
txtBox.info1.text = txtBox.info1.text + "\nAir only";
} else if (towers[unit.turrtype][tempLvl].ground == true) {
txtBox.info1.text = txtBox.info1.text + "\nGround only";
}
if (towers[unit.turrtype][0].power == undefined) {
txtBox.info1.text = txtBox.info1.text + ("\nUpgrade price " + towers[unit.turrtype][tempLvl + 1].price);
txtBox.upgButtn.label.gotoAndStop(1);
txtBox.upgButtn.labelF = 1;
if (money < towers[unit.turrtype][unit.level + 1].price) {
txtBox.upgButtn.bg.gotoAndStop(2);
txtBox.upgButtn.bgF = 2;
} else {
txtBox.upgButtn.bg.gotoAndStop(1);
txtBox.upgButtn.bgF = 1;
}
txtBox.upgButtn.gotoAndStop(1);
txtBox.upgButtn._visible = true;
} else {
power.gotoAndStop(towers[unit.turrtype][0].power);
power._visible = true;
}
if (towers[unit][0].indicatr != undefined) {
txtBox.indicatr.gotoAndStop(towers[unit.turrtype][0].indicatr);
txtBox.indicatr._visible = true;
}
} else {
txtBox.info1.text = (((("Level - " + (tempLvl + 1)) + " max\n") + "Damage ") + towers[unit.turrtype][tempLvl].damage) + newline;
if (towers[unit.turrtype][0].spclDmg > 0) {
txtBox.info1.text = txtBox.info1.text + ((((" +" + towers[unit.turrtype][0].spclType) + " damage ") + towers[unit.turrtype][tempLvl].spclDmg) + newline);
}
txtBox.info1.text = txtBox.info1.text + ((((((("Range " + towers[unit.turrtype][tempLvl].range) + newline) + "Reload ") + towers[unit.turrtype][tempLvl].delay) + newline) + "TurnSpd ") + towers[unit.turrtype][tempLvl].turnspd);
if ((towers[unit.turrtype][tempLvl].ground == true) && (towers[unit.turrtype][tempLvl].air == true)) {
txtBox.info1.text = txtBox.info1.text + "\nGround/Air";
} else if (towers[unit.turrtype][tempLvl].air == true) {
txtBox.info1.text = txtBox.info1.text + "\nAir only";
} else if (towers[unit.turrtype][tempLvl].ground == true) {
txtBox.info1.text = txtBox.info1.text + "\nGround only";
}
if (towers[unit.turrtype][0].power != undefined) {
power.gotoAndStop(towers[unit.turrtype][0].power);
power._visible = true;
}
}
if (towers[unit.turrtype][0].indicatr != undefined) {
txtBox.indicatr.gotoAndStop(towers[unit.turrtype][0].indicatr);
txtBox.indicatr._visible = true;
}
}
} else {
txtBox.title.text = monsters[unit.unitType].dispName;
txtBox.info1.text = (((((((((((("Health: " + Math.ceil(unit.health)) + newline) + "Armor: ") + Math.ceil(unit.armor)) + newline) + "Speed: ") + unit.speed) + newline) + "Strenght: ") + monsters[unit.unitType].strength) + newline) + "Weakness: ") + monsters[unit.unitType].weakness;
}
if (txtBox.upgButtn._visible == true) {
txtBox.upgButtn._y = (txtBox.info1._y + txtBox.info1._height) + 2;
txtBox.txtBG._height = txtBox.upgButtn._y + 13;
} else {
txtBox.txtBG._height = (txtBox.info1._y + txtBox.info1._height) + 13;
}
if (extra != "dontMove") {
txtBox._x = Math.max(10, Math.min((_global.stageWidth * _global.raster) - (txtBox.txtBG._height + 10), _root._xmouse + 10));
txtBox._y = _root._ymouse - ((txtBox.txtBG._height + 10) * (_root._ymouse / (_global.stageHeight * _global.raster)));
txtBox.timeCnt = 120;
} else {
txtBox.timeCnt = txtBox.timeCnt + 40;
}
txtBox._visible = true;
txtBox.onEnterFrame = function () {
this.timeCnt = this.timeCnt - 1;
if (this.timeCnt <= 0) {
if ((this.nameCnt == undefined) || (this.nameCnt > 300)) {
this.nameCnt = 0;
}
this.tempW = Math.floor(this.txtBG._width / 8);
this.tempH = Math.floor(this.txtBG._height / 8);
this.i = 0;
while (this.i < this.tempW) {
this.j = 0;
while (this.j < this.tempH) {
duplicateMovieClip (this._parent.shrinkL.shrinkB, "shrink" + this.nameCnt, 16 + this.nameCnt);
this._parent.shrinkL["shrink" + this.nameCnt]._x = this._x + (8 * this.i);
this._parent.shrinkL["shrink" + this.nameCnt]._y = this._y + (8 * this.j);
this.nameCnt = this.nameCnt + 1;
this.j++;
}
this.i++;
}
this.tempW = null;
this.tempH = null;
this._visible = false;
this.onEnterFrame = null;
}
};
}
}
_global.fileload = false;
this.lvlNum = 1;
if (_global.th_mode == undefined) {
_global.th_mode = false;
}
goNext = false;
_global.lvlCount = this.lvlNum;
storedL = 0;
_global.precis = 1;
_global.loops = 13;
_global.stageWidth = 28;
_global.stageHeight = 20;
_global.raster = 25;
if ((_global.th_mode != undefined) && (_global.lvlCount == this.lvlNum)) {
tempNum = _global.lvlCount;
while (tempNum > 1) {
tempNum = tempNum - 2;
}
tempNum = 1 - tempNum;
if (tempNum == 0) {
unloadMovie (_parent.mcHull1);
} else {
unloadMovie (_parent.mcHull0);
}
gotoAndStop ("lvl0");
}
Frame 10
gotoAndPlay (1);
Instance of Symbol 451 MovieClip "selField" in Frame 21
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 453 MovieClip "pathfind" in Frame 21
onClipEvent (load) {
if (_global.th_mode != true) {
fields = new Array();
tentpiec = new Array();
tentNum = 0;
if (_global.detail == true) {
tsDetail = "HQ";
} else {
tsDetail = "LQ";
}
i = 0;
j = 0;
i = 0;
while (i < _global.stageWidth) {
fields[i] = new Array();
j = 0;
while (j < _global.stageHeight) {
fields[i][j] = _parent.walls1.hitTest((i * 25) + 12.5, (j * 25) + 12.5, true);
j++;
}
i++;
}
starts = new Array();
starts[0] = new Object();
starts[0].x = Math.round(_parent.start1._x) / 25;
starts[0].y = Math.round(_parent.start1._y) / 25;
if (_parent.start2 != undefined) {
starts[1] = new Object();
starts[1].x = Math.round(_parent.start2._x) / 25;
starts[1].y = Math.round(_parent.start2._y) / 25;
}
finish = new Array();
finish[0] = new Object();
finish[0].x = Math.round(_parent.finish1._x) / 25;
finish[0].y = Math.round(_parent.finish1._y) / 25;
finish[0].outside = true;
if (finish[0].x == -1) {
finish[0].x = 0;
} else if (finish[0].x == _global.stageWidth) {
finish[0].x = _global.stageWidth - 1;
} else if (finish[0].y == -1) {
finish[0].y = 0;
} else if (finish[0].y == _global.stageHeight) {
finish[0].y = _global.stageHeight - 1;
} else {
finish[0].outside = false;
}
if (_parent.finish2 != undefined) {
scndFin = 1;
finish[1] = new Object();
finish[1].x = Math.round(_parent.finish2._x) / 25;
finish[1].y = Math.round(_parent.finish2._y) / 25;
finish[1].outside = true;
if (finish[1].x == -1) {
finish[1].x = 0;
} else if (finish[1].x == _global.stageWidth) {
finish[1].x = _global.stageWidth - 1;
} else if (finish[1].y == -1) {
finish[1].y = 0;
} else if (finish[1].y == _global.stageHeight) {
finish[1].y = _global.stageHeight - 1;
} else {
finish[1].outside = false;
}
} else {
scndFin = 0;
}
fullPath = new Array();
if (_parent.storedL != 1) {
mixUp = 0;
startCh = 0;
ready = false;
failed = false;
search = true;
} else {
recycle = true;
this.fullMove = new Array();
tempLen1 = _parent.storedP.length;
_i = 0;
while (_i < tempLen1) {
this.fullMove[_i] = new Object();
this.fullMove[_i].xPos = new Array();
this.fullMove[_i].yPos = new Array();
this.fullMove[_i].xSpeed = new Array();
this.fullMove[_i].ySpeed = new Array();
tempLen2 = _parent.storedP[_i].xPos.length;
_j = 0;
while (_j < tempLen2) {
this.fullMove[_i].xPos[_j] = _parent.storedP[_i].xPos[_j];
this.fullMove[_i].yPos[_j] = _parent.storedP[_i].yPos[_j];
this.fullMove[_i].xSpeed[_j] = _parent.storedP[_i].xSpeed[_j];
this.fullMove[_i].ySpeed[_j] = _parent.storedP[_i].ySpeed[_j];
_j++;
}
_i++;
}
}
this.onEnterFrame = function () {
if (search == true) {
if (startCh == 0) {
failed = false;
ready = false;
mixUp = 0;
tentNum = 0;
fullPath = new Array();
}
if (startCh == 1) {
mixUp = 2;
}
path1 = new Array();
path1[0] = new Object();
path1[0].x = starts[startCh].x;
path1[0].y = starts[startCh].y;
path1[0].path = (path1[0].x + ",") + path1[0].y;
if (path1[0].x == -1) {
path1[0].x = 0;
path1[0].path = path1[0].path + (((";" + path1[0].x) + ",") + path1[0].y);
path1[0].directn = new Array(false, true, true, true);
} else if (path1[0].x == _global.stageWidth) {
path1[0].x = _global.stageWidth - 1;
path1[0].path = path1[0].path + (((";" + path1[0].x) + ",") + path1[0].y);
path1[0].directn = new Array(true, false, true, true);
} else if (path1[0].y == -1) {
path1[0].y = 0;
path1[0].path = path1[0].path + (((";" + path1[0].x) + ",") + path1[0].y);
path1[0].directn = new Array(true, true, false, true);
} else if (path1[0].y == _global.stageHeight) {
path1[0].y = _global.stageHeight - 1;
path1[0].path = path1[0].path + (((";" + path1[0].x) + ",") + path1[0].y);
path1[0].directn = new Array(true, true, true, false);
} else {
path1[0].directn = new Array(true, true, true, true);
}
xField = new Array();
xField[0] = (path1[0].x + ",") + path1[0].y;
temp = path1.length;
path1Str = "";
toFin = Math.min(startCh, finish.length - 1);
finding = true;
endFound = false;
search = false;
_parent.findscr._visible = true;
}
loops = _global.precis;
while ((finding == true) && (loops > 0)) {
i = 0;
while (i < temp) {
firstChk = true;
j = 0;
while (j < 4) {
faceTo = (mixUp + j) % 4;
if (path1[i].directn[faceTo] == true) {
if (faceTo == 0) {
direct_x = -1;
direct_y = 0;
} else if (faceTo == 1) {
direct_x = 1;
direct_y = 0;
} else if (faceTo == 2) {
direct_x = 0;
direct_y = -1;
} else if (faceTo == 3) {
direct_x = 0;
direct_y = 1;
}
if (((path1[i].x + direct_x) == finish[toFin].x) && ((path1[i].y + direct_y) == finish[toFin].y)) {
fullPath[startCh] = (((path1[i].path + ";") + finish[Math.min(scndFin, startCh)].x) + ",") + finish[Math.min(scndFin, startCh)].y;
j = 4;
goFor = temp;
i = temp;
endFound = true;
finding = false;
} else if (fields[path1[i].x + direct_x][path1[i].y + direct_y] == false) {
fieldNew = true;
fieldFor = ((path1[i].x + direct_x) + ",") + (path1[i].y + direct_y);
temp2 = xField.length - 1;
k = temp2;
while (k > -1) {
if (xField[k] == fieldFor) {
fieldNew = false;
k = -1;
}
k--;
}
if (fieldNew == true) {
xField.push(((path1[i].x + direct_x) + ",") + (path1[i].y + direct_y));
saveTo = path1.length;
path1[saveTo] = new Object();
path1[saveTo].x = path1[i].x + direct_x;
path1[saveTo].y = path1[i].y + direct_y;
path1[saveTo].path = (((path1[i].path + ";") + path1[saveTo].x) + ",") + path1[saveTo].y;
if (faceTo == 0) {
path1[saveTo].directn = new Array(true, false, true, true);
} else if (faceTo == 1) {
path1[saveTo].directn = new Array(false, true, true, true);
} else if (faceTo == 2) {
path1[saveTo].directn = new Array(true, true, true, false);
} else if (faceTo == 3) {
path1[saveTo].directn = new Array(true, true, false, true);
}
}
}
}
j++;
}
mixUp = mixUp + 1;
path1[i].x = null;
path1[i].y = null;
path1[i].directn = null;
path1[i].path = null;
path1[i] = null;
path1.splice(i, 1);
temp = temp - 1;
i = i - 1;
i++;
}
if ((path1.length > 0) && (endFound == false)) {
step = 0;
temp = path1.length;
} else if (startCh < (starts.length - 1)) {
mixUp = 0;
startCh = startCh + 1;
search = true;
} else {
finding = false;
_parent.findscr._visible = false;
if (fullPath.length > 0) {
fullMove = new Array();
cleanup = fullPath.length;
counter = 0;
} else {
failed = true;
ready = true;
}
}
loops = loops - 1;
}
if (counter < cleanup) {
tempARR = fullPath[counter].split(";");
temp = tempARR.length;
tempARR2 = new Array();
if (tentpiec[counter] == undefined) {
tentpiec[counter] = new Array();
tentpiec[counter][0] = new Array();
tentpiec[counter][1] = new Array();
} else {
for (tentMC in tentpiec[counter][0]) {
removeMovieClip(tentMC);
}
for (tentMC in tentpiec[counter][1]) {
removeMovieClip(tentMC);
}
tentpiec[counter][0] = new Array();
tentpiec[counter][1] = new Array();
}
tDirARR = new Array();
i = 0;
while (i < temp) {
tempARR2[i] = tempARR[i].split(",");
tempARR2[i][0] = Number(tempARR2[i][0]);
tempARR2[i][1] = Number(tempARR2[i][1]);
i++;
}
temp = temp - 1;
toGo_x = tempARR2[1][0] - starts[counter].x;
toGo_y = tempARR2[1][1] - starts[counter].y;
newPos = 0;
fullMove[counter] = new Object();
fullMove[counter].xPos = new Array();
fullMove[counter].xPos[newPos] = starts[counter].x;
fullMove[counter].yPos = new Array();
fullMove[counter].yPos[newPos] = starts[counter].y;
fullMove[counter].xSpeed = new Array();
fullMove[counter].xSpeed[newPos] = toGo_x;
fullMove[counter].ySpeed = new Array();
fullMove[counter].ySpeed[newPos] = toGo_y;
newPos = 1;
i = 1;
while (i < temp) {
toGo2_x = tempARR2[i + 1][0] - tempARR2[i][0];
toGo2_y = tempARR2[i + 1][1] - tempARR2[i][1];
if ((tempARR2[i][0] < 10) || (tempARR2[i][1] > 13)) {
if (toGo2_x == toGo_x) {
tempStr = "tsx";
duplicateMovieClip (_parent.frontTL["ts" + tsDetail], tempStr + tentNum, 128 + tentNum);
duplicateMovieClip (_parent.backTL["ts" + tsDetail], tempStr + tentNum, 128 + tentNum);
if (toGo_y == 1) {
tempRot = 0;
} else if (toGo_y == -1) {
tempRot = 180;
} else if (toGo_x == 1) {
tempRot = 90;
} else {
tempRot = 270;
}
} else {
tempStr = "tcx";
duplicateMovieClip (_parent.frontTL["tc" + tsDetail], tempStr + tentNum, 128 + tentNum);
duplicateMovieClip (_parent.backTL["tc" + tsDetail], tempStr + tentNum, 128 + tentNum);
if (toGo_y == 1) {
if (toGo2_x == -1) {
tempRot = 0;
} else {
tempRot = 90;
}
} else if (toGo_y == -1) {
if (toGo2_x == 1) {
tempRot = 180;
} else {
tempRot = 270;
}
} else if (toGo_x == 1) {
if (toGo2_y == 1) {
tempRot = 270;
} else {
tempRot = 0;
}
} else if (toGo2_y == 1) {
tempRot = 180;
} else {
tempRot = 90;
}
}
if (tempRot == 0) {
_tempX = 0;
_tempY = 0;
} else if (tempRot == 90) {
_tempX = 25;
_tempY = 0;
} else if (tempRot == 180) {
_tempX = 25;
_tempY = 25;
} else {
_tempX = 0;
_tempY = 25;
}
_tempNum = tentpiec[counter][0].length;
tentpiec[counter][0][_tempNum] = _parent.frontTL[tempStr + tentNum];
tentpiec[counter][1][_tempNum] = _parent.backTL[tempStr + tentNum];
_i = 0;
while (_i < 2) {
tentpiec[counter][_i][_tempNum]._rotation = tempRot;
tentpiec[counter][_i][_tempNum]._x = (tempARR2[i][0] * 25) + _tempX;
tentpiec[counter][_i][_tempNum]._y = (tempARR2[i][1] * 25) + _tempY;
_i++;
}
tentNum = tentNum + 1;
}
if (toGo2_x != toGo_x) {
fullMove[counter].xPos[newPos] = tempARR2[i][0];
fullMove[counter].yPos[newPos] = tempARR2[i][1];
fullMove[counter].xSpeed[newPos] = toGo2_x;
fullMove[counter].ySpeed[newPos] = toGo2_y;
newPos = newPos + 1;
toGo_x = toGo2_x;
toGo_y = toGo2_y;
}
i++;
}
if ((counter == 0) || (scndFin == 0)) {
fullMove[counter].xPos[newPos] = Math.round(_parent.finish1._x) / 25;
fullMove[counter].yPos[newPos] = Math.round(_parent.finish1._y) / 25;
} else {
fullMove[counter].xPos[newPos] = Math.round(_parent.finish2._x) / 25;
fullMove[counter].yPos[newPos] = Math.round(_parent.finish2._y) / 25;
}
fullMove[counter].xSpeed[newPos] = 0;
fullMove[counter].ySpeed[newPos] = 0;
counter = counter + 1;
if (counter == cleanup) {
if (_parent.storedL != 1) {
_parent.storedL = 1;
_parent.storedP = new Array();
tempLen1 = this.fullMove.length;
_i = 0;
while (_i < tempLen1) {
_parent.storedP[_i] = new Object();
_parent.storedP[_i].xPos = new Array();
_parent.storedP[_i].yPos = new Array();
_parent.storedP[_i].xSpeed = new Array();
_parent.storedP[_i].ySpeed = new Array();
tempLen2 = this.fullMove[_i].xPos.length;
_j = 0;
while (_j < tempLen2) {
_parent.storedP[_i].xPos[_j] = this.fullMove[_i].xPos[_j];
_parent.storedP[_i].yPos[_j] = this.fullMove[_i].yPos[_j];
_parent.storedP[_i].xSpeed[_j] = this.fullMove[_i].xSpeed[_j];
_parent.storedP[_i].ySpeed[_j] = this.fullMove[_i].ySpeed[_j];
_j++;
}
_i++;
}
_parent._parent.storedT = new Array();
tempLen1 = this.tentpiec.length;
_i = 0;
while (_i < tempLen1) {
_parent._parent.storedT[_i] = new Array();
tempLen2 = this.tentpiec[_i][0].length;
_j = 0;
while (_j < tempLen2) {
_parent._parent.storedT[_i][_j] = new Object();
_parent._parent.storedT[_i][_j].x = this.tentpiec[_i][0][_j]._x;
_parent._parent.storedT[_i][_j].y = this.tentpiec[_i][0][_j]._y;
_parent._parent.storedT[_i][_j].rotation = this.tentpiec[_i][0][_j]._rotation;
_parent._parent.storedT[_i][_j].name = String(this.tentpiec[_i][0][_j]._name).slice(0, 2);
_j++;
}
_i++;
}
}
ready = true;
_parent.spawner.run = true;
_parent.gotoAndPlay(_parent._currentframe + 1);
}
}
if (recycle == true) {
tempLen1 = _parent._parent.storedT.length;
counter = 0;
while (counter < tempLen1) {
if (tentpiec[counter] == undefined) {
tentpiec[counter] = new Array();
tentpiec[counter][0] = new Array();
tentpiec[counter][1] = new Array();
} else {
for (tentMC in tentpiec[counter][0]) {
removeMovieClip(tentMC);
}
for (tentMC in tentpiec[counter][1]) {
removeMovieClip(tentMC);
}
tentpiec[counter][0] = new Array();
tentpiec[counter][1] = new Array();
}
tempLen2 = _parent._parent.storedT[counter].length;
i = 0;
while (i < tempLen2) {
tempStr = _parent._parent.storedT[counter][i].name;
duplicateMovieClip (_parent.frontTL[tempStr + tsDetail], (tempStr + "x") + tentNum, 128 + tentNum);
duplicateMovieClip (_parent.backTL[tempStr + tsDetail], (tempStr + "x") + tentNum, 128 + tentNum);
tentpiec[counter][0][i] = _parent.frontTL[(tempStr + "x") + tentNum];
tentpiec[counter][1][i] = _parent.backTL[(tempStr + "x") + tentNum];
_i = 0;
while (_i < 2) {
tentpiec[counter][_i][i]._rotation = _parent._parent.storedT[counter][i].rotation;
tentpiec[counter][_i][i]._x = _parent._parent.storedT[counter][i].x;
tentpiec[counter][_i][i]._y = _parent._parent.storedT[counter][i].y;
_i++;
}
tentNum = tentNum + 1;
i++;
}
counter++;
}
_parent.findscr._visible = false;
recycle = false;
ready = true;
_parent.spawner.run = true;
_parent.gotoAndPlay(_parent._currentframe + 1);
}
};
} else {
_parent.findscr._visible = false;
_parent.gotoAndPlay(_parent._currentframe + 1);
}
}
Instance of Symbol 453 MovieClip "spawner" in Frame 21
onClipEvent (load) {
if (_global.th_mode != true) {
run = false;
runTimer = true;
spwnMon = false;
tList = new Array();
monsters = new Array();
missiles = new Array();
portlDly = new Array();
mnAmount = new Array();
speedLog = new Array();
maxSpeed = 1;
doublNum = 0;
misslNum = 0;
newMon = false;
upgrades = new Array();
upgrades.energy = 0;
upgrders = new Array();
tier = 0;
_parent.level = 0;
_parent.wave = 0;
_global.gameSpd = 1;
_parent.effects = 0;
_parent.money = 30;
_parent.lifes = 11;
_parent.lifesTXT.text = _parent.lifes;
_parent.timer = 0;
_parent.timerTo = _parent.monSet[_parent.level][_parent.wave][0].pause;
lastWave = false;
this.onEnterFrame = function () {
if (run == true) {
if (Number(_parent.moneyTXT.text) != _parent.money) {
if (Number(_parent.moneyTXT.text) < _parent.money) {
_parent.moneyTXT.text = Math.min(_parent.money, Number(_parent.moneyTXT.text) + 3);
} else {
_parent.moneyTXT.text = Math.max(_parent.money, Number(_parent.moneyTXT.text) - 3);
}
}
i = upgrders.length - 1;
while (i >= 0) {
upgrders[i].counter = upgrders[i].counter + (1 * _global.gameSpd);
if (upgrders[i].counter >= _parent.towers[upgrders[i].turrtype][upgrders[i].level + 1].delay) {
_parent.upgBar.gotoAndPlay("levelUp");
upgrders[i].level = upgrders[i].level + 1;
upgrades[upgrders[i].power] = upgrders[i].level;
upgrders[i].upgradng = false;
if (_parent.placer.selected[0] == upgrders[i]) {
_parent.infoText(_parent.placer.selected[0], true, "");
_parent.upgBar._visible = true;
}
j = tList.length - 1;
while (j >= 0) {
if (upgrders[i].power == _parent.towers[tList[j].turrtype][0].power) {
tList[j].level = upgrders[i].level;
if (_parent.placer.selected[0] == tList[j]) {
if (_parent.placer.selected.length == 1) {
_parent.infoText(_parent.placer.selected[0], true, "");
}
}
}
j--;
}
upgrders.splice(i, 1);
} else {
_parent.upgBar.bar._xscale = (upgrders[i].counter / _parent.towers[upgrders[i].turrtype][upgrders[i].level + 1].delay) * 100;
}
i--;
}
if (runTimer == true) {
_parent.timer = _parent.timer + (1 * _global.gameSpd);
_parent.clock.clock_bar._yscale = 100 - ((_parent.timer / _parent.timerTo) * 100);
if (_parent.clock.blocked._visible == true) {
if (_parent.clock.blocked._alpha > 0) {
_parent.clock.blocked._alpha = Math.max(0, _parent.clock.blocked._alpha - 12);
} else {
_parent.clock.blocked._visible = false;
}
}
if (_parent.timer >= _parent.timerTo) {
portlDly[0] = 9999;
mnAmount[0] = _parent.monSet[_parent.level][_parent.wave][0].amount;
if (_parent.monSet[_parent.level][_parent.wave][1] == undefined) {
portals = 1;
mnAmount[1] = 0;
} else {
portals = 2;
portlDly[1] = 9999;
mnAmount[1] = _parent.monSet[_parent.level][_parent.wave][1].amount;
}
spwnMon = true;
runTimer = false;
}
}
if (spwnMon == true) {
if (_parent.clock.blocked._alpha < 100) {
_parent.clock.blocked._visible = true;
_parent.clock.blocked._alpha = Math.min(100, _parent.clock.blocked._alpha + (12 * _global.gameSpd));
}
if ((mnAmount[0] + mnAmount[1]) > 0) {
i = 0;
while (i < portals) {
if (mnAmount[i] > 0) {
portlDly[i] = portlDly[i] + (1 * _global.gameSpd);
if (portlDly[i] > _parent.monSet[_parent.level][_parent.wave][i].spwnDlay) {
unitName = String(_parent.monSet[_parent.level][_parent.wave][i].kind);
temp = monsters.length;
temp3 = _parent.monSet[_parent.level][_parent.wave][i].cluster;
tempFlag = _parent.monSet[_parent.level][_parent.wave][i].keepPos;
j = 0;
while (j < temp3) {
if (_parent.monsters[unitName].air == false) {
duplicateMovieClip (_parent.monLayer[unitName], "mon" + doublNum, 75 + doublNum);
monsters[temp + j] = _parent.monLayer["mon" + doublNum];
} else {
duplicateMovieClip (_parent.monAirL[unitName], "mon" + doublNum, 75 + doublNum);
monsters[temp + j] = _parent.monAirL["mon" + doublNum];
}
if (temp3 == 1) {
monsters[temp + j]._x = (_parent.pathfind.fullMove[i].xPos[0] * 25) + 12.5;
monsters[temp + j]._y = (_parent.pathfind.fullMove[i].yPos[0] * 25) + 12.5;
} else {
if (temp3 > 6) {
if (j < 3) {
tempRad = 3;
tempAng = 120 * j;
} else {
tempRad = 6;
tempAng = ((360 / temp3) * (j - 3)) + 90;
}
} else {
tempRad = 4;
tempAng = ((360 / temp3) * j) + 90;
}
monsters[temp + j]._x = ((_parent.pathfind.fullMove[i].xPos[0] * 25) + 12.5) + (tempRad * Math.sin((tempAng * Math.PI) / 180));
monsters[temp + j]._y = ((_parent.pathfind.fullMove[i].yPos[0] * 25) + 12.5) + (tempRad * Math.cos((tempAng * Math.PI) / 180));
}
if (tempFlag == true) {
monsters[temp + j].keepPosX = tempRad * Math.sin((tempAng * Math.PI) / 180);
monsters[temp + j].keepPosY = tempRad * Math.cos((tempAng * Math.PI) / 180);
} else {
monsters[temp + j].keepPosX = 0;
monsters[temp + j].keepPosY = 0;
}
monsters[temp + j].xSpeed = _parent.pathfind.fullMove[i].xSpeed[0];
monsters[temp + j].ySpeed = _parent.pathfind.fullMove[i].ySpeed[0];
if (monsters[temp + j].xSpeed == -1) {
monsters[temp + j]._rotation = 90;
} else if (monsters[temp + j].xSpeed == 1) {
monsters[temp + j]._rotation = -90;
} else if (monsters[temp + j].ySpeed == 1) {
monsters[temp + j]._rotation = 0;
} else if (monsters[temp + j].ySpeed == -1) {
monsters[temp + j]._rotation = 180;
}
monsters[temp + j].Target = 1;
monsters[temp + j].checkAng = true;
monsters[temp + j].portal = i;
monsters[temp + j].unitType = unitName;
monsters[temp + j].health = _parent.monsters[unitName].health;
monsters[temp + j].speed = _parent.monsters[unitName].speed;
monsters[temp + j].armor = _parent.monsters[unitName].armor;
monsters[temp + j].air = _parent.monsters[unitName].air;
monsters[temp + j].ground = _parent.monsters[unitName].ground;
monsters[temp + j].alive = true;
monsters[temp + j].dead = false;
monsters[temp + j].cntdown = 0;
doublNum = doublNum + 1;
j++;
}
temp2 = speedLog.length;
added = false;
j = 0;
while (j < temp2) {
if (speedLog[j].speed == monsters[temp].speed) {
speedLog[j].amount = speedLog[j].amount + _parent.monSet[_parent.level][_parent.wave][i].cluster;
added = true;
j = temp2;
}
j++;
}
if (added == false) {
speedLog[temp2] = new Object();
speedLog[temp2].speed = monsters[temp].speed;
speedLog[temp2].amount = _parent.monSet[_parent.level][_parent.wave][i].cluster;
temp2 = temp2 + 1;
j = 0;
while (j < temp2) {
if (Math.floor(speedLog[j].speed / _global.precis) > maxSpeed) {
maxSpeed = Math.floor(speedLog[j].speed / _global.precis);
}
j++;
}
}
mnAmount[i] = mnAmount[i] - 1;
portlDly[i] = 0;
newMon = true;
}
}
i++;
}
} else {
_parent.wave = _parent.wave + 1;
_parent.timer = 0;
if (_parent.wave < _parent.monSet[_parent.level].length) {
_parent.timerTo = _parent.monSet[_parent.level][_parent.wave][0].pause;
runTimer = true;
} else {
lastWave = true;
}
spwnMon = false;
}
}
speedUp = 0;
while (speedUp < _global.gameSpd) {
loops = 0;
monLen = monsters.length;
misslLen = missiles.length;
if (monLen > 0) {
turrLen = tList.length;
while (loops < maxSpeed) {
i = 0;
while (i < monLen) {
if ((monsters[i].dead == false) && (monsters[i].alive == true)) {
if (monsters[i].checkAng) {
if (monsters[i].xSpeed == -1) {
monsters[i].checkAng = _parent.rotateTo(monsters[i], 90, (monsters[i].speed * 4) / maxSpeed);
} else if (monsters[i].xSpeed == 1) {
monsters[i].checkAng = _parent.rotateTo(monsters[i], -90, (monsters[i].speed * 4) / maxSpeed);
} else if (monsters[i].ySpeed == 1) {
monsters[i].checkAng = _parent.rotateTo(monsters[i], 0, (monsters[i].speed * 4) / maxSpeed);
} else if (monsters[i].ySpeed == -1) {
monsters[i].checkAng = _parent.rotateTo(monsters[i], 180, (monsters[i].speed * 4) / maxSpeed);
}
}
tempVel = monsters[i].speed / maxSpeed;
monsters[i]._x = monsters[i]._x - (Math.sin((monsters[i]._rotation * Math.PI) / 180) * tempVel);
monsters[i]._y = monsters[i]._y + (Math.cos((monsters[i]._rotation * Math.PI) / 180) * tempVel);
if (monsters[i].xSpeed == -1) {
if ((monsters[i]._x - monsters[i].keepPosX) < ((_parent.pathfind.fullMove[monsters[i].portal].xPos[monsters[i].Target] * 25) + 25)) {
monsters[i].xSpeed = _parent.pathfind.fullMove[monsters[i].portal].xSpeed[monsters[i].Target];
monsters[i].ySpeed = _parent.pathfind.fullMove[monsters[i].portal].ySpeed[monsters[i].Target];
monsters[i].Target = monsters[i].Target + 1;
if (_parent.pathfind.fullMove[monsters[i].portal].xSpeed.length > monsters[i].Target) {
monsters[i].checkAng = true;
if (_parent.pathfind.fullMove[monsters[i].portal].xSpeed.length == monsters[i].Target) {
monsters[i].keepPosX = 0;
monsters[i].keepPosY = 0;
}
} else {
_parent.removeMe(this, i, false);
}
}
} else if (monsters[i].xSpeed == 1) {
if ((monsters[i]._x - monsters[i].keepPosX) > (_parent.pathfind.fullMove[monsters[i].portal].xPos[monsters[i].Target] * 25)) {
monsters[i].xSpeed = _parent.pathfind.fullMove[monsters[i].portal].xSpeed[monsters[i].Target];
monsters[i].ySpeed = _parent.pathfind.fullMove[monsters[i].portal].ySpeed[monsters[i].Target];
monsters[i].Target = monsters[i].Target + 1;
if (_parent.pathfind.fullMove[monsters[i].portal].xSpeed.length > monsters[i].Target) {
monsters[i].checkAng = true;
if (_parent.pathfind.fullMove[monsters[i].portal].xSpeed.length == monsters[i].Target) {
monsters[i].keepPosX = 0;
monsters[i].keepPosY = 0;
}
} else {
_parent.removeMe(this, i, false);
}
}
} else if (monsters[i].ySpeed == -1) {
if ((monsters[i]._y - monsters[i].keepPosY) < ((_parent.pathfind.fullMove[monsters[i].portal].yPos[monsters[i].Target] * 25) + 25)) {
monsters[i].xSpeed = _parent.pathfind.fullMove[monsters[i].portal].xSpeed[monsters[i].Target];
monsters[i].ySpeed = _parent.pathfind.fullMove[monsters[i].portal].ySpeed[monsters[i].Target];
monsters[i].Target = monsters[i].Target + 1;
if (_parent.pathfind.fullMove[monsters[i].portal].xSpeed.length > monsters[i].Target) {
monsters[i].checkAng = true;
if (_parent.pathfind.fullMove[monsters[i].portal].xSpeed.length == monsters[i].Target) {
monsters[i].keepPosX = 0;
monsters[i].keepPosY = 0;
}
} else {
_parent.removeMe(this, i, false);
}
}
} else if (monsters[i].ySpeed == 1) {
if ((monsters[i]._y - monsters[i].keepPosY) > (_parent.pathfind.fullMove[monsters[i].portal].yPos[monsters[i].Target] * 25)) {
monsters[i].xSpeed = _parent.pathfind.fullMove[monsters[i].portal].xSpeed[monsters[i].Target];
monsters[i].ySpeed = _parent.pathfind.fullMove[monsters[i].portal].ySpeed[monsters[i].Target];
monsters[i].Target = monsters[i].Target + 1;
if (_parent.pathfind.fullMove[monsters[i].portal].xSpeed.length > monsters[i].Target) {
monsters[i].checkAng = true;
if (_parent.pathfind.fullMove[monsters[i].portal].xSpeed.length == monsters[i].Target) {
monsters[i].keepPosX = 0;
monsters[i].keepPosY = 0;
}
} else {
_parent.removeMe(this, i, false);
}
}
}
} else if (monsters[i].dead == true) {
_parent.removeMe(this, i, true);
} else {
monsters[i].cntdown = monsters[i].cntdown + (1 / maxSpeed);
if (monsters[i].cntdown > 25) {
monsters[i].dead = true;
}
}
i++;
}
if (misslLen > 0) {
tempObj = new Object();
i = 0;
while (i < misslLen) {
if (missiles[i].aimFor == -1) {
tempObj._x = missiles[i].aimX;
tempObj._y = missiles[i].aimY;
} else {
tempObj._x = monsters[missiles[i].aimFor]._x;
tempObj._y = monsters[missiles[i].aimFor]._y;
}
tempAng = _parent.getAngTo(missiles[i], tempObj);
_parent.rotateTo(missiles[i], tempAng, _parent.towers[missiles[i].turrtype][missiles[i].level].bulltRot / maxSpeed);
tempVel = _parent.towers[missiles[i].turrtype][missiles[i].level].bulltSpd / maxSpeed;
missiles[i]._x = missiles[i]._x - (Math.sin((missiles[i]._rotation * Math.PI) / 180) * tempVel);
missiles[i]._y = missiles[i]._y + (Math.cos((missiles[i]._rotation * Math.PI) / 180) * tempVel);
temp = _parent.getDist(missiles[i], tempObj);
if (temp < 5) {
if (missiles[i].aimFor != -1) {
monsters[missiles[i].aimFor].health = monsters[missiles[i].aimFor].health - Math.max(0.2, (_parent.towers[missiles[i].turrtype][missiles[i].level].damage + ((_parent.towers[missiles[i].turrtype][missiles[i].level].spclDmg * (1 - Number(_parent.towers[missiles[i].turrtype][0].spclType == _parent.monsters[monsters[missiles[i].aimFor].unitType].strength))) * (1 + Number(_parent.towers[missiles[i].turrtype][0].spclType == _parent.monsters[monsters[missiles[i].aimFor].unitType].weakness)))) - monsters[missiles[i].aimFor].armor);
monsters[missiles[i].aimFor].hitspark.gotoAndPlay(2);
if (monsters[missiles[i].aimFor].health <= 0) {
if (monsters[missiles[i].aimFor].health > (-(Math.round(_parent.monsters[monsters[missiles[i].aimFor].unitType].health / 3) + (monsters[missiles[i].aimFor].armor * 3)))) {
if (monsters[missiles[i].aimFor].alive == true) {
monsters[missiles[i].aimFor].alive = false;
monsters[missiles[i].aimFor].gotoAndPlay("ko");
}
} else {
monsters[missiles[i].aimFor].alive = false;
if (monsters[missiles[i].aimFor].dead == false) {
monsters[missiles[i].aimFor].dead = true;
_parent.monfect(monsters[missiles[i].aimFor]);
}
}
}
}
temp = _parent.towers[missiles[i].turrtype][missiles[i].level].splash;
if (temp > 0) {
j = 0;
while (j < monLen) {
if (j != missiles[i].aimFor) {
if (((missiles[i].ground == true) && (monsters[j].ground == true)) || ((missiles[i].air == true) && (monsters[j].air == true))) {
temp3 = _parent.getDist(tempObj, monsters[j]);
if (temp3 < temp) {
if ((temp - Math.floor(temp)) > 0) {
monsters[j].health = monsters[j].health - Math.max(0.2, (_parent.towers[missiles[i].turrtype][missiles[i].level].damage + (((_parent.towers[missiles[i].turrtype][missiles[i].level].spclDmg * (1 - Number(_parent.towers[missiles[i].turrtype][0].spclType == _parent.monsters[monsters[j].unitType].strength))) * (1 + Number(_parent.towers[missiles[i].turrtype][0].spclType == _parent.monsters[monsters[j].unitType].weakness))) * (1 - (temp3 / temp)))) - monsters[j].armor);
} else {
monsters[j].health = monsters[j].health - Math.max(0.2, (_parent.towers[missiles[i].turrtype][missiles[i].level].damage + ((_parent.towers[missiles[i].turrtype][missiles[i].level].spclDmg * (1 - Number(_parent.towers[missiles[i].turrtype][0].spclType == _parent.monsters[monsters[j].unitType].strength))) * (1 + Number(_parent.towers[missiles[i].turrtype][0].spclType == _parent.monsters[monsters[j].unitType].weakness)))) - monsters[j].armor);
}
monsters[j].hitspark.gotoAndPlay(2);
if (monsters[j].health <= 0) {
if (monsters[j].health > (-(Math.round(_parent.monsters[monsters[j].unitType].health / 3) + (monsters[j].armor * 3)))) {
if (monsters[j].alive == true) {
monsters[j].alive = false;
monsters[j].gotoAndPlay("ko");
}
} else {
monsters[j].alive = false;
if (monsters[j].dead == false) {
monsters[j].dead = true;
_parent.monfect(monsters[j]);
}
}
}
}
}
}
j++;
}
}
_parent.removeMi(i);
misslLen = misslLen - 1;
i = i - 1;
}
i++;
}
}
i = 0;
while (i < turrLen) {
if (tList[i].attack != true) {
if (tList[i].active == true) {
if (tList[i].stopload != true) {
tList[i].chargeT = tList[i].chargeT - (1 / maxSpeed);
if (tList[i].chargeT <= 0) {
tList[i].stopload = true;
tList[i].gotoAndPlay("tower");
}
}
}
} else {
if (tList[i].reload < _parent.towers[tList[i].turrtype][tList[i].level].delay) {
tList[i].reload = tList[i].reload + (1 / maxSpeed);
} else if (tList[i].delay < _parent.towers[tList[i].turrtype][tList[i].level].rnddelay) {
tList[i].delay = tList[i].delay + (1 / maxSpeed);
}
if (tList[i].charge > 0) {
if (tList[i].delay >= _parent.towers[tList[i].turrtype][tList[i].level].rnddelay) {
tList[i].charge = tList[i].charge - (1 / maxSpeed);
if ((speedUp == (_global.gameSpd - 1)) && (loops == (maxSpeed - 1))) {
tList[i].charging = true;
tList[i].turrhead.gotoAndStop(50 + Math.round(_parent.towers[tList[i].turrtype][0].chargeT * (tList[i].charge / _parent.towers[tList[i].turrtype][tList[i].level].chargeT)));
}
}
} else if (tList[i].charging == true) {
tList[i].charging = false;
tList[i].turrhead.gotoAndPlay(1);
}
if ((tList[i].myTarget == -1) && (tList[i].myAim == -1)) {
if ((tList[i].cold <= 0) || (newMon == true)) {
smalldist = 9999;
if (monLen == 0) {
tList[i].cold = 9999;
} else {
j = 0;
while (j < monLen) {
if (((_parent.towers[tList[i].turrtype][tList[i].level].ground == true) && (monsters[j].ground == true)) || ((_parent.towers[tList[i].turrtype][tList[i].level].air == true) && (monsters[j].air == true))) {
temp = _parent.getDist(tList[i], monsters[j]) - _parent.monsters[monsters[j].unitType]._size;
if (smalldist > temp) {
smalldist = temp;
temp2 = j;
}
}
j++;
}
if (smalldist != 9999) {
temp = _parent.towers[tList[i].turrtype][tList[i].level].range;
if (smalldist > temp) {
tList[i].cold = Math.min(100, (smalldist - (temp + 1)) / Math.max(0.01, monsters[temp2].speed));
} else {
tList[i].myAim = temp2;
}
}
}
} else {
tList[i].cold = tList[i].cold - (1 / maxSpeed);
}
} else {
if (tList[i].myTarget != -1) {
_tempAim = tList[i].myTarget;
autoSet = false;
} else {
_tempAim = tList[i].myAim;
autoSet = true;
}
if (autoSet == false) {
temp = _parent.getAngTo(tList[i], monsters[_tempAim]);
temp2 = _parent.rotateTo(tList[i].turrhead, temp, _parent.towers[tList[i].turrtype][tList[i].level].turnspd / maxSpeed);
}
if ((_parent.getDist(tList[i], monsters[_tempAim]) - _parent.monsters[monsters[_tempAim].unitType]._size) > _parent.towers[tList[i].turrtype][tList[i].level].range) {
tList[i].myAim = -1;
} else {
if (autoSet == true) {
temp = _parent.getAngTo(tList[i], monsters[_tempAim]);
temp2 = _parent.rotateTo(tList[i].turrhead, temp, _parent.towers[tList[i].turrtype][tList[i].level].turnspd / maxSpeed);
}
if (tList[i].charge >= _parent.towers[tList[i].turrtype][upgrades[_parent.towers[tList[i].turrtype][0].power]].chargeT) {
if (temp2 == false) {
if (tList[i].reload >= _parent.towers[tList[i].turrtype][tList[i].level].delay) {
if (tList[i].delay >= _parent.towers[tList[i].turrtype][tList[i].level].rnddelay) {
tList[i].turrhead.gotoAndPlay("shoot" + tList[i].level);
tList[i].ammo = tList[i].ammo - 1;
if (tList[i].ammo <= 0) {
tList[i].delay = 9999;
tList[i].ammo = _parent.towers[tList[i].turrtype][tList[i].level].rounds;
tList[i].reload = 0;
tList[i].charge = 0;
} else {
tList[i].delay = 0;
}
if (_parent.towers[tList[i].turrtype][0].bullets == undefined) {
monsters[_tempAim].health = monsters[_tempAim].health - Math.max(0.2, (_parent.towers[tList[i].turrtype][tList[i].level].damage + ((_parent.towers[tList[i].turrtype][tList[i].level].spclDmg * (1 - Number(_parent.towers[tList[i].turrtype][0].spclType == _parent.monsters[monsters[_tempAim].unitType].strength))) * (1 + Number(_parent.towers[tList[i].turrtype][0].spclType == _parent.monsters[monsters[_tempAim].unitType].weakness)))) - monsters[_tempAim].armor);
monsters[_tempAim].hitspark.gotoAndPlay(2);
if (monsters[_tempAim].health <= 0) {
if (monsters[_tempAim].health > (-(Math.round(_parent.monsters[monsters[_tempAim].unitType].health / 3) + (monsters[_tempAim].armor * 3)))) {
if (monsters[_tempAim].alive == true) {
monsters[_tempAim].alive = false;
monsters[_tempAim].gotoAndPlay("ko");
}
} else {
monsters[_tempAim].alive = false;
if (monsters[_tempAim].dead == false) {
monsters[_tempAim].dead = true;
_parent.monfect(monsters[_tempAim]);
}
}
}
temp = _parent.towers[tList[i].turrtype][tList[i].level].splash;
if (temp > 0) {
_parent.sparks(monsters[_tempAim]._x, monsters[_tempAim]._y, 25 + (Math.random() * 10), temp);
j = 0;
while (j < monLen) {
if (j != _tempAim) {
if (((_parent.towers[tList[i].turrtype][tList[i].level].ground == true) && (monsters[j].ground == true)) || ((_parent.towers[tList[i].turrtype][tList[i].level].air == true) && (monsters[j].air == true))) {
temp3 = _parent.getDist(monsters[_tempAim], monsters[j]);
if (temp3 < temp) {
if ((temp - Math.floor(temp)) > 0) {
monsters[j].health = monsters[j].health - Math.max(0.2, (_parent.towers[tList[i].turrtype][tList[i].level].damage + (((_parent.towers[tList[i].turrtype][tList[i].level].spclDmg * (1 - Number(_parent.towers[tList[i].turrtype][0].spclType == _parent.monsters[monsters[j].unitType].strength))) * (1 + Number(_parent.towers[tList[i].turrtype][0].spclType == _parent.monsters[monsters[j].unitType].weakness))) * (1 - (temp3 / temp)))) - monsters[j].armor);
} else {
monsters[j].health = monsters[j].health - Math.max(0.2, (_parent.towers[tList[i].turrtype][tList[i].level].damage + ((_parent.towers[tList[i].turrtype][tList[i].level].spclDmg * (1 - Number(_parent.towers[tList[i].turrtype][0].spclType == _parent.monsters[monsters[j].unitType].strength))) * (1 + Number(_parent.towers[tList[i].turrtype][0].spclType == _parent.monsters[monsters[j].unitType].weakness)))) - monsters[j].armor);
}
monsters[j].hitspark.gotoAndPlay(2);
if (monsters[j].health <= 0) {
if (monsters[j].health > (-(Math.round(_parent.monsters[monsters[j].unitType].health / 3) + (monsters[j].armor * 3)))) {
if (monsters[j].alive == true) {
monsters[j].alive = false;
monsters[j].gotoAndPlay("ko");
}
} else {
monsters[j].alive = false;
if (monsters[j].dead == false) {
monsters[j].dead = true;
_parent.monfect(monsters[j]);
}
}
}
}
}
}
j++;
}
} else {
_parent.impactFX(tList[i].turrtype, monsters[_tempAim]._x, monsters[_tempAim]._y);
}
} else {
unitName = _parent.towers[tList[i].turrtype][0].bullets;
temp = missiles.length;
duplicateMovieClip (_parent.bullets[unitName], "bul" + misslNum, 75 + misslNum);
missiles[temp] = _parent.bullets["bul" + misslNum];
missiles[temp].level = tList[i].level;
missiles[temp].turrtype = tList[i].turrtype;
missiles[temp].aimFor = _tempAim;
missiles[temp].ground = _parent.towers[tList[i].turrtype][tList[i].level].ground;
missiles[temp].air = _parent.towers[tList[i].turrtype][tList[i].level].air;
missiles[temp]._x = tList[i]._x - (8 * Math.sin((tList[i].turrhead._rotation * Math.PI) / 180));
missiles[temp]._y = tList[i]._y + (8 * Math.cos((tList[i].turrhead._rotation * Math.PI) / 180));
missiles[temp]._rotation = tList[i].turrhead._rotation;
temp2 = speedLog.length;
added = false;
j = 0;
while (j < temp2) {
if (speedLog[j].speed == Math.floor(_parent.towers[missiles[temp].turrtype][missiles[temp].level].bulltSpd / 3)) {
speedLog[j].amount = speedLog[j].amount + 1;
added = true;
j = temp2;
}
j++;
}
if (added == false) {
speedLog[temp2] = new Object();
speedLog[temp2].speed = Math.floor(_parent.towers[missiles[temp].turrtype][missiles[temp].level].bulltSpd / 3);
speedLog[temp2].amount = 1;
temp2 = temp2 + 1;
j = 0;
while (j < temp2) {
if (Math.floor(speedLog[j].speed / _global.precis) > maxSpeed) {
maxSpeed = Math.floor(speedLog[j].speed / _global.precis);
}
j++;
}
}
misslNum = misslNum + 1;
}
}
}
}
} else {
tList[i].charge = tList[i].charge + (2 / maxSpeed);
if ((speedUp == (_global.gameSpd - 1)) && (loops == (maxSpeed - 1))) {
tList[i].charging = true;
}
}
}
}
}
i++;
}
newMon = false;
loops = loops + 1;
}
} else {
if (misslLen > 0) {
i = misslLen - 1;
while (i > -1) {
_parent.removeMi(i);
i--;
}
}
if (lastWave == true) {
if (_parent.lifes > 0) {
if (_parent.levelWin._visible == false) {
_parent.levelWin._visible = true;
_parent.levelWin.gotoAndPlay("nextLevel");
}
}
}
speedUp = speedUp + 998;
}
speedUp = speedUp + 1;
}
}
};
}
}
Instance of Symbol 474 MovieClip "placer" in Frame 21
onClipEvent (load) {
if (_global.th_mode != true) {
squares = 1;
this.gotoAndStop(1);
outpos = (_global.stageWidth * 25) + 200;
tcounter = 0;
blocked = new Array();
i = 0;
while (i < _global.stageWidth) {
blocked[i] = new Array();
j = 0;
while (j < _global.stageHeight) {
blocked[i][j] = _parent.blocked.hitTest((i * 25) + 12.5, (j * 25) + 12.5, true);
j++;
}
i++;
}
_parent.blocked._visible = false;
activate = new Array();
tSList = new Array();
selected = new Array();
selAttTw = false;
selMon = false;
updDelay = 0;
ringDlay = 0;
MiceInfo = new Object();
MiceInfo.click = false;
MiceInfo.hold = 0;
MiceInfo.startX = -100;
MiceInfo.startY = -100;
MiceInfo.width = 0;
MiceInfo.height = 0;
this.onMouseDown = function () {
if (_parent.placeT == undefined) {
MiceInfo.startX = _parent._xmouse;
MiceInfo.startY = _parent._ymouse;
buttnPos = false;
if ((_parent.txtBox.upgButtn._visible == true) && (_parent.txtBox._visible == true)) {
if ((((MiceInfo.startX > (_parent.txtBox._x + _parent.txtBox.upgButtn._x)) && (MiceInfo.startX < ((_parent.txtBox._x + _parent.txtBox.upgButtn._x) + _parent.txtBox.upgButtn._width))) && (MiceInfo.startY > (_parent.txtBox._y + _parent.txtBox.upgButtn._y))) && (MiceInfo.startY < ((_parent.txtBox._y + _parent.txtBox.upgButtn._y) + _parent.txtBox.upgButtn._height))) {
buttnPos = true;
}
}
if (buttnPos == false) {
_tempX = Math.floor(MiceInfo.startX / 25);
_tempY = Math.floor(MiceInfo.startY / 25);
_found = false;
if (Key.isDown(16) != true) {
_tempLen = tSList.length;
i = 0;
while (i < _tempLen) {
if ((tSList[i].posX == _tempX) && (tSList[i].posY == _tempY)) {
selected = new Array();
_parent.drawHere.clear();
selected.push(tSList[i]);
_parent.infoText(selected[0], true, "");
_parent.drawRect(_parent.drawHere, tSList[i].posX * 25, tSList[i].posY * 25, _parent.towers[tSList[i].turrtype][0].squares * 25, _parent.towers[tSList[i].turrtype][0].squares * 25, 10813646, 14, 10813646, 80);
selMon = false;
selAttTw = false;
_found = true;
if (_parent.towers[tSList[i].turrtype][0].ability == "energizr") {
_temp = Math.ceil(_parent.towers[tSList[i].turrtype][0].range / 25) * 2;
_twidth = _global.stageWidth;
_tempObj = new Object();
j = 0;
while (j < _temp) {
k = 0;
while (k < _temp) {
_tx = tSList[i].posX + (j - Math.ceil(_temp / 2));
_ty = tSList[i].posY + (k - Math.ceil(_temp / 2));
if (_tx >= 0) {
if (_tx <= _twidth) {
if (_ty >= 0) {
if (_ty <= _global.stageHeight) {
if (_parent.pathfind.fields[_tx][_ty] == true) {
if (blocked[_tx][_ty] != true) {
_tempObj._x = (_tx * 25) + 12.5;
_tempObj._y = (_ty * 25) + 12.5;
if (_parent.getDist(tSList[i], _tempObj) < _parent.towers[tSList[i].turrtype][0].range) {
_parent.drawRect(_parent.drawHere, _tx * 25, _ty * 25, 25, 25, 22015, 20, 16777215, 10);
}
}
}
}
}
}
}
k++;
}
j++;
}
}
i = _tempLen;
}
i++;
}
}
if (_found == false) {
_tempLen = _parent.spawner.tList.length;
_tempLe2 = selected.length;
i = 0;
while (i < _tempLen) {
if ((_parent.spawner.tList[i].posX == _tempX) && (_parent.spawner.tList[i].posY == _tempY)) {
newCanon = true;
j = 0;
while (j < _tempLe2) {
if (selected[j] == _parent.spawner.tList[i]) {
newCanon = false;
j = _tempLe2;
}
j++;
}
if (newCanon) {
if ((Key.isDown(16) != true) || (selAttTw == false)) {
selected = new Array();
_parent.drawHere.clear();
_parent.infoText(null, false, "clear");
}
selected.push(_parent.spawner.tList[i]);
if (selected.length == 1) {
_parent.infoText(selected[0], true, "");
} else {
_parent.infoText(null, true, "manyTurr");
}
_parent.drawRect(_parent.drawHere, _parent.spawner.tList[i].posX * 25, _parent.spawner.tList[i].posY * 25, _parent.towers[_parent.spawner.tList[i].turrtype][0].squares * 25, _parent.towers[_parent.spawner.tList[i].turrtype][0].squares * 25, 10813646, 14, 10813646, 80);
}
selMon = false;
selAttTw = true;
_found = true;
i = _tempLen;
}
i++;
}
if (_found == false) {
_tempLen = _parent.spawner.monsters.length;
_minDist = 9999;
tempObj = new Object();
tempObj._x = MiceInfo.startX;
tempObj._y = MiceInfo.startY;
i = 0;
while (i < _tempLen) {
_tempX = _parent.getDist(tempObj, _parent.spawner.monsters[i]);
if (_tempX < _minDist) {
_tempY = i;
_minDist = _tempX;
}
i++;
}
if ((_minDist == 9999) || ((_tempLen > 0) && (_parent.monsters[_parent.spawner.monsters[_tempY].unitType]._size < (_minDist - 2)))) {
selected = new Array();
selAttTw = false;
selMon = false;
_parent.drawHere.clear();
_parent.infoText(null, false, "clear");
} else {
if (selected.length > 0) {
if (selAttTw == true) {
_tempLen = selected.length;
i = 0;
while (i < _tempLen) {
if (((_parent.towers[selected[i].turrtype][selected[i].level].ground == true) && (_parent.spawner.monsters[_tempY].ground == true)) || ((_parent.towers[selected[i].turrtype][selected[i].level].air == true) && (_parent.spawner.monsters[_tempY].air == true))) {
selected[i].myTarget = _tempY;
}
i++;
}
}
} else {
selMon = true;
updDelay = 0;
ringDlay = 0;
selAttTw = false;
selected.push(_parent.spawner.monsters[_tempY]);
_parent.infoText(_parent.spawner.monsters[_tempY], false, "");
}
_found = true;
_parent.spawner.monsters[_tempY].selector.gotoAndPlay(2);
}
if (_found == false) {
MiceInfo.click = true;
}
}
}
}
}
};
this.onMouseUp = function () {
if (_parent.placeT == undefined) {
if (MiceInfo.hold >= 4) {
if (_parent._xmouse < MiceInfo.startX) {
MiceInfo.width = MiceInfo.startX - _parent._xmouse;
MiceInfo.startX = _parent._xmouse;
} else {
MiceInfo.width = _parent._xmouse - MiceInfo.startX;
}
if (_parent._ymouse < MiceInfo.startY) {
MiceInfo.height = MiceInfo.startY - _parent._ymouse;
MiceInfo.startY = _parent._ymouse;
} else {
MiceInfo.height = _parent._ymouse - MiceInfo.startY;
}
_tempLen = _parent.spawner.tList.length;
_tempLe2 = selected.length;
_found = false;
i = 0;
while (i < _tempLen) {
if (_parent.spawner.tList[i]._x > MiceInfo.startX) {
if (_parent.spawner.tList[i]._x < (MiceInfo.startX + MiceInfo.width)) {
if (_parent.spawner.tList[i]._y > MiceInfo.startY) {
if (_parent.spawner.tList[i]._y < (MiceInfo.startY + MiceInfo.height)) {
newCanon = true;
j = 0;
while (j < _tempLe2) {
if (selected[j] == _parent.spawner.tList[i]) {
newCanon = false;
j = _tempLe2;
}
j++;
}
if (newCanon == true) {
if ((Key.isDown(16) != true) && (_found == false)) {
selected = new Array();
_parent.drawHere.clear();
_parent.infoText(null, false, "clear");
}
selMon = false;
selAttTw = true;
_found = true;
selected.push(_parent.spawner.tList[i]);
if (selected.length == 1) {
_parent.infoText(selected[0], true, "");
} else {
_parent.infoText(null, true, "manyTurr");
}
_parent.drawRect(_parent.drawHere, _parent.spawner.tList[i].posX * 25, _parent.spawner.tList[i].posY * 25, _parent.towers[_parent.spawner.tList[i].turrtype][0].squares * 25, _parent.towers[_parent.spawner.tList[i].turrtype][0].squares * 25, 10813646, 14, 10813646, 80);
}
}
}
}
}
i++;
}
if (_found == false) {
_tempLen = _parent.spawner.monsters.length;
i = 0;
while (i < _tempLen) {
if (_parent.spawner.monsters[i]._x > MiceInfo.startX) {
if (_parent.spawner.monsters[i]._x < (MiceInfo.startX + MiceInfo.width)) {
if (_parent.spawner.monsters[i]._y > MiceInfo.startY) {
if (_parent.spawner.monsters[i]._y < (MiceInfo.startY + MiceInfo.height)) {
if (selected.length > 0) {
_tempLe2 = selected.length;
j = 0;
while (j < _tempLe2) {
if (((_parent.towers[selected[j].turrtype][selected[j].level].ground == true) && (_parent.spawner.monsters[i].ground == true)) || ((_parent.towers[selected[j].turrtype][selected[j].level].air == true) && (_parent.spawner.monsters[i].air == true))) {
selected[j].myTarget = i;
}
j++;
}
} else {
selMon = true;
updDelay = 0;
ringDlay = 0;
selAttTw = false;
selected.push(_parent.spawner.monsters[i]);
_parent.infoText(_parent.spawner.monsters[i], false, "");
}
_parent.spawner.monsters[i].selector.gotoAndPlay(2);
i = _tempLen;
_found = true;
}
}
}
}
i++;
}
if (_found == false) {
_tempLen = tSList.length;
i = 0;
while (i < _tempLen) {
if (tSList[i]._x > MiceInfo.startX) {
if (tSList[i]._x < (MiceInfo.startX + MiceInfo.width)) {
if (tSList[i]._y > MiceInfo.startY) {
if (tSList[i]._y < (MiceInfo.startY + MiceInfo.height)) {
selected = new Array();
selAttTw = false;
selMon = false;
_parent.drawHere.clear();
_found = true;
selected.push(tSList[i]);
_parent.infoText(selected[0], true, "");
_parent.drawRect(_parent.drawHere, tSList[i].posX * 25, tSList[i].posY * 25, _parent.towers[tSList[i].turrtype][0].squares * 25, _parent.towers[tSList[i].turrtype][0].squares * 25, 10813646, 14, 10813646, 80);
if (_parent.towers[tSList[i].turrtype][0].ability == "energizr") {
_temp = Math.ceil(_parent.towers[tSList[i].turrtype][0].range / 25) * 2;
_twidth = _global.stageWidth;
_tempObj = new Object();
j = 0;
while (j < _temp) {
k = 0;
while (k < _temp) {
_tx = tSList[i].posX + (j - Math.ceil(_temp / 2));
_ty = tSList[i].posY + (k - Math.ceil(_temp / 2));
if (_tx >= 0) {
if (_tx <= _twidth) {
if (_ty >= 0) {
if (_ty <= _global.stageHeight) {
if (_parent.pathfind.fields[_tx][_ty] == true) {
if (blocked[_tx][_ty] != true) {
_tempObj._x = (_tx * 25) + 12.5;
_tempObj._y = (_ty * 25) + 12.5;
if (_parent.getDist(tSList[i], _tempObj) < _parent.towers[tSList[i].turrtype][0].range) {
_parent.drawRect(_parent.drawHere, _tx * 25, _ty * 25, 25, 25, 22015, 20, 16777215, 10);
}
}
}
}
}
}
}
k++;
}
j++;
}
}
i = _tempLen;
}
}
}
}
i++;
}
if (_found == false) {
selected = new Array();
selAttTw = false;
selMon = false;
_parent.drawHere.clear();
_parent.infoText(null, false, "clear");
}
}
}
}
}
_parent.selField._visible = false;
MiceInfo.click = false;
MiceInfo.hold = 0;
};
Mouse.addListener(MiceInfo.down);
Mouse.addListener(MiceInfo.up);
this.onEnterFrame = function () {
if (_parent.spawner.run == true) {
if (_parent.placeT != undefined) {
if (selected.length > 0) {
selected = new Array();
selAttTw = false;
selMon = false;
_parent.drawMe.clear();
_parent.infoText(null, false, "clear");
}
temp = Math.floor(_parent._xmouse / 25) * 25;
if (temp < (_global.stageWidth * 25)) {
this._x = temp + 12.5;
this._y = (Math.floor(_parent._ymouse / 25) * 25) + 12.5;
if ((this._x != (mouseX + 12.5)) || (this._y != (mouseY + 12.5))) {
mouseX = this._x - 12.5;
mouseY = this._y - 12.5;
if ((_parent.pathfind.fields[mouseX / 25][mouseY / 25] == true) && (blocked[mouseX / 25][mouseY / 25] != true)) {
if (pType == undefined) {
this.gotoAndStop("green" + squares);
} else {
temp2 = tSList.length;
_found = false;
i = 0;
while (i < temp2) {
if (_parent.towers[tSList[i].turrtype][0].ability == "energizr") {
if (_parent.towers[tSList[i].turrtype][0].indicatr == pType) {
if (_parent.getDist(tSList[i], this) < _parent.towers[tSList[i].turrtype][0].range) {
_found = true;
i = temp2;
}
}
}
i++;
}
if (_found) {
this.gotoAndStop("green" + squares);
} else {
this.gotoAndStop("red" + squares);
}
}
} else {
this.gotoAndStop("red" + squares);
}
}
}
} else {
if (this._x < outpos) {
this._x = outpos;
mouseX = -100;
mouseY = -100;
}
if (selected.length > 0) {
if (selAttTw == true) {
if (Key.isDown(32)) {
temp = selected.length;
i = 0;
while (i < temp) {
selected[i].myTarget = -1;
i++;
}
}
} else if (selMon == true) {
if (ringDelay < (16 * _global.precis)) {
ringDelay = ringDelay + 1;
} else {
ringDelay = 0;
selected[0].selector.gotoAndPlay(2);
}
} else if (selected[0].upgradng == true) {
upgBar.bar._xscale = (towers[unit.turrtype][0].counter / towers[selected[0].turrtype][selected[0].level + 1].delay) * 100;
}
}
if (MiceInfo.click == true) {
if (MiceInfo.hold < 4) {
MiceInfo.hold = MiceInfo.hold + 1;
} else {
if (_parent.selField._visible == false) {
_parent.selField._visible = true;
}
tempX = _parent._xmouse - MiceInfo.startX;
tempY = _parent._ymouse - MiceInfo.startY;
if (tempX < 0) {
_parent.selField._width = tempX * -1;
_parent.selField._x = _parent._xmouse;
} else {
_parent.selField._width = tempX;
_parent.selField._x = MiceInfo.startX;
}
if (tempY < 0) {
_parent.selField._height = tempY * -1;
_parent.selField._y = _parent._ymouse;
} else {
_parent.selField._height = tempY;
_parent.selField._y = MiceInfo.startY;
}
}
}
}
}
};
this.onRelease = function () {
if (_parent.pathfind.fields[mouseX / 25][mouseY / 25] == true) {
if (blocked[mouseX / 25][mouseY / 25] != true) {
_found = false;
if (pType == undefined) {
_found = true;
} else {
temp2 = tSList.length;
i = 0;
while (i < temp2) {
if (_parent.towers[tSList[i].turrtype][0].ability == "energizr") {
if (_parent.towers[tSList[i].turrtype][0].indicatr == pType) {
if (_parent.getDist(tSList[i], this) < _parent.towers[tSList[i].turrtype][0].range) {
_found = true;
i = temp2;
}
}
}
i++;
}
}
if (_found == true) {
duplicateMovieClip (_parent.tLayer[_parent.placeT], "newT" + tcounter, 50 + tcounter);
if (_parent.towers[_parent.placeT][0].ability == undefined) {
temp = _parent.spawner.tList.length;
_parent.spawner.tList[temp] = _parent.tLayer["newT" + tcounter];
_parent.spawner.tList[temp].turrtype = _parent.placeT;
if (_parent.towers[_parent.placeT][0].power == undefined) {
_parent.spawner.tList[temp].level = 0;
} else {
_parent.spawner.tList[temp].level = _parent.spawner.upgrades[_parent.towers[_parent.placeT][0].power];
}
_parent.spawner.tList[temp].reload = 9999;
_parent.spawner.tList[temp].ammo = _parent.towers[_parent.placeT][0].rounds;
_parent.spawner.tList[temp].delay = 9999;
_parent.spawner.tList[temp].myTarget = -1;
_parent.spawner.tList[temp].myAim = -1;
_parent.spawner.tList[temp].cold = 0;
_parent.spawner.tList[temp].charging = false;
_parent.spawner.tList[temp].charge = 0;
_parent.spawner.tList[temp]._x = mouseX + 12.5;
_parent.spawner.tList[temp]._y = mouseY + 12.5;
_parent.spawner.tList[temp].posX = mouseX / 25;
_parent.spawner.tList[temp].posY = mouseY / 25;
_parent.spawner.tList[temp].chargeT = _parent.towers.fireStne[0].buildT;
_parent.spawner.tList[temp].gotoAndPlay("placed");
activate.push(_parent.spawner.tList[temp]);
_parent.money = _parent.money - _parent.towers[_parent.placeT][0].price;
tcounter = tcounter + 1;
blocked[mouseX / 25][mouseY / 25] = true;
} else {
temp = tSList.length;
tmpExist = false;
if (_parent.towers[_parent.placeT][0].ability == "upgrader") {
i = 0;
while (i < temp) {
if (_parent.towers[tSList[i].turrtype][0].ability == "upgrader") {
if (_parent.towers[tSList[i].turrtype][0].power == _parent.towers[_parent.placeT][0].power) {
tmpExist = true;
_parent.infoText("Upg2x", true, "error");
i = temp;
}
}
i++;
}
}
if (tmpExist == false) {
tSList[temp] = _parent.tLayer["newT" + tcounter];
tSList[temp].turrtype = _parent.placeT;
if (_parent.towers[_parent.placeT][0].ability == "energizr") {
tSList[temp].indicatr = _parent.towers[_parent.placeT][0].indicatr;
} else if (_parent.towers[_parent.placeT][0].ability == "upgrader") {
tSList[temp].power = _parent.towers[_parent.placeT][0].power;
tSList[temp].counter = 0;
tSList[temp].upgradng = false;
}
tSList[temp]._x = mouseX + 12.5;
tSList[temp]._y = mouseY + 12.5;
tSList[temp].posX = mouseX / 25;
tSList[temp].posY = mouseY / 25;
_parent.money = _parent.money - _parent.towers[_parent.placeT][0].price;
tcounter = tcounter + 1;
blocked[mouseX / 25][mouseY / 25] = true;
}
}
}
}
}
this._x = outpos;
mouseX = -100;
mouseY = -100;
_parent.placeT = undefined;
};
}
}
Instance of Symbol 453 MovieClip "finish1" in Frame 21
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 453 MovieClip "start1" in Frame 21
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 508 MovieClip in Frame 21
onClipEvent (load) {
if (_global.th_mode == true) {
if (_global.detail == true) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
} else {
this._visible = false;
}
}
Instance of Symbol 557 MovieClip "blocked" in Frame 21
onClipEvent (load) {
if (_global.th_mode == true) {
this._visible = false;
_parent.GMText._visible = false;
_parent.lifesTXT._visible = false;
_parent.moneyTXT._visible = false;
_parent.timeSpd._visible = false;
_parent.clock._visible = false;
}
}
Instance of Symbol 561 MovieClip "GameOver" in Frame 21
onClipEvent (load) {
this._visible = false;
this.gotoAndStop(1);
}
Instance of Symbol 575 MovieClip "levelWin" in Frame 21
onClipEvent (load) {
this._visible = false;
this.gotoAndStop(1);
}
Frame 22
Instance of Symbol 586 MovieClip in Frame 22
onClipEvent (load) {
if (_global.detail == true) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
}
Instance of Symbol 589 MovieClip in Frame 22
onClipEvent (load) {
if (_global.detail == true) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
}
Frame 37
temp = pathfind.tentpiec[0][0].length;
j = 0;
while (j < temp) {
pathfind.tentpiec[0][0][j].gotoAndPlay(3);
j++;
}
Frame 40
cumcount = 0;
Instance of Symbol 831 MovieClip "b1" in Frame 55
onClipEvent (load) {
if (_global.th_mode != true) {
this.pic.gotoAndPlay(Math.ceil(Math.random() * 14));
turrType = new Array();
turrType[0] = "fireStne";
turrType[1] = "locked";
turrType[2] = "locked";
} else {
this._visible = false;
_parent.spdBttnL._visible = false;
_parent.spdBttnR._visible = false;
_parent.starl1._visible = false;
_parent.finixx1._visible = false;
}
}
on (release) {
if (_parent.spawner.run == true) {
if (turrType[_parent.spawner.tier] != "locked") {
if (_parent.money >= _parent.towers[turrType[_parent.spawner.tier]][0].price) {
_parent.placer.turrPic.gotoAndStop(turrType[_parent.spawner.tier]);
_parent.placeT = turrType[_parent.spawner.tier];
if (_parent.towers[turrType[_parent.spawner.tier]][0].ability == "energizr") {
_parent.placer.pType = undefined;
} else {
_parent.placer.pType = _parent.towers[turrType[_parent.spawner.tier]][0].indicatr;
}
}
} else {
_parent.placeT = undefined;
}
}
}
on (rollOver) {
if (turrType[_parent.spawner.tier] != "locked") {
if (_parent.placer.selected.length == 0) {
_parent.infoText(turrType[_parent.spawner.tier], true, "menu");
}
}
}
Instance of Symbol 833 MovieClip "spdBttnR" in Frame 55
on (release) {
_global.gameSpd = Math.min(9, _global.gameSpd + 1);
if (_parent.timeSpd.text == "P") {
i = _parent.placer.tSList.length - 1;
while (i >= 0) {
if (_parent.towers[_parent.placer.tSList[i].turrtype][0].ability == "upgrader") {
_parent.placer.tSList[i].play();
} else {
_parent.placer.tSList[i].turrhead.play();
}
i--;
}
i = _parent.spawner.tList.length - 1;
while (i >= 0) {
_parent.spawner.tList[i].turrhead.play();
i--;
}
i = _parent.spawner.monsters.length - 1;
while (i >= 0) {
_parent.spawner.monsters[i].play();
i--;
}
i = _parent.spawner.missiles.length - 1;
while (i >= 0) {
_parent.spawner.missiles[i].play();
i--;
}
}
_parent.timeSpd.text = "x" + _global.gameSpd;
}
Instance of Symbol 833 MovieClip "spdBttnL" in Frame 55
on (release) {
_global.gameSpd = Math.max(0, _global.gameSpd - 1);
if (_global.gameSpd == 0) {
if (_parent.timeSpd.text != "P") {
_parent.timeSpd.text = "P";
i = _parent.placer.tSList.length - 1;
while (i >= 0) {
if (_parent.towers[_parent.placer.tSList[i].turrtype][0].ability == "upgrader") {
_parent.placer.tSList[i].stop();
} else {
_parent.placer.tSList[i].turrhead.stop();
}
i--;
}
i = _parent.spawner.tList.length - 1;
while (i >= 0) {
_parent.spawner.tList[i].turrhead.stop();
i--;
}
i = _parent.spawner.monsters.length - 1;
while (i >= 0) {
_parent.spawner.monsters[i].stop();
i--;
}
i = _parent.spawner.missiles.length - 1;
while (i >= 0) {
_parent.spawner.missiles[i].stop();
i--;
}
}
} else {
_parent.timeSpd.text = "x" + _global.gameSpd;
}
}
Instance of Symbol 882 MovieClip "cumS1" in Frame 58
onClipEvent (load) {
if (this._name == "cumS1") {
this.gotoAndStop(1);
this._visible = false;
}
}
Frame 69
if ((placer.activate.length > 0) || (magic == true)) {
gotoAndPlay("magic" + level);
}
Frame 86
if (goNext == true) {
gotoAndStop ("fScreen");
} else if (cumshot != true) {
gotoAndPlay("loop" + level);
} else {
gotoAndPlay("cumstart" + level);
}
Frame 101
cumshot = false;
if (Math.random() < 0.75) {
duplicateMovieClip (cumS1, "cumX" + cumcount, 100 + cumcount);
cumcount = cumcount + 1;
cumcount = cumcount % 5;
}
Frame 115
if (cumshot == true) {
elvebel.gotoAndPlay("begin1");
gotoAndPlay("cumloop" + level);
} else {
elvebel.gotoAndPlay("out1");
}
Frame 123
if (cumshot != true) {
gotoAndPlay("loop" + level);
} else {
gotoAndPlay("cumstart" + level);
}
Frame 130
if (magic == true) {
magic = false;
} else {
tempLen = placer.activate.length;
if (tempLen > 0) {
i = 0;
while (i < tempLen) {
placer.activate[i].gotoAndPlay("charge");
placer.activate[i].active = true;
i++;
}
placer.activate = new Array();
}
}
Frame 139
gotoAndPlay("mgcoff" + level);
Frame 140
function killMos() {
mosaic_mc[0].onEnterFrame = null;
var _local2 = mosaic_mc.length;
var _local1 = 0;
while (_local1 < _local2) {
removeMovieClip(mosaic_mc[_local1]);
_local1++;
}
mosaic_mc = null;
_local2 = mosaic_bd.length;
_local1 = 0;
while (_local1 < _local2) {
mosaic_bd[_local1].dispose();
_local1++;
}
mosaic_bd = null;
myColorTransform = null;
myBlendMode = null;
myRectangle = null;
clearRect = null;
myMatrix = null;
tempmtx = null;
mosaicRect = null;
alpha_bd.dispose();
alpha_bd = null;
}
function quickMos(_cnum) {
var _local3 = 0;
var _local5 = 0;
var _local4 = 0;
var _local2 = 0;
var _local1;
mosaic_bd[_cnum].copyChannel(alpha_bd, myRectangle, new Point(), 8, 8);
var _local6 = Math.round(mosaic_size * 0.5);
i = 0;
while (i < rasterWidth) {
j = 0;
while (j < rasterHeight) {
_local1 = mosaic_bd[_cnum].getPixel32(i + _local6, j + _local6);
if (_local1 != null) {
if (_local1 != 0) {
_local3 = (_local1 >> 16) & 255;
_local5 = (_local1 >> 8) & 255;
_local4 = _local1 & 255;
_local2 = (_local1 >> 24) & 255;
} else {
_local2 = 0;
}
} else {
_local2 = 0;
}
mosaicRect.x = i;
mosaicRect.y = j;
mosaic_bd[_cnum].fillRect(mosaicRect, Number(((((((("0x" + ((_local2 < 16) ? "0" : "")) + _local2.toString(16)) + ((_local3 < 16) ? "0" : "")) + _local3.toString(16)) + ((_local5 < 16) ? "0" : "")) + _local5.toString(16)) + ((_local4 < 16) ? "0" : "")) + _local4.toString(16)));
j = j + mosaic_size;
}
i = i + mosaic_size;
}
}
function normMos(_cnum) {
var _local7;
var _local3;
var _local4 = 0;
var _local6 = 0;
var _local5 = 0;
var _local2 = 0;
var _local1;
mosaic_bd[_cnum].copyChannel(alpha_bd, myRectangle, new Point(), 8, 8);
i = 0;
while (i < rasterWidth) {
j = 0;
while (j < rasterHeight) {
_local7 = true;
_local3 = true;
mos_w = 0;
while (mos_w < mosaic_size) {
mos_h = 0;
while (mos_h < mosaic_size) {
_local1 = mosaic_bd[_cnum].getPixel32(i + mos_w, j + mos_h);
if (_local1 != null) {
if (_local1 != 0) {
if (_local7) {
_local7 = false;
_local4 = (_local1 >> 16) & 255;
_local6 = (_local1 >> 8) & 255;
_local5 = _local1 & 255;
} else {
_local4 = (((_local1 >> 16) & 255) + _local4) * 0.5;
_local6 = (((_local1 >> 8) & 255) + _local6) * 0.5;
_local5 = ((_local1 & 255) + _local5) * 0.5;
}
if (_local3) {
_local3 = false;
_local2 = (_local1 >> 24) & 255;
} else {
_local2 = (((_local1 >> 24) & 255) + _local2) * 0.5;
}
} else if (_local3) {
_local3 = false;
_local2 = 0;
} else {
_local2 = _local2 * 0.5;
}
} else if (_local3) {
_local3 = false;
_local2 = 0;
} else {
_local2 = _local2 * 0.5;
}
mos_h++;
}
mos_w++;
}
mosaicRect.x = i;
mosaicRect.y = j;
mosaic_bd[_cnum].fillRect(mosaicRect, Number(((((((("0x" + ((_local2 < 16) ? "0" : "")) + _local2.toString(16)) + ((_local4 < 16) ? "0" : "")) + _local4.toString(16)) + ((_local6 < 16) ? "0" : "")) + _local6.toString(16)) + ((_local5 < 16) ? "0" : "")) + _local5.toString(16)));
j = j + mosaic_size;
}
i = i + mosaic_size;
}
}
function prfctMos(_cnum) {
var _local7;
var _local3;
var _local4 = 0;
var _local6 = 0;
var _local5 = 0;
var _local2 = 0;
var _local1 = 0;
i = 0;
while (i < rasterWidth) {
j = 0;
while (j < rasterHeight) {
_local7 = true;
_local3 = true;
mos_w = 0;
while (mos_w < mosaic_size) {
mos_h = 0;
while (mos_h < mosaic_size) {
_local1 = mosaic_bd[_cnum].getPixel(i + mos_w, j + mos_h);
if (_local1 != null) {
if (_local7) {
_local7 = false;
_local4 = (_local1 >> 16) & 255;
_local6 = (_local1 >> 8) & 255;
_local5 = _local1 & 255;
} else {
_local4 = (((_local1 >> 16) & 255) + _local4) * 0.5;
_local6 = (((_local1 >> 8) & 255) + _local6) * 0.5;
_local5 = ((_local1 & 255) + _local5) * 0.5;
}
}
_local1 = (alpha_bd.getPixel32(i + mos_w, j + mos_h) >> 24) & 255;
if (_local1 != null) {
if (_local3) {
_local3 = false;
_local2 = _local1;
} else {
_local2 = (_local1 + _local2) * 0.5;
}
} else if (_local3) {
_local3 = false;
_local2 = 0;
} else {
_local2 = _local2 * 0.5;
}
mos_h++;
}
mos_w++;
}
mosaicRect.x = i;
mosaicRect.y = j;
mosaic_bd[_cnum].fillRect(mosaicRect, Number(((((((("0x" + ((_local2 < 16) ? "0" : "")) + _local2.toString(16)) + ((_local4 < 16) ? "0" : "")) + _local4.toString(16)) + ((_local6 < 16) ? "0" : "")) + _local6.toString(16)) + ((_local5 < 16) ? "0" : "")) + _local5.toString(16)));
j = j + mosaic_size;
}
i = i + mosaic_size;
}
}
function mosaic_resize(new_size) {
mosaic_size = new_size;
mosaicRect.width = new_size;
mosaicRect.height = new_size;
}
if (((mosaic_mc == undefined) && (_global.mosaic_quality > 0)) && (_global.mosaic_quality < 4)) {
var mosaic_size = 6;
var maxMosaic = 1;
var areaX = 170;
var areaY = 140;
var rasterWidth = 0;
var rasterHeight = 0;
var mySmooth = true;
var myColorTransform = (new flash.geom.ColorTransform());
var myBlendMode = "normal";
var myRectangle = (new flash.geom.Rectangle(0, 0, 40, 50));
var clearRect = (new flash.geom.Rectangle(0, 0, areaX, areaY));
var myMatrix = (new flash.geom.Matrix());
var tempmtx = (new flash.geom.Matrix());
var mosaicRect = (new flash.geom.Rectangle(0, 0, mosaic_size, mosaic_size));
var alpha_bd = (new flash.display.BitmapData(areaX, areaY, true, 0));
var mosaic_mc = new Array();
var mosaic_bd = new Array();
i = 0;
while (i < maxMosaic) {
mosaic_bd[i] = new flash.display.BitmapData(areaX, areaY, true, 0);
mosaic_mc[i] = this.createEmptyMovieClip("mosaic_mc" + i, 800 + i);
mosaic_mc[i].attachBitmap(mosaic_bd[i], mosaic_mc[i].getNextHighestDepth());
i++;
}
mosaic_mc[0].onEnterFrame = function () {
var _local3;
_local3 = 0;
while (_local3 < maxMosaic) {
if (this._parent["censor" + _local3] != undefined) {
this._parent["censor" + _local3]._visible = false;
}
mosaic_mc[_local3]._visible = false;
_local3++;
}
_local3 = 0;
while (_local3 < maxMosaic) {
if (this._parent["censor" + _local3] != undefined) {
rasterWidth = Math.ceil(this._parent["censor" + _local3]._width / mosaic_size) * mosaic_size;
rasterHeight = Math.ceil(this._parent["censor" + _local3]._height / mosaic_size) * mosaic_size;
myRectangle.width = rasterWidth;
myRectangle.height = rasterHeight;
mosaic_mc[_local3]._x = Math.round(this._parent["censor" + _local3]._x + ((this._parent["censor" + _local3]._width - rasterWidth) * 0.5));
mosaic_mc[_local3]._y = Math.round(this._parent["censor" + _local3]._y + ((this._parent["censor" + _local3]._height - rasterHeight) * 0.5));
myMatrix.tx = -mosaic_mc[_local3]._x;
myMatrix.ty = -mosaic_mc[_local3]._y;
mosaic_bd[_local3].fillRect(clearRect, 0);
alpha_bd.fillRect(clearRect, 0);
mosaic_bd[_local3].draw(this._parent, myMatrix, myColorTransform, myBlendMode, myRectangle, mySmooth);
tempmtx = this._parent["censor" + _local3].transform.matrix;
tempmtx.tx = 0;
tempmtx.ty = 0;
alpha_bd.draw(this._parent["censor" + _local3], tempmtx, myColorTransform, myBlendMode, myRectangle, mySmooth);
if (_global.mosaic_quality == 3) {
prfctMos(_local3);
} else if (_global.mosaic_quality == 2) {
normMos(_local3);
} else if (_global.mosaic_quality == 1) {
quickMos(_local3);
}
}
_local3++;
}
_local3 = 0;
while (_local3 < maxMosaic) {
if (this._parent["censor" + _local3] != undefined) {
mosaic_mc[_local3]._visible = true;
}
_local3++;
}
};
}
snd_game.stop();
sndGame.stop();
Instance of Symbol 1102 MovieClip in Frame 140
onClipEvent (load) {
_global.contins = 3;
_parent.numTXT.text = _global.contins;
}
Frame 141
gotoAndStop(_currentframe + 2);
Frame 147
gotoAndStop(_currentframe - 2);
Frame 148
snd_game.stop();
sndGame.stop();
Frame 149
gotoAndStop(_currentframe + 2);
Frame 155
gotoAndStop(_currentframe - 2);
Symbol 29 MovieClip Frame 1
temp = Math.ceil(1 + (Math.random() * 5));
this.gotoAndStop(temp);
Symbol 45 MovieClip Frame 22
if (_parent.stopload != true) {
gotoAndPlay ("loadloop");
}
Symbol 45 MovieClip Frame 41
stop();
Symbol 96 MovieClip Frame 14
gotoAndPlay("wait" + _parent.level);
Symbol 96 MovieClip Frame 24
gotoAndPlay("wait" + _parent.level);
Symbol 96 MovieClip Frame 37
gotoAndPlay("wait" + _parent.level);
Symbol 96 MovieClip Frame 47
gotoAndPlay("wait" + _parent.level);
Symbol 96 MovieClip Frame 60
gotoAndPlay("wait" + _parent.level);
Symbol 96 MovieClip Frame 70
gotoAndPlay("wait" + _parent.level);
Symbol 97 MovieClip Frame 9
gotoAndPlay ("loop1");
Symbol 97 MovieClip Frame 16
stop();
Symbol 97 MovieClip Frame 20
attack = true;
stop();
Symbol 130 MovieClip Frame 9
gotoAndPlay("wait" + _parent.level);
Symbol 130 MovieClip Frame 16
gotoAndPlay("wait" + _parent.level);
Symbol 130 MovieClip Frame 21
gotoAndPlay("wait" + _parent.level);
Symbol 130 MovieClip Frame 25
gotoAndPlay("wait" + _parent.level);
Symbol 130 MovieClip Frame 35
gotoAndPlay("wait" + _parent.level);
Symbol 130 MovieClip Frame 41
gotoAndPlay("wait" + _parent.level);
Symbol 131 MovieClip Frame 3
if (this.level == undefined) {
this.turrhead.gotoAndStop(1);
}
Symbol 131 MovieClip Frame 4
stop();
Symbol 167 MovieClip Frame 9
gotoAndPlay("wait" + _parent.level);
Symbol 167 MovieClip Frame 17
gotoAndPlay("wait" + _parent.level);
Symbol 167 MovieClip Frame 25
gotoAndPlay("wait" + _parent.level);
Symbol 167 MovieClip Frame 34
gotoAndPlay("wait" + _parent.level);
Symbol 167 MovieClip Frame 39
gotoAndPlay("wait" + _parent.level);
Symbol 167 MovieClip Frame 44
gotoAndPlay("wait" + _parent.level);
Symbol 168 MovieClip Frame 3
if (this.level == undefined) {
this.turrhead.gotoAndStop(1);
}
Symbol 168 MovieClip Frame 4
stop();
Symbol 202 MovieClip Frame 9
gotoAndPlay("wait" + _parent.level);
Symbol 202 MovieClip Frame 25
gotoAndPlay("wait" + _parent.level);
Symbol 202 MovieClip Frame 33
gotoAndPlay("wait" + _parent.level);
Symbol 202 MovieClip Frame 41
gotoAndPlay("wait" + _parent.level);
Symbol 202 MovieClip Frame 46
gotoAndPlay("wait" + _parent.level);
Symbol 202 MovieClip Frame 62
gotoAndPlay("wait" + _parent.level);
Symbol 203 MovieClip Frame 3
if (this.level == undefined) {
this.turrhead.gotoAndStop(1);
}
Symbol 203 MovieClip Frame 4
stop();
Symbol 223 MovieClip Frame 9
gotoAndPlay("wait" + _parent.level);
Symbol 223 MovieClip Frame 13
gotoAndPlay("wait" + _parent.level);
Symbol 223 MovieClip Frame 18
gotoAndPlay("wait" + _parent.level);
Symbol 223 MovieClip Frame 22
gotoAndPlay("wait" + _parent.level);
Symbol 223 MovieClip Frame 27
gotoAndPlay("wait" + _parent.level);
Symbol 223 MovieClip Frame 30
gotoAndPlay("wait" + _parent.level);
Symbol 224 MovieClip Frame 3
if (this.level == undefined) {
this.turrhead.gotoAndStop(1);
}
Symbol 224 MovieClip Frame 4
stop();
Symbol 250 MovieClip Frame 3
if (this._name == "energizr") {
this.turrhead.gotoAndStop(1);
}
Symbol 250 MovieClip Frame 4
stop();
Symbol 264 MovieClip Frame 9
gotoAndPlay ("wait");
Symbol 264 MovieClip Frame 118
gotoAndPlay ("wait");
Instance of Symbol 264 MovieClip "turrhead" in Symbol 265 MovieClip Frame 1
onClipEvent (load) {
if (_parent._name == "egun") {
this.gotoAndStop(1);
}
}
Symbol 265 MovieClip Frame 3
if (this._name == "egun") {
this.turrhead.gotoAndStop(1);
}
Symbol 265 MovieClip Frame 4
stop();
Symbol 273 MovieClip Frame 12
if (this.upgradng != true) {
gotoAndPlay (1);
}
Symbol 273 MovieClip Frame 79
if (this.upgradng == true) {
gotoAndPlay ("upgrade");
}
Instance of Symbol 97 MovieClip "fireStne" in Symbol 274 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "fireStne") {
this.gotoAndStop(1);
this._visible = false;
}
}
Instance of Symbol 131 MovieClip "rockettw" in Symbol 274 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "rockettw") {
this._visible = false;
}
}
Instance of Symbol 168 MovieClip "shotgun" in Symbol 274 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "shotgun") {
this._visible = false;
}
}
Instance of Symbol 203 MovieClip "snipertw" in Symbol 274 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "snipertw") {
this._visible = false;
}
}
Instance of Symbol 224 MovieClip "poisontw" in Symbol 274 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "poisentw") {
this._visible = false;
}
}
Instance of Symbol 250 MovieClip "energizr" in Symbol 274 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "energizr") {
this._visible = false;
}
}
Instance of Symbol 265 MovieClip "egun" in Symbol 274 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "egun") {
this._visible = false;
}
}
Instance of Symbol 273 MovieClip "upgEnrgy" in Symbol 274 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "upgEnrgy") {
this.gotoAndStop(1);
this._visible = false;
}
}
Symbol 294 MovieClip Frame 17
gotoAndPlay ("loop1");
Symbol 310 MovieClip Frame 15
gotoAndPlay ("loop1");
Instance of Symbol 294 MovieClip "trocket" in Symbol 311 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "trocket") {
this._visible = false;
this.gotoAndStop(1);
}
}
Instance of Symbol 310 MovieClip "emissile" in Symbol 311 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "emissile") {
this._visible = false;
this.gotoAndStop(1);
}
}
Symbol 328 MovieClip Frame 10
removeMovieClip(this);
Symbol 334 MovieClip Frame 6
removeMovieClip(this);
Symbol 343 MovieClip Frame 8
removeMovieClip(this);
Symbol 349 MovieClip Frame 8
removeMovieClip(this);
Symbol 354 MovieClip Frame 5
removeMovieClip(this);
Symbol 360 MovieClip Frame 9
removeMovieClip(this);
Symbol 371 MovieClip Frame 9
removeMovieClip(this);
Symbol 378 MovieClip Frame 10
removeMovieClip(this);
Symbol 385 MovieClip Frame 6
removeMovieClip(this);
Symbol 394 MovieClip Frame 10
removeMovieClip(this);
Instance of Symbol 315 MovieClip "meatpack" in Symbol 395 MovieClip Frame 1
onClipEvent (load) {
if (this._name != "meatpack") {
this.gotoAndStop(Math.ceil(Math.random() * 3));
this.lifespan = 50;
temp = 4 + (Math.random() * 5);
this._rotation = Math.random() * 360;
this.rotForce = 16 - (Math.random() * 32);
this.scale = (this._xscale = (this._yscale = 80 + (Math.random() * 30)));
this._z = 18 + (Math.random() * 12);
this.zForce = 24 + (Math.random() * 20);
} else {
this._visible = false;
}
}
onClipEvent (enterFrame) {
if (this._visible) {
this._rotation = this._rotation + (this.rotForce * _global.gameSpd);
this._x = this._x + (this.xForce * _global.gameSpd);
this._y = this._y + (this.yForce * _global.gameSpd);
this.zForce = this.zForce - (5 * _global.gameSpd);
this._z = this._z + (this.zForce * _global.gameSpd);
if (this._z <= 0) {
if (this.zForce < 0) {
this.xForce = this.xForce * 0.8;
this.yForce = this.yForce * 0.8;
this.rotForce = this.rotForce * 0.8;
this.zForce = this.zForce * -0.95;
}
}
this._xscale = (this._yscale = this.scale + this._z);
this.lifespan = this.lifespan - (1 * _global.gameSpd);
if (this.lifespan <= 0) {
removeMovieClip(this);
}
}
}
Instance of Symbol 317 MovieClip "blood" in Symbol 395 MovieClip Frame 1
onClipEvent (load) {
if (this._name != "blood") {
temp = 4 + (Math.random() * 5);
this.scale = (this._xscale = (this._yscale = 100 + (Math.random() * 60)));
this._z = 18 + (Math.random() * 12);
this.zForce = 18 + (Math.random() * 12);
} else {
this._visible = false;
}
}
onClipEvent (enterFrame) {
if (this._visible) {
if (this._z < 0) {
this._alpha = this._alpha - (6 * _global.gameSpd);
} else {
this._x = this._x + (this.xForce * _global.gameSpd);
this._y = this._y + (this.yForce * _global.gameSpd);
this.zForce = this.zForce - (5 * _global.gameSpd);
this._z = this._z + (this.zForce * _global.gameSpd);
this._xscale = (this._yscale = this.scale + this._z);
}
if (this._alpha <= 0) {
removeMovieClip(this);
}
}
}
Instance of Symbol 328 MovieClip "exploY1" in Symbol 395 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "exploY1") {
this.gotoAndStop(1);
this._visible = false;
} else {
this._rotation = Math.random() * 360;
}
}
Instance of Symbol 334 MovieClip "splatG1" in Symbol 395 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "splatG1") {
this.gotoAndStop(1);
this._visible = false;
} else {
this._rotation = Math.random() * 360;
}
}
Instance of Symbol 343 MovieClip "exploY2" in Symbol 395 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "exploY2") {
this.gotoAndStop(1);
this._visible = false;
} else {
this._rotation = Math.random() * 360;
}
}
Instance of Symbol 349 MovieClip "splashY2" in Symbol 395 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "splashY2") {
this.gotoAndStop(1);
this._visible = false;
}
}
Instance of Symbol 354 MovieClip "sparkY1" in Symbol 395 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "sparkY1") {
this.gotoAndStop(1);
this._visible = false;
} else {
this._rotation = Math.random() * 360;
}
}
Instance of Symbol 360 MovieClip "splashW1" in Symbol 395 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "splashW1") {
this.gotoAndStop(1);
this._visible = false;
} else {
this._rotation = Math.random() * 360;
}
}
Instance of Symbol 371 MovieClip "exploE1" in Symbol 395 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "exploE1") {
this.gotoAndStop(1);
this._visible = false;
} else {
this._rotation = Math.random() * 360;
}
}
Instance of Symbol 378 MovieClip "exploG1" in Symbol 395 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "exploG1") {
this.gotoAndStop(1);
this._visible = false;
} else {
this._rotation = Math.random() * 360;
}
}
Instance of Symbol 385 MovieClip "exploC1" in Symbol 395 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "exploC1") {
this.gotoAndStop(1);
this._visible = false;
} else {
this._rotation = Math.random() * 360;
}
}
Instance of Symbol 394 MovieClip "exploR1" in Symbol 395 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "exploR1") {
this.gotoAndStop(1);
this._visible = false;
} else {
this._rotation = Math.random() * 360;
}
}
Symbol 403 MovieClip Frame 1
stop();
Symbol 421 MovieClip Frame 1
stop();
Instance of Symbol 403 MovieClip "selector" in Symbol 444 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (1);
}
Instance of Symbol 421 MovieClip "hitspark" in Symbol 444 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (1);
}
Symbol 444 MovieClip Frame 11
if (alive == true) {
gotoAndPlay (1);
}
Instance of Symbol 343 MovieClip in Symbol 444 MovieClip Frame 15
onClipEvent (load) {
if (this._name == "exploY2") {
this.gotoAndStop(1);
this._visible = false;
} else {
this._rotation = Math.random() * 360;
}
}
Instance of Symbol 343 MovieClip in Symbol 444 MovieClip Frame 19
onClipEvent (load) {
if (this._name == "exploY2") {
this.gotoAndStop(1);
this._visible = false;
} else {
this._rotation = Math.random() * 360;
}
}
Instance of Symbol 343 MovieClip in Symbol 444 MovieClip Frame 22
onClipEvent (load) {
if (this._name == "exploY2") {
this.gotoAndStop(1);
this._visible = false;
} else {
this._rotation = Math.random() * 360;
}
}
Instance of Symbol 378 MovieClip in Symbol 444 MovieClip Frame 31
onClipEvent (load) {
if (this._name == "exploG1") {
this.gotoAndStop(1);
this._visible = false;
} else {
this._rotation = Math.random() * 360;
}
}
Instance of Symbol 444 MovieClip "flydrone" in Symbol 445 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "flydrone") {
this.gotoAndStop(1);
this._visible = false;
}
}
Instance of Symbol 455 MovieClip "turrPic" in Symbol 474 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (1);
}
Symbol 496 MovieClip Frame 1
stop();
Instance of Symbol 481 MovieClip "bg" in Symbol 496 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent.bgF);
}
Instance of Symbol 495 MovieClip "bg" in Symbol 496 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent.bgF);
}
Symbol 501 MovieClip Frame 1
stop();
Instance of Symbol 481 MovieClip "bg" in Symbol 501 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent.bgF);
}
Instance of Symbol 495 MovieClip "bg" in Symbol 501 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent.bgF);
}
Symbol 506 MovieClip Frame 1
stop();
Instance of Symbol 481 MovieClip "bg" in Symbol 506 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent.bgF);
}
Instance of Symbol 495 MovieClip "bg" in Symbol 506 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent.bgF);
}
Instance of Symbol 496 MovieClip in Symbol 508 MovieClip Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
if (this._currentframe < 4) {
this.gotoAndStop(1);
}
}
on (press) {
this.gotoAndStop(3);
}
on (release) {
if (zoomed) {
zoomed = false;
_parent.btn1._x = (_parent.btn2._x = (this._x = 54.8));
_parent.btn1._y = 64.5;
_parent.btn2._y = 117;
this._y = 190.4;
this._xscale = (this._yscale = (_parent.btn1._xscale = (_parent.btn1._yscale = (_parent.btn2._xscale = (_parent.btn2._yscale = 100)))));
} else {
zoomed = true;
_parent.btn1._x = (_parent.btn2._x = (this._x = 511.6));
_parent.btn1._y = 330;
_parent.btn2._y = 340;
this._y = 349.8;
this._xscale = (this._yscale = (_parent.btn1._xscale = (_parent.btn1._yscale = (_parent.btn2._xscale = (_parent.btn2._yscale = 20)))));
}
}
onClipEvent (load) {
this.bgF = 1;
zoomed = false;
this.gotoAndStop(1);
}
Instance of Symbol 501 MovieClip "btn2" in Symbol 508 MovieClip Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
if (this._currentframe < 4) {
this.gotoAndStop(1);
}
}
on (press) {
this.gotoAndStop(3);
}
on (release) {
this.gotoAndPlay(4);
_parent._parent.magic = true;
}
onClipEvent (load) {
this.gotoAndStop(1);
this.bgF = 1;
}
Instance of Symbol 506 MovieClip "btn1" in Symbol 508 MovieClip Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
if (this._currentframe < 4) {
this.gotoAndStop(1);
}
}
on (press) {
this.gotoAndStop(3);
}
on (release) {
this.gotoAndPlay(4);
_parent._parent.cumshot = true;
}
onClipEvent (load) {
this.gotoAndStop(1);
this.bgF = 1;
}
Instance of Symbol 512 MovieClip "clock_bar" in Symbol 516 MovieClip Frame 1
on (release) {
_parent._parent.timer = 99999 /* 0x01869F */;
}
Instance of Symbol 514 MovieClip "blocked" in Symbol 516 MovieClip Frame 1
onClipEvent (load) {
this.useHandCursor = false;
}
on (release) {
}
Symbol 531 MovieClip Frame 1
stop();
Instance of Symbol 481 MovieClip "bg" in Symbol 531 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent.bgF);
}
Instance of Symbol 530 MovieClip "label" in Symbol 531 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent.labelF);
}
Instance of Symbol 495 MovieClip "bg" in Symbol 531 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent.bgF);
}
Symbol 546 MovieClip Frame 2
stop();
Symbol 546 MovieClip Frame 23
this._visible = false;
Instance of Symbol 531 MovieClip "upgButtn" in Symbol 551 MovieClip Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
if (this._currentframe < 4) {
this.gotoAndStop(1);
}
}
on (press) {
this.gotoAndStop(3);
}
on (release) {
this.gotoAndPlay(4);
temp = _parent._parent.placer.selected.length;
didUpg = 0;
i = 0;
while (i < temp) {
if ((_parent._parent.placer.selected[i].power == undefined) || (_parent._parent.towers[_parent._parent.placer.selected[i].turrtype][0].ability == "upgrader")) {
if (_parent._parent.placer.selected[i].level < _parent._parent.towers[_parent._parent.placer.selected[i].turrtype][0].maxLevel) {
if (_parent._parent.money >= _parent._parent.towers[_parent._parent.placer.selected[i].turrtype][_parent._parent.placer.selected[i].level + 1].price) {
_parent._parent.money = _parent._parent.money - _parent._parent.towers[_parent._parent.placer.selected[i].turrtype][_parent._parent.placer.selected[i].level + 1].price;
if (_parent._parent.towers[_parent._parent.placer.selected[i].turrtype][0].ability == "upgrader") {
_parent._parent.placer.selected[i].counter = 0;
_parent._parent.placer.selected[i].upgradng = true;
_parent._parent.spawner.upgrders.push(_parent._parent.placer.selected[i]);
didUpg = didUpg + 1;
this._visible = false;
} else {
_parent._parent.placer.selected[i].level = _parent._parent.placer.selected[i].level + 1;
didUpg = didUpg + 1;
}
}
}
}
i++;
}
if (temp > 1) {
if (didUpg > 1) {
_parent._parent.txtBox.info1.text = didUpg + " towers have been upgraded.";
}
if (didUpg == 1) {
_parent._parent.txtBox.info1.text = "1 tower has been upgraded.";
}
if (didUpg == 0) {
_parent._parent.txtBox.info1.text = "Not enough money or all towers at max";
}
} else {
if (didUpg == 1) {
_parent._parent.infoText(_parent._parent.placer.selected[0], true, "dontMove");
}
if (didUpg == 0) {
_parent._parent.txtBox.info1.text = "Not enough money.";
}
}
}
onClipEvent (load) {
this.gotoAndStop(1);
this.bgF = 1;
this.labelF = 1;
this._visible = false;
}
Instance of Symbol 546 MovieClip "upgBar" in Symbol 551 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 548 MovieClip "power" in Symbol 551 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(1);
this._visible = false;
}
Instance of Symbol 550 MovieClip "indicatr" in Symbol 551 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(1);
this._visible = false;
}
Symbol 561 MovieClip Frame 11
_parent.gotoAndStop("ggScreen");
Symbol 561 MovieClip Frame 14
_parent.gotoAndStop("ggScreen");
Symbol 561 MovieClip Frame 17
_parent.gotoAndStop("ggScreen");
Symbol 575 MovieClip Frame 52
_parent.goNext = true;
Symbol 575 MovieClip Frame 55
stop();
Symbol 581 MovieClip Frame 11
removeMovieClip(this);
Instance of Symbol 581 MovieClip "shrinkB" in Symbol 582 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "shrinkB") {
this.gotoAndStop(1);
this._visible = false;
}
}
Symbol 616 MovieClip Frame 1
stop();
Instance of Symbol 403 MovieClip "selector" in Symbol 637 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (1);
}
Instance of Symbol 616 MovieClip "hitspark" in Symbol 637 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (1);
}
Symbol 637 MovieClip Frame 11
if (alive == true) {
gotoAndPlay (1);
}
Instance of Symbol 403 MovieClip "selector" in Symbol 658 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (1);
}
Instance of Symbol 616 MovieClip "hitspark" in Symbol 658 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (1);
}
Symbol 658 MovieClip Frame 11
if (alive == true) {
gotoAndPlay (1);
}
Instance of Symbol 637 MovieClip "slime1" in Symbol 659 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "slime1") {
this.gotoAndStop(1);
this._visible = false;
}
}
Instance of Symbol 658 MovieClip "bigslime" in Symbol 659 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "slime1") {
this.gotoAndStop(1);
this._visible = false;
}
}
Symbol 665 MovieClip Frame 2
stop();
Symbol 665 MovieClip Frame 6
stop();
Symbol 671 MovieClip Frame 2
stop();
Symbol 671 MovieClip Frame 6
stop();
Symbol 675 MovieClip Frame 2
stop();
Symbol 675 MovieClip Frame 6
stop();
Symbol 679 MovieClip Frame 2
stop();
Symbol 679 MovieClip Frame 6
stop();
Symbol 818 MovieClip Frame 21
if (Math.random() < 0.8) {
gotoAndPlay (1);
}
Symbol 829 MovieClip Frame 11
stop();
Symbol 830 MovieClip Frame 15
if (_parent._parent.spawner.run == true) {
gotoAndStop(_parent.turrType[_parent._parent.spawner.tier]);
} else {
gotoAndPlay(Math.ceil(Math.random() * 4));
}
Symbol 830 MovieClip Frame 16
stop();
Instance of Symbol 829 MovieClip in Symbol 830 MovieClip Frame 18
onClipEvent (load) {
this._rotation = Math.random() * 360;
}
Instance of Symbol 849 MovieClip in Symbol 850 MovieClip Frame 1
onClipEvent (load) {
if (_parent._parent._rotation == 180) {
this._rotation = 180;
}
this.gotoAndStop(Number(_parent._parent._name.slice(5)));
}
Instance of Symbol 835 MovieClip in Symbol 851 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 851 MovieClip Frame 39
if (_parent.spawner.run != true) {
this.gotoAndPlay(2);
}
Symbol 851 MovieClip Frame 40
stop();
Symbol 851 MovieClip Frame 41
stop();
Symbol 851 MovieClip Frame 42
stop();
Instance of Symbol 860 MovieClip in Symbol 861 MovieClip Frame 1
onClipEvent (load) {
if (_parent._parent._rotation == 180) {
this._rotation = 180;
}
this.gotoAndStop(Number(_parent._parent._name.slice(6)));
}
Instance of Symbol 855 MovieClip in Symbol 862 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 862 MovieClip Frame 39
if (_parent.spawner.run != true) {
this.gotoAndPlay(2);
}
Symbol 862 MovieClip Frame 40
stop();
Symbol 862 MovieClip Frame 41
stop();
Symbol 862 MovieClip Frame 42
stop();
Symbol 882 MovieClip Frame 22
this.removeMovieClip();
Symbol 895 MovieClip Frame 1
gotoAndPlay("slurp" + Math.ceil(Math.random() * 5));
Symbol 895 MovieClip Frame 18
stop();
Symbol 895 MovieClip Frame 32
stop();
Symbol 895 MovieClip Frame 46
stop();
Symbol 895 MovieClip Frame 60
stop();
Symbol 895 MovieClip Frame 74
stop();
Symbol 911 MovieClip Frame 1
if ((_parent.placer.activate.length == 0) && (_parent.magic != true)) {
if (_parent._currentframe < 70) {
if (Math.random() < 0.6) {
_visible = false;
stop();
}
} else {
_visible = false;
stop();
}
} else {
_visible = false;
stop();
}
Symbol 1007 MovieClip Frame 33
stop();
Symbol 1014 MovieClip Frame 1
gotoAndPlay("squish" + Math.ceil(Math.random() * 5));
Symbol 1014 MovieClip Frame 14
stop();
Symbol 1014 MovieClip Frame 26
stop();
Symbol 1014 MovieClip Frame 38
stop();
Symbol 1014 MovieClip Frame 48
stop();
Symbol 1014 MovieClip Frame 61
stop();
Instance of Symbol 1104 MovieClip in Symbol 1114 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent._parent.censor0._x = _x + _parent._x;
_parent._parent.censor0._y = _y + _parent._y;
}
Symbol 1114 MovieClip Frame 18
stop();
Symbol 1120 Button
on (release) {
killMos();
gotoAndStop (1);
}
Symbol 1128 MovieClip Frame 1
if (_global.mosaic_quality == 4) {
_visible = false;
}
Symbol 1131 Button
on (release) {
_global.th_mode = true;
gotoAndStop (1);
}