Frame 1
stop();
var mochiads_game_id = "85e4a2fb1386a1c5";
prep = 10;
i = 0;
onEnterFrame = function () {
perc = _root.getBytesLoaded() / _root.getBytesTotal();
perc = perc * 100;
if (perc >= prep) {
bln = prep / 10;
prep = prep + 10;
this["lb" + bln].nextFrame();
}
if (perc >= 100) {
i++;
if (i > 30) {
delete onEnterFrame;
}
}
};
stop();
MochiAd.showPreGameAd({id:"85e4a2fb1386a1c5", res:"640x480", background:16777215, color:3157547, outline:3157547, no_bg:true});
Frame 2
function itemHandler(obj, item) {
getURL ("http://z-fox.com", "_blank");
}
root_cm = new ContextMenu();
_root.menu = root_cm;
root_cm.customItems.push(new ContextMenuItem("Play more games...", itemHandler));
Frame 3
var autoadjust = true;
var sel = "";
var bullets = [];
var minions = [];
var towers = [];
var money = 5000;
var lives = 10;
MAP = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
for (x1 in MAP) {
MAP[x1] = new Array({known:false, path:"", distance:"inf", obj:0, x:x1, y:0}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:1}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:2}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:3}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:4}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:5}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:6}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:7}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:8}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:9}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:10}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:11}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:12});
}
var Func = new Func();
Array.prototype.remove = function (rem) {
var _local2 = 0;
while (_local2 < this.length) {
if (this[_local2] == rem) {
this.splice(_local2, 1);
}
_local2++;
}
return(this);
};
smallest_distance = function () {
min = 10000;
key = 0;
for (d in checked) {
if ((checked[d].distance != "inf") && (checked[d].distance != undefined)) {
if ((checked[d].distance < min) && (checked[d].known == false)) {
min = checked[d].distance;
key = checked[d];
}
}
}
return(key);
};
id = function (to, from) {
if (to != undefined) {
if (to.known == false) {
if (to.obj == 1) {
cost = 3000;
} else {
cost = 1;
}
tod = to.distance;
if (tod == "inf") {
tod = 2000;
}
if ((from.distance + cost) < tod) {
to.distance = from.distance + cost;
checked.push(to);
to.path = from;
}
}
}
};
adjacent = function (px, py) {
me = _root.MAP[px][py];
temp = _root.MAP[int(px) + 1][py];
id(temp, me);
temp = _root.MAP[int(px) - 1][py];
id(temp, me);
temp = _root.MAP[px][int(py) - 1];
id(temp, me);
temp = _root.MAP[px][int(py) + 1];
id(temp, me);
};
dijkstra = function () {
checked = [];
for (i in _root.MAP) {
for (j in _root.MAP[i]) {
_root.MAP[i][j].known = false;
_root.MAP[i][j].distance = "inf";
_root.MAP[i][j].path = "";
}
}
_root.MAP[0][6].known = true;
_root.MAP[0][6].distance = 0;
checked.push(_root.MAP[0][6]);
_root.MAP[0][6].path = _root.MAP[0][6];
px = 0;
py = 6;
adjacent(px, py);
while (true) {
current = smallest_distance();
if (current == 0) {
break;
}
current.known = true;
checked.remove(current);
adjacent(current.x, current.y);
}
};
next_box = function (tx, ty) {
return(_root.MAP[tx][ty].path);
};
cookie = SharedObject.getLocal("warzone");
if (cookie.data.nosound == undefined) {
cookie.data.nosound = 0;
}
if (cookie.data.nosound == 1) {
_root.nosound = true;
} else if (cookie.data.nosound == 0) {
_root.nosound = false;
}
if (cookie.data.nosound2 == undefined) {
cookie.data.nosound2 = 0;
}
if (cookie.data.nosound2 == 1) {
_root.nosound2 = true;
} else if (cookie.data.nosound2 == 0) {
_root.nosound2 = false;
}
if (cookie.data.hints == undefined) {
cookie.data.hints = 1;
}
if (cookie.data.hints == 1) {
_root.hints = true;
} else if (cookie.data.hints == 0) {
_root.hints = false;
}
if (cookie.data.popup == undefined) {
cookie.data.popup = 1;
}
if (cookie.data.popup == 1) {
_root.popup = true;
} else if (cookie.data.popup == 0) {
_root.popup = false;
}
if (cookie.data.adjust == undefined) {
cookie.data.adjust = 0;
}
if (cookie.data.adjust == 1) {
_root.auto_adjust = true;
} else if (cookie.data.adjust == 0) {
_root.auto_adjust = false;
}
p = _root.createEmptyMovieClip("son_h", _root.getNextHighestDepth());
q = _root.createEmptyMovieClip("son_h2", _root.getNextHighestDepth());
sn_z = new Sound(p);
sn_z.attachSound("zap.wav");
sn_z_play = function () {
if (!nosound) {
sn_z.start(0, 1);
}
};
sn_x = new Sound(p);
sn_x.attachSound("explosion.wav");
sn_x_play = function () {
if (!nosound) {
sn_x.start(0, 1);
}
};
sn_g = new Sound(p);
sn_g.attachSound("gas_puff.wav");
sn_g_play = function () {
if (!nosound) {
sn_g.start(0, 1);
}
};
sn_s = new Sound(p);
sn_s.attachSound("shot.wav");
sn_s_play = function () {
if (!nosound) {
shot_sound = true;
}
};
sn_j = new Sound(p);
sn_j.attachSound("jingle.wav");
sn_j_play = function () {
if (!nosound) {
sn_j.start(0, 1);
}
};
sn_l = new Sound(q);
sn_l.attachSound("aif");
if (!nosound2) {
sn_l.start(0, 9999);
}
Frame 4
stop();
Frame 5
stop();
_root.sells = 0;
minion_info = 0;
kills = 0;
noz = 0;
factor = 0;
ufactor = 0;
xfactor = 1;
count = false;
clocki = 1000;
level = 0;
lower.money_txt.text = money;
lower.lives_txt.text = lives;
instance_mc = new Object();
lower.clock.onRelease = function () {
if ((minions.length == 0) && (noz == 0)) {
lower.clock.gotoAndStop(1);
_root.clocki = 1000;
_root.lower.clock.hand._rotation = (clocki / 1000) * 360;
}
if (_root.tut._currentframe == 3) {
_root.tut.play();
}
};
lower.help_icon.onRelease = function () {
};
instance_mc.onKeyUp = function () {
if (Key.getCode() == 32) {
if (kills == 0) {
with (lower.pause_icon) {
if (_currentframe == 1) {
if (_root.tut._currentframe == 2) {
_root.tut.play();
}
_root.count = true;
_root.ufactor = 1;
_root.fac();
play();
} else {
_root.count = false;
_root.ufactor = 0;
_root.fac();
play();
}
}
} else if ((minions.length == 0) && (noz == 0)) {
lower.clock.gotoAndStop(1);
clocki = 1000;
_root.lower.clock.hand._rotation = (clocki / 1000) * 360;
}
} else if (Key.getCode() == 85) {
_root.sel.upgrade();
} else if (Key.getCode() == 83) {
_root.sel.sell();
} else if (Key.getCode() == 77) {
_root.omenu.mc2.play();
} else if (Key.getCode() == 78) {
_root.omenu.mc.play();
} else if (Key.getCode() == 82) {
_root.sel.qmove();
} else if (Key.getCode() == 48) {
if (_root.action != "place") {
_root.Func.buy(45, 3);
}
} else if (Key.getCode() == 49) {
if (_root.action != "place") {
_root.Func.buy(25, 1);
}
} else if (Key.getCode() == 50) {
if (_root.action != "place") {
_root.Func.buy(25, 7);
}
} else if (Key.getCode() == 51) {
if (_root.action != "place") {
_root.Func.buy(25, 8);
}
} else if (Key.getCode() == 53) {
if (_root.action != "place") {
_root.Func.buy(100, 2);
}
} else if (Key.getCode() == 54) {
if (_root.action != "place") {
_root.Func.buy(100, 4);
}
} else if (Key.getCode() == 55) {
if (_root.action != "place") {
_root.Func.buy(150, 9);
}
} else if (Key.getCode() == 52) {
if (_root.action != "place") {
_root.Func.buy(500, 6);
}
} else if (Key.getCode() == 56) {
if (_root.action != "place") {
_root.Func.buy(300, 10);
}
} else if (Key.getCode() == 88) {
if (action == "place") {
imenu.tcancel.removeMovieClip();
_root.imenu._alpha = 100;
_root.omenu._alpha = 100;
_root.umenu._alpha = 100;
_root.action = "";
_root.rc._x = -20;
_root.rc._y = -20;
_root.rc._width = 0;
_root.rc._height = 0;
_root.imenu.gotoAndPlay(1);
}
} else if (Key.getCode() == 57) {
if (_root.action != "place") {
if (_root.money > 200) {
_root.money = _root.money - 200;
_root.lower.money_txt.text = _root.money;
_root.Func.airraid();
} else {
_root.mes.create_message("Not enough money");
}
}
} else if (Key.getCode() == 81) {
if (_root._quality == "HIGH") {
_root._quality = "MEDIUM";
} else if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
} else if (_root._quality == "LOW") {
_root._quality = "HIGH";
}
} else if (Key.getCode() == 67) {
_root.console._visible = !_root.console._visible;
} else if ((Key.getCode() == 80) || (Key.getCode() == 19)) {
with (lower.pause_icon) {
if (_currentframe == 1) {
if (_root.tut._currentframe == 2) {
_root.tut.play();
}
_root.count = true;
_root.ufactor = 1;
_root.fac();
play();
} else {
_root.count = false;
_root.ufactor = 0;
_root.fac();
play();
}
}
}
};
Key.addListener(instance_mc);
onEnterFrame = function () {
if (count == true) {
if (shot_sound == true) {
sn_s.start(0, 1);
shot_sound = false;
}
if (_root.minion_info != 0) {
if (_root.minion_info.hp != undefined) {
_root.minion_caller._x = _root.minion_info._x;
_root.minion_caller._y = _root.minion_info._y - 20;
_root.minion_caller._visible = true;
if (_root.minion_info.poisoned > 0) {
_root.minion_caller.gotoAndStop("poisoned");
_root.minion_caller.poison_txt.text = Math.round(_root.minion_info.poisoned * 10) / 10;
}
_root.minion_caller.hp_txt.text = Math.round(_root.minion_info.hp);
_root.minion_caller.maxhp_txt.text = _root.minion_info.maxhp;
} else {
_root.minion_caller.gotoAndStop("normal");
_root.minion_caller._visible = false;
_root.minion_info = 0;
}
} else {
_root.minion_caller._visible = false;
_root.minion_caller.gotoAndStop("normal");
}
clocki = clocki + (1 * _root.factor);
_root.lower.clock.hand._rotation = (clocki / 1000) * 360;
if (clocki >= 1000) {
if (lever[level].n == undefined) {
nts = 10;
} else {
nts = lever[level].n;
}
_root.Func.spawn(nts);
level++;
clocki = 0;
lower.clock.gotoAndStop(1);
}
}
};
_root.createEmptyMovieClip("mini", _root.getNextHighestDepth());
_root.createEmptyMovieClip("below", _root.getNextHighestDepth());
_root.createEmptyMovieClip("lasers", _root.getNextHighestDepth());
_root.minion_caller.swapDepths(_root.getNextHighestDepth());
_root.lower.swapDepths(_root.getNextHighestDepth());
_root.imenu.swapDepths(_root.getNextHighestDepth());
_root.umenu.swapDepths(_root.getNextHighestDepth());
_root.omenu.swapDepths(_root.getNextHighestDepth());
_root.mes.swapDepths(_root.getNextHighestDepth());
_root.tut.swapDepths(_root.getNextHighestDepth());
reset = function () {
minion_caller.removeMovieClip();
lower.removeMovieClip();
below.removeMovieClip();
lasers.removeMovieClip();
mini.removeMovieClip();
imenu.removeMovieClip();
umenu.removeMovieClip();
omenu.removeMovieClip();
tut.removeMovieClip();
mes.removeMovieClip();
Key.removeListener(instance_mc);
delete instance_mc;
delete fac;
delete onEnterFrame;
sel = "";
action = "";
bullets = [];
minions = [];
towers = [];
MAP = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
for (x1 in MAP) {
MAP[x1] = new Array({known:false, path:"", distance:"inf", obj:0, x:x1, y:0}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:1}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:2}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:3}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:4}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:5}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:6}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:7}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:8}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:9}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:10}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:11}, {known:false, path:"", distance:"inf", obj:0, x:x1, y:12});
}
};
newPath = function () {
dijkstra();
};
dijkstra();
fac = function () {
factor = ufactor * xfactor;
};
Instance of Symbol 511 MovieClip [build_menu] "imenu" in Frame 5
onClipEvent (load) {
wtype = "build_icon";
}
Instance of Symbol 553 MovieClip [upgrade_menu] "umenu" in Frame 5
onClipEvent (load) {
_yscale = 0;
_xscale = 0;
wtype = "upgrade_icon";
}
Instance of Symbol 593 MovieClip [menu3] "omenu" in Frame 5
onClipEvent (load) {
_yscale = 0;
_xscale = 0;
wtype = "option_icon";
}
Instance of Symbol 631 MovieClip "console" in Frame 5
onClipEvent (load) {
this._visible = false;
}
Frame 6
kills_txt.text = kills * level;
reset();
stop();
Instance of Symbol 637 MovieClip in Frame 6
onClipEvent (load) {
onRollOver = function () {
this.gotoAndPlay("out");
};
onRollOut = function () {
this.gotoAndPlay("in");
};
onReleaseOutside = onRollOut;
onPress = function () {
this.gotoAndPlay("down");
};
onRelease = function () {
_root.gotoAndPlay("menu");
};
}
Frame 7
kills_txt.text = ((kills + lives) + Math.round(money / 50)) * level;
reset();
stop();
Frame 8
kills_txt.text = kills * level;
reset();
stop();
Frame 9
kills_txt.text = ((kills + lives) + Math.round(money / 50)) * level;
reset();
stop();
Frame 10
kills_txt.text = kills * level;
reset();
stop();
Frame 11
kills_txt.text = (kills + lives) * level;
reset();
stop();
Frame 12
kills_txt.text = kills * level;
reset();
stop();
Frame 13
kills_txt.text = ((kills + lives) + Math.round(money / 50)) * level;
reset();
stop();
Symbol 4 MovieClip [fps] Frame 1
fps = 30;
n = 0;
avg = 0;
var timeinit = new Date();
var lasttime = timeinit.getMilliseconds();
onEnterFrame = function () {
var _local2 = new Date();
timepassed = (((_local2.getMilliseconds() - lasttime) >= 0) ? (_local2.getMilliseconds() - lasttime) : (1000 + (_local2.getMilliseconds() - lasttime)));
fps = Math.round(10000 / timepassed) / 10;
avg = avg + fps;
n++;
if (n == 30) {
n = 0;
fps_text = Math.round(avg / 30);
avg = 0;
}
tfps = avg / n;
lasttime = _local2.getMilliseconds();
if (_root.auto_adjust) {
if (tfps < 20) {
if (_root.ufactor > 0) {
_root.ufactor = 20 / tfps;
if (_root.ufactor > 4) {
_root.ufactor = 4;
}
_root.fac();
}
if (tfps < 5) {
_root._quality = "LOW";
} else if (tfps < 10) {
_root._quality = "MEDIUM";
} else {
_root._quality = "HIGH";
}
} else {
if (_root.ufactor > 0) {
_root.ufactor = 1;
_root.fac();
}
if (_root.auto_adjust == true) {
_root._quality = "HIGH";
}
}
}
};
Symbol 13 MovieClip Frame 1
stop();
Symbol 653 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.7");
}
static function showPreGameAd(options) {
var _local26 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local22 = 11000;
var _local25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
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 _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local21 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local23 = options.outline;
delete options.outline;
var _local5 = _local6.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 = _local6.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local21);
_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 _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local23, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local22;
chk.ad_timeout = _local25;
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.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local11 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local2 = (100 * _local8) / _local4;
var _local10 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local13 = Math.min(100, Math.min(_local2 || 0, _local10));
_local13 = Math.max(this.last_pcnt, _local13);
this.last_pcnt = _local13;
_local9._xscale = _local13;
options.ad_progress(_local13);
if (sendHostProgress) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local2});
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_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 showClickAwayAd(options) {
var _local9 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local9);
var clip = options.clip;
var _local8 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local10 = _local4[0];
var _local7 = _local4[1];
mc._x = _local10 * 0.5;
mc._y = _local7 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
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")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
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();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
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_failed();
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 = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
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) {
options.ad_failed();
_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 showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(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 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);
}
if (clip._mochiad._containerLCName != undefined) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
}
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);
}
static function rpc(clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
setValue(clip, arg.objectName, arg.value);
break;
case "getValue" :
var _local4 = getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local3);
break;
default :
trace("[mochiads rpc] unknown rpc id: " + arg.id);
}
}
static function setValue(base, objectName, value) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
base[_local2[_local1]] = value;
}
static function getValue(base, objectName) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
return(base[_local2[_local1]]);
}
static function runMethod(base, methodName, argsArray) {
var _local2 = methodName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
if (typeof(base[_local2[_local1]]) == "function") {
return(base[_local2[_local1]].apply(base, argsArray));
}
return(undefined);
}
}
Symbol 654 MovieClip [__Packages.Func] Frame 0
class Func
{
function Func () {
}
function test() {
trace("hello");
}
function buy(cost, turret_number) {
if ((_root.kills == 0) || (_root.factor > 0)) {
if ((_root.tut._currentframe == 1) && (_root.tut != undefined)) {
_root.tut.mini1.gotoAndStop(2);
}
if (turret_number == 1) {
var _local3 = "MachineGun";
} else if (turret_number == 2) {
var _local3 = "Rocket";
} else if (turret_number == 3) {
var _local3 = "Wall";
} else if (turret_number == 4) {
var _local3 = "PoisonGas";
} else if (turret_number == 5) {
var _local3 = "BasicTower";
} else if (turret_number == 6) {
var _local3 = "BombTower";
} else if (turret_number == 7) {
var _local3 = "DeathTower";
} else if (turret_number == 8) {
var _local3 = "Saw";
} else if (turret_number == 9) {
var _local3 = "LaserTower";
} else if (turret_number == 10) {
var _local3 = "ChargeCoil";
}
_root.action = "place";
return(_root.below.attachMovie(_local3, "t" + _root.below.getNextHighestDepth(), _root.below.getNextHighestDepth(), {tower_type:turret_number}));
}
_root.mes.create_message("Cannot build whilst paused");
}
function ar_remove(ar, rem) {
var _local4 = ar.length;
var _local1 = 0;
while (_local1 < ar.length) {
if (ar[_local1] == rem) {
ar.splice(_local1, 1);
}
_local1++;
}
if (ar.length < _local4) {
return(true);
}
return(false);
}
function spawn(num) {
var _local3 = _root.createEmptyMovieClip("z" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_root.noz++;
_local3.num = num;
_local3.z = 0;
var rf = (random(6) + 1);
_local3.onEnterFrame = function () {
if (this.z < this.num) {
if (_root.gamemode == 3) {
this.thp = Math.pow(_root.level, 2) + (_root.level * 2);
} else if (_root.level > _root.lever.length) {
_root.gotoAndPlay("win" + _root.gamemode);
this.removeMovieClip();
} else {
this.thp = _root.lever[_root.level - 1].hp;
}
if (_root.lever[_root.level - 1].g == undefined) {
if (_root.level < 21) {
this.tgo = Math.ceil(_root.level / 2);
} else {
this.tgo = Math.ceil(_root.level / 4) + 5;
}
} else {
this.tgo = _root.lever[_root.level - 1].g;
}
if (_root.gamemode == 3) {
this.tgo = _root.level;
}
var _local3 = _root.mini.attachMovie("Snake", "m" + _root.mini.getNextHighestDepth(), _root.mini.getNextHighestDepth(), {_x:(Stage.width + 20) + (this.z * 50), diff:_root.level, gold:this.tgo, maxhp:this.thp});
_local3.graph.gotoAndStop(rf);
this.z++;
} else {
this.removeMovieClip();
_root.noz--;
}
};
}
function checkpos(dx, dy) {
if (_root.MAP[dx][dy].obj == undefined) {
return(false);
}
if (_root.MAP[dx][dy].obj == 0) {
return(true);
}
return(false);
}
function airraid() {
var _local8 = _root.attachMovie("raid", "raid" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:-300, _y:200});
_local8.onEnterFrame = function () {
this._x = this._x + (7 * _root.factor);
if (this._x > 750) {
this.removeMovieClip();
}
for (var _local7 in this) {
for (var _local6 in _root.minions) {
if (this[_local7].hitTest(_root.minions[_local6]) && (this[_local7].ah != true)) {
this[_local7].ah = true;
var _local5 = this._x + this[_local7]._x;
var _local4 = this._y + this[_local7]._y;
var _local3 = _root.attachMovie("Bomb", "bomb" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:_local5, _y:_local4});
_local3.swapDepths(this);
}
}
}
};
}
function explode() {
var _local4 = new Array({x:0, y:0});
var _local6 = new Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
while (_local4.length > 0) {
if ((_local4[0].x >= 18) && (_local4[0].y == 6)) {
_local4 = [];
for (var _local7 in _root.minions) {
var _local5 = _root.minions[_local7].w_position();
if (_local5 != undefined) {
if (_global.findPath(_root.MAP, _local5.xpos, _local5.ypos, 0, _local5.ypos) == null) {
return(false);
}
}
}
return(true);
}
if (_local6[_local4[0].x][_local4[0].y] == -1) {
_local4.shift();
} else {
_local6[_local4[0].x][_local4[0].y] = -1;
if (checkpos(_local4[0].x, _local4[0].y)) {
if (checkpos(_local4[0].x + 1, _local4[0].y)) {
_local4.push({x:_local4[0].x + 1, y:_local4[0].y});
}
if (checkpos(_local4[0].x - 1, _local4[0].y)) {
_local4.push({x:_local4[0].x - 1, y:_local4[0].y});
}
if (checkpos(_local4[0].x, _local4[0].y + 1)) {
_local4.push({x:_local4[0].x, y:_local4[0].y + 1});
}
if (checkpos(_local4[0].x, _local4[0].y - 1)) {
_local4.push({x:_local4[0].x, y:_local4[0].y - 1});
}
} else {
_local4.shift();
}
}
}
return(false);
}
var dy = new Number();
}
Symbol 655 MovieClip [__Packages.Tower] Frame 0
class Tower extends MovieClip
{
var bullet, tower_type, rota, base, type, tname, specialtxt, desc, special, upgrades, range, speed, firing, damage, lid, lgr, _x, _y, gotoAndStop, attachMovie, getNextHighestDepth, ypos, xpos, _visible, removeMovieClip, rota2, trig, tobj, target_x, target_y, atf, b, _alpha, bm_x, bm_y, swapDepths;
function Tower () {
super();
_root.sel.gotoAndPlay(1);
_root.sel = "";
_root.umenu.gotoAndPlay("none");
_root.imenu.gotoAndStop("cancel");
_root.imenu.tcancel = this;
placing = true;
bullet = "bullet" + tower_type;
rota = rota;
base = base;
if (tower_type == 1) {
type = "Machine Gun";
tname = "Bob";
specialtxt = "[No special]";
desc = "The machine gun has a fast rate of fire and medium range, but deals low damage. Although good initially, it will be almost useless in later levels.";
special = 0;
ctu = 35;
upgrades = [{ctu:25, range:110, firing:15, damage:1}, {ctu:40, range:120, firing:14, damage:2}, {ctu:50, range:120, firing:13, damage:3}, {ctu:60, range:130, firing:12, damage:4}, {ctu:70, range:140, firing:11, damage:5}, {ctu:80, range:150, firing:10, damage:7}, {ctu:90, range:160, firing:10, damage:8}, {ctu:100, range:165, firing:10, damage:9}, {ctu:120, range:165, firing:10, damage:10}, {ctu:150, range:165, firing:10, damage:12}, {ctu:0, range:165, firing:10, damage:15}];
range = upgrades[0].range;
speed = 50;
firing = upgrades[0].firing;
i = firing - 1;
damage = upgrades[0].damage;
MoneySpent = 25;
} else if (tower_type == 2) {
type = "Rocket Launcher";
tname = "Tim";
specialtxt = "The rocket launcher's special is Splash damage.";
desc = "The rocket launcher has excellent range and damage, but a low rate of fire. It costs a lot to build and upgrade.";
speed = 0;
special = 0;
ctu = 50;
upgrades = [{ctu:100, range:135, firing:150, damage:20}, {ctu:50, range:150, firing:120, damage:35}, {ctu:120, range:155, firing:100, damage:50}, {ctu:150, range:160, firing:90, damage:100}, {ctu:200, range:165, firing:85, damage:150}, {ctu:400, range:170, firing:80, damage:200}, {ctu:500, range:175, firing:75, damage:250}, {ctu:0, range:180, firing:70, damage:300}];
MoneySpent = 100;
range = upgrades[0].range;
firing = upgrades[0].firing;
i = firing - 1;
damage = upgrades[0].damage;
} else if (tower_type == 4) {
type = "Poison Gas";
tname = "Dan";
specialtxt = "The poison gas tower's special is Poison damage.";
desc = "The poison gas tower has a small range and slow rate of fire, but deals a lot of damage over time.";
speed = 0;
special = 0;
ctu = 70;
upgrades = [{ctu:100, range:60, firing:200, damage:0.1}, {ctu:150, range:60, firing:190, damage:0.3}, {ctu:200, range:60, firing:180, damage:0.4}, {ctu:0, range:60, firing:170, damage:0.5}];
MoneySpent = 100;
range = upgrades[0].range;
firing = upgrades[0].firing;
i = firing - 1;
damage = upgrades[0].damage;
} else if (tower_type == 5) {
type = "Basic Tower";
tname = "Mike";
specialtxt = "The basic tower has no special.";
desc = "The basic tower is cheap.";
speed = 10;
special = 0;
ctu = 10;
upgrades = [{ctu:25, range:70, firing:10, damage:1}, {ctu:20, range:70, firing:40, damage:3}, {ctu:0, range:70, firing:35, damage:3}];
MoneySpent = 25;
range = upgrades[0].range;
firing = upgrades[0].firing;
i = firing - 1;
damage = upgrades[0].damage;
} else if (tower_type == 6) {
type = "Bomb Tower";
tname = "Fred";
specialtxt = "The bomb tower has enormous splash.";
desc = "The bomb tower is brilliant all round.";
speed = 10;
special = 0;
ctu = 50;
upgrades = [{ctu:60, range:130, firing:80, damage:10}, {ctu:100, range:150, firing:70, damage:20}, {ctu:150, range:170, firing:65, damage:40}, {ctu:0, range:180, firing:60, damage:70}];
MoneySpent = 60;
range = upgrades[0].range;
firing = upgrades[0].firing;
i = firing - 1;
damage = upgrades[0].damage;
} else if (tower_type == 7) {
type = "Zap Tower";
tname = "Barney";
specialtxt = "The death tower kills all enemies in one shot.";
desc = "The death tower takes forever to reload.";
speed = 10;
special = 0;
ctu = 25;
upgrades = [{ctu:25, range:60, firing:80, damage:7}, {ctu:35, range:60, firing:85, damage:20}, {ctu:40, range:60, firing:100, damage:40}, {ctu:45, range:60, firing:110, damage:60}, {ctu:120, range:60, firing:120, damage:100}, {ctu:0, range:65, firing:150, damage:150}];
MoneySpent = 25;
range = upgrades[0].range;
firing = upgrades[0].firing;
i = firing - 1;
damage = upgrades[0].damage;
} else if (tower_type == 8) {
type = "Saw";
tname = "Henry";
specialtxt = "=";
desc = "=";
speed = 1;
special = 0;
ctu = 35;
upgrades = [{ctu:25, range:60, firing:1, damage:0.1}, {ctu:50, range:60, firing:1, damage:0.2}, {ctu:70, range:60, firing:1, damage:0.4}, {ctu:85, range:60, firing:1, damage:1}, {ctu:100, range:60, firing:1, damage:2}, {ctu:0, range:60, firing:1, damage:2.5}];
MoneySpent = 25;
range = upgrades[0].range;
firing = upgrades[0].firing;
i = firing - 1;
damage = upgrades[0].damage;
} else if (tower_type == 9) {
type = "Laser";
tname = "Bert";
specialtxt = "=";
desc = "=";
speed = 1;
special = 0;
ctu = 100;
upgrades = [{ctu:150, range:100, firing:1, damage:0.7}, {ctu:100, range:110, firing:1, damage:0.9}, {ctu:150, range:115, firing:1, damage:1}, {ctu:300, range:120, firing:1, damage:1.5}, {ctu:0, range:150, firing:1, damage:2}];
MoneySpent = 150;
range = upgrades[0].range;
firing = upgrades[0].firing;
i = firing - 1;
damage = upgrades[0].damage;
lid = _root.lasers.createEmptyMovieClip("l" + _root.lasers.getNextHighestDepth(), _root.lasers.getNextHighestDepth());
lgr = _root.lasers.createEmptyMovieClip("g" + _root.lasers.getNextHighestDepth(), _root.lasers.getNextHighestDepth());
lgr.laser = false;
} else if (tower_type == 10) {
type = "Charge Coil";
tname = "Wendy";
specialtxt = "=";
desc = "=";
speed = 1;
special = 0;
ctu = 100;
upgrades = [{ctu:300, range:80, firing:30, damage:0}, {ctu:0, range:100, firing:25, damage:0}];
MoneySpent = 300;
range = upgrades[0].range;
firing = upgrades[0].firing;
i = firing - 1;
damage = upgrades[0].damage;
var _local7 = 0;
var _local4 = 0;
lgr = _root.lasers.createEmptyMovieClip("g" + _root.lasers.getNextHighestDepth(), _root.lasers.getNextHighestDepth());
lgr.laser = false;
}
}
function display() {
if (_root.sel == "") {
_root.umenu.gotoAndPlay("none");
} else if (_root.sel == this) {
_root.umenu.gotoAndPlay("tower");
if (100 > _root.money) {
_root.umenu.mno._visible = true;
} else {
_root.umenu.mno._visible = false;
}
if (ctu == 0) {
_root.umenu.upg.gotoAndPlay("maxed");
_root.umenu.ctu_text.text = "MAX";
_root.umenu.uno._visible = true;
_root.umenu.ispeed.safter.gotoAndPlay(3);
_root.umenu.irange.safter.gotoAndPlay(3);
_root.umenu.idamage.safter.gotoAndPlay(3);
_root.umenu.ispeed.bar_after._xscale = 0;
_root.umenu.irange.bar_after._xscale = 0;
_root.umenu.idamage.bar_after._xscale = 0;
} else {
_root.umenu.ctu_text.text = ctu;
if (ctu > _root.money) {
_root.umenu.uno._visible = true;
} else {
_root.umenu.uno._visible = false;
}
if (_root.umenu.upg._currentframe != 1) {
_root.umenu.upg.gotoAndPlay(1);
}
}
_root.umenu.upg.d1.text = damage;
_root.umenu.upg.d2.text = upgrades[level + 1].damage;
_root.umenu.upg.r1.text = range;
_root.umenu.upg.r2.text = upgrades[level + 1].range;
var _local4 = Math.round(1000 / firing);
var _local3 = Math.round(1000 / upgrades[level + 1].firing);
_root.umenu.upg.s1.text = _local4;
_root.umenu.upg.s2.text = _local3;
_root.umenu.sell_text.text = Math.ceil(MoneySpent * 0.7);
_root.rc._x = _x;
_root.rc._y = _y;
_root.rc._width = range * 2;
_root.rc._height = range * 2;
}
_root.lower.money_txt.text = _root.money;
}
function sell() {
if (_root.sells >= _root.sell_limit) {
if (_root.tut._currentframe < 286) {
if (_root.hints == false) {
_root.omenu.hc.play();
}
_root.tut.gotoAndPlay("penalty");
}
if (sell_cooldown == 0) {
if (_root.sel == this) {
gotoAndStop(1);
_root.sel = "";
_root.rc._x = -20;
_root.rc._y = -20;
_root.rc._width = 0;
_root.rc._height = 0;
display();
}
if (tower_type == 9) {
lid.removeMovieClip();
lgr.removeMovieClip();
}
sell_cooldown = 360;
attachMovie("selling", "selling", getNextHighestDepth());
}
} else {
_root.MAP[xpos][ypos].obj = 0;
_root.newPath();
_visible = false;
_root.sn_j_play();
_root.money = _root.money + Math.ceil(MoneySpent * 0.7);
_root.sells = _root.sells + 1;
_root.lower.money_txt.text = _root.money;
gotoAndStop(1);
_root.sel = "";
_root.rc._x = -20;
_root.rc._y = -20;
_root.rc._width = 0;
_root.rc._height = 0;
display();
if (tower_type == 9) {
lid.removeMovieClip();
lgr.removeMovieClip();
}
removeMovieClip();
}
}
function qmove() {
if (_root.money >= 100) {
if (tower_type == 9) {
lid.clear();
lgr.unloadMovie();
lgr.laser = false;
}
_root.sel = "";
gotoAndStop(1);
display();
_root.action = "place";
_root.MAP[xpos][ypos].obj = 0;
_root.newPath();
placing = true;
} else {
_root.mes.create_message("Not enough money");
}
}
function upgrade() {
if (ctu > 0) {
if (_root.money >= ctu) {
rota.upgrade.nextFrame();
if (rota == undefined) {
rota2.upgrade.nextFrame();
}
_root.money = _root.money - ctu;
_root.sn_j_play();
MoneySpent = MoneySpent + ctu;
_root.lower.money_txt.text = _root.money;
level = level + 1;
range = upgrades[level].range;
firing = upgrades[level].firing;
if (tower_type == 10) {
} else {
damage = upgrades[level].damage;
}
ctu = upgrades[level].ctu;
display();
} else {
_root.mes.create_message("Not enough money");
}
} else {
_root.mes.create_message("Maximum upgrade");
}
}
function onEnterFrame() {
if (sell_cooldown > 0) {
sell_cooldown = sell_cooldown - _root.factor;
if (sell_cooldown <= 0) {
_root.MAP[xpos][ypos].obj = 0;
_root.newPath();
_visible = false;
_root.sn_j_play();
_root.money = _root.money + Math.ceil(MoneySpent * 0.7);
_root.sells = _root.sells + 1;
_root.lower.money_txt.text = _root.money;
display();
if (tower_type == 9) {
lid.removeMovieClip();
lgr.removeMovieClip();
}
removeMovieClip();
}
} else if (!placing) {
trig = false;
if (targ_chosen) {
if (tobj._x == undefined) {
targ_chosen = false;
loop1 = 0;
} else if (Math.sqrt(Math.pow(_x - tobj._x, 2) + Math.pow(_y - tobj._y, 2)) > range) {
targ_chosen = false;
loop1 = 0;
} else {
target_x = tobj._x;
target_y = tobj._y;
trig = true;
}
} else {
if (_root.minions[loop1]._x < Stage.width) {
if (Math.sqrt(Math.pow(_x - _root.minions[loop1]._x, 2) + Math.pow(_y - _root.minions[loop1]._y, 2)) < range) {
targ_chosen = true;
target_y = _root.minions[loop1]._y;
target_x = _root.minions[loop1]._x;
tobj = _root.minions[loop1];
trig = true;
loop1 = 0;
}
}
loop1++;
if (loop1 >= _root.minions.length) {
loop1 = 0;
}
}
if (tower_type == 8) {
trig = false;
for (var _local14 in _root.minions) {
if (_root.minions[_local14]._x < Stage.width) {
if (Math.sqrt(Math.pow(_x - _root.minions[_local14]._x, 2) + Math.pow(_y - _root.minions[_local14]._y, 2)) < range) {
target_y = _root.minions[_local14]._y;
target_x = _root.minions[_local14]._x;
tobj = _root.minions[loop1];
if (rota._currentframe == 1) {
rota.play();
}
trig = true;
}
}
}
if (((trig == false) && (rota._currentframe != 1)) && (rota._currentframe == 16)) {
rota.gotoAndPlay(17);
}
trig = false;
} else if (tower_type == 9) {
if (trig == true) {
var angle = Math.atan((target_y - _y) / (target_x - _x));
if ((target_x - _x) < 0) {
angle = Math.PI + angle;
}
if (!lgr.laser) {
lgr.laser = true;
lgr.attachMovie("laser", "beam", lgr.getNextHighestDepth(), {_x:_x, _y:_y, _rotation:90 + (angle / (Math.PI/180))});
} else {
lgr.beam._rotation = 90 + (angle / (Math.PI/180));
}
var _local12 = _y + (100 * (target_y - _y));
var _local13 = _x + (100 * (target_x - _x));
for (var _local16 in _root.minions) {
var _local9 = _local13 - _x;
var _local8 = _local12 - _y;
var _local7 = _root.minions[_local16]._x - _x;
var _local6 = _root.minions[_local16]._y - _y;
var _local5 = (_local9 * _local7) + (_local8 * _local6);
var _local10 = (_local9 * _local9) + (_local8 * _local8);
if ((_local5 >= 0) && (_local5 <= _local10)) {
var _local11 = Math.floor(Math.sqrt(((_local7 * _local7) + (_local6 * _local6)) - ((_local5 * _local5) / _local10)));
}
if ((_local11 < 30) && (_root.minions[_local16]._x < 550)) {
_root.minions[_local16].hp = _root.minions[_local16].hp - (damage * _root.factor);
_root.minions[_local16].perc = Math.round((_root.minions[_local16].hp / _root.minions[_local16].maxhp) * 100);
if (_root.minions[_local16].perc <= 0) {
_root.minions[_local16].kill();
} else {
_root.minions[_local16].hpbar._xscale = _root.minions[_local16].perc;
}
}
}
} else {
lgr.unloadMovie();
lgr.laser = false;
}
trig = false;
} else if (tower_type == 10) {
if (i >= firing) {
if (_root.minions.length > 0) {
if (range == 100) {
damage = damage + (_root.factor * 2);
} else {
damage = damage + _root.factor;
}
if (_root.sel == this) {
_root.umenu.upg.d1.text = Math.ceil(damage);
}
}
}
}
angle = Math.atan((target_y - _y) / (target_x - _x)) / (Math.PI/180);
if ((tower_type == 7) && (rota._currentframe != 1)) {
} else if ((target_x - _x) > 0) {
rota._rotation = angle + 90;
} else if ((target_x - _x) < 0) {
rota._rotation = 270 + angle;
}
if (Math.abs(rota._x) > 0) {
rota._x = rota._x - (rota._x / 4);
}
if (Math.abs(rota._y) > 0) {
rota._y = rota._y - (rota._y / 4);
}
i = i + (1 * _root.factor);
if ((i / firing) < 1) {
atf._xscale = (i / firing) * 100;
} else {
atf._xscale = 100;
}
if ((i >= firing) && (trig)) {
i = 0;
if (tower_type == 1) {
_root.sn_s_play();
angle = Math.atan2(target_y - _y, target_x - _x);
rota._x = rota._x - ((Math.cos(angle) * speed) / 3);
rota._y = rota._y - ((Math.sin(angle) * speed) / 3);
tobj.hp = tobj.hp - damage;
tobj.perc = Math.round((tobj.hp / tobj.maxhp) * 100);
if (tobj.perc <= 0) {
tobj.kill();
} else {
tobj.hpbar._xscale = tobj.perc;
}
} else if (tower_type == 2) {
b = _root.below.attachMovie(bullet, bullet + _root.below.getNextHighestDepth(), _root.below.getNextHighestDepth(), {_x:_x, _y:_y, _rotation:rota._rotation, tower:this});
angle = Math.atan2(target_y - _y, target_x - _x);
b.dx = Math.cos(angle) * speed;
b.dy = Math.sin(angle) * speed;
b._rotation = (180 * angle) / 3.142;
b.still = false;
b.range = range;
b.ady = _y;
b.adx = _x;
b.speed = speed;
b.damage = damage;
_root.bullets.push(b);
rota._x = rota._x - (12 * Math.cos(angle));
rota._y = rota._y - (12 * Math.sin(angle));
b.tobj = tobj;
b.accel = 0.2;
b.conv = 0.0174555555555556;
b.trig = true;
b.tower = this;
b.onEnterFrame = function () {
if ((((this._x > Stage.width) || (this._x < 0)) || (this._y > Stage.height)) || (this._y < 0)) {
this.removeMovieClip();
}
if (isNaN(this.tobj._y)) {
this.trig = false;
}
if (this.trig) {
this.angle = Math.atan2(this.tobj._y - this._y, this.tobj._x - this._x);
}
this.dx = Math.cos(this._rotation * this.conv) * this.speed;
this.dy = Math.sin(this._rotation * this.conv) * this.speed;
this.speed = this.speed + this.accel;
this.tr = (180 * this.angle) / 3.142;
this._rotation = this._rotation - ((this._rotation - this.tr) / Math.abs(this._rotation - this.tr));
var _local4;
for (_local4 in _root.minions) {
if (this.hitTest(_root.minions[_local4])) {
var n = _root.attachMovie("explosion", (("r" + Math.round(Math.random())) + "x") + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:_root.minions[_local4]._x, _y:_root.minions[_local4]._y, tower:this.tower});
_root.minions[_local4].hp = _root.minions[_local4].hp - this.damage;
n.hit = _root.minions[_local4];
_root.minions[_local4].perc = Math.round((_root.minions[_local4].hp / _root.minions[_local4].maxhp) * 100);
if (_root.minions[_local4].perc <= 0) {
_root.minions[_local4].kill();
} else {
_root.minions[_local4].hpbar._xscale = _root.minions[_local4].perc;
}
n.counter = 100;
n.onEnterFrame = function () {
n.counter = n.counter - 5;
this._width = this._width + 5;
this._height = this._height + 5;
if (n.counter <= 0) {
this.removeMovieClip();
}
if (n.expl._currentframe == 10) {
var _local3;
for (_local3 in _root.minions) {
if (this.hitTest(_root.minions[_local3]) && (this.hit != _root.minions[_local3])) {
_root.minions[_local3].hp = _root.minions[_local3].hp - (this.tower.damage / 3);
_root.minions[_local3].perc = Math.round((_root.minions[_local3].hp / _root.minions[_local3].maxhp) * 100);
if (_root.minions[_local3].perc <= 0) {
_root.minions[_local3].kill();
} else {
_root.minions[_local3].hpbar._xscale = _root.minions[_local3].perc;
}
}
}
}
};
_root.sn_x_play();
this.removeMovieClip();
}
}
this._x = this._x + (this.dx * _root.factor);
this._y = this._y + (this.dy * _root.factor);
};
} else if (tower_type == 4) {
_root.sn_g_play();
rota.play();
var _local17 = attachMovie("cloud", "cloud" + getNextHighestDepth(), getNextHighestDepth(), {i:0, damage:damage, _x:tobj._x - _x, _y:tobj._y - _y});
_local17.onEnterFrame = function () {
this.i = 0;
while (this.i < _root.factor) {
this.nextFrame();
this.i++;
}
for (var _local3 in _root.minions) {
if (_root.minions[_local3].hitTest(this)) {
if (_root.minions[_local3].hbpc != this) {
_root.minions[_local3].hbpc = this;
_root.minions[_local3].Poison(this.damage);
}
}
}
};
} else if (tower_type == 5) {
b = _root.below.attachMovie(bullet, bullet + _root.below.getNextHighestDepth(), _root.below.getNextHighestDepth(), {_x:_x, _y:_y, _rotation:rota._rotation, tower:this});
angle = Math.atan2(target_y - _y, target_x - _x);
b.dx = Math.cos(angle) * speed;
b.dy = Math.sin(angle) * speed;
b._rotation = (180 * angle) / 3.142;
b.still = false;
b.range = range;
b.ady = _y;
b.adx = _x;
b.speed = speed;
b.damage = damage;
_root.bullets.push(b);
rota._x = rota._x - (12 * Math.cos(angle));
rota._y = rota._y - (12 * Math.sin(angle));
b.tobj = tobj;
b.conv = 0.0174555555555556;
b.trig = true;
b.tower = this;
b.onEnterFrame = function () {
if ((((this._x > Stage.width) || (this._x < 0)) || (this._y > Stage.height)) || (this._y < 0)) {
this.removeMovieClip();
}
if (isNaN(this.tobj._y)) {
this.trig = false;
for (this.mi in _root.minions) {
this.tobj = _root.minions[this.mi];
this.trig = true;
break;
}
}
this.dx = Math.cos(this._rotation * this.conv) * this.speed;
this.dy = Math.sin(this._rotation * this.conv) * this.speed;
var _local3;
for (_local3 in _root.minions) {
if (this.hitTest(_root.minions[_local3])) {
_root.minions[_local3].hp = _root.minions[_local3].hp - this.damage;
_root.minions[_local3].perc = Math.round((_root.minions[_local3].hp / _root.minions[_local3].maxhp) * 100);
if (_root.minions[_local3].perc <= 0) {
_root.minions[_local3].kill();
} else {
_root.minions[_local3].hpbar._xscale = _root.minions[_local3].perc;
}
this.removeMovieClip();
}
}
this._x = this._x + (this.dx * _root.factor);
this._y = this._y + (this.dy * _root.factor);
};
} else if (tower_type == 6) {
b = _root.below.attachMovie(bullet, bullet + _root.below.getNextHighestDepth(), _root.below.getNextHighestDepth(), {_x:_x, _y:_y, _rotation:rota._rotation, tower:this});
angle = Math.atan2(target_y - _y, target_x - _x);
b.dx = Math.cos(angle) * speed;
b.dy = Math.sin(angle) * speed;
b.still = false;
b.range = range;
b.ady = _y;
b.adx = _x;
b.speed = speed;
b.damage = damage;
b.dist = Math.sqrt(((target_y - _y) * (target_y - _y)) + ((target_x - _x) * (target_x - _x)));
b.tim = b.dist / speed;
b.wa = 0;
_root.bullets.push(b);
rota._x = rota._x - (12 * Math.cos(angle));
rota._y = rota._y - (12 * Math.sin(angle));
b.tobj = tobj;
b.conv = 0.0174555555555556;
b.trig = true;
b.tower = this;
b.onEnterFrame = function () {
if ((((this._x > Stage.width) || (this._x < 0)) || (this._y > Stage.height)) || (this._y < 0)) {
this.removeMovieClip();
}
this._x = this._x + (this.dx * _root.factor);
this._y = this._y + (this.dy * _root.factor);
this.wa = this.wa + _root.factor;
if (this.wa >= this.tim) {
this.play();
delete this.onEnterFrame;
}
};
} else if (tower_type == 7) {
_root.sn_z_play();
rota.play();
tobj.hp = tobj.hp - damage;
tobj.perc = Math.round((tobj.hp / tobj.maxhp) * 100);
if (tobj.perc <= 0) {
tobj.kill();
} else {
tobj.hpbar._xscale = tobj.perc;
}
} else if (tower_type == 10) {
_root.sn_z_play();
if (damage > tobj.hp) {
damage = damage - tobj.hp;
tobj.hp = 0;
} else {
tobj.hp = tobj.hp - damage;
damage = 0;
}
damage = Math.round(damage);
if (_root.sel == this) {
display();
}
_root.below.attachMovie("CC_bul", "cc" + _root.below.getNextHighestDepth(), _root.below.getNextHighestDepth(), {_x:_x, _y:_y, _rotation:rota._rotation - 90});
tobj.perc = Math.round((tobj.hp / tobj.maxhp) * 100);
if (tobj.perc <= 0) {
tobj.kill();
} else {
tobj.hpbar._xscale = tobj.perc;
}
}
}
}
if (placing) {
if ((_root.kills == 0) || (_root.factor > 0)) {
xpos = (_root._xmouse - (_root._xmouse % 32)) / 32;
ypos = (_root._ymouse - (_root._ymouse % 32)) / 32;
_x = (_root._xmouse - (_root._xmouse % 32)) + 16;
_y = (_root._ymouse - (_root._ymouse % 32)) + 16;
_alpha = 100;
_root.rc._x = _x;
_root.rc._y = _y;
_root.rc._width = range * 2;
_root.rc._height = range * 2;
if (!_root.Func.checkpos(xpos, ypos)) {
_alpha = 50;
_root.rc._x = -20;
_root.rc._y = -20;
_root.rc._width = 0;
_root.rc._height = 0;
}
if (((xpos == 0) || (xpos == 19)) || (_y > 410)) {
_alpha = 50;
_root.rc._x = -20;
_root.rc._y = -20;
_root.rc._width = 0;
_root.rc._height = 0;
}
} else {
_root.mes.create_message("Cannot build whilst paused");
_root.rc._x = -20;
_root.rc._y = -20;
_root.rc._width = 0;
_root.rc._height = 0;
_root.action = "";
_root.imenu.gotoAndPlay(1);
_root.imenu._alpha = 100;
_root.omenu._alpha = 100;
_root.umenu._alpha = 100;
removeMovieClip();
}
}
}
function onRelease() {
if (placing) {
_root.imenu.gotoAndPlay(1);
_root.imenu._alpha = 100;
_root.omenu._alpha = 100;
_root.umenu._alpha = 100;
if (_alpha == 100) {
_root.MAP[xpos][ypos].obj = 1;
if ((_root.money < upgrades[0].ctu) && (init == true)) {
_root.MAP[xpos][ypos].obj = 0;
_root.mes.create_message("Not enough money");
_root.rc._x = -20;
_root.rc._y = -20;
_root.rc._width = 0;
_root.rc._height = 0;
_root.action = "";
removeMovieClip();
} else {
_root.newPath();
if (_root.MAP[18][6].distance == "inf") {
_root.MAP[xpos][ypos].obj = 0;
_root.newPath();
_root.rc._x = -20;
_root.rc._y = -20;
_root.rc._width = 0;
_root.rc._height = 0;
_root.mes.create_message("Tower blocks tanks");
_root.action = "";
removeMovieClip();
} else {
for (var _local3 in _root.minions) {
if ((_root.minions[_local3].xpos == xpos) && (_root.minions[_local3].ypos == ypos)) {
_root.MAP[xpos][ypos].obj = 0;
_root.newPath();
_root.mes.create_message("You cannot build on a tank");
_root.action = "";
_root.rc._x = -20;
_root.rc._y = -20;
_root.rc._width = 0;
_root.rc._height = 0;
removeMovieClip();
break;
}
if (_root.MAP[_root.minions[_local3].xpos][_root.minions[_local3].ypos].distance == "inf") {
_root.MAP[xpos][ypos].obj = 0;
_root.newPath();
_root.mes.create_message("Tower blocks tanks");
_root.action = "";
_root.rc._x = -20;
_root.rc._y = -20;
_root.rc._width = 0;
_root.rc._height = 0;
removeMovieClip();
break;
}
}
if (_root.action != "") {
placing = false;
_root.action = "";
if (_root.tut._currentframe == 1) {
_root.tut.gotoAndPlay("play");
}
if (init) {
_root.money = _root.money - upgrades[0].ctu;
_root.sn_j_play();
} else {
_root.money = _root.money - 100;
_root.sn_j_play();
}
bm_x = _x;
bm_y = _y;
init = false;
_root.lower.money_txt.text = _root.money;
_root.sel.gotoAndPlay(1);
_root.rc._x = -20;
_root.rc._y = -20;
_root.rc._width = 0;
_root.rc._height = 0;
if (Key.isDown(17) || (Key.isDown(16))) {
_root.Func.buy(upgrades[0].ctu, tower_type);
}
}
}
}
} else {
_root.action = "";
if (init) {
_root.rc._x = -20;
_root.rc._y = -20;
_root.rc._width = 0;
_root.rc._height = 0;
removeMovieClip();
} else {
placing = false;
_root.action = "";
_x = bm_x;
_y = bm_y;
_alpha = 100;
display();
}
}
} else if (_root.sel != this) {
if (sell_cooldown == 0) {
if (_root.action == "") {
_root.sel.gotoAndPlay(1);
_root.sel = this;
swapDepths(_root.below.getNextHighestDepth());
gotoAndStop(2);
_root.umenu.maximize2();
_root.rc._x = _x;
_root.rc._y = _y;
_root.rc._width = range * 2;
_root.rc._height = range * 2;
}
}
} else {
gotoAndStop(1);
_root.sel = "";
_root.rc._x = -20;
_root.rc._y = -20;
_root.rc._width = 0;
_root.rc._height = 0;
}
display();
}
var targ_chosen = false;
var placing = true;
var i = 0;
var mi = 0;
var MoneySpent = 0;
var init = true;
var calculating = false;
var iim = 0;
var abs = false;
var loop1 = 0;
var sell_cooldown = 0;
var partner = "none";
var level = 0;
var ctu = 0;
var lti = 0;
}
Symbol 656 MovieClip [__Packages.Minion] Frame 0
class Minion extends MovieClip
{
var hpbar, hp, maxhp, speed, ypos, iny, xpos, _y, _x, removeMovieClip, angle, dx, graph, gotoAndPlay, mine;
function Minion () {
super();
_root.minions.push(this);
hpbar = hpbar;
perc = 100;
hp = maxhp;
speed = 2;
ypos = (iny = 6);
xpos = 18;
_y = (ypos * 32) + 16;
}
function calculate() {
}
function inside(xpos, ypos) {
var _local3 = (_x - (_x % 32)) / 32;
var _local2 = (_y - (_y % 32)) / 32;
if ((_local3 == xpos) && (_local2 == ypos)) {
return(true);
}
return(false);
}
function kill() {
_root.minions = _root.minions.remove(this);
_root.money = _root.money + gold;
_root.sel.display();
_root.lower.money_txt.text = _root.money;
_root.kills++;
if (_root.minions.length == 0) {
_root.lower.clock.gotoAndStop(2);
if ((_root.level >= _root.lever.length) && (_root.gamemode != 3)) {
_root.gotoAndPlay("win" + _root.gamemode);
}
}
removeMovieClip();
}
function onEnterFrame() {
if (init) {
angle = Math.atan2(((ypos * 32) + 16) - _y, ((xpos * 32) + 16) - _x);
dx = Math.cos(angle) * speed;
dy = Math.sin(angle) * speed;
init = false;
}
if (inside(xpos, ypos)) {
var _local3 = _root.next_box(xpos, ypos);
if ((_local3.x == xpos) && (_local3.y == ypos)) {
dy = 0;
dx = -speed;
var _local4 = 0;
} else {
xpos = _local3.x;
ypos = _local3.y;
angle = Math.atan2(((ypos * 32) + 16) - _y, ((xpos * 32) + 16) - _x);
var _local4 = (angle * 57.2957795130823) - 180;
dx = Math.cos(angle) * speed;
dy = Math.sin(angle) * speed;
}
}
if (_x < -10) {
_root.minions = _root.minions.remove(this);
if (_root.minions.length == 0) {
_root.lower.clock.gotoAndStop(2);
}
_root.lives = _root.lives - 1;
if (_root.lives <= 0) {
_root.reset();
_root.gotoAndPlay("lose" + _root.gamemode);
}
_root.lower.lives_txt.text = _root.lives;
removeMovieClip();
}
_x = _x + (dx * _root.factor);
_y = _y + (dy * _root.factor);
graph._rotation = _local4;
if (poisoned > 0) {
hp = hp - (poisoned * _root.factor);
perc = Math.round((hp / maxhp) * 100);
if (perc <= 0) {
kill();
} else {
hpbar._xscale = perc;
}
}
}
function onRollOver() {
if (_root.sel != "") {
if (Math.sqrt(Math.pow(_x - _root.sel._x, 2) + Math.pow(_y - _root.sel._y, 2)) <= _root.sel.range) {
(gotoAndPlay("c"));// not popped
}
}
}
function Poison(amount) {
if (poisoned == 0) {
hpbar.gotoAndStop("poison");
poisoned = amount;
} else {
poisoned = poisoned + (amount * 0.3);
}
}
function Mine() {
if (mined == false) {
mined = true;
mine.play();
}
}
function w_position() {
return({xpos:xpos, ypos:ypos});
}
function onRollOut() {
(gotoAndPlay("n"));// not popped
}
function onRelease() {
_root.minion_info = this;
if (_root.sel != "") {
var _local3 = _root.below.attachMovie("looky", "fx" + _root.below.getNextHighestDepth(), _root.below.getNextHighestDepth(), {fol:this, _x:_x, _y:_y});
_local3.onEnterFrame = function () {
this._x = this.fol._x;
this._y = this.fol._y;
};
_root.sel.tobj = this;
_root.sel.target_x = _x;
_root.sel.target_y = _y;
_root.sel.targ_chosen = true;
}
}
var perc = 100;
var fpath = new Array([18, 0]);
var dy = 0;
var init = true;
var gold = 0;
var amount = 0;
var poisoned = 0;
var mined = false;
}
Symbol 657 MovieClip [__Packages.Wall] Frame 0
class Wall extends MovieClip
{
var ypos, xpos, _visible, gotoAndPlay, _x, _y, _alpha, attachMovie, getNextHighestDepth, removeMovieClip, bm_x;
function Wall () {
super();
_root.imenu.gotoAndStop("cancel");
_root.imenu.tcancel = this;
}
function onEnterFrame() {
if (sell_cooldown > 0) {
sell_cooldown = sell_cooldown - _root.factor;
if (sell_cooldown == 0) {
_root.MAP[xpos][ypos].obj = 0;
_root.sells++;
_root.newPath();
abs = true;
_visible = false;
_root.sn_j_play();
_root.money = _root.money + 7;
_root.lower.money_txt.text = _root.money;
gotoAndPlay(1);
_root.sel = "";
display();
}
} else if (placing) {
xpos = (_root._xmouse - (_root._xmouse % 32)) / 32;
ypos = (_root._ymouse - (_root._ymouse % 32)) / 32;
_x = (_root._xmouse - (_root._xmouse % 32)) + 16;
_y = (_root._ymouse - (_root._ymouse % 32)) + 16;
_alpha = 100;
if (!_root.Func.checkpos(xpos, ypos)) {
_alpha = 50;
}
if (((xpos == 0) || (xpos == 19)) || (_y > 410)) {
_alpha = 50;
}
}
}
function sell() {
if (_root.sells >= _root.sell_limit) {
if (_root.tut._currentframe < 146) {
if (_root.hints == false) {
_root.omenu.hc.play();
}
_root.tut.gotoAndPlay(146);
}
if (sell_cooldown == 0) {
if (_root.sel == this) {
gotoAndPlay(1);
_root.sel = "";
display();
}
sell_cooldown = 360;
attachMovie("selling", "selling", getNextHighestDepth());
}
} else {
_root.MAP[xpos][ypos].obj = 0;
_root.newPath();
_root.sells++;
abs = true;
_visible = false;
_root.money = _root.money + 7;
_root.sn_j_play();
_root.lower.money_txt.text = _root.money;
gotoAndPlay(1);
_root.sel = "";
display();
}
}
function qmove() {
if (_root.money >= 100) {
_root.sel = "";
gotoAndPlay(1);
display();
_root.action = "place";
_root.MAP[xpos][ypos].obj = 0;
_root.newPath();
placing = true;
} else {
_root.mes.create_message("Not enough money");
}
}
function onRelease() {
if (placing) {
_root.imenu.gotoAndPlay(1);
if (_alpha == 100) {
_root.imenu._alpha = 100;
_root.omenu._alpha = 100;
_root.umenu._alpha = 100;
_root.MAP[xpos][ypos].obj = 1;
if (_root.money < 10) {
_root.MAP[xpos][ypos].obj = 0;
_root.mes.create_message("Not enough money");
_root.action = "";
removeMovieClip();
} else {
_root.newPath();
if (_root.MAP[18][6].distance == "inf") {
_root.MAP[xpos][ypos].obj = 0;
_root.newPath();
_root.mes.create_message("Wall blocks tanks");
_root.action = "";
removeMovieClip();
} else {
for (var _local3 in _root.minions) {
if ((_root.minions[_local3].xpos == xpos) && (_root.minions[_local3].ypos == ypos)) {
_root.MAP[xpos][ypos].obj = 0;
_root.newPath();
_root.mes.create_message("You cannot build on a tank");
_root.action = "";
_root.rc._x = -20;
_root.rc._y = -20;
_root.rc._width = 0;
_root.rc._height = 0;
removeMovieClip();
break;
}
if (_root.MAP[_root.minions[_local3].xpos][_root.minions[_local3].ypos].distance == "inf") {
_root.MAP[xpos][ypos].obj = 0;
_root.newPath();
_root.mes.create_message("Wall blocks tanks");
_root.action = "";
removeMovieClip();
break;
}
}
if (_root.action != "") {
placing = false;
_root.action = "";
_root.sn_j_play();
if (init) {
_root.money = _root.money - 10;
} else {
_root.money = _root.money - 100;
}
_root.newPath();
bm_x = _x;
bm_y = _y;
init = false;
_root.lower.money_txt.text = _root.money;
_root.sel.gotoAndPlay(1);
_root.sel = "";
display();
_root.umenu.sell_text.text = 7;
if (Key.isDown(17)) {
_root.Func.buy(20, 3);
}
}
}
}
} else {
_root.action = "";
if (init) {
_root.sel = "";
display();
removeMovieClip();
} else {
placing = false;
_root.action = "";
_x = bm_x;
_y = bm_y;
xpos = (_x - (_x % 32)) / 32;
ypos = (_y - (_y % 32)) / 32;
_root.MAP[xpos][ypos].obj = 0;
_root.newPath();
_alpha = 100;
}
}
} else if (_root.sel != this) {
if (sell_cooldown == 0) {
if (_root.action == "") {
_root.sel.gotoAndPlay(1);
_root.sel = this;
gotoAndPlay(3);
_root.umenu.maximize2();
display();
}
}
} else {
gotoAndPlay(1);
_root.sel = "";
display();
}
}
function display() {
if (_root.sel == "") {
_root.umenu.gotoAndPlay("none");
} else if (_root.sel == this) {
_root.umenu.gotoAndPlay("wall");
_root.umenu.sell_text.text = 7;
}
_root.rc._x = -20;
_root.rc._y = -20;
_root.rc._width = 0;
_root.rc._height = 0;
_root.lower.money_txt.text = _root.money;
}
var placing = true;
var init = true;
var bm_y = 0;
var calculating = false;
var iim = 0;
var sell_cooldown = 0;
var abs = false;
}
Symbol 658 MovieClip [__Packages.Windows] Frame 0
class Windows extends MovieClip
{
var close_btn, _x, _y, wtype, _xscale, swapDepths, _yscale, _name, _height, _width, _alpha;
function Windows () {
super();
close_btn = close_btn;
close_btn.onRelease = function () {
this._parent.minimize();
};
}
function minimize() {
ox = _x;
oy = _y;
tx = _root.lower[wtype]._x + _root.lower._x;
ty = _root.lower[wtype]._y + _root.lower._y;
distance = Math.sqrt(Math.pow(_x - tx, 2) + Math.pow(_y - ty, 2)) / speed;
objScale = 100 / distance;
angle = Math.atan2(ty - _y, tx - _x);
dx = Math.cos(angle) * speed;
dy = Math.sin(angle) * speed;
doing = 1;
}
function maximize() {
if (_xscale == 0) {
swapDepths(_root.getNextHighestDepth());
_x = _root.lower[wtype]._x + _root.lower._x;
_y = _root.lower[wtype]._y + _root.lower._y;
distance = Math.sqrt(Math.pow(_x - ox, 2) + Math.pow(_y - oy, 2)) / speed;
objScale = -100 / distance;
angle = Math.atan2(oy - _y, ox - _x);
dx = Math.cos(angle) * speed;
dy = Math.sin(angle) * speed;
doing = 2;
} else {
minimize();
}
}
function maximize2() {
if ((_xscale == 0) && (_root.popup)) {
swapDepths(_root.getNextHighestDepth());
_x = _root.lower[wtype]._x + _root.lower._x;
_y = _root.lower[wtype]._y + _root.lower._y;
distance = Math.sqrt(Math.pow(_x - ox, 2) + Math.pow(_y - oy, 2)) / speed;
objScale = -100 / distance;
angle = Math.atan2(oy - _y, ox - _x);
dx = Math.cos(angle) * speed;
dy = Math.sin(angle) * speed;
doing = 2;
}
}
function onEnterFrame() {
if (init) {
if (wtype == "option_icon") {
ox = 466.1;
oy = 5.5;
} else if (wtype == "upgrade_icon") {
ox = 294.3;
oy = 5.5;
}
init = false;
}
if (doing == 1) {
_xscale = _xscale - objScale;
_yscale = _yscale - objScale;
_x = _x + dx;
_y = _y + dy;
if (_xscale <= 0) {
_x = -50;
_y = -50;
_xscale = 0;
_yscale = 0;
doing = 0;
}
} else if (doing == 2) {
_xscale = _xscale - objScale;
_yscale = _yscale - objScale;
_x = _x + dx;
_y = _y + dy;
if (_xscale >= 100) {
_xscale = 100;
_yscale = 100;
_x = ox;
_y = oy;
doing = 0;
}
} else if (doing == -1) {
_root.lower[wtype].mtarget = _name;
_root.lower[wtype].onRelease = function () {
_root[this.mtarget].maximize();
};
doing = 0;
}
if (_root.action == "place") {
if ((((_root._ymouse > _y) && (_root._ymouse < (_y + _height))) && (_root._xmouse > (_x - (_width / 2)))) && (_root._xmouse < (_x + (_width / 2)))) {
_alpha = 50;
} else {
_alpha = 100;
}
}
}
var doing = -1;
var speed = 40;
var tx = 0;
var ty = 0;
var dx = 0;
var dy = 0;
var ox = 100;
var oy = 50;
var distance = 0;
var objScale = 0;
var angle = 0;
var init = true;
}
Symbol 17 Button
on (release) {
getURL ("http://www.z-fox.com", "_blank");
}
Symbol 33 MovieClip Frame 1
_root.stop();
Symbol 33 MovieClip Frame 190
_root.play();
Symbol 41 MovieClip Frame 1
stop();
Symbol 48 MovieClip [Wall] Frame 1
#initclip 16
Object.registerClass("Wall", Wall);
#endinitclip
stop();
Symbol 48 MovieClip [Wall] Frame 2
stop();
Symbol 48 MovieClip [Wall] Frame 3
stop();
Symbol 57 MovieClip [Rocket] Frame 1
#initclip 7
Object.registerClass("Rocket", Tower);
#endinitclip
stop();
Symbol 57 MovieClip [Rocket] Frame 2
stop();
Symbol 70 MovieClip Frame 1
stop();
Symbol 72 MovieClip [MachineGun] Frame 1
#initclip 8
Object.registerClass("MachineGun", Tower);
#endinitclip
stop();
Symbol 72 MovieClip [MachineGun] Frame 2
stop();
Symbol 75 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 2
stop();
Symbol 120 MovieClip Frame 15
stop();
_parent._parent.hp = _parent._parent.hp - _parent._parent.mine_tower.damage;
_parent._parent.perc = Math.round((_parent._parent.hp / _parent._parent.maxhp) * 100);
if (_parent._parent.perc <= 0) {
_parent._parent.kill();
} else {
_parent._parent.hpbar._xscale = _parent._parent.perc;
}
Symbol 121 MovieClip Frame 1
stop();
Symbol 123 MovieClip [Snake] Frame 1
#initclip 9
Object.registerClass("Snake", Minion);
#endinitclip
Symbol 123 MovieClip [Snake] Frame 2
stop();
Symbol 123 MovieClip [Snake] Frame 4
stop();
Symbol 129 MovieClip [bullet2] Frame 23
stop();
Symbol 140 MovieClip Frame 15
stop();
Symbol 153 MovieClip Frame 1
stop();
Symbol 168 MovieClip Frame 1
stop();
Symbol 169 MovieClip [PoisonGas] Frame 1
#initclip 10
Object.registerClass("PoisonGas", Tower);
#endinitclip
stop();
Symbol 169 MovieClip [PoisonGas] Frame 2
stop();
Symbol 188 MovieClip Frame 1
stop();
Symbol 192 MovieClip [BombTower] Frame 1
#initclip 11
Object.registerClass("BombTower", Tower);
#endinitclip
stop();
Symbol 192 MovieClip [BombTower] Frame 2
stop();
Symbol 212 MovieClip [bullet6] Frame 45
_root.sn_x_play();
Symbol 212 MovieClip [bullet6] Frame 51
for (i in _root.minions) {
if (_root.minions[i].hitTest(this)) {
_root.minions[i].hp = _root.minions[i].hp - tower.damage;
_root.minions[i].perc = Math.round((_root.minions[i].hp / _root.minions[i].maxhp) * 100);
if (_root.minions[i].perc <= 0) {
_root.minions[i].kill();
} else {
_root.minions[i].hpbar._xscale = _root.minions[i].perc;
}
}
}
Symbol 212 MovieClip [bullet6] Frame 59
stop();
Symbol 222 MovieClip Frame 1
stop();
Symbol 234 MovieClip Frame 1
stop();
Symbol 238 MovieClip [DeathTower] Frame 1
#initclip 12
Object.registerClass("DeathTower", Tower);
#endinitclip
stop();
Symbol 238 MovieClip [DeathTower] Frame 2
stop();
Symbol 257 MovieClip Frame 1
stop();
Symbol 257 MovieClip Frame 15
onEnterFrame = function () {
for (im2 in _root.minions) {
if (this.hitTest(_root.minions[im2])) {
_root.minions[im2].hp = _root.minions[im2].hp - (_parent.damage * _root.factor);
_root.minions[im2].perc = Math.round((_root.minions[im2].hp / _root.minions[im2].maxhp) * 100);
if (_root.minions[im2].perc <= 0) {
_root.minions[im2].kill();
} else {
_root.minions[im2].hpbar._xscale = _root.minions[im2].perc;
}
}
}
};
Symbol 257 MovieClip Frame 16
stop();
Symbol 257 MovieClip Frame 17
delete onEnterFrame;
Symbol 258 MovieClip [Saw] Frame 1
#initclip 13
Object.registerClass("Saw", Tower);
#endinitclip
stop();
Symbol 258 MovieClip [Saw] Frame 2
stop();
Symbol 262 MovieClip Frame 1
stop();
Symbol 263 MovieClip [LaserTower] Frame 1
#initclip 14
Object.registerClass("LaserTower", Tower);
#endinitclip
stop();
Symbol 263 MovieClip [LaserTower] Frame 2
stop();
Symbol 266 MovieClip [Bomb] Frame 21
a = 0;
while (a <= _root.minions.length) {
if (this.hitTest(_root.minions[a])) {
if (_root.minions.length == 0) {
_root.lower.clock.gotoAndStop(2);
if (_root.level >= _root.lever.length) {
_root.gotoAndPlay("win" + _root.gamemode);
}
}
_root.minions[a].removeMovieClip();
_root.minions = _root.minions.remove(_root.minions[a]);
break;
}
a++;
}
Symbol 266 MovieClip [Bomb] Frame 27
this.removeMovieClip();
Symbol 275 Button
on (release) {
for (i in _parent.ma) {
if ((_parent.ma[i]._y < this._y) && (_parent.ma[i] != this)) {
_parent.ma[i]._y = _parent.ma[i]._y + 40;
}
}
_parent.messages--;
_parent.ma.remove(this);
this.removeMovieClip();
}
Symbol 276 MovieClip [message] Frame 150
for (i in _parent.ma) {
if ((_parent.ma[i]._y < this._y) && (_parent.ma[i] != this)) {
_parent.ma[i]._y = _parent.ma[i]._y + 40;
}
}
_parent.messages--;
_parent.ma.remove(this);
this.removeMovieClip();
Symbol 279 MovieClip [selling] Frame 1
stop();
onEnterFrame = function () {
i = 1;
while (i <= _root.factor) {
nextFrame();
i++;
}
};
Symbol 284 MovieClip [cloud] Frame 1
stop();
Symbol 284 MovieClip [cloud] Frame 20
this.removeMovieClip();
Symbol 297 MovieClip Frame 1
stop();
Symbol 303 MovieClip [ChargeCoil] Frame 1
#initclip 15
Object.registerClass("ChargeCoil", Tower);
#endinitclip
stop();
Symbol 303 MovieClip [ChargeCoil] Frame 2
stop();
Symbol 310 MovieClip Frame 1
this.gotoAndStop(Math.floor(Math.random() * 5) + 2);
Symbol 311 MovieClip [CC_bul] Frame 11
this.removeMovieClip();
Symbol 317 MovieClip Frame 6
stop();
Symbol 318 MovieClip Frame 6
stop();
Symbol 319 MovieClip Frame 1
stop();
Symbol 319 MovieClip Frame 2
stop();
Symbol 319 MovieClip Frame 4
stop();
Symbol 319 MovieClip Frame 6
stop();
Symbol 319 MovieClip Frame 8
stop();
Symbol 319 MovieClip Frame 10
stop();
Symbol 323 MovieClip Frame 6
stop();
Symbol 324 MovieClip Frame 6
stop();
Symbol 325 MovieClip Frame 1
stop();
Symbol 325 MovieClip Frame 2
stop();
Symbol 325 MovieClip Frame 4
stop();
Symbol 325 MovieClip Frame 6
stop();
Symbol 325 MovieClip Frame 8
stop();
Symbol 325 MovieClip Frame 10
stop();
Symbol 329 MovieClip Frame 6
stop();
Symbol 330 MovieClip Frame 6
stop();
Symbol 331 MovieClip Frame 1
stop();
Symbol 331 MovieClip Frame 2
stop();
Symbol 331 MovieClip Frame 4
stop();
Symbol 331 MovieClip Frame 6
stop();
Symbol 331 MovieClip Frame 8
stop();
Symbol 331 MovieClip Frame 10
stop();
Symbol 335 MovieClip Frame 6
stop();
Symbol 336 MovieClip Frame 6
stop();
Symbol 337 MovieClip Frame 1
stop();
Symbol 337 MovieClip Frame 2
stop();
Symbol 337 MovieClip Frame 4
stop();
Symbol 337 MovieClip Frame 6
stop();
Symbol 337 MovieClip Frame 8
stop();
Symbol 337 MovieClip Frame 10
stop();
Symbol 341 MovieClip Frame 6
stop();
Symbol 342 MovieClip Frame 6
stop();
Symbol 343 MovieClip Frame 1
stop();
Symbol 343 MovieClip Frame 2
stop();
Symbol 343 MovieClip Frame 4
stop();
Symbol 343 MovieClip Frame 6
stop();
Symbol 343 MovieClip Frame 8
stop();
Symbol 343 MovieClip Frame 10
stop();
Symbol 346 MovieClip Frame 6
stop();
Symbol 347 MovieClip Frame 6
stop();
Symbol 348 MovieClip Frame 1
stop();
Symbol 348 MovieClip Frame 2
stop();
Symbol 348 MovieClip Frame 4
stop();
Symbol 348 MovieClip Frame 6
stop();
Symbol 348 MovieClip Frame 8
stop();
Symbol 348 MovieClip Frame 10
stop();
Symbol 369 MovieClip Frame 1
stop();
Instance of Symbol 319 MovieClip in Symbol 370 MovieClip Frame 1
onClipEvent (load) {
onRollOver = function () {
_parent.description.gotoAndStop("hardcore");
this.gotoAndPlay("out");
};
onRollOut = function () {
_parent.description.gotoAndStop(1);
this.gotoAndPlay("in");
};
onReleaseOutside = onRollOut;
onPress = function () {
this.gotoAndPlay("down");
};
onRelease = function () {
_root.sell_limit = 10;
_root.money = 100;
_root.lives = 5;
_root.gamemode = 1;
_root.lever = new Array({hp:5}, {hp:6}, {hp:7}, {hp:9}, {hp:11}, {hp:13}, {hp:16}, {hp:20}, {hp:24}, {hp:30}, {hp:34}, {hp:42}, {hp:51}, {hp:60}, {hp:68}, {hp:90}, {hp:150}, {hp:200}, {hp:220}, {hp:240}, {hp:260}, {hp:280}, {hp:310}, {hp:340}, {hp:370}, {hp:410}, {hp:450}, {hp:490}, {hp:540}, {hp:590}, {hp:640}, {hp:690}, {hp:750}, {hp:810}, {hp:870}, {hp:930}, {hp:1000}, {hp:1070}, {hp:1150}, {hp:1230}, {hp:1320}, {hp:1410}, {hp:1510}, {hp:1610}, {hp:1720}, {hp:1830}, {hp:1940}, {hp:2500});
_root.gotoAndPlay("unlim");
};
}
Instance of Symbol 325 MovieClip in Symbol 370 MovieClip Frame 1
onClipEvent (load) {
onRollOver = function () {
_parent.description.gotoAndStop("moregames");
this.gotoAndPlay("out");
};
onRollOut = function () {
_parent.description.gotoAndStop(1);
this.gotoAndPlay("in");
};
onReleaseOutside = onRollOut;
onPress = function () {
this.gotoAndPlay("down");
};
onRelease = function () {
getURL ("http://www.z-fox.com", "_blank");
};
}
Instance of Symbol 331 MovieClip in Symbol 370 MovieClip Frame 1
onClipEvent (load) {
onRollOver = function () {
_parent.description.gotoAndStop("walkthrough");
this.gotoAndPlay("out");
};
onRollOut = function () {
_parent.description.gotoAndStop(1);
this.gotoAndPlay("in");
};
onReleaseOutside = onRollOut;
onPress = function () {
this.gotoAndPlay("down");
};
onRelease = function () {
getURL ("http://www.z-fox.com/warzone", "_blank");
};
}
Instance of Symbol 337 MovieClip in Symbol 370 MovieClip Frame 1
onClipEvent (load) {
onRollOver = function () {
_parent.description.gotoAndStop("marathon");
this.gotoAndPlay("out");
};
onRollOut = function () {
_parent.description.gotoAndStop(1);
this.gotoAndPlay("in");
};
onReleaseOutside = onRollOut;
onPress = function () {
this.gotoAndPlay("down");
};
onRelease = function () {
_root.sell_limit = 10;
_root.money = 150;
_root.lives = 10;
_root.gamemode = 3;
_root.gotoAndPlay("unlim");
};
}
Instance of Symbol 343 MovieClip in Symbol 370 MovieClip Frame 1
onClipEvent (load) {
onRollOver = function () {
_parent.description.gotoAndStop("normal");
this.gotoAndPlay("out");
};
onRollOut = function () {
_parent.description.gotoAndStop(1);
this.gotoAndPlay("in");
};
onReleaseOutside = onRollOut;
onPress = function () {
this.gotoAndPlay("down");
};
onRelease = function () {
_root.sell_limit = 10;
_root.money = 100;
_root.lives = 10;
_root.gamemode = 0;
_root.lever = new Array({hp:3}, {hp:4}, {hp:5}, {hp:6}, {hp:7}, {hp:9}, {hp:11}, {hp:13}, {hp:16}, {hp:20}, {hp:24}, {hp:30}, {hp:34}, {hp:42}, {hp:51}, {hp:60}, {hp:68}, {hp:90}, {hp:150}, {hp:200}, {hp:220}, {hp:240}, {hp:260}, {hp:280}, {hp:310}, {hp:340}, {hp:370}, {hp:410}, {hp:450}, {hp:490}, {hp:540}, {hp:590}, {hp:640}, {hp:690}, {hp:750}, {hp:810}, {hp:870}, {hp:930}, {hp:1000}, {hp:1070}, {hp:1150}, {hp:1230}, {hp:1320}, {hp:1410}, {hp:1510}, {hp:1610}, {hp:1720}, {hp:1830}, {hp:1940}, {hp:2500});
_root.gotoAndPlay("unlim");
};
}
Instance of Symbol 348 MovieClip in Symbol 370 MovieClip Frame 1
onClipEvent (load) {
onRollOver = function () {
_parent.description.gotoAndStop("freestyle");
this.gotoAndPlay("out");
};
onRollOut = function () {
_parent.description.gotoAndStop(1);
this.gotoAndPlay("in");
};
onReleaseOutside = onRollOut;
onPress = function () {
this.gotoAndPlay("down");
};
onRelease = function () {
_root.sell_limit = 10;
_root.money = 9999;
_root.lives = 10;
_root.gamemode = 2;
_root.lever = new Array({hp:111}, {hp:141}, {hp:164}, {hp:214}, {hp:264}, {hp:314}, {hp:370}, {hp:450}, {hp:500}, {hp:550}, {hp:650}, {hp:700}, {hp:750}, {hp:800}, {hp:875}, {hp:950}, {hp:1025}, {hp:1100}, {hp:1200}, {hp:1300}, {hp:1400}, {hp:1500}, {hp:1625}, {hp:1750}, {hp:1875}, {hp:2000}, {hp:2125}, {hp:2250}, {hp:2425}, {hp:2600}, {hp:2775}, {hp:3025}, {hp:3275}, {hp:3525}, {hp:3775}, {hp:4125}, {hp:4475}, {hp:4825}, {hp:5325}, {hp:5825}, {hp:6325}, {hp:7025}, {hp:7725}, {hp:8425}, {hp:9000}, {hp:10000}, {hp:11000}, {hp:15000}, {hp:20000}, {hp:25000}, {hp:30000}, {hp:40000}, {hp:50000});
_root.gotoAndPlay("unlim");
};
}
Symbol 376 Button
on (release) {
play();
}
Symbol 377 MovieClip Frame 1
stop();
Symbol 377 MovieClip Frame 2
stop();
Symbol 386 MovieClip Frame 1
stop();
Symbol 386 MovieClip Frame 2
stop();
Instance of Symbol 395 MovieClip "tip" in Symbol 396 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 401 MovieClip "tip" in Symbol 402 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 407 MovieClip "tip" in Symbol 408 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 426 MovieClip Frame 1
stop();
Instance of Symbol 417 MovieClip "tip" in Symbol 426 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 420 MovieClip "close_btn" in Symbol 426 MovieClip Frame 1
onClipEvent (load) {
this.onRelease = function () {
_root.gotoAndPlay("menu");
_root.reset();
};
}
Symbol 426 MovieClip Frame 2
stop();
Instance of Symbol 424 MovieClip "tip" in Symbol 426 MovieClip Frame 2
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 431 MovieClip "tip" in Symbol 432 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 396 MovieClip "build_icon" in Symbol 433 MovieClip Frame 1
onClipEvent (load) {
this.onRollOver = function () {
this.tip._visible = true;
};
this.onRollOut = function () {
this.tip._visible = false;
};
this.onReleaseOutside = this.onRollOut;
}
Instance of Symbol 402 MovieClip "upgrade_icon" in Symbol 433 MovieClip Frame 1
onClipEvent (load) {
this.onRollOver = function () {
this.tip._visible = true;
};
this.onRollOut = function () {
this.tip._visible = false;
};
this.onReleaseOutside = this.onRollOut;
}
Instance of Symbol 408 MovieClip "option_icon" in Symbol 433 MovieClip Frame 1
onClipEvent (load) {
this.onRollOver = function () {
this.tip._visible = true;
};
this.onRollOut = function () {
this.tip._visible = false;
};
this.onReleaseOutside = this.onRollOut;
}
Instance of Symbol 426 MovieClip "pause_icon" in Symbol 433 MovieClip Frame 1
onClipEvent (load) {
this.ca.onRollOver = function () {
tip._visible = true;
};
this.ca.onRollOut = function () {
tip._visible = false;
};
this.ca.onReleaseOutside = this.ca.onRollOut;
this.ca.onRelease = function () {
if (_currentframe == 1) {
if (_root.tut._currentframe == 2) {
_root.tut.play();
}
_root.count = true;
_root.ufactor = 1;
_root.fac();
play();
} else {
_root.count = false;
_root.ufactor = 0;
_root.fac();
play();
}
};
}
Instance of Symbol 432 MovieClip "help_icon" in Symbol 433 MovieClip Frame 1
onClipEvent (load) {
this.onRollOver = function () {
this.tip._visible = true;
};
this.onRollOut = function () {
this.tip._visible = false;
};
this.onReleaseOutside = this.onRollOut;
this.onRelease = function () {
getURL ("http://www.z-fox.com/warzone", "_blank");
};
}
Symbol 439 Button
on (rollOver) {
rollover.gotoAndPlay("rocket");
}
on (release) {
if (_root.action != "place") {
_root.Func.buy(100, 2);
}
}
Symbol 440 Button
on (rollOver) {
rollover.gotoAndPlay("zap");
}
on (release) {
if (_root.action != "place") {
_root.Func.buy(25, 7);
}
}
Symbol 441 Button
on (rollOver) {
rollover.gotoAndPlay("charge");
}
on (release) {
if (_root.action != "place") {
_root.Func.buy(300, 10);
}
}
Symbol 442 Button
on (rollOver) {
rollover.gotoAndPlay("saw");
}
on (release) {
if (_root.action != "place") {
_root.Func.buy(25, 8);
}
}
Symbol 443 Button
on (rollOver) {
rollover.gotoAndPlay("turret");
}
on (release) {
if (_root.action != "place") {
_root.Func.buy(25, 1);
}
}
Symbol 444 Button
on (rollOver) {
rollover.gotoAndPlay("raid");
}
on (release) {
if (_root.action != "place") {
if (_root.money > 200) {
_root.money = _root.money - 200;
_root.lower.money_txt.text = _root.money;
_root.Func.airraid();
} else {
_root.mes.create_message("Not enough money");
}
}
}
Symbol 445 Button
on (rollOver) {
rollover.gotoAndPlay("poison");
}
on (release) {
if (_root.action != "place") {
_root.Func.buy(100, 4);
}
}
Symbol 446 Button
on (rollOver) {
rollover.gotoAndPlay("bomb");
}
on (release) {
if (_root.action != "place") {
_root.Func.buy(60, 6);
}
}
Symbol 447 Button
on (rollOver) {
rollover.gotoAndPlay("wall");
}
on (release) {
if (_root.action != "place") {
_root.Func.buy(45, 3);
}
}
Symbol 507 MovieClip Frame 1
stop();
Symbol 507 MovieClip Frame 3
stop();
Symbol 507 MovieClip Frame 5
stop();
Symbol 507 MovieClip Frame 7
stop();
Symbol 507 MovieClip Frame 9
stop();
Symbol 507 MovieClip Frame 11
stop();
Symbol 507 MovieClip Frame 13
stop();
Symbol 507 MovieClip Frame 15
stop();
Symbol 507 MovieClip Frame 17
stop();
Symbol 507 MovieClip Frame 19
stop();
Symbol 507 MovieClip Frame 21
stop();
Symbol 508 Button
on (rollOver) {
rollover.gotoAndPlay("laser");
}
on (release) {
if (_root.action != "place") {
_root.Func.buy(150, 9);
}
}
Symbol 511 MovieClip [build_menu] Frame 1
#initclip 19
Object.registerClass("build_menu", Windows);
#endinitclip
Instance of Symbol 436 MovieClip in Symbol 511 MovieClip [build_menu] Frame 1
onClipEvent (load) {
this.onPress = function () {
startDrag (_parent);
_parent._alpha = 50;
_parent.swapDepths(_root.getNextHighestDepth());
};
this.onRelease = function () {
_parent._alpha = 100;
stopDrag();
};
}
Symbol 511 MovieClip [build_menu] Frame 2
stop();
Symbol 511 MovieClip [build_menu] Frame 3
stop();
Symbol 534 MovieClip Frame 1
stop();
Symbol 534 MovieClip Frame 3
stop();
Symbol 537 Button
on (release) {
_root.sel.upgrade();
}
Symbol 545 Button
on (release) {
_root.sel.sell();
}
Symbol 550 Button
on (release) {
_root.sel.qmove();
}
Symbol 553 MovieClip [upgrade_menu] Frame 1
#initclip 17
Object.registerClass("upgrade_menu", Windows);
#endinitclip
Instance of Symbol 436 MovieClip in Symbol 553 MovieClip [upgrade_menu] Frame 1
onClipEvent (load) {
this.onPress = function () {
startDrag (_parent);
_parent._alpha = 50;
_parent.swapDepths(_root.getNextHighestDepth());
};
this.onRelease = function () {
_parent._alpha = 100;
stopDrag();
};
}
Symbol 553 MovieClip [upgrade_menu] Frame 2
stop();
Symbol 553 MovieClip [upgrade_menu] Frame 4
stop();
Instance of Symbol 540 MovieClip in Symbol 553 MovieClip [upgrade_menu] Frame 5
onClipEvent (enterFrame) {
this._visible = false;
if (100 > _root.money) {
this._visible = true;
}
}
Symbol 553 MovieClip [upgrade_menu] Frame 6
stop();
Symbol 565 Button
on (release) {
_root._quality = "HIGH";
}
Symbol 568 Button
on (release) {
_root._quality = "MEDIUM";
}
Symbol 571 Button
on (release) {
_root._quality = "LOW";
}
Symbol 572 MovieClip Frame 1
stop();
if (init == undefined) {
if (_root.auto_adjust == false) {
play();
} else {
stop();
}
init = 1;
} else {
_root.auto_adjust = true;
_root.cookie.data.adjust = 1;
stop();
}
Symbol 572 MovieClip Frame 2
stop();
_root.auto_adjust = false;
_root.cookie.data.adjust = 0;
Instance of Symbol 577 MovieClip in Symbol 578 MovieClip Frame 1
onClipEvent (load) {
this.dragging = false;
this.onPress = function () {
this.dragging = true;
};
this.onMouseUp = function () {
this.dragging = false;
};
this.onEnterFrame = function () {
if (this.dragging) {
if (_parent._xmouse > (_parent._width / 2)) {
_x = (_parent._width / 2);
_root.sn_x.setVolume(200);
} else if (_parent._xmouse < (-(_parent._width / 2))) {
_x = (-(_parent._width / 2));
_root.sn_x.setVolume(0);
} else {
_x = _parent._xmouse;
_root.sn_x.setVolume(((_x + (_parent._width / 2)) / _parent._width) * 200);
}
}
};
}
Symbol 580 MovieClip Frame 1
if (init != 1) {
if (_root.cookie.data.nosound == 1) {
play();
} else {
stop();
}
init = 1;
} else {
stop();
}
_root.cookie.data.nosound = 0;
_root.nosound = false;
Symbol 580 MovieClip Frame 2
stop();
_root.nosound = true;
_root.cookie.data.nosound = 1;
Instance of Symbol 577 MovieClip in Symbol 582 MovieClip Frame 1
onClipEvent (load) {
this.dragging = false;
this.onPress = function () {
this.dragging = true;
};
this.onMouseUp = function () {
this.dragging = false;
};
this.onEnterFrame = function () {
if (this.dragging) {
if (_parent._xmouse > (_parent._width / 2)) {
_x = (_parent._width / 2);
_root.sn_l.setVolume(200);
} else if (_parent._xmouse < (-(_parent._width / 2))) {
_x = (-(_parent._width / 2));
_root.sn_l.setVolume(0);
} else {
_x = _parent._xmouse;
_root.sn_l.setVolume(((_x + (_parent._width / 2)) / _parent._width) * 200);
}
}
};
}
Symbol 583 MovieClip Frame 1
if (init != 1) {
if (_root.cookie.data.nosound2 == 1) {
play();
} else {
stop();
}
init = 1;
} else {
_root.sn_l.start(0, 9999);
stop();
}
_root.cookie.data.nosound2 = 0;
_root.nosound2 = false;
Symbol 583 MovieClip Frame 2
stop();
_root.sn_l.stop();
_root.nosound2 = true;
_root.cookie.data.nosound2 = 1;
Symbol 587 MovieClip Frame 1
if (init != 1) {
if (_root.cookie.data.hints == 0) {
play();
} else {
stop();
}
init = 1;
} else {
stop();
}
_root.cookie.data.hints = 1;
_root.hints = true;
_root.mes._y = 340;
_root.tut._visible = true;
Symbol 587 MovieClip Frame 2
stop();
_root.cookie.data.hints = 0;
_root.hints = false;
_root.mes._y = 380;
_root.tut._visible = false;
Symbol 590 MovieClip Frame 1
stop();
_root.xfactor = 1;
_root.fac();
Symbol 590 MovieClip Frame 2
stop();
_root.xfactor = 3;
_root.fac();
Symbol 592 MovieClip Frame 1
if (init != 1) {
if (_root.cookie.data.popup == 0) {
play();
} else {
stop();
}
init = 1;
} else {
stop();
}
_root.cookie.data.popup = 1;
_root.popup = true;
Symbol 592 MovieClip Frame 2
stop();
_root.cookie.data.popup = 0;
_root.popup = false;
Symbol 593 MovieClip [menu3] Frame 1
#initclip 18
Object.registerClass("menu3", Windows);
#endinitclip
Instance of Symbol 436 MovieClip in Symbol 593 MovieClip [menu3] Frame 1
onClipEvent (load) {
this.onPress = function () {
startDrag (_parent);
_parent._alpha = 50;
_parent.swapDepths(_root.getNextHighestDepth());
};
this.onRelease = function () {
_parent._alpha = 100;
stopDrag();
};
}
Instance of Symbol 572 MovieClip in Symbol 593 MovieClip [menu3] Frame 1
onClipEvent (load) {
this.cb.onRelease = function () {
play();
};
}
Instance of Symbol 580 MovieClip "mc" in Symbol 593 MovieClip [menu3] Frame 1
onClipEvent (load) {
this.cb.onRelease = function () {
play();
};
}
Instance of Symbol 583 MovieClip "mc2" in Symbol 593 MovieClip [menu3] Frame 1
onClipEvent (load) {
this.cb.onRelease = function () {
play();
};
}
Instance of Symbol 587 MovieClip "hc" in Symbol 593 MovieClip [menu3] Frame 1
onClipEvent (load) {
this.onRelease = function () {
this.play();
};
}
Instance of Symbol 590 MovieClip in Symbol 593 MovieClip [menu3] Frame 1
onClipEvent (load) {
this.onRelease = function () {
this.play();
};
}
Instance of Symbol 592 MovieClip "popu" in Symbol 593 MovieClip [menu3] Frame 1
onClipEvent (load) {
this.onRelease = function () {
this.play();
};
}
Symbol 593 MovieClip [menu3] Frame 2
stop();
Symbol 603 MovieClip Frame 1
stop();
Symbol 603 MovieClip Frame 2
stop();
Symbol 606 Button
on (release) {
_root.omenu.hc.play();
}
Symbol 611 MovieClip Frame 2
stop();
Symbol 614 MovieClip Frame 1
stop();
Symbol 614 MovieClip Frame 2
stop();
Symbol 626 MovieClip Frame 1
stop();
Symbol 626 MovieClip Frame 2
stop();
Symbol 626 MovieClip Frame 3
stop();
Symbol 626 MovieClip Frame 286
stop();
if (_root.hints == true) {
_root.omenu.hc.gotoAndStop(2);
}
Symbol 626 MovieClip Frame 416
stop();
if (_root.hints == true) {
_root.omenu.hc.gotoAndStop(2);
}
Symbol 627 MovieClip Frame 1
stop();
messages = 0;
ma = Array();
create_message = function (txt) {
t = this.attachMovie("message", "message" + this.getNextHighestDepth(), this.getNextHighestDepth(), {_x:0, _y:messages * -40, key:ma.length});
t.msg_txt.text = txt;
ma.push(t);
messages++;
};
Symbol 635 MovieClip Frame 6
stop();
Symbol 636 MovieClip Frame 6
stop();
Symbol 637 MovieClip Frame 1
stop();
Symbol 637 MovieClip Frame 2
stop();
Symbol 637 MovieClip Frame 4
stop();
Symbol 637 MovieClip Frame 6
stop();
Symbol 637 MovieClip Frame 8
stop();
Symbol 637 MovieClip Frame 10
stop();