Frame 1
mochi.as2.MochiServices.connect("5647d8cb9668d8a9");
stop();
var CPMStarPoolID = 1649;
var CPMStarSubPoolID = 120;
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie((("http://server.cpmstar.com/adviewas2.swf?poolid=" + CPMStarPoolID) + "&subpoolid=") + CPMStarSubPoolID);
Instance of Symbol 32 MovieClip in Frame 1
onClipEvent (enterFrame) {
if (_root.loading.loadingComplete == true) {
this._visible = true;
} else {
this._visible = false;
}
}
on (press) {
_root.adBox.swapDepths(9999);
_root.adBox.removeMovieClip();
_root.gotoAndPlay("theintro");
}
Frame 2
stop();
Frame 3
stopAllSounds();
stop();
Frame 4
stop();
Frame 5
stop();
Frame 6
_root.challengescore.swapDepths(9988);
_root.challengescore._x = 2000;
_root.challengescore._y = 2000;
_root.challengescore.removeMovieClip();
stop();
Frame 7
stop();
storedskills = SharedObject.getLocal("flashskill");
if (storedskills.data.xpleft == undefined) {
_global.xpleft = 0;
} else {
_global.xpleft = storedskills.data.xpleft;
}
if (storedskills.data.attackskill == undefined) {
_global.attackskill = 0;
} else {
_global.attackskill = storedskills.data.attackskill;
}
if (storedskills.data.rangeskill == undefined) {
_global.rangeskill = 0;
} else {
_global.rangeskill = storedskills.data.rangeskill;
}
if (storedskills.data.startmoneylevel == undefined) {
_global.startmoneylevel = 0;
} else {
_global.startmoneylevel = storedskills.data.startmoneylevel;
}
if (storedskills.data.killbounty == undefined) {
_global.killbounty = 0;
} else {
_global.killbounty = storedskills.data.killbounty;
}
if (storedskills.data.gems == undefined) {
_global.gems = 0;
} else {
_global.gems = storedskills.data.gems;
}
if (storedskills.data.techlevel == undefined) {
_global.techlevel = 0;
} else {
_global.techlevel = storedskills.data.techlevel;
}
if (storedskills.data.maxlevelbeat == undefined) {
_root.maxlevelbeat = 0;
} else {
_root.maxlevelbeat = storedskills.data.maxlevelbeat;
}
if (storedskills.data.level1gain == undefined) {
_root.level1gain = 0;
} else {
_root.level1gain = storedskills.data.level1gain;
}
if (storedskills.data.level1score == undefined) {
_root.level1score = 0;
} else {
_root.level1score = storedskills.data.level1score;
}
if (storedskills.data.level2gain == undefined) {
_root.level2gain = 0;
} else {
_root.level2gain = storedskills.data.level2gain;
}
if (storedskills.data.level2score == undefined) {
_root.level2score = 0;
} else {
_root.level2score = storedskills.data.level2score;
}
if (storedskills.data.level3gain == undefined) {
_root.level3gain = 0;
} else {
_root.level3gain = storedskills.data.level3gain;
}
if (storedskills.data.level3score == undefined) {
_root.level3score = 0;
} else {
_root.level3score = storedskills.data.level3score;
}
if (storedskills.data.level4gain == undefined) {
_root.level4gain = 0;
} else {
_root.level4gain = storedskills.data.level4gain;
}
if (storedskills.data.level4score == undefined) {
_root.level4score = 0;
} else {
_root.level4score = storedskills.data.level4score;
}
if (storedskills.data.level5gain == undefined) {
_root.level5gain = 0;
} else {
_root.level5gain = storedskills.data.level5gain;
}
if (storedskills.data.level5score == undefined) {
_root.level5score = 0;
} else {
_root.level5score = storedskills.data.level5score;
}
if (storedskills.data.level6gain == undefined) {
_root.level6gain = 0;
} else {
_root.level6gain = storedskills.data.level6gain;
}
if (storedskills.data.level6score == undefined) {
_root.level6score = 0;
} else {
_root.level6score = storedskills.data.level6score;
}
if (storedskills.data.level7gain == undefined) {
_root.level7gain = 0;
} else {
_root.level7gain = storedskills.data.level7gain;
}
if (storedskills.data.level7score == undefined) {
_root.level7score = 0;
} else {
_root.level7score = storedskills.data.level7score;
}
if (storedskills.data.level8gain == undefined) {
_root.level8gain = 0;
} else {
_root.level8gain = storedskills.data.level8gain;
}
if (storedskills.data.level8score == undefined) {
_root.level8score = 0;
} else {
_root.level8score = storedskills.data.level8score;
}
if (storedskills.data.level9gain == undefined) {
_root.level9gain = 0;
} else {
_root.level9gain = storedskills.data.level9gain;
}
if (storedskills.data.level9score == undefined) {
_root.level9score = 0;
} else {
_root.level9score = storedskills.data.level9score;
}
if (storedskills.data.level10gain == undefined) {
_root.level10gain = 0;
} else {
_root.level10gain = storedskills.data.level10gain;
}
if (storedskills.data.level10score == undefined) {
_root.level10score = 0;
} else {
_root.level10score = storedskills.data.level10score;
}
if (storedskills.data.level11score == undefined) {
_root.level11score = 0;
} else {
_root.level11score = storedskills.data.level11score;
}
Instance of Symbol 109 MovieClip in Frame 7
on (rollOver) {
_root.skillstats._x = this._x;
_root.skillstats._y = this._y;
_root.skillstats._visible = true;
_root.lvlgain = _root.level1gain;
_root.lvlscore = _root.level1score;
_root.lvlmax = 2;
}
on (rollOut) {
_root.lvlgain = "";
_root.lvlscore = "";
_root.lvlmax = "";
_root.skillstats._x = 1000;
_root.skillstats._y = 1000;
}
on (press) {
_root.skillstats.swapDepths(9090);
_root.skillstats.removeMovieClip();
_root.challengescore.removeMovieClip();
_root.gotoAndPlay("level1");
}
Instance of Symbol 113 MovieClip in Frame 7
on (rollOver) {
_root.skillstats._x = this._x;
_root.skillstats._y = this._y;
_root.skillstats._visible = true;
_root.lvlgain = _root.level2gain;
_root.lvlscore = _root.level2score;
_root.lvlmax = 2;
}
on (rollOut) {
_root.lvlgain = "";
_root.lvlscore = "";
_root.lvlmax = "";
_root.skillstats._x = 1000;
_root.skillstats._y = 1000;
}
on (press) {
_root.skillstats.swapDepths(9091);
_root.skillstats.removeMovieClip();
_root.challengescore.removeMovieClip();
if (_root.maxlevelbeat >= 1) {
_root.gotoAndPlay("level2");
}
}
Instance of Symbol 117 MovieClip in Frame 7
on (rollOver) {
_root.skillstats._x = this._x;
_root.skillstats._y = this._y;
_root.skillstats._visible = true;
_root.lvlgain = _root.level3gain;
_root.lvlscore = _root.level3score;
_root.lvlmax = 3;
}
on (rollOut) {
_root.lvlgain = "";
_root.lvlscore = "";
_root.lvlmax = "";
_root.skillstats._x = 1000;
_root.skillstats._y = 1000;
}
on (press) {
_root.skillstats.swapDepths(9092);
_root.skillstats.removeMovieClip();
_root.challengescore.removeMovieClip();
if (_root.maxlevelbeat >= 2) {
_root.gotoAndPlay("level3");
}
}
Instance of Symbol 122 MovieClip in Frame 7
on (rollOver) {
_root.skillstats._x = this._x;
_root.skillstats._y = this._y;
_root.skillstats._visible = true;
_root.lvlgain = _root.level4gain;
_root.lvlscore = _root.level4score;
_root.lvlmax = 3;
}
on (rollOut) {
_root.lvlgain = "";
_root.lvlscore = "";
_root.lvlmax = "";
_root.skillstats._x = 1000;
_root.skillstats._y = 1000;
}
on (press) {
_root.skillstats.swapDepths(9093);
_root.skillstats.removeMovieClip();
_root.challengescore.removeMovieClip();
if (_root.maxlevelbeat >= 3) {
_root.gotoAndPlay("level4");
}
}
Instance of Symbol 126 MovieClip in Frame 7
on (rollOver) {
_root.skillstats._x = this._x;
_root.skillstats._y = this._y;
_root.skillstats._visible = true;
_root.lvlgain = _root.level5gain;
_root.lvlscore = _root.level5score;
_root.lvlmax = 3;
}
on (rollOut) {
_root.lvlgain = "";
_root.lvlscore = "";
_root.lvlmax = "";
_root.skillstats._x = 1000;
_root.skillstats._y = 1000;
}
on (press) {
_root.skillstats.swapDepths(9094);
_root.skillstats.removeMovieClip();
_root.challengescore.removeMovieClip();
if (_root.maxlevelbeat >= 4) {
_root.gotoAndPlay("level5");
}
}
Instance of Symbol 140 MovieClip "skillstats" in Frame 7
onClipEvent (load) {
this.swapDepths(9999);
this._visible = false;
}
Instance of Symbol 144 MovieClip in Frame 7
on (rollOver) {
_root.skillstats._x = this._x;
_root.skillstats._y = this._y;
_root.skillstats._visible = true;
_root.lvlgain = _root.level6gain;
_root.lvlscore = _root.level6score;
_root.lvlmax = 3;
}
on (rollOut) {
_root.lvlgain = "";
_root.lvlscore = "";
_root.lvlmax = "";
_root.skillstats._x = 1000;
_root.skillstats._y = 1000;
}
on (press) {
_root.skillstats.swapDepths(9095);
_root.skillstats.removeMovieClip();
_root.challengescore.removeMovieClip();
if (_root.maxlevelbeat >= 5) {
_root.gotoAndPlay("level6");
}
}
Instance of Symbol 148 MovieClip in Frame 7
on (rollOver) {
_root.skillstats._x = this._x;
_root.skillstats._y = this._y;
_root.skillstats._visible = true;
_root.lvlgain = _root.level7gain;
_root.lvlscore = _root.level7score;
_root.lvlmax = 3;
}
on (rollOut) {
_root.lvlgain = "";
_root.lvlscore = "";
_root.lvlmax = "";
_root.skillstats._x = 1000;
_root.skillstats._y = 1000;
}
on (press) {
_root.skillstats.swapDepths(9096);
_root.skillstats.removeMovieClip();
_root.challengescore.removeMovieClip();
if (_root.maxlevelbeat >= 6) {
_root.gotoAndPlay("level7");
}
}
Instance of Symbol 152 MovieClip in Frame 7
on (rollOver) {
_root.skillstats._x = this._x;
_root.skillstats._y = this._y;
_root.skillstats._visible = true;
_root.lvlgain = _root.level8gain;
_root.lvlscore = _root.level8score;
_root.lvlmax = 3;
}
on (rollOut) {
_root.lvlgain = "";
_root.lvlscore = "";
_root.lvlmax = "";
_root.skillstats._x = 1000;
_root.skillstats._y = 1000;
}
on (press) {
_root.skillstats.swapDepths(9097);
_root.skillstats.removeMovieClip();
_root.challengescore.removeMovieClip();
if (_root.maxlevelbeat >= 7) {
_root.gotoAndPlay("level8");
}
}
Instance of Symbol 156 MovieClip in Frame 7
on (rollOver) {
_root.skillstats._x = this._x;
_root.skillstats._y = this._y;
_root.skillstats._visible = true;
_root.lvlgain = _root.level9gain;
_root.lvlscore = _root.level9score;
_root.lvlmax = 4;
}
on (rollOut) {
_root.lvlgain = "";
_root.lvlscore = "";
_root.lvlmax = "";
_root.skillstats._x = 1000;
_root.skillstats._y = 1000;
}
on (press) {
_root.skillstats.swapDepths(9098);
_root.skillstats.removeMovieClip();
_root.challengescore.removeMovieClip();
if (_root.maxlevelbeat >= 8) {
_root.gotoAndPlay("level9");
}
}
Instance of Symbol 160 MovieClip in Frame 7
on (rollOver) {
_root.skillstats._x = this._x;
_root.skillstats._y = this._y;
_root.skillstats._visible = true;
_root.lvlgain = _root.level10gain;
_root.lvlscore = _root.level10score;
_root.lvlmax = 4;
}
on (rollOut) {
_root.lvlgain = "";
_root.lvlscore = "";
_root.lvlmax = "";
_root.skillstats._x = 1000;
_root.skillstats._y = 1000;
}
on (press) {
_root.skillstats.swapDepths(9099);
_root.skillstats.removeMovieClip();
_root.challengescore.removeMovieClip();
if (_root.maxlevelbeat >= 9) {
_root.gotoAndPlay("level10");
}
}
Instance of Symbol 164 MovieClip in Frame 7
on (rollOver) {
_root.lvlscore = _root.level11score;
_root.challengescore._x = this._x;
_root.challengescore._y = this._y;
_root.challengescore.swapDepths(9988);
_root.challengescore._visible = true;
_root.lvl11score = _root.level11score;
}
on (rollOut) {
_root.lvl11score = "";
_root.challengescore._x = 2000;
_root.challengescore._y = 2000;
}
on (press) {
_root.challengescore.swapDepths(9988);
_root.challengescore._x = 2000;
_root.challengescore._y = 2000;
_root.challengescore.removeMovieClip();
_root.skillstats.removeMovieClip();
if (_root.maxlevelbeat >= 9) {
_root.gotoAndPlay("level11");
}
}
Frame 8
_root.challengescore.swapDepths(9988);
_root.challengescore._x = 2000;
_root.challengescore._y = 2000;
_root.challengescore.removeMovieClip();
storedskills = SharedObject.getLocal("flashskill");
if (storedskills.data.xpleft == undefined) {
_global.xpleft = 0;
} else {
_global.xpleft = storedskills.data.xpleft;
}
_root.xpleft = _global.xpleft;
if (storedskills.data.attackskill == undefined) {
_global.attackskill = 0;
} else {
_global.attackskill = storedskills.data.attackskill;
}
_root.attackskill = _global.attackskill;
if (storedskills.data.rangeskill == undefined) {
_global.rangeskill = 0;
} else {
_global.rangeskill = storedskills.data.rangeskill;
}
_root.rangeskill = _global.rangeskill;
if (storedskills.data.startmoneylevel == undefined) {
_global.startmoneylevel = 0;
} else {
_global.startmoneylevel = storedskills.data.startmoneylevel;
}
_root.startmoneylevel = _global.startmoneylevel;
if (storedskills.data.killbounty == undefined) {
_global.killbounty = 0;
} else {
_global.killbounty = storedskills.data.killbounty;
}
_root.killbounty = _global.killbounty;
if (storedskills.data.gems == undefined) {
_global.gems = 0;
} else {
_global.gems = storedskills.data.gems;
}
_root.gems = _global.gems;
if (storedskills.data.techlevel == undefined) {
_global.techlevel = 0;
} else {
_global.techlevel = storedskills.data.techlevel;
}
_root.techlevel = _global.techlevel;
Frame 9
function TowerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
}
function towerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
_root.UpgradeTowerInfo._visible = true;
if (tower.maxtier >= tower.tier) {
_root.UpgradeTowerInfo.UpgradeInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 1][2]) + "\rRange: ") + tower.upgrades[tower.tier - 1][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 1][4]) + "\rEffect: ") + tower.desc;
if (tower.tier == 1) {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.damage) + "\rRange: ") + tower.range) + "\rCoolDown: ") + tower.rate) + "\rEffect: ") + tower.desc;
} else {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 2][2]) + "\rRange: ") + tower.upgrades[tower.tier - 2][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 2][4]) + "\rEffect: ") + tower.desc;
}
_root.UpgradeTowerInfo.UpgradeButton.UpgradeButtonText.text = ("Upgrade [$" + tower.upgrades[tower.tier - 1][1]) + "]";
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
sellprice = Math.floor(tower.cost * 0.85);
_root.UpgradeTowerInfo.sellbutton.UpgradeButtonText.text = ("Sell [$" + sellprice) + "]";
if (tower.maxtier > tower.tier) {
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
} else {
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
}
} else {
_root.UpgradeTowerInfo.f.text = "";
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
_root.UpgradeTowerInfo.h.text = "";
}
}
function newLevel() {
if (_root.wave < 59) {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.02 * _root.gold);
_root.nowspeed = _root.waves[_root.wave - 1][2];
_root.nextspeed = _root.waves[_root.wave][2];
_root.nowhp = _root.waves[_root.wave - 1][1];
_root.nexthp = _root.waves[_root.wave][1];
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = _root.goldworth * 1.7;
_root.goldworth = _root.goldworth * (1 + (0.05 * _global.killbounty));
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", _root.waves[_root.wave - 1][3], _root.wave, "creep1", _root.waves[_root.wave - 1][2], _root.waves[_root.wave - 1][1], _root.goldworth);
_root["spawned" + _root.wave] = _root.waves[_root.wave - 1][0];
} else {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.03 * _root.gold);
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = Math.floor(_root.goldworth);
_root.goldworth = _root.goldworth * 1.2;
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
randspeed = 1.25;
_root.nowspeed = randspeed;
_root.nextspeed = "???";
wavessince = _root.wave - 60;
hpmultiplier = Math.pow(1.2, wavessince);
_root.nowhp = Math.floor(_root.waves[59][1] * hpmultiplier);
_root.nexthp = Math.floor(_root.nowhp * 1.2);
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", 50, _root.wave, "creep1", _root.nowspeed, _root.nowhp, _root.goldworth);
_root["spawned" + _root.wave] = 30;
}
}
function spawn(level, creep, speed, health, gold) {
if (_root["spawned" + level] == 0) {
clearInterval(_root["spawnInterval" + level]);
} else {
_root["spawned" + level]--;
playanim = (level % 5) + 1;
_root.creepcount++;
_root[creep].duplicateMovieClip("c" + _root.creepcount, 20000 + _root.creepcount);
if (_root.creepcount > 10000) {
_root.creepcount = 1;
}
c = _root["c" + _root.creepcount];
c.creep.gotoAndStop(playanim);
c._x = _root.wp1._x;
c._y = _root.wp1._y;
c.health = health;
c.slowcount = 1;
c.isslow = 0;
c.maxhealth = health;
c.speed = speed;
c.maxspeed = c.speed;
c.ispoisoned = 0;
c.poisonedlevel = 0;
c.poisoncount = 0;
c.fullmax = c.maxspeed;
c.targ = 2;
c.rnd = 5;
c.shocked = 0;
c.shockcount = 1;
c.gold = gold;
c.iscorrode = 0;
c.isstunned = 0;
c.stuncount = 1;
c.splashslowed = 0;
c.splashslowedcount = 1;
_root.creepArray[_root.creepArray.length] = c;
c.onEnterFrame = function () {
if (_root.pauses == 0) {
this.health_bar.health._width = 30 * (this.health / this.maxhealth);
this.targX = (_root["wp" + this.targ]._x - 5) + this.rnd;
this.targY = (_root["wp" + this.targ]._y - 5) + this.rnd;
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this.rads = (this.dir * 3.141593) / 180;
if ((this.isstunned != 0) || (this.shocked == 1)) {
this.stuncount++;
if ((this.stuncount % 2) == 1) {
this._x = this._x + 2;
} else {
this._x = this._x - 2;
}
}
if (this.stuncount > 160) {
this.isstunned = 0;
this.stuncount = 1;
}
if (this.isslow != 0) {
this.speed = this.isslow * this.fullmax;
this.slowcount++;
}
if (this.slowcount > 160) {
this.speed = this.fullmax;
this.isslow = 0;
this.slowcount = 1;
}
if (this.splashslowed != 0) {
this.fullmax = this.maxspeed * this.splashslowed;
this.speed = this.fullmax;
if (this.isslow != 0) {
this.speed = this.fullmax * this.isslow;
}
this.splashslowedcount++;
}
if (this.splashslowedcount > 100) {
this.splashslowed = 0;
this.fullmax = this.maxspeed;
this.speed = this.fullmax;
this.splashslowedcount = 1;
}
if (this.iscorrode != 0) {
this.corrodecount++;
}
if (this.corrodecount > 200) {
this.iscorrode = 0;
this.corrdecount = 1;
}
if (this.ispoisoned == 1) {
if ((this.poisoncount % 40) == 0) {
this.health = this.health - this.poisonedlevel;
}
this.poisoncount++;
}
if (this.shocked == 1) {
this.shockcount++;
}
if (this.shockcount >= 80) {
this.shocked = 0;
this.shockcount = 1;
}
if (this.poisoncount > 200) {
this.ispoisoned = 0;
this.poisoncount = 0;
}
if ((this.isstunned == 0) && (this.shocked == 0)) {
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
}
d = Math.pow(this._x - this.targX, 2) + Math.pow(this._y - this.targY, 2);
if (d < 25) {
this.targ++;
if (this.targ > 10) {
_root.leak(this);
this._x = _root.wp1._x;
this._y = _root.wp1._y;
this.targ = 2;
}
}
this.r = this.dir;
if ((this._rotation + 10) < this.r) {
this._rotation = this._rotation + 10;
} else if ((this._rotation - 10) > this.r) {
this._rotation = this._rotation - 10;
} else {
this._rotation = r;
}
}
};
}
}
function fire(from, to, speed, acc, maxpeed, projectile, damage, towerid) {
_root.particlecount++;
_root[projectile].duplicateMovieClip("p" + _root.particlecount, 2000 + _root.particlecount);
r = _root["p" + _root.particlecount];
r._x = from._x;
r._y = from._y;
r.tier = from.tier;
r.type = from.type;
r.targ = to;
r.speed = speed;
r.acc = acc;
r.maxspeed = maxspeed;
r.damage = damage;
r.projectile = projectile;
r.towerid = towerid;
if (_root.particlecount > 300) {
_root.particlecount = 0;
}
r.onEnterFrame = function () {
if (_root.pauses == 0) {
if (("" + this.targ) != "") {
this.targX = this.targ._x;
this.targY = this.targ._y;
} else {
this._rotation = (Math.atan2(this.targ._y - this._y, this.targ._x - this._x) * 180) / 3.141593;
if (_root.creepArray.length <= 0) {
this.removeMovieClip();
} else {
w = 0;
if (w <= _root.creepArray.length) {
this.targ = _root.creepArray[w];
}
}
}
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this._rotation = this.dir + 90;
this.rads = (this.dir * 3.141593) / 180;
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
if (this.speed < this.maxspeed) {
this.speed = this.speed + this.acc;
}
d = ((this._x - this.targX) * (this._x - this.targX)) + ((this._y - this.targY) * (this._y - this.targY));
if (d < 25) {
if (this.towerid == 10) {
randcrit = random(100);
if ((this.tier == 1) && (randcrit < 11)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 2) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 3) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 4) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 5) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
} else if (this.towerid == 4) {
this.targ.corrodecount = 1;
if (this.tier == 1) {
this.targ.iscorrode = 0.06;
} else if (this.tier == 2) {
this.targ.iscorrode = 0.12;
} else if (this.tier == 3) {
this.targ.iscorrode = 0.2;
} else if (this.tier == 4) {
this.targ.iscorrode = 0.32;
} else if (this.tier == 5) {
this.targ.iscorrode = 0.45;
}
}
this.targ.health = this.targ.health - (this.damage * (1 + this.targ.iscorrode));
if (this.towerid == 7) {
randstun = random(100);
if ((this.tier == 1) && (randstun < 10)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 2) && (randstun < 14)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 3) && (randstun < 17)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 4) && (randstun < 20)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
}
} else if (this.towerid == 5) {
this.targ.ispoisoned = 1;
this.targ.poisoncount = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < 4225) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[i].ispoisoned = 1;
_root.creepArray[i].poisoncount = 1;
}
i++;
}
if (this.tier == 1) {
this.targ.poisonedlevel = 150;
} else if (this.tier == 2) {
this.targ.poisonedlevel = 600;
} else if (this.tier == 3) {
this.targ.poisonedlevel = 2700;
} else if (this.tier == 4) {
this.targ.poisonedlevel = 10000;
}
_root.poisonball.duplicateMovieClip("poisonball" + _root.splashct, 6300 + _root.splashct);
_root["poisonball" + _root.splashct]._x = this._x;
_root["poisonball" + _root.splashct]._y = this._y;
_root["poisonball" + _root.splashct]._width = 80;
_root["poisonball" + _root.splashct]._height = 80;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 6) {
if (this.targ.health < (0.35 * this.targ.maxhealth)) {
randdeath = random(100);
if ((this.tier == 1) && (randdeath < 8)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 2) && (randdeath < 12)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 3) && (randdeath < 16)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 4) && (randdeath < 20)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
}
}
} else if (this.towerid == 8) {
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < 10000) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
if (this.tier == 1) {
_root.creepArray[k].splashslowed = 0.6;
} else if (this.tier == 2) {
_root.creepArray[k].splashslowed = 0.55;
} else if (this.tier == 3) {
_root.creepArray[k].splashslowed = 0.5;
} else if (this.tier == 4) {
_root.creepArray[k].splashslowed = 0.4;
}
_root.creepArray[k].splashslowedcount = 0;
}
k++;
}
_root.explodingshot.duplicateMovieClip("explodingshot" + _root.explodecount, 5100 + _root.explodecount);
_root["explodingshot" + _root.explodecount]._x = this._x;
_root["explodingshot" + _root.explodecount]._y = this._y;
_root.explodecount++;
if (_root.explodecount > 20) {
_root.explodecount = 1;
}
} else if (this.towerid == 26) {
if (this.tier == 1) {
shockwidth = 75;
shockchance = 8;
} else if (this.tier == 2) {
shockwidth = 80;
shockchance = 10;
} else if (this.tier == 3) {
shockwidth = 85;
shockchance = 12;
} else if (this.tier == 4) {
shockwidth = 90;
shockchance = 14;
}
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < (shockwidth * shockwidth)) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
shockper = random(100);
if (shockper < shockchance) {
if (_root.creepArray[k].shocked == 0) {
_root.creepArray[k].shocked = 1;
_root.creepArray[k].splashslowedcount = 1;
}
}
}
k++;
}
_root.shockshot.duplicateMovieClip("shockshot" + _root.shockct, 26500 + _root.shockct);
_root["shockshot" + _root.shockct]._x = this._x;
_root["shockshot" + _root.shockct]._y = this._y;
_root["shockshot" + _root.shockct]._width = 2 * shockwidth;
_root["shockshot" + _root.shockct]._height = 2 * shockwidth;
_root.shockct++;
if (_root.shockct > 20) {
_root.shockct = 1;
}
} else if (this.towerid == 22) {
if (this.tier == 1) {
staticval = 5;
} else if (this.tier == 2) {
staticval = 7;
} else if (this.tier == 3) {
staticval = 10;
}
staticchance = random(100);
if (staticchance < staticval) {
damagetaken = this.targ.maxhealth - this.targ.health;
(this.health - this.health) - (0.5 * damagetaken);
_root.lighteffect.duplicateMovieClip("lighteffect" + _root.staticcount, 23000 + _root.staticcount);
_root["lighteffect" + _root.staticcount]._x = this._x;
_root["lighteffect" + _root.staticcount]._y = this._y;
_root.staticcount++;
if (_root.staticcount > 50) {
_root.staticcount = 1;
}
}
} else if (this.towerid == 25) {
stealval = random(100);
if (this.tier == 1) {
this.stealmax = 6;
} else if (this.tier == 2) {
this.stealmax = 9;
} else if (this.tier == 3) {
this.stealmax = 10;
} else if (this.tier == 4) {
this.stealmax = 12;
}
if (stealval < this.stealmax) {
_root.gold = _root.gold + this.targ.gold;
_root.goldeffect.duplicateMovieClip("goldeffect" + _root.goldeffectct, 26000 + _root.goldeffectct);
_root["goldeffect" + _root.goldeffectct]._x = this._x;
_root["goldeffect" + _root.goldeffectct]._y = this._y;
_root.goldeffectct++;
if (_root.goldeffectct > 20) {
_root.goldeffectct = 1;
}
}
} else if (this.towerid == 999) {
if (this.targ.health < (0.65 * this.targ.maxhealth)) {
randteleport = random(100);
if ((this.tier == 1) && (randteleport < 8)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
_root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 2) && (randteleport < 9)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 3) && (randteleport < 10)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 4) && (randteleport < 11)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 5) && (randteleport < 13)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
}
}
} else if (this.towerid == 100) {
if (this.tier == 1) {
spradius = 1225;
spwidth = 35;
} else if (this.tier == 2) {
spradius = 1600;
spwidth = 40;
} else if (this.tier == 3) {
spradius = 2025;
spwidth = 45;
} else if (this.tier == 4) {
spradius = 2500;
spwidth = 50;
} else if (this.tier == 5) {
spradius = 3600;
spwidth = 60;
}
j = 0;
while (j <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[j]._x, 2) + Math.pow(this._y - _root.creepArray[j]._y, 2);
if (d < spradius) {
if ((("" + _root.creepArray[j]) != "") && (_root.creepArray[j] != this.targ)) {
_root.creepArray[j].health = _root.creepArray[j].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[j].splashslowed = 1;
_root.creepArray[j].splashslowedcount = 1;
}
j++;
}
_root.iceball.duplicateMovieClip("iceball" + _root.splashct, 5200 + _root.splashct);
_root["iceball" + _root.splashct]._x = this._x;
_root["iceball" + _root.splashct]._y = this._y;
_root["iceball" + _root.splashct]._width = spwidth;
_root["iceball" + _root.splashct]._height = spwidth;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 3) {
if (this.tier == 1) {
this.targ.isslow = 0.6;
}
if (this.tier == 2) {
this.targ.isslow = 0.5;
}
if (this.tier == 3) {
this.targ.isslow = 0.4;
}
if (this.tier == 4) {
this.targ.isslow = 0.35;
}
if (this.tier == 5) {
this.targ.isslow = 0.3;
}
this.targ.slowcount = 1;
} else if (this.towerid == 2) {
_root.explosion.duplicateMovieClip("explosion" + _root.explosioncount, 5000 + _root.explosioncount);
_root["explosion" + _root.explosioncount]._x = this._x;
_root["explosion" + _root.explosioncount]._y = this._y;
_root["explosion" + _root.explosioncount]._width = 100;
_root["explosion" + _root.explosioncount]._height = 100;
_root.explosioncount++;
if (_root.explosioncount > 40) {
_root.explosioncount = 1;
}
splashrad = 50;
splashrad2 = splashrad * splashrad;
i = 0;
while (i <= _root.creepArray.length) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < splashrad2) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 6000)));
}
}
i++;
}
}
if (this.targ.health <= 0) {
this.targ.isDead = 1;
}
this.removeMovieClip();
}
}
};
}
function checkkill() {
n = 0;
while (n < _root.creepArray.length) {
if ((_root.creepArray[n].health <= 0) || (_root.creepArray[n] == "undefined")) {
_root.kills++;
_root.aftereffect.duplicateMovieClip("aftereffect" + _root.effectcount, 50000 + _root.effectcount);
_root["aftereffect" + _root.effectcount]._x = _root.creepArray[n]._x;
_root["aftereffect" + _root.effectcount]._y = _root.creepArray[n]._y;
_root.effectcount++;
if (_root.effectcount > 50) {
_root.effectcount = 1;
}
if (((_root.creepArray[n].gold != "undefined") && (_root.creepArray[n].gold != "null")) && (_root.creepArray[n].gold > 0)) {
_root.gold = _root.gold + _root.creepArray[n].gold;
_root.score = _root.score + _root.creepArray[n].maxhealth;
}
_root.creepArray[n].removeMovieClip();
_root.creepArray.splice(n, 1);
}
n++;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
function kill(creep) {
_root.kills++;
if (_root.kills >= _root.waves[_root.wave - 1][0]) {
_root.kills = 0;
_root.newLevel();
}
creep.onEnterFrame = function () {
this.removeMovieClip();
};
}
function upgrade() {
a = _root.selectedTower;
b = a.tier - 1;
if (int(a.upgrades[b][1]) <= _root.gold) {
a.damage = int(a.upgrades[b][2]);
a.range = a.upgrades[b][3];
a.rate = a.upgrades[b][4];
a.splash = a.upgrades[b][5];
a.slow = a.upgrades[b][6];
a.cost = a.cost + int(a.upgrades[b][1]);
a.tier++;
_root.towerInfo(a);
_root.gold = _root.gold - int(a.upgrades[b][1]);
updateInfoBar();
}
}
function sell() {
tower = _root.selectedTower;
if (((tower != "undefined") && (tower != "null")) && (tower != "")) {
sellprice = Math.floor(tower.cost * 0.85);
if (sellprice != "undefined") {
_root.gold = _root.gold + sellprice;
}
_root.range._x = 1000;
_root.range._height = 0;
_root.range._width = 0;
if (tower.maxtier == 2) {
_root.gems++;
}
tower.removeMovieClip();
_root.UpgradeTowerInfo._visible = false;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
stop();
_root.skillstats.swapDepths(9090);
_root.skillstats.removeMovieClip();
_root.challengescore._x = 2000;
_root.challengescore._y = 2000;
_root.levelwin = 0;
_root.gold = 100;
_root.gems = _global.gems;
_root.attackskill = _global.attackskill;
_root.rangeskill = _global.rangeskill;
_root.killbounty = _global.killbounty;
_root.techlevel = _global.techlevel;
if (_global.startmoneylevel == 1) {
_root.gold = 150;
} else if (_global.startmoneylevel == 2) {
_root.gold = 200;
} else if (_global.startmoneylevel == 3) {
_root.gold = 250;
} else if (_global.startmoneylevel == 4) {
_root.gold = 400;
} else if (_global.startmoneylevel == 5) {
_root.gold = 600;
}
_root.wave = 0;
_root.levelnew = 1;
_root.effectcount = 1;
_root.staticcount = 1;
_root.shockct = 1;
_root.gameover = 0;
_root.towerCount = 0;
_root.creepcount = 1;
_root.goldeffectct = 1;
_root.kills = 0;
_root.pauses = 0;
_root.creepleaks = 0;
_root.timer = 45;
_root.lives = 20;
_root.goldworth = 0;
_root.creepArray = [];
_global.sound = 1;
_root.particlecount = 1;
_root.splashct = 1;
_root.pwncount = 1;
_root.explodecount = 1;
_root.score = 0;
_root.playsound = new Sound(this);
_root.playsound.attachSound("music");
if (_global.sound == 1) {
_root.playsound.start(0, 100000);
}
_root.playsound1 = new Sound(this);
_root.playsound1.attachSound("sndplasma");
_root.playsound2 = new Sound(this);
_root.playsound2.attachSound("sndrocket");
_root.playsound3 = new Sound(this);
_root.playsound3.attachSound("sndbullet");
_root.playsound4 = new Sound(this);
_root.playsound4.attachSound("sndbullet1");
_root.playsound5 = new Sound(this);
_root.playsound5.attachSound("sndexplode");
_root.playsound6 = new Sound(this);
_root.playsound6.attachSound("sndlaser");
_global.maxwaves = 20;
_root.wavemax = _global.maxwaves;
_root.waves = [[20, 81, 3.75, 667], [20, 90, 4.5, 600], [20, 103, 2.75, 400], [20, 120, 3.75, 667], [20, 141, 4.05, 600], [20, 164, 3.75, 667], [20, 192, 1.5, 266], [2, 800, 5.25, 600], [20, 263, 3, 667], [20, 308, 3.75, 667], [20, 361, 3, 667], [20, 422, 2.75, 400], [20, 494, 3, 650], [20, 577, 5, 700], [20, 676, 3.25, 550], [2, 4000, 2.75, 800], [20, 925, 3.75, 600], [20, 1082, 4, 700], [20, 1266, 4.25, 650], [20, 1481, 3.5, 580], [20, 1737, 3.25, 500], [20, 2036, 3.4, 525], [20, 2387, 2.8, 475], [20, 2799, 3, 600], [2, 13000, 3.141592, 620], [20, 3848, 3.5, 650], [20, 4512, 4, 700], [20, 5290, 3.3, 600], [20, 6203, 3.4, 590], [20, 7273, 3.12, 550], [20, 8546, 3.3, 600], [20, 10041, 3.2, 570], [2, 45000, 2.5, 800], [20, 13863, 3, 600], [20, 16290, 3.15, 577], [20, 19140, 3.2, 500], [20, 22490, 3.35, 600], [20, 26426, 3.4, 620], [20, 31050, 3.5, 630], [20, 36484, 3.75, 670], [2, 200000, 3, 700], [20, 50800, 3.2, 650], [20, 59946, 3.3, 660], [20, 70734, 3.4, 675], [20, 83466, 3.5, 690], [20, 98490, 4, 800], [20, 116218, 3, 650], [20, 137137, 3.5, 700], [2, 800000, 4, 1000], [20, 190950, 3.5, 700], [20, 229140, 3.4, 600], [20, 274968, 3.33, 590], [20, 329962, 4.5, 750], [20, 395954, 4, 700], [20, 475145, 3.4, 600], [20, 570174, 3.6, 625], [2, 3500000, 3.7, 700], [20, 821050, 3.8, 710], [20, 985261, 4, 650], [20, 1182313, 5, 700]];
_root.nowhp = 0;
_root.nowspeed = 0;
_root.nexthp = _root.waves[0][1];
_root.nextspeed = 2.5;
Instance of Symbol 228 MovieClip "wp1" in Frame 9
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp2" in Frame 9
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp3" in Frame 9
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp4" in Frame 9
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp5" in Frame 9
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp6" in Frame 9
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp7" in Frame 9
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp8" in Frame 9
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp9" in Frame 9
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp10" in Frame 9
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 236 MovieClip in Frame 9
on (press) {
_root.marker.active = 1;
_root.marker.tower = "basic";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Tower. Shoots bullets at enemies. 80 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 238 MovieClip in Frame 9
on (press) {
_root.marker.active = 1;
_root.marker.tower = "splash";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Splash Tower. Shoots Exploding bullets at enemies. 29 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 240 MovieClip in Frame 9
on (press) {
_root.marker.active = 1;
_root.marker.tower = "slow";
_root.marker.cost = 150;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Slow Tower. Shoots shots that slow the enemy. 100 base damage. Cost: $150";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 242 MovieClip in Frame 9
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "poison";
_root.marker.cost = 500;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Splash Poison Tower. Splashes Poison(150/sec for level 1) to hurt the enemy. 300 base damage. Cost: $500, Tech level 1 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 244 MovieClip in Frame 9
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "static";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Static tower. 6% chance to make target take 50% of the damage that is has lost so far. 500 base damage. Cost: $650. Requires Tech level 1.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 246 MovieClip in Frame 9
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "shock";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Shock tower. Has the ability to random stun any enemy within its radius. Enemies cannot be stunned if already under effect of stun. 500 base damage. Cost: $1000. Requires Tech level 4.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 248 MovieClip in Frame 9
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "stun";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Stun Tower. Has a 10% chance of stunning enemies. 500 base damage. Cost: $700. Requires Tech level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 252 MovieClip in Frame 9
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "death";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Instant death tower. 8% chance to instantly kill if target is under 35% HP. 500 base damage. Cost: $650. Requires Tech level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 254 MovieClip in Frame 9
on (press) {
if (_root.techlevel >= 2) {
_root.marker.active = 1;
_root.marker.tower = "money";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Money Tower. Has a 5% chance of stealing money from creeps it hits at level 1. 500 Damage. Cost: $700. Requires Tech level 2";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 256 MovieClip in Frame 9
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "explode";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Exploding Tower. Damages and slows all enemies in a radius of itself. 500 base damage. Cost: $1000. Requires Tech level 4.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 258 MovieClip in Frame 9
on (press) {
if (_root.gems > 0) {
if (_root.techlevel >= 5) {
_root.marker.active = 1;
_root.marker.tower = "ultimate";
_root.marker.cost = 20000;
_root.tinfo._visible = false;
}
}
}
on (rollOver) {
_root.buyinfo = "Ultimate Tower. Extreme Damage and splash. 100000 damage. Cost: $20000 and 1 Gem. Requires Tech level 5.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 236 MovieClip "tower_basic" in Frame 9
onClipEvent (load) {
title = "Basic Damage Tower";
desc = "Basic Damage Tower";
cost = 50;
this.range = 65 * (1 + (0.05 * _global.rangeskill));
this.range2 = 66 * (1 + (0.05 * _global.rangeskill));
this.range3 = 67 * (1 + (0.05 * _global.rangeskill));
this.range4 = 68 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 80;
damage = 80 * (1 + (0.05 * _global.attackskill));
this.damage2 = 240 * (1 + (0.05 * _global.attackskill));
this.damage3 = 720 * (1 + (0.05 * _global.attackskill));
this.damage4 = 2160 * (1 + (0.05 * _global.attackskill));
rate = 19;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 240\rRange: 66\rCooldown: 18\rEffect: None", 120, this.damage2, this.range2, 18], ["Damage: 720\rRange: 67\rCooldown: 17\rEffect: None", 300, this.damage3, this.range3, 17], ["Damage: 2160\rRange: 68\rCooldown: 17\rEffect: None", 880, this.damage4, this.range4, 17]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_basic")) {
if (target == undefined) {
target = 0;
}
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 264 MovieClip "range" in Frame 9
onClipEvent (enterFrame) {
if ((_root.selectedTower == "") && (_root.marker.active == 0)) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 267 MovieClip "marker" in Frame 9
onClipEvent (load) {
active = 0;
inpath = 0;
this.swapDepths(9998);
}
onClipEvent (enterFrame) {
if (active == 1) {
this.startDrag(true);
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((maphit == 1) && (inpath == 0)) {
this.gotoAndStop(1);
_root.range.gotoAndStop(1);
} else {
this.gotoAndStop(2);
_root.range.gotoAndStop(2);
}
_root.range._x = _x;
_root.range._y = _y;
_root.range._width = _root["tower_" + tower].range * 2;
_root.range._height = _root["tower_" + tower].range * 2;
}
if (Key.isDown(32)) {
active = 0;
trace(1);
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
on (press) {
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((((maphit == 1) && (inpath == 0)) && (_root.gold >= this.cost)) && (_root.pauses == 0)) {
if (this.hitTest(_root.nextwave) == false) {
if (_root.marker.tower == "ultimate") {
if (_root.gems > 0) {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gems--;
_root.gold = _root.gold - this.cost;
}
} else {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gold = _root.gold - this.cost;
}
}
}
if (maphit == 0) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
if (this.hitTest(_root.nextwave)) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
Instance of Symbol 238 MovieClip "tower_splash" in Frame 9
onClipEvent (load) {
title = "Splash Tower";
desc = "Splash Tower";
cost = 50;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 73 * (1 + (0.05 * _global.rangeskill));
this.range4 = 75 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 34 * (1 + (0.05 * _global.attackskill));
this.damage2 = 102 * (1 + (0.05 * _global.attackskill));
this.damage3 = 306 * (1 + (0.05 * _global.attackskill));
this.damage4 = 918 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 102\rRange: 72\rCooldown: 21\rEffect: Splash", 120, this.damage2, this.range2, 21], ["Damage: 306\rRange: 73\rCooldown: 21\rEffect: Splash", 300, this.damage3, this.range3, 21], ["Damage: 918\rRange: 75\rCooldown: 20\rEffect: Splash", 880, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_splash")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > ((range * range) + 81)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 289 MovieClip "explosion" in Frame 9
onClipEvent (load) {
if (this._name == "explosion") {
this._visible = false;
}
}
Instance of Symbol 240 MovieClip "tower_slow" in Frame 9
onClipEvent (load) {
title = "Slow tower";
desc = "Slow tower";
cost = 150;
this.range = 68 * (1 + (0.05 * _global.rangeskill));
this.range2 = 69 * (1 + (0.05 * _global.rangeskill));
this.range3 = 70 * (1 + (0.05 * _global.rangeskill));
this.range4 = 71 * (1 + (0.05 * _global.rangeskill));
this.range5 = 72 * (1 + (0.05 * _global.rangeskill));
damage = 100 * (1 + (0.05 * _global.attackskill));
this.damage2 = 500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2200 * (1 + (0.05 * _global.attackskill));
this.damage4 = 10500 * (1 + (0.05 * _global.attackskill));
this.damage5 = 33000 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 500\rRange: 69\rCooldown: 22\rEffect: Slow", 500, this.damage2, this.range2, 22], ["Damage: 2200\rRange: 70\rCooldown: 21\rEffect: Slow", 1250, this.damage3, this.range3, 21], ["Damage: 10500\rRange: 71\rCooldown: 21\rEffect: Slow", 3150, this.damage4, this.range4, 21], ["Damage: 33000\rRange: 72\rColldown:19\rEffect: Slow", 8000, this.damage5, this.range5, 19]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_slow")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 314 MovieClip in Frame 9
on (press) {
_root.marker.active = 1;
_root.marker.tower = "rust";
_root.marker.cost = 400;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Rust Tower. Shoots shots that rust the enemy, causing them to take more damage. 300 base damage. Ultra Fast. Cost: $400";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 314 MovieClip "tower_rust" in Frame 9
onClipEvent (load) {
title = "Rust Tower";
desc = "Rust Tower";
cost = 400;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range5 = 80 * (1 + (0.05 * _global.rangeskill));
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 930 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 5000 * (1 + (0.05 * _global.attackskill));
this.damage5 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 9;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 930\rRange: 76\rCooldown: 9\rEffect: Rust", 1200, this.damage2, this.range2, 9], ["Damage: 2000\rRange: 77\rCooldown: 8\rEffect: Rust", 3000, this.damage3, this.range3, 8], ["Damage: 5000\rRange: 78\rCooldown: 8\rEffect: Rust", 6000, this.damage4, this.range4, 8], ["Damage: 15000\rRange: 80\rCooldown: 7\rEffect:Rust", 13500, this.damage5, this.range5, 7]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 242 MovieClip "tower_poison" in Frame 9
onClipEvent (load) {
title = "Splash Poison";
desc = "Splash Poison";
cost = 500;
this.range = 70;
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 75 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 12000 * (1 + (0.05 * _global.attackskill));
rate = 23;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 72\rCooldown: 22\rEffect:Poison(600)", 1500, this.damage2, this.range2, 22], ["Damage: 4000\rRange: 75\rCooldown: 21\rEffect:Poison(2700)", 5000, this.damage3, this.range3, 21], ["Damage: 12000\rRange:78\rCooldown: 20\rEffect:Poison(10000)", 11500, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 244 MovieClip "tower_static" in Frame 9
onClipEvent (load) {
title = "Static";
desc = "Static";
cost = 500;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 80 * (1 + (0.05 * _global.rangeskill));
this.range4 = 85 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 25;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 77\rCooldown: 24\rEffect:Static(7)", 1500, this.damage2, this.range2, 24], ["Damage: 4000\rRange: 80\rCooldown: 23\rEffect:Static(10)", 5000, this.damage3, this.range3, 23], ["Damage: 15000\rRange: 85\rCooldown:22\rEffect:Static(12)", 11000, this.damage4, this.range4, 22]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 252 MovieClip "tower_death" in Frame 9
onClipEvent (load) {
title = "Instant Death";
desc = "Instant Death";
cost = 650;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 79 * (1 + (0.05 * _global.rangeskill));
this.range4 = 82 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 650 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 15000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 35000 * (1 + (0.05 * _global.attackskill));
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3000)\rRange: 77\rCooldown: 28\rEffect:Death(12%)", 2000, this.damage2, this.range2, 28], ["Damage: 15000\rRange: 79\rCooldown: 26\rEffect:Death(16%)", 7000, this.damage3, this.range3, 26], ["Damage: 35000\rRange:82\rCooldown: 23 \rEffect:Death(19%)", 13500, this.damage4, this.range4, 23]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 248 MovieClip "tower_stun" in Frame 9
onClipEvent (load) {
title = "Stun Tower";
desc = "Stun Tower";
cost = 700;
rate = 22;
this.range = 73 * (1 + (0.05 * _global.rangeskill));
this.range2 = 74 * (1 + (0.05 * _global.rangeskill));
this.range3 = 76 * (1 + (0.05 * _global.rangeskill));
this.range4 = 79 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 45000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 74\rCooldown: 22\rEffect:Stun(13%)", 2500, this.damage2, this.range2, 22], ["Damage: 17000\rRange: 76\rCooldown: 21\rEffect:Stun(16%)", 9000, this.damage3, this.range3, 21], ["Damage: 45000\rRange: 79\rCooldown: 20\rEffect:Stun(18%)", 18000, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 254 MovieClip "tower_money" in Frame 9
onClipEvent (load) {
title = "Money Tower";
desc = "Money Tower";
cost = 700;
rate = 25;
this.range = 75;
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 78 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 40000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 76\rCooldown: 24\rEffect:Steal Money(8)", 2500, this.damage2, this.range2, 24], ["Damage: 17000\rRange: 78\rCooldown: 23\rEffect:Steal(9)", 9000, this.damage3, this.range3, 23], ["Damage: 40000\rRange: 80\rCooldown:21\rEffect:Steal(11)", 18000, this.damage4, this.range4, 21]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 256 MovieClip "tower_explode" in Frame 9
onClipEvent (load) {
title = "Explosion";
desc = "Explosion";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 80 * (1 + (0.05 * _global.rangeskill));
this.range2 = 82 * (1 + (0.05 * _global.rangeskill));
this.range3 = 84 * (1 + (0.05 * _global.rangeskill));
this.range4 = 86 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 82\rCooldown: 28\rEffect:Slow", 3000, this.damage2, this.range2, 28], ["Damage: 8000\rRange: 84\rCooldown: 27\rEffect:Slow", 10000, this.damage3, this.range3, 27], ["Damage: 25000\rRange: 86\rCooldown:25\rEffect:Slow", 25000, this.damage4, this.range4, 25]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 336 MovieClip "shockshot" in Frame 9
onClipEvent (enterFrame) {
this._rotation = this._rotation + 30;
}
Instance of Symbol 246 MovieClip "tower_shock" in Frame 9
onClipEvent (load) {
title = "Shock";
desc = "Shock";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 75 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 35;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 75\rCooldown: 33\rEffect:Shock", 3000, this.damage2, this.range2, 33], ["Damage: 8000\rRange: 77\rCooldown: 30\rEffect:Shock", 10000, this.damage3, this.range3, 30], ["Damage: 25000\rRange: 80\rCooldown: 27\rEffect:Shock", 25000, this.damage4, this.range4, 27]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 258 MovieClip "tower_ultimate" in Frame 9
onClipEvent (load) {
title = "Ultimate Tower";
desc = "Ultimate Tower";
cost = 20000;
damage = 100000 * (1 + (0.05 * _global.attackskill));
this.damage2 = 200000 * (1 + (0.05 * _global.attackskill));
this.range = 85 * (1 + (0.05 * _global.rangeskill));
this.range2 = 95 * (1 + (0.05 * _global.rangeskill));
rate = 27;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 2;
upgrades = [["Damage: 200000\rRange: 95\rCooldown: 33\rEffect:Splash", 40000, this.damage2, this.range2, 24]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_ultimate")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 353 MovieClip "UpgradeTowerInfo" in Frame 9
onClipEvent (load) {
_visible = false;
swapDepths(100000);
}
Instance of Symbol 378 MovieClip "creep1" in Frame 9
onClipEvent (load) {
this._rotation = this._rotation + 45;
}
Instance of Symbol 380 MovieClip in Frame 9
onClipEvent (enterFrame) {
if (_root.timer > 50) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 381 MovieClip in Frame 9
onClipEvent (load) {
this._visible = false;
this.startDrag(true);
this.count = 0;
}
onClipEvent (enterFrame) {
trace(_root.techlevel);
if (Key.isDown(77) && (_global.sound == 1)) {
_global.sound = 0;
stopAllSounds();
}
if (Key.isDown(78) && (_global.sound == 0)) {
_global.sound = 1;
_root.playsound.start(0, 100000);
}
if (Key.isDown(80) && (_root.pauses == 0)) {
_root.pauses = 1;
}
if (Key.isDown(85) && (_root.pauses == 1)) {
_root.pauses = 0;
}
if (_root.pauses == 0) {
_root.levelnew++;
_root.checkkill();
this.count++;
if ((this.count % 30) == 0) {
_root.timer--;
}
if (_root.timer <= 0) {
if (_root.wave < _global.maxwaves) {
_root.newLevel();
}
_root.timer = 60;
}
if ((_root.lives <= 0) && (_root.gameover == 0)) {
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
if (_root.creepArray.length <= 0) {
_root.gotoAndPlay("lose1");
}
}
if (((((_root.wave >= _global.maxwaves) && (_root.creepArray.length <= 0)) && (_root.gameover == 0)) && (_root.kills >= 20)) && (_root.levelnew > 120)) {
_root.levelwin = 1;
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
_root.gotoAndPlay("win1");
}
}
}
Instance of Symbol 387 MovieClip "tinfo" in Frame 9
onClipEvent (load) {
this.swapDepths(99999);
}
Instance of Symbol 421 MovieClip "quitbox" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Frame 10
stop();
stopAllSounds();
Frame 11
stop();
stopAllSounds();
_root.gameover = 1;
if (_root.levelwin == 0) {
_root.gotoAndPlay("lose1");
}
if (_root.lives == 20) {
_root.skillgained = 2;
} else {
_root.skillgained = 1;
}
storedskills = SharedObject.getLocal("flashskill");
if (storedskills.data.level1gain == undefined) {
_global.xpleft = _global.xpleft + _root.skillgained;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level1gain = _root.skillgained;
} else {
xplast = storedskills.data.level1gain;
skilldifferent = _root.skillgained - xplast;
if (skilldifferent > 0) {
_global.xpleft = _global.xpleft + skilldifferent;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level1gain = storedskills.data.level1gain + skilldifferent;
}
}
if ((storedskills.data.maxlevelbeat < 1) || (storedskills.data.maxlevelbeat == undefined)) {
storedskills.data.maxlevelbeat = 1;
}
if ((storedskills.data.level1score == undefined) || (_root.score > storedskills.data.level1score)) {
storedskills.data.level1score = _root.score;
}
Frame 12
function TowerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
}
function towerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
_root.UpgradeTowerInfo._visible = true;
if (tower.maxtier >= tower.tier) {
_root.UpgradeTowerInfo.UpgradeInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 1][2]) + "\rRange: ") + tower.upgrades[tower.tier - 1][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 1][4]) + "\rEffect: ") + tower.desc;
if (tower.tier == 1) {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.damage) + "\rRange: ") + tower.range) + "\rCoolDown: ") + tower.rate) + "\rEffect: ") + tower.desc;
} else {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 2][2]) + "\rRange: ") + tower.upgrades[tower.tier - 2][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 2][4]) + "\rEffect: ") + tower.desc;
}
_root.UpgradeTowerInfo.UpgradeButton.UpgradeButtonText.text = ("Upgrade [$" + tower.upgrades[tower.tier - 1][1]) + "]";
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
sellprice = Math.floor(tower.cost * 0.85);
_root.UpgradeTowerInfo.sellbutton.UpgradeButtonText.text = ("Sell [$" + sellprice) + "]";
if (tower.maxtier > tower.tier) {
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
} else {
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
}
} else {
_root.UpgradeTowerInfo.f.text = "";
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
_root.UpgradeTowerInfo.h.text = "";
}
}
function newLevel() {
if (_root.wave < 59) {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.02 * _root.gold);
_root.nowspeed = _root.waves[_root.wave - 1][2];
_root.nextspeed = _root.waves[_root.wave][2];
_root.nowhp = _root.waves[_root.wave - 1][1];
_root.nexthp = _root.waves[_root.wave][1];
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = _root.goldworth * 1.7;
_root.goldworth = _root.goldworth * (1 + (0.05 * _global.killbounty));
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", _root.waves[_root.wave - 1][3], _root.wave, "creep1", _root.waves[_root.wave - 1][2], _root.waves[_root.wave - 1][1], _root.goldworth);
_root["spawned" + _root.wave] = _root.waves[_root.wave - 1][0];
} else {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.03 * _root.gold);
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = Math.floor(_root.goldworth);
_root.goldworth = _root.goldworth * 1.2;
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
randspeed = 1.25;
_root.nowspeed = randspeed;
_root.nextspeed = "???";
wavessince = _root.wave - 60;
hpmultiplier = Math.pow(1.2, wavessince);
_root.nowhp = Math.floor(_root.waves[59][1] * hpmultiplier);
_root.nexthp = Math.floor(_root.nowhp * 1.2);
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", 50, _root.wave, "creep1", _root.nowspeed, _root.nowhp, _root.goldworth);
_root["spawned" + _root.wave] = 30;
}
}
function spawn(level, creep, speed, health, gold) {
if (_root["spawned" + level] == 0) {
clearInterval(_root["spawnInterval" + level]);
} else {
_root["spawned" + level]--;
playanim = (level % 5) + 1;
_root.creepcount++;
_root[creep].duplicateMovieClip("c" + _root.creepcount, 20000 + _root.creepcount);
if (_root.creepcount > 10000) {
_root.creepcount = 1;
}
c = _root["c" + _root.creepcount];
c.creep.gotoAndStop(playanim);
c._x = _root.wp1._x;
c._y = _root.wp1._y;
c.health = health;
c.slowcount = 1;
c.isslow = 0;
c.maxhealth = health;
c.speed = speed;
c.maxspeed = c.speed;
c.ispoisoned = 0;
c.poisonedlevel = 0;
c.poisoncount = 0;
c.fullmax = c.maxspeed;
c.targ = 2;
c.rnd = 5;
c.shocked = 0;
c.shockcount = 1;
c.gold = gold;
c.iscorrode = 0;
c.isstunned = 0;
c.stuncount = 1;
c.splashslowed = 0;
c.splashslowedcount = 1;
_root.creepArray[_root.creepArray.length] = c;
c.onEnterFrame = function () {
if (_root.pauses == 0) {
this.health_bar.health._width = 30 * (this.health / this.maxhealth);
this.targX = (_root["wp" + this.targ]._x - 5) + this.rnd;
this.targY = (_root["wp" + this.targ]._y - 5) + this.rnd;
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this.rads = (this.dir * 3.141593) / 180;
if ((this.isstunned != 0) || (this.shocked == 1)) {
this.stuncount++;
if ((this.stuncount % 2) == 1) {
this._x = this._x + 2;
} else {
this._x = this._x - 2;
}
}
if (this.stuncount > 160) {
this.isstunned = 0;
this.stuncount = 1;
}
if (this.isslow != 0) {
this.speed = this.isslow * this.fullmax;
this.slowcount++;
}
if (this.slowcount > 160) {
this.speed = this.fullmax;
this.isslow = 0;
this.slowcount = 1;
}
if (this.splashslowed != 0) {
this.fullmax = this.maxspeed * this.splashslowed;
this.speed = this.fullmax;
if (this.isslow != 0) {
this.speed = this.fullmax * this.isslow;
}
this.splashslowedcount++;
}
if (this.splashslowedcount > 100) {
this.splashslowed = 0;
this.fullmax = this.maxspeed;
this.speed = this.fullmax;
this.splashslowedcount = 1;
}
if (this.iscorrode != 0) {
this.corrodecount++;
}
if (this.corrodecount > 200) {
this.iscorrode = 0;
this.corrdecount = 1;
}
if (this.ispoisoned == 1) {
if ((this.poisoncount % 40) == 0) {
this.health = this.health - this.poisonedlevel;
}
this.poisoncount++;
}
if (this.shocked == 1) {
this.shockcount++;
}
if (this.shockcount >= 80) {
this.shocked = 0;
this.shockcount = 1;
}
if (this.poisoncount > 200) {
this.ispoisoned = 0;
this.poisoncount = 0;
}
if ((this.isstunned == 0) && (this.shocked == 0)) {
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
}
d = Math.pow(this._x - this.targX, 2) + Math.pow(this._y - this.targY, 2);
if (d < 25) {
this.targ++;
if (this.targ > 14) {
_root.leak(this);
this._x = _root.wp1._x;
this._y = _root.wp1._y;
this.targ = 2;
}
}
this.r = this.dir;
if ((this._rotation + 10) < this.r) {
this._rotation = this._rotation + 10;
} else if ((this._rotation - 10) > this.r) {
this._rotation = this._rotation - 10;
} else {
this._rotation = r;
}
}
};
}
}
function fire(from, to, speed, acc, maxpeed, projectile, damage, towerid) {
_root.particlecount++;
_root[projectile].duplicateMovieClip("p" + _root.particlecount, 2000 + _root.particlecount);
r = _root["p" + _root.particlecount];
r._x = from._x;
r._y = from._y;
r.tier = from.tier;
r.type = from.type;
r.targ = to;
r.speed = speed;
r.acc = acc;
r.maxspeed = maxspeed;
r.damage = damage;
r.projectile = projectile;
r.towerid = towerid;
if (_root.particlecount > 300) {
_root.particlecount = 0;
}
r.onEnterFrame = function () {
if (_root.pauses == 0) {
if (("" + this.targ) != "") {
this.targX = this.targ._x;
this.targY = this.targ._y;
} else {
this._rotation = (Math.atan2(this.targ._y - this._y, this.targ._x - this._x) * 180) / 3.141593;
if (_root.creepArray.length <= 0) {
this.removeMovieClip();
} else {
w = 0;
if (w <= _root.creepArray.length) {
this.targ = _root.creepArray[w];
}
}
}
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this._rotation = this.dir + 90;
this.rads = (this.dir * 3.141593) / 180;
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
if (this.speed < this.maxspeed) {
this.speed = this.speed + this.acc;
}
d = ((this._x - this.targX) * (this._x - this.targX)) + ((this._y - this.targY) * (this._y - this.targY));
if (d < 25) {
if (this.towerid == 10) {
randcrit = random(100);
if ((this.tier == 1) && (randcrit < 11)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 2) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 3) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 4) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 5) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
} else if (this.towerid == 4) {
this.targ.corrodecount = 1;
if (this.tier == 1) {
this.targ.iscorrode = 0.06;
} else if (this.tier == 2) {
this.targ.iscorrode = 0.12;
} else if (this.tier == 3) {
this.targ.iscorrode = 0.2;
} else if (this.tier == 4) {
this.targ.iscorrode = 0.32;
} else if (this.tier == 5) {
this.targ.iscorrode = 0.45;
}
}
this.targ.health = this.targ.health - (this.damage * (1 + this.targ.iscorrode));
if (this.towerid == 7) {
randstun = random(100);
if ((this.tier == 1) && (randstun < 10)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 2) && (randstun < 14)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 3) && (randstun < 17)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 4) && (randstun < 20)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
}
} else if (this.towerid == 5) {
this.targ.ispoisoned = 1;
this.targ.poisoncount = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < 4225) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[i].ispoisoned = 1;
_root.creepArray[i].poisoncount = 1;
}
i++;
}
if (this.tier == 1) {
this.targ.poisonedlevel = 150;
} else if (this.tier == 2) {
this.targ.poisonedlevel = 600;
} else if (this.tier == 3) {
this.targ.poisonedlevel = 2700;
} else if (this.tier == 4) {
this.targ.poisonedlevel = 10000;
}
_root.poisonball.duplicateMovieClip("poisonball" + _root.splashct, 6300 + _root.splashct);
_root["poisonball" + _root.splashct]._x = this._x;
_root["poisonball" + _root.splashct]._y = this._y;
_root["poisonball" + _root.splashct]._width = 80;
_root["poisonball" + _root.splashct]._height = 80;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 6) {
if (this.targ.health < (0.35 * this.targ.maxhealth)) {
randdeath = random(100);
if ((this.tier == 1) && (randdeath < 8)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 2) && (randdeath < 12)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 3) && (randdeath < 16)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 4) && (randdeath < 20)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
}
}
} else if (this.towerid == 8) {
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < 10000) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
if (this.tier == 1) {
_root.creepArray[k].splashslowed = 0.6;
} else if (this.tier == 2) {
_root.creepArray[k].splashslowed = 0.55;
} else if (this.tier == 3) {
_root.creepArray[k].splashslowed = 0.5;
} else if (this.tier == 4) {
_root.creepArray[k].splashslowed = 0.4;
}
_root.creepArray[k].splashslowedcount = 0;
}
k++;
}
_root.explodingshot.duplicateMovieClip("explodingshot" + _root.explodecount, 5100 + _root.explodecount);
_root["explodingshot" + _root.explodecount]._x = this._x;
_root["explodingshot" + _root.explodecount]._y = this._y;
_root.explodecount++;
if (_root.explodecount > 20) {
_root.explodecount = 1;
}
} else if (this.towerid == 26) {
if (this.tier == 1) {
shockwidth = 75;
shockchance = 8;
} else if (this.tier == 2) {
shockwidth = 80;
shockchance = 10;
} else if (this.tier == 3) {
shockwidth = 85;
shockchance = 12;
} else if (this.tier == 4) {
shockwidth = 90;
shockchance = 14;
}
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < (shockwidth * shockwidth)) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
shockper = random(100);
if (shockper < shockchance) {
if (_root.creepArray[k].shocked == 0) {
_root.creepArray[k].shocked = 1;
_root.creepArray[k].splashslowedcount = 1;
}
}
}
k++;
}
_root.shockshot.duplicateMovieClip("shockshot" + _root.shockct, 26500 + _root.shockct);
_root["shockshot" + _root.shockct]._x = this._x;
_root["shockshot" + _root.shockct]._y = this._y;
_root["shockshot" + _root.shockct]._width = 2 * shockwidth;
_root["shockshot" + _root.shockct]._height = 2 * shockwidth;
_root.shockct++;
if (_root.shockct > 20) {
_root.shockct = 1;
}
} else if (this.towerid == 22) {
if (this.tier == 1) {
staticval = 5;
} else if (this.tier == 2) {
staticval = 7;
} else if (this.tier == 3) {
staticval = 10;
}
staticchance = random(100);
trace(staticchance);
if (staticchance < staticval) {
damagetaken = this.targ.maxhealth - this.targ.health;
(this.health - this.health) - (0.5 * damagetaken);
_root.lighteffect.duplicateMovieClip("lighteffect" + _root.staticcount, 23000 + _root.staticcount);
_root["lighteffect" + _root.staticcount]._x = this._x;
_root["lighteffect" + _root.staticcount]._y = this._y;
_root.staticcount++;
if (_root.staticcount > 50) {
_root.staticcount = 1;
}
}
} else if (this.towerid == 25) {
stealval = random(100);
if (this.tier == 1) {
this.stealmax = 6;
} else if (this.tier == 2) {
this.stealmax = 9;
} else if (this.tier == 3) {
this.stealmax = 10;
} else if (this.tier == 4) {
this.stealmax = 12;
}
if (stealval < this.stealmax) {
_root.gold = _root.gold + this.targ.gold;
_root.goldeffect.duplicateMovieClip("goldeffect" + _root.goldeffectct, 26000 + _root.goldeffectct);
_root["goldeffect" + _root.goldeffectct]._x = this._x;
_root["goldeffect" + _root.goldeffectct]._y = this._y;
_root.goldeffectct++;
if (_root.goldeffectct > 20) {
_root.goldeffectct = 1;
}
}
} else if (this.towerid == 999) {
if (this.targ.health < (0.65 * this.targ.maxhealth)) {
randteleport = random(100);
if ((this.tier == 1) && (randteleport < 8)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
_root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 2) && (randteleport < 9)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 3) && (randteleport < 10)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 4) && (randteleport < 11)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 5) && (randteleport < 13)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
}
}
} else if (this.towerid == 100) {
if (this.tier == 1) {
spradius = 1225;
spwidth = 35;
} else if (this.tier == 2) {
spradius = 1600;
spwidth = 40;
} else if (this.tier == 3) {
spradius = 2025;
spwidth = 45;
} else if (this.tier == 4) {
spradius = 2500;
spwidth = 50;
} else if (this.tier == 5) {
spradius = 3600;
spwidth = 60;
}
j = 0;
while (j <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[j]._x, 2) + Math.pow(this._y - _root.creepArray[j]._y, 2);
if (d < spradius) {
if ((("" + _root.creepArray[j]) != "") && (_root.creepArray[j] != this.targ)) {
_root.creepArray[j].health = _root.creepArray[j].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[j].splashslowed = 1;
_root.creepArray[j].splashslowedcount = 1;
}
j++;
}
_root.iceball.duplicateMovieClip("iceball" + _root.splashct, 5200 + _root.splashct);
_root["iceball" + _root.splashct]._x = this._x;
_root["iceball" + _root.splashct]._y = this._y;
_root["iceball" + _root.splashct]._width = spwidth;
_root["iceball" + _root.splashct]._height = spwidth;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 3) {
if (this.tier == 1) {
this.targ.isslow = 0.6;
}
if (this.tier == 2) {
this.targ.isslow = 0.5;
}
if (this.tier == 3) {
this.targ.isslow = 0.4;
}
if (this.tier == 4) {
this.targ.isslow = 0.35;
}
if (this.tier == 5) {
this.targ.isslow = 0.3;
}
this.targ.slowcount = 1;
} else if (this.towerid == 2) {
_root.explosion.duplicateMovieClip("explosion" + _root.explosioncount, 5000 + _root.explosioncount);
_root["explosion" + _root.explosioncount]._x = this._x;
_root["explosion" + _root.explosioncount]._y = this._y;
_root["explosion" + _root.explosioncount]._width = 100;
_root["explosion" + _root.explosioncount]._height = 100;
_root.explosioncount++;
if (_root.explosioncount > 40) {
_root.explosioncount = 1;
}
splashrad = 50;
splashrad2 = splashrad * splashrad;
i = 0;
while (i <= _root.creepArray.length) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < splashrad2) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 6000)));
}
}
i++;
}
}
if (this.targ.health <= 0) {
this.targ.isDead = 1;
}
this.removeMovieClip();
}
}
};
}
function checkkill() {
n = 0;
while (n < _root.creepArray.length) {
if ((_root.creepArray[n].health <= 0) || (_root.creepArray[n] == "undefined")) {
_root.kills++;
_root.aftereffect.duplicateMovieClip("aftereffect" + _root.effectcount, 50000 + _root.effectcount);
_root["aftereffect" + _root.effectcount]._x = _root.creepArray[n]._x;
_root["aftereffect" + _root.effectcount]._y = _root.creepArray[n]._y;
_root.effectcount++;
if (_root.effectcount > 50) {
_root.effectcount = 1;
}
if (((_root.creepArray[n].gold != "undefined") && (_root.creepArray[n].gold != "null")) && (_root.creepArray[n].gold > 0)) {
_root.gold = _root.gold + _root.creepArray[n].gold;
_root.score = _root.score + _root.creepArray[n].maxhealth;
}
_root.creepArray[n].removeMovieClip();
_root.creepArray.splice(n, 1);
}
n++;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
function kill(creep) {
_root.kills++;
if (_root.kills >= _root.waves[_root.wave - 1][0]) {
_root.kills = 0;
_root.newLevel();
}
creep.onEnterFrame = function () {
this.removeMovieClip();
};
}
function upgrade() {
a = _root.selectedTower;
b = a.tier - 1;
if (int(a.upgrades[b][1]) <= _root.gold) {
a.damage = int(a.upgrades[b][2]);
a.range = a.upgrades[b][3];
a.rate = a.upgrades[b][4];
a.splash = a.upgrades[b][5];
a.slow = a.upgrades[b][6];
a.cost = a.cost + int(a.upgrades[b][1]);
a.tier++;
_root.towerInfo(a);
_root.gold = _root.gold - int(a.upgrades[b][1]);
updateInfoBar();
}
}
function sell() {
tower = _root.selectedTower;
if (((tower != "undefined") && (tower != "null")) && (tower != "")) {
sellprice = Math.floor(tower.cost * 0.85);
if (sellprice != "undefined") {
_root.gold = _root.gold + sellprice;
}
_root.range._x = 1000;
_root.range._height = 0;
_root.range._width = 0;
if (tower.maxtier == 2) {
_root.gems++;
}
tower.removeMovieClip();
_root.UpgradeTowerInfo._visible = false;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
stop();
_root.skillstats.swapDepths(9090);
_root.skillstats.removeMovieClip();
_root.challengescore._x = 2000;
_root.challengescore._y = 2000;
_root.levelwin = 0;
_root.gold = 100;
_root.gems = _global.gems;
_root.attackskill = _global.attackskill;
_root.rangeskill = _global.rangeskill;
_root.killbounty = _global.killbounty;
_root.techlevel = _global.techlevel;
if (_global.startmoneylevel == 1) {
_root.gold = 150;
} else if (_global.startmoneylevel == 2) {
_root.gold = 200;
} else if (_global.startmoneylevel == 3) {
_root.gold = 250;
} else if (_global.startmoneylevel == 4) {
_root.gold = 400;
} else if (_global.startmoneylevel == 5) {
_root.gold = 600;
}
_root.wave = 0;
_root.levelnew = 1;
_root.effectcount = 1;
_root.staticcount = 1;
_root.shockct = 1;
_root.gameover = 0;
_root.towerCount = 0;
_root.creepcount = 1;
_root.goldeffectct = 1;
_root.kills = 0;
_root.pauses = 0;
_root.creepleaks = 0;
_root.timer = 45;
_root.lives = 20;
_root.goldworth = 0;
_root.creepArray = [];
_global.sound = 1;
_root.particlecount = 1;
_root.splashct = 1;
_root.pwncount = 1;
_root.explodecount = 1;
_root.score = 0;
_root.playsound = new Sound(this);
_root.playsound.attachSound("music");
if (_global.sound == 1) {
_root.playsound.start(0, 100000);
}
_root.playsound1 = new Sound(this);
_root.playsound1.attachSound("sndplasma");
_root.playsound2 = new Sound(this);
_root.playsound2.attachSound("sndrocket");
_root.playsound3 = new Sound(this);
_root.playsound3.attachSound("sndbullet");
_root.playsound4 = new Sound(this);
_root.playsound4.attachSound("sndbullet1");
_root.playsound5 = new Sound(this);
_root.playsound5.attachSound("sndexplode");
_root.playsound6 = new Sound(this);
_root.playsound6.attachSound("sndlaser");
_global.maxwaves = 26;
_root.wavemax = _global.maxwaves;
_root.waves = [[20, 76, 3.75, 667], [20, 90, 4.5, 600], [20, 103, 2.75, 400], [20, 120, 3.75, 667], [20, 141, 4.05, 600], [20, 164, 3.75, 667], [20, 192, 1.5, 266], [2, 800, 5.25, 600], [20, 263, 3, 667], [20, 308, 3.75, 667], [20, 361, 3, 667], [20, 422, 2.75, 400], [20, 494, 3, 650], [20, 577, 5, 700], [20, 676, 3.25, 550], [2, 4000, 2.75, 800], [20, 925, 3.75, 600], [20, 1082, 4, 700], [20, 1266, 4.25, 650], [20, 1481, 3.5, 580], [20, 1737, 3.25, 500], [20, 2036, 3.4, 525], [20, 2387, 2.8, 475], [20, 2799, 3, 600], [2, 13000, 3.141592, 620], [20, 3848, 3.5, 650], [20, 4512, 4, 700], [20, 5290, 3.3, 600], [20, 6203, 3.4, 590], [20, 7273, 3.12, 550], [20, 8546, 3.3, 600], [20, 10041, 3.2, 570], [2, 45000, 2.5, 800], [20, 13863, 3, 600], [20, 16290, 3.15, 577], [20, 19140, 3.2, 500], [20, 22490, 3.35, 600], [20, 26426, 3.4, 620], [20, 31050, 3.5, 630], [20, 36484, 3.75, 670], [2, 200000, 3, 700], [20, 50800, 3.2, 650], [20, 59946, 3.3, 660], [20, 70734, 3.4, 675], [20, 83466, 3.5, 690], [20, 98490, 4, 800], [20, 116218, 3, 650], [20, 137137, 3.5, 700], [2, 800000, 4, 1000], [20, 190950, 3.5, 700], [20, 229140, 3.4, 600], [20, 274968, 3.33, 590], [20, 329962, 4.5, 750], [20, 395954, 4, 700], [20, 475145, 3.4, 600], [20, 570174, 3.6, 625], [2, 3500000, 3.7, 700], [20, 821050, 3.8, 710], [20, 985261, 4, 650], [20, 1182313, 5, 700]];
_root.nowhp = 0;
_root.nowspeed = 0;
_root.nexthp = _root.waves[0][1];
_root.nextspeed = 2.5;
Instance of Symbol 228 MovieClip "wp11" in Frame 12
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp12" in Frame 12
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp13" in Frame 12
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp14" in Frame 12
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp1" in Frame 12
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp2" in Frame 12
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp3" in Frame 12
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp4" in Frame 12
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp5" in Frame 12
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp6" in Frame 12
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp7" in Frame 12
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp8" in Frame 12
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp9" in Frame 12
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp10" in Frame 12
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 236 MovieClip in Frame 12
on (press) {
_root.marker.active = 1;
_root.marker.tower = "basic";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Tower. Shoots bullets at enemies. 80 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 238 MovieClip in Frame 12
on (press) {
_root.marker.active = 1;
_root.marker.tower = "splash";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Splash Tower. Shoots Exploding bullets at enemies. 29 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 240 MovieClip in Frame 12
on (press) {
_root.marker.active = 1;
_root.marker.tower = "slow";
_root.marker.cost = 150;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Slow Tower. Shoots shots that slow the enemy. 100 base damage. Cost: $150";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 242 MovieClip in Frame 12
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "poison";
_root.marker.cost = 500;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Splash Poison Tower. Splashes Poison(150/sec for level 1) to hurt the enemy. 300 base damage. Cost: $500. Tech level 1 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 244 MovieClip in Frame 12
on (press) {
_root.marker.active = 1;
_root.marker.tower = "static";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Static tower. 6% chance to make target take 50% of the damage that is has lost so far. 500 base damage. Cost: $650. Tech Level 1 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 246 MovieClip in Frame 12
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "shock";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Shock tower. Has the ability to random stun any enemy within its radius. Enemies cannot be stunned if already under effect of stun. 500 base damage. Cost: $1000. Tech Level 4 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 248 MovieClip in Frame 12
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "stun";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Stun Tower. Has a 10% chance of stunning enemies. 500 base damage. Cost: $700. Tech Level 3 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 252 MovieClip in Frame 12
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "death";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Instant death tower. 8% chance to instantly kill if target is under 35% HP. 500 base damage. Cost: $650. Tech level 3 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 254 MovieClip in Frame 12
on (press) {
if (_root.techlevel >= 2) {
_root.marker.active = 1;
_root.marker.tower = "money";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Money Tower. Has a 5% chance of stealing money from creeps it hits at level 1. 500 Damage. Cost: $700. Tech level 2 Required";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 256 MovieClip in Frame 12
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "explode";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Exploding Tower. Damages and slows all enemies in a radius of itself. 500 base damage. Cost: $1000. Tech level 4 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 258 MovieClip in Frame 12
on (press) {
if (_root.gems > 0) {
if (_root.techlevel >= 5) {
_root.marker.active = 1;
_root.marker.tower = "ultimate";
_root.marker.cost = 20000;
_root.tinfo._visible = false;
}
}
}
on (rollOver) {
_root.buyinfo = "Ultimate Tower. Extreme Damage and splash. 100000 damage. Cost: $20000 and 1 Gem. Tech Level 5 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 236 MovieClip "tower_basic" in Frame 12
onClipEvent (load) {
title = "Basic Damage Tower";
desc = "Basic Damage Tower";
cost = 50;
this.range = 65 * (1 + (0.05 * _global.rangeskill));
this.range2 = 66 * (1 + (0.05 * _global.rangeskill));
this.range3 = 67 * (1 + (0.05 * _global.rangeskill));
this.range4 = 68 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 80;
damage = 80 * (1 + (0.05 * _global.attackskill));
this.damage2 = 240 * (1 + (0.05 * _global.attackskill));
this.damage3 = 720 * (1 + (0.05 * _global.attackskill));
this.damage4 = 2160 * (1 + (0.05 * _global.attackskill));
rate = 19;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 240\rRange: 66\rCooldown: 18\rEffect: None", 120, this.damage2, this.range2, 18], ["Damage: 720\rRange: 67\rCooldown: 17\rEffect: None", 300, this.damage3, this.range3, 17], ["Damage: 2160\rRange: 68\rCooldown: 17\rEffect: None", 880, this.damage4, this.range4, 17]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_basic")) {
if (target == undefined) {
target = 0;
}
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 264 MovieClip "range" in Frame 12
onClipEvent (enterFrame) {
if ((_root.selectedTower == "") && (_root.marker.active == 0)) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 267 MovieClip "marker" in Frame 12
onClipEvent (load) {
active = 0;
inpath = 0;
this.swapDepths(9998);
}
onClipEvent (enterFrame) {
if (active == 1) {
this.startDrag(true);
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((maphit == 1) && (inpath == 0)) {
this.gotoAndStop(1);
_root.range.gotoAndStop(1);
} else {
this.gotoAndStop(2);
_root.range.gotoAndStop(2);
}
_root.range._x = _x;
_root.range._y = _y;
_root.range._width = _root["tower_" + tower].range * 2;
_root.range._height = _root["tower_" + tower].range * 2;
}
if (Key.isDown(32)) {
active = 0;
trace(1);
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
on (press) {
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((((maphit == 1) && (inpath == 0)) && (_root.gold >= this.cost)) && (_root.pauses == 0)) {
if (this.hitTest(_root.nextwave) == false) {
if (_root.marker.tower == "ultimate") {
if (_root.gems > 0) {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gems--;
_root.gold = _root.gold - this.cost;
}
} else {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gold = _root.gold - this.cost;
}
}
}
if (maphit == 0) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
if (this.hitTest(_root.nextwave)) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
Instance of Symbol 238 MovieClip "tower_splash" in Frame 12
onClipEvent (load) {
title = "Splash Tower";
desc = "Splash Tower";
cost = 50;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 73 * (1 + (0.05 * _global.rangeskill));
this.range4 = 75 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 34 * (1 + (0.05 * _global.attackskill));
this.damage2 = 102 * (1 + (0.05 * _global.attackskill));
this.damage3 = 306 * (1 + (0.05 * _global.attackskill));
this.damage4 = 918 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 102\rRange: 72\rCooldown: 21\rEffect: Splash", 120, this.damage2, this.range2, 21], ["Damage: 306\rRange: 73\rCooldown: 21\rEffect: Splash", 300, this.damage3, this.range3, 21], ["Damage: 918\rRange: 75\rCooldown: 20\rEffect: Splash", 880, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_splash")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > ((range * range) + 81)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 289 MovieClip "explosion" in Frame 12
onClipEvent (load) {
if (this._name == "explosion") {
this._visible = false;
}
}
Instance of Symbol 240 MovieClip "tower_slow" in Frame 12
onClipEvent (load) {
title = "Slow tower";
desc = "Slow tower";
cost = 150;
this.range = 68 * (1 + (0.05 * _global.rangeskill));
this.range2 = 69 * (1 + (0.05 * _global.rangeskill));
this.range3 = 70 * (1 + (0.05 * _global.rangeskill));
this.range4 = 71 * (1 + (0.05 * _global.rangeskill));
this.range5 = 72 * (1 + (0.05 * _global.rangeskill));
damage = 100 * (1 + (0.05 * _global.attackskill));
this.damage2 = 500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2200 * (1 + (0.05 * _global.attackskill));
this.damage4 = 10500 * (1 + (0.05 * _global.attackskill));
this.damage5 = 33000 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 500\rRange: 69\rCooldown: 22\rEffect: Slow", 500, this.damage2, this.range2, 22], ["Damage: 2200\rRange: 70\rCooldown: 21\rEffect: Slow", 1250, this.damage3, this.range3, 21], ["Damage: 10500\rRange: 71\rCooldown: 21\rEffect: Slow", 3150, this.damage4, this.range4, 21], ["Damage: 33000\rRange: 72\rColldown:19\rEffect: Slow", 8000, this.damage5, this.range5, 19]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_slow")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 314 MovieClip in Frame 12
on (press) {
_root.marker.active = 1;
_root.marker.tower = "rust";
_root.marker.cost = 400;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Rust Tower. Shoots shots that rust the enemy, causing them to take more damage. 300 base damage. Ultra Fast. Cost: $400";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 314 MovieClip "tower_rust" in Frame 12
onClipEvent (load) {
title = "Rust Tower";
desc = "Rust Tower";
cost = 400;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range5 = 80 * (1 + (0.05 * _global.rangeskill));
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 930 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 5000 * (1 + (0.05 * _global.attackskill));
this.damage5 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 9;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 930\rRange: 76\rCooldown: 9\rEffect: Rust", 1200, this.damage2, this.range2, 9], ["Damage: 2000\rRange: 77\rCooldown: 8\rEffect: Rust", 3000, this.damage3, this.range3, 8], ["Damage: 5000\rRange: 78\rCooldown: 8\rEffect: Rust", 6000, this.damage4, this.range4, 8], ["Damage: 15000\rRange: 80\rCooldown: 7\rEffect:Rust", 13500, this.damage5, this.range5, 7]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 242 MovieClip "tower_poison" in Frame 12
onClipEvent (load) {
title = "Splash Poison";
desc = "Splash Poison";
cost = 500;
this.range = 70;
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 75 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 12000 * (1 + (0.05 * _global.attackskill));
rate = 23;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 72\rCooldown: 22\rEffect:Poison(600)", 1500, this.damage2, this.range2, 22], ["Damage: 4000\rRange: 75\rCooldown: 21\rEffect:Poison(2700)", 5000, this.damage3, this.range3, 21], ["Damage: 12000\rRange:78\rCooldown: 20\rEffect:Poison(10000)", 11500, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 244 MovieClip "tower_static" in Frame 12
onClipEvent (load) {
title = "Static";
desc = "Static";
cost = 500;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 80 * (1 + (0.05 * _global.rangeskill));
this.range4 = 85 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 25;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 77\rCooldown: 24\rEffect:Static(7)", 1500, this.damage2, this.range2, 24], ["Damage: 4000\rRange: 80\rCooldown: 23\rEffect:Static(10)", 5000, this.damage3, this.range3, 23], ["Damage: 15000\rRange: 85\rCooldown:22\rEffect:Static(12)", 11000, this.damage4, this.range4, 22]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 252 MovieClip "tower_death" in Frame 12
onClipEvent (load) {
title = "Instant Death";
desc = "Instant Death";
cost = 650;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 79 * (1 + (0.05 * _global.rangeskill));
this.range4 = 82 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 650 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 15000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 35000 * (1 + (0.05 * _global.attackskill));
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3000)\rRange: 77\rCooldown: 28\rEffect:Death(12%)", 2000, this.damage2, this.range2, 28], ["Damage: 15000\rRange: 79\rCooldown: 26\rEffect:Death(16%)", 7000, this.damage3, this.range3, 26], ["Damage: 35000\rRange:82\rCooldown: 23 \rEffect:Death(19%)", 13500, this.damage4, this.range4, 23]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 248 MovieClip "tower_stun" in Frame 12
onClipEvent (load) {
title = "Stun Tower";
desc = "Stun Tower";
cost = 700;
rate = 22;
this.range = 73 * (1 + (0.05 * _global.rangeskill));
this.range2 = 74 * (1 + (0.05 * _global.rangeskill));
this.range3 = 76 * (1 + (0.05 * _global.rangeskill));
this.range4 = 79 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 45000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 74\rCooldown: 22\rEffect:Stun(13%)", 2500, this.damage2, this.range2, 22], ["Damage: 17000\rRange: 76\rCooldown: 21\rEffect:Stun(16%)", 9000, this.damage3, this.range3, 21], ["Damage: 45000\rRange: 79\rCooldown: 20\rEffect:Stun(18%)", 18000, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 254 MovieClip "tower_money" in Frame 12
onClipEvent (load) {
title = "Money Tower";
desc = "Money Tower";
cost = 700;
rate = 25;
this.range = 75;
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 78 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 40000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 76\rCooldown: 24\rEffect:Steal Money(8)", 2500, this.damage2, this.range2, 24], ["Damage: 17000\rRange: 78\rCooldown: 23\rEffect:Steal(9)", 9000, this.damage3, this.range3, 23], ["Damage: 40000\rRange: 80\rCooldown:21\rEffect:Steal(11)", 18000, this.damage4, this.range4, 21]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 256 MovieClip "tower_explode" in Frame 12
onClipEvent (load) {
title = "Explosion";
desc = "Explosion";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 80 * (1 + (0.05 * _global.rangeskill));
this.range2 = 82 * (1 + (0.05 * _global.rangeskill));
this.range3 = 84 * (1 + (0.05 * _global.rangeskill));
this.range4 = 86 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 82\rCooldown: 28\rEffect:Slow", 3000, this.damage2, this.range2, 28], ["Damage: 8000\rRange: 84\rCooldown: 27\rEffect:Slow", 10000, this.damage3, this.range3, 27], ["Damage: 25000\rRange: 86\rCooldown:25\rEffect:Slow", 25000, this.damage4, this.range4, 25]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 336 MovieClip "shockshot" in Frame 12
onClipEvent (enterFrame) {
this._rotation = this._rotation + 30;
}
Instance of Symbol 246 MovieClip "tower_shock" in Frame 12
onClipEvent (load) {
title = "Shock";
desc = "Shock";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 75 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 35;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 75\rCooldown: 33\rEffect:Shock", 3000, this.damage2, this.range2, 33], ["Damage: 8000\rRange: 77\rCooldown: 30\rEffect:Shock", 10000, this.damage3, this.range3, 30], ["Damage: 25000\rRange: 80\rCooldown: 27\rEffect:Shock", 25000, this.damage4, this.range4, 27]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 258 MovieClip "tower_ultimate" in Frame 12
onClipEvent (load) {
title = "Ultimate Tower";
desc = "Ultimate Tower";
cost = 20000;
damage = 100000 * (1 + (0.05 * _global.attackskill));
this.damage2 = 200000 * (1 + (0.05 * _global.attackskill));
this.range = 85 * (1 + (0.05 * _global.rangeskill));
this.range2 = 95 * (1 + (0.05 * _global.rangeskill));
rate = 27;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 2;
upgrades = [["Damage: 200000\rRange: 95\rCooldown: 33\rEffect:Splash", 40000, this.damage2, this.range2, 24]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_ultimate")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 353 MovieClip "UpgradeTowerInfo" in Frame 12
onClipEvent (load) {
_visible = false;
swapDepths(100000);
}
Instance of Symbol 378 MovieClip "creep1" in Frame 12
onClipEvent (load) {
this._rotation = this._rotation + 45;
}
Instance of Symbol 380 MovieClip in Frame 12
onClipEvent (enterFrame) {
if (_root.timer > 50) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 381 MovieClip in Frame 12
onClipEvent (load) {
this._visible = false;
this.startDrag(true);
this.count = 0;
}
onClipEvent (enterFrame) {
trace(_root.techlevel);
if (Key.isDown(77) && (_global.sound == 1)) {
_global.sound = 0;
stopAllSounds();
}
if (Key.isDown(78) && (_global.sound == 0)) {
_global.sound = 1;
_root.playsound.start(0, 100000);
}
if (Key.isDown(80) && (_root.pauses == 0)) {
_root.pauses = 1;
}
if (Key.isDown(85) && (_root.pauses == 1)) {
_root.pauses = 0;
}
if (_root.pauses == 0) {
_root.levelnew++;
_root.checkkill();
this.count++;
if ((this.count % 30) == 0) {
_root.timer--;
}
if (_root.timer <= 0) {
if (_root.wave < _global.maxwaves) {
_root.newLevel();
}
_root.timer = 60;
}
if ((_root.lives <= 0) && (_root.gameover == 0)) {
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
if (_root.creepArray.length <= 0) {
_root.gotoAndPlay("lose2");
}
}
if (((((_root.wave >= _global.maxwaves) && (_root.creepArray.length <= 0)) && (_root.gameover == 0)) && (_root.kills >= 20)) && (_root.levelnew > 120)) {
_root.levelwin = 1;
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
_root.gotoAndPlay("win2");
}
}
}
Instance of Symbol 387 MovieClip "tinfo" in Frame 12
onClipEvent (load) {
this.swapDepths(99999);
}
Instance of Symbol 421 MovieClip "quitbox" in Frame 12
onClipEvent (load) {
this._visible = false;
}
Frame 13
stop();
stopAllSounds();
Frame 14
stop();
stopAllSounds();
_root.gameover = 1;
if (_root.levelwin == 0) {
_root.gotoAndPlay("lose2");
}
if (_root.lives == 20) {
_root.skillgained = 2;
} else {
_root.skillgained = 1;
}
storedskills = SharedObject.getLocal("flashskill");
if (storedskills.data.level2gain == undefined) {
_global.xpleft = _global.xpleft + _root.skillgained;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level2gain = _root.skillgained;
} else {
xplast = storedskills.data.level2gain;
skilldifferent = _root.skillgained - xplast;
if (skilldifferent > 0) {
_global.xpleft = _global.xpleft + skilldifferent;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level2gain = storedskills.data.level2gain + skilldifferent;
}
}
if ((storedskills.data.maxlevelbeat < 2) || (storedskills.data.maxlevelbeat == undefined)) {
storedskills.data.maxlevelbeat = 2;
}
if ((storedskills.data.level2score == undefined) || (_root.score > storedskills.data.level2score)) {
storedskills.data.level2score = _root.score;
}
Frame 15
function TowerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
}
function towerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
_root.UpgradeTowerInfo._visible = true;
if (tower.maxtier >= tower.tier) {
_root.UpgradeTowerInfo.UpgradeInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 1][2]) + "\rRange: ") + tower.upgrades[tower.tier - 1][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 1][4]) + "\rEffect: ") + tower.desc;
if (tower.tier == 1) {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.damage) + "\rRange: ") + tower.range) + "\rCoolDown: ") + tower.rate) + "\rEffect: ") + tower.desc;
} else {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 2][2]) + "\rRange: ") + tower.upgrades[tower.tier - 2][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 2][4]) + "\rEffect: ") + tower.desc;
}
_root.UpgradeTowerInfo.UpgradeButton.UpgradeButtonText.text = ("Upgrade [$" + tower.upgrades[tower.tier - 1][1]) + "]";
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
sellprice = Math.floor(tower.cost * 0.85);
_root.UpgradeTowerInfo.sellbutton.UpgradeButtonText.text = ("Sell [$" + sellprice) + "]";
if (tower.maxtier > tower.tier) {
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
} else {
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
}
} else {
_root.UpgradeTowerInfo.f.text = "";
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
_root.UpgradeTowerInfo.h.text = "";
}
}
function newLevel() {
if (_root.wave < 59) {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.02 * _root.gold);
_root.nowspeed = _root.waves[_root.wave - 1][2];
_root.nextspeed = _root.waves[_root.wave][2];
_root.nowhp = _root.waves[_root.wave - 1][1];
_root.nexthp = _root.waves[_root.wave][1];
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = _root.goldworth * 1.7;
_root.goldworth = _root.goldworth * (1 + (0.05 * _global.killbounty));
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", _root.waves[_root.wave - 1][3], _root.wave, "creep1", _root.waves[_root.wave - 1][2], _root.waves[_root.wave - 1][1], _root.goldworth);
_root["spawned" + _root.wave] = _root.waves[_root.wave - 1][0];
} else {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.03 * _root.gold);
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = Math.floor(_root.goldworth);
_root.goldworth = _root.goldworth * 1.2;
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
randspeed = 1.25;
_root.nowspeed = randspeed;
_root.nextspeed = "???";
wavessince = _root.wave - 60;
hpmultiplier = Math.pow(1.2, wavessince);
_root.nowhp = Math.floor(_root.waves[59][1] * hpmultiplier);
_root.nexthp = Math.floor(_root.nowhp * 1.2);
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", 50, _root.wave, "creep1", _root.nowspeed, _root.nowhp, _root.goldworth);
_root["spawned" + _root.wave] = 30;
}
}
function spawn(level, creep, speed, health, gold) {
if (_root["spawned" + level] == 0) {
clearInterval(_root["spawnInterval" + level]);
} else {
_root["spawned" + level]--;
playanim = (level % 5) + 1;
_root.creepcount++;
_root[creep].duplicateMovieClip("c" + _root.creepcount, 20000 + _root.creepcount);
if (_root.creepcount > 10000) {
_root.creepcount = 1;
}
c = _root["c" + _root.creepcount];
c.creep.gotoAndStop(playanim);
c._x = _root.wp1._x;
c._y = _root.wp1._y;
c.health = health;
c.slowcount = 1;
c.isslow = 0;
c.maxhealth = health;
c.speed = speed;
c.maxspeed = c.speed;
c.ispoisoned = 0;
c.poisonedlevel = 0;
c.poisoncount = 0;
c.fullmax = c.maxspeed;
c.targ = 2;
c.rnd = 5;
c.shocked = 0;
c.shockcount = 1;
c.gold = gold;
c.iscorrode = 0;
c.isstunned = 0;
c.stuncount = 1;
c.splashslowed = 0;
c.splashslowedcount = 1;
_root.creepArray[_root.creepArray.length] = c;
c.onEnterFrame = function () {
if (_root.pauses == 0) {
this.health_bar.health._width = 30 * (this.health / this.maxhealth);
this.targX = (_root["wp" + this.targ]._x - 5) + this.rnd;
this.targY = (_root["wp" + this.targ]._y - 5) + this.rnd;
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this.rads = (this.dir * 3.141593) / 180;
if ((this.isstunned != 0) || (this.shocked == 1)) {
this.stuncount++;
if ((this.stuncount % 2) == 1) {
this._x = this._x + 2;
} else {
this._x = this._x - 2;
}
}
if (this.stuncount > 160) {
this.isstunned = 0;
this.stuncount = 1;
}
if (this.isslow != 0) {
this.speed = this.isslow * this.fullmax;
this.slowcount++;
}
if (this.slowcount > 160) {
this.speed = this.fullmax;
this.isslow = 0;
this.slowcount = 1;
}
if (this.splashslowed != 0) {
this.fullmax = this.maxspeed * this.splashslowed;
this.speed = this.fullmax;
if (this.isslow != 0) {
this.speed = this.fullmax * this.isslow;
}
this.splashslowedcount++;
}
if (this.splashslowedcount > 100) {
this.splashslowed = 0;
this.fullmax = this.maxspeed;
this.speed = this.fullmax;
this.splashslowedcount = 1;
}
if (this.iscorrode != 0) {
this.corrodecount++;
}
if (this.corrodecount > 200) {
this.iscorrode = 0;
this.corrdecount = 1;
}
if (this.ispoisoned == 1) {
if ((this.poisoncount % 40) == 0) {
this.health = this.health - this.poisonedlevel;
}
this.poisoncount++;
}
if (this.shocked == 1) {
this.shockcount++;
}
if (this.shockcount >= 80) {
this.shocked = 0;
this.shockcount = 1;
}
if (this.poisoncount > 200) {
this.ispoisoned = 0;
this.poisoncount = 0;
}
if ((this.isstunned == 0) && (this.shocked == 0)) {
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
}
d = Math.pow(this._x - this.targX, 2) + Math.pow(this._y - this.targY, 2);
if (d < 25) {
this.targ++;
if (this.targ > 12) {
_root.leak(this);
this._x = _root.wp1._x;
this._y = _root.wp1._y;
this.targ = 2;
}
}
this.r = this.dir;
if ((this._rotation + 10) < this.r) {
this._rotation = this._rotation + 10;
} else if ((this._rotation - 10) > this.r) {
this._rotation = this._rotation - 10;
} else {
this._rotation = r;
}
}
};
}
}
function fire(from, to, speed, acc, maxpeed, projectile, damage, towerid) {
_root.particlecount++;
_root[projectile].duplicateMovieClip("p" + _root.particlecount, 2000 + _root.particlecount);
r = _root["p" + _root.particlecount];
r._x = from._x;
r._y = from._y;
r.tier = from.tier;
r.type = from.type;
r.targ = to;
r.speed = speed;
r.acc = acc;
r.maxspeed = maxspeed;
r.damage = damage;
r.projectile = projectile;
r.towerid = towerid;
if (_root.particlecount > 300) {
_root.particlecount = 0;
}
r.onEnterFrame = function () {
if (_root.pauses == 0) {
if (("" + this.targ) != "") {
this.targX = this.targ._x;
this.targY = this.targ._y;
} else {
this._rotation = (Math.atan2(this.targ._y - this._y, this.targ._x - this._x) * 180) / 3.141593;
if (_root.creepArray.length <= 0) {
this.removeMovieClip();
} else {
w = 0;
if (w <= _root.creepArray.length) {
this.targ = _root.creepArray[w];
}
}
}
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this._rotation = this.dir + 90;
this.rads = (this.dir * 3.141593) / 180;
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
if (this.speed < this.maxspeed) {
this.speed = this.speed + this.acc;
}
d = ((this._x - this.targX) * (this._x - this.targX)) + ((this._y - this.targY) * (this._y - this.targY));
if (d < 25) {
if (this.towerid == 10) {
randcrit = random(100);
if ((this.tier == 1) && (randcrit < 11)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 2) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 3) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 4) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 5) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
} else if (this.towerid == 4) {
this.targ.corrodecount = 1;
if (this.tier == 1) {
this.targ.iscorrode = 0.06;
} else if (this.tier == 2) {
this.targ.iscorrode = 0.12;
} else if (this.tier == 3) {
this.targ.iscorrode = 0.2;
} else if (this.tier == 4) {
this.targ.iscorrode = 0.32;
} else if (this.tier == 5) {
this.targ.iscorrode = 0.45;
}
}
this.targ.health = this.targ.health - (this.damage * (1 + this.targ.iscorrode));
if (this.towerid == 7) {
randstun = random(100);
if ((this.tier == 1) && (randstun < 10)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 2) && (randstun < 14)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 3) && (randstun < 17)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 4) && (randstun < 20)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
}
} else if (this.towerid == 5) {
this.targ.ispoisoned = 1;
this.targ.poisoncount = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < 4225) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[i].ispoisoned = 1;
_root.creepArray[i].poisoncount = 1;
}
i++;
}
if (this.tier == 1) {
this.targ.poisonedlevel = 150;
} else if (this.tier == 2) {
this.targ.poisonedlevel = 600;
} else if (this.tier == 3) {
this.targ.poisonedlevel = 2700;
} else if (this.tier == 4) {
this.targ.poisonedlevel = 10000;
}
_root.poisonball.duplicateMovieClip("poisonball" + _root.splashct, 6300 + _root.splashct);
_root["poisonball" + _root.splashct]._x = this._x;
_root["poisonball" + _root.splashct]._y = this._y;
_root["poisonball" + _root.splashct]._width = 80;
_root["poisonball" + _root.splashct]._height = 80;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 6) {
if (this.targ.health < (0.35 * this.targ.maxhealth)) {
randdeath = random(100);
if ((this.tier == 1) && (randdeath < 8)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 2) && (randdeath < 12)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 3) && (randdeath < 16)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 4) && (randdeath < 20)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
}
}
} else if (this.towerid == 8) {
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < 10000) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
if (this.tier == 1) {
_root.creepArray[k].splashslowed = 0.6;
} else if (this.tier == 2) {
_root.creepArray[k].splashslowed = 0.55;
} else if (this.tier == 3) {
_root.creepArray[k].splashslowed = 0.5;
} else if (this.tier == 4) {
_root.creepArray[k].splashslowed = 0.4;
}
_root.creepArray[k].splashslowedcount = 0;
}
k++;
}
_root.explodingshot.duplicateMovieClip("explodingshot" + _root.explodecount, 5100 + _root.explodecount);
_root["explodingshot" + _root.explodecount]._x = this._x;
_root["explodingshot" + _root.explodecount]._y = this._y;
_root.explodecount++;
if (_root.explodecount > 20) {
_root.explodecount = 1;
}
} else if (this.towerid == 26) {
if (this.tier == 1) {
shockwidth = 75;
shockchance = 8;
} else if (this.tier == 2) {
shockwidth = 80;
shockchance = 10;
} else if (this.tier == 3) {
shockwidth = 85;
shockchance = 12;
} else if (this.tier == 4) {
shockwidth = 90;
shockchance = 14;
}
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < (shockwidth * shockwidth)) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
shockper = random(100);
if (shockper < shockchance) {
if (_root.creepArray[k].shocked == 0) {
_root.creepArray[k].shocked = 1;
_root.creepArray[k].splashslowedcount = 1;
}
}
}
k++;
}
_root.shockshot.duplicateMovieClip("shockshot" + _root.shockct, 26500 + _root.shockct);
_root["shockshot" + _root.shockct]._x = this._x;
_root["shockshot" + _root.shockct]._y = this._y;
_root["shockshot" + _root.shockct]._width = 2 * shockwidth;
_root["shockshot" + _root.shockct]._height = 2 * shockwidth;
_root.shockct++;
if (_root.shockct > 20) {
_root.shockct = 1;
}
} else if (this.towerid == 22) {
if (this.tier == 1) {
staticval = 5;
} else if (this.tier == 2) {
staticval = 7;
} else if (this.tier == 3) {
staticval = 10;
}
staticchance = random(100);
trace(staticchance);
if (staticchance < staticval) {
damagetaken = this.targ.maxhealth - this.targ.health;
(this.health - this.health) - (0.5 * damagetaken);
_root.lighteffect.duplicateMovieClip("lighteffect" + _root.staticcount, 23000 + _root.staticcount);
_root["lighteffect" + _root.staticcount]._x = this._x;
_root["lighteffect" + _root.staticcount]._y = this._y;
_root.staticcount++;
if (_root.staticcount > 50) {
_root.staticcount = 1;
}
}
} else if (this.towerid == 25) {
stealval = random(100);
if (this.tier == 1) {
this.stealmax = 6;
} else if (this.tier == 2) {
this.stealmax = 9;
} else if (this.tier == 3) {
this.stealmax = 10;
} else if (this.tier == 4) {
this.stealmax = 12;
}
if (stealval < this.stealmax) {
_root.gold = _root.gold + this.targ.gold;
_root.goldeffect.duplicateMovieClip("goldeffect" + _root.goldeffectct, 26000 + _root.goldeffectct);
_root["goldeffect" + _root.goldeffectct]._x = this._x;
_root["goldeffect" + _root.goldeffectct]._y = this._y;
_root.goldeffectct++;
if (_root.goldeffectct > 20) {
_root.goldeffectct = 1;
}
}
} else if (this.towerid == 999) {
if (this.targ.health < (0.65 * this.targ.maxhealth)) {
randteleport = random(100);
if ((this.tier == 1) && (randteleport < 8)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
_root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 2) && (randteleport < 9)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 3) && (randteleport < 10)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 4) && (randteleport < 11)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 5) && (randteleport < 13)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
}
}
} else if (this.towerid == 100) {
if (this.tier == 1) {
spradius = 1225;
spwidth = 35;
} else if (this.tier == 2) {
spradius = 1600;
spwidth = 40;
} else if (this.tier == 3) {
spradius = 2025;
spwidth = 45;
} else if (this.tier == 4) {
spradius = 2500;
spwidth = 50;
} else if (this.tier == 5) {
spradius = 3600;
spwidth = 60;
}
j = 0;
while (j <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[j]._x, 2) + Math.pow(this._y - _root.creepArray[j]._y, 2);
if (d < spradius) {
if ((("" + _root.creepArray[j]) != "") && (_root.creepArray[j] != this.targ)) {
_root.creepArray[j].health = _root.creepArray[j].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[j].splashslowed = 1;
_root.creepArray[j].splashslowedcount = 1;
}
j++;
}
_root.iceball.duplicateMovieClip("iceball" + _root.splashct, 5200 + _root.splashct);
_root["iceball" + _root.splashct]._x = this._x;
_root["iceball" + _root.splashct]._y = this._y;
_root["iceball" + _root.splashct]._width = spwidth;
_root["iceball" + _root.splashct]._height = spwidth;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 3) {
if (this.tier == 1) {
this.targ.isslow = 0.6;
}
if (this.tier == 2) {
this.targ.isslow = 0.5;
}
if (this.tier == 3) {
this.targ.isslow = 0.4;
}
if (this.tier == 4) {
this.targ.isslow = 0.35;
}
if (this.tier == 5) {
this.targ.isslow = 0.3;
}
this.targ.slowcount = 1;
} else if (this.towerid == 2) {
_root.explosion.duplicateMovieClip("explosion" + _root.explosioncount, 5000 + _root.explosioncount);
_root["explosion" + _root.explosioncount]._x = this._x;
_root["explosion" + _root.explosioncount]._y = this._y;
_root["explosion" + _root.explosioncount]._width = 100;
_root["explosion" + _root.explosioncount]._height = 100;
_root.explosioncount++;
if (_root.explosioncount > 40) {
_root.explosioncount = 1;
}
splashrad = 50;
splashrad2 = splashrad * splashrad;
i = 0;
while (i <= _root.creepArray.length) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < splashrad2) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 6000)));
}
}
i++;
}
}
if (this.targ.health <= 0) {
this.targ.isDead = 1;
}
this.removeMovieClip();
}
}
};
}
function checkkill() {
n = 0;
while (n < _root.creepArray.length) {
if ((_root.creepArray[n].health <= 0) || (_root.creepArray[n] == "undefined")) {
_root.kills++;
_root.aftereffect.duplicateMovieClip("aftereffect" + _root.effectcount, 50000 + _root.effectcount);
_root["aftereffect" + _root.effectcount]._x = _root.creepArray[n]._x;
_root["aftereffect" + _root.effectcount]._y = _root.creepArray[n]._y;
_root.effectcount++;
if (_root.effectcount > 50) {
_root.effectcount = 1;
}
if (((_root.creepArray[n].gold != "undefined") && (_root.creepArray[n].gold != "null")) && (_root.creepArray[n].gold > 0)) {
_root.gold = _root.gold + _root.creepArray[n].gold;
_root.score = _root.score + _root.creepArray[n].maxhealth;
}
_root.creepArray[n].removeMovieClip();
_root.creepArray.splice(n, 1);
}
n++;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
function kill(creep) {
_root.kills++;
if (_root.kills >= _root.waves[_root.wave - 1][0]) {
_root.kills = 0;
_root.newLevel();
}
creep.onEnterFrame = function () {
this.removeMovieClip();
};
}
function upgrade() {
a = _root.selectedTower;
b = a.tier - 1;
if (int(a.upgrades[b][1]) <= _root.gold) {
a.damage = int(a.upgrades[b][2]);
a.range = a.upgrades[b][3];
a.rate = a.upgrades[b][4];
a.splash = a.upgrades[b][5];
a.slow = a.upgrades[b][6];
a.cost = a.cost + int(a.upgrades[b][1]);
a.tier++;
_root.towerInfo(a);
_root.gold = _root.gold - int(a.upgrades[b][1]);
updateInfoBar();
}
}
function sell() {
tower = _root.selectedTower;
if (((tower != "undefined") && (tower != "null")) && (tower != "")) {
sellprice = Math.floor(tower.cost * 0.85);
if (sellprice != "undefined") {
_root.gold = _root.gold + sellprice;
}
_root.range._x = 1000;
_root.range._height = 0;
_root.range._width = 0;
if (tower.maxtier == 2) {
_root.gems++;
}
tower.removeMovieClip();
_root.UpgradeTowerInfo._visible = false;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
stop();
_root.skillstats.swapDepths(9090);
_root.skillstats.removeMovieClip();
_root.challengescore._x = 2000;
_root.challengescore._y = 2000;
_root.levelwin = 0;
_root.gold = 100;
_root.gems = _global.gems;
_root.attackskill = _global.attackskill;
_root.rangeskill = _global.rangeskill;
_root.killbounty = _global.killbounty;
_root.techlevel = _global.techlevel;
if (_global.startmoneylevel == 1) {
_root.gold = 150;
} else if (_global.startmoneylevel == 2) {
_root.gold = 200;
} else if (_global.startmoneylevel == 3) {
_root.gold = 250;
} else if (_global.startmoneylevel == 4) {
_root.gold = 400;
} else if (_global.startmoneylevel == 5) {
_root.gold = 600;
}
_root.wave = 0;
_root.levelnew = 1;
_root.effectcount = 1;
_root.staticcount = 1;
_root.shockct = 1;
_root.gameover = 0;
_root.towerCount = 0;
_root.creepcount = 1;
_root.goldeffectct = 1;
_root.kills = 0;
_root.pauses = 0;
_root.creepleaks = 0;
_root.timer = 45;
_root.lives = 20;
_root.goldworth = 0;
_root.creepArray = [];
_global.sound = 1;
_root.particlecount = 1;
_root.splashct = 1;
_root.pwncount = 1;
_root.explodecount = 1;
_root.score = 0;
_root.playsound = new Sound(this);
_root.playsound.attachSound("music");
if (_global.sound == 1) {
_root.playsound.start(0, 100000);
}
_root.playsound1 = new Sound(this);
_root.playsound1.attachSound("sndplasma");
_root.playsound2 = new Sound(this);
_root.playsound2.attachSound("sndrocket");
_root.playsound3 = new Sound(this);
_root.playsound3.attachSound("sndbullet");
_root.playsound4 = new Sound(this);
_root.playsound4.attachSound("sndbullet1");
_root.playsound5 = new Sound(this);
_root.playsound5.attachSound("sndexplode");
_root.playsound6 = new Sound(this);
_root.playsound6.attachSound("sndlaser");
_global.maxwaves = 30;
_root.wavemax = _global.maxwaves;
_root.waves = [[20, 93, 3.75, 667], [20, 109, 4.5, 600], [20, 128, 2.75, 400], [20, 149, 3.75, 667], [20, 176, 4.05, 600], [20, 204, 3.75, 667], [20, 239, 1.5, 266], [2, 900, 5.25, 600], [20, 328, 3, 667], [20, 384, 3.75, 667], [20, 450, 3, 667], [20, 526, 4, 250], [20, 616, 3, 650], [20, 720, 5, 700], [20, 843, 3.25, 550], [2, 4900, 2.75, 800], [20, 1154, 3.75, 600], [20, 1350, 4, 250], [20, 1580, 4.25, 650], [20, 1848, 3.5, 580], [20, 2159, 3.25, 500], [20, 2530, 3.4, 525], [20, 2967, 2.8, 475], [20, 3494, 3, 600], [2, 15600, 3.141592, 620], [20, 4783, 3.5, 200], [20, 5608, 4, 700], [20, 6575, 3.3, 600], [20, 7710, 3.4, 590], [20, 9040, 3.12, 550], [20, 10623, 3.3, 600], [20, 12481, 3.2, 570], [2, 55000, 2.5, 800], [20, 17232, 3, 600], [20, 20249, 3.15, 577], [20, 23792, 3.2, 500], [20, 27957, 3.35, 600], [20, 32849, 3.4, 620], [20, 38597, 3.5, 630], [20, 45352, 3.75, 670], [20, 53516, 3, 700], [20, 63148, 3.2, 650], [20, 74515, 3.3, 660], [20, 87928, 3.4, 675], [20, 103755, 3.5, 690], [20, 122437, 4, 800], [20, 144469, 3, 650], [20, 170473, 3.5, 700], [2, 976000, 4, 1000], [20, 238375, 3.5, 700], [20, 284841, 3.4, 600], [20, 341809, 3.33, 590], [20, 410171, 4.5, 750], [20, 492205, 4, 700], [20, 593155, 3.4, 600], [20, 708776, 3.6, 625], [2, 4300000, 3.7, 700], [20, 1020637, 3.8, 710], [20, 1224766, 4, 650], [20, 1469719, 5, 700]];
_root.nowhp = 0;
_root.nowspeed = 0;
_root.nexthp = _root.waves[0][1];
_root.nextspeed = 2.5;
Instance of Symbol 228 MovieClip "wp11" in Frame 15
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp12" in Frame 15
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp1" in Frame 15
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp2" in Frame 15
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp3" in Frame 15
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp4" in Frame 15
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp5" in Frame 15
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp6" in Frame 15
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp7" in Frame 15
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp8" in Frame 15
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp9" in Frame 15
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp10" in Frame 15
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 236 MovieClip in Frame 15
on (press) {
_root.marker.active = 1;
_root.marker.tower = "basic";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Tower. Shoots bullets at enemies. 80 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 238 MovieClip in Frame 15
on (press) {
_root.marker.active = 1;
_root.marker.tower = "splash";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Splash Tower. Shoots Exploding bullets at enemies. 29 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 240 MovieClip in Frame 15
on (press) {
_root.marker.active = 1;
_root.marker.tower = "slow";
_root.marker.cost = 150;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Slow Tower. Shoots shots that slow the enemy. 100 base damage. Cost: $150";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 242 MovieClip in Frame 15
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "poison";
_root.marker.cost = 500;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Splash Poison Tower. Splashes Poison(150/sec for level 1) to hurt the enemy. 300 base damage. Cost: $500, tech level 1 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 244 MovieClip in Frame 15
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "static";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Static tower. 6% chance to make target take 50% of the damage that is has lost so far. 500 base damage. Cost: $650. Tech level 1.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 246 MovieClip in Frame 15
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "shock";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Shock tower. Has the ability to random stun any enemy within its radius. Enemies cannot be stunned if already under effect of stun. 500 base damage. Cost: $1000. Tech level 4 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 248 MovieClip in Frame 15
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "stun";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Stun Tower. Has a 10% chance of stunning enemies. 500 base damage. Cost: $700. Requires Tech level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 252 MovieClip in Frame 15
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "death";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Instant death tower. 8% chance to instantly kill if target is under 35% HP. 500 base damage. Cost: $650. Tech Level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 254 MovieClip in Frame 15
on (press) {
if (_root.techlevel >= 2) {
_root.marker.active = 1;
_root.marker.tower = "money";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Money Tower. Has a 5% chance of stealing money from creeps it hits at level 1. 500 Damage. Cost: $700. Tech Level 2.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 256 MovieClip in Frame 15
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "explode";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Exploding Tower. Damages and slows all enemies in a radius of itself. 500 base damage. Cost: $1000. Tech Level 4.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 258 MovieClip in Frame 15
on (press) {
if (_root.gems > 0) {
if (_root.techlevel >= 5) {
_root.marker.active = 1;
_root.marker.tower = "ultimate";
_root.marker.cost = 20000;
_root.tinfo._visible = false;
}
}
}
on (rollOver) {
_root.buyinfo = "Ultimate Tower. Extreme Damage and splash. 100000 damage. Cost: $20000 and 1 Gem. Tech level 5 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 236 MovieClip "tower_basic" in Frame 15
onClipEvent (load) {
title = "Basic Damage Tower";
desc = "Basic Damage Tower";
cost = 50;
this.range = 65 * (1 + (0.05 * _global.rangeskill));
this.range2 = 66 * (1 + (0.05 * _global.rangeskill));
this.range3 = 67 * (1 + (0.05 * _global.rangeskill));
this.range4 = 68 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 80;
damage = 80 * (1 + (0.05 * _global.attackskill));
this.damage2 = 240 * (1 + (0.05 * _global.attackskill));
this.damage3 = 720 * (1 + (0.05 * _global.attackskill));
this.damage4 = 2160 * (1 + (0.05 * _global.attackskill));
rate = 19;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 240\rRange: 66\rCooldown: 18\rEffect: None", 120, this.damage2, this.range2, 18], ["Damage: 720\rRange: 67\rCooldown: 17\rEffect: None", 300, this.damage3, this.range3, 17], ["Damage: 2160\rRange: 68\rCooldown: 17\rEffect: None", 880, this.damage4, this.range4, 17]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_basic")) {
if (target == undefined) {
target = 0;
}
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 264 MovieClip "range" in Frame 15
onClipEvent (enterFrame) {
if ((_root.selectedTower == "") && (_root.marker.active == 0)) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 267 MovieClip "marker" in Frame 15
onClipEvent (load) {
active = 0;
inpath = 0;
this.swapDepths(9998);
}
onClipEvent (enterFrame) {
if (active == 1) {
this.startDrag(true);
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((maphit == 1) && (inpath == 0)) {
this.gotoAndStop(1);
_root.range.gotoAndStop(1);
} else {
this.gotoAndStop(2);
_root.range.gotoAndStop(2);
}
_root.range._x = _x;
_root.range._y = _y;
_root.range._width = _root["tower_" + tower].range * 2;
_root.range._height = _root["tower_" + tower].range * 2;
}
if (Key.isDown(32)) {
active = 0;
trace(1);
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
on (press) {
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((((maphit == 1) && (inpath == 0)) && (_root.gold >= this.cost)) && (_root.pauses == 0)) {
if (this.hitTest(_root.nextwave) == false) {
if (_root.marker.tower == "ultimate") {
if (_root.gems > 0) {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gems--;
_root.gold = _root.gold - this.cost;
}
} else {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gold = _root.gold - this.cost;
}
}
}
if (maphit == 0) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
if (this.hitTest(_root.nextwave)) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
Instance of Symbol 238 MovieClip "tower_splash" in Frame 15
onClipEvent (load) {
title = "Splash Tower";
desc = "Splash Tower";
cost = 50;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 73 * (1 + (0.05 * _global.rangeskill));
this.range4 = 75 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 34 * (1 + (0.05 * _global.attackskill));
this.damage2 = 102 * (1 + (0.05 * _global.attackskill));
this.damage3 = 306 * (1 + (0.05 * _global.attackskill));
this.damage4 = 918 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 102\rRange: 72\rCooldown: 21\rEffect: Splash", 120, this.damage2, this.range2, 21], ["Damage: 306\rRange: 73\rCooldown: 21\rEffect: Splash", 300, this.damage3, this.range3, 21], ["Damage: 918\rRange: 75\rCooldown: 20\rEffect: Splash", 880, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_splash")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > ((range * range) + 81)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 289 MovieClip "explosion" in Frame 15
onClipEvent (load) {
if (this._name == "explosion") {
this._visible = false;
}
}
Instance of Symbol 240 MovieClip "tower_slow" in Frame 15
onClipEvent (load) {
title = "Slow tower";
desc = "Slow tower";
cost = 150;
this.range = 68 * (1 + (0.05 * _global.rangeskill));
this.range2 = 69 * (1 + (0.05 * _global.rangeskill));
this.range3 = 70 * (1 + (0.05 * _global.rangeskill));
this.range4 = 71 * (1 + (0.05 * _global.rangeskill));
this.range5 = 72 * (1 + (0.05 * _global.rangeskill));
damage = 100 * (1 + (0.05 * _global.attackskill));
this.damage2 = 500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2200 * (1 + (0.05 * _global.attackskill));
this.damage4 = 10500 * (1 + (0.05 * _global.attackskill));
this.damage5 = 33000 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 500\rRange: 69\rCooldown: 22\rEffect: Slow", 500, this.damage2, this.range2, 22], ["Damage: 2200\rRange: 70\rCooldown: 21\rEffect: Slow", 1250, this.damage3, this.range3, 21], ["Damage: 10500\rRange: 71\rCooldown: 21\rEffect: Slow", 3150, this.damage4, this.range4, 21], ["Damage: 33000\rRange: 72\rColldown:19\rEffect: Slow", 8000, this.damage5, this.range5, 19]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_slow")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 314 MovieClip in Frame 15
on (press) {
_root.marker.active = 1;
_root.marker.tower = "rust";
_root.marker.cost = 400;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Rust Tower. Shoots shots that rust the enemy, causing them to take more damage. 300 base damage. Ultra Fast. Cost: $400";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 314 MovieClip "tower_rust" in Frame 15
onClipEvent (load) {
title = "Rust Tower";
desc = "Rust Tower";
cost = 400;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range5 = 80 * (1 + (0.05 * _global.rangeskill));
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 930 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 5000 * (1 + (0.05 * _global.attackskill));
this.damage5 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 9;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 930\rRange: 76\rCooldown: 9\rEffect: Rust", 1200, this.damage2, this.range2, 9], ["Damage: 2000\rRange: 77\rCooldown: 8\rEffect: Rust", 3000, this.damage3, this.range3, 8], ["Damage: 5000\rRange: 78\rCooldown: 8\rEffect: Rust", 6000, this.damage4, this.range4, 8], ["Damage: 15000\rRange: 80\rCooldown: 7\rEffect:Rust", 13500, this.damage5, this.range5, 7]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 242 MovieClip "tower_poison" in Frame 15
onClipEvent (load) {
title = "Splash Poison";
desc = "Splash Poison";
cost = 500;
this.range = 70;
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 75 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 12000 * (1 + (0.05 * _global.attackskill));
rate = 23;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 72\rCooldown: 22\rEffect:Poison(600)", 1500, this.damage2, this.range2, 22], ["Damage: 4000\rRange: 75\rCooldown: 21\rEffect:Poison(2700)", 5000, this.damage3, this.range3, 21], ["Damage: 12000\rRange:78\rCooldown: 20\rEffect:Poison(10000)", 11500, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 244 MovieClip "tower_static" in Frame 15
onClipEvent (load) {
title = "Static";
desc = "Static";
cost = 500;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 80 * (1 + (0.05 * _global.rangeskill));
this.range4 = 85 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 25;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 77\rCooldown: 24\rEffect:Static(7)", 1500, this.damage2, this.range2, 24], ["Damage: 4000\rRange: 80\rCooldown: 23\rEffect:Static(10)", 5000, this.damage3, this.range3, 23], ["Damage: 15000\rRange: 85\rCooldown:22\rEffect:Static(12)", 11000, this.damage4, this.range4, 22]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 252 MovieClip "tower_death" in Frame 15
onClipEvent (load) {
title = "Instant Death";
desc = "Instant Death";
cost = 650;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 79 * (1 + (0.05 * _global.rangeskill));
this.range4 = 82 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 650 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 15000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 35000 * (1 + (0.05 * _global.attackskill));
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3000)\rRange: 77\rCooldown: 28\rEffect:Death(12%)", 2000, this.damage2, this.range2, 28], ["Damage: 15000\rRange: 79\rCooldown: 26\rEffect:Death(16%)", 7000, this.damage3, this.range3, 26], ["Damage: 35000\rRange:82\rCooldown: 23 \rEffect:Death(19%)", 13500, this.damage4, this.range4, 23]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 248 MovieClip "tower_stun" in Frame 15
onClipEvent (load) {
title = "Stun Tower";
desc = "Stun Tower";
cost = 700;
rate = 22;
this.range = 73 * (1 + (0.05 * _global.rangeskill));
this.range2 = 74 * (1 + (0.05 * _global.rangeskill));
this.range3 = 76 * (1 + (0.05 * _global.rangeskill));
this.range4 = 79 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 45000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 74\rCooldown: 22\rEffect:Stun(13%)", 2500, this.damage2, this.range2, 22], ["Damage: 17000\rRange: 76\rCooldown: 21\rEffect:Stun(16%)", 9000, this.damage3, this.range3, 21], ["Damage: 45000\rRange: 79\rCooldown: 20\rEffect:Stun(18%)", 18000, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 254 MovieClip "tower_money" in Frame 15
onClipEvent (load) {
title = "Money Tower";
desc = "Money Tower";
cost = 700;
rate = 25;
this.range = 75;
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 78 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 40000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 76\rCooldown: 24\rEffect:Steal Money(8)", 2500, this.damage2, this.range2, 24], ["Damage: 17000\rRange: 78\rCooldown: 23\rEffect:Steal(9)", 9000, this.damage3, this.range3, 23], ["Damage: 40000\rRange: 80\rCooldown:21\rEffect:Steal(11)", 18000, this.damage4, this.range4, 21]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 256 MovieClip "tower_explode" in Frame 15
onClipEvent (load) {
title = "Explosion";
desc = "Explosion";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 80 * (1 + (0.05 * _global.rangeskill));
this.range2 = 82 * (1 + (0.05 * _global.rangeskill));
this.range3 = 84 * (1 + (0.05 * _global.rangeskill));
this.range4 = 86 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 82\rCooldown: 28\rEffect:Slow", 3000, this.damage2, this.range2, 28], ["Damage: 8000\rRange: 84\rCooldown: 27\rEffect:Slow", 10000, this.damage3, this.range3, 27], ["Damage: 25000\rRange: 86\rCooldown:25\rEffect:Slow", 25000, this.damage4, this.range4, 25]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 336 MovieClip "shockshot" in Frame 15
onClipEvent (enterFrame) {
this._rotation = this._rotation + 30;
}
Instance of Symbol 246 MovieClip "tower_shock" in Frame 15
onClipEvent (load) {
title = "Shock";
desc = "Shock";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 75 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 35;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 75\rCooldown: 33\rEffect:Shock", 3000, this.damage2, this.range2, 33], ["Damage: 8000\rRange: 77\rCooldown: 30\rEffect:Shock", 10000, this.damage3, this.range3, 30], ["Damage: 25000\rRange: 80\rCooldown: 27\rEffect:Shock", 25000, this.damage4, this.range4, 27]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 258 MovieClip "tower_ultimate" in Frame 15
onClipEvent (load) {
title = "Ultimate Tower";
desc = "Ultimate Tower";
cost = 20000;
damage = 100000 * (1 + (0.05 * _global.attackskill));
this.damage2 = 200000 * (1 + (0.05 * _global.attackskill));
this.range = 85 * (1 + (0.05 * _global.rangeskill));
this.range2 = 95 * (1 + (0.05 * _global.rangeskill));
rate = 27;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 2;
upgrades = [["Damage: 200000\rRange: 95\rCooldown: 33\rEffect:Splash", 40000, this.damage2, this.range2, 24]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_ultimate")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 353 MovieClip "UpgradeTowerInfo" in Frame 15
onClipEvent (load) {
_visible = false;
swapDepths(100000);
}
Instance of Symbol 378 MovieClip "creep1" in Frame 15
onClipEvent (load) {
this._rotation = this._rotation + 45;
}
Instance of Symbol 380 MovieClip in Frame 15
onClipEvent (enterFrame) {
if (_root.timer > 50) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 381 MovieClip in Frame 15
onClipEvent (load) {
this._visible = false;
this.startDrag(true);
this.count = 0;
}
onClipEvent (enterFrame) {
trace(_root.techlevel);
if (Key.isDown(77) && (_global.sound == 1)) {
_global.sound = 0;
stopAllSounds();
}
if (Key.isDown(78) && (_global.sound == 0)) {
_global.sound = 1;
_root.playsound.start(0, 100000);
}
if (Key.isDown(80) && (_root.pauses == 0)) {
_root.pauses = 1;
}
if (Key.isDown(85) && (_root.pauses == 1)) {
_root.pauses = 0;
}
if (_root.pauses == 0) {
_root.levelnew++;
_root.checkkill();
this.count++;
if ((this.count % 30) == 0) {
_root.timer--;
}
if (_root.timer <= 0) {
if (_root.wave < _global.maxwaves) {
_root.newLevel();
}
_root.timer = 60;
}
if ((_root.lives <= 0) && (_root.gameover == 0)) {
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
if (_root.creepArray.length <= 0) {
_root.gotoAndPlay("lose3");
}
}
if (((((_root.wave >= _global.maxwaves) && (_root.creepArray.length <= 0)) && (_root.gameover == 0)) && (_root.kills >= 20)) && (_root.levelnew > 120)) {
_root.levelwin = 1;
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
_root.gotoAndPlay("win3");
}
}
}
Instance of Symbol 387 MovieClip "tinfo" in Frame 15
onClipEvent (load) {
this.swapDepths(99999);
}
Instance of Symbol 421 MovieClip "quitbox" in Frame 15
onClipEvent (load) {
this._visible = false;
}
Frame 16
stop();
stopAllSounds();
Frame 17
stop();
_root.gameover = 1;
stopAllSounds();
if (_root.levelwin == 0) {
_root.gotoAndPlay("lose3");
}
if (_root.lives == 20) {
_root.skillgained = 3;
} else {
_root.skillgained = 2;
}
storedskills = SharedObject.getLocal("flashskill");
if (storedskills.data.level3gain == undefined) {
_global.xpleft = _global.xpleft + _root.skillgained;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level3gain = _root.skillgained;
} else {
xplast = storedskills.data.level3gain;
skilldifferent = _root.skillgained - xplast;
if (skilldifferent > 0) {
_global.xpleft = _global.xpleft + skilldifferent;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level3gain = storedskills.data.level3gain + skilldifferent;
}
}
if ((storedskills.data.maxlevelbeat < 3) || (storedskills.data.maxlevelbeat == undefined)) {
storedskills.data.maxlevelbeat = 3;
}
if ((storedskills.data.level3score == undefined) || (_root.score > storedskills.data.level3score)) {
storedskills.data.level3score = _root.score;
}
Frame 18
function TowerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
}
function towerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
_root.UpgradeTowerInfo._visible = true;
if (tower.maxtier >= tower.tier) {
_root.UpgradeTowerInfo.UpgradeInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 1][2]) + "\rRange: ") + tower.upgrades[tower.tier - 1][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 1][4]) + "\rEffect: ") + tower.desc;
if (tower.tier == 1) {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.damage) + "\rRange: ") + tower.range) + "\rCoolDown: ") + tower.rate) + "\rEffect: ") + tower.desc;
} else {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 2][2]) + "\rRange: ") + tower.upgrades[tower.tier - 2][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 2][4]) + "\rEffect: ") + tower.desc;
}
_root.UpgradeTowerInfo.UpgradeButton.UpgradeButtonText.text = ("Upgrade [$" + tower.upgrades[tower.tier - 1][1]) + "]";
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
sellprice = Math.floor(tower.cost * 0.85);
_root.UpgradeTowerInfo.sellbutton.UpgradeButtonText.text = ("Sell [$" + sellprice) + "]";
if (tower.maxtier > tower.tier) {
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
} else {
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
}
} else {
_root.UpgradeTowerInfo.f.text = "";
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
_root.UpgradeTowerInfo.h.text = "";
}
}
function newLevel() {
if (_root.wave < 59) {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.02 * _root.gold);
_root.nowspeed = _root.waves[_root.wave - 1][2];
_root.nextspeed = _root.waves[_root.wave][2];
_root.nowhp = _root.waves[_root.wave - 1][1];
_root.nexthp = _root.waves[_root.wave][1];
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = _root.goldworth * 1.7;
_root.goldworth = _root.goldworth * (1 + (0.05 * _global.killbounty));
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", _root.waves[_root.wave - 1][3], _root.wave, "creep1", _root.waves[_root.wave - 1][2], _root.waves[_root.wave - 1][1], _root.goldworth);
_root["spawned" + _root.wave] = _root.waves[_root.wave - 1][0];
} else {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.03 * _root.gold);
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = Math.floor(_root.goldworth);
_root.goldworth = _root.goldworth * 1.2;
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
randspeed = 1.25;
_root.nowspeed = randspeed;
_root.nextspeed = "???";
wavessince = _root.wave - 60;
hpmultiplier = Math.pow(1.2, wavessince);
_root.nowhp = Math.floor(_root.waves[59][1] * hpmultiplier);
_root.nexthp = Math.floor(_root.nowhp * 1.2);
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", 50, _root.wave, "creep1", _root.nowspeed, _root.nowhp, _root.goldworth);
_root["spawned" + _root.wave] = 30;
}
}
function spawn(level, creep, speed, health, gold) {
if (_root["spawned" + level] == 0) {
clearInterval(_root["spawnInterval" + level]);
} else {
_root["spawned" + level]--;
playanim = (level % 5) + 1;
_root.creepcount++;
_root[creep].duplicateMovieClip("c" + _root.creepcount, 20000 + _root.creepcount);
if (_root.creepcount > 10000) {
_root.creepcount = 1;
}
c = _root["c" + _root.creepcount];
c.creep.gotoAndStop(playanim);
c._x = _root.wp1._x;
c._y = _root.wp1._y;
c.health = health;
c.slowcount = 1;
c.isslow = 0;
c.maxhealth = health;
c.speed = speed;
c.maxspeed = c.speed;
c.ispoisoned = 0;
c.poisonedlevel = 0;
c.poisoncount = 0;
c.fullmax = c.maxspeed;
c.targ = 2;
c.rnd = 5;
c.shocked = 0;
c.shockcount = 1;
c.gold = gold;
c.iscorrode = 0;
c.isstunned = 0;
c.stuncount = 1;
c.splashslowed = 0;
c.splashslowedcount = 1;
_root.creepArray[_root.creepArray.length] = c;
c.onEnterFrame = function () {
if (_root.pauses == 0) {
this.health_bar.health._width = 30 * (this.health / this.maxhealth);
this.targX = (_root["wp" + this.targ]._x - 5) + this.rnd;
this.targY = (_root["wp" + this.targ]._y - 5) + this.rnd;
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this.rads = (this.dir * 3.141593) / 180;
if ((this.isstunned != 0) || (this.shocked == 1)) {
this.stuncount++;
if ((this.stuncount % 2) == 1) {
this._x = this._x + 2;
} else {
this._x = this._x - 2;
}
}
if (this.stuncount > 160) {
this.isstunned = 0;
this.stuncount = 1;
}
if (this.isslow != 0) {
this.speed = this.isslow * this.fullmax;
this.slowcount++;
}
if (this.slowcount > 160) {
this.speed = this.fullmax;
this.isslow = 0;
this.slowcount = 1;
}
if (this.splashslowed != 0) {
this.fullmax = this.maxspeed * this.splashslowed;
this.speed = this.fullmax;
if (this.isslow != 0) {
this.speed = this.fullmax * this.isslow;
}
this.splashslowedcount++;
}
if (this.splashslowedcount > 100) {
this.splashslowed = 0;
this.fullmax = this.maxspeed;
this.speed = this.fullmax;
this.splashslowedcount = 1;
}
if (this.iscorrode != 0) {
this.corrodecount++;
}
if (this.corrodecount > 200) {
this.iscorrode = 0;
this.corrdecount = 1;
}
if (this.ispoisoned == 1) {
if ((this.poisoncount % 40) == 0) {
this.health = this.health - this.poisonedlevel;
}
this.poisoncount++;
}
if (this.shocked == 1) {
this.shockcount++;
}
if (this.shockcount >= 80) {
this.shocked = 0;
this.shockcount = 1;
}
if (this.poisoncount > 200) {
this.ispoisoned = 0;
this.poisoncount = 0;
}
if ((this.isstunned == 0) && (this.shocked == 0)) {
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
}
d = Math.pow(this._x - this.targX, 2) + Math.pow(this._y - this.targY, 2);
if (d < 25) {
this.targ++;
if (this.targ > 12) {
_root.leak(this);
this._x = _root.wp1._x;
this._y = _root.wp1._y;
this.targ = 2;
}
}
this.r = this.dir;
if ((this._rotation + 10) < this.r) {
this._rotation = this._rotation + 10;
} else if ((this._rotation - 10) > this.r) {
this._rotation = this._rotation - 10;
} else {
this._rotation = r;
}
}
};
}
}
function fire(from, to, speed, acc, maxpeed, projectile, damage, towerid) {
_root.particlecount++;
_root[projectile].duplicateMovieClip("p" + _root.particlecount, 2000 + _root.particlecount);
r = _root["p" + _root.particlecount];
r._x = from._x;
r._y = from._y;
r.tier = from.tier;
r.type = from.type;
r.targ = to;
r.speed = speed;
r.acc = acc;
r.maxspeed = maxspeed;
r.damage = damage;
r.projectile = projectile;
r.towerid = towerid;
if (_root.particlecount > 300) {
_root.particlecount = 0;
}
r.onEnterFrame = function () {
if (_root.pauses == 0) {
if (("" + this.targ) != "") {
this.targX = this.targ._x;
this.targY = this.targ._y;
} else {
this._rotation = (Math.atan2(this.targ._y - this._y, this.targ._x - this._x) * 180) / 3.141593;
if (_root.creepArray.length <= 0) {
this.removeMovieClip();
} else {
w = 0;
if (w <= _root.creepArray.length) {
this.targ = _root.creepArray[w];
}
}
}
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this._rotation = this.dir + 90;
this.rads = (this.dir * 3.141593) / 180;
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
if (this.speed < this.maxspeed) {
this.speed = this.speed + this.acc;
}
d = ((this._x - this.targX) * (this._x - this.targX)) + ((this._y - this.targY) * (this._y - this.targY));
if (d < 25) {
if (this.towerid == 10) {
randcrit = random(100);
if ((this.tier == 1) && (randcrit < 11)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 2) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 3) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 4) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 5) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
} else if (this.towerid == 4) {
this.targ.corrodecount = 1;
if (this.tier == 1) {
this.targ.iscorrode = 0.06;
} else if (this.tier == 2) {
this.targ.iscorrode = 0.12;
} else if (this.tier == 3) {
this.targ.iscorrode = 0.2;
} else if (this.tier == 4) {
this.targ.iscorrode = 0.32;
} else if (this.tier == 5) {
this.targ.iscorrode = 0.45;
}
}
this.targ.health = this.targ.health - (this.damage * (1 + this.targ.iscorrode));
if (this.towerid == 7) {
randstun = random(100);
if ((this.tier == 1) && (randstun < 10)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 2) && (randstun < 14)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 3) && (randstun < 17)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 4) && (randstun < 20)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
}
} else if (this.towerid == 5) {
this.targ.ispoisoned = 1;
this.targ.poisoncount = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < 4225) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[i].ispoisoned = 1;
_root.creepArray[i].poisoncount = 1;
}
i++;
}
if (this.tier == 1) {
this.targ.poisonedlevel = 150;
} else if (this.tier == 2) {
this.targ.poisonedlevel = 600;
} else if (this.tier == 3) {
this.targ.poisonedlevel = 2700;
} else if (this.tier == 4) {
this.targ.poisonedlevel = 10000;
}
_root.poisonball.duplicateMovieClip("poisonball" + _root.splashct, 6300 + _root.splashct);
_root["poisonball" + _root.splashct]._x = this._x;
_root["poisonball" + _root.splashct]._y = this._y;
_root["poisonball" + _root.splashct]._width = 80;
_root["poisonball" + _root.splashct]._height = 80;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 6) {
if (this.targ.health < (0.35 * this.targ.maxhealth)) {
randdeath = random(100);
if ((this.tier == 1) && (randdeath < 8)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 2) && (randdeath < 12)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 3) && (randdeath < 16)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 4) && (randdeath < 20)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
}
}
} else if (this.towerid == 8) {
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < 10000) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
if (this.tier == 1) {
_root.creepArray[k].splashslowed = 0.6;
} else if (this.tier == 2) {
_root.creepArray[k].splashslowed = 0.55;
} else if (this.tier == 3) {
_root.creepArray[k].splashslowed = 0.5;
} else if (this.tier == 4) {
_root.creepArray[k].splashslowed = 0.4;
}
_root.creepArray[k].splashslowedcount = 0;
}
k++;
}
_root.explodingshot.duplicateMovieClip("explodingshot" + _root.explodecount, 5100 + _root.explodecount);
_root["explodingshot" + _root.explodecount]._x = this._x;
_root["explodingshot" + _root.explodecount]._y = this._y;
_root.explodecount++;
if (_root.explodecount > 20) {
_root.explodecount = 1;
}
} else if (this.towerid == 26) {
if (this.tier == 1) {
shockwidth = 75;
shockchance = 8;
} else if (this.tier == 2) {
shockwidth = 80;
shockchance = 10;
} else if (this.tier == 3) {
shockwidth = 85;
shockchance = 12;
} else if (this.tier == 4) {
shockwidth = 90;
shockchance = 14;
}
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < (shockwidth * shockwidth)) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
shockper = random(100);
if (shockper < shockchance) {
if (_root.creepArray[k].shocked == 0) {
_root.creepArray[k].shocked = 1;
_root.creepArray[k].splashslowedcount = 1;
}
}
}
k++;
}
_root.shockshot.duplicateMovieClip("shockshot" + _root.shockct, 26500 + _root.shockct);
_root["shockshot" + _root.shockct]._x = this._x;
_root["shockshot" + _root.shockct]._y = this._y;
_root["shockshot" + _root.shockct]._width = 2 * shockwidth;
_root["shockshot" + _root.shockct]._height = 2 * shockwidth;
_root.shockct++;
if (_root.shockct > 20) {
_root.shockct = 1;
}
} else if (this.towerid == 22) {
if (this.tier == 1) {
staticval = 5;
} else if (this.tier == 2) {
staticval = 7;
} else if (this.tier == 3) {
staticval = 10;
}
staticchance = random(100);
if (staticchance < staticval) {
damagetaken = this.targ.maxhealth - this.targ.health;
(this.health - this.health) - (0.5 * damagetaken);
_root.lighteffect.duplicateMovieClip("lighteffect" + _root.staticcount, 23000 + _root.staticcount);
_root["lighteffect" + _root.staticcount]._x = this._x;
_root["lighteffect" + _root.staticcount]._y = this._y;
_root.staticcount++;
if (_root.staticcount > 50) {
_root.staticcount = 1;
}
}
} else if (this.towerid == 25) {
stealval = random(100);
if (this.tier == 1) {
this.stealmax = 6;
} else if (this.tier == 2) {
this.stealmax = 9;
} else if (this.tier == 3) {
this.stealmax = 10;
} else if (this.tier == 4) {
this.stealmax = 12;
}
if (stealval < this.stealmax) {
_root.gold = _root.gold + this.targ.gold;
_root.goldeffect.duplicateMovieClip("goldeffect" + _root.goldeffectct, 26000 + _root.goldeffectct);
_root["goldeffect" + _root.goldeffectct]._x = this._x;
_root["goldeffect" + _root.goldeffectct]._y = this._y;
_root.goldeffectct++;
if (_root.goldeffectct > 20) {
_root.goldeffectct = 1;
}
}
} else if (this.towerid == 999) {
if (this.targ.health < (0.65 * this.targ.maxhealth)) {
randteleport = random(100);
if ((this.tier == 1) && (randteleport < 8)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
_root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 2) && (randteleport < 9)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 3) && (randteleport < 10)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 4) && (randteleport < 11)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 5) && (randteleport < 13)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
}
}
} else if (this.towerid == 100) {
if (this.tier == 1) {
spradius = 1225;
spwidth = 35;
} else if (this.tier == 2) {
spradius = 1600;
spwidth = 40;
} else if (this.tier == 3) {
spradius = 2025;
spwidth = 45;
} else if (this.tier == 4) {
spradius = 2500;
spwidth = 50;
} else if (this.tier == 5) {
spradius = 3600;
spwidth = 60;
}
j = 0;
while (j <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[j]._x, 2) + Math.pow(this._y - _root.creepArray[j]._y, 2);
if (d < spradius) {
if ((("" + _root.creepArray[j]) != "") && (_root.creepArray[j] != this.targ)) {
_root.creepArray[j].health = _root.creepArray[j].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[j].splashslowed = 1;
_root.creepArray[j].splashslowedcount = 1;
}
j++;
}
_root.iceball.duplicateMovieClip("iceball" + _root.splashct, 5200 + _root.splashct);
_root["iceball" + _root.splashct]._x = this._x;
_root["iceball" + _root.splashct]._y = this._y;
_root["iceball" + _root.splashct]._width = spwidth;
_root["iceball" + _root.splashct]._height = spwidth;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 3) {
if (this.tier == 1) {
this.targ.isslow = 0.6;
}
if (this.tier == 2) {
this.targ.isslow = 0.5;
}
if (this.tier == 3) {
this.targ.isslow = 0.4;
}
if (this.tier == 4) {
this.targ.isslow = 0.35;
}
if (this.tier == 5) {
this.targ.isslow = 0.3;
}
this.targ.slowcount = 1;
} else if (this.towerid == 2) {
_root.explosion.duplicateMovieClip("explosion" + _root.explosioncount, 5000 + _root.explosioncount);
_root["explosion" + _root.explosioncount]._x = this._x;
_root["explosion" + _root.explosioncount]._y = this._y;
_root["explosion" + _root.explosioncount]._width = 100;
_root["explosion" + _root.explosioncount]._height = 100;
_root.explosioncount++;
if (_root.explosioncount > 40) {
_root.explosioncount = 1;
}
splashrad = 50;
splashrad2 = splashrad * splashrad;
i = 0;
while (i <= _root.creepArray.length) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < splashrad2) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 6000)));
}
}
i++;
}
}
if (this.targ.health <= 0) {
this.targ.isDead = 1;
}
this.removeMovieClip();
}
}
};
}
function checkkill() {
n = 0;
while (n < _root.creepArray.length) {
if ((_root.creepArray[n].health <= 0) || (_root.creepArray[n] == "undefined")) {
_root.kills++;
_root.aftereffect.duplicateMovieClip("aftereffect" + _root.effectcount, 50000 + _root.effectcount);
_root["aftereffect" + _root.effectcount]._x = _root.creepArray[n]._x;
_root["aftereffect" + _root.effectcount]._y = _root.creepArray[n]._y;
_root.effectcount++;
if (_root.effectcount > 50) {
_root.effectcount = 1;
}
if (((_root.creepArray[n].gold != "undefined") && (_root.creepArray[n].gold != "null")) && (_root.creepArray[n].gold > 0)) {
_root.gold = _root.gold + _root.creepArray[n].gold;
_root.score = _root.score + _root.creepArray[n].maxhealth;
}
_root.creepArray[n].removeMovieClip();
_root.creepArray.splice(n, 1);
}
n++;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
function kill(creep) {
_root.kills++;
if (_root.kills >= _root.waves[_root.wave - 1][0]) {
_root.kills = 0;
_root.newLevel();
}
creep.onEnterFrame = function () {
this.removeMovieClip();
};
}
function upgrade() {
a = _root.selectedTower;
b = a.tier - 1;
if (int(a.upgrades[b][1]) <= _root.gold) {
a.damage = int(a.upgrades[b][2]);
a.range = a.upgrades[b][3];
a.rate = a.upgrades[b][4];
a.splash = a.upgrades[b][5];
a.slow = a.upgrades[b][6];
a.cost = a.cost + int(a.upgrades[b][1]);
a.tier++;
_root.towerInfo(a);
_root.gold = _root.gold - int(a.upgrades[b][1]);
updateInfoBar();
}
}
function sell() {
tower = _root.selectedTower;
if (((tower != "undefined") && (tower != "null")) && (tower != "")) {
sellprice = Math.floor(tower.cost * 0.85);
if (sellprice != "undefined") {
_root.gold = _root.gold + sellprice;
}
_root.range._x = 1000;
_root.range._height = 0;
_root.range._width = 0;
if (tower.maxtier == 2) {
_root.gems++;
}
tower.removeMovieClip();
_root.UpgradeTowerInfo._visible = false;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
stop();
_root.skillstats.swapDepths(9090);
_root.skillstats.removeMovieClip();
_root.challengescore._x = 2000;
_root.challengescore._y = 2000;
_root.levelwin = 0;
_root.gold = 100;
_root.gems = _global.gems;
_root.attackskill = _global.attackskill;
_root.rangeskill = _global.rangeskill;
_root.killbounty = _global.killbounty;
_root.techlevel = _global.techlevel;
if (_global.startmoneylevel == 1) {
_root.gold = 150;
} else if (_global.startmoneylevel == 2) {
_root.gold = 200;
} else if (_global.startmoneylevel == 3) {
_root.gold = 250;
} else if (_global.startmoneylevel == 4) {
_root.gold = 400;
} else if (_global.startmoneylevel == 5) {
_root.gold = 600;
}
_root.wave = 0;
_root.levelnew = 1;
_root.effectcount = 1;
_root.staticcount = 1;
_root.shockct = 1;
_root.gameover = 0;
_root.towerCount = 0;
_root.creepcount = 1;
_root.goldeffectct = 1;
_root.kills = 0;
_root.pauses = 0;
_root.creepleaks = 0;
_root.timer = 45;
_root.lives = 20;
_root.goldworth = 0;
_root.creepArray = [];
_global.sound = 1;
_root.particlecount = 1;
_root.splashct = 1;
_root.pwncount = 1;
_root.explodecount = 1;
_root.score = 0;
_root.playsound = new Sound(this);
_root.playsound.attachSound("music");
if (_global.sound == 1) {
_root.playsound.start(0, 100000);
}
_root.playsound1 = new Sound(this);
_root.playsound1.attachSound("sndplasma");
_root.playsound2 = new Sound(this);
_root.playsound2.attachSound("sndrocket");
_root.playsound3 = new Sound(this);
_root.playsound3.attachSound("sndbullet");
_root.playsound4 = new Sound(this);
_root.playsound4.attachSound("sndbullet1");
_root.playsound5 = new Sound(this);
_root.playsound5.attachSound("sndexplode");
_root.playsound6 = new Sound(this);
_root.playsound6.attachSound("sndlaser");
_global.maxwaves = 38;
_root.wavemax = _global.maxwaves;
_root.waves = [[20, 93, 3.75, 667], [20, 109, 4.5, 600], [20, 128, 2.75, 400], [20, 149, 3.75, 667], [20, 176, 4.05, 600], [20, 204, 3.75, 667], [20, 239, 3, 266], [2, 900, 5.25, 600], [20, 328, 3, 667], [20, 384, 3.75, 667], [20, 450, 3, 667], [20, 526, 2.75, 400], [20, 616, 3, 650], [20, 720, 5, 700], [20, 843, 3.25, 550], [2, 4900, 2.75, 150], [20, 1154, 3.75, 600], [20, 1350, 4, 700], [20, 1580, 4.25, 650], [20, 1848, 3.5, 580], [20, 2159, 3.25, 170], [20, 2530, 3.4, 525], [20, 2967, 2.8, 475], [20, 3494, 3, 600], [2, 15600, 3.141592, 620], [20, 4783, 3.5, 650], [20, 5608, 4, 700], [20, 6575, 3.3, 200], [20, 7710, 3.4, 590], [20, 9040, 3.12, 550], [20, 10623, 3.3, 600], [20, 12481, 3.2, 570], [2, 55000, 2.5, 800], [20, 17232, 3, 600], [20, 20249, 3.15, 177], [20, 23792, 3.2, 500], [20, 27957, 3.35, 600], [20, 32849, 3.4, 620], [20, 38597, 3.5, 630], [20, 45352, 3.75, 670], [20, 53516, 3, 700], [20, 63148, 3.2, 650], [20, 74515, 3.3, 660], [20, 87928, 3.4, 675], [20, 103755, 3.5, 690], [20, 122437, 4, 800], [20, 144469, 3, 650], [20, 170473, 3.5, 700], [2, 976000, 4, 1000], [20, 238375, 3.5, 700], [20, 284841, 3.4, 600], [20, 341809, 3.33, 590], [20, 410171, 4.5, 750], [20, 492205, 4, 700], [20, 593155, 3.4, 600], [20, 708776, 3.6, 625], [2, 4300000, 3.7, 700], [20, 1020637, 3.8, 710], [20, 1224766, 4, 650], [20, 1469719, 5, 700]];
_root.nowhp = 0;
_root.nowspeed = 0;
_root.nexthp = _root.waves[0][1];
_root.nextspeed = 2.5;
Instance of Symbol 228 MovieClip "wp11" in Frame 18
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp12" in Frame 18
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp1" in Frame 18
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp2" in Frame 18
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp3" in Frame 18
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp4" in Frame 18
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp5" in Frame 18
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp6" in Frame 18
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp7" in Frame 18
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp8" in Frame 18
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp9" in Frame 18
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp10" in Frame 18
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 236 MovieClip in Frame 18
on (press) {
_root.marker.active = 1;
_root.marker.tower = "basic";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Tower. Shoots bullets at enemies. 80 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 238 MovieClip in Frame 18
on (press) {
_root.marker.active = 1;
_root.marker.tower = "splash";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Splash Tower. Shoots Exploding bullets at enemies. 29 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 240 MovieClip in Frame 18
on (press) {
_root.marker.active = 1;
_root.marker.tower = "slow";
_root.marker.cost = 150;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Slow Tower. Shoots shots that slow the enemy. 100 base damage. Cost: $150";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 242 MovieClip in Frame 18
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "poison";
_root.marker.cost = 500;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Splash Poison Tower. Splashes Poison(150/sec for level 1) to hurt the enemy. 300 base damage. Cost: $500, tech level 1 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 244 MovieClip in Frame 18
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "static";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Static tower. 6% chance to make target take 50% of the damage that is has lost so far. 500 base damage. Cost: $650. Tech level 1.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 246 MovieClip in Frame 18
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "shock";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Shock tower. Has the ability to random stun any enemy within its radius. Enemies cannot be stunned if already under effect of stun. 500 base damage. Cost: $1000. Tech level 4 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 248 MovieClip in Frame 18
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "stun";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Stun Tower. Has a 10% chance of stunning enemies. 500 base damage. Cost: $700. Requires Tech level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 252 MovieClip in Frame 18
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "death";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Instant death tower. 8% chance to instantly kill if target is under 35% HP. 500 base damage. Cost: $650. Tech Level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 254 MovieClip in Frame 18
on (press) {
if (_root.techlevel >= 2) {
_root.marker.active = 1;
_root.marker.tower = "money";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Money Tower. Has a 5% chance of stealing money from creeps it hits at level 1. 500 Damage. Cost: $700. Tech Level 2.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 256 MovieClip in Frame 18
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "explode";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Exploding Tower. Damages and slows all enemies in a radius of itself. 500 base damage. Cost: $1000. Tech Level 4.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 258 MovieClip in Frame 18
on (press) {
if (_root.gems > 0) {
if (_root.techlevel >= 5) {
_root.marker.active = 1;
_root.marker.tower = "ultimate";
_root.marker.cost = 20000;
_root.tinfo._visible = false;
}
}
}
on (rollOver) {
_root.buyinfo = "Ultimate Tower. Extreme Damage and splash. 100000 damage. Cost: $20000 and 1 Gem. Tech level 5 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 236 MovieClip "tower_basic" in Frame 18
onClipEvent (load) {
title = "Basic Damage Tower";
desc = "Basic Damage Tower";
cost = 50;
this.range = 65 * (1 + (0.05 * _global.rangeskill));
this.range2 = 66 * (1 + (0.05 * _global.rangeskill));
this.range3 = 67 * (1 + (0.05 * _global.rangeskill));
this.range4 = 68 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 80;
damage = 80 * (1 + (0.05 * _global.attackskill));
this.damage2 = 240 * (1 + (0.05 * _global.attackskill));
this.damage3 = 720 * (1 + (0.05 * _global.attackskill));
this.damage4 = 2160 * (1 + (0.05 * _global.attackskill));
rate = 19;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 240\rRange: 66\rCooldown: 18\rEffect: None", 120, this.damage2, this.range2, 18], ["Damage: 720\rRange: 67\rCooldown: 17\rEffect: None", 300, this.damage3, this.range3, 17], ["Damage: 2160\rRange: 68\rCooldown: 17\rEffect: None", 880, this.damage4, this.range4, 17]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_basic")) {
if (target == undefined) {
target = 0;
}
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 264 MovieClip "range" in Frame 18
onClipEvent (enterFrame) {
if ((_root.selectedTower == "") && (_root.marker.active == 0)) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 267 MovieClip "marker" in Frame 18
onClipEvent (load) {
active = 0;
inpath = 0;
this.swapDepths(9998);
}
onClipEvent (enterFrame) {
if (active == 1) {
this.startDrag(true);
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((maphit == 1) && (inpath == 0)) {
this.gotoAndStop(1);
_root.range.gotoAndStop(1);
} else {
this.gotoAndStop(2);
_root.range.gotoAndStop(2);
}
_root.range._x = _x;
_root.range._y = _y;
_root.range._width = _root["tower_" + tower].range * 2;
_root.range._height = _root["tower_" + tower].range * 2;
}
if (Key.isDown(32)) {
active = 0;
trace(1);
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
on (press) {
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((((maphit == 1) && (inpath == 0)) && (_root.gold >= this.cost)) && (_root.pauses == 0)) {
if (this.hitTest(_root.nextwave) == false) {
if (_root.marker.tower == "ultimate") {
if (_root.gems > 0) {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gems--;
_root.gold = _root.gold - this.cost;
}
} else {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gold = _root.gold - this.cost;
}
}
}
if (maphit == 0) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
if (this.hitTest(_root.nextwave)) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
Instance of Symbol 238 MovieClip "tower_splash" in Frame 18
onClipEvent (load) {
title = "Splash Tower";
desc = "Splash Tower";
cost = 50;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 73 * (1 + (0.05 * _global.rangeskill));
this.range4 = 75 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 34 * (1 + (0.05 * _global.attackskill));
this.damage2 = 102 * (1 + (0.05 * _global.attackskill));
this.damage3 = 306 * (1 + (0.05 * _global.attackskill));
this.damage4 = 918 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 102\rRange: 72\rCooldown: 21\rEffect: Splash", 120, this.damage2, this.range2, 21], ["Damage: 306\rRange: 73\rCooldown: 21\rEffect: Splash", 300, this.damage3, this.range3, 21], ["Damage: 918\rRange: 75\rCooldown: 20\rEffect: Splash", 880, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_splash")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > ((range * range) + 81)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 289 MovieClip "explosion" in Frame 18
onClipEvent (load) {
if (this._name == "explosion") {
this._visible = false;
}
}
Instance of Symbol 240 MovieClip "tower_slow" in Frame 18
onClipEvent (load) {
title = "Slow tower";
desc = "Slow tower";
cost = 150;
this.range = 68 * (1 + (0.05 * _global.rangeskill));
this.range2 = 69 * (1 + (0.05 * _global.rangeskill));
this.range3 = 70 * (1 + (0.05 * _global.rangeskill));
this.range4 = 71 * (1 + (0.05 * _global.rangeskill));
this.range5 = 72 * (1 + (0.05 * _global.rangeskill));
damage = 100 * (1 + (0.05 * _global.attackskill));
this.damage2 = 500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2200 * (1 + (0.05 * _global.attackskill));
this.damage4 = 10500 * (1 + (0.05 * _global.attackskill));
this.damage5 = 33000 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 500\rRange: 69\rCooldown: 22\rEffect: Slow", 500, this.damage2, this.range2, 22], ["Damage: 2200\rRange: 70\rCooldown: 21\rEffect: Slow", 1250, this.damage3, this.range3, 21], ["Damage: 10500\rRange: 71\rCooldown: 21\rEffect: Slow", 3150, this.damage4, this.range4, 21], ["Damage: 33000\rRange: 72\rColldown:19\rEffect: Slow", 8000, this.damage5, this.range5, 19]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_slow")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 314 MovieClip in Frame 18
on (press) {
_root.marker.active = 1;
_root.marker.tower = "rust";
_root.marker.cost = 400;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Rust Tower. Shoots shots that rust the enemy, causing them to take more damage. 300 base damage. Ultra Fast. Cost: $400";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 314 MovieClip "tower_rust" in Frame 18
onClipEvent (load) {
title = "Rust Tower";
desc = "Rust Tower";
cost = 400;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range5 = 80 * (1 + (0.05 * _global.rangeskill));
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 930 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 5000 * (1 + (0.05 * _global.attackskill));
this.damage5 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 9;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 930\rRange: 76\rCooldown: 9\rEffect: Rust", 1200, this.damage2, this.range2, 9], ["Damage: 2000\rRange: 77\rCooldown: 8\rEffect: Rust", 3000, this.damage3, this.range3, 8], ["Damage: 5000\rRange: 78\rCooldown: 8\rEffect: Rust", 6000, this.damage4, this.range4, 8], ["Damage: 15000\rRange: 80\rCooldown: 7\rEffect:Rust", 13500, this.damage5, this.range5, 7]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 242 MovieClip "tower_poison" in Frame 18
onClipEvent (load) {
title = "Splash Poison";
desc = "Splash Poison";
cost = 500;
this.range = 70;
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 75 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 12000 * (1 + (0.05 * _global.attackskill));
rate = 23;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 72\rCooldown: 22\rEffect:Poison(600)", 1500, this.damage2, this.range2, 22], ["Damage: 4000\rRange: 75\rCooldown: 21\rEffect:Poison(2700)", 5000, this.damage3, this.range3, 21], ["Damage: 12000\rRange:78\rCooldown: 20\rEffect:Poison(10000)", 11500, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 244 MovieClip "tower_static" in Frame 18
onClipEvent (load) {
title = "Static";
desc = "Static";
cost = 500;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 80 * (1 + (0.05 * _global.rangeskill));
this.range4 = 85 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 25;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 77\rCooldown: 24\rEffect:Static(7)", 1500, this.damage2, this.range2, 24], ["Damage: 4000\rRange: 80\rCooldown: 23\rEffect:Static(10)", 5000, this.damage3, this.range3, 23], ["Damage: 15000\rRange: 85\rCooldown:22\rEffect:Static(12)", 11000, this.damage4, this.range4, 22]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 252 MovieClip "tower_death" in Frame 18
onClipEvent (load) {
title = "Instant Death";
desc = "Instant Death";
cost = 650;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 79 * (1 + (0.05 * _global.rangeskill));
this.range4 = 82 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 650 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 15000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 35000 * (1 + (0.05 * _global.attackskill));
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3000)\rRange: 77\rCooldown: 28\rEffect:Death(12%)", 2000, this.damage2, this.range2, 28], ["Damage: 15000\rRange: 79\rCooldown: 26\rEffect:Death(16%)", 7000, this.damage3, this.range3, 26], ["Damage: 35000\rRange:82\rCooldown: 23 \rEffect:Death(19%)", 13500, this.damage4, this.range4, 23]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 248 MovieClip "tower_stun" in Frame 18
onClipEvent (load) {
title = "Stun Tower";
desc = "Stun Tower";
cost = 700;
rate = 22;
this.range = 73 * (1 + (0.05 * _global.rangeskill));
this.range2 = 74 * (1 + (0.05 * _global.rangeskill));
this.range3 = 76 * (1 + (0.05 * _global.rangeskill));
this.range4 = 79 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 45000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 74\rCooldown: 22\rEffect:Stun(13%)", 2500, this.damage2, this.range2, 22], ["Damage: 17000\rRange: 76\rCooldown: 21\rEffect:Stun(16%)", 9000, this.damage3, this.range3, 21], ["Damage: 45000\rRange: 79\rCooldown: 20\rEffect:Stun(18%)", 18000, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 254 MovieClip "tower_money" in Frame 18
onClipEvent (load) {
title = "Money Tower";
desc = "Money Tower";
cost = 700;
rate = 25;
this.range = 75;
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 78 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 40000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 76\rCooldown: 24\rEffect:Steal Money(8)", 2500, this.damage2, this.range2, 24], ["Damage: 17000\rRange: 78\rCooldown: 23\rEffect:Steal(9)", 9000, this.damage3, this.range3, 23], ["Damage: 40000\rRange: 80\rCooldown:21\rEffect:Steal(11)", 18000, this.damage4, this.range4, 21]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 256 MovieClip "tower_explode" in Frame 18
onClipEvent (load) {
title = "Explosion";
desc = "Explosion";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 80 * (1 + (0.05 * _global.rangeskill));
this.range2 = 82 * (1 + (0.05 * _global.rangeskill));
this.range3 = 84 * (1 + (0.05 * _global.rangeskill));
this.range4 = 86 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 82\rCooldown: 28\rEffect:Slow", 3000, this.damage2, this.range2, 28], ["Damage: 8000\rRange: 84\rCooldown: 27\rEffect:Slow", 10000, this.damage3, this.range3, 27], ["Damage: 25000\rRange: 86\rCooldown:25\rEffect:Slow", 25000, this.damage4, this.range4, 25]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 336 MovieClip "shockshot" in Frame 18
onClipEvent (enterFrame) {
this._rotation = this._rotation + 30;
}
Instance of Symbol 246 MovieClip "tower_shock" in Frame 18
onClipEvent (load) {
title = "Shock";
desc = "Shock";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 75 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 35;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 75\rCooldown: 33\rEffect:Shock", 3000, this.damage2, this.range2, 33], ["Damage: 8000\rRange: 77\rCooldown: 30\rEffect:Shock", 10000, this.damage3, this.range3, 30], ["Damage: 25000\rRange: 80\rCooldown: 27\rEffect:Shock", 25000, this.damage4, this.range4, 27]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 258 MovieClip "tower_ultimate" in Frame 18
onClipEvent (load) {
title = "Ultimate Tower";
desc = "Ultimate Tower";
cost = 20000;
damage = 100000 * (1 + (0.05 * _global.attackskill));
this.damage2 = 200000 * (1 + (0.05 * _global.attackskill));
this.range = 85 * (1 + (0.05 * _global.rangeskill));
this.range2 = 95 * (1 + (0.05 * _global.rangeskill));
rate = 27;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 2;
upgrades = [["Damage: 200000\rRange: 95\rCooldown: 33\rEffect:Splash", 40000, this.damage2, this.range2, 24]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_ultimate")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 353 MovieClip "UpgradeTowerInfo" in Frame 18
onClipEvent (load) {
_visible = false;
swapDepths(100000);
}
Instance of Symbol 378 MovieClip "creep1" in Frame 18
onClipEvent (load) {
this._rotation = this._rotation + 45;
}
Instance of Symbol 380 MovieClip in Frame 18
onClipEvent (enterFrame) {
if (_root.timer > 50) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 381 MovieClip in Frame 18
onClipEvent (load) {
this._visible = false;
this.startDrag(true);
this.count = 0;
}
onClipEvent (enterFrame) {
trace(_root.techlevel);
if (Key.isDown(77) && (_global.sound == 1)) {
_global.sound = 0;
stopAllSounds();
}
if (Key.isDown(78) && (_global.sound == 0)) {
_global.sound = 1;
_root.playsound.start(0, 100000);
}
if (Key.isDown(80) && (_root.pauses == 0)) {
_root.pauses = 1;
}
if (Key.isDown(85) && (_root.pauses == 1)) {
_root.pauses = 0;
}
if (_root.pauses == 0) {
_root.levelnew++;
_root.checkkill();
this.count++;
if ((this.count % 30) == 0) {
_root.timer--;
}
if (_root.timer <= 0) {
if (_root.wave < _global.maxwaves) {
_root.newLevel();
}
_root.timer = 60;
}
if ((_root.lives <= 0) && (_root.gameover == 0)) {
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
if (_root.creepArray.length <= 0) {
_root.gotoAndPlay("lose4");
}
}
if (((((_root.wave >= _global.maxwaves) && (_root.creepArray.length <= 0)) && (_root.gameover == 0)) && (_root.kills >= 20)) && (_root.levelnew > 120)) {
_root.levelwin = 1;
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
_root.gotoAndPlay("win4");
}
}
}
Instance of Symbol 387 MovieClip "tinfo" in Frame 18
onClipEvent (load) {
this.swapDepths(99999);
}
Instance of Symbol 421 MovieClip "quitbox" in Frame 18
onClipEvent (load) {
this._visible = false;
}
Frame 19
stop();
stopAllSounds();
Frame 20
stop();
_root.gameover = 1;
stopAllSounds();
if (_root.levelwin == 0) {
_root.gotoAndPlay("lose4");
}
if (_root.lives == 20) {
_root.skillgained = 3;
} else {
_root.skillgained = 2;
}
storedskills = SharedObject.getLocal("flashskill");
if (storedskills.data.level4gain == undefined) {
_global.xpleft = _global.xpleft + _root.skillgained;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level4gain = _root.skillgained;
} else {
xplast = storedskills.data.level4gain;
skilldifferent = _root.skillgained - xplast;
if (skilldifferent > 0) {
_global.xpleft = _global.xpleft + skilldifferent;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level4gain = storedskills.data.level4gain + skilldifferent;
}
}
if ((storedskills.data.maxlevelbeat < 4) || (storedskills.data.maxlevelbeat == undefined)) {
storedskills.data.maxlevelbeat = 4;
}
if ((storedskills.data.level4score == undefined) || (_root.score > storedskills.data.level4score)) {
storedskills.data.level4score = _root.score;
}
Frame 21
function TowerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
}
function towerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
_root.UpgradeTowerInfo._visible = true;
if (tower.maxtier >= tower.tier) {
_root.UpgradeTowerInfo.UpgradeInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 1][2]) + "\rRange: ") + tower.upgrades[tower.tier - 1][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 1][4]) + "\rEffect: ") + tower.desc;
if (tower.tier == 1) {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.damage) + "\rRange: ") + tower.range) + "\rCoolDown: ") + tower.rate) + "\rEffect: ") + tower.desc;
} else {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 2][2]) + "\rRange: ") + tower.upgrades[tower.tier - 2][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 2][4]) + "\rEffect: ") + tower.desc;
}
_root.UpgradeTowerInfo.UpgradeButton.UpgradeButtonText.text = ("Upgrade [$" + tower.upgrades[tower.tier - 1][1]) + "]";
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
sellprice = Math.floor(tower.cost * 0.85);
_root.UpgradeTowerInfo.sellbutton.UpgradeButtonText.text = ("Sell [$" + sellprice) + "]";
if (tower.maxtier > tower.tier) {
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
} else {
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
}
} else {
_root.UpgradeTowerInfo.f.text = "";
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
_root.UpgradeTowerInfo.h.text = "";
}
}
function newLevel() {
if (_root.wave < 59) {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.02 * _root.gold);
_root.nowspeed = _root.waves[_root.wave - 1][2];
_root.nextspeed = _root.waves[_root.wave][2];
_root.nowhp = _root.waves[_root.wave - 1][1];
_root.nexthp = _root.waves[_root.wave][1];
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = _root.goldworth * 1.7;
_root.goldworth = _root.goldworth * (1 + (0.05 * _global.killbounty));
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", _root.waves[_root.wave - 1][3], _root.wave, "creep1", _root.waves[_root.wave - 1][2], _root.waves[_root.wave - 1][1], _root.goldworth);
_root["spawned" + _root.wave] = _root.waves[_root.wave - 1][0];
} else {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.03 * _root.gold);
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = Math.floor(_root.goldworth);
_root.goldworth = _root.goldworth * 1.2;
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
randspeed = 1.25;
_root.nowspeed = randspeed;
_root.nextspeed = "???";
wavessince = _root.wave - 60;
hpmultiplier = Math.pow(1.2, wavessince);
_root.nowhp = Math.floor(_root.waves[59][1] * hpmultiplier);
_root.nexthp = Math.floor(_root.nowhp * 1.2);
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", 50, _root.wave, "creep1", _root.nowspeed, _root.nowhp, _root.goldworth);
_root["spawned" + _root.wave] = 30;
}
}
function spawn(level, creep, speed, health, gold) {
if (_root["spawned" + level] == 0) {
clearInterval(_root["spawnInterval" + level]);
} else {
_root["spawned" + level]--;
playanim = (level % 5) + 1;
_root.creepcount++;
_root[creep].duplicateMovieClip("c" + _root.creepcount, 20000 + _root.creepcount);
if (_root.creepcount > 10000) {
_root.creepcount = 1;
}
c = _root["c" + _root.creepcount];
c.creep.gotoAndStop(playanim);
c._x = _root.wp1._x;
c._y = _root.wp1._y;
c.health = health;
c.slowcount = 1;
c.isslow = 0;
c.maxhealth = health;
c.speed = speed;
c.maxspeed = c.speed;
c.ispoisoned = 0;
c.poisonedlevel = 0;
c.poisoncount = 0;
c.fullmax = c.maxspeed;
c.targ = 2;
c.rnd = 5;
c.shocked = 0;
c.shockcount = 1;
c.gold = gold;
c.iscorrode = 0;
c.isstunned = 0;
c.stuncount = 1;
c.splashslowed = 0;
c.splashslowedcount = 1;
_root.creepArray[_root.creepArray.length] = c;
c.onEnterFrame = function () {
if (_root.pauses == 0) {
this.health_bar.health._width = 30 * (this.health / this.maxhealth);
this.targX = (_root["wp" + this.targ]._x - 5) + this.rnd;
this.targY = (_root["wp" + this.targ]._y - 5) + this.rnd;
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this.rads = (this.dir * 3.141593) / 180;
if ((this.isstunned != 0) || (this.shocked == 1)) {
this.stuncount++;
if ((this.stuncount % 2) == 1) {
this._x = this._x + 2;
} else {
this._x = this._x - 2;
}
}
if (this.stuncount > 160) {
this.isstunned = 0;
this.stuncount = 1;
}
if (this.isslow != 0) {
this.speed = this.isslow * this.fullmax;
this.slowcount++;
}
if (this.slowcount > 160) {
this.speed = this.fullmax;
this.isslow = 0;
this.slowcount = 1;
}
if (this.splashslowed != 0) {
this.fullmax = this.maxspeed * this.splashslowed;
this.speed = this.fullmax;
if (this.isslow != 0) {
this.speed = this.fullmax * this.isslow;
}
this.splashslowedcount++;
}
if (this.splashslowedcount > 100) {
this.splashslowed = 0;
this.fullmax = this.maxspeed;
this.speed = this.fullmax;
this.splashslowedcount = 1;
}
if (this.iscorrode != 0) {
this.corrodecount++;
}
if (this.corrodecount > 200) {
this.iscorrode = 0;
this.corrdecount = 1;
}
if (this.ispoisoned == 1) {
if ((this.poisoncount % 40) == 0) {
this.health = this.health - this.poisonedlevel;
}
this.poisoncount++;
}
if (this.shocked == 1) {
this.shockcount++;
}
if (this.shockcount >= 80) {
this.shocked = 0;
this.shockcount = 1;
}
if (this.poisoncount > 200) {
this.ispoisoned = 0;
this.poisoncount = 0;
}
if ((this.isstunned == 0) && (this.shocked == 0)) {
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
}
d = Math.pow(this._x - this.targX, 2) + Math.pow(this._y - this.targY, 2);
if (d < 25) {
this.targ++;
if (this.targ > 14) {
_root.leak(this);
this._x = _root.wp1._x;
this._y = _root.wp1._y;
this.targ = 2;
}
}
this.r = this.dir;
if ((this._rotation + 10) < this.r) {
this._rotation = this._rotation + 10;
} else if ((this._rotation - 10) > this.r) {
this._rotation = this._rotation - 10;
} else {
this._rotation = r;
}
}
};
}
}
function fire(from, to, speed, acc, maxpeed, projectile, damage, towerid) {
_root.particlecount++;
_root[projectile].duplicateMovieClip("p" + _root.particlecount, 2000 + _root.particlecount);
r = _root["p" + _root.particlecount];
r._x = from._x;
r._y = from._y;
r.tier = from.tier;
r.type = from.type;
r.targ = to;
r.speed = speed;
r.acc = acc;
r.maxspeed = maxspeed;
r.damage = damage;
r.projectile = projectile;
r.towerid = towerid;
if (_root.particlecount > 300) {
_root.particlecount = 0;
}
r.onEnterFrame = function () {
if (_root.pauses == 0) {
if (("" + this.targ) != "") {
this.targX = this.targ._x;
this.targY = this.targ._y;
} else {
this._rotation = (Math.atan2(this.targ._y - this._y, this.targ._x - this._x) * 180) / 3.141593;
if (_root.creepArray.length <= 0) {
this.removeMovieClip();
} else {
w = 0;
if (w <= _root.creepArray.length) {
this.targ = _root.creepArray[w];
}
}
}
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this._rotation = this.dir + 90;
this.rads = (this.dir * 3.141593) / 180;
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
if (this.speed < this.maxspeed) {
this.speed = this.speed + this.acc;
}
d = ((this._x - this.targX) * (this._x - this.targX)) + ((this._y - this.targY) * (this._y - this.targY));
if (d < 25) {
if (this.towerid == 10) {
randcrit = random(100);
if ((this.tier == 1) && (randcrit < 11)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 2) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 3) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 4) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 5) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
} else if (this.towerid == 4) {
this.targ.corrodecount = 1;
if (this.tier == 1) {
this.targ.iscorrode = 0.06;
} else if (this.tier == 2) {
this.targ.iscorrode = 0.12;
} else if (this.tier == 3) {
this.targ.iscorrode = 0.2;
} else if (this.tier == 4) {
this.targ.iscorrode = 0.32;
} else if (this.tier == 5) {
this.targ.iscorrode = 0.45;
}
}
this.targ.health = this.targ.health - (this.damage * (1 + this.targ.iscorrode));
if (this.towerid == 7) {
randstun = random(100);
if ((this.tier == 1) && (randstun < 10)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 2) && (randstun < 14)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 3) && (randstun < 17)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 4) && (randstun < 20)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
}
} else if (this.towerid == 5) {
this.targ.ispoisoned = 1;
this.targ.poisoncount = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < 4225) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[i].ispoisoned = 1;
_root.creepArray[i].poisoncount = 1;
}
i++;
}
if (this.tier == 1) {
this.targ.poisonedlevel = 150;
} else if (this.tier == 2) {
this.targ.poisonedlevel = 600;
} else if (this.tier == 3) {
this.targ.poisonedlevel = 2700;
} else if (this.tier == 4) {
this.targ.poisonedlevel = 10000;
}
_root.poisonball.duplicateMovieClip("poisonball" + _root.splashct, 6300 + _root.splashct);
_root["poisonball" + _root.splashct]._x = this._x;
_root["poisonball" + _root.splashct]._y = this._y;
_root["poisonball" + _root.splashct]._width = 80;
_root["poisonball" + _root.splashct]._height = 80;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 6) {
if (this.targ.health < (0.35 * this.targ.maxhealth)) {
randdeath = random(100);
if ((this.tier == 1) && (randdeath < 8)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 2) && (randdeath < 12)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 3) && (randdeath < 16)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 4) && (randdeath < 20)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
}
}
} else if (this.towerid == 8) {
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < 10000) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
if (this.tier == 1) {
_root.creepArray[k].splashslowed = 0.6;
} else if (this.tier == 2) {
_root.creepArray[k].splashslowed = 0.55;
} else if (this.tier == 3) {
_root.creepArray[k].splashslowed = 0.5;
} else if (this.tier == 4) {
_root.creepArray[k].splashslowed = 0.4;
}
_root.creepArray[k].splashslowedcount = 0;
}
k++;
}
_root.explodingshot.duplicateMovieClip("explodingshot" + _root.explodecount, 5100 + _root.explodecount);
_root["explodingshot" + _root.explodecount]._x = this._x;
_root["explodingshot" + _root.explodecount]._y = this._y;
_root.explodecount++;
if (_root.explodecount > 20) {
_root.explodecount = 1;
}
} else if (this.towerid == 26) {
if (this.tier == 1) {
shockwidth = 75;
shockchance = 8;
} else if (this.tier == 2) {
shockwidth = 80;
shockchance = 10;
} else if (this.tier == 3) {
shockwidth = 85;
shockchance = 12;
} else if (this.tier == 4) {
shockwidth = 90;
shockchance = 14;
}
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < (shockwidth * shockwidth)) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
shockper = random(100);
if (shockper < shockchance) {
if (_root.creepArray[k].shocked == 0) {
_root.creepArray[k].shocked = 1;
_root.creepArray[k].splashslowedcount = 1;
}
}
}
k++;
}
_root.shockshot.duplicateMovieClip("shockshot" + _root.shockct, 26500 + _root.shockct);
_root["shockshot" + _root.shockct]._x = this._x;
_root["shockshot" + _root.shockct]._y = this._y;
_root["shockshot" + _root.shockct]._width = 2 * shockwidth;
_root["shockshot" + _root.shockct]._height = 2 * shockwidth;
_root.shockct++;
if (_root.shockct > 20) {
_root.shockct = 1;
}
} else if (this.towerid == 22) {
if (this.tier == 1) {
staticval = 5;
} else if (this.tier == 2) {
staticval = 7;
} else if (this.tier == 3) {
staticval = 10;
}
staticchance = random(100);
if (staticchance < staticval) {
damagetaken = this.targ.maxhealth - this.targ.health;
(this.health - this.health) - (0.5 * damagetaken);
_root.lighteffect.duplicateMovieClip("lighteffect" + _root.staticcount, 23000 + _root.staticcount);
_root["lighteffect" + _root.staticcount]._x = this._x;
_root["lighteffect" + _root.staticcount]._y = this._y;
_root.staticcount++;
if (_root.staticcount > 50) {
_root.staticcount = 1;
}
}
} else if (this.towerid == 25) {
stealval = random(100);
if (this.tier == 1) {
this.stealmax = 6;
} else if (this.tier == 2) {
this.stealmax = 9;
} else if (this.tier == 3) {
this.stealmax = 10;
} else if (this.tier == 4) {
this.stealmax = 12;
}
if (stealval < this.stealmax) {
_root.gold = _root.gold + this.targ.gold;
_root.goldeffect.duplicateMovieClip("goldeffect" + _root.goldeffectct, 26000 + _root.goldeffectct);
_root["goldeffect" + _root.goldeffectct]._x = this._x;
_root["goldeffect" + _root.goldeffectct]._y = this._y;
_root.goldeffectct++;
if (_root.goldeffectct > 20) {
_root.goldeffectct = 1;
}
}
} else if (this.towerid == 999) {
if (this.targ.health < (0.65 * this.targ.maxhealth)) {
randteleport = random(100);
if ((this.tier == 1) && (randteleport < 8)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
_root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 2) && (randteleport < 9)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 3) && (randteleport < 10)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 4) && (randteleport < 11)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 5) && (randteleport < 13)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
}
}
} else if (this.towerid == 100) {
if (this.tier == 1) {
spradius = 1225;
spwidth = 35;
} else if (this.tier == 2) {
spradius = 1600;
spwidth = 40;
} else if (this.tier == 3) {
spradius = 2025;
spwidth = 45;
} else if (this.tier == 4) {
spradius = 2500;
spwidth = 50;
} else if (this.tier == 5) {
spradius = 3600;
spwidth = 60;
}
j = 0;
while (j <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[j]._x, 2) + Math.pow(this._y - _root.creepArray[j]._y, 2);
if (d < spradius) {
if ((("" + _root.creepArray[j]) != "") && (_root.creepArray[j] != this.targ)) {
_root.creepArray[j].health = _root.creepArray[j].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[j].splashslowed = 1;
_root.creepArray[j].splashslowedcount = 1;
}
j++;
}
_root.iceball.duplicateMovieClip("iceball" + _root.splashct, 5200 + _root.splashct);
_root["iceball" + _root.splashct]._x = this._x;
_root["iceball" + _root.splashct]._y = this._y;
_root["iceball" + _root.splashct]._width = spwidth;
_root["iceball" + _root.splashct]._height = spwidth;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 3) {
if (this.tier == 1) {
this.targ.isslow = 0.6;
}
if (this.tier == 2) {
this.targ.isslow = 0.5;
}
if (this.tier == 3) {
this.targ.isslow = 0.4;
}
if (this.tier == 4) {
this.targ.isslow = 0.35;
}
if (this.tier == 5) {
this.targ.isslow = 0.3;
}
this.targ.slowcount = 1;
} else if (this.towerid == 2) {
_root.explosion.duplicateMovieClip("explosion" + _root.explosioncount, 5000 + _root.explosioncount);
_root["explosion" + _root.explosioncount]._x = this._x;
_root["explosion" + _root.explosioncount]._y = this._y;
_root["explosion" + _root.explosioncount]._width = 100;
_root["explosion" + _root.explosioncount]._height = 100;
_root.explosioncount++;
if (_root.explosioncount > 40) {
_root.explosioncount = 1;
}
splashrad = 50;
splashrad2 = splashrad * splashrad;
i = 0;
while (i <= _root.creepArray.length) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < splashrad2) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 6000)));
}
}
i++;
}
}
if (this.targ.health <= 0) {
this.targ.isDead = 1;
}
this.removeMovieClip();
}
}
};
}
function checkkill() {
n = 0;
while (n < _root.creepArray.length) {
if ((_root.creepArray[n].health <= 0) || (_root.creepArray[n] == "undefined")) {
_root.kills++;
_root.aftereffect.duplicateMovieClip("aftereffect" + _root.effectcount, 50000 + _root.effectcount);
_root["aftereffect" + _root.effectcount]._x = _root.creepArray[n]._x;
_root["aftereffect" + _root.effectcount]._y = _root.creepArray[n]._y;
_root.effectcount++;
if (_root.effectcount > 50) {
_root.effectcount = 1;
}
if (((_root.creepArray[n].gold != "undefined") && (_root.creepArray[n].gold != "null")) && (_root.creepArray[n].gold > 0)) {
_root.gold = _root.gold + _root.creepArray[n].gold;
_root.score = _root.score + _root.creepArray[n].maxhealth;
}
_root.creepArray[n].removeMovieClip();
_root.creepArray.splice(n, 1);
}
n++;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
function kill(creep) {
_root.kills++;
if (_root.kills >= _root.waves[_root.wave - 1][0]) {
_root.kills = 0;
_root.newLevel();
}
creep.onEnterFrame = function () {
this.removeMovieClip();
};
}
function upgrade() {
a = _root.selectedTower;
b = a.tier - 1;
if (int(a.upgrades[b][1]) <= _root.gold) {
a.damage = int(a.upgrades[b][2]);
a.range = a.upgrades[b][3];
a.rate = a.upgrades[b][4];
a.splash = a.upgrades[b][5];
a.slow = a.upgrades[b][6];
a.cost = a.cost + int(a.upgrades[b][1]);
a.tier++;
_root.towerInfo(a);
_root.gold = _root.gold - int(a.upgrades[b][1]);
updateInfoBar();
}
}
function sell() {
tower = _root.selectedTower;
if (((tower != "undefined") && (tower != "null")) && (tower != "")) {
sellprice = Math.floor(tower.cost * 0.85);
if (sellprice != "undefined") {
_root.gold = _root.gold + sellprice;
}
_root.range._x = 1000;
_root.range._height = 0;
_root.range._width = 0;
if (tower.maxtier == 2) {
_root.gems++;
}
tower.removeMovieClip();
_root.UpgradeTowerInfo._visible = false;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
stop();
_root.skillstats.swapDepths(9090);
_root.skillstats.removeMovieClip();
_root.challengescore._x = 2000;
_root.challengescore._y = 2000;
_root.levelwin = 0;
_root.gold = 100;
_root.gems = _global.gems;
_root.attackskill = _global.attackskill;
_root.rangeskill = _global.rangeskill;
_root.killbounty = _global.killbounty;
_root.techlevel = _global.techlevel;
if (_global.startmoneylevel == 1) {
_root.gold = 150;
} else if (_global.startmoneylevel == 2) {
_root.gold = 200;
} else if (_global.startmoneylevel == 3) {
_root.gold = 250;
} else if (_global.startmoneylevel == 4) {
_root.gold = 400;
} else if (_global.startmoneylevel == 5) {
_root.gold = 600;
}
_root.wave = 0;
_root.levelnew = 1;
_root.effectcount = 1;
_root.staticcount = 1;
_root.shockct = 1;
_root.gameover = 0;
_root.towerCount = 0;
_root.creepcount = 1;
_root.goldeffectct = 1;
_root.kills = 0;
_root.pauses = 0;
_root.creepleaks = 0;
_root.timer = 45;
_root.lives = 20;
_root.goldworth = 0;
_root.creepArray = [];
_global.sound = 1;
_root.particlecount = 1;
_root.splashct = 1;
_root.pwncount = 1;
_root.explodecount = 1;
_root.score = 0;
_root.playsound = new Sound(this);
_root.playsound.attachSound("music");
if (_global.sound == 1) {
_root.playsound.start(0, 100000);
}
_root.playsound1 = new Sound(this);
_root.playsound1.attachSound("sndplasma");
_root.playsound2 = new Sound(this);
_root.playsound2.attachSound("sndrocket");
_root.playsound3 = new Sound(this);
_root.playsound3.attachSound("sndbullet");
_root.playsound4 = new Sound(this);
_root.playsound4.attachSound("sndbullet1");
_root.playsound5 = new Sound(this);
_root.playsound5.attachSound("sndexplode");
_root.playsound6 = new Sound(this);
_root.playsound6.attachSound("sndlaser");
_global.maxwaves = 47;
_root.wavemax = _global.maxwaves;
_root.waves = [[20, 93, 3.75, 667], [20, 109, 4.5, 600], [20, 128, 2.75, 400], [20, 149, 3.75, 667], [20, 176, 4.05, 600], [20, 204, 3.75, 667], [20, 239, 3, 266], [2, 900, 5.25, 600], [20, 328, 3, 667], [20, 384, 3.75, 667], [20, 450, 3, 667], [20, 526, 2.75, 400], [20, 616, 3, 250], [20, 720, 5, 700], [20, 843, 3.25, 550], [2, 4900, 2.75, 800], [20, 1154, 3.75, 250], [20, 1350, 4, 700], [20, 1580, 4.25, 650], [20, 1848, 3.5, 580], [20, 2159, 3.25, 150], [20, 2530, 3.4, 525], [20, 2967, 2.8, 475], [20, 3494, 3, 600], [2, 15600, 3.141592, 620], [20, 4783, 3.5, 650], [20, 5608, 4, 700], [20, 6575, 3.3, 600], [20, 7710, 3.4, 190], [20, 9040, 3.12, 550], [20, 10623, 3.3, 600], [20, 12481, 3.2, 570], [2, 55000, 2.5, 800], [20, 17232, 3, 600], [20, 20249, 3.15, 577], [20, 23792, 3.2, 500], [20, 27957, 3.35, 600], [20, 32849, 3.4, 220], [20, 38597, 3.5, 630], [20, 45352, 3.75, 670], [20, 53516, 3, 200], [20, 63148, 3.2, 650], [20, 74515, 3.3, 660], [20, 87928, 3.4, 675], [20, 103755, 3.5, 690], [20, 122437, 4, 800], [20, 144469, 3, 650], [20, 170473, 3.5, 700], [2, 976000, 4, 1000], [20, 238375, 3.5, 170], [20, 284841, 3.4, 600], [20, 341809, 3.33, 590], [20, 410171, 4.5, 750], [20, 492205, 4, 700], [20, 593155, 3.4, 600], [20, 708776, 3.6, 625], [2, 4300000, 3.7, 700], [20, 1020637, 3.8, 710], [20, 1224766, 4, 650], [20, 1469719, 5, 700]];
_root.nowhp = 0;
_root.nowspeed = 0;
_root.nexthp = _root.waves[0][1];
_root.nextspeed = 2.5;
Instance of Symbol 228 MovieClip "wp11" in Frame 21
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp12" in Frame 21
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp13" in Frame 21
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp14" in Frame 21
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp1" in Frame 21
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp2" in Frame 21
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp3" in Frame 21
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp4" in Frame 21
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp5" in Frame 21
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp6" in Frame 21
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp7" in Frame 21
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp8" in Frame 21
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp9" in Frame 21
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp10" in Frame 21
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 236 MovieClip in Frame 21
on (press) {
_root.marker.active = 1;
_root.marker.tower = "basic";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Tower. Shoots bullets at enemies. 80 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 238 MovieClip in Frame 21
on (press) {
_root.marker.active = 1;
_root.marker.tower = "splash";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Splash Tower. Shoots Exploding bullets at enemies. 29 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 240 MovieClip in Frame 21
on (press) {
_root.marker.active = 1;
_root.marker.tower = "slow";
_root.marker.cost = 150;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Slow Tower. Shoots shots that slow the enemy. 100 base damage. Cost: $150";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 242 MovieClip in Frame 21
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "poison";
_root.marker.cost = 500;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Splash Poison Tower. Splashes Poison(150/sec for level 1) to hurt the enemy. 300 base damage. Cost: $500, tech level 1 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 244 MovieClip in Frame 21
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "static";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Static tower. 6% chance to make target take 50% of the damage that is has lost so far. 500 base damage. Cost: $650. Tech level 1.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 246 MovieClip in Frame 21
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "shock";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Shock tower. Has the ability to random stun any enemy within its radius. Enemies cannot be stunned if already under effect of stun. 500 base damage. Cost: $1000. Tech level 4 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 248 MovieClip in Frame 21
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "stun";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Stun Tower. Has a 10% chance of stunning enemies. 500 base damage. Cost: $700. Requires Tech level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 252 MovieClip in Frame 21
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "death";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Instant death tower. 8% chance to instantly kill if target is under 35% HP. 500 base damage. Cost: $650. Tech Level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 254 MovieClip in Frame 21
on (press) {
if (_root.techlevel >= 2) {
_root.marker.active = 1;
_root.marker.tower = "money";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Money Tower. Has a 5% chance of stealing money from creeps it hits at level 1. 500 Damage. Cost: $700. Tech Level 2.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 256 MovieClip in Frame 21
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "explode";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Exploding Tower. Damages and slows all enemies in a radius of itself. 500 base damage. Cost: $1000. Tech Level 4.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 258 MovieClip in Frame 21
on (press) {
if (_root.gems > 0) {
if (_root.techlevel >= 5) {
_root.marker.active = 1;
_root.marker.tower = "ultimate";
_root.marker.cost = 20000;
_root.tinfo._visible = false;
}
}
}
on (rollOver) {
_root.buyinfo = "Ultimate Tower. Extreme Damage and splash. 100000 damage. Cost: $20000 and 1 Gem. Tech level 5 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 236 MovieClip "tower_basic" in Frame 21
onClipEvent (load) {
title = "Basic Damage Tower";
desc = "Basic Damage Tower";
cost = 50;
this.range = 65 * (1 + (0.05 * _global.rangeskill));
this.range2 = 66 * (1 + (0.05 * _global.rangeskill));
this.range3 = 67 * (1 + (0.05 * _global.rangeskill));
this.range4 = 68 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 80;
damage = 80 * (1 + (0.05 * _global.attackskill));
this.damage2 = 240 * (1 + (0.05 * _global.attackskill));
this.damage3 = 720 * (1 + (0.05 * _global.attackskill));
this.damage4 = 2160 * (1 + (0.05 * _global.attackskill));
rate = 19;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 240\rRange: 66\rCooldown: 18\rEffect: None", 120, this.damage2, this.range2, 18], ["Damage: 720\rRange: 67\rCooldown: 17\rEffect: None", 300, this.damage3, this.range3, 17], ["Damage: 2160\rRange: 68\rCooldown: 17\rEffect: None", 880, this.damage4, this.range4, 17]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_basic")) {
if (target == undefined) {
target = 0;
}
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 264 MovieClip "range" in Frame 21
onClipEvent (enterFrame) {
if ((_root.selectedTower == "") && (_root.marker.active == 0)) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 267 MovieClip "marker" in Frame 21
onClipEvent (load) {
active = 0;
inpath = 0;
this.swapDepths(9998);
}
onClipEvent (enterFrame) {
if (active == 1) {
this.startDrag(true);
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((maphit == 1) && (inpath == 0)) {
this.gotoAndStop(1);
_root.range.gotoAndStop(1);
} else {
this.gotoAndStop(2);
_root.range.gotoAndStop(2);
}
_root.range._x = _x;
_root.range._y = _y;
_root.range._width = _root["tower_" + tower].range * 2;
_root.range._height = _root["tower_" + tower].range * 2;
}
if (Key.isDown(32)) {
active = 0;
trace(1);
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
on (press) {
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((((maphit == 1) && (inpath == 0)) && (_root.gold >= this.cost)) && (_root.pauses == 0)) {
if (this.hitTest(_root.nextwave) == false) {
if (_root.marker.tower == "ultimate") {
if (_root.gems > 0) {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gems--;
_root.gold = _root.gold - this.cost;
}
} else {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gold = _root.gold - this.cost;
}
}
}
if (maphit == 0) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
if (this.hitTest(_root.nextwave)) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
Instance of Symbol 238 MovieClip "tower_splash" in Frame 21
onClipEvent (load) {
title = "Splash Tower";
desc = "Splash Tower";
cost = 50;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 73 * (1 + (0.05 * _global.rangeskill));
this.range4 = 75 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 34 * (1 + (0.05 * _global.attackskill));
this.damage2 = 102 * (1 + (0.05 * _global.attackskill));
this.damage3 = 306 * (1 + (0.05 * _global.attackskill));
this.damage4 = 918 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 102\rRange: 72\rCooldown: 21\rEffect: Splash", 120, this.damage2, this.range2, 21], ["Damage: 306\rRange: 73\rCooldown: 21\rEffect: Splash", 300, this.damage3, this.range3, 21], ["Damage: 918\rRange: 75\rCooldown: 20\rEffect: Splash", 880, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_splash")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > ((range * range) + 81)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 289 MovieClip "explosion" in Frame 21
onClipEvent (load) {
if (this._name == "explosion") {
this._visible = false;
}
}
Instance of Symbol 240 MovieClip "tower_slow" in Frame 21
onClipEvent (load) {
title = "Slow tower";
desc = "Slow tower";
cost = 150;
this.range = 68 * (1 + (0.05 * _global.rangeskill));
this.range2 = 69 * (1 + (0.05 * _global.rangeskill));
this.range3 = 70 * (1 + (0.05 * _global.rangeskill));
this.range4 = 71 * (1 + (0.05 * _global.rangeskill));
this.range5 = 72 * (1 + (0.05 * _global.rangeskill));
damage = 100 * (1 + (0.05 * _global.attackskill));
this.damage2 = 500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2200 * (1 + (0.05 * _global.attackskill));
this.damage4 = 10500 * (1 + (0.05 * _global.attackskill));
this.damage5 = 33000 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 500\rRange: 69\rCooldown: 22\rEffect: Slow", 500, this.damage2, this.range2, 22], ["Damage: 2200\rRange: 70\rCooldown: 21\rEffect: Slow", 1250, this.damage3, this.range3, 21], ["Damage: 10500\rRange: 71\rCooldown: 21\rEffect: Slow", 3150, this.damage4, this.range4, 21], ["Damage: 33000\rRange: 72\rColldown:19\rEffect: Slow", 8000, this.damage5, this.range5, 19]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_slow")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 314 MovieClip in Frame 21
on (press) {
_root.marker.active = 1;
_root.marker.tower = "rust";
_root.marker.cost = 400;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Rust Tower. Shoots shots that rust the enemy, causing them to take more damage. 300 base damage. Ultra Fast. Cost: $400";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 314 MovieClip "tower_rust" in Frame 21
onClipEvent (load) {
title = "Rust Tower";
desc = "Rust Tower";
cost = 400;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range5 = 80 * (1 + (0.05 * _global.rangeskill));
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 930 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 5000 * (1 + (0.05 * _global.attackskill));
this.damage5 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 9;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 930\rRange: 76\rCooldown: 9\rEffect: Rust", 1200, this.damage2, this.range2, 9], ["Damage: 2000\rRange: 77\rCooldown: 8\rEffect: Rust", 3000, this.damage3, this.range3, 8], ["Damage: 5000\rRange: 78\rCooldown: 8\rEffect: Rust", 6000, this.damage4, this.range4, 8], ["Damage: 15000\rRange: 80\rCooldown: 7\rEffect:Rust", 13500, this.damage5, this.range5, 7]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 242 MovieClip "tower_poison" in Frame 21
onClipEvent (load) {
title = "Splash Poison";
desc = "Splash Poison";
cost = 500;
this.range = 70;
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 75 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 12000 * (1 + (0.05 * _global.attackskill));
rate = 23;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 72\rCooldown: 22\rEffect:Poison(600)", 1500, this.damage2, this.range2, 22], ["Damage: 4000\rRange: 75\rCooldown: 21\rEffect:Poison(2700)", 5000, this.damage3, this.range3, 21], ["Damage: 12000\rRange:78\rCooldown: 20\rEffect:Poison(10000)", 11500, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 244 MovieClip "tower_static" in Frame 21
onClipEvent (load) {
title = "Static";
desc = "Static";
cost = 500;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 80 * (1 + (0.05 * _global.rangeskill));
this.range4 = 85 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 25;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 77\rCooldown: 24\rEffect:Static(7)", 1500, this.damage2, this.range2, 24], ["Damage: 4000\rRange: 80\rCooldown: 23\rEffect:Static(10)", 5000, this.damage3, this.range3, 23], ["Damage: 15000\rRange: 85\rCooldown:22\rEffect:Static(12)", 11000, this.damage4, this.range4, 22]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 252 MovieClip "tower_death" in Frame 21
onClipEvent (load) {
title = "Instant Death";
desc = "Instant Death";
cost = 650;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 79 * (1 + (0.05 * _global.rangeskill));
this.range4 = 82 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 650 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 15000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 35000 * (1 + (0.05 * _global.attackskill));
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3000)\rRange: 77\rCooldown: 28\rEffect:Death(12%)", 2000, this.damage2, this.range2, 28], ["Damage: 15000\rRange: 79\rCooldown: 26\rEffect:Death(16%)", 7000, this.damage3, this.range3, 26], ["Damage: 35000\rRange:82\rCooldown: 23 \rEffect:Death(19%)", 13500, this.damage4, this.range4, 23]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 248 MovieClip "tower_stun" in Frame 21
onClipEvent (load) {
title = "Stun Tower";
desc = "Stun Tower";
cost = 700;
rate = 22;
this.range = 73 * (1 + (0.05 * _global.rangeskill));
this.range2 = 74 * (1 + (0.05 * _global.rangeskill));
this.range3 = 76 * (1 + (0.05 * _global.rangeskill));
this.range4 = 79 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 45000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 74\rCooldown: 22\rEffect:Stun(13%)", 2500, this.damage2, this.range2, 22], ["Damage: 17000\rRange: 76\rCooldown: 21\rEffect:Stun(16%)", 9000, this.damage3, this.range3, 21], ["Damage: 45000\rRange: 79\rCooldown: 20\rEffect:Stun(18%)", 18000, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 254 MovieClip "tower_money" in Frame 21
onClipEvent (load) {
title = "Money Tower";
desc = "Money Tower";
cost = 700;
rate = 25;
this.range = 75;
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 78 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 40000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 76\rCooldown: 24\rEffect:Steal Money(8)", 2500, this.damage2, this.range2, 24], ["Damage: 17000\rRange: 78\rCooldown: 23\rEffect:Steal(9)", 9000, this.damage3, this.range3, 23], ["Damage: 40000\rRange: 80\rCooldown:21\rEffect:Steal(11)", 18000, this.damage4, this.range4, 21]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 256 MovieClip "tower_explode" in Frame 21
onClipEvent (load) {
title = "Explosion";
desc = "Explosion";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 80 * (1 + (0.05 * _global.rangeskill));
this.range2 = 82 * (1 + (0.05 * _global.rangeskill));
this.range3 = 84 * (1 + (0.05 * _global.rangeskill));
this.range4 = 86 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 82\rCooldown: 28\rEffect:Slow", 3000, this.damage2, this.range2, 28], ["Damage: 8000\rRange: 84\rCooldown: 27\rEffect:Slow", 10000, this.damage3, this.range3, 27], ["Damage: 25000\rRange: 86\rCooldown:25\rEffect:Slow", 25000, this.damage4, this.range4, 25]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 336 MovieClip "shockshot" in Frame 21
onClipEvent (enterFrame) {
this._rotation = this._rotation + 30;
}
Instance of Symbol 246 MovieClip "tower_shock" in Frame 21
onClipEvent (load) {
title = "Shock";
desc = "Shock";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 75 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 35;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 75\rCooldown: 33\rEffect:Shock", 3000, this.damage2, this.range2, 33], ["Damage: 8000\rRange: 77\rCooldown: 30\rEffect:Shock", 10000, this.damage3, this.range3, 30], ["Damage: 25000\rRange: 80\rCooldown: 27\rEffect:Shock", 25000, this.damage4, this.range4, 27]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 258 MovieClip "tower_ultimate" in Frame 21
onClipEvent (load) {
title = "Ultimate Tower";
desc = "Ultimate Tower";
cost = 20000;
damage = 100000 * (1 + (0.05 * _global.attackskill));
this.damage2 = 200000 * (1 + (0.05 * _global.attackskill));
this.range = 85 * (1 + (0.05 * _global.rangeskill));
this.range2 = 95 * (1 + (0.05 * _global.rangeskill));
rate = 27;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 2;
upgrades = [["Damage: 200000\rRange: 95\rCooldown: 33\rEffect:Splash", 40000, this.damage2, this.range2, 24]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_ultimate")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 353 MovieClip "UpgradeTowerInfo" in Frame 21
onClipEvent (load) {
_visible = false;
swapDepths(100000);
}
Instance of Symbol 378 MovieClip "creep1" in Frame 21
onClipEvent (load) {
this._rotation = this._rotation + 45;
}
Instance of Symbol 380 MovieClip in Frame 21
onClipEvent (enterFrame) {
if (_root.timer > 50) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 381 MovieClip in Frame 21
onClipEvent (load) {
this._visible = false;
this.startDrag(true);
this.count = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(77) && (_global.sound == 1)) {
_global.sound = 0;
stopAllSounds();
}
if (Key.isDown(78) && (_global.sound == 0)) {
_global.sound = 1;
_root.playsound.start(0, 100000);
}
if (Key.isDown(80) && (_root.pauses == 0)) {
_root.pauses = 1;
}
if (Key.isDown(85) && (_root.pauses == 1)) {
_root.pauses = 0;
}
if (_root.pauses == 0) {
_root.levelnew++;
_root.checkkill();
this.count++;
if ((this.count % 30) == 0) {
_root.timer--;
}
if (_root.timer <= 0) {
if (_root.wave < _global.maxwaves) {
_root.newLevel();
}
_root.timer = 60;
}
if ((_root.lives <= 0) && (_root.gameover == 0)) {
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
if (_root.creepArray.length <= 0) {
_root.gotoAndPlay("lose5");
}
}
if (((((_root.wave >= _global.maxwaves) && (_root.creepArray.length <= 0)) && (_root.gameover == 0)) && (_root.kills >= 20)) && (_root.levelnew > 120)) {
_root.levelwin = 1;
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
_root.gotoAndPlay("win5");
}
}
}
Instance of Symbol 387 MovieClip "tinfo" in Frame 21
onClipEvent (load) {
this.swapDepths(99999);
}
Instance of Symbol 421 MovieClip "quitbox" in Frame 21
onClipEvent (load) {
this._visible = false;
}
Frame 22
stop();
stopAllSounds();
Frame 23
stop();
_root.gameover = 1;
stopAllSounds();
if (_root.levelwin == 0) {
_root.gotoAndPlay("lose5");
}
if (_root.lives == 20) {
_root.skillgained = 3;
} else {
_root.skillgained = 2;
}
storedskills = SharedObject.getLocal("flashskill");
if (storedskills.data.level5gain == undefined) {
_global.xpleft = _global.xpleft + _root.skillgained;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level5gain = _root.skillgained;
} else {
xplast = storedskills.data.level5gain;
skilldifferent = _root.skillgained - xplast;
if (skilldifferent > 0) {
_global.xpleft = _global.xpleft + skilldifferent;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level5gain = storedskills.data.level5gain + skilldifferent;
}
}
if ((storedskills.data.maxlevelbeat < 5) || (storedskills.data.maxlevelbeat == undefined)) {
storedskills.data.maxlevelbeat = 5;
}
if ((storedskills.data.level5score == undefined) || (_root.score > storedskills.data.level5score)) {
storedskills.data.level5score = _root.score;
}
Frame 24
function TowerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
}
function towerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
_root.UpgradeTowerInfo._visible = true;
if (tower.maxtier >= tower.tier) {
_root.UpgradeTowerInfo.UpgradeInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 1][2]) + "\rRange: ") + tower.upgrades[tower.tier - 1][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 1][4]) + "\rEffect: ") + tower.desc;
if (tower.tier == 1) {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.damage) + "\rRange: ") + tower.range) + "\rCoolDown: ") + tower.rate) + "\rEffect: ") + tower.desc;
} else {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 2][2]) + "\rRange: ") + tower.upgrades[tower.tier - 2][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 2][4]) + "\rEffect: ") + tower.desc;
}
_root.UpgradeTowerInfo.UpgradeButton.UpgradeButtonText.text = ("Upgrade [$" + tower.upgrades[tower.tier - 1][1]) + "]";
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
sellprice = Math.floor(tower.cost * 0.85);
_root.UpgradeTowerInfo.sellbutton.UpgradeButtonText.text = ("Sell [$" + sellprice) + "]";
if (tower.maxtier > tower.tier) {
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
} else {
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
}
} else {
_root.UpgradeTowerInfo.f.text = "";
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
_root.UpgradeTowerInfo.h.text = "";
}
}
function newLevel() {
if (_root.wave < 59) {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.02 * _root.gold);
_root.nowspeed = _root.waves[_root.wave - 1][2];
_root.nextspeed = _root.waves[_root.wave][2];
_root.nowhp = _root.waves[_root.wave - 1][1];
_root.nexthp = _root.waves[_root.wave][1];
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = _root.goldworth * 1.7;
_root.goldworth = _root.goldworth * (1 + (0.05 * _global.killbounty));
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", _root.waves[_root.wave - 1][3], _root.wave, "creep1", _root.waves[_root.wave - 1][2], _root.waves[_root.wave - 1][1], _root.goldworth);
_root["spawned" + _root.wave] = _root.waves[_root.wave - 1][0];
} else {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.03 * _root.gold);
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = Math.floor(_root.goldworth);
_root.goldworth = _root.goldworth * 1.2;
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
randspeed = 1.25;
_root.nowspeed = randspeed;
_root.nextspeed = "???";
wavessince = _root.wave - 60;
hpmultiplier = Math.pow(1.2, wavessince);
_root.nowhp = Math.floor(_root.waves[59][1] * hpmultiplier);
_root.nexthp = Math.floor(_root.nowhp * 1.2);
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", 50, _root.wave, "creep1", _root.nowspeed, _root.nowhp, _root.goldworth);
_root["spawned" + _root.wave] = 30;
}
}
function spawn(level, creep, speed, health, gold) {
if (_root["spawned" + level] == 0) {
clearInterval(_root["spawnInterval" + level]);
} else {
_root["spawned" + level]--;
playanim = (level % 5) + 1;
_root.creepcount++;
_root[creep].duplicateMovieClip("c" + _root.creepcount, 20000 + _root.creepcount);
if (_root.creepcount > 10000) {
_root.creepcount = 1;
}
c = _root["c" + _root.creepcount];
c.creep.gotoAndStop(playanim);
c._x = _root.wp1._x;
c._y = _root.wp1._y;
c.health = health;
c.slowcount = 1;
c.isslow = 0;
c.maxhealth = health;
c.speed = speed;
c.maxspeed = c.speed;
c.ispoisoned = 0;
c.poisonedlevel = 0;
c.poisoncount = 0;
c.fullmax = c.maxspeed;
c.targ = 2;
c.rnd = 5;
c.shocked = 0;
c.shockcount = 1;
c.gold = gold;
c.iscorrode = 0;
c.isstunned = 0;
c.stuncount = 1;
c.splashslowed = 0;
c.splashslowedcount = 1;
_root.creepArray[_root.creepArray.length] = c;
c.onEnterFrame = function () {
if (_root.pauses == 0) {
this.health_bar.health._width = 30 * (this.health / this.maxhealth);
this.targX = (_root["wp" + this.targ]._x - 5) + this.rnd;
this.targY = (_root["wp" + this.targ]._y - 5) + this.rnd;
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this.rads = (this.dir * 3.141593) / 180;
if ((this.isstunned != 0) || (this.shocked == 1)) {
this.stuncount++;
if ((this.stuncount % 2) == 1) {
this._x = this._x + 2;
} else {
this._x = this._x - 2;
}
}
if (this.stuncount > 160) {
this.isstunned = 0;
this.stuncount = 1;
}
if (this.isslow != 0) {
this.speed = this.isslow * this.fullmax;
this.slowcount++;
}
if (this.slowcount > 160) {
this.speed = this.fullmax;
this.isslow = 0;
this.slowcount = 1;
}
if (this.splashslowed != 0) {
this.fullmax = this.maxspeed * this.splashslowed;
this.speed = this.fullmax;
if (this.isslow != 0) {
this.speed = this.fullmax * this.isslow;
}
this.splashslowedcount++;
}
if (this.splashslowedcount > 100) {
this.splashslowed = 0;
this.fullmax = this.maxspeed;
this.speed = this.fullmax;
this.splashslowedcount = 1;
}
if (this.iscorrode != 0) {
this.corrodecount++;
}
if (this.corrodecount > 200) {
this.iscorrode = 0;
this.corrdecount = 1;
}
if (this.ispoisoned == 1) {
if ((this.poisoncount % 40) == 0) {
this.health = this.health - this.poisonedlevel;
}
this.poisoncount++;
}
if (this.shocked == 1) {
this.shockcount++;
}
if (this.shockcount >= 80) {
this.shocked = 0;
this.shockcount = 1;
}
if (this.poisoncount > 200) {
this.ispoisoned = 0;
this.poisoncount = 0;
}
if ((this.isstunned == 0) && (this.shocked == 0)) {
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
}
d = Math.pow(this._x - this.targX, 2) + Math.pow(this._y - this.targY, 2);
if (d < 25) {
this.targ++;
if (this.targ > 10) {
_root.leak(this);
this._x = _root.wp1._x;
this._y = _root.wp1._y;
this.targ = 2;
}
}
this.r = this.dir;
if ((this._rotation + 10) < this.r) {
this._rotation = this._rotation + 10;
} else if ((this._rotation - 10) > this.r) {
this._rotation = this._rotation - 10;
} else {
this._rotation = r;
}
}
};
}
}
function fire(from, to, speed, acc, maxpeed, projectile, damage, towerid) {
_root.particlecount++;
_root[projectile].duplicateMovieClip("p" + _root.particlecount, 2000 + _root.particlecount);
r = _root["p" + _root.particlecount];
r._x = from._x;
r._y = from._y;
r.tier = from.tier;
r.type = from.type;
r.targ = to;
r.speed = speed;
r.acc = acc;
r.maxspeed = maxspeed;
r.damage = damage;
r.projectile = projectile;
r.towerid = towerid;
if (_root.particlecount > 300) {
_root.particlecount = 0;
}
r.onEnterFrame = function () {
if (_root.pauses == 0) {
if (("" + this.targ) != "") {
this.targX = this.targ._x;
this.targY = this.targ._y;
} else {
this._rotation = (Math.atan2(this.targ._y - this._y, this.targ._x - this._x) * 180) / 3.141593;
if (_root.creepArray.length <= 0) {
this.removeMovieClip();
} else {
w = 0;
if (w <= _root.creepArray.length) {
this.targ = _root.creepArray[w];
}
}
}
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this._rotation = this.dir + 90;
this.rads = (this.dir * 3.141593) / 180;
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
if (this.speed < this.maxspeed) {
this.speed = this.speed + this.acc;
}
d = ((this._x - this.targX) * (this._x - this.targX)) + ((this._y - this.targY) * (this._y - this.targY));
if (d < 25) {
if (this.towerid == 10) {
randcrit = random(100);
if ((this.tier == 1) && (randcrit < 11)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 2) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 3) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 4) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 5) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
} else if (this.towerid == 4) {
this.targ.corrodecount = 1;
if (this.tier == 1) {
this.targ.iscorrode = 0.06;
} else if (this.tier == 2) {
this.targ.iscorrode = 0.12;
} else if (this.tier == 3) {
this.targ.iscorrode = 0.2;
} else if (this.tier == 4) {
this.targ.iscorrode = 0.32;
} else if (this.tier == 5) {
this.targ.iscorrode = 0.45;
}
}
this.targ.health = this.targ.health - (this.damage * (1 + this.targ.iscorrode));
if (this.towerid == 7) {
randstun = random(100);
if ((this.tier == 1) && (randstun < 10)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 2) && (randstun < 14)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 3) && (randstun < 17)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 4) && (randstun < 20)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
}
} else if (this.towerid == 5) {
this.targ.ispoisoned = 1;
this.targ.poisoncount = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < 4225) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[i].ispoisoned = 1;
_root.creepArray[i].poisoncount = 1;
}
i++;
}
if (this.tier == 1) {
this.targ.poisonedlevel = 150;
} else if (this.tier == 2) {
this.targ.poisonedlevel = 600;
} else if (this.tier == 3) {
this.targ.poisonedlevel = 2700;
} else if (this.tier == 4) {
this.targ.poisonedlevel = 10000;
}
_root.poisonball.duplicateMovieClip("poisonball" + _root.splashct, 6300 + _root.splashct);
_root["poisonball" + _root.splashct]._x = this._x;
_root["poisonball" + _root.splashct]._y = this._y;
_root["poisonball" + _root.splashct]._width = 80;
_root["poisonball" + _root.splashct]._height = 80;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 6) {
if (this.targ.health < (0.35 * this.targ.maxhealth)) {
randdeath = random(100);
if ((this.tier == 1) && (randdeath < 8)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 2) && (randdeath < 12)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 3) && (randdeath < 16)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 4) && (randdeath < 20)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
}
}
} else if (this.towerid == 8) {
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < 10000) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
if (this.tier == 1) {
_root.creepArray[k].splashslowed = 0.6;
} else if (this.tier == 2) {
_root.creepArray[k].splashslowed = 0.55;
} else if (this.tier == 3) {
_root.creepArray[k].splashslowed = 0.5;
} else if (this.tier == 4) {
_root.creepArray[k].splashslowed = 0.4;
}
_root.creepArray[k].splashslowedcount = 0;
}
k++;
}
_root.explodingshot.duplicateMovieClip("explodingshot" + _root.explodecount, 5100 + _root.explodecount);
_root["explodingshot" + _root.explodecount]._x = this._x;
_root["explodingshot" + _root.explodecount]._y = this._y;
_root.explodecount++;
if (_root.explodecount > 20) {
_root.explodecount = 1;
}
} else if (this.towerid == 26) {
if (this.tier == 1) {
shockwidth = 75;
shockchance = 8;
} else if (this.tier == 2) {
shockwidth = 80;
shockchance = 10;
} else if (this.tier == 3) {
shockwidth = 85;
shockchance = 12;
} else if (this.tier == 4) {
shockwidth = 90;
shockchance = 14;
}
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < (shockwidth * shockwidth)) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
shockper = random(100);
if (shockper < shockchance) {
if (_root.creepArray[k].shocked == 0) {
_root.creepArray[k].shocked = 1;
_root.creepArray[k].splashslowedcount = 1;
}
}
}
k++;
}
_root.shockshot.duplicateMovieClip("shockshot" + _root.shockct, 26500 + _root.shockct);
_root["shockshot" + _root.shockct]._x = this._x;
_root["shockshot" + _root.shockct]._y = this._y;
_root["shockshot" + _root.shockct]._width = 2 * shockwidth;
_root["shockshot" + _root.shockct]._height = 2 * shockwidth;
_root.shockct++;
if (_root.shockct > 20) {
_root.shockct = 1;
}
} else if (this.towerid == 22) {
if (this.tier == 1) {
staticval = 5;
} else if (this.tier == 2) {
staticval = 7;
} else if (this.tier == 3) {
staticval = 10;
}
staticchance = random(100);
if (staticchance < staticval) {
damagetaken = this.targ.maxhealth - this.targ.health;
(this.health - this.health) - (0.5 * damagetaken);
_root.lighteffect.duplicateMovieClip("lighteffect" + _root.staticcount, 23000 + _root.staticcount);
_root["lighteffect" + _root.staticcount]._x = this._x;
_root["lighteffect" + _root.staticcount]._y = this._y;
_root.staticcount++;
if (_root.staticcount > 50) {
_root.staticcount = 1;
}
}
} else if (this.towerid == 25) {
stealval = random(100);
if (this.tier == 1) {
this.stealmax = 6;
} else if (this.tier == 2) {
this.stealmax = 9;
} else if (this.tier == 3) {
this.stealmax = 10;
} else if (this.tier == 4) {
this.stealmax = 12;
}
if (stealval < this.stealmax) {
_root.gold = _root.gold + this.targ.gold;
_root.goldeffect.duplicateMovieClip("goldeffect" + _root.goldeffectct, 26000 + _root.goldeffectct);
_root["goldeffect" + _root.goldeffectct]._x = this._x;
_root["goldeffect" + _root.goldeffectct]._y = this._y;
_root.goldeffectct++;
if (_root.goldeffectct > 20) {
_root.goldeffectct = 1;
}
}
} else if (this.towerid == 999) {
if (this.targ.health < (0.65 * this.targ.maxhealth)) {
randteleport = random(100);
if ((this.tier == 1) && (randteleport < 8)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
_root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 2) && (randteleport < 9)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 3) && (randteleport < 10)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 4) && (randteleport < 11)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 5) && (randteleport < 13)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
}
}
} else if (this.towerid == 100) {
if (this.tier == 1) {
spradius = 1225;
spwidth = 35;
} else if (this.tier == 2) {
spradius = 1600;
spwidth = 40;
} else if (this.tier == 3) {
spradius = 2025;
spwidth = 45;
} else if (this.tier == 4) {
spradius = 2500;
spwidth = 50;
} else if (this.tier == 5) {
spradius = 3600;
spwidth = 60;
}
j = 0;
while (j <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[j]._x, 2) + Math.pow(this._y - _root.creepArray[j]._y, 2);
if (d < spradius) {
if ((("" + _root.creepArray[j]) != "") && (_root.creepArray[j] != this.targ)) {
_root.creepArray[j].health = _root.creepArray[j].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[j].splashslowed = 1;
_root.creepArray[j].splashslowedcount = 1;
}
j++;
}
_root.iceball.duplicateMovieClip("iceball" + _root.splashct, 5200 + _root.splashct);
_root["iceball" + _root.splashct]._x = this._x;
_root["iceball" + _root.splashct]._y = this._y;
_root["iceball" + _root.splashct]._width = spwidth;
_root["iceball" + _root.splashct]._height = spwidth;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 3) {
if (this.tier == 1) {
this.targ.isslow = 0.6;
}
if (this.tier == 2) {
this.targ.isslow = 0.5;
}
if (this.tier == 3) {
this.targ.isslow = 0.4;
}
if (this.tier == 4) {
this.targ.isslow = 0.35;
}
if (this.tier == 5) {
this.targ.isslow = 0.3;
}
this.targ.slowcount = 1;
} else if (this.towerid == 2) {
_root.explosion.duplicateMovieClip("explosion" + _root.explosioncount, 5000 + _root.explosioncount);
_root["explosion" + _root.explosioncount]._x = this._x;
_root["explosion" + _root.explosioncount]._y = this._y;
_root["explosion" + _root.explosioncount]._width = 100;
_root["explosion" + _root.explosioncount]._height = 100;
_root.explosioncount++;
if (_root.explosioncount > 40) {
_root.explosioncount = 1;
}
splashrad = 50;
splashrad2 = splashrad * splashrad;
i = 0;
while (i <= _root.creepArray.length) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < splashrad2) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 6000)));
}
}
i++;
}
}
if (this.targ.health <= 0) {
this.targ.isDead = 1;
}
this.removeMovieClip();
}
}
};
}
function checkkill() {
n = 0;
while (n < _root.creepArray.length) {
if ((_root.creepArray[n].health <= 0) || (_root.creepArray[n] == "undefined")) {
_root.kills++;
_root.aftereffect.duplicateMovieClip("aftereffect" + _root.effectcount, 50000 + _root.effectcount);
_root["aftereffect" + _root.effectcount]._x = _root.creepArray[n]._x;
_root["aftereffect" + _root.effectcount]._y = _root.creepArray[n]._y;
_root.effectcount++;
if (_root.effectcount > 50) {
_root.effectcount = 1;
}
if (((_root.creepArray[n].gold != "undefined") && (_root.creepArray[n].gold != "null")) && (_root.creepArray[n].gold > 0)) {
_root.gold = _root.gold + _root.creepArray[n].gold;
_root.score = _root.score + _root.creepArray[n].maxhealth;
}
_root.creepArray[n].removeMovieClip();
_root.creepArray.splice(n, 1);
}
n++;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
function kill(creep) {
_root.kills++;
if (_root.kills >= _root.waves[_root.wave - 1][0]) {
_root.kills = 0;
_root.newLevel();
}
creep.onEnterFrame = function () {
this.removeMovieClip();
};
}
function upgrade() {
a = _root.selectedTower;
b = a.tier - 1;
if (int(a.upgrades[b][1]) <= _root.gold) {
a.damage = int(a.upgrades[b][2]);
a.range = a.upgrades[b][3];
a.rate = a.upgrades[b][4];
a.splash = a.upgrades[b][5];
a.slow = a.upgrades[b][6];
a.cost = a.cost + int(a.upgrades[b][1]);
a.tier++;
_root.towerInfo(a);
_root.gold = _root.gold - int(a.upgrades[b][1]);
updateInfoBar();
}
}
function sell() {
tower = _root.selectedTower;
if (((tower != "undefined") && (tower != "null")) && (tower != "")) {
sellprice = Math.floor(tower.cost * 0.85);
if (sellprice != "undefined") {
_root.gold = _root.gold + sellprice;
}
_root.range._x = 1000;
_root.range._height = 0;
_root.range._width = 0;
if (tower.maxtier == 2) {
_root.gems++;
}
tower.removeMovieClip();
_root.UpgradeTowerInfo._visible = false;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
stop();
_root.skillstats.swapDepths(9090);
_root.skillstats.removeMovieClip();
_root.challengescore._x = 2000;
_root.challengescore._y = 2000;
_root.levelwin = 0;
_root.gold = 100;
_root.gems = _global.gems;
_root.attackskill = _global.attackskill;
_root.rangeskill = _global.rangeskill;
_root.killbounty = _global.killbounty;
_root.techlevel = _global.techlevel;
if (_global.startmoneylevel == 1) {
_root.gold = 150;
} else if (_global.startmoneylevel == 2) {
_root.gold = 200;
} else if (_global.startmoneylevel == 3) {
_root.gold = 250;
} else if (_global.startmoneylevel == 4) {
_root.gold = 400;
} else if (_global.startmoneylevel == 5) {
_root.gold = 600;
}
_root.wave = 0;
_root.levelnew = 1;
_root.effectcount = 1;
_root.staticcount = 1;
_root.shockct = 1;
_root.gameover = 0;
_root.towerCount = 0;
_root.creepcount = 1;
_root.goldeffectct = 1;
_root.kills = 0;
_root.pauses = 0;
_root.creepleaks = 0;
_root.timer = 45;
_root.lives = 20;
_root.goldworth = 0;
_root.creepArray = [];
_global.sound = 1;
_root.particlecount = 1;
_root.splashct = 1;
_root.pwncount = 1;
_root.explodecount = 1;
_root.score = 0;
_root.playsound = new Sound(this);
_root.playsound.attachSound("music");
if (_global.sound == 1) {
_root.playsound.start(0, 100000);
}
_root.playsound1 = new Sound(this);
_root.playsound1.attachSound("sndplasma");
_root.playsound2 = new Sound(this);
_root.playsound2.attachSound("sndrocket");
_root.playsound3 = new Sound(this);
_root.playsound3.attachSound("sndbullet");
_root.playsound4 = new Sound(this);
_root.playsound4.attachSound("sndbullet1");
_root.playsound5 = new Sound(this);
_root.playsound5.attachSound("sndexplode");
_root.playsound6 = new Sound(this);
_root.playsound6.attachSound("sndlaser");
_global.maxwaves = 53;
_root.wavemax = _global.maxwaves;
_root.waves = [[20, 93, 3.75, 667], [20, 109, 4.5, 600], [20, 128, 2.75, 400], [20, 149, 3.75, 667], [20, 176, 4.05, 600], [20, 204, 3.75, 667], [20, 239, 3, 266], [2, 900, 5.25, 600], [20, 328, 3, 667], [20, 384, 3.75, 667], [20, 450, 3, 667], [20, 526, 2.75, 400], [20, 616, 3, 250], [20, 720, 5, 700], [20, 843, 3.25, 550], [2, 4900, 2.75, 800], [20, 1154, 3.75, 250], [20, 1350, 4, 700], [20, 1580, 4.25, 650], [20, 1848, 3.5, 580], [20, 2159, 3.25, 150], [20, 2530, 3.4, 525], [20, 2967, 2.8, 475], [20, 3494, 3, 600], [2, 15600, 3.141592, 620], [20, 4783, 3.5, 650], [20, 5608, 4, 700], [20, 6575, 3.3, 600], [20, 7710, 3.4, 190], [20, 9040, 3.12, 550], [20, 10623, 3.3, 600], [20, 12481, 3.2, 570], [2, 55000, 2.5, 800], [20, 17232, 3, 600], [20, 20249, 3.15, 577], [20, 23792, 3.2, 500], [20, 27957, 3.35, 600], [20, 32849, 3.4, 220], [20, 38597, 3.5, 630], [20, 45352, 3.75, 670], [20, 53516, 3, 200], [20, 63148, 3.2, 650], [20, 74515, 3.3, 660], [20, 87928, 3.4, 675], [20, 103755, 3.5, 690], [20, 122437, 4, 800], [20, 144469, 3, 650], [20, 170473, 3.5, 700], [2, 976000, 4, 1000], [20, 238375, 3.5, 170], [20, 284841, 3.4, 600], [20, 341809, 3.33, 590], [20, 410171, 4.5, 750], [20, 492205, 4, 700], [20, 593155, 3.4, 600], [20, 708776, 3.6, 625], [2, 4300000, 3.7, 700], [20, 1020637, 3.8, 710], [20, 1224766, 4, 650], [20, 1469719, 5, 700]];
_root.nowhp = 0;
_root.nowspeed = 0;
_root.nexthp = _root.waves[0][1];
_root.nextspeed = 2.5;
Instance of Symbol 228 MovieClip "wp1" in Frame 24
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp2" in Frame 24
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp3" in Frame 24
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp4" in Frame 24
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp5" in Frame 24
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp6" in Frame 24
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp7" in Frame 24
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp8" in Frame 24
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp9" in Frame 24
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp10" in Frame 24
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 236 MovieClip in Frame 24
on (press) {
_root.marker.active = 1;
_root.marker.tower = "basic";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Tower. Shoots bullets at enemies. 80 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 238 MovieClip in Frame 24
on (press) {
_root.marker.active = 1;
_root.marker.tower = "splash";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Splash Tower. Shoots Exploding bullets at enemies. 29 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 240 MovieClip in Frame 24
on (press) {
_root.marker.active = 1;
_root.marker.tower = "slow";
_root.marker.cost = 150;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Slow Tower. Shoots shots that slow the enemy. 100 base damage. Cost: $150";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 242 MovieClip in Frame 24
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "poison";
_root.marker.cost = 500;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Splash Poison Tower. Splashes Poison(150/sec for level 1) to hurt the enemy. 300 base damage. Cost: $500, tech level 1 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 244 MovieClip in Frame 24
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "static";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Static tower. 6% chance to make target take 50% of the damage that is has lost so far. 500 base damage. Cost: $650. Tech level 1.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 246 MovieClip in Frame 24
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "shock";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Shock tower. Has the ability to random stun any enemy within its radius. Enemies cannot be stunned if already under effect of stun. 500 base damage. Cost: $1000. Tech level 4 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 248 MovieClip in Frame 24
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "stun";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Stun Tower. Has a 10% chance of stunning enemies. 500 base damage. Cost: $700. Requires Tech level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 252 MovieClip in Frame 24
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "death";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Instant death tower. 8% chance to instantly kill if target is under 35% HP. 500 base damage. Cost: $650. Tech Level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 254 MovieClip in Frame 24
on (press) {
if (_root.techlevel >= 2) {
_root.marker.active = 1;
_root.marker.tower = "money";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Money Tower. Has a 5% chance of stealing money from creeps it hits at level 1. 500 Damage. Cost: $700. Tech Level 2.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 256 MovieClip in Frame 24
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "explode";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Exploding Tower. Damages and slows all enemies in a radius of itself. 500 base damage. Cost: $1000. Tech Level 4.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 258 MovieClip in Frame 24
on (press) {
if (_root.gems > 0) {
if (_root.techlevel >= 5) {
_root.marker.active = 1;
_root.marker.tower = "ultimate";
_root.marker.cost = 20000;
_root.tinfo._visible = false;
}
}
}
on (rollOver) {
_root.buyinfo = "Ultimate Tower. Extreme Damage and splash. 100000 damage. Cost: $20000 and 1 Gem. Tech level 5 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 236 MovieClip "tower_basic" in Frame 24
onClipEvent (load) {
title = "Basic Damage Tower";
desc = "Basic Damage Tower";
cost = 50;
this.range = 65 * (1 + (0.05 * _global.rangeskill));
this.range2 = 66 * (1 + (0.05 * _global.rangeskill));
this.range3 = 67 * (1 + (0.05 * _global.rangeskill));
this.range4 = 68 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 80;
damage = 80 * (1 + (0.05 * _global.attackskill));
this.damage2 = 240 * (1 + (0.05 * _global.attackskill));
this.damage3 = 720 * (1 + (0.05 * _global.attackskill));
this.damage4 = 2160 * (1 + (0.05 * _global.attackskill));
rate = 19;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 240\rRange: 66\rCooldown: 18\rEffect: None", 120, this.damage2, this.range2, 18], ["Damage: 720\rRange: 67\rCooldown: 17\rEffect: None", 300, this.damage3, this.range3, 17], ["Damage: 2160\rRange: 68\rCooldown: 17\rEffect: None", 880, this.damage4, this.range4, 17]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_basic")) {
if (target == undefined) {
target = 0;
}
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 264 MovieClip "range" in Frame 24
onClipEvent (enterFrame) {
if ((_root.selectedTower == "") && (_root.marker.active == 0)) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 267 MovieClip "marker" in Frame 24
onClipEvent (load) {
active = 0;
inpath = 0;
this.swapDepths(9998);
}
onClipEvent (enterFrame) {
if (active == 1) {
this.startDrag(true);
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((maphit == 1) && (inpath == 0)) {
this.gotoAndStop(1);
_root.range.gotoAndStop(1);
} else {
this.gotoAndStop(2);
_root.range.gotoAndStop(2);
}
_root.range._x = _x;
_root.range._y = _y;
_root.range._width = _root["tower_" + tower].range * 2;
_root.range._height = _root["tower_" + tower].range * 2;
}
if (Key.isDown(32)) {
active = 0;
trace(1);
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
on (press) {
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((((maphit == 1) && (inpath == 0)) && (_root.gold >= this.cost)) && (_root.pauses == 0)) {
if (this.hitTest(_root.nextwave) == false) {
if (_root.marker.tower == "ultimate") {
if (_root.gems > 0) {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gems--;
_root.gold = _root.gold - this.cost;
}
} else {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gold = _root.gold - this.cost;
}
}
}
if (maphit == 0) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
if (this.hitTest(_root.nextwave)) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
Instance of Symbol 238 MovieClip "tower_splash" in Frame 24
onClipEvent (load) {
title = "Splash Tower";
desc = "Splash Tower";
cost = 50;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 73 * (1 + (0.05 * _global.rangeskill));
this.range4 = 75 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 34 * (1 + (0.05 * _global.attackskill));
this.damage2 = 102 * (1 + (0.05 * _global.attackskill));
this.damage3 = 306 * (1 + (0.05 * _global.attackskill));
this.damage4 = 918 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 102\rRange: 72\rCooldown: 21\rEffect: Splash", 120, this.damage2, this.range2, 21], ["Damage: 306\rRange: 73\rCooldown: 21\rEffect: Splash", 300, this.damage3, this.range3, 21], ["Damage: 918\rRange: 75\rCooldown: 20\rEffect: Splash", 880, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_splash")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > ((range * range) + 81)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 289 MovieClip "explosion" in Frame 24
onClipEvent (load) {
if (this._name == "explosion") {
this._visible = false;
}
}
Instance of Symbol 240 MovieClip "tower_slow" in Frame 24
onClipEvent (load) {
title = "Slow tower";
desc = "Slow tower";
cost = 150;
this.range = 68 * (1 + (0.05 * _global.rangeskill));
this.range2 = 69 * (1 + (0.05 * _global.rangeskill));
this.range3 = 70 * (1 + (0.05 * _global.rangeskill));
this.range4 = 71 * (1 + (0.05 * _global.rangeskill));
this.range5 = 72 * (1 + (0.05 * _global.rangeskill));
damage = 100 * (1 + (0.05 * _global.attackskill));
this.damage2 = 500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2200 * (1 + (0.05 * _global.attackskill));
this.damage4 = 10500 * (1 + (0.05 * _global.attackskill));
this.damage5 = 33000 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 500\rRange: 69\rCooldown: 22\rEffect: Slow", 500, this.damage2, this.range2, 22], ["Damage: 2200\rRange: 70\rCooldown: 21\rEffect: Slow", 1250, this.damage3, this.range3, 21], ["Damage: 10500\rRange: 71\rCooldown: 21\rEffect: Slow", 3150, this.damage4, this.range4, 21], ["Damage: 33000\rRange: 72\rColldown:19\rEffect: Slow", 8000, this.damage5, this.range5, 19]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_slow")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 314 MovieClip in Frame 24
on (press) {
_root.marker.active = 1;
_root.marker.tower = "rust";
_root.marker.cost = 400;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Rust Tower. Shoots shots that rust the enemy, causing them to take more damage. 300 base damage. Ultra Fast. Cost: $400";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 314 MovieClip "tower_rust" in Frame 24
onClipEvent (load) {
title = "Rust Tower";
desc = "Rust Tower";
cost = 400;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range5 = 80 * (1 + (0.05 * _global.rangeskill));
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 930 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 5000 * (1 + (0.05 * _global.attackskill));
this.damage5 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 9;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 930\rRange: 76\rCooldown: 9\rEffect: Rust", 1200, this.damage2, this.range2, 9], ["Damage: 2000\rRange: 77\rCooldown: 8\rEffect: Rust", 3000, this.damage3, this.range3, 8], ["Damage: 5000\rRange: 78\rCooldown: 8\rEffect: Rust", 6000, this.damage4, this.range4, 8], ["Damage: 15000\rRange: 80\rCooldown: 7\rEffect:Rust", 13500, this.damage5, this.range5, 7]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 242 MovieClip "tower_poison" in Frame 24
onClipEvent (load) {
title = "Splash Poison";
desc = "Splash Poison";
cost = 500;
this.range = 70;
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 75 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 12000 * (1 + (0.05 * _global.attackskill));
rate = 23;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 72\rCooldown: 22\rEffect:Poison(600)", 1500, this.damage2, this.range2, 22], ["Damage: 4000\rRange: 75\rCooldown: 21\rEffect:Poison(2700)", 5000, this.damage3, this.range3, 21], ["Damage: 12000\rRange:78\rCooldown: 20\rEffect:Poison(10000)", 11500, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 244 MovieClip "tower_static" in Frame 24
onClipEvent (load) {
title = "Static";
desc = "Static";
cost = 500;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 80 * (1 + (0.05 * _global.rangeskill));
this.range4 = 85 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 25;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 77\rCooldown: 24\rEffect:Static(7)", 1500, this.damage2, this.range2, 24], ["Damage: 4000\rRange: 80\rCooldown: 23\rEffect:Static(10)", 5000, this.damage3, this.range3, 23], ["Damage: 15000\rRange: 85\rCooldown:22\rEffect:Static(12)", 11000, this.damage4, this.range4, 22]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 252 MovieClip "tower_death" in Frame 24
onClipEvent (load) {
title = "Instant Death";
desc = "Instant Death";
cost = 650;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 79 * (1 + (0.05 * _global.rangeskill));
this.range4 = 82 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 650 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 15000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 35000 * (1 + (0.05 * _global.attackskill));
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3000)\rRange: 77\rCooldown: 28\rEffect:Death(12%)", 2000, this.damage2, this.range2, 28], ["Damage: 15000\rRange: 79\rCooldown: 26\rEffect:Death(16%)", 7000, this.damage3, this.range3, 26], ["Damage: 35000\rRange:82\rCooldown: 23 \rEffect:Death(19%)", 13500, this.damage4, this.range4, 23]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 248 MovieClip "tower_stun" in Frame 24
onClipEvent (load) {
title = "Stun Tower";
desc = "Stun Tower";
cost = 700;
rate = 22;
this.range = 73 * (1 + (0.05 * _global.rangeskill));
this.range2 = 74 * (1 + (0.05 * _global.rangeskill));
this.range3 = 76 * (1 + (0.05 * _global.rangeskill));
this.range4 = 79 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 45000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 74\rCooldown: 22\rEffect:Stun(13%)", 2500, this.damage2, this.range2, 22], ["Damage: 17000\rRange: 76\rCooldown: 21\rEffect:Stun(16%)", 9000, this.damage3, this.range3, 21], ["Damage: 45000\rRange: 79\rCooldown: 20\rEffect:Stun(18%)", 18000, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 254 MovieClip "tower_money" in Frame 24
onClipEvent (load) {
title = "Money Tower";
desc = "Money Tower";
cost = 700;
rate = 25;
this.range = 75;
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 78 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 40000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 76\rCooldown: 24\rEffect:Steal Money(8)", 2500, this.damage2, this.range2, 24], ["Damage: 17000\rRange: 78\rCooldown: 23\rEffect:Steal(9)", 9000, this.damage3, this.range3, 23], ["Damage: 40000\rRange: 80\rCooldown:21\rEffect:Steal(11)", 18000, this.damage4, this.range4, 21]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 256 MovieClip "tower_explode" in Frame 24
onClipEvent (load) {
title = "Explosion";
desc = "Explosion";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 80 * (1 + (0.05 * _global.rangeskill));
this.range2 = 82 * (1 + (0.05 * _global.rangeskill));
this.range3 = 84 * (1 + (0.05 * _global.rangeskill));
this.range4 = 86 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 82\rCooldown: 28\rEffect:Slow", 3000, this.damage2, this.range2, 28], ["Damage: 8000\rRange: 84\rCooldown: 27\rEffect:Slow", 10000, this.damage3, this.range3, 27], ["Damage: 25000\rRange: 86\rCooldown:25\rEffect:Slow", 25000, this.damage4, this.range4, 25]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 336 MovieClip "shockshot" in Frame 24
onClipEvent (enterFrame) {
this._rotation = this._rotation + 30;
}
Instance of Symbol 246 MovieClip "tower_shock" in Frame 24
onClipEvent (load) {
title = "Shock";
desc = "Shock";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 75 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 35;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 75\rCooldown: 33\rEffect:Shock", 3000, this.damage2, this.range2, 33], ["Damage: 8000\rRange: 77\rCooldown: 30\rEffect:Shock", 10000, this.damage3, this.range3, 30], ["Damage: 25000\rRange: 80\rCooldown: 27\rEffect:Shock", 25000, this.damage4, this.range4, 27]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 258 MovieClip "tower_ultimate" in Frame 24
onClipEvent (load) {
title = "Ultimate Tower";
desc = "Ultimate Tower";
cost = 20000;
damage = 100000 * (1 + (0.05 * _global.attackskill));
this.damage2 = 200000 * (1 + (0.05 * _global.attackskill));
this.range = 85 * (1 + (0.05 * _global.rangeskill));
this.range2 = 95 * (1 + (0.05 * _global.rangeskill));
rate = 27;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 2;
upgrades = [["Damage: 200000\rRange: 95\rCooldown: 33\rEffect:Splash", 40000, this.damage2, this.range2, 24]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_ultimate")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 353 MovieClip "UpgradeTowerInfo" in Frame 24
onClipEvent (load) {
_visible = false;
swapDepths(100000);
}
Instance of Symbol 378 MovieClip "creep1" in Frame 24
onClipEvent (load) {
this._rotation = this._rotation + 45;
}
Instance of Symbol 380 MovieClip in Frame 24
onClipEvent (enterFrame) {
if (_root.timer > 50) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 381 MovieClip in Frame 24
onClipEvent (load) {
this._visible = false;
this.startDrag(true);
this.count = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(77) && (_global.sound == 1)) {
_global.sound = 0;
stopAllSounds();
}
if (Key.isDown(78) && (_global.sound == 0)) {
_global.sound = 1;
_root.playsound.start(0, 100000);
}
if (Key.isDown(80) && (_root.pauses == 0)) {
_root.pauses = 1;
}
if (Key.isDown(85) && (_root.pauses == 1)) {
_root.pauses = 0;
}
if (_root.pauses == 0) {
_root.levelnew++;
_root.checkkill();
this.count++;
if ((this.count % 30) == 0) {
_root.timer--;
}
if (_root.timer <= 0) {
if (_root.wave < _global.maxwaves) {
_root.newLevel();
}
_root.timer = 60;
}
if ((_root.lives <= 0) && (_root.gameover == 0)) {
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
if (_root.creepArray.length <= 0) {
_root.gotoAndPlay("lose6");
}
}
if (((((_root.wave >= _global.maxwaves) && (_root.creepArray.length <= 0)) && (_root.gameover == 0)) && (_root.kills >= 20)) && (_root.levelnew > 120)) {
_root.levelwin = 1;
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
_root.gotoAndPlay("win6");
}
}
}
Instance of Symbol 387 MovieClip "tinfo" in Frame 24
onClipEvent (load) {
this.swapDepths(99999);
}
Instance of Symbol 421 MovieClip "quitbox" in Frame 24
onClipEvent (load) {
this._visible = false;
}
Frame 25
stop();
stopAllSounds();
Frame 26
stop();
_root.gameover = 1;
stopAllSounds();
if (_root.levelwin == 0) {
_root.gotoAndPlay("lose6");
}
if (_root.lives == 20) {
_root.skillgained = 3;
} else {
_root.skillgained = 2;
}
storedskills = SharedObject.getLocal("flashskill");
if (storedskills.data.level6gain == undefined) {
_global.xpleft = _global.xpleft + _root.skillgained;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level6gain = _root.skillgained;
} else {
xplast = storedskills.data.level6gain;
skilldifferent = _root.skillgained - xplast;
if (skilldifferent > 0) {
_global.xpleft = _global.xpleft + skilldifferent;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level6gain = storedskills.data.level6gain + skilldifferent;
}
}
if ((storedskills.data.maxlevelbeat < 6) || (storedskills.data.maxlevelbeat == undefined)) {
storedskills.data.maxlevelbeat = 6;
}
if ((storedskills.data.level6score == undefined) || (_root.score > storedskills.data.level6score)) {
storedskills.data.level6score = _root.score;
}
Frame 27
function TowerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
}
function towerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
_root.UpgradeTowerInfo._visible = true;
if (tower.maxtier >= tower.tier) {
_root.UpgradeTowerInfo.UpgradeInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 1][2]) + "\rRange: ") + tower.upgrades[tower.tier - 1][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 1][4]) + "\rEffect: ") + tower.desc;
if (tower.tier == 1) {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.damage) + "\rRange: ") + tower.range) + "\rCoolDown: ") + tower.rate) + "\rEffect: ") + tower.desc;
} else {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 2][2]) + "\rRange: ") + tower.upgrades[tower.tier - 2][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 2][4]) + "\rEffect: ") + tower.desc;
}
_root.UpgradeTowerInfo.UpgradeButton.UpgradeButtonText.text = ("Upgrade [$" + tower.upgrades[tower.tier - 1][1]) + "]";
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
sellprice = Math.floor(tower.cost * 0.85);
_root.UpgradeTowerInfo.sellbutton.UpgradeButtonText.text = ("Sell [$" + sellprice) + "]";
if (tower.maxtier > tower.tier) {
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
} else {
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
}
} else {
_root.UpgradeTowerInfo.f.text = "";
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
_root.UpgradeTowerInfo.h.text = "";
}
}
function newLevel() {
if (_root.wave < 59) {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.02 * _root.gold);
_root.nowspeed = _root.waves[_root.wave - 1][2];
_root.nextspeed = _root.waves[_root.wave][2];
_root.nowhp = _root.waves[_root.wave - 1][1];
_root.nexthp = _root.waves[_root.wave][1];
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = _root.goldworth * 1.7;
_root.goldworth = _root.goldworth * (1 + (0.05 * _global.killbounty));
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", _root.waves[_root.wave - 1][3], _root.wave, "creep1", _root.waves[_root.wave - 1][2], _root.waves[_root.wave - 1][1], _root.goldworth);
_root["spawned" + _root.wave] = _root.waves[_root.wave - 1][0];
} else {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.03 * _root.gold);
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = Math.floor(_root.goldworth);
_root.goldworth = _root.goldworth * 1.2;
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
randspeed = 1.25;
_root.nowspeed = randspeed;
_root.nextspeed = "???";
wavessince = _root.wave - 60;
hpmultiplier = Math.pow(1.2, wavessince);
_root.nowhp = Math.floor(_root.waves[59][1] * hpmultiplier);
_root.nexthp = Math.floor(_root.nowhp * 1.2);
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", 50, _root.wave, "creep1", _root.nowspeed, _root.nowhp, _root.goldworth);
_root["spawned" + _root.wave] = 30;
}
}
function spawn(level, creep, speed, health, gold) {
if (_root["spawned" + level] == 0) {
clearInterval(_root["spawnInterval" + level]);
} else {
_root["spawned" + level]--;
playanim = (level % 5) + 1;
_root.creepcount++;
_root[creep].duplicateMovieClip("c" + _root.creepcount, 20000 + _root.creepcount);
if (_root.creepcount > 10000) {
_root.creepcount = 1;
}
c = _root["c" + _root.creepcount];
c.creep.gotoAndStop(playanim);
c._x = _root.wp1._x;
c._y = _root.wp1._y;
c.health = health;
c.slowcount = 1;
c.isslow = 0;
c.maxhealth = health;
c.speed = speed;
c.maxspeed = c.speed;
c.ispoisoned = 0;
c.poisonedlevel = 0;
c.poisoncount = 0;
c.fullmax = c.maxspeed;
c.targ = 2;
c.rnd = 5;
c.shocked = 0;
c.shockcount = 1;
c.gold = gold;
c.iscorrode = 0;
c.isstunned = 0;
c.stuncount = 1;
c.splashslowed = 0;
c.splashslowedcount = 1;
_root.creepArray[_root.creepArray.length] = c;
c.onEnterFrame = function () {
if (_root.pauses == 0) {
this.health_bar.health._width = 30 * (this.health / this.maxhealth);
this.targX = (_root["wp" + this.targ]._x - 5) + this.rnd;
this.targY = (_root["wp" + this.targ]._y - 5) + this.rnd;
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this.rads = (this.dir * 3.141593) / 180;
if ((this.isstunned != 0) || (this.shocked == 1)) {
this.stuncount++;
if ((this.stuncount % 2) == 1) {
this._x = this._x + 2;
} else {
this._x = this._x - 2;
}
}
if (this.stuncount > 160) {
this.isstunned = 0;
this.stuncount = 1;
}
if (this.isslow != 0) {
this.speed = this.isslow * this.fullmax;
this.slowcount++;
}
if (this.slowcount > 160) {
this.speed = this.fullmax;
this.isslow = 0;
this.slowcount = 1;
}
if (this.splashslowed != 0) {
this.fullmax = this.maxspeed * this.splashslowed;
this.speed = this.fullmax;
if (this.isslow != 0) {
this.speed = this.fullmax * this.isslow;
}
this.splashslowedcount++;
}
if (this.splashslowedcount > 100) {
this.splashslowed = 0;
this.fullmax = this.maxspeed;
this.speed = this.fullmax;
this.splashslowedcount = 1;
}
if (this.iscorrode != 0) {
this.corrodecount++;
}
if (this.corrodecount > 200) {
this.iscorrode = 0;
this.corrdecount = 1;
}
if (this.ispoisoned == 1) {
if ((this.poisoncount % 40) == 0) {
this.health = this.health - this.poisonedlevel;
}
this.poisoncount++;
}
if (this.shocked == 1) {
this.shockcount++;
}
if (this.shockcount >= 80) {
this.shocked = 0;
this.shockcount = 1;
}
if (this.poisoncount > 200) {
this.ispoisoned = 0;
this.poisoncount = 0;
}
if ((this.isstunned == 0) && (this.shocked == 0)) {
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
}
d = Math.pow(this._x - this.targX, 2) + Math.pow(this._y - this.targY, 2);
if (d < 25) {
this.targ++;
if (this.targ > 14) {
_root.leak(this);
this._x = _root.wp1._x;
this._y = _root.wp1._y;
this.targ = 2;
}
}
this.r = this.dir;
if ((this._rotation + 10) < this.r) {
this._rotation = this._rotation + 10;
} else if ((this._rotation - 10) > this.r) {
this._rotation = this._rotation - 10;
} else {
this._rotation = r;
}
}
};
}
}
function fire(from, to, speed, acc, maxpeed, projectile, damage, towerid) {
_root.particlecount++;
_root[projectile].duplicateMovieClip("p" + _root.particlecount, 2000 + _root.particlecount);
r = _root["p" + _root.particlecount];
r._x = from._x;
r._y = from._y;
r.tier = from.tier;
r.type = from.type;
r.targ = to;
r.speed = speed;
r.acc = acc;
r.maxspeed = maxspeed;
r.damage = damage;
r.projectile = projectile;
r.towerid = towerid;
if (_root.particlecount > 300) {
_root.particlecount = 0;
}
r.onEnterFrame = function () {
if (_root.pauses == 0) {
if (("" + this.targ) != "") {
this.targX = this.targ._x;
this.targY = this.targ._y;
} else {
this._rotation = (Math.atan2(this.targ._y - this._y, this.targ._x - this._x) * 180) / 3.141593;
if (_root.creepArray.length <= 0) {
this.removeMovieClip();
} else {
w = 0;
if (w <= _root.creepArray.length) {
this.targ = _root.creepArray[w];
}
}
}
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this._rotation = this.dir + 90;
this.rads = (this.dir * 3.141593) / 180;
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
if (this.speed < this.maxspeed) {
this.speed = this.speed + this.acc;
}
d = ((this._x - this.targX) * (this._x - this.targX)) + ((this._y - this.targY) * (this._y - this.targY));
if (d < 25) {
if (this.towerid == 10) {
randcrit = random(100);
if ((this.tier == 1) && (randcrit < 11)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 2) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 3) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 4) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 5) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
} else if (this.towerid == 4) {
this.targ.corrodecount = 1;
if (this.tier == 1) {
this.targ.iscorrode = 0.06;
} else if (this.tier == 2) {
this.targ.iscorrode = 0.12;
} else if (this.tier == 3) {
this.targ.iscorrode = 0.2;
} else if (this.tier == 4) {
this.targ.iscorrode = 0.32;
} else if (this.tier == 5) {
this.targ.iscorrode = 0.45;
}
}
this.targ.health = this.targ.health - (this.damage * (1 + this.targ.iscorrode));
if (this.towerid == 7) {
randstun = random(100);
if ((this.tier == 1) && (randstun < 10)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 2) && (randstun < 14)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 3) && (randstun < 17)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 4) && (randstun < 20)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
}
} else if (this.towerid == 5) {
this.targ.ispoisoned = 1;
this.targ.poisoncount = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < 4225) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[i].ispoisoned = 1;
_root.creepArray[i].poisoncount = 1;
}
i++;
}
if (this.tier == 1) {
this.targ.poisonedlevel = 150;
} else if (this.tier == 2) {
this.targ.poisonedlevel = 600;
} else if (this.tier == 3) {
this.targ.poisonedlevel = 2700;
} else if (this.tier == 4) {
this.targ.poisonedlevel = 10000;
}
_root.poisonball.duplicateMovieClip("poisonball" + _root.splashct, 6300 + _root.splashct);
_root["poisonball" + _root.splashct]._x = this._x;
_root["poisonball" + _root.splashct]._y = this._y;
_root["poisonball" + _root.splashct]._width = 80;
_root["poisonball" + _root.splashct]._height = 80;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 6) {
if (this.targ.health < (0.35 * this.targ.maxhealth)) {
randdeath = random(100);
if ((this.tier == 1) && (randdeath < 8)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 2) && (randdeath < 12)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 3) && (randdeath < 16)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 4) && (randdeath < 20)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
}
}
} else if (this.towerid == 8) {
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < 10000) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
if (this.tier == 1) {
_root.creepArray[k].splashslowed = 0.6;
} else if (this.tier == 2) {
_root.creepArray[k].splashslowed = 0.55;
} else if (this.tier == 3) {
_root.creepArray[k].splashslowed = 0.5;
} else if (this.tier == 4) {
_root.creepArray[k].splashslowed = 0.4;
}
_root.creepArray[k].splashslowedcount = 0;
}
k++;
}
_root.explodingshot.duplicateMovieClip("explodingshot" + _root.explodecount, 5100 + _root.explodecount);
_root["explodingshot" + _root.explodecount]._x = this._x;
_root["explodingshot" + _root.explodecount]._y = this._y;
_root.explodecount++;
if (_root.explodecount > 20) {
_root.explodecount = 1;
}
} else if (this.towerid == 26) {
if (this.tier == 1) {
shockwidth = 75;
shockchance = 8;
} else if (this.tier == 2) {
shockwidth = 80;
shockchance = 10;
} else if (this.tier == 3) {
shockwidth = 85;
shockchance = 12;
} else if (this.tier == 4) {
shockwidth = 90;
shockchance = 14;
}
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < (shockwidth * shockwidth)) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
shockper = random(100);
if (shockper < shockchance) {
if (_root.creepArray[k].shocked == 0) {
_root.creepArray[k].shocked = 1;
_root.creepArray[k].splashslowedcount = 1;
}
}
}
k++;
}
_root.shockshot.duplicateMovieClip("shockshot" + _root.shockct, 26500 + _root.shockct);
_root["shockshot" + _root.shockct]._x = this._x;
_root["shockshot" + _root.shockct]._y = this._y;
_root["shockshot" + _root.shockct]._width = 2 * shockwidth;
_root["shockshot" + _root.shockct]._height = 2 * shockwidth;
_root.shockct++;
if (_root.shockct > 20) {
_root.shockct = 1;
}
} else if (this.towerid == 22) {
if (this.tier == 1) {
staticval = 5;
} else if (this.tier == 2) {
staticval = 7;
} else if (this.tier == 3) {
staticval = 10;
}
staticchance = random(100);
if (staticchance < staticval) {
damagetaken = this.targ.maxhealth - this.targ.health;
(this.health - this.health) - (0.5 * damagetaken);
_root.lighteffect.duplicateMovieClip("lighteffect" + _root.staticcount, 23000 + _root.staticcount);
_root["lighteffect" + _root.staticcount]._x = this._x;
_root["lighteffect" + _root.staticcount]._y = this._y;
_root.staticcount++;
if (_root.staticcount > 50) {
_root.staticcount = 1;
}
}
} else if (this.towerid == 25) {
stealval = random(100);
if (this.tier == 1) {
this.stealmax = 6;
} else if (this.tier == 2) {
this.stealmax = 9;
} else if (this.tier == 3) {
this.stealmax = 10;
} else if (this.tier == 4) {
this.stealmax = 12;
}
if (stealval < this.stealmax) {
_root.gold = _root.gold + this.targ.gold;
_root.goldeffect.duplicateMovieClip("goldeffect" + _root.goldeffectct, 26000 + _root.goldeffectct);
_root["goldeffect" + _root.goldeffectct]._x = this._x;
_root["goldeffect" + _root.goldeffectct]._y = this._y;
_root.goldeffectct++;
if (_root.goldeffectct > 20) {
_root.goldeffectct = 1;
}
}
} else if (this.towerid == 999) {
if (this.targ.health < (0.65 * this.targ.maxhealth)) {
randteleport = random(100);
if ((this.tier == 1) && (randteleport < 8)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
_root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 2) && (randteleport < 9)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 3) && (randteleport < 10)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 4) && (randteleport < 11)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 5) && (randteleport < 13)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
}
}
} else if (this.towerid == 100) {
if (this.tier == 1) {
spradius = 1225;
spwidth = 35;
} else if (this.tier == 2) {
spradius = 1600;
spwidth = 40;
} else if (this.tier == 3) {
spradius = 2025;
spwidth = 45;
} else if (this.tier == 4) {
spradius = 2500;
spwidth = 50;
} else if (this.tier == 5) {
spradius = 3600;
spwidth = 60;
}
j = 0;
while (j <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[j]._x, 2) + Math.pow(this._y - _root.creepArray[j]._y, 2);
if (d < spradius) {
if ((("" + _root.creepArray[j]) != "") && (_root.creepArray[j] != this.targ)) {
_root.creepArray[j].health = _root.creepArray[j].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[j].splashslowed = 1;
_root.creepArray[j].splashslowedcount = 1;
}
j++;
}
_root.iceball.duplicateMovieClip("iceball" + _root.splashct, 5200 + _root.splashct);
_root["iceball" + _root.splashct]._x = this._x;
_root["iceball" + _root.splashct]._y = this._y;
_root["iceball" + _root.splashct]._width = spwidth;
_root["iceball" + _root.splashct]._height = spwidth;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 3) {
if (this.tier == 1) {
this.targ.isslow = 0.6;
}
if (this.tier == 2) {
this.targ.isslow = 0.5;
}
if (this.tier == 3) {
this.targ.isslow = 0.4;
}
if (this.tier == 4) {
this.targ.isslow = 0.35;
}
if (this.tier == 5) {
this.targ.isslow = 0.3;
}
this.targ.slowcount = 1;
} else if (this.towerid == 2) {
_root.explosion.duplicateMovieClip("explosion" + _root.explosioncount, 5000 + _root.explosioncount);
_root["explosion" + _root.explosioncount]._x = this._x;
_root["explosion" + _root.explosioncount]._y = this._y;
_root["explosion" + _root.explosioncount]._width = 100;
_root["explosion" + _root.explosioncount]._height = 100;
_root.explosioncount++;
if (_root.explosioncount > 40) {
_root.explosioncount = 1;
}
splashrad = 50;
splashrad2 = splashrad * splashrad;
i = 0;
while (i <= _root.creepArray.length) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < splashrad2) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 6000)));
}
}
i++;
}
}
if (this.targ.health <= 0) {
this.targ.isDead = 1;
}
this.removeMovieClip();
}
}
};
}
function checkkill() {
n = 0;
while (n < _root.creepArray.length) {
if ((_root.creepArray[n].health <= 0) || (_root.creepArray[n] == "undefined")) {
_root.kills++;
_root.aftereffect.duplicateMovieClip("aftereffect" + _root.effectcount, 50000 + _root.effectcount);
_root["aftereffect" + _root.effectcount]._x = _root.creepArray[n]._x;
_root["aftereffect" + _root.effectcount]._y = _root.creepArray[n]._y;
_root.effectcount++;
if (_root.effectcount > 50) {
_root.effectcount = 1;
}
if (((_root.creepArray[n].gold != "undefined") && (_root.creepArray[n].gold != "null")) && (_root.creepArray[n].gold > 0)) {
_root.gold = _root.gold + _root.creepArray[n].gold;
_root.score = _root.score + _root.creepArray[n].maxhealth;
}
_root.creepArray[n].removeMovieClip();
_root.creepArray.splice(n, 1);
}
n++;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
function kill(creep) {
_root.kills++;
if (_root.kills >= _root.waves[_root.wave - 1][0]) {
_root.kills = 0;
_root.newLevel();
}
creep.onEnterFrame = function () {
this.removeMovieClip();
};
}
function upgrade() {
a = _root.selectedTower;
b = a.tier - 1;
if (int(a.upgrades[b][1]) <= _root.gold) {
a.damage = int(a.upgrades[b][2]);
a.range = a.upgrades[b][3];
a.rate = a.upgrades[b][4];
a.splash = a.upgrades[b][5];
a.slow = a.upgrades[b][6];
a.cost = a.cost + int(a.upgrades[b][1]);
a.tier++;
_root.towerInfo(a);
_root.gold = _root.gold - int(a.upgrades[b][1]);
updateInfoBar();
}
}
function sell() {
tower = _root.selectedTower;
if (((tower != "undefined") && (tower != "null")) && (tower != "")) {
sellprice = Math.floor(tower.cost * 0.85);
if (sellprice != "undefined") {
_root.gold = _root.gold + sellprice;
}
_root.range._x = 1000;
_root.range._height = 0;
_root.range._width = 0;
if (tower.maxtier == 2) {
_root.gems++;
}
tower.removeMovieClip();
_root.UpgradeTowerInfo._visible = false;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
stop();
_root.skillstats.swapDepths(9090);
_root.skillstats.removeMovieClip();
_root.challengescore._x = 2000;
_root.challengescore._y = 2000;
_root.levelwin = 0;
_root.gold = 100;
_root.gems = _global.gems;
_root.attackskill = _global.attackskill;
_root.rangeskill = _global.rangeskill;
_root.killbounty = _global.killbounty;
_root.techlevel = _global.techlevel;
if (_global.startmoneylevel == 1) {
_root.gold = 150;
} else if (_global.startmoneylevel == 2) {
_root.gold = 200;
} else if (_global.startmoneylevel == 3) {
_root.gold = 250;
} else if (_global.startmoneylevel == 4) {
_root.gold = 400;
} else if (_global.startmoneylevel == 5) {
_root.gold = 600;
}
_root.wave = 0;
_root.levelnew = 1;
_root.effectcount = 1;
_root.staticcount = 1;
_root.shockct = 1;
_root.gameover = 0;
_root.towerCount = 0;
_root.creepcount = 1;
_root.goldeffectct = 1;
_root.kills = 0;
_root.pauses = 0;
_root.creepleaks = 0;
_root.timer = 45;
_root.lives = 20;
_root.goldworth = 0;
_root.creepArray = [];
_global.sound = 1;
_root.particlecount = 1;
_root.splashct = 1;
_root.pwncount = 1;
_root.explodecount = 1;
_root.score = 0;
_root.playsound = new Sound(this);
_root.playsound.attachSound("music");
if (_global.sound == 1) {
_root.playsound.start(0, 100000);
}
_root.playsound1 = new Sound(this);
_root.playsound1.attachSound("sndplasma");
_root.playsound2 = new Sound(this);
_root.playsound2.attachSound("sndrocket");
_root.playsound3 = new Sound(this);
_root.playsound3.attachSound("sndbullet");
_root.playsound4 = new Sound(this);
_root.playsound4.attachSound("sndbullet1");
_root.playsound5 = new Sound(this);
_root.playsound5.attachSound("sndexplode");
_root.playsound6 = new Sound(this);
_root.playsound6.attachSound("sndlaser");
_global.maxwaves = 60;
_root.wavemax = _global.maxwaves;
_root.waves = [[20, 110, 3.75, 667], [20, 129, 4.5, 600], [20, 151, 2.75, 400], [20, 176, 3.75, 667], [20, 207, 4.05, 600], [20, 241, 3.75, 667], [20, 282, 1.5, 266], [2, 1050, 5.25, 600], [20, 387, 3, 667], [20, 453, 3.75, 117], [20, 531, 3, 667], [20, 621, 2.75, 400], [20, 727, 3, 650], [20, 850, 5, 700], [20, 996, 3.25, 550], [2, 5800, 2.75, 800], [20, 1363, 3.75, 600], [20, 1594, 4, 700], [20, 1865, 4.25, 650], [20, 2182, 3.5, 580], [20, 2559, 3.25, 100], [20, 3000, 3.4, 525], [20, 3517, 2.8, 475], [20, 4124, 3, 600], [2, 18600, 3.141592, 620], [20, 5670, 3.5, 650], [20, 6648, 4, 700], [20, 7795, 3.3, 600], [20, 9140, 3.4, 130], [20, 10654, 3.12, 550], [20, 12593, 3.3, 600], [20, 14796, 3.2, 570], [2, 64000, 2.5, 800], [20, 20428, 3, 600], [20, 24004, 3.15, 577], [20, 28204, 3.2, 500], [20, 33141, 3.35, 600], [20, 38941, 3.4, 620], [20, 45755, 3.5, 630], [20, 53762, 3.75, 130], [20, 63439, 3, 700], [20, 74858, 3.2, 650], [20, 88333, 3.3, 660], [20, 104233, 3.4, 675], [20, 122995, 3.5, 690], [20, 145134, 4, 800], [20, 171258, 3, 650], [20, 20285, 3.5, 700], [2, 1151680, 4, 1000], [20, 281383, 3.5, 110], [20, 337660, 3.4, 600], [20, 405192, 3.33, 590], [20, 486232, 4.5, 750], [20, 583477, 4, 700], [20, 700137, 3.4, 150], [20, 840208, 3.6, 625], [2, 5100000, 3.7, 700], [20, 1209899, 3.8, 710], [20, 1451880, 4, 250], [20, 1742256, 5, 700]];
_root.nowhp = 0;
_root.nowspeed = 0;
_root.nexthp = _root.waves[0][1];
_root.nextspeed = 2.5;
Instance of Symbol 228 MovieClip "wp1" in Frame 27
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp2" in Frame 27
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp3" in Frame 27
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp4" in Frame 27
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp5" in Frame 27
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp6" in Frame 27
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp7" in Frame 27
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp8" in Frame 27
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp9" in Frame 27
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp10" in Frame 27
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp11" in Frame 27
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp12" in Frame 27
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp13" in Frame 27
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp14" in Frame 27
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 236 MovieClip in Frame 27
on (press) {
_root.marker.active = 1;
_root.marker.tower = "basic";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Tower. Shoots bullets at enemies. 80 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 238 MovieClip in Frame 27
on (press) {
_root.marker.active = 1;
_root.marker.tower = "splash";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Splash Tower. Shoots Exploding bullets at enemies. 29 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 240 MovieClip in Frame 27
on (press) {
_root.marker.active = 1;
_root.marker.tower = "slow";
_root.marker.cost = 150;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Slow Tower. Shoots shots that slow the enemy. 100 base damage. Cost: $150";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 242 MovieClip in Frame 27
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "poison";
_root.marker.cost = 500;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Splash Poison Tower. Splashes Poison(150/sec for level 1) to hurt the enemy. 300 base damage. Cost: $500, tech level 1 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 244 MovieClip in Frame 27
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "static";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Static tower. 6% chance to make target take 50% of the damage that is has lost so far. 500 base damage. Cost: $650. Tech level 1.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 246 MovieClip in Frame 27
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "shock";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Shock tower. Has the ability to random stun any enemy within its radius. Enemies cannot be stunned if already under effect of stun. 500 base damage. Cost: $1000. Tech level 4 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 248 MovieClip in Frame 27
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "stun";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Stun Tower. Has a 10% chance of stunning enemies. 500 base damage. Cost: $700. Requires Tech level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 252 MovieClip in Frame 27
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "death";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Instant death tower. 8% chance to instantly kill if target is under 35% HP. 500 base damage. Cost: $650. Tech Level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 254 MovieClip in Frame 27
on (press) {
if (_root.techlevel >= 2) {
_root.marker.active = 1;
_root.marker.tower = "money";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Money Tower. Has a 5% chance of stealing money from creeps it hits at level 1. 500 Damage. Cost: $700. Tech Level 2.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 256 MovieClip in Frame 27
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "explode";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Exploding Tower. Damages and slows all enemies in a radius of itself. 500 base damage. Cost: $1000. Tech Level 4.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 258 MovieClip in Frame 27
on (press) {
if (_root.gems > 0) {
if (_root.techlevel >= 5) {
_root.marker.active = 1;
_root.marker.tower = "ultimate";
_root.marker.cost = 20000;
_root.tinfo._visible = false;
}
}
}
on (rollOver) {
_root.buyinfo = "Ultimate Tower. Extreme Damage and splash. 100000 damage. Cost: $20000 and 1 Gem. Tech level 5 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 236 MovieClip "tower_basic" in Frame 27
onClipEvent (load) {
title = "Basic Damage Tower";
desc = "Basic Damage Tower";
cost = 50;
this.range = 65 * (1 + (0.05 * _global.rangeskill));
this.range2 = 66 * (1 + (0.05 * _global.rangeskill));
this.range3 = 67 * (1 + (0.05 * _global.rangeskill));
this.range4 = 68 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 80;
damage = 80 * (1 + (0.05 * _global.attackskill));
this.damage2 = 240 * (1 + (0.05 * _global.attackskill));
this.damage3 = 720 * (1 + (0.05 * _global.attackskill));
this.damage4 = 2160 * (1 + (0.05 * _global.attackskill));
rate = 19;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 240\rRange: 66\rCooldown: 18\rEffect: None", 120, this.damage2, this.range2, 18], ["Damage: 720\rRange: 67\rCooldown: 17\rEffect: None", 300, this.damage3, this.range3, 17], ["Damage: 2160\rRange: 68\rCooldown: 17\rEffect: None", 880, this.damage4, this.range4, 17]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_basic")) {
if (target == undefined) {
target = 0;
}
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 264 MovieClip "range" in Frame 27
onClipEvent (enterFrame) {
if ((_root.selectedTower == "") && (_root.marker.active == 0)) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 267 MovieClip "marker" in Frame 27
onClipEvent (load) {
active = 0;
inpath = 0;
this.swapDepths(9998);
}
onClipEvent (enterFrame) {
if (active == 1) {
this.startDrag(true);
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((maphit == 1) && (inpath == 0)) {
this.gotoAndStop(1);
_root.range.gotoAndStop(1);
} else {
this.gotoAndStop(2);
_root.range.gotoAndStop(2);
}
_root.range._x = _x;
_root.range._y = _y;
_root.range._width = _root["tower_" + tower].range * 2;
_root.range._height = _root["tower_" + tower].range * 2;
}
if (Key.isDown(32)) {
active = 0;
trace(1);
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
on (press) {
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((((maphit == 1) && (inpath == 0)) && (_root.gold >= this.cost)) && (_root.pauses == 0)) {
if (this.hitTest(_root.nextwave) == false) {
if (_root.marker.tower == "ultimate") {
if (_root.gems > 0) {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gems--;
_root.gold = _root.gold - this.cost;
}
} else {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gold = _root.gold - this.cost;
}
}
}
if (maphit == 0) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
if (this.hitTest(_root.nextwave)) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
Instance of Symbol 238 MovieClip "tower_splash" in Frame 27
onClipEvent (load) {
title = "Splash Tower";
desc = "Splash Tower";
cost = 50;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 73 * (1 + (0.05 * _global.rangeskill));
this.range4 = 75 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 34 * (1 + (0.05 * _global.attackskill));
this.damage2 = 102 * (1 + (0.05 * _global.attackskill));
this.damage3 = 306 * (1 + (0.05 * _global.attackskill));
this.damage4 = 918 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 102\rRange: 72\rCooldown: 21\rEffect: Splash", 120, this.damage2, this.range2, 21], ["Damage: 306\rRange: 73\rCooldown: 21\rEffect: Splash", 300, this.damage3, this.range3, 21], ["Damage: 918\rRange: 75\rCooldown: 20\rEffect: Splash", 880, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_splash")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > ((range * range) + 81)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 289 MovieClip "explosion" in Frame 27
onClipEvent (load) {
if (this._name == "explosion") {
this._visible = false;
}
}
Instance of Symbol 240 MovieClip "tower_slow" in Frame 27
onClipEvent (load) {
title = "Slow tower";
desc = "Slow tower";
cost = 150;
this.range = 68 * (1 + (0.05 * _global.rangeskill));
this.range2 = 69 * (1 + (0.05 * _global.rangeskill));
this.range3 = 70 * (1 + (0.05 * _global.rangeskill));
this.range4 = 71 * (1 + (0.05 * _global.rangeskill));
this.range5 = 72 * (1 + (0.05 * _global.rangeskill));
damage = 100 * (1 + (0.05 * _global.attackskill));
this.damage2 = 500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2200 * (1 + (0.05 * _global.attackskill));
this.damage4 = 10500 * (1 + (0.05 * _global.attackskill));
this.damage5 = 33000 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 500\rRange: 69\rCooldown: 22\rEffect: Slow", 500, this.damage2, this.range2, 22], ["Damage: 2200\rRange: 70\rCooldown: 21\rEffect: Slow", 1250, this.damage3, this.range3, 21], ["Damage: 10500\rRange: 71\rCooldown: 21\rEffect: Slow", 3150, this.damage4, this.range4, 21], ["Damage: 33000\rRange: 72\rColldown:19\rEffect: Slow", 8000, this.damage5, this.range5, 19]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_slow")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 314 MovieClip in Frame 27
on (press) {
_root.marker.active = 1;
_root.marker.tower = "rust";
_root.marker.cost = 400;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Rust Tower. Shoots shots that rust the enemy, causing them to take more damage. 300 base damage. Ultra Fast. Cost: $400";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 314 MovieClip "tower_rust" in Frame 27
onClipEvent (load) {
title = "Rust Tower";
desc = "Rust Tower";
cost = 400;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range5 = 80 * (1 + (0.05 * _global.rangeskill));
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 930 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 5000 * (1 + (0.05 * _global.attackskill));
this.damage5 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 9;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 930\rRange: 76\rCooldown: 9\rEffect: Rust", 1200, this.damage2, this.range2, 9], ["Damage: 2000\rRange: 77\rCooldown: 8\rEffect: Rust", 3000, this.damage3, this.range3, 8], ["Damage: 5000\rRange: 78\rCooldown: 8\rEffect: Rust", 6000, this.damage4, this.range4, 8], ["Damage: 15000\rRange: 80\rCooldown: 7\rEffect:Rust", 13500, this.damage5, this.range5, 7]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 242 MovieClip "tower_poison" in Frame 27
onClipEvent (load) {
title = "Splash Poison";
desc = "Splash Poison";
cost = 500;
this.range = 70;
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 75 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 12000 * (1 + (0.05 * _global.attackskill));
rate = 23;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 72\rCooldown: 22\rEffect:Poison(600)", 1500, this.damage2, this.range2, 22], ["Damage: 4000\rRange: 75\rCooldown: 21\rEffect:Poison(2700)", 5000, this.damage3, this.range3, 21], ["Damage: 12000\rRange:78\rCooldown: 20\rEffect:Poison(10000)", 11500, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 244 MovieClip "tower_static" in Frame 27
onClipEvent (load) {
title = "Static";
desc = "Static";
cost = 500;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 80 * (1 + (0.05 * _global.rangeskill));
this.range4 = 85 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 25;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 77\rCooldown: 24\rEffect:Static(7)", 1500, this.damage2, this.range2, 24], ["Damage: 4000\rRange: 80\rCooldown: 23\rEffect:Static(10)", 5000, this.damage3, this.range3, 23], ["Damage: 15000\rRange: 85\rCooldown:22\rEffect:Static(12)", 11000, this.damage4, this.range4, 22]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 252 MovieClip "tower_death" in Frame 27
onClipEvent (load) {
title = "Instant Death";
desc = "Instant Death";
cost = 650;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 79 * (1 + (0.05 * _global.rangeskill));
this.range4 = 82 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 650 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 15000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 35000 * (1 + (0.05 * _global.attackskill));
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3000)\rRange: 77\rCooldown: 28\rEffect:Death(12%)", 2000, this.damage2, this.range2, 28], ["Damage: 15000\rRange: 79\rCooldown: 26\rEffect:Death(16%)", 7000, this.damage3, this.range3, 26], ["Damage: 35000\rRange:82\rCooldown: 23 \rEffect:Death(19%)", 13500, this.damage4, this.range4, 23]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 248 MovieClip "tower_stun" in Frame 27
onClipEvent (load) {
title = "Stun Tower";
desc = "Stun Tower";
cost = 700;
rate = 22;
this.range = 73 * (1 + (0.05 * _global.rangeskill));
this.range2 = 74 * (1 + (0.05 * _global.rangeskill));
this.range3 = 76 * (1 + (0.05 * _global.rangeskill));
this.range4 = 79 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 45000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 74\rCooldown: 22\rEffect:Stun(13%)", 2500, this.damage2, this.range2, 22], ["Damage: 17000\rRange: 76\rCooldown: 21\rEffect:Stun(16%)", 9000, this.damage3, this.range3, 21], ["Damage: 45000\rRange: 79\rCooldown: 20\rEffect:Stun(18%)", 18000, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 254 MovieClip "tower_money" in Frame 27
onClipEvent (load) {
title = "Money Tower";
desc = "Money Tower";
cost = 700;
rate = 25;
this.range = 75;
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 78 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 40000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 76\rCooldown: 24\rEffect:Steal Money(8)", 2500, this.damage2, this.range2, 24], ["Damage: 17000\rRange: 78\rCooldown: 23\rEffect:Steal(9)", 9000, this.damage3, this.range3, 23], ["Damage: 40000\rRange: 80\rCooldown:21\rEffect:Steal(11)", 18000, this.damage4, this.range4, 21]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 256 MovieClip "tower_explode" in Frame 27
onClipEvent (load) {
title = "Explosion";
desc = "Explosion";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 80 * (1 + (0.05 * _global.rangeskill));
this.range2 = 82 * (1 + (0.05 * _global.rangeskill));
this.range3 = 84 * (1 + (0.05 * _global.rangeskill));
this.range4 = 86 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 82\rCooldown: 28\rEffect:Slow", 3000, this.damage2, this.range2, 28], ["Damage: 8000\rRange: 84\rCooldown: 27\rEffect:Slow", 10000, this.damage3, this.range3, 27], ["Damage: 25000\rRange: 86\rCooldown:25\rEffect:Slow", 25000, this.damage4, this.range4, 25]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 336 MovieClip "shockshot" in Frame 27
onClipEvent (enterFrame) {
this._rotation = this._rotation + 30;
}
Instance of Symbol 246 MovieClip "tower_shock" in Frame 27
onClipEvent (load) {
title = "Shock";
desc = "Shock";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 75 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 35;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 75\rCooldown: 33\rEffect:Shock", 3000, this.damage2, this.range2, 33], ["Damage: 8000\rRange: 77\rCooldown: 30\rEffect:Shock", 10000, this.damage3, this.range3, 30], ["Damage: 25000\rRange: 80\rCooldown: 27\rEffect:Shock", 25000, this.damage4, this.range4, 27]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 258 MovieClip "tower_ultimate" in Frame 27
onClipEvent (load) {
title = "Ultimate Tower";
desc = "Ultimate Tower";
cost = 20000;
damage = 100000 * (1 + (0.05 * _global.attackskill));
this.damage2 = 200000 * (1 + (0.05 * _global.attackskill));
this.range = 85 * (1 + (0.05 * _global.rangeskill));
this.range2 = 95 * (1 + (0.05 * _global.rangeskill));
rate = 27;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 2;
upgrades = [["Damage: 200000\rRange: 95\rCooldown: 33\rEffect:Splash", 40000, this.damage2, this.range2, 24]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_ultimate")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 353 MovieClip "UpgradeTowerInfo" in Frame 27
onClipEvent (load) {
_visible = false;
swapDepths(100000);
}
Instance of Symbol 378 MovieClip "creep1" in Frame 27
onClipEvent (load) {
this._rotation = this._rotation + 45;
}
Instance of Symbol 380 MovieClip in Frame 27
onClipEvent (enterFrame) {
if (_root.timer > 50) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 381 MovieClip in Frame 27
onClipEvent (load) {
this._visible = false;
this.startDrag(true);
this.count = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(77) && (_global.sound == 1)) {
_global.sound = 0;
stopAllSounds();
}
if (Key.isDown(78) && (_global.sound == 0)) {
_global.sound = 1;
_root.playsound.start(0, 100000);
}
if (Key.isDown(80) && (_root.pauses == 0)) {
_root.pauses = 1;
}
if (Key.isDown(85) && (_root.pauses == 1)) {
_root.pauses = 0;
}
if (_root.pauses == 0) {
_root.levelnew++;
_root.checkkill();
this.count++;
if ((this.count % 30) == 0) {
_root.timer--;
}
if (_root.timer <= 0) {
if (_root.wave < _global.maxwaves) {
_root.newLevel();
}
_root.timer = 60;
}
if ((_root.lives <= 0) && (_root.gameover == 0)) {
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
if (_root.creepArray.length <= 0) {
_root.gotoAndPlay("lose7");
}
}
if (((((_root.wave >= _global.maxwaves) && (_root.creepArray.length <= 0)) && (_root.gameover == 0)) && (_root.kills >= 20)) && (_root.levelnew > 120)) {
_root.levelwin = 1;
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
_root.gotoAndPlay("win7");
}
}
}
Instance of Symbol 387 MovieClip "tinfo" in Frame 27
onClipEvent (load) {
this.swapDepths(99999);
}
Instance of Symbol 421 MovieClip "quitbox" in Frame 27
onClipEvent (load) {
this._visible = false;
}
Frame 28
stop();
stopAllSounds();
Frame 29
stop();
_root.gameover = 1;
stopAllSounds();
if (_root.levelwin == 0) {
_root.gotoAndPlay("lose7");
}
if (_root.lives == 20) {
_root.skillgained = 3;
} else {
_root.skillgained = 2;
}
storedskills = SharedObject.getLocal("flashskill");
if (storedskills.data.level7gain == undefined) {
_global.xpleft = _global.xpleft + _root.skillgained;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level7gain = _root.skillgained;
} else {
xplast = storedskills.data.level7gain;
skilldifferent = _root.skillgained - xplast;
if (skilldifferent > 0) {
_global.xpleft = _global.xpleft + skilldifferent;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level7gain = storedskills.data.level7gain + skilldifferent;
}
}
if ((storedskills.data.maxlevelbeat < 7) || (storedskills.data.maxlevelbeat == undefined)) {
storedskills.data.maxlevelbeat = 7;
}
if ((storedskills.data.level7score == undefined) || (_root.score > storedskills.data.level7score)) {
storedskills.data.level7score = _root.score;
}
Frame 30
function TowerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
}
function towerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
_root.UpgradeTowerInfo._visible = true;
if (tower.maxtier >= tower.tier) {
_root.UpgradeTowerInfo.UpgradeInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 1][2]) + "\rRange: ") + tower.upgrades[tower.tier - 1][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 1][4]) + "\rEffect: ") + tower.desc;
if (tower.tier == 1) {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.damage) + "\rRange: ") + tower.range) + "\rCoolDown: ") + tower.rate) + "\rEffect: ") + tower.desc;
} else {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 2][2]) + "\rRange: ") + tower.upgrades[tower.tier - 2][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 2][4]) + "\rEffect: ") + tower.desc;
}
_root.UpgradeTowerInfo.UpgradeButton.UpgradeButtonText.text = ("Upgrade [$" + tower.upgrades[tower.tier - 1][1]) + "]";
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
sellprice = Math.floor(tower.cost * 0.85);
_root.UpgradeTowerInfo.sellbutton.UpgradeButtonText.text = ("Sell [$" + sellprice) + "]";
if (tower.maxtier > tower.tier) {
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
} else {
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
}
} else {
_root.UpgradeTowerInfo.f.text = "";
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
_root.UpgradeTowerInfo.h.text = "";
}
}
function newLevel() {
if (_root.wave < 59) {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.02 * _root.gold);
_root.nowspeed = _root.waves[_root.wave - 1][2];
_root.nextspeed = _root.waves[_root.wave][2];
_root.nowhp = _root.waves[_root.wave - 1][1];
_root.nexthp = _root.waves[_root.wave][1];
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = _root.goldworth * 1.7;
_root.goldworth = _root.goldworth * (1 + (0.05 * _global.killbounty));
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", _root.waves[_root.wave - 1][3], _root.wave, "creep1", _root.waves[_root.wave - 1][2], _root.waves[_root.wave - 1][1], _root.goldworth);
_root["spawned" + _root.wave] = _root.waves[_root.wave - 1][0];
} else {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.03 * _root.gold);
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = Math.floor(_root.goldworth);
_root.goldworth = _root.goldworth * 1.2;
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
randspeed = 1.25;
_root.nowspeed = randspeed;
_root.nextspeed = "???";
wavessince = _root.wave - 60;
hpmultiplier = Math.pow(1.2, wavessince);
_root.nowhp = Math.floor(_root.waves[59][1] * hpmultiplier);
_root.nexthp = Math.floor(_root.nowhp * 1.2);
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", 50, _root.wave, "creep1", _root.nowspeed, _root.nowhp, _root.goldworth);
_root["spawned" + _root.wave] = 30;
}
}
function spawn(level, creep, speed, health, gold) {
if (_root["spawned" + level] == 0) {
clearInterval(_root["spawnInterval" + level]);
} else {
_root["spawned" + level]--;
playanim = (level % 5) + 1;
_root.creepcount++;
_root[creep].duplicateMovieClip("c" + _root.creepcount, 20000 + _root.creepcount);
if (_root.creepcount > 10000) {
_root.creepcount = 1;
}
c = _root["c" + _root.creepcount];
c.creep.gotoAndStop(playanim);
c._x = _root.wp1._x;
c._y = _root.wp1._y;
c.health = health;
c.slowcount = 1;
c.isslow = 0;
c.maxhealth = health;
c.speed = speed;
c.maxspeed = c.speed;
c.ispoisoned = 0;
c.poisonedlevel = 0;
c.poisoncount = 0;
c.fullmax = c.maxspeed;
c.targ = 2;
c.rnd = 5;
c.shocked = 0;
c.shockcount = 1;
c.gold = gold;
c.iscorrode = 0;
c.isstunned = 0;
c.stuncount = 1;
c.splashslowed = 0;
c.splashslowedcount = 1;
_root.creepArray[_root.creepArray.length] = c;
c.onEnterFrame = function () {
if (_root.pauses == 0) {
this.health_bar.health._width = 30 * (this.health / this.maxhealth);
this.targX = (_root["wp" + this.targ]._x - 5) + this.rnd;
this.targY = (_root["wp" + this.targ]._y - 5) + this.rnd;
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this.rads = (this.dir * 3.141593) / 180;
if ((this.isstunned != 0) || (this.shocked == 1)) {
this.stuncount++;
if ((this.stuncount % 2) == 1) {
this._x = this._x + 2;
} else {
this._x = this._x - 2;
}
}
if (this.stuncount > 160) {
this.isstunned = 0;
this.stuncount = 1;
}
if (this.isslow != 0) {
this.speed = this.isslow * this.fullmax;
this.slowcount++;
}
if (this.slowcount > 160) {
this.speed = this.fullmax;
this.isslow = 0;
this.slowcount = 1;
}
if (this.splashslowed != 0) {
this.fullmax = this.maxspeed * this.splashslowed;
this.speed = this.fullmax;
if (this.isslow != 0) {
this.speed = this.fullmax * this.isslow;
}
this.splashslowedcount++;
}
if (this.splashslowedcount > 100) {
this.splashslowed = 0;
this.fullmax = this.maxspeed;
this.speed = this.fullmax;
this.splashslowedcount = 1;
}
if (this.iscorrode != 0) {
this.corrodecount++;
}
if (this.corrodecount > 200) {
this.iscorrode = 0;
this.corrdecount = 1;
}
if (this.ispoisoned == 1) {
if ((this.poisoncount % 40) == 0) {
this.health = this.health - this.poisonedlevel;
}
this.poisoncount++;
}
if (this.shocked == 1) {
this.shockcount++;
}
if (this.shockcount >= 80) {
this.shocked = 0;
this.shockcount = 1;
}
if (this.poisoncount > 200) {
this.ispoisoned = 0;
this.poisoncount = 0;
}
if ((this.isstunned == 0) && (this.shocked == 0)) {
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
}
d = Math.pow(this._x - this.targX, 2) + Math.pow(this._y - this.targY, 2);
if (d < 25) {
this.targ++;
if (this.targ > 14) {
_root.leak(this);
this._x = _root.wp1._x;
this._y = _root.wp1._y;
this.targ = 2;
}
}
this.r = this.dir;
if ((this._rotation + 10) < this.r) {
this._rotation = this._rotation + 10;
} else if ((this._rotation - 10) > this.r) {
this._rotation = this._rotation - 10;
} else {
this._rotation = r;
}
}
};
}
}
function fire(from, to, speed, acc, maxpeed, projectile, damage, towerid) {
_root.particlecount++;
_root[projectile].duplicateMovieClip("p" + _root.particlecount, 2000 + _root.particlecount);
r = _root["p" + _root.particlecount];
r._x = from._x;
r._y = from._y;
r.tier = from.tier;
r.type = from.type;
r.targ = to;
r.speed = speed;
r.acc = acc;
r.maxspeed = maxspeed;
r.damage = damage;
r.projectile = projectile;
r.towerid = towerid;
if (_root.particlecount > 300) {
_root.particlecount = 0;
}
r.onEnterFrame = function () {
if (_root.pauses == 0) {
if (("" + this.targ) != "") {
this.targX = this.targ._x;
this.targY = this.targ._y;
} else {
this._rotation = (Math.atan2(this.targ._y - this._y, this.targ._x - this._x) * 180) / 3.141593;
if (_root.creepArray.length <= 0) {
this.removeMovieClip();
} else {
w = 0;
if (w <= _root.creepArray.length) {
this.targ = _root.creepArray[w];
}
}
}
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this._rotation = this.dir + 90;
this.rads = (this.dir * 3.141593) / 180;
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
if (this.speed < this.maxspeed) {
this.speed = this.speed + this.acc;
}
d = ((this._x - this.targX) * (this._x - this.targX)) + ((this._y - this.targY) * (this._y - this.targY));
if (d < 25) {
if (this.towerid == 10) {
randcrit = random(100);
if ((this.tier == 1) && (randcrit < 11)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 2) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 3) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 4) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 5) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
} else if (this.towerid == 4) {
this.targ.corrodecount = 1;
if (this.tier == 1) {
this.targ.iscorrode = 0.06;
} else if (this.tier == 2) {
this.targ.iscorrode = 0.12;
} else if (this.tier == 3) {
this.targ.iscorrode = 0.2;
} else if (this.tier == 4) {
this.targ.iscorrode = 0.32;
} else if (this.tier == 5) {
this.targ.iscorrode = 0.45;
}
}
this.targ.health = this.targ.health - (this.damage * (1 + this.targ.iscorrode));
if (this.towerid == 7) {
randstun = random(100);
if ((this.tier == 1) && (randstun < 10)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 2) && (randstun < 14)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 3) && (randstun < 17)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 4) && (randstun < 20)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
}
} else if (this.towerid == 5) {
this.targ.ispoisoned = 1;
this.targ.poisoncount = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < 4225) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[i].ispoisoned = 1;
_root.creepArray[i].poisoncount = 1;
}
i++;
}
if (this.tier == 1) {
this.targ.poisonedlevel = 150;
} else if (this.tier == 2) {
this.targ.poisonedlevel = 600;
} else if (this.tier == 3) {
this.targ.poisonedlevel = 2700;
} else if (this.tier == 4) {
this.targ.poisonedlevel = 10000;
}
_root.poisonball.duplicateMovieClip("poisonball" + _root.splashct, 6300 + _root.splashct);
_root["poisonball" + _root.splashct]._x = this._x;
_root["poisonball" + _root.splashct]._y = this._y;
_root["poisonball" + _root.splashct]._width = 80;
_root["poisonball" + _root.splashct]._height = 80;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 6) {
if (this.targ.health < (0.35 * this.targ.maxhealth)) {
randdeath = random(100);
if ((this.tier == 1) && (randdeath < 8)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 2) && (randdeath < 12)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 3) && (randdeath < 16)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 4) && (randdeath < 20)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
}
}
} else if (this.towerid == 8) {
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < 10000) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
if (this.tier == 1) {
_root.creepArray[k].splashslowed = 0.6;
} else if (this.tier == 2) {
_root.creepArray[k].splashslowed = 0.55;
} else if (this.tier == 3) {
_root.creepArray[k].splashslowed = 0.5;
} else if (this.tier == 4) {
_root.creepArray[k].splashslowed = 0.4;
}
_root.creepArray[k].splashslowedcount = 0;
}
k++;
}
_root.explodingshot.duplicateMovieClip("explodingshot" + _root.explodecount, 5100 + _root.explodecount);
_root["explodingshot" + _root.explodecount]._x = this._x;
_root["explodingshot" + _root.explodecount]._y = this._y;
_root.explodecount++;
if (_root.explodecount > 20) {
_root.explodecount = 1;
}
} else if (this.towerid == 26) {
if (this.tier == 1) {
shockwidth = 75;
shockchance = 8;
} else if (this.tier == 2) {
shockwidth = 80;
shockchance = 10;
} else if (this.tier == 3) {
shockwidth = 85;
shockchance = 12;
} else if (this.tier == 4) {
shockwidth = 90;
shockchance = 14;
}
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < (shockwidth * shockwidth)) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
shockper = random(100);
if (shockper < shockchance) {
if (_root.creepArray[k].shocked == 0) {
_root.creepArray[k].shocked = 1;
_root.creepArray[k].splashslowedcount = 1;
}
}
}
k++;
}
_root.shockshot.duplicateMovieClip("shockshot" + _root.shockct, 26500 + _root.shockct);
_root["shockshot" + _root.shockct]._x = this._x;
_root["shockshot" + _root.shockct]._y = this._y;
_root["shockshot" + _root.shockct]._width = 2 * shockwidth;
_root["shockshot" + _root.shockct]._height = 2 * shockwidth;
_root.shockct++;
if (_root.shockct > 20) {
_root.shockct = 1;
}
} else if (this.towerid == 22) {
if (this.tier == 1) {
staticval = 5;
} else if (this.tier == 2) {
staticval = 7;
} else if (this.tier == 3) {
staticval = 10;
}
staticchance = random(100);
if (staticchance < staticval) {
damagetaken = this.targ.maxhealth - this.targ.health;
(this.health - this.health) - (0.5 * damagetaken);
_root.lighteffect.duplicateMovieClip("lighteffect" + _root.staticcount, 23000 + _root.staticcount);
_root["lighteffect" + _root.staticcount]._x = this._x;
_root["lighteffect" + _root.staticcount]._y = this._y;
_root.staticcount++;
if (_root.staticcount > 50) {
_root.staticcount = 1;
}
}
} else if (this.towerid == 25) {
stealval = random(100);
if (this.tier == 1) {
this.stealmax = 6;
} else if (this.tier == 2) {
this.stealmax = 9;
} else if (this.tier == 3) {
this.stealmax = 10;
} else if (this.tier == 4) {
this.stealmax = 12;
}
if (stealval < this.stealmax) {
_root.gold = _root.gold + this.targ.gold;
_root.goldeffect.duplicateMovieClip("goldeffect" + _root.goldeffectct, 26000 + _root.goldeffectct);
_root["goldeffect" + _root.goldeffectct]._x = this._x;
_root["goldeffect" + _root.goldeffectct]._y = this._y;
_root.goldeffectct++;
if (_root.goldeffectct > 20) {
_root.goldeffectct = 1;
}
}
} else if (this.towerid == 999) {
if (this.targ.health < (0.65 * this.targ.maxhealth)) {
randteleport = random(100);
if ((this.tier == 1) && (randteleport < 8)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
_root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 2) && (randteleport < 9)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 3) && (randteleport < 10)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 4) && (randteleport < 11)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 5) && (randteleport < 13)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
}
}
} else if (this.towerid == 100) {
if (this.tier == 1) {
spradius = 1225;
spwidth = 35;
} else if (this.tier == 2) {
spradius = 1600;
spwidth = 40;
} else if (this.tier == 3) {
spradius = 2025;
spwidth = 45;
} else if (this.tier == 4) {
spradius = 2500;
spwidth = 50;
} else if (this.tier == 5) {
spradius = 3600;
spwidth = 60;
}
j = 0;
while (j <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[j]._x, 2) + Math.pow(this._y - _root.creepArray[j]._y, 2);
if (d < spradius) {
if ((("" + _root.creepArray[j]) != "") && (_root.creepArray[j] != this.targ)) {
_root.creepArray[j].health = _root.creepArray[j].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[j].splashslowed = 1;
_root.creepArray[j].splashslowedcount = 1;
}
j++;
}
_root.iceball.duplicateMovieClip("iceball" + _root.splashct, 5200 + _root.splashct);
_root["iceball" + _root.splashct]._x = this._x;
_root["iceball" + _root.splashct]._y = this._y;
_root["iceball" + _root.splashct]._width = spwidth;
_root["iceball" + _root.splashct]._height = spwidth;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 3) {
if (this.tier == 1) {
this.targ.isslow = 0.6;
}
if (this.tier == 2) {
this.targ.isslow = 0.5;
}
if (this.tier == 3) {
this.targ.isslow = 0.4;
}
if (this.tier == 4) {
this.targ.isslow = 0.35;
}
if (this.tier == 5) {
this.targ.isslow = 0.3;
}
this.targ.slowcount = 1;
} else if (this.towerid == 2) {
_root.explosion.duplicateMovieClip("explosion" + _root.explosioncount, 5000 + _root.explosioncount);
_root["explosion" + _root.explosioncount]._x = this._x;
_root["explosion" + _root.explosioncount]._y = this._y;
_root["explosion" + _root.explosioncount]._width = 100;
_root["explosion" + _root.explosioncount]._height = 100;
_root.explosioncount++;
if (_root.explosioncount > 40) {
_root.explosioncount = 1;
}
splashrad = 50;
splashrad2 = splashrad * splashrad;
i = 0;
while (i <= _root.creepArray.length) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < splashrad2) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 6000)));
}
}
i++;
}
}
if (this.targ.health <= 0) {
this.targ.isDead = 1;
}
this.removeMovieClip();
}
}
};
}
function checkkill() {
n = 0;
while (n < _root.creepArray.length) {
if ((_root.creepArray[n].health <= 0) || (_root.creepArray[n] == "undefined")) {
_root.kills++;
_root.aftereffect.duplicateMovieClip("aftereffect" + _root.effectcount, 50000 + _root.effectcount);
_root["aftereffect" + _root.effectcount]._x = _root.creepArray[n]._x;
_root["aftereffect" + _root.effectcount]._y = _root.creepArray[n]._y;
_root.effectcount++;
if (_root.effectcount > 50) {
_root.effectcount = 1;
}
if (((_root.creepArray[n].gold != "undefined") && (_root.creepArray[n].gold != "null")) && (_root.creepArray[n].gold > 0)) {
_root.gold = _root.gold + _root.creepArray[n].gold;
_root.score = _root.score + _root.creepArray[n].maxhealth;
}
_root.creepArray[n].removeMovieClip();
_root.creepArray.splice(n, 1);
}
n++;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
function kill(creep) {
_root.kills++;
if (_root.kills >= _root.waves[_root.wave - 1][0]) {
_root.kills = 0;
_root.newLevel();
}
creep.onEnterFrame = function () {
this.removeMovieClip();
};
}
function upgrade() {
a = _root.selectedTower;
b = a.tier - 1;
if (int(a.upgrades[b][1]) <= _root.gold) {
a.damage = int(a.upgrades[b][2]);
a.range = a.upgrades[b][3];
a.rate = a.upgrades[b][4];
a.splash = a.upgrades[b][5];
a.slow = a.upgrades[b][6];
a.cost = a.cost + int(a.upgrades[b][1]);
a.tier++;
_root.towerInfo(a);
_root.gold = _root.gold - int(a.upgrades[b][1]);
updateInfoBar();
}
}
function sell() {
tower = _root.selectedTower;
if (((tower != "undefined") && (tower != "null")) && (tower != "")) {
sellprice = Math.floor(tower.cost * 0.85);
if (sellprice != "undefined") {
_root.gold = _root.gold + sellprice;
}
_root.range._x = 1000;
_root.range._height = 0;
_root.range._width = 0;
if (tower.maxtier == 2) {
_root.gems++;
}
tower.removeMovieClip();
_root.UpgradeTowerInfo._visible = false;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
stop();
_root.skillstats.swapDepths(9090);
_root.skillstats.removeMovieClip();
_root.challengescore._x = 2000;
_root.challengescore._y = 2000;
_root.levelwin = 0;
_root.gold = 100;
_root.gems = _global.gems;
_root.attackskill = _global.attackskill;
_root.rangeskill = _global.rangeskill;
_root.killbounty = _global.killbounty;
_root.techlevel = _global.techlevel;
if (_global.startmoneylevel == 1) {
_root.gold = 150;
} else if (_global.startmoneylevel == 2) {
_root.gold = 200;
} else if (_global.startmoneylevel == 3) {
_root.gold = 250;
} else if (_global.startmoneylevel == 4) {
_root.gold = 400;
} else if (_global.startmoneylevel == 5) {
_root.gold = 600;
}
_root.wave = 0;
_root.levelnew = 1;
_root.effectcount = 1;
_root.staticcount = 1;
_root.shockct = 1;
_root.gameover = 0;
_root.towerCount = 0;
_root.creepcount = 1;
_root.goldeffectct = 1;
_root.kills = 0;
_root.pauses = 0;
_root.creepleaks = 0;
_root.timer = 45;
_root.lives = 20;
_root.goldworth = 0;
_root.creepArray = [];
_global.sound = 1;
_root.particlecount = 1;
_root.splashct = 1;
_root.pwncount = 1;
_root.explodecount = 1;
_root.score = 0;
_root.playsound = new Sound(this);
_root.playsound.attachSound("music");
if (_global.sound == 1) {
_root.playsound.start(0, 100000);
}
_root.playsound1 = new Sound(this);
_root.playsound1.attachSound("sndplasma");
_root.playsound2 = new Sound(this);
_root.playsound2.attachSound("sndrocket");
_root.playsound3 = new Sound(this);
_root.playsound3.attachSound("sndbullet");
_root.playsound4 = new Sound(this);
_root.playsound4.attachSound("sndbullet1");
_root.playsound5 = new Sound(this);
_root.playsound5.attachSound("sndexplode");
_root.playsound6 = new Sound(this);
_root.playsound6.attachSound("sndlaser");
_global.maxwaves = 60;
_root.wavemax = _global.maxwaves;
_root.waves = [[20, 110, 3.75, 667], [20, 129, 4.5, 600], [20, 151, 2.75, 400], [20, 176, 3.75, 667], [20, 207, 4.05, 600], [20, 241, 3.75, 667], [20, 282, 1.5, 266], [2, 1050, 5.25, 600], [20, 387, 3, 127], [20, 453, 3.75, 667], [20, 531, 3, 667], [20, 621, 2.75, 400], [20, 727, 3, 650], [20, 850, 5, 700], [20, 996, 3.25, 550], [2, 5800, 2.75, 800], [20, 1363, 3.75, 110], [20, 1594, 4, 700], [20, 1865, 4.25, 650], [20, 2182, 3.5, 580], [20, 2559, 3.25, 500], [20, 3000, 3.4, 525], [20, 3517, 2.8, 475], [20, 4124, 3, 600], [2, 18600, 3.141592, 620], [20, 5670, 3.5, 150], [20, 6648, 4, 700], [20, 7795, 3.3, 600], [20, 9140, 3.4, 590], [20, 10654, 3.12, 550], [20, 12593, 3.3, 600], [20, 14796, 3.2, 570], [2, 64000, 2.5, 500], [20, 20428, 3, 150], [20, 24004, 3.15, 577], [20, 28204, 3.2, 500], [20, 33141, 3.35, 600], [20, 38941, 3.4, 620], [20, 45755, 3.5, 630], [20, 53762, 3.75, 670], [20, 63439, 3, 700], [20, 74858, 3.2, 170], [20, 88333, 3.3, 660], [20, 104233, 3.4, 675], [20, 122995, 3.5, 690], [20, 145134, 4, 800], [20, 171258, 3, 650], [20, 20285, 3.5, 110], [2, 1151680, 4, 1000], [20, 281383, 3.5, 700], [20, 337660, 3.4, 600], [20, 405192, 3.33, 590], [20, 486232, 4.5, 200], [20, 583477, 4, 700], [20, 700137, 3.4, 600], [20, 840208, 3.6, 625], [2, 5100000, 3.7, 700], [20, 1209899, 3.8, 710], [20, 1451880, 4, 180], [20, 1742256, 5, 700]];
_root.nowhp = 0;
_root.nowspeed = 0;
_root.nexthp = _root.waves[0][1];
_root.nextspeed = 2.5;
Instance of Symbol 228 MovieClip "wp1" in Frame 30
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp2" in Frame 30
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp3" in Frame 30
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp4" in Frame 30
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp5" in Frame 30
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp6" in Frame 30
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp7" in Frame 30
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp8" in Frame 30
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp9" in Frame 30
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp10" in Frame 30
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp11" in Frame 30
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp12" in Frame 30
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp13" in Frame 30
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp14" in Frame 30
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 236 MovieClip in Frame 30
on (press) {
_root.marker.active = 1;
_root.marker.tower = "basic";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Tower. Shoots bullets at enemies. 80 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 238 MovieClip in Frame 30
on (press) {
_root.marker.active = 1;
_root.marker.tower = "splash";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Splash Tower. Shoots Exploding bullets at enemies. 29 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 240 MovieClip in Frame 30
on (press) {
_root.marker.active = 1;
_root.marker.tower = "slow";
_root.marker.cost = 150;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Slow Tower. Shoots shots that slow the enemy. 100 base damage. Cost: $150";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 242 MovieClip in Frame 30
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "poison";
_root.marker.cost = 500;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Splash Poison Tower. Splashes Poison(150/sec for level 1) to hurt the enemy. 300 base damage. Cost: $500, tech level 1 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 244 MovieClip in Frame 30
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "static";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Static tower. 6% chance to make target take 50% of the damage that is has lost so far. 500 base damage. Cost: $650. Tech level 1.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 246 MovieClip in Frame 30
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "shock";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Shock tower. Has the ability to random stun any enemy within its radius. Enemies cannot be stunned if already under effect of stun. 500 base damage. Cost: $1000. Tech level 4 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 248 MovieClip in Frame 30
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "stun";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Stun Tower. Has a 10% chance of stunning enemies. 500 base damage. Cost: $700. Requires Tech level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 252 MovieClip in Frame 30
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "death";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Instant death tower. 8% chance to instantly kill if target is under 35% HP. 500 base damage. Cost: $650. Tech Level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 254 MovieClip in Frame 30
on (press) {
if (_root.techlevel >= 2) {
_root.marker.active = 1;
_root.marker.tower = "money";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Money Tower. Has a 5% chance of stealing money from creeps it hits at level 1. 500 Damage. Cost: $700. Tech Level 2.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 256 MovieClip in Frame 30
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "explode";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Exploding Tower. Damages and slows all enemies in a radius of itself. 500 base damage. Cost: $1000. Tech Level 4.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 258 MovieClip in Frame 30
on (press) {
if (_root.gems > 0) {
if (_root.techlevel >= 5) {
_root.marker.active = 1;
_root.marker.tower = "ultimate";
_root.marker.cost = 20000;
_root.tinfo._visible = false;
}
}
}
on (rollOver) {
_root.buyinfo = "Ultimate Tower. Extreme Damage and splash. 100000 damage. Cost: $20000 and 1 Gem. Tech level 5 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 236 MovieClip "tower_basic" in Frame 30
onClipEvent (load) {
title = "Basic Damage Tower";
desc = "Basic Damage Tower";
cost = 50;
this.range = 65 * (1 + (0.05 * _global.rangeskill));
this.range2 = 66 * (1 + (0.05 * _global.rangeskill));
this.range3 = 67 * (1 + (0.05 * _global.rangeskill));
this.range4 = 68 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 80;
damage = 80 * (1 + (0.05 * _global.attackskill));
this.damage2 = 240 * (1 + (0.05 * _global.attackskill));
this.damage3 = 720 * (1 + (0.05 * _global.attackskill));
this.damage4 = 2160 * (1 + (0.05 * _global.attackskill));
rate = 19;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 240\rRange: 66\rCooldown: 18\rEffect: None", 120, this.damage2, this.range2, 18], ["Damage: 720\rRange: 67\rCooldown: 17\rEffect: None", 300, this.damage3, this.range3, 17], ["Damage: 2160\rRange: 68\rCooldown: 17\rEffect: None", 880, this.damage4, this.range4, 17]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_basic")) {
if (target == undefined) {
target = 0;
}
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 264 MovieClip "range" in Frame 30
onClipEvent (enterFrame) {
if ((_root.selectedTower == "") && (_root.marker.active == 0)) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 267 MovieClip "marker" in Frame 30
onClipEvent (load) {
active = 0;
inpath = 0;
this.swapDepths(9998);
}
onClipEvent (enterFrame) {
if (active == 1) {
this.startDrag(true);
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((maphit == 1) && (inpath == 0)) {
this.gotoAndStop(1);
_root.range.gotoAndStop(1);
} else {
this.gotoAndStop(2);
_root.range.gotoAndStop(2);
}
_root.range._x = _x;
_root.range._y = _y;
_root.range._width = _root["tower_" + tower].range * 2;
_root.range._height = _root["tower_" + tower].range * 2;
}
if (Key.isDown(32)) {
active = 0;
trace(1);
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
on (press) {
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((((maphit == 1) && (inpath == 0)) && (_root.gold >= this.cost)) && (_root.pauses == 0)) {
if (this.hitTest(_root.nextwave) == false) {
if (_root.marker.tower == "ultimate") {
if (_root.gems > 0) {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gems--;
_root.gold = _root.gold - this.cost;
}
} else {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gold = _root.gold - this.cost;
}
}
}
if (maphit == 0) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
if (this.hitTest(_root.nextwave)) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
Instance of Symbol 238 MovieClip "tower_splash" in Frame 30
onClipEvent (load) {
title = "Splash Tower";
desc = "Splash Tower";
cost = 50;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 73 * (1 + (0.05 * _global.rangeskill));
this.range4 = 75 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 34 * (1 + (0.05 * _global.attackskill));
this.damage2 = 102 * (1 + (0.05 * _global.attackskill));
this.damage3 = 306 * (1 + (0.05 * _global.attackskill));
this.damage4 = 918 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 102\rRange: 72\rCooldown: 21\rEffect: Splash", 120, this.damage2, this.range2, 21], ["Damage: 306\rRange: 73\rCooldown: 21\rEffect: Splash", 300, this.damage3, this.range3, 21], ["Damage: 918\rRange: 75\rCooldown: 20\rEffect: Splash", 880, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_splash")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > ((range * range) + 81)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 289 MovieClip "explosion" in Frame 30
onClipEvent (load) {
if (this._name == "explosion") {
this._visible = false;
}
}
Instance of Symbol 240 MovieClip "tower_slow" in Frame 30
onClipEvent (load) {
title = "Slow tower";
desc = "Slow tower";
cost = 150;
this.range = 68 * (1 + (0.05 * _global.rangeskill));
this.range2 = 69 * (1 + (0.05 * _global.rangeskill));
this.range3 = 70 * (1 + (0.05 * _global.rangeskill));
this.range4 = 71 * (1 + (0.05 * _global.rangeskill));
this.range5 = 72 * (1 + (0.05 * _global.rangeskill));
damage = 100 * (1 + (0.05 * _global.attackskill));
this.damage2 = 500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2200 * (1 + (0.05 * _global.attackskill));
this.damage4 = 10500 * (1 + (0.05 * _global.attackskill));
this.damage5 = 33000 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 500\rRange: 69\rCooldown: 22\rEffect: Slow", 500, this.damage2, this.range2, 22], ["Damage: 2200\rRange: 70\rCooldown: 21\rEffect: Slow", 1250, this.damage3, this.range3, 21], ["Damage: 10500\rRange: 71\rCooldown: 21\rEffect: Slow", 3150, this.damage4, this.range4, 21], ["Damage: 33000\rRange: 72\rColldown:19\rEffect: Slow", 8000, this.damage5, this.range5, 19]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_slow")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 314 MovieClip in Frame 30
on (press) {
_root.marker.active = 1;
_root.marker.tower = "rust";
_root.marker.cost = 400;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Rust Tower. Shoots shots that rust the enemy, causing them to take more damage. 300 base damage. Ultra Fast. Cost: $400";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 314 MovieClip "tower_rust" in Frame 30
onClipEvent (load) {
title = "Rust Tower";
desc = "Rust Tower";
cost = 400;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range5 = 80 * (1 + (0.05 * _global.rangeskill));
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 930 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 5000 * (1 + (0.05 * _global.attackskill));
this.damage5 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 9;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 930\rRange: 76\rCooldown: 9\rEffect: Rust", 1200, this.damage2, this.range2, 9], ["Damage: 2000\rRange: 77\rCooldown: 8\rEffect: Rust", 3000, this.damage3, this.range3, 8], ["Damage: 5000\rRange: 78\rCooldown: 8\rEffect: Rust", 6000, this.damage4, this.range4, 8], ["Damage: 15000\rRange: 80\rCooldown: 7\rEffect:Rust", 13500, this.damage5, this.range5, 7]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 242 MovieClip "tower_poison" in Frame 30
onClipEvent (load) {
title = "Splash Poison";
desc = "Splash Poison";
cost = 500;
this.range = 70;
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 75 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 12000 * (1 + (0.05 * _global.attackskill));
rate = 23;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 72\rCooldown: 22\rEffect:Poison(600)", 1500, this.damage2, this.range2, 22], ["Damage: 4000\rRange: 75\rCooldown: 21\rEffect:Poison(2700)", 5000, this.damage3, this.range3, 21], ["Damage: 12000\rRange:78\rCooldown: 20\rEffect:Poison(10000)", 11500, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 244 MovieClip "tower_static" in Frame 30
onClipEvent (load) {
title = "Static";
desc = "Static";
cost = 500;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 80 * (1 + (0.05 * _global.rangeskill));
this.range4 = 85 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 25;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 77\rCooldown: 24\rEffect:Static(7)", 1500, this.damage2, this.range2, 24], ["Damage: 4000\rRange: 80\rCooldown: 23\rEffect:Static(10)", 5000, this.damage3, this.range3, 23], ["Damage: 15000\rRange: 85\rCooldown:22\rEffect:Static(12)", 11000, this.damage4, this.range4, 22]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 252 MovieClip "tower_death" in Frame 30
onClipEvent (load) {
title = "Instant Death";
desc = "Instant Death";
cost = 650;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 79 * (1 + (0.05 * _global.rangeskill));
this.range4 = 82 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 650 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 15000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 35000 * (1 + (0.05 * _global.attackskill));
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3000)\rRange: 77\rCooldown: 28\rEffect:Death(12%)", 2000, this.damage2, this.range2, 28], ["Damage: 15000\rRange: 79\rCooldown: 26\rEffect:Death(16%)", 7000, this.damage3, this.range3, 26], ["Damage: 35000\rRange:82\rCooldown: 23 \rEffect:Death(19%)", 13500, this.damage4, this.range4, 23]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 248 MovieClip "tower_stun" in Frame 30
onClipEvent (load) {
title = "Stun Tower";
desc = "Stun Tower";
cost = 700;
rate = 22;
this.range = 73 * (1 + (0.05 * _global.rangeskill));
this.range2 = 74 * (1 + (0.05 * _global.rangeskill));
this.range3 = 76 * (1 + (0.05 * _global.rangeskill));
this.range4 = 79 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 45000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 74\rCooldown: 22\rEffect:Stun(13%)", 2500, this.damage2, this.range2, 22], ["Damage: 17000\rRange: 76\rCooldown: 21\rEffect:Stun(16%)", 9000, this.damage3, this.range3, 21], ["Damage: 45000\rRange: 79\rCooldown: 20\rEffect:Stun(18%)", 18000, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 254 MovieClip "tower_money" in Frame 30
onClipEvent (load) {
title = "Money Tower";
desc = "Money Tower";
cost = 700;
rate = 25;
this.range = 75;
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 78 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 40000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 76\rCooldown: 24\rEffect:Steal Money(8)", 2500, this.damage2, this.range2, 24], ["Damage: 17000\rRange: 78\rCooldown: 23\rEffect:Steal(9)", 9000, this.damage3, this.range3, 23], ["Damage: 40000\rRange: 80\rCooldown:21\rEffect:Steal(11)", 18000, this.damage4, this.range4, 21]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 256 MovieClip "tower_explode" in Frame 30
onClipEvent (load) {
title = "Explosion";
desc = "Explosion";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 80 * (1 + (0.05 * _global.rangeskill));
this.range2 = 82 * (1 + (0.05 * _global.rangeskill));
this.range3 = 84 * (1 + (0.05 * _global.rangeskill));
this.range4 = 86 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 82\rCooldown: 28\rEffect:Slow", 3000, this.damage2, this.range2, 28], ["Damage: 8000\rRange: 84\rCooldown: 27\rEffect:Slow", 10000, this.damage3, this.range3, 27], ["Damage: 25000\rRange: 86\rCooldown:25\rEffect:Slow", 25000, this.damage4, this.range4, 25]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 336 MovieClip "shockshot" in Frame 30
onClipEvent (enterFrame) {
this._rotation = this._rotation + 30;
}
Instance of Symbol 246 MovieClip "tower_shock" in Frame 30
onClipEvent (load) {
title = "Shock";
desc = "Shock";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 75 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 35;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 75\rCooldown: 33\rEffect:Shock", 3000, this.damage2, this.range2, 33], ["Damage: 8000\rRange: 77\rCooldown: 30\rEffect:Shock", 10000, this.damage3, this.range3, 30], ["Damage: 25000\rRange: 80\rCooldown: 27\rEffect:Shock", 25000, this.damage4, this.range4, 27]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 258 MovieClip "tower_ultimate" in Frame 30
onClipEvent (load) {
title = "Ultimate Tower";
desc = "Ultimate Tower";
cost = 20000;
damage = 100000 * (1 + (0.05 * _global.attackskill));
this.damage2 = 200000 * (1 + (0.05 * _global.attackskill));
this.range = 85 * (1 + (0.05 * _global.rangeskill));
this.range2 = 95 * (1 + (0.05 * _global.rangeskill));
rate = 27;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 2;
upgrades = [["Damage: 200000\rRange: 95\rCooldown: 33\rEffect:Splash", 40000, this.damage2, this.range2, 24]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_ultimate")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 353 MovieClip "UpgradeTowerInfo" in Frame 30
onClipEvent (load) {
_visible = false;
swapDepths(100000);
}
Instance of Symbol 378 MovieClip "creep1" in Frame 30
onClipEvent (load) {
this._rotation = this._rotation + 45;
}
Instance of Symbol 380 MovieClip in Frame 30
onClipEvent (enterFrame) {
if (_root.timer > 50) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 381 MovieClip in Frame 30
onClipEvent (load) {
this._visible = false;
this.startDrag(true);
this.count = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(77) && (_global.sound == 1)) {
_global.sound = 0;
stopAllSounds();
}
if (Key.isDown(78) && (_global.sound == 0)) {
_global.sound = 1;
_root.playsound.start(0, 100000);
}
if (Key.isDown(80) && (_root.pauses == 0)) {
_root.pauses = 1;
}
if (Key.isDown(85) && (_root.pauses == 1)) {
_root.pauses = 0;
}
if (_root.pauses == 0) {
_root.levelnew++;
_root.checkkill();
this.count++;
if ((this.count % 30) == 0) {
_root.timer--;
}
if (_root.timer <= 0) {
if (_root.wave < _global.maxwaves) {
_root.newLevel();
}
_root.timer = 60;
}
if ((_root.lives <= 0) && (_root.gameover == 0)) {
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
if (_root.creepArray.length <= 0) {
_root.gotoAndPlay("lose8");
}
}
if (((((_root.wave >= _global.maxwaves) && (_root.creepArray.length <= 0)) && (_root.gameover == 0)) && (_root.kills >= 20)) && (_root.levelnew > 120)) {
_root.levelwin = 1;
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
_root.gotoAndPlay("win8");
}
}
}
Instance of Symbol 387 MovieClip "tinfo" in Frame 30
onClipEvent (load) {
this.swapDepths(99999);
}
Instance of Symbol 421 MovieClip "quitbox" in Frame 30
onClipEvent (load) {
this._visible = false;
}
Frame 31
stop();
stopAllSounds();
Frame 32
stop();
_root.gameover = 1;
stopAllSounds();
if (_root.levelwin == 0) {
_root.gotoAndPlay("lose8");
}
if (_root.lives == 20) {
_root.skillgained = 3;
} else {
_root.skillgained = 2;
}
storedskills = SharedObject.getLocal("flashskill");
if (storedskills.data.level8gain == undefined) {
_global.xpleft = _global.xpleft + _root.skillgained;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level8gain = _root.skillgained;
} else {
xplast = storedskills.data.level8gain;
skilldifferent = _root.skillgained - xplast;
if (skilldifferent > 0) {
_global.xpleft = _global.xpleft + skilldifferent;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level8gain = storedskills.data.level8gain + skilldifferent;
}
}
if ((storedskills.data.maxlevelbeat < 8) || (storedskills.data.maxlevelbeat == undefined)) {
storedskills.data.maxlevelbeat = 8;
}
if ((storedskills.data.level8score == undefined) || (_root.score > storedskills.data.level8score)) {
storedskills.data.level8score = _root.score;
}
Frame 33
function TowerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
}
function towerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
_root.UpgradeTowerInfo._visible = true;
if (tower.maxtier >= tower.tier) {
_root.UpgradeTowerInfo.UpgradeInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 1][2]) + "\rRange: ") + tower.upgrades[tower.tier - 1][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 1][4]) + "\rEffect: ") + tower.desc;
if (tower.tier == 1) {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.damage) + "\rRange: ") + tower.range) + "\rCoolDown: ") + tower.rate) + "\rEffect: ") + tower.desc;
} else {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 2][2]) + "\rRange: ") + tower.upgrades[tower.tier - 2][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 2][4]) + "\rEffect: ") + tower.desc;
}
_root.UpgradeTowerInfo.UpgradeButton.UpgradeButtonText.text = ("Upgrade [$" + tower.upgrades[tower.tier - 1][1]) + "]";
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
sellprice = Math.floor(tower.cost * 0.85);
_root.UpgradeTowerInfo.sellbutton.UpgradeButtonText.text = ("Sell [$" + sellprice) + "]";
if (tower.maxtier > tower.tier) {
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
} else {
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
}
} else {
_root.UpgradeTowerInfo.f.text = "";
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
_root.UpgradeTowerInfo.h.text = "";
}
}
function newLevel() {
if (_root.wave < 59) {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.02 * _root.gold);
_root.nowspeed = _root.waves[_root.wave - 1][2];
_root.nextspeed = _root.waves[_root.wave][2];
_root.nowhp = _root.waves[_root.wave - 1][1];
_root.nexthp = _root.waves[_root.wave][1];
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = _root.goldworth * 1.7;
_root.goldworth = _root.goldworth * (1 + (0.05 * _global.killbounty));
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", _root.waves[_root.wave - 1][3], _root.wave, "creep1", _root.waves[_root.wave - 1][2], _root.waves[_root.wave - 1][1], _root.goldworth);
_root["spawned" + _root.wave] = _root.waves[_root.wave - 1][0];
} else {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.03 * _root.gold);
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = Math.floor(_root.goldworth);
_root.goldworth = _root.goldworth * 1.2;
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
randspeed = 1.5 + random(3);
_root.nowspeed = randspeed;
_root.nextspeed = "???";
wavessince = _root.wave - 60;
hpmultiplier = Math.pow(1.2, wavessince);
_root.nowhp = Math.floor(_root.waves[59][1] * hpmultiplier);
_root.nexthp = Math.floor(_root.nowhp * 1.2);
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", 200, _root.wave, "creep1", _root.nowspeed, _root.nowhp, _root.goldworth);
_root["spawned" + _root.wave] = 30;
}
}
function spawn(level, creep, speed, health, gold) {
if (_root["spawned" + level] == 0) {
clearInterval(_root["spawnInterval" + level]);
} else {
_root["spawned" + level]--;
playanim = (level % 5) + 1;
_root.creepcount++;
_root[creep].duplicateMovieClip("c" + _root.creepcount, 20000 + _root.creepcount);
if (_root.creepcount > 10000) {
_root.creepcount = 1;
}
c = _root["c" + _root.creepcount];
c.creep.gotoAndStop(playanim);
c._x = _root.wp1._x;
c._y = _root.wp1._y;
c.health = health;
c.slowcount = 1;
c.isslow = 0;
c.maxhealth = health;
c.speed = speed;
c.maxspeed = c.speed;
c.ispoisoned = 0;
c.poisonedlevel = 0;
c.poisoncount = 0;
c.fullmax = c.maxspeed;
c.targ = 2;
c.rnd = 5;
c.shocked = 0;
c.shockcount = 1;
c.gold = gold;
c.iscorrode = 0;
c.isstunned = 0;
c.stuncount = 1;
c.splashslowed = 0;
c.splashslowedcount = 1;
_root.creepArray[_root.creepArray.length] = c;
c.onEnterFrame = function () {
if (_root.pauses == 0) {
this.health_bar.health._width = 30 * (this.health / this.maxhealth);
this.targX = (_root["wp" + this.targ]._x - 5) + this.rnd;
this.targY = (_root["wp" + this.targ]._y - 5) + this.rnd;
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this.rads = (this.dir * 3.141593) / 180;
if ((this.isstunned != 0) || (this.shocked == 1)) {
this.stuncount++;
if ((this.stuncount % 2) == 1) {
this._x = this._x + 2;
} else {
this._x = this._x - 2;
}
}
if (this.stuncount > 160) {
this.isstunned = 0;
this.stuncount = 1;
}
if (this.isslow != 0) {
this.speed = this.isslow * this.fullmax;
this.slowcount++;
}
if (this.slowcount > 160) {
this.speed = this.fullmax;
this.isslow = 0;
this.slowcount = 1;
}
if (this.splashslowed != 0) {
this.fullmax = this.maxspeed * this.splashslowed;
this.speed = this.fullmax;
if (this.isslow != 0) {
this.speed = this.fullmax * this.isslow;
}
this.splashslowedcount++;
}
if (this.splashslowedcount > 100) {
this.splashslowed = 0;
this.fullmax = this.maxspeed;
this.speed = this.fullmax;
this.splashslowedcount = 1;
}
if (this.iscorrode != 0) {
this.corrodecount++;
}
if (this.corrodecount > 200) {
this.iscorrode = 0;
this.corrdecount = 1;
}
if (this.ispoisoned == 1) {
if ((this.poisoncount % 40) == 0) {
this.health = this.health - this.poisonedlevel;
}
this.poisoncount++;
}
if (this.shocked == 1) {
this.shockcount++;
}
if (this.shockcount >= 80) {
this.shocked = 0;
this.shockcount = 1;
}
if (this.poisoncount > 200) {
this.ispoisoned = 0;
this.poisoncount = 0;
}
if ((this.isstunned == 0) && (this.shocked == 0)) {
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
}
d = Math.pow(this._x - this.targX, 2) + Math.pow(this._y - this.targY, 2);
if (d < 25) {
this.targ++;
if (this.targ > 14) {
_root.leak(this);
this._x = _root.wp1._x;
this._y = _root.wp1._y;
this.targ = 2;
}
}
this.r = this.dir;
if ((this._rotation + 10) < this.r) {
this._rotation = this._rotation + 10;
} else if ((this._rotation - 10) > this.r) {
this._rotation = this._rotation - 10;
} else {
this._rotation = r;
}
}
};
}
}
function fire(from, to, speed, acc, maxpeed, projectile, damage, towerid) {
_root.particlecount++;
_root[projectile].duplicateMovieClip("p" + _root.particlecount, 2000 + _root.particlecount);
r = _root["p" + _root.particlecount];
r._x = from._x;
r._y = from._y;
r.tier = from.tier;
r.type = from.type;
r.targ = to;
r.speed = speed;
r.acc = acc;
r.maxspeed = maxspeed;
r.damage = damage;
r.projectile = projectile;
r.towerid = towerid;
if (_root.particlecount > 300) {
_root.particlecount = 0;
}
r.onEnterFrame = function () {
if (_root.pauses == 0) {
if (("" + this.targ) != "") {
this.targX = this.targ._x;
this.targY = this.targ._y;
} else {
this._rotation = (Math.atan2(this.targ._y - this._y, this.targ._x - this._x) * 180) / 3.141593;
if (_root.creepArray.length <= 0) {
this.removeMovieClip();
} else {
w = 0;
if (w <= _root.creepArray.length) {
this.targ = _root.creepArray[w];
}
}
}
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this._rotation = this.dir + 90;
this.rads = (this.dir * 3.141593) / 180;
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
if (this.speed < this.maxspeed) {
this.speed = this.speed + this.acc;
}
d = ((this._x - this.targX) * (this._x - this.targX)) + ((this._y - this.targY) * (this._y - this.targY));
if (d < 25) {
if (this.towerid == 10) {
randcrit = random(100);
if ((this.tier == 1) && (randcrit < 11)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 2) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 3) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 4) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 5) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
} else if (this.towerid == 4) {
this.targ.corrodecount = 1;
if (this.tier == 1) {
this.targ.iscorrode = 0.06;
} else if (this.tier == 2) {
this.targ.iscorrode = 0.12;
} else if (this.tier == 3) {
this.targ.iscorrode = 0.2;
} else if (this.tier == 4) {
this.targ.iscorrode = 0.32;
} else if (this.tier == 5) {
this.targ.iscorrode = 0.45;
}
}
this.targ.health = this.targ.health - (this.damage * (1 + this.targ.iscorrode));
if (this.towerid == 7) {
randstun = random(100);
if ((this.tier == 1) && (randstun < 10)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 2) && (randstun < 14)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 3) && (randstun < 17)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 4) && (randstun < 20)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
}
} else if (this.towerid == 5) {
this.targ.ispoisoned = 1;
this.targ.poisoncount = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < 4225) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[i].ispoisoned = 1;
_root.creepArray[i].poisoncount = 1;
}
i++;
}
if (this.tier == 1) {
this.targ.poisonedlevel = 150;
} else if (this.tier == 2) {
this.targ.poisonedlevel = 600;
} else if (this.tier == 3) {
this.targ.poisonedlevel = 2700;
} else if (this.tier == 4) {
this.targ.poisonedlevel = 10000;
}
_root.poisonball.duplicateMovieClip("poisonball" + _root.splashct, 6300 + _root.splashct);
_root["poisonball" + _root.splashct]._x = this._x;
_root["poisonball" + _root.splashct]._y = this._y;
_root["poisonball" + _root.splashct]._width = 80;
_root["poisonball" + _root.splashct]._height = 80;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 6) {
if (this.targ.health < (0.35 * this.targ.maxhealth)) {
randdeath = random(100);
if ((this.tier == 1) && (randdeath < 8)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 2) && (randdeath < 12)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 3) && (randdeath < 16)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 4) && (randdeath < 20)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
}
}
} else if (this.towerid == 8) {
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < 10000) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
if (this.tier == 1) {
_root.creepArray[k].splashslowed = 0.6;
} else if (this.tier == 2) {
_root.creepArray[k].splashslowed = 0.55;
} else if (this.tier == 3) {
_root.creepArray[k].splashslowed = 0.5;
} else if (this.tier == 4) {
_root.creepArray[k].splashslowed = 0.4;
}
_root.creepArray[k].splashslowedcount = 0;
}
k++;
}
_root.explodingshot.duplicateMovieClip("explodingshot" + _root.explodecount, 5100 + _root.explodecount);
_root["explodingshot" + _root.explodecount]._x = this._x;
_root["explodingshot" + _root.explodecount]._y = this._y;
_root.explodecount++;
if (_root.explodecount > 20) {
_root.explodecount = 1;
}
} else if (this.towerid == 26) {
if (this.tier == 1) {
shockwidth = 75;
shockchance = 8;
} else if (this.tier == 2) {
shockwidth = 80;
shockchance = 10;
} else if (this.tier == 3) {
shockwidth = 85;
shockchance = 12;
} else if (this.tier == 4) {
shockwidth = 90;
shockchance = 14;
}
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < (shockwidth * shockwidth)) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
shockper = random(100);
if (shockper < shockchance) {
if (_root.creepArray[k].shocked == 0) {
_root.creepArray[k].shocked = 1;
_root.creepArray[k].splashslowedcount = 1;
}
}
}
k++;
}
_root.shockshot.duplicateMovieClip("shockshot" + _root.shockct, 26500 + _root.shockct);
_root["shockshot" + _root.shockct]._x = this._x;
_root["shockshot" + _root.shockct]._y = this._y;
_root["shockshot" + _root.shockct]._width = 2 * shockwidth;
_root["shockshot" + _root.shockct]._height = 2 * shockwidth;
_root.shockct++;
if (_root.shockct > 20) {
_root.shockct = 1;
}
} else if (this.towerid == 22) {
if (this.tier == 1) {
staticval = 5;
} else if (this.tier == 2) {
staticval = 7;
} else if (this.tier == 3) {
staticval = 10;
}
staticchance = random(100);
if (staticchance < staticval) {
damagetaken = this.targ.maxhealth - this.targ.health;
(this.health - this.health) - (0.5 * damagetaken);
_root.lighteffect.duplicateMovieClip("lighteffect" + _root.staticcount, 23000 + _root.staticcount);
_root["lighteffect" + _root.staticcount]._x = this._x;
_root["lighteffect" + _root.staticcount]._y = this._y;
_root.staticcount++;
if (_root.staticcount > 50) {
_root.staticcount = 1;
}
}
} else if (this.towerid == 25) {
stealval = random(100);
if (this.tier == 1) {
this.stealmax = 6;
} else if (this.tier == 2) {
this.stealmax = 9;
} else if (this.tier == 3) {
this.stealmax = 10;
} else if (this.tier == 4) {
this.stealmax = 12;
}
if (stealval < this.stealmax) {
_root.gold = _root.gold + this.targ.gold;
_root.goldeffect.duplicateMovieClip("goldeffect" + _root.goldeffectct, 26000 + _root.goldeffectct);
_root["goldeffect" + _root.goldeffectct]._x = this._x;
_root["goldeffect" + _root.goldeffectct]._y = this._y;
_root.goldeffectct++;
if (_root.goldeffectct > 20) {
_root.goldeffectct = 1;
}
}
} else if (this.towerid == 999) {
if (this.targ.health < (0.65 * this.targ.maxhealth)) {
randteleport = random(100);
if ((this.tier == 1) && (randteleport < 8)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
_root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 2) && (randteleport < 9)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 3) && (randteleport < 10)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 4) && (randteleport < 11)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 5) && (randteleport < 13)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
}
}
} else if (this.towerid == 100) {
if (this.tier == 1) {
spradius = 1225;
spwidth = 35;
} else if (this.tier == 2) {
spradius = 1600;
spwidth = 40;
} else if (this.tier == 3) {
spradius = 2025;
spwidth = 45;
} else if (this.tier == 4) {
spradius = 2500;
spwidth = 50;
} else if (this.tier == 5) {
spradius = 3600;
spwidth = 60;
}
j = 0;
while (j <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[j]._x, 2) + Math.pow(this._y - _root.creepArray[j]._y, 2);
if (d < spradius) {
if ((("" + _root.creepArray[j]) != "") && (_root.creepArray[j] != this.targ)) {
_root.creepArray[j].health = _root.creepArray[j].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[j].splashslowed = 1;
_root.creepArray[j].splashslowedcount = 1;
}
j++;
}
_root.iceball.duplicateMovieClip("iceball" + _root.splashct, 5200 + _root.splashct);
_root["iceball" + _root.splashct]._x = this._x;
_root["iceball" + _root.splashct]._y = this._y;
_root["iceball" + _root.splashct]._width = spwidth;
_root["iceball" + _root.splashct]._height = spwidth;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 3) {
if (this.tier == 1) {
this.targ.isslow = 0.6;
}
if (this.tier == 2) {
this.targ.isslow = 0.5;
}
if (this.tier == 3) {
this.targ.isslow = 0.4;
}
if (this.tier == 4) {
this.targ.isslow = 0.35;
}
if (this.tier == 5) {
this.targ.isslow = 0.3;
}
this.targ.slowcount = 1;
} else if (this.towerid == 2) {
_root.explosion.duplicateMovieClip("explosion" + _root.explosioncount, 5000 + _root.explosioncount);
_root["explosion" + _root.explosioncount]._x = this._x;
_root["explosion" + _root.explosioncount]._y = this._y;
_root["explosion" + _root.explosioncount]._width = 100;
_root["explosion" + _root.explosioncount]._height = 100;
_root.explosioncount++;
if (_root.explosioncount > 40) {
_root.explosioncount = 1;
}
splashrad = 50;
splashrad2 = splashrad * splashrad;
i = 0;
while (i <= _root.creepArray.length) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < splashrad2) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 6000)));
}
}
i++;
}
}
if (this.targ.health <= 0) {
this.targ.isDead = 1;
}
this.removeMovieClip();
}
}
};
}
function checkkill() {
n = 0;
while (n < _root.creepArray.length) {
if ((_root.creepArray[n].health <= 0) || (_root.creepArray[n] == "undefined")) {
_root.kills++;
_root.aftereffect.duplicateMovieClip("aftereffect" + _root.effectcount, 50000 + _root.effectcount);
_root["aftereffect" + _root.effectcount]._x = _root.creepArray[n]._x;
_root["aftereffect" + _root.effectcount]._y = _root.creepArray[n]._y;
_root.effectcount++;
if (_root.effectcount > 50) {
_root.effectcount = 1;
}
if (((_root.creepArray[n].gold != "undefined") && (_root.creepArray[n].gold != "null")) && (_root.creepArray[n].gold > 0)) {
_root.gold = _root.gold + _root.creepArray[n].gold;
_root.score = _root.score + _root.creepArray[n].maxhealth;
}
_root.creepArray[n].removeMovieClip();
_root.creepArray.splice(n, 1);
}
n++;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
function kill(creep) {
_root.kills++;
if (_root.kills >= _root.waves[_root.wave - 1][0]) {
_root.kills = 0;
if (_root.wave < _global.maxwaves) {
_root.newLevel();
}
}
creep.onEnterFrame = function () {
this.removeMovieClip();
};
}
function upgrade() {
a = _root.selectedTower;
b = a.tier - 1;
if (int(a.upgrades[b][1]) <= _root.gold) {
a.damage = int(a.upgrades[b][2]);
a.range = a.upgrades[b][3];
a.rate = a.upgrades[b][4];
a.splash = a.upgrades[b][5];
a.slow = a.upgrades[b][6];
a.cost = a.cost + int(a.upgrades[b][1]);
a.tier++;
_root.towerInfo(a);
_root.gold = _root.gold - int(a.upgrades[b][1]);
updateInfoBar();
}
}
function sell() {
tower = _root.selectedTower;
if (((tower != "undefined") && (tower != "null")) && (tower != "")) {
sellprice = Math.floor(tower.cost * 0.85);
if (sellprice != "undefined") {
_root.gold = _root.gold + sellprice;
}
_root.range._x = 1000;
_root.range._height = 0;
_root.range._width = 0;
if (tower.maxtier == 2) {
_root.gems++;
}
tower.removeMovieClip();
_root.UpgradeTowerInfo._visible = false;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
stop();
_root.skillstats.swapDepths(9090);
_root.skillstats.removeMovieClip();
_root.challengescore._x = 2000;
_root.challengescore._y = 2000;
_root.levelwin = 0;
_root.gold = 100;
_root.gems = _global.gems;
_root.attackskill = _global.attackskill;
_root.rangeskill = _global.rangeskill;
_root.killbounty = _global.killbounty;
_root.techlevel = _global.techlevel;
if (_global.startmoneylevel == 1) {
_root.gold = 150;
} else if (_global.startmoneylevel == 2) {
_root.gold = 200;
} else if (_global.startmoneylevel == 3) {
_root.gold = 250;
} else if (_global.startmoneylevel == 4) {
_root.gold = 400;
} else if (_global.startmoneylevel == 5) {
_root.gold = 600;
}
_root.wave = 0;
_root.levelnew = 1;
_root.effectcount = 1;
_root.staticcount = 1;
_root.shockct = 1;
_root.gameover = 0;
_root.towerCount = 0;
_root.creepcount = 1;
_root.goldeffectct = 1;
_root.kills = 0;
_root.pauses = 0;
_root.creepleaks = 0;
_root.timer = 45;
_root.lives = 20;
_root.goldworth = 0;
_root.creepArray = [];
_global.sound = 1;
_root.particlecount = 1;
_root.splashct = 1;
_root.pwncount = 1;
_root.explodecount = 1;
_root.score = 0;
_root.playsound = new Sound(this);
_root.playsound.attachSound("music2");
if (_global.sound == 1) {
_root.playsound.start(0, 100000);
}
_root.playsound1 = new Sound(this);
_root.playsound1.attachSound("sndplasma");
_root.playsound2 = new Sound(this);
_root.playsound2.attachSound("sndrocket");
_root.playsound3 = new Sound(this);
_root.playsound3.attachSound("sndbullet");
_root.playsound4 = new Sound(this);
_root.playsound4.attachSound("sndbullet1");
_root.playsound5 = new Sound(this);
_root.playsound5.attachSound("sndexplode");
_root.playsound6 = new Sound(this);
_root.playsound6.attachSound("sndlaser");
_global.maxwaves = 67;
_root.wavemax = _global.maxwaves;
_root.waves = [[20, 116, 3.75, 667], [20, 136, 4.5, 600], [20, 159, 2.75, 400], [20, 184, 3.75, 667], [20, 218, 4.05, 600], [20, 253, 3.75, 667], [20, 296, 1.5, 266], [2, 1102, 5.25, 600], [20, 406, 3, 667], [20, 453, 3.75, 137], [20, 476, 3, 667], [20, 652, 2.75, 400], [20, 763, 3, 650], [20, 892, 5, 700], [20, 1045, 3.25, 550], [2, 6090, 2.75, 200], [20, 1431, 3.75, 600], [20, 1673, 4, 700], [20, 1958, 4.25, 650], [20, 2291, 3.5, 580], [20, 2686, 3.25, 500], [20, 3150, 3.4, 125], [20, 3692, 2.8, 475], [20, 4330, 3, 600], [2, 19530, 3.141592, 620], [20, 5953, 3.5, 650], [20, 6980, 4, 700], [20, 8184, 3.3, 600], [20, 9597, 3.4, 590], [20, 11186, 3.12, 150], [20, 13222, 3.3, 600], [20, 15535, 3.2, 570], [2, 67200, 2.5, 800], [20, 21449, 3, 600], [20, 25204, 3.15, 577], [20, 29614, 3.2, 110], [20, 34798, 3.35, 600], [20, 38941, 3.4, 620], [20, 48042, 3.5, 630], [20, 56450, 3.75, 670], [20, 66610, 3, 700], [20, 78600, 3.2, 650], [20, 92749, 3.3, 120], [20, 109444, 3.4, 675], [20, 129144, 3.5, 690], [20, 152390, 4, 200], [20, 179820, 3, 650], [20, 212999, 3.5, 700], [2, 1209264, 4, 1000], [20, 295452, 3.5, 700], [20, 354543, 3.4, 600], [20, 425451, 3.33, 190], [20, 510543, 4.5, 750], [20, 612650, 4, 700], [20, 735143, 3.4, 600], [20, 882218, 3.6, 625], [2, 5355000, 3.7, 700], [20, 1270393, 3.8, 710], [20, 1524474, 4, 650], [20, 1829368, 5, 280]];
_root.nowhp = 0;
_root.nowspeed = 0;
_root.nexthp = _root.waves[0][1];
_root.nextspeed = 2.5;
Instance of Symbol 228 MovieClip "wp1" in Frame 33
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp2" in Frame 33
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp3" in Frame 33
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp4" in Frame 33
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp5" in Frame 33
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp6" in Frame 33
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp7" in Frame 33
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp8" in Frame 33
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp9" in Frame 33
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp10" in Frame 33
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp11" in Frame 33
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp12" in Frame 33
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp13" in Frame 33
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp14" in Frame 33
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 236 MovieClip in Frame 33
on (press) {
_root.marker.active = 1;
_root.marker.tower = "basic";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Tower. Shoots bullets at enemies. 80 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 238 MovieClip in Frame 33
on (press) {
_root.marker.active = 1;
_root.marker.tower = "splash";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Splash Tower. Shoots Exploding bullets at enemies. 29 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 240 MovieClip in Frame 33
on (press) {
_root.marker.active = 1;
_root.marker.tower = "slow";
_root.marker.cost = 150;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Slow Tower. Shoots shots that slow the enemy. 100 base damage. Cost: $150";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 242 MovieClip in Frame 33
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "poison";
_root.marker.cost = 500;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Splash Poison Tower. Splashes Poison(150/sec for level 1) to hurt the enemy. 300 base damage. Cost: $500, tech level 1 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 244 MovieClip in Frame 33
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "static";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Static tower. 6% chance to make target take 50% of the damage that is has lost so far. 500 base damage. Cost: $650. Tech level 1.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 246 MovieClip in Frame 33
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "shock";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Shock tower. Has the ability to random stun any enemy within its radius. Enemies cannot be stunned if already under effect of stun. 500 base damage. Cost: $1000. Tech level 4 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 248 MovieClip in Frame 33
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "stun";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Stun Tower. Has a 10% chance of stunning enemies. 500 base damage. Cost: $700. Requires Tech level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 252 MovieClip in Frame 33
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "death";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Instant death tower. 8% chance to instantly kill if target is under 35% HP. 500 base damage. Cost: $650. Tech Level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 254 MovieClip in Frame 33
on (press) {
if (_root.techlevel >= 2) {
_root.marker.active = 1;
_root.marker.tower = "money";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Money Tower. Has a 5% chance of stealing money from creeps it hits at level 1. 500 Damage. Cost: $700. Tech Level 2.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 256 MovieClip in Frame 33
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "explode";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Exploding Tower. Damages and slows all enemies in a radius of itself. 500 base damage. Cost: $1000. Tech Level 4.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 258 MovieClip in Frame 33
on (press) {
if (_root.gems > 0) {
if (_root.techlevel >= 5) {
_root.marker.active = 1;
_root.marker.tower = "ultimate";
_root.marker.cost = 20000;
_root.tinfo._visible = false;
}
}
}
on (rollOver) {
_root.buyinfo = "Ultimate Tower. Extreme Damage and splash. 100000 damage. Cost: $20000 and 1 Gem. Tech level 5 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 236 MovieClip "tower_basic" in Frame 33
onClipEvent (load) {
title = "Basic Damage Tower";
desc = "Basic Damage Tower";
cost = 50;
this.range = 65 * (1 + (0.05 * _global.rangeskill));
this.range2 = 66 * (1 + (0.05 * _global.rangeskill));
this.range3 = 67 * (1 + (0.05 * _global.rangeskill));
this.range4 = 68 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 80;
damage = 80 * (1 + (0.05 * _global.attackskill));
this.damage2 = 240 * (1 + (0.05 * _global.attackskill));
this.damage3 = 720 * (1 + (0.05 * _global.attackskill));
this.damage4 = 2160 * (1 + (0.05 * _global.attackskill));
rate = 19;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 240\rRange: 66\rCooldown: 18\rEffect: None", 120, this.damage2, this.range2, 18], ["Damage: 720\rRange: 67\rCooldown: 17\rEffect: None", 300, this.damage3, this.range3, 17], ["Damage: 2160\rRange: 68\rCooldown: 17\rEffect: None", 880, this.damage4, this.range4, 17]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_basic")) {
if (target == undefined) {
target = 0;
}
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 264 MovieClip "range" in Frame 33
onClipEvent (enterFrame) {
if ((_root.selectedTower == "") && (_root.marker.active == 0)) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 267 MovieClip "marker" in Frame 33
onClipEvent (load) {
active = 0;
inpath = 0;
this.swapDepths(9998);
}
onClipEvent (enterFrame) {
if (active == 1) {
this.startDrag(true);
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((maphit == 1) && (inpath == 0)) {
this.gotoAndStop(1);
_root.range.gotoAndStop(1);
} else {
this.gotoAndStop(2);
_root.range.gotoAndStop(2);
}
_root.range._x = _x;
_root.range._y = _y;
_root.range._width = _root["tower_" + tower].range * 2;
_root.range._height = _root["tower_" + tower].range * 2;
}
if (Key.isDown(32)) {
active = 0;
trace(1);
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
on (press) {
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((((maphit == 1) && (inpath == 0)) && (_root.gold >= this.cost)) && (_root.pauses == 0)) {
if (this.hitTest(_root.nextwave) == false) {
if (_root.marker.tower == "ultimate") {
if (_root.gems > 0) {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gems--;
_root.gold = _root.gold - this.cost;
}
} else {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gold = _root.gold - this.cost;
}
}
}
if (maphit == 0) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
if (this.hitTest(_root.nextwave)) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
Instance of Symbol 238 MovieClip "tower_splash" in Frame 33
onClipEvent (load) {
title = "Splash Tower";
desc = "Splash Tower";
cost = 50;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 73 * (1 + (0.05 * _global.rangeskill));
this.range4 = 75 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 34 * (1 + (0.05 * _global.attackskill));
this.damage2 = 102 * (1 + (0.05 * _global.attackskill));
this.damage3 = 306 * (1 + (0.05 * _global.attackskill));
this.damage4 = 918 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 102\rRange: 72\rCooldown: 21\rEffect: Splash", 120, this.damage2, this.range2, 21], ["Damage: 306\rRange: 73\rCooldown: 21\rEffect: Splash", 300, this.damage3, this.range3, 21], ["Damage: 918\rRange: 75\rCooldown: 20\rEffect: Splash", 880, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_splash")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > ((range * range) + 81)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 289 MovieClip "explosion" in Frame 33
onClipEvent (load) {
if (this._name == "explosion") {
this._visible = false;
}
}
Instance of Symbol 240 MovieClip "tower_slow" in Frame 33
onClipEvent (load) {
title = "Slow tower";
desc = "Slow tower";
cost = 150;
this.range = 68 * (1 + (0.05 * _global.rangeskill));
this.range2 = 69 * (1 + (0.05 * _global.rangeskill));
this.range3 = 70 * (1 + (0.05 * _global.rangeskill));
this.range4 = 71 * (1 + (0.05 * _global.rangeskill));
this.range5 = 72 * (1 + (0.05 * _global.rangeskill));
damage = 100 * (1 + (0.05 * _global.attackskill));
this.damage2 = 500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2200 * (1 + (0.05 * _global.attackskill));
this.damage4 = 10500 * (1 + (0.05 * _global.attackskill));
this.damage5 = 33000 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 500\rRange: 69\rCooldown: 22\rEffect: Slow", 500, this.damage2, this.range2, 22], ["Damage: 2200\rRange: 70\rCooldown: 21\rEffect: Slow", 1250, this.damage3, this.range3, 21], ["Damage: 10500\rRange: 71\rCooldown: 21\rEffect: Slow", 3150, this.damage4, this.range4, 21], ["Damage: 33000\rRange: 72\rColldown:19\rEffect: Slow", 8000, this.damage5, this.range5, 19]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_slow")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 314 MovieClip in Frame 33
on (press) {
_root.marker.active = 1;
_root.marker.tower = "rust";
_root.marker.cost = 400;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Rust Tower. Shoots shots that rust the enemy, causing them to take more damage. 300 base damage. Ultra Fast. Cost: $400";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 314 MovieClip "tower_rust" in Frame 33
onClipEvent (load) {
title = "Rust Tower";
desc = "Rust Tower";
cost = 400;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range5 = 80 * (1 + (0.05 * _global.rangeskill));
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 930 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 5000 * (1 + (0.05 * _global.attackskill));
this.damage5 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 9;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 930\rRange: 76\rCooldown: 9\rEffect: Rust", 1200, this.damage2, this.range2, 9], ["Damage: 2000\rRange: 77\rCooldown: 8\rEffect: Rust", 3000, this.damage3, this.range3, 8], ["Damage: 5000\rRange: 78\rCooldown: 8\rEffect: Rust", 6000, this.damage4, this.range4, 8], ["Damage: 15000\rRange: 80\rCooldown: 7\rEffect:Rust", 13500, this.damage5, this.range5, 7]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 242 MovieClip "tower_poison" in Frame 33
onClipEvent (load) {
title = "Splash Poison";
desc = "Splash Poison";
cost = 500;
this.range = 70;
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 75 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 12000 * (1 + (0.05 * _global.attackskill));
rate = 23;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 72\rCooldown: 22\rEffect:Poison(600)", 1500, this.damage2, this.range2, 22], ["Damage: 4000\rRange: 75\rCooldown: 21\rEffect:Poison(2700)", 5000, this.damage3, this.range3, 21], ["Damage: 12000\rRange:78\rCooldown: 20\rEffect:Poison(10000)", 11500, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 244 MovieClip "tower_static" in Frame 33
onClipEvent (load) {
title = "Static";
desc = "Static";
cost = 500;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 80 * (1 + (0.05 * _global.rangeskill));
this.range4 = 85 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 25;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 77\rCooldown: 24\rEffect:Static(7)", 1500, this.damage2, this.range2, 24], ["Damage: 4000\rRange: 80\rCooldown: 23\rEffect:Static(10)", 5000, this.damage3, this.range3, 23], ["Damage: 15000\rRange: 85\rCooldown:22\rEffect:Static(12)", 11000, this.damage4, this.range4, 22]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 252 MovieClip "tower_death" in Frame 33
onClipEvent (load) {
title = "Instant Death";
desc = "Instant Death";
cost = 650;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 79 * (1 + (0.05 * _global.rangeskill));
this.range4 = 82 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 650 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 15000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 35000 * (1 + (0.05 * _global.attackskill));
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3000)\rRange: 77\rCooldown: 28\rEffect:Death(12%)", 2000, this.damage2, this.range2, 28], ["Damage: 15000\rRange: 79\rCooldown: 26\rEffect:Death(16%)", 7000, this.damage3, this.range3, 26], ["Damage: 35000\rRange:82\rCooldown: 23 \rEffect:Death(19%)", 13500, this.damage4, this.range4, 23]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 248 MovieClip "tower_stun" in Frame 33
onClipEvent (load) {
title = "Stun Tower";
desc = "Stun Tower";
cost = 700;
rate = 22;
this.range = 73 * (1 + (0.05 * _global.rangeskill));
this.range2 = 74 * (1 + (0.05 * _global.rangeskill));
this.range3 = 76 * (1 + (0.05 * _global.rangeskill));
this.range4 = 79 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 45000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 74\rCooldown: 22\rEffect:Stun(13%)", 2500, this.damage2, this.range2, 22], ["Damage: 17000\rRange: 76\rCooldown: 21\rEffect:Stun(16%)", 9000, this.damage3, this.range3, 21], ["Damage: 45000\rRange: 79\rCooldown: 20\rEffect:Stun(18%)", 18000, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 254 MovieClip "tower_money" in Frame 33
onClipEvent (load) {
title = "Money Tower";
desc = "Money Tower";
cost = 700;
rate = 25;
this.range = 75;
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 78 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 40000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 76\rCooldown: 24\rEffect:Steal Money(8)", 2500, this.damage2, this.range2, 24], ["Damage: 17000\rRange: 78\rCooldown: 23\rEffect:Steal(9)", 9000, this.damage3, this.range3, 23], ["Damage: 40000\rRange: 80\rCooldown:21\rEffect:Steal(11)", 18000, this.damage4, this.range4, 21]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 256 MovieClip "tower_explode" in Frame 33
onClipEvent (load) {
title = "Explosion";
desc = "Explosion";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 80 * (1 + (0.05 * _global.rangeskill));
this.range2 = 82 * (1 + (0.05 * _global.rangeskill));
this.range3 = 84 * (1 + (0.05 * _global.rangeskill));
this.range4 = 86 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 82\rCooldown: 28\rEffect:Slow", 3000, this.damage2, this.range2, 28], ["Damage: 8000\rRange: 84\rCooldown: 27\rEffect:Slow", 10000, this.damage3, this.range3, 27], ["Damage: 25000\rRange: 86\rCooldown:25\rEffect:Slow", 25000, this.damage4, this.range4, 25]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 336 MovieClip "shockshot" in Frame 33
onClipEvent (enterFrame) {
this._rotation = this._rotation + 30;
}
Instance of Symbol 246 MovieClip "tower_shock" in Frame 33
onClipEvent (load) {
title = "Shock";
desc = "Shock";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 75 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 35;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 75\rCooldown: 33\rEffect:Shock", 3000, this.damage2, this.range2, 33], ["Damage: 8000\rRange: 77\rCooldown: 30\rEffect:Shock", 10000, this.damage3, this.range3, 30], ["Damage: 25000\rRange: 80\rCooldown: 27\rEffect:Shock", 25000, this.damage4, this.range4, 27]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 258 MovieClip "tower_ultimate" in Frame 33
onClipEvent (load) {
title = "Ultimate Tower";
desc = "Ultimate Tower";
cost = 20000;
damage = 100000 * (1 + (0.05 * _global.attackskill));
this.damage2 = 200000 * (1 + (0.05 * _global.attackskill));
this.range = 85 * (1 + (0.05 * _global.rangeskill));
this.range2 = 95 * (1 + (0.05 * _global.rangeskill));
rate = 27;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 2;
upgrades = [["Damage: 200000\rRange: 95\rCooldown: 33\rEffect:Splash", 40000, this.damage2, this.range2, 24]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_ultimate")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 353 MovieClip "UpgradeTowerInfo" in Frame 33
onClipEvent (load) {
_visible = false;
swapDepths(100000);
}
Instance of Symbol 378 MovieClip "creep1" in Frame 33
onClipEvent (load) {
this._rotation = this._rotation + 45;
}
Instance of Symbol 380 MovieClip in Frame 33
onClipEvent (enterFrame) {
if (_root.timer > 50) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 381 MovieClip in Frame 33
onClipEvent (load) {
this._visible = false;
this.startDrag(true);
this.count = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(77) && (_global.sound == 1)) {
_global.sound = 0;
stopAllSounds();
}
if (Key.isDown(78) && (_global.sound == 0)) {
_global.sound = 1;
_root.playsound.start(0, 100000);
}
if (Key.isDown(80) && (_root.pauses == 0)) {
_root.pauses = 1;
}
if (Key.isDown(85) && (_root.pauses == 1)) {
_root.pauses = 0;
}
if (_root.pauses == 0) {
_root.levelnew++;
_root.checkkill();
this.count++;
if ((this.count % 30) == 0) {
_root.timer--;
}
if (_root.timer <= 0) {
if (_root.wave < _global.maxwaves) {
_root.newLevel();
}
_root.timer = 60;
}
if ((_root.lives <= 0) && (_root.gameover == 0)) {
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
if (_root.creepArray.length <= 0) {
_root.gotoAndPlay("lose9");
}
}
if (((((_root.wave >= _global.maxwaves) && (_root.creepArray.length <= 0)) && (_root.gameover == 0)) && (_root.kills >= 20)) && (_root.levelnew > 120)) {
_root.levelwin = 1;
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
_root.gotoAndPlay("win9");
}
}
}
Instance of Symbol 387 MovieClip "tinfo" in Frame 33
onClipEvent (load) {
this.swapDepths(99999);
}
Instance of Symbol 421 MovieClip "quitbox" in Frame 33
onClipEvent (load) {
this._visible = false;
}
Frame 34
stop();
stopAllSounds();
Frame 35
stop();
_root.gameover = 1;
stopAllSounds();
if (_root.levelwin == 0) {
_root.gotoAndPlay("lose9");
}
if (_root.lives == 20) {
_root.skillgained = 4;
} else if (_root.lives >= 10) {
_root.skillgained = 3;
} else {
_root.skillgained = 2;
}
storedskills = SharedObject.getLocal("flashskill");
if (storedskills.data.level9gain == undefined) {
_global.xpleft = _global.xpleft + _root.skillgained;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level9gain = _root.skillgained;
} else {
xplast = storedskills.data.level9gain;
skilldifferent = _root.skillgained - xplast;
if (skilldifferent > 0) {
_global.xpleft = _global.xpleft + skilldifferent;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level9gain = storedskills.data.level9gain + skilldifferent;
}
}
if ((storedskills.data.maxlevelbeat < 9) || (storedskills.data.maxlevelbeat == undefined)) {
storedskills.data.maxlevelbeat = 9;
}
if ((storedskills.data.level9score == undefined) || (_root.score > storedskills.data.level9score)) {
storedskills.data.level9score = _root.score;
}
Frame 36
function TowerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
}
function towerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
_root.UpgradeTowerInfo._visible = true;
if (tower.maxtier >= tower.tier) {
_root.UpgradeTowerInfo.UpgradeInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 1][2]) + "\rRange: ") + tower.upgrades[tower.tier - 1][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 1][4]) + "\rEffect: ") + tower.desc;
if (tower.tier == 1) {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.damage) + "\rRange: ") + tower.range) + "\rCoolDown: ") + tower.rate) + "\rEffect: ") + tower.desc;
} else {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 2][2]) + "\rRange: ") + tower.upgrades[tower.tier - 2][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 2][4]) + "\rEffect: ") + tower.desc;
}
_root.UpgradeTowerInfo.UpgradeButton.UpgradeButtonText.text = ("Upgrade [$" + tower.upgrades[tower.tier - 1][1]) + "]";
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
sellprice = Math.floor(tower.cost * 0.85);
_root.UpgradeTowerInfo.sellbutton.UpgradeButtonText.text = ("Sell [$" + sellprice) + "]";
if (tower.maxtier > tower.tier) {
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
} else {
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
}
} else {
_root.UpgradeTowerInfo.f.text = "";
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
_root.UpgradeTowerInfo.h.text = "";
}
}
function newLevel() {
if (_root.wave < 59) {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.02 * _root.gold);
_root.nowspeed = _root.waves[_root.wave - 1][2];
_root.nextspeed = _root.waves[_root.wave][2];
_root.nowhp = _root.waves[_root.wave - 1][1];
_root.nexthp = _root.waves[_root.wave][1];
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = _root.goldworth * 1.7;
_root.goldworth = _root.goldworth * (1 + (0.05 * _global.killbounty));
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", _root.waves[_root.wave - 1][3], _root.wave, "creep1", _root.waves[_root.wave - 1][2], _root.waves[_root.wave - 1][1], _root.goldworth);
_root["spawned" + _root.wave] = _root.waves[_root.wave - 1][0];
} else {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.03 * _root.gold);
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = Math.floor(_root.goldworth);
_root.goldworth = _root.goldworth * 1.2;
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
randspeed = 1.25 + random(3);
_root.nowspeed = randspeed;
_root.nextspeed = "???";
wavessince = _root.wave - 60;
hpmultiplier = Math.pow(1.2, wavessince);
_root.nowhp = Math.floor(_root.waves[59][1] * hpmultiplier);
_root.nexthp = Math.floor(_root.nowhp * 1.2);
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", 250, _root.wave, "creep1", _root.nowspeed, _root.nowhp, _root.goldworth);
_root["spawned" + _root.wave] = 30;
}
}
function spawn(level, creep, speed, health, gold) {
if (_root["spawned" + level] == 0) {
clearInterval(_root["spawnInterval" + level]);
} else {
_root["spawned" + level]--;
playanim = (level % 5) + 1;
_root.creepcount++;
_root[creep].duplicateMovieClip("c" + _root.creepcount, 20000 + _root.creepcount);
if (_root.creepcount > 10000) {
_root.creepcount = 1;
}
c = _root["c" + _root.creepcount];
c.creep.gotoAndStop(playanim);
c._x = _root.wp1._x;
c._y = _root.wp1._y;
c.health = health;
c.slowcount = 1;
c.isslow = 0;
c.maxhealth = health;
c.speed = speed;
c.maxspeed = c.speed;
c.ispoisoned = 0;
c.poisonedlevel = 0;
c.poisoncount = 0;
c.fullmax = c.maxspeed;
c.targ = 2;
c.rnd = 5;
c.shocked = 0;
c.shockcount = 1;
c.gold = gold;
c.iscorrode = 0;
c.isstunned = 0;
c.stuncount = 1;
c.splashslowed = 0;
c.splashslowedcount = 1;
_root.creepArray[_root.creepArray.length] = c;
c.onEnterFrame = function () {
if (_root.pauses == 0) {
this.health_bar.health._width = 30 * (this.health / this.maxhealth);
this.targX = (_root["wp" + this.targ]._x - 5) + this.rnd;
this.targY = (_root["wp" + this.targ]._y - 5) + this.rnd;
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this.rads = (this.dir * 3.141593) / 180;
if ((this.isstunned != 0) || (this.shocked == 1)) {
this.stuncount++;
if ((this.stuncount % 2) == 1) {
this._x = this._x + 2;
} else {
this._x = this._x - 2;
}
}
if (this.stuncount > 160) {
this.isstunned = 0;
this.stuncount = 1;
}
if (this.isslow != 0) {
this.speed = this.isslow * this.fullmax;
this.slowcount++;
}
if (this.slowcount > 160) {
this.speed = this.fullmax;
this.isslow = 0;
this.slowcount = 1;
}
if (this.splashslowed != 0) {
this.fullmax = this.maxspeed * this.splashslowed;
this.speed = this.fullmax;
if (this.isslow != 0) {
this.speed = this.fullmax * this.isslow;
}
this.splashslowedcount++;
}
if (this.splashslowedcount > 100) {
this.splashslowed = 0;
this.fullmax = this.maxspeed;
this.speed = this.fullmax;
this.splashslowedcount = 1;
}
if (this.iscorrode != 0) {
this.corrodecount++;
}
if (this.corrodecount > 200) {
this.iscorrode = 0;
this.corrdecount = 1;
}
if (this.ispoisoned == 1) {
if ((this.poisoncount % 40) == 0) {
this.health = this.health - this.poisonedlevel;
}
this.poisoncount++;
}
if (this.shocked == 1) {
this.shockcount++;
}
if (this.shockcount >= 80) {
this.shocked = 0;
this.shockcount = 1;
}
if (this.poisoncount > 200) {
this.ispoisoned = 0;
this.poisoncount = 0;
}
if ((this.isstunned == 0) && (this.shocked == 0)) {
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
}
d = Math.pow(this._x - this.targX, 2) + Math.pow(this._y - this.targY, 2);
if (d < 25) {
this.targ++;
if (this.targ > 18) {
_root.leak(this);
this._x = _root.wp1._x;
this._y = _root.wp1._y;
this.targ = 2;
}
}
this.r = this.dir;
if ((this._rotation + 10) < this.r) {
this._rotation = this._rotation + 10;
} else if ((this._rotation - 10) > this.r) {
this._rotation = this._rotation - 10;
} else {
this._rotation = r;
}
}
};
}
}
function fire(from, to, speed, acc, maxpeed, projectile, damage, towerid) {
_root.particlecount++;
_root[projectile].duplicateMovieClip("p" + _root.particlecount, 2000 + _root.particlecount);
r = _root["p" + _root.particlecount];
r._x = from._x;
r._y = from._y;
r.tier = from.tier;
r.type = from.type;
r.targ = to;
r.speed = speed;
r.acc = acc;
r.maxspeed = maxspeed;
r.damage = damage;
r.projectile = projectile;
r.towerid = towerid;
if (_root.particlecount > 300) {
_root.particlecount = 0;
}
r.onEnterFrame = function () {
if (_root.pauses == 0) {
if (("" + this.targ) != "") {
this.targX = this.targ._x;
this.targY = this.targ._y;
} else {
this._rotation = (Math.atan2(this.targ._y - this._y, this.targ._x - this._x) * 180) / 3.141593;
if (_root.creepArray.length <= 0) {
this.removeMovieClip();
} else {
w = 0;
if (w <= _root.creepArray.length) {
this.targ = _root.creepArray[w];
}
}
}
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this._rotation = this.dir + 90;
this.rads = (this.dir * 3.141593) / 180;
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
if (this.speed < this.maxspeed) {
this.speed = this.speed + this.acc;
}
d = ((this._x - this.targX) * (this._x - this.targX)) + ((this._y - this.targY) * (this._y - this.targY));
if (d < 25) {
if (this.towerid == 10) {
randcrit = random(100);
if ((this.tier == 1) && (randcrit < 11)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 2) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 3) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 4) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 5) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
} else if (this.towerid == 4) {
this.targ.corrodecount = 1;
if (this.tier == 1) {
this.targ.iscorrode = 0.06;
} else if (this.tier == 2) {
this.targ.iscorrode = 0.12;
} else if (this.tier == 3) {
this.targ.iscorrode = 0.2;
} else if (this.tier == 4) {
this.targ.iscorrode = 0.32;
} else if (this.tier == 5) {
this.targ.iscorrode = 0.45;
}
}
this.targ.health = this.targ.health - (this.damage * (1 + this.targ.iscorrode));
if (this.towerid == 7) {
randstun = random(100);
if ((this.tier == 1) && (randstun < 10)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 2) && (randstun < 14)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 3) && (randstun < 17)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 4) && (randstun < 20)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
}
} else if (this.towerid == 5) {
this.targ.ispoisoned = 1;
this.targ.poisoncount = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < 4225) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[i].ispoisoned = 1;
_root.creepArray[i].poisoncount = 1;
}
i++;
}
if (this.tier == 1) {
this.targ.poisonedlevel = 150;
} else if (this.tier == 2) {
this.targ.poisonedlevel = 600;
} else if (this.tier == 3) {
this.targ.poisonedlevel = 2700;
} else if (this.tier == 4) {
this.targ.poisonedlevel = 10000;
}
_root.poisonball.duplicateMovieClip("poisonball" + _root.splashct, 6300 + _root.splashct);
_root["poisonball" + _root.splashct]._x = this._x;
_root["poisonball" + _root.splashct]._y = this._y;
_root["poisonball" + _root.splashct]._width = 80;
_root["poisonball" + _root.splashct]._height = 80;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 6) {
if (this.targ.health < (0.35 * this.targ.maxhealth)) {
randdeath = random(100);
if ((this.tier == 1) && (randdeath < 8)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 2) && (randdeath < 12)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 3) && (randdeath < 16)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 4) && (randdeath < 20)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
}
}
} else if (this.towerid == 8) {
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < 10000) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
if (this.tier == 1) {
_root.creepArray[k].splashslowed = 0.6;
} else if (this.tier == 2) {
_root.creepArray[k].splashslowed = 0.55;
} else if (this.tier == 3) {
_root.creepArray[k].splashslowed = 0.5;
} else if (this.tier == 4) {
_root.creepArray[k].splashslowed = 0.4;
}
_root.creepArray[k].splashslowedcount = 0;
}
k++;
}
_root.explodingshot.duplicateMovieClip("explodingshot" + _root.explodecount, 5100 + _root.explodecount);
_root["explodingshot" + _root.explodecount]._x = this._x;
_root["explodingshot" + _root.explodecount]._y = this._y;
_root.explodecount++;
if (_root.explodecount > 20) {
_root.explodecount = 1;
}
} else if (this.towerid == 26) {
if (this.tier == 1) {
shockwidth = 75;
shockchance = 8;
} else if (this.tier == 2) {
shockwidth = 80;
shockchance = 10;
} else if (this.tier == 3) {
shockwidth = 85;
shockchance = 12;
} else if (this.tier == 4) {
shockwidth = 90;
shockchance = 14;
}
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < (shockwidth * shockwidth)) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
shockper = random(100);
if (shockper < shockchance) {
if (_root.creepArray[k].shocked == 0) {
_root.creepArray[k].shocked = 1;
_root.creepArray[k].splashslowedcount = 1;
}
}
}
k++;
}
_root.shockshot.duplicateMovieClip("shockshot" + _root.shockct, 26500 + _root.shockct);
_root["shockshot" + _root.shockct]._x = this._x;
_root["shockshot" + _root.shockct]._y = this._y;
_root["shockshot" + _root.shockct]._width = 2 * shockwidth;
_root["shockshot" + _root.shockct]._height = 2 * shockwidth;
_root.shockct++;
if (_root.shockct > 20) {
_root.shockct = 1;
}
} else if (this.towerid == 22) {
if (this.tier == 1) {
staticval = 5;
} else if (this.tier == 2) {
staticval = 7;
} else if (this.tier == 3) {
staticval = 10;
}
staticchance = random(100);
if (staticchance < staticval) {
damagetaken = this.targ.maxhealth - this.targ.health;
(this.health - this.health) - (0.5 * damagetaken);
_root.lighteffect.duplicateMovieClip("lighteffect" + _root.staticcount, 23000 + _root.staticcount);
_root["lighteffect" + _root.staticcount]._x = this._x;
_root["lighteffect" + _root.staticcount]._y = this._y;
_root.staticcount++;
if (_root.staticcount > 50) {
_root.staticcount = 1;
}
}
} else if (this.towerid == 25) {
stealval = random(100);
if (this.tier == 1) {
this.stealmax = 6;
} else if (this.tier == 2) {
this.stealmax = 9;
} else if (this.tier == 3) {
this.stealmax = 10;
} else if (this.tier == 4) {
this.stealmax = 12;
}
if (stealval < this.stealmax) {
_root.gold = _root.gold + this.targ.gold;
_root.goldeffect.duplicateMovieClip("goldeffect" + _root.goldeffectct, 26000 + _root.goldeffectct);
_root["goldeffect" + _root.goldeffectct]._x = this._x;
_root["goldeffect" + _root.goldeffectct]._y = this._y;
_root.goldeffectct++;
if (_root.goldeffectct > 20) {
_root.goldeffectct = 1;
}
}
} else if (this.towerid == 999) {
if (this.targ.health < (0.65 * this.targ.maxhealth)) {
randteleport = random(100);
if ((this.tier == 1) && (randteleport < 8)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
_root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 2) && (randteleport < 9)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 3) && (randteleport < 10)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 4) && (randteleport < 11)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 5) && (randteleport < 13)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
}
}
} else if (this.towerid == 100) {
if (this.tier == 1) {
spradius = 1225;
spwidth = 35;
} else if (this.tier == 2) {
spradius = 1600;
spwidth = 40;
} else if (this.tier == 3) {
spradius = 2025;
spwidth = 45;
} else if (this.tier == 4) {
spradius = 2500;
spwidth = 50;
} else if (this.tier == 5) {
spradius = 3600;
spwidth = 60;
}
j = 0;
while (j <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[j]._x, 2) + Math.pow(this._y - _root.creepArray[j]._y, 2);
if (d < spradius) {
if ((("" + _root.creepArray[j]) != "") && (_root.creepArray[j] != this.targ)) {
_root.creepArray[j].health = _root.creepArray[j].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[j].splashslowed = 1;
_root.creepArray[j].splashslowedcount = 1;
}
j++;
}
_root.iceball.duplicateMovieClip("iceball" + _root.splashct, 5200 + _root.splashct);
_root["iceball" + _root.splashct]._x = this._x;
_root["iceball" + _root.splashct]._y = this._y;
_root["iceball" + _root.splashct]._width = spwidth;
_root["iceball" + _root.splashct]._height = spwidth;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 3) {
if (this.tier == 1) {
this.targ.isslow = 0.6;
}
if (this.tier == 2) {
this.targ.isslow = 0.5;
}
if (this.tier == 3) {
this.targ.isslow = 0.4;
}
if (this.tier == 4) {
this.targ.isslow = 0.35;
}
if (this.tier == 5) {
this.targ.isslow = 0.3;
}
this.targ.slowcount = 1;
} else if (this.towerid == 2) {
_root.explosion.duplicateMovieClip("explosion" + _root.explosioncount, 5000 + _root.explosioncount);
_root["explosion" + _root.explosioncount]._x = this._x;
_root["explosion" + _root.explosioncount]._y = this._y;
_root["explosion" + _root.explosioncount]._width = 100;
_root["explosion" + _root.explosioncount]._height = 100;
_root.explosioncount++;
if (_root.explosioncount > 40) {
_root.explosioncount = 1;
}
splashrad = 50;
splashrad2 = splashrad * splashrad;
i = 0;
while (i <= _root.creepArray.length) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < splashrad2) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 6000)));
}
}
i++;
}
}
if (this.targ.health <= 0) {
this.targ.isDead = 1;
}
this.removeMovieClip();
}
}
};
}
function checkkill() {
n = 0;
while (n < _root.creepArray.length) {
if ((_root.creepArray[n].health <= 0) || (_root.creepArray[n] == "undefined")) {
_root.kills++;
_root.aftereffect.duplicateMovieClip("aftereffect" + _root.effectcount, 50000 + _root.effectcount);
_root["aftereffect" + _root.effectcount]._x = _root.creepArray[n]._x;
_root["aftereffect" + _root.effectcount]._y = _root.creepArray[n]._y;
_root.effectcount++;
if (_root.effectcount > 50) {
_root.effectcount = 1;
}
if (((_root.creepArray[n].gold != "undefined") && (_root.creepArray[n].gold != "null")) && (_root.creepArray[n].gold > 0)) {
_root.gold = _root.gold + _root.creepArray[n].gold;
_root.score = _root.score + _root.creepArray[n].maxhealth;
}
_root.creepArray[n].removeMovieClip();
_root.creepArray.splice(n, 1);
}
n++;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
function kill(creep) {
_root.kills++;
if (_root.kills >= _root.waves[_root.wave - 1][0]) {
_root.kills = 0;
if (_root.wave < _global.maxwaves) {
_root.newLevel();
}
}
creep.onEnterFrame = function () {
this.removeMovieClip();
};
}
function upgrade() {
a = _root.selectedTower;
b = a.tier - 1;
if (int(a.upgrades[b][1]) <= _root.gold) {
a.damage = int(a.upgrades[b][2]);
a.range = a.upgrades[b][3];
a.rate = a.upgrades[b][4];
a.splash = a.upgrades[b][5];
a.slow = a.upgrades[b][6];
a.cost = a.cost + int(a.upgrades[b][1]);
a.tier++;
_root.towerInfo(a);
_root.gold = _root.gold - int(a.upgrades[b][1]);
updateInfoBar();
}
}
function sell() {
tower = _root.selectedTower;
if (((tower != "undefined") && (tower != "null")) && (tower != "")) {
sellprice = Math.floor(tower.cost * 0.85);
if (sellprice != "undefined") {
_root.gold = _root.gold + sellprice;
}
_root.range._x = 1000;
_root.range._height = 0;
_root.range._width = 0;
if (tower.maxtier == 2) {
_root.gems++;
}
tower.removeMovieClip();
_root.UpgradeTowerInfo._visible = false;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
stop();
_root.skillstats.swapDepths(9090);
_root.skillstats.removeMovieClip();
_root.challengescore._x = 2000;
_root.challengescore._y = 2000;
_root.levelwin = 0;
_root.gold = 100;
_root.gems = _global.gems;
_root.attackskill = _global.attackskill;
_root.rangeskill = _global.rangeskill;
_root.killbounty = _global.killbounty;
_root.techlevel = _global.techlevel;
if (_global.startmoneylevel == 1) {
_root.gold = 150;
} else if (_global.startmoneylevel == 2) {
_root.gold = 200;
} else if (_global.startmoneylevel == 3) {
_root.gold = 250;
} else if (_global.startmoneylevel == 4) {
_root.gold = 400;
} else if (_global.startmoneylevel == 5) {
_root.gold = 600;
}
_root.wave = 0;
_root.levelnew = 1;
_root.effectcount = 1;
_root.staticcount = 1;
_root.shockct = 1;
_root.gameover = 0;
_root.towerCount = 0;
_root.creepcount = 1;
_root.goldeffectct = 1;
_root.kills = 0;
_root.pauses = 0;
_root.creepleaks = 0;
_root.timer = 45;
_root.lives = 20;
_root.goldworth = 0;
_root.creepArray = [];
_global.sound = 1;
_root.particlecount = 1;
_root.splashct = 1;
_root.pwncount = 1;
_root.explodecount = 1;
_root.score = 0;
_root.playsound = new Sound(this);
_root.playsound.attachSound("music2");
if (_global.sound == 1) {
_root.playsound.start(0, 100000);
}
_root.playsound1 = new Sound(this);
_root.playsound1.attachSound("sndplasma");
_root.playsound2 = new Sound(this);
_root.playsound2.attachSound("sndrocket");
_root.playsound3 = new Sound(this);
_root.playsound3.attachSound("sndbullet");
_root.playsound4 = new Sound(this);
_root.playsound4.attachSound("sndbullet1");
_root.playsound5 = new Sound(this);
_root.playsound5.attachSound("sndexplode");
_root.playsound6 = new Sound(this);
_root.playsound6.attachSound("sndlaser");
_global.maxwaves = 74;
_root.wavemax = _global.maxwaves;
_root.waves = [[20, 125, 3.75, 667], [20, 146, 4.5, 600], [20, 171, 2.75, 400], [20, 198, 3.75, 667], [20, 228, 4.05, 600], [20, 273, 3.75, 667], [20, 319, 1.5, 266], [2, 1190, 5.25, 600], [20, 438, 3, 667], [20, 469, 3.75, 200], [20, 514, 3, 667], [20, 704, 2.75, 400], [20, 824, 3, 650], [20, 963, 5, 700], [20, 1128, 3.25, 150], [2, 6577, 2.75, 800], [20, 1545, 3.75, 600], [20, 1806, 4, 700], [20, 2114, 4.25, 650], [20, 2474, 3.5, 180], [20, 2900, 3.25, 500], [20, 3402, 3.4, 525], [20, 3987, 2.8, 475], [20, 4676, 3, 600], [2, 21092, 3.141592, 620], [20, 6429, 3.5, 150], [20, 7538, 4, 700], [20, 8838, 3.3, 600], [20, 10364, 3.4, 590], [20, 12080, 3.12, 550], [20, 14279, 3.3, 600], [20, 16777, 3.2, 570], [2, 72576, 2.5, 800], [20, 23164, 3, 600], [20, 27220, 3.15, 177], [20, 31983, 3.2, 500], [20, 37581, 3.35, 600], [20, 42056, 3.4, 620], [20, 51896, 3.5, 630], [20, 60966, 3.75, 670], [20, 71938, 3, 700], [20, 84888, 3.2, 650], [20, 100168, 3.3, 160], [20, 118199, 3.4, 675], [20, 139475, 3.5, 690], [20, 164581, 4, 800], [20, 194205, 3, 650], [20, 230038, 3.5, 700], [2, 1306005, 4, 1000], [20, 319088, 3.5, 700], [20, 382906, 3.4, 150], [20, 459487, 3.33, 590], [20, 551386, 4.5, 750], [20, 661662, 4, 200], [20, 793954, 3.4, 600], [20, 952795, 3.6, 625], [2, 5783400, 3.7, 700], [20, 1372024, 3.8, 710], [20, 1646431, 4, 650], [20, 1975717, 5, 250]];
_root.nowhp = 0;
_root.nowspeed = 0;
_root.nexthp = _root.waves[0][1];
_root.nextspeed = 2.5;
Instance of Symbol 228 MovieClip "wp1" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp2" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp3" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp4" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp5" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp6" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp7" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp8" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp9" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp10" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp11" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp12" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp13" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp14" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp15" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp16" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp17" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp18" in Frame 36
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 236 MovieClip in Frame 36
on (press) {
_root.marker.active = 1;
_root.marker.tower = "basic";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Tower. Shoots bullets at enemies. 80 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 238 MovieClip in Frame 36
on (press) {
_root.marker.active = 1;
_root.marker.tower = "splash";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Splash Tower. Shoots Exploding bullets at enemies. 29 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 240 MovieClip in Frame 36
on (press) {
_root.marker.active = 1;
_root.marker.tower = "slow";
_root.marker.cost = 150;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Slow Tower. Shoots shots that slow the enemy. 100 base damage. Cost: $150";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 242 MovieClip in Frame 36
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "poison";
_root.marker.cost = 500;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Splash Poison Tower. Splashes Poison(150/sec for level 1) to hurt the enemy. 300 base damage. Cost: $500, tech level 1 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 244 MovieClip in Frame 36
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "static";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Static tower. 6% chance to make target take 50% of the damage that is has lost so far. 500 base damage. Cost: $650. Tech level 1.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 246 MovieClip in Frame 36
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "shock";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Shock tower. Has the ability to random stun any enemy within its radius. Enemies cannot be stunned if already under effect of stun. 500 base damage. Cost: $1000. Tech level 4 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 248 MovieClip in Frame 36
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "stun";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Stun Tower. Has a 10% chance of stunning enemies. 500 base damage. Cost: $700. Requires Tech level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 252 MovieClip in Frame 36
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "death";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Instant death tower. 8% chance to instantly kill if target is under 35% HP. 500 base damage. Cost: $650. Tech Level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 254 MovieClip in Frame 36
on (press) {
if (_root.techlevel >= 2) {
_root.marker.active = 1;
_root.marker.tower = "money";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Money Tower. Has a 5% chance of stealing money from creeps it hits at level 1. 500 Damage. Cost: $700. Tech Level 2.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 256 MovieClip in Frame 36
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "explode";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Exploding Tower. Damages and slows all enemies in a radius of itself. 500 base damage. Cost: $1000. Tech Level 4.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 258 MovieClip in Frame 36
on (press) {
if (_root.gems > 0) {
if (_root.techlevel >= 5) {
_root.marker.active = 1;
_root.marker.tower = "ultimate";
_root.marker.cost = 20000;
_root.tinfo._visible = false;
}
}
}
on (rollOver) {
_root.buyinfo = "Ultimate Tower. Extreme Damage and splash. 100000 damage. Cost: $20000 and 1 Gem. Tech level 5 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 236 MovieClip "tower_basic" in Frame 36
onClipEvent (load) {
title = "Basic Damage Tower";
desc = "Basic Damage Tower";
cost = 50;
this.range = 65 * (1 + (0.05 * _global.rangeskill));
this.range2 = 66 * (1 + (0.05 * _global.rangeskill));
this.range3 = 67 * (1 + (0.05 * _global.rangeskill));
this.range4 = 68 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 80;
damage = 80 * (1 + (0.05 * _global.attackskill));
this.damage2 = 240 * (1 + (0.05 * _global.attackskill));
this.damage3 = 720 * (1 + (0.05 * _global.attackskill));
this.damage4 = 2160 * (1 + (0.05 * _global.attackskill));
rate = 19;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 240\rRange: 66\rCooldown: 18\rEffect: None", 120, this.damage2, this.range2, 18], ["Damage: 720\rRange: 67\rCooldown: 17\rEffect: None", 300, this.damage3, this.range3, 17], ["Damage: 2160\rRange: 68\rCooldown: 17\rEffect: None", 880, this.damage4, this.range4, 17]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_basic")) {
if (target == undefined) {
target = 0;
}
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 264 MovieClip "range" in Frame 36
onClipEvent (enterFrame) {
if ((_root.selectedTower == "") && (_root.marker.active == 0)) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 267 MovieClip "marker" in Frame 36
onClipEvent (load) {
active = 0;
inpath = 0;
this.swapDepths(9998);
}
onClipEvent (enterFrame) {
if (active == 1) {
this.startDrag(true);
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((maphit == 1) && (inpath == 0)) {
this.gotoAndStop(1);
_root.range.gotoAndStop(1);
} else {
this.gotoAndStop(2);
_root.range.gotoAndStop(2);
}
_root.range._x = _x;
_root.range._y = _y;
_root.range._width = _root["tower_" + tower].range * 2;
_root.range._height = _root["tower_" + tower].range * 2;
}
if (Key.isDown(32)) {
active = 0;
trace(1);
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
on (press) {
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((((maphit == 1) && (inpath == 0)) && (_root.gold >= this.cost)) && (_root.pauses == 0)) {
if (this.hitTest(_root.nextwave) == false) {
if (_root.marker.tower == "ultimate") {
if (_root.gems > 0) {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gems--;
_root.gold = _root.gold - this.cost;
}
} else {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gold = _root.gold - this.cost;
}
}
}
if (maphit == 0) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
if (this.hitTest(_root.nextwave)) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
Instance of Symbol 238 MovieClip "tower_splash" in Frame 36
onClipEvent (load) {
title = "Splash Tower";
desc = "Splash Tower";
cost = 50;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 73 * (1 + (0.05 * _global.rangeskill));
this.range4 = 75 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 34 * (1 + (0.05 * _global.attackskill));
this.damage2 = 102 * (1 + (0.05 * _global.attackskill));
this.damage3 = 306 * (1 + (0.05 * _global.attackskill));
this.damage4 = 918 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 102\rRange: 72\rCooldown: 21\rEffect: Splash", 120, this.damage2, this.range2, 21], ["Damage: 306\rRange: 73\rCooldown: 21\rEffect: Splash", 300, this.damage3, this.range3, 21], ["Damage: 918\rRange: 75\rCooldown: 20\rEffect: Splash", 880, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_splash")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > ((range * range) + 81)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 289 MovieClip "explosion" in Frame 36
onClipEvent (load) {
if (this._name == "explosion") {
this._visible = false;
}
}
Instance of Symbol 240 MovieClip "tower_slow" in Frame 36
onClipEvent (load) {
title = "Slow tower";
desc = "Slow tower";
cost = 150;
this.range = 68 * (1 + (0.05 * _global.rangeskill));
this.range2 = 69 * (1 + (0.05 * _global.rangeskill));
this.range3 = 70 * (1 + (0.05 * _global.rangeskill));
this.range4 = 71 * (1 + (0.05 * _global.rangeskill));
this.range5 = 72 * (1 + (0.05 * _global.rangeskill));
damage = 100 * (1 + (0.05 * _global.attackskill));
this.damage2 = 500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2200 * (1 + (0.05 * _global.attackskill));
this.damage4 = 10500 * (1 + (0.05 * _global.attackskill));
this.damage5 = 33000 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 500\rRange: 69\rCooldown: 22\rEffect: Slow", 500, this.damage2, this.range2, 22], ["Damage: 2200\rRange: 70\rCooldown: 21\rEffect: Slow", 1250, this.damage3, this.range3, 21], ["Damage: 10500\rRange: 71\rCooldown: 21\rEffect: Slow", 3150, this.damage4, this.range4, 21], ["Damage: 33000\rRange: 72\rColldown:19\rEffect: Slow", 8000, this.damage5, this.range5, 19]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_slow")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 314 MovieClip in Frame 36
on (press) {
_root.marker.active = 1;
_root.marker.tower = "rust";
_root.marker.cost = 400;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Rust Tower. Shoots shots that rust the enemy, causing them to take more damage. 300 base damage. Ultra Fast. Cost: $400";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 314 MovieClip "tower_rust" in Frame 36
onClipEvent (load) {
title = "Rust Tower";
desc = "Rust Tower";
cost = 400;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range5 = 80 * (1 + (0.05 * _global.rangeskill));
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 930 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 5000 * (1 + (0.05 * _global.attackskill));
this.damage5 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 9;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 930\rRange: 76\rCooldown: 9\rEffect: Rust", 1200, this.damage2, this.range2, 9], ["Damage: 2000\rRange: 77\rCooldown: 8\rEffect: Rust", 3000, this.damage3, this.range3, 8], ["Damage: 5000\rRange: 78\rCooldown: 8\rEffect: Rust", 6000, this.damage4, this.range4, 8], ["Damage: 15000\rRange: 80\rCooldown: 7\rEffect:Rust", 13500, this.damage5, this.range5, 7]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 242 MovieClip "tower_poison" in Frame 36
onClipEvent (load) {
title = "Splash Poison";
desc = "Splash Poison";
cost = 500;
this.range = 70;
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 75 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 12000 * (1 + (0.05 * _global.attackskill));
rate = 23;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 72\rCooldown: 22\rEffect:Poison(600)", 1500, this.damage2, this.range2, 22], ["Damage: 4000\rRange: 75\rCooldown: 21\rEffect:Poison(2700)", 5000, this.damage3, this.range3, 21], ["Damage: 12000\rRange:78\rCooldown: 20\rEffect:Poison(10000)", 11500, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 244 MovieClip "tower_static" in Frame 36
onClipEvent (load) {
title = "Static";
desc = "Static";
cost = 500;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 80 * (1 + (0.05 * _global.rangeskill));
this.range4 = 85 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 25;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 77\rCooldown: 24\rEffect:Static(7)", 1500, this.damage2, this.range2, 24], ["Damage: 4000\rRange: 80\rCooldown: 23\rEffect:Static(10)", 5000, this.damage3, this.range3, 23], ["Damage: 15000\rRange: 85\rCooldown:22\rEffect:Static(12)", 11000, this.damage4, this.range4, 22]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 252 MovieClip "tower_death" in Frame 36
onClipEvent (load) {
title = "Instant Death";
desc = "Instant Death";
cost = 650;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 79 * (1 + (0.05 * _global.rangeskill));
this.range4 = 82 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 650 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 15000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 35000 * (1 + (0.05 * _global.attackskill));
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3000)\rRange: 77\rCooldown: 28\rEffect:Death(12%)", 2000, this.damage2, this.range2, 28], ["Damage: 15000\rRange: 79\rCooldown: 26\rEffect:Death(16%)", 7000, this.damage3, this.range3, 26], ["Damage: 35000\rRange:82\rCooldown: 23 \rEffect:Death(19%)", 13500, this.damage4, this.range4, 23]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 248 MovieClip "tower_stun" in Frame 36
onClipEvent (load) {
title = "Stun Tower";
desc = "Stun Tower";
cost = 700;
rate = 22;
this.range = 73 * (1 + (0.05 * _global.rangeskill));
this.range2 = 74 * (1 + (0.05 * _global.rangeskill));
this.range3 = 76 * (1 + (0.05 * _global.rangeskill));
this.range4 = 79 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 45000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 74\rCooldown: 22\rEffect:Stun(13%)", 2500, this.damage2, this.range2, 22], ["Damage: 17000\rRange: 76\rCooldown: 21\rEffect:Stun(16%)", 9000, this.damage3, this.range3, 21], ["Damage: 45000\rRange: 79\rCooldown: 20\rEffect:Stun(18%)", 18000, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 254 MovieClip "tower_money" in Frame 36
onClipEvent (load) {
title = "Money Tower";
desc = "Money Tower";
cost = 700;
rate = 25;
this.range = 75;
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 78 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 40000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 76\rCooldown: 24\rEffect:Steal Money(8)", 2500, this.damage2, this.range2, 24], ["Damage: 17000\rRange: 78\rCooldown: 23\rEffect:Steal(9)", 9000, this.damage3, this.range3, 23], ["Damage: 40000\rRange: 80\rCooldown:21\rEffect:Steal(11)", 18000, this.damage4, this.range4, 21]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 256 MovieClip "tower_explode" in Frame 36
onClipEvent (load) {
title = "Explosion";
desc = "Explosion";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 80 * (1 + (0.05 * _global.rangeskill));
this.range2 = 82 * (1 + (0.05 * _global.rangeskill));
this.range3 = 84 * (1 + (0.05 * _global.rangeskill));
this.range4 = 86 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 82\rCooldown: 28\rEffect:Slow", 3000, this.damage2, this.range2, 28], ["Damage: 8000\rRange: 84\rCooldown: 27\rEffect:Slow", 10000, this.damage3, this.range3, 27], ["Damage: 25000\rRange: 86\rCooldown:25\rEffect:Slow", 25000, this.damage4, this.range4, 25]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 336 MovieClip "shockshot" in Frame 36
onClipEvent (enterFrame) {
this._rotation = this._rotation + 30;
}
Instance of Symbol 246 MovieClip "tower_shock" in Frame 36
onClipEvent (load) {
title = "Shock";
desc = "Shock";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 75 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 35;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 75\rCooldown: 33\rEffect:Shock", 3000, this.damage2, this.range2, 33], ["Damage: 8000\rRange: 77\rCooldown: 30\rEffect:Shock", 10000, this.damage3, this.range3, 30], ["Damage: 25000\rRange: 80\rCooldown: 27\rEffect:Shock", 25000, this.damage4, this.range4, 27]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 258 MovieClip "tower_ultimate" in Frame 36
onClipEvent (load) {
title = "Ultimate Tower";
desc = "Ultimate Tower";
cost = 20000;
damage = 100000 * (1 + (0.05 * _global.attackskill));
this.damage2 = 200000 * (1 + (0.05 * _global.attackskill));
this.range = 85 * (1 + (0.05 * _global.rangeskill));
this.range2 = 95 * (1 + (0.05 * _global.rangeskill));
rate = 27;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 2;
upgrades = [["Damage: 200000\rRange: 95\rCooldown: 33\rEffect:Splash", 40000, this.damage2, this.range2, 24]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_ultimate")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 353 MovieClip "UpgradeTowerInfo" in Frame 36
onClipEvent (load) {
_visible = false;
swapDepths(100000);
}
Instance of Symbol 378 MovieClip "creep1" in Frame 36
onClipEvent (load) {
this._rotation = this._rotation + 45;
}
Instance of Symbol 380 MovieClip in Frame 36
onClipEvent (enterFrame) {
if (_root.timer > 50) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 381 MovieClip in Frame 36
onClipEvent (load) {
this._visible = false;
this.startDrag(true);
this.count = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(77) && (_global.sound == 1)) {
_global.sound = 0;
stopAllSounds();
}
if (Key.isDown(78) && (_global.sound == 0)) {
_global.sound = 1;
_root.playsound.start(0, 100000);
}
if (Key.isDown(80) && (_root.pauses == 0)) {
_root.pauses = 1;
}
if (Key.isDown(85) && (_root.pauses == 1)) {
_root.pauses = 0;
}
if (_root.pauses == 0) {
_root.levelnew++;
_root.checkkill();
this.count++;
if ((this.count % 30) == 0) {
_root.timer--;
}
if (_root.timer <= 0) {
if (_root.wave < _global.maxwaves) {
_root.newLevel();
}
_root.timer = 60;
}
if ((_root.lives <= 0) && (_root.gameover == 0)) {
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
if (_root.creepArray.length <= 0) {
_root.gotoAndPlay("lose10");
}
}
if (((((_root.wave >= _global.maxwaves) && (_root.creepArray.length <= 0)) && (_root.gameover == 0)) && (_root.kills >= 20)) && (_root.levelnew > 120)) {
_root.levelwin = 1;
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
_root.gotoAndPlay("win10");
}
}
}
Instance of Symbol 387 MovieClip "tinfo" in Frame 36
onClipEvent (load) {
this.swapDepths(99999);
}
Instance of Symbol 421 MovieClip "quitbox" in Frame 36
onClipEvent (load) {
this._visible = false;
}
Frame 37
stop();
stopAllSounds();
Frame 38
stop();
_root.gameover = 1;
stopAllSounds();
if (_root.levelwin == 0) {
_root.gotoAndPlay("lose10");
}
if (_root.lives == 20) {
_root.skillgained = 4;
} else if (_root.lives >= 10) {
_root.skillgained = 3;
} else {
_root.skillgained = 2;
}
storedskills = SharedObject.getLocal("flashskill");
if (storedskills.data.level10gain == undefined) {
_global.xpleft = _global.xpleft + _root.skillgained;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level10gain = _root.skillgained;
} else {
xplast = storedskills.data.level10gain;
skilldifferent = _root.skillgained - xplast;
if (skilldifferent > 0) {
_global.xpleft = _global.xpleft + skilldifferent;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.level10gain = storedskills.data.level10gain + skilldifferent;
}
}
if ((storedskills.data.maxlevelbeat < 10) || (storedskills.data.maxlevelbeat == undefined)) {
storedskills.data.maxlevelbeat = 10;
}
if ((storedskills.data.level10score == undefined) || (_root.score > storedskills.data.level10score)) {
storedskills.data.level10score = _root.score;
}
Frame 39
stop();
Frame 40
function TowerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
}
function towerInfo(tower) {
_root.selectedTower = tower;
_root.range._x = tower._x;
_root.range._y = tower._y;
_root.range._width = tower.range * 2;
_root.range._height = tower.range * 2;
_root.UpgradeTowerInfo._visible = true;
if (tower.maxtier >= tower.tier) {
_root.UpgradeTowerInfo.UpgradeInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 1][2]) + "\rRange: ") + tower.upgrades[tower.tier - 1][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 1][4]) + "\rEffect: ") + tower.desc;
if (tower.tier == 1) {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.damage) + "\rRange: ") + tower.range) + "\rCoolDown: ") + tower.rate) + "\rEffect: ") + tower.desc;
} else {
_root.UpgradeTowerInfo.TowerInfoText.text = (((((("Damage: " + tower.upgrades[tower.tier - 2][2]) + "\rRange: ") + tower.upgrades[tower.tier - 2][3]) + "\rCoolDown: ") + tower.upgrades[tower.tier - 2][4]) + "\rEffect: ") + tower.desc;
}
_root.UpgradeTowerInfo.UpgradeButton.UpgradeButtonText.text = ("Upgrade [$" + tower.upgrades[tower.tier - 1][1]) + "]";
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
sellprice = Math.floor(tower.cost * 0.85);
_root.UpgradeTowerInfo.sellbutton.UpgradeButtonText.text = ("Sell [$" + sellprice) + "]";
if (tower.maxtier > tower.tier) {
_root.UpgradeTowerInfo.UpgradeButton._visible = true;
} else {
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
}
} else {
_root.UpgradeTowerInfo.f.text = "";
_root.UpgradeTowerInfo.UpgradeButton._visible = false;
_root.UpgradeTowerInfo.UpgradeInfoText.text = "Maximum Level reached";
_root.UpgradeTowerInfo.h.text = "";
}
}
function newLevel() {
if (_root.wave < 59) {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.02 * _root.gold);
_root.nowspeed = _root.waves[_root.wave - 1][2];
_root.nextspeed = _root.waves[_root.wave][2];
_root.nowhp = _root.waves[_root.wave - 1][1];
_root.nexthp = _root.waves[_root.wave][1];
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = _root.goldworth * 1.7;
_root.goldworth = _root.goldworth * (1 + (0.05 * _global.killbounty));
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", _root.waves[_root.wave - 1][3], _root.wave, "creep1", _root.waves[_root.wave - 1][2], _root.waves[_root.wave - 1][1], _root.goldworth);
_root["spawned" + _root.wave] = _root.waves[_root.wave - 1][0];
} else {
_root.levelnew = 1;
_root.kills = 0;
_root.wave++;
_root.gold = Math.floor(1.03 * _root.gold);
_root.goldworth = Math.pow(1.108, _root.wave);
_root.goldworth = Math.floor(_root.goldworth);
_root.goldworth = _root.goldworth * 1.2;
_root.goldworth = Math.floor(_root.goldworth);
if (_root.waves[_root.wave - 1][0] == 2) {
_root.goldworth = _root.goldworth * 10;
}
randspeed = 2.25 + random(3);
_root.nowspeed = randspeed;
_root.nextspeed = "???";
wavessince = _root.wave - 60;
hpmultiplier = Math.pow(1.2, wavessince);
_root.nowhp = Math.floor(_root.waves[59][1] * hpmultiplier);
_root.nexthp = Math.floor(_root.nowhp * 1.2);
_root["spawnInterval" + _root.wave] = setInterval(_root, "spawn", 200, _root.wave, "creep1", _root.nowspeed, _root.nowhp, _root.goldworth);
_root["spawned" + _root.wave] = 30;
}
}
function spawn(level, creep, speed, health, gold) {
if (_root["spawned" + level] == 0) {
clearInterval(_root["spawnInterval" + level]);
} else {
_root["spawned" + level]--;
playanim = (level % 5) + 1;
_root.creepcount++;
_root[creep].duplicateMovieClip("c" + _root.creepcount, 20000 + _root.creepcount);
if (_root.creepcount > 10000) {
_root.creepcount = 1;
}
c = _root["c" + _root.creepcount];
c.creep.gotoAndStop(playanim);
c._x = _root.wp1._x;
c._y = _root.wp1._y;
c.health = health;
c.slowcount = 1;
c.isslow = 0;
c.maxhealth = health;
c.speed = speed;
c.maxspeed = c.speed;
c.ispoisoned = 0;
c.poisonedlevel = 0;
c.poisoncount = 0;
c.fullmax = c.maxspeed;
c.targ = 2;
c.rnd = 5;
c.shocked = 0;
c.shockcount = 1;
c.gold = gold;
c.iscorrode = 0;
c.isstunned = 0;
c.stuncount = 1;
c.splashslowed = 0;
c.splashslowedcount = 1;
_root.creepArray[_root.creepArray.length] = c;
c.onEnterFrame = function () {
if (_root.pauses == 0) {
this.health_bar.health._width = 30 * (this.health / this.maxhealth);
this.targX = (_root["wp" + this.targ]._x - 5) + this.rnd;
this.targY = (_root["wp" + this.targ]._y - 5) + this.rnd;
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this.rads = (this.dir * 3.141593) / 180;
if ((this.isstunned != 0) || (this.shocked == 1)) {
this.stuncount++;
if ((this.stuncount % 2) == 1) {
this._x = this._x + 2;
} else {
this._x = this._x - 2;
}
}
if (this.stuncount > 160) {
this.isstunned = 0;
this.stuncount = 1;
}
if (this.isslow != 0) {
this.speed = this.isslow * this.fullmax;
this.slowcount++;
}
if (this.slowcount > 160) {
this.speed = this.fullmax;
this.isslow = 0;
this.slowcount = 1;
}
if (this.splashslowed != 0) {
this.fullmax = this.maxspeed * this.splashslowed;
this.speed = this.fullmax;
if (this.isslow != 0) {
this.speed = this.fullmax * this.isslow;
}
this.splashslowedcount++;
}
if (this.splashslowedcount > 100) {
this.splashslowed = 0;
this.fullmax = this.maxspeed;
this.speed = this.fullmax;
this.splashslowedcount = 1;
}
if (this.iscorrode != 0) {
this.corrodecount++;
}
if (this.corrodecount > 200) {
this.iscorrode = 0;
this.corrdecount = 1;
}
if (this.ispoisoned == 1) {
if ((this.poisoncount % 40) == 0) {
this.health = this.health - this.poisonedlevel;
}
this.poisoncount++;
}
if (this.shocked == 1) {
this.shockcount++;
}
if (this.shockcount >= 80) {
this.shocked = 0;
this.shockcount = 1;
}
if (this.poisoncount > 200) {
this.ispoisoned = 0;
this.poisoncount = 0;
}
if ((this.isstunned == 0) && (this.shocked == 0)) {
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
}
d = Math.pow(this._x - this.targX, 2) + Math.pow(this._y - this.targY, 2);
if (d < 25) {
this.targ++;
if (this.targ > 14) {
_root.leak(this);
this._x = _root.wp1._x;
this._y = _root.wp1._y;
this.targ = 2;
}
}
this.r = this.dir;
if ((this._rotation + 10) < this.r) {
this._rotation = this._rotation + 10;
} else if ((this._rotation - 10) > this.r) {
this._rotation = this._rotation - 10;
} else {
this._rotation = r;
}
}
};
}
}
function fire(from, to, speed, acc, maxpeed, projectile, damage, towerid) {
_root.particlecount++;
_root[projectile].duplicateMovieClip("p" + _root.particlecount, 2000 + _root.particlecount);
r = _root["p" + _root.particlecount];
r._x = from._x;
r._y = from._y;
r.tier = from.tier;
r.type = from.type;
r.targ = to;
r.speed = speed;
r.acc = acc;
r.maxspeed = maxspeed;
r.damage = damage;
r.projectile = projectile;
r.towerid = towerid;
if (_root.particlecount > 300) {
_root.particlecount = 0;
}
r.onEnterFrame = function () {
if (_root.pauses == 0) {
if (("" + this.targ) != "") {
this.targX = this.targ._x;
this.targY = this.targ._y;
} else {
this._rotation = (Math.atan2(this.targ._y - this._y, this.targ._x - this._x) * 180) / 3.141593;
if (_root.creepArray.length <= 0) {
this.removeMovieClip();
} else {
w = 0;
if (w <= _root.creepArray.length) {
this.targ = _root.creepArray[w];
}
}
}
this.dir = (Math.atan2(this.targY - this._y, this.targX - this._x) * 180) / 3.141593;
this._rotation = this.dir + 90;
this.rads = (this.dir * 3.141593) / 180;
this._x = this._x + (Math.cos(this.rads) * this.speed);
this._y = this._y + (Math.sin(this.rads) * this.speed);
if (this.speed < this.maxspeed) {
this.speed = this.speed + this.acc;
}
d = ((this._x - this.targX) * (this._x - this.targX)) + ((this._y - this.targY) * (this._y - this.targY));
if (d < 25) {
if (this.towerid == 10) {
randcrit = random(100);
if ((this.tier == 1) && (randcrit < 11)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 2) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 3) && (randcrit < 16)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 4) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
if ((this.tier == 5) && (randcrit < 21)) {
this.damage = this.damage * 3;
_root.triple.duplicateMovieClip("triple" + _root.triplecount, 6750 + _root.triplecount);
_root["triple" + _root.triplecount]._x = this._x;
_root["triple" + _root.triplecount]._y = this._y;
_root.triplecount++;
if (_root.triplecount > 20) {
_root.triplecount = 1;
}
}
} else if (this.towerid == 4) {
this.targ.corrodecount = 1;
if (this.tier == 1) {
this.targ.iscorrode = 0.06;
} else if (this.tier == 2) {
this.targ.iscorrode = 0.12;
} else if (this.tier == 3) {
this.targ.iscorrode = 0.2;
} else if (this.tier == 4) {
this.targ.iscorrode = 0.32;
} else if (this.tier == 5) {
this.targ.iscorrode = 0.45;
}
}
this.targ.health = this.targ.health - (this.damage * (1 + this.targ.iscorrode));
if (this.towerid == 7) {
randstun = random(100);
if ((this.tier == 1) && (randstun < 10)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 2) && (randstun < 14)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 3) && (randstun < 17)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
} else if ((this.tier == 4) && (randstun < 20)) {
this.targ.isstunned = 1;
this.targ.stuncount = 1;
}
} else if (this.towerid == 5) {
this.targ.ispoisoned = 1;
this.targ.poisoncount = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < 4225) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[i].ispoisoned = 1;
_root.creepArray[i].poisoncount = 1;
}
i++;
}
if (this.tier == 1) {
this.targ.poisonedlevel = 150;
} else if (this.tier == 2) {
this.targ.poisonedlevel = 600;
} else if (this.tier == 3) {
this.targ.poisonedlevel = 2700;
} else if (this.tier == 4) {
this.targ.poisonedlevel = 10000;
}
_root.poisonball.duplicateMovieClip("poisonball" + _root.splashct, 6300 + _root.splashct);
_root["poisonball" + _root.splashct]._x = this._x;
_root["poisonball" + _root.splashct]._y = this._y;
_root["poisonball" + _root.splashct]._width = 80;
_root["poisonball" + _root.splashct]._height = 80;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 6) {
if (this.targ.health < (0.35 * this.targ.maxhealth)) {
randdeath = random(100);
if ((this.tier == 1) && (randdeath < 8)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 2) && (randdeath < 12)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 3) && (randdeath < 16)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
} else if ((this.tier == 4) && (randdeath < 20)) {
this.targ.health = 0;
_root.skull.duplicateMovieClip("skull" + _root.pwncount, 5750 + _root.pwncount);
_root["skull" + _root.pwncount]._x = this._x;
_root["skull" + _root.pwncount]._y = this._y;
_root.pwncount++;
if (_root.pwncount > 20) {
_root.pwncount = 1;
}
}
}
} else if (this.towerid == 8) {
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < 10000) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
if (this.tier == 1) {
_root.creepArray[k].splashslowed = 0.6;
} else if (this.tier == 2) {
_root.creepArray[k].splashslowed = 0.55;
} else if (this.tier == 3) {
_root.creepArray[k].splashslowed = 0.5;
} else if (this.tier == 4) {
_root.creepArray[k].splashslowed = 0.4;
}
_root.creepArray[k].splashslowedcount = 0;
}
k++;
}
_root.explodingshot.duplicateMovieClip("explodingshot" + _root.explodecount, 5100 + _root.explodecount);
_root["explodingshot" + _root.explodecount]._x = this._x;
_root["explodingshot" + _root.explodecount]._y = this._y;
_root.explodecount++;
if (_root.explodecount > 20) {
_root.explodecount = 1;
}
} else if (this.towerid == 26) {
if (this.tier == 1) {
shockwidth = 75;
shockchance = 8;
} else if (this.tier == 2) {
shockwidth = 80;
shockchance = 10;
} else if (this.tier == 3) {
shockwidth = 85;
shockchance = 12;
} else if (this.tier == 4) {
shockwidth = 90;
shockchance = 14;
}
k = 0;
while (k <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[k]._x, 2) + Math.pow(this._y - _root.creepArray[k]._y, 2);
if (d < (shockwidth * shockwidth)) {
_root.creepArray[k].health = _root.creepArray[k].health - this.damage;
shockper = random(100);
if (shockper < shockchance) {
if (_root.creepArray[k].shocked == 0) {
_root.creepArray[k].shocked = 1;
_root.creepArray[k].splashslowedcount = 1;
}
}
}
k++;
}
_root.shockshot.duplicateMovieClip("shockshot" + _root.shockct, 26500 + _root.shockct);
_root["shockshot" + _root.shockct]._x = this._x;
_root["shockshot" + _root.shockct]._y = this._y;
_root["shockshot" + _root.shockct]._width = 2 * shockwidth;
_root["shockshot" + _root.shockct]._height = 2 * shockwidth;
_root.shockct++;
if (_root.shockct > 20) {
_root.shockct = 1;
}
} else if (this.towerid == 22) {
if (this.tier == 1) {
staticval = 5;
} else if (this.tier == 2) {
staticval = 7;
} else if (this.tier == 3) {
staticval = 10;
}
staticchance = random(100);
if (staticchance < staticval) {
damagetaken = this.targ.maxhealth - this.targ.health;
(this.health - this.health) - (0.5 * damagetaken);
_root.lighteffect.duplicateMovieClip("lighteffect" + _root.staticcount, 23000 + _root.staticcount);
_root["lighteffect" + _root.staticcount]._x = this._x;
_root["lighteffect" + _root.staticcount]._y = this._y;
_root.staticcount++;
if (_root.staticcount > 50) {
_root.staticcount = 1;
}
}
} else if (this.towerid == 25) {
stealval = random(100);
if (this.tier == 1) {
this.stealmax = 6;
} else if (this.tier == 2) {
this.stealmax = 9;
} else if (this.tier == 3) {
this.stealmax = 10;
} else if (this.tier == 4) {
this.stealmax = 12;
}
if (stealval < this.stealmax) {
_root.gold = _root.gold + this.targ.gold;
_root.goldeffect.duplicateMovieClip("goldeffect" + _root.goldeffectct, 26000 + _root.goldeffectct);
_root["goldeffect" + _root.goldeffectct]._x = this._x;
_root["goldeffect" + _root.goldeffectct]._y = this._y;
_root.goldeffectct++;
if (_root.goldeffectct > 20) {
_root.goldeffectct = 1;
}
}
} else if (this.towerid == 999) {
if (this.targ.health < (0.65 * this.targ.maxhealth)) {
randteleport = random(100);
if ((this.tier == 1) && (randteleport < 8)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
_root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 2) && (randteleport < 9)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 3) && (randteleport < 10)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 4) && (randteleport < 11)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
} else if ((this.tier == 5) && (randteleport < 13)) {
this.targ._x = _root.wp1._x;
this.targ._y = _root.wp1._y;
this.targ.targ = 2;
root.tele.duplicateMovieClip("tele" + _root.telecount, 5700 + _root.telecount);
_root["tele" + _root.telecount]._x = this._x;
_root["tele" + _root.telecount]._y = this._y;
_root.telecount++;
if (_root.telecount > 20) {
_root.telecount = 1;
}
}
}
} else if (this.towerid == 100) {
if (this.tier == 1) {
spradius = 1225;
spwidth = 35;
} else if (this.tier == 2) {
spradius = 1600;
spwidth = 40;
} else if (this.tier == 3) {
spradius = 2025;
spwidth = 45;
} else if (this.tier == 4) {
spradius = 2500;
spwidth = 50;
} else if (this.tier == 5) {
spradius = 3600;
spwidth = 60;
}
j = 0;
while (j <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[j]._x, 2) + Math.pow(this._y - _root.creepArray[j]._y, 2);
if (d < spradius) {
if ((("" + _root.creepArray[j]) != "") && (_root.creepArray[j] != this.targ)) {
_root.creepArray[j].health = _root.creepArray[j].health - (this.damage * (1 - (d / 3600)));
}
_root.creepArray[j].splashslowed = 1;
_root.creepArray[j].splashslowedcount = 1;
}
j++;
}
_root.iceball.duplicateMovieClip("iceball" + _root.splashct, 5200 + _root.splashct);
_root["iceball" + _root.splashct]._x = this._x;
_root["iceball" + _root.splashct]._y = this._y;
_root["iceball" + _root.splashct]._width = spwidth;
_root["iceball" + _root.splashct]._height = spwidth;
_root.splashct++;
if (_root.splashct > 20) {
_root.splashct = 1;
}
} else if (this.towerid == 3) {
if (this.tier == 1) {
this.targ.isslow = 0.6;
}
if (this.tier == 2) {
this.targ.isslow = 0.5;
}
if (this.tier == 3) {
this.targ.isslow = 0.4;
}
if (this.tier == 4) {
this.targ.isslow = 0.35;
}
if (this.tier == 5) {
this.targ.isslow = 0.3;
}
this.targ.slowcount = 1;
} else if (this.towerid == 2) {
_root.explosion.duplicateMovieClip("explosion" + _root.explosioncount, 5000 + _root.explosioncount);
_root["explosion" + _root.explosioncount]._x = this._x;
_root["explosion" + _root.explosioncount]._y = this._y;
_root["explosion" + _root.explosioncount]._width = 100;
_root["explosion" + _root.explosioncount]._height = 100;
_root.explosioncount++;
if (_root.explosioncount > 40) {
_root.explosioncount = 1;
}
splashrad = 50;
splashrad2 = splashrad * splashrad;
i = 0;
while (i <= _root.creepArray.length) {
if ((("" + _root.creepArray[i]) != "") && (_root.creepArray[i] != this.targ)) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < splashrad2) {
_root.creepArray[i].health = _root.creepArray[i].health - (this.damage * (1 - (d / 6000)));
}
}
i++;
}
}
if (this.targ.health <= 0) {
this.targ.isDead = 1;
}
this.removeMovieClip();
}
}
};
}
function checkkill() {
n = 0;
while (n < _root.creepArray.length) {
if ((_root.creepArray[n].health <= 0) || (_root.creepArray[n] == "undefined")) {
_root.kills++;
_root.aftereffect.duplicateMovieClip("aftereffect" + _root.effectcount, 50000 + _root.effectcount);
_root["aftereffect" + _root.effectcount]._x = _root.creepArray[n]._x;
_root["aftereffect" + _root.effectcount]._y = _root.creepArray[n]._y;
_root.effectcount++;
if (_root.effectcount > 50) {
_root.effectcount = 1;
}
if (((_root.creepArray[n].gold != "undefined") && (_root.creepArray[n].gold != "null")) && (_root.creepArray[n].gold > 0)) {
_root.gold = _root.gold + _root.creepArray[n].gold;
_root.score = _root.score + _root.creepArray[n].maxhealth;
}
_root.creepArray[n].removeMovieClip();
_root.creepArray.splice(n, 1);
}
n++;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
function kill(creep) {
_root.kills++;
if (_root.kills >= _root.waves[_root.wave - 1][0]) {
_root.kills = 0;
_root.newLevel();
}
creep.onEnterFrame = function () {
this.removeMovieClip();
};
}
function upgrade() {
a = _root.selectedTower;
b = a.tier - 1;
if (int(a.upgrades[b][1]) <= _root.gold) {
a.damage = int(a.upgrades[b][2]);
a.range = a.upgrades[b][3];
a.rate = a.upgrades[b][4];
a.splash = a.upgrades[b][5];
a.slow = a.upgrades[b][6];
a.cost = a.cost + int(a.upgrades[b][1]);
a.tier++;
_root.towerInfo(a);
_root.gold = _root.gold - int(a.upgrades[b][1]);
updateInfoBar();
}
}
function sell() {
tower = _root.selectedTower;
if (((tower != "undefined") && (tower != "null")) && (tower != "")) {
sellprice = Math.floor(tower.cost * 0.85);
if (sellprice != "undefined") {
_root.gold = _root.gold + sellprice;
}
_root.range._x = 1000;
_root.range._height = 0;
_root.range._width = 0;
if (tower.maxtier == 2) {
_root.gems++;
}
tower.removeMovieClip();
_root.UpgradeTowerInfo._visible = false;
}
}
function leak(creep) {
_root.creepLeaks++;
_root.lives--;
creep._x = _root.wp1._x;
creep._y = _root.wp1._y;
creep.targ = 1;
}
stop();
_root.skillstats.swapDepths(9090);
_root.skillstats.removeMovieClip();
_root.challengescore._x = 2000;
_root.challengescore._y = 2000;
_root.levelwin = 0;
_root.gold = 100;
_root.gems = _global.gems;
_root.attackskill = _global.attackskill;
_root.rangeskill = _global.rangeskill;
_root.killbounty = _global.killbounty;
_root.techlevel = _global.techlevel;
if (_global.startmoneylevel == 1) {
_root.gold = 150;
} else if (_global.startmoneylevel == 2) {
_root.gold = 200;
} else if (_global.startmoneylevel == 3) {
_root.gold = 250;
} else if (_global.startmoneylevel == 4) {
_root.gold = 400;
} else if (_global.startmoneylevel == 5) {
_root.gold = 600;
}
_root.wave = 0;
_root.levelnew = 1;
_root.effectcount = 1;
_root.staticcount = 1;
_root.shockct = 1;
_root.gameover = 0;
_root.towerCount = 0;
_root.creepcount = 1;
_root.goldeffectct = 1;
_root.kills = 0;
_root.pauses = 0;
_root.creepleaks = 0;
_root.timer = 45;
_root.lives = 20;
_root.goldworth = 0;
_root.creepArray = [];
_global.sound = 1;
_root.particlecount = 1;
_root.splashct = 1;
_root.pwncount = 1;
_root.explodecount = 1;
_root.score = 0;
_root.playsound = new Sound(this);
_root.playsound.attachSound("music2");
if (_global.sound == 1) {
_root.playsound.start(0, 100000);
}
_root.playsound1 = new Sound(this);
_root.playsound1.attachSound("sndplasma");
_root.playsound2 = new Sound(this);
_root.playsound2.attachSound("sndrocket");
_root.playsound3 = new Sound(this);
_root.playsound3.attachSound("sndbullet");
_root.playsound4 = new Sound(this);
_root.playsound4.attachSound("sndbullet1");
_root.playsound5 = new Sound(this);
_root.playsound5.attachSound("sndexplode");
_root.playsound6 = new Sound(this);
_root.playsound6.attachSound("sndlaser");
_global.maxwaves = 10000;
_root.wavemax = _global.maxwaves;
_root.waves = [[20, 125, 3.75, 667], [20, 146, 4.5, 600], [20, 171, 2.75, 400], [20, 198, 3.75, 667], [20, 228, 4.05, 600], [20, 273, 3.75, 667], [20, 319, 1.5, 266], [2, 1190, 5.25, 600], [20, 438, 3, 667], [20, 469, 3.75, 667], [20, 514, 3, 667], [20, 704, 2.75, 400], [20, 824, 3, 650], [20, 963, 5, 700], [20, 1128, 3.25, 550], [2, 6577, 2.75, 800], [20, 1545, 3.75, 600], [20, 1806, 4, 700], [20, 2114, 4.25, 650], [20, 2474, 3.5, 580], [20, 2900, 3.25, 500], [20, 3402, 3.4, 525], [20, 3987, 2.8, 475], [20, 4676, 3, 600], [2, 21092, 3.141592, 620], [20, 6429, 3.5, 650], [20, 7538, 4, 700], [20, 8838, 3.3, 600], [20, 10364, 3.4, 590], [20, 12080, 3.12, 550], [20, 14279, 3.3, 600], [20, 16777, 3.2, 570], [2, 72576, 2.5, 800], [20, 23164, 3, 600], [20, 27220, 3.15, 577], [20, 31983, 3.2, 500], [20, 37581, 3.35, 600], [20, 42056, 3.4, 620], [20, 51896, 3.5, 630], [20, 60966, 3.75, 670], [20, 71938, 3, 700], [20, 84888, 3.2, 650], [20, 100168, 3.3, 660], [20, 118199, 3.4, 675], [20, 139475, 3.5, 690], [20, 164581, 4, 800], [20, 194205, 3, 650], [20, 230038, 3.5, 700], [2, 1306005, 4, 1000], [20, 319088, 3.5, 700], [20, 382906, 3.4, 600], [20, 459487, 3.33, 590], [20, 551386, 4.5, 750], [20, 661662, 4, 700], [20, 793954, 3.4, 600], [20, 952795, 3.6, 625], [2, 5783400, 3.7, 700], [20, 1372024, 3.8, 710], [20, 1646431, 4, 650], [20, 1975717, 5, 700]];
_root.nowhp = 0;
_root.nowspeed = 0;
_root.nexthp = _root.waves[0][1];
_root.nextspeed = 2.5;
Instance of Symbol 236 MovieClip in Frame 40
on (press) {
_root.marker.active = 1;
_root.marker.tower = "basic";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Tower. Shoots bullets at enemies. 80 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 238 MovieClip in Frame 40
on (press) {
_root.marker.active = 1;
_root.marker.tower = "splash";
_root.marker.cost = 50;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Basic Splash Tower. Shoots Exploding bullets at enemies. 29 base damage. Cost: $50";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 240 MovieClip in Frame 40
on (press) {
_root.marker.active = 1;
_root.marker.tower = "slow";
_root.marker.cost = 150;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Slow Tower. Shoots shots that slow the enemy. 100 base damage. Cost: $150";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 242 MovieClip in Frame 40
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "poison";
_root.marker.cost = 500;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Splash Poison Tower. Splashes Poison(150/sec for level 1) to hurt the enemy. 300 base damage. Cost: $500, tech level 1 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 244 MovieClip in Frame 40
on (press) {
if (_root.techlevel >= 1) {
_root.marker.active = 1;
_root.marker.tower = "static";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Static tower. 6% chance to make target take 50% of the damage that is has lost so far. 500 base damage. Cost: $650. Tech level 1.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 246 MovieClip in Frame 40
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "shock";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Shock tower. Has the ability to random stun any enemy within its radius. Enemies cannot be stunned if already under effect of stun. 500 base damage. Cost: $1000. Tech level 4 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 248 MovieClip in Frame 40
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "stun";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Stun Tower. Has a 10% chance of stunning enemies. 500 base damage. Cost: $700. Requires Tech level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 252 MovieClip in Frame 40
on (press) {
if (_root.techlevel >= 3) {
_root.marker.active = 1;
_root.marker.tower = "death";
_root.marker.cost = 650;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Instant death tower. 8% chance to instantly kill if target is under 35% HP. 500 base damage. Cost: $650. Tech Level 3.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 254 MovieClip in Frame 40
on (press) {
if (_root.techlevel >= 2) {
_root.marker.active = 1;
_root.marker.tower = "money";
_root.marker.cost = 700;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Money Tower. Has a 5% chance of stealing money from creeps it hits at level 1. 500 Damage. Cost: $700. Tech Level 2.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 256 MovieClip in Frame 40
on (press) {
if (_root.techlevel >= 4) {
_root.marker.active = 1;
_root.marker.tower = "explode";
_root.marker.cost = 1000;
_root.tinfo._visible = false;
}
}
on (rollOver) {
_root.buyinfo = "Exploding Tower. Damages and slows all enemies in a radius of itself. 500 base damage. Cost: $1000. Tech Level 4.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 258 MovieClip in Frame 40
on (press) {
if (_root.gems > 0) {
if (_root.techlevel >= 5) {
_root.marker.active = 1;
_root.marker.tower = "ultimate";
_root.marker.cost = 20000;
_root.tinfo._visible = false;
}
}
}
on (rollOver) {
_root.buyinfo = "Ultimate Tower. Extreme Damage and splash. 100000 damage. Cost: $20000 and 1 Gem. Tech level 5 required.";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 236 MovieClip "tower_basic" in Frame 40
onClipEvent (load) {
title = "Basic Damage Tower";
desc = "Basic Damage Tower";
cost = 50;
this.range = 65 * (1 + (0.05 * _global.rangeskill));
this.range2 = 66 * (1 + (0.05 * _global.rangeskill));
this.range3 = 67 * (1 + (0.05 * _global.rangeskill));
this.range4 = 68 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 80;
damage = 80 * (1 + (0.05 * _global.attackskill));
this.damage2 = 240 * (1 + (0.05 * _global.attackskill));
this.damage3 = 720 * (1 + (0.05 * _global.attackskill));
this.damage4 = 2160 * (1 + (0.05 * _global.attackskill));
rate = 19;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 240\rRange: 66\rCooldown: 18\rEffect: None", 120, this.damage2, this.range2, 18], ["Damage: 720\rRange: 67\rCooldown: 17\rEffect: None", 300, this.damage3, this.range3, 17], ["Damage: 2160\rRange: 68\rCooldown: 17\rEffect: None", 880, this.damage4, this.range4, 17]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_basic")) {
if (target == undefined) {
target = 0;
}
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 1);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 264 MovieClip "range" in Frame 40
onClipEvent (enterFrame) {
if ((_root.selectedTower == "") && (_root.marker.active == 0)) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 267 MovieClip "marker" in Frame 40
onClipEvent (load) {
active = 0;
inpath = 0;
this.swapDepths(9998);
}
onClipEvent (enterFrame) {
if (active == 1) {
this.startDrag(true);
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((maphit == 1) && (inpath == 0)) {
this.gotoAndStop(1);
_root.range.gotoAndStop(1);
} else {
this.gotoAndStop(2);
_root.range.gotoAndStop(2);
}
_root.range._x = _x;
_root.range._y = _y;
_root.range._width = _root["tower_" + tower].range * 2;
_root.range._height = _root["tower_" + tower].range * 2;
}
if (Key.isDown(32)) {
active = 0;
trace(1);
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
on (press) {
maphit = _root.background.hitTest(_x, _y, 1);
inpath = 0;
i = 1;
while (i <= 20) {
if (this.hitTest(_root["track" + i])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
i++;
}
if (inpath == 0) {
j = 0;
while (j <= _root.towerCount) {
if (this.hitTest(_root["t" + j])) {
inpath = 1;
}
if (inpath == 1) {
break;
}
j++;
}
}
if ((((maphit == 1) && (inpath == 0)) && (_root.gold >= this.cost)) && (_root.pauses == 0)) {
if (this.hitTest(_root.nextwave) == false) {
if (_root.marker.tower == "ultimate") {
if (_root.gems > 0) {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gems--;
_root.gold = _root.gold - this.cost;
}
} else {
_root.towerCount++;
_root["tower_" + tower].duplicateMovieClip("t" + _root.towerCount, 10000 + _root.towerCount);
a = _root["t" + _root.towerCount];
a._x = _x;
a._y = _y;
a.active = 1;
_root.gold = _root.gold - this.cost;
}
}
}
if (maphit == 0) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
if (this.hitTest(_root.nextwave)) {
active = 0;
_x = 1000;
_root.selectedTower = "";
_root.range._x = 1000;
_root.range._width = 10;
_root.range._height = 10;
_root.UpgradeTowerInfo._visible = false;
this.stopDrag();
}
}
Instance of Symbol 238 MovieClip "tower_splash" in Frame 40
onClipEvent (load) {
title = "Splash Tower";
desc = "Splash Tower";
cost = 50;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 73 * (1 + (0.05 * _global.rangeskill));
this.range4 = 75 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 34 * (1 + (0.05 * _global.attackskill));
this.damage2 = 102 * (1 + (0.05 * _global.attackskill));
this.damage3 = 306 * (1 + (0.05 * _global.attackskill));
this.damage4 = 918 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 102\rRange: 72\rCooldown: 21\rEffect: Splash", 120, this.damage2, this.range2, 21], ["Damage: 306\rRange: 73\rCooldown: 21\rEffect: Splash", 300, this.damage3, this.range3, 21], ["Damage: 918\rRange: 75\rCooldown: 20\rEffect: Splash", 880, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_splash")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > ((range * range) + 81)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "redbullet", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 289 MovieClip "explosion" in Frame 40
onClipEvent (load) {
if (this._name == "explosion") {
this._visible = false;
}
}
Instance of Symbol 240 MovieClip "tower_slow" in Frame 40
onClipEvent (load) {
title = "Slow tower";
desc = "Slow tower";
cost = 150;
this.range = 68 * (1 + (0.05 * _global.rangeskill));
this.range2 = 69 * (1 + (0.05 * _global.rangeskill));
this.range3 = 70 * (1 + (0.05 * _global.rangeskill));
this.range4 = 71 * (1 + (0.05 * _global.rangeskill));
this.range5 = 72 * (1 + (0.05 * _global.rangeskill));
damage = 100 * (1 + (0.05 * _global.attackskill));
this.damage2 = 500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2200 * (1 + (0.05 * _global.attackskill));
this.damage4 = 10500 * (1 + (0.05 * _global.attackskill));
this.damage5 = 33000 * (1 + (0.05 * _global.attackskill));
rate = 22;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 500\rRange: 69\rCooldown: 22\rEffect: Slow", 500, this.damage2, this.range2, 22], ["Damage: 2200\rRange: 70\rCooldown: 21\rEffect: Slow", 1250, this.damage3, this.range3, 21], ["Damage: 10500\rRange: 71\rCooldown: 21\rEffect: Slow", 3150, this.damage4, this.range4, 21], ["Damage: 33000\rRange: 72\rColldown:19\rEffect: Slow", 8000, this.damage5, this.range5, 19]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_slow")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "snowflake", this.damage, 3);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 314 MovieClip in Frame 40
on (press) {
_root.marker.active = 1;
_root.marker.tower = "rust";
_root.marker.cost = 400;
_root.tinfo._visible = false;
}
on (rollOver) {
_root.buyinfo = "Rust Tower. Shoots shots that rust the enemy, causing them to take more damage. 300 base damage. Ultra Fast. Cost: $400";
_root.tinfo._x = this._x;
_root.tinfo._y = this._y;
_root.tinfo._visible = true;
}
on (rollOut) {
_root.buyinfo = "";
_root.tinfo._visible = false;
}
Instance of Symbol 314 MovieClip "tower_rust" in Frame 40
onClipEvent (load) {
title = "Rust Tower";
desc = "Rust Tower";
cost = 400;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range5 = 80 * (1 + (0.05 * _global.rangeskill));
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 930 * (1 + (0.05 * _global.attackskill));
this.damage3 = 2000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 5000 * (1 + (0.05 * _global.attackskill));
this.damage5 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 9;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 5;
upgrades = [["Damage: 930\rRange: 76\rCooldown: 9\rEffect: Rust", 1200, this.damage2, this.range2, 9], ["Damage: 2000\rRange: 77\rCooldown: 8\rEffect: Rust", 3000, this.damage3, this.range3, 8], ["Damage: 5000\rRange: 78\rCooldown: 8\rEffect: Rust", 6000, this.damage4, this.range4, 8], ["Damage: 15000\rRange: 80\rCooldown: 7\rEffect:Rust", 13500, this.damage5, this.range5, 7]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "yellowshot", this.damage, 4);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound3.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 242 MovieClip "tower_poison" in Frame 40
onClipEvent (load) {
title = "Splash Poison";
desc = "Splash Poison";
cost = 500;
this.range = 70;
this.range2 = 72 * (1 + (0.05 * _global.rangeskill));
this.range3 = 75 * (1 + (0.05 * _global.rangeskill));
this.range4 = 78 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 12000 * (1 + (0.05 * _global.attackskill));
rate = 23;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 72\rCooldown: 22\rEffect:Poison(600)", 1500, this.damage2, this.range2, 22], ["Damage: 4000\rRange: 75\rCooldown: 21\rEffect:Poison(2700)", 5000, this.damage3, this.range3, 21], ["Damage: 12000\rRange:78\rCooldown: 20\rEffect:Poison(10000)", 11500, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "shot", this.damage, 5);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 244 MovieClip "tower_static" in Frame 40
onClipEvent (load) {
title = "Static";
desc = "Static";
cost = 500;
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 80 * (1 + (0.05 * _global.rangeskill));
this.range4 = 85 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 300 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 4000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 15000 * (1 + (0.05 * _global.attackskill));
rate = 25;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1000\rRange: 77\rCooldown: 24\rEffect:Static(7)", 1500, this.damage2, this.range2, 24], ["Damage: 4000\rRange: 80\rCooldown: 23\rEffect:Static(10)", 5000, this.damage3, this.range3, 23], ["Damage: 15000\rRange: 85\rCooldown:22\rEffect:Static(12)", 11000, this.damage4, this.range4, 22]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "light", this.damage, 22);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 252 MovieClip "tower_death" in Frame 40
onClipEvent (load) {
title = "Instant Death";
desc = "Instant Death";
cost = 650;
this.range = 75 * (1 + (0.05 * _global.rangeskill));
this.range2 = 77 * (1 + (0.05 * _global.rangeskill));
this.range3 = 79 * (1 + (0.05 * _global.rangeskill));
this.range4 = 82 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 650 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3000 * (1 + (0.05 * _global.attackskill));
this.damage3 = 15000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 35000 * (1 + (0.05 * _global.attackskill));
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3000)\rRange: 77\rCooldown: 28\rEffect:Death(12%)", 2000, this.damage2, this.range2, 28], ["Damage: 15000\rRange: 79\rCooldown: 26\rEffect:Death(16%)", 7000, this.damage3, this.range3, 26], ["Damage: 35000\rRange:82\rCooldown: 23 \rEffect:Death(19%)", 13500, this.damage4, this.range4, 23]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "deathbullet", this.damage, 6);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound6.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 248 MovieClip "tower_stun" in Frame 40
onClipEvent (load) {
title = "Stun Tower";
desc = "Stun Tower";
cost = 700;
rate = 22;
this.range = 73 * (1 + (0.05 * _global.rangeskill));
this.range2 = 74 * (1 + (0.05 * _global.rangeskill));
this.range3 = 76 * (1 + (0.05 * _global.rangeskill));
this.range4 = 79 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 45000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 74\rCooldown: 22\rEffect:Stun(13%)", 2500, this.damage2, this.range2, 22], ["Damage: 17000\rRange: 76\rCooldown: 21\rEffect:Stun(16%)", 9000, this.damage3, this.range3, 21], ["Damage: 45000\rRange: 79\rCooldown: 20\rEffect:Stun(18%)", 18000, this.damage4, this.range4, 20]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "blueshot", this.damage, 7);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 254 MovieClip "tower_money" in Frame 40
onClipEvent (load) {
title = "Money Tower";
desc = "Money Tower";
cost = 700;
rate = 25;
this.range = 75;
this.range2 = 76 * (1 + (0.05 * _global.rangeskill));
this.range3 = 78 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 3500 * (1 + (0.05 * _global.attackskill));
this.damage3 = 17000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 40000 * (1 + (0.05 * _global.attackskill));
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 3500\rRange: 76\rCooldown: 24\rEffect:Steal Money(8)", 2500, this.damage2, this.range2, 24], ["Damage: 17000\rRange: 78\rCooldown: 23\rEffect:Steal(9)", 9000, this.damage3, this.range3, 23], ["Damage: 40000\rRange: 80\rCooldown:21\rEffect:Steal(11)", 18000, this.damage4, this.range4, 21]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if (((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "moneyshot", this.damage, 25);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound4.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 256 MovieClip "tower_explode" in Frame 40
onClipEvent (load) {
title = "Explosion";
desc = "Explosion";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 80 * (1 + (0.05 * _global.rangeskill));
this.range2 = 82 * (1 + (0.05 * _global.rangeskill));
this.range3 = 84 * (1 + (0.05 * _global.rangeskill));
this.range4 = 86 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 30;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 82\rCooldown: 28\rEffect:Slow", 3000, this.damage2, this.range2, 28], ["Damage: 8000\rRange: 84\rCooldown: 27\rEffect:Slow", 10000, this.damage3, this.range3, 27], ["Damage: 25000\rRange: 86\rCooldown:25\rEffect:Slow", 25000, this.damage4, this.range4, 25]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 8);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 336 MovieClip "shockshot" in Frame 40
onClipEvent (enterFrame) {
this._rotation = this._rotation + 30;
}
Instance of Symbol 246 MovieClip "tower_shock" in Frame 40
onClipEvent (load) {
title = "Shock";
desc = "Shock";
cost = 1000;
damage = 500 * (1 + (0.05 * _global.attackskill));
this.damage2 = 1800 * (1 + (0.05 * _global.attackskill));
this.damage3 = 8000 * (1 + (0.05 * _global.attackskill));
this.damage4 = 25000 * (1 + (0.05 * _global.attackskill));
this.range = 70 * (1 + (0.05 * _global.rangeskill));
this.range2 = 75 * (1 + (0.05 * _global.rangeskill));
this.range3 = 77 * (1 + (0.05 * _global.rangeskill));
this.range4 = 80 * (1 + (0.05 * _global.rangeskill));
this.range = Math.floor(this.range);
rate = 35;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 4;
upgrades = [["Damage: 1800\rRange: 75\rCooldown: 33\rEffect:Shock", 3000, this.damage2, this.range2, 33], ["Damage: 8000\rRange: 77\rCooldown: 30\rEffect:Shock", 10000, this.damage3, this.range3, 30], ["Damage: 25000\rRange: 80\rCooldown: 27\rEffect:Shock", 25000, this.damage4, this.range4, 27]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_explode")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_root.fire(this, this, 10, 1, 10, "redbullet", this.damage, 26);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound1.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 258 MovieClip "tower_ultimate" in Frame 40
onClipEvent (load) {
title = "Ultimate Tower";
desc = "Ultimate Tower";
cost = 20000;
damage = 100000 * (1 + (0.05 * _global.attackskill));
this.damage2 = 200000 * (1 + (0.05 * _global.attackskill));
this.range = 85 * (1 + (0.05 * _global.rangeskill));
this.range2 = 95 * (1 + (0.05 * _global.rangeskill));
rate = 27;
lastFire = rate;
lastChecked = rate;
creep = "";
target = 0;
tier = 1;
maxtier = 2;
upgrades = [["Damage: 200000\rRange: 95\rCooldown: 33\rEffect:Splash", 40000, this.damage2, this.range2, 24]];
}
on (press) {
_root.towerInfo(this);
_root.TowerInfo(this);
}
onClipEvent (enterFrame) {
if ((((active == 1) && (_root.creepArray.length > 0)) && (_root.pauses == 0)) && (this._name != "tower_ultimate")) {
lastChecked++;
if (lastChecked >= rate) {
if (target == 0) {
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else if (("" + creep) == "") {
target = 0;
i = 0;
while (i <= _root.creepArray.length) {
d = Math.pow(this._x - _root.creepArray[i]._x, 2) + Math.pow(this._y - _root.creepArray[i]._y, 2);
if (d < ((range * range) + 81)) {
target = 1;
creep = _root.creepArray[i];
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
break;
}
i++;
}
} else {
d = Math.pow(this._x - creep._x, 2) + Math.pow(this._y - creep._y, 2);
if (d > (range * range)) {
lastChecked = 999;
target = 0;
} else {
_rotation = ((Math.atan2(creep._y - this._y, creep._x - this._x) * 180) / 3.141593);
_root.fire(this, creep, 10, 1, 10, "bigbomb", this.damage, 2);
lastChecked = 0;
if (_global.sound == 1) {
_root.playsound2.start(0, 1);
}
}
}
}
}
}
Instance of Symbol 353 MovieClip "UpgradeTowerInfo" in Frame 40
onClipEvent (load) {
_visible = false;
swapDepths(100000);
}
Instance of Symbol 378 MovieClip "creep1" in Frame 40
onClipEvent (load) {
this._rotation = this._rotation + 45;
}
Instance of Symbol 380 MovieClip in Frame 40
onClipEvent (enterFrame) {
if (_root.timer > 50) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 381 MovieClip in Frame 40
onClipEvent (load) {
this._visible = false;
this.startDrag(true);
this.count = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(77) && (_global.sound == 1)) {
_global.sound = 0;
stopAllSounds();
}
if (Key.isDown(78) && (_global.sound == 0)) {
_global.sound = 1;
_root.playsound.start(0, 100000);
}
if (Key.isDown(80) && (_root.pauses == 0)) {
_root.pauses = 1;
}
if (Key.isDown(85) && (_root.pauses == 1)) {
_root.pauses = 0;
}
if (_root.pauses == 0) {
_root.levelnew++;
_root.checkkill();
this.count++;
if ((this.count % 30) == 0) {
_root.timer--;
}
if (_root.timer <= 0) {
_root.newLevel();
_root.timer = 60;
}
if ((_root.lives <= 0) && (_root.gameover == 0)) {
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
if (_root.creepArray.length <= 0) {
_root.gotoAndPlay("lose11");
}
}
if (((((_root.wave >= _global.maxwaves) && (_root.creepArray.length <= 0)) && (_root.gameover == 0)) && (_root.kills >= 20)) && (_root.levelnew > 120)) {
_root.levelwin = 1;
i = 0;
while (i < _root.creepArray.length) {
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
_root.gotoAndPlay("win11");
}
}
}
Instance of Symbol 387 MovieClip "tinfo" in Frame 40
onClipEvent (load) {
this.swapDepths(99999);
}
Instance of Symbol 421 MovieClip "quitbox" in Frame 40
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 228 MovieClip "wp1" in Frame 40
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp2" in Frame 40
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp3" in Frame 40
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp4" in Frame 40
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp5" in Frame 40
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp6" in Frame 40
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp7" in Frame 40
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp8" in Frame 40
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp9" in Frame 40
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp10" in Frame 40
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp11" in Frame 40
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp12" in Frame 40
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp13" in Frame 40
onClipEvent (enterFrame) {
_root.checkkill();
}
Instance of Symbol 228 MovieClip "wp14" in Frame 40
onClipEvent (enterFrame) {
_root.checkkill();
}
Frame 41
stop();
stopAllSounds();
var o = {n:[12, 10, 4, 3, 12, 9, 4, 10, 9, 2, 1, 12, 12, 2, 8, 0], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
var boardID = o.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:boardID, score:_root.score});
Frame 42
_root.gotoAndPlay("levelselect");
Symbol 27 Button
on (release) {
getURL ("http://www.flashgamesnexus.com/", "_blank");
}
Symbol 28 MovieClip Frame 1
function timerHandler() {
if (!loadingComplete) {
var _local4 = _root.getBytesLoaded() / _root.getBytesTotal();
bar._xscale = 200 * _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.play();
}
_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 594 MovieClip [__Packages.mochi.as2.MochiSync] Frame 0
class mochi.as2.MochiSync
{
var _syncContainer;
function MochiSync () {
_syncContainer = {};
}
function getProp(name) {
return(_syncContainer[name]);
}
function setProp(name, value) {
if (_syncContainer[name] == value) {
return(undefined);
}
_syncContainer[name] = value;
mochi.as2.MochiServices.send("sync_propUpdate", {name:name, value:value});
}
function triggerEvent(eventType, args) {
switch (eventType) {
case SYNC_REQUEST :
mochi.as2.MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY :
_syncContainer[args.name] = args.value;
}
}
static var SYNC_REQUEST = "SyncRequest";
static var SYNC_PROPERTY = "UpdateProperty";
}
Symbol 595 MovieClip [__Packages.mochi.as2.MochiServices] Frame 0
class mochi.as2.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("3.8 as2");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
warnID(id, false);
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local6 = "_mochiservices_com_" + id;
var _local5 = new MovieClipLoader();
var _local3 = {};
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servURL) {
_servURL = urlOptions().servURL;
}
var _local4 = _servURL + _services;
if (urlOptions().servicesURL) {
_local4 = urlOptions().servicesURL;
}
allowDomains(_local4);
_clip = clip.createEmptyMovieClip(_local6, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
listen();
if (_local3.waitInterval != null) {
clearInterval(_local3.waitInterval);
}
_local3.onLoadError = loadError;
_local3.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_local3.onLoadComplete = function (target_mc) {
target_mc.MochiServices = mochi.as2.MochiServices;
};
_local3.startTime = getTimer();
_local3.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_local3.waitInterval = setInterval(_local3, "wait", 1000);
_local5.addListener(_local3);
_local5.loadClip((((((_local4 + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options)) + "&api_version=") + getVersion(), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
return(_clip);
}
static function loadError(target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
disconnect();
onError.apply(null, [errorCode]);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.as2.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_listenChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_listenChannel.onEvent = function (pkg) {
switch (pkg.target) {
case "events" :
mochi.as2.MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins" :
mochi.as2.MochiSocial.triggerEvent(pkg.event, pkg.args);
break;
case "sync" :
mochi.as2.MochiServices.servicesSync.triggerEvent(pkg.event, pkg.args);
}
};
_listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
};
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function updateCopy(args) {
send("coins_updateCopy", args, null, null);
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
trace("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var _local5 = {};
var _local6;
if (_root._url.indexOf("mochiad_options") != -1) {
var _local2 = (_root._url.indexOf("mochiad_options") + "mochiad_options".length) + 1;
_local6 = _root._url.substr(_local2, _root._url.length);
} else if (_root.mochiad_options) {
_local6 = _root.mochiad_options;
}
if (_local6) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function warnID(bid, leaderboard) {
bid = bid.toLowerCase();
if (bid.length != 16) {
trace(("WARNING: " + (leaderboard ? "board" : "game")) + " ID is not the appropriate length");
return(undefined);
}
if (bid == "1e113c7239048b3f") {
if (leaderboard) {
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
}
return(undefined);
}
if (bid == "84993a1de4031cd8") {
if (leaderboard) {
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
}
return(undefined);
}
var _local1 = 0;
while (_local1 < bid.length) {
switch (bid.charAt(_local1)) {
case "0" :
case "1" :
case "2" :
case "3" :
case "4" :
case "5" :
case "6" :
case "7" :
case "8" :
case "9" :
case "a" :
case "b" :
case "c" :
case "d" :
case "e" :
case "f" :
break;
default :
trace("WARNING: Board ID contains illegal characters: " + bid);
return(undefined);
}
_local1++;
}
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.as2.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static function setContainer(clip) {
}
static function stayOnTop(clip) {
}
static var _servURL = "http://www.mochiads.com/static/lib/services/";
static var _services = "services.swf";
static var _mochiLC = "MochiLC.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
static var servicesSync = new mochi.as2.MochiSync();
}
Symbol 596 MovieClip [__Packages.mochi.as2.MochiEventDispatcher] Frame 0
class mochi.as2.MochiEventDispatcher
{
var eventTable;
function MochiEventDispatcher () {
eventTable = {};
}
function buildDelegate(thisObject, thatObject) {
var _local2 = {thisObject:thisObject, thatObject:thatObject};
if (thatObject != undefined) {
var funct = ((typeof(thatObject) == "string") ? (thisObject[thatObject]) : (thatObject));
_local2.delegate = function (args) {
funct.call(thisObject, args);
};
} else {
_local2.delegate = thisObject;
}
return(_local2);
}
function compareDelegate(d_A, d_B) {
if ((d_A.thisObject != d_B.thisObject) || (d_A.thatObject != d_B.thatObject)) {
return(false);
}
return(true);
}
function addEventListener(event, thisObject, thatObject) {
removeEventListener(event, thisObject, thatObject);
eventTable[event].push(buildDelegate(thisObject, thatObject));
}
function removeEventListener(event, thisObject, thatObject) {
var _local3 = buildDelegate(thisObject, thatObject);
if (eventTable[event] == undefined) {
eventTable[event] = [];
return(undefined);
}
for (var _local4 in eventTable[event]) {
if (!compareDelegate(eventTable[event][_local4], _local3)) {
continue;
}
eventTable[event].splice(Number(_local4), 1);
}
}
function triggerEvent(event, args) {
if (eventTable[event] == undefined) {
return(undefined);
}
for (var _local4 in eventTable[event]) {
eventTable[event][_local4].delegate(args);
}
}
}
Symbol 597 MovieClip [__Packages.mochi.as2.MochiEvents] Frame 0
class mochi.as2.MochiEvents
{
function MochiEvents () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function startSession(achievementID) {
mochi.as2.MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
static function setNotifications(clip, style) {
var _local2 = {};
for (var _local3 in style) {
_local2[_local3] = style[_local3];
}
_local2.clip = clip;
mochi.as2.MochiServices.send("events_setNotifications", _local2, null, null);
}
static function addEventListener(eventType, thisObject, thatObject) {
_dispatcher.addEventListener(eventType, thisObject, thatObject);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, thisObject, thatObject) {
_dispatcher.removeEventListener(eventType, thisObject, thatObject);
}
static function startPlay(tag) {
if (tag == undefined) {
tag = "gameplay";
}
mochi.as2.MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
static function endPlay() {
mochi.as2.MochiServices.send("events_clearRoundID", null, null, null);
}
static function trackEvent(tag, value) {
mochi.as2.MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
static var ACHIEVEMENT_RECEIVED = "AchievementReceived";
static var ALIGN_TOP_LEFT = "ALIGN_TL";
static var ALIGN_TOP = "ALIGN_T";
static var ALIGN_TOP_RIGHT = "ALIGN_TR";
static var ALIGN_LEFT = "ALIGN_L";
static var ALIGN_CENTER = "ALIGN_C";
static var ALIGN_RIGHT = "ALIGN_R";
static var ALIGN_BOTTOM_LEFT = "ALIGN_BL";
static var ALIGN_BOTTOM = "ALIGN_B";
static var ALIGN_BOTTOM_RIGHT = "ALIGN_BR";
static var FORMAT_SHORT = "ShortForm";
static var FORMAT_LONG = "LongForm";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 598 MovieClip [__Packages.mochi.as2.MochiSocial] Frame 0
class mochi.as2.MochiSocial
{
function MochiSocial () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showLoginWidget(options) {
mochi.as2.MochiServices.setContainer();
mochi.as2.MochiServices.stayOnTop();
mochi.as2.MochiServices.send("coins_showLoginWidget", {options:options});
}
static function hideLoginWidget() {
mochi.as2.MochiServices.send("coins_hideLoginWidget");
}
static function requestLogin() {
mochi.as2.MochiServices.send("coins_requestLogin");
}
static function getUserInfo() {
mochi.as2.MochiServices.send("coins_getUserInfo");
}
static function saveUserProperties(properties) {
mochi.as2.MochiServices.send("coins_saveUserProperties", properties);
}
static function addEventListener(eventType, delegate) {
_dispatcher.addEventListener(eventType, delegate);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, delegate) {
_dispatcher.removeEventListener(eventType, delegate);
}
static var LOGGED_IN = "LoggedIn";
static var LOGGED_OUT = "LoggedOut";
static var LOGIN_SHOW = "LoginShow";
static var LOGIN_HIDE = "LoginHide";
static var LOGIN_SHOWN = "LoginShown";
static var PROFILE_SHOW = "ProfileShow";
static var PROFILE_HIDE = "ProfileHide";
static var PROPERTIES_SAVED = "PropertySaved";
static var WIDGET_LOADED = "WidgetLoaded";
static var USER_INFO = "UserInfo";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var NO_USER = "NoUser";
static var PROPERTIES_SIZE = "PropertiesSize";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 599 MovieClip [__Packages.mochi.as2.MochiScores] Frame 0
class mochi.as2.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.as2.MochiServices.warnID(boardID, true);
mochi.as2.MochiScores.boardID = boardID;
mochi.as2.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
options.clip = mochi.as2.MochiServices.clip;
if ((options.clip != mochi.as2.MochiServices.__get__clip()) || (mochi.as2.MochiServices.__get__childClip()._target == undefined)) {
mochi.as2.MochiServices.disconnect();
trace("WARNING! This application is attempting to connect to MochiServices inside a showLeaderboard call!");
trace("make sure MochiServices.connect is called as early in the application runtime as possible.");
mochi.as2.MochiServices.connect(mochi.as2.MochiServices.__get__id(), options.clip);
}
delete options.clip;
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (options.score instanceof TextField) {
if (options.score.text != undefined) {
options.score = options.score.text;
}
} else if (options.score instanceof mochi.as2.MochiDigits) {
options.score = options.score.value;
}
var _local1 = Number(options.score);
if (isNaN(_local1)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'");
} else if ((_local1 == Number.NEGATIVE_INFINITY) || (_local1 == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(_local1) != _local1) {
trace(("WARNING: Submitted score '" + options.score) + "' will be truncated");
}
options.score = _local1;
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.as2.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.as2.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.as2.MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
mochi.as2.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.as2.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
score = Number(score);
if (isNaN(score)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'");
} else if ((score == Number.NEGATIVE_INFINITY) || (score == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(score) != score) {
trace(("WARNING: Submitted score '" + String(score)) + "' will be truncated");
}
score = Number(score);
}
mochi.as2.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 600 MovieClip [__Packages.mochi.as2.MochiDigits] Frame 0
class mochi.as2.MochiDigits
{
var Encoder, Fragment, Sibling;
function MochiDigits (digit, index) {
Encoder = 0;
setValue(digit, index);
}
function get value() {
return(Number(toString()));
}
function set value(v) {
setValue(v);
//return(value);
}
function addValue(v) {
value = value + v;
}
function setValue(digit, index) {
var _local3 = digit.toString();
if ((index == undefined) || (isNaN(index))) {
index = 0;
}
Fragment = _local3.charCodeAt(index++) ^ Encoder;
if (index < _local3.length) {
Sibling = new mochi.as2.MochiDigits(digit, index);
} else {
Sibling = null;
}
reencode();
}
function reencode() {
var _local2 = int(2147483647 * Math.random());
Fragment = Fragment ^ (_local2 ^ Encoder);
Encoder = _local2;
}
function toString() {
var _local2 = String.fromCharCode(Fragment ^ Encoder);
return(((Sibling != null) ? (_local2.concat(Sibling.toString())) : (_local2)));
}
}
Symbol 53 MovieClip Frame 109
_root.gotoAndPlay("mainmenu");
Symbol 55 Button
on (release) {
_root.gotoAndPlay("instr");
}
Symbol 57 Button
on (release) {
_root.gotoAndPlay("instr");
}
Symbol 59 Button
on (release) {
getURL ("http://www.flashgamesnexus.com", "_blank");
}
Symbol 61 Button
on (release) {
_root.gotoAndPlay("credits");
}
Symbol 63 Button
on (release) {
getURL ("http://www.flashninjaclan.com/fncgames.php", "_blank");
}
Symbol 67 Button
on (release) {
getURL ("http://www.flashgamesnexus.com", "_blank");
}
Symbol 70 Button
on (release) {
getURL ("http://www.flashninjaclan.com", "_blank");
}
Symbol 82 Button
on (release) {
_root.gotoAndStop("story");
}
Symbol 92 Button
on (release) {
_root.gotoAndStop("mainmenu");
}
Symbol 95 Button
on (release) {
_root.gotoAndStop("levelselect");
}
Symbol 103 Button
on (release) {
_root.gotoAndStop("skillshop");
}
Instance of Symbol 100 MovieClip in Symbol 113 MovieClip Frame 1
onClipEvent (load) {
if (_root.maxlevelbeat < 1) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 100 MovieClip in Symbol 117 MovieClip Frame 1
onClipEvent (load) {
if (_root.maxlevelbeat < 2) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 100 MovieClip in Symbol 122 MovieClip Frame 1
onClipEvent (load) {
if (_root.maxlevelbeat < 3) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 100 MovieClip in Symbol 126 MovieClip Frame 1
onClipEvent (load) {
if (_root.maxlevelbeat < 4) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 100 MovieClip in Symbol 144 MovieClip Frame 1
onClipEvent (load) {
if (_root.maxlevelbeat < 5) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 100 MovieClip in Symbol 148 MovieClip Frame 1
onClipEvent (load) {
if (_root.maxlevelbeat < 6) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 100 MovieClip in Symbol 152 MovieClip Frame 1
onClipEvent (load) {
if (_root.maxlevelbeat < 7) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 100 MovieClip in Symbol 156 MovieClip Frame 1
onClipEvent (load) {
if (_root.maxlevelbeat < 8) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 100 MovieClip in Symbol 160 MovieClip Frame 1
onClipEvent (load) {
if (_root.maxlevelbeat < 9) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 100 MovieClip in Symbol 164 MovieClip Frame 1
onClipEvent (load) {
if (_root.maxlevelbeat < 5) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 176 Button
on (release) {
if ((_global.xpleft > 0) && (_global.attackskill < 5)) {
_global.attackskill++;
_global.xpleft--;
_root.attackskill = _global.attackskill;
_root.xpleft = _global.xpleft;
}
}
Symbol 179 Button
on (release) {
if (_global.attackskill > 0) {
_global.attackskill--;
_global.xpleft++;
_root.attackskill = _global.attackskill;
_root.xpleft = _global.xpleft;
}
}
Symbol 183 Button
on (release) {
if ((_global.xpleft > 0) && (_global.rangeskill < 5)) {
_global.rangeskill++;
_global.xpleft--;
_root.rangeskill = _global.rangeskill;
_root.xpleft = _global.xpleft;
}
}
Symbol 184 Button
on (release) {
if (_global.rangeskill > 0) {
_global.rangeskill--;
_global.xpleft++;
_root.rangeskill = _global.rangeskill;
_root.xpleft = _global.xpleft;
}
}
Symbol 187 Button
on (release) {
if ((_global.xpleft > 0) && (_global.startmoneylevel < 5)) {
_global.startmoneylevel++;
_global.xpleft--;
_root.startmoneylevel = _global.startmoneylevel;
_root.xpleft = _global.xpleft;
}
}
Symbol 188 Button
on (release) {
if (_global.startmoneylevel > 0) {
_global.startmoneylevel--;
_global.xpleft++;
_root.startmoneylevel = _global.startmoneylevel;
_root.xpleft = _global.xpleft;
}
}
Symbol 195 Button
on (release) {
if ((_global.xpleft > 0) && (_global.killbounty < 5)) {
_global.killbounty++;
_global.xpleft--;
_root.killbounty = _global.killbounty;
_root.xpleft = _global.xpleft;
}
}
Symbol 196 Button
on (release) {
if (_global.killbounty > 0) {
_global.killbounty--;
_global.xpleft++;
_root.killbounty = _global.killbounty;
_root.xpleft = _global.xpleft;
}
}
Symbol 201 Button
on (release) {
if ((_global.xpleft > 0) && (_global.gems < 5)) {
_global.gems++;
_global.xpleft--;
_root.gems = _global.gems;
_root.xpleft = _global.xpleft;
}
}
Symbol 202 Button
on (release) {
if (_global.gems > 0) {
_global.gems--;
_global.xpleft++;
_root.gems = _global.gems;
_root.xpleft = _global.xpleft;
}
}
Symbol 206 Button
on (release) {
storedskills = SharedObject.getLocal("flashskill");
storedskills.data.attackskill = _global.attackskill;
storedskills.data.xpleft = _global.xpleft;
storedskills.data.rangeskill = _global.rangeskill;
storedskills.data.startmoneylevel = _global.startmoneylevel;
storedskills.data.killbounty = _global.killbounty;
storedskills.data.gems = _global.gems;
storedskills.data.techlevel = _global.techlevel;
if (storedskills.data.techlevel == undefined) {
storedskills.data.techlevel = 0;
}
if (storedskills.data.attackskill == undefined) {
storedskills.data.attackskill = 0;
}
if (storedskills.data.xpleft == undefined) {
storedskills.data.xpleft = 0;
}
if (storedskills.data.rangeskill == undefined) {
storedskills.data.rangeskill = 0;
}
if (storedskills.data.startmoneylevel == undefined) {
storedskills.data.startmoneylevel = 0;
}
if (storedskills.data.killbounty == undefined) {
storedskills.data.killbounty = 0;
}
if (storedskills.data.gems == undefined) {
storedskills.data.gems = 0;
}
_root.gotoAndPlay("levelselect");
}
Symbol 209 Button
on (release) {
if ((_global.xpleft > 0) && (_global.techlevel < 5)) {
_global.techlevel++;
_global.xpleft--;
_root.techlevel = _global.techlevel;
_root.xpleft = _global.xpleft;
}
}
Symbol 210 Button
on (release) {
if (_global.techlevel > 0) {
_global.techlevel--;
_global.xpleft++;
_root.techlevel = _global.techlevel;
_root.xpleft = _global.xpleft;
}
}
Symbol 228 MovieClip Frame 2
stop();
Symbol 235 MovieClip Frame 1
stop();
Symbol 235 MovieClip Frame 2
stop();
Symbol 235 MovieClip Frame 3
stop();
Symbol 235 MovieClip Frame 4
stop();
Symbol 235 MovieClip Frame 5
stop();
Instance of Symbol 235 MovieClip "levelicon" in Symbol 236 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(this._parent.tier);
}
Instance of Symbol 235 MovieClip "levelicon" in Symbol 238 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(this._parent.tier);
}
Instance of Symbol 235 MovieClip "levelicon" in Symbol 240 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(this._parent.tier);
}
Instance of Symbol 235 MovieClip "levelicon" in Symbol 242 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(this._parent.tier);
}
Instance of Symbol 100 MovieClip in Symbol 242 MovieClip Frame 1
onClipEvent (load) {
if (_root.techlevel >= 1) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 235 MovieClip "levelicon" in Symbol 244 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(this._parent.tier);
}
Instance of Symbol 100 MovieClip in Symbol 244 MovieClip Frame 1
onClipEvent (load) {
if (_root.techlevel >= 1) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 235 MovieClip "levelicon" in Symbol 246 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(this._parent.tier);
}
Instance of Symbol 100 MovieClip in Symbol 246 MovieClip Frame 1
onClipEvent (load) {
if (_root.techlevel >= 4) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 235 MovieClip "levelicon" in Symbol 248 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(this._parent.tier);
}
Instance of Symbol 100 MovieClip in Symbol 248 MovieClip Frame 1
onClipEvent (load) {
if (_root.techlevel >= 3) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 235 MovieClip "levelicon" in Symbol 252 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(this._parent.tier);
}
Instance of Symbol 100 MovieClip in Symbol 252 MovieClip Frame 1
onClipEvent (load) {
if (_root.techlevel >= 3) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 235 MovieClip "levelicon" in Symbol 254 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(this._parent.tier);
}
Instance of Symbol 100 MovieClip in Symbol 254 MovieClip Frame 1
onClipEvent (load) {
if (_root.techlevel >= 2) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 235 MovieClip "levelicon" in Symbol 256 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(this._parent.tier);
}
Instance of Symbol 100 MovieClip in Symbol 256 MovieClip Frame 1
onClipEvent (load) {
if (_root.techlevel >= 4) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 235 MovieClip "levelicon" in Symbol 258 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(this._parent.tier);
}
Instance of Symbol 100 MovieClip in Symbol 258 MovieClip Frame 1
onClipEvent (load) {
if (_root.techlevel >= 5) {
this._visible = false;
} else {
this._visible = true;
}
}
Symbol 267 MovieClip Frame 1
stop();
Symbol 267 MovieClip Frame 2
stop();
Symbol 280 MovieClip Frame 1
stop();
Symbol 280 MovieClip Frame 2
this.live = 0;
_root.thescore = _root.thescore + 10;
if (_global.sound == 1) {
_root.playsound5.start(0, 1);
}
Symbol 280 MovieClip Frame 6
this.reset();
Symbol 289 MovieClip Frame 5
if (this._name != "explosion") {
this.removeMovieClip();
}
Symbol 310 MovieClip Frame 11
if (this._name != "aftereffect") {
this.removeMovieClip();
}
Instance of Symbol 235 MovieClip "levelicon" in Symbol 314 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(this._parent.tier);
}
Symbol 322 MovieClip Frame 5
if (this._name != "iceball") {
this.removeMovieClip();
}
Symbol 327 MovieClip Frame 7
if (this._name != "lighteffect") {
this.removeMovieClip();
}
Symbol 333 MovieClip Frame 5
this.removeMovieClip();
Symbol 336 MovieClip Frame 9
if (this._name != "shockshot") {
this.removeMovieClip();
}
Symbol 341 MovieClip Frame 5
this.removeMovieClip();
Instance of Symbol 350 MovieClip "UpgradeButton" in Symbol 353 MovieClip Frame 1
on (press) {
a = _root.selectedTower;
b = a.maxtier;
c = a.tier;
if (c < b) {
_root.upgrade();
}
}
Instance of Symbol 350 MovieClip "sellbutton" in Symbol 353 MovieClip Frame 1
on (press) {
_root.sell();
}
Instance of Symbol 352 MovieClip "xsymbol" in Symbol 353 MovieClip Frame 1
on (release) {
this._parent._visible = false;
}
Symbol 362 Button
on (release) {
if (((_root.wave < _global.maxwaves) && (_root.pauses == 0)) && (_root.timer < 50)) {
_root.kills = 0;
_root.newLevel();
_root.score = _root.score + (40 * _root.timer);
addgold = Math.floor(_root.timer / 3);
_root.gold = _root.gold + addgold;
_root.timer = 60;
}
}
Symbol 371 MovieClip Frame 1
stop();
Symbol 371 MovieClip Frame 2
stop();
Symbol 371 MovieClip Frame 3
stop();
Symbol 371 MovieClip Frame 4
stop();
Symbol 378 MovieClip Frame 1
stop();
stop();
Instance of Symbol 377 MovieClip in Symbol 378 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this._parent.iscorrode != 0) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 384 MovieClip Frame 10
if (this._name != "goldeffect") {
this.removeMovieClip();
}
Symbol 412 Button
on (release) {
_root.pauses = 1;
_root.quitbox._visible = true;
}
Symbol 417 Button
on (release) {
stopAllSounds();
_root.pauses = 0;
while (_root.creepArray.length > 0) {
i = 0;
while (i < _root.creepArray.length) {
trace(i);
_root.creepArray[i].removeMovieClip();
_root.creepArray.splice(i, 1);
i++;
}
}
_root.marker.swapDepths(9994);
_root.marker.removeMovieClip();
_root.range.swapDepths(9993);
_root.range.removeMovieClip();
_root.creep1.swapDepths(9992);
_root.creep1.removeMovieClip();
_root.UpgradeTowerInfo.swapDepths(9991);
_root.UpgradeTowerInfo.removeMovieClip();
_root.range.swapDepths(9999);
_root.range.removeMovieClip();
j = 0;
while (j <= _root.towerCount) {
_root["t" + j].removeMovieClip();
j++;
}
if (_root.creepArray.length <= 0) {
_root.gotoAndPlay("mainmenu");
}
}
Symbol 420 Button
on (release) {
_root.pauses = 0;
_root.quitbox._visible = false;
}
Symbol 426 Button
on (release) {
_root.gotoAndPlay("levelselect");
}
Symbol 430 Button
on (release) {
getURL ("http://www.flashgamesnexus.com/flash-games/Space-Invasion-Tower-Defense.php", "_blank");
}
Symbol 433 Button
on (release) {
getURL ("http://www.flashgamesnexus.com/flash-games/Ninjas-vs-Pirates-TD.php", "_blank");
}
Symbol 436 Button
on (release) {
getURL ("http://www.flashgamesnexus.com/flash-games/Highlord-TD.php", "_blank");
}