Frame 1
mochi.MochiServices.connect("fabdb9c565924979");
MochiAd.showPreGameAd({id:"fabdb9c565924979", res:"650x400"});
Frame 2
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);
}
__com_mochibot__("54b4e036", this, 10301, true);
function dist_ab(ax, ay, bx, by) {
dx = ax - bx;
dy = ay - by;
dist = (dx * dx) + (dy * dy);
return(dist);
}
function help(itext) {
_root.imenu.mb.box.help.text = itext;
_root.imenu.mb.play();
}
function callMinions(hp) {
monsters_placed = 0;
if (level == 1) {
hp = 1;
igold = 2;
num_monsters = 5;
linkage = "min0";
spec = "ground";
speed = 2;
boxtext = ((((("Level " + level) + ": Armoured Tank [") + hp) + "hp, ") + igold) + " gold]";
} else if (level == 2) {
hp = 2;
igold = 4;
num_monsters = 7;
linkage = "min3";
spec = "ground";
speed = 2.5;
boxtext = ((((("Level " + level) + ": Light Tank [") + hp) + "hp, ") + igold) + " gold]";
} else if (level == 3) {
hp = 3;
igold = 6;
num_monsters = 9;
linkage = "min0";
spec = "ground";
speed = 2;
boxtext = ((((("Level " + level) + ": Armoured Tank [") + hp) + "hp, ") + igold) + " gold]";
} else {
if (_root.diff == 0) {
num_monsters = 10;
} else if (_root.diff == 1) {
num_monsters = 15;
} else if (_root.diff == 2) {
num_monsters = 30;
}
modal = random(4);
igold = level * 2;
if (igold > 20) {
igold = 20;
}
if (modal == 0) {
linkage = "min0";
spec = "ground";
speed = 2.5;
boxtext = ((((("Level " + level) + ": Armoured Tank [") + hp) + "hp, ") + igold) + " gold]";
} else if (modal == 1) {
linkage = "min4";
spec = "air";
speed = 3.5;
boxtext = ((((("Level " + level) + ": Fighter planes [") + hp) + "hp, ") + igold) + " gold, FLYING]";
} else if (modal == 2) {
linkage = "min3";
spec = "ground";
speed = 3;
boxtext = ((((("Level " + level) + ": Light tanks [") + hp) + "hp, ") + igold) + " gold]";
} else if (modal == 3) {
linkage = "min5";
spec = "air";
speed = 3.5;
boxtext = ((((("Level " + level) + ": RAF planes [") + hp) + "hp, ") + igold) + " gold, FLYING]";
}
}
help(boxtext);
life = hp;
minionWave++;
minionMC = "minion" + minionWave;
levelsend = 1;
}
function increment() {
min_id = min_id - _root.gamespeed;
secs = Math.round(min_id / 12);
secs_perc = Math.round((min_id / 1200) * 360);
if (min_id <= 0) {
level++;
min_id = 1200;
thp = (Math.pow(level, 2) + (level * _root.diff)) * (Math.floor(level / 10) + 1);
callMinions(thp);
}
}
monstify = function (yoff) {
_root.monsters_placed++;
_root.new_monster = 0;
min = attachMovie(linkage, "minion" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:40, _y:yoff});
min.spec = _root.spec;
_root.mins.push(min);
min.point_to_reach = 0;
min.kgold = level;
min.hp = 100;
min.life = life;
min.hit = 0;
min.dead = false;
min.speed = _root.speed;
min.origspeed = _root.speed;
hpb = _root.attachMovie("hp", "hp" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:min._x, _y:min._y + (min._height / 2)});
hpb.par = min;
min.bar = hpb;
hpb.onEnterFrame = function () {
this._x = this.par._x;
this._y = this.par._y + (this.par._height / 2);
this.bar._xscale = this.par.hp;
if (this.par.hp <= 0) {
_root.mins = _root.mins.remove(this.par);
val = _root.attachMovie("value", "value" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
val.price = this.par.kgold;
val._x = this.par._x;
val._y = this.par._y;
_root.gold = _root.gold + this.par.kgold;
_root.gamescore = _root.gamescore + (this.par.kgold * (diff + 1));
this.par.play();
this.par.dead = true;
_root.explode();
_root.kills++;
this.removeMovieClip();
}
if (this.par.hp == 100) {
this._visible = false;
} else {
this._visible = true;
}
};
min.onEnterFrame = function () {
if (this.speed < this.origspeed) {
this.speed = this.speed + 0.01;
} else {
this.hit = 0;
}
if (this.hitTest("_root.path.cy")) {
_root.lives = _root.lives - 1;
_root.imenu.mc_lives.gotoAndPlay(_root.lives);
_root.gold = _root.gold - _root.level;
if (_root.gold < 0) {
_root.gold = 0;
}
if (_root.lives <= 0) {
_root.reset();
_root.gotoAndStop("lose");
}
_root.mins = _root.mins.remove(this);
this.bar.removeMovieClip();
this.removeMovieClip();
}
dist_x = waypoint_x[this.point_to_reach] - this._x;
dist_y = waypoint_y[this.point_to_reach] - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < (this.speed * _root.gamespeed)) {
this.point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this.tspeed = this.speed * _root.gamespeed;
if ((_root.pauser._currentframe == 1) && (!this.dead)) {
this._x = this._x + (this.tspeed * Math.cos(angle));
this._y = this._y + (this.tspeed * Math.sin(angle));
}
this._rotation = ((angle / Math.PI) * 180) - 90;
if (this.spec == "air") {
i = _root.tows.length;
while (i > -1) {
tow = _root[_root.tows[i]._name];
if (this.getDepth() < tow.getDepth()) {
this.swapDepths(tow);
}
i--;
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (this.getDepth() < obj.getDepth()) {
this.swapDepths(obj);
}
i--;
}
}
};
return(min._height);
};
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);
};
stopAllSounds();
xp = new Sound(this);
xp.attachSound("expl");
explode = function () {
xp.start(0, 1);
};
bp = new Sound(this);
bp.attachSound("beep");
beep = function () {
bp.start(0, 1);
};
reset = function () {
i = _root.tows.length;
while (i > -1) {
tow = _root[_root.tows[i]._name];
tow.removeMovieClip();
i--;
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
obj.bar.removeMovieClip();
obj.removeMovieClip();
i--;
}
_root.imenu.removeMovieClip();
_root.pauser.removeMovieClip();
delete onEnterFrame;
};
stop();
Instance of Symbol 157 MovieClip in Frame 2
onClipEvent (load) {
stopAllSounds();
this.swapDepths(200);
this.removeMovieClip();
}
Frame 3
stop();
if (!_root.startedMusic) {
allsound = new Sound();
bgmusic = new Sound(this);
bgmusic.attachSound("loop");
bgmusic.start(0, 999);
_root.startedMusic = true;
}
Frame 4
stop();
_root.gamescore = 0;
levelsend = 0;
imenu.mc_lives.gotoAndPlay(10);
imenu.qbutton.onRelease = function () {
if (_root._quality == "HIGH") {
_root._quality = "LOW";
} else if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
} else if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
} else {
_root._quality = "LOW";
}
};
imenu.mbutton.onRelease = function () {
if (_root.allsound.getVolume() == 100) {
_root.allsound.setVolume(0);
} else {
_root.allsound.setVolume(100);
}
this.play();
};
var lives = 10;
var speed = 1.25;
if (diff == 0) {
var gold = 4000;
} else if (diff == 1) {
var gold = 1000;
} else if (diff == 2) {
var gold = 500;
}
var kills = 0;
var gamespeed = 3;
var level = 0;
var minionWave = 0;
var min_id = 0;
var mins = new Array();
var tows = new Array();
var minionMC = ("minion" + minionWave);
var linkage = "minion";
var sel = "";
attachMovie("path", "path", _root.getNextHighestDepth());
path.onEnterFrame = function () {
this.gotoAndPlay(Math.ceil(Math.random() * 3));
delete this.onEnterFrame;
};
imenu.swapDepths(path);
delay = 25;
new_monster = 0;
monsters_placed = 0;
onEnterFrame = function () {
if (_root.gold > 10000) {
_root.gold = 10000;
}
if (_root.sel != "") {
_root.sel.swapDepths(_root.getNextHighestDepth());
}
if (_root.pauser._currentframe == 1) {
increment();
if (levelsend == 1) {
thite = monstify(-30);
i = 1;
while (i < num_monsters) {
tyoff = -30 - ((thite + 5) * i);
monstify(tyoff);
i++;
}
levelsend = 0;
}
}
};
Instance of Symbol 238 MovieClip "pauser" in Frame 4
onClipEvent (load) {
this.gotoAndPlay(2);
}
onClipEvent (enterFrame) {
if (_root.pauser._currentframe != 1) {
this.swapDepths(_root.getNextHighestDepth());
}
}
Instance of Symbol 271 MovieClip "imenu" in Frame 4
onClipEvent (enterFrame) {
this.swapDepths(_root.getNextHighestDepth());
}
Frame 5
stop();
mochi.MochiScores.showLeaderboard({boardID:"88358f263161e577", score:_root.kills * (diff + 1), onClose:function () {
_root.gotoAndPlay("menu");
}});
Frame 6
stop();
_root.attachMovie("cover", "cover", _root.getNextHighestDepth());
stop();
mochi.MochiScores.showLeaderboard({boardID:"88358f263161e577", score:_root.kills * (diff + 1), onClose:function () {
_root.gotoAndPlay("menu");
_root.cover.removeMovieClip();
}});
Symbol 10 MovieClip [path] Frame 1
stop();
Symbol 10 MovieClip [path] Frame 2
_root.waypoint_x = new Array(40, 140, 140, 220, 220, 80, 80, 340, 340, 445, 445, 610, 610);
_root.waypoint_y = new Array(140, 140, 60, 60, 240, 240, 300, 300, 100, 100, 300, 300, -20);
stop();
Symbol 10 MovieClip [path] Frame 3
_root.waypoint_x = new Array(40, 180, 180, 40, 40, 250, 250, 330, 330, 500, 500, 600, 600);
_root.waypoint_y = new Array(140, 140, 220, 220, 300, 300, 100, 100, 300, 300, 160, 160, -20);
stop();
Symbol 13 MovieClip [min0] Frame 1
stop();
Symbol 13 MovieClip [min0] Frame 2
this.removeMovieClip();
Symbol 275 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _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("1.2");
}
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";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.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();
_rcvChannel.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 _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
return(_clip);
}
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.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.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];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._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 (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:_rcvChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 276 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.2");
}
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++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
}
Symbol 277 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if (options.clip != mochi.MochiServices.__get__clip()) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.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 (typeof(options.score) == "object") {
if (options.score.text != undefined) {
options.score = options.score.text;
}
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.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.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.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 20 MovieClip [min3] Frame 1
stop();
Symbol 20 MovieClip [min3] Frame 10
this.removeMovieClip();
Symbol 26 MovieClip Frame 1
stop();
Symbol 26 MovieClip Frame 2
stop();
Symbol 43 Button
on (press) {
startDrag (this);
}
on (release) {
stopDrag();
}
Symbol 45 Button
on (release) {
ivalue = 0;
i = 0;
while (i < _parent.tower.innerLevel) {
ivalue = ivalue + ((_parent.tower.cost / 2) * (i + 1));
i++;
}
ivalue = ivalue * 0.8;
ivalue = Math.round(ivalue);
_root.gold = _root.gold + ivalue;
val = _root.attachMovie("value", "value" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
val.price = ivalue;
val._x = _parent._x;
val._y = _parent._y;
_root.tows = _root.tows.remove(_parent);
_parent.removeMovieClip();
}
Symbol 55 Button
on (release) {
_root.sel = "";
_parent.tower.placing = true;
startDrag (_parent, true);
_parent.onEnterFrame = function () {
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 1) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (obj != _parent._parent) {
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
mi++;
}
if ((mi >= _root.tows.length) && (di >= ni)) {
this._alpha = 100;
}
}
i++;
}
}
};
_parent.onRelease = function () {
if (_parent._alpha == 100) {
_parent.tower.placing = false;
stopDrag();
delete this.onEnterFrame;
delete this.onRelease;
}
};
}
Symbol 56 MovieClip Frame 1
refreshV = function () {
bar._xscale = _parent.tower.range;
pbar._xscale = _parent.tower.getStats(_parent.tower.innerLevel + 1, "range");
range_txt.text = _parent.tower.getStats(_parent.tower.innerLevel, "range");
bad._xscale = _parent.tower.damage;
pbad._xscale = _parent.tower.getStats(_parent.tower.innerLevel + 1, "damage");
damage_txt.text = _parent.tower.getStats(_parent.tower.innerLevel, "damage");
bas._xscale = _parent.tower.getStats(_parent.tower.innerLevel, "speed");
pbas._xscale = _parent.tower.getStats(_parent.tower.innerLevel + 1, "speed");
speed_txt.text = _parent.tower.getStats(_parent.tower.innerLevel, "speed");
};
onLoad = refreshV();
stop();
Instance of Symbol 33 MovieClip in Symbol 56 MovieClip Frame 1
onClipEvent (enterFrame) {
this.onRelease = function () {
_root.sel = "none";
};
}
Instance of Symbol 49 MovieClip in Symbol 56 MovieClip Frame 1
onClipEvent (load) {
onEnterFrame = function () {
if (_parent._parent.tower.innerLevel == 1) {
upgradeCost = _parent._parent.tower.upgradeCost1;
}
if (_parent._parent.tower.innerLevel == 2) {
upgradeCost = _parent._parent.tower.upgradeCost2;
}
if (_parent._parent.tower.innerLevel == 3) {
upgradeCost = _parent._parent.tower.upgradeCost3;
}
if (_parent._parent.tower.innerLevel == 4) {
upgradeCost = _parent._parent.tower.upgradeCost4;
}
if (_parent._parent.tower.innerLevel == 5) {
_parent.amount.text = "Fully upgraded";
if (this._currentframe != 2) {
this.gotoAndPlay(2);
}
} else {
_parent.amount.text = upgradeCost + " gold";
if (_root.gold >= upgradeCost) {
if (this._currentframe != 1) {
this.gotoAndPlay(1);
}
} else if (this._currentframe != 2) {
this.gotoAndPlay(2);
}
}
};
onRelease = function () {
if (this._currentframe != 2) {
if (_root.gold >= upgradeCost) {
_root.gold = _root.gold - upgradeCost;
_parent._parent.tower.upgrade();
_parent.refreshV();
if (_parent._parent.tower.innerLevel == 5) {
_parent._parent.tower.play();
}
}
}
};
}
Symbol 57 Button
on (release) {
_root.sel = this;
}
Instance of Symbol 26 MovieClip "tower" in Symbol 58 MovieClip [sn1] Frame 1
onClipEvent (load) {
upgradeCost1 = 100;
upgradeCost2 = 200;
upgradeCost3 = 400;
upgradeCost4 = 800;
innerLevel = 1;
cost = 200;
range = 70;
mspeed = 1.5;
firing = 15;
damage = 10;
btype = "bul1";
no = true;
w = 10;
getStats = function (lvl, stat) {
if (lvl > 5) {
lvl = 6;
}
switch (lvl) {
case 1 :
if (stat == "range") {
return(70);
}
if (stat == "speed") {
return(7);
}
return(10);
case 2 :
if (stat == "range") {
return(70);
}
if (stat == "speed") {
return(8);
}
return(20);
case 3 :
if (stat == "range") {
return(80);
}
if (stat == "speed") {
return(9);
}
return(40);
case 4 :
if (stat == "range") {
return(100);
}
if (stat == "speed") {
return(11);
}
return(80);
case 5 :
if (stat == "range") {
return(150);
}
if (stat == "speed") {
return(14);
}
return(160);
case 6 :
if (stat == "range") {
return(150);
}
if (stat == "speed") {
return(7);
}
return(120);
}
};
upgrade = function () {
innerLevel = innerLevel + 1;
switch (this.innerLevel) {
case 1 :
this.range = 70;
this.damage = 10;
this.firing = 15;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 2 :
this.range = 70;
this.damage = 20;
this.firing = 13;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 3 :
this.range = 80;
this.damage = 40;
this.firing = 11;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 4 :
this.range = 100;
this.damage = 80;
this.firing = 9;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 5 :
this.range = 150;
this.damage = 160;
this.firing = 7;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
}
};
cir = _parent.attachMovie("circle", "rc", this.getNextHighestDepth());
cir.swapDepths(_parent.inf);
cir._alpha = 30;
cir._width = this.range * 2;
cir._height = this.range * 2;
cir.onEnterFrame = function () {
if ((_root.sel == _parent) || (placing)) {
this._visible = true;
} else {
this._visible = false;
}
};
this.onEnterFrame = function () {
if (this.innerLevel == 5) {
i = _root.tows.length;
while (i > -1) {
tow = _root[_root.tows[i]._name];
if (((tow.tower.innerLevel == 5) && (tow.tower.fuse == 2)) && (!tow.tower.placing)) {
if (this.hitTest(tow.tower)) {
thun = _root.attachMovie("grind", "grind" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
thun._x = (_parent._x + tow._x) / 2;
thun._y = (_parent._y + tow._y) / 2;
_root.tows.push(thun);
_root.tows = _root.tows.remove(tow);
_root.tows = _root.tows.remove(this);
tow.removeMovieClip();
_parent.removeMovieClip();
}
}
i--;
}
}
if (_root.pauser._currentframe == 1) {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.getDepth() > _parent.getDepth()) {
_parent.swapDepths(obj);
}
if (_root.dist_ab(obj._x, obj._y, this._parent._x, this._parent._y) > (this.range * this.range)) {
} else if (obj != undefined) {
if (obj._y > 0) {
this.px = obj._x;
this.py = obj._y;
this.no = true;
}
} else {
this.no = false;
}
i--;
}
this.rotA = (Math.atan2(this._parent._y - this.py, this._parent._x - this.px) / 0.0174532925) + 90;
if (this.no && (!this.placing)) {
this.w = this.w + _root.gamespeed;
if (this.w >= this.firing) {
bul = _root.attachMovie(this.btype, "bullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
this.w = 0;
bul.par = this;
bul.hitting = true;
this.angle = this.rotA - 90;
bul._rotation = this.rotA;
bul._x = this._parent._x;
bul._y = this._parent._y;
bul._xscale = 50;
bul._yscale = 50;
bul.dirx = Math.cos((this.angle * Math.PI) / 180) * (15 * _root.gamespeed);
bul.diry = Math.sin((this.angle * Math.PI) / 180) * (15 * _root.gamespeed);
bul.onEnterFrame = function () {
if (this.hitting) {
this._x = this._x - this.dirx;
this._y = this._y - this.diry;
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.hitTest(this) && (this.hitting)) {
obj.hp = obj.hp - ((this.par.damage / obj.life) * 100);
this._x = obj._x;
this._y = obj._y;
this.hitting = false;
this.removeMovieClip();
}
i--;
}
};
}
}
}
};
}
Instance of Symbol 56 MovieClip "inf" in Symbol 58 MovieClip [sn1] Frame 1
onClipEvent (enterFrame) {
if (_root.sel == _parent) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 72 MovieClip Frame 1
stop();
Symbol 72 MovieClip Frame 2
stop();
Instance of Symbol 72 MovieClip "tower" in Symbol 73 MovieClip [gr1] Frame 1
onClipEvent (load) {
upgradeCost1 = 150;
upgradeCost2 = 300;
upgradeCost3 = 600;
upgradeCost4 = 1200;
pobj = "";
cost = 800;
innerLevel = 1;
range = 50;
mspeed = 1;
firing = 20;
damage = 20;
btype = "razorshot";
no = true;
w = 0;
getStats = function (lvl, stat) {
if (lvl > 5) {
lvl = 6;
}
switch (lvl) {
case 1 :
if (stat == "range") {
return(50);
}
if (stat == "speed") {
return(0);
}
return(30);
case 2 :
if (stat == "range") {
return(50);
}
if (stat == "speed") {
return(0);
}
return(60);
case 3 :
if (stat == "range") {
return(50);
}
if (stat == "speed") {
return(0);
}
return(120);
case 4 :
if (stat == "range") {
return(50);
}
if (stat == "speed") {
return(0);
}
return(200);
case 5 :
if (stat == "range") {
return(50);
}
if (stat == "speed") {
return(0);
}
return(400);
case 6 :
if (stat == "range") {
return(1);
}
if (stat == "speed") {
return(0);
}
return(1);
}
};
upgrade = function () {
innerLevel = innerLevel + 1;
switch (this.innerLevel) {
case 1 :
this.range = 50;
this.damage = 30;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 2 :
this.range = 50;
this.damage = 60;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 3 :
this.range = 50;
this.damage = 120;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 4 :
this.range = 50;
this.damage = 200;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 5 :
this.range = 50;
this.damage = 400;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
}
};
cir = _parent.attachMovie("circle", "rc", this.getNextHighestDepth());
cir.swapDepths(_parent.inf);
cir._alpha = 30;
cir._width = this.range * 2;
cir._height = this.range * 2;
cir.onEnterFrame = function () {
if ((_root.sel == _parent) || (placing)) {
this._visible = true;
} else {
this._visible = false;
}
};
this.onEnterFrame = function () {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.getDepth() > _parent.getDepth()) {
_parent.swapDepths(obj);
}
if (_root.dist_ab(obj._x, obj._y, this._parent._x, this._parent._y) > (this.range * this.range)) {
} else if (obj != undefined) {
if ((obj.spec == "ground") || (obj.spec == "air")) {
if (obj._y > 0) {
this.px = obj._x;
this.py = obj._y;
this.pobj = obj;
this.no = true;
if (this.no && (!this.placing)) {
}
}
}
} else {
this.no = false;
}
this.rotA = (Math.atan2(this._parent._y - this.py, this._parent._x - this.px) / 0.0174532925) + 90;
if (this.no && (!this.placing)) {
this.innerT._rotation = (Math.atan2(this._parent._y - this.py, this._parent._x - this.px) / 0.0174532925) + 90;
this.w = this.w + _root.gamespeed;
if (obj.spec == "air") {
if (this.w >= this.firing) {
bul = _root.attachMovie(this.btype, "bullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
this.w = 0;
bul.par = this;
bul.hitting = true;
this.angle = this.rotA - 90;
bul._rotation = this.rotA;
bul._x = this._parent._x;
bul._y = this._parent._y;
bul._xscale = 50;
bul._yscale = 50;
bul.dirx = Math.cos((this.angle * Math.PI) / 180) * (15 * _root.gamespeed);
bul.diry = Math.sin((this.angle * Math.PI) / 180) * (15 * _root.gamespeed);
bul.onEnterFrame = function () {
if (this.hitting) {
this._x = this._x - this.dirx;
this._y = this._y - this.diry;
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.hitTest(this) && (this.hitting)) {
obj.hp = obj.hp - ((this.par.damage / obj.life) * 100);
this._x = obj._x;
this._y = obj._y;
this.hitting = false;
this.removeMovieClip();
}
i--;
}
};
}
} else {
w = w + _root.gamespeed;
if ((this.no && (!this.placing)) && (this.pobj != "")) {
if (this.innerT.razor.hitTest(this.pobj)) {
dps = (damage / 10) * _root.gamespeed;
this.pobj.hp = this.pobj.hp - ((dps / this.pobj.life) * 100);
}
}
}
}
i--;
}
};
}
Instance of Symbol 56 MovieClip "inf" in Symbol 73 MovieClip [gr1] Frame 1
onClipEvent (enterFrame) {
if (_root.sel == _parent) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 76 MovieClip Frame 1
stop();
Symbol 76 MovieClip Frame 2
stop();
Instance of Symbol 76 MovieClip "tower" in Symbol 77 MovieClip [snow] Frame 1
onClipEvent (load) {
upgradeCost1 = 250;
upgradeCost2 = 500;
upgradeCost3 = 750;
upgradeCost4 = 1000;
innerLevel = 1;
cost = 500;
shots = 0;
range = 60;
mspeed = 1;
firing = 200;
damage = 0;
btype = "bul4";
no = true;
w = 190;
getStats = function (lvl, stat) {
if (lvl > 5) {
lvl = 6;
}
switch (lvl) {
case 1 :
if (stat == "range") {
return(60);
}
if (stat == "speed") {
return(20);
}
return(0);
case 2 :
if (stat == "range") {
return(60);
}
if (stat == "speed") {
return(50);
}
return(0);
case 3 :
if (stat == "range") {
return(60);
}
if (stat == "speed") {
return(80);
}
return(0);
case 4 :
if (stat == "range") {
return(60);
}
if (stat == "speed") {
return(100);
}
return(0);
case 5 :
if (stat == "range") {
return(60);
}
if (stat == "speed") {
return(200);
}
return(0);
case 6 :
if (stat == "range") {
return(1);
}
if (stat == "speed") {
return(1);
}
return(1);
}
};
upgrade = function () {
innerLevel = innerLevel + 1;
switch (this.innerLevel) {
case 1 :
this.range = 60;
this.damage = 0;
this.firing = 200;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 2 :
this.range = 60;
this.damage = 0;
this.firing = 180;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 3 :
this.range = 60;
this.damage = 0;
this.firing = 150;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 4 :
this.range = 60;
this.damage = 0;
this.firing = 100;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 5 :
this.range = 60;
this.damage = 0;
this.firing = 40;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
}
};
cir = _parent.attachMovie("circle", "rc", this.getNextHighestDepth());
cir._alpha = 30;
cir._width = this.range * 2;
cir._height = this.range * 2;
cir.onEnterFrame = function () {
if ((_root.sel == _parent) || (placing)) {
this._visible = true;
} else {
this._visible = false;
}
};
this.onEnterFrame = function () {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.getDepth() > _parent.getDepth()) {
_parent.swapDepths(obj);
}
if (_root.dist_ab(obj._x, obj._y, this._parent._x, this._parent._y) > (this.range * this.range)) {
} else if (obj != undefined) {
if (obj._y > 0) {
this.px = obj._x;
this.py = obj._y;
this.no = true;
}
} else {
this.no = false;
}
i--;
}
w = w + _root.gamespeed;
if (this.no && (!this.placing)) {
if (w >= firing) {
w = 0;
bul = _root.attachMovie("sw", "bullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
bul._x = this._parent._x;
bul._y = this._parent._y;
bul.onEnterFrame = function () {
this._xscale = this._xscale + (30 * _root.gamespeed);
this._yscale = this._yscale + (30 * _root.gamespeed);
this._alpha = this._alpha - (1 * _root.gamespeed);
if (this._alpha <= 0) {
this.removeMovieClip();
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.hitTest(this)) {
if (!(obj.hit === 1)) {
obj.speed = obj.speed - 2;
if (obj.spec == "air") {
obj.hp = obj.hp - ((5 / obj.life) * 100);
}
obj.hit = 1;
}
}
i--;
}
};
}
}
};
}
Instance of Symbol 56 MovieClip "inf" in Symbol 77 MovieClip [snow] Frame 1
onClipEvent (enterFrame) {
if (_root.sel == _parent) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 81 MovieClip Frame 1
stop();
Symbol 81 MovieClip Frame 2
stop();
Instance of Symbol 81 MovieClip "tower" in Symbol 82 MovieClip [electro] Frame 1
onClipEvent (load) {
pobj = "";
cost = 350;
innerLevel = 1;
range = 50;
mspeed = 1;
firing = 35;
damage = 10;
btype = "bul2";
no = true;
w = 30;
getStats = function (lvl, stat) {
if (lvl > 5) {
lvl = 6;
}
switch (lvl) {
case 1 :
if (stat == "range") {
return(50);
}
if (stat == "speed") {
return(0);
}
return(10);
case 2 :
if (stat == "range") {
return(60);
}
if (stat == "speed") {
return(0);
}
return(15);
case 3 :
if (stat == "range") {
return(70);
}
if (stat == "speed") {
return(0);
}
return(20);
case 4 :
if (stat == "range") {
return(80);
}
if (stat == "speed") {
return(0);
}
return(30);
case 5 :
if (stat == "range") {
return(90);
}
if (stat == "speed") {
return(0);
}
return(40);
case 6 :
if (stat == "range") {
return(1);
}
if (stat == "speed") {
return(0);
}
return(1);
}
};
upgrade = function () {
innerLevel = innerLevel + 1;
switch (this.innerLevel) {
case 1 :
this.range = 50;
this.damage = 10;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 2 :
this.range = 60;
this.damage = 15;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 3 :
this.range = 70;
this.damage = 20;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 4 :
this.range = 80;
this.damage = 30;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 5 :
this.range = 90;
this.damage = 40;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
}
};
cir = _parent.attachMovie("circle", "rc", this.getNextHighestDepth());
cir.swapDepths(_parent.inf);
cir._alpha = 30;
cir._width = this.range * 2;
cir._height = this.range * 2;
cir.onEnterFrame = function () {
if ((_root.sel == _parent) || (placing)) {
this._visible = true;
} else {
this._visible = false;
}
};
this.onEnterFrame = function () {
if (this.innerLevel == 5) {
i = _root.tows.length;
while (i > -1) {
tow = _root[_root.tows[i]._name];
if (((tow.tower.innerLevel == 5) && (tow.tower.fuse == 1)) && (!tow.tower.placing)) {
if (this.hitTest(tow.tower)) {
thun = _root.attachMovie("thunder", "thunder" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
thun._x = (_parent._x + tow._x) / 2;
thun._y = (_parent._y + tow._y) / 2;
_root.tows.push(thun);
_root.tows = _root.tows.remove(tow);
_root.tows = _root.tows.remove(this);
tow.removeMovieClip();
_parent.removeMovieClip();
}
}
i--;
}
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.getDepth() > _parent.getDepth()) {
_parent.swapDepths(obj);
}
if (_root.dist_ab(obj._x, obj._y, this._parent._x, this._parent._y) > (this.range * this.range)) {
} else if (obj != undefined) {
if (obj._y > 0) {
this.px = obj._x;
this.py = obj._y;
this.pobj = obj;
this.no = true;
if (this.no && (!this.placing)) {
}
}
} else {
this.no = false;
}
i--;
}
w = w + _root.gamespeed;
if (((this.no && (!this.placing)) && (this.pobj != "")) && (w >= firing)) {
w = 0;
cm = _root.createEmptyMovieClip("canvas_mc" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
cm.living = 35;
cm.lived = 0;
cm.sx = _parent._x;
cm.sy = _parent._y;
cm.onEnterFrame = function () {
this.clear();
this.lived = this.lived + _root.gamespeed;
this.lineStyle(5, 16776960, 100);
this.moveTo(this.sx, this.sy);
this.curveTo((pobj._x - (Math.random() * 20)) + 10, (pobj._y - (Math.random() * 20)) + 10, pobj._x, pobj._y);
dps = (damage / 10) * _root.gamespeed;
pobj.hp = pobj.hp - ((dps / pobj.life) * 100);
if (pobj.hp <= 0) {
this.clear();
this._parent.removeMovieClip();
delete this.onEnterFrame;
}
if (this.lived >= this.living) {
this.clear();
this._parent.removeMovieClip();
delete this.onEnterFrame;
}
};
}
};
}
Instance of Symbol 56 MovieClip "inf" in Symbol 82 MovieClip [electro] Frame 1
onClipEvent (enterFrame) {
if (_root.sel == _parent) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 86 MovieClip [min4] Frame 1
stop();
Symbol 86 MovieClip [min4] Frame 2
this.removeMovieClip();
Instance of Symbol 89 MovieClip in Symbol 90 MovieClip [value] Frame 1
onClipEvent (load) {
price_txt.text = _parent.price + " gold";
}
Instance of Symbol 89 MovieClip in Symbol 90 MovieClip [value] Frame 15
onClipEvent (load) {
price_txt.text = _parent.price;
}
Symbol 90 MovieClip [value] Frame 16
this.removeMovieClip();
Symbol 94 Button
on (release) {
ivalue = _parent.tower.price;
_root.gold = _root.gold + ivalue;
val = _root.attachMovie("value", "value" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
val.price = ivalue;
val._x = _parent._x;
val._y = _parent._y;
_root.tows = _root.tows.remove(_parent);
_parent.removeMovieClip();
}
Symbol 96 MovieClip [thunder] Frame 20
stop();
Instance of Symbol 93 MovieClip "tower" in Symbol 96 MovieClip [thunder] Frame 20
onClipEvent (load) {
elec = new Array();
price = 12100;
pobj = "";
innerLevel = 5;
range = 150;
mspeed = 1;
firing = 35;
damage = 25;
btype = "bul2";
no = true;
w = 0;
getStats = function (lvl, stat) {
if (lvl > 5) {
lvl = 6;
}
switch (lvl) {
case 1 :
if (stat == "range") {
return(50);
}
if (stat == "speed") {
return(0);
}
return(10);
case 2 :
if (stat == "range") {
return(60);
}
if (stat == "speed") {
return(0);
}
return(15);
case 3 :
if (stat == "range") {
return(70);
}
if (stat == "speed") {
return(0);
}
return(20);
case 4 :
if (stat == "range") {
return(80);
}
if (stat == "speed") {
return(0);
}
return(30);
case 5 :
if (stat == "range") {
return(90);
}
if (stat == "speed") {
return(0);
}
return(40);
case 6 :
if (stat == "range") {
return(1);
}
if (stat == "speed") {
return(0);
}
return(1);
}
};
upgrade = function () {
innerLevel = innerLevel + 1;
switch (this.innerLevel) {
case 1 :
this.range = 50;
this.damage = 10;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 2 :
this.range = 60;
this.damage = 15;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 3 :
this.range = 70;
this.damage = 20;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 4 :
this.range = 80;
this.damage = 30;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 5 :
this.range = 90;
this.damage = 40;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
}
};
cir = _parent.attachMovie("circle", "rc", this.getNextHighestDepth());
cir.swapDepths(_parent.inf);
cir._alpha = 30;
cir._width = this.range * 2;
cir._height = this.range * 2;
cir.onEnterFrame = function () {
if ((_root.sel == _parent) || (placing)) {
this._visible = true;
} else {
this._visible = false;
}
};
this.onEnterFrame = function () {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.getDepth() > _parent.getDepth()) {
_parent.swapDepths(obj);
}
if (_root.dist_ab(obj._x, obj._y, this._parent._x, this._parent._y) > (this.range * this.range)) {
} else if (obj != undefined) {
if (((obj._y > 0) && (this.elec[obj] != 1)) && (!this.placing)) {
cm = _root.createEmptyMovieClip("canvas_mc" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
cm.living = 35;
cm.lived = 0;
cm.par = this;
cm.sx = _parent._x;
cm.sy = _parent._y;
cm.obj = obj;
cm.onEnterFrame = function () {
this.clear();
this.lived = this.lived + _root.gamespeed;
this.lineStyle(5, 16776960, 100);
this.moveTo(this.sx, this.sy);
this.curveTo((this.obj._x - (Math.random() * 20)) + 10, (this.obj._y - (Math.random() * 20)) + 10, this.obj._x, this.obj._y);
dps = (damage / 10) * _root.gamespeed;
this.obj.hp = this.obj.hp - ((dps / this.obj.life) * 100);
this.obj.speed = this.obj.speed - (0.05 * _root.gamespeed);
if (this.obj.speed <= 0) {
this.obj.speed = 0.2;
}
this.par.elec[this.obj] = 1;
if (this.obj.hp <= 0) {
this.clear();
this._parent.removeMovieClip();
delete this.onEnterFrame;
}
if (this.lived >= this.living) {
this.par.elec[this.obj] = 0;
this.clear();
this._parent.removeMovieClip();
delete this.onEnterFrame;
}
};
}
} else {
this.no = false;
}
i--;
}
w = w + _root.gamespeed;
if (((this.no && (!this.placing)) && (this.pobj != "")) && (w >= firing)) {
w = 0;
}
};
}
Instance of Symbol 95 MovieClip "inf" in Symbol 96 MovieClip [thunder] Frame 20
onClipEvent (enterFrame) {
if (_root.sel == _parent) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 102 MovieClip Frame 1
gotoAndStop(random(4) + 2);
Instance of Symbol 103 MovieClip "tower" in Symbol 104 MovieClip [bank] Frame 1
onClipEvent (load) {
w = 0;
}
onClipEvent (enterFrame) {
w = w + _root.gamespeed;
if (w >= 720) {
ivalue = Math.round(_root.gold * 0.15);
_root.gold = _root.gold + ivalue;
val = _root.attachMovie("value", "value" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
val.price = ivalue;
val._x = _parent._x;
val._y = _parent._y;
w = 0;
}
}
Symbol 111 MovieClip [mine2] Frame 1
stop();
Symbol 111 MovieClip [mine2] Frame 2
onEnterFrame = function () {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (this.hitTest(obj)) {
obj.hp = obj.hp - 500;
}
i--;
}
};
Symbol 111 MovieClip [mine2] Frame 40
this.removeMovieClip();
Instance of Symbol 113 MovieClip "tower" in Symbol 114 MovieClip [grind] Frame 1
onClipEvent (load) {
innerLevel = 1;
price = 800;
range = 200;
mspeed = 1;
firing = 8;
damage = 120;
btype = "rbul";
no = true;
w = 0;
cir = _parent.attachMovie("circle", "rc", this.getNextHighestDepth());
cir.swapDepths(_parent.inf);
cir._alpha = 30;
cir._width = this.range * 2;
cir._height = this.range * 2;
cir.onEnterFrame = function () {
if ((_root.sel == _parent) || (placing)) {
this._visible = true;
} else {
this._visible = false;
}
};
this.onEnterFrame = function () {
if (_root.pauser._currentframe == 1) {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (_root.dist_ab(obj._x, obj._y, this._parent._x, this._parent._y) > this.range) {
} else if (obj != undefined) {
if (obj._y > 0) {
this.px = obj._x;
this.py = obj._y;
this.no = true;
}
} else {
this.no = false;
}
i--;
}
this.rotA = (Math.atan2(this._parent._y - this.py, this._parent._x - this.px) / 0.0174532925) + 90;
if (this.no && (!this.placing)) {
this.w++;
if (this.w >= this.firing) {
bul = _root.attachMovie(this.btype, "bullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
this.w = 0;
bul.par = this;
bul.hitting = true;
this.angle = this.rotA - 90;
bul._rotation = this.rotA;
bul._x = this._parent._x;
bul._y = this._parent._y;
bul._xscale = 50;
bul._yscale = 50;
bul.dirx = Math.cos((this.angle * Math.PI) / 180) * 15;
bul.diry = Math.sin((this.angle * Math.PI) / 180) * 15;
bul.onEnterFrame = function () {
if (this.hitting) {
this._x = this._x - this.dirx;
this._y = this._y - this.diry;
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.hitTest(this) && (this.hitting)) {
obj.hp = obj.hp - ((this.par.damage / obj.life) * 100);
this._x = obj._x;
this._y = obj._y;
this.hitting = false;
this.removeMovieClip();
}
i--;
}
};
}
}
}
};
}
Symbol 114 MovieClip [grind] Frame 21
stop();
Instance of Symbol 95 MovieClip "inf" in Symbol 114 MovieClip [grind] Frame 21
onClipEvent (enterFrame) {
if (_root.sel == _parent) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 113 MovieClip "tower" in Symbol 114 MovieClip [grind] Frame 21
onClipEvent (load) {
innerLevel = 1;
price = 11000;
range = 200;
mspeed = 2;
firing = 5;
damage = 120;
btype = "rbul";
no = true;
w = 0;
cir = _parent.attachMovie("circle", "rc", this.getNextHighestDepth());
cir.swapDepths(_parent.inf);
cir._alpha = 30;
cir._width = this.range * 2;
cir._height = this.range * 2;
cir.onEnterFrame = function () {
if ((_root.sel == _parent) || (placing)) {
this._visible = true;
} else {
this._visible = false;
}
};
this.onEnterFrame = function () {
if (_root.pauser._currentframe == 1) {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (_root.dist_ab(obj._x, obj._y, this._parent._x, this._parent._y) > (this.range * this.range)) {
} else if (obj != undefined) {
if (obj._y > 0) {
this.px = obj._x;
this.py = obj._y;
this.no = true;
}
} else {
this.no = false;
}
i--;
}
this.rotA = (Math.atan2(this._parent._y - this.py, this._parent._x - this.px) / 0.0174532925) + 90;
if (this.no && (!this.placing)) {
this.w = this.w + _root.gamespeed;
if (this.w >= this.firing) {
bul = _root.attachMovie(this.btype, "bullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
this.w = 0;
bul.par = this;
bul.hitting = true;
this.angle = this.rotA - 90;
bul._rotation = this.rotA;
bul._x = this._parent._x;
bul._y = this._parent._y;
bul._xscale = 50;
bul._yscale = 50;
bul.dirx = (Math.cos((this.angle * Math.PI) / 180) * 15) * _root.gamespeed;
bul.diry = (Math.sin((this.angle * Math.PI) / 180) * 15) * _root.gamespeed;
bul.onEnterFrame = function () {
if (this.hitting) {
this._x = this._x - this.dirx;
this._y = this._y - this.diry;
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.hitTest(this) && (this.hitting)) {
obj.hp = obj.hp - ((this.par.damage / obj.life) * 100);
this._x = obj._x;
this._y = obj._y;
this.hitting = false;
this.removeMovieClip();
}
i--;
}
};
}
}
}
};
}
Symbol 117 MovieClip [razorshot] Frame 1
trace("HI");
Instance of Symbol 124 MovieClip "tower" in Symbol 125 MovieClip [sl] Frame 1
onClipEvent (load) {
upgradeCost1 = 5000;
upgradeCost2 = 10000;
upgradeCost3 = 15000;
upgradeCost4 = 20000;
pobj = "";
innerLevel = 1;
cost = 3000;
range = 100;
mspeed = 2;
firing = 15;
damage = 90;
btype = "supershot";
no = true;
w = 10;
getStats = function (lvl, stat) {
if (lvl > 5) {
lvl = 6;
}
switch (lvl) {
case 1 :
if (stat == "range") {
return(100);
}
if (stat == "speed") {
return(7);
}
return(2000);
case 2 :
if (stat == "range") {
return(70);
}
if (stat == "speed") {
return(8);
}
return(3000);
case 3 :
if (stat == "range") {
return(80);
}
if (stat == "speed") {
return(9);
}
return(5000);
case 4 :
if (stat == "range") {
return(100);
}
if (stat == "speed") {
return(11);
}
return(7500);
case 5 :
if (stat == "range") {
return(150);
}
if (stat == "speed") {
return(14);
}
return(10000);
case 6 :
if (stat == "range") {
return(150);
}
if (stat == "speed") {
return(7);
}
return(10000);
}
};
upgrade = function () {
innerLevel = innerLevel + 1;
switch (this.innerLevel) {
case 1 :
this.range = 120;
this.damage = 2000;
this.firing = 15;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 2 :
this.range = 140;
this.damage = 3000;
this.firing = 13;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 3 :
this.range = 160;
this.damage = 5000;
this.firing = 11;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 4 :
this.range = 180;
this.damage = 7500;
this.firing = 9;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 5 :
this.range = 200;
this.damage = 10000;
this.firing = 7;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
}
};
cir = _parent.attachMovie("circle", "rc", this.getNextHighestDepth());
cir.swapDepths(_parent.inf);
cir._alpha = 30;
cir._width = this.range * 2;
cir._height = this.range * 2;
cir.onEnterFrame = function () {
if ((_root.sel == _parent) || (placing)) {
this._visible = true;
} else {
this._visible = false;
}
};
this.onEnterFrame = function () {
if (this.innerLevel == 5) {
i = _root.tows.length;
while (i > -1) {
tow = _root[_root.tows[i]._name];
if (((tow.tower.innerLevel == 5) && (tow.tower.fuse == 2)) && (!tow.tower.placing)) {
if (this.hitTest(tow.tower)) {
thun = _root.attachMovie("grind", "grind" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
thun._x = (_parent._x + tow._x) / 2;
thun._y = (_parent._y + tow._y) / 2;
_root.tows.push(thun);
_root.tows = _root.tows.remove(tow);
_root.tows = _root.tows.remove(this);
tow.removeMovieClip();
_parent.removeMovieClip();
}
}
i--;
}
}
if (_root.pauser._currentframe == 1) {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.getDepth() > _parent.getDepth()) {
_parent.swapDepths(obj);
}
if (_root.dist_ab(obj._x, obj._y, this._parent._x, this._parent._y) > (this.range * this.range)) {
} else if (obj != undefined) {
if (obj._y > 0) {
this.px = obj._x;
this.py = obj._y;
this.no = true;
}
} else {
this.no = false;
}
i--;
}
this.rotA = (Math.atan2(this._parent._y - this.py, this._parent._x - this.px) / 0.0174532925) + 90;
if (this.no && (!this.placing)) {
this.w = this.w + _root.gamespeed;
if (this.w >= this.firing) {
bul = _root.attachMovie(this.btype, "bullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
this.w = 0;
bul.par = this;
bul.hitting = true;
this.angle = this.rotA - 90;
bul._rotation = this.rotA;
bul._x = this._parent._x;
bul._y = this._parent._y;
bul._xscale = 50;
bul._yscale = 50;
bul.dirx = Math.cos((this.angle * Math.PI) / 180) * (15 * _root.gamespeed);
bul.diry = Math.sin((this.angle * Math.PI) / 180) * (15 * _root.gamespeed);
bul.onEnterFrame = function () {
if (this.hitting) {
this._x = this._x - this.dirx;
this._y = this._y - this.diry;
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.hitTest(this) && (this.hitting)) {
obj.hp = obj.hp - ((this.par.damage / obj.life) * 100);
this._x = obj._x;
this._y = obj._y;
this.hitting = false;
this.removeMovieClip();
}
i--;
}
};
}
}
}
};
}
Instance of Symbol 56 MovieClip "inf" in Symbol 125 MovieClip [sl] Frame 1
onClipEvent (enterFrame) {
if (_root.sel == _parent) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 137 Button
on (release) {
getURL ("http://www.play4all.net", "_blank");
}
Symbol 141 MovieClip [min5] Frame 1
stop();
Symbol 141 MovieClip [min5] Frame 2
this.removeMovieClip();
Symbol 152 MovieClip Frame 1
stop();
Symbol 152 MovieClip Frame 2
stop();
Instance of Symbol 152 MovieClip "tower" in Symbol 153 MovieClip [ml] Frame 1
onClipEvent (load) {
upgradeCost1 = 300;
upgradeCost2 = 600;
upgradeCost3 = 1200;
upgradeCost4 = 2400;
innerLevel = 1;
cost = 550;
range = 100;
mspeed = 0.8;
firing = 50;
damage = 50;
btype = "missile";
no = true;
w = 20;
getStats = function (lvl, stat) {
if (lvl > 5) {
lvl = 6;
}
switch (lvl) {
case 1 :
if (stat == "range") {
return(100);
}
if (stat == "speed") {
return(2);
}
return(50);
case 2 :
if (stat == "range") {
return(150);
}
if (stat == "speed") {
return(2);
}
return(100);
case 3 :
if (stat == "range") {
return(200);
}
if (stat == "speed") {
return(2);
}
return(200);
case 4 :
if (stat == "range") {
return(200);
}
if (stat == "speed") {
return(2);
}
return(400);
case 5 :
if (stat == "range") {
return(200);
}
if (stat == "speed") {
return(2);
}
return(1000);
case 6 :
if (stat == "range") {
return(150);
}
if (stat == "speed") {
return(0);
}
return(120);
}
};
upgrade = function () {
innerLevel = innerLevel + 1;
switch (this.innerLevel) {
case 1 :
this.range = 100;
this.damage = 50;
this.firing = 50;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 2 :
this.range = 150;
this.damage = 100;
this.firing = 50;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 3 :
this.range = 200;
this.damage = 200;
this.firing = 50;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 4 :
this.range = 200;
this.damage = 400;
this.firing = 50;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 5 :
this.range = 200;
this.damage = 1000;
this.firing = 50;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
}
};
cir = _parent.attachMovie("circle", "rc", this.getNextHighestDepth());
cir.swapDepths(_parent.inf);
cir._alpha = 30;
cir._width = this.range * 2;
cir._height = this.range * 2;
cir.onEnterFrame = function () {
if ((_root.sel == _parent) || (placing)) {
this._visible = true;
} else {
this._visible = false;
}
};
this.onEnterFrame = function () {
if (_root.pauser._currentframe == 1) {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.getDepth() > _parent.getDepth()) {
_parent.swapDepths(obj);
}
if (_root.dist_ab(obj._x, obj._y, this._parent._x, this._parent._y) > (this.range * this.range)) {
} else if (obj != undefined) {
if (obj._y > 0) {
this.px = obj._x;
this.py = obj._y;
this.no = true;
}
} else {
this.no = false;
}
i--;
}
this.rotA = (Math.atan2(this._parent._y - this.py, this._parent._x - this.px) / 0.0174532925) + 90;
this.innerT._rotation = this.rotA;
if (this.no && (!this.placing)) {
this.w = this.w + _root.gamespeed;
if (this.w >= this.firing) {
bul = _root.attachMovie(this.btype, "bullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
this._parent.swapDepths(bul);
this.w = 0;
bul.par = this;
bul.hitting = true;
this.angle = this.rotA - 90;
bul._rotation = this.rotA;
bul._x = this._parent._x;
bul._y = this._parent._y;
bul._xscale = 50;
bul._yscale = 50;
bul.acc = 1;
bul.dirx = Math.cos((this.angle * Math.PI) / 180);
bul.diry = Math.sin((this.angle * Math.PI) / 180);
bul.onEnterFrame = function () {
this.acc = this.acc + (0.5 * _root.gamespeed);
if (this.hitting) {
this._x = this._x - (this.dirx * (this.acc * _root.gamespeed));
this._y = this._y - (this.diry * (this.acc * _root.gamespeed));
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.hitTest(this) && (this.hitting)) {
obj.hp = obj.hp - ((this.par.damage / obj.life) * 100);
this.hitting = false;
qe = _root.attachMovie("exploder", "ex" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
qe._x = this._x;
qe._y = this._y;
qe.par = this.par;
this.removeMovieClip();
}
i--;
}
};
}
}
}
};
}
Instance of Symbol 56 MovieClip "inf" in Symbol 153 MovieClip [ml] Frame 1
onClipEvent (enterFrame) {
if (_root.sel == _parent) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 154 MovieClip [exploder] Frame 1
mhit = new Array();
onEnterFrame = function () {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if ((this.hitTest(obj) && (mhit[obj] != 1)) && (obj.spec == "air")) {
mhit[obj] = 1;
obj.hp = obj.hp - ((this.par.damage / obj.life) * 100);
}
i--;
}
};
Symbol 154 MovieClip [exploder] Frame 39
this.removeMovieClip();
Symbol 174 MovieClip Frame 46
stop();
Instance of Symbol 160 MovieClip in Symbol 175 MovieClip Frame 17
on (release) {
getURL ("http://play4all.net/", "_blank");
}
Symbol 175 MovieClip Frame 134
_root.play();
Symbol 184 Button
on (release) {
counter = 0;
play();
}
Instance of Symbol 192 MovieClip in Symbol 196 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Electro";
_parent.details.trange.text = "50 range";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "600 gold";
_parent.details.tdamage.text = "10 damage/second";
_parent.details.tdesc.text = "This tower deals a constant stream of low electrical damage at increasing ranges. It can damage both land and air units.";
};
this.onRelease = function () {
if (_root.gold >= 600) {
tur = _root.attachMovie("electro", "electro" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.sel = this;
_root.gold = _root.gold - 600;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Symbol 200 Button
on (release) {
ivalue = 0;
i = 0;
while (i < _parent.tower.innerLevel) {
ivalue = ivalue + (_parent.tower.cost * (i + 1));
i++;
}
ivalue = ivalue * 0.8;
ivalue = Math.round(ivalue);
_root.gold = _root.gold + ivalue;
val = _root.attachMovie("value", "value" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
val.price = ivalue;
val._x = _parent._x;
val._y = _parent._y;
_root.tows = _root.tows.remove(_parent);
_parent.removeMovieClip();
}
Instance of Symbol 49 MovieClip in Symbol 210 MovieClip Frame 1
onClipEvent (load) {
onEnterFrame = function () {
if (_parent._parent.tower.innerLevel == 5) {
_parent.amount.text = "Fully upgraded";
if (this._currentframe != 2) {
this.gotoAndPlay(2);
}
} else {
_parent.amount.text = (_parent._parent.tower.cost * _parent._parent.tower.innerLevel) + " gold";
if (_root.gold >= (_parent._parent.tower.cost * _parent._parent.tower.innerLevel)) {
if (this._currentframe != 1) {
this.gotoAndPlay(1);
}
} else if (this._currentframe != 2) {
this.gotoAndPlay(2);
}
}
};
onRelease = function () {
if (this._currentframe != 2) {
if (_root.gold >= (_parent._parent.tower.cost * _parent._parent.tower.innerLevel)) {
_root.gold = _root.gold - (_parent._parent.tower.cost * _parent._parent.tower.innerLevel);
_parent._parent.tower.upgrade();
_parent.refreshV();
if (_parent._parent.tower.innerLevel == 5) {
_parent._parent.tower.play();
}
}
}
};
}
Instance of Symbol 33 MovieClip in Symbol 210 MovieClip Frame 1
onClipEvent (enterFrame) {
this.onRelease = function () {
_root.sel = "none";
};
}
Symbol 211 MovieClip Frame 1
stop();
Symbol 211 MovieClip Frame 12
stop();
Symbol 215 Button
on (release) {
diff = 0;
play();
}
Symbol 219 Button
on (release) {
diff = 1;
play();
}
Symbol 223 Button
on (release) {
diff = 2;
play();
}
Symbol 235 Button
on (release) {
loading.play();
play();
}
Symbol 237 MovieClip Frame 1
stop();
Symbol 237 MovieClip Frame 2
stop();
Symbol 238 MovieClip Frame 1
stop();
Symbol 238 MovieClip Frame 2
stop();
Instance of Symbol 244 MovieClip in Symbol 245 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = 360 - _root.secs_perc;
}
Symbol 250 Button
on (release, keyPress "<Space>") {
_root.min_id = 1;
}
Symbol 254 MovieClip Frame 1
stop();
Symbol 254 MovieClip Frame 2
stop();
Symbol 254 MovieClip Frame 3
stop();
Symbol 254 MovieClip Frame 4
stop();
Symbol 254 MovieClip Frame 5
stop();
Symbol 254 MovieClip Frame 6
stop();
Symbol 254 MovieClip Frame 7
stop();
Symbol 254 MovieClip Frame 8
stop();
Symbol 254 MovieClip Frame 9
stop();
Symbol 254 MovieClip Frame 10
stop();
Symbol 257 MovieClip Frame 1
stop();
Symbol 257 MovieClip Frame 2
stop();
Symbol 271 MovieClip Frame 1
onEnterFrame = function () {
gold_txt.text = _root.gold + " gold";
};
Instance of Symbol 188 MovieClip in Symbol 271 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "EMP tower";
_parent.details.trange.text = "60 range";
_parent.details.tspeed.text = "20 speed";
_parent.details.tgold.text = "500 gold";
_parent.details.tdamage.text = "Slows enemies";
_parent.details.tdesc.text = "This tower slows down enemies it hits with its electromagnetic pulse It also deals a bonus amount of damage to aeroplanes.";
};
this.onRelease = function () {
if (_root.gold >= 500) {
tur = _root.attachMovie("snow", "snow" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 500;
_root.tows.push(this);
this.tower.fuse = 1;
this.tower.placing = false;
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 189 MovieClip in Symbol 271 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Turret";
_parent.details.trange.text = "70 range";
_parent.details.tspeed.text = "7 speed";
_parent.details.tgold.text = "200 gold";
_parent.details.tdamage.text = "10 damage";
_parent.details.tdesc.text = "Fire basic bolts at all enemies to deal low amounts of damage.";
};
this.onRelease = function () {
if (_root.gold >= 200) {
tur = _root.attachMovie("sn1", "sn" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 200;
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 191 MovieClip in Symbol 271 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Grinder";
_parent.details.trange.text = "50 range";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "150 gold";
_parent.details.tdamage.text = "20 damage/second";
_parent.details.tdesc.text = "This tower only damages land units and very close range, but it deals damage constantly and can kill a a tough enemy at maximum upgrade.";
};
this.onRelease = function () {
if (_root.gold >= 150) {
tur = _root.attachMovie("gr1", "gr" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 150;
this.tower.fuse = 2;
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 192 MovieClip in Symbol 271 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Electro";
_parent.details.trange.text = "50 range";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "350 gold";
_parent.details.tdamage.text = "10 damage/second";
_parent.details.tdesc.text = "This tower deals a constant stream of low electrical damage at increasing ranges. It can damage both land and air units.";
};
this.onRelease = function () {
if (_root.gold >= 350) {
tur = _root.attachMovie("electro", "electro" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.sel = this;
_root.gold = _root.gold - 350;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 194 MovieClip in Symbol 271 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Missile site";
_parent.details.trange.text = "100 range";
_parent.details.tspeed.text = "5 speed";
_parent.details.tgold.text = "300 gold";
_parent.details.tdamage.text = "50 damage";
_parent.details.tdesc.text = "This surface-to-air missile launcher can deal massive amounts of damage, but it takes a long time to power up.";
};
this.onRelease = function () {
if (_root.gold >= 300) {
tur = _root.attachMovie("ml", "ml" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 300;
_root.tows.push(this);
this.tower.placing = false;
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 195 MovieClip in Symbol 271 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Super tower";
_parent.details.trange.text = "100 range";
_parent.details.tspeed.text = "7 speed";
_parent.details.tgold.text = "5000 gold";
_parent.details.tdamage.text = "90 damage";
_parent.details.tdesc.text = "This tower dominates the battlefield with superior speed, range, and power.";
};
this.onRelease = function () {
if (_root.gold >= 5000) {
tur = _root.attachMovie("sl", "sl" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 5000;
_root.tows.push(this);
this.tower.fuse = 1;
this.tower.placing = false;
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 270 MovieClip "details" in Symbol 271 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 273 Button
on (release) {
_root.gotoAndPlay("menu");
}