Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("43d52fb7", this, 10301, true);
__com_mochibot__("f411f2b6", this, 10301, true);
MochiAd.showPreGameAd({id:"1ad4ded2b94beb32", res:"500x450"});
Frame 3
ak47_shot = new Sound(this);
ak47_shot.attachSound("ak_shot.mp3");
pistol_shot = new Sound(this);
pistol_shot.attachSound("pistol_shot.mp3");
magnum_shot = new Sound(this);
magnum_shot.attachSound("magnum_shot.mp3");
shotgun_shot = new Sound(this);
shotgun_shot.attachSound("shotgun_shot.mp3");
splat = new Sound(this);
splat.attachSound("splat.mp3");
zombie_moan = new Sound(this);
zombie_moan.attachSound("zombie_moan5.mp3");
earthquakesound = new Sound(this);
earthquakesound.attachSound("earthquake.mp3");
boop = new Sound(this);
boop.attachSound("boop.mp3");
menu_tune = new Sound(this);
menu_tune.attachSound("menu_tune.mp3");
level_tune = new Sound(this);
level_tune.attachSound("level_tune.mp3");
mute = false;
Frame 4
function itemHandler1(obj, item) {
getURL ("http://www.mortargames.com", _blank);
}
function itemHandler2(obj, item) {
getURL ("http://www.mortargames.com", _blank);
}
stop();
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
myMenu.customItems.push(new ContextMenuItem("Just War Games!", itemHandler1));
myMenu.customItems.push(new ContextMenuItem("MortarGames", itemHandler2));
_root.menu = myMenu;
playmore.onPress = function () {
getURL ("http://www.mortargames.com", _blank);
};
level_tune.stop("level_tune.mp3");
menu_tune.stop("menu_tune.mp3");
menu_tune.start();
menu_tune.setVolume(100);
score = 0;
play.onPress = function () {
gotoAndPlay ("instructions");
cash = 0;
ragebarmax = 100;
exp = 0;
exp_amount = 0;
playerlife = 10000;
monster_types = 1;
cash_num = 0;
total_monsters = 10;
interlevel_placed = false;
level = 1;
total_to_create = 10;
mdelay = 75;
player_life = 100;
player_rage = 1;
};
endless.onPress = function () {
gotoAndPlay ("instructions");
cash = 40000;
ragebarmax = 100;
exp = 30000;
exp_amount = 0;
playerlife = 10000;
interlevel_placed = false;
level = "endless";
player_life = 100;
player_rage = 100;
endless_count = 0;
};
viewnorm.onPress = function () {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect("bf22a5506157e080");
mochi.MochiScores.showLeaderboard({boardID:"fbfcc461a5aba4bf"});
};
viewendless.onPress = function () {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect("bf22a5506157e080");
mochi.MochiScores.showLeaderboard({boardID:"485cbdb606f1c597", score:myscore});
};
mute_btn.onPress = function () {
if (mute == false) {
mute = true;
menu_tune.setVolume(0);
mute_btn.gotoAndStop(2);
} else {
mute = false;
menu_tune.setVolume(100);
mute_btn.gotoAndStop(1);
}
};
Frame 5
walk_speed = 2;
n = 0;
radius = 3;
ammo = 1000;
delay = 0;
shot_delay = 30;
hit = true;
myscore = 0;
boom_distance = 100;
boom_cost = 10;
boom_bought = true;
boom_level = 1;
modes = "cursor";
earthquake_level = 0;
adrenaline_level = 0;
xattack_level = 0;
pistol = "pistol";
pistolpower = 1;
pistoldelay = 30;
pistolreloadspeed = 100;
pistolclipsize = 10;
pistolammo = 1000;
pistolcurrentammo = 10;
AK47 = "AK47";
AK47power = 2;
AK47delay = 12;
AK47reloadspeed = 100;
AK47clipsize = 20;
AK47ammo = 100;
AK47bought = false;
AK47currentammo = 20;
magnum = "magnum";
magnumpower = 5;
magnumdelay = 35;
magnumreloadspeed = 100;
magnumclipsize = 6;
magnumammo = 30;
magnumbought = false;
magnumcurrentammo = 6;
shotgun = "shotgun";
shotgunpower = 10;
shotgundelay = 50;
shotgunreloadspeed = 120;
shotgunclipsize = 8;
shotgunammo = 30;
shotgunbought = false;
shotguncurrentammo = 8;
if (_root.level == "endless") {
gotoAndStop ("interlevel");
} else {
gotoAndStop ("levels");
}
Frame 6
stop();
removeMovieClip("test_area");
removeMovieClip("ground");
removeMovieClip("splat_holder");
removeMovieClip("cash_holder");
removeMovieClip("environment");
removeMovieClip("cursor");
removeMovieClip("player");
removeMovieClip("minion_holder");
removeMovieClip("info");
removeMovieClip("full_area");
attachMovie("interlevel", "interlevel", _root.getNextHighestDepth());
onEnterFrame = function () {
interlevel.AK47power_btn.onPress = function () {
if ((_root.AK47power < 5) and (_root.cash >= 300)) {
_root.AK47power++;
_root.cash = _root.cash - 300;
}
};
interlevel.AK47delay_btn.onPress = function () {
if ((_root.AK47delay > 3) and (_root.cash >= 300)) {
_root.AK47delay--;
_root.cash = _root.cash - 300;
}
};
interlevel.AK47reloadspeed_btn.onPress = function () {
if ((_root.AK47reloadspeed > 75) and (_root.cash >= 35)) {
_root.AK47reloadspeed--;
_root.cash = _root.cash - 35;
}
};
interlevel.AK47clipsize_btn.onPress = function () {
if ((_root.AK47clipsize < 100) and (_root.cash >= 20)) {
_root.AK47clipsize++;
_root.cash = _root.cash - 20;
}
};
interlevel.AK47ammo_btn.onPress = function () {
if ((_root.AK47ammo < 2000) and (_root.cash > 20)) {
if (_root.AK47ammo < 1900) {
_root.AK47ammo = _root.AK47ammo + 100;
_root.cash = _root.cash - 20;
} else {
AK47ammo = 2000;
_root.cash = _root.cash - 20;
}
}
};
interlevel.pistolpower_btn.onPress = function () {
if ((_root.pistolpower < 10) and (_root.cash >= 100)) {
_root.pistolpower++;
_root.cash = _root.cash - 100;
}
};
interlevel.pistoldelay_btn.onPress = function () {
if ((_root.pistoldelay > 10) and (_root.cash >= 50)) {
_root.pistoldelay--;
_root.cash = _root.cash - 50;
}
};
interlevel.pistolreloadspeed_btn.onPress = function () {
if ((_root.pistolreloadspeed > 50) and (_root.cash >= 30)) {
_root.pistolreloadspeed--;
_root.cash = _root.cash - 30;
}
};
interlevel.pistolclipsize_btn.onPress = function () {
if ((_root.pistolclipsize < 50) and (_root.cash >= 20)) {
_root.pistolclipsize++;
_root.cash = _root.cash - 20;
}
};
interlevel.pistolammo_btn.onPress = function () {
if ((_root.pistolammo < 2000) and (_root.cash > 10)) {
if (_root.pistolammo < 1900) {
_root.pistolammo = _root.pistolammo + 100;
_root.cash = _root.cash - 10;
} else {
pistolammo = 2000;
_root.cash = _root.cash - 10;
}
}
};
interlevel.magnumpower_btn.onPress = function () {
if ((_root.magnumpower < 20) and (_root.cash >= 200)) {
_root.magnumpower++;
_root.cash = _root.cash - 200;
}
};
interlevel.magnumdelay_btn.onPress = function () {
if ((_root.magnumdelay > 15) and (_root.cash >= 75)) {
_root.magnumdelay--;
_root.cash = _root.cash - 75;
}
};
interlevel.magnumreloadspeed_btn.onPress = function () {
if ((_root.magnumreloadspeed > 60) and (_root.cash >= 35)) {
_root.magnumreloadspeed--;
_root.cash = _root.cash - 35;
}
};
interlevel.magnumclipsize_btn.onPress = function () {
if ((_root.magnumclipsize < 30) and (_root.cash >= 35)) {
_root.magnumclipsize++;
_root.cash = _root.cash - 35;
}
};
interlevel.magnumammo_btn.onPress = function () {
if ((_root.magnumammo < 2000) and (_root.cash > 50)) {
if (_root.magnumammo < 1900) {
_root.magnumammo = _root.magnumammo + 100;
_root.cash = _root.cash - 20;
} else {
magnumammo = 2000;
_root.cash = _root.cash - 50;
}
}
};
interlevel.shotgunpower_btn.onPress = function () {
if ((_root.shotgunpower < 40) and (_root.cash >= 100)) {
_root.shotgunpower++;
_root.cash = _root.cash - 100;
}
};
interlevel.shotgundelay_btn.onPress = function () {
if ((_root.shotgundelay > 25) and (_root.cash >= 75)) {
_root.shotgundelay--;
_root.cash = _root.cash - 75;
}
};
interlevel.shotgunreloadspeed_btn.onPress = function () {
if ((_root.shotgunreloadspeed > 80) and (_root.cash >= 40)) {
_root.shotgunreloadspeed--;
_root.cash = _root.cash - 40;
}
};
interlevel.shotgunclipsize_btn.onPress = function () {
if ((_root.shotgunclipsize < 20) and (_root.cash >= 40)) {
_root.shotgunclipsize++;
_root.cash = _root.cash - 40;
}
};
interlevel.shotgunammo_btn.onPress = function () {
if ((_root.shotgunammo < 2000) and (_root.cash >= 50)) {
if (_root.shotgunammo < 1900) {
_root.shotgunammo = _root.shotgunammo + 100;
_root.cash = _root.cash - 50;
} else {
shotgunammo = 2000;
_root.cash = _root.cash - 50;
}
}
};
if (AK47bought) {
interlevel.buy_AK47._visible = false;
}
if (magnumbought) {
interlevel.buy_magnum._visible = false;
}
if (shotgunbought) {
interlevel.buy_shotgun._visible = false;
}
interlevel.buy_AK47.onPress = function () {
if (cash > 199) {
cash = cash - 200;
this._visible = false;
AK47bought = true;
}
};
interlevel.buy_magnum.onPress = function () {
if (cash > 349) {
cash = cash - 350;
this._visible = false;
magnumbought = true;
}
};
interlevel.buy_shotgun.onPress = function () {
if (cash > 499) {
cash = cash - 500;
this._visible = false;
shotgunbought = true;
}
};
interlevel.boom_btn.onPress = function () {
if ((boom_level < 10) and (exp >= 200)) {
boom_distance = boom_distance + 10;
boom_damage++;
boom_level++;
exp = exp - 200;
}
};
interlevel.earthquake_btn.onPress = function () {
if ((earthquake_level < 1) and (exp >= 500)) {
earthquake_distance = 100;
earthquake_damage = 1;
earthquake_bought = true;
earthquake_cost = 10;
earthquake_level++;
exp - 500;
} else if ((earthquake_level < 10) and (exp >= 500)) {
earthquake_distance = earthquake_distance + 10;
earthquake_damage = earthquake_damage + 0.5;
earthquake_level++;
exp = exp - 500;
}
};
interlevel.adrenaline_btn.onPress = function () {
if ((adrenaline_level < 1) and (exp >= 350)) {
adrenaline_count = 31;
adrenaline_bought = true;
adrenaline_speed = 0.9;
adrenaline_cost = 0.1;
adrenaline_skill = false;
adrenaline_startcost = 10;
adrenaline_level = 1;
adrenaline_percent = (adrenaline_speed * 100) + "%";
exp = exp - 350;
} else if ((adrenaline_level < 7) and (exp >= 350)) {
adrenaline_speed = adrenaline_speed - 0.1;
adrenaline_percent = (adrenaline_speed * 100) + "%";
adrenaline_level++;
exp = exp - 350;
}
};
interlevel.xattack_btn.onPress = function () {
if ((xattack_level < 1) and (exp >= 400)) {
xattack_count = 31;
xattack_bought = true;
xattack_speed = 1.1;
xattack_cost = 0.1;
xattack_skill = false;
xattack_startcost = 10;
xattack_level = 1;
xattack_percent = (xattack_speed * 100) + "%";
exp = exp - 400;
} else if ((xattack_level < 7) and (exp >= 400)) {
xattack_speed = xattack_speed + 0.1;
xattack_percent = (xattack_speed * 100) + "%";
xattack_level++;
exp = exp - 400;
}
};
interlevel.next_btn.onPress = function () {
if (interlevel._currentframe < 4) {
interlevel.gotoAndStop(interlevel._currentframe + 1);
} else {
if (level != "endless") {
level++;
}
cash_num = 0;
interlevel_placed = false;
if (level == 2) {
monster_types = 1;
total_to_create = 20;
total_monsters = 20;
mdelay = 75;
removeMovieClip(interlevel);
}
if (level == 3) {
monster_types = 2;
total_to_create = 40;
total_monsters = 40;
mdelay = 50;
removeMovieClip(interlevel);
}
if (level == 4) {
monster_types = 3;
total_to_create = 50;
total_monsters = 50;
mdelay = 75;
removeMovieClip(interlevel);
}
if (level == 5) {
monster_types = 4;
total_to_create = 50;
total_monsters = 50;
mdelay = 75;
removeMovieClip(interlevel);
}
if (level == 6) {
monster_types = 6;
total_to_create = 75;
total_monsters = 75;
mdelay = 60;
removeMovieClip(interlevel);
}
if (level == 7) {
monster_types = 6;
total_to_create = 75;
total_monsters = 75;
mdelay = 50;
removeMovieClip(interlevel);
}
if (level == 8) {
monster_types = 8;
total_to_create = 100;
total_monsters = 100;
mdelay = 50;
removeMovieClip(interlevel);
}
if (level == 9) {
monster_types = 9;
total_to_create = 75;
total_monsters = 75;
mdelay = 40;
removeMovieClip(interlevel);
}
if (level == 10) {
monster_types = 10;
total_to_create = 100;
total_monsters = 100;
mdelay = 30;
removeMovieClip(interlevel);
}
if (level == 11) {
monster_types = 11;
total_to_create = 100;
total_monsters = 100;
mdelay = 30;
removeMovieClip(interlevel);
}
if (level == 12) {
monster_types = 12;
total_to_create = 100;
total_monsters = 100;
mdelay = 30;
removeMovieClip(interlevel);
}
if (level == 13) {
monster_types = 13;
total_to_create = 100;
total_monsters = 100;
mdelay = 30;
removeMovieClip(interlevel);
}
if (level == 14) {
monster_types = 14;
total_to_create = 100;
total_monsters = 100;
mdelay = 30;
removeMovieClip(interlevel);
}
if (level == 15) {
monster_types = 15;
total_to_create = 100;
total_monsters = 100;
mdelay = 30;
removeMovieClip(interlevel);
}
if (level == 16) {
monster_types = 16;
total_to_create = 100;
total_monsters = 100;
mdelay = 30;
removeMovieClip(interlevel);
}
if (level == 17) {
monster_types = 17;
total_to_create = 100;
total_monsters = 100;
mdelay = 30;
removeMovieClip(interlevel);
}
if (level == 18) {
monster_types = 18;
total_to_create = 100;
total_monsters = 100;
mdelay = 30;
removeMovieClip(interlevel);
}
if (level == 19) {
monster_types = 19;
total_to_create = 100;
total_monsters = 100;
mdelay = 20;
removeMovieClip(interlevel);
}
if (level == 20) {
monster_types = 20;
total_to_create = 100;
total_monsters = 100;
mdelay = 20;
removeMovieClip(interlevel);
}
if (level == "endless") {
monster_types = 1;
total_to_create = 99999 /* 0x01869F */;
total_monsters = 99999 /* 0x01869F */;
mdelay = 100;
removeMovieClip(interlevel);
}
_root.gotoAndStop("levels");
}
};
};
Frame 7
function collision1(mc1, mc2) {
return(mc1.hitTest(mc2));
}
function collision2(mc1, mc2) {
var _local1 = mc1.getBounds(mc1);
var _local2 = mc2.getBounds(mc1);
return((((_local1.xMin <= (_local2.xMax - 8)) && ((_local1.xMax - 8) >= _local2.xMin)) && (_local1.yMin <= (_local2.yMax - 8))) && ((_local1.yMax - 8) >= _local2.yMin));
}
function checkCollision(r1, r2) {
var _local1 = collision1(r1, r2);
var _local3 = collision2(r1, r2);
var _local2 = collision2(r2, r1);
if (_local1) {
green.gotoAndStop(2);
} else {
green.gotoAndStop(1);
}
if (_local3) {
yellow.gotoAndStop(2);
} else {
yellow.gotoAndStop(1);
}
if (_local2) {
blue.gotoAndStop(2);
} else {
blue.gotoAndStop(1);
}
if ((_local1 && (_local3)) && (_local2)) {
red.gotoAndStop(2);
} else {
red.gotoAndStop(1);
}
}
function doRemove(parent) {
var _local1;
for (_local1 in parent) {
if (parent[_local1].removeMovieClip()) {
parent[_local1].removeMovieClip();
}
}
}
stop();
menu_tune.stop("menu_tune.mp3");
level_tune.start(0, 99);
starting = 0;
counting = 0;
var myMatrix = (new flash.geom.Matrix());
var translateMatrix = (new flash.geom.Matrix());
boom_skill = false;
earthquake_skill = false;
offsetx = 0;
offsety = 0;
_root.createEmptyMovieClip("full_area", _root.getNextHighestDepth());
_root.attachMovie("ground", "ground", _root.getNextHighestDepth(), {_x:3000, _y:1000});
var bitmapData_2 = (new flash.display.BitmapData(500, 800, false));
bitmapData_2.draw(_root.ground);
full_area.attachBitmap(bitmapData_2, 2);
_root.createEmptyMovieClip("splat_holder", _root.getNextHighestDepth());
_root.createEmptyMovieClip("body_holder", _root.getNextHighestDepth());
_root.createEmptyMovieClip("cash_holder", _root.getNextHighestDepth());
_root.attachMovie("environment", "environment", _root.getNextHighestDepth());
_root.attachMovie("test_area", "test_area", _root.getNextHighestDepth(), {_x:250, _y:200});
_root.createEmptyMovieClip("minion_holder", _root.getNextHighestDepth());
_root.attachMovie("player", "player", _root.getNextHighestDepth(), {_x:250, _y:200});
_root.createEmptyMovieClip("skill_holder", _root.getNextHighestDepth());
_root.attachMovie("info", "info", _root.getNextHighestDepth());
_root.attachMovie("cursor", "cursor", _root.getNextHighestDepth());
_root.info.ragebar._width = player_rage;
winattached = false;
Mouse.hide();
_root.info.pistol_btn.gotoAndStop(1);
if (boom_bought) {
_root.info.boom_btn.gotoAndStop(1);
} else {
_root.info.boom_btn.gotoAndStop(2);
}
if (earthquake_bought) {
_root.info.earthquake_btn.gotoAndStop(1);
} else {
_root.info.earthquake_btn.gotoAndStop(2);
}
if (adrenaline_bought) {
_root.info.adrenaline_btn.gotoAndStop(1);
} else {
_root.info.adrenaline_btn.gotoAndStop(2);
}
if (xattack_bought) {
_root.info.xattack_btn.gotoAndStop(1);
} else {
_root.info.xattack_btn.gotoAndStop(2);
}
if (AK47bought) {
_root.info.AK47_btn.gotoAndStop(1);
} else {
_root.info.AK47_btn.gotoAndStop(2);
}
if (magnumbought) {
_root.info.magnum_btn.gotoAndStop(1);
} else {
_root.info.magnum_btn.gotoAndStop(2);
}
if (shotgunbought) {
_root.info.shotgun_btn.gotoAndStop(1);
} else {
_root.info.shotgun_btn.gotoAndStop(2);
}
new_monster = 0;
monsters_placed = 0;
i = 0;
player.hp = playerlife;
player.power = pistolpower;
player.delay = pistoldelay;
player.reloadspeed = pistolreloadspeed;
player.clipsize = pistolclipsize;
player.current_clip = pistolclipsize;
pistolcurrentammo = pistolclipsize;
player.ammo = pistolammo;
player.weapon = "pistol";
reload = 0;
info.reloading_txt._visible = false;
info.reloading_bar._visible = false;
test_area._visible = false;
overcount = 0;
player.onEnterFrame = function () {
info.mute_btn.onRollOver = function () {
Mouse.show();
};
info.mute_btn.onRollOut = function () {
Mouse.hide();
};
info.mute_btn.onPress = function () {
if (mute == false) {
mute = true;
menu_tune.setVolume(0);
info.mute_btn.gotoAndStop(2);
} else {
mute = false;
menu_tune.setVolume(100);
info.mute_btn.gotoAndStop(1);
}
};
myscore = Math.floor(myscore);
if (player.hp < 1) {
doRemove(_root);
gameover_type = 1;
_root.gotoAndPlay("gameover");
}
if (level == 21) {
doRemove(_root);
gameover_type = 2;
_root.gotoAndPlay("gameover");
}
test_area._x = player._x;
test_area._y = player._y;
test_area._rotation = player._rotation;
shoot = false;
if ((player.current_clip <= 0) and (player.ammo > 0)) {
info.reloading_txt._visible = true;
info.reloading_bar._visible = true;
info.relaoding_bar._width = player.reloadspeed;
reload = reload + 2;
info.reloading_bar._width = player.reloadspeed - reload;
if (reload >= player.reloadspeed) {
if (player.ammo >= player.clipsize) {
player.current_clip = player.current_clip + player.clipsize;
player.ammo = player.ammo - player.clipsize;
_root[player.weapon + "ammo"] = _root[player.weapon + "ammo"] - player.clipsize;
_root[player.weapon + "currentammo"] = _root[player.weapon + "currentammo"] + player.clipsize;
} else {
player.current_clip = player.current_clip + player.ammo;
player.ammo = 0;
}
reload = 0;
info.reloading_txt._visible = false;
info.reloading_bar._visible = false;
}
}
if (adrenaline_skill) {
if (_root.info.ragebar._width >= adrenaline_cost) {
_root.info.ragebar._width = _root.info.ragebar._width - adrenaline_cost;
if (adrenaline_count < 31) {
adrenaline_count++;
}
} else {
adrenaline_skill = false;
removeMovieClip(_root.skill_holder.adrenaline);
}
} else if (adrenaline_count < 31) {
adrenaline_count++;
}
if (xattack_skill) {
if (_root.info.ragebar._width >= xattack_cost) {
_root.info.ragebar._width = _root.info.ragebar._width - xattack_cost;
if (xattack_count < 31) {
xattack_count++;
}
} else {
xattack_skill = false;
removeMovieClip(_root.skill_holder.xattack);
}
} else if (xattack_count < 31) {
xattack_count++;
}
_root.info.lifebar._width = player.hp / 100;
if (Key.isDown(88)) {
if (((xattack_skill == false) and (_root.info.ragebar._width >= xattack_startcost)) and (xattack_count > 29)) {
_root.skill_holder.attachMovie("xattack", "xattack", _root.skill_holder.getNextHighestDepth(), {_x:0, _y:-500});
xattack_skill = true;
_root.info.ragebar._width = _root.info.ragebar._width - xattack_startcost;
xattack_count = 0;
} else if (xattack_count > 30) {
xattack_skill = false;
removeMovieClip(_root.skill_holder.xattack);
xattack_count = 0;
}
}
if (Key.isDown(90)) {
if (((adrenaline_skill == false) and (_root.info.ragebar._width >= adrenaline_startcost)) and (adrenaline_count > 29)) {
_root.skill_holder.attachMovie("adrenaline", "adrenaline", _root.getNextHighestDepth(), {_x:0, _y:-500});
adrenaline_skill = true;
_root.info.ragebar._width = _root.info.ragebar._width - adrenaline_startcost;
adrenaline_count = 0;
} else if (adrenaline_count > 30) {
adrenaline_skill = false;
removeMovieClip(_root.skill_holder.adrenaline);
adrenaline_count = 0;
}
}
if (Key.isDown(69)) {
if ((earthquake_skill == false) and (_root.info.ragebar._width >= earthquake_cost)) {
attachMovie("earthquake", "earthquake", _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
earthquake_skill = true;
_root.info.ragebar._width = _root.info.ragebar._width - earthquake_cost;
earthquakesound.start();
}
}
if (earthquake._width < earthquake_distance) {
earthquake._width = earthquake._width + (earthquake_distance / 10);
earthquake._height = earthquake._height + (earthquake_distance / 10);
earthquake._alpha = earthquake._alpha - 10;
earthquake_count = 0;
} else {
removeMovieClip("earthquake");
earthquake_count++;
if (earthquake_count > 40) {
earthquake_skill = false;
}
}
if (Key.isDown(81)) {
if ((boom_skill == false) and (_root.info.ragebar._width >= boom_cost)) {
attachMovie("boom", "boom", _root.getNextHighestDepth(), {_x:player._x, _y:player._y});
boom_skill = true;
_root.info.ragebar._width = _root.info.ragebar._width - boom_cost;
boop.start();
}
}
if (boom._width < boom_distance) {
boom._width = boom._width + (boom_distance / 10);
boom._height = boom._height + (boom_distance / 10);
boom._alpha = boom._alpha - 10;
boom_count = 0;
} else {
removeMovieClip("boom");
boom_count++;
if (boom_count > 40) {
boom_skill = false;
}
}
if (Key.isDown(49)) {
if (reload == 0) {
player.power = pistolpower;
player.delay = pistoldelay;
player.reloadspeed = pistolreloadspeed;
player.clipsize = pistolclipsize;
player.ammo = pistolammo;
if (pistolammo > pistolclipsize) {
player.current_clip = pistolcurrentammo;
} else {
player.current_clip = pistolammo;
}
player.weapon = "pistol";
}
} else if (Key.isDown(50) and AK47bought) {
if (reload == 0) {
player.power = AK47power;
player.delay = AK47delay;
player.reloadspeed = AK47reloadspeed;
player.clipsize = AK47clipsize;
player.ammo = AK47ammo;
if (AK47ammo > AK47clipsize) {
player.current_clip = AK47currentammo;
} else {
player.current_clip = AK47ammo;
}
player.weapon = "AK47";
}
} else if (Key.isDown(51) and magnumbought) {
if (reload == 0) {
player.power = magnumpower;
player.delay = magnumdelay;
player.reloadspeed = magnumreloadspeed;
player.clipsize = magnumclipsize;
player.ammo = magnumammo;
if (magnumammo > magnumclipsize) {
player.current_clip = magnumcurrentammo;
} else {
player.current_clip = magnumammo;
}
player.weapon = "magnum";
}
} else if (Key.isDown(52) and shotgunbought) {
if (reload == 0) {
player.power = shotgunpower;
player.delay = shotgundelay;
player.reloadspeed = shotgunreloadspeed;
player.clipsize = shotgunclipsize;
player.ammo = shotgunammo;
if (shotgunammo > shotgunclipsize) {
player.current_clip = shotguncurrentammo;
} else {
player.current_clip = shotgunammo;
}
player.weapon = "shotgun";
}
}
if (Key.isDown(37) or Key.isDown(65)) {
if ((full_area._x < 0) and (player._x < 250)) {
offsetx = offsetx - walk_speed;
full_area._x = full_area._x + walk_speed;
minion_holder._x = minion_holder._x + walk_speed;
splat_holder._x = splat_holder._x + walk_speed;
cash_holder._x = cash_holder._x + walk_speed;
} else {
player._x = player._x - walk_speed;
}
if (run == false) {
run = true;
player.gotoAndPlay(player.weapon + "_walk");
}
} else if (Key.isDown(39) or Key.isDown(68)) {
if ((full_area._x > 0) and (player._x > 250)) {
offsetx = offsetx + walk_speed;
full_area._x = full_area._x - walk_speed;
minion_holder._x = minion_holder._x - walk_speed;
splat_holder._x = splat_holder._x - walk_speed;
cash_holder._x = cash_holder._x - walk_speed;
} else {
player._x = player._x + walk_speed;
}
if (run == false) {
run = true;
player.gotoAndPlay(player.weapon + "_walk");
}
}
if (Key.isDown(38) or Key.isDown(87)) {
if ((full_area._y < 0) and (player._y < 200)) {
offsety = offsety - walk_speed;
full_area._y = full_area._y + walk_speed;
minion_holder._y = minion_holder._y + walk_speed;
splat_holder._y = splat_holder._y + walk_speed;
cash_holder._y = cash_holder._y + walk_speed;
} else {
player._y = player._y - walk_speed;
}
if (run == false) {
run = true;
player.gotoAndPlay(player.weapon + "_walk");
}
} else if (Key.isDown(40) or Key.isDown(83)) {
if ((full_area._y > -400) and (player._y > 200)) {
offsety = offsety + walk_speed;
full_area._y = full_area._y - walk_speed;
minion_holder._y = minion_holder._y - walk_speed;
splat_holder._y = splat_holder._y - walk_speed;
cash_holder._y = cash_holder._y - walk_speed;
} else {
player._y = player._y + walk_speed;
}
if (run == false) {
run = true;
player.gotoAndPlay(player.weapon + "_walk");
}
}
if ((((((((!Key.isDown(37)) and (!Key.isDown(39))) and (!Key.isDown(40))) and (!Key.isDown(38))) and (!Key.isDown(65))) and (!Key.isDown(68))) and (!Key.isDown(83))) and (!Key.isDown(87))) {
run = false;
player.gotoAndStop(player.weapon + "_stand");
}
onMouseDown = function () {
if (can_shoot == false) {
can_shoot = true;
n++;
}
};
if (can_shoot) {
removeMovieClip(line);
if (modes == "line") {
attachMovie("line", "line", 100, {_x:player._x, _y:player._y});
dist_x = (player._x - _root._xmouse) - Math.cos(angle);
dist_y = (player._y - _root._ymouse) - Math.sin(angle);
angle = Math.atan2(dist_y, dist_x);
i = 0;
while (i < 10) {
line._x = player._x - ((i * 40) * Math.cos(angle));
line._y = player._y - ((i * 40) * Math.sin(angle));
v = 1;
while (v < (monsters_placed + 1)) {
monsternum = 999999 /* 0x0F423F */;
shot = false;
if (line.hitTest(_root.minion_holder["minion" + v])) {
shot = true;
monsternum = v;
v = monsters_placed + 1;
i = 401;
}
v++;
}
i++;
}
} else if (modes == "cursor") {
var v = starting;
while (v < (monsters_placed + 1)) {
monster = _root.minion_holder["minion" + v];
if (monster.hitTest(cursor)) {
shot = true;
monsternum = v;
}
v++;
}
}
}
onMouseUp = function () {
can_shoot = false;
};
delay++;
if (delay >= player.delay) {
if (can_shoot == true) {
if (player.weapon != "AK47") {
can_shoot = false;
}
shoot = true;
effect = true;
delay = 0;
}
} else {
shoot = false;
}
var v = 1;
while (v < (monsters_placed + 1)) {
monster = _root.minion_holder["minion" + v];
if (earthquake_skill) {
if (monster.hitTest(earthquake)) {
_root.splat_holder.attachMovie("blood_splat", "blood_splat", splat_holder.getNextHighestDepth(), {_x:monster._x, _y:monster._y});
splat_num = Math.floor(Math.random() * 3) + 1;
splat_holder.blood_splat.gotoAndStop(splat_num);
var _local3 = new flash.geom.Matrix();
var _local4 = new flash.geom.Matrix();
_local4.translate(monster._x, monster._y);
_local3.rotate(monster._rotation);
_local3.concat(_local4);
bitmapData_2.draw(splat_holder.blood_splat, _local3);
removeMovieClip(splat_holder.blood_splat);
monster.hp = monster.hp - earthquake_damage;
if (monster.hp < 1) {
expamount = Math.floor(Math.random() * 25);
exp = exp + expamount;
myscore = myscore + expamount;
should_drop = (cashamount = Math.floor(Math.random() * 4));
if (should_drop == 1) {
_root.cash_holder.attachMovie("cash0", "cash0" + cash_num, cash_holder.getNextHighestDepth(), {_x:monster._x, _y:monster._y});
_root.cash_holder["cash0" + cash_num]._rotation = ((angle / Math.PI) * 180) - 90;
cash_num++;
}
total_monsters--;
monster.gotoAndStop(32);
_local3 = new flash.geom.Matrix();
_local4 = new flash.geom.Matrix();
_local4.translate(monster._x, monster._y);
_local3.rotate(monster._rotation);
_local3.concat(_local4);
bitmapData_2.draw(monster, _local3);
removeMovieClip(monster);
myscore = myscore + 10;
}
}
}
if ((shoot == true) and (shot == true)) {
monster_shot = _root.minion_holder["minion" + monsternum];
if (player.current_clip > 0) {
if (xattack_skill) {
monster_shot.hp = monster_shot.hp - (player.power * xattack_speed);
} else {
monster_shot.hp = monster_shot.hp - player.power;
}
_root.splat_holder.attachMovie("blood_splat", "blood_splat", splat_holder.getNextHighestDepth(), {_x:monster_shot._x, _y:monster_shot._y});
splat_num = Math.floor(Math.random() * 3) + 1;
splat_holder.blood_splat.gotoAndStop(splat_num);
var _local3 = new flash.geom.Matrix();
var _local4 = new flash.geom.Matrix();
_local4.translate(monster_shot._x, monster_shot._y);
_local3.rotate(monster_shot._rotation);
_local3.concat(_local4);
bitmapData_2.draw(splat_holder.blood_splat, _local3);
removeMovieClip(splat_holder.blood_splat);
waypoint_x = _root.player._x;
waypoint_y = _root.player._y;
dist_x = (waypoint_x - _root._xmouse) - Math.cos(angle);
dist_y = (waypoint_y - _root._ymouse) - Math.sin(angle);
angle = Math.atan2(dist_y, dist_x);
_root.splat_holder["blood_splat" + v]._rotation = ((angle / Math.PI) * 180) - 90;
if (monster_shot.hp < 1) {
if (_root.info.ragebar._width < ragebarmax) {
_root.info.ragebar._width = _root.info.ragebar._width + (monster_shot.damage / 10);
}
splat.start();
zombie_moan.start();
expamount = Math.floor(Math.random() * 25);
exp = exp + expamount;
myscore = myscore + expamount;
should_drop = (cashamount = Math.floor(Math.random() * 4));
if (should_drop == 1) {
_root.cash_holder.attachMovie("cash0", "cash0" + cash_num, cash_holder.getNextHighestDepth(), {_x:monster_shot._x, _y:monster_shot._y});
_root.cash_holder["cash0" + cash_num]._rotation = ((angle / Math.PI) * 180) - 90;
cash_num++;
}
total_monsters--;
monster_shot.gotoAndStop(32);
_local3 = new flash.geom.Matrix();
_local4 = new flash.geom.Matrix();
_local4.translate(monster_shot._x, monster_shot._y);
_local3.rotate(monster_shot._rotation);
_local3.concat(_local4);
bitmapData_2.draw(monster_shot, _local3);
removeMovieClip(monster_shot);
myscore = myscore + 10;
shoot = false;
}
}
monsternum = "";
}
v++;
}
var v = 0;
while (v < (cash_num + 1)) {
if (_root.cash_holder["cash0" + v].hitTest(player._x, player._y)) {
removeMovieClip(_root.cash_holder["cash0" + v]);
if (level < 4) {
cashamount = Math.floor(Math.random() * 100);
} else {
cashamount = Math.floor(Math.random() * 100);
}
cash = cash + cashamount;
myscore = myscore + cashamount;
}
v++;
}
if (effect == true) {
if (player.current_clip > 0) {
player.gotoAndPlay(player.weapon + "_shoot");
player.current_clip--;
effect = false;
if (player.weapon == "pistol") {
pistol_shot.start();
pistolcurrentammo--;
}
if (player.weapon == "AK47") {
ak47_shot.start();
AK47currentammo--;
}
if (player.weapon == "magnum") {
magnum_shot.start();
magnumcurrentammo--;
}
if (player.weapon == "shotgun") {
shotgun_shot.start();
shotguncurrentammo--;
}
}
}
while (_root.environment.hitTest(this._x, this._y + radius, true)) {
this._y--;
}
while (_root.environment.hitTest(this._x, this._y - radius, true)) {
this._y++;
}
while (_root.environment.hitTest(this._x - radius, this._y, true)) {
this._x++;
}
while (_root.environment.hitTest(this._x + radius, this._y, true)) {
this._x--;
}
cursor._x = _root._xmouse;
cursor._y = _root._ymouse;
dist_x = this._x - _root._xmouse;
dist_y = this._y - _root._ymouse;
angle = -Math.atan2(dist_x, dist_y);
this._rotation = angle / (Math.PI/180);
if (monsters_placed < total_to_create) {
new_monster++;
}
randommonster = Math.floor(Math.random() * monster_types);
if (new_monster == mdelay) {
if (level == "endless") {
counting++;
if (counting >= 40) {
starting = starting + 30;
counting = 0;
}
endless_count++;
if (endless_count >= 25) {
if (mdelay > 20) {
mdelay = mdelay - 10;
}
if (monster_types < 20) {
monster_types = monster_types + 2;
}
endless_count = 0;
}
}
monsters_placed++;
new_monster = 0;
mdirection = Math.floor(Math.random() * 4);
if (mdirection == 0) {
randomx = Math.floor(Math.random() * 500);
randomy = -20;
} else if (mdirection == 1) {
randomx = Math.floor(Math.random() * 500);
randomy = 820;
} else if (mdirection == 2) {
randomx = -20;
randomy = Math.floor(Math.random() * 800);
} else if (mdirection == 3) {
randomx = 520;
randomy = Math.floor(Math.random() * 800);
}
min = minion_holder.attachMovie("minion" + randommonster, "minion" + monsters_placed, minion_holder.getNextHighestDepth(), {_x:randomx, _y:randomy});
min.cacheAsBitmap = true;
if (randommonster == 0) {
minion_holder["minion" + monsters_placed].hp = 2;
min.speed = 0.5;
minion_holder["minion" + monsters_placed].damage = 10;
}
if (randommonster == 1) {
minion_holder["minion" + monsters_placed].hp = 10;
min.speed = 0.3;
minion_holder["minion" + monsters_placed].damage = 10;
}
if (randommonster == 2) {
minion_holder["minion" + monsters_placed].hp = 10;
min.speed = 0.7;
minion_holder["minion" + monsters_placed].damage = 12;
}
if (randommonster == 3) {
minion_holder["minion" + monsters_placed].hp = 20;
min.speed = 0.35;
minion_holder["minion" + monsters_placed].damage = 12;
}
if (randommonster == 4) {
minion_holder["minion" + monsters_placed].hp = 15;
min.speed = 0.9;
minion_holder["minion" + monsters_placed].damage = 14;
}
if (randommonster == 5) {
minion_holder["minion" + monsters_placed].hp = 30;
min.speed = 0.45;
minion_holder["minion" + monsters_placed].damage = 14;
}
if (randommonster == 6) {
minion_holder["minion" + monsters_placed].hp = 20;
min.speed = 1;
minion_holder["minion" + monsters_placed].damage = 16;
}
if (randommonster == 7) {
minion_holder["minion" + monsters_placed].hp = 40;
min.speed = 0.5;
minion_holder["minion" + monsters_placed].damage = 16;
}
if (randommonster == 8) {
minion_holder["minion" + monsters_placed].hp = 25;
min.speed = 1.2;
minion_holder["minion" + monsters_placed].damage = 20;
}
if (randommonster == 9) {
minion_holder["minion" + monsters_placed].hp = 50;
min.speed = 0.6;
minion_holder["minion" + monsters_placed].damage = 20;
} else if (randommonster == 10) {
minion_holder["minion" + monsters_placed].hp = 30;
min.speed = 1.2;
minion_holder["minion" + monsters_placed].damage = 25;
} else if (randommonster == 11) {
minion_holder["minion" + monsters_placed].hp = 60;
min.speed = 0.6;
minion_holder["minion" + monsters_placed].damage = 25;
} else if (randommonster == 12) {
minion_holder["minion" + monsters_placed].hp = 35;
min.speed = 1.3;
minion_holder["minion" + monsters_placed].damage = 30;
} else if (randommonster == 13) {
minion_holder["minion" + monsters_placed].hp = 70;
min.speed = 0.65;
minion_holder["minion" + monsters_placed].damage = 30;
} else if (randommonster == 14) {
minion_holder["minion" + monsters_placed].hp = 40;
min.speed = 1.4;
minion_holder["minion" + monsters_placed].damage = 32;
} else if (randommonster == 15) {
minion_holder["minion" + monsters_placed].hp = 80;
min.speed = 0.7;
minion_holder["minion" + monsters_placed].damage = 32;
} else if (randommonster == 16) {
minion_holder["minion" + monsters_placed].hp = 45;
min.speed = 1.5;
minion_holder["minion" + monsters_placed].damage = 35;
} else if (randommonster == 17) {
minion_holder["minion" + monsters_placed].hp = 90;
min.speed = 0.75;
minion_holder["minion" + monsters_placed].damage = 38;
} else if (randommonster == 18) {
minion_holder["minion" + monsters_placed].hp = 50;
min.speed = 1.6;
minion_holder["minion" + monsters_placed].damage = 40;
} else if (randommonster == 19) {
minion_holder["minion" + monsters_placed].hp = 100;
min.speed = 0.8;
minion_holder["minion" + monsters_placed].damage = 40;
}
min.onEnterFrame = function () {
waypoint_x = _root.player._x + offsetx;
waypoint_y = _root.player._y + offsety;
dist_x = (waypoint_x - this._x) - (Math.cos(angle) * 20);
dist_y = (waypoint_y - this._y) - (Math.sin(angle) * 20);
angle = Math.atan2(dist_y, dist_x);
if (boom_skill) {
if (this.hitTest(boom)) {
this._x = this._x - (20 * Math.cos(angle));
this._y = this._y - (20 * Math.sin(angle));
}
}
if (this.hitTest(test_area)) {
player.hp = player.hp - this.damage;
myscore = myscore - (this.damage / 100);
_root.info.ragebar._width = _root.info.ragebar._width - (this.damage / 100);
this.stop;
} else {
if (adrenaline_skill) {
this._x = this._x + ((this.speed * adrenaline_speed) * Math.cos(angle));
this._y = this._y + ((this.speed * adrenaline_speed) * Math.sin(angle));
} else {
this._x = this._x + (this.speed * Math.cos(angle));
this._y = this._y + (this.speed * Math.sin(angle));
}
this._rotation = ((angle / Math.PI) * 180) - 90;
}
};
}
if ((total_monsters == 0) and (!interlevel_placed)) {
if (!winattached) {
myscore = myscore + (level * 100);
_root.attachMovie("youwin", "youwin", _root.getNextHighestDepth(), {_x:75, _y:100});
winattached = true;
}
overcount++;
if (youwin.mask._width < 350) {
youwin.mask._width = youwin.mask._width + 2;
}
if (overcount > 280) {
player_life = player.hp;
player_rage = _root.info.ragebar._width;
_root.cash_txt.text = _root.cash;
_root.exp_txt.text = _root.exp;
interlevel_placed = true;
doRemove(_root);
overcount = 0;
_root.gotoAndStop("interlevel");
}
}
};
Frame 8
stop();
Frame 9
stop();
Mouse.show();
playername = "player";
if (gameover_type == 1) {
gameover_txt.gotoAndStop(1);
}
if (gameover_type == 2) {
gameover_txt.gotoAndStop(2);
}
level = 1;
submit.onPress = function () {
if (level == "endless") {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect("bf22a5506157e080");
mochi.MochiScores.showLeaderboard({boardID:"485cbdb606f1c597", score:myscore});
} else {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect("bf22a5506157e080");
mochi.MochiScores.showLeaderboard({boardID:"fbfcc461a5aba4bf", score:myscore});
mochi.MochiScores.showLeaderboard({boardID:"fbfcc461a5aba4bf"});
}
};
menu_btn.onPress = function () {
_root.gotoAndPlay(1);
};
Symbol 29 MovieClip [blood_splat] Frame 1
stop();
Symbol 29 MovieClip [blood_splat] Frame 2
stop();
Symbol 29 MovieClip [blood_splat] Frame 3
stop();
Symbol 31 MovieClip [minion18] Frame 26
gotoAndPlay (1);
Symbol 31 MovieClip [minion18] Frame 32
stop();
Symbol 37 MovieClip [minion16] Frame 26
gotoAndPlay (1);
Symbol 37 MovieClip [minion16] Frame 32
stop();
Symbol 43 MovieClip [minion14] Frame 26
gotoAndPlay (1);
Symbol 43 MovieClip [minion14] Frame 32
stop();
Symbol 49 MovieClip [minion12] Frame 26
gotoAndPlay (1);
Symbol 49 MovieClip [minion12] Frame 32
stop();
Symbol 55 MovieClip [minion10] Frame 26
gotoAndPlay (1);
Symbol 55 MovieClip [minion10] Frame 32
stop();
Symbol 61 MovieClip [minion13] Frame 26
gotoAndPlay (1);
Symbol 61 MovieClip [minion13] Frame 32
stop();
Symbol 67 MovieClip [minion19] Frame 26
gotoAndPlay (1);
Symbol 67 MovieClip [minion19] Frame 32
stop();
Symbol 73 MovieClip [minion17] Frame 26
gotoAndPlay (1);
Symbol 73 MovieClip [minion17] Frame 32
stop();
Symbol 79 MovieClip [minion15] Frame 26
gotoAndPlay (1);
Symbol 79 MovieClip [minion15] Frame 32
stop();
Symbol 85 MovieClip [minion11] Frame 26
gotoAndPlay (1);
Symbol 85 MovieClip [minion11] Frame 32
stop();
Symbol 93 MovieClip [skill_btn] Frame 1
stop();
Symbol 93 MovieClip [skill_btn] Frame 2
stop();
Symbol 98 MovieClip [btn] Frame 1
stop();
Symbol 98 MovieClip [btn] Frame 2
stop();
Symbol 142 MovieClip [minion6] Frame 26
gotoAndPlay (1);
Symbol 148 MovieClip [minion4] Frame 26
gotoAndPlay (1);
Symbol 154 MovieClip [minion2] Frame 26
gotoAndPlay (1);
Symbol 160 MovieClip [minion5] Frame 26
gotoAndPlay (1);
Symbol 166 MovieClip [minion7] Frame 26
gotoAndPlay (1);
Symbol 172 MovieClip [minion9] Frame 26
gotoAndPlay (1);
Symbol 178 MovieClip [minion3] Frame 26
gotoAndPlay (1);
Symbol 184 MovieClip [minion1] Frame 26
gotoAndPlay (1);
Symbol 190 MovieClip [minion8] Frame 26
gotoAndPlay (1);
Symbol 210 MovieClip [pistol_btn] Frame 1
stop();
Symbol 210 MovieClip [pistol_btn] Frame 2
stop();
Symbol 213 MovieClip Frame 1
stop();
Symbol 213 MovieClip Frame 2
stop();
Symbol 216 MovieClip [magnum_btn] Frame 1
stop();
Symbol 216 MovieClip [magnum_btn] Frame 2
stop();
Symbol 218 MovieClip [shotgun_btn] Frame 1
stop();
Symbol 218 MovieClip [shotgun_btn] Frame 2
stop();
Symbol 225 MovieClip [boom_btn] Frame 1
stop();
Symbol 225 MovieClip [boom_btn] Frame 2
stop();
Symbol 228 MovieClip Frame 1
stop();
Symbol 228 MovieClip Frame 2
stop();
Symbol 230 MovieClip Frame 1
play();
Symbol 231 MovieClip Frame 1
stop();
Symbol 231 MovieClip Frame 2
stop();
Symbol 233 MovieClip [xdmg_btn] Frame 1
stop();
Symbol 233 MovieClip [xdmg_btn] Frame 2
stop();
Symbol 250 MovieClip [mute] Frame 1
stop();
Symbol 250 MovieClip [mute] Frame 2
stop();
Symbol 364 MovieClip [interlevel] Frame 1
Mouse.show();
stop();
Symbol 402 MovieClip [minion0] Frame 26
gotoAndPlay (1);
Symbol 423 MovieClip [magnum_run] Frame 1
play();
Symbol 431 MovieClip Frame 1
play();
Symbol 452 MovieClip [player] Frame 2
stop();
Symbol 452 MovieClip [player] Frame 4
gotoAndPlay (1);
Symbol 452 MovieClip [player] Frame 5
stop();
Symbol 452 MovieClip [player] Frame 6
stop();
Symbol 452 MovieClip [player] Frame 8
stop();
Symbol 452 MovieClip [player] Frame 10
stop();
Symbol 452 MovieClip [player] Frame 12
stop();
Symbol 452 MovieClip [player] Frame 14
stop();
Symbol 452 MovieClip [player] Frame 16
stop();
Symbol 463 MovieClip Frame 1
stop();
Symbol 472 MovieClip [instructions] Frame 1
stop();
onEnterFrame = function () {
if (this._currentframe <= 1) {
previous._visible = false;
} else {
previous._visible = true;
}
if (this._currentframe >= 3) {
next._visible = false;
} else {
next._visible = true;
}
next.onPress = function () {
gotoAndStop(_currentframe + 1);
};
previous.onPress = function () {
gotoAndStop(_currentframe - 1);
};
play.onPress = function () {
_root.gotoAndPlay("start");
};
};
Symbol 484 MovieClip [splash] Frame 1
stop();
Symbol 521 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 522 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if ((options.clip == null) || (options.clip == undefined)) {
options.clip = mochi.MochiServices.clip;
}
if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (options.score instanceof TextField) {
if (options.score.text != undefined) {
options.score = options.score.text;
}
} else if (options.score instanceof mochi.MochiDigits) {
options.score = options.score.value;
}
var _local1 = Number(options.score);
if (isNaN(_local1)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'");
} else if ((_local1 == Number.NEGATIVE_INFINITY) || (_local1 == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(_local1) != _local1) {
trace(("WARNING: Submitted score '" + options.score) + "' will be truncated");
}
options.score = _local1;
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
score = Number(score);
if (isNaN(score)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'");
} else if ((score == Number.NEGATIVE_INFINITY) || (score == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(score) != score) {
trace(("WARNING: Submitted score '" + String(score)) + "' will be truncated");
}
score = Number(score);
}
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 523 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("1.43");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local3 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servicesURL != undefined) {
_servicesURL = urlOptions().servicesURL;
}
allowDomains(_servicesURL);
_clip = clip.createEmptyMovieClip(_local3, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip((((_servicesURL + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_listenChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_listenChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
trace("connected!");
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((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);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var _local5 = {};
if (_root.mochiad_options) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static var _servicesURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
}
Symbol 524 MovieClip [__Packages.mochi.MochiDigits] Frame 0
class mochi.MochiDigits
{
var Encoder, Fragment, Sibling;
function MochiDigits (digit, index) {
Encoder = 0;
setValue(digit, index);
}
function get value() {
return(Number(toString()));
}
function set value(v) {
setValue(v);
//return(value);
}
function addValue(v) {
value = value + v;
}
function setValue(digit, index) {
var _local3 = digit.toString();
if ((index == undefined) || (isNaN(index))) {
index = 0;
}
Fragment = _local3.charCodeAt(index++) ^ Encoder;
if (index < _local3.length) {
Sibling = new mochi.MochiDigits(digit, index);
} else {
Sibling = null;
}
reencode();
}
function reencode() {
var _local2 = int(2147483647 * Math.random());
Fragment = Fragment ^ (_local2 ^ Encoder);
Encoder = _local2;
}
function toString() {
var _local2 = String.fromCharCode(Fragment ^ Encoder);
return(((Sibling != null) ? (_local2.concat(Sibling.toString())) : (_local2)));
}
}
Symbol 488 Button
on (release) {
getURL ("http://www.mortargames.com", _blank);
}
Symbol 500 MovieClip Frame 1
_root.stop();
gotoAndPlay (2);
Symbol 500 MovieClip Frame 201
_root.play();
Symbol 512 MovieClip Frame 1
stop();