Frame 36
stop();
var Wave = 0;
var Time = 60;
var Citizens = 12;
var Money = 200;
var Health;
var MoneyInc;
var DefaultSpeed = 4;
var SlowSpeed = 3.5;
var BuildMode;
var Mode = 0;
var numEnemies = 1;
var minSize = 10;
var allowAlpha = true;
var TheTime = 0;
SoundBass = new Sound(Beat_Bass);
SoundBeat = new Sound(Beat_Beat);
SoundChime = new Sound(Beat_Chime);
SoundDX = new Sound(Beat_DX);
SoundBass.attachSound("Beat_Bass");
SoundBeat.attachSound("Beat_Beat");
SoundChime.attachSound("Beat_Chime");
SoundDX.attachSound("Beat_DX");
var Selected;
twrType = new Object();
twrArray = new Array(twrType);
var numTowers = 0;
addTower = new eval (function (X, Y, Mine, Type) {
twrArray[num_towers].X = X;
twrArray[num_towers].Y = Y;
twrArray[num_towers].Mine = Mine;
twrArray[num_towers].Type = Type;
twrArray[num_towers].Level = 1;
_root.numTowers = _root.numTowers + 1;
})();
Instance of Symbol 227 MovieClip in Frame 36
onClipEvent (enterFrame) {
loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
if (loadedbytes >= totalbytes) {
this.nextFrame();
}
}
Frame 37
stop();
Instance of Symbol 262 MovieClip "Path" in Frame 37
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 265 MovieClip "LBL1" in Frame 37
onClipEvent (load) {
var ROUND = Math.round;
var SQRT = Math.sqrt;
var NUM = 1;
}
onClipEvent (enterFrame) {
_x = _root["p" + NUM]._x;
_y = _root["p" + NUM]._y;
this.VAL.text = Math.round(_root["p" + NUM].HP * 10) / 10;
var XDIST = (_x - _root._xmouse);
var YDIST = (_y - _root._ymouse);
_alpha = (100 - ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))));
}
Instance of Symbol 265 MovieClip "LBL2" in Frame 37
onClipEvent (load) {
var ROUND = Math.round;
var SQRT = Math.sqrt;
var NUM = 2;
}
onClipEvent (enterFrame) {
_x = _root["p" + NUM]._x;
_y = _root["p" + NUM]._y;
this.VAL.text = Math.round(_root["p" + NUM].HP * 10) / 10;
var XDIST = (_x - _root._xmouse);
var YDIST = (_y - _root._ymouse);
_alpha = (100 - ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))));
}
Instance of Symbol 265 MovieClip "LBL3" in Frame 37
onClipEvent (load) {
var ROUND = Math.round;
var SQRT = Math.sqrt;
var NUM = 3;
}
onClipEvent (enterFrame) {
_x = _root["p" + NUM]._x;
_y = _root["p" + NUM]._y;
this.VAL.text = Math.round(_root["p" + NUM].HP * 10) / 10;
var XDIST = (_x - _root._xmouse);
var YDIST = (_y - _root._ymouse);
_alpha = (100 - ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))));
}
Instance of Symbol 265 MovieClip "LBL4" in Frame 37
onClipEvent (load) {
var ROUND = Math.round;
var SQRT = Math.sqrt;
var NUM = 4;
}
onClipEvent (enterFrame) {
_x = _root["p" + NUM]._x;
_y = _root["p" + NUM]._y;
this.VAL.text = Math.round(_root["p" + NUM].HP * 10) / 10;
var XDIST = (_x - _root._xmouse);
var YDIST = (_y - _root._ymouse);
_alpha = (100 - ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))));
}
Instance of Symbol 265 MovieClip "LBL6" in Frame 37
onClipEvent (load) {
var ROUND = Math.round;
var SQRT = Math.sqrt;
var NUM = 6;
}
onClipEvent (enterFrame) {
_x = _root["p" + NUM]._x;
_y = _root["p" + NUM]._y;
this.VAL.text = Math.round(_root["p" + NUM].HP * 10) / 10;
var XDIST = (_x - _root._xmouse);
var YDIST = (_y - _root._ymouse);
_alpha = (100 - ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))));
}
Instance of Symbol 265 MovieClip "LBL8" in Frame 37
onClipEvent (load) {
var ROUND = Math.round;
var SQRT = Math.sqrt;
var NUM = 8;
}
onClipEvent (enterFrame) {
_x = _root["p" + NUM]._x;
_y = _root["p" + NUM]._y;
this.VAL.text = Math.round(_root["p" + NUM].HP * 10) / 10;
var XDIST = (_x - _root._xmouse);
var YDIST = (_y - _root._ymouse);
_alpha = (100 - ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))));
}
Instance of Symbol 265 MovieClip "LBL7" in Frame 37
onClipEvent (load) {
var ROUND = Math.round;
var SQRT = Math.sqrt;
var NUM = 7;
}
onClipEvent (enterFrame) {
_x = _root["p" + NUM]._x;
_y = _root["p" + NUM]._y;
this.VAL.text = Math.round(_root["p" + NUM].HP * 10) / 10;
var XDIST = (_x - _root._xmouse);
var YDIST = (_y - _root._ymouse);
_alpha = (100 - ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))));
}
Instance of Symbol 265 MovieClip "LBL5" in Frame 37
onClipEvent (load) {
var ROUND = Math.round;
var SQRT = Math.sqrt;
var NUM = 5;
}
onClipEvent (enterFrame) {
_x = _root["p" + NUM]._x;
_y = _root["p" + NUM]._y;
this.VAL.text = Math.round(_root["p" + NUM].HP * 10) / 10;
var XDIST = (_x - _root._xmouse);
var YDIST = (_y - _root._ymouse);
_alpha = (100 - ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))));
}
Instance of Symbol 265 MovieClip "LBL9" in Frame 37
onClipEvent (load) {
var ROUND = Math.round;
var SQRT = Math.sqrt;
var NUM = 9;
}
onClipEvent (enterFrame) {
_x = _root["p" + NUM]._x;
_y = _root["p" + NUM]._y;
this.VAL.text = Math.round(_root["p" + NUM].HP * 10) / 10;
var XDIST = (_x - _root._xmouse);
var YDIST = (_y - _root._ymouse);
_alpha = (100 - ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))));
}
Instance of Symbol 265 MovieClip "LBL10" in Frame 37
onClipEvent (load) {
var ROUND = Math.round;
var SQRT = Math.sqrt;
var NUM = 10;
}
onClipEvent (enterFrame) {
_x = _root["p" + NUM]._x;
_y = _root["p" + NUM]._y;
this.VAL.text = Math.round(_root["p" + NUM].HP * 10) / 10;
var XDIST = (_x - _root._xmouse);
var YDIST = (_y - _root._ymouse);
_alpha = (100 - ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))));
}
Frame 38
var k = 0;
var s = 0;
var g = 0;
_root.Path._visible = true;
Effect_Cash = function (Cash, X, Y) {
k++;
s = k + 2;
while ((_root["TWR" + (k + 100)] != null) || (_root["TWR" + (s + 10000)] != null)) {
k++;
s = k + 2;
}
_root.attachMovie("Effect_Dust", "dust" + k, k + 100);
_root["dust" + k]._x = X;
_root["dust" + k]._y = Y;
_root.attachMovie("Effect_PlusMoney", "cash" + s, s + 10000);
_root["cash" + s]._x = X;
_root["cash" + s]._y = Y;
_root["cash" + s].Cash = Cash;
};
Effect_Grass = function (X, Y) {
while (_root["TWR" + (g + 20000)] != null) {
g++;
}
_root.attachMovie("Particle_Grass", "grass" + g, g + 20000);
_root["grass" + g]._x = X;
_root["grass" + g]._y = Y;
};
Effect_Poof = function (X, Y) {
var _local2;
while (_root["TWR" + (_local2 + 10000)] != null) {
_local2++;
}
_root.attachMovie("Effect_Dust", "dust" + _local2, _local2 + 10000);
_root["dust" + _local2]._x = X;
_root["dust" + _local2]._y = Y;
};
Effect_Z = function (X, Y, k) {
_root.attachMovie("Particle_Z", "dust" + k, k + 10000);
_root["dust" + k]._x = X;
_root["dust" + k]._y = Y;
};
stop();
Instance of Symbol 305 MovieClip "Box" in Frame 38
onClipEvent (load) {
gotoAndStop (1);
_visible = false;
}
Instance of Symbol 385 MovieClip "MENU" in Frame 38
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 387 MovieClip "SelBox" in Frame 38
onClipEvent (load) {
var Depth;
var DepthAdd = 0;
var Open = true;
var tr;
_visible = false;
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var SQRT = Math.sqrt;
getDist = function () {
var _local2 = xx - _root._xmouse;
var _local3 = yy - _root._ymouse;
if (ROUND(SQRT((_local2 * _local2) + (_local3 * _local3))) < 30) {
Open = false;
}
};
getDist2 = function () {
var _local2 = point_1_x - _root._xmouse;
var _local3 = point_1_y - _root._ymouse;
if (ROUND(SQRT((_local2 * _local2) + (_local3 * _local3))) < 30) {
Open = false;
}
};
}
onClipEvent (mouseMove) {
if (_root.BuildMode == true) {
_visible = true;
_x = _root._xmouse;
_y = _root._ymouse;
}
}
onClipEvent (mouseUp) {
Open = true;
}
onClipEvent (mouseDown) {
Depth = (_root._xmouse * _root._ymouse) + DepthAdd;
if (_root.BuildMode == true) {
if ((((_root._xmouse > 15) && (_root._xmouse < 785)) && (_root._ymouse > 15)) && (_root._ymouse < 585)) {
n = 1;
while (n < _root.numPts) {
var point_1_x = _root.Path["cp" + n]._x;
var point_1_y = _root.Path["cp" + n]._y;
var point_2_x = _root.Path["cp" + (n + 1)]._x;
var point_2_y = _root.Path["cp" + (n + 1)]._y;
var m1 = ((point_2_y - point_1_y) / (point_2_x - point_1_x));
var m2 = (-1 / m1);
var x1 = point_1_x;
var y1 = point_1_y;
var x2 = _x;
var y2 = _y;
var xx = ((((((-m2) * x2) + y2) + (m1 * x1)) - y1) / (m1 - m2));
var yy = ((m1 * (xx - x1)) + y1);
getDist2();
if (((point_1_x <= xx) && (xx <= point_2_x)) || ((point_1_x >= xx) && (xx >= point_2_x))) {
getDist();
}
n++;
}
t = 0;
while (t < _root.numTowers) {
tr = _root.twrArray[t];
var XDIST = (_root["twr" + tr]._x - _root._xmouse);
var YDIST = (_root["twr" + tr]._y - _root._ymouse);
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) < 30) {
Open = false;
}
t++;
}
if (Open == true) {
if (_root["twr" + Depth] == null) {
if (_root.Selected < 13) {
_root.attachMovie(_root.Selected + "_TWR", "twr" + Depth, Depth);
_root["twr" + Depth]._x = _root._xmouse;
_root["twr" + Depth]._y = _root._ymouse;
if (_root.Selected == 1) {
_root.Money = _root.Money - 50;
} else if (_root.Selected == 2) {
_root.Money = _root.Money - 30;
} else if (_root.Selected == 3) {
_root.Money = _root.Money - 50;
} else if (_root.Selected == 4) {
_root.Money = _root.Money - 30;
} else if (_root.Selected == 5) {
_root.Money = _root.Money - 3000;
} else if (_root.Selected == 6) {
_root.Money = _root.Money - 1000;
} else if (_root.Selected == 7) {
_root.Money = _root.Money - 800;
} else if (_root.Selected == 8) {
_root.Money = _root.Money - 7000;
} else if (_root.Selected == 9) {
_root.Money = _root.Money - 800;
} else if (_root.Selected == 10) {
_root.Money = _root.Money - 400;
} else if (_root.Selected == 11) {
_root.Money = _root.Money - 500;
} else if (_root.Selected == 12) {
_root.Money = _root.Money - 300000000;
} else if (_root.Selected == 13) {
_root.txtMsg.text = "Can't Build There -- Please Build Mines on the Path";
} else if (_root.Selected == 14) {
_root.txtMsg.text = "Can't Build There -- Please Build Mines on the Path";
} else if (_root.Selected == 15) {
_root.txtMsg.text = "Can't Build There -- Please Build Mines on the Path";
}
_root.twrArray[_root.numTowers] = Depth;
_root.BuildMode = false;
_root.numTowers++;
_visible = false;
_root.Effect_Grass(_root._xmouse, _root._ymouse);
_x = 805;
_y = 565;
}
} else {
DepthAdd++;
mouseDown();
}
_root.txtMsg.text = "";
} else if (_root["twr" + Depth] == null) {
if (_root.Selected >= 13) {
_root.attachMovie(_root.Selected + "_TWR", "twr" + Depth, Depth);
_root["twr" + Depth]._x = _root._xmouse;
_root["twr" + Depth]._y = _root._ymouse;
if (_root.Selected == 13) {
_root.Money = _root.Money - 10;
} else if (_root.Selected == 14) {
_root.Money = _root.Money - 80;
} else if (_root.Selected == 15) {
_root.Money = _root.Money - 500;
} else {
_root.txtMsg.text = "Can't Build There -- Please Build Towers on the Grass";
}
_root.twrArray[_root.numTowers] = Depth;
_root.BuildMode = false;
_root.numTowers++;
_visible = false;
_root.Effect_Grass(_root._xmouse, _root._ymouse);
_x = 805;
_y = 565;
}
} else {
DepthAdd++;
mouseDown();
}
}
}
}
Instance of Symbol 424 MovieClip "p1" in Frame 38
onClipEvent (load) {
var LIFETIME = 0;
var SLOW_END = 0;
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_alpha = 100;
var initX = _x;
var initY = _y;
var targetCP = 0;
var active = false;
var HP = _root.Health;
var speed = 0;
var REG_speed = _root.DefaultSpeed;
var SLOW_speed = _root.SlowSpeed;
var i = 0;
var m = 10;
var Boss = false;
Death = function () {
LIFETIME = 0;
SLOW_END = 0;
_root.Effect_Cash(Math.round(_root.DeathMoney), _x, _y);
_x = initX;
_y = initY;
HP = _root.Health;
targetCP = 0;
active = false;
_alpha = 100;
_root.Money = _root.Money + Math.round(_root.DeathMoney);
this.gotoAndStop(Math.ceil(_root.Wave / 7));
};
}
onClipEvent (enterFrame) {
if (active == true) {
x = ROUND(_root.Path["cp" + targetCP]._x - _x);
y = ROUND(_root.Path["cp" + targetCP]._y - _y) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
if (LIFETIME >= SLOW_END) {
speed = REG_speed;
SLOW_END = 0;
} else {
if (i > 5) {
while (_root["TWR" + m] != null) {
m++;
}
_root.Effect_Z(_x, _y, m);
m++;
i = 0;
} else {
i++;
}
speed = SLOW_speed;
}
_x = (_x + (SIN((_rotation + 90) * PIE) * speed));
_y = (_y + ((COS((_rotation + 90) * PIE) * speed) * -1));
var XDIST = (_root.Path["cp" + targetCP]._x - _x);
var YDIST = (_root.Path["cp" + targetCP]._y - _y);
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) <= speed) {
_x = _root.Path["cp" + targetCP]._x;
_y = _root.Path["cp" + targetCP]._y;
if (targetCP == 0) {
_x = _root.Path.cp1._x;
_y = _root.Path.cp1._y;
targetCP++;
}
targetCP++;
}
if (targetCP > _root.numPts) {
this.gotoAndStop(Math.ceil(_root.Wave / 7));
_x = initX;
_y = initY;
_root.Citizens = _root.Citizens - 1;
if (_root.Citizens <= 0) {
_root.play();
}
HP = _root.Health;
targetCP = 0;
active = false;
}
}
}
Instance of Symbol 424 MovieClip "p2" in Frame 38
onClipEvent (load) {
var LIFETIME = 0;
var SLOW_END = 0;
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_alpha = 100;
var initX = _x;
var initY = _y;
var targetCP = 0;
var active = false;
var HP = _root.Health;
var speed = 0;
var REG_speed = _root.DefaultSpeed;
var SLOW_speed = _root.SlowSpeed;
var i = 0;
var m = 10;
var Boss = false;
Death = function () {
LIFETIME = 0;
SLOW_END = 0;
_root.Effect_Cash(Math.round(_root.DeathMoney), _x, _y);
_x = initX;
_y = initY;
HP = _root.Health;
targetCP = 0;
active = false;
_alpha = 100;
_root.Money = _root.Money + Math.round(_root.DeathMoney);
this.gotoAndStop(Math.ceil(_root.Wave / 7));
};
}
onClipEvent (enterFrame) {
if (active == true) {
x = ROUND(_root.Path["cp" + targetCP]._x - _x);
y = ROUND(_root.Path["cp" + targetCP]._y - _y) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
if (LIFETIME >= SLOW_END) {
speed = REG_speed;
SLOW_END = 0;
} else {
if (i > 5) {
while (_root["TWR" + m] != null) {
m++;
}
_root.Effect_Z(_x, _y, m);
m++;
i = 0;
} else {
i++;
}
speed = SLOW_speed;
}
_x = (_x + (SIN((_rotation + 90) * PIE) * speed));
_y = (_y + ((COS((_rotation + 90) * PIE) * speed) * -1));
var XDIST = (_root.Path["cp" + targetCP]._x - _x);
var YDIST = (_root.Path["cp" + targetCP]._y - _y);
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) <= speed) {
_x = _root.Path["cp" + targetCP]._x;
_y = _root.Path["cp" + targetCP]._y;
if (targetCP == 0) {
_x = _root.Path.cp1._x;
_y = _root.Path.cp1._y;
targetCP++;
}
targetCP++;
}
if (targetCP > _root.numPts) {
this.gotoAndStop(Math.ceil(_root.Wave / 7));
_x = initX;
_y = initY;
_root.Citizens = _root.Citizens - 1;
if (_root.Citizens <= 0) {
_root.play();
}
HP = _root.Health;
targetCP = 0;
active = false;
}
}
}
Instance of Symbol 424 MovieClip "p3" in Frame 38
onClipEvent (load) {
var LIFETIME = 0;
var SLOW_END = 0;
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_alpha = 100;
var initX = _x;
var initY = _y;
var targetCP = 0;
var active = false;
var HP = _root.Health;
var speed = 0;
var REG_speed = _root.DefaultSpeed;
var SLOW_speed = _root.SlowSpeed;
var i = 0;
var m = 10;
var Boss = false;
Death = function () {
LIFETIME = 0;
SLOW_END = 0;
_root.Effect_Cash(Math.round(_root.DeathMoney), _x, _y);
_x = initX;
_y = initY;
HP = _root.Health;
targetCP = 0;
active = false;
_alpha = 100;
_root.Money = _root.Money + Math.round(_root.DeathMoney);
this.gotoAndStop(Math.ceil(_root.Wave / 7));
};
}
onClipEvent (enterFrame) {
if (active == true) {
x = ROUND(_root.Path["cp" + targetCP]._x - _x);
y = ROUND(_root.Path["cp" + targetCP]._y - _y) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
if (LIFETIME >= SLOW_END) {
speed = REG_speed;
SLOW_END = 0;
} else {
if (i > 5) {
while (_root["TWR" + m] != null) {
m++;
}
_root.Effect_Z(_x, _y, m);
m++;
i = 0;
} else {
i++;
}
speed = SLOW_speed;
}
_x = (_x + (SIN((_rotation + 90) * PIE) * speed));
_y = (_y + ((COS((_rotation + 90) * PIE) * speed) * -1));
var XDIST = (_root.Path["cp" + targetCP]._x - _x);
var YDIST = (_root.Path["cp" + targetCP]._y - _y);
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) <= speed) {
_x = _root.Path["cp" + targetCP]._x;
_y = _root.Path["cp" + targetCP]._y;
if (targetCP == 0) {
_x = _root.Path.cp1._x;
_y = _root.Path.cp1._y;
targetCP++;
}
targetCP++;
}
if (targetCP > _root.numPts) {
this.gotoAndStop(Math.ceil(_root.Wave / 7));
_x = initX;
_y = initY;
_root.Citizens = _root.Citizens - 1;
if (_root.Citizens <= 0) {
_root.play();
}
HP = _root.Health;
targetCP = 0;
active = false;
}
}
}
Instance of Symbol 424 MovieClip "p4" in Frame 38
onClipEvent (load) {
var LIFETIME = 0;
var SLOW_END = 0;
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_alpha = 100;
var initX = _x;
var initY = _y;
var targetCP = 0;
var active = false;
var HP = _root.Health;
var speed = 0;
var REG_speed = _root.DefaultSpeed;
var SLOW_speed = _root.SlowSpeed;
var i = 0;
var m = 10;
var Boss = false;
Death = function () {
LIFETIME = 0;
SLOW_END = 0;
_root.Effect_Cash(Math.round(_root.DeathMoney), _x, _y);
_x = initX;
_y = initY;
HP = _root.Health;
targetCP = 0;
active = false;
_alpha = 100;
_root.Money = _root.Money + Math.round(_root.DeathMoney);
this.gotoAndStop(Math.ceil(_root.Wave / 7));
};
}
onClipEvent (enterFrame) {
if (active == true) {
x = ROUND(_root.Path["cp" + targetCP]._x - _x);
y = ROUND(_root.Path["cp" + targetCP]._y - _y) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
if (LIFETIME >= SLOW_END) {
speed = REG_speed;
SLOW_END = 0;
} else {
if (i > 5) {
while (_root["TWR" + m] != null) {
m++;
}
_root.Effect_Z(_x, _y, m);
m++;
i = 0;
} else {
i++;
}
speed = SLOW_speed;
}
_x = (_x + (SIN((_rotation + 90) * PIE) * speed));
_y = (_y + ((COS((_rotation + 90) * PIE) * speed) * -1));
var XDIST = (_root.Path["cp" + targetCP]._x - _x);
var YDIST = (_root.Path["cp" + targetCP]._y - _y);
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) <= speed) {
_x = _root.Path["cp" + targetCP]._x;
_y = _root.Path["cp" + targetCP]._y;
if (targetCP == 0) {
_x = _root.Path.cp1._x;
_y = _root.Path.cp1._y;
targetCP++;
}
targetCP++;
}
if (targetCP > _root.numPts) {
this.gotoAndStop(Math.ceil(_root.Wave / 7));
_x = initX;
_y = initY;
_root.Citizens = _root.Citizens - 1;
if (_root.Citizens <= 0) {
_root.play();
}
HP = _root.Health;
targetCP = 0;
active = false;
}
}
}
Instance of Symbol 424 MovieClip "p5" in Frame 38
onClipEvent (load) {
var LIFETIME = 0;
var SLOW_END = 0;
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_alpha = 100;
var initX = _x;
var initY = _y;
var targetCP = 0;
var active = false;
var HP = _root.Health;
var speed = 0;
var REG_speed = _root.DefaultSpeed;
var SLOW_speed = _root.SlowSpeed;
var i = 0;
var m = 10;
var Boss = false;
Death = function () {
LIFETIME = 0;
SLOW_END = 0;
_root.Effect_Cash(Math.round(_root.DeathMoney), _x, _y);
_x = initX;
_y = initY;
HP = _root.Health;
targetCP = 0;
active = false;
_alpha = 100;
_root.Money = _root.Money + Math.round(_root.DeathMoney);
this.gotoAndStop(Math.ceil(_root.Wave / 7));
};
}
onClipEvent (enterFrame) {
if (active == true) {
x = ROUND(_root.Path["cp" + targetCP]._x - _x);
y = ROUND(_root.Path["cp" + targetCP]._y - _y) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
if (LIFETIME >= SLOW_END) {
speed = REG_speed;
SLOW_END = 0;
} else {
if (i > 5) {
while (_root["TWR" + m] != null) {
m++;
}
_root.Effect_Z(_x, _y, m);
m++;
i = 0;
} else {
i++;
}
speed = SLOW_speed;
}
_x = (_x + (SIN((_rotation + 90) * PIE) * speed));
_y = (_y + ((COS((_rotation + 90) * PIE) * speed) * -1));
var XDIST = (_root.Path["cp" + targetCP]._x - _x);
var YDIST = (_root.Path["cp" + targetCP]._y - _y);
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) <= speed) {
_x = _root.Path["cp" + targetCP]._x;
_y = _root.Path["cp" + targetCP]._y;
if (targetCP == 0) {
_x = _root.Path.cp1._x;
_y = _root.Path.cp1._y;
targetCP++;
}
targetCP++;
}
if (targetCP > _root.numPts) {
this.gotoAndStop(Math.ceil(_root.Wave / 7));
_x = initX;
_y = initY;
_root.Citizens = _root.Citizens - 1;
if (_root.Citizens <= 0) {
_root.play();
}
HP = _root.Health;
targetCP = 0;
active = false;
}
}
}
Instance of Symbol 424 MovieClip "p6" in Frame 38
onClipEvent (load) {
var LIFETIME = 0;
var SLOW_END = 0;
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_alpha = 100;
var initX = _x;
var initY = _y;
var targetCP = 0;
var active = false;
var HP = _root.Health;
var speed = 0;
var REG_speed = _root.DefaultSpeed;
var SLOW_speed = _root.SlowSpeed;
var i = 0;
var m = 10;
var Boss = false;
Death = function () {
LIFETIME = 0;
SLOW_END = 0;
_root.Effect_Cash(Math.round(_root.DeathMoney), _x, _y);
_x = initX;
_y = initY;
HP = _root.Health;
targetCP = 0;
active = false;
_alpha = 100;
_root.Money = _root.Money + Math.round(_root.DeathMoney);
this.gotoAndStop(Math.ceil(_root.Wave / 7));
};
}
onClipEvent (enterFrame) {
if (active == true) {
x = ROUND(_root.Path["cp" + targetCP]._x - _x);
y = ROUND(_root.Path["cp" + targetCP]._y - _y) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
if (LIFETIME >= SLOW_END) {
speed = REG_speed;
SLOW_END = 0;
} else {
if (i > 5) {
while (_root["TWR" + m] != null) {
m++;
}
_root.Effect_Z(_x, _y, m);
m++;
i = 0;
} else {
i++;
}
speed = SLOW_speed;
}
_x = (_x + (SIN((_rotation + 90) * PIE) * speed));
_y = (_y + ((COS((_rotation + 90) * PIE) * speed) * -1));
var XDIST = (_root.Path["cp" + targetCP]._x - _x);
var YDIST = (_root.Path["cp" + targetCP]._y - _y);
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) <= speed) {
_x = _root.Path["cp" + targetCP]._x;
_y = _root.Path["cp" + targetCP]._y;
if (targetCP == 0) {
_x = _root.Path.cp1._x;
_y = _root.Path.cp1._y;
targetCP++;
}
targetCP++;
}
if (targetCP > _root.numPts) {
this.gotoAndStop(Math.ceil(_root.Wave / 7));
_x = initX;
_y = initY;
_root.Citizens = _root.Citizens - 1;
if (_root.Citizens <= 0) {
_root.play();
}
HP = _root.Health;
targetCP = 0;
active = false;
}
}
}
Instance of Symbol 424 MovieClip "p7" in Frame 38
onClipEvent (load) {
var LIFETIME = 0;
var SLOW_END = 0;
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_alpha = 100;
var initX = _x;
var initY = _y;
var targetCP = 0;
var active = false;
var HP = _root.Health;
var speed = 0;
var REG_speed = _root.DefaultSpeed;
var SLOW_speed = _root.SlowSpeed;
var i = 0;
var m = 10;
var Boss = false;
Death = function () {
LIFETIME = 0;
SLOW_END = 0;
_root.Effect_Cash(Math.round(_root.DeathMoney), _x, _y);
_x = initX;
_y = initY;
HP = _root.Health;
targetCP = 0;
active = false;
_alpha = 100;
_root.Money = _root.Money + Math.round(_root.DeathMoney);
this.gotoAndStop(Math.ceil(_root.Wave / 7));
};
}
onClipEvent (enterFrame) {
if (active == true) {
x = ROUND(_root.Path["cp" + targetCP]._x - _x);
y = ROUND(_root.Path["cp" + targetCP]._y - _y) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
if (LIFETIME >= SLOW_END) {
speed = REG_speed;
SLOW_END = 0;
} else {
if (i > 5) {
while (_root["TWR" + m] != null) {
m++;
}
_root.Effect_Z(_x, _y, m);
m++;
i = 0;
} else {
i++;
}
speed = SLOW_speed;
}
_x = (_x + (SIN((_rotation + 90) * PIE) * speed));
_y = (_y + ((COS((_rotation + 90) * PIE) * speed) * -1));
var XDIST = (_root.Path["cp" + targetCP]._x - _x);
var YDIST = (_root.Path["cp" + targetCP]._y - _y);
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) <= speed) {
_x = _root.Path["cp" + targetCP]._x;
_y = _root.Path["cp" + targetCP]._y;
if (targetCP == 0) {
_x = _root.Path.cp1._x;
_y = _root.Path.cp1._y;
targetCP++;
}
targetCP++;
}
if (targetCP > _root.numPts) {
this.gotoAndStop(Math.ceil(_root.Wave / 7));
_x = initX;
_y = initY;
_root.Citizens = _root.Citizens - 1;
if (_root.Citizens <= 0) {
_root.play();
}
HP = _root.Health;
targetCP = 0;
active = false;
}
}
}
Instance of Symbol 424 MovieClip "p8" in Frame 38
onClipEvent (load) {
var LIFETIME = 0;
var SLOW_END = 0;
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_alpha = 100;
var initX = _x;
var initY = _y;
var targetCP = 0;
var active = false;
var HP = _root.Health;
var speed = 0;
var REG_speed = _root.DefaultSpeed;
var SLOW_speed = _root.SlowSpeed;
var i = 0;
var m = 10;
var Boss = false;
Death = function () {
LIFETIME = 0;
SLOW_END = 0;
_root.Effect_Cash(Math.round(_root.DeathMoney), _x, _y);
_x = initX;
_y = initY;
HP = _root.Health;
targetCP = 0;
active = false;
_alpha = 100;
_root.Money = _root.Money + Math.round(_root.DeathMoney);
this.gotoAndStop(Math.ceil(_root.Wave / 7));
};
}
onClipEvent (enterFrame) {
if (active == true) {
x = ROUND(_root.Path["cp" + targetCP]._x - _x);
y = ROUND(_root.Path["cp" + targetCP]._y - _y) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
if (LIFETIME >= SLOW_END) {
speed = REG_speed;
SLOW_END = 0;
} else {
if (i > 5) {
while (_root["TWR" + m] != null) {
m++;
}
_root.Effect_Z(_x, _y, m);
m++;
i = 0;
} else {
i++;
}
speed = SLOW_speed;
}
_x = (_x + (SIN((_rotation + 90) * PIE) * speed));
_y = (_y + ((COS((_rotation + 90) * PIE) * speed) * -1));
var XDIST = (_root.Path["cp" + targetCP]._x - _x);
var YDIST = (_root.Path["cp" + targetCP]._y - _y);
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) <= speed) {
_x = _root.Path["cp" + targetCP]._x;
_y = _root.Path["cp" + targetCP]._y;
if (targetCP == 0) {
_x = _root.Path.cp1._x;
_y = _root.Path.cp1._y;
targetCP++;
}
targetCP++;
}
if (targetCP > _root.numPts) {
this.gotoAndStop(Math.ceil(_root.Wave / 7));
_x = initX;
_y = initY;
_root.Citizens = _root.Citizens - 1;
if (_root.Citizens <= 0) {
_root.play();
}
HP = _root.Health;
targetCP = 0;
active = false;
}
}
}
Instance of Symbol 424 MovieClip "p9" in Frame 38
onClipEvent (load) {
var LIFETIME = 0;
var SLOW_END = 0;
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_alpha = 100;
var initX = _x;
var initY = _y;
var targetCP = 0;
var active = false;
var HP = _root.Health;
var speed = 0;
var REG_speed = _root.DefaultSpeed;
var SLOW_speed = _root.SlowSpeed;
var i = 0;
var m = 10;
var Boss = false;
Death = function () {
LIFETIME = 0;
SLOW_END = 0;
_root.Effect_Cash(Math.round(_root.DeathMoney), _x, _y);
_x = initX;
_y = initY;
HP = _root.Health;
targetCP = 0;
active = false;
_alpha = 100;
_root.Money = _root.Money + Math.round(_root.DeathMoney);
this.gotoAndStop(Math.ceil(_root.Wave / 7));
};
}
onClipEvent (enterFrame) {
if (active == true) {
x = ROUND(_root.Path["cp" + targetCP]._x - _x);
y = ROUND(_root.Path["cp" + targetCP]._y - _y) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
if (LIFETIME >= SLOW_END) {
speed = REG_speed;
SLOW_END = 0;
} else {
if (i > 5) {
while (_root["TWR" + m] != null) {
m++;
}
_root.Effect_Z(_x, _y, m);
m++;
i = 0;
} else {
i++;
}
speed = SLOW_speed;
}
_x = (_x + (SIN((_rotation + 90) * PIE) * speed));
_y = (_y + ((COS((_rotation + 90) * PIE) * speed) * -1));
var XDIST = (_root.Path["cp" + targetCP]._x - _x);
var YDIST = (_root.Path["cp" + targetCP]._y - _y);
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) <= speed) {
_x = _root.Path["cp" + targetCP]._x;
_y = _root.Path["cp" + targetCP]._y;
if (targetCP == 0) {
_x = _root.Path.cp1._x;
_y = _root.Path.cp1._y;
targetCP++;
}
targetCP++;
}
if (targetCP > _root.numPts) {
this.gotoAndStop(Math.ceil(_root.Wave / 7));
_x = initX;
_y = initY;
_root.Citizens = _root.Citizens - 1;
if (_root.Citizens <= 0) {
_root.play();
}
HP = _root.Health;
targetCP = 0;
active = false;
}
}
}
Instance of Symbol 424 MovieClip "p10" in Frame 38
onClipEvent (load) {
var LIFETIME = 0;
var SLOW_END = 0;
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_alpha = 100;
var initX = _x;
var initY = _y;
var targetCP = 0;
var active = false;
var HP = _root.Health;
var speed = 0;
var REG_speed = _root.DefaultSpeed;
var SLOW_speed = _root.SlowSpeed;
var i = 0;
var m = 10;
var Boss = false;
Death = function () {
LIFETIME = 0;
SLOW_END = 0;
_root.Effect_Cash(Math.round(_root.DeathMoney), _x, _y);
_x = initX;
_y = initY;
HP = _root.Health;
targetCP = 0;
active = false;
_alpha = 100;
_root.Money = _root.Money + Math.round(_root.DeathMoney);
this.gotoAndStop(Math.ceil(_root.Wave / 7));
};
}
onClipEvent (enterFrame) {
if (active == true) {
x = ROUND(_root.Path["cp" + targetCP]._x - _x);
y = ROUND(_root.Path["cp" + targetCP]._y - _y) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
if (LIFETIME >= SLOW_END) {
speed = REG_speed;
SLOW_END = 0;
} else {
if (i > 5) {
while (_root["TWR" + m] != null) {
m++;
}
_root.Effect_Z(_x, _y, m);
m++;
i = 0;
} else {
i++;
}
speed = SLOW_speed;
}
_x = (_x + (SIN((_rotation + 90) * PIE) * speed));
_y = (_y + ((COS((_rotation + 90) * PIE) * speed) * -1));
var XDIST = (_root.Path["cp" + targetCP]._x - _x);
var YDIST = (_root.Path["cp" + targetCP]._y - _y);
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) <= speed) {
_x = _root.Path["cp" + targetCP]._x;
_y = _root.Path["cp" + targetCP]._y;
if (targetCP == 0) {
_x = _root.Path.cp1._x;
_y = _root.Path.cp1._y;
targetCP++;
}
targetCP++;
}
if (targetCP > _root.numPts) {
this.gotoAndStop(Math.ceil(_root.Wave / 7));
_x = initX;
_y = initY;
_root.Citizens = _root.Citizens - 1;
if (_root.Citizens <= 0) {
_root.play();
}
HP = _root.Health;
targetCP = 0;
active = false;
}
}
}
Instance of Symbol 455 MovieClip "ToolTip" in Frame 38
onClipEvent (load) {
this.swapDepths(1E18);
GetValues = function (SEL) {
NowName.text = _root["twr" + SEL].Tower.NAME;
NowDmg.text = _root["twr" + SEL].Tower.DMG;
NowRng.text = _root["twr" + SEL].Tower.RNG;
NewName.text = "Required Level: " + _root["twr" + SEL].Tower.REQUIRE;
NewDmg.text = _root["twr" + SEL].Tower.DMG_NEXT;
NewRng.text = _root["twr" + SEL].Tower.RNG_NEXT;
NewCost.text = _root["twr" + SEL].Tower.COST_NEXT;
};
stop();
}
Instance of Symbol 457 MovieClip "Loop" in Frame 38
onClipEvent (load) {
var subtimer = 0;
var Pause = false;
}
onClipEvent (keyDown) {
}
onClipEvent (enterFrame) {
if (Pause == false) {
subtimer = subtimer + 1;
}
if (subtimer >= 30) {
if (_root.Money == undefined) {
_root.error._visible = true;
_root.Money = -100;
}
_root.Time = _root.Time - 1;
_root.TheTime++;
subtimer = 0;
i = 1;
while (i <= 10) {
_root["p" + i].LIFETIME++;
i++;
}
}
if (_root.Time <= 0) {
_root.Wave = _root.Wave + 1;
_root.Time = 40;
_root.stopDrag();
if ((((((((((((((((_root.Wave == 7) || (_root.Wave == 14)) || (_root.Wave == 21)) || (_root.Wave == 28)) || (_root.Wave == 35)) || (_root.Wave == 42)) || (_root.Wave == 49)) || (_root.Wave == 56)) || (_root.Wave == 63)) || (_root.Wave == 70)) || (_root.Wave == 77)) || (_root.Wave == 84)) || (_root.Wave == 91)) || (_root.Wave == 98)) || (_root.Wave == 105)) || (_root.Wave == 112)) {
_root.BOSS = true;
} else {
_root.BOSS = false;
}
if (_root.BOSS == true) {
_root.Health = (0.03 * Math.pow(_root.Wave + 2, 2.65)) * 5;
_root.DeathMoney = (0.16 * Math.pow(_root.Wave + 3, 1.2)) * 30;
_root.p1.HP = _root.Health;
_root.p1.active = true;
_root.p1._xscale = (_root.p1._yscale = 200);
_root.BOSS = false;
} else {
_root.Health = 0.03 * Math.pow(_root.Wave + 2, 2.65);
_root.DeathMoney = (0.08 * Math.pow(_root.Wave, 1.2)) + 1;
i = 1;
while (i <= 10) {
_root["p" + i].HP = _root.Health;
_root["p" + i].active = true;
_root.p1._xscale = (_root.p1._yscale = 100);
i++;
}
}
}
}
Instance of Symbol 463 MovieClip "error" in Frame 38
onClipEvent (load) {
_visible = false;
}
Frame 39
Score.text = ("You Scored " + _root.Wave) + ".";
gotoAndStop (5);
Frame 40
stop();
Frame 41
gotoAndPlay (40);
Frame 42
_root.stopAllSounds();
Symbol 7 MovieClip [Water_Hit] Frame 3
this.removeMovieClip();
Symbol 10 MovieClip [Wind_Hit] Frame 3
this.removeMovieClip();
Symbol 13 MovieClip [Fire_Hit] Frame 3
this.removeMovieClip();
Symbol 16 MovieClip [Earth_Hit] Frame 3
this.removeMovieClip();
Symbol 20 Button
on (press) {
_root.BuildMode = false;
_root.Selected = _parent.getDepth();
_root.Box._x = (_root.ToolTip._x = _parent._x);
_root.Box._y = (_root.ToolTip._y = _parent._y);
_root.ToolTip.GetValues(_root.Selected);
_root.ToolTip._visible = true;
_root.Box._visible = true;
_root.Box.play();
}
Symbol 33 MovieClip [Earth_Tower] Frame 1
NAME = "Lil Gecko";
COST = 20;
DMG = 2;
RNG = 110;
COST_NEXT = 30;
DMG_NEXT = 4;
RNG_NEXT = 180;
DEL = 1;
SPD = 3;
REQUIRE = 0;
stop();
Instance of Symbol 22 MovieClip "Arrow" in Symbol 33 MovieClip [Earth_Tower] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_y = 0;
_x = 0;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Instance of Symbol 23 MovieClip "Ball" in Symbol 33 MovieClip [Earth_Tower] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var rotation = 0;
var o = 1;
var k = 0;
var myTime = 0;
var myAtkTime = (myTime + _parent.DEL);
}
onClipEvent (enterFrame) {
if (attack == true) {
if (_root.TheTime >= myAtkTime) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
_x = (_x + (SIN((_rotation + 90) * PIE) * (_parent.SPD * 2)));
_y = (_y + ((COS((_rotation + 90) * PIE) * (_parent.SPD * 2)) * -1));
if (k >= 0) {
while ((_root["eff" + o] != null) && (_root["twr" + o] != null)) {
o++;
}
_root.attachMovie("Particle_Earth", "eff" + o, o);
_root["eff" + o]._x = _parent._parent._x + _x;
_root["eff" + o]._y = _parent._parent._y + _y;
o++;
k = 0;
if (o > 100) {
o = 0;
}
k = 0;
} else {
k++;
}
var XDIST = (_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
var YDIST = (_root["p" + _parent.Target]._y - (_parent._parent._y + _y));
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) < ((_parent.SPD * 2) + 1)) {
_root["p" + _parent.Target].HP = _root["p" + _parent.Target].HP - _parent.DMG;
_root["p" + _parent.Target]._alpha = (_root["p" + _parent.Target].HP / _root.Health) * 100;
_x = 0;
_y = 0;
if (_root["p" + _parent.Target].HP <= 0) {
_root["p" + _parent.Target].Death();
}
_parent.Target = 1;
_parent.pickNewTarget();
attack = false;
myAtkTime = _root.TheTime + _parent.DEL;
}
}
}
}
Symbol 33 MovieClip [Earth_Tower] Frame 3
NAME = "Gecko Jr.";
COST = 30;
DMG = 4;
RNG = 110;
COST_NEXT = 60;
DMG_NEXT = 12;
RNG_NEXT = 180;
DEL = 0;
SPD = 3;
REQUIRE = 10;
Arrow._x = (Arrow._y = -6);
stop();
Instance of Symbol 22 MovieClip "Arrow" in Symbol 33 MovieClip [Earth_Tower] Frame 3
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_y = -1;
_x = -1;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Symbol 33 MovieClip [Earth_Tower] Frame 5
NAME = "Gecko";
COST = 60;
DMG = 12;
RNG = 110;
COST_NEXT = 120;
DMG_NEXT = 48;
RNG_NEXT = 180;
DEL = 0;
SPD = 3;
REQUIRE = 15;
Arrow._x = (Arrow._y = -7);
stop();
Instance of Symbol 22 MovieClip "Arrow" in Symbol 33 MovieClip [Earth_Tower] Frame 5
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_y = -2;
_x = -2;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Symbol 33 MovieClip [Earth_Tower] Frame 7
NAME = "Gecko Sr.";
COST = 120;
DMG = 48;
RNG = 110;
COST_NEXT = 240;
DMG_NEXT = 240;
RNG_NEXT = 180;
DEL = 0;
SPD = 3;
REQUIRE = 30;
Arrow._x = (Arrow._y = -8);
stop();
Instance of Symbol 22 MovieClip "Arrow" in Symbol 33 MovieClip [Earth_Tower] Frame 7
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_y = -3;
_x = -3;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Symbol 33 MovieClip [Earth_Tower] Frame 9
NAME = "Great Gecko";
COST = 240;
DMG = 240;
RNG = 110;
COST_NEXT = 880;
DMG_NEXT = 1440;
RNG_NEXT = 200;
DEL = 0;
SPD = 3;
REQUIRE = 44;
Arrow._x = (Arrow._y = -9);
stop();
Instance of Symbol 22 MovieClip "Arrow" in Symbol 33 MovieClip [Earth_Tower] Frame 9
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_y = -4;
_x = -4;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Symbol 33 MovieClip [Earth_Tower] Frame 11
NAME = "Elder Gecko";
COST = 880;
DMG = 1440;
RNG = 160;
COST_NEXT = 2120;
DMG_NEXT = 10080;
RNG_NEXT = 200;
DEL = 0;
SPD = 3;
REQUIRE = 70;
Arrow._x = (Arrow._y = -10);
stop();
Instance of Symbol 22 MovieClip "Arrow" in Symbol 33 MovieClip [Earth_Tower] Frame 11
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_y = -5;
_x = -5;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Symbol 33 MovieClip [Earth_Tower] Frame 13
NAME = "Enchanted Gecko";
COST = 2120;
DMG = 10080;
RNG = 160;
COST_NEXT = 20000;
DMG_NEXT = 80640 /* 0x013B00 */;
RNG_NEXT = 200;
DEL = 0;
SPD = 3;
REQUIRE = 90;
Arrow._x = (Arrow._y = -11);
stop();
Instance of Symbol 22 MovieClip "Arrow" in Symbol 33 MovieClip [Earth_Tower] Frame 13
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_y = -6;
_x = -6;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Symbol 33 MovieClip [Earth_Tower] Frame 15
NAME = "Mystical Gecko";
COST = 20000;
DMG = 80640 /* 0x013B00 */;
RNG = 170;
COST_NEXT = "---";
DMG_NEXT = "---";
RNG_NEXT = "---";
DEL = 0;
SPD = 3;
REQUIRE = Infinity;
Arrow._x = (Arrow._y = -12);
stop();
Instance of Symbol 22 MovieClip "Arrow" in Symbol 33 MovieClip [Earth_Tower] Frame 15
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_y = -7;
_x = -7;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Symbol 33 MovieClip [Earth_Tower] Frame 16
gotoAndStop (15);
_root.txtMsg = "No Further Upgrades Available";
Instance of Symbol 33 MovieClip [Earth_Tower] "Tower" in Symbol 34 MovieClip [3_TWR] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var Target = 1;
var Parent = _parent;
var PointTarget = _root["p" + Target];
var RNG;
var recDist = 9999;
pickNewTarget = function () {
recDist = 9000;
i = 1;
while (i < 11) {
var _local5 = _root["p" + i]._x - _parent._x;
var _local4 = _root["p" + i]._y - _parent._y;
var _local3 = ROUND(SQRT((_local5 * _local5) + (_local4 * _local4)));
if (_root["p" + i].active && (_root["p" + i].targetCP > 1)) {
if (_local3 <= RNG) {
if (_local3 <= recDist) {
Target = i;
PointTarget = _root["p" + Target];
}
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
recDist = _local3;
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
i++;
}
};
killTarget = function () {
if (PointTarget.active && (PointTarget.targetCP > 1)) {
var _local4 = _root["p" + Target]._x - _parent._x;
var _local3 = _root["p" + Target]._y - _parent._y;
var _local5 = ROUND(SQRT((_local4 * _local4) + (_local3 * _local3)));
if (_local5 <= RNG) {
Arrow._rotation = Arrow.angle * -1;
Ball.attack = true;
Ball._visible = true;
} else {
pickNewTarget();
}
} else {
pickNewTarget();
}
};
}
onClipEvent (enterFrame) {
killTarget();
}
Symbol 36 Button
on (press) {
_root.BuildMode = false;
_root.Selected = _parent.getDepth();
_root.Box._x = (_root.ToolTip._x = _parent._x);
_root.Box._y = (_root.ToolTip._y = _parent._y);
_root.ToolTip.GetValues(_root.Selected);
_root.ToolTip._visible = true;
_root.Box._visible = true;
_root.Box.play();
}
Symbol 41 MovieClip [Wind_Tower] Frame 1
NAME = "Hand Fan";
COST = 30;
DMG = 2;
RNG = 100;
COST_NEXT = 50;
DMG_NEXT = 4;
RNG_NEXT = 180;
SPD = 4;
REQUIRE = 0;
stop();
Instance of Symbol 38 MovieClip "Arrow" in Symbol 41 MovieClip [Wind_Tower] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Instance of Symbol 40 MovieClip "Ball" in Symbol 41 MovieClip [Wind_Tower] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var rotation = 0;
var o = 1;
var k = 0;
}
onClipEvent (enterFrame) {
if (attack == true) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
_x = (_x + (SIN((_rotation + 90) * PIE) * (_parent.SPD * 2)));
_y = (_y + ((COS((_rotation + 90) * PIE) * (_parent.SPD * 2)) * -1));
while ((_root["eff" + o] != null) && (_root["twr" + o] != null)) {
o++;
}
_root.attachMovie("Particle_Wind", "eff" + o, o);
_root["eff" + o]._x = _parent._parent._x + _x;
_root["eff" + o]._y = _parent._parent._y + _y;
o++;
k = 0;
if (o > 100) {
o = 0;
}
var XDIST = (_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
var YDIST = (_root["p" + _parent.Target]._y - (_parent._parent._y + _y));
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) < ((_parent.SPD * 2) + 1)) {
_root["p" + _parent.Target].HP = _root["p" + _parent.Target].HP - _parent.DMG;
_root["p" + _parent.Target]._alpha = (_root["p" + _parent.Target].HP / _root.Health) * 100;
_x = 0;
_y = 0;
if (_root["p" + _parent.Target].HP <= 0) {
_root["p" + _parent.Target].Death();
}
_parent.Target = 1;
_parent.pickNewTarget();
attack = false;
}
}
}
Symbol 41 MovieClip [Wind_Tower] Frame 3
NAME = "Electric Fan";
COST = 50;
DMG = 4;
RNG = 110;
COST_NEXT = 100;
DMG_NEXT = 6;
RNG_NEXT = 200;
SPD = 5;
REQUIRE = 3;
stop();
Symbol 41 MovieClip [Wind_Tower] Frame 5
NAME = "Wind Mill";
COST = 100;
DMG = 6;
RNG = 120;
COST_NEXT = 250;
DMG_NEXT = 10;
RNG_NEXT = 200;
SPD = 5;
REQUIRE = 3;
stop();
Symbol 41 MovieClip [Wind_Tower] Frame 7
NAME = "Wind Generator";
COST = 250;
DMG = 10;
RNG = 130;
COST_NEXT = 500;
DMG_NEXT = 14;
RNG_NEXT = 200;
SPD = 6;
REQUIRE = 3;
stop();
Symbol 41 MovieClip [Wind_Tower] Frame 9
NAME = "Wind Tunnel";
COST = 500;
DMG = 14;
RNG = 130;
COST_NEXT = 1800;
DMG_NEXT = 20;
RNG_NEXT = 200;
SPD = 7;
REQUIRE = 6;
stop();
Symbol 41 MovieClip [Wind_Tower] Frame 11
NAME = "Twister Generator";
COST = 1800;
DMG = 20;
RNG = 150;
COST_NEXT = 4100;
DMG_NEXT = 25;
RNG_NEXT = 200;
SPD = 8;
REQUIRE = 40;
stop();
Symbol 41 MovieClip [Wind_Tower] Frame 13
NAME = "Tornado Generator";
COST = 4100;
DMG = 25;
RNG = 160;
COST_NEXT = 20500;
DMG_NEXT = 40;
RNG_NEXT = 200;
SPD = 9;
REQUIRE = 45;
stop();
Symbol 41 MovieClip [Wind_Tower] Frame 15
NAME = "Hurricane Generator";
COST = 20500;
DMG = 40;
RNG = 160;
COST_NEXT = "---";
DMG_NEXT = "---";
RNG_NEXT = "---";
SPD = 10;
REQUIRE = Infinity;
stop();
Symbol 41 MovieClip [Wind_Tower] Frame 16
gotoAndStop (15);
_root.txtMsg.text = "No Further Upgrades Available";
Instance of Symbol 41 MovieClip [Wind_Tower] "Tower" in Symbol 42 MovieClip [4_TWR] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var Target = 1;
var Parent = _parent;
var PointTarget = _root["p" + Target];
var RNG;
var recDist = 9999;
pickNewTarget = function () {
recDist = 9000;
i = 1;
while (i < 11) {
var _local5 = _root["p" + i]._x - _parent._x;
var _local4 = _root["p" + i]._y - _parent._y;
var _local3 = ROUND(SQRT((_local5 * _local5) + (_local4 * _local4)));
if (_root["p" + i].active && (_root["p" + i].targetCP > 1)) {
if (_local3 <= RNG) {
if (_local3 <= recDist) {
Target = i;
PointTarget = _root["p" + Target];
}
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
recDist = _local3;
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
i++;
}
};
killTarget = function () {
if (PointTarget.active && (PointTarget.targetCP > 1)) {
var _local4 = _root["p" + Target]._x - _parent._x;
var _local3 = _root["p" + Target]._y - _parent._y;
var _local5 = ROUND(SQRT((_local4 * _local4) + (_local3 * _local3)));
if (_local5 <= RNG) {
Arrow._rotation = Arrow.angle * -1;
Ball.attack = true;
Ball._visible = true;
} else {
pickNewTarget();
}
} else {
pickNewTarget();
}
};
}
onClipEvent (enterFrame) {
killTarget();
}
Symbol 45 Button
on (press) {
_root.BuildMode = false;
_root.Selected = _parent.getDepth();
_root.Box._x = (_root.ToolTip._x = _parent._x);
_root.Box._y = (_root.ToolTip._y = _parent._y);
_root.ToolTip.GetValues(_root.Selected);
_root.ToolTip._visible = true;
_root.Box._visible = true;
_root.Box.play();
}
Symbol 50 MovieClip [Water_Tower] Frame 1
NAME = "Faucet";
COST = 30;
DMG = 3;
RNG = 150;
DEL = 0;
COST_NEXT = 50;
DMG_NEXT = 6;
RNG_NEXT = 210;
SPD = 3;
REQUIRE = 0;
stop();
Instance of Symbol 47 MovieClip "Arrow" in Symbol 50 MovieClip [Water_Tower] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Instance of Symbol 48 MovieClip "Ball" in Symbol 50 MovieClip [Water_Tower] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var rotation = 0;
var o = 1;
var k = 0;
var myTime = 0;
var myAtkTime = (myTime + _parent.DEL);
}
onClipEvent (enterFrame) {
if (attack == true) {
if (_root.TheTime >= myAtkTime) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
_x = (_x + (SIN((_rotation + 90) * PIE) * (_parent.SPD * 2)));
_y = (_y + ((COS((_rotation + 90) * PIE) * (_parent.SPD * 2)) * -1));
if (k >= 0) {
while ((_root["eff" + o] != null) && (_root["twr" + o] != null)) {
o++;
}
_root.attachMovie("Particle_Water", "eff" + o, o);
_root["eff" + o]._x = _parent._parent._x + _x;
_root["eff" + o]._y = _parent._parent._y + _y;
o++;
k = 0;
if (o > 100) {
o = 0;
}
k = 0;
} else {
k++;
}
var XDIST = (_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
var YDIST = (_root["p" + _parent.Target]._y - (_parent._parent._y + _y));
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) < ((_parent.SPD * 2) + 1)) {
_root["p" + _parent.Target].HP = _root["p" + _parent.Target].HP - _parent.DMG;
_root["p" + _parent.Target]._alpha = (_root["p" + _parent.Target].HP / _root.Health) * 100;
_x = 0;
_y = 0;
if (_root["p" + _parent.Target].HP <= 0) {
_root["p" + _parent.Target].Death();
}
_parent.Target = 1;
_parent.pickNewTarget();
attack = false;
myAtkTime = _root.TheTime + _parent.DEL;
}
}
}
}
Symbol 50 MovieClip [Water_Tower] Frame 3
NAME = "Garden Hose";
COST = 50;
DMG = 6;
RNG = 160;
COST_NEXT = 100;
DMG_NEXT = 18;
RNG_NEXT = 210;
SPD = 3;
REQUIRE = 8;
stop();
Symbol 50 MovieClip [Water_Tower] Frame 5
NAME = "Fire Hydrant";
COST = 100;
DMG = 18;
RNG = 165;
COST_NEXT = 180;
DMG_NEXT = 72;
RNG_NEXT = 210;
SPD = 3;
REQUIRE = 30;
stop();
Symbol 50 MovieClip [Water_Tower] Frame 7
NAME = "Fire Station";
COST = 180;
DMG = 72;
RNG = 170;
COST_NEXT = 350;
DMG_NEXT = 360;
RNG_NEXT = 220;
SPD = 3;
REQUIRE = 45;
stop();
Symbol 50 MovieClip [Water_Tower] Frame 9
NAME = "Water Plant";
COST = 350;
DMG = 360;
RNG = 180;
COST_NEXT = 1700;
DMG_NEXT = 2160;
RNG_NEXT = 230;
SPD = 3;
REQUIRE = 60;
stop();
Symbol 50 MovieClip [Water_Tower] Frame 11
NAME = "Water Plant";
COST = 1700;
DMG = 2160;
RNG = 182;
COST_NEXT = 5000;
DMG_NEXT = 15120;
RNG_NEXT = 240;
SPD = 3;
REQUIRE = 80;
stop();
Symbol 50 MovieClip [Water_Tower] Frame 13
NAME = "Water Plant";
COST = 5000;
DMG = 15120;
RNG = 185;
COST_NEXT = 30000;
DMG_NEXT = 120960 /* 0x01D880 */;
RNG_NEXT = 260;
SPD = 3;
REQUIRE = 120;
stop();
Symbol 50 MovieClip [Water_Tower] Frame 15
NAME = "Toxic Dump";
COST = 30000;
DMG = 120960 /* 0x01D880 */;
RNG = 185;
COST_NEXT = 200000 /* 0x030D40 */;
DMG_NEXT = 1000000 /* 0x0F4240 */;
RNG_NEXT = 400;
SPD = 3;
REQUIRE = 160;
stop();
Symbol 50 MovieClip [Water_Tower] Frame 17
NAME = "UltraToxic Waste";
COST = 200000 /* 0x030D40 */;
DMG = 1000000 /* 0x0F4240 */;
RNG = 300;
COST_NEXT = "---";
DMG_NEXT = "---";
RNG_NEXT = "---";
SPD = 3;
REQUIRE = Infinity;
stop();
Symbol 50 MovieClip [Water_Tower] Frame 18
gotoAndStop (17);
_root.txtMsg = "No Further Upgrades Available";
Instance of Symbol 50 MovieClip [Water_Tower] "Tower" in Symbol 51 MovieClip [2_TWR] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var Target = 1;
var Parent = _parent;
var PointTarget = _root["p" + Target];
var RNG;
var recDist = 9999;
pickNewTarget = function () {
recDist = 9000;
i = 1;
while (i < 11) {
var _local5 = _root["p" + i]._x - _parent._x;
var _local4 = _root["p" + i]._y - _parent._y;
var _local3 = ROUND(SQRT((_local5 * _local5) + (_local4 * _local4)));
if (_root["p" + i].active && (_root["p" + i].targetCP > 1)) {
if (_local3 <= RNG) {
if (_local3 <= recDist) {
Target = i;
PointTarget = _root["p" + Target];
}
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
recDist = _local3;
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
i++;
}
};
killTarget = function () {
if (PointTarget.active && (PointTarget.targetCP > 1)) {
var _local4 = _root["p" + Target]._x - _parent._x;
var _local3 = _root["p" + Target]._y - _parent._y;
var _local5 = ROUND(SQRT((_local4 * _local4) + (_local3 * _local3)));
if (_local5 <= RNG) {
Arrow._rotation = Arrow.angle * -1;
Ball.attack = true;
Ball._visible = true;
} else {
pickNewTarget();
}
} else {
pickNewTarget();
}
};
}
onClipEvent (enterFrame) {
killTarget();
}
Symbol 55 Button
on (press) {
_root.Effect_Poof(this._x, this._y);
i = 1;
while (i < 11) {
var XDIST = (this._x - _root["p" + i]._x);
var YDIST = (this._y - _root["p" + i]._y);
if (Math.round(Math.sqrt((XDIST * XDIST) + (YDIST * YDIST))) <= 70) {
_root["p" + i].HP = _root["p" + i].HP - 100;
_root["p" + i]._alpha = (_root["p" + i].HP / _root.Health) * 100;
if (_root["p" + i].HP <= 0) {
_root["p" + i].Death();
}
}
i++;
}
this.removeMovieClip();
}
Symbol 56 MovieClip [14_TWR] Frame 5
stop();
Symbol 59 Button
on (press) {
_root.Effect_Poof(this._x, this._y);
i = 1;
while (i < 11) {
var XDIST = (this._x - _root["p" + i]._x);
var YDIST = (this._y - _root["p" + i]._y);
if (Math.round(Math.sqrt((XDIST * XDIST) + (YDIST * YDIST))) <= 70) {
_root["p" + i].HP = _root["p" + i].HP - 1000;
_root["p" + i]._alpha = (_root["p" + i].HP / _root.Health) * 100;
if (_root["p" + i].HP <= 0) {
_root["p" + i].Death();
}
}
i++;
}
this.removeMovieClip();
}
Symbol 60 MovieClip [15_TWR] Frame 5
stop();
Symbol 63 Button
on (press) {
_root.Effect_Poof(this._x, this._y);
i = 1;
while (i < 11) {
var XDIST = (this._x - _root["p" + i]._x);
var YDIST = (this._y - _root["p" + i]._y);
if (Math.round(Math.sqrt((XDIST * XDIST) + (YDIST * YDIST))) <= 70) {
_root["p" + i].HP = _root["p" + i].HP - 10;
_root["p" + i]._alpha = (_root["p" + i].HP / _root.Health) * 100;
if (_root["p" + i].HP <= 0) {
_root["p" + i].Death();
}
}
i++;
}
this.removeMovieClip();
}
Symbol 64 MovieClip [13_TWR] Frame 5
stop();
Symbol 66 Button
on (press) {
_root.BuildMode = false;
_root.Selected = _parent.getDepth();
_root.Box._x = (_root.ToolTip._x = _parent._x);
_root.Box._y = (_root.ToolTip._y = _parent._y);
_root.ToolTip.GetValues(_root.Selected);
_root.ToolTip._visible = true;
_root.Box._visible = true;
_root.Box.play();
}
Symbol 70 MovieClip Frame 1
NAME = "Death [Ultimate Chance]";
COST = 1000;
DMG = 1000;
RNG = 130;
COST_NEXT = "---";
DMG_NEXT = "---";
RNG_NEXT = "---";
SPD = 3;
REQUIRE = Infinity;
stop();
Instance of Symbol 68 MovieClip "Arrow" in Symbol 70 MovieClip Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
rotation = angle * -1;
}
Instance of Symbol 69 MovieClip "Ball" in Symbol 70 MovieClip Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var rotation = 0;
var o = 1;
var k = 0;
var myTime = 0;
var myAtkTime = (myTime + _parent.DEL);
}
onClipEvent (enterFrame) {
if (attack == true) {
if (_root.TheTime >= myAtkTime) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
_x = (_x + (SIN((_rotation + 90) * PIE) * (_parent.SPD * 2)));
_y = (_y + ((COS((_rotation + 90) * PIE) * (_parent.SPD * 2)) * -1));
if (k >= 0) {
while ((_root["eff" + o] != null) && (_root["twr" + o] != null)) {
o++;
}
_root.attachMovie("Particle_Death", "eff" + o, o);
_root["eff" + o]._x = _parent._parent._x + _x;
_root["eff" + o]._y = _parent._parent._y + _y;
o++;
k = 0;
if (o > 100) {
o = 0;
}
k = 0;
} else {
k++;
}
var XDIST = (_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
var YDIST = (_root["p" + _parent.Target]._y - (_parent._parent._y + _y));
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) < ((_parent.SPD * 2) + 1)) {
_root["p" + _parent.Target].HP = _root["p" + _parent.Target].HP - _parent.DMG;
_root["p" + _parent.Target]._alpha = (_root["p" + _parent.Target].HP / _root.Health) * 100;
_x = 0;
_y = 0;
if (_root["p" + _parent.Target].HP <= 0) {
_root["p" + _parent.Target].Death();
}
_parent.Target = 1;
_parent.pickNewTarget();
attack = false;
myAtkTime = _root.TheTime + _parent.DEL;
}
}
}
}
Instance of Symbol 70 MovieClip "Tower" in Symbol 71 MovieClip [8_TWR] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var Target = 1;
var Parent = _parent;
var PointTarget = _root["p" + Target];
var RNG;
var recDist = 9999;
pickNewTarget = function () {
recDist = 9000;
i = 1;
while (i < 11) {
var _local5 = _root["p" + i]._x - _parent._x;
var _local4 = _root["p" + i]._y - _parent._y;
var _local3 = ROUND(SQRT((_local5 * _local5) + (_local4 * _local4)));
if (_root["p" + i].active && (_root["p" + i].targetCP > 1)) {
if (_local3 <= RNG) {
if (_local3 <= recDist) {
Target = i;
PointTarget = _root["p" + Target];
}
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
recDist = _local3;
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
i++;
}
};
killTarget = function () {
if (PointTarget.active && (PointTarget.targetCP > 1)) {
var _local4 = _root["p" + Target]._x - _parent._x;
var _local3 = _root["p" + Target]._y - _parent._y;
var _local5 = ROUND(SQRT((_local4 * _local4) + (_local3 * _local3)));
if (_local5 <= RNG) {
Arrow._rotation = Arrow.angle * -1;
Ball.attack = true;
Ball._visible = true;
} else {
pickNewTarget();
}
} else {
pickNewTarget();
}
};
}
onClipEvent (enterFrame) {
killTarget();
}
Symbol 74 Button
on (press) {
_root.BuildMode = false;
_root.Selected = _parent.getDepth();
_root.Box._x = (_root.ToolTip._x = _parent._x);
_root.Box._y = (_root.ToolTip._y = _parent._y);
_root.ToolTip.GetValues(_root.Selected);
_root.ToolTip._visible = true;
_root.Box._visible = true;
_root.Box.play();
}
Symbol 79 MovieClip Frame 1
NAME = "Biohazard [Follower]";
COST = 1000;
DMG = 70;
RNG = 100;
DEL = 1;
COST_NEXT = "---";
DMG_NEXT = "---";
RNG_NEXT = "---";
SPD = 3;
REQUIRE = Infinity;
stop();
Instance of Symbol 76 MovieClip "Arrow" in Symbol 79 MovieClip Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Instance of Symbol 77 MovieClip "Ball" in Symbol 79 MovieClip Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var rotation = 0;
var o = 1;
var k = 0;
var myTime = 0;
var myAtkTime = (myTime + _parent.DEL);
}
onClipEvent (enterFrame) {
if (attack == true) {
if (_root.TheTime >= myAtkTime) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
_x = (_x + (SIN((_rotation + 90) * PIE) * (_parent.SPD * 2)));
_y = (_y + ((COS((_rotation + 90) * PIE) * (_parent.SPD * 2)) * -1));
if (k >= 0) {
while ((_root["eff" + o] != null) && (_root["twr" + o] != null)) {
o++;
}
_root.attachMovie("Particle_Ult", "eff" + o, o);
_root["eff" + o]._x = _parent._parent._x + _x;
_root["eff" + o]._y = _parent._parent._y + _y;
o++;
k = 0;
if (o > 100) {
o = 0;
}
k = 0;
} else {
k++;
}
var XDIST = (_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
var YDIST = (_root["p" + _parent.Target]._y - (_parent._parent._y + _y));
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) < ((_parent.SPD * 2) + 1)) {
_root["p" + _parent.Target].HP = _root["p" + _parent.Target].HP - _parent.DMG;
_root["p" + _parent.Target]._alpha = (_root["p" + _parent.Target].HP / _root.Health) * 100;
_x = 0;
_y = 0;
if (_root["p" + _parent.Target].HP <= 0) {
_root["p" + _parent.Target].Death();
}
_parent.Target = 1;
_parent.pickNewTarget();
attack = false;
myAtkTime = _root.TheTime + _parent.DEL;
}
}
}
}
Instance of Symbol 79 MovieClip "Tower" in Symbol 80 MovieClip [9_TWR] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var Target = 1;
var Parent = _parent;
var PointTarget = _root["p" + Target];
var RNG;
var recDist = 9999;
pickNewTarget = function () {
recDist = 9000;
i = 1;
while (i < 11) {
var _local5 = _root["p" + i]._x - _parent._x;
var _local4 = _root["p" + i]._y - _parent._y;
var _local3 = ROUND(SQRT((_local5 * _local5) + (_local4 * _local4)));
if (_root["p" + i].active && (_root["p" + i].targetCP > 1)) {
if (_local3 <= 800) {
if (_local3 <= recDist) {
Target = i;
PointTarget = _root["p" + Target];
}
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
recDist = _local3;
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
i++;
}
};
killTarget = function () {
if (PointTarget.active && (PointTarget.targetCP > 1)) {
var _local4 = _root["p" + Target]._x - _parent._x;
var _local3 = _root["p" + Target]._y - _parent._y;
var _local5 = ROUND(SQRT((_local4 * _local4) + (_local3 * _local3)));
if (_local5 <= RNG) {
Arrow._rotation = Arrow.angle * -1;
Ball.attack = true;
Ball._visible = true;
} else {
Arrow._rotation = Arrow.angle * -1;
_parent._x = _parent._x + (SIN((Arrow._rotation + 90) * PIE) * 2);
_parent._y = _parent._y + ((COS((Arrow._rotation + 90) * PIE) * 2) * -1);
}
} else {
pickNewTarget();
}
};
}
onClipEvent (enterFrame) {
killTarget();
}
Symbol 82 Button
on (press) {
_root.BuildMode = false;
_root.Selected = _parent.getDepth();
_root.Box._x = (_root.ToolTip._x = _parent._x);
_root.Box._y = (_root.ToolTip._y = _parent._y);
_root.ToolTip.GetValues(_root.Selected);
_root.ToolTip._visible = true;
_root.Box._visible = true;
_root.Box.play();
}
Symbol 86 MovieClip Frame 1
NAME = "Godly Tower";
COST = 300000000 /* 0x11E1A300 */;
DMG = 99999999999;
RNG = 220;
COST_NEXT = "---";
DMG_NEXT = "---";
RNG_NEXT = "---";
SPD = 3;
REQUIRE = Infinity;
stop();
Instance of Symbol 84 MovieClip "Arrow" in Symbol 86 MovieClip Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Instance of Symbol 85 MovieClip "Ball" in Symbol 86 MovieClip Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var rotation = 0;
var o = 1;
var k = 0;
var ele = 2;
var s = 0;
var myTime = 0;
var myAtkTime = (myTime + _parent.DEL);
}
onClipEvent (enterFrame) {
if (attack == true) {
if (_root.TheTime >= myAtkTime) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
rotation = _parent.Arrow.angle * -1;
if ((rotation < 90) && (rotation >= -90)) {
_parent.DMG = 100000 /* 0x0186A0 */;
ele = 1;
} else {
_parent.DMG = 10000;
ele = 2;
}
_x = (_x + (SIN((_rotation + 90) * PIE) * (_parent.SPD * 2)));
_y = (_y + ((COS((_rotation + 90) * PIE) * (_parent.SPD * 2)) * -1));
if (k > 1) {
while ((_root["eff" + o] != null) && (_root["twr" + o] != null)) {
o++;
}
s = o + 1;
while ((_root["eff" + s] != null) && (_root["twr" + s] != null)) {
s++;
}
if (ele == 1) {
_root.attachMovie("Particle_S2", "eff" + o, o);
_root.attachMovie("Particle_S", "eff" + s, s);
} else {
_root.attachMovie("Particle_r2", "eff" + o, o);
_root.attachMovie("Particle_r", "eff" + s, s);
}
_root["eff" + s]._x = _parent._parent._x + _x;
_root["eff" + s]._y = _parent._parent._y + _y;
_root["eff" + o]._x = _parent._parent._x + _x;
_root["eff" + o]._y = _parent._parent._y + _y;
o++;
s++;
k = 0;
if (o > 100) {
o = 0;
}
} else {
k++;
}
var XDIST = (_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
var YDIST = (_root["p" + _parent.Target]._y - (_parent._parent._y + _y));
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) < ((_parent.SPD * 2) + 1)) {
_root["p" + _parent.Target].HP = _root["p" + _parent.Target].HP - _parent.DMG;
_root["p" + _parent.Target]._alpha = (_root["p" + _parent.Target].HP / _root.Health) * 100;
_x = 0;
_y = 0;
if (_root["p" + _parent.Target].HP <= 0) {
_root["p" + _parent.Target].Death();
}
_parent.Target = 1;
_parent.pickNewTarget();
attack = false;
myAtkTime = _root.TheTime + _parent.DEL;
}
}
}
}
Instance of Symbol 86 MovieClip "Tower" in Symbol 87 MovieClip [12_TWR] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var Target = 1;
var Parent = _parent;
var PointTarget = _root["p" + Target];
var RNG;
var recDist = 9999;
pickNewTarget = function () {
recDist = 9000;
i = 1;
while (i < 11) {
var _local5 = _root["p" + i]._x - _parent._x;
var _local4 = _root["p" + i]._y - _parent._y;
var _local3 = ROUND(SQRT((_local5 * _local5) + (_local4 * _local4)));
if (_root["p" + i].active && (_root["p" + i].targetCP > 1)) {
if (_local3 <= RNG) {
if (_local3 <= recDist) {
Target = i;
PointTarget = _root["p" + Target];
}
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
recDist = _local3;
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
i++;
}
};
killTarget = function () {
if (PointTarget.active && (PointTarget.targetCP > 1)) {
var _local4 = _root["p" + Target]._x - _parent._x;
var _local3 = _root["p" + Target]._y - _parent._y;
var _local5 = ROUND(SQRT((_local4 * _local4) + (_local3 * _local3)));
if (_local5 <= RNG) {
Arrow._rotation = Arrow.angle * -1;
Ball.attack = true;
Ball._visible = true;
} else {
pickNewTarget();
}
} else {
pickNewTarget();
}
};
}
onClipEvent (enterFrame) {
killTarget();
}
Symbol 90 Button
on (press) {
_root.BuildMode = false;
_root.Selected = _parent.getDepth();
_root.Box._x = (_root.ToolTip._x = _parent._x);
_root.Box._y = (_root.ToolTip._y = _parent._y);
_root.ToolTip.GetValues(_root.Selected);
_root.ToolTip._visible = true;
_root.Box._visible = true;
_root.Box.play();
}
Symbol 94 MovieClip Frame 1
NAME = "Ultimate-1";
COST = 1000;
DMG = 400;
RNG = 200;
DEL = 3;
COST_NEXT = 2000;
DMG_NEXT = 2000;
RNG_NEXT = 210;
SPD = 3;
REQUIRE = 50;
stop();
Instance of Symbol 92 MovieClip "Arrow" in Symbol 94 MovieClip Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Instance of Symbol 93 MovieClip "Ball" in Symbol 94 MovieClip Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var rotation = 0;
var o = 1;
var k = 0;
var myTime = 0;
var myAtkTime = (myTime + _parent.DEL);
}
onClipEvent (enterFrame) {
if (attack == true) {
if (_root.TheTime >= myAtkTime) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
_x = (_x + (SIN((_rotation + 90) * PIE) * (_parent.SPD * 2)));
_y = (_y + ((COS((_rotation + 90) * PIE) * (_parent.SPD * 2)) * -1));
if (k >= 0) {
while ((_root["eff" + o] != null) && (_root["twr" + o] != null)) {
o++;
}
_root.attachMovie("Particle_Ult", "eff" + o, o);
_root["eff" + o]._x = _parent._parent._x + _x;
_root["eff" + o]._y = _parent._parent._y + _y;
o++;
k = 0;
if (o > 100) {
o = 0;
}
k = 0;
} else {
k++;
}
var XDIST = (_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
var YDIST = (_root["p" + _parent.Target]._y - (_parent._parent._y + _y));
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) < ((_parent.SPD * 2) + 1)) {
_root["p" + _parent.Target].HP = _root["p" + _parent.Target].HP - _parent.DMG;
_root["p" + _parent.Target]._alpha = (_root["p" + _parent.Target].HP / _root.Health) * 100;
_x = 0;
_y = 0;
if (_root["p" + _parent.Target].HP <= 0) {
_root["p" + _parent.Target].Death();
}
_parent.Target = 1;
_parent.pickNewTarget();
attack = false;
myAtkTime = _root.TheTime + _parent.DEL;
}
}
}
}
Symbol 94 MovieClip Frame 3
NAME = "Ultimate-2";
COST = 2000;
DMG = 1000;
RNG = 210;
DEL = 2;
COST_NEXT = 4000;
DMG_NEXT = 6000;
RNG_NEXT = 220;
SPD = 3;
REQUIRE = 70;
Arrow._x = (Arrow._y = -6);
stop();
Symbol 94 MovieClip Frame 5
NAME = "Ultimate-3";
COST = 4000;
DMG = 3000;
RNG = 220;
DEL = 2;
COST_NEXT = 6000;
DMG_NEXT = 24000;
RNG_NEXT = 220;
SPD = 3;
REQUIRE = 80;
Arrow._x = (Arrow._y = -7);
stop();
Symbol 94 MovieClip Frame 7
NAME = "Ultimate-4";
COST = 6000;
DMG = 10000;
RNG = 220;
DEL = 2;
COST_NEXT = 9000;
DMG_NEXT = 120000 /* 0x01D4C0 */;
RNG_NEXT = 220;
SPD = 3;
REQUIRE = 85;
Arrow._x = (Arrow._y = -8);
stop();
Symbol 94 MovieClip Frame 9
NAME = "Ultimate-5";
COST = 9000;
DMG = 60000;
RNG = 220;
DEL = 2;
COST_NEXT = 15000;
DMG_NEXT = 720000 /* 0x0AFC80 */;
RNG_NEXT = 230;
SPD = 3;
REQUIRE = 150;
Arrow._x = (Arrow._y = -9);
stop();
Symbol 94 MovieClip Frame 11
NAME = "Ultimate6";
COST = 15000;
DMG = 90000 /* 0x015F90 */;
RNG = 230;
DEL = 2;
COST_NEXT = "---";
DMG_NEXT = "---";
RNG_NEXT = "---";
SPD = 3;
REQUIRE = Infinity;
Arrow._x = (Arrow._y = -10);
stop();
Symbol 94 MovieClip Frame 12
gotoAndStop (11);
_root.txtMsg.text = "No Further Upgrades Available";
Instance of Symbol 94 MovieClip "Tower" in Symbol 95 MovieClip [5_TWR] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var Target = 1;
var Parent = _parent;
var PointTarget = _root["p" + Target];
var RNG;
var recDist = 9999;
pickNewTarget = function () {
recDist = 9000;
i = 1;
while (i < 11) {
var _local5 = _root["p" + i]._x - _parent._x;
var _local4 = _root["p" + i]._y - _parent._y;
var _local3 = ROUND(SQRT((_local5 * _local5) + (_local4 * _local4)));
if (_root["p" + i].active && (_root["p" + i].targetCP > 1)) {
if (_local3 <= RNG) {
if (_local3 <= recDist) {
Target = i;
PointTarget = _root["p" + Target];
}
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
recDist = _local3;
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
i++;
}
};
killTarget = function () {
if (PointTarget.active && (PointTarget.targetCP > 1)) {
var _local4 = _root["p" + Target]._x - _parent._x;
var _local3 = _root["p" + Target]._y - _parent._y;
var _local5 = ROUND(SQRT((_local4 * _local4) + (_local3 * _local3)));
if (_local5 <= RNG) {
Arrow._rotation = Arrow.angle * -1;
Ball.attack = true;
Ball._visible = true;
} else {
pickNewTarget();
}
} else {
pickNewTarget();
}
};
}
onClipEvent (enterFrame) {
killTarget();
}
Symbol 99 MovieClip [Effect_PlusMoney] Frame 1
txtCash.text = ["+ $" + Cash];
Symbol 99 MovieClip [Effect_PlusMoney] Frame 30
this.removeMovieClip();
Symbol 101 MovieClip Frame 30
stop();
Instance of Symbol 101 MovieClip in Symbol 102 MovieClip [Effect_Dust] Frame 1
onClipEvent (load) {
_rotation = (Math.random() * 360);
}
Instance of Symbol 101 MovieClip in Symbol 102 MovieClip [Effect_Dust] Frame 1
onClipEvent (load) {
_rotation = (Math.random() * 360);
}
Instance of Symbol 101 MovieClip in Symbol 102 MovieClip [Effect_Dust] Frame 1
onClipEvent (load) {
_rotation = (Math.random() * 360);
}
Instance of Symbol 101 MovieClip in Symbol 102 MovieClip [Effect_Dust] Frame 1
onClipEvent (load) {
_rotation = (Math.random() * 360);
}
Instance of Symbol 101 MovieClip in Symbol 102 MovieClip [Effect_Dust] Frame 1
onClipEvent (load) {
_rotation = (Math.random() * 360);
}
Instance of Symbol 101 MovieClip in Symbol 102 MovieClip [Effect_Dust] Frame 1
onClipEvent (load) {
_rotation = (Math.random() * 360);
}
Symbol 102 MovieClip [Effect_Dust] Frame 30
this.removeMovieClip();
Symbol 108 MovieClip Frame 30
_parent.removeMovieClip();
Instance of Symbol 108 MovieClip in Symbol 109 MovieClip [Particle_Fire] Frame 1
onClipEvent (load) {
_rotation = (Math.random() * 360);
minSize = _root.minSize;
allowAlpha = _root.allowAlpha;
}
onClipEvent (enterFrame) {
_rotation = (_rotation + 1);
if (allowAlpha) {
_alpha = (_alpha * 0.97);
if (_alpha < minSize) {
_parent.removeMovieClip();
}
} else {
_yscale = (_yscale * 0.94);
_xscale = (_yscale * 0.94);
if (_xscale < minSize) {
_parent.removeMovieClip();
}
}
}
Instance of Symbol 111 MovieClip in Symbol 112 MovieClip [Particle_Water] Frame 1
onClipEvent (load) {
_yscale = ((Math.random() * 50) + 50);
_xscale = ((Math.random() * 50) + 50);
_rotation = ((Math.random() * 50) + 50);
minSize = _root.minSize;
allowAlpha = _root.allowAlpha;
}
onClipEvent (enterFrame) {
_rotation = (_rotation + 2);
_yscale = (_yscale * 0.97);
_xscale = (_yscale * 0.97);
if (allowAlpha) {
_alpha = _xscale;
}
if (_xscale < minSize) {
_parent.removeMovieClip();
}
}
Instance of Symbol 114 MovieClip in Symbol 115 MovieClip [Particle_Z] Frame 1
onClipEvent (load) {
minSize = _root.minSize;
allowAlpha = _root.allowAlpha;
}
onClipEvent (enterFrame) {
_yscale = (_yscale * 0.9);
_xscale = (_yscale * 0.9);
_x = (_x+1);
if (allowAlpha) {
_alpha = _xscale;
}
if (_xscale < minSize) {
_parent.removeMovieClip();
}
}
Instance of Symbol 117 MovieClip in Symbol 118 MovieClip [Particle_Cash] Frame 1
onClipEvent (load) {
_rotation = (Math.random() * 360);
minSize = _root.minSize;
var XS = ((Math.random() * 10) - 5);
var YS = ((Math.random() * 10) - 5);
allowAlpha = _root.allowAlpha;
}
onClipEvent (enterFrame) {
_rotation = (_rotation + 2);
_yscale = (_yscale * 0.95);
_xscale = (_yscale * 0.95);
_parent._x = _parent._x + XS;
_parent._y = _parent._y + YS;
if (allowAlpha) {
_alpha = _xscale;
}
if (_xscale < minSize) {
_parent.removeMovieClip();
}
}
Instance of Symbol 120 MovieClip in Symbol 121 MovieClip [Particle_Needle] Frame 1
onClipEvent (load) {
_rotation = (Math.random() * 360);
minSize = _root.minSize;
allowAlpha = _root.allowAlpha;
}
onClipEvent (enterFrame) {
_rotation = (_rotation + 2);
_yscale = (_yscale * 0.95);
_xscale = (_yscale * 0.95);
if (allowAlpha) {
_alpha = _xscale;
}
if (_xscale < minSize) {
_parent.removeMovieClip();
}
}
Instance of Symbol 123 MovieClip in Symbol 124 MovieClip [Particle_Earth] Frame 1
onClipEvent (load) {
_rotation = (Math.random() * 360);
minSize = _root.minSize;
allowAlpha = _root.allowAlpha;
}
onClipEvent (enterFrame) {
_rotation = (_rotation + 2);
_yscale = (_yscale * 0.95);
_xscale = (_yscale * 0.95);
if (allowAlpha) {
_alpha = _xscale;
}
if (_xscale < minSize) {
_parent.removeMovieClip();
}
}
Instance of Symbol 126 MovieClip in Symbol 127 MovieClip [Particle_r2] Frame 1
onClipEvent (load) {
_rotation = (Math.random() * 360);
minSize = _root.minSize;
allowAlpha = _root.allowAlpha;
}
onClipEvent (enterFrame) {
_rotation = (_rotation + 2);
_yscale = (_yscale * 0.98);
_xscale = (_yscale * 0.98);
if (allowAlpha) {
_alpha = _xscale;
}
if (_xscale < minSize) {
_parent.removeMovieClip();
}
}
Instance of Symbol 129 MovieClip in Symbol 130 MovieClip [Particle_r] Frame 1
onClipEvent (load) {
_rotation = (Math.random() * 360);
minSize = _root.minSize;
allowAlpha = _root.allowAlpha;
}
onClipEvent (enterFrame) {
_rotation = (_rotation + 2);
_yscale = (_yscale * 0.98);
_xscale = (_yscale * 0.98);
if (allowAlpha) {
_alpha = _xscale;
}
if (_xscale < minSize) {
_parent.removeMovieClip();
}
}
Instance of Symbol 132 MovieClip in Symbol 133 MovieClip [Particle_S2] Frame 1
onClipEvent (load) {
_rotation = (Math.random() * 360);
minSize = _root.minSize;
allowAlpha = _root.allowAlpha;
}
onClipEvent (enterFrame) {
_rotation = (_rotation + 2);
_yscale = (_yscale * 0.98);
_xscale = (_yscale * 0.98);
if (allowAlpha) {
_alpha = _xscale;
}
if (_xscale < minSize) {
_parent.removeMovieClip();
}
}
Instance of Symbol 135 MovieClip in Symbol 136 MovieClip [Particle_S] Frame 1
onClipEvent (load) {
_rotation = (Math.random() * 360);
minSize = _root.minSize;
allowAlpha = _root.allowAlpha;
}
onClipEvent (enterFrame) {
_rotation = (_rotation + 2);
_yscale = (_yscale * 0.98);
_xscale = (_yscale * 0.98);
if (allowAlpha) {
_alpha = _xscale;
}
if (_xscale < minSize) {
_parent.removeMovieClip();
}
}
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip [Particle_Ult] Frame 1
onClipEvent (load) {
_rotation = (Math.random() * 360);
minSize = _root.minSize;
allowAlpha = _root.allowAlpha;
}
onClipEvent (enterFrame) {
_rotation = (_rotation + 2);
_yscale = (_yscale * 0.98);
_xscale = (_yscale * 0.98);
if (allowAlpha) {
_alpha = _xscale;
}
if (_xscale < minSize) {
_parent.removeMovieClip();
}
}
Instance of Symbol 141 MovieClip in Symbol 142 MovieClip [Particle_Wind] Frame 1
onClipEvent (load) {
minSize = _root.minSize;
allowAlpha = _root.allowAlpha;
}
onClipEvent (enterFrame) {
_rotation = (_rotation + 30);
_yscale = (_yscale * 0.95);
_xscale = (_yscale * 0.95);
if (allowAlpha) {
_alpha = _xscale;
}
if (_xscale < minSize) {
_parent.removeMovieClip();
}
}
Instance of Symbol 144 MovieClip in Symbol 145 MovieClip [Particle_Grass] Frame 1
onClipEvent (load) {
this._rotation = Math.random() * 360;
}
Instance of Symbol 144 MovieClip in Symbol 145 MovieClip [Particle_Grass] Frame 1
onClipEvent (load) {
this._rotation = Math.random() * 360;
}
Instance of Symbol 144 MovieClip in Symbol 145 MovieClip [Particle_Grass] Frame 1
onClipEvent (load) {
this._rotation = Math.random() * 360;
}
Instance of Symbol 144 MovieClip in Symbol 145 MovieClip [Particle_Grass] Frame 1
onClipEvent (load) {
this._rotation = Math.random() * 360;
}
Instance of Symbol 144 MovieClip in Symbol 145 MovieClip [Particle_Grass] Frame 1
onClipEvent (load) {
this._rotation = Math.random() * 360;
}
Instance of Symbol 144 MovieClip in Symbol 145 MovieClip [Particle_Grass] Frame 1
onClipEvent (load) {
this._rotation = Math.random() * 360;
}
Instance of Symbol 144 MovieClip in Symbol 145 MovieClip [Particle_Grass] Frame 1
onClipEvent (load) {
this._rotation = Math.random() * 360;
}
Instance of Symbol 144 MovieClip in Symbol 145 MovieClip [Particle_Grass] Frame 1
onClipEvent (load) {
this._rotation = Math.random() * 360;
}
Instance of Symbol 144 MovieClip in Symbol 145 MovieClip [Particle_Grass] Frame 1
onClipEvent (load) {
this._rotation = Math.random() * 360;
}
Symbol 145 MovieClip [Particle_Grass] Frame 30
this.removeMovieClip();
Symbol 147 Button
on (press) {
_root.BuildMode = false;
_root.Selected = _parent.getDepth();
_root.Box._x = (_root.ToolTip._x = _parent._x);
_root.Box._y = (_root.ToolTip._y = _parent._y);
_root.ToolTip.GetValues(_root.Selected);
_root.ToolTip._visible = true;
_root.Box._visible = true;
_root.Box.play();
}
Symbol 152 MovieClip Frame 1
var NAME = "Mixed Tower";
var COST = 1000;
var DMG = 1;
var nDMG = 0;
var RNG = 160;
var COST_NEXT = 1900;
var DMG_NEXT = 2;
var RNG_NEXT = 210;
var SPD = 3;
var REQUIRE = 0;
stop();
Instance of Symbol 149 MovieClip "Arrow" in Symbol 152 MovieClip Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var rotation = 0;
var o = 1;
var k = 0;
var myTime = 0;
var myAtkTime = (myTime + _parent.DEL);
}
onClipEvent (enterFrame) {
if (attack == true) {
if (_root.TheTime >= myAtkTime) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
_x = (_x + (SIN((_rotation + 90) * PIE) * (_parent.SPD * 2)));
_y = (_y + ((COS((_rotation + 90) * PIE) * (_parent.SPD * 2)) * -1));
if (k >= 0) {
while ((_root["eff" + o] != null) && (_root["twr" + o] != null)) {
o++;
}
_root.attachMovie("Particle_Water", "eff" + o, o);
_root["eff" + o]._x = _parent._parent._x + _x;
_root["eff" + o]._y = _parent._parent._y + _y;
o++;
k = 0;
if (o > 100) {
o = 0;
}
k = 0;
} else {
k++;
}
var XDIST = (_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
var YDIST = (_root["p" + _parent.Target]._y - (_parent._parent._y + _y));
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) < ((_parent.SPD * 2) + 1)) {
_root["p" + _parent.Target].HP = _root["p" + _parent.Target].HP - _parent.DMG;
_root["p" + _parent.Target]._alpha = (_root["p" + _parent.Target].HP / _root.Health) * 100;
_x = 0;
_y = 0;
if (_root["p" + _parent.Target].HP <= 0) {
_root["p" + _parent.Target].Death();
}
_parent.Target = 1;
_parent.pickNewTarget();
attack = false;
myAtkTime = _root.TheTime + _parent.DEL;
}
}
}
}
Instance of Symbol 150 MovieClip "Ball" in Symbol 152 MovieClip Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var rotation = 0;
var o = 1;
var k = 0;
var myTime = 0;
var myAtkTime = (myTime + _parent.DEL);
}
onClipEvent (enterFrame) {
if (attack == true) {
if (_root.TheTime >= myAtkTime) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
var rotation = (angle * -1);
while ((_root["eff" + o] != null) && (_root["twr" + o] != null)) {
o++;
}
if (ele == 1) {
_root.attachMovie("Particle_Water", "eff" + o, o);
} else if (ele == 2) {
_root.attachMovie("Particle_Wind", "eff" + o, o);
} else if (ele == 3) {
_root.attachMovie("Particle_Fire", "eff" + o, o);
} else if (ele == 4) {
_root.attachMovie("Particle_Earth", "eff" + o, o);
}
_root["eff" + o]._x = _parent._parent._x + _x;
_root["eff" + o]._y = _parent._parent._y + _y;
o++;
k = 0;
if (o > 100) {
o = 0;
}
_x = (_x + (SIN((rotation + 90) * PIE) * (_parent.SPD * 2)));
_y = (_y + ((COS((rotation + 90) * PIE) * (_parent.SPD * 2)) * -1));
var XDIST = (_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
var YDIST = (_root["p" + _parent.Target]._y - (_parent._parent._y + _y));
_root.sniperLine.clear();
_root.sniperLine.moveTo(_root["p" + _parent.Target]._x, _root["p" + _parent.Target]._y);
_root.sniperLine.lineTo(_parent._parent._x, _parent._parent._y);
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) < ((_parent.SPD * 2) + 1)) {
_root["p" + _parent.Target].HP = _root["p" + _parent.Target].HP - _parent.DMG;
_root["p" + _parent.Target]._alpha = (_root["p" + _parent.Target].HP / _root.Health) * 100;
_x = 0;
_y = 0;
if (_root["p" + _parent.Target].HP <= 0) {
_root["p" + _parent.Target].Death();
}
_parent.Target = 1;
_parent.pickNewTarget();
attack = false;
myAtkTime = _root.TheTime + _parent.DEL;
}
}
}
}
Symbol 152 MovieClip Frame 3
var NAME = "Enhanced Mixed Tower";
var COST = 1500;
var DMG = 2;
var RNG = 170;
var COST_NEXT = "---";
var DMG_NEXT = "---";
var RNG_NEXT = "---";
var SPD = 3;
var REQUIRE = Infinity;
stop();
Instance of Symbol 149 MovieClip "Arrow" in Symbol 152 MovieClip Frame 3
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var rotation = 0;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
rotation = angle * -1;
if ((rotation < 0) && (rotation >= -90)) {
_parent.nDMG = 240 * _parent.DMG;
_parent.RNG = 180;
_parent.SPD = 3;
_parent.Ball.ele = 4;
} else if ((rotation < -90) && (rotation >= -180)) {
_parent.nDMG = 480 * _parent.DMG;
_parent.RNG = 180;
_parent.SPD = 2.5;
_parent.Ball.ele = 3;
} else if ((rotation < -180) && (rotation >= -270)) {
_parent.nDMG = 6 * _parent.DMG;
_parent.RNG = 200;
_parent.SPD = 7;
_parent.Ball.ele = 2;
} else {
_parent.nDMG = 360 * _parent.DMG;
_parent.RNG = 220;
_parent.SPD = 3;
_parent.Ball.ele = 1;
}
}
Instance of Symbol 152 MovieClip "Tower" in Symbol 153 MovieClip [7_TWR] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var Target = 1;
var Parent = _parent;
var PointTarget = _root["p" + Target];
var RNG;
var recDist = 9999;
pickNewTarget = function () {
recDist = 9000;
i = 1;
while (i < 11) {
var _local5 = _root["p" + i]._x - _parent._x;
var _local4 = _root["p" + i]._y - _parent._y;
var _local3 = ROUND(SQRT((_local5 * _local5) + (_local4 * _local4)));
if (_root["p" + i].active && (_root["p" + i].targetCP > 1)) {
if (_local3 <= RNG) {
if (_local3 <= recDist) {
Target = i;
PointTarget = _root["p" + Target];
}
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
recDist = _local3;
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
i++;
}
};
killTarget = function () {
if (PointTarget.active && (PointTarget.targetCP > 1)) {
var _local4 = _root["p" + Target]._x - _parent._x;
var _local3 = _root["p" + Target]._y - _parent._y;
var _local5 = ROUND(SQRT((_local4 * _local4) + (_local3 * _local3)));
if (_local5 <= RNG) {
Arrow._rotation = Arrow.angle * -1;
Ball.attack = true;
Ball._visible = true;
} else {
pickNewTarget();
}
} else {
pickNewTarget();
}
};
}
onClipEvent (enterFrame) {
killTarget();
}
Symbol 155 Button
on (press) {
_root.BuildMode = false;
_root.Selected = _parent.getDepth();
_root.Box._x = (_root.ToolTip._x = _parent._x);
_root.Box._y = (_root.ToolTip._y = _parent._y);
_root.ToolTip.GetValues(_root.Selected);
_root.ToolTip._visible = true;
_root.Box._visible = true;
_root.Box.play();
}
Symbol 160 MovieClip Frame 1
NAME = "HitMan";
COST = 1000;
DMG = 500;
RNG = 800;
DEL = 6;
COST_NEXT = "---";
DMG_NEXT = "---";
RNG_NEXT = "---";
SPD = 3;
REQUIRE = Infinity;
stop();
Instance of Symbol 157 MovieClip "Arrow" in Symbol 160 MovieClip Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Instance of Symbol 159 MovieClip "Ball" in Symbol 160 MovieClip Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var rotation = 0;
var o = 1;
var k = 0;
var myTime = 0;
var myAtkTime = (myTime + _parent.DEL);
}
onClipEvent (enterFrame) {
if (attack == true) {
if (_root.TheTime >= myAtkTime) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
_x = (_x + (SIN((_rotation + 90) * PIE) * (_parent.SPD * 2)));
_y = (_y + ((COS((_rotation + 90) * PIE) * (_parent.SPD * 2)) * -1));
if (k >= 0) {
while ((_root["eff" + o] != null) && (_root["twr" + o] != null)) {
o++;
}
_root.attachMovie("Particle_Death", "eff" + o, o);
_root["eff" + o]._x = _parent._parent._x + _x;
_root["eff" + o]._y = _parent._parent._y + _y;
o++;
k = 0;
if (o > 100) {
o = 0;
}
k = 0;
} else {
k++;
}
var XDIST = (_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
var YDIST = (_root["p" + _parent.Target]._y - (_parent._parent._y + _y));
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) < ((_parent.SPD * 2) + 1)) {
_root["p" + _parent.Target].HP = _root["p" + _parent.Target].HP - _parent.DMG;
_root["p" + _parent.Target]._alpha = (_root["p" + _parent.Target].HP / _root.Health) * 100;
_x = 0;
_y = 0;
if (_root["p" + _parent.Target].HP <= 0) {
_root["p" + _parent.Target].Death();
}
_parent.Target = 1;
_parent.pickNewTarget();
attack = false;
myAtkTime = _root.TheTime + _parent.DEL;
}
}
}
}
Instance of Symbol 160 MovieClip "Tower" in Symbol 161 MovieClip [6_TWR] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var Target = 1;
var Parent = _parent;
var PointTarget = _root["p" + Target];
var RNG;
var recDist = 9999;
pickNewTarget = function () {
recDist = 9000;
i = 1;
while (i < 11) {
var _local5 = _root["p" + i]._x - _parent._x;
var _local4 = _root["p" + i]._y - _parent._y;
var _local3 = ROUND(SQRT((_local5 * _local5) + (_local4 * _local4)));
if (_root["p" + i].active && (_root["p" + i].targetCP > 1)) {
if (_local3 <= RNG) {
if (_local3 <= recDist) {
Target = i;
PointTarget = _root["p" + Target];
}
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
recDist = _local3;
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
i++;
}
};
killTarget = function () {
if (PointTarget.active && (PointTarget.targetCP > 1)) {
var _local4 = _root["p" + Target]._x - _parent._x;
var _local3 = _root["p" + Target]._y - _parent._y;
var _local5 = ROUND(SQRT((_local4 * _local4) + (_local3 * _local3)));
if (_local5 <= RNG) {
Arrow._rotation = Arrow.angle * -1;
Ball.attack = true;
Ball._visible = true;
} else {
pickNewTarget();
}
} else {
pickNewTarget();
}
};
}
onClipEvent (enterFrame) {
killTarget();
}
Instance of Symbol 163 MovieClip in Symbol 164 MovieClip [Particle_Death] Frame 1
onClipEvent (load) {
minSize = _root.minSize;
allowAlpha = _root.allowAlpha;
}
onClipEvent (enterFrame) {
_rotation = (_rotation + 2);
_yscale = (_yscale * 0.95);
_xscale = (_yscale * 0.95);
if (allowAlpha) {
_alpha = _xscale;
}
if (_xscale < minSize) {
_parent.removeMovieClip();
}
}
Symbol 168 Button
on (press) {
_root.BuildMode = false;
_root.Selected = _parent.getDepth();
_root.Box._x = (_root.ToolTip._x = _parent._x);
_root.Box._y = (_root.ToolTip._y = _parent._y);
_root.ToolTip.GetValues(_root.Selected);
_root.ToolTip._visible = true;
_root.Box._visible = true;
_root.Box.play();
}
Symbol 171 MovieClip [Fire_Tower] Frame 1
NAME = "Candle";
COST = 30;
DMG = 4;
RNG = 130;
COST_NEXT = 50;
DMG_NEXT = 8;
RNG_NEXT = 180;
DEL = 0;
SPD = 3;
REQUIRE = 0;
stop();
Instance of Symbol 170 MovieClip "Arrow" in Symbol 171 MovieClip [Fire_Tower] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Instance of Symbol 166 MovieClip [Fire_Ball] "Ball" in Symbol 171 MovieClip [Fire_Tower] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var rotation = 0;
var o = 1;
var k = 0;
var myTime = 0;
var myAtkTime = (myTime + _parent.DEL);
}
onClipEvent (enterFrame) {
if (attack == true) {
if (_root.TheTime >= myAtkTime) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
_x = (_x + (SIN((_rotation + 90) * PIE) * (_parent.SPD * 2)));
_y = (_y + ((COS((_rotation + 90) * PIE) * (_parent.SPD * 2)) * -1));
if (k >= 0) {
while ((_root["eff" + o] != null) && (_root["twr" + o] != null)) {
o++;
}
_root.attachMovie("Particle_Fire", "eff" + o, o);
_root["eff" + o]._x = _parent._parent._x + _x;
_root["eff" + o]._y = _parent._parent._y + _y;
o++;
k = 0;
if (o > 100) {
o = 0;
}
k = 0;
} else {
k++;
}
var XDIST = (_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
var YDIST = (_root["p" + _parent.Target]._y - (_parent._parent._y + _y));
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) < ((_parent.SPD * 2) + 1)) {
_root["p" + _parent.Target].HP = _root["p" + _parent.Target].HP - _parent.DMG;
_root["p" + _parent.Target]._alpha = (_root["p" + _parent.Target].HP / _root.Health) * 100;
_x = 0;
_y = 0;
if (_root["p" + _parent.Target].HP <= 0) {
_root["p" + _parent.Target].Death();
}
_parent.Target = 1;
_parent.pickNewTarget();
attack = false;
myAtkTime = _root.TheTime + _parent.DEL;
}
}
}
}
Symbol 171 MovieClip [Fire_Tower] Frame 3
NAME = "Lighter";
COST = 50;
DMG = 8;
RNG = 130;
COST_NEXT = 140;
DMG_NEXT = 24;
RNG_NEXT = 180;
SPD = 4;
DEL = 0;
REQUIRE = 0;
stop();
Symbol 171 MovieClip [Fire_Tower] Frame 5
NAME = "Fire";
COST = 140;
DMG = 24;
RNG = 140;
COST_NEXT = 280;
DMG_NEXT = 96;
RNG_NEXT = 180;
SPD = 8;
DEL = 1;
REQUIRE = 0;
stop();
Symbol 171 MovieClip [Fire_Tower] Frame 7
NAME = "Barbeque";
COST = 280;
DMG = 96;
RNG = 150;
COST_NEXT = 460;
DMG_NEXT = 480;
RNG_NEXT = 180;
SPD = 7;
DEL = 1;
REQUIRE = 0;
stop();
Symbol 171 MovieClip [Fire_Tower] Frame 9
NAME = "Inferno";
COST = 460;
DMG = 480;
RNG = 160;
COST_NEXT = 2120;
DMG_NEXT = 2880;
RNG_NEXT = 185;
SPD = 7;
DEL = 1;
REQUIRE = 55;
stop();
Symbol 171 MovieClip [Fire_Tower] Frame 11
NAME = "Flamethrower";
COST = 2120;
DMG = 2880;
RNG = 165;
COST_NEXT = 17750;
DMG_NEXT = 20160;
RNG_NEXT = 190;
SPD = 8;
DEL = 1;
REQUIRE = 75;
stop();
Symbol 171 MovieClip [Fire_Tower] Frame 13
NAME = "Advanced Fire Tower";
COST = 17750;
DMG = 20160;
RNG = 170;
COST_NEXT = 0;
DMG_NEXT = 0;
RNG_NEXT = 0;
SPD = 4;
DEL = 1;
REQUIRE = Infinity;
stop();
Symbol 171 MovieClip [Fire_Tower] Frame 14
gotoAndStop (13);
_root.txtMsg = "No Further Upgrades Available";
Instance of Symbol 171 MovieClip [Fire_Tower] "Tower" in Symbol 172 MovieClip [1_TWR] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var Target = 1;
var Parent = _parent;
var PointTarget = _root["p" + Target];
var RNG;
var recDist = 9999;
pickNewTarget = function () {
recDist = 9000;
i = 1;
while (i < 11) {
var _local5 = _root["p" + i]._x - _parent._x;
var _local4 = _root["p" + i]._y - _parent._y;
var _local3 = ROUND(SQRT((_local5 * _local5) + (_local4 * _local4)));
if (_root["p" + i].active && (_root["p" + i].targetCP > 1)) {
if (_local3 <= RNG) {
if (_local3 <= recDist) {
Target = i;
PointTarget = _root["p" + Target];
}
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
recDist = _local3;
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
i++;
}
};
killTarget = function () {
if (PointTarget.active && (PointTarget.targetCP > 1)) {
var _local4 = _root["p" + Target]._x - _parent._x;
var _local3 = _root["p" + Target]._y - _parent._y;
var _local5 = ROUND(SQRT((_local4 * _local4) + (_local3 * _local3)));
if (_local5 <= RNG) {
Arrow._rotation = Arrow.angle * -1;
Ball.attack = true;
Ball._visible = true;
} else {
pickNewTarget();
}
} else {
pickNewTarget();
}
};
}
onClipEvent (enterFrame) {
killTarget();
}
Symbol 176 MovieClip [fps] Frame 1
fps = 30;
var timeinit = new Date();
var lasttime = timeinit.getMilliseconds();
onEnterFrame = function () {
var _local1 = new Date();
timepassed = (((_local1.getMilliseconds() - lasttime) >= 0) ? (_local1.getMilliseconds() - lasttime) : (1000 + (_local1.getMilliseconds() - lasttime)));
fps = Math.round(10000 / timepassed) / 10;
lasttime = _local1.getMilliseconds();
};
Symbol 178 Button
on (press) {
_root.BuildMode = false;
_root.Selected = _parent.getDepth();
_root.Box._x = (_root.ToolTip._x = _parent._x);
_root.Box._y = (_root.ToolTip._y = _parent._y);
_root.ToolTip.GetValues(_root.Selected);
_root.ToolTip._visible = true;
_root.Box._visible = true;
_root.Box.play();
}
Symbol 187 MovieClip Frame 1
NAME = "Thief";
COST = 20;
DMG = 2;
RNG = 180;
DEL = 5;
COST_NEXT = 300;
DMG_NEXT = 2;
RNG_NEXT = 180;
SPD = 5;
REQUIRE = 0;
stop();
Instance of Symbol 180 MovieClip "Ball" in Symbol 187 MovieClip Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var rotation = 0;
var o = 1;
var k = 0;
var myTime = 0;
var myAtkTime = (myTime + _parent.DEL);
}
onClipEvent (enterFrame) {
if (attack == true) {
if (_root.TheTime >= myAtkTime) {
_visible = true;
x = ROUND(_x);
y = ROUND(_y) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
_x = (_x - (SIN((_rotation + 90) * PIE) * (_parent.SPD * 2)));
_y = (_y - ((COS((_rotation + 90) * PIE) * (_parent.SPD * 2)) * -1));
if (k > 3) {
while ((_root["eff" + o] != null) && (_root["twr" + o] != null)) {
o++;
}
_root.attachMovie("Particle_Cash", "eff" + o, o);
_root["eff" + o]._x = _parent._parent._x + _x;
_root["eff" + o]._y = _parent._parent._y + _y;
o++;
k = 0;
if (o > 100) {
o = 0;
}
} else {
k++;
}
var XDIST = _x;
var YDIST = _y;
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) < ((_parent.SPD * 2) + 1)) {
_root.Money = _root.Money + _parent.DMG;
_x = (_root["p" + _parent.Target]._x - _parent._parent._x);
_y = (_root["p" + _parent.Target]._y - _parent._parent._y);
_parent.Target = 1;
_parent.pickNewTarget();
attack = false;
}
}
}
}
Instance of Symbol 182 MovieClip "Arrow" in Symbol 187 MovieClip Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Symbol 187 MovieClip Frame 3
NAME = "Robber";
COST = 300;
DMG = 4;
RNG = 180;
COST_NEXT = 600;
DMG_NEXT = 2;
RNG_NEXT = 180;
SPD = 2;
REQUIRE = 10;
stop();
Instance of Symbol 180 MovieClip "Ball" in Symbol 187 MovieClip Frame 3
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var rotation = 0;
var o = 1;
var k = 0;
var myTime = 0;
var myAtkTime = (myTime + _parent.DEL);
}
onClipEvent (enterFrame) {
if (attack == true) {
if (_root.TheTime >= myAtkTime) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
_x = (_x + (SIN((_rotation + 90) * PIE) * (_parent.SPD * 2)));
_y = (_y + ((COS((_rotation + 90) * PIE) * (_parent.SPD * 2)) * -1));
if (k >= 0) {
while ((_root["eff" + o] != null) && (_root["twr" + o] != null)) {
o++;
}
_root.attachMovie("Particle_Cash", "eff" + o, o);
_root["eff" + o]._x = _parent._parent._x + _x;
_root["eff" + o]._y = _parent._parent._y + _y;
o++;
k = 0;
if (o > 100) {
o = 0;
}
k = 0;
} else {
k++;
}
var XDIST = (_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
var YDIST = (_root["p" + _parent.Target]._y - (_parent._parent._y + _y));
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) < ((_parent.SPD * 2) + 1)) {
_root["p" + _parent.Target].HP = _root["p" + _parent.Target].HP - _parent.DMG;
_root["p" + _parent.Target]._alpha = (_root["p" + _parent.Target].HP / _root.Health) * 100;
_x = 0;
_y = 0;
if (_root["p" + _parent.Target].HP <= 0) {
_root["p" + _parent.Target].Death();
}
_parent.Target = 1;
_parent.pickNewTarget();
attack = false;
myAtkTime = _root.TheTime + _parent.DEL;
}
}
}
}
Instance of Symbol 182 MovieClip "Arrow" in Symbol 187 MovieClip Frame 3
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_x = -7;
_y = -7;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Symbol 187 MovieClip Frame 5
NAME = "Cold Thief";
COST = 600;
DMG = 9;
RNG = 180;
COST_NEXT = "---";
DMG_NEXT = "---";
RNG_NEXT = "---";
SPD = 3;
REQUIRE = Infinity;
stop();
Instance of Symbol 182 MovieClip "Arrow" in Symbol 187 MovieClip Frame 5
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
_x = -9;
_y = -9;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Instance of Symbol 187 MovieClip "Tower" in Symbol 188 MovieClip [11_TWR] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var Target = 1;
var Parent = _parent;
var PointTarget = _root["p" + Target];
var RNG;
var recDist = 9999;
pickNewTarget = function () {
recDist = 9000;
i = 1;
while (i < 11) {
var _local5 = _root["p" + i]._x - _parent._x;
var _local4 = _root["p" + i]._y - _parent._y;
var _local3 = ROUND(SQRT((_local5 * _local5) + (_local4 * _local4)));
if (_root["p" + i].active && (_root["p" + i].targetCP > 1)) {
if (_local3 <= RNG) {
if (_local3 <= recDist) {
Target = i;
PointTarget = _root["p" + Target];
}
} else {
Ball.attack = false;
Ball._x = PointTarget._x - _parent._x;
Ball._y = PointTarget._y - _parent._y;
}
recDist = _local3;
} else {
Ball.attack = false;
Ball._x = PointTarget._x - _parent._x;
Ball._y = PointTarget._y - _parent._y;
}
i++;
}
};
killTarget = function () {
if (PointTarget.active && (PointTarget.targetCP > 1)) {
var _local4 = _root["p" + Target]._x - _parent._x;
var _local3 = _root["p" + Target]._y - _parent._y;
var _local5 = ROUND(SQRT((_local4 * _local4) + (_local3 * _local3)));
if (_local5 <= RNG) {
Arrow._rotation = Arrow.angle * -1;
Ball.attack = true;
Ball._visible = true;
} else {
pickNewTarget();
}
} else {
pickNewTarget();
}
};
}
onClipEvent (enterFrame) {
killTarget();
}
Symbol 190 Button
on (press) {
_root.BuildMode = false;
_root.Selected = _parent.getDepth();
_root.Box._x = (_root.ToolTip._x = _parent._x);
_root.Box._y = (_root.ToolTip._y = _parent._y);
_root.ToolTip.GetValues(_root.Selected);
_root.ToolTip._visible = true;
_root.Box._visible = true;
_root.Box.play();
}
Symbol 194 MovieClip Frame 1
NAME = "Thief";
COST = "---";
DMG = "---";
RNG = 200;
COST_NEXT = "---";
DMG_NEXT = "---";
RNG_NEXT = "---";
SPD = 5;
REQUIRE = Infinity;
stop();
Instance of Symbol 192 MovieClip "Arrow" in Symbol 194 MovieClip Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
}
onClipEvent (enterFrame) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
}
Instance of Symbol 193 MovieClip "Ball" in Symbol 194 MovieClip Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var rotation = 0;
var o = 1;
var k = 0;
var myTime = 0;
var myAtkTime = (myTime + _parent.DEL);
}
onClipEvent (enterFrame) {
if (attack == true) {
if (_root.TheTime >= myAtkTime) {
x = ROUND(_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
y = ROUND(_root["p" + _parent.Target]._y - (_parent._parent._y + _y)) * -1;
angle = ATAN(y / x) / PIE;
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
_rotation = (angle * -1);
_x = (_x + (SIN((_rotation + 90) * PIE) * (_parent.SPD * 2)));
_y = (_y + ((COS((_rotation + 90) * PIE) * (_parent.SPD * 2)) * -1));
if (k > 5) {
while ((_root["eff" + o] != null) && (_root["twr" + o] != null)) {
o++;
}
_root.attachMovie("Particle_Needle", "eff" + o, o);
_root["eff" + o]._x = _parent._parent._x + _x;
_root["eff" + o]._y = _parent._parent._y + _y;
o++;
k = 0;
if (o > 100) {
o = 0;
}
} else {
k++;
}
var XDIST = (_root["p" + _parent.Target]._x - (_parent._parent._x + _x));
var YDIST = (_root["p" + _parent.Target]._y - (_parent._parent._y + _y));
if (ROUND(SQRT((XDIST * XDIST) + (YDIST * YDIST))) < ((_parent.SPD * 2) + 1)) {
_root["p" + _parent.Target].SLOW_END = _root["p" + _parent.Target].LIFETIME + 5;
_root["p" + _parent.Target]._alpha = (_root["p" + _parent.Target].HP / _root.Health) * 100;
_x = 0;
_y = 0;
if (_root["p" + _parent.Target].HP <= 0) {
_root["p" + _parent.Target].Death();
}
_parent.Target = 1;
_parent.pickNewTarget();
attack = false;
}
}
}
}
Instance of Symbol 194 MovieClip "Tower" in Symbol 195 MovieClip [10_TWR] Frame 1
onClipEvent (load) {
var ATAN = Math.atan;
var SIN = Math.sin;
var COS = Math.cos;
var ROUND = Math.round;
var PIE = (Math.PI/180);
var angle = 0;
var SQRT = Math.sqrt;
var Target = 1;
var Parent = _parent;
var PointTarget = _root["p" + Target];
var RNG;
var recDist = 9999;
pickNewTarget = function () {
recDist = 9000;
i = 1;
while (i < 11) {
var _local5 = _root["p" + i]._x - _parent._x;
var _local4 = _root["p" + i]._y - _parent._y;
var _local3 = ROUND(SQRT((_local5 * _local5) + (_local4 * _local4)));
if (_root["p" + i].active && (_root["p" + i].targetCP > 1)) {
if (_local3 <= RNG) {
if (_local3 <= recDist) {
Target = i;
PointTarget = _root["p" + Target];
}
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
recDist = _local3;
} else {
Ball.attack = false;
Ball._x = (Ball._y = 0);
}
i++;
}
};
killTarget = function () {
if (PointTarget.active && (PointTarget.targetCP > 1)) {
var _local4 = _root["p" + Target]._x - _parent._x;
var _local3 = _root["p" + Target]._y - _parent._y;
var _local5 = ROUND(SQRT((_local4 * _local4) + (_local3 * _local3)));
if (_local5 <= RNG) {
Arrow._rotation = Arrow.angle * -1;
Ball.attack = true;
Ball._visible = true;
} else {
pickNewTarget();
}
} else {
pickNewTarget();
}
};
}
onClipEvent (enterFrame) {
killTarget();
}
Symbol 214 Button
on (release) {
_root.gotoAndStop(42);
}
Symbol 215 Button
on (release) {
_root.play();
}
Symbol 219 Button
on (press) {
_root.Mode++;
if (_root.Mode == 1) {
GFX.text = "NORMAL";
_root.minSize = 20;
_root.allowAlpha = false;
} else if (_root.Mode == 2) {
GFX.text = "LOW";
_root.minSize = 40;
_root.allowAlpha = false;
} else {
_root.Mode = 0;
GFX.text = "FULL";
_root.minSize = 10;
_root.allowAlpha = true;
}
}
Symbol 223 Button
on (release) {
getURL ("http://www.gamegecko.com/towerdefense.php", 1);
}
Symbol 225 Button
on (release) {
getURL ("http://www.gamegecko.com", 1);
}
Symbol 227 MovieClip Frame 1
stop();
Symbol 231 Button
on (release) {
getURL ("http://www.gamegecko.com/", 1);
}
Symbol 241 Button
on (release) {
if (_root.MENU._visible == true) {
_root.MENU._visible = false;
} else {
_root.MENU._visible = true;
}
_root.ToolTip._visible = false;
_root.Selected = 0;
_root.BuildMode = false;
_root.Box._visible = false;
}
on (rollOver) {
_root.BuildMode = false;
_root.Selected = 0;
_root.SelBox._visible = false;
_root.ToolTip._visible = false;
}
Symbol 246 Button
on (release) {
if (_root.MENU._visible == true) {
_root.MENU._visible = false;
} else {
_root.MENU._visible = true;
}
_root.ToolTip._visible = false;
_root.Selected = 0;
_root.BuildMode = false;
_root.Box._visible = false;
}
on (rollOver) {
_root.BuildMode = false;
_root.Selected = 0;
_root.SelBox._visible = false;
}
Symbol 262 MovieClip Frame 1
_root.numPts = 10;
stop();
Symbol 262 MovieClip Frame 2
_root.numPts = 9;
stop();
Symbol 262 MovieClip Frame 3
_root.numPts = 6;
stop();
Symbol 262 MovieClip Frame 4
_root.numPts = 6;
stop();
Symbol 262 MovieClip Frame 5
_root.numPts = 5;
stop();
Symbol 262 MovieClip Frame 6
_root.numPts = 3;
stop();
Symbol 262 MovieClip Frame 7
_root.numPts = 6;
stop();
Symbol 262 MovieClip Frame 8
_root.numPts = 7;
stop();
Symbol 262 MovieClip Frame 9
_root.numPts = 8;
stop();
Symbol 268 Button
on (press) {
_root.Path.gotoAndStop(2);
play();
}
Symbol 269 Button
on (press) {
_root.Path.gotoAndStop(5);
play();
}
Symbol 270 Button
on (press) {
_root.Path.gotoAndStop(8);
play();
}
Symbol 275 Button
on (press) {
_root.Path.gotoAndStop(3);
play();
}
Symbol 276 Button
on (press) {
_root.Path.gotoAndStop(6);
play();
}
Symbol 277 Button
on (press) {
_root.Path.gotoAndStop(9);
play();
}
Symbol 281 Button
on (press) {
_root.Path.gotoAndStop(1);
play();
}
Symbol 282 Button
on (press) {
_root.Path.gotoAndStop(4);
play();
}
Symbol 283 Button
on (press) {
_root.Path.gotoAndStop(7);
play();
}
Symbol 294 Button
on (release) {
if ((((((((((_root.p1.active == false) && (_root.p2.active == false)) && (_root.p3.active == false)) && (_root.p4.active == false)) && (_root.p5.active == false)) && (_root.p6.active == false)) && (_root.p7.active == false)) && (_root.p8.active == false)) && (_root.p9.active == false)) && (_root.p10.active == false)) {
if (_root.Loop.Pause == true) {
_root.Loop.Pause = false;
} else {
_root.Loop.Pause = true;
}
}
}
Symbol 296 Button
on (release) {
if (_root._quality == "HIGH") {
_root._quality = "LOW";
} else {
_root._quality = "HIGH";
}
}
Symbol 300 Button
on (release) {
getURL ("http://www.gamegecko.com/", 1);
}
Symbol 307 Button
on (press) {
this.startDrag();
}
on (release) {
stopDrag();
}
Symbol 312 Button
on (release) {
if (_root.Money >= 2000) {
_root.BuildMode = true;
_root.Selected = 6;
_root.ToolTip._visible = false;
} else {
_root.txtMsg.text = "Insufficient Funds.";
}
_visible = false;
}
Symbol 315 Button
on (release) {
if (_root.Money >= 800) {
_root.BuildMode = true;
_root.Selected = 7;
_root.ToolTip._visible = false;
} else {
_root.txtMsg.text = "Insufficient Funds.";
}
_visible = false;
}
Symbol 318 Button
on (release) {
if (_root.Money >= 7000) {
_root.BuildMode = true;
_root.Selected = 8;
_root.ToolTip._visible = false;
} else {
_root.txtMsg.text = "Insufficient Funds.";
}
_visible = false;
}
Symbol 321 Button
on (release) {
if (_root.Money >= 800) {
_root.BuildMode = true;
_root.Selected = 9;
_root.ToolTip._visible = false;
} else {
_root.txtMsg.text = "Insufficient Funds.";
}
_visible = false;
}
Symbol 325 Button
on (release) {
if (_root.Money >= 500) {
_root.BuildMode = true;
_root.Selected = 11;
_root.ToolTip._visible = false;
} else {
_root.txtMsg.text = "Insufficient Funds.";
}
_visible = false;
}
Symbol 328 Button
on (release) {
if (_root.Money >= 400) {
_root.BuildMode = true;
_root.Selected = 10;
_root.ToolTip._visible = false;
} else {
_root.txtMsg.text = "Insufficient Funds.";
}
_visible = false;
}
Symbol 332 Button
on (release) {
if (_root.Money >= 300000000) {
_root.BuildMode = true;
_root.Selected = 12;
_root.ToolTip._visible = false;
} else {
_root.txtMsg.text = "Insufficient Funds.";
}
_visible = false;
}
Symbol 335 Button
on (release) {
_visible = false;
_root.Selected = 0;
_root.BuildMode = false;
}
Symbol 339 Button
on (release) {
if (_root.Money >= 50) {
_root.BuildMode = true;
_root.Selected = 3;
_root.ToolTip._visible = false;
} else {
_root.txtMsg.text = "Insufficient Funds.";
}
_visible = false;
}
Symbol 344 Button
on (release) {
if (_root.Money >= 50) {
_root.BuildMode = true;
_root.Selected = 1;
_root.ToolTip._visible = false;
} else {
_root.txtMsg.text = "Insufficient Funds.";
}
_visible = false;
}
Symbol 348 Button
on (release) {
if (_root.Money >= 30) {
_root.BuildMode = true;
_root.Selected = 2;
_root.ToolTip._visible = false;
} else {
_root.txtMsg.text = "Insufficient Funds.";
}
_visible = false;
}
Symbol 353 Button
on (release) {
if (_root.Money >= 30) {
_root.BuildMode = true;
_root.Selected = 4;
_root.ToolTip._visible = false;
} else {
_root.txtMsg.text = "Insufficient Funds.";
}
_visible = false;
}
Symbol 357 Button
on (release) {
if (_root.Money >= 3000) {
_root.BuildMode = true;
_root.Selected = 5;
_root.ToolTip._visible = false;
} else {
_root.txtMsg.text = "Insufficient Funds.";
}
_visible = false;
}
Symbol 362 Button
on (release) {
if (_root.Money >= 10) {
_root.BuildMode = true;
_root.Selected = 13;
_root.ToolTip._visible = false;
} else {
_root.txtMsg.text = "Insufficient Funds.";
}
_visible = false;
}
Symbol 367 Button
on (release) {
if (_root.Money >= 500) {
_root.BuildMode = true;
_root.Selected = 15;
_root.ToolTip._visible = false;
} else {
_root.txtMsg.text = "Insufficient Funds.";
}
_visible = false;
}
Symbol 372 Button
on (release) {
if (_root.Money >= 80) {
_root.BuildMode = true;
_root.Selected = 14;
_root.ToolTip._visible = false;
} else {
_root.txtMsg.text = "Insufficient Funds.";
}
_visible = false;
}
Symbol 385 MovieClip Frame 1
GetValues = function (SEL) {
NowName.text = _root["twr" + SEL].Tower.NAME;
NowDmg.text = _root["twr" + SEL].Tower.DMG;
NowRng.text = _root["twr" + SEL].Tower.RNG;
NewName.text = _root["twr" + SEL].Tower.NAME_NEXT;
NewDmg.text = _root["twr" + SEL].Tower.DMG_NEXT;
NewRng.text = _root["twr" + SEL].Tower.RNG_NEXT;
NewCost.text = _root["twr" + SEL].Tower.COST_NEXT;
trace("GOT VALUES: DMG = " + _root["twr" + SEL].Tower.DMG);
};
stop();
Symbol 424 MovieClip Frame 1
stop();
Symbol 424 MovieClip Frame 2
stop();
Symbol 438 Button
on (press) {
this.startDrag(0);
}
on (release) {
stopDrag();
}
Symbol 443 Button
on (release) {
var NEXTCOST = _root["twr" + _root.Selected].Tower.COST_NEXT;
var REQ = _root["twr" + _root.Selected].Tower.REQUIRE;
if (NEXTCOST <= _root.Money) {
if (_root.Wave >= REQ) {
_root.Money = _root.Money - NEXTCOST;
_root["twr" + _root.Selected].Tower.play();
_root.Effect_Grass(_root["twr" + _root.Selected]._x, _root["twr" + _root.Selected]._y);
_visible = false;
_root.Selected = 0;
_root.BuildMode = false;
_root.Box._visible = false;
} else {
_root.txtMsg.text = ("You must be on wave [" + REQ) + "] or higher to upgrade!";
}
} else {
_root.txtMsg.text = "Insufficient Funds!";
}
}
Symbol 453 Button
on (release) {
_visible = false;
_root.Selected = 0;
_root.BuildMode = false;
_root.Box._visible = false;
}
Symbol 455 MovieClip Frame 1
GetValues(_root.Selected);
stop();
Symbol 459 Button
on (keyPress "<Space>") {
if ((((((((((_root.p1.active == false) && (_root.p2.active == false)) && (_root.p3.active == false)) && (_root.p4.active == false)) && (_root.p5.active == false)) && (_root.p6.active == false)) && (_root.p7.active == false)) && (_root.p8.active == false)) && (_root.p9.active == false)) && (_root.p10.active == false)) {
_root.Time = 0;
_root.Loop.Pause = false;
}
}
Symbol 472 Button
on (press) {
getURL ("www.rstd.net", 1);
}
Symbol 473 Button
on (release) {
_visible = false;
}
Symbol 479 Button
on (release) {
gotoAndStop (36);
}