Frame 1
var LevelSelected;
var EnemyTypes = 10;
var Difficulty;
var MyHealth;
var Cr;
var Placing = 0;
var SelIndex;
var SelDepth;
GetRnd = function (min, max) {
var _local1;
_local1 = (Math.random() * (max - min)) + min;
return(_local1);
};
GetRndInt = function (min, max) {
var _local1;
_local1 = Math.floor((Math.random() * ((max - min) + 1)) + min);
return(_local1);
};
Frame 3
stop();
var MusicLoaded;
var TrackPlaying;
if ((MusicLoaded == false) or (MusicLoaded == undefined)) {
_root.createEmptyMovieClip("mSoundTrackHolder1", this.getNextHighestDepth());
var sndTrack1 = new Sound(_root.mSoundTrackHolder1);
sndTrack1.attachSound("TitleMusic");
_root.createEmptyMovieClip("mSoundTrackHolder2", this.getNextHighestDepth());
var sndTrack2 = new Sound(_root.mSoundTrackHolder2);
sndTrack2.attachSound("Music1");
MusicLoaded = true;
}
PlaySong = function (index) {
if (MusicLoaded == true) {
if ((index == 1) && (TrackPlaying != 1)) {
sndTrack2.stop();
sndTrack1.start(0, 100);
TrackPlaying = 1;
}
if ((index == 2) && (TrackPlaying != 2)) {
sndTrack1.stop();
sndTrack2.start(0, 100);
TrackPlaying = 2;
}
}
};
PlaySong(1);
Frame 4
stop();
Frame 7
PlaySong(2);
var fGlow = (new flash.filters.GlowFilter(0, 1, 25, 25, 3, 1, false, false));
var fDropShadow = (new flash.filters.DropShadowFilter(5, 45, 0, 1, 10, 10, 1, 1, false, false, false));
_root.attachMovie(LevelSelected, "Path", _root.getNextHighestDepth());
_root.Path._x = 0;
_root.Path._y = 0;
_root.Path.filters = [fGlow];
_root.Path._alpha = 50;
_root.attachMovie("mcBase", "Base", _root.getNextHighestDepth());
_root.Base._x = 560;
_root.Base._y = 237;
_root.Base._alpha = 90;
_root.attachMovie("mcTurrets", "BuyTurretsWindow", _root.getNextHighestDepth());
_root.BuyTurretsWindow._x = 537;
_root.BuyTurretsWindow._y = 383;
_root.BuyTurretsWindow.filters = [fDropShadow];
_root.BuyTurretsWindow._alpha = 60;
_root.attachMovie("mcWaves", "WavesWindow", _root.getNextHighestDepth());
_root.WavesWindow._x = 2;
_root.WavesWindow._y = 383;
_root.WavesWindow.filters = [fDropShadow];
_root.WavesWindow._alpha = 60;
var Turrets = 0;
var tType = new Array(200);
var tDep = new Array(200);
var tPower = new Array(200);
var tPowerLev = new Array(200);
var tReloadLev = new Array(200);
var tRangeLev = new Array(200);
var tReload = new Array(200);
var tRange = new Array(200);
var tX = new Array(200);
var tY = new Array(200);
var tActive = new Array(200);
var TPower = new Array([5, 10, 30, 80, 120, 190, 320, 500, 950, 1400], [30, 50, 70, 120, 200, 400, 550, 750, 1250, 2500], [100, 150, 225, 350, 500, 700, 950, 1400, 2500, 5000], [3, 8, 19, 40, 70, 145, 210, 385, 700, 1000], [100, 150, 225, 335, 500, 750, 1135, 1700, 2600, 3500]);
var TPowerCost = new Array([0, 50, 200, 800, 1900, 4000, 8000, 14500, 25000, 40000], [0, 50, 250, 900, 2000, 4500, 9950, 16000, 26000, 45000], [0, 100, 300, 1000, 2300, 4500, 10550, 17000, 30000, 54500], [0, 50, 150, 600, 1500, 3000, 6000, 11500, 20000, 30000], [0, 300, 500, 700, 1200, 1800, 2500, 3500, 6000, 10000]);
var TReload = new Array([7, 6, 6, 5, 5, 5, 4, 4, 4, 3], [12, 11, 11, 10, 10, 10, 9, 9, 9, 8], [45, 42, 37, 34, 31, 30, 28, 27, 24, 23], [10, 9, 9, 8, 8, 8, 8, 7, 7, 6], [75, 73, 71, 69, 67, 65, 63, 61, 59, 55]);
var TReloadCost = new Array([0, 30, 100, 330, 650, 1200, 3500, 8000, 15000, 45000], [0, 40, 120, 400, 750, 1000, 2500, 4000, 7500, 11000], [0, 100, 300, 550, 900, 1250, 3000, 5000, 8000, 19000], [0, 30, 100, 330, 650, 1200, 3500, 8000, 15000, 45000], [0, 300, 600, 1200, 2000, 3200, 6000, 8000, 12000, 20000]);
var TRange = new Array([75, 85, 100, 115, 125, 150, 160, 180, 200, 250], [50, 55, 65, 75, 85, 95, 100, 110, 115, 120], [145, 160, 175, 205, 230, 250, 275, 310, 340, 375], [65, 75, 90, 105, 115, 130, 150, 170, 190, 200], [75, 85, 95, 105, 115, 125, 135, 145, 155, 170]);
var TRangeCost = new Array([0, 125, 200, 550, 900, 1900, 3500, 5000, 8500, 13000], [0, 165, 300, 650, 1200, 3500, 4500, 6000, 12000, 30000], [0, 200, 450, 750, 1500, 4500, 11000, 15000, 20000, 35000], [0, 125, 200, 550, 900, 1900, 3500, 5000, 8500, 13000], [0, 400, 700, 1000, 1400, 2300, 3500, 5000, 8500, 10000]);
var wpxl1 = new Array(61, 61, 149, 149, 375, 375, 568, 568, 250, 250, 55, 55, 147, 147, 325, 325, 482, 482, 680);
var wpyl1 = new Array(-25, 136, 136, 65, 65, 224, 224, 144, 144, 224, 224, 357, 357, 296, 296, 351, 351, 288, 288);
var wpnl1 = 19;
var wpxl2 = new Array(-25, 571, 571, 63, 63, 680);
var wpyl2 = new Array(63, 63, 187, 187, 312, 312);
var wpnl2 = 6;
var wpX = new Array(1);
var wpY = new Array(1);
var Waypoints;
var eCount = 0;
var eHp = new Array(250);
var wHp = new Array(150);
var eMHp = new Array(250);
var eType = new Array(250);
var wType = new Array(150);
var eWave = new Array(250);
var eSpeed = new Array(250);
var wSpeed = new Array(150);
var eSlowedFor = new Array(250);
var eSpeedBU = new Array(250);
var eActive = new Array(250);
var eWaiting = new Array(250);
var ePower = new Array(250);
var wPower = new Array(150);
var eCredits = new Array(250);
var wCredits = new Array(150);
var eWp = new Array(250);
var eArmor = new Array(250);
var wArmor = new Array(150);
var eElement = new Array(250);
var wElement = new Array(150);
var eRot = new Array(250);
var eDist = new Array(250);
var eX = new Array(250);
var eY = new Array(250);
var eIndex = new Array(250);
var eMods = new Array(250);
var wMods = new Array(150);
var wNum = new Array(150);
var wCurNum = new Array(150);
var eLeft = 0;
var wFrameWait = new Array(150);
if (LevelSelected == "mcLevel1") {
Waypoints = wpnl1;
wpX = wpxl1;
wpY = wpyl1;
}
if (LevelSelected == "mcLevel2") {
Waypoints = wpnl2;
wpX = wpxl2;
wpY = wpyl2;
}
var Waves;
var CurWave = 0;
var FramesLeft = 504;
GenerateWaves = function () {
var _local3;
var _local2 = 0;
r = 0;
while (r < 5) {
i = 0;
while (i < EnemyTypes) {
_root.WavesWindow.WaveStrip.attachMovie("mcEnemy", "WaveIcon" + _local2, _root.WavesWindow.WaveStrip.getNextHighestDepth());
_root.WavesWindow.WaveStrip["WaveIcon" + _local2]._y = 20;
_root.WavesWindow.WaveStrip["WaveIcon" + _local2]._x = 16 + (32 * _local2);
_root.WavesWindow.WaveStrip["WaveIcon" + _local2].gotoAndStop(i + 1);
_root.WavesWindow.WaveStrip["WaveIcon" + _local2]._width = 16;
_root.WavesWindow.WaveStrip["WaveIcon" + _local2]._height = 26;
wType[_local2] = i + 1;
tspd = 2;
if (i == 4) {
tspd = 1;
}
if (i == 3) {
tspd = 3;
}
if (i == 8) {
tspd = 3.5;
}
if (i == 9) {
tspd = 1.5;
}
wSpeed[_local2] = tspd;
tcrdt = (_local2 + 1) * 3.5;
if (i == 4) {
tcrdt = tcrdt * 25;
}
if (i == 9) {
tcrdt = tcrdt * 100;
}
wCredits[_local2] = Math.floor(tcrdt);
tpwr = 1;
tpwr = tpwr + Math.floor(_local2 / 10);
if (i == 4) {
tpwr = tpwr * 3;
}
if (i == 9) {
tpwr = tpwr * 5;
}
wPower[_local2] = tpwr;
tarm = 0;
tarm = tarm + Math.floor(_local2 / 2);
wArmor[_local2] = tarm;
wElement[_local2] = 0;
wWave[_local2] = _local2 + 1;
tnum = GetRndInt(20, 32);
if (i == 4) {
tnum = GetRndInt(2, 4);
}
if (i == 9) {
tnum = 1;
}
wNum[_local2] = tnum;
tfw = 40;
if (i == 4) {
tfw = GetRndInt(220, 300);
}
if (i == 7) {
tfw = 20;
}
if (i == 9) {
tfw = 24;
}
wFrameWait[_local2] = tfw;
_local3 = Math.pow(((r * EnemyTypes) + i) + 1, 2.4) * 3;
if (Difficulty == 1) {
_local3 = _local3 * 0.75;
}
if (Difficulty == 3) {
_local3 = _local3 * 1.25;
}
if (i == 4) {
_local3 = _local3 * 10;
}
if (i == 9) {
_local3 = _local3 * 25;
}
if (i == 7) {
_local3 = _local3 * 0.7;
}
wHp[_local2] = Math.floor(_local3);
_local2++;
i++;
}
r++;
}
twaves = EnemyTypes * 5;
Waves = twaves;
WavesWindow.timeleft = Math.floor(FramesLeft / 24);
};
SendWave = function (w) {
var _local1 = 0;
var _local3 = 2;
WavesWindow.wavenum = w + 1;
i = 0;
while (i < wNum[w]) {
_local3 = 2;
if (eCount > 0) {
_local3 = 0;
ii = 0;
while (ii < eCount) {
if (eHp[ii] <= 0) {
_local3 = 1;
_local1 = ii;
}
if (_local3 == 1) {
break;
}
ii++;
}
}
if (eCount < 1) {
_local1 = 0;
eCount = 1;
}
if (_local3 == 0) {
eCount++;
_local1 = eCount - 1;
}
eType[_local1] = wType[w];
eHp[_local1] = wHp[w];
eMHp[_local1] = wHp[w];
eArmor[_local1] = wArmor[w];
ePower[_local1] = wPower[w];
eCredits[_local1] = wCredits[w];
eSpeed[_local1] = wSpeed[w];
eSpeedBU[_local1] = 0;
eSlowedFor[_local1] = 0;
eWaiting[_local1] = (wFrameWait[w] * i) + 1;
eWp[_local1] = 0;
eActive[_local1] = 0;
eX[_local1] = 700;
eY[_local1] = 700;
eDist[_local1] = 0;
eRot[_local1] = 180;
eWave[_local1] = w;
i++;
}
wCurNum[w] = wNum[w];
eLeft = eLeft + wNum[w];
if (w < (Waves - 1)) {
WavesWindow.gotowave = w + 1;
}
};
AddTurret = function (iType, iDep) {
tType[Turrets] = iType;
tDep[Turrets] = iDep;
tPower[Turrets] = 0;
tReload[Turrets] = 0;
tRange[Turrets] = 0;
tX[Turrets] = -1;
tY[Turrets] = -1;
tActive[Turrets] = 0;
Turrets++;
};
GenerateWaves();
Frame 8
if (Cr != null) {
WavesWindow.credits = Cr;
}
if (FramesLeft > 0) {
FramesLeft--;
}
if (FramesLeft > 0) {
WavesWindow.timeleft = Math.floor(FramesLeft / 24);
}
if (FramesLeft <= 0) {
WavesWindow.timeleft = "";
}
WavesWindow.health = MyHealth;
if (FramesLeft == 0) {
if (CurWave < Waves) {
SendNextWave();
} else {
gotoAndStop (11);
}
}
if (wCurNum[CurWave - 1] != null) {
WavesWindow.ecount = (wCurNum[CurWave - 1] + " / ") + eLeft;
if ((wCurNum[CurWave - 1] <= 0) && (FramesLeft <= 0)) {
FramesLeft = 504;
}
}
if (eCount > 0) {
e = 0;
while (e < eCount) {
if (eWaiting[e] > 0) {
eWaiting[e]--;
if (eWaiting[e] == 0) {
eActive[e] = 1;
eX[e] = wpX[0];
eY[e] = wpY[0];
eWp[e] = 1;
_root.attachMovie("mcEnemyH", "Enemy" + e, _root.getNextHighestDepth());
_root["Enemy" + e].EnemyFrame.gotoAndStop(eType[e]);
_root["Enemy" + e]._x = eX[e];
_root["Enemy" + e]._y = eY[e];
_root["Enemy" + e].EnemyFrame._rotation = 180;
_root["Enemy" + e]._visible = true;
eLeft--;
}
} else if ((eActive[e] == 1) && (eHp[e] > 0)) {
var iix;
var iiy;
if (eSlowedFor[e] > 0) {
eSlowedFor[e]--;
if (eSlowedFor[e] <= 0) {
eSpeed[e] = eSpeedBU[e];
eSpeedBU[e] = 0;
}
}
dist_x = wpX[eWp[e]] - eX[e];
dist_y = wpY[eWp[e]] - eY[e];
angle = Math.atan2(dist_y, dist_x);
if ((Math.abs(dist_x) + Math.abs(dist_y)) <= 1) {
eWp[e]++;
if (eWp[e] >= Waypoints) {
MyHealth = MyHealth - ePower[e];
WavesWindow.health = MyHealth;
eHp[e] = -100;
eX[e] = 900;
eY[e] = 900;
eActive[i] = 0;
wCurNum[eWave[e]]--;
WavesWindow.ecount = (wCurNum[CurWave - 1] + " / ") + eLeft;
_root["Enemy" + e].removeMovieClip();
if (MyHealth <= 0) {
gotoAndStop (12);
}
}
}
if ((Math.abs(dist_x) > 1) && (Math.abs(dist_x) < eSpeed[e])) {
iix = dist_x;
} else {
iix = eSpeed[e] * Math.cos(angle);
}
if ((Math.abs(dist_y) > 1) && (Math.abs(dist_y) < eSpeed[e])) {
iiy = dist_y;
} else {
iiy = eSpeed[e] * Math.sin(angle);
}
eX[e] = eX[e] + iix;
eY[e] = eY[e] + iiy;
eDist[e] = eDist[e] + eSpeed[e];
eRot[e] = ((angle / Math.PI) * 180) + 90;
_root["Enemy" + e].EnemyFrame._rotation = eRot[e];
_root["Enemy" + e]._x = eX[e];
_root["Enemy" + e]._y = eY[e];
}
e++;
}
}
SendNextWave = function () {
if (CurWave < Waves) {
if ((eCount + wNum[CurWave]) < 250) {
SendWave(CurWave);
CurWave++;
FramesLeft = -1;
}
}
};
Frame 9
gotoAndPlay (8);
Frame 11
WavesWindow.removeMovieClip();
BuyTurretsWindow.removeMovieClip();
Path.removeMovieClip();
stop();
Frame 12
WavesWindow.removeMovieClip();
BuyTurretsWindow.removeMovieClip();
Path.removeMovieClip();
stop();
Symbol 7 MovieClip [mcTHeavy] Frame 1
var Target;
var ShowAOE;
var Range;
var Placed;
var Index;
var CanPlace;
var Cooldown;
var WaitTime;
var Attack;
var Dep;
var Power;
var Reload;
var PowerLev;
var ReloadLev;
var RangeLev;
var Selected;
if (Cooldown > 0) {
Cooldown--;
}
if (Selected == 1) {
_root.SelDepth = Dep;
}
if ((Key.isDown(27) && (Placed == undefined)) or (Placed < 1)) {
_root.Cr = _root.Cr + 150;
_root.WavesWindow.credits = _root.Cr;
_root.Placing = 0;
Placed = 0;
ShowAOE = 0;
_root.tActive[Index] = 0;
this.removeMovieClip();
}
onMouseDown = function () {
if ((Placed == 0) or (Placed == null)) {
if (CanPlace == 1) {
Placed = 1;
_root.tX[Index] = this._x;
_root.tY[Index] = this._y;
_root.Placing = 0;
ShowAOE = 0;
_root.tActive[Index] = 1;
}
} else if (THeavy.hitTest(_root._xmouse, _root._ymouse, false)) {
ShowAOE = 1;
Selected = 1;
_root.SelIndex = Index;
_root.SelDepth = Dep;
d = _root.getNextHighestDepth();
_root.attachMovie("mcTurretStatus", "TurretStatus" + d, d);
_root["TurretStatus" + d].SelDep = Dep;
_root["TurretStatus" + d]._x = this._x;
_root["TurretStatus" + d]._y = this._y;
if (_root["TurretStatus" + d]._y < 80) {
_root["TurretStatus" + d]._y = 80;
}
if (_root["TurretStatus" + d]._y > 420) {
_root["TurretStatus" + d]._y = 420;
}
if (_root["TurretStatus" + d]._x < 75) {
_root["TurretStatus" + d]._x = 75;
}
if (_root["TurretStatus" + d]._x > 575) {
_root["TurretStatus" + d]._x = 575;
}
_root["TurretStatus" + d]._alpha = 70;
} else {
ShowAOE = 0;
Selected = -1;
_root.SelIndex = -1;
_root.SelDepth = -1;
}
};
if (ShowAOE > 0) {
AOE._visible = true;
AOE._width = Range * 2;
AOE._x = 0;
AOE._height = Range * 2;
AOE._y = 0;
} else {
AOE._visible = false;
}
if ((Placed == 0) or (Placed == null)) {
this._x = _root._xmouse;
this._y = _root._ymouse;
ShowAOE = 1;
Target = -1;
CanPlace = 1;
if (((_root.Path.hitTest(this._x - ((THeavy_width / 2) + 5), this._y - ((THeavy._height / 2) + 5), true) or _root.Path.hitTest(this._x + ((THeavy._width / 2) + 5), this._y + ((THeavy._height / 2) + 5), true)) or _root.Path.hitTest(this._x - ((THeavy._width / 2) + 5), this._y + ((THeavy._height / 2) + 5), true)) or _root.Path.hitTest(this._x + ((THeavy._width / 2) + 5), this._y - ((THeavy._height / 2) + 5), true)) {
CanPlace = 0;
}
if (_root.Turrets > 1) {
i = 0;
while (i < _root.Turrets) {
if (_root.tDep[i] != Dep) {
Dst2 = Math.sqrt(Math.pow(this._x - _root["T" + _root.tDep[i]]._x, 2) + Math.pow(this._y - _root["T" + _root.tDep[i]]._y, 2));
if ((Dst2 <= 19) && (_root.tActive[i] == 1)) {
CanPlace = 0;
}
}
i++;
}
}
if (CanPlace == 0) {
ShowAOE = 0;
}
}
if (Target >= 0) {
dist_x = _root.eX[Target] - this._x;
dist_y = _root.eY[Target] - this._y;
angle = Math.atan2(dist_y, dist_x);
this._rotation = ((angle / Math.PI) * 180) + 90;
Dst = Math.sqrt(Math.pow(this._x - _root.eX[Target], 2) + Math.pow(this._y - _root.eY[Target], 2));
if (Dst > Range) {
Target = -1;
} else if (_root.eHp[Target] > 0) {
if (Cooldown <= 0) {
_root.eHp[Target] = _root.eHp[Target] - Power;
_root["Enemy" + Target].HealthBar._xscale = (_root.eHp[Target] / _root.eMHp[Target]) * 100;
_root["Enemy" + Target].HealthBar._x = -10 + ((20 - _root["Enemy" + Target].HealthBar._width) / 2);
_root.Fire2.gotoAndPlay(3);
d = _root.getNextHighestDepth();
_root.attachMovie("mcBullet", "Bullet" + d, d);
_root["Bullet" + d].x = this._x;
_root["Bullet" + d].y = this._y;
_root["Bullet" + d]._x = this._x;
_root["Bullet" + d]._y = this._y;
_root["Bullet" + d].speed = 20;
_root["Bullet" + d].xT = _root.eX[Target];
_root["Bullet" + d].yT = _root.eY[Target];
Cooldown = Reload;
if (_root.eHp[Target] <= 0) {
_root.Cr = _root.Cr + _root.eCredits[Target];
_root.WavesWindow.credits = _root.Cr;
if (Difficulty == 1) {
_root.Cr = _root.Cr + (_root.eCredits[Target] * 0.25);
}
_root.Cr = Math.floor(_root.Cr);
_root["Enemy" + Target].removeMovieClip();
_root.wCurNum[_root.eWave[Target]]--;
Target = -1;
}
}
}
if ((_root.eHp[Target] <= 0) && (Target >= 0)) {
Target = -1;
}
}
if (((Target == -1) && (Placed == 1)) && (_root.eCount > 0)) {
FoundTarget = 0;
i = 0;
while (i < _root.eCount) {
Dst = Math.sqrt(Math.pow(this._x - _root.eX[i], 2) + Math.pow(this._y - _root.eY[i], 2));
if ((((Dst <= Range) && (Dst != null)) && (Dst > 0)) && (_root.eHp[i] > 0)) {
if (FoundTarget == 0) {
FoundTarget = 1;
Target = i;
} else if (_root.eDist[i] > _root.eDist[Target]) {
Target = i;
}
}
i++;
}
}
Symbol 7 MovieClip [mcTHeavy] Frame 2
gotoAndPlay (1);
Symbol 10 MovieClip [mcTSniper] Frame 1
var Target;
var ShowAOE;
var Range;
var Placed;
var Index;
var CanPlace;
var Cooldown;
var WaitTime;
var Attack;
var Dep;
var Power;
var Reload;
var PowerLev;
var ReloadLev;
var RangeLev;
var Selected;
if (Cooldown > 0) {
Cooldown--;
}
if (Selected == 1) {
_root.SelDepth = Dep;
}
if ((Key.isDown(27) && (Placed == undefined)) or (Placed < 1)) {
_root.Cr = _root.Cr + 250;
_root.WavesWindow.credits = _root.Cr;
Placed = 0;
ShowAOE = 0;
_root.tActive[Index] = 0;
this.removeMovieClip();
}
onMouseDown = function () {
if ((Placed == 0) or (Placed == null)) {
if (CanPlace == 1) {
Placed = 1;
_root.tX[Index] = this._x;
_root.tY[Index] = this._y;
_root.Placing = 0;
ShowAOE = 0;
_root.tActive[Index] = 1;
}
} else if (TSniper.hitTest(_root._xmouse, _root._ymouse, false)) {
ShowAOE = 1;
Selected = 1;
_root.SelIndex = Index;
_root.SelDepth = Dep;
d = _root.getNextHighestDepth();
_root.attachMovie("mcTurretStatus", "TurretStatus" + d, d);
_root["TurretStatus" + d].SelDep = Dep;
_root["TurretStatus" + d]._x = this._x;
_root["TurretStatus" + d]._y = this._y;
if (_root["TurretStatus" + d]._y < 80) {
_root["TurretStatus" + d]._y = 80;
}
if (_root["TurretStatus" + d]._y > 420) {
_root["TurretStatus" + d]._y = 420;
}
if (_root["TurretStatus" + d]._x < 75) {
_root["TurretStatus" + d]._x = 75;
}
if (_root["TurretStatus" + d]._x > 575) {
_root["TurretStatus" + d]._x = 575;
}
_root["TurretStatus" + d]._alpha = 70;
} else {
ShowAOE = 0;
Selected = -1;
_root.SelIndex = -1;
_root.SelDepth = -1;
HideUpgrades();
}
};
if (ShowAOE > 0) {
AOE._visible = true;
AOE._width = Range * 2;
AOE._x = 0;
AOE._height = Range * 2;
AOE._y = 0;
} else {
AOE._visible = false;
}
if ((Placed == 0) or (Placed == null)) {
this._x = _root._xmouse;
this._y = _root._ymouse;
ShowAOE = 1;
Target = -1;
CanPlace = 1;
if (((_root.Path.hitTest(this._x - ((TSniper._width / 2) + 5), this._y - ((TSniper._height / 2) + 5), true) or _root.Path.hitTest(this._x + ((TSniper._width / 2) + 5), this._y + ((TSniper._height / 2) + 5), true)) or _root.Path.hitTest(this._x - ((TSniper._width / 2) + 5), this._y + ((TSniper._height / 2) + 5), true)) or _root.Path.hitTest(this._x + ((TSniper._width / 2) + 5), this._y - ((TSniper._height / 2) + 5), true)) {
CanPlace = 0;
}
if (_root.Turrets > 1) {
i = 0;
while (i < _root.Turrets) {
if (_root.tDep[i] != Dep) {
Dst2 = Math.sqrt(Math.pow(this._x - _root["T" + _root.tDep[i]]._x, 2) + Math.pow(this._y - _root["T" + _root.tDep[i]]._y, 2));
if ((Dst2 <= 19) && (_root.tActive[i] == 1)) {
CanPlace = 0;
}
}
i++;
}
}
if (CanPlace == 0) {
ShowAOE = 0;
}
}
if (Target >= 0) {
dist_x = _root.eX[Target] - this._x;
dist_y = _root.eY[Target] - this._y;
angle = Math.atan2(dist_y, dist_x);
this._rotation = ((angle / Math.PI) * 180) + 90;
Dst = Math.sqrt(Math.pow(this._x - _root.eX[Target], 2) + Math.pow(this._y - _root.eY[Target], 2));
if (Dst > Range) {
Target = -1;
} else if (_root.eHp[Target] > 0) {
if (Cooldown <= 0) {
_root.eHp[Target] = _root.eHp[Target] - Power;
_root["Enemy" + Target].HealthBar._xscale = (_root.eHp[Target] / _root.eMHp[Target]) * 100;
_root["Enemy" + Target].HealthBar._x = -10 + ((20 - _root["Enemy" + Target].HealthBar._width) / 2);
_root.Fire2.gotoAndPlay(3);
d = _root.getNextHighestDepth();
_root.attachMovie("mcBullet", "Bullet" + d, d);
_root["Bullet" + d].x = this._x;
_root["Bullet" + d].y = this._y;
_root["Bullet" + d]._x = this._x;
_root["Bullet" + d]._y = this._y;
_root["Bullet" + d].speed = 30;
_root["Bullet" + d].xT = _root.eX[Target];
_root["Bullet" + d].yT = _root.eY[Target];
Cooldown = Reload;
if (_root.eHp[Target] <= 0) {
_root.Cr = _root.Cr + _root.eCredits[Target];
_root.WavesWindow.credits = _root.Cr;
if (Difficulty == 1) {
_root.Cr = _root.Cr + (_root.eCredits[Target] * 0.25);
}
_root.Cr = Math.floor(_root.Cr);
_root["Enemy" + Target].removeMovieClip();
_root.wCurNum[_root.eWave[Target]]--;
Target = -1;
}
}
}
if ((_root.eHp[Target] <= 0) && (Target >= 0)) {
Target = -1;
}
}
if (((Target == -1) && (Placed == 1)) && (_root.eCount > 0)) {
FoundTarget = 0;
i = 0;
while (i < _root.eCount) {
Dst = Math.sqrt(Math.pow(this._x - _root.eX[i], 2) + Math.pow(this._y - _root.eY[i], 2));
if ((((Dst <= Range) && (Dst != undefined)) && (Dst > 0)) && (_root.eHp[i] > 0)) {
if (FoundTarget == 0) {
FoundTarget = 1;
Target = i;
} else if (_root.eDist[i] > _root.eDist[Target]) {
Target = i;
}
}
i++;
}
}
Symbol 10 MovieClip [mcTSniper] Frame 2
gotoAndPlay (1);
Symbol 13 MovieClip [mcTFreeze] Frame 1
var Target;
var ShowAOE;
var Range;
var Placed;
var Index;
var CanPlace;
var Cooldown;
var WaitTime;
var Attack;
var Dep;
var Power;
var Reload;
var PowerLev;
var ReloadLev;
var RangeLev;
var Selected;
var Type;
if (Cooldown > 0) {
Cooldown--;
}
if (Selected == 1) {
_root.SelDepth = Dep;
}
if ((Key.isDown(27) && (Placed == undefined)) or (Placed < 1)) {
_root.Cr = _root.Cr + 500;
_root.WavesWindow.credits = _root.Cr;
_root.Placing = 0;
Placed = 0;
ShowAOE = 0;
_root.tActive[Index] = 0;
this.removeMovieClip();
}
onMouseDown = function () {
if ((Placed == 0) or (Placed == null)) {
if (CanPlace == 1) {
Placed = 1;
_root.tX[Index] = this._x;
_root.tY[Index] = this._y;
_root.Placing = 0;
ShowAOE = 0;
_root.tActive[Index] = 1;
}
} else if (TFreeze.hitTest(_root._xmouse, _root._ymouse, false)) {
ShowAOE = 1;
Selected = 1;
_root.SelIndex = Index;
_root.SelDepth = Dep;
d = _root.getNextHighestDepth();
_root.attachMovie("mcTurretStatus", "TurretStatus" + d, d);
_root["TurretStatus" + d].SelDep = Dep;
_root["TurretStatus" + d]._x = this._x;
_root["TurretStatus" + d]._y = this._y;
if (_root["TurretStatus" + d]._y < 80) {
_root["TurretStatus" + d]._y = 80;
}
if (_root["TurretStatus" + d]._y > 420) {
_root["TurretStatus" + d]._y = 420;
}
if (_root["TurretStatus" + d]._x < 75) {
_root["TurretStatus" + d]._x = 75;
}
if (_root["TurretStatus" + d]._x > 575) {
_root["TurretStatus" + d]._x = 575;
}
_root["TurretStatus" + d]._alpha = 70;
} else {
ShowAOE = 0;
Selected = -1;
_root.SelIndex = -1;
_root.SelDepth = -1;
}
};
if (ShowAOE > 0) {
AOE._visible = true;
AOE._width = Range * 2;
AOE._x = 0;
AOE._height = Range * 2;
AOE._y = 0;
} else {
AOE._visible = false;
}
if ((Placed == 0) or (Placed == null)) {
this._x = _root._xmouse;
this._y = _root._ymouse;
ShowAOE = 1;
Target = -1;
CanPlace = 1;
if (((_root.Path.hitTest(this._x - ((TFreeze._width / 2) + 5), this._y - ((TFreeze._height / 2) + 5), true) or _root.Path.hitTest(this._x + ((TFreeze._width / 2) + 5), this._y + ((TFreeze._height / 2) + 5), true)) or _root.Path.hitTest(this._x - ((TFreeze._width / 2) + 5), this._y + ((TFreeze._height / 2) + 5), true)) or _root.Path.hitTest(this._x + ((TFreeze._width / 2) + 5), this._y - ((TFreeze._height / 2) + 5), true)) {
CanPlace = 0;
}
if (_root.Turrets > 1) {
i = 0;
while (i < _root.Turrets) {
if (_root.tDep[i] != Dep) {
Dst2 = Math.sqrt(Math.pow(this._x - _root["T" + _root.tDep[i]]._x, 2) + Math.pow(this._y - _root["T" + _root.tDep[i]]._y, 2));
if ((Dst2 <= 19) && (_root.tActive[i] == 1)) {
CanPlace = 0;
}
}
i++;
}
}
if (CanPlace == 0) {
ShowAOE = 0;
}
}
if (Target >= 0) {
dist_x = _root.eX[Target] - this._x;
dist_y = _root.eY[Target] - this._y;
angle = Math.atan2(dist_y, dist_x);
this._rotation = ((angle / Math.PI) * 180) + 90;
Dst = Math.sqrt(Math.pow(this._x - _root.eX[Target], 2) + Math.pow(this._y - _root.eY[Target], 2));
if (Dst > Range) {
Target = -1;
} else if (_root.eHp[Target] > 0) {
if (Cooldown <= 0) {
_root.eHp[Target] = _root.eHp[Target] - Power;
_root["Enemy" + Target].HealthBar._xscale = (_root.eHp[Target] / _root.eMHp[Target]) * 100;
_root["Enemy" + Target].HealthBar._x = -10 + ((20 - _root["Enemy" + Target].HealthBar._width) / 2);
_root.eSlowedFor[Target] = 75;
if (_root.eSpeedBU[Target] == 0) {
_root.eSpeedBU[Target] = _root.eSpeed[Target];
_root.eSpeed[Target] = _root.eSpeed[Target] * 0.33;
}
_root.eSpeed[Target] = _root.eSpeedBU[Target] * 0.33;
_root.Fire4.gotoAndPlay(3);
d = _root.getNextHighestDepth();
_root.attachMovie("mcBullet", "Bullet" + d, d);
_root["Bullet" + d].x = this._x;
_root["Bullet" + d].y = this._y;
_root["Bullet" + d]._x = this._x;
_root["Bullet" + d]._y = this._y;
_root["Bullet" + d].speed = 30;
_root["Bullet" + d].xT = _root.eX[Target];
_root["Bullet" + d].yT = _root.eY[Target];
Cooldown = Reload;
if (_root.eHp[Target] <= 0) {
_root.Cr = _root.Cr + _root.eCredits[Target];
_root.Credits = _root.Cr;
if (Difficulty == 1) {
_root.Cr = _root.Cr + (_root.eCredits[Target] * 0.25);
}
_root.Cr = Math.floor(_root.Cr);
_root["Enemy" + Target].removeMovieClip();
_root.wCurNum[_root.eWave[Target]]--;
Target = -1;
}
}
}
if ((_root.eHp[Target] <= 0) && (Target >= 0)) {
Target = -1;
}
}
if (((Target == -1) && (Placed == 1)) && (_root.eCount > 0)) {
FoundTarget = 0;
i = 0;
while (i < _root.eCount) {
Dst = Math.sqrt(Math.pow(this._x - _root.eX[i], 2) + Math.pow(this._y - _root.eY[i], 2));
if ((((Dst <= Range) && (Dst != null)) && (Dst > 0)) && (_root.eHp[i] > 0)) {
if (FoundTarget == 0) {
FoundTarget = 1;
Target = i;
} else if (_root.eDist[i] > _root.eDist[Target]) {
Target = i;
}
}
i++;
}
}
Symbol 13 MovieClip [mcTFreeze] Frame 2
gotoAndPlay (1);
Symbol 16 MovieClip [mcTTesla] Frame 1
var Target = 500;
var ShowAOE;
var Range;
var Placed;
var Index;
var CanPlace;
var Cooldown;
var WaitTime;
var Attack;
var Dep;
var Power;
var Reload;
var PowerLev;
var ReloadLev;
var RangeLev;
var Selected;
var Type;
var ShowAttack;
if (Cooldown == null) {
Cooldown = 2;
}
if (Cooldown > 0) {
Cooldown--;
}
if (Selected == 1) {
_root.SelDepth = Dep;
}
if ((Key.isDown(27) && (Placed == undefined)) or (Placed < 1)) {
_root.Cr = _root.Cr + 1000;
_root.WavesWindow.credits = _root.Cr;
_root.Placing = 0;
Placed = 0;
ShowAOE = 0;
_root.tActive[Index] = 0;
this.removeMovieClip();
}
onMouseDown = function () {
if ((Placed == 0) or (Placed == null)) {
if (CanPlace == 1) {
Placed = 1;
_root.tX[Index] = this._x;
_root.tY[Index] = this._y;
_root.Placing = 0;
ShowAOE = 0;
_root.tActive[Index] = 1;
}
} else if (TTesla.hitTest(_root._xmouse, _root._ymouse, false)) {
ShowAOE = 1;
Selected = 1;
_root.SelIndex = Index;
_root.SelDepth = Dep;
d = _root.getNextHighestDepth();
_root.attachMovie("mcTurretStatus", "TurretStatus" + d, d);
_root["TurretStatus" + d].SelDep = Dep;
_root["TurretStatus" + d]._x = this._x;
_root["TurretStatus" + d]._y = this._y;
if (_root["TurretStatus" + d]._y < 80) {
_root["TurretStatus" + d]._y = 80;
}
if (_root["TurretStatus" + d]._y > 420) {
_root["TurretStatus" + d]._y = 420;
}
if (_root["TurretStatus" + d]._x < 75) {
_root["TurretStatus" + d]._x = 75;
}
if (_root["TurretStatus" + d]._x > 575) {
_root["TurretStatus" + d]._x = 575;
}
_root["TurretStatus" + d]._alpha = 70;
} else {
ShowAOE = 0;
Selected = -1;
HideUpgrades();
_root.SelIndex = -1;
_root.SelDepth = -1;
}
};
if (ShowAOE > 0) {
AOE._visible = true;
AOE._width = Range * 2;
AOE._x = 0;
AOE._height = Range * 2;
AOE._y = 0;
} else {
AOE._visible = false;
}
if (ShowAttack > 0) {
TeslaAttack._visible = true;
TeslaAttack._width = Range * 2;
TeslaAttack._x = 0;
TeslaAttack._height = Range * 2;
TeslaAttack._y = 0;
ShowAttack--;
}
if (((ShowAttack == 0) or (ShowAttack == undefined)) or (ShowAttack == null)) {
TeslaAttack._visible = false;
}
if ((Placed == 0) or (Placed == null)) {
this._x = _root._xmouse;
this._y = _root._ymouse;
ShowAOE = 1;
Target = -1;
CanPlace = 1;
if (((_root.Path.hitTest(this._x - ((TTesla._width / 2) + 5), this._y - ((TTesla._height / 2) + 5), true) or _root.Path.hitTest(this._x + ((TTesla._width / 2) + 5), this._y + ((TTesla._height / 2) + 5), true)) or _root.Path.hitTest(this._x - ((TTesla._width / 2) + 5), this._y + ((TTesla._height / 2) + 5), true)) or _root.Path.hitTest(this._x + ((TTesla._width / 2) + 5), this._y - ((TTesla._height / 2) + 5), true)) {
CanPlace = 0;
}
if (_root.Turrets > 1) {
i = 0;
while (i < _root.Turrets) {
if (_root.tDep[i] != Dep) {
Dst2 = Math.sqrt(Math.pow(this._x - _root["T" + _root.tDep[i]]._x, 2) + Math.pow(this._y - _root["T" + _root.tDep[i]]._y, 2));
if ((Dst2 <= 19) && (_root.tActive[i] == 1)) {
CanPlace = 0;
}
}
i++;
}
}
if (CanPlace == 0) {
ShowAOE = 0;
}
}
if (Target >= 0) {
if (Cooldown <= 0) {
if (_root.eCount > 0) {
ie = 0;
while (ie < _root.eCount) {
Dst = Math.sqrt(Math.pow(this._x - _root.eX[ie], 2) + Math.pow(this._y - _root.eY[ie], 2));
if ((Dst <= Range) && (_root.eHp[ie] > 0)) {
_root.eHp[ie] = _root.eHp[ie] - Power;
_root["Enemy" + ie].HealthBar._xscale = (_root.eHp[ie] / _root.eMHp[ie]) * 100;
_root["Enemy" + ie].HealthBar._x = -10 + ((20 - _root["Enemy" + ie].HealthBar._width) / 2);
if (Cooldown <= 0) {
_root.Fire5.gotoAndPlay(3);
Cooldown = Reload;
}
ShowAttack = 15;
if (_root.eHp[ie] <= 0) {
_root.Cr = _root.Cr + _root.eCredits[ie];
_root.WavesWindow.credits = _root.Cr;
if (Difficulty == 1) {
_root.Cr = _root.Cr + (_root.eCredits[ie] * 0.25);
}
_root.Cr = Math.floor(_root.Cr);
_root["Enemy" + ie].removeMovieClip();
_root.wCurNum[_root.eWave[Target]]--;
}
}
ie++;
}
}
}
}
Symbol 16 MovieClip [mcTTesla] Frame 2
gotoAndPlay (1);
Symbol 18 MovieClip [mcBullet] Frame 1
var xT;
var yT;
var speed;
var x;
var y;
var Power;
dist_x = xT - this._x;
dist_y = yT - this._y;
angle = Math.atan2(dist_y, dist_x);
Dst = Math.sqrt(Math.pow(this._x - xT, 2) + Math.pow(this._y - yT, 2));
if (Dst > 1) {
if (Dst > speed) {
iix = speed * Math.cos(angle);
iiy = speed * Math.sin(angle);
} else {
iix = dist_x;
iiy = dist_y;
}
x = x + iix;
y = y + iiy;
this._x = x;
this._y = y;
} else {
this.removeMovieClip();
}
Symbol 18 MovieClip [mcBullet] Frame 2
gotoAndPlay (1);
Symbol 22 MovieClip [mcTBasic] Frame 1
var Target;
var ShowAOE;
var Range;
var Placed;
var Index;
var CanPlace;
var Cooldown;
var WaitTime;
var Attack;
var Dep;
var Power;
var Reload;
var PowerLev;
var ReloadLev;
var RangeLev;
var Selected;
var Type;
if (Cooldown > 0) {
Cooldown--;
}
if (Selected == 1) {
UpdateUpgrades();
_root.SelDepth = Dep;
}
if ((Key.isDown(27) && (Placed == undefined)) or (Placed < 1)) {
_root.Cr = _root.Cr + 100;
_root.WavesWindow.credits = _root.Cr + " Credits";
_root.Placing = 0;
Placed = 0;
ShowAOE = 0;
_root.tActive[Index] = 0;
this.removeMovieClip();
}
onMouseDown = function () {
if ((Placed == 0) or (Placed == null)) {
if (CanPlace == 1) {
Placed = 1;
_root.tX[Index] = this._x;
_root.tY[Index] = this._y;
_root.Placing = 0;
ShowAOE = 0;
_root.tActive[Index] = 1;
}
} else if (TBasic.hitTest(_root._xmouse, _root._ymouse, false)) {
ShowAOE = 1;
Selected = 1;
_root.SelIndex = Index;
_root.SelDepth = Dep;
d = _root.getNextHighestDepth();
_root.attachMovie("mcTurretStatus", "TurretStatus" + d, d);
_root["TurretStatus" + d].SelDep = Dep;
_root["TurretStatus" + d]._x = this._x;
_root["TurretStatus" + d]._y = this._y;
if (_root["TurretStatus" + d]._y < 80) {
_root["TurretStatus" + d]._y = 80;
}
if (_root["TurretStatus" + d]._y > 420) {
_root["TurretStatus" + d]._y = 420;
}
if (_root["TurretStatus" + d]._x < 75) {
_root["TurretStatus" + d]._x = 75;
}
if (_root["TurretStatus" + d]._x > 575) {
_root["TurretStatus" + d]._x = 575;
}
_root["TurretStatus" + d]._alpha = 70;
} else {
ShowAOE = 0;
Selected = -1;
_root.SelIndex = -1;
_root.SelDepth = -1;
}
};
if (ShowAOE > 0) {
AOE._visible = true;
AOE._width = Range * 2;
AOE._x = 0;
AOE._height = Range * 2;
AOE._y = 0;
} else {
AOE._visible = false;
}
if ((Placed == 0) or (Placed == null)) {
this._x = _root._xmouse;
this._y = _root._ymouse;
ShowAOE = 1;
Target = -1;
CanPlace = 1;
if (((_root.Path.hitTest(this._x - ((TBasic._width / 2) + 5), this._y - ((TBasic._height / 2) + 5), true) or _root.Path.hitTest(this._x + ((TBasic._width / 2) + 5), this._y + ((TBasic._height / 2) + 5), true)) or _root.Path.hitTest(this._x - ((TBasic._width / 2) + 5), this._y + ((TBasic._height / 2) + 5), true)) or _root.Path.hitTest(this._x + ((TBasic._width / 2) + 5), this._y - ((TBasic._height / 2) + 5), true)) {
CanPlace = 0;
}
if (_root.Turrets > 1) {
i = 0;
while (i < _root.Turrets) {
if (_root.tDep[i] != Dep) {
Dst2 = Math.sqrt(Math.pow(this._x - _root["T" + _root.tDep[i]]._x, 2) + Math.pow(this._y - _root["T" + _root.tDep[i]]._y, 2));
if ((Dst2 <= 19) && (_root.tActive[i] == 1)) {
CanPlace = 0;
}
}
i++;
}
}
if (CanPlace == 0) {
ShowAOE = 0;
}
}
if (Target >= 0) {
dist_x = _root.eX[Target] - this._x;
dist_y = _root.eY[Target] - this._y;
angle = Math.atan2(dist_y, dist_x);
this._rotation = ((angle / Math.PI) * 180) + 90;
Dst = Math.sqrt(Math.pow(this._x - _root.eX[Target], 2) + Math.pow(this._y - _root.eY[Target], 2));
if (Dst > Range) {
Target = -1;
} else if (_root.eHp[Target] > 0) {
if (Cooldown <= 0) {
_root.eHp[Target] = _root.eHp[Target] - Power;
_root["Enemy" + Target].HealthBar._xscale = (_root.eHp[Target] / _root.eMHp[Target]) * 100;
_root["Enemy" + Target].HealthBar._x = -10 + ((20 - _root["Enemy" + Target].HealthBar._width) / 2);
_root.Fire1.gotoAndPlay(3);
d = _root.getNextHighestDepth();
_root.attachMovie("mcBullet", "Bullet" + d, d);
_root["Bullet" + d].x = this._x;
_root["Bullet" + d].y = this._y;
_root["Bullet" + d]._x = this._x;
_root["Bullet" + d]._y = this._y;
_root["Bullet" + d].speed = 20;
_root["Bullet" + d].xT = _root.eX[Target];
_root["Bullet" + d].yT = _root.eY[Target];
Cooldown = Reload;
if (_root.eHp[Target] <= 0) {
_root.Cr = _root.Cr + _root.eCredits[Target];
if (Difficulty == 1) {
_root.Cr = _root.Cr + (_root.eCredits[Target] * 0.25);
}
_root.Cr = Math.floor(_root.Cr);
_root.WavesWindow.credits = _root.Cr;
_root["Enemy" + Target].removeMovieClip();
_root.wCurNum[_root.eWave[Target]]--;
Target = -1;
}
}
}
if ((_root.eHp[Target] <= 0) && (Target >= 0)) {
Target = -1;
}
}
if (((Target == -1) && (Placed == 1)) && (_root.eCount > 0)) {
FoundTarget = 0;
i = 0;
while (i < _root.eCount) {
Dst = Math.sqrt(Math.pow(this._x - _root.eX[i], 2) + Math.pow(this._y - _root.eY[i], 2));
if ((((Dst <= Range) && (Dst != null)) && (Dst > 0)) && (_root.eHp[i] > 0)) {
if (FoundTarget == 0) {
FoundTarget = 1;
Target = i;
} else if (_root.eDist[i] > _root.eDist[Target]) {
Target = i;
}
}
i++;
}
}
Symbol 22 MovieClip [mcTBasic] Frame 2
gotoAndPlay (1);
Symbol 43 Button
on (release) {
if ((_root.Cr >= 100) && (_root.Placing == 0)) {
_root.Cr = _root.Cr - 100;
_root.WavesWindow.credits = Cr;
_root.Placing = 1;
var dep;
dep = _root.getNextHighestDepth();
_root.attachMovie("mcTBasic", "T" + dep, dep);
_root["T" + dep].Index = _root.Turrets;
_root["T" + dep].Dep = dep;
_root["T" + dep].Range = _root.TRange[0][0];
_root["T" + dep].Reload = _root.TReload[0][0];
_root["T" + dep].Power = _root.TPower[0][0];
_root["T" + dep].PowerLev = 0;
_root["T" + dep].RangeLev = 0;
_root["T" + dep].ReloadLev = 0;
_root["T" + dep].Type = 0;
_root.AddTurret(0, dep);
}
}
on (rollOver) {
var fDropShadow = (new flash.filters.DropShadowFilter(5, 45, 0, 1, 10, 10, 1, 1, false, false, false));
_root.attachMovie("mcInfo", "InfoBox", _root.getNextHighestDepth());
_root.InfoBox._alpha = 80;
_root.InfoBox.title = "Basic Turret - 100 Cr";
_root.InfoBox.infoInfo = "Medium rate of fire, medium damage, medium AOE. All around a versitle turret";
_root.InfoBox._x = _root._xmouse;
_root.InfoBox._y = _root._ymouse;
_root.InfoBox.filters = [fDropShadow];
}
on (rollOut) {
_root.InfoBox.removeMovieClip();
}
Symbol 46 Button
on (release) {
if ((_root.Cr >= 150) && (_root.Placing == 0)) {
_root.Cr = _root.Cr - 150;
_root.WavesWindow.credits = Cr;
_root.Placing = 1;
var dep;
dep = _root.getNextHighestDepth();
_root.attachMovie("mcTHeavy", "T" + dep, dep);
_root["T" + dep].Index = _root.Turrets;
_root["T" + dep].Dep = dep;
_root["T" + dep].Range = _root.TRange[1][0];
_root["T" + dep].Reload = _root.TReload[1][0];
_root["T" + dep].Power = _root.TPower[1][0];
_root["T" + dep].PowerLev = 0;
_root["T" + dep].RangeLev = 0;
_root["T" + dep].ReloadLev = 0;
_root["T" + dep].Type = 1;
_root.AddTurret(1, dep);
}
}
on (rollOver) {
_root.attachMovie("mcInfo", "InfoBox", _root.getNextHighestDepth());
_root.InfoBox._alpha = 80;
_root.InfoBox.title = "Heavy Turret - 150 Cr";
_root.InfoBox.infoInfo = "Medium/slow rate of fire, high damage, small AOE. Your basic heavy hitter";
_root.InfoBox._x = _root._xmouse;
_root.InfoBox._y = _root._ymouse;
var fDropShadow = (new flash.filters.DropShadowFilter(5, 45, 0, 1, 10, 10, 1, 1, false, false, false));
_root.InfoBox.filters = [fDropShadow];
}
on (rollOut) {
_root.InfoBox.removeMovieClip();
}
Symbol 49 Button
on (release) {
if ((_root.Cr >= 250) && (_root.Placing == 0)) {
_root.Cr = _root.Cr - 250;
_root.WavesWindow.credits = Cr;
_root.Placing = 1;
var dep;
dep = _root.getNextHighestDepth();
_root.attachMovie("mcTSniper", "T" + dep, dep);
_root["T" + dep].Index = _root.Turrets;
_root["T" + dep].Dep = dep;
_root["T" + dep].Range = _root.TRange[2][0];
_root["T" + dep].Reload = _root.TReload[2][0];
_root["T" + dep].Power = _root.TPower[2][0];
_root["T" + dep].PowerLev = 0;
_root["T" + dep].RangeLev = 0;
_root["T" + dep].ReloadLev = 0;
_root["T" + dep].Type = 2;
_root.AddTurret(2, dep);
}
}
on (rollOver) {
_root.attachMovie("mcInfo", "InfoBox", _root.getNextHighestDepth());
_root.InfoBox._alpha = 80;
_root.InfoBox.title = "Sniper Turret - 250 Cr";
_root.InfoBox.infoInfo = "Snipes from far away, very high damage, very high reload";
_root.InfoBox._x = _root._xmouse;
_root.InfoBox._y = _root._ymouse;
var fDropShadow = (new flash.filters.DropShadowFilter(5, 45, 0, 1, 10, 10, 1, 1, false, false, false));
_root.InfoBox.filters = [fDropShadow];
}
on (rollOut) {
_root.InfoBox.removeMovieClip();
}
Symbol 52 Button
on (release) {
if ((_root.Cr >= 500) && (_root.Placing == 0)) {
_root.Cr = _root.Cr - 500;
_root.WavesWindow.credits = Cr;
_root.Placing = 1;
var dep;
dep = _root.getNextHighestDepth();
_root.attachMovie("mcTFreeze", "T" + dep, dep);
_root["T" + dep].Index = _root.Turrets;
_root["T" + dep].Dep = dep;
_root["T" + dep].Range = _root.TRange[3][0];
_root["T" + dep].Reload = _root.TReload[3][0];
_root["T" + dep].Power = _root.TPower[3][0];
_root["T" + dep].PowerLev = 0;
_root["T" + dep].RangeLev = 0;
_root["T" + dep].ReloadLev = 0;
_root["T" + dep].Type = 3;
_root.AddTurret(3, dep);
}
}
on (rollOver) {
_root.attachMovie("mcInfo", "InfoBox", _root.getNextHighestDepth());
_root.InfoBox._alpha = 80;
_root.InfoBox.title = "Freeze Turret - 500 Cr";
_root.InfoBox.infoInfo = "Has a weak attack, but slows enemy down to a third of ther original speed for about 5 seconds at the same time. Invaluable for the later levels";
_root.InfoBox._x = _root._xmouse;
_root.InfoBox._y = _root._ymouse;
var fDropShadow = (new flash.filters.DropShadowFilter(5, 45, 0, 1, 10, 10, 1, 1, false, false, false));
_root.InfoBox.filters = [fDropShadow];
}
on (rollOut) {
_root.InfoBox.removeMovieClip();
}
Symbol 55 Button
on (release) {
if ((_root.Cr >= 1000) && (_root.Placing == 0)) {
_root.Cr = _root.Cr - 1000;
_root.WavesWindow.credits = _root.Cr;
_root.Placing = 1;
var dep;
dep = _root.getNextHighestDepth();
_root.attachMovie("mcTTesla", "T" + dep, dep);
_root["T" + dep].Index = _root.Turrets;
_root["T" + dep].Dep = dep;
_root["T" + dep].Range = _root.TRange[4][0];
_root["T" + dep].Reload = _root.TReload[4][0];
_root["T" + dep].Power = _root.TPower[4][0];
_root["T" + dep].PowerLev = 0;
_root["T" + dep].RangeLev = 0;
_root["T" + dep].ReloadLev = 0;
_root["T" + dep].Type = 4;
_root["T" + dep].ShowAttack = 0;
_root.AddTurret(4, dep);
}
}
on (rollOver) {
_root.attachMovie("mcInfo", "InfoBox", _root.getNextHighestDepth());
_root.InfoBox._alpha = 80;
_root.InfoBox.title = "Tesla Coil - 1000 Cr";
_root.InfoBox.infoInfo = "Moderate Attack, very long cooldown, but hits everything in its range all at once!";
_root.InfoBox._x = _root._xmouse;
_root.InfoBox._y = _root._ymouse;
var fDropShadow = (new flash.filters.DropShadowFilter(5, 45, 0, 1, 10, 10, 1, 1, false, false, false));
_root.InfoBox.filters = [fDropShadow];
}
on (rollOut) {
_root.InfoBox.removeMovieClip();
}
Symbol 61 Button
on (release) {
if (this._y < 385) {
this._y = 490;
this._x = 537;
} else {
this._y = 383;
}
}
Symbol 62 MovieClip [mcTurrets] Frame 1
onMouseDown = function () {
if (BuyTurretsMove.hitTest(_root._xmouse, _root._ymouse, true)) {
this.startDrag();
}
};
onMouseUp = function () {
this.stopDrag();
};
Symbol 62 MovieClip [mcTurrets] Frame 2
gotoAndPlay (1);
Symbol 70 MovieClip [mcTurretWindow] Frame 2
gotoAndPlay (1);
Symbol 78 Button
on (release) {
_root.SendNextWave();
}
Symbol 79 Button
on (release) {
if (this._y < 385) {
this._y = 490;
this._x = 2;
} else {
this._y = 383;
}
}
Symbol 93 MovieClip [mcWaves] Frame 1
var wsx;
var gotowave;
if (gotowave == null) {
gotowave = 0;
}
wsx = 64.1 - (gotowave * 32);
if ((wsx != null) && (WaveStrip._x > wsx)) {
WaveStrip._x = WaveStrip._x - 1;
}
onMouseDown = function () {
if (WavesMove.hitTest(_root._xmouse, _root._ymouse, true)) {
this.startDrag();
}
};
onMouseUp = function () {
this.stopDrag();
};
Symbol 93 MovieClip [mcWaves] Frame 2
gotoAndPlay (1);
Symbol 97 MovieClip [mcNumber] Frame 2
gotoAndStop (1);
Symbol 114 Button
on (release) {
if ((_root.Cr >= _root.TPowerCost[_root["T" + SelDep].Type][_root["T" + SelDep].PowerLev + 1]) && (_root["T" + SelDep].PowerLev < 9)) {
_root.Cr = _root.Cr - _root.TPowerCost[_root["T" + SelDep].Type][_root["T" + SelDep].PowerLev + 1];
WavesWindow.credits = _root.Cr;
_root["T" + SelDep].PowerLev++;
_root["T" + SelDep].Power = _root.TPower[_root["T" + SelDep].Type][_root["T" + SelDep].PowerLev];
UpdateMe();
}
}
Symbol 115 Button
on (release) {
if ((_root.Cr >= _root.TReloadCost[_root["T" + SelDep].Type][_root["T" + SelDep].ReloadLev + 1]) && (_root["T" + SelDep].ReloadLev < 9)) {
_root.Cr = _root.Cr - _root.TReloadCost[_root["T" + SelDep].Type][_root["T" + SelDep].ReloadLev + 1];
WavesWindow.credits = _root.Cr;
_root["T" + SelDep].ReloadLev++;
_root["T" + SelDep].Reload = _root.TReload[_root["T" + SelDep].Type][_root["T" + SelDep].ReloadLev];
UpdateMe();
}
}
Symbol 116 Button
on (release) {
if ((_root.Cr >= _root.TRangeCost[_root["T" + SelDep].Type][_root["T" + SelDep].RangeLev + 1]) && (_root["T" + SelDep].RangeLev < 9)) {
_root.Cr = _root.Cr - _root.TRangeCost[_root["T" + SelDep].Type][_root["T" + SelDep].RangeLev + 1];
WavesWindow.credits = _root.Cr;
_root["T" + SelDep].RangeLev++;
_root["T" + SelDep].Range = _root.TRange[_root["T" + SelDep].Type][_root["T" + SelDep].RangeLev];
UpdateMe();
}
}
Symbol 121 MovieClip [mcTurretStatus] Frame 1
var SelDep;
if (SelDep != null) {
UpdateMe();
}
onMouseMove = function () {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
} else {
this.removeMovieClip();
}
};
UpdateMe = function () {
powernow = _root["T" + SelDep].Power;
reloadnow = _root["T" + SelDep].Reload;
rangenow = _root["T" + SelDep].Range;
if (_root["T" + SelDep].PowerLev < 9) {
powernext = _root.TPower[_root["T" + SelDep].Type][_root["T" + SelDep].PowerLev + 1];
} else {
powernext = "MAX";
}
if (_root["T" + SelDep].ReloadLev < 9) {
reloadnext = _root.TReload[_root["T" + SelDep].Type][_root["T" + SelDep].ReloadLev + 1];
} else {
reloadnext = "MAX";
}
if (_root["T" + SelDep].RangeLev < 9) {
rangenext = _root.TRange[_root["T" + SelDep].Type][_root["T" + SelDep].RangeLev + 1];
} else {
rangenext = "MAX";
}
if (_root["T" + SelDep].PowerLev < 9) {
powercost = _root.TPowerCost[_root["T" + SelDep].Type][_root["T" + SelDep].PowerLev + 1];
} else {
powercost = "";
}
if (_root["T" + SelDep].ReloadLev < 9) {
reloadcost = _root.TReloadCost[_root["T" + SelDep].Type][_root["T" + SelDep].ReloadLev + 1];
} else {
reloadcost = "";
}
if (_root["T" + SelDep].RangeLev < 9) {
rangecost = _root.TRangeCost[_root["T" + SelDep].Type][_root["T" + SelDep].RangeLev + 1];
} else {
rangecost = "";
}
};
Symbol 121 MovieClip [mcTurretStatus] Frame 2
gotoAndPlay (1);
Symbol 167 Button
on (release) {
getURL ("http://www.newgrounds.com", "_blank");
}
Symbol 169 MovieClip Frame 40
stop();
Symbol 195 Button
on (release) {
startMovie();
}
Symbol 196 MovieClip Frame 1
function timerHandler() {
if (!loadingComplete) {
var _local4 = _root.getBytesLoaded() / _root.getBytesTotal();
bar._xscale = 100 * _local4;
if (_local4 == 1) {
loadingComplete = true;
if (AUTO_PLAY) {
startMovie();
} else {
gotoAndStop ("loaded");
}
return(undefined);
}
}
dt = getTimer() - time;
time = time + dt;
frameAccum = frameAccum + dt;
var _local3 = 0;
while ((frameAccum >= FRAME_TIME) && (_local3 < MAX_FRAME_SKIP)) {
advanceFrame(tankLogo, true, true);
advanceFrame(loadingText, false, true);
advanceFrame(barGfx, false, true);
if (loadingComplete) {
advanceFrame(this, false, false);
}
(frameAccum = frameAccum - FRAME_TIME);
_local3++;
}
updateAfterEvent();
}
function advanceFrame(clip, recurse, loop) {
if (!clip) {
return(undefined);
}
clip.stop();
if (clip._currentframe == clip._totalframes) {
if (loop) {
clip.gotoAndStop(1);
}
} else {
clip.nextFrame();
}
if (recurse) {
for (childName in clip) {
if (typeof(clip[childName]) == "movieclip") {
advanceFrame(clip[childName], recurse, loop);
}
}
}
}
function startMovie() {
clearInterval(intervalId);
_root.gotoAndPlay(3);
}
_root.stop();
stop();
var FRAME_TIME = 33.3333333333333;
var AUTO_PLAY = false;
var MAX_FRAME_SKIP = 5;
var loadingComplete;
var intervalId;
var time;
var frameAccum;
loadingComplete = false;
intervalId = setInterval(this, "timerHandler", FRAME_TIME / 2);
frameAccum = 0;
time = getTimer();
timerHandler();
Symbol 198 MovieClip Frame 1
stop();
Symbol 200 MovieClip Frame 1
stop();
Symbol 202 MovieClip Frame 1
stop();
Symbol 204 MovieClip Frame 1
stop();
Symbol 208 MovieClip Frame 1
this._x = 300 + ((_root._xmouse - 300) * 2.75);
this._y = 225 + ((_root._ymouse - 225) * 2.75);
this._rotation = 45;
Symbol 208 MovieClip Frame 2
gotoAndPlay (1);
Symbol 213 MovieClip Frame 60
gotoAndPlay (1);
Symbol 219 Button
on (release) {
gotoAndStop (6);
}
Symbol 223 Button
on (release) {
gotoAndPlay (4);
}
Symbol 237 Button
on (release) {
_root.gotoAndPlay(3);
}
Symbol 239 MovieClip Frame 26
stop();
Symbol 245 Button
on (release) {
LevelSelected = "mcLevel1";
gotoAndStop (10);
}
Symbol 250 Button
on (release) {
LevelSelected = "mcLevel2";
gotoAndStop (10);
}
Symbol 253 MovieClip Frame 1
var tX;
var tY;
var tRot;
var tXMax = 500;
var tXMin = 150;
var tYMax = 350;
var tYMin = 150;
if ((tX == undefined) or (this._x == tX)) {
tX = Math.floor((Math.random() * (tXMax - tXMin)) + tXMin);
}
if ((tY == undefined) or (this._y == tY)) {
tY = Math.floor((Math.random() * (tYMax - tYMin)) + tYMin);
}
if ((tRot == undefined) or (tRot == 0)) {
tRot = Math.floor(Math.random() * 360) - 180;
}
if (tX > this._x) {
this._x++;
}
if (tX < this._x) {
this._x--;
}
if (tY > this._y) {
this._y++;
}
if (tY < this._y) {
this._y--;
}
if (tRot >= 1) {
this._rotation--;
tRot--;
}
if (tRot < 0) {
this._rotation++;
tRot++;
}
Symbol 253 MovieClip Frame 2
gotoAndPlay (1);
Symbol 263 Button
on (release) {
Difficulty = 1;
MyHealth = 100;
Cr = 1200;
gotoAndPlay (7);
}
Symbol 267 Button
on (release) {
Difficulty = 2;
MyHealth = 100;
Cr = 800;
gotoAndPlay (7);
}
Symbol 271 Button
on (release) {
Difficulty = 3;
MyHealth = 50;
Cr = 500;
gotoAndPlay (7);
}