Frame 1
Stage.showMenu = false;
MochiAd.showPreGameAd({id:"29dbe5940873ef0c", res:"540x440"});
Frame 2
var sd = SharedObject.getLocal("DAZArena");
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, 14, 30, 3, "weapon", 1, 0, 160]);
s.push(["Handgun Ammo", "ammo", "handgun", 27]);
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]);
}
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];
}
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, 3, 6, 7, 4, 9, 11, 8];
function create(d, i) {
if (!d) {
d = _root;
}
if (!i) {
return(d.createEmptyMovieClip("empty", d.getNextHighestDepth()));
}
return(d.attachMovie(i, i + d.getNextHighestDepth(), d.getNextHighestDepth()));
}
function rand(min, max) {
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 _local4 = pythag(player.cx(), player.cy(), s[0], s[1]);
var _local3 = Math.round(vol - (_local4 / 5));
if (_local3 < 1) {
_local3 = 0;
}
sound.setVolume(_local3);
} 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);
}
return(undefined);
}
stop();
Frame 3
stop();
var current = 1;
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 - ((this._alpha - 100) / 10);
} else {
this._alpha = this._alpha - (this._alpha / 10);
if (Math.floor(this._alpha) < 2) {
this.removeMovieClip();
}
}
};
var _local4 = 1;
while (_local4 <= 20) {
var _local3 = create(k, "rnd");
_local3._x = Stage.width / 2;
_local3._y = 12 + (_local4 * _local3._height);
_local3.val = _local4;
var _local5 = Math.ceil(_local4 / 5);
_local3.r.text = (("Round " + _local5) + "-") + (5 - ((_local5 * 5) - _local4));
if (_local4 <= sd.data.unlocked) {
_local3.onPress = function () {
_root.gotoAndStop(4);
current = this.val;
m.removeMovieClip();
k.removeMovieClip();
};
_local3.onRollOver = function () {
this.gotoAndStop(2);
};
_local3.onRollOut = function () {
this.gotoAndStop(1);
};
} else {
_local3._alpha = 20;
}
_local4++;
}
};
m.achb.onPress = function () {
var _local6 = create(_root, "achscreen");
_local6._alpha = 0;
_local6.done = false;
_local6.onEnterFrame = function () {
if (!this.done) {
this._alpha = this._alpha - ((this._alpha - 100) / 10);
} else {
this._alpha = this._alpha - (this._alpha / 10);
if (Math.floor(this._alpha) < 2) {
this.removeMovieClip();
}
}
};
var _local7 = sd.data.achievements;
var _local5 = 0;
while (_local5 < a_order.length) {
var _local4 = _local7[a_order[_local5]];
var _local3 = create(_local6, "ac");
_local3._x = 20;
_local3._y = 50 + (_local5 * _local3._height);
_local3.nme.html = true;
if (_local4[2] == false) {
_local3._alpha = 50;
_local3.nme.htmlText = _local4[0];
} else {
_local3.nme.htmlText = (("<font color='#FFCC00'>" + _local4[0]) + "</font> - ") + _local4[1];
}
_local5++;
}
};
m.tutb.onPress = function () {
var _local3 = create(_root, "tutorial");
_local3._alpha = 0;
_local3.done = false;
_local3.onEnterFrame = function () {
if (!this.done) {
this._alpha = this._alpha - ((this._alpha - 100) / 10);
} else {
this._alpha = this._alpha - (this._alpha / 10);
if (Math.floor(this._alpha) < 2) {
this.removeMovieClip();
}
}
};
};
Frame 4
function upgrade(wep) {
var _local5 = upg[wep[0]][wep[8] - 1];
if (wep[8] == 1) {
get_ach([5]);
}
if (wep[8] == 4) {
get_ach([10]);
}
var _local6 = wep[2];
weapon[wep[0]] = _local5;
player.equip.weapon = weapon[wep[0]];
player.equip.weapon[2] = _local6;
alert(("<font color='#FFCC00'>" + wep[0]) + "</font> increased strength");
for (var _local4 in player.backpack) {
var _local2 = player.backpack[_local4];
if (_local2[0] == wep[0]) {
player.backpack[_local4] = weapon[wep[0]];
}
}
var _local3 = 0;
for (var _local4 in player.backpack) {
if (player.backpack[_local4][7] == "weapon") {
var _local2 = player.backpack[_local4];
if (_local2[8] == 5) {
_local3 = _local3 + 1;
}
}
}
if (_local3 >= 5) {
get_ach([3]);
}
}
var weapon = [];
var upg = [];
weapon["Beretta 92"] = ["Beretta 92", "handgun", 9, 9, 14, 30, 3, "weapon", 1, 0, 160];
upg["Beretta 92"] = [["Beretta 92", "handgun", 0, 9, 14, 28, 5, "weapon", 2, 0, 280], ["Beretta 92", "handgun", 0, 11, 13, 25, 6, "weapon", 3, 0, 400], ["Beretta 92", "handgun", 0, 13, 12, 22, 8, "weapon", 4, 0, 520], ["Beretta 92", "handgun", 0, 15, 11, 20, 10, "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["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, 28, "weapon", 2, 0, 350], ["Colt Python", "revolver", 0, 6, 18, 28, 32, "weapon", 3, 0, 500], ["Colt Python", "revolver", 0, 8, 16, 25, 36, "weapon", 4, 0, 650], ["Colt Python", "revolver", 0, 8, 14, 23, 40, "weapon", 5, 0, 0]];
weapon["Panzerfaust 3"] = ["Panzerfaust 3", "rocketlauncher", rand(1, 3), 3, 50, 60, 44, "weapon", 1, 0, 200];
upg["Panzerfaust 3"] = [["Panzerfaust 3", "rocketlauncher", 0, 3, 48, 57, 49, "weapon", 2, 0, 350], ["Panzerfaust 3", "rocketlauncher", 0, 3, 46, 54, 53, "weapon", 3, 0, 500], ["Panzerfaust 3", "rocketlauncher", 0, 4, 43, 50, 57, "weapon", 4, 0, 650], ["Panzerfaust 3", "rocketlauncher", 0, 4, 40, 46, 62, "weapon", 5, 0, 0]];
function get_ach(type) {
var _local1 = achievement[type];
if (_local1[2] == false) {
popup_ach(_local1);
_local1[2] = true;
player.stars = player.stars + 1;
}
}
function popup_ach(ach) {
playSound("gain", sd.data.sfxvol);
var _local2 = create(hud_container, "achieve");
_local2.cacheAsBitmap = true;
for (var _local3 in achs) {
achs[_local3].timer = 0;
achs[_local3].done = true;
}
achs.push(_local2);
_local2._y = 90;
_local2._alpha = 0;
_local2.timer = 250;
_local2.done = false;
_local2.pos = 80;
_local2.title.text = ("\"" + ach[0]) + "\"";
_local2.type.text = ach[1];
_local2.onEnterFrame = function () {
if (!freeze) {
this._y = this._y - ((this._y - this.pos) / 10);
if (!this.done) {
this._alpha = this._alpha - ((this._alpha - 100) / 10);
if (Math.ceil(this._alpha) > 95) {
this.done = true;
}
} else {
this.timer = this.timer - 1;
}
if (this.timer < 1) {
this._alpha = 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 = [];
function pythag(xa, ya, xb, yb) {
var _local2 = xa - xb;
var _local1 = ya - yb;
return(Math.sqrt((_local2 * _local2) + (_local1 * _local1)));
}
function alert(info) {
var _local2 = create(hud_container, "alert");
_local2.cacheAsBitmap = true;
alerts.push(_local2);
_local2._x = -_local2._width;
_local2._y = (Stage.height - _local2._height) - 100;
_local2.html = true;
_local2.write.htmlText = info;
for (var _local3 in alerts) {
alerts[_local3].pos = alerts[_local3].pos - (_local2._height - 2);
}
_local2.pos = _local2._y;
_local2.timer = 150;
_local2.onEnterFrame = function () {
if (!frozen) {
this._x = this._x - (this._x / 5);
this._y = this._y - ((this._y - this.pos) / 10);
this.timer = this.timer - 1;
if (this.timer < 1) {
this._alpha = this._alpha - (this._alpha / 5);
}
if (Math.floor(this._alpha) < 2) {
this.array_remove(alerts);
this.removeMovieClip();
}
}
};
}
function wait(t) {
var _local2 = create();
_local2.timer = t;
_local2.onEnterFrame = function () {
this.timer = this.timer - 1;
if (this.timer < 1) {
this.removeMovieClip();
}
};
return(_local2);
}
function refresh_field() {
arena.draw(remains);
for (var _local1 in remains) {
remains[_local1].removeMovieClip();
}
}
function tree(xp, yp) {
var _local4 = create(structure, "tree");
_local4.cacheAsBitmap = true;
_local4._x = xp;
_local4._y = yp;
collides.push(_local4);
_local4.onEnterFrame = function () {
this.hidden();
for (var _local4 in units) {
var _local2 = units[_local4];
while (pythag(this.cx(), this.cy(), _local2.cx(), _local2.cy()) < ((this.hit._width / 2) + (_local2.hit._width / 2))) {
var _local3 = Math.atan2(this.cy() - _local2.cy(), this.cx() - _local2.cx());
_local2._x = _local2._x - Math.cos(_local3);
_local2._y = _local2._y - Math.sin(_local3);
}
}
};
}
function store(ar) {
var _local1 = ar.concat();
for (var _local2 in _local1) {
_local1[_local2] = _local1[_local2].join("#");
}
return(_local1.join("$"));
}
function restore(st) {
var _local1 = st.split("$");
for (var _local2 in _local1) {
_local1[_local2] = _local1[_local2].split("#");
}
return(_local1);
}
function fix2D(ar) {
for (var _local5 in ar) {
for (var _local4 in ar[_local5]) {
var _local3 = ar[_local5][_local4];
var _local2 = Math.round(ar[_local5][_local4]);
ar[_local5][_local4] = _local2;
if (isNaN(ar[_local5][_local4])) {
ar[_local5][_local4] = _local3;
}
}
}
}
function splash() {
var _local4 = create();
var _local3 = create(_local4);
_local4._x = Stage.width / 2;
_local4._y = Stage.height / 2;
_local3._x = -(Stage.width / 2);
_local3._y = -(Stage.height / 2);
_local3.father = _local4;
var _local5 = new flash.display.BitmapData(Stage.width, Stage.height, true, 0);
_local5.draw(_root);
_local3.attachBitmap(_local5, _local3.getNextHighestDepth());
_local3._alpha = 40;
_local3.onEnterFrame = function () {
this._xscale = this._xscale - ((this._xscale - 200) / 20);
this._yscale = this._yscale - ((this._yscale - 200) / 20);
this._alpha = 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) {
if (!offset) {
offset = 0;
}
var _local5 = create(projectile);
_local5.lineStyle(1, 16777215, rand(10, 50));
_local5.timer = 2;
_local5.onEnterFrame = function () {
this.timer = this.timer - 1;
if (this.timer < 1) {
this.removeMovieClip();
}
};
var _local9 = Math.atan2(yp - this.cy(), xp - this.cx()) + ((offset / 180) * Math.PI);
var _local4 = this.cx() + (Math.cos(this.anchor) * forward);
var _local3 = this.cy() + (Math.sin(this.anchor) * forward);
_local5._x = _local4;
_local5._y = _local3;
var _local7 = 0;
while (_local7 < (800 / accuracy)) {
_local4 = _local4 + (Math.cos(_local9) * accuracy);
_local3 = _local3 + (Math.sin(_local9) * accuracy);
for (var _local10 in targs) {
var _local2 = targs[_local10];
if ((_local4 > _local2._x) && (_local4 < (_local2._x + _local2.hit._width))) {
if ((_local3 > _local2._y) && (_local3 < (_local2._y + _local2.hit._height))) {
_local5.lineTo(_local4 - _local5._x, _local3 - _local5._y);
return(_local2);
}
}
}
for (var _local10 in collides) {
var _local2 = collides[_local10];
if ((_local4 > _local2._x) && (_local4 < (_local2._x + _local2.hit._width))) {
if ((_local3 > _local2._y) && (_local3 < (_local2._y + _local2.hit._height))) {
_local5.lineTo(_local4 - _local5._x, _local3 - _local5._y);
if (!_local2.struck) {
trees = trees + 1;
_local2.struck = true;
}
return(undefined);
}
}
}
if ((((_local4 < 0) || (_local4 > 800)) || (_local3 < 0)) || (_local3 > 800)) {
_local5.lineTo(_local4 - _local5._x, _local3 - _local5._y);
return(undefined);
}
_local7++;
}
_local5.lineTo(_local4 - _local5._x, _local3 - _local5._y);
return(undefined);
};
MovieClip.prototype.array_remove = function (ar) {
var _local2 = 0;
while (_local2 < ar.length) {
if (this == ar[_local2]) {
ar.splice(_local2, 1);
}
_local2++;
}
};
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 = this._x + rand(-amount, amount);
this._y = this._y + rand(-amount, amount);
};
pause_screen = function () {
var _local3 = new flash.display.BitmapData(Stage.width, Stage.height);
_local3.draw(_root);
var _local2 = create(_root, "pause");
_local2.base.attachBitmap(_local3, _local2.base.getNextHighestDepth());
_local2.base.filters = [new flash.filters.BlurFilter(8, 8, 2)];
_local2.mm.onPress = function () {
exit();
};
return(_local2);
};
credits_screen = function () {
cinematic = true;
frozen = true;
var _local4 = new flash.display.BitmapData(Stage.width, Stage.height);
_local4.draw(_root);
var _local3 = create(_root, "credits");
_local3.base.attachBitmap(_local4, _local3.base.getNextHighestDepth());
_local3.base.filters = [new flash.filters.BlurFilter(8, 8, 2)];
_local3.onEnterFrame = function () {
this.roll._y = this.roll._y - 4;
if ((this.roll._y + this.roll._height) < 0) {
cinematic = false;
frozen = false;
this.removeMovieClip();
set_round(21);
}
};
return(_local3);
};
MovieClip.prototype.explode = function (range, damage) {
playSound("explode", sd.data.sfxvol);
for (var _local5 in enemies) {
var _local2 = enemies[_local5];
if (pythag(this._x, this._y, _local2.cx(), _local2.cy()) < ((_local2.hit._width / 2) + (range / 2))) {
_local2.bleed(rand(4, 8));
_local2.health = _local2.health - Math.round(damage + rand((-damage) / 4, damage / 4));
_local2.hitcooldown = 50;
}
}
var _local6 = create(effects);
_local6._x = this._x;
_local6._y = this._y;
_local6.timer = rand(8, 12);
_local6.onEnterFrame = function () {
this.timer = this.timer - 1;
if (this.timer < 1) {
this.removeMovieClip();
}
var _local2 = create(effects, "explosion");
_local2._x = this._x + rand(-(range / 4), range / 4);
_local2._y = this._y + rand(-(range / 4), range / 4);
_local2._width = rand(5, 10);
_local2._height = _local2._width;
_local2.grow = rand(60, 100);
_local2.expire = rand(5, 10);
_local2.filters = [new flash.filters.BlurFilter(7, 7, 1)];
_local2._alpha = rand(60, 80);
_local2.gotoAndStop(rand(1, 4));
_local2.onEnterFrame = function () {
this._width = this._width - ((this._width - this.grow) / this.expire);
this._height = this._width;
this._alpha = this._alpha - (this._alpha / this.expire);
if (Math.floor(this._alpha) < 3) {
this.removeMovieClip();
}
};
};
};
var professional = false;
var frozen = false;
var cinematic = false;
var enemies = [];
var units = [];
var remaining_kills = 0;
var current_enemies = 0;
var temp_backpack = "";
var temp_hp = 0;
var temp_kills = 0;
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());
MovieClip.prototype.bleed = function (inten) {
var _local5 = random(360);
var _local3 = 0;
while (_local3 < inten) {
var _local2 = create(effects, "blood");
_local2.cacheAsBitmap = true;
_local2._x = this.cx();
_local2._y = this.cy();
_local2.anchor = ((_local5 + rand(-20, 20)) * Math.PI) / 180;
_local2._rotation = (_local2.anchor * 180) / Math.PI;
_local2.v = rand(4, 8);
_local2.onEnterFrame = function () {
if (!frozen) {
this._x = this._x + (Math.cos(this.anchor) * this.v);
this._y = this._y + (Math.sin(this.anchor) * this.v);
this.v = this.v - (this.v / 12);
this._alpha = this._alpha - (this._alpha / 10);
if (Math.floor(this._alpha) < 2) {
this.removeMovieClip();
}
}
};
_local3++;
}
_local3 = 0;
while (_local3 < Math.ceil(inten / 4)) {
var _local2 = create(remains, "ground_blood");
_local2._x = this.cx() + rand(-(this.hit._width / 2), this.hit._width / 2);
_local2._y = this.cy() + rand(-(this.hit._height / 2), this.hit._height / 2);
_local2._width = this.hit._width + rand(this.hit._width / 10, this.hit._width / 5);
_local2._height = _local2._width;
_local2._alpha = rand(5, 50);
_local2._rotation = random(360);
_local2.puddle.gotoAndStop(rand(1, 30));
_local3++;
}
refresh_field();
};
MovieClip.prototype.physics = function () {
for (var _local4 in units) {
var _local2 = units[_local4];
if (_local2 != this) {
while (pythag(this.cx(), this.cy(), _local2.cx(), _local2.cy()) < ((this.hit._width / 2) + (_local2.hit._width / 2))) {
var _local3 = Math.atan2(this.cy() - _local2.cy(), this.cx() - _local2.cx());
_local2._x = _local2._x - Math.cos(_local3);
_local2._y = _local2._y - Math.sin(_local3);
this._x = this._x + Math.cos(_local3);
this._y = this._y + Math.sin(_local3);
}
}
}
};
MovieClip.prototype.haste = function () {
this.hasted = true;
this.sheet.speed = this.sheet.speed * 2;
this.sheet.cooldown = this.sheet.cooldown / 2;
Math.round(this.sheet.cooldown);
var _local2 = create(effects, "haste_effect");
_local2._x = this.cx();
_local2._y = this.cy();
var mc = this;
var _local3 = new flash.filters.GlowFilter(16763904, 100, 6, 6, 1, 2);
this.filters = [_local3];
_local2.onEnterFrame = function () {
this._x = mc.cx();
this._y = mc.cy();
if (this._currentframe >= 60) {
this.removeMovieClip();
}
};
};
function unit() {
var mc = create(mobiles, "player");
units.push(mc);
mc.sheet = [];
mc.sheet.speed = 5;
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.regen = 0;
mc.regen_timer = 3;
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();
}
if (((this.sheet.health < this.maxhp) && (current < 21)) && (!professional)) {
this.regen = this.regen + 1;
} else {
this.regen = 0;
}
if (this.regen >= this.regen_timer) {
this.regen = 0;
this.sheet.health = this.sheet.health + 1;
if (this.regen_timer > 3) {
this.regen_timer = this.regen_timer - 1;
}
}
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 _local2 = pythag(this.half_pointer._x, this.half_pointer._y, world._xmouse, world._ymouse) / 2;
this.half_pointer._x = this.half_pointer._x + (Math.cos(this.anchor) * _local2);
this.half_pointer._y = this.half_pointer._y + (Math.sin(this.anchor) * _local2);
if (Key.isDown(87)) {
this._y = this._y - 7;
this.walking = true;
}
if (Key.isDown(83)) {
this._y = this._y + 7;
this.walking = true;
}
if (Key.isDown(68)) {
this._x = this._x + 7;
this.walking = true;
}
if (Key.isDown(65)) {
this._x = 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 = 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 = 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 _local3 = this.get_ammo();
if (((this.equip.weapon[2] < 1) && (_local3 != undefined)) && (_local3[3] > 0)) {
this.reloading = true;
}
}
}
};
mc.attack = function () {
var _local7 = this.equip.weapon[1];
var w = this.equip.weapon;
if (((this.cooldown == w[4]) && (w[2] > 0)) && (!this.reloading)) {
w[2] = w[2] - 1;
if (_local7 == "handgun") {
world.distort(3);
playSound("handgun_fire", sd.data.sfxvol);
var _local6 = this.fire_ray(world._xmouse, world._ymouse, 50, enemies, 5, rand(-4, 4));
if (_local6 != undefined) {
_local6.bleed(rand(3, 5));
_local6.health = _local6.health - w[6];
_local6.hitcooldown = 50;
player.equip.weapon[9] = player.equip.weapon[9] + 1;
if (_local6.can_teleport) {
if (random(100) < 20) {
_local6.teleporting = true;
}
}
}
}
if (_local7 == "shotgun") {
world.distort(6);
playSound("shotgun_fire", sd.data.sfxvol);
var _local5 = 0;
var _local3 = 0;
while (_local3 < 6) {
var _local6 = this.fire_ray(world._xmouse, world._ymouse, 60, enemies, 10, rand(-12, 12));
if (_local6 != undefined) {
_local6.bleed(rand(3, 6));
if ((_local6.health <= w[6]) && (_local6.health > 0)) {
_local5 = _local5 + 1;
}
_local6.health = _local6.health - w[6];
_local6.hitcooldown = 50;
player.equip.weapon[9] = player.equip.weapon[9] + 1;
if (_local6.can_teleport) {
if (random(100) < 20) {
_local6.teleporting = true;
}
}
}
_local3++;
}
if (_local5 >= 3) {
get_ach([6]);
}
}
if (_local7 == "machinegun") {
world.distort(2);
playSound("machinegun_fire", sd.data.sfxvol);
var _local6 = this.fire_ray(world._xmouse, world._ymouse, 60, enemies, 5, rand(-3, 3));
if (_local6 != undefined) {
_local6.bleed(rand(1, 3));
_local6.health = _local6.health - w[6];
_local6.hitcooldown = 50;
player.equip.weapon[9] = player.equip.weapon[9] + 1;
if (_local6.can_teleport) {
if (random(100) < 20) {
_local6.teleporting = true;
}
}
}
}
if (_local7 == "revolver") {
world.distort(7);
playSound("revolver_fire", sd.data.sfxvol);
var _local6 = this.fire_ray(world._xmouse, world._ymouse, 45, enemies, 5, rand(-2, 2));
if (_local6 != undefined) {
_local6.bleed(rand(5, 12));
_local6.health = _local6.health - w[6];
_local6.hitcooldown = 50;
player.equip.weapon[9] = player.equip.weapon[9] + 1;
if (_local6.can_teleport) {
if (random(100) < 20) {
_local6.teleporting = true;
}
}
}
}
if (_local7 == "rocketlauncher") {
world.distort(10);
playSound("rocketlauncher_fire", sd.data.sfxvol);
var _local4 = create(projectile, "rocket");
_local4._x = this.cx();
_local4._y = this.cy();
_local4._x = _local4._x + (Math.cos(this.anchor) * 40);
_local4._y = _local4._y + (Math.sin(this.anchor) * 40);
_local4.anchor = this.anchor;
_local4._rotation = (this.anchor * 180) / Math.PI;
_local4.v = 6;
_local4.onEnterFrame = function () {
this._x = this._x + (Math.cos(this.anchor) * this.v);
this._y = this._y + (Math.sin(this.anchor) * this.v);
this.v = this.v - ((this.v - 15) / 10);
for (var _local4 in enemies) {
var _local2 = enemies[_local4];
if (pythag(this._x, this._y, _local2.cx(), _local2.cy()) < ((_local2.hit._width / 2) + 15)) {
_local2.bleed(rand(6, 9));
_local2.health = _local2.health - w[6];
_local2.hitcooldown = 50;
player.equip.weapon[9] = player.equip.weapon[9] + 1;
if (_local2.can_teleport) {
if (random(100) < 20) {
_local2.teleporting = true;
}
}
this.explode(w[6] * 4, w[6]);
this.removeMovieClip();
}
}
for (var _local4 in collides) {
var _local3 = collides[_local4];
if ((this._x > _local3._x) && (this._x < (_local3._x + _local3.hit._width))) {
if ((this._y > _local3._y) && (this._y < (_local3._y + _local3.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 _local3 = this.equip.weapon[1];
for (var _local4 in this.backpack) {
var _local2 = this.backpack[_local4];
if ((_local2[2] == _local3) && (_local2[1] == "ammo")) {
return(_local2);
}
}
return(undefined);
};
mc.total_ammo = function () {
var _local3 = 0;
for (var _local4 in this.backpack) {
var _local2 = this.backpack[_local4];
if (_local2[1] == "ammo") {
_local3 = _local3 + _local2[3];
}
if (_local2[7] == "weapon") {
_local3 = _local3 + _local2[2];
}
}
for (var _local4 in ammos) {
_local3 = _local3 + ammos[_local4].count;
}
return(_local3);
};
mc.search_inventory = function (what) {
for (var _local2 in this.backpack) {
if (this.backpack[_local2][0] == what) {
return(this.backpack[_local2]);
}
}
return(undefined);
};
mc.list_weapons = function () {
var _local2 = [];
for (var _local3 in this.backpack) {
if (this.backpack[_local3][7] == "weapon") {
_local2.push(this.backpack[_local3]);
}
}
_local2.reverse();
return(_local2);
};
mc.next_weapon = function () {
if ((!this.reloading) && (!this.firing)) {
var _local3 = this.list_weapons();
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2] == this.equip.weapon) {
var _local4 = _local2;
}
_local2++;
}
if ((_local4 + 1) >= _local3.length) {
this.equip.weapon = _local3[0];
} else {
this.equip.weapon = _local3[_local4 + 1];
}
mc.reloading = false;
mc.cooldown = 0;
}
};
mc.reload = function () {
var _local3 = this.equip.weapon;
var _local2 = this.get_ammo();
if ((_local2 != undefined) && (_local2[3] > 0)) {
var _local4 = _local3[3] - _local3[2];
playSound("reload", sd.data.sfxvol);
if (_local2[3] > _local4) {
_local2[3] = _local2[3] - _local4;
_local3[2] = _local3[2] + _local4;
} else {
_local3[2] = _local3[2] + _local2[3];
_local2[3] = 0;
if (_local2[2] == "handgun") {
_local2[3] = rand(2, 5);
}
}
}
};
mc.hurt = function (damage) {
this.regen_timer = 30;
this.sheet.health = 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 _local3 = create(_root, "black");
_local3._alpha = 0;
this._visible = false;
_local3.done = false;
_local3.forward = false;
_local3.onEnterFrame = function () {
if (!this.done) {
this._alpha = 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.backpack = restore(temp_backpack);
fix2D(p.backpack);
p.equip.weapon = p.backpack[0];
p.sheet.health = temp_hp;
a_kills = temp_kills;
for (var _local2 in enemies) {
enemies[_local2].die(false);
}
set_round(current, true);
camera.set_target(p, true);
camera.set_target(p.half_pointer);
}
}
if (this.done && (this.forward)) {
this._alpha = this._alpha - (this._alpha / 5);
if (Math.floor(this._alpha) < 2) {
this.removeMovieClip();
}
}
};
};
return(mc);
}
var ammos = [];
MovieClip.prototype.drop = function (types, chance) {
var ob = types[random(types.length)];
if ((random(100) + 1) <= chance) {
if (ob == "ammo_handgun") {
if (player.search_inventory("Beretta 92") == undefined) {
var _local3 = create(objects, "handgun_pickup");
_local3.style = "weapon";
} else {
var _local3 = create(objects, ob);
_local3.style = "box";
}
_local3.count = rand(Math.round(weapon["Beretta 92"][3] / 2), weapon["Beretta 92"][3]);
ammos.push(_local3);
}
if (ob == "ammo_shotgun") {
if (player.search_inventory("Beretta Silver Pigeon") == undefined) {
var _local3 = create(objects, "shotgun_pickup");
_local3.style = "weapon";
} else {
var _local3 = create(objects, ob);
_local3.style = "box";
}
_local3.count = rand(Math.round(weapon["Beretta Silver Pigeon"][3] / 2), weapon["Beretta Silver Pigeon"][3]);
ammos.push(_local3);
}
if (ob == "ammo_machinegun") {
if (player.search_inventory("Beretta M12") == undefined) {
var _local3 = create(objects, "machinegun_pickup");
_local3.style = "weapon";
} else {
var _local3 = create(objects, ob);
_local3.style = "box";
}
_local3.count = rand(Math.round(weapon["Beretta M12"][3] / 2), weapon["Beretta M12"][3]);
ammos.push(_local3);
}
if (ob == "ammo_revolver") {
if (player.search_inventory("Colt Python") == undefined) {
var _local3 = create(objects, "revolver_pickup");
_local3.style = "weapon";
} else {
var _local3 = create(objects, ob);
_local3.style = "box";
}
_local3.count = rand(Math.round(weapon["Colt Python"][3] / 2), weapon["Colt Python"][3]);
ammos.push(_local3);
}
if (ob == "ammo_rocketlauncher") {
if (player.search_inventory("Panzerfaust 3") == undefined) {
var _local3 = create(objects, "rocketlauncher_pickup");
_local3.style = "weapon";
} else {
var _local3 = create(objects, ob);
_local3.style = "box";
}
_local3.count = rand(Math.round(weapon["Panzerfaust 3"][3] / 2), weapon["Panzerfaust 3"][3]);
ammos.push(_local3);
}
_local3._x = this.cx();
_local3._y = this.cy();
_local3.v = rand(3, 8);
_local3.an = (random(360) / 180) * Math.PI;
_local3.rota._rotation = random(360);
_local3.r = rand(-40, 40);
_local3.onEnterFrame = function () {
this.hidden();
if (!frozen) {
this._x = this._x + (Math.cos(this.an) * this.v);
this._y = this._y + (Math.sin(this.an) * this.v);
this.v = this.v - (this.v / 10);
this.rota._rotation = this.rota._rotation + this.r;
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();
}
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";
}
}
}
for (var _local3 in collides) {
var _local2 = collides[_local3];
if (((this._x + this.hit._width) > _local2._x) && (this._x < (_local2._x + _local2.hit._width))) {
if (((this._y + this.hit._height) > _local2._y) && (this._y < (_local2._y + _local2.hit._height))) {
this.array_remove(ammos);
this.removeMovieClip();
}
}
}
}
};
_local3.pickup = function () {
if (this.style == "weapon") {
playSound("weapon", sd.data.sfxvol);
if (ob == "ammo_handgun") {
alert("Picked up <font color='#FFCC00'>Beretta 92</font>");
this.array_remove(ammos);
player.backpack.push(weapon["Beretta 92"]);
}
if (ob == "ammo_shotgun") {
alert("Picked up <font color='#FFCC00'>Beretta Silver Pigeon</font>");
this.array_remove(ammos);
player.backpack.push(weapon["Beretta Silver Pigeon"]);
}
if (ob == "ammo_machinegun") {
alert("Picked up <font color='#FFCC00'>Beretta M12</font>");
this.array_remove(ammos);
player.backpack.push(weapon["Beretta M12"]);
}
if (ob == "ammo_revolver") {
alert("Picked up <font color='#FFCC00'>Colt Python</font>");
this.array_remove(ammos);
player.backpack.push(weapon["Colt Python"]);
}
if (ob == "ammo_rocketlauncher") {
alert("Picked up <font color='#FFCC00'>Panzerfaust 3</font>");
this.array_remove(ammos);
player.backpack.push(weapon["Panzerfaust 3"]);
get_ach([7]);
}
} else {
playSound("bullets", sd.data.sfxvol);
if (ob == "ammo_handgun") {
var _local2 = player.search_inventory("Handgun Ammo");
if (_local2 != undefined) {
_local2[3] = _local2[3] + this.count;
} else {
player.backpack.push(["Handgun Ammo", "ammo", "handgun", this.count]);
}
alert(("Picked up " + this.count) + " <font color='#FFCC00'>Handgun Ammo</font>");
this.array_remove(ammos);
}
if (ob == "ammo_shotgun") {
var _local2 = player.search_inventory("Shotgun Ammo");
if (_local2 != undefined) {
_local2[3] = _local2[3] + this.count;
} else {
player.backpack.push(["Shotgun Ammo", "ammo", "shotgun", this.count]);
}
alert(("Picked up " + this.count) + " <font color='#FFCC00'>Shotgun Ammo</font>");
this.array_remove(ammos);
}
if (ob == "ammo_machinegun") {
var _local2 = player.search_inventory("Machinegun Ammo");
if (_local2 != undefined) {
_local2[3] = _local2[3] + this.count;
} else {
player.backpack.push(["Machinegun Ammo", "ammo", "machinegun", this.count]);
}
alert(("Picked up " + this.count) + " <font color='#FFCC00'>Machinegun Ammo</font>");
this.array_remove(ammos);
}
if (ob == "ammo_revolver") {
var _local2 = player.search_inventory("Revolver Ammo");
if (_local2 != undefined) {
_local2[3] = _local2[3] + this.count;
} else {
player.backpack.push(["Revolver Ammo", "ammo", "revolver", this.count]);
}
alert(("Picked up " + this.count) + " <font color='#FFCC00'>Revolver Ammo</font>");
this.array_remove(ammos);
}
if (ob == "ammo_rocketlauncher") {
var _local2 = player.search_inventory("Rockets");
if (_local2 != undefined) {
_local2[3] = _local2[3] + this.count;
} else {
player.backpack.push(["Rockets", "ammo", "rocketlauncher", this.count]);
}
if (this.count == 1) {
alert("Picked up 1 <font color='#FFCC00'>Rocket</font>");
} else {
alert(("Picked up " + this.count) + " <font color='#FFCC00'>Rockets</font>");
}
this.array_remove(ammos);
}
}
this.removeMovieClip();
};
}
};
function newenemy(type, summon) {
var _local2 = create(mobiles, type);
enemies.push(_local2);
units.push(_local2);
_local2.sheet = [];
_local2.long = false;
if (type == "rat") {
_local2.sheet.health = Math.round(6 * round[current][3]);
_local2.sheet.damage = Math.round(3 * round[current][3]);
_local2.sheet.speed = 2.2 * round[current][4];
_local2.sheet.cooldown = 10;
}
if (type == "zombie") {
_local2.sheet.health = Math.round(10 * round[current][3]);
_local2.sheet.damage = Math.round(6 * round[current][3]);
_local2.sheet.speed = 1.7 * round[current][4];
_local2.sheet.cooldown = 14;
}
if (type == "mummy") {
_local2.sheet.health = Math.round(22 * round[current][3]);
_local2.sheet.damage = Math.round(9 * round[current][3]);
_local2.sheet.speed = 1.5 * round[current][4];
_local2.sheet.cooldown = 17;
}
if (type == "acolyte") {
_local2.sheet.health = Math.round(20 * round[current][3]);
_local2.sheet.damage = Math.round(6 * round[current][3]);
_local2.sheet.speed = 1.6 * round[current][4];
_local2.sheet.cooldown = 12;
_local2.cast_timer = 200;
}
if (type == "hell_hound") {
_local2.sheet.health = Math.round(18 * round[current][3]);
_local2.sheet.damage = Math.round(8 * round[current][3]);
_local2.sheet.speed = 2.1 * round[current][4];
_local2.sheet.cooldown = 14;
}
if (type == "archer") {
_local2.sheet.health = Math.round(25 * round[current][3]);
_local2.sheet.damage = Math.round(6 * round[current][3]);
_local2.sheet.speed = 1.5 * round[current][4];
_local2.sheet.cooldown = 50;
_local2.long = true;
_local2.walking = true;
}
if (type == "bouvine") {
_local2.sheet.health = Math.round(37 * round[current][3]);
_local2.sheet.damage = Math.round(6 * round[current][3]);
_local2.sheet.speed = 1.2 * round[current][4];
_local2.sheet.cooldown = 12;
}
if (!summon) {
_local2.place_outside();
}
_local2.health = _local2.sheet.health;
_local2.anchor = 0;
_local2.bar = _local2.healthbar();
_local2.cooldown = _local2.sheet.cooldown;
_local2.hitcooldown = 0;
_local2.onEnterFrame = function () {
this.enemyAI_melee();
this.physics();
this.hidden();
if (this.hitcooldown > 0) {
this.hitcooldown = 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 == "ghost") {
if (this.hitcooldown > 0) {
this._alpha = this._alpha - ((this._alpha - 70) / 7);
} else {
this._alpha = this._alpha - ((this._alpha - 20) / 4);
}
}
if (type == "acolyte") {
this.cast_timer = 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 == "archer") {
if (!this.walking) {
this.cooldown = 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 _local3 = create(projectile, "bolt");
_local3._x = this.cx();
_local3._y = this.cy();
_local3.anchor = this.anchor;
_local3._rotation = (this.anchor * 180) / Math.PI;
_local3._x = _local3._x + (Math.cos(this.anchor) * 20);
_local3._y = _local3._y + (Math.sin(this.anchor) * 20);
_local3.onEnterFrame = function () {
this._x = this._x + (Math.cos(this.anchor) * 12);
this._y = 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 _local3 in collides) {
var _local2 = collides[_local3];
if ((this._x > _local2._x) && (this._x < (_local2._x + _local2.hit._width))) {
if ((this._y > _local2._y) && (this._y < (_local2._y + _local2.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);
}
}
};
_local2.die = function (fromplayer) {
if (fromplayer) {
var _local2 = 80;
if (type == "rat") {
this.drop(["ammo_handgun"], _local2);
player.equip.weapon[9] = player.equip.weapon[9] + 3;
}
if (type == "zombie") {
this.drop(["ammo_handgun", "ammo_machinegun"], _local2);
player.equip.weapon[9] = 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"], _local2);
player.equip.weapon[9] = 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"], _local2);
player.equip.weapon[9] = player.equip.weapon[9] + 11;
}
if (type == "hell_hound") {
this.drop(["ammo_machinegun", "ammo_shotgun", "ammo_revolver", "ammo_rocketlauncher"], _local2);
player.equip.weapon[9] = 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"], _local2);
player.equip.weapon[9] = player.equip.weapon[9] + 17;
}
if (type == "bouvine") {
this.drop(["ammo_handgun", "ammo_machinegun", "ammo_shotgun", "ammo_revolver", "ammo_rocketlauncher"], _local2);
player.equip.weapon[9] = player.equip.weapon[9] + 22;
playSound("moo", sd.data.sfxvol, true, [this._x, this._y]);
cow_kills = cow_kills + 1;
}
a_kills = a_kills + 1;
static_kills = static_kills + 1;
}
this.array_remove(units);
this.array_remove(enemies);
this.bar.removeMovieClip();
current_enemies = current_enemies - 1;
if ((!bossrnd) && (!summon)) {
remaining_kills = remaining_kills - 1;
}
this.removeMovieClip();
};
if (!summon) {
current_enemies++;
}
return(_local2);
}
MovieClip.prototype.place_outside = function () {
var _local2 = rand(1, 4);
if (_local2 == 1) {
this._x = -300 - this.hit._width;
this._y = rand(-150 - this.hit._height, 950);
}
if (_local2 == 3) {
this._x = 1100;
this._y = rand(-150 - this.hit._height, 950);
}
if (_local2 == 2) {
this._y = -300 - this.hit._height;
this._x = rand(-150 - this.hit._height, 950);
}
if (_local2 == 4) {
this._y = 1100;
this._x = rand(-150 - this.hit._height, 950);
}
};
MovieClip.prototype.healthbar = function () {
var _local2 = create(special, "hpbar");
_local2.cacheAsBitmap = true;
_local2._x = this.hit._width / 2;
_local2._y = -5;
if (!sd.data.showbars) {
_local2._visible = false;
}
return(_local2);
};
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 = this._x + (Math.cos(this.anchor) * this.sheet.speed);
this._y = 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 = this._x + (Math.cos(this.anchor) * this.sheet.speed);
this._y = 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 = this.cooldown - 1;
if (this.cooldown < 1) {
this.cooldown = this.sheet.cooldown;
player.hurt(this.sheet.damage);
}
} else {
this.cooldown = this.sheet.cooldown;
}
}
}
};
function newboss(type) {
var _local2 = create(mobiles, type);
enemies.push(_local2);
units.push(_local2);
_local2.sheet = [];
if (type == "boss_5") {
_local2.sheet.health = 220;
_local2.sheet.speed = 2;
_local2.sheet.cooldown = 16;
_local2.sheet.damage = 12;
_local2.casting = false;
_local2.screenbar = _local2.bossbar("Aiden", "the Witchdoctor");
}
if (type == "boss_10") {
_local2.sheet.health = 390;
_local2.sheet.speed = 2.2;
_local2.sheet.cooldown = 6;
_local2.sheet.damage = 5;
_local2.casting = false;
_local2.teleporting = false;
_local2.tele_complete = false;
_local2.can_teleport = true;
_local2.boost_timer = 0;
_local2.perm_speed = _local2.sheet.speed;
_local2.screenbar = _local2.bossbar("Sanakhte Nebka", "the Risen Pharaoh");
}
if (type == "boss_15") {
_local2.sheet.health = 650;
_local2.sheet.speed = 2;
_local2.sheet.cooldown = 5;
_local2.sheet.damage = 5;
_local2.casting = false;
_local2.screenbar = _local2.bossbar("Fenrisulfr", "the Hellhound");
}
if (type == "boss_20") {
_local2.sheet.health = 1300;
_local2.sheet.speed = 2;
_local2.sheet.cooldown = 12;
_local2.sheet.damage = 16;
_local2.casting = false;
_local2.screenbar = _local2.bossbar("Terra", "the Immortal");
_local2.summon_timer = 200;
}
_local2.place_outside();
_local2.health = _local2.sheet.health;
_local2.anchor = Math.atan2(player.cy() - _local2.cy(), player.cx() - _local2.cx());
_local2.rota._rotation = (_local2.anchor * 180) / Math.PI;
_local2.spellcooldown = 200;
_local2.cast_timer = 10;
_local2.cooldown = _local2.sheet.cooldown;
_local2.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 = this.spellcooldown - 1;
if (this.spellcooldown < 1) {
this.spellcooldown = rand(40, 90);
this.bone_shot(60, 6, 3);
}
if (!this.casting) {
this._x = this._x + (Math.cos(this.anchor) * this.sheet.speed);
this._y = this._y + (Math.sin(this.anchor) * this.sheet.speed);
}
}
if (type == "boss_10") {
this.spellcooldown = 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 = this.boost_timer - 1;
this.sheet.speed = this.sheet.speed - ((this.sheet.speed - 5) / 10);
} else {
this.sheet.speed = this.sheet.speed - ((this.sheet.speed - this.perm_speed) / 10);
}
if (this.casting) {
this.cast_timer = this.cast_timer - 1;
if (this.cast_timer < 1) {
this.cast_timer = 10;
this.casting = false;
var _local2 = [];
for (var _local3 in enemies) {
if ((enemies[_local3] != this) && (!enemies[_local3].hasted)) {
_local2.push(enemies[_local3]);
}
}
var _local4 = _local2[random(_local2.length)];
_local4.haste();
}
}
if ((!this.casting) && (!this.teleporting)) {
this._x = this._x + (Math.cos(this.anchor) * this.sheet.speed);
this._y = this._y + (Math.sin(this.anchor) * this.sheet.speed);
}
if (this.teleporting) {
this._x = this._x + (Math.cos(this.anchor) * (this.sheet.speed / 3));
this._y = this._y + (Math.sin(this.anchor) * (this.sheet.speed / 3));
}
if (this.teleporting) {
if (!this.tele_complete) {
this._alpha = 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 - ((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 = this._x + (Math.cos(this.anchor) * this.sheet.speed);
this._y = this._y + (Math.sin(this.anchor) * this.sheet.speed);
}
this.spellcooldown = 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 = this._x + (Math.cos(this.anchor) * this.sheet.speed);
this._y = this._y + (Math.sin(this.anchor) * this.sheet.speed);
}
this.spellcooldown = this.spellcooldown - 1;
if (this.spellcooldown < 1) {
this.spellcooldown = rand(10, 100);
this.fireball(3, 12);
}
this.summon_timer = 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 = this.cooldown - 1;
if (this.cooldown < 1) {
this.cooldown = this.sheet.cooldown;
player.hurt(this.sheet.damage);
}
}
}
};
_local2.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 _local2 = 0;
while (_local2 < 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);
}
_local2++;
}
if (type == "boss_20") {
get_ach([8]);
setTimeout(credits_screen, 5000);
}
}
this.screenbar.removeMovieClip();
this.removeMovieClip();
};
return(_local2);
}
MovieClip.prototype.bossbar = function (str, job) {
var _local2 = create(hud_container, "bossbar");
_local2.cacheAsBitmap = true;
_local2._x = Stage.width / 2;
_local2._y = 10;
_local2._alpha = 0;
_local2.father = this;
_local2.comp = false;
_local2.gotoAndStop(200);
_local2.str.text = str;
_local2.job.text = job;
_local2.onEnterFrame = function () {
this.gotoAndStop(Math.round((this.father.health / this.father.sheet.health) * 200));
if (this.comp) {
this._alpha = this._alpha - (this._alpha / 10);
if (Math.floor(this._alpha) < 3) {
this.removeMovieClip();
}
} else {
this._alpha = this._alpha - ((this._alpha - 100) / 10);
}
};
return(_local2);
};
MovieClip.prototype.bone_shot = function (count, damage, spin) {
var _local2 = create(objects);
_local2._x = this.cx();
_local2._y = this.cy();
playSound("spike", sd.data.sfxvol, true, [_local2._x, _local2._y]);
_local2.anchor = this.anchor;
_local2.count = count;
_local2.timer = 2;
_local2.swirl = rand(-spin, spin);
_local2.onEnterFrame = function () {
if (!frozen) {
this.timer = this.timer - 1;
if (this.timer < 1) {
this.timer = 2;
this.count = this.count - 1;
if (this.count > 0) {
this.anchor = this.anchor + ((this.swirl / 180) * Math.PI);
this._x = this._x + (Math.cos(this.anchor) * 15);
this._y = this._y + (Math.sin(this.anchor) * 15);
var _local2 = create(objects, "effects_bone");
_local2._x = this._x;
_local2._y = this._y;
_local2.used = false;
_local2.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 _local3 = create(projectile, "fireball");
_local3._x = this.cx();
_local3._y = this.cy();
playSound("fireballsound", sd.data.sfxvol, true, [_local3._x, _local3._y]);
_local3.anchor = this.anchor;
_local3._rotation = (this.anchor * 180) / Math.PI;
_local3.smoketimer = 3;
_local3.onEnterFrame = function () {
this._x = this._x + (Math.cos(this.anchor) * speed);
this._y = 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 = this.smoketimer - 1;
if (this.smoketimer < 1) {
this.smoketimer = 3;
var _local4 = create(objects, "smoke");
_local4._x = this._x;
_local4._y = this._y;
}
for (var _local3 in collides) {
var _local2 = collides[_local3];
if ((this._x > _local2._x) && (this._x < (_local2._x + _local2.hit._width))) {
if ((this._y > _local2._y) && (this._y < (_local2._y + _local2.hit._height))) {
this.removeMovieClip();
}
}
}
if ((((this._x < -50) || (this._x > 850)) || (this._y < -50)) || (this._y > 850)) {
this.removeMovieClip();
}
};
};
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 _local3 = (world._x + this.follow.cx()) - (Stage.width / 2);
var _local2 = (world._y + this.follow.cy()) - (Stage.height / 2);
return(Math.sqrt((_local3 * _local3) + (_local2 * _local2)));
};
camera.targ_angle = function () {
var _local3 = (world._x + this.follow.cx()) - (Stage.width / 2);
var _local2 = (world._y + this.follow.cy()) - (Stage.height / 2);
return(Math.atan2(_local2, _local3));
};
camera.force = function (p, a) {
world._x = world._x - (Math.cos(a) * p);
world._y = world._y - (Math.sin(a) * p);
};
camera.onEnterFrame = function () {
if ((!frozen) || (cinematic)) {
if (this.follow != undefined) {
var _local2 = this.targ_distance() / 12;
this.force(_local2, this.targ_angle());
}
}
};
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 _local2 = player.equip.weapon;
var _local4 = player.get_ammo()[3];
if (_local4) {
this.totalammo.text = _local4;
} 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 - (this.health.beep._alpha / 5);
this.wepname.text = _local2[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;
}
var _local3 = _local2[1];
if (_local3 == "handgun") {
player.rota.gun.gotoAndStop(1);
this.weapon.gotoAndStop(1);
}
if (_local3 == "shotgun") {
player.rota.gun.gotoAndStop(2);
this.weapon.gotoAndStop(2);
}
if (_local3 == "machinegun") {
player.rota.gun.gotoAndStop(3);
this.weapon.gotoAndStop(3);
}
if (_local3 == "revolver") {
player.rota.gun.gotoAndStop(4);
this.weapon.gotoAndStop(4);
}
if (_local3 == "rocketlauncher") {
player.rota.gun.gotoAndStop(5);
this.weapon.gotoAndStop(5);
}
if (_local2[8] < 5) {
this.tier.text = ((("Tier " + _local2[8]) + " - ") + (Math.round((_local2[9] / _local2[10]) * 1000) / 10)) + "%";
} else {
this.tier.text = "Tier 5";
}
};
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_backpack = store(player.backpack);
temp_hp = player.sheet.health;
temp_kills = a_kills;
for (var _local5 in bossrounds) {
if (val == bossrounds[_local5]) {
bossrnd = true;
if (!reset) {
musicmc.changesong = true;
}
bosstarg = newboss("boss_" + val);
}
if (val == (bossrounds[_local5] + 1)) {
bossrnd = false;
if (!reset) {
musicmc.changesong = true;
}
}
}
if (current <= 21) {
var _local3 = create(hud, "round");
}
_local3.cacheAsBitmap = true;
_local3._alpha = 0;
_local3._x = Stage.width / 2;
_local3._y = Stage.height / 2;
_local3.comp = false;
_local3.timer = 100;
if (current != 20) {
var _local6 = Math.ceil(current / 5);
_local3.round.text = (("Round " + _local6) + "-") + (5 - ((_local6 * 5) - current));
} else if (current == 20) {
_local3.round.text = "Finishing Battle";
}
if (current == 21) {
_local3.round.text = "Undead Bouvine Survival!";
player.go_turret();
}
_local3.onEnterFrame = function () {
if (!frozen) {
if (!this.comp) {
this._alpha = this._alpha - ((this._alpha - 100) / 12);
}
if (Math.ceil(this._alpha) > 95) {
this.comp = true;
}
if (this.comp) {
this.timer = this.timer - 1;
if (Math.floor(this._alpha) < 2) {
this.removeMovieClip();
}
}
if (this.timer < 1) {
this._alpha = this._alpha - (this._alpha / 5);
}
}
};
}
var round = [];
var bossrnd = false;
var bosstarg = undefined;
var spawn_delay = 10;
round[1] = [["rat"], 3, 4, 1, 1];
round[2] = [["rat"], 3, 4, 1.1, 1];
round[3] = [["rat", "zombie"], 4, 5, 1.15, 1];
round[4] = [["rat", "zombie"], 4, 5, 1.2, 1];
round[5] = [["zombie"], 3, 0, 1.25, 1];
round[6] = [["zombie", "mummy"], 5, 6, 1.3, 1.1];
round[7] = [["zombie", "mummy"], 5, 6, 1.35, 1.1];
round[8] = [["zombie", "mummy", "acolyte"], 6, 7, 1.4, 1.1];
round[9] = [["zombie", "mummy", "acolyte"], 6, 7, 1.45, 1.15];
round[10] = [["mummy", "acolyte"], 2, 0, 1.5, 1.15];
round[11] = [["mummy", "acolyte"], 7, 8, 1.5, 1.15];
round[12] = [["mummy", "acolyte", "hell_hound"], 7, 8, 1.55, 1.2];
round[13] = [["mummy", "acolyte", "hell_hound"], 7, 9, 1.6, 1.2];
round[14] = [["acolyte", "hell_hound"], 7, 9, 1.65, 1.2];
round[15] = [["hell_hound"], 3, 0, 1.7, 1.25];
round[16] = [["acolyte", "hell_hound", "archer"], 8, 10, 1.8, 1.25];
round[17] = [["hell_hound", "archer"], 6, 10, 2, 1.25];
round[18] = [["hell_hound", "archer"], 6, 11, 2.1, 1.3];
round[19] = [["archer", "acolyte"], 6, 11, 2.2, 1.3];
round[20] = [[], 0, 0, 2.25, 1.3];
round[21] = [["bouvine"], 2, 1, 2.3, 1.3];
var i = 22;
while (i < 1000) {
var num = Math.ceil(i / 7);
round[i] = [["bouvine"], 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 = this.spawntime - 1;
} else {
this.spawntime = spawn_delay;
}
if (this.spawntime < 1) {
this.spawntime = spawn_delay;
var _local2 = round[current][0];
newenemy(_local2[random(_local2.length)]);
}
if ((remaining_kills < 1) && (!bossrnd)) {
set_round(current + 1);
}
};
function exit() {
calm.stop();
boss.stop();
musicmc.removeMovieClip();
for (var _local2 in _root) {
_root[_local2].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 = [];
tree(113, 130);
tree(51, 720);
tree(760, 594);
tree(681, 393);
tree(542, 48);
tree(287, 483);
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 - ((this.curvol - (sd.data.musicvol / 10)) / 10);
} else {
this.curvol = this.curvol - ((this.curvol - (sd.data.musicvol / 2)) / 10);
}
} else {
this.curvol = 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));
};
Symbol 422 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.7");
}
static function showPreGameAd(options) {
var _local26 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local22 = 11000;
var _local25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local21 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local23 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local6.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local21);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local23, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local22;
chk.ad_timeout = _local25;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local11 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local2 = (100 * _local8) / _local4;
var _local10 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local13 = Math.min(100, Math.min(_local2 || 0, _local10));
_local13 = Math.max(this.last_pcnt, _local13);
this.last_pcnt = _local13;
_local9._xscale = _local13;
options.ad_progress(_local13);
if (sendHostProgress) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local2});
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local9 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local9);
var clip = options.clip;
var _local8 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local10 = _local4[0];
var _local7 = _local4[1];
mc._x = _local10 * 0.5;
mc._y = _local7 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
if (clip._mochiad._containerLCName != undefined) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
static function rpc(clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
setValue(clip, arg.objectName, arg.value);
break;
case "getValue" :
var _local4 = getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local3);
break;
default :
trace("[mochiads rpc] unknown rpc id: " + arg.id);
}
}
static function setValue(base, objectName, value) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
base[_local2[_local1]] = value;
}
static function getValue(base, objectName) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
return(base[_local2[_local1]]);
}
static function runMethod(base, methodName, argsArray) {
var _local2 = methodName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
if (typeof(base[_local2[_local1]]) == "function") {
return(base[_local2[_local1]].apply(base, argsArray));
}
return(undefined);
}
}
Symbol 119 MovieClip Frame 1
_visible = false;
Symbol 123 MovieClip Frame 1
this.gotoAndStop(random(3) + 1);
Symbol 141 MovieClip Frame 1
stop();
Symbol 141 MovieClip Frame 2
stop();
Symbol 147 MovieClip Frame 1
Symbol 147 MovieClip Frame 20
gotoAndPlay (1);
Symbol 152 MovieClip Frame 1
this.gotoAndStop(random(3) + 1);
Symbol 156 MovieClip Frame 1
this.gotoAndStop(random(3) + 1);
Symbol 160 MovieClip Frame 1
this.gotoAndStop(random(3) + 1);
Symbol 194 MovieClip 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;
};
Symbol 197 MovieClip [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;
};
Symbol 262 MovieClip Frame 1
stop();
Symbol 304 MovieClip Frame 1
this.gotoAndStop(random(2) + 1);
Symbol 308 MovieClip Frame 1
this.gotoAndStop(random(3) + 1);
Symbol 311 MovieClip Frame 1
this.gotoAndStop(random(2) + 1);
Symbol 317 MovieClip Frame 1
this.gotoAndStop(random(4) + 1);
Symbol 324 MovieClip Frame 1
this.gotoAndStop(random(2) + 1);
Symbol 337 MovieClip [smoke] Frame 39
this.removeMovieClip();
Symbol 367 MovieClip Frame 1
this.useHandCursor = false;
this.onRollOver = function () {
};
Symbol 395 MovieClip [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);
}
};
Symbol 396 MovieClip [achscreen] Frame 1
var c = this;
ret.onPress = function () {
c.done = true;
};
Symbol 404 MovieClip [rnd_Select] Frame 1
var c = this;
rtn.onPress = function () {
c.done = true;
};
Symbol 407 MovieClip [rnd] Frame 1
stop();
Symbol 413 Button
on (press) {
getURL ("http://www.hysteriastudios.com/", "_blank");
}
Symbol 417 MovieClip Frame 135
stop();
_root.gotoAndStop(3);