Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
ctx = new ContextMenu();
ctx.hideBuiltInItems();
_root.menu = ctx;
MochiAd.showPreGameAd({id:"fcd7c52afae7201d", res:"440x362"});
__com_mochibot__("cc15ca05", this, 10301, true);
_root.submit_kongregate = true;
if (_root.submit_kongregate) {
_root.kongregateServices.connect();
}
Frame 2
stop();
stopAllSounds();
_root.top_bar._visible = false;
_root.select = null;
Frame 3
function getInterest() {
return(Math.floor(_root.money * 0.1));
}
function readyForLevel() {
if (_root.creeps.length == 0) {
if (_root.ready_for_level) {
return(true);
}
if (_root.level_count_down < Const.TIME_BETWEEN_LEVELS) {
if ((_root.level_count_down == 0) && (_root.level != 0)) {
_root.level_complete_sound.start();
}
_root.level_count_down++;
} else {
_root.ready_for_level = true;
}
}
return(false);
}
function hideTowers() {
var _local2 = 0;
while (_local2 < _root.towers.length) {
_root.towers[_local2].bounds._visible = false;
_local2++;
}
}
function showTowers() {
var _local2 = 0;
while (_local2 < _root.towers.length) {
_root.towers[_local2].bounds._visible = true;
_local2++;
}
}
function distance(x1, y1, x2, y2) {
dx = x1 - x2;
dy = y1 - y2;
dist = Math.sqrt((dx * dx) + (dy * dy));
return(dist);
}
_root.background = new Sound(backgroundSMC);
_root.bomb_sound = new Sound(bombSMC);
_root.pistol_sound = new Sound(pistolSMC);
_root.laser_sound = new Sound(laserSMC);
_root.multi_sound = new Sound(multiSMC);
_root.freeze_sound = new Sound(freezeSMC);
_root.poison_sound = new Sound(poisonSMC);
_root.rapid_sound = new Sound(rapidSMC);
_root.level_complete_sound = new Sound(levelCompleteSMC);
_root.win_sound = new Sound(winSMC);
_root.lose_sound = new Sound(loseSMC);
_root.level_complete_sound.attachSound("level_complete_sound");
_root.win_sound.attachSound("win_sound");
_root.lose_sound.attachSound("lose_sound");
_root.background.attachSound("bg_music_2");
_root.background.setVolume(10);
_root.background.start(0, 99999);
_root.option_panel._visible = false;
_root.top_bar._visible = true;
_root.top_bar.swapDepths(60000);
_root.option_panel.swapDepths(70000);
stop();
if ((_root.difficulty == null) or (_root.difficulty == undefined)) {
_root.difficulty = 1;
}
var ready_for_level = false;
var between_levels = false;
var lives = 20;
var speed = 1.25;
var money = 25;
var level = 0;
var last_level = 50;
var level_text = "1/50";
var creeps = new Array();
var towers = new Array();
var placing_tower = false;
var select = null;
var creep_depth = 1000;
var tower_depth = 10000;
var bullet_depth = 20000;
var upgrade_depth = 50000;
var add_zombie = true;
var delay = 55;
var delay_counter = 0;
var creep_count = 0;
var max_creeps = 10;
var level_life = (level * (level + 5));
var level_speed = 1;
var level_money = 1;
var paused = false;
var zombie_type = "regular";
var zombie_num_type = ("Average Zombies: " + max_creeps);
var zombie_health = ("Health: " + level_life);
var zombie_reward = ("Reward: " + level_money);
var zombie_interest = "Interest: 0";
var level_count_down_max = 175;
var level_count_down = 0;
var send_creeps = false;
var total_creeps_killed = 0;
var total_money_earned = 0;
var spawn = new Spawn();
var last_level_interest = 0;
var level_text_desc = spawn.getLevelDescription();
var fps = 30;
var timeinit = new Date();
var lasttime = timeinit.getMilliseconds();
var keep_playing = false;
onEnterFrame = function () {
var _local2 = new Date();
timepassed = (((_local2.getMilliseconds() - lasttime) >= 0) ? (_local2.getMilliseconds() - lasttime) : (1000 + (_local2.getMilliseconds() - lasttime)));
fps = Math.round(10000 / timepassed) / 10;
lasttime = _local2.getMilliseconds();
if (!_root.paused) {
Const.reorder_creeps();
if (readyForLevel()) {
_root.level++;
_root.level_text = _root.level + "/50";
_root.level_text_desc = spawn.getLevelDescription();
if (_root.level != 1) {
_root.last_level_interest = getInterest();
}
_root.money = _root.money + last_level_interest;
if ((_root.level > _root.last_level) && (_root.keep_playing == false)) {
_root.attachMovie("win", "win" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
} else {
spawn.spawn_creeps();
_root.ready_for_level = false;
_root.level_count_down = 0;
}
}
}
};
Array.prototype.remove = function (obj) {
var _local3 = [];
var _local2 = 0;
while (_local2 < this.length) {
if (this[_local2] != obj) {
_local3.push(this[_local2]);
}
_local2++;
}
return(_local3);
};
Symbol 19 MovieClip [pistol] Frame 1
#initclip 27
Object.registerClass("pistol", Tower);
#endinitclip
Symbol 23 MovieClip [pistol_bullet] Frame 1
#initclip 8
Object.registerClass("pistol_bullet", Bullet);
#endinitclip
Symbol 58 MovieClip [upgrade_area] Frame 1
#initclip 9
Object.registerClass("upgrade_area", UpgradeArea);
#endinitclip
Symbol 66 MovieClip [pistol_turret] Frame 1
stop();
Symbol 66 MovieClip [pistol_turret] Frame 2
stop();
Symbol 66 MovieClip [pistol_turret] Frame 3
stop();
Symbol 66 MovieClip [pistol_turret] Frame 4
stop();
Symbol 66 MovieClip [pistol_turret] Frame 5
stop();
Symbol 69 MovieClip [pistol_base] Frame 1
stop();
Symbol 69 MovieClip [pistol_base] Frame 2
stop();
Symbol 69 MovieClip [pistol_base] Frame 3
stop();
Symbol 69 MovieClip [pistol_base] Frame 4
stop();
Symbol 69 MovieClip [pistol_base] Frame 5
stop();
Symbol 70 MovieClip [bomb] Frame 1
#initclip 10
Object.registerClass("bomb", Tower);
#endinitclip
Symbol 71 MovieClip [bomb_base] Frame 1
stop();
Symbol 71 MovieClip [bomb_base] Frame 2
stop();
Symbol 71 MovieClip [bomb_base] Frame 3
stop();
Symbol 71 MovieClip [bomb_base] Frame 4
stop();
Symbol 71 MovieClip [bomb_base] Frame 5
stop();
Symbol 79 MovieClip [bomb_turret] Frame 1
stop();
Symbol 79 MovieClip [bomb_turret] Frame 2
stop();
Symbol 79 MovieClip [bomb_turret] Frame 3
stop();
Symbol 79 MovieClip [bomb_turret] Frame 4
stop();
Symbol 79 MovieClip [bomb_turret] Frame 5
stop();
Symbol 82 MovieClip [bomb_bullet] Frame 1
#initclip 11
Object.registerClass("bomb_bullet", Bullet);
#endinitclip
Symbol 87 MovieClip [zombie] Frame 1
#initclip 12
Object.registerClass("zombie", Creep);
#endinitclip
Symbol 88 MovieClip [laser] Frame 1
#initclip 13
Object.registerClass("laser", Tower);
#endinitclip
Symbol 94 MovieClip [laser_turret] Frame 1
stop();
Symbol 94 MovieClip [laser_turret] Frame 2
stop();
Symbol 94 MovieClip [laser_turret] Frame 3
stop();
Symbol 94 MovieClip [laser_turret] Frame 4
stop();
Symbol 94 MovieClip [laser_turret] Frame 5
stop();
Symbol 95 MovieClip [laser_base] Frame 1
stop();
Symbol 95 MovieClip [laser_base] Frame 2
stop();
Symbol 95 MovieClip [laser_base] Frame 3
stop();
Symbol 95 MovieClip [laser_base] Frame 4
stop();
Symbol 95 MovieClip [laser_base] Frame 5
stop();
Symbol 97 MovieClip [laser_bullet_red] Frame 1
#initclip 14
Object.registerClass("laser_bullet_red", Bullet);
#endinitclip
Symbol 99 MovieClip [laser_bullet_yellow] Frame 1
#initclip 15
Object.registerClass("laser_bullet_yellow", Bullet);
#endinitclip
Symbol 101 MovieClip [laser_bullet_green] Frame 1
#initclip 16
Object.registerClass("laser_bullet_green", Bullet);
#endinitclip
Symbol 103 MovieClip [laser_bullet_purple] Frame 1
#initclip 17
Object.registerClass("laser_bullet_purple", Bullet);
#endinitclip
Symbol 105 MovieClip [laser_bullet_blue] Frame 1
#initclip 18
Object.registerClass("laser_bullet_blue", Bullet);
#endinitclip
Symbol 118 MovieClip [multishot] Frame 1
#initclip 19
Object.registerClass("multishot", Tower);
#endinitclip
Symbol 120 MovieClip [multishot_bullet] Frame 1
#initclip 20
Object.registerClass("multishot_bullet", Bullet);
#endinitclip
Symbol 127 MovieClip [multishot_turret] Frame 1
stop();
Symbol 127 MovieClip [multishot_turret] Frame 2
stop();
Symbol 127 MovieClip [multishot_turret] Frame 3
stop();
Symbol 127 MovieClip [multishot_turret] Frame 4
stop();
Symbol 127 MovieClip [multishot_turret] Frame 5
stop();
Symbol 152 Button
on (press) {
this.removeMovieClip();
}
Symbol 157 Button
on (release) {
_root.difficulty = Const.EASY;
_root.play();
this.removeMovieClip();
}
Symbol 161 Button
on (release) {
_root.difficulty = Const.MEDIUM;
_root.play();
this.removeMovieClip();
}
Symbol 165 Button
on (release) {
_root.difficulty = Const.HARD;
_root.play();
this.removeMovieClip();
}
Symbol 175 Button
on (press) {
this.removeMovieClip();
}
Symbol 181 Button
on (press) {
gotoAndPlay (2);
}
Symbol 187 Button
on (press) {
gotoAndPlay (1);
}
Symbol 189 Button
on (press) {
gotoAndPlay (3);
}
Symbol 190 Button
on (press) {
gotoAndPlay (2);
}
Symbol 192 Button
on (press) {
gotoAndPlay (4);
}
Symbol 193 Button
on (press) {
gotoAndPlay (3);
}
Symbol 195 Button
on (press) {
gotoAndPlay (5);
}
Symbol 196 Button
on (press) {
gotoAndPlay (4);
}
Symbol 198 Button
on (press) {
gotoAndPlay (6);
}
Symbol 199 Button
on (press) {
gotoAndPlay (5);
}
Symbol 201 MovieClip [instructions] Frame 1
stop();
Symbol 201 MovieClip [instructions] Frame 2
stop();
Symbol 201 MovieClip [instructions] Frame 3
stop();
Symbol 201 MovieClip [instructions] Frame 4
stop();
Symbol 201 MovieClip [instructions] Frame 5
stop();
Symbol 201 MovieClip [instructions] Frame 6
stop();
Symbol 210 MovieClip [splash] Frame 14
this.removeMovieClip();
Symbol 217 Button
on (press) {
Const.stop_game();
_root.gotoAndPlay(2);
_root.option_panel.removeMovieClip();
}
Symbol 220 Button
on (press) {
_root.paused = false;
_root.option_panel.removeMovieClip();
}
Symbol 227 MovieClip [freezing_turret] Frame 1
stop();
Symbol 227 MovieClip [freezing_turret] Frame 2
stop();
Symbol 227 MovieClip [freezing_turret] Frame 3
stop();
Symbol 227 MovieClip [freezing_turret] Frame 4
stop();
Symbol 227 MovieClip [freezing_turret] Frame 5
stop();
Symbol 229 MovieClip [freezing_bullet] Frame 1
#initclip 21
Object.registerClass("freezing_bullet", Bullet);
#endinitclip
Symbol 230 MovieClip [Freezing] Frame 1
#initclip 22
Object.registerClass("Freezing", Tower);
#endinitclip
Symbol 231 MovieClip [Poison] Frame 1
#initclip 23
Object.registerClass("Poison", Tower);
#endinitclip
Symbol 233 MovieClip [poison_bullet] Frame 1
#initclip 24
Object.registerClass("poison_bullet", Bullet);
#endinitclip
Symbol 239 MovieClip [poison_turret] Frame 1
stop();
Symbol 239 MovieClip [poison_turret] Frame 2
stop();
Symbol 239 MovieClip [poison_turret] Frame 3
stop();
Symbol 239 MovieClip [poison_turret] Frame 4
stop();
Symbol 239 MovieClip [poison_turret] Frame 5
stop();
Symbol 240 MovieClip [Rapid] Frame 1
#initclip 25
Object.registerClass("Rapid", Tower);
#endinitclip
Symbol 246 MovieClip [rapid_turret] Frame 1
stop();
Symbol 246 MovieClip [rapid_turret] Frame 2
stop();
Symbol 246 MovieClip [rapid_turret] Frame 3
stop();
Symbol 246 MovieClip [rapid_turret] Frame 4
stop();
Symbol 246 MovieClip [rapid_turret] Frame 5
stop();
Symbol 248 MovieClip [rapid_bullet] Frame 1
#initclip 26
Object.registerClass("rapid_bullet", Bullet);
#endinitclip
Symbol 253 Button
on (release) {
gotoAndPlay (3);
}
Symbol 266 Button
on (press) {
_root.gotoAndPlay(2);
this.removeMovieClip();
}
Symbol 267 MovieClip [Lose] Frame 1
_root.lose_sound.start();
stop();
Symbol 275 Button
on (release) {
Const.stop_game();
_root.gotoAndPlay(2);
this.removeMovieClip();
}
Symbol 280 Button
on (press) {
_root.paused = false;
_root.keep_playing = true;
this.removeMovieClip();
}
Symbol 281 MovieClip [win] Frame 1
_root.win_sound.start();
_root.paused = true;
if (_root.submit_kongregate) {
_root.kongregateStats.submit("TotalMoneyEarned", _root.total_money_earned);
_root.kongregateStats.submit("TotalCreepsKilled", _root.total_creeps_killed);
if (_root.difficulty == Const.EASY) {
_root.kongregateStats.submit("CompletedGameEasy", 1);
} else if (_root.difficulty == Const.MEDIUM) {
_root.kongregateStats.submit("CompletedGameMedium", 1);
} else if (_root.difficulty == Const.HARD) {
_root.kongregateStats.submit("CompletedGameHard", 1);
}
}
if (_root.difficulty == Const.EASY) {
this.ending_text = "You have beaten Zombie Tower Defense 3 on the Easy difficulty setting. I am sure your grandma would be proud of your wussy zombie destroying skills.";
} else if (_root.difficulty == Const.MEDIUM) {
this.ending_text = "You have beaten Zombie Tower Defense 3 on the Medium difficulty setting. You are moderately skilled in the ways of zombie destruction. Think you can handle Hard?";
} else if (_root.difficulty == Const.HARD) {
this.ending_text = "You have owned Zombie Tower Defense 3. Your zombie destroying skills are unsurpassed. Your friends and neighbors cheer in your success. Great Job!";
}
_root.kongregateStats.submit("GameCompleted", 1);
stop();
Instance of Symbol 284 MovieClip "background" in Symbol 300 MovieClip [Sniper Menu Item] Frame 1
onClipEvent (load) {
}
Symbol 372 MovieClip [__Packages.Const] Frame 0
class Const
{
function Const () {
}
static function speed_string(speed) {
return((int((35 / speed) * 100) / 100) + " per sec");
}
static function splash_string(range) {
if (range == 0) {
return("None");
}
return(range);
}
static function poison_string(damage, time) {
if (damage == 0) {
return("None");
}
return(((int(damage * time) + " dmg / ") + (int((time / 35) * 100) / 100)) + " sec");
}
static function slow_string(slow, time) {
if (slow == 0) {
return("None");
}
return(((int(slow * 100) + "% for ") + (int((time / 35) * 100) / 100)) + " sec");
}
static function reorder_creeps() {
var _local2 = 1;
while (_local2 < _root.creeps.length) {
var _local4 = _root.creeps[_local2 - 1];
var _local3 = _root.creeps[_local2];
if (!_local4.closer_to_end(_local3)) {
_root.creeps[_local2 - 1] = _local3;
_root.creeps[_local2] = _local4;
}
_local2++;
}
}
static function stop_game() {
_root.top_bar._visible = false;
_root.paused = true;
stopAllSounds();
_root.creep_count = 9999;
_root.spawn = null;
var _local2 = 0;
while (_local2 < _root.creeps.length) {
_root.creeps[_local2].removeMovieClip();
_local2++;
}
_local2 = 0;
while (_local2 < _root.towers.length) {
_root.towers[_local2].removeMovieClip();
_local2++;
}
_root.select = null;
_root.stop();
}
static var EASY = 0.75;
static var MEDIUM = 1;
static var HARD = 1.25;
static var GAME_END_FRAME = 5;
static var STARTING_LIVES = 20;
static var BASE_SPEED = 1.25;
static var STARTING_MONEY = 500;
static var CREEP_DEPTH = 1000;
static var TOWER_DEPTH = 10000;
static var BULLET_DEPTH = 20000;
static var UPGRADE_DEPTH = 50000;
static var TIME_BETWEEN_LEVELS = 175;
static var SPAWN_START_X = 20;
static var SPAWN_START_Y = 20;
static var WAYPOINT_X = new Array(20, 100, 100, 160, 160, 220, 220, 40, 40, 280, 280, 340, 340, 420, 420);
static var WAYPOINT_Y = new Array(110, 110, 170, 170, 90, 90, 250, 250, 310, 310, 110, 110, 190, 190, -40);
static var TYPES = ["regular", "fat", "crawler", "regular_2", "ghoul", "stumpy"];
static var ZOMBIES = [["regular", "Average Zombies", 1, 1.25, 10, 40, 1], ["fat", "Fat Lumbering Zombies", 1.5, 0.75, 10, 30, 1], ["crawler", "Quick Crawling Zombie Torsos", 0.9, 1.35, 15, 40, 1], [-1, "Staggering Zombies", 0.8, -1, 15, 30, 1], ["regular", "Sprinting Zombies", 0.5, 3, 10, 60, 1], ["regular_2", "Regular Joe Zombies", 1, 1.25, 10, 40, 1], ["ghoul", "Ghoulish Creeping Zombies", 1.1, 0.9, 15, 30, 1], ["stumpy", "Stumpy Armless Zombies", 1, 1.35, 10, 30, 1], [-1, "A Zombie Horde", 0.25, 1, 30, 15, 0.25], ["hulk", "A Massive Mutant Zombie Hulk", 8, 1, 1, 35, 9]];
static var PISTOL_TURRET_OPTS = {base_name:"pistol", name:["Pistol Tower I", "Pistol Tower II", "Pistol Tower III", "Pistol Tower IV", "Pistol Tower V"], damage:[4, 12, 40, 100, 200], range:[50, 60, 75, 100, 125], speed:[30, 40, 50, 60, 70], splash:[0, 0, 0, 0, 0], poison:[0, 0, 0, 0, 0], poisontime:[0, 0, 0, 0, 0], slow:[0, 0, 0, 0, 0], slowtime:[0, 0, 0, 0, 0], cost:[10, 10, 20, 40, 80], description:"Shoot bullets at your targets. Upgrades increase the damage and range, but decreases its speed."};
static var BOMB_TURRET_OPTS = {base_name:"bomb", name:["Bomb Tower I", "Bomb Tower II", "Bomb Tower III", "Bomb Tower IV", "Bomb Tower V"], damage:[12, 26, 58, 120, 250], range:[50, 60, 70, 80, 90], speed:[60, 50, 40, 30, 20], splash:[40, 50, 60, 70, 80], poison:[0, 0, 0, 0, 0], poisontime:[0, 0, 0, 0, 0], slow:[0, 0, 0, 0, 0], slowtime:[0, 0, 0, 0, 0], cost:[20, 20, 40, 80, 160], description:"Low damage but has a large splash damage range. Upgrades increase damage, speed and splash range."};
static var LASER_TURRET_OPTS = {base_name:"laser", name:["Laser Tower I", "Laser Tower II", "Laser Tower III", "Laser Tower IV", "Laser Tower V"], bullet_name:["laser_bullet_red", "laser_bullet_yellow", "laser_bullet_green", "laser_bullet_purple", "laser_bullet_blue"], damage:[30, 75, 180, 400, 1250], range:[90, 90, 90, 90, 90], speed:[17.5, 17.5, 17.5, 17.5, 17.5], splash:[0, 0, 0, 0, 0], poison:[0, 0, 0, 0, 0], poisontime:[0, 0, 0, 0, 0], slow:[0, 0, 0, 0, 0], slowtime:[0, 0, 0, 0, 0], cost:[100, 100, 200, 400, 800], description:"High speed, damage and range. Upgrades increase damage. Best damaging tower in the game."};
static var MULTI_TURRET_OPTS = {base_name:"multishot", name:["Multishot Tower I", "Multishot Tower II", "Multishot Tower III", "Multishot Tower IV", "Multishot Tower V"], damage:[18, 32, 64, 128, 256], range:[60, 70, 80, 90, 90], speed:[35, 35, 35, 35, 35], splash:[0, 0, 0, 0, 0], poison:[0, 0, 0, 0, 0], poisontime:[0, 0, 0, 0, 0], slow:[0, 0, 0, 0, 0], slowtime:[0, 0, 0, 0, 0], cost:[40, 40, 80, 160, 320], description:"Shoot lots of bullets. Upgrades increase the damage and the number of bullets launched."};
static var RAPID_TURRET_OPTS = {base_name:"rapid", name:["Rapid Tower I", "Rapid Tower II", "Rapid Tower III", "Rapid Tower IV", "Rapid Tower V"], damage:[8, 16, 32, 64, 128], range:[70, 70, 70, 70, 70], speed:[10, 9, 7, 5, 3], splash:[0, 0, 0, 0, 0], poison:[0, 0, 0, 0, 0], poisontime:[0, 0, 0, 0, 0], slow:[0, 0, 0, 0, 0], slowtime:[0, 0, 0, 0, 0], cost:[60, 60, 120, 240, 480], description:"Low damage, decent range, but really fast. Upgrades increase speed and damage."};
static var FREEZING_TURRET_OPTS = {base_name:"freezing", name:["Freezing Tower I", "Freezing Tower II", "Freezing Tower III", "Freezing Tower IV", "Freezing Tower V"], damage:[2, 5, 12, 30, 75], range:[50, 60, 70, 80, 90], speed:[45, 45, 45, 45, 45], splash:[0, 0, 0, 0, 0], poison:[0, 0, 0, 0, 0], poisontime:[0, 0, 0, 0, 0], slow:[0.7, 0.6, 0.5, 0.4, 0.3], slowtime:[70, 105, 140, 175, 210], cost:[50, 25, 25, 25, 50], description:"Slows down enemies, but does no damage. Upgrades improve the duration and effective slow."};
static var POISON_TURRET_OPTS = {base_name:"poison", name:["Poison Tower I", "Poison Tower II", "Poison Tower III", "Poison Tower IV", "Poison Tower V"], damage:[0, 5, 10, 20, 40], range:[50, 60, 70, 80, 90], speed:[45, 45, 45, 45, 45], splash:[0, 0, 0, 0, 0], poison:[0.25, 0.5, 1, 2, 4], poisontime:[80, 120, 160, 200, 240], slow:[0, 0, 0, 0, 0], slowtime:[0, 0, 0, 0, 0], cost:[30, 30, 60, 120, 240], description:"Damages enemies over time. Upgrades increase the damage and the duration the damage is dealt over."};
}
Symbol 373 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.1");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
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 _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}
Symbol 374 MovieClip [__Packages.Bullet] Frame 0
class Bullet extends MovieClip
{
var _x, _y, _rotation, hitTest, removeMovieClip;
function Bullet () {
super();
}
function setup(speed, damage, splash, poison, poisontime, slow, slowtime, x, y, rotation) {
this.speed = speed;
this.damage = damage;
this.splash = splash;
this.poison = poison;
this.poisontime = poisontime;
this.slow = slow;
this.slowtime = slowtime;
_x = x;
_y = y;
_rotation = rotation;
dirx = Math.cos((_rotation * Math.PI) / 180) * 15;
diry = Math.sin((_rotation * Math.PI) / 180) * 15;
}
function play_sound(sound_id, volume) {
var _local2 = new Sound(this);
_local2.attachSound(sound_id);
_local2.setVolume(volume);
_local2.start();
}
function move() {
if (!_root.paused) {
_x = _x - (speed * dirx);
_y = _y - (speed * diry);
var _local4 = 0;
while (_local4 < _root.creeps.length) {
var _local5 = _root[_root.creeps[_local4]._name];
if (hitTest(_local5)) {
_local5.hp = _local5.hp - damage;
if (splash > 0) {
var splash = _root.attachMovie("splash", "splash" + (_root.bullet_depth++), _root.bullet_depth, {_width:splash, _height:splash, _x:_x, _y:_y});
_local4 = 0;
while (_local4 < _root.creeps.length) {
var _local3 = _root[_root.creeps[_local4]._name];
if (splash.hitTest(_local3) && (_local3 != _local5)) {
_local3.hp = _local3.hp - Math.floor(damage / 4);
}
_local4++;
}
}
if (slow > 0) {
_local5.slowCreep(slow, slowtime);
}
if (poison > 0) {
_local5.poisonCreep(poison, poisontime);
}
removeMovieClip();
}
_local4++;
}
if ((((_x < 0) || (_x > 700)) || (_y < 0)) || (_y > 600)) {
removeMovieClip();
}
}
}
var speed = null;
var damage = null;
var splash = null;
var poison = null;
var poisontime = null;
var slow = null;
var slowtime = null;
var dirx = null;
var diry = null;
}
Symbol 375 MovieClip [__Packages.UpgradeArea] Frame 0
class UpgradeArea extends MovieClip
{
var onEnterFrame, removeMovieClip;
function UpgradeArea () {
super();
upgrade_button.onRelease = function () {
if (_root.money >= this._parent.up_cost) {
_root.money = _root.money - this._parent.up_cost;
this._parent.target.upgrade();
this._parent.update();
if (this._parent.target.level >= 5) {
this._visible = 0;
}
_root.select = null;
this._parent._visible = false;
}
};
sell_button.onRelease = function () {
this._parent.sellTower();
_root.select = null;
this._parent._visible = false;
};
sell_button._x = 335;
sell_button._y = 31;
onEnterFrame = function () {
if (_root.select == this.target) {
this._visible = true;
} else {
this._visible = false;
}
};
}
function update() {
name = target.getName();
speed = Const.speed_string(target.getSpeed());
damage = target.getDamage();
range = target.getRange();
splash = Const.splash_string(target.getSplash());
poison = Const.poison_string(target.getPoison(), target.getPoisonTime());
slow = Const.slow_string(target.getSlow(), target.getSlowTime());
if (target.level < 5) {
up_cost = target.getUpCost();
up_speed = Const.speed_string(target.getUpSpeed());
up_damage = target.getUpDamage();
up_range = target.getUpRange();
up_splash = Const.splash_string(target.getUpSplash());
up_poison = Const.poison_string(target.getUpPoison(), target.getUpPoisonTime());
up_slow = Const.slow_string(target.getUpSlow(), target.getUpSlowTime());
} else {
up_cost = "At max level";
up_speed = "At max level";
up_damage = "At max level";
up_range = "At max level";
}
sell_text = "Sell for " + getSellPrice();
}
function sellTower() {
_root.money = _root.money + getSellPrice();
target.removeMovieClip();
removeMovieClip();
}
function getSellPrice() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < target.level) {
_local3 = _local3 + target.cost[_local2];
_local2++;
}
return(Math.floor(_local3 * 0.9));
}
var target = null;
var name = "";
var sell_price = "";
var speed = "";
var damage = "";
var range = "";
var splash = "";
var poison = "";
var slow = "";
var up_cost = "";
var up_speed = "";
var up_damage = "";
var up_range = "";
var up_splash = "";
var up_poison = "";
var up_slow = "";
var sell_button = null;
var upgrade_button = null;
var sell_text = "Just a test";
}
Symbol 376 MovieClip [__Packages.Tower] Frame 0
class Tower extends MovieClip
{
var attachMovie, getNextHighestDepth, startDrag, onEnterFrame, onRelease, _alpha, stopDrag, _x, _y;
function Tower () {
super();
range_circle = attachMovie("range_circle", "range_circle" + getNextHighestDepth(), getNextHighestDepth());
bounds = attachMovie("bounds", "bounds" + getNextHighestDepth(), getNextHighestDepth());
base = attachMovie(base_name + "_base", (base_name + "_base") + getNextHighestDepth(), getNextHighestDepth());
turret = attachMovie(base_name + "_turret", (base_name + "_turret") + getNextHighestDepth(), getNextHighestDepth());
startDrag(true);
escapeKey = new Object();
escapeKey.cost = cost[0];
escapeKey.target = this;
escapeKey.onKeyDown = function () {
if (Key.getCode() == 32) {
_root.money = _root.money + this.cost;
this.target.removeMovieClip();
Key.removeListener(this);
}
};
Key.addListener(escapeKey);
onEnterFrame = function () {
this.handlePlaceTower();
};
onRelease = function () {
this.handlePlaceRelease();
};
setupRangeCircle();
setupUpgradeArea();
}
function init() {
onRelease = function () {
_root.select = this;
};
onEnterFrame = function () {
this.handleEnterFrame();
};
}
function setupRangeCircle() {
range_circle._alpha = 20;
updateRange();
range_circle.onEnterFrame = function () {
if ((_root.select == this._parent) || (_root.placing_tower)) {
this._visible = true;
} else {
this._visible = false;
}
};
}
function updateRange() {
range_circle._width = getRange() * 2;
range_circle._height = getRange() * 2;
}
function setupUpgradeArea() {
upgrade_area = _root.attachMovie("upgrade_area", "upgrade_area" + (_root.upgrade_depth++), _root.upgrade_depth);
upgrade_area.target = this;
upgrade_area.update();
upgrade_area._x = 2;
upgrade_area._y = 226;
}
function upgrade() {
level++;
updateRange();
turret.gotoAndPlay(level);
base.gotoAndPlay(level);
}
function handlePlaceTower() {
_root.placing_tower = true;
var _local4 = false;
if (bounds.hitTest("_root.menuBar")) {
_local4 = true;
} else {
var _local3 = 0;
while (_local3 < 15) {
if (bounds.hitTest("_root.path.s" + _local3)) {
_local4 = true;
break;
}
_local3++;
}
if (!_local4) {
_local3 = 0;
while (_local3 < _root.towers.length) {
if ((this != _root.towers[_local3]) && (bounds.hitTest(_root.towers[_local3].bounds))) {
_local4 = true;
break;
}
_local3++;
}
}
}
if (_local4) {
_alpha = 50;
} else {
_alpha = 100;
}
}
function handlePlaceRelease() {
if (_alpha == 100) {
stopDrag();
Key.removeListener(escapeKey);
_root.placing_tower = false;
_root.towers.push(this);
_root.hideTowers();
init();
}
}
function getName() {
return(name[level - 1]);
}
function getBulletName() {
return(bullet_name[level - 1]);
}
function getCost() {
return(cost[level - 1]);
}
function getUpCost() {
return(cost[level]);
}
function getDamage() {
return(damage[level - 1]);
}
function getUpDamage() {
return(damage[level]);
}
function getRange() {
return(range[level - 1]);
}
function getUpRange() {
return(range[level]);
}
function getSpeed() {
return(speed[level - 1]);
}
function getUpSpeed() {
return(speed[level]);
}
function getSplash() {
return(splash[level - 1]);
}
function getUpSplash() {
return(splash[level]);
}
function getPoison() {
return(poison[level - 1]);
}
function getUpPoison() {
return(poison[level]);
}
function getPoisonTime() {
return(poisontime[level - 1]);
}
function getUpPoisonTime() {
return(poisontime[level]);
}
function getSlow() {
return(slow[level - 1]);
}
function getUpSlow() {
return(slow[level]);
}
function getSlowTime() {
return(slowtime[level - 1]);
}
function getUpSlowTime() {
return(slowtime[level]);
}
function getBulletCoords() {
var _local2 = {x:turret.bullet_spawn._x, y:turret.bullet_spawn._y};
turret.bullet_spawn.localToGlobal(_local2);
return(_local2);
}
function getBulletCoordsById(id) {
var _local2 = {x:turret["bullet_spawn_" + id]._x, y:turret["bullet_spawn_" + id]._y};
turret["bullet_spawn_" + id].localToGlobal(_local2);
return(_local2);
}
function setupBulletShot(id, bullet_name, rotation_offset) {
var _local4 = getBulletCoordsById(id);
var _local3 = _root.attachMovie(bullet_name, bullet_name + (_root.bullet_depth++), _root.bullet_depth);
_local3.setup(bullet_speed, getDamage(), getSplash(), getPoison(), getPoisonTime(), getSlow(), getSlowTime(), _local4.x, _local4.y, turret._rotation + rotation_offset);
_local3.onEnterFrame = function () {
this.move();
};
return(_local3);
}
function getTargetCoords() {
if (getPoison() == 0) {
var _local4 = 0;
while (_local4 < _root.creeps.length) {
var _local3 = _root[_root.creeps[_local4]._name];
if (_root.distance(_local3._x, _local3._y, _x, _y) <= getRange()) {
return({x:_local3._x, y:_local3._y});
}
_local4++;
}
} else {
var _local5 = null;
var _local4 = 0;
while (_local4 < _root.creeps.length) {
var _local3 = _root[_root.creeps[_local4]._name];
if (_root.distance(_local3._x, _local3._y, _x, _y) <= getRange()) {
if (_local5 == null) {
_local5 = {x:_local3._x, y:_local3._y};
}
if (_local3.poison == 0) {
return({x:_local3._x, y:_local3._y});
}
}
_local4++;
}
return(_local5);
}
return(null);
}
function fireBullet() {
var _local4 = getBulletCoords();
var _local3 = _root.attachMovie("pistol_bullet", "pistol_bullet" + (_root.bullet_depth++), _root.bullet_depth);
trace(turret._rotation);
_local3.setup(bullet_speed, getDamage(), getSplash(), getPoison(), getPoisonTime(), getSlow(), getSlowTime(), _local4.x, _local4.y, turret._rotation);
_local3.play_sound("pistol_bullet_sound", 50);
_local3.onEnterFrame = function () {
this.move();
};
}
function rotateTurret(point) {
if (point != null) {
turret._rotation = (Math.atan2(_y - point.y, _x - point.x) * 180) / Math.PI;
}
}
function canFire(count) {
return(count > getSpeed());
}
function handleEnterFrame() {
if (!_root.paused) {
if (_root.select == this) {
upgrade_area._visible = true;
range_circle._visible = true;
} else {
upgrade_area._visible = false;
range_circle._visible = false;
}
fire_delay_counter++;
var _local3 = getTargetCoords();
rotateTurret(_local3);
if ((_local3 != null) && (canFire(fire_delay_counter))) {
fire_delay_counter = 0;
fireBullet();
}
}
}
var level = 1;
var bullet_speed = 1;
var name = null;
var cost = null;
var damage = null;
var splash = null;
var poison = null;
var poisontime = null;
var slow = null;
var slowtime = null;
var range = null;
var speed = null;
var turret = null;
var base = null;
var bounds = null;
var range_circle = null;
var upgrade_area = null;
var bullet_name = null;
var fire_delay_counter = 0;
var base_name = null;
var escapeKey = null;
}
Symbol 377 MovieClip [__Packages.Creep] Frame 0
class Creep extends MovieClip
{
var attachMovie, getNextHighestDepth, onEnterFrame, _x, _y, removeMovieClip, hitTest;
function Creep () {
super();
zombie = attachMovie(type, type + getNextHighestDepth(), getNextHighestDepth());
health_border = attachMovie("health_border", "health_border" + getNextHighestDepth(), getNextHighestDepth());
health_bar = attachMovie("health_bar", "health_bar" + getNextHighestDepth(), getNextHighestDepth());
health_bar._x = -15;
health_bar._y = 25;
health_border._y = 25;
slowfilter = new flash.filters.GradientGlowFilter(0, 0, slow_colors, alphas, ratios, 3, 3, 1.2, 1, "outer", false);
poisonfilter = new flash.filters.GradientGlowFilter(0, 0, poison_colors, alphas, ratios, 3, 3, 1.2, 1, "outer", false);
onEnterFrame = function () {
this.handleEnterFrame();
};
}
function closer_to_end(other_creep) {
if (next_waypoint > other_creep.next_waypoint) {
return(true);
}
if (next_waypoint == other_creep.next_waypoint) {
return(closer_to_waypoint(other_creep));
}
return(false);
}
function closer_to_waypoint(other_creep) {
if (distance_to_waypoint() < other_creep.distance_to_waypoint()) {
return(true);
}
return(false);
}
function distance_to_waypoint() {
var _local3 = Const.WAYPOINT_X[next_waypoint] - _x;
var _local2 = Const.WAYPOINT_Y[next_waypoint] - _y;
return(Math.abs(_local3) + Math.abs(_local2));
}
function slowCreep(slow, time) {
if (time > 0) {
zombie.filters = [slowfilter];
}
if (slow < this.slow) {
this.slow = slow;
}
if (time > slowtime) {
slowtime = time;
}
}
function poisonCreep(poison, time) {
if (time > 0) {
if (slowtime > 0) {
zombie.filters = [poisonfilter, slowfilter];
} else {
zombie.filters = [poisonfilter];
}
}
if (poison > this.poison) {
this.poison = poison;
}
if (time > poisontime) {
poisontime = time;
}
}
function doPoison() {
if (poisontime > 0) {
hp = hp - poison;
poisontime = poisontime - 1;
if (poisontime == 0) {
poison = 0;
if (slowtime > 0) {
if (poisontime > 0) {
zombie.filters = [poisonfilter, slowfilter];
} else {
zombie.filters = [slowfilter];
}
} else {
zombie.filters = [];
}
}
}
}
function getSpeed() {
if (slowtime == 0) {
return(speed);
}
slowtime = slowtime - 1;
if (slowtime == 0) {
slow = 1;
if (poisontime > 0) {
zombie.filters = [poisonfilter];
} else {
zombie.filters = [];
}
}
return(speed * slow);
}
function getMoney() {
if (money == 0) {
return(1);
}
return(money);
}
function handleEnterFrame() {
if (!_root.paused) {
doPoison();
if (hp <= 0) {
_root.money = _root.money + getMoney();
_root.total_creeps_killed++;
_root.total_money_earned = _root.total_money_earned + getMoney();
_root.creeps = _root.creeps.remove(this);
removeMovieClip();
}
health_bar._width = (hp / life) * 30;
if (hitTest("_root.end_spot")) {
_root.lives--;
if (_root.lives <= 0) {
Const.stop_game();
_root.attachMovie("Lose", "lose" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
}
_root.creeps = _root.creeps.remove(this);
removeMovieClip();
}
var _local5 = Const.WAYPOINT_X[next_waypoint] - _x;
var _local4 = Const.WAYPOINT_Y[next_waypoint] - _y;
if ((Math.abs(_local5) + Math.abs(_local4)) < speed) {
next_waypoint++;
}
var _local3 = Math.atan2(_local4, _local5);
_x = _x + (getSpeed() * Math.cos(_local3));
_y = _y + (getSpeed() * Math.sin(_local3));
zombie._rotation = ((_local3 / 3.14) * 180) - 90;
}
}
var hp = null;
var life = null;
var speed = null;
var money = null;
var type = null;
var slow_colors = [255, 255, 11184895];
var poison_colors = [255, 65280, 11206570];
var alphas = [0, 0.4, 0.3];
var ratios = [0, 50, 255];
var slow = 1;
var slowtime = 0;
var slowfilter = null;
var poison = 0;
var poisontime = 0;
var poisonfilter = null;
var next_waypoint = 0;
var description = null;
var zombie = null;
var health_bar = null;
var health_border = null;
var hit_area = null;
}
Symbol 378 MovieClip [__Packages.Spawn] Frame 0
class Spawn
{
function Spawn () {
}
function spawn_creeps() {
var _local3 = getLevelCount();
var _local2 = 0;
while (_local2 < _local3) {
spawnZombie(Const.SPAWN_START_X, getSpawnY(_local2));
_local2++;
}
}
function getSpawnY(index) {
return(Const.SPAWN_START_Y - (index * getLevelDelay()));
}
function spawnZombie(x, y) {
var _local3 = _root.attachMovie("zombie", "zombie" + (_root.creep_depth++), _root.creep_depth, {type:getLevelType(), _x:x, _y:y, speed:getLevelSpeed(), hp:getLevelLife(), life:getLevelLife(), money:getLevelMoney(), description:getLevelDescription()});
_local3._width = _local3._width / 2;
_local3._height = _local3._height / 2;
_root.creeps.push(_local3);
}
function getIndex() {
return((_root.level - 1) % Const.ZOMBIES.length);
}
function getZombie() {
return(Const.ZOMBIES[getIndex()]);
}
function getBaseLevelMoney() {
return(Math.floor(_root.level / 6) + 1);
}
function getBaseLevelLife() {
var _local2 = Math.floor((_root.level * (_root.level + 5)) * _root.difficulty);
if (_local2 <= 0) {
_local2 = 1;
}
return(_local2);
}
function getLevelType() {
var _local2 = getZombie()[0];
if (_local2 == -1) {
var _local3 = Math.floor(Math.random() * Const.TYPES.length);
return(Const.TYPES[_local3]);
}
return(_local2);
}
function getLevelName() {
return(getZombie()[1]);
}
function getLevelLife() {
var _local2 = Math.floor(getZombie()[2] * getBaseLevelLife());
if (_local2 <= 0) {
_local2 = 1;
}
return(_local2);
}
function getLevelSpeed() {
var _local2 = getZombie()[3];
if (_local2 == -1) {
return((Math.random() * 2.5) + 0.5);
}
return(_local2);
}
function getLevelCount() {
return(getZombie()[4]);
}
function getLevelDelay() {
return(getZombie()[5]);
}
function getLevelMoney() {
return(Math.floor(getBaseLevelMoney() * getZombie()[6]));
}
function getLevelDescription() {
var _local2 = ((("<b>" + (getLevelName() || "Zombies")) + "</b>: ") + (getLevelCount() || 1)) + " ";
_local2 = _local2 + (("<b>Max Health</b>: " + (getLevelLife() || 1)) + " ");
_local2 = _local2 + ("<b>Reward</b>: " + (getLevelMoney() || 0));
return(_local2);
}
}
Symbol 318 Button
on (release) {
getURL ("http://www.zombiehead.org");
}
Symbol 323 Button
on (release) {
_root.difficulty_frame = this.attachMovie("difficulty_frame", "difficulty_frame" + this.getNextHighestDepth(), this.getNextHighestDepth());
}
Symbol 325 Button
on (release) {
_root.instruction_frame = this.attachMovie("instructions", "instruction" + this.getNextHighestDepth(), this.getNextHighestDepth());
}
Symbol 330 Button
on (release) {
_root.select = null;
}
Symbol 337 Button
on (release) {
getURL ("http://www.zombiehead.org");
}
Symbol 342 Button
on (press) {
gotoAndPlay (2);
}
Symbol 352 Button
on (press) {
_root.paused = true;
_root.option_panel = this.attachMovie("option_panel", "option_panel" + this.getNextHighestDepth(), this.getNextHighestDepth());
}
Symbol 354 Button
on (press) {
gotoAndPlay (1);
}
Symbol 369 MovieClip Frame 1
stop();
Symbol 369 MovieClip Frame 2
stop();
Instance of Symbol 300 MovieClip [Sniper Menu Item] in Symbol 369 MovieClip Frame 2
onClipEvent (load) {
var info_pane = _root.attachMovie("menu_item_info", "pistol_menu_item_info", _root.getNextHighestDepth() + 100);
info_pane._x = 149;
info_pane._y = 20;
info_pane._visible = false;
info_pane.tower_name = Const.PISTOL_TURRET_OPTS.name[0];
info_pane.damage = Const.PISTOL_TURRET_OPTS.damage[0];
info_pane.cost = Const.PISTOL_TURRET_OPTS.cost[0];
info_pane.range = Const.PISTOL_TURRET_OPTS.range[0];
info_pane.speed = Const.speed_string(Const.PISTOL_TURRET_OPTS.speed[0]);
info_pane.splash = "None";
info_pane.poison = "None";
info_pane.slow = "None";
info_pane.description = Const.PISTOL_TURRET_OPTS.description;
var cost = Const.PISTOL_TURRET_OPTS.cost[0];
this.onRollOver = function () {
this.info_pane._visible = true;
};
this.onRollOut = function () {
this.info_pane._visible = false;
};
this.onRelease = function () {
var _local4 = Const.PISTOL_TURRET_OPTS.cost[0];
if (_root.money >= _local4) {
_root.money = _root.money - _local4;
_root.showTowers();
turret = _root.attachMovie("pistol", "pistol" + (_root.tower_depth++), _root.tower_depth, Const.PISTOL_TURRET_OPTS);
turret.fireBullet = function () {
var _local4 = this.getBulletCoords();
var _local3 = _root.attachMovie("pistol_bullet", "pistol_bullet" + (_root.bullet_depth++), _root.bullet_depth);
_local3.setup(this.bullet_speed, this.getDamage(), this.getSplash(), this.getPoison(), this.getPoisonTime(), this.getSlow(), this.getSlowTime(), _local4.x, _local4.y, this.turret._rotation);
_root.pistol_sound.attachSound("pistol_bullet_sound");
_root.pistol_sound.setVolume(50);
_root.pistol_sound.start();
_local3.onEnterFrame = function () {
this.move();
};
};
}
this.info_pane._visible = false;
_parent.gotoAndPlay(1);
};
}
Instance of Symbol 296 MovieClip [Gernade Thrower Menu Item] in Symbol 369 MovieClip Frame 2
onClipEvent (load) {
var info_pane = _root.attachMovie("menu_item_info", "bomb_menu_item_info", _root.getNextHighestDepth() + 100);
info_pane._x = 149;
info_pane._y = 58;
info_pane._visible = false;
info_pane.tower_name = Const.BOMB_TURRET_OPTS.name[0];
info_pane.damage = Const.BOMB_TURRET_OPTS.damage[0];
info_pane.cost = Const.BOMB_TURRET_OPTS.cost[0];
info_pane.range = Const.BOMB_TURRET_OPTS.range[0];
info_pane.speed = Const.speed_string(Const.BOMB_TURRET_OPTS.speed[0]);
info_pane.splash = Const.BOMB_TURRET_OPTS.splash[0];
info_pane.poison = "None";
info_pane.slow = "None";
info_pane.description = Const.BOMB_TURRET_OPTS.description;
var cost = Const.BOMB_TURRET_OPTS.cost[0];
this.onRollOver = function () {
this.info_pane._visible = true;
};
this.onRollOut = function () {
this.info_pane._visible = false;
};
this.onRelease = function () {
var _local4 = Const.BOMB_TURRET_OPTS.cost[0];
if (_root.money >= _local4) {
_root.money = _root.money - _local4;
_root.showTowers();
turret = _root.attachMovie("bomb", "bomb" + (_root.tower_depth++), _root.tower_depth, Const.BOMB_TURRET_OPTS);
turret.fireBullet = function () {
var _local4 = this.getBulletCoords();
var _local3 = _root.attachMovie("bomb_bullet", "bomb_bullet" + (_root.bullet_depth++), _root.bullet_depth);
_local3.setup(this.bullet_speed, this.getDamage(), this.getSplash(), this.getPoison(), this.getPoisonTime(), this.getSlow(), this.getSlowTime(), _local4.x, _local4.y, this.turret._rotation);
_root.bomb_sound.attachSound("bomb_bullet_sound");
_root.bomb_sound.setVolume(10);
_root.bomb_sound.start();
_local3.onEnterFrame = function () {
this.move();
};
};
}
this.info_pane._visible = false;
_parent.gotoAndPlay(1);
};
}
Instance of Symbol 292 MovieClip [multishot_menu_item] in Symbol 369 MovieClip Frame 2
onClipEvent (load) {
var info_pane = _root.attachMovie("menu_item_info", "multishot_menu_item_info", _root.getNextHighestDepth() + 100);
info_pane._x = 149;
info_pane._y = 190;
info_pane._visible = false;
info_pane.tower_name = Const.MULTI_TURRET_OPTS.name[0];
info_pane.damage = Const.MULTI_TURRET_OPTS.damage[0];
info_pane.cost = Const.MULTI_TURRET_OPTS.cost[0];
info_pane.range = Const.MULTI_TURRET_OPTS.range[0];
info_pane.speed = Const.speed_string(Const.MULTI_TURRET_OPTS.speed[0]);
info_pane.splash = "None";
info_pane.poison = "None";
info_pane.slow = "None";
info_pane.description = Const.MULTI_TURRET_OPTS.description;
var cost = Const.MULTI_TURRET_OPTS.cost[0];
this.onRollOver = function () {
this.info_pane._visible = true;
};
this.onRollOut = function () {
this.info_pane._visible = false;
};
this.onRelease = function () {
var _local4 = Const.MULTI_TURRET_OPTS.cost[0];
if (_root.money >= _local4) {
_root.money = _root.money - _local4;
_root.showTowers();
turret = _root.attachMovie("multishot", "multishot" + (_root.tower_depth++), _root.tower_depth, Const.MULTI_TURRET_OPTS);
turret.fireBullet = function () {
var _local3 = this.setupBulletShot("1", "multishot_bullet", 0);
if (this.level >= 2) {
this.setupBulletShot("2", "multishot_bullet", -15);
this.setupBulletShot("3", "multishot_bullet", 15);
}
if (this.level >= 3) {
this.setupBulletShot("4", "multishot_bullet", -30);
this.setupBulletShot("5", "multishot_bullet", 30);
}
if (this.level >= 4) {
this.setupBulletShot("6", "multishot_bullet", -45);
this.setupBulletShot("7", "multishot_bullet", 45);
}
if (this.level >= 5) {
this.setupBulletShot("8", "multishot_bullet", -60);
this.setupBulletShot("9", "multishot_bullet", 60);
}
_root.multi_sound.attachSound("multi_bullet_sound");
_root.multi_sound.setVolume(5);
_root.multi_sound.start();
};
this.info_pane._visible = false;
_parent.gotoAndPlay(1);
}
};
}
Instance of Symbol 288 MovieClip [SAM Launcher Menu Item] in Symbol 369 MovieClip Frame 2
onClipEvent (load) {
var info_pane = _root.attachMovie("menu_item_info", "laser_menu_item_info", _root.getNextHighestDepth() + 100);
info_pane._x = 149;
info_pane._y = 220;
info_pane._visible = false;
info_pane.tower_name = Const.LASER_TURRET_OPTS.name[0];
info_pane.damage = Const.LASER_TURRET_OPTS.damage[0];
info_pane.cost = Const.LASER_TURRET_OPTS.cost[0];
info_pane.range = Const.LASER_TURRET_OPTS.range[0];
info_pane.speed = Const.speed_string(Const.LASER_TURRET_OPTS.speed[0]);
info_pane.splash = "None";
info_pane.poison = "None";
info_pane.slow = "None";
info_pane.description = Const.LASER_TURRET_OPTS.description;
var cost = Const.LASER_TURRET_OPTS.cost[0];
this.onRollOver = function () {
this.info_pane._visible = true;
};
this.onRollOut = function () {
this.info_pane._visible = false;
};
this.onRelease = function () {
var _local4 = Const.LASER_TURRET_OPTS.cost[0];
if (_root.money >= _local4) {
_root.money = _root.money - _local4;
_root.showTowers();
turret = _root.attachMovie("laser", "laser" + (_root.tower_depth++), _root.tower_depth, Const.LASER_TURRET_OPTS);
turret.fireBullet = function () {
var _local4 = this.getBulletCoords();
var _local3 = _root.attachMovie(this.getBulletName(), this.getBulletName() + (_root.bullet_depth++), _root.bullet_depth);
_local3.setup(this.bullet_speed, this.getDamage(), this.getSplash(), this.getPoison(), this.getPoisonTime(), this.getSlow(), this.getSlowTime(), _local4.x, _local4.y, this.turret._rotation);
_root.laser_sound.attachSound("laser_bullet_sound");
_root.laser_sound.setVolume(20);
_root.laser_sound.start();
_local3.onEnterFrame = function () {
this.move();
};
};
}
this.info_pane._visible = false;
_parent.gotoAndPlay(1);
};
}
Instance of Symbol 360 MovieClip in Symbol 369 MovieClip Frame 2
onClipEvent (load) {
var info_pane = _root.attachMovie("menu_item_info", "freezing_menu_item_info", _root.getNextHighestDepth() + 100);
info_pane._x = 149;
info_pane._y = 160;
info_pane._visible = false;
info_pane.tower_name = Const.FREEZING_TURRET_OPTS.name[0];
info_pane.damage = Const.FREEZING_TURRET_OPTS.damage[0];
info_pane.cost = Const.FREEZING_TURRET_OPTS.cost[0];
info_pane.range = Const.FREEZING_TURRET_OPTS.range[0];
info_pane.speed = Const.speed_string(Const.FREEZING_TURRET_OPTS.speed[0]);
info_pane.splash = "None";
info_pane.poison = "None";
info_pane.slow = Const.slow_string(Const.FREEZING_TURRET_OPTS.slow[0], Const.FREEZING_TURRET_OPTS.slowtime[0]);
info_pane.description = Const.FREEZING_TURRET_OPTS.description;
var cost = Const.FREEZING_TURRET_OPTS.cost[0];
this.onRollOver = function () {
this.info_pane._visible = true;
};
this.onRollOut = function () {
this.info_pane._visible = false;
};
this.onRelease = function () {
var _local4 = Const.FREEZING_TURRET_OPTS.cost[0];
if (_root.money >= _local4) {
_root.money = _root.money - _local4;
_root.showTowers();
turret = _root.attachMovie("freezing", "freezing" + (_root.tower_depth++), _root.tower_depth, Const.FREEZING_TURRET_OPTS);
turret.fireBullet = function () {
var _local4 = this.getBulletCoords();
var _local3 = _root.attachMovie("freezing_bullet", "freezing_bullet" + (_root.bullet_depth++), _root.bullet_depth);
_local3.setup(this.bullet_speed, this.getDamage(), this.getSplash(), this.getPoison(), this.getPoisonTime(), this.getSlow(), this.getSlowTime(), _local4.x, _local4.y, this.turret._rotation);
_root.freeze_sound.attachSound("freeze_bullet_sound");
_root.freeze_sound.setVolume(20);
_root.freeze_sound.start();
_local3.onEnterFrame = function () {
this.move();
};
};
}
this.info_pane._visible = false;
_parent.gotoAndPlay(1);
};
}
Instance of Symbol 364 MovieClip in Symbol 369 MovieClip Frame 2
onClipEvent (load) {
var info_pane = _root.attachMovie("menu_item_info", "poison_menu_item_info", _root.getNextHighestDepth() + 100);
info_pane._x = 149;
info_pane._y = 90;
info_pane._visible = false;
info_pane.tower_name = Const.POISON_TURRET_OPTS.name[0];
info_pane.damage = Const.POISON_TURRET_OPTS.damage[0];
info_pane.cost = Const.POISON_TURRET_OPTS.cost[0];
info_pane.range = Const.POISON_TURRET_OPTS.range[0];
info_pane.speed = Const.speed_string(Const.POISON_TURRET_OPTS.speed[0]);
info_pane.splash = "None";
info_pane.poison = Const.poison_string(Const.POISON_TURRET_OPTS.poison[0], Const.POISON_TURRET_OPTS.poisontime[0]);
info_pane.slow = "None";
info_pane.description = Const.POISON_TURRET_OPTS.description;
var cost = Const.POISON_TURRET_OPTS.cost[0];
this.onRollOver = function () {
this.info_pane._visible = true;
};
this.onRollOut = function () {
this.info_pane._visible = false;
};
this.onRelease = function () {
var _local4 = Const.POISON_TURRET_OPTS.cost[0];
if (_root.money >= _local4) {
_root.money = _root.money - _local4;
_root.showTowers();
turret = _root.attachMovie("poison", "poison" + (_root.tower_depth++), _root.tower_depth, Const.POISON_TURRET_OPTS);
turret.fireBullet = function () {
var _local4 = this.getBulletCoords();
var _local3 = _root.attachMovie("poison_bullet", "poison_bullet" + (_root.bullet_depth++), _root.bullet_depth);
_local3.setup(this.bullet_speed, this.getDamage(), this.getSplash(), this.getPoison(), this.getPoisonTime(), this.getSlow(), this.getSlowTime(), _local4.x, _local4.y, this.turret._rotation);
_root.poison_sound.attachSound("poison_bullet_sound");
_root.poison_sound.setVolume(10);
_root.poison_sound.start();
_local3.onEnterFrame = function () {
this.move();
};
};
}
this.info_pane._visible = false;
_parent.gotoAndPlay(1);
};
}
Instance of Symbol 368 MovieClip in Symbol 369 MovieClip Frame 2
onClipEvent (load) {
var info_pane = _root.attachMovie("menu_item_info", "rapid_menu_item_info", _root.getNextHighestDepth() + 100);
info_pane._x = 149;
info_pane._y = 130;
info_pane._visible = false;
info_pane.tower_name = Const.RAPID_TURRET_OPTS.name[0];
info_pane.damage = Const.RAPID_TURRET_OPTS.damage[0];
info_pane.cost = Const.RAPID_TURRET_OPTS.cost[0];
info_pane.range = Const.RAPID_TURRET_OPTS.range[0];
info_pane.speed = Const.speed_string(Const.RAPID_TURRET_OPTS.speed[0]);
info_pane.splash = "None";
info_pane.poison = "None";
info_pane.slow = "None";
info_pane.description = Const.RAPID_TURRET_OPTS.description;
var cost = Const.RAPID_TURRET_OPTS.cost[0];
this.onRollOver = function () {
this.info_pane._visible = true;
};
this.onRollOut = function () {
this.info_pane._visible = false;
};
this.onRelease = function () {
var _local4 = Const.RAPID_TURRET_OPTS.cost[0];
if (_root.money >= _local4) {
_root.money = _root.money - _local4;
_root.showTowers();
turret = _root.attachMovie("rapid", "rapid" + (_root.tower_depth++), _root.tower_depth, Const.RAPID_TURRET_OPTS);
turret.fireBullet = function () {
var _local4 = this.getBulletCoords();
var _local3 = _root.attachMovie("rapid_bullet", "rapid_bullet" + (_root.bullet_depth++), _root.bullet_depth);
_local3.setup(this.bullet_speed, this.getDamage(), this.getSplash(), this.getPoison(), this.getPoisonTime(), this.getSlow(), this.getSlowTime(), _local4.x, _local4.y, this.turret._rotation);
_root.rapid_sound.attachSound("rapid_bullet_sound");
_root.rapid_sound.setVolume(15);
_root.rapid_sound.start();
_local3.onEnterFrame = function () {
this.move();
};
};
}
this.info_pane._visible = false;
_parent.gotoAndPlay(1);
};
}