Combined Code
frame 1 {
}
frame 1 {
mochi.as2.MochiAd.showPreGameAd({'id': '0644f85e2de9e31d', 'res': '540x440'});
Stage.align = 'TL';
Stage.scaleMode = 'noScale';
Stage.showMenu = false;
}
movieClip 422 __Packages.mochi.as2.MochiAd {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiAd) {
var v1 = function () {};
mochi.as2.MochiAd = v1;
var v2 = v1.prototype;
v1.getVersion = function () {
return mochi.as2.MochiServices.getVersion();
};
v1.showPreGameAd = function (options) {
var v26 = {'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 = mochi.as2.MochiAd._parseOptions(options, v26);
if ('c862232051e0a94e1c3609b3916ddb17'.substr(0) == 'dfeada81ac97cde83665f81c12da7def') {
options.ad_started();
options.ad_finished();
return undefined;
}
var clip = options.clip;
var v22 = 11000;
var v25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!mochi.as2.MochiAd.load(options)) {
options.ad_failed();
options.ad_finished();
return undefined;
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var v14 = mochi.as2.MochiAd._getRes(options);
var v4 = v14[0];
var v13 = v14[1];
mc._x = v4 * 0.5;
mc._y = v13 * 0.5;
var chk = mc.createEmptyMovieClip('_mochiad_wait', 3);
chk._x = v4 * -0.5;
chk._y = v13 * -0.5;
var v6 = chk.createEmptyMovieClip('_mochiad_bar', 4);
if (options.no_progress_bar) {
v6._visible = false;
delete options.no_progress_bar;
} else {
v6._x = 10;
v6._y = v13 - 20;
}
var v21 = options.color;
delete options.color;
var v19 = options.background;
delete options.background;
var v23 = options.outline;
delete options.outline;
var v5 = v6.createEmptyMovieClip('_outline', 1);
v5.beginFill(v19);
v5.moveTo(0, 0);
v5.lineTo(v4 - 20, 0);
v5.lineTo(v4 - 20, 10);
v5.lineTo(0, 10);
v5.lineTo(0, 0);
v5.endFill();
var v3 = v6.createEmptyMovieClip('_inside', 2);
v3.beginFill(v21);
v3.moveTo(0, 0);
v3.lineTo(v4 - 20, 0);
v3.lineTo(v4 - 20, 10);
v3.lineTo(0, 10);
v3.lineTo(0, 0);
v3.endFill();
v3._xscale = 0;
var v7 = v6.createEmptyMovieClip('_outline', 3);
v7.lineStyle(0, v23, 100);
v7.moveTo(0, 0);
v7.lineTo(v4 - 20, 0);
v7.lineTo(v4 - 20, 10);
v7.lineTo(0, 10);
v7.lineTo(0, 0);
chk.ad_msec = v22;
chk.ad_timeout = v25;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var v2 = 100 * (1 - (getTimer() - this.fadeout_start) / this.fadeout_time);
if (v2 > 0) {
this._parent._alpha = v2;
} else {
var v3 = this._parent._parent;
mochi.as2.MochiAd.unload(v3);
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 v2 = this.mc._mochiad_wait;
v2.server_control = true;
v2.started = getTimer();
v2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace('[MOCHIAD rpcTestFn] ' + s);
return s;
};
chk.onEnterFrame = function () {
var v6 = this._parent._parent;
var v11 = this._parent._mochiad_ctr;
var v5 = getTimer() - this.started;
var v3 = false;
var v4 = v6.getBytesTotal();
var v8 = v6.getBytesLoaded();
var v2 = 100 * v8 / v4;
var v10 = 100 * v5 / chk.ad_msec;
var v9 = this._mochiad_bar._inside;
var v13 = Math.min(100, Math.min(v2 || 0, v10));
v13 = Math.max(this.last_pcnt, v13);
this.last_pcnt = v13;
v9._xscale = v13;
options.ad_progress(v13);
if (sendHostProgress) {
mochi.as2.MochiAd.containerNotify(clip, {'id': 'hostLoadPcnt', 'pcnt': v2}, clip._mochiad._containerLCName);
if (v2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var v7 = v11.getBytesTotal();
if (v7 > 0 || typeof v7 == 'undefined') {
chk.showing = true;
chk.started = getTimer();
} else {
if (v5 > chk.ad_timeout && v2 == 100) {
options.ad_failed();
v3 = true;
}
}
}
if (v5 > chk.ad_msec) {
v3 = true;
}
if (v4 > 0 && v8 >= v4 && v3) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
};
v1.showClickAwayAd = function (options) {
var v9 = {'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 = mochi.as2.MochiAd._parseOptions(options, v9);
var clip = options.clip;
var v8 = options.ad_timeout;
delete options.ad_timeout;
if (!mochi.as2.MochiAd.load(options)) {
options.ad_failed();
options.ad_finished();
return undefined;
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var v4 = mochi.as2.MochiAd._getRes(options);
var v10 = v4[0];
var v7 = v4[1];
mc._x = v10 * 0.5;
mc._y = v7 * 0.5;
var chk = mc.createEmptyMovieClip('_mochiad_wait', 3);
chk.ad_timeout = v8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace('[MOCHIAD rpcTestFn] ' + s);
return s;
};
var v20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var v5 = this._parent._mochiad_ctr;
var v4 = getTimer() - this.started;
var v2 = false;
if (!chk.showing) {
var v3 = v5.getBytesTotal();
if (v3 > 0 || typeof v3 == 'undefined') {
v2 = true;
chk.showing = true;
chk.started = getTimer();
} else {
if (v4 > chk.ad_timeout) {
options.ad_failed();
v2 = true;
}
}
}
if (v2) {
delete this.onEnterFrame;
}
};
};
v1.showInterLevelAd = function (options) {
var v13 = {'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 = mochi.as2.MochiAd._parseOptions(options, v13);
var clip = options.clip;
var v10 = 11000;
var v12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!mochi.as2.MochiAd.load(options)) {
options.ad_failed();
options.ad_finished();
return undefined;
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var v5 = mochi.as2.MochiAd._getRes(options);
var v14 = v5[0];
var v11 = v5[1];
mc._x = v14 * 0.5;
mc._y = v11 * 0.5;
var chk = mc.createEmptyMovieClip('_mochiad_wait', 3);
chk.ad_msec = v10;
chk.ad_timeout = v12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var v2 = 100 * (1 - (getTimer() - this.fadeout_start) / this.fadeout_time);
if (v2 > 0) {
this._parent._alpha = v2;
} else {
var v3 = this._parent._parent;
mochi.as2.MochiAd.unload(v3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var v2 = this.mc._mochiad_wait;
v2.server_control = true;
v2.started = getTimer();
v2.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace('[MOCHIAD rpcTestFn] ' + s);
return s;
};
chk.onEnterFrame = function () {
var v5 = this._parent._mochiad_ctr;
var v4 = getTimer() - this.started;
var v2 = false;
if (!chk.showing) {
var v3 = v5.getBytesTotal();
if (v3 > 0 || typeof v3 == 'undefined') {
chk.showing = true;
chk.started = getTimer();
} else {
if (v4 > chk.ad_timeout) {
options.ad_failed();
v2 = true;
}
}
}
if (v4 > chk.ad_msec) {
v2 = true;
}
if (v2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
};
v1.showPreloaderAd = function (options) {
trace('[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0');
mochi.as2.MochiAd.showPreGameAd(options);
};
v1.showTimedAd = function (options) {
trace('[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0');
mochi.as2.MochiAd.showInterLevelAd(options);
};
v1._allowDomains = function (server) {
var v1 = ((server.split('/'))[2].split(':'))[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain('*');
System.security.allowDomain(v1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain('*');
System.security.allowInsecureDomain(v1);
}
}
return v1;
};
v1.load = function (options) {
var v13 = {'clip': _root, 'server': 'http://x.mochiads.com/srv/1/', 'method': 'load', 'depth': 10333, 'id': '_UNKNOWN_'};
options = mochi.as2.MochiAd._parseOptions(options, v13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = mochi.as2.MochiAd.getVersion();
var v7 = options.clip;
if (!mochi.as2.MochiAd._isNetworkAvailable()) {
return null;
}
if (v7._mochiad_loaded) {
return null;
}
var v12 = options.depth;
delete options.depth;
var v6 = v7.createEmptyMovieClip('_mochiad', v12);
var v11 = mochi.as2.MochiAd._getRes(options);
options.res = v11[0] + 'x' + v11[1];
options.server += options.id;
delete options.id;
v7._mochiad_loaded = true;
if (v7._url.indexOf('http') != 0) {
trace('[MochiAd] NOTE: Security Sandbox Violation errors below are normal');
}
var v4 = v6.createEmptyMovieClip('_mochiad_ctr', 1);
for (var v8 in options) {
v4[v8] = options[v8];
}
var v10 = v4.server;
delete v4.server;
var v14 = mochi.as2.MochiAd._allowDomains(v10);
v6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
mochi.as2.MochiAd.unload(this._parent);
}
};
}
};
var v5 = new Object();
var v9 = ['', Math.floor((new Date()).getTime()), random(999999)].join('_');
v5.mc = v6;
v5.name = v9;
v5.hostname = v14;
v5.allowDomain = function (d) {
return true;
};
v5.allowInsecureDomain = v5.allowDomain;
v5.connect(v9);
v6.lc = v5;
v4.lc = v9;
v4.st = getTimer();
v4.loadMovie(v10 + '.swf', 'POST');
return v6;
};
v1.unload = function (clip) {
if (typeof clip == 'undefined') {
clip = _root;
}
if (clip.clip && clip.clip._mochiad) {
clip = clip.clip;
}
if (!clip._mochiad) {
return false;
}
mochi.as2.MochiAd.containerNotify(clip, {'id': 'unload'}, clip._mochiad._containerLCName);
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return true;
};
v1._isNetworkAvailable = function () {
if (System.security) {
var v1 = System.security;
if (v1.sandboxType == 'localWithFile') {
return false;
}
}
return true;
};
v1._getRes = function (options) {
var v3 = options.clip.getBounds();
var v2 = 0;
var v1 = 0;
if (typeof options.res != 'undefined') {
var v4 = options.res.split('x');
v2 = parseFloat(v4[0]);
v1 = parseFloat(v4[1]);
} else {
v2 = v3.xMax - v3.xMin;
v1 = v3.yMax - v3.yMin;
}
if (v2 == 0 || v1 == 0) {
v2 = Stage.width;
v1 = Stage.height;
}
return [v2, v1];
};
v1._parseOptions = function (options, defaults) {
var v4 = {};
for (var v8 in defaults) {
v4[v8] = defaults[v8];
}
if (options) {
for (v8 in options) {
v4[v8] = options[v8];
}
}
if (_root.mochiad_options) {
var v5 = _root.mochiad_options.split('&');
var v2 = 0;
while (v2 < v5.length) {
var v3 = v5[v2].split('=');
v4[unescape(v3[0])] = unescape(v3[1]);
++v2;
}
}
if (v4.id == 'test') {
trace('[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!');
}
return v4;
};
v1.rpc = function (clip, callbackID, arg) {
switch (arg.id) {
case 'setValue':
mochi.as2.MochiAd.setValue(clip, arg.objectName, arg.value);
break;
case 'getValue':
var v4 = mochi.as2.MochiAd.getValue(clip, arg.objectName);
mochi.as2.MochiAd.containerRpcResult(clip, callbackID, v4, clip._mochiad._containerLCName);
break;
case 'runMethod':
var v3 = mochi.as2.MochiAd.runMethod(clip, arg.method, arg.args);
mochi.as2.MochiAd.containerRpcResult(clip, callbackID, v3, clip._mochiad._containerLCName);
break;
default:
trace('[mochiads rpc] unknown rpc id: ' + arg.id);
}
};
v1.setValue = function (base, objectName, value) {
var v2 = objectName.split('.');
var v1;
v1 = 0;
while (v1 < v2.length - 1) {
if (base[v2[v1]] == undefined || base[v2[v1]] == null) {
return undefined;
}
base = base[v2[v1]];
++v1;
}
base[v2[v1]] = value;
};
v1.getValue = function (base, objectName) {
var v2 = objectName.split('.');
var v1;
v1 = 0;
while (v1 < v2.length - 1) {
if (base[v2[v1]] == undefined || base[v2[v1]] == null) {
return undefined;
}
base = base[v2[v1]];
++v1;
}
return base[v2[v1]];
};
v1.runMethod = function (base, methodName, argsArray) {
var v2 = methodName.split('.');
var v1;
v1 = 0;
while (v1 < v2.length - 1) {
if (base[v2[v1]] == undefined || base[v2[v1]] == null) {
return undefined;
}
base = base[v2[v1]];
++v1;
}
if (typeof base[v2[v1]] == 'function') {
return base[v2[v1]].apply(base, argsArray);
} else {
return undefined;
}
};
v1.containerNotify = function (clip, args, lcName) {
var v1 = clip._mochiad._mochiad_ctr.ad.app;
if (v1.notify) {
v1.notify(args);
} else {
(new LocalConnection()).send(lcName, 'notify', args);
}
};
v1.containerRpcResult = function (clip, callbackID, val, lcName) {
var v1 = clip._mochiad._mochiad_ctr.ad.app;
if (v1.rpcResult) {
v1.rpcResult(callbackID, val);
} else {
(new LocalConnection()).send(lcName, 'rpcResult', callbackID, val);
}
};
ASSetPropFlags(mochi.as2.MochiAd.prototype, null, 1);
}
#endinitclip
}
movieClip 423 __Packages.mochi.as2.MochiSync {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiSync) {
var v1 = function () {
this._syncContainer = {};
};
mochi.as2.MochiSync = v1;
var v2 = v1.prototype;
v2.getProp = function (name) {
return this._syncContainer[name];
};
v2.setProp = function (name, value) {
if (this._syncContainer[name] == value) {
return undefined;
}
this._syncContainer[name] = value;
mochi.as2.MochiServices.send('sync_propUpdate', {'name': name, 'value': value});
};
v2.triggerEvent = function (eventType, args) {
switch (eventType) {
case mochi.as2.MochiSync.SYNC_REQUEST:
mochi.as2.MochiServices.send('sync_syncronize', this._syncContainer);
break;
case mochi.as2.MochiSync.SYNC_PROPERTY:
this._syncContainer[args.name] = args.value;
}
};
v1.SYNC_REQUEST = 'SyncRequest';
v1.SYNC_PROPERTY = 'UpdateProperty';
ASSetPropFlags(mochi.as2.MochiSync.prototype, null, 1);
}
#endinitclip
}
movieClip 424 __Packages.mochi.as2.MochiServices {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiServices) {
var v1 = function () {};
mochi.as2.MochiServices = v1;
var v2 = v1.prototype;
v1.__get__id = function () {
return mochi.as2.MochiServices._id;
};
v1.__get__clip = function () {
return mochi.as2.MochiServices._container;
};
v1.__get__childClip = function () {
return mochi.as2.MochiServices._clip;
};
v1.getVersion = function () {
return '3.2 as2';
};
v1.allowDomains = function (server) {
var v1 = ((server.split('/'))[2].split(':'))[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain('*');
System.security.allowDomain(v1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain('*');
System.security.allowInsecureDomain(v1);
}
}
return v1;
};
v1.__get__isNetworkAvailable = function () {
if (System.security) {
var v1 = System.security;
if (v1.sandboxType == 'localWithFile') {
return false;
}
}
return true;
};
v1.__set__comChannelName = function (val) {
if (val != undefined) {
if (val.length > 3) {
mochi.as2.MochiServices._sendChannelName = val + '_fromgame';
mochi.as2.MochiServices.initComChannels();
}
}
return mochi.as2.MochiServices.__get__comChannelName();
};
v1.__get__connected = function () {
return mochi.as2.MochiServices._connected;
};
v1.connect = function (id, clip, onError) {
mochi.as2.MochiServices.warnID(id, false);
if (!mochi.as2.MochiServices._connected && mochi.as2.MochiServices._clip == undefined) {
trace('MochiServices Connecting...');
mochi.as2.MochiServices._connecting = true;
mochi.as2.MochiServices.init(id, clip);
}
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else {
if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
};
v1.disconnect = function () {
if (mochi.as2.MochiServices._connected || mochi.as2.MochiServices._connecting) {
mochi.as2.MochiServices._connected = false;
mochi.as2.MochiServices._connecting = mochi.as2.MochiServices._connected;
mochi.as2.MochiServices.flush(true);
if (mochi.as2.MochiServices._clip != undefined) {
mochi.as2.MochiServices._clip.removeMovieClip();
delete mochi.as2.MochiServices._clip;
}
mochi.as2.MochiServices._listenChannel.close();
}
};
v1.init = function (id, clip) {
mochi.as2.MochiServices._id = id;
if (clip != undefined) {
mochi.as2.MochiServices._container = clip;
} else {
mochi.as2.MochiServices._container = _root;
}
mochi.as2.MochiServices.loadCommunicator(id, mochi.as2.MochiServices._container);
};
v1.loadCommunicator = function (id, clip) {
var v6 = '_mochiservices_com_' + id;
var v5 = new MovieClipLoader();
var v3 = {};
if (mochi.as2.MochiServices._clip != null) {
return mochi.as2.MochiServices._clip;
}
if (!mochi.as2.MochiServices.__get__isNetworkAvailable()) {
return null;
}
if ((mochi.as2.MochiServices.urlOptions()).servURL) {
mochi.as2.MochiServices._servURL = (mochi.as2.MochiServices.urlOptions()).servURL;
}
var v4 = mochi.as2.MochiServices._servURL + mochi.as2.MochiServices._services;
if ((mochi.as2.MochiServices.urlOptions()).servicesURL) {
v4 = (mochi.as2.MochiServices.urlOptions()).servicesURL;
}
mochi.as2.MochiServices.allowDomains(v4);
mochi.as2.MochiServices._clip = clip.createEmptyMovieClip(v6, 10336, false);
mochi.as2.MochiServices._listenChannelName += Math.floor((new Date()).getTime()) + '_' + Math.floor(Math.random() * 99999);
mochi.as2.MochiServices.listen();
if (v3.waitInterval != null) {
clearInterval(v3.waitInterval);
}
v3.onLoadError = mochi.as2.MochiServices.loadError;
v3.onLoadStart = function (target_mc) {
this.isLoading = true;
};
v3.startTime = getTimer();
v3.wait = function () {
if (getTimer() - this.startTime > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ['IOError']);
}
clearInterval(this.waitInterval);
}
};
v3.waitInterval = setInterval(v3, 'wait', 1000);
v5.addListener(v3);
v5.loadClip(v4 + '?listenLC=' + mochi.as2.MochiServices._listenChannelName + '&mochiad_options=' + escape(_root.mochiad_options) + '&api_version=' + /:$version, mochi.as2.MochiServices._clip);
mochi.as2.MochiServices._sendChannel = new LocalConnection();
mochi.as2.MochiServices._sendChannel._queue = [];
return mochi.as2.MochiServices._clip;
};
v1.loadError = function (target_mc, errorCode, httpStatus) {
trace('MochiServices could not load.');
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, [errorCode]);
};
v1.onStatus = function (infoObject) {
if (infoObject.level !== 'error') {
} else {
mochi.as2.MochiServices._connected = false;
mochi.as2.MochiServices._listenChannel.connect(mochi.as2.MochiServices._listenChannelName);
}
};
v1.listen = function () {
mochi.as2.MochiServices._listenChannel = new LocalConnection();
mochi.as2.MochiServices._listenChannel.handshake = function (args) {
mochi.as2.MochiServices.__set__comChannelName(args.newChannel);
};
mochi.as2.MochiServices._listenChannel.allowDomain = function (d) {
return true;
};
mochi.as2.MochiServices._listenChannel.allowInsecureDomain = mochi.as2.MochiServices._listenChannel.allowDomain;
mochi.as2.MochiServices._listenChannel._nextcallbackID = 0;
mochi.as2.MochiServices._listenChannel._callbacks = {};
mochi.as2.MochiServices._listenChannel.connect(mochi.as2.MochiServices._listenChannelName);
trace('Waiting for MochiAds services to connect...');
};
v1.initComChannels = function () {
if (!mochi.as2.MochiServices._connected) {
mochi.as2.MochiServices._sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
mochi.as2.MochiServices._sendChannel.send(mochi.as2.MochiServices._sendChannelName, 'onReceive', {'methodName': 'handshakeDone'});
mochi.as2.MochiServices._sendChannel.send(mochi.as2.MochiServices._sendChannelName, 'onReceive', {'methodName': 'registerGame', 'id': mochi.as2.MochiServices._id, 'clip': mochi.as2.MochiServices._clip, 'version': mochi.as2.MochiServices.getVersion()});
mochi.as2.MochiServices._listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
mochi.as2.MochiServices._listenChannel.onReceive = function (pkg) {
var v5 = pkg.callbackID;
var v4 = this._callbacks[v5];
if (!v4) {
return undefined;
}
var v2 = v4.callbackMethod;
var v3 = v4.callbackObject;
if (v3 && typeof v2 == 'string') {
v2 = v3[v2];
}
if (v2 != undefined) {
v2.apply(v3, pkg.args);
}
delete this._callbacks[v5];
};
mochi.as2.MochiServices._listenChannel.onEvent = function (pkg) {
switch (pkg.target) {
case 'events':
mochi.as2.MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case 'coins':
mochi.as2.MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case 'sync':
mochi.as2.MochiServices.servicesSync.triggerEvent(pkg.event, pkg.args);
}
};
mochi.as2.MochiServices._listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ['IOError']);
};
trace('[SERVICES_API] connected!');
mochi.as2.MochiServices._connecting = false;
mochi.as2.MochiServices._connected = true;
while (mochi.as2.MochiServices._sendChannel._queue.length > 0) {
mochi.as2.MochiServices._sendChannel.send(mochi.as2.MochiServices._sendChannelName, 'onReceive', mochi.as2.MochiServices._sendChannel._queue.shift());
}
}
};
v1.flush = function (error) {
var v1;
var v2;
while (mochi.as2.MochiServices._sendChannel._queue.length > 0) {
v1 = mochi.as2.MochiServices._sendChannel._queue.shift();
false;
if (v1.callbackID != null) {
v2 = mochi.as2.MochiServices._listenChannel._callbacks[v1.callbackID];
}
delete mochi.as2.MochiServices._listenChannel._callbacks[v1.callbackID];
if (error) {
mochi.as2.MochiServices.handleError(v1.args, v2.callbackObject, v2.callbackMethod);
}
}
};
v1.handleError = function (args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ['NotConnected']);
}
if (args.options != null && args.options.onError != null) {
args.options.onError.apply(null, ['NotConnected']);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = 'NotConnected';
if (callbackObject != null && typeof callbackMethod == 'string') {
callbackObject[callbackMethod](args);
} else {
if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
};
v1.send = function (methodName, args, callbackObject, callbackMethod) {
if (mochi.as2.MochiServices._connected) {
mochi.as2.MochiServices._sendChannel.send(mochi.as2.MochiServices._sendChannelName, 'onReceive', {'methodName': methodName, 'args': args, 'callbackID': mochi.as2.MochiServices._listenChannel._nextcallbackID});
} else {
if (mochi.as2.MochiServices._clip == undefined || !mochi.as2.MochiServices._connecting) {
trace('Error: MochiServices not connected. Please call MochiServices.connect(). Function: ' + methodName);
mochi.as2.MochiServices.handleError(args, callbackObject, callbackMethod);
mochi.as2.MochiServices.flush(true);
return undefined;
} else {
mochi.as2.MochiServices._sendChannel._queue.push({'methodName': methodName, 'args': args, 'callbackID': mochi.as2.MochiServices._listenChannel._nextcallbackID});
}
}
mochi.as2.MochiServices._listenChannel._callbacks[mochi.as2.MochiServices._listenChannel._nextcallbackID] = {'callbackObject': callbackObject, 'callbackMethod': callbackMethod};
++mochi.as2.MochiServices._listenChannel._nextcallbackID;
};
v1.urlOptions = function () {
var v5 = {};
if (_root.mochiad_options) {
var v4 = _root.mochiad_options.split('&');
var v2 = 0;
while (v2 < v4.length) {
var v3 = v4[v2].split('=');
v5[unescape(v3[0])] = unescape(v3[1]);
++v2;
}
}
return v5;
};
v1.warnID = function (bid, leaderboard) {
bid = bid.toLowerCase();
if (bid.length != 16) {
trace('WARNING: ' + (leaderboard ? 'board' : 'game') + ' ID is not the appropriate length');
return undefined;
} else {
if (bid == '1e113c7239048b3f') {
if (leaderboard) {
trace('WARNING: Using testing board ID');
} else {
trace('WARNING: Using testing board ID as game ID');
}
return undefined;
} else {
if (bid == '84993a1de4031cd8') {
if (leaderboard) {
trace('WARNING: Using testing game ID as board ID');
} else {
trace('WARNING: Using testing game ID');
}
return undefined;
}
}
}
var v1 = 0;
while (v1 < bid.length) {
switch (bid.charAt(v1)) {
if (bid.charAt(v1) !== 'f') {
} else {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case 'a':
break;
case 'b':
case 'c':
case 'd':
case 'e':
}
default:
trace('WARNING: Board ID contains illegal characters: ' + bid);
return undefined;
}
++v1;
}
};
v1.addLinkEvent = function (url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var v2 = new Object();
v2.mav = mochi.as2.MochiServices.getVersion();
v2.swfv = btn.getSWFVersion() || 6;
v2.swfurl = btn._url;
v2.fv = System.capabilities.version;
v2.os = System.capabilities.os;
v2.lang = System.capabilities.language;
v2.scres = System.capabilities.screenResolutionX + 'x' + System.capabilities.screenResolutionY;
var s = '?';
var v3 = 0;
for (var v6 in v2) {
if (v3 != 0) {
s += '&';
}
++v3;
s = s + v6 + '=' + escape(v2[v6]);
}
if (!(mochi.as2.MochiServices.netupAttempted || mochi.as2.MochiServices._connected)) {
var ping = btn.createEmptyMovieClip('ping', 777);
var v7 = btn.createEmptyMovieClip('nettest', 778);
mochi.as2.MochiServices.netupAttempted = true;
ping.loadMovie('http://x.mochiads.com/linkping.swf?t=' + getTimer());
v7.onEnterFrame = function () {
if (ping._totalframes > 0 && ping._totalframes == ping._framesloaded) {
delete this.onEnterFrame;
} else {
if (getTimer() - t0 > timeout) {
delete this.onEnterFrame;
mochi.as2.MochiServices.netup = false;
}
}
};
}
var v4 = btn.createEmptyMovieClip('clk', 1001);
v4._alpha = 0;
v4.beginFill(1044735);
v4.moveTo(0, 0);
v4.lineTo(0, btn._height);
v4.lineTo(btn._width, btn._height);
v4.lineTo(btn._width, 0);
v4.lineTo(0, 0);
v4.endFill();
v4.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL(url + s, '_blank');
} else {
getURL(burl, '_blank');
}
if (onClick != undefined) {
onClick();
}
};
};
v1.setContainer = function (clip) {};
v1.stayOnTop = function (clip) {};
v1._servURL = 'http://www.mochiads.com/static/lib/services/';
v1._services = 'services.swf';
v1._mochiLC = 'MochiLC.swf';
v1._listenChannelName = '__ms_';
v1._connecting = false;
v1._connected = false;
v1.netup = true;
v1.netupAttempted = false;
v1.servicesSync = new mochi.as2.MochiSync();
v1.addProperty('childClip', v1.__get__childClip, function () {});
v1.addProperty('clip', v1.__get__clip, function () {});
v1.addProperty('comChannelName', function () {}, v1.__set__comChannelName);
v1.addProperty('connected', v1.__get__connected, function () {});
v1.addProperty('id', v1.__get__id, function () {});
v1.addProperty('isNetworkAvailable', v1.__get__isNetworkAvailable, function () {});
ASSetPropFlags(mochi.as2.MochiServices.prototype, null, 1);
}
#endinitclip
}
movieClip 425 __Packages.mochi.as2.MochiEventDispatcher {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiEventDispatcher) {
var v1 = function () {
this.eventTable = {};
};
mochi.as2.MochiEventDispatcher = v1;
var v2 = v1.prototype;
v2.buildDelegate = function (thisObject, thatObject) {
var v2 = {'thisObject': thisObject, 'thatObject': thatObject};
if (thatObject != undefined) {
var funct = (typeof thatObject == 'string') ? thisObject[thatObject] : thatObject;
v2.delegate = function (args) {
funct.call(thisObject, args);
};
return v2;
}
v2.delegate = thisObject;
return v2;
};
v2.compareDelegate = function (d_A, d_B) {
if (d_A.thisObject != d_B.thisObject || d_A.thatObject != d_B.thatObject) {
return false;
}
return true;
};
v2.addEventListener = function (event, thisObject, thatObject) {
this.removeEventListener(event, thisObject, thatObject);
this.eventTable[event].push(this.buildDelegate(thisObject, thatObject));
};
v2.removeEventListener = function (event, thisObject, thatObject) {
var v3 = this.buildDelegate(thisObject, thatObject);
if (this.eventTable[event] == undefined) {
this.eventTable[event] = [];
return undefined;
}
for (var v4 in this.eventTable[event]) {
if (!this.compareDelegate(this.eventTable[event][v4], v3)) {
continue;
}
this.eventTable[event].splice(Number(v4), 1);
}
};
v2.triggerEvent = function (event, args) {
if (this.eventTable[event] == undefined) {
return undefined;
}
for (var v4 in this.eventTable[event]) {
this.eventTable[event][v4].delegate(args);
}
};
ASSetPropFlags(mochi.as2.MochiEventDispatcher.prototype, null, 1);
}
#endinitclip
}
movieClip 426 __Packages.mochi.as2.MochiEvents {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiEvents) {
var v1 = function () {};
mochi.as2.MochiEvents = v1;
var v2 = v1.prototype;
v1.getVersion = function () {
return mochi.as2.MochiServices.getVersion();
};
v1.startSession = function (achievementID) {
mochi.as2.MochiServices.send('events_beginSession', {'achievementID': achievementID}, null, null);
};
v1.trigger = function (kind, obj) {
if (obj == undefined) {
obj = {};
} else {
if (obj.kind != undefined) {
trace('WARNING: optional arguements package contains key \'id\', it will be overwritten');
obj.kind = kind;
}
}
mochi.as2.MochiServices.send('events_triggerEvent', {'eventObject': obj}, null, null);
};
v1.setNotifications = function (clip, style) {
var v2 = {};
for (var v3 in style) {
v2[v3] = style[v3];
}
v2.clip = clip;
mochi.as2.MochiServices.send('events_setNotifications', v2, null, null);
};
v1.addEventListener = function (eventType, thisObject, thatObject) {
mochi.as2.MochiEvents._dispatcher.addEventListener(eventType, thisObject, thatObject);
};
v1.triggerEvent = function (eventType, args) {
mochi.as2.MochiEvents._dispatcher.triggerEvent(eventType, args);
};
v1.removeEventListener = function (eventType, thisObject, thatObject) {
mochi.as2.MochiEvents._dispatcher.removeEventListener(eventType, thisObject, thatObject);
};
v1.startGame = function () {
mochi.as2.MochiEvents.gameStart = (new Date()).getTime();
mochi.as2.MochiEvents.trigger('start_game');
};
v1.endGame = function () {
var v1 = (new Date()).getTime() - mochi.as2.MochiEvents.gameStart;
mochi.as2.MochiEvents.trigger('end_game', {'time': v1});
};
v1.startLevel = function () {
mochi.as2.MochiEvents.levelStart = (new Date()).getTime();
mochi.as2.MochiEvents.trigger('start_level');
};
v1.endLevel = function () {
var v1 = (new Date()).getTime() - mochi.as2.MochiEvents.levelStart;
mochi.as2.MochiEvents.trigger('end_level', {'time': v1});
};
v1.ACHIEVEMENT_RECEIVED = 'AchievementReceived';
v1.ALIGN_TOP_LEFT = 'ALIGN_TL';
v1.ALIGN_TOP = 'ALIGN_T';
v1.ALIGN_TOP_RIGHT = 'ALIGN_TR';
v1.ALIGN_LEFT = 'ALIGN_L';
v1.ALIGN_CENTER = 'ALIGN_C';
v1.ALIGN_RIGHT = 'ALIGN_R';
v1.ALIGN_BOTTOM_LEFT = 'ALIGN_BL';
v1.ALIGN_BOTTOM = 'ALIGN_B';
v1.ALIGN_BOTTOM_RIGHT = 'ALIGN_BR';
v1.FORMAT_SHORT = 'ShortForm';
v1.FORMAT_LONG = 'LongForm';
v1._dispatcher = new mochi.as2.MochiEventDispatcher();
ASSetPropFlags(mochi.as2.MochiEvents.prototype, null, 1);
}
#endinitclip
}
movieClip 427 __Packages.mochi.as2.MochiCoins {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiCoins) {
var v1 = function () {};
mochi.as2.MochiCoins = v1;
var v2 = v1.prototype;
v1.getVersion = function () {
return mochi.as2.MochiServices.getVersion();
};
v1.showStore = function (options) {
mochi.as2.MochiServices.send('coins_showStore', {'options': options}, null, null);
};
v1.showItem = function (options) {
if (options == undefined || typeof options.item != 'string') {
trace('ERROR: showItem call must pass an Object with an item key');
return undefined;
}
mochi.as2.MochiServices.send('coins_showItem', {'options': options}, null, null);
};
v1.showVideo = function (options) {
if (options == undefined || typeof options.item != 'string') {
trace('ERROR: showVideo call must pass an Object with an item key');
return undefined;
}
mochi.as2.MochiServices.send('coins_showVideo', {'options': options}, null, null);
};
v1.showLoginWidget = function (options) {
mochi.as2.MochiServices.setContainer();
mochi.as2.MochiServices.stayOnTop();
mochi.as2.MochiServices.send('coins_showLoginWidget', {'options': options});
};
v1.hideLoginWidget = function () {
mochi.as2.MochiServices.send('coins_hideLoginWidget');
};
v1.getStoreItems = function () {
mochi.as2.MochiServices.send('coins_getStoreItems');
};
v1.getUserInfo = function () {
mochi.as2.MochiServices.send('coins_getUserInfo');
};
v1.saveUserProperties = function (properties) {
mochi.as2.MochiServices.send('coins_saveUserProperties', properties);
};
v1.addEventListener = function (eventType, delegate) {
mochi.as2.MochiCoins._dispatcher.addEventListener(eventType, delegate);
};
v1.triggerEvent = function (eventType, args) {
mochi.as2.MochiCoins._dispatcher.triggerEvent(eventType, args);
};
v1.removeEventListener = function (eventType, delegate) {
mochi.as2.MochiCoins._dispatcher.removeEventListener(eventType, delegate);
};
v1.LOGGED_IN = 'LoggedIn';
v1.LOGGED_OUT = 'LoggedOut';
v1.LOGIN_SHOW = 'LoginShow';
v1.LOGIN_HIDE = 'LoginHide';
v1.STORE_SHOW = 'StoreShow';
v1.STORE_HIDE = 'StoreHide';
v1.PROFILE_SHOW = 'ProfileShow';
v1.PROFILE_HIDE = 'ProfileHide';
v1.PROPERTIES_SAVED = 'PropertySaved';
v1.WIDGET_LOADED = 'WidgetLoaded';
v1.ITEM_OWNED = 'ItemOwned';
v1.ITEM_NEW = 'ItemNew';
v1.STORE_ITEMS = 'StoreItems';
v1.USER_INFO = 'UserInfo';
v1.ERROR = 'Error';
v1.IO_ERROR = 'IOError';
v1.NO_USER = 'NoUser';
v1.PROPERTIES_SIZE = 'PropertiesSize';
v1._dispatcher = new mochi.as2.MochiEventDispatcher();
ASSetPropFlags(mochi.as2.MochiCoins.prototype, null, 1);
}
#endinitclip
}
frame 2 {
var sd = SharedObject.getLocal('DAZExcl1');
if (!sd.data.sfxvol) {
sd.data.sfxvol = 100;
}
if (!sd.data.musicvol) {
sd.data.musicvol = 100;
}
if (!sd.data.showbars) {
sd.data.showbars = false;
}
if (!sd.data.inventory) {
sd.data.inventory = [];
var s = sd.data.inventory;
s.push(['Beretta 92', 'handgun', 9, 9, 19, 32, 2, 'weapon', 1, 0, 160]);
s.push(['Handgun Ammo', 'ammo', 'handgun', 36]);
s.push(['Shotgun Ammo', 'ammo', 'shotgun', 0]);
s.push(['Machinegun Ammo', 'ammo', 'machinegun', 0]);
s.push(['Revolver Ammo', 'ammo', 'revolver', 0]);
s.push(['Rockets', 'ammo', 'rocketlauncher', 0]);
s.push(['Laser Fuel', 'ammo', 'laserbeam', 0]);
}
if (!sd.data.achievements) {
sd.data.achievements = [];
var s = sd.data.achievements;
s[0] = ['Newbie', 'Kill 15 Enemies', false];
s[1] = ['Slayer', 'Kill 50 Enemies', false];
s[2] = ['Maniac', 'Kill 100 Enemies', false];
s[3] = ['Legendary Firearms', 'Increase all weapons to Tier 5', false];
s[4] = ['Nature Hater', 'Shoot three trees', false];
s[5] = ['Basic Firearms', 'Increase any weapon to Tier 2', false];
s[6] = ['Shotgun Frenzy', 'Kill 3 enemies simultaneously using the Beretta Silver Pigeon', false];
s[7] = ['Missile Tactics', 'Grab yourself the Rocket Launcher', false];
s[8] = ['Destroy All Zombies', 'Defeat the final boss on level 20', false];
s[9] = ['Static', 'Defeat 10 enemies without moving', false];
s[10] = ['Master Firearms', 'Increase any weapon to Tier 5', false];
s[11] = ['Statue', 'Defeat 25 enemies without moving', false];
s[12] = ['Bouvine Slayer', 'Kill 25 Bouvine', false];
s[13] = ['Participant', 'Grab yourself the Crescent Laser by being looged in at Hysteria Studios', false];
s[14] = ['Hoarder', 'Collect 1000 combined ammunition', false];
}
if (!sd.data.unlocked) {
sd.data.unlocked = 1;
}
if (!sd.data.qual) {
sd.data.qual = 'high';
}
_root._quality = sd.data.qual;
var a_order = [0, 1, 2, 5, 10, 14, 3, 6, 7, 13, 4, 9, 11, 8, 12];
}
frame 2 {
function create(d, i) {
if (!d) {
d = _root;
}
if (!i) {
return d.createEmptyMovieClip('empty', d.getNextHighestDepth());
} else {
return d.attachMovie(i, i + d.getNextHighestDepth(), d.getNextHighestDepth());
}
}
function rand(min, max) {
max += 1;
return random(max - min) + min;
}
function playSound(item, vol, distance, s) {
if (!breakSounds) {
if (!distance) {
distance = false;
s = [];
}
if (vol < 3) {
return undefined;
}
var soundMC = _root.createEmptyMovieClip(item, _root.getNextHighestDepth());
var sound = new Sound(soundMC);
sound.attachSound(item);
if (distance) {
var v4 = pythag(player.cx(), player.cy(), s[0], s[1]);
var v3 = Math.round(vol - v4 / 5);
if (v3 < 1) {
v3 = 0;
}
sound.setVolume(v3);
} else {
sound.setVolume(vol);
}
sound.start(0, 0);
soundMC.frozen = false;
soundMC.sp = 0;
soundMC.toKill = item;
soundMC.onEnterFrame = function () {
if (frozen && !this.frozen) {
this.frozen = true;
this.sp = sound.position;
sound.stop();
}
if (!frozen && this.frozen) {
this.frozen = false;
sound.start(this.sp / 1000, 0);
}
};
sound.onSoundComplete = function () {
soundMC.removeMovieClip();
};
return soundMC;
} else {
return undefined;
}
}
}
frame 2 {
stop();
}
movieClip 3 {
}
// unknown tag 88 length 210
// unknown tag 88 length 78
movieClip 17 main_menu {
}
movieClip 20 background {
}
movieClip 24 {
}
movieClip 27 {
}
movieClip 29 {
}
movieClip 31 {
}
movieClip 84 {
}
movieClip 86 {
}
movieClip 87 {
}
movieClip 96 {
}
// unknown tag 88 length 88
movieClip 102 {
}
movieClip 103 hud {
}
movieClip 105 limit {
}
movieClip 107 dot {
}
movieClip 110 {
}
movieClip 112 {
}
movieClip 114 hpbar {
}
movieClip 115 {
frame 1 {
_visible = false;
}
}
movieClip 119 {
frame 1 {
this.gotoAndStop(random(3) + 1);
}
}
movieClip 120 rat {
}
movieClip 122 {
}
movieClip 123 ammo_handgun {
}
movieClip 125 blood {
}
// unknown tag 88 length 425
movieClip 128 alert {
}
movieClip 130 {
}
movieClip 132 {
}
movieClip 139 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
movieClip 141 {
}
movieClip 143 {
}
movieClip 145 {
frame 1 {
}
frame 20 {
gotoAndPlay(1);
}
}
movieClip 146 player {
}
movieClip 150 {
frame 1 {
this.gotoAndStop(random(3) + 1);
}
}
movieClip 154 {
frame 1 {
this.gotoAndStop(random(3) + 1);
}
}
movieClip 158 {
frame 1 {
this.gotoAndStop(random(3) + 1);
}
}
movieClip 159 {
}
movieClip 160 zombie {
}
movieClip 162 {
}
movieClip 163 ammo_shotgun {
}
movieClip 164 {
}
// unknown tag 88 length 83
// unknown tag 88 length 114
movieClip 184 {
}
movieClip 186 {
frame 1 {
this.onPress = function () {
this.val = Math.round((this._xmouse / this._width) * 100);
};
this.onEnterFrame = function () {
if (val > 99) {
val = 100;
}
if (val < 1) {
val = 0;
}
this.bar._xscale = this.val;
};
}
}
movieClip 189 pause {
frame 1 {
qhigh.onPress = function () {
_root.sd.data.qual = 'high';
_root._quality = 'high';
};
qmedium.onPress = function () {
_root.sd.data.qual = 'medium';
_root._quality = 'medium';
};
qlow.onPress = function () {
_root.sd.data.qual = 'low';
_root._quality = 'low';
};
sfx.val = _root.sd.data.sfxvol;
music.val = _root.sd.data.musicvol;
this.onEnterFrame = function () {
_root.sd.data.sfxvol = sfx.val;
_root.sd.data.musicvol = music.val;
};
}
}
movieClip 191 round {
}
movieClip 193 {
}
movieClip 194 handgun_pickup {
}
movieClip 196 {
}
movieClip 197 shotgun_pickup {
}
movieClip 199 {
}
movieClip 200 machinegun_pickup {
}
movieClip 202 {
}
movieClip 203 revolver_pickup {
}
movieClip 205 {
}
movieClip 206 ammo_machinegun {
}
movieClip 208 {
}
movieClip 209 ammo_revolver {
}
movieClip 212 {
}
movieClip 213 ground_blood {
}
movieClip 215 {
}
movieClip 216 mummy {
}
movieClip 218 {
}
movieClip 221 {
}
movieClip 225 {
}
movieClip 227 achieve {
}
movieClip 231 {
}
movieClip 232 {
}
movieClip 233 tree {
}
movieClip 253 {
frame 1 {
stop();
}
}
movieClip 255 {
}
movieClip 256 boss_5 {
}
movieClip 258 tag {
}
movieClip 262 effects_bone {
}
movieClip 264 hole {
}
movieClip 266 star {
}
movieClip 268 darkness {
frame 1 {
stop();
}
}
movieClip 272 {
}
movieClip 273 popup {
}
movieClip 275 {
}
movieClip 276 boss_10 {
}
movieClip 278 {
}
movieClip 280 {
}
movieClip 282 {
}
movieClip 283 haste_effect {
}
movieClip 286 {
frame 1 {
this.gotoAndStop(random(2) + 1);
}
}
movieClip 290 {
frame 1 {
this.gotoAndStop(random(3) + 1);
}
}
movieClip 293 {
frame 1 {
this.gotoAndStop(random(2) + 1);
}
}
movieClip 299 {
frame 1 {
this.gotoAndStop(random(4) + 1);
}
}
movieClip 300 {
}
movieClip 301 acolyte {
}
movieClip 303 {
}
movieClip 306 {
frame 1 {
this.gotoAndStop(random(2) + 1);
}
}
movieClip 308 {
}
movieClip 309 {
}
movieClip 310 hell_hound {
}
movieClip 312 {
}
movieClip 313 boss_15 {
}
movieClip 315 {
}
movieClip 316 fireball {
}
movieClip 318 {
}
movieClip 319 smoke {
frame 39 {
this.removeMovieClip();
}
}
movieClip 321 {
}
movieClip 322 archer {
}
movieClip 324 {
}
movieClip 325 bouvine {
}
movieClip 327 bolt {
}
movieClip 329 {
}
movieClip 330 rocketlauncher_pickup {
}
movieClip 332 {
}
movieClip 333 ammo_rocketlauncher {
}
movieClip 336 {
}
movieClip 337 rocket {
}
movieClip 341 explosion {
}
movieClip 345 {
}
movieClip 347 {
}
movieClip 348 boss_20 {
}
movieClip 349 {
frame 1 {
this.useHandCursor = false;
this.onRollOver = function () {};
}
}
movieClip 377 tutorial {
frame 1 {
stop();
var c = this;
n.onPress = function () {
if (c._currentframe < 4) {
c.gotoAndStop(c._currentframe + 1);
} else {
c.gotoAndStop(1);
}
};
kk.onPress = function () {
c.done = true;
};
p.onPress = function () {
if (c._currentframe > 1) {
c.gotoAndStop(c._currentframe - 1);
} else {
c.gotoAndStop(4);
}
};
}
}
movieClip 378 achscreen {
frame 1 {
var c = this;
ret.onPress = function () {
c.done = true;
};
}
}
movieClip 380 ac {
}
movieClip 381 rnd_Select {
frame 1 {
var c = this;
rtn.onPress = function () {
c.done = true;
};
}
}
movieClip 384 rnd {
frame 1 {
stop();
}
}
// unknown tag 88 length 114
movieClip 389 {
}
button 390 {
on (press) {
getURL('http://www.hysteriastudios.com/', '_blank');
}
}
movieClip 393 {
}
movieClip 394 {
frame 135 {
stop();
_root.gotoAndStop(3);
}
}
// unknown tag 88 length 83
movieClip 397 {
}
movieClip 398 credits {
}
movieClip 400 {
}
movieClip 402 {
}
movieClip 404 {
}
// unknown tag 88 length 79
movieClip 409 bossbar {
}
movieClip 411 {
}
movieClip 412 healthpack {
}
movieClip 414 red {
}
movieClip 416 {
}
movieClip 417 laserbeam_pickup {
}
movieClip 419 {
}
movieClip 420 ammo_laserbeam {
}
frame 3 {
stop();
var current = 1;
var exclusive = false;
var l = new LoadVars();
l.load('http://www.hysteriastudios.com/api/checklogin.php');
l.onLoad = function (s) {
if (s) {
if (l.output == 1) {
exclusive = true;
}
trace(exclusive);
trace(l.output);
} else {
trace('Connection error');
}
};
var m = create(_root, 'main_menu');
m.playb.onPress = function () {
var k = create(_root, 'rnd_select');
k._alpha = 0;
k.done = false;
k.onEnterFrame = function () {
if (!this.done) {
this._alpha -= (this._alpha - 100) / 10;
} else {
this._alpha -= this._alpha / 10;
if (Math.floor(this._alpha) < 2) {
this.removeMovieClip();
}
}
};
var v4 = 1;
while (v4 <= 20) {
var v3 = create(k, 'rnd');
v3._x = Stage.width / 2;
v3._y = 12 + v4 * v3._height;
v3.val = v4;
var v5 = Math.ceil(v4 / 5);
v3.r.text = 'Round ' + v5 + '-' + (5 - (v5 * 5 - v4));
if (v4 <= sd.data.unlocked) {
v3.onPress = function () {
_root.gotoAndStop(4);
current = this.val;
m.removeMovieClip();
k.removeMovieClip();
};
v3.onRollOver = function () {
this.gotoAndStop(2);
};
v3.onRollOut = function () {
this.gotoAndStop(1);
};
} else {
v3._alpha = 20;
}
++v4;
}
};
m.achb.onPress = function () {
var v6 = create(_root, 'achscreen');
v6._alpha = 0;
v6.done = false;
v6.onEnterFrame = function () {
if (!this.done) {
this._alpha -= (this._alpha - 100) / 10;
} else {
this._alpha -= this._alpha / 10;
if (Math.floor(this._alpha) < 2) {
this.removeMovieClip();
}
}
};
var v7 = sd.data.achievements;
var v5 = 0;
while (v5 < a_order.length) {
var v4 = v7[a_order[v5]];
var v3 = create(v6, 'ac');
v3._x = 20;
v3._y = 50 + v5 * v3._height;
v3.nme.html = true;
if (v4[2] == false) {
v3._alpha = 50;
v3.nme.htmlText = v4[0];
} else {
v3.nme.htmlText = '<font color=\'#FFCC00\'>' + v4[0] + '</font> - ' + v4[1];
}
++v5;
}
};
m.tutb.onPress = function () {
var v3 = create(_root, 'tutorial');
v3._alpha = 0;
v3.done = false;
v3.onEnterFrame = function () {
if (!this.done) {
this._alpha -= (this._alpha - 100) / 10;
} else {
this._alpha -= this._alpha / 10;
if (Math.floor(this._alpha) < 2) {
this.removeMovieClip();
}
}
};
};
}
frame 4 {
}
frame 4 {
function upgrade(wep) {
var v5 = upg[wep[0]][wep[8] - 1];
if (wep[8] == 1) {
get_ach([5]);
}
if (wep[8] == 4) {
get_ach([10]);
}
var v6 = wep[2];
weapon[wep[0]] = v5;
player.equip.weapon = weapon[wep[0]];
player.equip.weapon[2] = v6;
alert('<font color=\'#65CCFF\'>' + wep[0] + '</font> increased strength to Tier ' + Math.round(wep[8] + 1));
for (var v4 in player.backpack) {
var v2 = player.backpack[v4];
if (v2[0] == wep[0]) {
player.backpack[v4] = weapon[wep[0]];
}
}
var v3 = 0;
for (v4 in player.backpack) {
if (player.backpack[v4][7] == 'weapon') {
v2 = player.backpack[v4];
if (v2[8] == 5) {
v3 += 1;
}
}
}
if (v3 >= 6) {
get_ach([3]);
}
}
var weapon = [];
var upg = [];
weapon.Beretta 92 = ['Beretta 92', 'handgun', 9, 9, 19, 32, 2, 'weapon', 1, 0, 160];
upg.Beretta 92 = [['Beretta 92', 'handgun', 0, 11, 18, 28, 3, 'weapon', 2, 0, 260], ['Beretta 92', 'handgun', 0, 13, 16, 27, 5, 'weapon', 3, 0, 380], ['Beretta 92', 'handgun', 0, 15, 14, 25, 6, 'weapon', 4, 0, 510], ['Beretta 92', 'handgun', 0, 16, 12, 23, 8, 'weapon', 5, 0, 0]];
weapon.Beretta Silver Pigeon = ['Beretta Silver Pigeon', 'shotgun', rand(4, 7), 7, 35, 60, 3, 'weapon', 1, 0, 200];
upg.Beretta Silver Pigeon = [['Beretta Silver Pigeon', 'shotgun', 0, 7, 33, 56, 4, 'weapon', 2, 0, 330], ['Beretta Silver Pigeon', 'shotgun', 0, 8, 31, 53, 5, 'weapon', 3, 0, 460], ['Beretta Silver Pigeon', 'shotgun', 0, 10, 28, 50, 7, 'weapon', 4, 0, 590], ['Beretta Silver Pigeon', 'shotgun', 0, 12, 26, 47, 10, 'weapon', 5, 0, 0]];
weapon.Beretta M12 = ['Beretta M12', 'machinegun', rand(16, 32), 32, 2, 55, 2, 'weapon', 1, 0, 280];
upg.Beretta M12 = [['Beretta M12', 'machinegun', 0, 34, 2, 52, 3, 'weapon', 2, 0, 420], ['Beretta M12', 'machinegun', 0, 38, 2, 49, 5, 'weapon', 3, 0, 570], ['Beretta M12', 'machinegun', 0, 42, 2, 46, 6, 'weapon', 4, 0, 720], ['Beretta M12', 'machinegun', 0, 46, 2, 42, 7, 'weapon', 5, 0, 0]];
weapon.Crescent Laser = ['Crescent Laser', 'laserbeam', 50, 50, 1, 1, 3, 'weapon', 1, 0, 540];
upg.Crescent Laser = [['Crescent Laser', 'laserbeam', 0, 50, 1, 1, 4, 'weapon', 2, 0, 720], ['Crescent Laser', 'laserbeam', 0, 50, 1, 1, 6, 'weapon', 3, 0, 910], ['Crescent Laser', 'laserbeam', 0, 50, 1, 1, 7, 'weapon', 4, 0, 1200], ['Crescent Laser', 'laserbeam', 0, 50, 1, 1, 9, 'weapon', 5, 0, 0]];
weapon.Colt Python = ['Colt Python', 'revolver', rand(3, 6), 6, 22, 35, 24, 'weapon', 1, 0, 200];
upg.Colt Python = [['Colt Python', 'revolver', 0, 6, 20, 32, 29, 'weapon', 2, 0, 350], ['Colt Python', 'revolver', 0, 6, 18, 28, 35, 'weapon', 3, 0, 500], ['Colt Python', 'revolver', 0, 8, 16, 25, 39, 'weapon', 4, 0, 650], ['Colt Python', 'revolver', 0, 8, 14, 23, 44, 'weapon', 5, 0, 0]];
weapon.Panzerfaust 3 = ['Panzerfaust 3', 'rocketlauncher', rand(1, 3), 3, 50, 60, 28, 'weapon', 1, 0, 200];
upg.Panzerfaust 3 = [['Panzerfaust 3', 'rocketlauncher', 0, 3, 48, 57, 31, 'weapon', 2, 0, 350], ['Panzerfaust 3', 'rocketlauncher', 0, 3, 46, 54, 35, 'weapon', 3, 0, 500], ['Panzerfaust 3', 'rocketlauncher', 0, 4, 43, 50, 39, 'weapon', 4, 0, 650], ['Panzerfaust 3', 'rocketlauncher', 0, 4, 40, 45, 43, 'weapon', 5, 0, 0]];
}
frame 4 {
function total_unlocked() {
var v2 = 0;
var v1 = 0;
while (v1 < achievements.length) {
if (achievements[v1][2]) {
v2 += 1;
}
++v1;
}
return v2;
}
function get_ach(type) {
var v2 = achievement[type];
if (v2[2] == false) {
popup_ach(v2);
_root.kongregateStats.submit('Achievements Unlocked', total_unlocked + 1);
v2[2] = true;
player.stars += 1;
}
}
function popup_ach(ach) {
playSound('gain', sd.data.sfxvol);
var v2 = create(hud_container, 'achieve');
v2.cacheAsBitmap = true;
for (var v3 in achs) {
achs[v3].timer = 0;
achs[v3].done = true;
}
achs.push(v2);
v2._y = 90;
v2._alpha = 0;
v2.timer = 250;
v2.done = false;
v2.pos = 80;
v2.title.text = '"' + ach[0] + '"';
v2.type.text = ach[1];
v2.onEnterFrame = function () {
if (!freeze) {
this._y -= (this._y - this.pos) / 10;
if (!this.done) {
this._alpha -= (this._alpha - 100) / 10;
if (Math.ceil(this._alpha) > 95) {
this.done = true;
}
} else {
this.timer -= 1;
}
if (this.timer < 1) {
this._alpha -= this._alpha / 5;
if (Math.floor(this._alpha) < 5) {
this.array_remove(achs);
this.removeMovieClip();
}
}
}
};
}
var a_kills = 0;
var static_kills = 0;
var cow_kills = 0;
var trees = 0;
var achievement = sd.data.achievements;
var achievement_handler = create();
achievement_handler.onEnterFrame = function () {
if (a_kills >= 15) {
get_ach([0]);
}
if (a_kills >= 50) {
get_ach([1]);
}
if (a_kills >= 100) {
get_ach([2]);
}
if (static_kills >= 10) {
get_ach([9]);
}
if (static_kills >= 25) {
get_ach([11]);
}
if (trees >= 3) {
get_ach([4]);
}
if (cow_kills >= 25) {
get_ach([12]);
}
sd.data.achievements = achievement;
};
var achs = [];
}
frame 4 {
function pythag(xa, ya, xb, yb) {
var v2 = xa - xb;
var v1 = ya - yb;
return Math.sqrt(v2 * v2 + v1 * v1);
}
function alert(info) {
var v2 = create(hud_container, 'alert');
v2.cacheAsBitmap = true;
alerts.push(v2);
v2._x = -v2._width;
v2._y = Stage.height - v2._height - 100;
v2.html = true;
v2.write.htmlText = info;
for (var v3 in alerts) {
alerts[v3].pos -= v2._height - 2;
}
v2.pos = v2._y;
v2.timer = 150;
v2.onEnterFrame = function () {
if (!frozen) {
this._x -= this._x / 5;
this._y -= (this._y - this.pos) / 10;
this.timer -= 1;
if (this.timer < 1) {
this._alpha -= this._alpha / 5;
}
if (Math.floor(this._alpha) < 2) {
this.array_remove(alerts);
this.removeMovieClip();
}
}
};
}
function wait(t) {
var v2 = create();
v2.timer = t;
v2.onEnterFrame = function () {
this.timer -= 1;
if (this.timer < 1) {
this.removeMovieClip();
}
};
return v2;
}
function refresh_field() {
arena.draw(remains);
for (var v1 in remains) {
remains[v1].removeMovieClip();
}
}
function tree(xp, yp) {
var v4 = create(structure, 'tree');
v4.cacheAsBitmap = true;
v4._x = xp;
v4._y = yp;
collides.push(v4);
v4.onEnterFrame = function () {
this.hidden();
for (var v4 in units) {
var v2 = units[v4];
while (pythag(this.cx(), this.cy(), v2.cx(), v2.cy()) < this.hit._width / 2 + v2.hit._width / 2) {
var v3 = Math.atan2(this.cy() - v2.cy(), this.cx() - v2.cx());
v2._x -= Math.cos(v3);
v2._y -= Math.sin(v3);
}
}
};
}
function store(ar) {
var v1 = ar.concat();
for (var v2 in v1) {
v1[v2] = v1[v2].join('#');
}
return v1.join('$');
}
function restore(st) {
var v1 = st.split('$');
for (var v2 in v1) {
v1[v2] = v1[v2].split('#');
}
return v1;
}
function fix2D(ar) {
for (var v5 in ar) {
for (var v4 in ar[v5]) {
var v3 = ar[v5][v4];
var v2 = Math.round(ar[v5][v4]);
ar[v5][v4] = v2;
if (isNaN(ar[v5][v4])) {
ar[v5][v4] = v3;
}
}
}
}
function splash() {
var v4 = create();
var v3 = create(v4);
v4._x = Stage.width / 2;
v4._y = Stage.height / 2;
v3._x = -(Stage.width / 2);
v3._y = -(Stage.height / 2);
v3.father = v4;
var v5 = new flash.display.BitmapData(Stage.width, Stage.height, true, 0);
v5.draw(_root);
v3.attachBitmap(v5, v3.getNextHighestDepth());
v3._alpha = 40;
v3.onEnterFrame = function () {
this._xscale -= (this._xscale - 200) / 20;
this._yscale -= (this._yscale - 200) / 20;
this._alpha -= this._alpha / 5;
if (Math.floor(this._alpha) < 3) {
this.father.removeMovieClip();
}
};
}
MovieClip.prototype.cx = function () {
if (this.hit) {
return this._x + this.hit._width / 2;
}
return this._x + this._width / 2;
};
MovieClip.prototype.cy = function () {
if (this.hit) {
return this._y + this.hit._height / 2;
}
return this._y + this._height / 2;
};
MovieClip.prototype.fire_ray = function (xp, yp, forward, targs, accuracy, offset, style) {
if (!offset) {
offset = 0;
}
if (!style) {
style = [16777215, 1];
}
var v5 = create(projectile);
v5.lineStyle(style[1], style[0], rand(30, 60));
v5.timer = 2;
v5.onEnterFrame = function () {
this.timer -= 1;
if (this.timer < 1) {
this.removeMovieClip();
}
};
var v9 = Math.atan2(yp - this.cy(), xp - this.cx()) + (offset / 180) * Math.PI;
var v4 = this.cx() + Math.cos(this.anchor) * forward;
var v3 = this.cy() + Math.sin(this.anchor) * forward;
v5._x = v4;
v5._y = v3;
var v7 = 0;
while (v7 < 800 / accuracy) {
v4 += Math.cos(v9) * accuracy;
v3 += Math.sin(v9) * accuracy;
for (var v10 in targs) {
var v2 = targs[v10];
if (v4 > v2._x && v4 < v2._x + v2.hit._width) {
if (v3 > v2._y && v3 < v2._y + v2.hit._height) {
v5.lineTo(v4 - v5._x, v3 - v5._y);
return v2;
}
}
}
for (v10 in collides) {
v2 = collides[v10];
if (v4 > v2._x && v4 < v2._x + v2.hit._width) {
if (v3 > v2._y && v3 < v2._y + v2.hit._height) {
v5.lineTo(v4 - v5._x, v3 - v5._y);
if (!v2.struck) {
trees += 1;
v2.struck = true;
}
return undefined;
}
}
}
if (v4 < 0 || v4 > 800 || v3 < 0 || v3 > 800) {
v5.lineTo(v4 - v5._x, v3 - v5._y);
return undefined;
}
++v7;
}
v5.lineTo(v4 - v5._x, v3 - v5._y);
return undefined;
};
MovieClip.prototype.array_remove = function (ar) {
var v2 = 0;
while (v2 < ar.length) {
if (this == ar[v2]) {
ar.splice(v2, 1);
}
++v2;
}
};
MovieClip.prototype.hidden = function () {
this._visible = true;
if (world._x + this._x + this._width < 0) {
this._visible = false;
}
if (world._x + this._x - this._width > Stage.width) {
this._visible = false;
}
if (world._y + this._y + this._height < 0) {
this._visible = false;
}
if (world._y + this._y - this._height > Stage.height) {
this._visible = false;
}
};
var alerts = [];
MovieClip.prototype.distort = function (amount) {
this._x += rand(-amount, amount);
this._y += rand(-amount, amount);
};
pause_screen = function () {
var v3 = new flash.display.BitmapData(Stage.width, Stage.height);
v3.draw(_root);
var v2 = create(_root, 'pause');
v2.base.attachBitmap(v3, v2.base.getNextHighestDepth());
v2.base.filters = [new flash.filters.BlurFilter(8, 8, 2)];
v2.mm.onPress = function () {
exit();
};
return v2;
};
credits_screen = function () {
cinematic = true;
frozen = true;
var v4 = new flash.display.BitmapData(Stage.width, Stage.height);
v4.draw(_root);
var v3 = create(_root, 'credits');
v3.base.attachBitmap(v4, v3.base.getNextHighestDepth());
v3.base.filters = [new flash.filters.BlurFilter(8, 8, 2)];
v3.onEnterFrame = function () {
this.roll._y -= 2;
if (this.roll._y + this.roll._height < -50) {
cinematic = false;
frozen = false;
set_round(21);
this.removeMovieClip();
}
};
return v3;
};
MovieClip.prototype.explode = function (range, damage) {
playSound('explode', sd.data.sfxvol);
for (var v5 in enemies) {
var v2 = enemies[v5];
if (pythag(this._x, this._y, v2.cx(), v2.cy()) < v2.hit._width / 2 + range / 2) {
v2.bleed(rand(4, 8));
v2.health -= Math.round(damage + rand(-damage / 4, damage / 4));
v2.hitcooldown = 50;
}
}
var v6 = create(effects);
v6._x = this._x;
v6._y = this._y;
v6.timer = rand(8, 12);
v6.onEnterFrame = function () {
this.timer -= 1;
if (this.timer < 1) {
this.removeMovieClip();
}
var v2 = create(effects, 'explosion');
v2._x = this._x + rand(-(range / 4), range / 4);
v2._y = this._y + rand(-(range / 4), range / 4);
v2._width = rand(5, 10);
v2._height = v2._width;
v2.grow = rand(60, 100);
v2.expire = rand(5, 10);
v2.filters = [new flash.filters.BlurFilter(7, 7, 1)];
v2._alpha = rand(60, 80);
v2.gotoAndStop(rand(1, 4));
v2.onEnterFrame = function () {
this._width -= (this._width - this.grow) / this.expire;
this._height = this._width;
this._alpha -= this._alpha / this.expire;
if (Math.floor(this._alpha) < 3) {
this.removeMovieClip();
}
};
};
};
}
frame 4 {
var professional = false;
var frozen = false;
var cinematic = false;
var enemies = [];
var units = [];
var remaining_kills = 0;
var current_enemies = 0;
var temp_kills = 0;
var gameTime = 0;
}
frame 4 {
var world = create();
var terrain = create(world);
var remains = create(world);
var objects = create(world);
var projectile = create(world);
var mobiles = create(world);
var effects = create(world);
var structure = create(world);
var special = create(world);
var limit = create(world, 'limit');
var dark = create();
var hud_container = create();
var arena = new flash.display.BitmapData(800, 800, true, 0);
remains.attachBitmap(arena, remains.getNextHighestDepth());
}
frame 4 {
MovieClip.prototype.bleed = function (inten) {
var v5 = random(360);
var v3 = 0;
while (v3 < inten) {
var v2 = create(effects, 'blood');
v2.cacheAsBitmap = true;
v2._x = this.cx();
v2._y = this.cy();
v2.anchor = (v5 + rand(-20, 20)) * Math.PI / 180;
v2._rotation = v2.anchor * 180 / Math.PI;
v2.v = rand(4, 8);
v2.onEnterFrame = function () {
if (!frozen) {
this._x += Math.cos(this.anchor) * this.v;
this._y += Math.sin(this.anchor) * this.v;
this.v -= this.v / 12;
this._alpha -= this._alpha / 10;
if (Math.floor(this._alpha) < 2) {
this.removeMovieClip();
}
}
};
++v3;
}
v3 = 0;
while (v3 < Math.ceil(inten / 4)) {
v2 = create(remains, 'ground_blood');
v2._x = this.cx() + rand(-(this.hit._width / 2), this.hit._width / 2);
v2._y = this.cy() + rand(-(this.hit._height / 2), this.hit._height / 2);
v2._width = this.hit._width + rand(this.hit._width / 10, this.hit._width / 5);
v2._height = v2._width;
v2._alpha = rand(5, 50);
v2._rotation = random(360);
v2.puddle.gotoAndStop(rand(1, 30));
++v3;
}
refresh_field();
};
MovieClip.prototype.haste = function () {
this.hasted = true;
this.sheet.speed *= 2;
this.sheet.cooldown /= 2;
Math.round(this.sheet.cooldown);
var v2 = create(effects, 'haste_effect');
v2._x = this.cx();
v2._y = this.cy();
var mc = this;
var v3 = new flash.filters.GlowFilter(16763904, 100, 6, 6, 1, 2);
this.filters = [v3];
v2.onEnterFrame = function () {
this._x = mc.cx();
this._y = mc.cy();
if (this._currentframe >= 60) {
this.removeMovieClip();
}
};
};
}
frame 4 {
function unit() {
var mc = create(mobiles, 'player');
units.push(mc);
mc.sheet = [];
mc.sheet.speed = 4;
mc.sheet.health = 100;
mc.anchor = 0;
mc.half_pointer = create(world);
mc.half_pointer._x = mc.cx();
mc.half_pointer._y = mc.cy();
mc.money = 0;
mc.backpack = sd.data.inventory;
mc.stars = 0;
mc.equip = [];
mc.equip.weapon = mc.backpack[0];
mc.cooldown = 0;
mc.reload_time = 0;
mc.reloading = false;
mc.maxhp = mc.sheet.health;
mc.walking = false;
mc.firing = false;
mc.qdown = false;
mc.pdown = false;
mc.screen = undefined;
mc.disable = false;
mc.dead = false;
mc.onEnterFrame = function () {
sd.data.inventory = this.backpack;
if (!cinematic) {
if (Key.isDown(80) && !this.pdown) {
this.pdown = true;
if (frozen) {
frozen = false;
this.screen.removeMovieClip();
} else {
if (!frozen) {
frozen = true;
this.screen = pause_screen();
}
}
}
if (!Key.isDown(80)) {
this.pdown = false;
}
}
if (frozen) {
this.rota.stop();
}
if (!frozen && !this.disable) {
this.physics();
if (this.sheet.health < 1 && !this.dead) {
this.sheet.health = 0;
this.dead = true;
this.die();
}
this.anchor = Math.atan2(world._ymouse - this.cy(), world._xmouse - this.cx());
this.rota._rotation = this.anchor * 180 / Math.PI;
this.half_pointer._x = this.cx();
this.half_pointer._y = this.cy();
var v2 = pythag(this.half_pointer._x, this.half_pointer._y, world._xmouse, world._ymouse) / 4;
this.half_pointer._x += Math.cos(this.anchor) * v2;
this.half_pointer._y += Math.sin(this.anchor) * v2;
if (Key.isDown(87) || Key.isDown(38)) {
this._y -= 7;
this.walking = true;
}
if (Key.isDown(83) || Key.isDown(40)) {
this._y += 7;
this.walking = true;
}
if (Key.isDown(68) || Key.isDown(39)) {
this._x += 7;
this.walking = true;
}
if (Key.isDown(65) || Key.isDown(37)) {
this._x -= 7;
this.walking = true;
}
if (!Key.isDown(87) && !Key.isDown(83) && !Key.isDown(68) && !Key.isDown(65)) {
this.walking = false;
}
if (this.walking) {
this.rota.play();
} else {
this.rota.gotoAndStop(1);
}
if (this.walking) {
static_kills = 0;
}
if (Key.isDown(81) && !this.qdown) {
this.qdown = true;
this.next_weapon();
}
if (!Key.isDown(81)) {
if (this.equip.weapon[9] >= this.equip.weapon[10] && this.equip.weapon[8] < 5) {
upgrade(this.equip.weapon);
}
this.qdown = false;
}
if (this._x < 0) {
this._x = 0;
}
if (this._x + this.hit._width > 800) {
this._x = 800 - this.hit._width;
}
if (this._y < 0) {
this._y = 0;
}
if (this._y + this.hit._height > 800) {
this._y = 800 - this.hit._height;
}
if (this.sheet.health < 1) {
this.sheet.health = 0;
}
if (this.cooldown < this.equip.weapon[4]) {
this.cooldown += 1;
}
if (Key.isDown(69) && this.equip.weapon[2] != this.equip.weapon[3] && !this.reloading) {
if (this.get_ammo() != undefined && (this.get_ammo())[3] > 0) {
this.reloading = true;
}
}
if (this.reloading) {
this.reload_time += 1;
}
if (this.reload_time == this.equip.weapon[5]) {
this.reloading = false;
this.reload_time = 0;
this.reload();
}
if (this.firing) {
this.attack();
var v3 = this.get_ammo();
if (this.equip.weapon[2] < 1 && v3 != undefined && v3[3] > 0) {
this.reloading = true;
}
}
}
};
mc.attack = function () {
var v7 = this.equip.weapon[1];
var w = this.equip.weapon;
if (this.cooldown == w[4] && w[2] > 0 && !this.reloading) {
w[2] -= 1;
if (v7 != 'handgun') {
_root.kongregateStats.submit('Only Handgun', 0);
}
if (v7 == 'handgun') {
world.distort(3);
playSound('handgun_fire', sd.data.sfxvol);
var v8 = this.fire_ray(world._xmouse, world._ymouse, 50, enemies, 5, rand(-4, 4));
if (v8 != undefined) {
v8.bleed(rand(3, 5));
v8.health -= w[6];
v8.hitcooldown = 50;
player.equip.weapon[9] += 1;
if (v8.can_teleport) {
if (random(100) < 20) {
v8.teleporting = true;
}
}
}
}
if (v7 == 'shotgun') {
world.distort(6);
playSound('shotgun_fire', sd.data.sfxvol);
var v6 = 0;
var v4 = 0;
while (v4 < 6) {
v8 = this.fire_ray(world._xmouse, world._ymouse, 60, enemies, 10, rand(-12, 12));
if (v8 != undefined) {
v8.bleed(rand(3, 6));
if (v8.health <= w[6] && v8.health > 0) {
v6 += 1;
}
v8.health -= w[6];
v8.hitcooldown = 50;
player.equip.weapon[9] += 1;
if (v8.can_teleport) {
if (random(100) < 20) {
v8.teleporting = true;
}
}
}
++v4;
}
if (v6 >= 3) {
get_ach([6]);
}
}
if (v7 == 'machinegun') {
world.distort(2);
playSound('machinegun_fire', sd.data.sfxvol);
v8 = this.fire_ray(world._xmouse, world._ymouse, 60, enemies, 5, rand(-3, 3));
if (v8 != undefined) {
v8.bleed(rand(1, 3));
v8.health -= w[6];
v8.hitcooldown = 50;
player.equip.weapon[9] += 1;
if (v8.can_teleport) {
if (random(100) < 20) {
v8.teleporting = true;
}
}
}
}
if (v7 == 'laserbeam') {
world.distort(3);
playSound('laser_fire', sd.data.sfxvol);
v8 = this.fire_ray(world._xmouse, world._ymouse, 60, enemies, 5, rand(-3, 3), [13260, rand(2, 4)]);
if (v8 != undefined) {
v8.bleed(rand(1, 3));
v8.health -= w[6];
v8.hitcooldown = 50;
player.equip.weapon[9] += 1;
if (v8.can_teleport) {
if (random(100) < 20) {
v8.teleporting = true;
}
}
}
}
if (v7 == 'revolver') {
world.distort(7);
playSound('revolver_fire', sd.data.sfxvol);
v8 = this.fire_ray(world._xmouse, world._ymouse, 45, enemies, 5, rand(-2, 2));
if (v8 != undefined) {
v8.bleed(rand(5, 12));
v8.health -= w[6];
v8.hitcooldown = 50;
player.equip.weapon[9] += 1;
if (v8.can_teleport) {
if (random(100) < 20) {
v8.teleporting = true;
}
}
}
}
if (v7 == 'rocketlauncher') {
world.distort(10);
playSound('rocketlauncher_fire', sd.data.sfxvol);
var v5 = create(projectile, 'rocket');
v5._x = this.cx();
v5._y = this.cy();
v5._x += Math.cos(this.anchor) * 40;
v5._y += Math.sin(this.anchor) * 40;
v5.anchor = this.anchor;
v5._rotation = this.anchor * 180 / Math.PI;
v5.v = 6;
v5.onEnterFrame = function () {
this._x += Math.cos(this.anchor) * this.v;
this._y += Math.sin(this.anchor) * this.v;
this.v -= (this.v - 15) / 10;
for (var v4 in enemies) {
var v2 = enemies[v4];
if (pythag(this._x, this._y, v2.cx(), v2.cy()) < v2.hit._width / 2 + 15) {
v2.bleed(rand(6, 9));
v2.health -= w[6];
v2.hitcooldown = 50;
player.equip.weapon[9] += 1;
if (v2.can_teleport) {
if (random(100) < 20) {
v2.teleporting = true;
}
}
this.explode(w[6] * 4, w[6]);
this.removeMovieClip();
}
}
for (v4 in collides) {
var v3 = collides[v4];
if (this._x > v3._x && this._x < v3._x + v3.hit._width) {
if (this._y > v3._y && this._y < v3._y + v3.hit._height) {
this.explode(w[6] * 4, w[6]);
this.removeMovieClip();
}
}
}
if (this._x < 0 || this._x > 800 || this._y < 0 || this._y > 800) {
this.removeMovieClip();
}
};
}
this.cooldown = 0;
}
};
mc.get_ammo = function () {
var v3 = this.equip.weapon[1];
for (var v4 in this.backpack) {
var v2 = this.backpack[v4];
if (v2[2] == v3 && v2[1] == 'ammo') {
return v2;
}
}
return undefined;
};
mc.total_ammo = function () {
var v3 = 0;
for (var v4 in this.backpack) {
var v2 = this.backpack[v4];
if (v2[1] == 'ammo') {
v3 += v2[3];
}
if (v2[7] == 'weapon') {
v3 += v2[2];
}
}
for (v4 in ammos) {
v3 += ammos[v4].count;
}
return v3;
};
mc.search_inventory = function (what) {
for (var v2 in this.backpack) {
if (this.backpack[v2][0] == what) {
return this.backpack[v2];
}
}
return undefined;
};
mc.list_weapons = function () {
var v2 = [];
for (var v3 in this.backpack) {
if (this.backpack[v3][7] == 'weapon') {
v2.push(this.backpack[v3]);
}
}
v2.reverse();
return v2;
};
mc.next_weapon = function () {
if (!this.reloading && !this.firing) {
var v3 = this.list_weapons();
var v2 = 0;
while (v2 < v3.length) {
if (v3[v2] == this.equip.weapon) {
var v4 = v2;
}
++v2;
}
if (v4 + 1 >= v3.length) {
this.equip.weapon = v3[0];
} else {
this.equip.weapon = v3[v4 + 1];
}
mc.reloading = false;
mc.cooldown = 0;
}
};
mc.reload = function () {
var v3 = this.equip.weapon;
var v2 = this.get_ammo();
if (v2 != undefined && v2[3] > 0) {
var v4 = v3[3] - v3[2];
playSound('reload', sd.data.sfxvol);
if (v2[3] > v4) {
v2[3] -= v4;
v3[2] += v4;
} else {
v3[2] += v2[3];
v2[3] = 0;
if (v2[2] == 'handgun') {
v2[3] = rand(2, 5);
}
}
}
};
mc.hurt = function (damage) {
this.regen_timer = 30;
this.sheet.health -= damage;
this.bleed(damage);
hud.health.beep._alpha = 100;
};
mc.die = function () {
playSound('killed', sd.data.sfxvol);
var p = this;
this.disable = true;
this.rota.gotoAndStop(21);
camera.set_target(this);
var v3 = create(_root, 'red');
v3._alpha = 0;
this._visible = false;
v3.done = false;
v3.forward = false;
v3.onEnterFrame = function () {
if (!this.done) {
this._alpha -= (this._alpha - 120) / 20;
}
if (Math.ceil(this._alpha) > 99) {
this.done = true;
}
if (this.done && !this.forward) {
this.forward = true;
if (current > 20) {
exit();
} else {
p.sheet.health = player.maxhp;
p._visible = true;
p.disable = false;
p._x = random(800 - p.hit._width);
p._y = random(800 - p.hit._height);
p.dead = false;
p.sheet.health = 100;
a_kills = temp_kills;
for (var v2 in enemies) {
enemies[v2].die(false);
}
var v3 = Math.floor(current / 5) * 5;
if (v3 + 1 > current) {
v3 -= 1;
}
set_round(v3 + 1, true);
camera.set_target(p, true);
camera.set_target(p.half_pointer);
}
}
if (this.done && this.forward) {
this._alpha -= this._alpha / 5;
if (Math.floor(this._alpha) < 2) {
this.removeMovieClip();
}
}
};
};
return mc;
}
}
frame 4 {
var ammos = [];
var exclusive_warning = false;
MovieClip.prototype.drop = function (types, chance) {
var ob = types[random(types.length)];
if (random(100) + 1 <= 15) {
ob = 'healthpack';
}
if (random(100) + 1 <= chance) {
if (ob == 'healthpack') {
var v3 = create(objects, 'healthpack');
v3.style = 'pack';
}
if (ob == 'ammo_handgun') {
if (player.search_inventory('Beretta 92') == undefined) {
v3 = create(objects, 'handgun_pickup');
v3.style = 'weapon';
} else {
v3 = create(objects, ob);
v3.style = 'box';
}
v3.count = rand(Math.round(weapon.Beretta 92[3]), weapon.Beretta 92[3] * 2);
ammos.push(v3);
}
if (ob == 'ammo_laserbeam') {
if (player.search_inventory('Crescent Laser') == undefined) {
v3 = create(objects, 'laserbeam_pickup');
v3.style = 'weapon';
} else {
v3 = create(objects, ob);
v3.style = 'box';
}
if (exclusive_warning) {
v3.removeMovieClip();
}
v3.count = rand(Math.round(weapon.Crescent Laser[3]), weapon.Crescent Laser[3] * 2);
ammos.push(v3);
}
if (ob == 'ammo_shotgun') {
if (player.search_inventory('Beretta Silver Pigeon') == undefined) {
v3 = create(objects, 'shotgun_pickup');
v3.style = 'weapon';
} else {
v3 = create(objects, ob);
v3.style = 'box';
}
v3.count = rand(Math.round(weapon.Beretta Silver Pigeon[3]), weapon.Beretta Silver Pigeon[3] * 2);
ammos.push(v3);
}
if (ob == 'ammo_machinegun') {
if (player.search_inventory('Beretta M12') == undefined) {
v3 = create(objects, 'machinegun_pickup');
v3.style = 'weapon';
} else {
v3 = create(objects, ob);
v3.style = 'box';
}
v3.count = rand(Math.round(weapon.Beretta M12[3]), weapon.Beretta M12[3] * 2);
ammos.push(v3);
}
if (ob == 'ammo_revolver') {
if (player.search_inventory('Colt Python') == undefined) {
v3 = create(objects, 'revolver_pickup');
v3.style = 'weapon';
} else {
v3 = create(objects, ob);
v3.style = 'box';
}
v3.count = rand(Math.round(weapon.Colt Python[3]), weapon.Colt Python[3] * 2);
ammos.push(v3);
}
if (ob == 'ammo_rocketlauncher') {
if (player.search_inventory('Panzerfaust 3') == undefined) {
v3 = create(objects, 'rocketlauncher_pickup');
v3.style = 'weapon';
} else {
v3 = create(objects, ob);
v3.style = 'box';
}
v3.count = rand(Math.round(weapon.Panzerfaust 3[3]), weapon.Panzerfaust 3[3] * 2);
ammos.push(v3);
}
v3._x = this.cx();
v3._y = this.cy();
v3.v = rand(3, 8);
v3.an = (random(360) / 180) * Math.PI;
v3.rota._rotation = random(360);
v3.r = rand(-40, 40);
v3.touching = false;
v3.reject = false;
v3.onEnterFrame = function () {
this.hidden();
if (!frozen) {
this._x += Math.cos(this.an) * this.v;
this._y += Math.sin(this.an) * this.v;
this.v -= this.v / 10;
this.rota._rotation += this.r;
this.r -= this.r / 10;
if (pythag(this.cx(), this.cy(), player.cx(), player.cy()) < this.hit._width / 2 + player.hit._width / 2) {
this.pickup();
} else {
this.touching = false;
}
if (this.cx() < 0 || this.cx() > 800 || this.cy() < 0 || this.cy() > 800) {
this.array_remove(ammos);
this.removeMovieClip();
}
if (this.style == 'weapon') {
if (ob == 'ammo_handgun') {
if (player.search_inventory('Beretta 92') != undefined) {
this.style = 'ammo';
}
}
if (ob == 'ammo_shotgun') {
if (player.search_inventory('Beretta Silver Pigeon') != undefined) {
this.style = 'ammo';
}
}
if (ob == 'ammo_machinegun') {
if (player.search_inventory('Beretta M12') != undefined) {
this.style = 'ammo';
}
}
if (ob == 'ammo_revolver') {
if (player.search_inventory('Colt Python') != undefined) {
this.style = 'ammo';
}
}
if (ob == 'ammo_rocketlauncher') {
if (player.search_inventory('Panzerfaust 3') != undefined) {
this.style = 'ammo';
}
}
if (ob == 'ammo_laserbeam') {
if (player.search_inventory('Crescent Laser') != undefined) {
this.style = 'ammo';
}
}
}
if (this.v > 0.5) {
for (var v3 in collides) {
var v2 = collides[v3];
if (this._x + this.hit._width > v2._x && this._x < v2._x + v2.hit._width) {
if (this._y + this.hit._height > v2._y && this._y < v2._y + v2.hit._height) {
this.array_remove(ammos);
this.removeMovieClip();
}
}
}
}
}
};
v3.pickup = function () {
this.touching = true;
if (ob == 'healthpack') {
var v3 = random(25) + 25;
player.sheet.health += v3;
alert(v3 + ' health restored');
if (player.sheet.health > 100) {
player.sheet.health = 100;
}
}
if (this.style == 'weapon') {
if (ob == 'ammo_handgun') {
alert('Picked up <font color=\'#65CCFF\'>Beretta 92</font>');
this.array_remove(ammos);
player.backpack.push(weapon.Beretta 92);
}
if (ob == 'ammo_shotgun') {
alert('Picked up <font color=\'#65CCFF\'>Beretta Silver Pigeon</font>');
this.array_remove(ammos);
player.backpack.push(weapon.Beretta Silver Pigeon);
}
if (ob == 'ammo_machinegun') {
alert('Picked up <font color=\'#65CCFF\'>Beretta M12</font>');
this.array_remove(ammos);
player.backpack.push(weapon.Beretta M12);
}
if (ob == 'ammo_revolver') {
alert('Picked up <font color=\'#65CCFF\'>Colt Python</font>');
this.array_remove(ammos);
player.backpack.push(weapon.Colt Python);
}
if (ob == 'ammo_rocketlauncher') {
alert('Picked up <font color=\'#65CCFF\'>Panzerfaust 3</font>');
this.array_remove(ammos);
player.backpack.push(weapon.Panzerfaust 3);
get_ach([7]);
}
if (ob == 'ammo_laserbeam') {
if (!exclusive) {
if (!this.reject) {
alert('Crescent Laser is exclusive to Hysteria Studios users who are logged in');
this.reject = true;
delete this.onEnterFrame;
exclusive_warning = true;
}
} else {
alert('Picked up <font color=\'#65CCFF\'>Crescent Laser</font>');
this.array_remove(ammos);
player.backpack.push(weapon.Crescent Laser);
get_ach([13]);
}
}
if (!this.reject) {
playSound('weapon', sd.data.sfxvol);
}
} else {
if (ob == 'ammo_handgun') {
var v2 = player.search_inventory('Handgun Ammo');
if (v2 != undefined) {
v2[3] += this.count;
} else {
player.backpack.push(['Handgun Ammo', 'ammo', 'handgun', this.count]);
}
alert('Picked up ' + this.count + ' <font color=\'#65CCFF\'>Handgun Ammo</font>');
this.array_remove(ammos);
}
if (ob == 'ammo_shotgun') {
v2 = player.search_inventory('Shotgun Ammo');
if (v2 != undefined) {
v2[3] += this.count;
} else {
player.backpack.push(['Shotgun Ammo', 'ammo', 'shotgun', this.count]);
}
alert('Picked up ' + this.count + ' <font color=\'#65CCFF\'>Shotgun Ammo</font>');
this.array_remove(ammos);
}
if (ob == 'ammo_machinegun') {
v2 = player.search_inventory('Machinegun Ammo');
if (v2 != undefined) {
v2[3] += this.count;
} else {
player.backpack.push(['Machinegun Ammo', 'ammo', 'machinegun', this.count]);
}
alert('Picked up ' + this.count + ' <font color=\'#65CCFF\'>Machinegun Ammo</font>');
this.array_remove(ammos);
}
if (ob == 'ammo_revolver') {
v2 = player.search_inventory('Revolver Ammo');
if (v2 != undefined) {
v2[3] += this.count;
} else {
player.backpack.push(['Revolver Ammo', 'ammo', 'revolver', this.count]);
}
alert('Picked up ' + this.count + ' <font color=\'#65CCFF\'>Revolver Ammo</font>');
this.array_remove(ammos);
}
if (ob == 'ammo_rocketlauncher') {
v2 = player.search_inventory('Rockets');
if (v2 != undefined) {
v2[3] += this.count;
} else {
player.backpack.push(['Rockets', 'ammo', 'rocketlauncher', this.count]);
}
if (this.count == 1) {
alert('Picked up 1 <font color=\'#65CCFF\'>Rocket</font>');
} else {
alert('Picked up ' + this.count + ' <font color=\'#65CCFF\'>Rockets</font>');
}
this.array_remove(ammos);
}
if (ob == 'ammo_laserbeam') {
if (!exclusive) {
if (!this.reject) {
alert('Laser Fuel is exclusive to Hysteria Studios users who are logged in');
this.reject = true;
delete this.onEnterFrame;
this.cacheAsBitmap = true;
exclusive_warning = true;
}
} else {
v2 = player.search_inventory('Laser Fuel');
if (v2 != undefined) {
v2[3] += this.count;
} else {
player.backpack.push(['Laser Fuel', 'ammo', 'laserbeam', this.count]);
}
alert('Picked up ' + Math.round(this.count * 2) + '% <font color=\'#65CCFF\'>Laser Fuel</font>');
this.array_remove(ammos);
}
}
if (!this.reject) {
playSound('bullets', sd.data.sfxvol);
}
}
if (!this.reject) {
this.removeMovieClip();
}
};
}
};
}
frame 4 {
function newenemy(type, summon) {
var v2 = create(mobiles, type);
enemies.push(v2);
units.push(v2);
v2.sheet = [];
v2.long = false;
if (type == 'rat') {
v2.sheet.health = Math.round(4 * round[current][3]);
v2.sheet.damage = Math.round(3 * round[current][3]);
v2.sheet.speed = 2.2 * round[current][4];
v2.sheet.cooldown = 10;
}
if (type == 'zombie') {
v2.sheet.health = Math.round(7 * round[current][3]);
v2.sheet.damage = Math.round(6 * round[current][3]);
v2.sheet.speed = 1.7 * round[current][4];
v2.sheet.cooldown = 14;
}
if (type == 'mummy') {
v2.sheet.health = Math.round(13 * round[current][3]);
v2.sheet.damage = Math.round(9 * round[current][3]);
v2.sheet.speed = 1.5 * round[current][4];
v2.sheet.cooldown = 17;
}
if (type == 'acolyte') {
v2.sheet.health = Math.round(11 * round[current][3]);
v2.sheet.damage = Math.round(6 * round[current][3]);
v2.sheet.speed = 1.6 * round[current][4];
v2.sheet.cooldown = 12;
v2.cast_timer = 140;
}
if (type == 'hell_hound') {
v2.sheet.health = Math.round(14 * round[current][3]);
v2.sheet.damage = Math.round(8 * round[current][3]);
v2.sheet.speed = 2.1 * round[current][4];
v2.sheet.cooldown = 14;
v2.cast_timer = 300;
}
if (type == 'archer') {
v2.sheet.health = Math.round(13 * round[current][3]);
v2.sheet.damage = Math.round(6 * round[current][3]);
v2.sheet.speed = 1.5 * round[current][4];
v2.sheet.cooldown = 50;
v2.long = true;
v2.walking = true;
}
if (type == 'bouvine') {
v2.sheet.health = Math.round(35 * round[current][3]);
v2.sheet.damage = Math.round(6 * round[current][3]);
v2.sheet.speed = 1.2 * round[current][4];
v2.sheet.cooldown = 12;
}
if (!summon) {
v2.place_outside();
}
v2.health = v2.sheet.health;
v2.anchor = 0;
v2.bar = v2.healthbar();
v2.cooldown = v2.sheet.cooldown;
v2.hitcooldown = 0;
v2.onEnterFrame = function () {
this.enemyAI_melee();
this.physics();
this.hidden();
if (this.hitcooldown > 0) {
this.hitcooldown -= 1;
}
if (frozen) {
this.rota.stop();
}
if (!frozen) {
this.bar._x = this._x + this.hit._width / 2;
this.bar._y = this._y - 5;
this.bar.gotoAndStop(Math.round((this.health / this.sheet.health) * 100));
if (!sd.data.showbars) {
this.bar._visible = false;
} else {
this.bar._visible = true;
}
if (this.hitcooldown > 0) {
this.bar._visible = true;
}
if (type == 'acolyte') {
this.cast_timer -= 1;
if (this.cast_timer < 1) {
this.cast_timer = rand(150, 300);
this.bone_shot(20, Math.round(3 * round[current][3]), 5);
}
}
if (type == 'hell_hound') {
this.cast_timer -= 1;
if (this.cast_timer < 1) {
this.cast_timer = rand(300, 500);
this.fireball(Math.round(round[current][3] * 0.8), 20);
}
}
if (type == 'archer') {
if (!this.walking) {
this.cooldown -= 1;
if (this.cooldown < 1) {
playSound('arrow', sd.data.sfxvol, true, [this.cx(), this.cy()]);
this.cooldown = this.sheet.cooldown + rand(-15, 15);
var v3 = create(projectile, 'bolt');
v3._x = this.cx();
v3._y = this.cy();
v3.anchor = this.anchor;
v3._rotation = this.anchor * 180 / Math.PI;
v3._x += Math.cos(this.anchor) * 20;
v3._y += Math.sin(this.anchor) * 20;
v3.onEnterFrame = function () {
this._x += Math.cos(this.anchor) * 12;
this._y += Math.sin(this.anchor) * 12;
if (pythag(this._x, this._y, player.cx(), player.cy()) < player.hit._width / 2 + 5) {
player.hurt(7);
this.removeMovieClip();
}
for (var v3 in collides) {
var v2 = collides[v3];
if (this._x > v2._x && this._x < v2._x + v2.hit._width) {
if (this._y > v2._y && this._y < v2._y + v2.hit._height) {
this.removeMovieClip();
}
}
}
if (this._x < 0 || this._x > 800 || this._y < 0 || this._y > 800) {
this.removeMovieClip();
}
};
}
}
}
if (this.health < 1) {
this.die(true);
}
}
};
v2.die = function (fromplayer) {
if (fromplayer) {
var v2 = 36;
if (type == 'rat') {
this.drop(['ammo_handgun'], v2);
player.equip.weapon[9] += 3;
}
if (type == 'zombie') {
this.drop(['ammo_handgun', 'ammo_machinegun'], v2);
player.equip.weapon[9] += 5;
playSound('moan', sd.data.sfxvol, true, [this._x, this._y]);
}
if (type == 'mummy') {
this.drop(['ammo_handgun', 'ammo_machinegun', 'ammo_shotgun', 'ammo_laserbeam'], v2);
player.equip.weapon[9] += 8;
playSound('moan', sd.data.sfxvol, true, [this._x, this._y]);
}
if (type == 'acolyte') {
this.drop(['ammo_handgun', 'ammo_machinegun', 'ammo_shotgun', 'ammo_revolver', 'ammo_laserbeam'], v2);
player.equip.weapon[9] += 11;
}
if (type == 'hell_hound') {
this.drop(['ammo_machinegun', 'ammo_shotgun', 'ammo_revolver', 'ammo_rocketlauncher', 'ammo_laserbeam'], v2);
player.equip.weapon[9] += 14;
playSound('bark', sd.data.sfxvol, true, [this._x, this._y]);
}
if (type == 'archer') {
this.drop(['ammo_shotgun', 'ammo_revolver', 'ammo_rocketlauncher', 'ammo_laserbeam'], v2);
player.equip.weapon[9] += 17;
}
if (type == 'bouvine') {
this.drop(['ammo_handgun', 'ammo_machinegun', 'ammo_shotgun', 'ammo_revolver', 'ammo_rocketlauncher', 'ammo_laserbeam'], v2);
player.equip.weapon[9] += 22;
playSound('moo', sd.data.sfxvol, true, [this._x, this._y]);
cow_kills += 1;
}
a_kills += 1;
static_kills += 1;
}
this.array_remove(units);
this.array_remove(enemies);
this.bar.removeMovieClip();
current_enemies -= 1;
if (!bossrnd && !summon) {
remaining_kills -= 1;
}
this.removeMovieClip();
};
if (!summon) {
++current_enemies;
}
return v2;
}
MovieClip.prototype.place_outside = function () {
var v2 = rand(1, 4);
if (v2 == 1) {
this._x = -300 - this.hit._width;
this._y = rand(-150 - this.hit._height, 950);
}
if (v2 == 3) {
this._x = 1100;
this._y = rand(-150 - this.hit._height, 950);
}
if (v2 == 2) {
this._y = -300 - this.hit._height;
this._x = rand(-150 - this.hit._height, 950);
}
if (v2 == 4) {
this._y = 1100;
this._x = rand(-150 - this.hit._height, 950);
}
};
MovieClip.prototype.healthbar = function () {
var v2 = create(special, 'hpbar');
v2.cacheAsBitmap = true;
v2._x = this.hit._width / 2;
v2._y = -5;
if (!sd.data.showbars) {
v2._visible = false;
}
return v2;
};
MovieClip.prototype.enemyAI_melee = function () {
if (!frozen) {
this.anchor = Math.atan2(player.cy() - this.cy(), player.cx() - this.cx());
this.rota._rotation = this.anchor * 180 / Math.PI;
if (!this.long) {
this._x += Math.cos(this.anchor) * this.sheet.speed;
this._y += Math.sin(this.anchor) * this.sheet.speed;
} else {
this.walking = true;
if (this._x > 10 && this._x < 790 && this._y > 10 && this._y < 790) {
if (pythag(this.cx(), this.cy(), player.cx(), player.cy()) < 300) {
this.walking = false;
}
}
if (this.walking) {
this._x += Math.cos(this.anchor) * this.sheet.speed;
this._y += Math.sin(this.anchor) * this.sheet.speed;
}
}
if (!this.long) {
if (pythag(this.cx(), this.cy(), player.cx(), player.cy()) < this.hit._width / 2 + player.hit._width / 2 + 10) {
this.cooldown -= 1;
if (this.cooldown < 1) {
this.cooldown = this.sheet.cooldown;
player.hurt(this.sheet.damage);
}
} else {
this.cooldown = this.sheet.cooldown;
}
}
}
};
}
frame 4 {
function newboss(type) {
var v3 = create(mobiles, type);
enemies.push(v3);
units.push(v3);
v3.sheet = [];
if (type == 'boss_5') {
v3.sheet.health = 220;
v3.sheet.speed = 2;
v3.sheet.cooldown = 16;
v3.sheet.damage = 12;
v3.casting = false;
v3.screenbar = v3.bossbar('Aiden', 'the Witchdoctor');
}
if (type == 'boss_10') {
v3.sheet.health = 390;
v3.sheet.speed = 2.2;
v3.sheet.cooldown = 6;
v3.sheet.damage = 5;
v3.casting = false;
v3.teleporting = false;
v3.tele_complete = false;
v3.can_teleport = true;
v3.boost_timer = 0;
v3.perm_speed = v3.sheet.speed;
v3.screenbar = v3.bossbar('Sanakhte Nebka', 'the Risen Pharaoh');
}
if (type == 'boss_15') {
v3.sheet.health = 650;
v3.sheet.speed = 2;
v3.sheet.cooldown = 5;
v3.sheet.damage = 5;
v3.casting = false;
v3.screenbar = v3.bossbar('Fenrisulfr', 'the Hellhound');
}
if (type == 'boss_20') {
v3.sheet.health = 1300;
v3.sheet.speed = 2;
v3.sheet.cooldown = 12;
v3.sheet.damage = 16;
v3.casting = false;
v3.screenbar = v3.bossbar('Terra', 'the Immortal');
v3.summon_timer = 200;
}
v3.place_outside();
v3.health = v3.sheet.health;
v3.anchor = Math.atan2(player.cy() - v3.cy(), player.cx() - v3.cx());
v3.rota._rotation = v3.anchor * 180 / Math.PI;
v3.spellcooldown = 200;
v3.cast_timer = 10;
v3.cooldown = v3.sheet.cooldown;
v3.onEnterFrame = function () {
if (!frozen) {
this.physics();
this.anchor = Math.atan2(player.cy() - this.cy(), player.cx() - this.cx());
this.rota._rotation = this.anchor * 180 / Math.PI;
if (type == 'boss_5') {
this.spellcooldown -= 1;
if (this.spellcooldown < 1) {
this.spellcooldown = rand(40, 90);
this.bone_shot(60, 6, 3);
}
if (!this.casting) {
this._x += Math.cos(this.anchor) * this.sheet.speed;
this._y += Math.sin(this.anchor) * this.sheet.speed;
}
}
if (type == 'boss_10') {
this.spellcooldown -= 1;
if (this.spellcooldown < 1) {
if (random(100) < 50) {
this.boost_timer = 100;
} else {
this.cast_timer = 30;
this.casting = true;
}
this.spellcooldown = rand(300, 400);
}
if (this.boost_timer > 0) {
this.boost_timer -= 1;
this.sheet.speed -= (this.sheet.speed - 5) / 10;
} else {
this.sheet.speed -= (this.sheet.speed - this.perm_speed) / 10;
}
if (this.casting) {
this.cast_timer -= 1;
if (this.cast_timer < 1) {
this.cast_timer = 10;
this.casting = false;
var v2 = [];
for (var v3 in enemies) {
if (enemies[v3] != this && !enemies[v3].hasted) {
v2.push(enemies[v3]);
}
}
var v4 = v2[random(v2.length)];
v4.haste();
}
}
if (!this.casting && !this.teleporting) {
this._x += Math.cos(this.anchor) * this.sheet.speed;
this._y += Math.sin(this.anchor) * this.sheet.speed;
}
if (this.teleporting) {
this._x += Math.cos(this.anchor) * (this.sheet.speed / 3);
this._y += Math.sin(this.anchor) * (this.sheet.speed / 3);
}
if (this.teleporting) {
if (!this.tele_complete) {
this._alpha -= this._alpha / 5;
if (Math.floor(this._alpha) < 5) {
this._x = rand(100, 700);
this._y = rand(100, 700);
this.tele_complete = true;
}
} else {
this._alpha -= (this._alpha - 100) / 8;
if (Math.ceil(this._alpha) > 97) {
this._alpha = 100;
this.teleporting = false;
this.tele_complete = false;
}
}
}
}
if (type == 'boss_15') {
if (!this.casting) {
this._x += Math.cos(this.anchor) * this.sheet.speed;
this._y += Math.sin(this.anchor) * this.sheet.speed;
}
this.spellcooldown -= 1;
if (this.spellcooldown < 1) {
this.spellcooldown = rand(100, 200);
this.fireball(5, 12);
}
}
if (type == 'boss_20') {
if (!this.casting) {
this._x += Math.cos(this.anchor) * this.sheet.speed;
this._y += Math.sin(this.anchor) * this.sheet.speed;
}
this.spellcooldown -= 1;
if (this.spellcooldown < 1) {
this.spellcooldown = rand(10, 100);
this.fireball(3, 12);
}
this.summon_timer -= 1;
if (this.summon_timer < 1) {
this.summon_timer = rand(10, 100);
this.bone_shot(30, 6, 6);
}
}
if (this.health < 1) {
this.die(true);
splash();
}
if (pythag(this.cx(), this.cy(), player.cx(), player.cy()) < this.hit._width / 2 + player.hit._width / 2 + 5) {
this.cooldown -= 1;
if (this.cooldown < 1) {
this.cooldown = this.sheet.cooldown;
player.hurt(this.sheet.damage);
}
}
}
};
v3.die = function (fromplayer) {
this.array_remove(enemies);
this.array_remove(units);
if (fromplayer && type != 'boss_20') {
set_round(current + 1);
}
bosstarg = undefined;
if (fromplayer) {
var v3 = 0;
while (v3 < rand(5, 7)) {
if (type == 'boss_5') {
this.drop(['ammo_handgun', 'ammo_machinegun'], 100);
}
if (type == 'boss_10') {
this.drop(['ammo_machinegun', 'ammo_shotgun'], 100);
}
if (type == 'boss_15') {
this.drop(['ammo_shotgun', 'ammo_revolver'], 100);
}
++v3;
}
if (type == 'boss_20') {
get_ach([8]);
_root.kongregateStats.submit('Game Completed', 1);
_root.kongregateStats.submit('Game Time', gameTime);
setTimeout(credits_screen, 5000);
}
}
this.screenbar.removeMovieClip();
this.removeMovieClip();
};
return v3;
}
MovieClip.prototype.bossbar = function (str, job) {
var v2 = create(hud_container, 'bossbar');
v2.cacheAsBitmap = true;
v2._x = Stage.width / 2;
v2._y = 10;
v2._alpha = 0;
v2.father = this;
v2.comp = false;
v2.gotoAndStop(200);
v2.str.text = str;
v2.job.text = job;
v2.onEnterFrame = function () {
this.gotoAndStop(Math.round((this.father.health / this.father.sheet.health) * 200));
if (this.comp) {
this._alpha -= this._alpha / 10;
if (Math.floor(this._alpha) < 3) {
this.removeMovieClip();
}
} else {
this._alpha -= (this._alpha - 100) / 10;
}
};
return v2;
};
MovieClip.prototype.bone_shot = function (count, damage, spin) {
var v2 = create(objects);
v2._x = this.cx();
v2._y = this.cy();
playSound('spike', sd.data.sfxvol, true, [v2._x, v2._y]);
v2.anchor = this.anchor;
v2.count = count;
v2.timer = 2;
v2.swirl = rand(-spin, spin);
v2.onEnterFrame = function () {
if (!frozen) {
this.timer -= 1;
if (this.timer < 1) {
this.timer = 2;
this.count -= 1;
if (this.count > 0) {
this.anchor += (this.swirl / 180) * Math.PI;
this._x += Math.cos(this.anchor) * 15;
this._y += Math.sin(this.anchor) * 15;
var v2 = create(objects, 'effects_bone');
v2._x = this._x;
v2._y = this._y;
v2.used = false;
v2.onEnterFrame = function () {
if (!frozen) {
if (this._currentframe > 13) {
this.removeMovieClip();
}
if (!this.used && this._x > player._x && this._x < player._x + player.hit._width) {
if (this._y > player._y && this._y < player._y + player.hit._width) {
this.used = true;
player.hurt(damage);
}
}
}
};
} else {
this.removeMovieClip();
}
}
}
};
};
MovieClip.prototype.fireball = function (damage, speed) {
var v3 = create(projectile, 'fireball');
v3._x = this.cx();
v3._y = this.cy();
playSound('fireballsound', sd.data.sfxvol, true, [v3._x, v3._y]);
v3.anchor = this.anchor;
v3._rotation = this.anchor * 180 / Math.PI;
v3.smoketimer = 3;
v3.onEnterFrame = function () {
this._x += Math.cos(this.anchor) * speed;
this._y += Math.sin(this.anchor) * speed;
if (pythag(this._x, this._y, player._x, player._y) < player.hit._width / 2 + 25) {
player.hurt(damage);
}
this.smoketimer -= 1;
if (this.smoketimer < 1) {
this.smoketimer = 3;
var v4 = create(objects, 'smoke');
v4._x = this._x;
v4._y = this._y;
}
for (var v3 in collides) {
var v2 = collides[v3];
if (this._x > v2._x && this._x < v2._x + v2.hit._width) {
if (this._y > v2._y && this._y < v2._y + v2.hit._height) {
this.removeMovieClip();
}
}
}
if (this._x < -50 || this._x > 850 || this._y < -50 || this._y > 850) {
this.removeMovieClip();
}
};
};
}
frame 4 {
var camera = create();
camera.follow = undefined;
camera.set_target = function (t, forced) {
this.follow = t;
if (forced) {
this.force(this.targ_distance(), this.targ_angle());
}
};
camera.targ_distance = function () {
var v3 = world._x + this.follow.cx() - Stage.width / 2;
var v2 = world._y + this.follow.cy() - Stage.height / 2;
return Math.sqrt(v3 * v3 + v2 * v2);
};
camera.targ_angle = function () {
var v3 = world._x + this.follow.cx() - Stage.width / 2;
var v2 = world._y + this.follow.cy() - Stage.height / 2;
return Math.atan2(v2, v3);
};
camera.force = function (p, a) {
world._x -= Math.cos(a) * p;
world._y -= Math.sin(a) * p;
};
camera.onEnterFrame = function () {
if (!frozen || cinematic) {
if (this.follow != undefined) {
var v2 = this.targ_distance() / 12;
this.force(v2, this.targ_angle());
}
}
};
}
frame 4 {
var hud = create(hud_container, 'hud');
hud.health.beep._alpha = 0;
hud.onEnterFrame = function () {
this.ammo.ammo_up.gotoAndStop(player.equip.weapon[2] + 1);
this.ammo.ammo_down.gotoAndStop(player.equip.weapon[3] + 1);
var v5 = player.equip.weapon;
var v6 = (player.get_ammo())[3];
if (v6) {
this.totalammo.text = v6;
} else {
this.totalammo.text = 0;
}
this.health.style.gotoAndStop(Math.round((player.sheet.health / player.maxhp) * 1000) + 1);
this.health.bar.gotoAndStop(Math.round((player.sheet.health / player.maxhp) * 1000) + 1);
this.health.beep._alpha -= this.health.beep._alpha / 5;
this.wepname.text = v5[0];
this.ach.text = player.stars;
this.kills.text = a_kills + ' Kills';
this.kill.kills.text = remaining_kills;
this.kill._visible = true;
if (bossrnd || current > 20) {
this.kill._visible = false;
}
if (!frozen) {
gameTime += 1;
}
var v7 = v5[1];
var v3 = [];
v3.handgun = 1;
v3.shotgun = 2;
v3.machinegun = 3;
v3.revolver = 4;
v3.rocketlauncher = 5;
v3.laserbeam = 6;
player.rota.gun.gotoAndStop(v3[v7]);
this.weapon.gotoAndStop(v3[v7]);
var v4 = 0;
var v2 = 0;
while (v2 < player.backpack.length) {
if (player.backpack[v2][1] == 'ammo') {
v4 += player.backpack[v2][3];
}
++v2;
}
if (v4 > 1000) {
get_ach([14]);
}
if (v5[8] < 5) {
this.tier.text = 'Tier ' + v5[8] + ' - ' + Math.round((v5[9] / v5[10]) * 1000) / 10 + '%';
} else {
this.tier.text = 'Exclusive';
}
};
}
frame 4 {
function set_round(val, reset) {
engine.spawntime = spawn_delay;
current = val;
remaining_kills = round[val][2];
if (sd.data.unlocked < val) {
sd.data.unlocked = val;
}
temp_kills = a_kills;
for (var v5 in bossrounds) {
if (val == bossrounds[v5]) {
bossrnd = true;
if (!reset) {
musicmc.changesong = true;
}
bosstarg = newboss('boss_' + val);
}
if (val == bossrounds[v5] + 1) {
bossrnd = false;
if (!reset) {
musicmc.changesong = true;
}
}
}
if (current <= 21) {
var v3 = create(hud, 'round');
}
v3.cacheAsBitmap = true;
v3._alpha = 0;
v3._x = Stage.width / 2;
v3._y = Stage.height / 2;
v3.comp = false;
v3.timer = 100;
if (current != 20) {
var v6 = Math.ceil(current / 5);
v3.round.text = 'Round ' + v6 + '-' + (5 - (v6 * 5 - current));
} else {
if (current == 5) {
v3.round.text = 'Aiden';
} else {
if (current == 10) {
v3.round.text = 'Sanakhte Nebka';
} else {
if (current == 15) {
v3.round.text = 'Fenrisulfr';
} else {
if (current == 20) {
v3.round.text = 'Terra';
}
}
}
}
}
if (current == 21) {
v3.round.text = 'Undead Bovine Survival!';
player.go_turret();
}
v3.onEnterFrame = function () {
if (!frozen) {
if (!this.comp) {
this._alpha -= (this._alpha - 100) / 12;
}
if (Math.ceil(this._alpha) > 95) {
this.comp = true;
}
if (this.comp) {
this.timer -= 1;
if (Math.floor(this._alpha) < 2) {
this.removeMovieClip();
}
}
if (this.timer < 1) {
this._alpha -= this._alpha / 5;
}
}
};
}
var round = [];
var bossrnd = false;
var bosstarg = undefined;
var spawn_delay = 2;
round[1] = [['rat'], 4, 8, 1, 1];
round[2] = [['rat'], 5, 10, 1.2, 1];
round[3] = [['rat', 'zombie'], 5, 10, 1.4, 1.1];
round[4] = [['rat', 'zombie'], 6, 12, 1.6, 1.1];
round[5] = [['rat', 'zombie'], 6, 0, 1.8, 1.1];
round[6] = [['rat', 'zombie', 'mummy'], 6, 14, 2, 1.2];
round[7] = [['rat', 'zombie', 'mummy'], 6, 16, 2.2, 1.2];
round[8] = [['zombie', 'mummy', 'acolyte'], 7, 16, 2.4, 1.3];
round[9] = [['zombie', 'mummy', 'acolyte'], 7, 18, 2.6, 1.3];
round[10] = [['zombie', 'mummy', 'acolyte'], 7, 0, 2.8, 1.3];
round[11] = [['zombie', 'mummy', 'acolyte'], 8, 20, 3, 1.4];
round[12] = [['zombie', 'mummy', 'acolyte', 'hell_hound'], 8, 22, 3.2, 1.4];
round[13] = [['zombie', 'mummy', 'acolyte', 'hell_hound'], 8, 22, 3.4, 1.5];
round[14] = [['zombie', 'mummy', 'acolyte', 'hell_hound'], 8, 24, 3.6, 1.5];
round[15] = [['hell_hound'], 5, 0, 3.8, 1.5];
round[16] = [['zombie', 'mummy', 'acolyte', 'hell_hound', 'archer'], 9, 26, 4, 1.6];
round[17] = [['zombie', 'mummy', 'acolyte', 'hell_hound', 'archer'], 9, 26, 4.2, 1.6];
round[18] = [['zombie', 'mummy', 'acolyte', 'hell_hound', 'archer'], 9, 28, 4.6, 1.7];
round[19] = [['acolyte', 'archer', 'hell_hound'], 10, 30, 4.8, 1.7];
round[20] = [['zombie'], 4, 0, 13, 1.7];
round[21] = [['bouvine', 'zombie'], 2, 1, 2.3, 1.3];
var i = 22;
while (i < 1000) {
var num = Math.ceil(i / 7);
round[i] = [['bouvine', 'zombie'], num, 1, i / 8, i / 15];
++i;
}
var bossrounds = [5, 10, 15, 20];
var engine = create();
engine.spawntime = spawn_delay;
engine.onEnterFrame = function () {
if (current_enemies < round[current][1]) {
this.spawntime -= 1;
} else {
this.spawntime = spawn_delay;
}
if (this.spawntime < 1) {
this.spawntime = spawn_delay;
var v2 = round[current][0];
newenemy(v2[random(v2.length)]);
}
if (remaining_kills < 1 && !bossrnd) {
set_round(current + 1);
}
};
}
frame 4 {
function exit() {
calm.stop();
boss.stop();
musicmc.removeMovieClip();
for (var v2 in _root) {
_root[v2].removeMovieClip();
}
_root.gotoAndStop(3);
}
var player = unit();
player._x = random(800 - player.hit._width);
player._y = random(800 - player.hit._height);
var darkness = create(dark, 'darkness');
darkness.cacheAsBitmap = true;
darkness._x = player.cx() + world._x;
darkness._y = player.cy() + world._y;
darkness.onEnterFrame = function () {
this._x = player.cx() + world._x;
this._y = player.cy() + world._y;
};
camera.set_target(player, true);
camera.set_target(player.half_pointer, false);
create(terrain, 'background');
create(remains, 'background');
var collides = [];
var treec = rand(3, 5);
var i = 0;
while (i < treec) {
tree(rand(-50, 750), rand(50, 750));
++i;
}
refresh_field();
set_round(current);
onMouseDown = function () {
player.firing = true;
if (player.equip.weapon[2] < 1) {
playSound('gun_empty', sd.data.sfxvol);
}
};
onMouseUp = function () {
player.firing = false;
};
var musicmc = create();
var calm = new Sound(musicmc);
var boss = new Sound(musicmc);
calm.attachSound('calm');
boss.attachSound('boss');
calm.setVolume(0);
calm.start(0, 9999);
boss.setVolume(0);
musicmc.curvol = 0;
musicmc.changesong = false;
musicmc.cursong = 'calm';
for (var i in bossrounds) {
if (current == bossrounds[i]) {
musicmc.changesong = true;
}
}
musicmc.onEnterFrame = function () {
if (!this.changesong) {
if (frozen && !cinematic) {
this.curvol -= (this.curvol - sd.data.musicvol / 10) / 10;
} else {
this.curvol -= (this.curvol - sd.data.musicvol / 2) / 10;
}
} else {
this.curvol -= this.curvol / 10;
if (Math.floor(this.curvol) < 2) {
this.changesong = false;
if (this.cursong == 'calm') {
calm.stop();
this.cursong = 'boss';
boss.start(0, 9999);
} else {
boss.stop();
this.cursong = 'calm';
calm.start(0, 9999);
}
}
}
calm.setVolume(Math.round(this.curvol));
boss.setVolume(Math.round(this.curvol));
};
trace(player.backpack);
trace(player.equip.weapon);
}
movieClip 421 black {
}