Frame 1
function nothinghere() {
}
function visitSite1() {
_root.getURL("http://www.jflashgaming.com", "_blank");
}
function visitSite2() {
_root.getURL("http://www.badhed.com?ref=the-cursed-beneath_RIGHTCLICK", "_blank");
}
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
var copyrightText0 = new ContextMenuItem("THE CURSED BENEATH 2010", nothinghere, true);
copyrightText0.enabled = false;
myMenu.customItems.push(copyrightText0);
var copyrightText1 = new ContextMenuItem("www.JFLASHGAMING.com", visitSite1);
myMenu.customItems.push(copyrightText1);
var copyrightText2 = new ContextMenuItem("www.BADHED.com", visitSite2);
myMenu.customItems.push(copyrightText2);
_root.menu = myMenu;
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 onConnectError(_status) {
trace("Mochi Analytics Connect Error");
}
__com_mochibot__("6f036b08", this, 10301, true);
mochi.as2.MochiAd.showPreGameAd({id:"92313a47c1e0c604", res:"600x480", background:2105627, color:10737408, outline:13994812, no_bg:true});
mochi.as2.MochiServices.connect("92313a47c1e0c604", root, onConnectError);
Frame 2
function changeTrack() {
if (_root.global_s.getVolume() != 0) {
clearInterval(musicint);
musicint = setInterval(fadeAudio, 50);
}
}
function fadeAudio() {
if (_root.svolume == 0) {
getoutofmyway_s.stop();
laststand_s.stop();
devouringtime_s.stop();
outbreak_s.stop();
clearInterval(musicint2);
musicint2 = setInterval(newTrack, 700);
clearInterval(musicint);
} else {
_root.svolume = _root.svolume - 5;
_root.getoutofmyway_s.setVolume(_root.svolume);
_root.laststand_s.setVolume(_root.svolume);
_root.devouringtime_s.setVolume(_root.svolume);
_root.outbreak_s.setVolume(_root.svolume);
}
}
function newTrack() {
clearInterval(musicint);
musicint = setInterval(fadeAudioIn, 50);
if ((_root.hero.alive == false) || (_root._currentframe != 5)) {
_root.outbreak_s.start(0.3, 100);
}
clearInterval(musicint2);
}
function fadeAudioIn() {
_root.svolume = _root.svolume + 5;
_root.getoutofmyway_s.setVolume(_root.svolume);
_root.laststand_s.setVolume(_root.svolume);
_root.devouringtime_s.setVolume(_root.svolume);
_root.outbreak_s.setVolume(_root.svolume);
if (_root.getoutofmyway_s.getVolume() > 100) {
clearInterval(musicint);
}
}
function fadeCrescendo() {
getoutofmyway_s.setVolume(0);
laststand_s.setVolume(0);
devouringtime_s.setVolume(0);
clearInterval(crescendoint);
crescendoint = setInterval(fadeCrescendoIn, 50);
}
function fadeCrescendoIn() {
getoutofmyway_s.setVolume(getoutofmyway_s.getVolume() + 1);
laststand_s.setVolume(getoutofmyway_s.getVolume());
devouringtime_s.setVolume(getoutofmyway_s.getVolume());
if (getoutofmyway_s.getVolume() > 100) {
clearInterval(crescendoint);
}
}
function playBehemoth_s() {
_root[("behemoth" + (random(4) + 1)) + "_s"].start(0, 1);
}
function playBehemothDeath_s() {
_root.behemothdeath1_s.start(0, 1);
}
function playBrute_s() {
_root[("stalker" + (random(5) + 1)) + "_s"].start(0, 1);
}
function playBruteDeath_s() {
_root[("stalkerdeath" + (random(3) + 1)) + "_s"].start(0, 1);
}
function playStalker_s() {
_root[("brute" + (random(4) + 1)) + "_s"].start(0, 1);
}
function playStalkerDeath_s() {
_root[("brutedeath" + (random(2) + 1)) + "_s"].start(0, 1);
}
function playHero_s() {
_root[("hero" + (random(4) + 1)) + "_s"].start(0, 1);
}
function playHeroDeath_s() {
_root[("herodeath" + (random(1) + 1)) + "_s"].start(0, 1);
}
function proximityCheck(_xpos, _ypos) {
if ((((_xpos > (((-_root._x) / 2) - 30)) && (_xpos < ((((-_root._x) / 2) + 300) + 30))) && (_ypos > (((-_root._y) / 2) - 30))) && (_ypos < ((((-_root._y) / 2) + 240) + 30))) {
return(true);
}
return(false);
}
var global_s = new Sound(this);
_root.global_s.setVolume(80);
svolume = 100;
_root.createEmptyMovieClip("deadvillage_s", 799996);
var deadvillage_s = new Sound(deadvillage_s);
deadvillage_s.attachSound("deadvillage");
deadvillage_s.setVolume(35);
deadvillage_s.start(0, 9999);
_root.createEmptyMovieClip("outbreak_s", 799997);
var outbreak_s = new Sound(outbreak_s);
outbreak_s.attachSound("outbreak");
_root.createEmptyMovieClip("getoutofmyway_s", 799998);
var getoutofmyway_s = new Sound(getoutofmyway_s);
getoutofmyway_s.attachSound("getoutofmyway");
getoutofmyway_s.setVolume(80);
_root.createEmptyMovieClip("laststand_s", 799999);
var laststand_s = new Sound(laststand_s);
laststand_s.attachSound("laststand");
_root.createEmptyMovieClip("devouringtime_s", 800001);
var devouringtime_s = new Sound(devouringtime_s);
devouringtime_s.attachSound("devouringtime");
devouringtime_s.setVolume(80);
_root.createEmptyMovieClip("behemoth1_s", 800004);
var behemoth1_s = new Sound(behemoth1_s);
behemoth1_s.attachSound("behemoth1");
_root.createEmptyMovieClip("behemoth2_s", 800005);
var behemoth2_s = new Sound(behemoth2_s);
behemoth2_s.attachSound("behemoth2");
_root.createEmptyMovieClip("behemoth3_s", 800006);
var behemoth3_s = new Sound(behemoth3_s);
behemoth3_s.attachSound("behemoth3");
_root.createEmptyMovieClip("behemoth4_s", 800007);
var behemoth4_s = new Sound(behemoth4_s);
behemoth4_s.attachSound("behemoth4");
_root.createEmptyMovieClip("behemothdeath1_s", 800008);
var behemothdeath1_s = new Sound(behemothdeath1_s);
behemothdeath1_s.attachSound("behemothdeath1");
_root.createEmptyMovieClip("brute1_s", 800009);
var brute1_s = new Sound(brute1_s);
brute1_s.attachSound("brute1");
_root.createEmptyMovieClip("brute2_s", 800010);
var brute2_s = new Sound(brute2_s);
brute2_s.attachSound("brute2");
_root.createEmptyMovieClip("brute3_s", 800011);
var brute3_s = new Sound(brute3_s);
brute3_s.attachSound("brute3");
_root.createEmptyMovieClip("brute4_s", 800012);
var brute4_s = new Sound(brute4_s);
brute4_s.attachSound("brute4");
_root.createEmptyMovieClip("brute5_s", 800013);
var brute5_s = new Sound(brute5_s);
brute5_s.attachSound("brute5");
_root.createEmptyMovieClip("brutedeath1_s", 800014);
var brutedeath1_s = new Sound(brutedeath1_s);
brutedeath1_s.attachSound("brutedeath1");
_root.createEmptyMovieClip("brutedeath2_s", 800015);
var brutedeath2_s = new Sound(brutedeath2_s);
brutedeath2_s.attachSound("brutedeath2");
_root.createEmptyMovieClip("brutedeath3_s", 800016);
var brutedeath3_s = new Sound(brutedeath3_s);
brutedeath3_s.attachSound("brutedeath3");
brute1_s.setVolume(60);
brute2_s.setVolume(60);
brute3_s.setVolume(60);
brute4_s.setVolume(60);
brute5_s.setVolume(60);
brutedeath1_s.setVolume(60);
brutedeath2_s.setVolume(60);
brutedeath3_s.setVolume(60);
_root.createEmptyMovieClip("stalker1_s", 800017);
var stalker1_s = new Sound(stalker1_s);
stalker1_s.attachSound("stalker1");
_root.createEmptyMovieClip("stalker2_s", 800018);
var stalker2_s = new Sound(stalker2_s);
stalker2_s.attachSound("stalker2");
_root.createEmptyMovieClip("stalker3_s", 800019);
var stalker3_s = new Sound(stalker3_s);
stalker3_s.attachSound("stalker3");
_root.createEmptyMovieClip("stalker4_s", 800020);
var stalker4_s = new Sound(stalker4_s);
stalker4_s.attachSound("stalker4");
_root.createEmptyMovieClip("stalkerdeath1_s", 800021);
var stalkerdeath1_s = new Sound(stalkerdeath1_s);
stalkerdeath1_s.attachSound("stalkerdeath1");
_root.createEmptyMovieClip("stalkerdeath2_s", 800022);
var stalkerdeath2_s = new Sound(stalkerdeath2_s);
stalkerdeath2_s.attachSound("stalkerdeath2");
_root.createEmptyMovieClip("hero1_s", 800023);
var hero1_s = new Sound(hero1_s);
hero1_s.attachSound("hero1");
_root.createEmptyMovieClip("hero2_s", 800024);
var hero2_s = new Sound(hero2_s);
hero2_s.attachSound("hero2");
_root.createEmptyMovieClip("hero3_s", 800025);
var hero3_s = new Sound(hero3_s);
hero3_s.attachSound("hero3");
_root.createEmptyMovieClip("hero4_s", 800026);
var hero4_s = new Sound(hero4_s);
hero4_s.attachSound("hero4");
_root.createEmptyMovieClip("herodeath1_s", 800027);
var herodeath1_s = new Sound(herodeath1_s);
herodeath1_s.attachSound("herodeath1");
_root.createEmptyMovieClip("reload_s", 800029);
var reload_s = new Sound(reload_s);
reload_s.attachSound("reload");
reload_s.setVolume(60);
_root.createEmptyMovieClip("belch_s", 800030);
var belch_s = new Sound(belch_s);
belch_s.attachSound("belch");
belch_s.setVolume(20);
_root.createEmptyMovieClip("smash_s", 800031);
var smash_s = new Sound(smash_s);
smash_s.attachSound("smash");
smash_s.setVolume(35);
_root.createEmptyMovieClip("splat_s", 800032);
var splat_s = new Sound(splat_s);
splat_s.attachSound("splat");
splat_s.setVolume(30);
_root.createEmptyMovieClip("beep_s", 800033);
var beep_s = new Sound(beep_s);
beep_s.attachSound("beep");
_root.createEmptyMovieClip("fire_s", 800034);
var fire_s = new Sound(fire_s);
fire_s.attachSound("fire");
_root.createEmptyMovieClip("gong_s", 800035);
var gong_s = new Sound(gong_s);
gong_s.attachSound("gong");
gong_s.setVolume(40);
_root.createEmptyMovieClip("rocksmash_s", 800036);
var rocksmash_s = new Sound(rocksmash_s);
rocksmash_s.attachSound("rocksmash");
rocksmash_s.setVolume(80);
_root.createEmptyMovieClip("stalkerboss_s", 800037);
var stalkerboss_s = new Sound(stalkerboss_s);
stalkerboss_s.attachSound("stalkerboss");
_root.createEmptyMovieClip("bruteboss_s", 800038);
var bruteboss_s = new Sound(bruteboss_s);
bruteboss_s.attachSound("bruteboss");
_root.createEmptyMovieClip("rumble_s", 800039);
var rumble_s = new Sound(rumble_s);
rumble_s.attachSound("rumble");
_root.createEmptyMovieClip("gunfire1_s", 800040);
var gunfire1_s = new Sound(gunfire1_s);
gunfire1_s.attachSound("gunfire1");
gunfire1_s.setVolume(40);
_root.createEmptyMovieClip("gunfire2_s", 800041);
var gunfire2_s = new Sound(gunfire2_s);
gunfire2_s.attachSound("gunfire2");
gunfire2_s.setVolume(25);
_root.createEmptyMovieClip("gunfire3_s", 800042);
var gunfire3_s = new Sound(gunfire3_s);
gunfire3_s.attachSound("gunfire3");
gunfire3_s.setVolume(40);
_root.createEmptyMovieClip("gunfire4_s", 800043);
var gunfire4_s = new Sound(gunfire4_s);
gunfire4_s.attachSound("gunfire4");
gunfire4_s.setVolume(30);
_root.createEmptyMovieClip("gunfire5_s", 800044);
var gunfire5_s = new Sound(gunfire5_s);
gunfire5_s.attachSound("gunfire5");
gunfire5_s.setVolume(40);
_root.createEmptyMovieClip("gunfire6_s", 800045);
var gunfire6_s = new Sound(gunfire6_s);
gunfire6_s.attachSound("gunfire6");
gunfire6_s.setVolume(65);
_root.createEmptyMovieClip("gunfire7_s", 800046);
var gunfire7_s = new Sound(gunfire7_s);
gunfire7_s.attachSound("gunfire7");
gunfire7_s.setVolume(50);
function deleteSave() {
myLSO = SharedObject.getLocal("lsmf21");
myObj = undefined;
myLSO.data.myObj = myObj;
myLSO.flush();
_root.newGame();
_root.menu_mc.loadbox.text = "Save file deleted";
_root.menu_mc.deletesave._x = -1000;
}
function saveGame() {
myLSO = SharedObject.getLocal("lsmf21");
myObj = {};
myObj.objArray = new Array();
myObj.objArray[0] = _root.hero_lastlevel;
myObj.objArray[1] = _root.hero_points;
myObj.objArray[2] = _root.hero_weapons;
myObj.objArray[3] = _root.effects;
myObj.objArray[4] = _root.difficultymod;
myLSO.data.myObj = myObj;
myLSO.flush();
}
function loadGame() {
myLSO = SharedObject.getLocal("lsmf21");
if (myLSO.data.myObj == undefined) {
_root.menu_mc.loadbox.text = "Save file not found \nGame saves automatically";
_root.menu_mc.deletesave._x = -1000;
} else {
_root.menu_mc.loadbox.text = "Save file loaded";
_root.hero_lastlevel = myLSO.data.myObj.objArray[0];
_root.hero_points = myLSO.data.myObj.objArray[1];
_root.hero_weapons = myLSO.data.myObj.objArray[2];
_root.effects = myLSO.data.myObj.objArray[3];
_root.difficultymod = myLSO.data.myObj.objArray[4];
}
}
level01A = "00000:39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:39,0,0,0,0,0,0,67,0,0,0,0,0,0,67,0,0,0,0,0,0,0,39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,0,0,4702,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:39,0,0,0,4904,0,0,0,0,0,0,0,0,0,0,0,62,0,0,0,0,0,4702,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:4703,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:4703,0,66,0,0,0,0,0,0,62,0,0,0,66,0,0,0,0,65,0,64,0,39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:4803,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,39,39,39,39,39,0,0,0,0,0,0,0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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0";
level03A = "00000:39,39,39,39,39,39,39,39,4702,4802,4702,4702,39,39,39,39,39,39,39,4702,4702,4802,4702,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,0,0:39,0,0,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,0,0,0,0,0,0,67,0,0,0,39,0,0,0,0,0:39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,0,39:39,0,62,0,0,0,0,0,63,0,0,64,0,0,0,0,0,0,0,64,0,0,65,0,0,0,0,0,62,0,0,0,0,0,39,0,0,0,0,0:39,0,0,0,0,0,0,3,3,3,3,3,3,0,0,0,0,0,3,3,3,3,3,3,3,0,0,0,0,0,0,0,0,0,4701,0,0,0,0,0:39,0,0,0,66,0,0,70,0,0,67,0,72,0,0,0,0,0,70,0,0,0,67,0,72,0,0,0,0,0,0,0,0,0,4701,0,0,0,0,0:39,0,0,0,0,0,0,70,62,0,0,0,72,0,0,0,0,0,70,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,4801,0,0,0,0,0:39,63,0,0,0,0,0,70,0,0,0,0,72,0,0,66,0,0,70,0,66,0,0,0,72,0,0,0,0,0,63,0,0,65,39,0,0,0,0,0:39,63,63,0,0,0,0,70,0,0,0,65,72,0,0,0,0,0,70,0,0,4903,0,0,72,0,62,0,0,3,3,3,3,3,39,0,0,0,0,0:39,3,3,3,0,0,0,70,0,0,3,3,3,3,3,0,0,0,70,0,0,0,0,0,72,0,0,0,0,70,0,0,0,0,39,0,0,0,0,0:4701,0,0,72,0,0,0,70,0,0,70,0,0,0,72,0,0,0,70,0,0,0,0,0,72,0,0,0,0,70,0,62,0,0,4701,0,0,0,0,0:4701,0,0,72,0,66,0,70,0,0,70,0,62,0,72,0,0,0,70,0,0,0,0,0,72,0,66,0,0,70,0,0,0,0,4701,0,0,0,0,0:4801,0,0,72,0,0,0,70,0,0,70,64,0,0,72,0,0,0,70,0,65,0,64,0,72,0,0,0,0,70,0,0,0,0,4801,0,0,0,0,0:39,65,he,72,0,0,0,70,0,0,39,39,39,39,39,0,0,0,3,3,3,3,3,3,3,0,0,0,64,70,65,0,63,63,39,0,0,0,0,0:39,39,39,39,39,39,23,23,23,23,39,39,39,39,39,23,23,23,23,23,23,23,23,23,23,23,23,39,39,39,39,39,39,39,39,0,0,0,0,0:39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0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,0,0,0,0,0,0,0,0,0:39,0,70,0,0,3,3,3,3,3,0,62,0,3,3,3,3,0,0,66,0,70,0,62,39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:39,0,70,0,0,70,67,0,0,72,0,0,0,70,67,0,72,0,0,0,0,70,0,0,39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:39,0,70,62,0,70,0,0,66,72,0,65,0,70,0,0,72,0,0,0,0,70,0,0,39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:39,0,70,0,0,70,0,0,0,0,3,3,3,0,0,0,72,0,0,0,0,70,0,0,39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:39,0,70,0,0,70,4901,0,0,0,70,0,72,0,0,62,72,0,4901,0,0,70,0,0,39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:39,0,70,0,0,70,0,0,he,0,70,0,72,0,64,0,72,0,0,0,0,70,0,0,39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:39,23,23,23,23,39,39,39,39,39,23,23,23,39,39,39,39,39,39,39,39,23,23,23,39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0";
level06A = "00000:39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,4803,4803,4703,4803,39,39,39,39,39,39,39,39,39,39,39,39,39,39,4803,4703,4803,4803,39,0:39,0,0,0,0,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,0,67,0,0,0,0,39,0:39,0,0,0,0,0,0,0,0,4901,0,0,0,0,0,0,0,0,0,0,0,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,0:4802,0,0,0,0,0,0,0,65,0,0,0,0,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,0:4802,0,0,0,66,0,0,0,3,3,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,0:4702,0,0,0,0,0,0,0,70,0,67,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4901,0,0,0,0,0,66,0,0,0,4802,0:39,64,0,0,0,0,0,0,70,0,0,72,0,0,0,0,0,0,0,0,0,66,0,0,0,0,0,0,0,0,65,0,0,0,0,0,0,0,4802,0:39,3,3,3,0,0,66,0,70,0,0,72,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,3,3,3,3,0,0,0,0,0,0,0,4702,0:39,0,0,72,0,0,0,0,70,0,0,72,0,0,0,0,3,3,3,3,0,0,0,0,0,0,0,70,0,0,72,0,0,0,0,0,0,0,39,0:39,0,0,72,0,0,0,0,70,0,0,72,0,0,0,0,70,0,0,72,0,0,0,0,0,0,0,70,0,0,72,0,0,0,0,0,0,0,39,0:39,0,0,72,0,0,0,0,70,64,0,72,0,0,0,0,70,0,66,72,0,0,0,0,0,0,0,70,64,0,72,65,0,0,0,0,0,0,39,0:4802,0,0,72,0,0,3,3,3,3,3,3,0,0,0,0,70,0,0,72,0,0,66,0,0,3,3,3,3,3,3,3,3,0,0,0,0,0,39,0:4802,0,66,72,0,0,70,0,67,0,0,72,0,0,0,0,70,0,0,72,0,0,0,0,0,70,0,0,0,0,67,0,72,0,0,0,0,0,39,0:4702,0,0,72,0,0,70,0,0,0,0,72,0,0,3,3,3,3,0,72,0,4901,0,0,0,70,0,66,0,0,0,0,72,0,0,0,0,0,39,0:39,0,64,72,0,he,70,0,0,0,0,72,65,0,70,65,0,72,0,72,0,0,0,0,0,70,0,0,0,0,0,0,72,0,65,0,0,64,39,0:39,39,39,39,39,39,39,23,23,23,23,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,23,23,23,23,23,23,39,39,39,39,39,39,39,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,65,63,0,0,0,0,0,66,0,0,0,0,0,0,0,0,0,0,0,0,4701:39,39,39,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,4801:39,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,70,0,0,0,0,72,0,0,0,0,71,0,0,0,0,0,0,0,64,0,0,63,63,39:39,0,72,0,0,0,0,0,0,73,0,0,0,0,0,0,70,0,0,0,0,72,0,0,0,0,71,0,4904,0,0,0,0,39,39,39,39,39,39,39:39,0,72,0,0,0,0,0,0,73,0,0,0,0,0,0,70,0,0,0,0,72,0,0,0,0,71,0,0,0,0,0,0,70,0,0,67,0,0,39:39,0,72,0,0,0,0,0,0,73,0,64,0,0,0,0,70,0,0,0,0,72,0,0,0,0,71,0,0,0,0,0,0,70,0,0,0,0,0,39:39,0,72,0,0,0,63,0,65,73,0,3,3,0,0,0,70,0,0,0,0,72,0,65,0,63,71,0,65,0,0,0,0,70,0,0,0,0,0,39:39,0,72,0,0,0,3,3,3,3,3,3,3,3,0,0,70,0,0,0,0,3,3,3,3,3,3,3,3,0,0,0,0,70,0,0,0,0,0,39:39,0,72,0,0,0,70,0,0,0,0,0,0,72,0,0,70,0,0,0,0,70,0,0,0,0,0,0,72,0,0,0,0,70,0,0,0,71,0,4702:39,0,72,0,0,0,70,0,0,0,66,0,63,72,0,0,70,0,66,0,0,70,0,0,0,0,0,0,72,0,66,0,0,70,0,0,0,71,0,4702:39,0,72,0,0,0,70,0,0,0,0,0,3,3,3,0,70,0,0,0,0,70,0,0,0,0,0,3,3,0,0,0,0,70,0,0,0,71,0,4802:39,0,72,4904,0,0,70,0,73,0,0,0,70,0,72,0,70,0,0,0,0,70,0,0,0,0,0,70,72,65,0,64,0,70,0,0,0,71,0,39:39,0,72,0,0,0,70,0,73,0,0,0,70,0,72,0,70,0,0,0,0,70,0,0,0,0,0,39,39,39,39,39,39,39,0,0,0,39,39,39:39,0,72,0,0,0,70,0,73,0,0,0,3,3,3,3,3,0,0,0,0,70,0,4903,0,0,0,70,67,0,0,0,0,72,0,0,0,70,0,39:4702,0,72,0,64,0,70,65,73,0,0,0,70,0,0,0,72,0,0,0,0,70,0,0,0,0,0,70,0,0,0,0,0,72,0,64,0,70,0,39:4702,0,72,0,3,3,3,3,3,0,0,0,70,0,0,0,72,0,0,0,0,70,0,0,0,66,0,70,0,0,0,0,0,0,3,3,3,0,0,39:4802,0,72,0,70,0,0,0,72,0,0,0,70,0,0,0,72,65,0,0,0,70,0,0,0,0,0,70,0,0,0,0,0,0,70,0,72,0,0,39:39,63,72,0,70,65,0,0,72,0,63,64,70,0,0,39,39,39,0,0,he,70,0,63,0,0,0,70,0,64,0,65,63,0,70,0,72,0,65,39:39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0";
function createLevel(_input, _type) {
level = _input.split(":");
leveldata = level.splice(0, 1);
k = 0;
while (k < level.length) {
level[k] = level[k].split(",");
k++;
}
_root.vert_limit = 15;
i = 29;
while (i >= 15) {
gcheck = false;
j = 0;
while (j < 40) {
if ((((level[i][j] != 0) && (int(level[i][j]) != 0)) && (level[i][j] != "0\n")) && (level[i][j] != "\n0")) {
gcheck = i;
}
j++;
}
if (gcheck) {
_root.vert_limit = gcheck;
break;
}
i--;
}
j = 39;
while (j >= 0) {
gcheck = false;
i = 0;
while (i < 30) {
if ((((level[i][j] != 0) && (int(level[i][j]) != 0)) && (level[i][j] != "0\n")) && (level[i][j] != "\n0")) {
gcheck = j;
}
i++;
}
if (gcheck) {
_root.hori_limit = gcheck;
break;
}
j--;
}
i = 0;
while (i <= _root.vert_limit) {
j = 0;
while (j < 40) {
if ((int(level[i][j]) >= 39) && (int(level[i][j]) <= 44)) {
level_ground[i][j] = 1;
} else if (level[i][j] == 3) {
level_ground[i][j] = 3;
} else if (((level[i][j].substr(0, 2) == 47) || (level[i][j].substr(0, 2) == 48)) || (level[i][j].substr(0, 2) == 75)) {
level_ground[i][j] = 5;
} else if (level[i][j] == 21) {
level_ground[i][j] = 21;
} else if (level[i][j] == 22) {
level_ground[i][j] = 22;
} else if ((level[i][j] == 23) || (int(level[i][j].substr(0, 2)) == 15)) {
level_ground[i][j] = 23;
if (i >= _root.vert_limit) {
level_ground[i + 1][j] = 1;
}
} else if (level[i][j] == 24) {
level_ground[i][j] = 24;
} else {
level_ground[i][j] = 0;
}
j++;
}
i++;
}
captureShot();
destroyLevel();
closeEditor();
_root._xscale = 200;
_root._yscale = 200;
_root.attachMovie("blacktrans", "blacktrans", 50000);
_root.blacktrans.origx = -_root._x;
_root.blacktrans.origy = -_root._y;
_root.blacktrans.type = _type;
_root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 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
function updateGun() {
_root.hud_mc.gunlabel2.text = weapon_label[_root.hero.gun];
_q = 0;
while (_q < 101) {
_root.hud_mc["bullet" + _q].removeMovieClip();
_q++;
}
_root.hud_mc.reloading.removeMovieClip();
if ((_root["weapon_capacity" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun] < 101) && (!_root.hero.reloading)) {
_q = 0;
while (_q < _root.hero["ammo" + _root.hero.gun]) {
_root.hud_mc.attachMovie("hud_bullet", "bullet" + _q, _q);
if (_q < 50) {
_root.hud_mc["bullet" + _q]._y = 26;
_root.hud_mc["bullet" + _q]._x = 593 - (_q * 4);
} else {
_root.hud_mc["bullet" + _q]._y = 28;
_root.hud_mc["bullet" + _q]._x = (593 - ((_q - 50) * 4)) - 2;
}
_q++;
}
}
if (_root.hero.reloading) {
_root.hud_mc.attachMovie("reloading_mc", "reloading", 0);
_root.hud_mc.reloading._x = 593;
_root.hud_mc.reloading._y = 17;
}
}
function spawnHero(_i, _j) {
_root.hero.removeMovieClip();
_root.attachMovie("hero_mc", "hero", 30999);
if ((_root.currentlevel == "00") && (_root.lastx != undefined)) {
_root.hero._x = _root.lastx;
_root.hero._y = _root.lasty;
} else {
_root.hero._x = (_j * 16) + 8;
_root.hero._y = (_i * 16) + 16;
}
_root.desx = _root.hero._x;
_root.desy = _root.hero._y;
if (_root.desx > ((((_root.hori_limit + 1) * 16) - 150) - 7.5)) {
_root.desx = (((_root.hori_limit + 1) * 16) - 150) - 7.5;
}
if (_root.desx < 157.5) {
_root.desx = 157.5;
}
if (_root.desy > ((((_root.vert_limit + 1) * 16) - 120) - 7.5)) {
_root.desy = (((_root.vert_limit + 1) * 16) - 120) - 7.5;
}
if (_root.desy < 127.5) {
_root.desy = 127.5;
}
_root._x = ((-_root.desx) * 2) + 300;
_root._y = ((-_root.desy) * 2) + 240;
_root.snapshot_mc._x = ((-_root.snapshot_mc.origx) / 2) - (_root._x / 2);
_root.snapshot_mc._y = ((-_root.snapshot_mc.origy) / 2) - (_root._y / 2);
_root.hero.alive = true;
if (_root.hero_weapons[0] == 1) {
_root.hero.maxhealth = 100;
} else if (_root.hero_weapons[0] == 2) {
_root.hero.maxhealth = 150;
} else {
_root.hero.maxhealth = 200;
}
_root.hero.health = _root.hero.maxhealth;
_root.hero.xspd = 0;
_root.hero.yspd = 0;
_root.hero.jump = false;
_root.hero.doublejump = false;
_root.hero.platform = false;
_root.hero.deathtimer = 0;
_root.hero.gun = 1;
p = 1;
while (p < _root.weapon_capacity1.length) {
_root.hero["ammo" + p] = _root.weapon_capacity1[p];
p++;
}
_root.updateGun();
_root.hero.onMouseDown = function () {
this.shootkey = true;
};
_root.hero.onMouseUp = function () {
this.shootkey = false;
};
_root.hero.onEnterFrame = function () {
if (this.alive) {
if ((((!this.shoot) && (this.shootkey)) && (this["ammo" + this.gun] > 0)) && (!this.reloading)) {
this.shoot = true;
this.shootstance = true;
this["ammo" + this.gun] = this["ammo" + this.gun] - 1;
if (this["ammo" + this.gun] > 0) {
setTimeout(function () {
_root.hero.shoot = false;
}, _root["weapon_cooldown" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun]);
} else {
this.reloading = true;
_root.reload_s.start(0, 1);
this.reloadtimeout = setTimeout(function () {
_root.hero.shoot = false;
_root.hero.reloading = false;
_root.hero["ammo" + _root.hero.gun] = _root["weapon_capacity" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun];
_root.updateGun();
}, _root["weapon_reloadtime" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun]);
_root.updateGun();
}
clearInterval(_root.shootstanceint);
if (_root.hero.gun == 1) {
_root.shootstanceint = setTimeout(function () {
if (_root.hero.gun == 1) {
_root.hero.shootstance = false;
}
clearInterval(_root.shootstanceint);
}, 1200);
}
this.shootangle = Math.atan2(-((this._y - 24) - _root._ymouse), -(this._x - _root._xmouse));
if ((this.shootangle > -2.74889357189107) && (this.shootangle < -1.96349540849362)) {
this.arms.gotoAndStop(5);
this.arms.mc.play();
_root.shootBullet(this._x - 8, this._y - 33, this.shootangle, _root["weapon_bullet" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun], _root["weapon_accuracy" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun], _root["weapon_damage" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun]);
if (this._xscale > 0) {
this.arms._xscale = -100;
} else {
this.arms._xscale = 100;
}
} else if ((this.shootangle > -1.96349540849362) && (this.shootangle < -1.17809724509617)) {
this.arms.gotoAndStop(4);
this.arms.mc.play();
_root.shootBullet(this._x, this._y - 33, this.shootangle, _root["weapon_bullet" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun], _root["weapon_accuracy" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun], _root["weapon_damage" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun]);
} else if ((this.shootangle > -1.17809724509617) && (this.shootangle < -0.392699081698724)) {
this.arms.gotoAndStop(5);
this.arms.mc.play();
_root.shootBullet(this._x + 8, this._y - 33, this.shootangle, _root["weapon_bullet" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun], _root["weapon_accuracy" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun], _root["weapon_damage" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun]);
if (this._xscale > 0) {
this.arms._xscale = 100;
} else {
this.arms._xscale = -100;
}
} else if ((this.shootangle > -0.392699081698724) && (this.shootangle < 0.392699081698724)) {
this.arms.gotoAndStop(6);
this.arms.mc.play();
_root.shootBullet(this._x + 11, this._y - 21, this.shootangle, _root["weapon_bullet" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun], _root["weapon_accuracy" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun], _root["weapon_damage" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun]);
if (this._xscale > 0) {
this.arms._xscale = 100;
} else {
this.arms._xscale = -100;
}
} else if ((this.shootangle > 0.392699081698724) && (this.shootangle < 1.17809724509617)) {
this.arms.gotoAndStop(7);
this.arms.mc.play();
_root.shootBullet(this._x + 8, this._y - 14, this.shootangle, _root["weapon_bullet" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun], _root["weapon_accuracy" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun], _root["weapon_damage" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun]);
if (this._xscale > 0) {
this.arms._xscale = 100;
} else {
this.arms._xscale = -100;
}
} else if ((this.shootangle > 1.17809724509617) && (this.shootangle < 1.96349540849362)) {
this.arms.gotoAndStop(8);
this.arms.mc.play();
_root.shootBullet(this._x, this._y - 10, this.shootangle, _root["weapon_bullet" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun], _root["weapon_accuracy" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun], _root["weapon_damage" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun]);
} else if ((this.shootangle > 1.96349540849362) && (this.shootangle < 2.74889357189107)) {
this.arms.gotoAndStop(7);
this.arms.mc.play();
_root.shootBullet(this._x - 8, this._y - 14, this.shootangle, _root["weapon_bullet" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun], _root["weapon_accuracy" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun], _root["weapon_damage" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun]);
if (this._xscale > 0) {
this.arms._xscale = -100;
} else {
this.arms._xscale = 100;
}
} else if ((this.shootangle > 2.74889357189107) || (this.shootangle < -2.74889357189107)) {
this.arms.gotoAndStop(6);
this.arms.mc.play();
_root.shootBullet(this._x - 11, this._y - 21, this.shootangle, _root["weapon_bullet" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun], _root["weapon_accuracy" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun], _root["weapon_damage" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun]);
if (this._xscale > 0) {
this.arms._xscale = -100;
} else {
this.arms._xscale = 100;
}
}
}
if ((Key.isDown(38) && (!this.jkey)) || (Key.isDown(87) && (!this.jkey))) {
if (this.jump) {
if ((!this.doublejump) && (this.yspd > -2)) {
this.doublejump = true;
this.yspd = -8;
if (Key.isDown(39) || (Key.isDown(68))) {
this.xspd = this.xspd + 5;
} else if (Key.isDown(37) || (Key.isDown(65))) {
this.xspd = this.xspd - 5;
}
}
} else {
this.yspd = -10;
if ((Key.isDown(39) && (this.xspd < 0)) || (Key.isDown(68) && (this.xspd < 0))) {
this.xspd = this.xspd + 5;
} else if ((Key.isDown(37) && (this.xspd > 0)) || (Key.isDown(65) && (this.xspd > 0))) {
this.xspd = this.xspd - 5;
}
}
this.platform = 0;
this.jump = true;
this.jkey = true;
}
if (((!Key.isDown(38)) && (this.jkey)) && (!Key.isDown(87))) {
this.jkey = false;
}
if (!this.jump) {
if (Key.isDown(39) || (Key.isDown(68))) {
this.xspd = this.xspd + 2;
if (this.xspd > 5) {
this.xspd = 5;
}
this._xscale = 100;
} else if (Key.isDown(37) || (Key.isDown(65))) {
this.xspd = this.xspd - 2;
if (this.xspd < -5) {
this.xspd = -5;
}
this._xscale = -100;
} else if (this.xspd >= 2) {
this.xspd = this.xspd - 2;
} else if (this.xspd <= -2) {
this.xspd = this.xspd + 2;
} else {
this.xspd = 0;
}
} else if (Key.isDown(39) || (Key.isDown(68))) {
this.xspd = this.xspd + 1.5;
if (this.xspd > 5) {
this.xspd = 5;
}
this._xscale = 100;
} else if (Key.isDown(37) || (Key.isDown(65))) {
this.xspd = this.xspd - 1.5;
if (this.xspd < -5) {
this.xspd = -5;
}
this._xscale = -100;
} else if (this.xspd >= 1.5) {
this.xspd = this.xspd - 1.5;
} else if (this.xspd <= -1.5) {
this.xspd = this.xspd + 1.5;
} else {
this.xspd = 0;
}
if (this._y > (((_root.vert_limit + 1) * 16) + 13)) {
this.xspd = 0;
this.deathtimer = 50;
this.alive = false;
}
if ((((this.groundpos - this._y) < 10) && (_root.level_ground[this.ycoord][this.xcoord] == 23)) && (this.alive)) {
if (this.xspd == 0) {
if (random(2) == 0) {
this.xspd = 7.5;
} else {
this.xspd = -7.5;
}
} else {
this.xspd = (7.5 * Math.abs(this.xspd)) / this.xspd;
}
this.jump = true;
this.yspd = -8;
this._y = this.groundpos - 4;
this.alive = false;
this.health = 0;
_root.hud_mc.hpbar._xscale = 0;
_root.playHeroDeath_s();
_root.fire_s.start(0, 1);
}
} else if (this.jump) {
if (this.xspd > 0.25) {
this.xspd = this.xspd - 0.25;
this._xscale = -100;
} else if (this.xspd < -0.25) {
this.xspd = this.xspd + 0.25;
this._xscale = 100;
} else {
this.xspd = 0;
}
} else if (!this.jump) {
if (!_root.hud_mc.hud_deathscreen) {
_root.hero_deaths++;
if (_root.gameover) {
_root.mochi.as2.MochiServices("Game Over");
_root.hud_mc.attachMovie("hud_gameover", "hud_deathscreen", 49999);
} else {
_root.mochi.as2.MochiServices("Death");
_root.hud_mc.attachMovie("hud_deathscreen", "hud_deathscreen", 49999);
}
}
if (this.mc._currentframe < 7) {
this.mc.play();
}
if (this.xspd > 0.5) {
this.xspd = this.xspd - 1;
this._xscale = -100;
} else if (this.xspd < -0.5) {
this.xspd = this.xspd + 1;
this._xscale = 100;
} else {
this.xspd = 0;
}
}
this.xcoord = Math.floor(this._x / 16);
this.ycoord = Math.floor((this._y - 8) / 16);
if ((((_root.level_ground[this.ycoord][this.xcoord + 1] == 1) || (_root.level_ground[this.ycoord - 1][this.xcoord + 1] == 1)) || (_root.level_ground[this.ycoord][this.xcoord + 1] == 5)) || (_root.level_ground[this.ycoord - 1][this.xcoord + 1] == 5)) {
this.rlim = (this.xcoord * 16) + 7;
} else {
this.rlim = 10000;
}
if ((((_root.level_ground[this.ycoord][this.xcoord - 1] == 1) || (_root.level_ground[this.ycoord - 1][this.xcoord - 1] == 1)) || (_root.level_ground[this.ycoord][this.xcoord - 1] == 5)) || (_root.level_ground[this.ycoord - 1][this.xcoord - 1] == 5)) {
this.llim = (this.xcoord * 16) + 7;
} else {
this.llim = -10000;
}
this._x = this._x + this.xspd;
if (this._x > this.rlim) {
this._x = this.rlim;
this.xspd = 0;
}
if (this._x < this.llim) {
this._x = this.llim;
this.xspd = 0;
}
if (this.platform) {
this.groundpos = _root["obj" + this.platform]._y;
if ((this._x < (_root["obj" + this.platform]._x - 5)) || (this._x > ((_root["obj" + this.platform]._x + _root["obj" + this.platform]._width) + 5))) {
this.platform = 0;
}
} else {
this.platform = 0;
k = 1;
while (k < _root.pn) {
_root["obj" + k].activated = false;
if (((((this.jump && (this.yspd > 0)) && (this._x > (_root["obj" + k]._x - 5))) && (this._x < ((_root["obj" + k]._x + _root["obj" + k]._width) + 5))) && (this._y < (_root["obj" + k]._y + 3))) && (this._y > (_root["obj" + k]._y - (this.yspd * 1.5)))) {
_root["obj" + k].activated = true;
this.groundpos = _root["obj" + k]._y;
this.platform = k;
break;
}
k++;
}
if ((((_root.level_ground[this.ycoord + 1][Math.floor((this._x - 6) / 16)] == 1) || (_root.level_ground[this.ycoord + 1][Math.floor((this._x + 6) / 16)] == 1)) || (_root.level_ground[this.ycoord + 1][Math.floor((this._x - 3) / 16)] == 3)) || (_root.level_ground[this.ycoord + 1][Math.floor((this._x + 3) / 16)] == 3)) {
this.groundpos = (this.ycoord + 1) * 16;
} else {
if (!this.jump) {
this.jump = true;
this.yspd = 0;
}
this.groundpos = 10000;
}
}
if ((((_root.level_ground[this.ycoord - 2][Math.floor((this._x - 3) / 16)] == 1) || (_root.level_ground[this.ycoord - 2][Math.floor((this._x + 3) / 16)] == 1)) || (_root.level_ground[this.ycoord - 2][Math.floor((this._x - 3) / 16)] == 5)) || (_root.level_ground[this.ycoord - 2][Math.floor((this._x + 3) / 16)] == 5)) {
this.ceilpos = (this.ycoord - 1) * 16;
} else {
this.ceilpos = -10000;
}
if (this.jump) {
this._y = this._y + this.yspd;
if ((this._y - 26) < this.ceilpos) {
this.yspd = 0;
this._y = this.ceilpos + 26;
if (_root.level_ground[this.ycoord - 1][this.xcoord] == 21) {
if (this.xspd == 0) {
this.xspd = 6;
} else {
this.xspd = (6 * Math.abs(this.xspd)) / this.xspd;
}
this.alive = false;
}
}
if (this.yspd < 10) {
this.yspd = this.yspd + 1.2;
}
if (((this.groundpos - this._y) < 0) && (this.yspd > 0)) {
this._x = Math.round(this._x);
this.jump = false;
this.doublejump = false;
this._y = this.groundpos;
}
} else {
this._y = this.groundpos;
}
if (this.alive) {
if (this.jump) {
this.legs.gotoAndStop(3);
this.legs.mc.gotoAndStop(this.yspd + 12);
if ((!this.shoot) && (!this.shootstance)) {
this.arms._xscale = 100;
this.arms.gotoAndStop(3);
this.arms.mc.gotoAndStop(this.yspd + 12);
}
} else if (this.xspd != 0) {
this.legs.gotoAndStop(2);
if ((!this.shoot) && (!this.shootstance)) {
this.arms._xscale = 100;
this.arms.gotoAndStop(2);
}
} else {
this.legs.gotoAndStop(1);
if ((!this.shoot) && (!this.shootstance)) {
this.arms._xscale = 100;
this.arms.gotoAndStop(1);
}
}
} else {
this.gotoAndStop(2);
}
};
}
function updateHealthBar(_health, _dir) {
if (_health < 0) {
_root.hero.health = _root.hero.health - _health;
_root.beep_s.start(0, 2);
} else {
_root.hero.health = _root.hero.health - (_health * 0.9);
if ((_root.hero.health > 0) && (random(2) == 0)) {
_root.playHero_s();
} else if ((_root.hero.health < 0) && (_root.hero.alive)) {
_root.playHeroDeath_s();
}
if (random(2) == 0) {
_root.splat_s.start(0, 1);
}
}
if (_health > 0) {
_q = 0;
while (_q < 5) {
_root.spawnBlood(_root.hero._x, _root.hero._y);
_q++;
}
_root.background_g.bloodspatter(Math.round(_root.hero._x / 16), Math.round(_root.hero._y / 16) - 1);
}
if (_root.hero.health < 0) {
_root.hero.health = 0;
if (_root.hero.alive) {
_root.hero.xspd = 4 * _dir;
_root.hero.jump = true;
_root.hero.yspd = -5;
}
_root.hero.alive = false;
}
if (_root.hero.health > _root.hero.maxhealth) {
_root.hero.health = _root.hero.maxhealth;
}
_root.hud_mc.hpbar._xscale = _root.hero.health;
}
var mouseListener = new Object();
mouseListener.onMouseWheel = function (delta) {
if (_root.hero.alive) {
if (delta > 0) {
_q = 0;
while (_q < 10) {
_root.hero.gun++;
if (_root.hero.gun > 7) {
_root.hero.gun = 1;
}
if (_root.hero_weapons[_root.hero.gun] != 0) {
break;
}
_q++;
}
} else {
_q = 0;
while (_q < 10) {
_root.hero.gun--;
if (_root.hero.gun < 1) {
_root.hero.gun = 7;
}
if (_root.hero_weapons[_root.hero.gun] != 0) {
break;
}
_q++;
}
}
_root.hero.arms.mc.gun.updateGun();
clearTimeout(_root.hero.reloadtimeout);
_root.hero.shoot = false;
_root.hero.reloading = false;
if (_root.hero["ammo" + _root.hero.gun] <= 0) {
_root.reload_s.start(0, 1);
_root.hero.reloading = true;
_root.hero.reloadtimeout = setTimeout(function () {
_root.hero.shoot = false;
_root.hero.reloading = false;
_root.hero["ammo" + _root.hero.gun] = _root["weapon_capacity" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun];
_root.updateGun();
}, _root["weapon_reloadtime" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun]);
}
_root.updateGun();
}
};
Mouse.addListener(mouseListener);
weapon_label = ["", "Revolvers", "Rifle", "Tommy gun", "Shotgun", "Heavy Machine Gun", "Rail Gun", "Tesla Gun"];
weapon_damage1 = [0, 20, 40, 22, 50, 18, 150, 100];
weapon_accuracy1 = [0, 90, 95, 55, 15, 30, 90, 90];
weapon_bullet1 = [0, 1, 1, 1, 3, 1, 1, 1];
weapon_cooldown1 = [0, 150, 275, 100, 400, 50, 500, 500];
weapon_capacity1 = [0, 99999, 8, 30, 6, 100, 5, 4];
weapon_reloadtime1 = [0, 150, 500, 1000, 1000, 1100, 1000, 1000];
weapon_damage2 = [0, 35, 60, 30, 46, 25, 200, 125];
weapon_accuracy2 = [0, 90, 95, 55, 15, 30, 90, 90];
weapon_bullet2 = [0, 1, 1, 1, 4, 1, 1, 1];
weapon_cooldown2 = [0, 150, 250, 100, 400, 50, 500, 500];
weapon_capacity2 = [0, 99999, 8, 30, 6, 100, 5, 4];
weapon_reloadtime2 = [0, 150, 500, 900, 1000, 1000, 900, 900];
weapon_damage3 = [0, 50, 75, 41, 43, 32, 250, 150];
weapon_accuracy3 = [0, 90, 95, 55, 15, 30, 90, 90];
weapon_bullet3 = [0, 1, 1, 1, 5, 1, 1, 1];
weapon_cooldown3 = [0, 150, 225, 100, 400, 50, 500, 500];
weapon_capacity3 = [0, 99999, 8, 30, 6, 100, 5, 4];
weapon_reloadtime3 = [0, 150, 500, 800, 1000, 900, 750, 750];
var keyListener = new Object();
keyListener.onKeyDown = function () {
if (Key.isDown(27)) {
}
if (Key.isDown(77)) {
if (_root.global_s.getVolume() != 0) {
_root.global_s.setVolume(0);
} else {
_root.global_s.setVolume(80);
}
}
if (Key.getCode() == 80) {
}
if (((Key.getCode() == 82) && (!_root.hero.reloading)) && (_root.hero["ammo" + _root.hero.gun] != _root["weapon_capacity" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun])) {
_root.hero.reloading = true;
_root.reload_s.start(0, 1);
_root.hero.reloadtimeout = setTimeout(function () {
_root.hero.shoot = false;
_root.hero.reloading = false;
_root.hero["ammo" + _root.hero.gun] = _root["weapon_capacity" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun];
_root.updateGun();
}, _root["weapon_reloadtime" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun]);
_root.updateGun();
}
if (((_root.hero.alive && (Key.getCode() >= 49)) && (Key.getCode() <= 55)) && (_root.hero_weapons[Key.getCode() - 48] != 0)) {
_root.hero.gun = Key.getCode() - 48;
_root.hero.arms.mc.gun.updateGun();
clearTimeout(_root.hero.reloadtimeout);
_root.hero.shoot = false;
_root.hero.reloading = false;
if (_root.hero["ammo" + _root.hero.gun] <= 0) {
_root.hero.reloading = true;
_root.reload_s.start(0, 1);
_root.hero.reloadtimeout = setTimeout(function () {
_root.hero.shoot = false;
_root.hero.reloading = false;
_root.hero["ammo" + _root.hero.gun] = _root["weapon_capacity" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun];
_root.updateGun();
}, _root["weapon_reloadtime" + _root.hero_weapons[_root.hero.gun]][_root.hero.gun]);
}
_root.updateGun();
}
};
Key.addListener(keyListener);
updateHealthBar(0);
function changeColor(_mc, _r, _g, _b) {
if (_r != undefined) {
var _local1 = [_r, 0, 0, 0, 0, 0, _g, 0, 0, 0, 0, 0, _b, 0, 0, 0, 0, 0, 1, 0];
} else {
var _local1 = [0.9 + (random(20) / 100), 0, 0, 0, 0, 0, 0.9 + (random(20) / 100), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
}
var _local2 = new flash.filters.ColorMatrixFilter(_local1);
_mc.filters = [_local2];
}
function addGlow(_mc, _color) {
var _local1 = new flash.filters.GlowFilter(_color, 15, 5, 5, 2, 1, false, false);
_mc.filters = [_local1];
}
function addBlur(_mc) {
var _local3 = new flash.filters.BlurFilter(3, 3, 1);
var _local1 = [2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
var _local4 = new flash.filters.ColorMatrixFilter(_local1);
var _local2 = new flash.filters.GlowFilter(16776969, 15, 3, 3, 1, 1, false, false);
_mc.filters = [_local3, _local2, _local4];
}
function clearFilters(_mc) {
_mc.filters = [];
}
function shootBullet(_origx, _origy, _ang, _count, _accuracy, _damage) {
_root.updateGun();
_root[("gunfire" + _root.hero.gun) + "_s"].start(0, 1);
_p = 0;
while (_p < int(_count)) {
_root.hero_shotsfired++;
b_chk = 0;
b_ang = _ang + (((random(50) - 25) / 7) / _accuracy);
b_x = 15 * Math.cos(b_ang);
b_y = 15 * Math.sin(b_ang);
while (b_chk < 20) {
p = 0;
while (p < 40) {
if (((_root["enemy" + p] && (_root["enemy" + p].alive)) && (Math.abs(_root["enemy" + p]._x - (_origx + (b_x * b_chk))) < 7.5)) && (Math.abs((_root["enemy" + p]._y - 15) - (_origy + (b_y * b_chk))) < 15)) {
_root.spawnTracer(_origx + b_x, _origy + b_y, _origx + (b_x * b_chk), _origy + (b_y * b_chk));
_root.background_g.bloodspatter(Math.round(_root["enemy" + p]._x / 16), Math.round(_root["enemy" + p]._y / 16) - 1);
_q = 0;
while (_q < 5) {
_root.spawnBlood(_root["enemy" + p]._x, _root["enemy" + p]._y);
_q++;
}
_root["enemy" + p].health = _root["enemy" + p].health - _damage;
_root.hero_shotshit++;
_root.splat_s.start(0, 1);
if (_root["enemy" + p].health <= 0) {
_root.hero_kills++;
_root["enemy" + p].alive = false;
_root.hero_points = _root.hero_points + Math.round(5 * _root.difficulty);
if ((random(_root.healthchance) == 0) && (_root.hero.gun != 7)) {
_root.spawnHealth(_root["enemy" + p]._x, _root["enemy" + p]._y);
}
if (_root["enemy" + p].etype == "brute") {
_root.playBruteDeath_s();
} else if (_root["enemy" + p].etype == "stalker") {
_root.playStalkerDeath_s();
} else {
_root.playBehemothDeath_s();
}
} else if (random(100) < 40) {
if (_root["enemy" + p].etype == "brute") {
_root.playBrute_s();
} else if (_root["enemy" + p].etype == "stalker") {
_root.playStalker_s();
} else {
_root.playBehemoth_s();
}
}
if (_root.hero.gun != 7) {
b_chk = 999;
}
break;
}
p++;
}
if (_root.level_ground[Math.floor((_origy + (b_y * b_chk)) / 16)][Math.floor((_origx + (b_x * b_chk)) / 16)] == 1) {
if (_root.hero.gun == 7) {
_root.spawnTracer(_origx + b_x, _origy + b_y, _origx + (b_x * b_chk), _origy + (b_y * b_chk), 1);
} else {
_root.spawnTracer(_origx + b_x, _origy + b_y, _origx + (b_x * b_chk), _origy + (b_y * b_chk));
}
break;
}
if (b_chk == 19) {
if (_root.hero.gun == 7) {
_root.spawnTracer(_origx + b_x, _origy + b_y, _origx + (b_x * b_chk), _origy + (b_y * b_chk), 1);
} else {
_root.spawnTracer(_origx + b_x, _origy + b_y, _origx + (b_x * b_chk), _origy + (b_y * b_chk));
}
}
b_chk++;
}
_p++;
}
}
function shootSlime(_origx, _origy, _desx, _desy, _type, _damage) {
if (_type == "rock") {
_root.attachMovie("rockparticle1", "spew" + pn, 31500 + pn);
_root.addGlow(_root["spew" + pn], 2883456);
} else {
_root.attachMovie("spew_particle1", "spew" + pn, 31500 + pn);
}
_root["spew" + pn].projc = _root.calculateProjectile(_origx, _origy, _desx, _desy);
_root["spew" + pn].dis = Math.round(_root["spew" + pn].projc[3] / 10);
_root["spew" + pn].leaptimer = 0;
_root["spew" + pn].damage = _damage;
_root["spew" + pn].onEnterFrame = function () {
this.leaptimer++;
if (this.leaptimer < this.dis) {
this.lastx = this._x;
this._x = (((_desx - _origx) / this.dis) * this.leaptimer) + _origx;
this.xspd = this._x - this.lastx;
this.lasty = this._y;
this._y = ((this.projc[0] * Math.pow(this._x, 2)) + (this.projc[1] * this._x)) + this.projc[2];
this.lastyspd = this.yspd;
this.yspd = this._y - this.lasty;
this.yacc = this.yspd - this.lastyspd;
} else {
this._x = this._x + this.xspd;
this._y = this._y + this.yspd;
if (this.yacc < 1) {
this.yacc = 1;
}
this.yspd = this.yspd + this.yacc;
if (_root.level_ground[Math.floor(this._y / 16)][Math.floor(this._x / 16)] == 3) {
p = 0;
while (p < 3) {
_root.spawnDust2((this._x + random(10)) - 5, (this._y + random(10)) - 5);
p++;
}
_root.splat_s.start(0, 1);
if (_type == "rock") {
_root.rocksmash_s.start(0, 1);
}
this.removeMovieClip();
}
}
if ((Math.abs(this._x - _root.hero._x) < 10) && (Math.abs((this._y + 16) - _root.hero._y) < 15)) {
p = 0;
while (p < 2) {
_root.spawnDust2((this._x + random(10)) - 5, (this._y + random(10)) - 5);
p++;
}
if (this._x > _root.hero._x) {
_root.updateHealthBar(this.damage * _root.difficulty, -1);
} else {
_root.updateHealthBar(this.damage * _root.difficulty, 1);
}
if (_type == "rock") {
_root.rocksmash_s.start(0, 1);
}
this.removeMovieClip();
}
if (_root.level_ground[Math.floor(this._y / 16)][Math.floor(this._x / 16)] == 1) {
p = 0;
while (p < 3) {
_root.spawnDust2((this._x + random(10)) - 5, (this._y + random(10)) - 5);
p++;
}
_root.splat_s.start(0, 1);
if (_type == "rock") {
_root.rocksmash_s.start(0, 1);
}
this.removeMovieClip();
}
};
pn++;
if (pn > 499) {
pn = 0;
}
}
function removeEnemy(_en) {
if (_root["enemy" + _en]) {
_root["enemy" + _en].removeMovieClip();
_root.enemy_idpool.push(_en);
_root.seq_killcount++;
_root.ecount--;
}
}
function findWall(_xpos, _ypos, _wall) {
p = 0;
while (p < 50) {
if (((_xpos + p) <= 40) && ((_xpos + p) != _wall)) {
if (_root.level[_ypos][_xpos + p] == 70) {
return([_xpos + p, -1]);
}
}
if (((_xpos - p) >= 0) && ((_xpos - p) != _wall)) {
if (_root.level[_ypos][_xpos - p] == 72) {
return([_xpos - p, 1]);
}
}
p++;
}
}
function findHeight(_xpos, _ypos) {
p = 1;
while (p < 30) {
if ((_root.level[_ypos - p][_xpos] != 70) && (_root.level[_ypos - p][_xpos] != 72)) {
return(p - 1);
}
p++;
}
}
function calculateProjectile(_xpos, _ypos, _xdes, _ydes, _type) {
x1 = (_xpos + _xdes) / 2;
if (_type == "pounce") {
y1 = ((_ypos + _ydes) / 2) - 10;
} else if (_ydes < _ypos) {
y1 = _ydes - 5;
} else {
y1 = _ypos - 5;
}
x2 = _xpos;
y2 = _ypos;
x3 = _xdes;
y3 = _ydes;
proj_a = ((y1 - y2) - (((x1 - x2) * (y1 - y3)) / (x1 - x3))) / ((Math.pow(x1, 2) - Math.pow(x2, 2)) - (((Math.pow(x1, 2) - Math.pow(x3, 2)) * (x1 - x2)) / (x1 - x3)));
proj_b = ((y1 - y3) - (proj_a * (Math.pow(x1, 2) - Math.pow(x3, 2)))) / (x1 - x3);
proj_c = (y1 - (proj_a * Math.pow(x1, 2))) - (proj_b * x1);
dis = 0;
x4 = _xpos;
y4 = _ypos;
p = 1;
while (p <= 40) {
x5 = (((_xdes - _xpos) / 40) * p) + _xpos;
y5 = ((proj_a * Math.pow(x5, 2)) + (proj_b * x5)) + proj_c;
dis = dis + Math.sqrt(Math.pow(x5 - x4, 2) + Math.pow(y5 - y4, 2));
x4 = x5;
y4 = y5;
p++;
}
return([proj_a, proj_b, proj_c, Math.round(dis + 30)]);
}
function spawnTracer(_xpos, _ypos, _xdes, _ydes, _spec) {
_root.createEmptyMovieClip("effect" + fn, 40000 + fn);
if (_spec == 1) {
_root["effect" + fn].lineStyle(3, 16777215, 15);
} else {
_root["effect" + fn].lineStyle(1, 16777215, 15);
}
_root["effect" + fn].moveTo(_xpos, _ypos);
_root["effect" + fn].lineTo(_xdes, _ydes);
j = 0;
while (j < 3) {
_root["effect" + fn].lineStyle(1, 16777215, 1 + random(10));
_root["effect" + fn].moveTo(_xpos + ((random(30) - 15) / 10), _ypos + ((random(30) - 15) / 10));
_root["effect" + fn].lineTo(_xdes + ((random(30) - 15) / 10), _ydes + ((random(30) - 15) / 10));
j++;
}
_root["effect" + fn].onEnterFrame = function () {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
fn++;
if (fn >= 1000) {
fn = 0;
}
}
function spawnExplosion(_xpos, _ypos) {
k = 0;
while (k < 10) {
spawnDust(_xpos, _ypos, 1);
k++;
}
}
function spawnDust(_xpos, _ypos, _mod) {
_root.attachMovie("dust_mc", "effect" + fn, 40000 + fn);
_root["effect" + fn]._x = _xpos;
_root["effect" + fn]._y = _ypos;
_root["effect" + fn].xspd = (random(50) / 2) * _mod;
if (random(2) == 0) {
_root["effect" + fn].xspd = _root["effect" + fn].xspd * -1;
}
_root["effect" + fn].yspd = ((-random(15)) / 2) * _mod;
_root["effect" + fn].fallspd = (1 + (random(10) / 2)) * _mod;
if (random(2) == 0) {
_root["effect" + fn]._xscale = 50;
}
if (random(2) == 0) {
_root["effect" + fn]._yscale = 50;
}
_root["effect" + fn].onEnterFrame = function () {
this._x = this._x + this.xspd;
this.xspd = this.xspd * 0.5;
if (Math.abs(this.xspd) <= 0.5) {
this.xspd = 0;
}
if (this.yspd < this.fallspd) {
this.yspd = this.yspd + 0.5;
}
this._y = this._y + this.yspd;
if (this._y > 450) {
this.removeMovieClip();
}
};
fn++;
if (fn >= 1000) {
fn = 0;
}
}
function spawnDust2(_xpos, _ypos) {
if (_root.effects) {
_root.attachMovie("dust_mc", "effect" + fn, 40000 + fn);
_root["effect" + fn]._x = (_xpos + random(30)) - 15;
_root["effect" + fn].origx = _root["effect" + fn]._x;
_root["effect" + fn]._y = (_ypos - random(10)) + 3;
_root["effect" + fn].yspd = 0.5 + (random(20) / 40);
_root["effect" + fn]._alpha = 75;
_root["effect" + fn].sinang = 0;
if (random(2) == 0) {
_root["effect" + fn]._xscale = 50;
}
if (random(2) == 0) {
_root["effect" + fn]._yscale = 50;
}
_root["effect" + fn].onEnterFrame = function () {
this.sinang = this.sinang + 1;
this._x = this.origx + (3 * Math.sin(this.sinang));
this._y = this._y - this.yspd;
this._alpha = this._alpha - 2;
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
fn++;
if (fn >= 1000) {
fn = 0;
}
}
}
function spawnHealth(_xpos, _ypos) {
_root.attachMovie("healthkit_mc", "drop" + dn, 32000 + dn);
_root["drop" + dn]._x = _xpos;
_root["drop" + dn]._y = _ypos;
_root["drop" + dn]._alpha = 500;
_root["drop" + dn].rotspd = random(6) - 3;
_root["drop" + dn].yspd = -3;
_q = 0;
while (_q < 50) {
if ((_root.level_ground[Math.floor(_ypos / 16) + _q][Math.floor(_xpos / 16)] == 1) || (_root.level_ground[Math.floor(_ypos / 16) + _q][Math.floor(_xpos / 16)] == 3)) {
_root["drop" + dn].groundy = (Math.floor(_ypos / 16) + _q) * 16;
break;
}
_q++;
}
_root["drop" + dn].onEnterFrame = function () {
this._rotation = this._rotation + this.rotspd;
this._y = this._y + this.yspd;
this.yspd = this.yspd + 0.5;
this._alpha = this._alpha - 2;
if (this._y > this.groundy) {
this._rotation = this._rotation / 2;
this._y = this.groundy;
}
if ((Math.abs(this._x - _root.hero._x) < 10) && (Math.abs(this._y - (_root.hero._y - 16)) < 18)) {
_root.updateHealthBar(-20);
this.removeMovieClip();
}
if (this._alpha < 0) {
this.removeMovieClip();
}
};
dn++;
if (dn > 50) {
dn = 0;
}
}
function spawnBricks(_xpos, _ypos) {
q = 0;
while (q < 2) {
_root.attachMovie("bricks_mc", "effect" + fn, 40000 + fn);
_root["effect" + fn]._x = _xpos + random(16);
_root["effect" + fn]._y = _ypos + random(16);
if (_xpos < 25) {
_root["effect" + fn].xspd = random(80) / 20;
} else if (_xpos > ((_root.hori_limit * 16) - 25)) {
_root["effect" + fn].xspd = (-random(80)) / 20;
} else {
_root["effect" + fn].xspd = (random(160) / 20) - 4;
}
_root["effect" + fn].yspd = (random(80) / 20) - 4;
_root["effect" + fn]._rotation = random(360);
_root["effect" + fn].rotspd = (random(120) / 20) - 3;
_root["effect" + fn]._alpha = 100;
_root["effect" + fn].onEnterFrame = function () {
this._x = this._x + this.xspd;
this._y = this._y + this.yspd;
this.yspd = this.yspd + 0.8;
this._rotation = this._rotation + this.rotspd;
this._alpha = this._alpha - 4;
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
fn++;
if (fn >= 1000) {
fn = 0;
}
q++;
}
}
function spawnBlood(_xpos, _ypos) {
if (_root.effects) {
_root.attachMovie("blood_mc", "effect" + fn, 40000 + fn);
if (random(2) == 0) {
_root["effect" + fn]._xscale = 150;
}
if (random(2) == 0) {
_root["effect" + fn]._yscale = 150;
}
_root["effect" + fn]._x = (_xpos + random(16)) - 8;
_root["effect" + fn]._y = _ypos - random(32);
_root["effect" + fn].xspd = (random(160) / 20) - 4;
_root["effect" + fn].yspd = (random(80) / 20) - 4;
_root["effect" + fn]._alpha = 100 + random(25);
_root["effect" + fn].onEnterFrame = function () {
this._x = this._x + this.xspd;
this._y = this._y + this.yspd;
this.yspd = this.yspd + 0.8;
this._alpha = this._alpha - 3;
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
fn++;
if (fn >= 1000) {
fn = 0;
}
}
}
function spawnSpew(_xpos, _ypos, _angle) {
if (_root.effects) {
_root.attachMovie("spew_particle2", "effect" + fn, 40000 + fn);
_root["effect" + fn]._x = _xpos;
_root["effect" + fn]._y = _ypos;
_root["effect" + fn].xspd = (5 + (random(40) / 20)) * Math.cos(_angle);
_root["effect" + fn].yspd = (5 + (random(40) / 20)) * Math.sin(_angle);
_root["effect" + fn]._alpha = 30 + random(20);
_root["effect" + fn]._xscale = 50;
_root["effect" + fn]._yscale = 50;
_root["effect" + fn].onEnterFrame = function () {
this._x = this._x + this.xspd;
this.yspd = this.yspd + 0.4;
this._y = this._y + this.yspd;
if (this._y > 450) {
this.removeMovieClip();
}
};
fn++;
if (fn >= 1000) {
fn = 0;
}
}
}
enemy_idpool = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25];
pn = 0;
fn = 0;
dn = 0;
function spawnStalker(_i, _j, _entry, _boss) {
if (random(3) == 0) {
playStalker_s();
}
_root.ecount++;
en = _root.enemy_idpool.pop();
_root.attachMovie("stalker_mc", "enemy" + en, 31000 + en);
_root.changeColor(_root["enemy" + en]);
if (_entry == 1) {
_root["enemy" + en]._x = (_j * 16) + 8;
_root["enemy" + en]._y = (_i * 16) + 8;
_root["enemy" + en].entry = false;
} else {
_root["enemy" + en]._x = (_j * 16) + 16;
_root["enemy" + en]._y = (_i * 16) + 32;
_root["enemy" + en].entry = true;
_root["enemy" + en].gotoAndStop(6);
}
_root["enemy" + en].alive = true;
_root["enemy" + en].health = 150 * _root.difficulty;
_root["enemy" + en].maxxspd = (4 + (random(50) / 50)) * _root.difficulty;
_root["enemy" + en].xspd = 0;
_root["enemy" + en].yspd = 0;
_root["enemy" + en].jump = false;
_root["enemy" + en].climb = false;
_root["enemy" + en].targethero = true;
_root["enemy" + en].etype = "stalker";
_root["enemy" + en].en = en;
if (_boss) {
_root.stalkerboss_s.start(0, 1);
_root.changeColor(_root["enemy" + en], 1, 2, 2);
_root["enemy" + en]._alpha = 40;
_root["enemy" + en].health = _root["enemy" + en].health * 6.5;
_root["enemy" + en].maxxspd = _root["enemy" + en].maxxspd * 1.7;
_root["enemy" + en].boss = true;
}
_root["enemy" + en].onEnterFrame = function () {
if (this.boss && (random(3) == 0)) {
_root.spawnDust2((this._x + random(16)) - 8, this._y - random(32));
}
this.xcoord = Math.floor(this._x / 16);
this.ycoord = Math.floor((this._y - 8) / 16);
if (this.entry) {
this.xspd = 0;
this.yspd = 0;
} else if (this.alive) {
this.dis = Math.pow(Math.pow(this._y - _root.hero._y, 2) + Math.pow(this._x - _root.hero._x, 2), 0.5);
if (this.targetspecial) {
if ((this.dis > 125) || (this.dis < 15)) {
this.targetspecial = false;
this.targethero = false;
this.ypoint = (_root.hero._y + random(200)) - 100;
this.xpoint = (_root.hero._x + random(200)) - 100;
if (this.xpoint > ((_root.hori_limit - 2) * 16)) {
this.xpoint = (_root.hori_limit - 2) * 16;
} else if (this.xpoint < 0) {
this.xpoint = 0;
}
if (this.ypoint > ((_root.vert_limit - 2) * 16)) {
this.ypoint = (_root.vert_limit - 2) * 16;
} else if (this.ypoint < 0) {
this.ypoint = 0;
}
}
} else if (this.dis < 75) {
if ((((this.dis > 45) && (!this.lkey)) && (!this.rkey)) && (this.targethero)) {
this.targetspecial = true;
this.ypoint = _root.hero._y;
this.xpoint = random(((_root.hori_limit - 2) * 16) + 16);
} else {
if ((this.dis < 20) && (!this.jump)) {
this.attacking = true;
}
this.ypoint = _root.hero._y;
this.xpoint = (_root.hero._x + random(32)) - 16;
}
this.targethero = true;
} else if (this.targethero) {
this.ypoint = _root.hero._y;
this.xpoint = _root.hero._x;
if (random(70) == 0) {
this.ypoint = random(((_root.vert_limit - 2) * 16) + 16);
this.xpoint = random(((_root.hori_limit - 2) * 16) + 16);
this.targethero = false;
}
} else if (random(100) == 0) {
this.targethero = true;
}
this.yd = this.ycoord - Math.floor((this.ypoint - 8) / 16);
if (this.climb) {
this._x = this.desx + (16 * this.wall[1]);
this.lastwall = this.wall[0];
if ((random(40) == 0) || (((random(20) == 0) && (this.dis < 75)) && (this.yd < 0))) {
if (random(5) == 0) {
playStalker_s();
}
this.climb = false;
this.jump = true;
this.yspd = -10;
this.xspd = 10 * this.wall[1];
}
} else if (((this.yd > 3) && (this.dis > 200)) && (random(20) == 0)) {
this.ypoint = this._y;
this.xpoint = _root.hero._x;
} else if (this.yd >= 3) {
this.wall = _root.findWall(this.xcoord, this.ycoord, this.lastwall);
this.wallh = (-_root.findHeight(this.wall[0], this.ycoord)) + this.ycoord;
if (this.wall[0] != undefined) {
this.desx = (this.wall[0] * 16) + 8;
if (((this.wall[1] == -1) && (this._x < (this.desx - 24))) || ((this.wall[1] == 1) && (this._x < (this.desx + 10)))) {
this.rkey = true;
this.lkey = false;
} else if (((this.wall[1] == 1) && (this._x > (this.desx + 24))) || ((this.wall[1] == -1) && (this._x > (this.desx - 10)))) {
this.lkey = true;
this.rkey = false;
} else {
this._xscale = -100 * this.wall[1];
this.climb = true;
this.lkey = false;
this.rkey = false;
}
this.jkey = false;
} else {
this.ypoint = this._y;
this.xpoint = _root.hero._x;
}
} else {
if (this._x < ((this.xpoint - 20) + this.maxxspd)) {
if ((random(20) == 0) && (!this.jump)) {
this.jump = true;
this.yspd = -5 - random(3);
}
this.rkey = true;
this.lkey = false;
} else if (this._x > ((this.xpoint + 20) - this.maxxspd)) {
if ((random(20) == 0) && (!this.jump)) {
this.jump = true;
this.yspd = -5 - random(3);
}
this.lkey = true;
this.rkey = false;
} else {
if (random(20) == 0) {
this.ypoint = _root.hero._y;
this.xpoint = random(((_root.hori_limit - 2) * 16) + 16);
this.targethero = false;
}
this.lkey = false;
this.rkey = false;
}
if (Math.abs(this._x - this.xpoint) < 50) {
if (((this._y > (this.ypoint + 20)) && (!_root.hero.jump)) || (this._y > (this.ypoint + 35))) {
this.jkey = true;
} else {
this.jkey = false;
}
}
}
if (this.jkey && (!this.jump)) {
this.gotoAndStop(4);
this.yspd = -9 - random(3);
if (this.rkey && (this.xspd < 0)) {
this.xspd = this.xspd + 5;
} else if (this.lkey && (this.xspd > 0)) {
this.xspd = this.xspd - 5;
}
this.jump = true;
this.jkey = true;
}
if (this.rkey && (!this.attacking)) {
this.xspd = this.xspd + 2;
if (this.xspd > this.maxxspd) {
this.xspd = this.maxxspd;
}
this._xscale = 100;
} else if (this.lkey && (!this.attacking)) {
this.xspd = this.xspd - 2;
if (this.xspd < (-this.maxxspd)) {
this.xspd = -this.maxxspd;
}
this._xscale = -100;
} else if (this.xspd >= 2) {
this.xspd = this.xspd - 2;
} else if (this.xspd <= -2) {
this.xspd = this.xspd + 2;
} else {
this.xspd = 0;
}
} else if (this.jump) {
this.climb = false;
if (this.xspd > 0.25) {
this.xspd = this.xspd - 0.25;
} else if (this.xspd < -0.25) {
this.xspd = this.xspd + 0.25;
} else {
this.xspd = 0;
}
} else if (!this.jump) {
this.climb = false;
if (this.xspd > 0.5) {
this.xspd = this.xspd - 1;
} else if (this.xspd < -0.5) {
this.xspd = this.xspd + 1;
} else {
this.xspd = 0;
}
}
if ((_root.level_ground[this.ycoord][this.xcoord + 1] == 1) || (_root.level_ground[this.ycoord - 1][this.xcoord + 1] == 1)) {
this.rlim = (this.xcoord * 16) + 7;
} else {
this.rlim = _root.hori_limit * 16;
}
if ((_root.level_ground[this.ycoord][this.xcoord - 1] == 1) || (_root.level_ground[this.ycoord - 1][this.xcoord - 1] == 1)) {
this.llim = (this.xcoord * 16) + 7;
} else {
this.llim = 0;
}
this._x = this._x + this.xspd;
if ((((((!this.jump) && (!this.climb)) && (this.xspd > 0)) && (_root.level_ground[this.ycoord + 1][this.xcoord + 1] != 1)) && (_root.level_ground[this.ycoord + 1][this.xcoord + 1] != 3)) || (((((!this.jump) && (!this.climb)) && (this.xspd < 0)) && (_root.level_ground[this.ycoord + 1][this.xcoord - 1] != 1)) && (_root.level_ground[this.ycoord + 1][this.xcoord - 1] != 3))) {
if (((this.yd > 1) && (random(100) < 60)) || (random(100) < 20)) {
this.jump = true;
this.yspd = -6 - random(4);
}
}
if (this._x > this.rlim) {
this._x = this.rlim;
this.xspd = 0;
if (random(15) == 0) {
this.jump = true;
this.yspd = -6 - random(4);
}
}
if (this._x < this.llim) {
this._x = this.llim;
this.xspd = 0;
if (random(15) == 0) {
this.jump = true;
this.yspd = -6 - random(4);
}
}
if ((((_root.level_ground[this.ycoord + 1][Math.floor((this._x - 6) / 16)] == 1) || (_root.level_ground[this.ycoord + 1][Math.floor((this._x + 6) / 16)] == 1)) || (_root.level_ground[this.ycoord + 1][Math.floor((this._x - 3) / 16)] == 3)) || (_root.level_ground[this.ycoord + 1][Math.floor((this._x + 3) / 16)] == 3)) {
this.groundpos = (this.ycoord + 1) * 16;
} else {
if (!this.jump) {
this.jump = true;
this.yspd = 0;
}
this.groundpos = 10000;
}
if ((_root.level_ground[this.ycoord - 2][Math.floor((this._x - 3) / 16)] == 1) || (_root.level_ground[this.ycoord - 2][Math.floor((this._x + 3) / 16)] == 1)) {
this.ceilpos = (this.ycoord - 1) * 16;
} else {
this.ceilpos = 0;
}
if (this.climb) {
this._y = this._y - (2 + (this.maxxspd / 3));
if (this._y < (this.wallh * 16)) {
this.climb = false;
this.jump = true;
this.yspd = -10;
if (this.targethero) {
this.ypoint = 9999;
this.xpoint = _root.hero._x;
this.targetspecial = false;
}
}
} else if (this.jump) {
this._y = this._y + this.yspd;
if ((this._y - 26) < this.ceilpos) {
this.yspd = 0;
this._y = this.ceilpos + 26;
if (_root.level_ground[this.ycoord - 1][this.xcoord] == 21) {
if (this.xspd == 0) {
this.xspd = 6;
} else {
this.xspd = (6 * Math.abs(this.xspd)) / this.xspd;
}
this.alive = false;
}
}
if (this.yspd < 10) {
this.yspd = this.yspd + 1.2;
}
if (((this.groundpos - this._y) < 0) && (this.yspd > 0)) {
this.jump = false;
this.doublejump = false;
this._y = this.groundpos;
}
if (this._y > 500) {
_root.removeEnemy(this.en);
}
} else {
this._y = this.groundpos;
}
if (this.entry) {
this.gotoAndStop(6);
} else if (this.alive) {
if (this.climb) {
this.gotoAndStop(5);
} else if (this.jump) {
if (this.dis < 25) {
this.attacking = true;
this.gotoAndStop(4);
} else {
this.gotoAndStop(3);
this.mc.gotoAndStop(this.yspd + 12);
}
} else if (this.attacking) {
this.gotoAndStop(4);
} else if (this.xspd != 0) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
} else if (this.jump) {
this.gotoAndStop(7);
} else {
this.gotoAndStop(7);
this.mc.play();
}
};
}
function spawnBrute(_i, _j, _entry, _boss) {
if (random(3) == 0) {
playBrute_s();
}
en = _root.enemy_idpool.pop();
_root.ecount++;
_root.attachMovie("brute_mc", "enemy" + en, 31000 + en);
_root.changeColor(_root["enemy" + en]);
if (_entry == 1) {
_root["enemy" + en]._x = (_j * 16) + 8;
_root["enemy" + en]._y = (_i * 16) + 8;
_root["enemy" + en].entry = false;
} else {
_root["enemy" + en]._x = (_j * 16) + 16;
_root["enemy" + en]._y = (_i * 16) + 32;
_root["enemy" + en].entry = true;
_root["enemy" + en].gotoAndStop(6);
}
_root["enemy" + en].alive = true;
_root["enemy" + en].health = 150 * _root.difficulty;
_root["enemy" + en].maxxspd = 2.5 + (random(50) / 50);
_root["enemy" + en].xspd = 0;
_root["enemy" + en].yspd = 0;
_root["enemy" + en].jump = false;
_root["enemy" + en].leap = false;
_root["enemy" + en].targethero = true;
_root["enemy" + en].etype = "brute";
_root["enemy" + en].en = en;
if (_boss) {
_root.bruteboss_s.start(0, 1);
_root.changeColor(_root["enemy" + en], 2, 1, 1);
_root["enemy" + en].health = _root["enemy" + en].health * 6.5;
_root["enemy" + en].boss = true;
}
_root["enemy" + en].onEnterFrame = function () {
if (this.entry) {
this.xspd = 0;
this.yspd = 0;
} else if (this.alive) {
this.dis = Math.pow(Math.pow(this._y - _root.hero._y, 2) + Math.pow(this._x - _root.hero._x, 2), 0.5);
if (this.targetspecial) {
if ((this.dis > 125) || (this.dis < 16)) {
this.targetspecial = false;
this.targethero = false;
this.ypoint = (_root.hero._y + random(200)) - 100;
this.xpoint = (_root.hero._x + random(200)) - 100;
if (this.xpoint > ((_root.hori_limit - 2) * 16)) {
this.xpoint = (_root.hori_limit - 2) * 16;
} else if (this.xpoint < 0) {
this.xpoint = 0;
}
if (this.ypoint > ((_root.vert_limit - 2) * 16)) {
this.ypoint = (_root.vert_limit - 2) * 16;
} else if (this.ypoint < 0) {
this.ypoint = 0;
}
}
} else if (this.dis < 75) {
if ((((this.dis > 45) && (!this.lkey)) && (!this.rkey)) && (this.targethero)) {
this.targetspecial = true;
this.ypoint = _root.hero._y;
this.xpoint = random(((_root.hori_limit - 2) * 16) + 16);
} else {
if ((this.dis < 20) && (!this.jump)) {
this.attacking = true;
}
this.ypoint = _root.hero._y;
this.xpoint = (_root.hero._x + random(32)) - 16;
}
this.targethero = true;
} else if (this.targethero) {
this.ypoint = _root.hero._y;
this.xpoint = _root.hero._x;
if (random(70) == 0) {
this.ypoint = random(((_root.vert_limit - 2) * 16) + 16);
this.xpoint = random(((_root.hori_limit - 2) * 16) + 16);
this.targethero = false;
}
} else if (random(100) == 0) {
this.targethero = true;
}
this.yd = this.ycoord - Math.floor((this.ypoint - 8) / 16);
if (this.leap) {
this.lastwall = this.wall[0];
} else if (((this.yd > 3) && (this.dis > 200)) && (random(40) == 0)) {
this.ypoint = this._y;
this.xpoint = _root.hero._x;
} else if ((((((this.dis < 200) && (!this.jump)) && (!this.leap)) && (this.boss)) && (random(10) == 0)) || (this.bossattack == 1)) {
this.wall[0] = Math.floor(_root.hero._x / 16);
this.wallh = Math.floor(_root.hero._y / 16);
if ((this.wall[0] != undefined) && (Math.abs(((this.wall[0] * 16) + 7.5) - this._x) > 10)) {
this.desx = (this.wall[0] * 16) + 7.5;
if (this._x < ((this.desx + (16 * this.wall[1])) - 200)) {
this.rkey = true;
this.lkey = false;
} else if (this._x > ((this.desx + (16 * this.wall[1])) + 200)) {
this.lkey = true;
this.rkey = false;
} else {
_root.addBlur(_root["enemy" + this.en]);
if (this.bossattack == 0) {
this.bossattack = 1;
} else {
this.bossattack = 0;
}
this.origx = this._x;
this.origy = this._y;
this.desx = (this.wall[0] * 16) + 7.5;
this.desy = ((this.wallh - 1) * 16) - 5;
this.leapc = _root.calculateProjectile(this.origx, this.origy, this.desx, this.desy, "pounce");
this.lkey = false;
this.rkey = false;
this.leap = true;
if (this.boss) {
_root.bruteboss_s.start(0, 1);
}
this.leaptimer = 0;
if (this._x < this.desx) {
this._xscale = 100;
} else {
this._xscale = -100;
}
}
this.jkey = false;
} else {
this.ypoint = this._y;
this.xpoint = _root.hero._x;
}
} else if (((this.yd >= 3) && (!this.jump)) && (!this.leap)) {
this.wall = _root.findWall(this.xcoord, this.ycoord, this.lastwall);
this.wallh = (-_root.findHeight(this.wall[0], this.ycoord)) + this.ycoord;
if (this.boss && (random(5) == 0)) {
this.wall[0] = Math.floor(_root.hero._x / 16);
this.wallh = Math.floor(_root.hero._y / 16) - 1;
}
if ((this.wall[0] != undefined) && (Math.abs(((this.wall[0] * 16) + 7.5) - this._x) > 10)) {
this.desx = (this.wall[0] * 16) + 7.5;
if (this._x < ((this.desx + (16 * this.wall[1])) - 200)) {
this.rkey = true;
this.lkey = false;
} else if (this._x > ((this.desx + (16 * this.wall[1])) + 200)) {
this.lkey = true;
this.rkey = false;
} else {
if (this.boss) {
_root.addBlur(_root["enemy" + this.en]);
}
this.origx = this._x;
this.origy = this._y;
this.desx = (this.wall[0] * 16) + 7.5;
this.desy = ((this.wallh - 1) * 16) - 5;
this.leapc = _root.calculateProjectile(this.origx, this.origy, this.desx, this.desy);
this.lkey = false;
this.rkey = false;
this.leap = true;
this.leaptimer = 6;
if (this._x < this.desx) {
this._xscale = 100;
} else {
this._xscale = -100;
}
}
this.jkey = false;
} else {
this.ypoint = this._y;
this.xpoint = _root.hero._x;
}
} else {
if (this._x < ((this.xpoint - 20) + this.maxxspd)) {
if ((random(20) == 0) && (!this.jump)) {
this.jump = true;
this.yspd = -5 - random(3);
}
this.rkey = true;
this.lkey = false;
} else if (this._x > ((this.xpoint + 20) - this.maxxspd)) {
if ((random(20) == 0) && (!this.jump)) {
this.jump = true;
this.yspd = -5 - random(3);
}
this.lkey = true;
this.rkey = false;
} else {
if (random(20) == 0) {
this.ypoint = _root.hero._y;
this.xpoint = random(((_root.hori_limit - 2) * 16) + 16);
this.targethero = false;
}
this.lkey = false;
this.rkey = false;
}
if (Math.abs(this._x - this.xpoint) < 50) {
if (((this._y > (this.ypoint + 20)) && (!_root.hero.jump)) || (this._y > (this.ypoint + 35))) {
this.jkey = true;
} else {
this.jkey = false;
}
}
}
if (this.jkey && (!this.jump)) {
this.gotoAndStop(4);
this.yspd = -9 - random(3);
if (this.rkey && (this.xspd < 0)) {
this.xspd = this.xspd + 5;
} else if (this.lkey && (this.xspd > 0)) {
this.xspd = this.xspd - 5;
}
this.jump = true;
this.jkey = true;
}
if (this.rkey && (!this.attacking)) {
this.xspd = this.xspd + 2;
if (this.xspd > this.maxxspd) {
this.xspd = this.maxxspd;
}
this._xscale = 100;
} else if (this.lkey && (!this.attacking)) {
this.xspd = this.xspd - 2;
if (this.xspd < (-this.maxxspd)) {
this.xspd = -this.maxxspd;
}
this._xscale = -100;
} else if (this.xspd >= 2) {
this.xspd = this.xspd - 2;
} else if (this.xspd <= -2) {
this.xspd = this.xspd + 2;
} else {
this.xspd = 0;
}
} else if (this.jump) {
this.leap = false;
if (this.xspd > 0.25) {
this.xspd = this.xspd - 0.25;
} else if (this.xspd < -0.25) {
this.xspd = this.xspd + 0.25;
} else {
this.xspd = 0;
}
} else if (!this.jump) {
this.leap = false;
if (this.xspd > 0.5) {
this.xspd = this.xspd - 1;
} else if (this.xspd < -0.5) {
this.xspd = this.xspd + 1;
} else {
this.xspd = 0;
}
}
this.xcoord = Math.floor(this._x / 16);
this.ycoord = Math.floor((this._y - 8) / 16);
if ((_root.level_ground[this.ycoord][this.xcoord + 1] == 1) || (_root.level_ground[this.ycoord - 1][this.xcoord + 1] == 1)) {
this.rlim = (this.xcoord * 16) + 7;
} else {
this.rlim = _root.hori_limit * 16;
}
if ((_root.level_ground[this.ycoord][this.xcoord - 1] == 1) || (_root.level_ground[this.ycoord - 1][this.xcoord - 1] == 1)) {
this.llim = (this.xcoord * 16) + 7;
} else {
this.llim = 0;
}
this._x = this._x + this.xspd;
if ((((((!this.jump) && (!this.leap)) && (this.xspd > 0)) && (_root.level_ground[this.ycoord + 1][this.xcoord + 1] != 1)) && (_root.level_ground[this.ycoord + 1][this.xcoord + 1] != 3)) || (((((!this.jump) && (!this.leap)) && (this.xspd < 0)) && (_root.level_ground[this.ycoord + 1][this.xcoord - 1] != 1)) && (_root.level_ground[this.ycoord + 1][this.xcoord - 1] != 3))) {
if (((this.yd > 1) && (random(100) < 60)) || (random(100) < 20)) {
this.jump = true;
this.yspd = -6 - random(4);
}
}
if (this._x > this.rlim) {
this._x = this.rlim;
this.xspd = 0;
if (random(15) == 0) {
this.jump = true;
this.yspd = -6 - random(4);
}
}
if (this._x < this.llim) {
this._x = this.llim;
this.xspd = 0;
if (random(15) == 0) {
this.jump = true;
this.yspd = -6 - random(4);
}
}
if ((((_root.level_ground[this.ycoord + 1][Math.floor((this._x - 6) / 16)] == 1) || (_root.level_ground[this.ycoord + 1][Math.floor((this._x + 6) / 16)] == 1)) || (_root.level_ground[this.ycoord + 1][Math.floor((this._x - 3) / 16)] == 3)) || (_root.level_ground[this.ycoord + 1][Math.floor((this._x + 3) / 16)] == 3)) {
this.groundpos = (this.ycoord + 1) * 16;
} else {
if (!this.jump) {
this.jump = true;
this.yspd = 0;
}
this.groundpos = 10000;
}
if ((_root.level_ground[this.ycoord - 2][Math.floor((this._x - 3) / 16)] == 1) || (_root.level_ground[this.ycoord - 2][Math.floor((this._x + 3) / 16)] == 1)) {
this.ceilpos = (this.ycoord - 1) * 16;
} else {
this.ceilpos = 0;
}
if (this.leap) {
this.leaptimer = this.leaptimer - 1;
this.leapdis = Math.round(this.leapc[3] / 10);
if (this.boss) {
this.leapdis = Math.round(this.leapdis / 2);
}
if (this.leaptimer < (-this.leapdis)) {
this.jump = true;
this.yspd = (-this.leaplasty) + this._y;
this._y = this._y + this.yspd;
this.leap = false;
if (random(5) == 0) {
playBrute_s();
}
if (this.targethero) {
this.ypoint = 9999;
this.xpoint = _root.hero._x;
this.targetspecial = false;
}
if (this.boss) {
_root.changeColor(_root["enemy" + this.en], 2, 1, 1);
}
} else if (this.leaptimer < 0) {
this._x = (((this.desx - this.origx) / this.leapdis) * (-this.leaptimer)) + this.origx;
this.leaplasty = this._y;
this._y = ((this.leapc[0] * Math.pow(this._x, 2)) + (this.leapc[1] * this._x)) + this.leapc[2];
}
} else if (this.jump) {
this._y = this._y + this.yspd;
if ((this._y - 26) < this.ceilpos) {
this.yspd = 0;
this._y = this.ceilpos + 26;
if (_root.level_ground[this.ycoord - 1][this.xcoord] == 21) {
if (this.xspd == 0) {
this.xspd = 6;
} else {
this.xspd = (6 * Math.abs(this.xspd)) / this.xspd;
}
this.alive = false;
}
}
if (this.yspd < 10) {
this.yspd = this.yspd + 1.2;
}
if (((this.groundpos - this._y) < 0) && (this.yspd > 0)) {
this.jump = false;
this.doublejump = false;
this._y = this.groundpos;
}
if (this._y > 500) {
_root.removeEnemy(this.en);
}
} else {
this._y = this.groundpos;
}
if (this.entry) {
this.gotoAndStop(6);
} else if (this.alive) {
if (this.leap) {
if (this.leaptimer > 0) {
this.gotoAndStop(8);
} else {
this.gotoAndStop(3);
}
} else if (this.jump) {
if (this.dis < 25) {
this.attacking = true;
this.gotoAndStop(4);
} else {
this.gotoAndStop(3);
this.mc.gotoAndStop(this.yspd + 12);
}
} else if (this.attacking) {
this.gotoAndStop(4);
} else if (this.xspd != 0) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
} else if (this.jump) {
this.gotoAndStop(7);
} else {
this.gotoAndStop(7);
this.mc.play();
}
};
}
function spawnBehemoth(_i, _j, _entry, _boss) {
en = _root.enemy_idpool.pop();
_root.ecount++;
_root.attachMovie("behemoth_mc", "enemy" + en, 31000 + en);
_root.changeColor(_root["enemy" + en]);
if (random(3) == 0) {
playBehemoth_s();
}
if (_entry == 1) {
_root["enemy" + en]._x = (_j * 16) + 8;
_root["enemy" + en]._y = (_i * 16) + 8;
_root["enemy" + en].entry = false;
if (_root["enemy" + en]._x < 30) {
_root["enemy" + en].xpoint = 40 + random(40);
} else if (_root["enemy" + en]._x > ((_root.hori_limit * 16) - 30)) {
_root["enemy" + en].xpoint = ((_root.hori_limit * 16) - 40) - random(40);
}
} else {
_root["enemy" + en]._x = (_j * 16) + 16;
_root["enemy" + en]._y = (_i * 16) + 32;
_root["enemy" + en].entry = true;
_root["enemy" + en].gotoAndStop(6);
}
_root["enemy" + en].alive = true;
_root["enemy" + en].health = 100 * _root.difficulty;
_root["enemy" + en].maxxspd = (1.3 + (random(50) / 50)) * _root.difficulty;
_root["enemy" + en].xspd = 0;
_root["enemy" + en].yspd = 0;
_root["enemy" + en].jump = false;
_root["enemy" + en].targethero = true;
_root["enemy" + en].etype = "behemoth";
_root["enemy" + en].en = en;
if (_boss) {
_root.addGlow(_root["enemy" + en], 2883456);
_root["enemy" + en].health = _root["enemy" + en].health * 10;
_root["enemy" + en].boss = true;
}
_root["enemy" + en].onEnterFrame = function () {
if (this.entry) {
this.xspd = 0;
this.yspd = 0;
} else if (this.alive) {
this.dis = Math.pow(Math.pow(this._y - _root.hero._y, 2) + Math.pow(this._x - _root.hero._x, 2), 0.5);
if ((((((random(40 / _root.difficulty) == 0) && (!this.jump)) && (!this.attacking)) && (this.dis < 250)) && (Math.abs(this._x - _root.hero._x) > 10)) || ((this.attacktype > 2) && (!this.attacking))) {
if (this.boss) {
if (this.attacktype > 2) {
this.attacktype--;
} else if (random(5) == 0) {
this.attacktype = -1;
} else if (random(2) == 0) {
this.attacktype = 5;
} else {
this.attacktype = 1;
}
} else {
this.attacktype = 0;
}
this.attacking = true;
if (this.attacktype != -1) {
_root.shootSlime(this._x, this._y - 20, _root.hero._x, ((_root.hero._y - 15) + random(30)) - 15, "reg", 5);
if (this.attacktype == 1) {
_root.shootSlime(this._x, this._y - 20, (_root.hero._x + random(40)) - 20, ((((_root.hero._y - 15) + random(30)) - 15) + random(40)) - 20, "reg", 3);
_root.shootSlime(this._x, this._y - 20, (_root.hero._x + random(40)) - 20, ((((_root.hero._y - 15) + random(30)) - 15) + random(40)) - 20, "reg", 3);
}
p = 0;
while (p < 3) {
_root.spawnSpew((this._x + random(10)) - 5, ((this._y - 20) + random(10)) - 5, Math.atan2(((-this._y) + _root.hero._y) - 100, (-this._x) + _root.hero._x));
p++;
}
}
if (this._x > _root.hero._x) {
this._xscale = -100;
} else {
this._xscale = 100;
}
}
if (random(50) == 0) {
this.xpoint = random((_root.hori_limit - 2) * 16);
} else if (random(20) == 0) {
this.xpoint = this._x;
}
if (this._x < ((this.xpoint - 20) + this.maxxspd)) {
if ((random(50) == 0) && (!this.jump)) {
this.jump = true;
this.yspd = -5 - random(3);
}
this.rkey = true;
this.lkey = false;
} else if (this._x > ((this.xpoint + 20) - this.maxxspd)) {
if ((random(50) == 0) && (!this.jump)) {
this.jump = true;
this.yspd = -5 - random(3);
}
this.lkey = true;
this.rkey = false;
} else {
if (random(200) == 0) {
this.ypoint = _root.hero._y;
this.xpoint = random(((_root.hori_limit - 2) * 16) + 16);
this.targethero = false;
}
this.lkey = false;
this.rkey = false;
}
if (this.jkey && (!this.jump)) {
this.gotoAndStop(4);
this.yspd = -9 - random(3);
if (this.rkey && (this.xspd < 0)) {
this.xspd = this.xspd + 5;
} else if (this.lkey && (this.xspd > 0)) {
this.xspd = this.xspd - 5;
}
this.jump = true;
this.jkey = true;
}
if (this.rkey && (!this.attacking)) {
this.xspd = this.xspd + 2;
if (this.xspd > this.maxxspd) {
this.xspd = this.maxxspd;
}
this._xscale = 100;
} else if (this.lkey && (!this.attacking)) {
this.xspd = this.xspd - 2;
if (this.xspd < (-this.maxxspd)) {
this.xspd = -this.maxxspd;
}
this._xscale = -100;
} else if (this.xspd >= 2) {
this.xspd = this.xspd - 2;
} else if (this.xspd <= -2) {
this.xspd = this.xspd + 2;
} else {
this.xspd = 0;
}
} else if (this.jump) {
this.climb = false;
if (this.xspd > 0.25) {
this.xspd = this.xspd - 0.25;
} else if (this.xspd < -0.25) {
this.xspd = this.xspd + 0.25;
} else {
this.xspd = 0;
}
} else if (!this.jump) {
this.climb = false;
if (this.xspd > 0.5) {
this.xspd = this.xspd - 1;
} else if (this.xspd < -0.5) {
this.xspd = this.xspd + 1;
} else {
this.xspd = 0;
}
}
this.xcoord = Math.floor(this._x / 16);
this.ycoord = Math.floor((this._y - 8) / 16);
if ((_root.level_ground[this.ycoord][this.xcoord + 1] == 1) || (_root.level_ground[this.ycoord - 1][this.xcoord + 1] == 1)) {
this.rlim = (this.xcoord * 16) + 7;
} else {
this.rlim = _root.hori_limit * 16;
}
if ((_root.level_ground[this.ycoord][this.xcoord - 1] == 1) || (_root.level_ground[this.ycoord - 1][this.xcoord - 1] == 1)) {
this.llim = (this.xcoord * 16) + 7;
} else {
this.llim = 0;
}
this._x = this._x + this.xspd;
if ((((((!this.jump) && (!this.climb)) && (this.xspd > 0)) && (_root.level_ground[this.ycoord + 1][this.xcoord + 1] != 1)) && (_root.level_ground[this.ycoord + 1][this.xcoord + 1] != 3)) || (((((!this.jump) && (!this.climb)) && (this.xspd < 0)) && (_root.level_ground[this.ycoord + 1][this.xcoord - 1] != 1)) && (_root.level_ground[this.ycoord + 1][this.xcoord - 1] != 3))) {
if (((this.yd > 1) && (random(100) < 60)) || (random(100) < 20)) {
this.jump = true;
this.yspd = -6 - random(4);
}
}
if (this._x > this.rlim) {
this._x = this.rlim;
this.xspd = 0;
if (random(15) == 0) {
this.jump = true;
this.yspd = -6 - random(4);
}
}
if (this._x < this.llim) {
this._x = this.llim;
this.xspd = 0;
if (random(15) == 0) {
this.jump = true;
this.yspd = -6 - random(4);
}
}
if ((((_root.level_ground[this.ycoord + 1][Math.floor((this._x - 6) / 16)] == 1) || (_root.level_ground[this.ycoord + 1][Math.floor((this._x + 6) / 16)] == 1)) || (_root.level_ground[this.ycoord + 1][Math.floor((this._x - 3) / 16)] == 3)) || (_root.level_ground[this.ycoord + 1][Math.floor((this._x + 3) / 16)] == 3)) {
this.groundpos = (this.ycoord + 1) * 16;
} else {
if (!this.jump) {
this.jump = true;
this.yspd = 0;
}
this.groundpos = 10000;
}
if ((_root.level_ground[this.ycoord - 2][Math.floor((this._x - 3) / 16)] == 1) || (_root.level_ground[this.ycoord - 2][Math.floor((this._x + 3) / 16)] == 1)) {
this.ceilpos = (this.ycoord - 1) * 16;
} else {
this.ceilpos = 0;
}
if (this.climb) {
this._y = this._y - (2 + (this.maxxspd / 3));
if (this._y < (this.wallh * 16)) {
this.climb = false;
this.jump = true;
this.yspd = -10;
}
} else if (this.jump) {
this._y = this._y + this.yspd;
if ((this._y - 26) < this.ceilpos) {
this.yspd = 0;
this._y = this.ceilpos + 26;
if (_root.level_ground[this.ycoord - 1][this.xcoord] == 21) {
if (this.xspd == 0) {
this.xspd = 6;
} else {
this.xspd = (6 * Math.abs(this.xspd)) / this.xspd;
}
this.alive = false;
}
}
if (this.yspd < 10) {
this.yspd = this.yspd + 1.2;
}
if (((this.groundpos - this._y) < 0) && (this.yspd > 0)) {
this.jump = false;
this.doublejump = false;
this._y = this.groundpos;
}
if (this._y > 500) {
_root.removeEnemy(this.en);
}
} else {
this._y = this.groundpos;
}
if (this.entry) {
this.gotoAndStop(6);
} else if (this.alive) {
if (this.jump) {
this.gotoAndStop(3);
this.mc.gotoAndStop(this.yspd + 12);
} else if (this.attacking) {
if (this.attacktype == -1) {
this.gotoAndStop(5);
} else {
this.gotoAndStop(4);
}
} else if (this.xspd != 0) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
} else if (this.jump) {
this.gotoAndStop(7);
} else {
this.gotoAndStop(7);
this.mc.play();
}
};
}
function newGame() {
_root.hero_lastlevel = "01A";
_root.hero_points = 0;
_root.hero_weapons = [1, 1, 0, 0, 0, 0, 0, 0];
_root.hero_kills = 0;
_root.hero_deaths = 0;
_root.effects = true;
_root.difficultymod = 2;
}
function startLevel(_type) {
_root._quality = "LOW";
_root.mochi.as2.MochiServices("Start Level", _root.currentlevel);
_root.objectids = ["piss", "shit"];
_root.spawnids = [];
_root.deadspawnids = [];
_root.attachMovie("background_g", "background_g", 1);
_root.attachMovie("hud_mc", "hud_mc", 49998);
_root.hud_mc._xscale = 50;
_root.hud_mc._yscale = 50;
_root._xscale = 200;
_root._yscale = 200;
depth = 0;
pn = 1;
cn = 0;
objn = 0;
en = 0;
gemcount = 0;
gemcollect = 0;
ecount = 0;
seq_killcount = 0;
seq_spawncount = 0;
seq_end = 0;
if (_type == "restart") {
seq_type = "store";
seq_pt = -1;
_root.hud_mc.attachMovie("hud_store", "hud_store", 49999);
_root.hud_mc.hud_store.gotoAndPlay(2);
_root.hud_mc.hud_store.hiscore._visible = false;
if ((_root.currentlevel == "06") || (_root.currentlevel == "07")) {
_root.attachMovie("hud_darkness", "hud_darkness", 49997);
_root.hud_darkness.onEnterFrame = function () {
this._x = _root.hero._x;
this._y = _root.hero._y - 14;
};
}
} else {
seq_pt = 0;
nextSequence(seq_pt);
}
i = 0;
while (i < 30) {
j = 0;
while (j < 40) {
if (level[i][j] == "he") {
spawnHero(i, j);
} else if (level[i][j].substr(0, 2) == "57") {
_root.attachMovie("tile57", "tile" + depth, 15000 + depth);
_root["tile" + depth].j = j;
_root["tile" + depth].i = i;
_root["tile" + depth]._x = j * 16;
_root["tile" + depth]._y = i * 16;
_root["tile" + depth].tid = level[i][j].substr(5, 2);
_root["tile" + depth].dest = level[i][j].substr(2, 3);
Key.addListener(_root["tile" + depth]);
_root["tile" + depth].onKeyDown = function () {
if (Key.isDown(40) && (!this.kd)) {
this.kd = true;
if (((!_root.hero.jump) && (Math.abs((this._x + 16) - _root.hero._x) < 10)) && (Math.abs((this._y + 32) - _root.hero._y) < 12)) {
this.gotoAndPlay(2);
_root.hero.removeMovieClip();
clearInterval(_root.nextlevelint);
_root.nextlevelint = setInterval(nextLevel, 1000, this.dest);
}
}
};
_root["tile" + depth].onKeyUp = function () {
if (!Key.isDown(40)) {
this.kd = false;
}
};
depth++;
} else if (((level[i][j].substr(0, 2) == "47") || (level[i][j].substr(0, 2) == "48")) || (level[i][j].substr(0, 2) == "49")) {
if ((level[i][j].substr(0, 2) == "47") || (level[i][j].substr(0, 2) == "48")) {
if ((j < 1) || (j > (_root.hori_limit - 2))) {
_root.attachMovie("tile_horigrad", "tile" + depth, 15000 + depth);
} else {
_root.attachMovie("tile_vertgrad", "tile" + depth, 15000 + depth);
}
_root["tile" + depth]._x = j * 16;
_root["tile" + depth]._y = i * 16;
_root["tile" + depth].depth = depth;
depth++;
_root.attachMovie("tile39", "tile" + depth, 15000 + depth);
_root["tile" + depth]._x = j * 16;
_root["tile" + depth]._y = i * 16;
_root["tile" + depth]._alpha = 80;
_root["tile" + depth].depth = depth;
} else {
_root.attachMovie("tile49", "tile" + depth, 15000 + depth);
_root["tile" + depth]._x = j * 16;
_root["tile" + depth]._y = i * 16;
_root["tile" + depth].depth = depth;
}
if (level[i][j].substr(2, 2) == "01") {
_root.spawnids.push(i);
_root.spawnids.push(j);
if (level[i][j].substr(0, 2) == "49") {
_root.spawnids.push(2);
} else if ((level[i][j].substr(0, 2) == "47") || (level[i][j].substr(0, 2) == "48")) {
_root.spawnids.push(1);
_root["tile" + depth]._visible = false;
}
} else {
if (level[i][j].substr(0, 2) == "49") {
_root["tile" + depth].stype = 2;
p = 0;
while (p < 5) {
_root["tile" + depth].attachMovie("woodboard_mc", "board" + p, 10 - p);
_root["tile" + depth]["board" + p]._x = (16 + random(4)) - 2;
_root["tile" + depth]["board" + p]._xscale = (100 + random(20)) - 10;
_root["tile" + depth]["board" + p]._y = 10 + (4 * p);
_root["tile" + depth]["board" + p]._rotation = random(20) - 10;
p++;
}
} else if (level[i][j].substr(0, 2) == "48") {
_root["tile" + depth].stype = 1;
} else if (level[i][j].substr(0, 2) == "47") {
_root["tile" + depth].stype = 3;
}
_root.deadspawnids.push(level[i][j].substr(2, 2));
_root.deadspawnids.push(depth);
}
depth++;
} else {
_root.attachMovie("tile" + level[i][j], "tile" + depth, 15000 + depth);
_root["tile" + depth]._x = j * 16;
_root["tile" + depth]._y = i * 16;
_root["tile" + depth].depth = depth;
depth++;
}
j++;
}
i++;
}
}
function destroyLevel() {
_root._x = 0;
_root._y = 0;
_root._xscale = 100;
_root._yscale = 100;
_root.snapshot_mc._x = ((-_root.snapshot_mc.origx) / 2) - (_root._x / 2);
_root.snapshot_mc._y = ((-_root.snapshot_mc.origy) / 2) - (_root._y / 2);
clearInterval(_root.nextlevelint);
clearTimeout(_root.lulltimeout);
i = 0;
while (i <= 2000) {
Key.removeListener(_root["tile" + i]);
_root["tile" + i].removeMovieClip();
_root["effect" + i].removeMovieClip();
i++;
}
i = 0;
while (i <= 500) {
_root["arrow" + i].removeMovieClip();
_root["obj" + i].removeMovieClip();
_root["obj2" + i].removeMovieClip();
_root["objc" + i].removeMovieClip();
_root["drop" + i].removeMovieClip();
_root.removeEnemy(i);
_root["ghost" + i].removeMovieClip();
i++;
}
_root.hud_darkness.removeMovieClip();
_root.hero.removeMovieClip();
_root.background_g.removeMovieClip();
_root.hud_mc.removeMovieClip();
_root.seq_pt = 9999;
delete objectids;
}
function nextLevel(_id, _type) {
_root.hero_kills = 0;
_root.hero_shotsfired = 0;
_root.hero_shotshit = 0;
_root.hero_lastlevel = _id;
_root.saveGame();
_root.currentid = _id;
_root.currentlevel = _id.substr(0, 2);
Array.prototype.copy = Array.prototype.slice;
sequence = _root["sequence" + _id].copy();
_root.createLevel(_root["level" + _id], _type);
clearInterval(_root.nextlevelint);
}
function captureShot() {
_root.snapshot_mc.removeMovieClip();
_root.snapshot = new flash.display.BitmapData(600, 480);
_root.snapshot.draw(_root, new flash.geom.Matrix(), new flash.geom.ColorTransform(), 1, new flash.geom.Rectangle((-_root._x) / 2, (-_root._y) / 2, 300, 240));
_root.createEmptyMovieClip("snapshot_mc", 50001);
_root.snapshot_mc.attachBitmap(_root.snapshot, 1);
_root.snapshot_mc.origx = -_root._x;
_root.snapshot_mc.origy = -_root._y;
_root.snapshot_mc._x = ((-_root.snapshot_mc.origx) / 2) - (_root._x / 2);
_root.snapshot_mc._y = ((-_root.snapshot_mc.origy) / 2) - (_root._y / 2);
_root.snapshot_mc.onEnterFrame = function () {
this._x = ((-this.origx) / 2) - (_root._x / 2);
this._y = ((-this.origy) / 2) - (_root._y / 2);
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
}
_root.onEnterFrame = function () {
_root.desx = _root.hero._x;
_root.desy = _root.hero._y;
if (_root.desx > ((((_root.hori_limit + 1) * 16) - 150) - 7.5)) {
_root.desx = (((_root.hori_limit + 1) * 16) - 150) - 7.5;
}
if (_root.desx < 157.5) {
_root.desx = 157.5;
}
if (_root.desy > ((((_root.vert_limit + 1) * 16) - 120) - 7.5)) {
_root.desy = (((_root.vert_limit + 1) * 16) - 120) - 7.5;
}
if (_root.desy < 127.5) {
_root.desy = 127.5;
}
_root._x = _root._x - (((_root._x + (_root.desx * 2)) - 300) / 6);
_root._y = _root._y - (((_root._y + (_root.desy * 2)) - 240) / 6);
_root._x = Math.round(_root._x / 2) * 2;
_root._y = Math.round(_root._y / 2) * 2;
_root.hud_mc._x = (-_root._x) / 2;
_root.hud_mc._y = (-_root._y) / 2;
if (seq_type == "elim") {
if ((((((seq_spawncount < seq_end) && (_root.ecount < _root.maxecount)) && (_root.hero)) && (random(_root.spawnchanceint) == 0)) && (_root.spawnids.length > 0)) && (_root.enemy_idpool.length > 0)) {
spawnrand = random(100);
spawnloc = random(_root.spawnids.length / 3);
if (setboss1 == seq_spawncount) {
p = 0;
while (p < setbosstype1[0]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnStalker(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
}
p++;
}
p = 0;
while (p < setbosstype1[1]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnBrute(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
}
p++;
}
p = 0;
while (p < setbosstype1[2]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnBehemoth(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
}
p++;
}
} else if (setboss2 == seq_spawncount) {
p = 0;
while (p < setbosstype2[0]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnStalker(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
}
p++;
}
p = 0;
while (p < setbosstype2[1]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnBrute(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
}
p++;
}
p = 0;
while (p < setbosstype2[2]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnBehemoth(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
}
p++;
}
} else if (setboss3 == seq_spawncount) {
p = 0;
while (p < setbosstype3[0]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnStalker(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
}
p++;
}
p = 0;
while (p < setbosstype3[1]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnBrute(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
}
p++;
}
p = 0;
while (p < setbosstype3[2]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnBehemoth(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
}
p++;
}
} else if (setboss4 == seq_spawncount) {
p = 0;
while (p < setbosstype4[0]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnStalker(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
}
p++;
}
p = 0;
while (p < setbosstype4[1]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnBrute(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
}
p++;
}
p = 0;
while (p < setbosstype4[2]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnBehemoth(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
}
p++;
}
} else if (setboss5 == seq_spawncount) {
p = 0;
while (p < setbosstype5[0]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnStalker(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
}
p++;
}
p = 0;
while (p < setbosstype5[1]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnBrute(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
}
p++;
}
p = 0;
while (p < setbosstype5[2]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnBehemoth(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
}
p++;
}
} else {
seq_spawncount++;
if (spawnrand < spawnchance[0]) {
_root.spawnStalker(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2]);
} else if (spawnrand < spawnchance[1]) {
_root.spawnBrute(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2]);
} else {
_root.spawnBehemoth(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2]);
}
}
}
if (seq_killcount >= seq_end) {
seq_pt++;
nextSequence(seq_pt);
}
} else if (seq_type == "batch") {
if (seq_killcount >= seq_end) {
seq_pt++;
nextSequence(seq_pt);
}
} else if (seq_type == "boss") {
if (seq_killcount >= seq_end) {
seq_pt++;
nextSequence(seq_pt);
}
}
};
var keyListener2 = new Object();
keyListener2.onKeyDown = function () {
if (Key.isDown(13)) {
captureShot();
}
};
Key.addListener(keyListener2);
newGame();
function nextSequence(_pt) {
seq_type = _root.sequence[seq_pt][0];
if (seq_type == "clearboss") {
setboss1 = 999;
setboss2 = 999;
setboss3 = 999;
setboss4 = 999;
setboss5 = 999;
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
} else if (seq_type == "setboss") {
if (setboss1 == 999) {
setboss1 = seq_end + _root.sequence[seq_pt][2];
setbosstype1 = _root.sequence[seq_pt][1];
} else if (setboss2 == 999) {
setboss2 = seq_end + _root.sequence[seq_pt][2];
setbosstype2 = _root.sequence[seq_pt][1];
} else if (setboss3 == 999) {
setboss3 = seq_end + _root.sequence[seq_pt][2];
setbosstype3 = _root.sequence[seq_pt][1];
} else if (setboss4 == 999) {
setboss4 = seq_end + _root.sequence[seq_pt][2];
setbosstype4 = _root.sequence[seq_pt][1];
} else if (setboss5 == 999) {
setboss5 = seq_end + _root.sequence[seq_pt][2];
setbosstype5 = _root.sequence[seq_pt][1];
}
seq_end = seq_end + ((_root.sequence[seq_pt][1][0] + _root.sequence[seq_pt][1][1]) + _root.sequence[seq_pt][1][2]);
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
} else if (seq_type == "elim") {
spawnchance = [_root.sequence[seq_pt][1][0], _root.sequence[seq_pt][1][0] + _root.sequence[seq_pt][1][1], (_root.sequence[seq_pt][1][0] + _root.sequence[seq_pt][1][1]) + _root.sequence[seq_pt][1][2]];
seq_end = seq_end + _root.sequence[seq_pt][2];
} else if (seq_type == "batch") {
spawnloc = random(_root.spawnids.length / 3);
p = 0;
while (p < _root.sequence[seq_pt][1][0]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnStalker(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2]);
seq_spawncount++;
seq_end++;
}
p++;
}
p = 0;
while (p < _root.sequence[seq_pt][1][1]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnBrute(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2]);
seq_spawncount++;
seq_end++;
}
p++;
}
p = 0;
while (p < _root.sequence[seq_pt][1][2]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnBehemoth(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2]);
seq_spawncount++;
seq_end++;
}
p++;
}
if (_root.sequence[seq_pt][2] == 0) {
} else {
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
}
} else if (seq_type == "boss") {
spawnloc = random(_root.spawnids.length / 3);
p = 0;
while (p < _root.sequence[seq_pt][1][0]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnStalker(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
seq_end++;
}
p++;
}
p = 0;
while (p < _root.sequence[seq_pt][1][1]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnBrute(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
seq_end++;
}
p++;
}
p = 0;
while (p < _root.sequence[seq_pt][1][2]) {
if ((_root.spawnids.length > 0) && (_root.enemy_idpool.length > 0)) {
_root.spawnBehemoth(_root.spawnids[spawnloc * 3], _root.spawnids[(spawnloc * 3) + 1], _root.spawnids[(spawnloc * 3) + 2], true);
seq_spawncount++;
seq_end++;
}
p++;
}
if (_root.sequence[seq_pt][2] == 0) {
} else {
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
}
} else if (seq_type == "lull") {
lulltimeout = setTimeout(function () {
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
}, _root.sequence[seq_pt][1]);
} else if (seq_type == "spawnint") {
_root.spawnchanceint = _root.sequence[seq_pt][1];
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
} else if (seq_type == "ecount") {
_root.maxecount = _root.sequence[seq_pt][1];
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
} else if (seq_type == "difficulty") {
_root.difficulty = _root.sequence[seq_pt][1] * (0.55 + (_root.difficultymod * 0.225));
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
} else if (seq_type == "healthchance") {
_root.healthchance = _root.sequence[seq_pt][1];
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
} else if (seq_type == "lightsoff") {
_root.attachMovie("hud_darkness", "hud_darkness", 49997);
_root.hud_darkness.onEnterFrame = function () {
this._x = _root.hero._x;
this._y = _root.hero._y - 14;
};
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
} else if (seq_type == "opensp") {
_root.smash_s.start(0, 1);
_root.rocksmash_s.start(0, 1);
p = 0;
while (p < (_root.deadspawnids.length / 2)) {
if (_root.deadspawnids[p * 2] == _root.sequence[seq_pt][1]) {
if (_root["tile" + _root.deadspawnids[(p * 2) + 1]].stype == 3) {
_root["tile" + _root.deadspawnids[(p * 2) + 1]]._visible = false;
_root.spawnBricks(_root["tile" + _root.deadspawnids[(p * 2) + 1]]._x, _root["tile" + _root.deadspawnids[(p * 2) + 1]]._y);
} else {
_root.spawnids.push(_root["tile" + _root.deadspawnids[(p * 2) + 1]]._y / 16);
_root.spawnids.push(_root["tile" + _root.deadspawnids[(p * 2) + 1]]._x / 16);
if (_root["tile" + _root.deadspawnids[(p * 2) + 1]].stype == 1) {
_root.spawnids.push(1);
_root["tile" + _root.deadspawnids[(p * 2) + 1]]._visible = false;
_root.spawnBricks(_root["tile" + _root.deadspawnids[(p * 2) + 1]]._x, _root["tile" + _root.deadspawnids[(p * 2) + 1]]._y);
} else {
_root.spawnids.push(2);
_root["tile" + _root.deadspawnids[(p * 2) + 1]].openEntry();
}
}
}
p++;
}
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
} else if (seq_type == "store") {
_root.hud_mc.attachMovie("hud_store", "hud_store", 49999);
if (_root.sequence[seq_pt][1] != 0) {
_root.hud_mc.hud_store.type = 1;
_root.hud_mc.hud_store.gotoAndPlay(2);
trace(_root.currentlevel);
if (_root.currentlevel == "01") {
_root.hud_mc.hud_store.hiscore._visible = false;
}
} else {
_root.hud_mc.hud_store.hiscore._visible = false;
}
_root.hud_mc.hud_store.onEnterFrame = function () {
if (Key.isDown(32)) {
}
};
} else if (seq_type == "pause") {
_root.hud_mc.attachMovie("hud_pause", "hud_pause", 49999);
_root.hud_mc.hud_pause.gotoAndStop(_root.sequence[seq_pt][1]);
_root.hud_mc.hud_pause.onEnterFrame = function () {
if (Key.isDown(32)) {
_root.hud_mc.hud_pause.spacebar_btn();
}
};
} else if (seq_type == "music") {
_root.fadeCrescendo();
if (_root.sequence[seq_pt][1] == 1) {
_root.devouringtime_s.start(0, 100);
} else if (_root.sequence[seq_pt][1] == 2) {
_root.getoutofmyway_s.start(0, 100);
} else if (_root.sequence[seq_pt][1] == 3) {
_root.outbreak_s.start(0, 100);
} else if (_root.sequence[seq_pt][1] == 4) {
_root.laststand_s.start(0, 100);
}
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
} else if (seq_type == "setgameover") {
_root.gameover = true;
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
} else if (seq_type == "gameover") {
_root.nextLevel(_root.sequence[seq_pt][1]);
} else if (seq_type == "title") {
_root.hud_mc.attachMovie("hud_title", "hud_title", 1600);
_root.hud_mc.hud_title.txt.text = _root.sequence[seq_pt][1];
_root.hud_mc.hud_title.clearTimeout(_root.hud_mc.hud_title.hudtimeout);
if (_root.sequence[seq_pt][2] != 0) {
_root.hud_mc.hud_title.hudtimeout = setTimeout(function () {
_root.hud_mc.hud_title.removeMovieClip();
}, _root.sequence[seq_pt][2]);
}
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
} else if (seq_type == "text") {
_root.hud_mc.attachMovie("hud_text", "hud_text", 1601);
_root.hud_mc.hud_text.txt.text = _root.sequence[seq_pt][1];
_root.hud_mc.hud_text.clearTimeout(_root.hud_mc.hud_text.hudtimeout);
if (_root.sequence[seq_pt][2] != 0) {
_root.hud_mc.hud_text.hudtimeout = setTimeout(function () {
_root.hud_mc.hud_text.removeMovieClip();
}, _root.sequence[seq_pt][2]);
}
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
} else if (seq_type == "cleartext") {
_root.hud_mc.hud_text.removeMovieClip();
_root.hud_mc.hud_title.removeMovieClip();
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
}
}
function getRandomSequence() {
if (random(4) == 0) {
if (random(5) == 0) {
return(["boss", [0, 0, 1 + random(3)], 1]);
}
if (random(4) == 0) {
return(["boss", [1, 0, random(2)], 1]);
}
if (random(3) == 0) {
return(["boss", [random(3) + 1, 0, 0], 1]);
}
if (random(2) == 0) {
return(["boss", [0, random(3) + 1, 0], 1]);
}
return(["boss", [0, 2, random(2)], 1]);
}
if (random(2) == 0) {
if (random(3) == 0) {
return(["elim", [50, 25, 25], 20]);
}
if (random(2) == 0) {
return(["elim", [25, 50, 25], 20]);
}
return(["elim", [25, 25, 50], 20]);
}
if (random(1) == 0) {
if (random(3) == 0) {
return(["batch", [6, 0, 0], 0]);
}
if (random(2) == 0) {
return(["batch", [0, 6, 0], 0]);
}
return(["batch", [0, 0, 6], 0]);
}
}
sequence01A = [["spawnint", 35], ["ecount", 5], ["difficulty", 0.75], ["healthchance", 5], ["pause", 6], ["music", 3], ["lull", 2000], ["pause", 2], ["pause", 3], ["lull", 3000], ["opensp", "02"], ["batch", [1, 0, 0], 0], ["lull", 1000], ["pause", 4], ["lull", 5000], ["batch", [3, 0, 0], 0], ["text", "here they come...", 0], ["lull", 5000], ["cleartext"], ["elim", [100, 0, 0], 9], ["opensp", "03"], ["batch", [3, 0, 0], 1], ["elim", [100, 0, 0], 9], ["text", "something's coming... something different", 5000], ["lull", 3000], ["clearboss"], ["setboss", [1, 0, 0], 4], ["elim", [100, 0, 0], 12], ["clearboss"], ["store", 1], ["gameover", "02A"]];
sequence02A = [["spawnint", 30], ["ecount", 7], ["difficulty", 0.8], ["healthchance", 6], ["lull", 1000], ["title", "1. The Cursed Beneath", 5000], ["lull", 5000], ["pause", 5], ["lull", 3000], ["batch", [4, 0, 0], 0], ["cleartext"], ["batch", [6, 0, 0], 0], ["lull", 3000], ["opensp", "02"], ["batch", [3, 0, 2], 1], ["text", "disgusting...", 5000], ["music", 1], ["elim", [70, 0, 30], 20], ["store", 0], ["lull", 2000], ["spawnint", 25], ["clearboss"], ["setboss", [1, 0, 0], 1], ["setboss", [1, 0, 0], 19], ["elim", [70, 0, 30], 20], ["clearboss"], ["lull", 1000], ["store", 1], ["gameover", "03A"]];
sequence03A = [["spawnint", 27], ["ecount", 9], ["difficulty", 0.87], ["healthchance", 5], ["lull", 1000], ["title", "2. Onward Alone", 5000], ["lull", 5000], ["text", "careful...", 5000], ["lull", 1000], ["elim", [70, 0, 30], 16], ["store", 0], ["lull", 3000], ["music", 2], ["opensp", "02"], ["batch", [3, 0, 0], 1], ["boss", [1, 0, 0], 1], ["lull", 3000], ["clearboss"], ["setboss", [1, 0, 0], 18], ["elim", [70, 0, 30], 20], ["clearboss"], ["lull", 3000], ["opensp", "03"], ["batch", [3, 0, 0], 1], ["boss", [2, 0, 0], 0], ["lull", 5000], ["store", 1], ["gameover", "04A"]];
sequence04A = [["spawnint", 27], ["ecount", 9], ["difficulty", 1], ["healthchance", 6], ["lull", 1000], ["title", "3. They are changing...", 5000], ["lull", 5000], ["elim", [20, 0, 80], 20], ["lull", 3000], ["music", 1], ["batch", [0, 0, 4], 1], ["boss", [0, 0, 1], 0], ["text", "I'm going to be sick...", 5000], ["store", 0], ["lull", 3000], ["opensp", "02"], ["batch", [0, 0, 4], 0], ["clearboss"], ["setboss", [0, 0, 1], 10], ["setboss", [1, 0, 0], 16], ["setboss", [0, 0, 1], 27], ["elim", [60, 0, 40], 28], ["clearboss"], ["store", 1], ["gameover", "05A"]];
sequence05A = [["spawnint", 30], ["ecount", 11], ["difficulty", 1.3], ["healthchance", 6], ["lull", 1000], ["title", "4. Brute Strength", 5000], ["lull", 5000], ["elim", [0, 100, 0], 5], ["music", 2], ["text", "...how many of these things are there?", 5000], ["lull", 5000], ["elim", [25, 50, 25], 20], ["store", 0], ["lull", 3000], ["batch", [0, 4, 0], 0], ["batch", [0, 3, 0], 1], ["boss", [0, 0, 2], 0], ["batch", [0, 5, 0], 0], ["lull", 5000], ["elim", [20, 55, 25], 20], ["lull", 5000], ["store", 1], ["gameover", "06A"]];
sequence06A = [["spawnint", 30], ["ecount", 10], ["difficulty", 1.5], ["healthchance", 4], ["lightsoff"], ["lull", 1000], ["title", "5. Alone in the dark", 5000], ["lull", 5000], ["text", "I can't see a damn thing", 5000], ["clearboss"], ["setboss", [0, 0, 1], 8], ["elim", [50, 25, 25], 15], ["lull", 3000], ["music", 1], ["clearboss"], ["setboss", [1, 0, 0], 12], ["elim", [25, 50, 25], 15], ["clearboss"], ["store", 0], ["lull", 3000], ["spawnint", 20], ["opensp", "02"], ["batch", [0, 7, 0], 0], ["batch", [4, 0, 2], 1], ["boss", [0, 0, 2], 0], ["lull", 1000], ["opensp", "03"], ["spawnint", 20], ["elim", [33, 33, 33], 18], ["lull", 1000], ["batch", [5, 5, 0], 1], ["boss", [2, 0, 0], 0], ["text", "I'm so tired...", 5000], ["lull", 5000], ["store", 1], ["gameover", "07A"]];
sequence07A = [["spawnint", 25], ["ecount", 15], ["difficulty", 1.5], ["healthchance", 5], ["lightsoff"], ["lull", 1000], ["title", "6. Too late to turn back", 5000], ["lull", 5000], ["boss", [0, 1, 0], 0], ["text", "They're getting faster... stronger...", 5000], ["lull", 5000], ["elim", [20, 50, 30], 15], ["lull", 3000], ["music", 4], ["opensp", "02"], ["batch", [4, 0, 0], 0], ["batch", [3, 0, 2], 1], ["boss", [1, 1, 0], 0], ["store", 0], ["batch", [4, 0, 3], 1], ["text", "I can't do this alone", 5000], ["lull", 5000], ["opensp", "03"], ["elim", [10, 60, 30], 20], ["text", "There's so many of them...", 5000], ["lull", 5000], ["opensp", "04"], ["spawnint", 18], ["batch", [3, 1, 2], 0], ["boss", [1, 0, 0], 1], ["elim", [50, 30, 20], 20], ["text", "they can't reach the surface...", 5000], ["lull", 2000], ["batch", [6, 0, 0], 0], ["boss", [0, 0, 1], 1], ["batch", [0, 6, 0], 0], ["boss", [0, 1, 0], 1], ["elim", [30, 50, 20], 8], ["store", 0], ["setgameover"], ["text", "I don't know how long I can keep this up...", 5000], ["lull", 2000], ["clearboss"], ["setboss", [0, 1, 0], 8], ["elim", [30, 20, 50], 12], ["clearboss"], ["ecount", 20], ["clearboss"], ["setboss", [0, 2, 0], 12], ["elim", [30, 50, 20], 15], ["clearboss"], ["batch", [6, 0, 0], 0], ["boss", [0, 0, 1], 1], ["batch", [0, 6, 0], 0], ["boss", [0, 1, 0], 1], ["elim", [30, 50, 20], 8], ["text", "So tired...", 5000], ["lull", 2000], ["elim", [20, 20, 60], 10], ["difficulty", 2], _root.getRandomSequence(), _root.getRandomSequence(), _root.getRandomSequence(), ["text", "I'm sorry...", 5000], ["lull", 2000], _root.getRandomSequence(), _root.getRandomSequence(), ["difficulty", 3], ["text", "I tried...", 5000], ["lull", 2000], _root.getRandomSequence(), _root.getRandomSequence(), _root.getRandomSequence(), _root.getRandomSequence(), _root.getRandomSequence(), _root.getRandomSequence(), _root.getRandomSequence(), _root.getRandomSequence(), ["difficulty", 5], ["text", "How am i still alive?", 5000], ["lull", 2000], _root.getRandomSequence(), _root.getRandomSequence(), _root.getRandomSequence(), _root.getRandomSequence(), _root.getRandomSequence(), _root.getRandomSequence(), _root.getRandomSequence(), ["gameover", "08A"]];
function startEditor() {
current_tile = "nu";
editor = true;
_root.createEmptyMovieClip("editor_controller", 2);
Key.addListener(_root.editor_controller);
_root.editor_controller.onKeyDown = function () {
if (((Key.isDown(46) && (!this.kd_del)) || (Key.isDown(8) && (!this.kd_del))) || (Key.isDown(68) && (!this.kd_del))) {
this.kd_del = true;
_root.updateTile(0);
}
if (Key.isDown(70) && (!this.kd_edit)) {
this.kd_edit = true;
_root.updateTile("edit");
}
if (Key.isDown(84) && (!this.kd_test)) {
this.kd_test = true;
_root.createLevel((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((_root.sample_leveldata + ":") + _root.sample_level[0]) + ":") + _root.sample_level[1]) + ":") + _root.sample_level[2]) + ":") + _root.sample_level[3]) + ":") + _root.sample_level[4]) + ":") + _root.sample_level[5]) + ":") + _root.sample_level[6]) + ":") + _root.sample_level[7]) + ":") + _root.sample_level[8]) + ":") + _root.sample_level[9]) + ":") + _root.sample_level[10]) + ":") + _root.sample_level[11]) + ":") + _root.sample_level[12]) + ":") + _root.sample_level[13]) + ":") + _root.sample_level[14]) + ":") + _root.sample_level[15]) + ":") + _root.sample_level[16]) + ":") + _root.sample_level[17]) + ":") + _root.sample_level[18]) + ":") + _root.sample_level[19]) + ":") + _root.sample_level[20]) + ":") + _root.sample_level[21]) + ":") + _root.sample_level[22]) + ":") + _root.sample_level[23]) + ":") + _root.sample_level[24]) + ":") + _root.sample_level[25]) + ":") + _root.sample_level[26]) + ":") + _root.sample_level[27]) + ":") + _root.sample_level[28]) + ":") + _root.sample_level[29]) + ":") + _root.sample_level[30]);
}
if (Key.isDown(49) && (!this.kd_1)) {
this.kd_1 = true;
_root.editor_menu.removeTiles();
_root.editor_menu.showTiles(_root.editor_menu.tile_main);
}
if (Key.isDown(50) && (!this.kd_2)) {
this.kd_2 = true;
_root.editor_menu.removeTiles();
_root.editor_menu.showTiles(_root.editor_menu.tile_enemy);
}
if (Key.isDown(51) && (!this.kd_3)) {
this.kd_3 = true;
_root.editor_menu.removeTiles();
_root.editor_menu.showTiles(_root.editor_menu.tile_environment);
}
};
_root.editor_controller.onKeyUp = function () {
if (((!Key.isDown(46)) && (!Key.isDown(8))) && (!Key.isDown(68))) {
this.kd_del = false;
}
if (!Key.isDown(70)) {
this.kd_edit = false;
}
if (!Key.isDown(84)) {
this.kd_test = false;
}
if (!Key.isDown(49)) {
this.kd_1 = false;
}
if (!Key.isDown(50)) {
this.kd_2 = false;
}
if (!Key.isDown(51)) {
this.kd_3 = false;
}
};
_root.editor_controller.onMouseMove = function () {
this.xcoord1 = this.xcoord;
this.ycoord1 = this.ycoord;
this.xcoord = Math.floor(_root._xmouse / 15);
this.ycoord = Math.floor(_root._ymouse / 15);
if (((this.xcoord != this.xcoord1) && (this.mouse)) || ((this.ycoord != this.ycoord1) && (this.mouse))) {
if ((!_root.editor_load) && (_root.current_tile != "nu")) {
_root.updateSample(this.xcoord, this.ycoord);
_root.updateDisplay2(this.xcoord, this.ycoord);
}
}
};
_root.editor_controller.onMouseDown = function () {
if (((!_root.editor_menu.showtiles) && (_root.current_tile != "nu")) && (_root._ymouse < 450)) {
this.mouse = true;
if (!_root.editor_load) {
_root.updateSample(this.xcoord, this.ycoord);
if (_root.current_tile != 0) {
_root.updateDisplay();
}
}
} else {
_root.editor_menu.removeTiles();
}
};
_root.editor_controller.onMouseUp = function () {
this.mouse = false;
_root.updateDisplay();
};
_root.attachMovie("editor_menu", "editor_menu", 9998);
_root.attachMovie("editor_redsquare", "editor_redsquare", 9997);
_root.editor_redsquare.onEnterFrame = function () {
this._x = Math.floor(_root._xmouse / 15) * 15;
this._y = Math.floor(_root._ymouse / 15) * 15;
};
_root.attachMovie("editor_redsquare", "editor_previewsquare", 9995);
_root.editor_previewsquare.onEnterFrame = function () {
this._x = Math.floor(_root._xmouse / 15) * 15;
this._y = Math.floor(_root._ymouse / 15) * 15;
};
_root.attachMovie("editor_mouse", "editor_mouse", 10002);
_root.editor_mouse.onEnterFrame = function () {
this._x = _root._xmouse + 15;
this._y = _root._ymouse + 15;
if (_root.current_tile == 0) {
this.gotoAndStop(2);
} else if (_root.current_tile == "edit") {
this.gotoAndStop(3);
} else {
this.gotoAndStop(1);
}
};
updateDisplay();
}
function updateSample(_xpos, _ypos) {
if (current_tile == "edit") {
_root.editor_redsquare2.removeMovieClip();
_root.attachMovie("editor_redsquare", "editor_redsquare2", 9996);
_root.editor_redsquare2._x = _xpos * 15;
_root.editor_redsquare2._y = _ypos * 15;
i = 1;
while (i <= 11) {
_root.editor_menu["var" + i].removeMovieClip();
i++;
}
_root["updateVars_" + sample_level[_ypos][_xpos].substr(0, 2)](_xpos, _ypos);
} else if ((_xpos < 40) && (_ypos < 30)) {
current_tile = String(current_tile);
if ((editor_menu.var1.var_num < 10) && (String(editor_menu.var1.var_num).length < 2)) {
editor_menu.var1.var_num = "0" + String(editor_menu.var1.var_num);
}
if ((editor_menu.var2.var_num < 10) && (String(editor_menu.var2.var_num).length < 2)) {
editor_menu.var2.var_num = "0" + String(editor_menu.var2.var_num);
}
if ((editor_menu.var3.var_num < 10) && (String(editor_menu.var3.var_num).length < 2)) {
editor_menu.var3.var_num = "0" + String(editor_menu.var3.var_num);
}
if (editor_menu.var1.var_num == undefined) {
_root.sample_level[_ypos][_xpos] = current_tile;
} else if (editor_menu.var2.var_num == undefined) {
_root.sample_level[_ypos][_xpos] = current_tile + String(editor_menu.var1.var_num).toUpperCase();
} else if (editor_menu.var3.var_num == undefined) {
_root.sample_level[_ypos][_xpos] = (current_tile + String(editor_menu.var1.var_num).toUpperCase()) + String(editor_menu.var2.var_num).toUpperCase();
} else {
_root.sample_level[_ypos][_xpos] = ((current_tile + String(editor_menu.var1.var_num).toUpperCase()) + String(editor_menu.var2.var_num).toUpperCase()) + String(editor_menu.var3.var_num).toUpperCase();
}
if ((current_tile == 0) && (depth < 2999)) {
_root.attachMovie("tile_grey", "tile" + depth, 3000 + depth);
_root["tile" + depth]._x = _xpos * 15;
_root["tile" + depth]._y = _ypos * 15;
_root["tile" + depth].depth = depth;
depth++;
}
}
}
function updateDisplay() {
_root.editor_redsquare2.removeMovieClip();
depth = 0;
i = 0;
while (i < 3000) {
_root["tile" + i].removeMovieClip();
i++;
}
i = 0;
while (i < 30) {
j = 0;
while (j < 40) {
_root.attachMovie("tile" + String(sample_level[i][j]).substr(0, 2), "tile" + depth, 3000 + depth);
_root["tile" + depth]._x = j * 15;
_root["tile" + depth]._y = i * 15;
_root["tile" + depth].depth = depth;
depth++;
j++;
}
i++;
}
}
function updateDisplay2(_xpos, _ypos) {
_root.attachMovie("tile" + String(sample_level[_ypos][_xpos]).substr(0, 2), "tile" + depth, 3000 + depth);
_root["tile" + depth]._x = _xpos * 15;
_root["tile" + depth]._y = _ypos * 15;
_root["tile" + depth].depth = depth;
depth++;
}
function updateTile(_tid) {
_root.editor_previewsquare.icon.removeMovieClip();
_root.editor_previewsquare.attachMovie("tile" + _tid, "icon", 1);
_root.editor_previewsquare.icon._alpha = 50;
current_tile = _tid;
i = 1;
while (i <= 11) {
_root.editor_menu["var" + i].removeMovieClip();
i++;
}
_root.editor_menu.save_btn.removeMovieClip();
_root["updateVars_" + _tid]();
_root.tile.removeMovieClip();
_root.attachMovie("tile" + _tid, "tile", 9999);
_root.tile.onRollOver = function () {
this.removeMovieClip();
};
_root.tile._x = 15;
_root.tile._y = 15;
_root.tile._xscale = 300;
_root.tile._yscale = 300;
}
function createVariable(_id, _default) {
editor_menu.attachMovie("editor_var_number", "var" + varnum, varnum);
editor_menu["var" + varnum]._x = 215 + (50 * varnum);
editor_menu["var" + varnum]._y = 440;
editor_menu["var" + varnum].var_text.text = _id;
editor_menu["var" + varnum].var_num = _default;
varnum++;
}
function createSlider(_id, _lowerlim, _upperlim, _default, _multi, _unit) {
editor_menu.attachMovie("editor_var_slider", "var" + varnum, varnum);
editor_menu["var" + varnum]._x = 215 + (50 * varnum);
editor_menu["var" + varnum]._y = 440;
editor_menu["var" + varnum].upperlim = _upperlim;
editor_menu["var" + varnum].lowerlim = _lowerlim;
editor_menu["var" + varnum].var_text.text = _id;
editor_menu["var" + varnum].var_num = _default;
editor_menu["var" + varnum].multi = _multi;
editor_menu["var" + varnum].num.text = Math.round((_default / _multi) * 10) / 10;
editor_menu["var" + varnum].unit.text = _unit;
varnum++;
}
function createToggle(_label, _ids, _values, _default) {
editor_menu.attachMovie("editor_var_toggle1", "var" + varnum, varnum);
editor_menu["var" + varnum]._x = 215 + (50 * varnum);
editor_menu["var" + varnum]._y = 440;
editor_menu["var" + varnum].var_text.text = _label;
editor_menu["var" + varnum].var_num = _default;
i = 0;
while (i < _ids.length) {
editor_menu["var" + varnum].attachMovie("editor_var_toggle2", "toggle" + i, i);
editor_menu["var" + varnum]["toggle" + i]._x = i * 15;
editor_menu["var" + varnum]["toggle" + i].label.text = _ids[i];
editor_menu["var" + varnum]["toggle" + i].val = _values[i];
if (_values[i] == _default) {
editor_menu["var" + varnum]["toggle" + i].box.gotoAndStop(2);
}
editor_menu["var" + varnum]["toggle" + i].onPress = function () {
this._parent.var_num = this.val;
k = 0;
while (k < 15) {
this._parent["toggle" + k].box.gotoAndStop(1);
k++;
}
this.box.gotoAndStop(2);
};
i++;
}
varnum++;
}
function createSaveButton(_xpos, _ypos) {
editor_menu.attachMovie("editor_var_save", "var10", varnum);
editor_menu.var10.xpos = _xpos;
editor_menu.var10.ypos = _ypos;
editor_menu.var10.onRelease = function () {
_root.current_tile = _root.sample_level[this.ypos][this.xpos].substr(0, 2);
_root.updateSample(this.xpos, this.ypos);
i = 1;
while (i <= 9) {
_root.editor_menu["var" + i].removeMovieClip();
i++;
}
_root.current_tile = "edit";
this.removeMovieClip();
};
editor_menu.var10._x = 215 + (50 * varnum);
editor_menu.var10._y = 440;
varnum++;
}
function closeEditor() {
Key.removeListener(_root.editor_controller);
_root.editor = false;
_root.tile.removeMovieClip();
_root.editor_previewsquare.removeMovieClip();
_root.editor_redsquare.removeMovieClip();
_root.editor_redsquare2.removeMovieClip();
_root.editor_mouse.removeMovieClip();
_root.editor_load.removeMovieClip();
i = 0;
while (i < 3000) {
_root["tile" + i].removeMovieClip();
i++;
}
_root.editor_controller.removeMovieClip();
_root.editor_menu.removeMovieClip();
}
function updateVars_57(_xpos, _ypos) {
varnum = 1;
if (_xpos == undefined) {
createVariable("Dest", "00a");
createToggle("ID", ["OP", "GE", "S1", "S2", "S3", "S4", "S5", "S6", "S7"], ["00", "GE", "S1", "S2", "S3", "S4", "S5", "S6", "S7"], "00");
} else {
createVariable("Dest", _root.sample_level[_ypos][_xpos].substr(2, 3));
createToggle("ID", ["OP", "GE", "S1", "S2", "S3", "S4", "S5", "S6", "S7"], ["00", "GE", "S1", "S2", "S3", "S4", "S5", "S6", "S7"], _root.sample_level[_ypos][_xpos].substr(5, 2));
varnum = varnum + 2;
createSaveButton(_xpos, _ypos);
}
}
function updateVars_49(_xpos, _ypos) {
varnum = 1;
if (_xpos == undefined) {
createToggle("State", ["01", "02", "03", "04", "05", "06", "07", "08", "09"], ["01", "02", "03", "04", "05", "06", "07", "08", "09"], "01");
} else {
createToggle("State", ["01", "02", "03", "04", "05", "06", "07", "08", "09"], ["01", "02", "03", "04", "05", "06", "07", "08", "09"], _root.sample_level[_ypos][_xpos].substr(2, 2));
varnum = varnum + 2;
createSaveButton(_xpos, _ypos);
}
}
function updateVars_47(_xpos, _ypos) {
varnum = 1;
if (_xpos == undefined) {
createToggle("State", ["01", "02", "03", "04", "05", "06", "07", "08", "09"], ["01", "02", "03", "04", "05", "06", "07", "08", "09"], "01");
} else {
createToggle("State", ["01", "02", "03", "04", "05", "06", "07", "08", "09"], ["01", "02", "03", "04", "05", "06", "07", "08", "09"], _root.sample_level[_ypos][_xpos].substr(2, 2));
varnum = varnum + 2;
createSaveButton(_xpos, _ypos);
}
}
function updateVars_48(_xpos, _ypos) {
varnum = 1;
if (_xpos == undefined) {
createToggle("State", ["01", "02", "03", "04", "05", "06", "07", "08", "09"], ["01", "02", "03", "04", "05", "06", "07", "08", "09"], "01");
} else {
createToggle("State", ["01", "02", "03", "04", "05", "06", "07", "08", "09"], ["01", "02", "03", "04", "05", "06", "07", "08", "09"], _root.sample_level[_ypos][_xpos].substr(2, 2));
varnum = varnum + 2;
create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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
sample_leveldata = "00000";
stop();
Frame 3
_root._quality = "LOW";
stop();
Frame 5
_root._quality = "LOW";
nextLevel(_root.hero_lastlevel);
stop();
Symbol 11 MovieClip Frame 1
gotoAndPlay(random(13));
Symbol 11 MovieClip Frame 13
gotoAndPlay (2);
Symbol 27 MovieClip [tile23] Frame 1
gotoAndStop(random(4) + 1);
Symbol 32 Button
on (release) {
_root.getURL("http://www.badhed.com?ref=the-cursed-beneath_INGAMELOGO", "_blank");
}
Symbol 45 MovieClip [hud_mc] Frame 1
function updateHealthBar() {
if (_root.hero_weapons[0] == 1) {
_root.hero.maxhealth = 100;
} else if (_root.hero_weapons[0] == 2) {
_root.hero.maxhealth = 150;
} else {
_root.hero.maxhealth = 200;
}
hpbar._xscale = _root.hero.health;
hpborder._xscale = _root.hero.maxhealth;
}
updateHealthBar();
Symbol 77 MovieClip Frame 7
if (_parent._parent.arms._y == -0.5) {
_parent._parent.arms._y = 0;
} else {
_parent._parent.arms._y = -0.5;
}
Symbol 77 MovieClip Frame 11
if (_parent._parent.arms._y == -0.5) {
_parent._parent.arms._y = 0;
} else {
_parent._parent.arms._y = -0.5;
}
Symbol 77 MovieClip Frame 14
gotoAndPlay (3);
if (_parent._parent.arms._y == -0.5) {
_parent._parent.arms._y = 0;
} else {
_parent._parent.arms._y = -0.5;
}
Symbol 87 MovieClip Frame 1
stop();
Symbol 102 MovieClip Frame 6
gotoAndPlay (3);
Symbol 116 MovieClip Frame 1
stop();
Symbol 120 MovieClip Frame 1
stop();
Symbol 124 MovieClip Frame 1
stop();
Symbol 128 MovieClip Frame 1
stop();
Symbol 132 MovieClip Frame 1
stop();
Symbol 137 MovieClip Frame 1
stop();
Symbol 141 MovieClip Frame 1
stop();
Symbol 145 MovieClip Frame 1
stop();
Symbol 149 MovieClip Frame 1
stop();
Symbol 153 MovieClip Frame 1
stop();
Symbol 157 MovieClip Frame 1
stop();
Symbol 158 MovieClip Frame 1
function updateGun() {
if (_parent._parent._parent.gun == 1) {
if (_parent.ptype == 0) {
gotoAndStop (1);
} else if (_parent.ptype == 45) {
gotoAndStop (2);
} else if (_parent.ptype == -45) {
gotoAndStop (3);
} else if (_parent.ptype == 90) {
gotoAndStop (4);
} else {
gotoAndStop (5);
}
} else {
gotoAndStop(_parent._parent._parent.gun + 4);
}
}
updateGun();
Symbol 164 MovieClip Frame 1
ptype = 90;
Symbol 164 MovieClip Frame 2
gun.mc.gotoAndPlay(2);
Symbol 164 MovieClip Frame 6
gotoAndStop (1);
Symbol 171 MovieClip Frame 1
ptype = 45;
Symbol 171 MovieClip Frame 2
gun.mc.gotoAndPlay(2);
Symbol 171 MovieClip Frame 6
gotoAndStop (1);
Symbol 178 MovieClip Frame 1
ptype = 0;
Symbol 178 MovieClip Frame 2
gun.mc.gotoAndPlay(2);
Symbol 178 MovieClip Frame 6
gotoAndStop (1);
Symbol 185 MovieClip Frame 1
ptype = -45;
Symbol 185 MovieClip Frame 2
gun.mc.gotoAndPlay(2);
Symbol 185 MovieClip Frame 6
gotoAndStop (1);
Symbol 192 MovieClip Frame 1
ptype = -90;
Symbol 192 MovieClip Frame 2
gun.mc.gotoAndPlay(2);
Symbol 192 MovieClip Frame 6
gotoAndStop (1);
Symbol 193 MovieClip Frame 1
stop();
Symbol 204 MovieClip Frame 6
if (_parent.jump) {
stop();
}
Symbol 204 MovieClip Frame 10
stop();
Symbol 205 MovieClip [hero_mc] Frame 1
stop();
Symbol 205 MovieClip [hero_mc] Frame 2
stop();
Symbol 214 MovieClip [tile3] Frame 1
gotoAndStop(random(4) + 1);
Symbol 226 MovieClip [tile42] Frame 1
gotoAndStop(random(3) + 1);
Symbol 238 MovieClip [tile39] Frame 1
gotoAndStop(random(4) + 1);
Symbol 241 MovieClip [background_g] Frame 1
function bloodspatter(_i, _j) {
_i = _i + (random(3) - 1);
_j = _j + (random(3) - 1);
this[(("tile" + _i) + "_") + _j].mc.nextFrame();
}
n = 0;
i = 0;
while (i < 40) {
j = 0;
while (j < 30) {
this.attachMovie("bg1", (("tile" + i) + "_") + j, n);
this[(("tile" + i) + "_") + j]._x = i * 16;
this[(("tile" + i) + "_") + j]._y = j * 16;
n++;
j++;
}
i++;
}
Symbol 257 MovieClip [tile52] Frame 1
stop();
gotoAndStop((this.depth % 11) + 1);
Instance of Symbol 257 MovieClip [tile52] in Symbol 260 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (6);
}
Instance of Symbol 257 MovieClip [tile52] in Symbol 262 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (1);
}
Instance of Symbol 257 MovieClip [tile52] in Symbol 264 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (11);
}
Symbol 286 MovieClip [editor_menu] Frame 1
function showTiles(_array) {
tabbg._visible = true;
showtiles = true;
tn = 1000;
i = 0;
while (i < _array.length) {
j = 0;
while (j < _array[0].length) {
this.attachMovie("tile" + _array[i][j], "tile" + tn, tn);
this["tile" + tn]._x = 4 + (j * 18);
this["tile" + tn]._y = 379 + (i * 18);
this["tile" + tn].tid = _array[i][j];
this["tile" + tn].onMouseDown = function () {
if (((((_root._xmouse < (this._x + this._width)) && (_root._xmouse > this._x)) && (_root._ymouse < (this._y + this._height))) && (_root._ymouse > this._y)) || ((((_root._xmouse < (this._x + 15)) && (_root._xmouse > this._x)) && (_root._ymouse < (this._y + 15))) && (_root._ymouse > this._y))) {
this._parent._parent.updateTile(this.tid);
}
};
tn++;
j++;
}
i++;
}
}
function removeTiles() {
tabbg._visible = false;
showtiles = false;
m = 1000;
while (m < 2000) {
this["tile" + m].removeMovieClip();
m++;
}
}
tile_main = [[45, 0, 47, 49, 0, 0, 3, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 53, 50, 0, 0, 0], [46, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 74, 0, 0, 54, 55, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 70, 0, 72, 0, 56, 0, 51, 0, 0, 0], [39, 40, 41, 42, 43, 44, 0, 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
tile_enemy = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [71, 73, 74, 0, 0, 0, "he"]];
tile_environment = [[77, 0, 0, 70, 72, 74, 71, 56, 0, 50, 0, 45, 0, 0, 0, 0, 83, 0, 0, 0], [0, 0, 0, 0, 0, 73, 76, 0, 0, 0, 0, 46, 81, 0, 0, 0, 0, 0, 82, 0], [0, 0, 0, 62, 64, 75, 0, 52, 53, 51, 0, 0, 0, 47, 48, 49, 84, 0, 0, 0], [0, 63, 0, 0, 0, 0, 0, 54, 55, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0]];
Instance of Symbol 260 MovieClip in Symbol 286 MovieClip [editor_menu] Frame 1
on (press) {
_parent.removeTiles();
_parent.showTiles(_parent.tile_main);
}
Instance of Symbol 262 MovieClip in Symbol 286 MovieClip [editor_menu] Frame 1
on (press) {
_parent.removeTiles();
_parent.showTiles(_parent.tile_enemy);
}
Instance of Symbol 264 MovieClip in Symbol 286 MovieClip [editor_menu] Frame 1
on (press) {
_parent.removeTiles();
_parent.showTiles(_parent.tile_environment);
}
Instance of Symbol 266 MovieClip "tabbg" in Symbol 286 MovieClip [editor_menu] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 269 MovieClip in Symbol 286 MovieClip [editor_menu] Frame 1
on (press) {
this._parent._parent.updateTile(0);
}
Instance of Symbol 272 MovieClip in Symbol 286 MovieClip [editor_menu] Frame 1
on (press) {
_root.editor_load.removeMovieClip();
_root.attachMovie("editor_download", "editor_load", 10000);
_root.editor_load.level.text = (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((_parent._parent.sample_leveldata + ":") + _parent._parent.sample_level[0]) + ":") + _parent._parent.sample_level[1]) + ":") + _parent._parent.sample_level[2]) + ":") + _parent._parent.sample_level[3]) + ":") + _parent._parent.sample_level[4]) + ":") + _parent._parent.sample_level[5]) + ":") + _parent._parent.sample_level[6]) + ":") + _parent._parent.sample_level[7]) + ":") + _parent._parent.sample_level[8]) + ":") + _parent._parent.sample_level[9]) + ":") + _parent._parent.sample_level[10]) + ":") + _parent._parent.sample_level[11]) + ":") + _parent._parent.sample_level[12]) + ":") + _parent._parent.sample_level[13]) + ":") + _parent._parent.sample_level[14]) + ":") + _parent._parent.sample_level[15]) + ":") + _parent._parent.sample_level[16]) + ":") + _parent._parent.sample_level[17]) + ":") + _parent._parent.sample_level[18]) + ":") + _parent._parent.sample_level[19]) + ":") + _parent._parent.sample_level[20]) + ":") + _parent._parent.sample_level[21]) + ":") + _parent._parent.sample_level[22]) + ":") + _parent._parent.sample_level[23]) + ":") + _parent._parent.sample_level[24]) + ":") + _parent._parent.sample_level[25]) + ":") + _parent._parent.sample_level[26]) + ":") + _parent._parent.sample_level[27]) + ":") + _parent._parent.sample_level[28]) + ":") + _parent._parent.sample_level[29];
}
Instance of Symbol 275 MovieClip in Symbol 286 MovieClip [editor_menu] Frame 1
on (press) {
this._parent._parent.updateTile("edit");
}
Instance of Symbol 278 MovieClip in Symbol 286 MovieClip [editor_menu] Frame 1
on (press) {
_root.editor_load.removeMovieClip();
_root.attachMovie("editor_upload", "editor_load", 10000);
}
Instance of Symbol 281 MovieClip in Symbol 286 MovieClip [editor_menu] Frame 1
on (press) {
_root.currentlevel = "input";
_root.createLevel((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((_parent._parent.sample_leveldata + ":") + _parent._parent.sample_level[0]) + ":") + _parent._parent.sample_level[1]) + ":") + _parent._parent.sample_level[2]) + ":") + _parent._parent.sample_level[3]) + ":") + _parent._parent.sample_level[4]) + ":") + _parent._parent.sample_level[5]) + ":") + _parent._parent.sample_level[6]) + ":") + _parent._parent.sample_level[7]) + ":") + _parent._parent.sample_level[8]) + ":") + _parent._parent.sample_level[9]) + ":") + _parent._parent.sample_level[10]) + ":") + _parent._parent.sample_level[11]) + ":") + _parent._parent.sample_level[12]) + ":") + _parent._parent.sample_level[13]) + ":") + _parent._parent.sample_level[14]) + ":") + _parent._parent.sample_level[15]) + ":") + _parent._parent.sample_level[16]) + ":") + _parent._parent.sample_level[17]) + ":") + _parent._parent.sample_level[18]) + ":") + _parent._parent.sample_level[19]) + ":") + _parent._parent.sample_level[20]) + ":") + _parent._parent.sample_level[21]) + ":") + _parent._parent.sample_level[22]) + ":") + _parent._parent.sample_level[23]) + ":") + _parent._parent.sample_level[24]) + ":") + _parent._parent.sample_level[25]) + ":") + _parent._parent.sample_level[26]) + ":") + _parent._parent.sample_level[27]) + ":") + _parent._parent.sample_level[28]) + ":") + _parent._parent.sample_level[29]) + ":") + _parent._parent.sample_level[30]);
}
Instance of Symbol 284 MovieClip in Symbol 286 MovieClip [editor_menu] Frame 1
on (press) {
_root.editor_load.removeMovieClip();
_root.attachMovie("editor_popup", "editor_load", 10000);
}
Symbol 301 MovieClip [tile49] Frame 1
function openEntry() {
p = 0;
while (p < 5) {
this["board" + p].fallspd = (random(20) / 10) - 1;
this["board" + p].xspd = (random(16) / 10) - 0.8;
this["board" + p].rotspd = (random(60) / 10) - 3;
p++;
}
fallingint = setInterval(mx.utils.Delegate.create(this, falldown), 40);
}
function falldown() {
count++;
p = 0;
while (p < 5) {
if (count > (p * 4)) {
this["board" + p]._y = this["board" + p]._y + this["board" + p].fallspd;
this["board" + p].fallspd = this["board" + p].fallspd + 0.3;
this["board" + p]._x = this["board" + p]._x + this["board" + p].xspd;
this["board" + p]._rotation = this["board" + p]._rotation + this["board" + p].rotspd;
this["board" + p]._alpha = this["board" + p]._alpha - 3;
}
if (count > (30 + (p * 6))) {
this["board" + p].removeMovieClip();
}
p++;
}
if (count > 70) {
clearInterval(fallingint);
}
_root.updateAfterEvent();
}
count = 0;
gotoAndStop(random(3) + 1);
Symbol 310 MovieClip [tile54] Frame 1
stop();
gotoAndStop((this.depth % 2) + 1);
Symbol 318 MovieClip [tile56] Frame 1
stop();
gotoAndStop((this.depth % 5) + 1);
Instance of Symbol 333 MovieClip in Symbol 334 MovieClip [editor_upload] Frame 1
on (press) {
_parent.removeMovieClip();
}
Instance of Symbol 325 MovieClip in Symbol 334 MovieClip [editor_upload] Frame 1
on (press) {
delete _root.sample_level;
delete _root.sample_leveldata;
_root.sample_level = String(_parent.level).split(":");
_root.sample_leveldata = _root.sample_level.splice(0, 1);
k = 0;
while (k < _root.sample_level.length) {
_root.sample_level[k] = _root.sample_level[k].split(",");
k++;
}
_root.updateDisplay();
_parent.removeMovieClip();
}
Instance of Symbol 333 MovieClip in Symbol 337 MovieClip [editor_download] Frame 1
on (press) {
_parent.removeMovieClip();
}
Symbol 346 MovieClip [tile62] Frame 10
if (random(3) == 0) {
gotoAndPlay (1);
}
Symbol 353 MovieClip [tile64] Frame 1
gotoAndStop(random(2) + 1);
Symbol 358 MovieClip [tile70] Frame 1
gotoAndStop(random(3) + 1);
Symbol 370 MovieClip Frame 1
stop();
Symbol 378 MovieClip Frame 1
stop();
Symbol 386 MovieClip Frame 1
stop();
Symbol 387 MovieClip [bg1] Frame 1
gotoAndStop(random(3) + 1);
Symbol 390 MovieClip [editor_mouse] Frame 1
stop();
Symbol 394 MovieClip Frame 1
stop();
Symbol 403 MovieClip [editor_popup] Frame 1
function createSlider(_id, _lowerlim, _upperlim, _default, _multi, _unit) {
this.attachMovie("editor_var_slider", "var" + varnum, varnum);
this["var" + varnum]._x = 75;
this["var" + varnum]._y = 125 + (50 * varnum);
this["var" + varnum].upperlim = _upperlim;
this["var" + varnum].lowerlim = _lowerlim;
this["var" + varnum].var_text.text = _id;
this["var" + varnum].var_num = _default;
this["var" + varnum].multi = _multi;
this["var" + varnum].num.text = Math.round((_default / _multi) * 10) / 10;
this["var" + varnum].unit.text = _unit;
varnum++;
}
function createToggle(_label, _ids, _values, _default) {
this.attachMovie("editor_var_toggle1", "var" + varnum, varnum);
this["var" + varnum]._x = 75;
this["var" + varnum]._y = 125 + (50 * varnum);
this["var" + varnum].var_text.text = _label;
this["var" + varnum].var_num = _default;
i = 0;
while (i < _ids.length) {
this["var" + varnum].attachMovie("editor_var_toggle2", "toggle" + i, i);
this["var" + varnum]["toggle" + i]._x = i * 15;
this["var" + varnum]["toggle" + i].label.text = _ids[i];
this["var" + varnum]["toggle" + i].val = _values[i];
if (_values[i] == _default) {
this["var" + varnum]["toggle" + i].box.gotoAndStop(2);
}
this["var" + varnum]["toggle" + i].onPress = function () {
this._parent.var_num = this.val;
k = 0;
while (k < 5) {
this._parent["toggle" + k].box.gotoAndStop(1);
k++;
}
this.box.gotoAndStop(2);
};
i++;
}
varnum++;
}
varnum = 0;
createSlider("Ghosts", 0, 9, int(String(_root.sample_leveldata).substr(0, 1)), 1, " ");
createToggle("Spider BG", ["Y", "N"], ["1", "0"], String(_root.sample_leveldata).substr(1, 1));
createToggle("Cracks BG", ["Y", "N"], ["1", "0"], String(_root.sample_leveldata).substr(2, 1));
Instance of Symbol 325 MovieClip in Symbol 403 MovieClip [editor_popup] Frame 1
on (press) {
_root.sample_leveldata = String(_parent.var0.var_num).concat(String(_parent.var1.var_num), String(_parent.var2.var_num));
k = 0;
while (k < 10) {
_parent["var" + k].removeMovieClip();
k++;
}
_parent.removeMovieClip();
}
Instance of Symbol 333 MovieClip in Symbol 403 MovieClip [editor_popup] Frame 1
on (press) {
k = 0;
while (k < 10) {
_parent["var" + k].removeMovieClip();
k++;
}
_parent.removeMovieClip();
}
Instance of Symbol 406 MovieClip in Symbol 410 MovieClip [editor_var_slider] Frame 1
onClipEvent (load) {
this._x = Math.round(((_parent.var_num - _parent.lowerlim) / (_parent.upperlim - _parent.lowerlim)) * 40);
}
onClipEvent (mouseDown) {
if ((Math.abs(this._xmouse) < 4) && (Math.abs(this._ymouse) < 8)) {
this.grab = true;
}
}
onClipEvent (enterFrame) {
if (this.grab) {
this._x = _root._xmouse - _parent._x;
this._x = Math.round(this._x);
if (this._x < 0) {
this._x = 0;
} else if (this._x > 40) {
this._x = 40;
}
_parent.var_num = Math.round(_parent.lowerlim + ((this._x / 40) * (_parent.upperlim - _parent.lowerlim)));
_parent.num.text = Math.round((_parent.var_num / _parent.multi) * 10) / 10;
}
}
onClipEvent (mouseUp) {
this.grab = false;
}
Symbol 454 MovieClip Frame 1
if (_parent.boss) {
_root.stalkerboss_s.start(0, 1);
} else if (_root.hero.alive) {
if (random(2) == 0) {
_root.playStalker_s();
}
} else if (random(5) == 0) {
_root.playStalker_s();
}
Symbol 454 MovieClip Frame 3
if (_parent.dis < 30) {
if (_parent._x > _root.hero._x) {
_root.updateHealthBar(4 * _root.difficulty, -1);
} else {
_root.updateHealthBar(4 * _root.difficulty, 1);
}
}
Symbol 454 MovieClip Frame 10
_parent.attacking = false;
Symbol 476 MovieClip Frame 12
_parent.entry = false;
Symbol 487 MovieClip Frame 7
if (_parent.jump) {
stop();
}
Symbol 487 MovieClip Frame 21
_root.rumble_s.start(0, 1);
Symbol 487 MovieClip Frame 23
_root.spawnDust2(_parent._x, _parent._y);
Symbol 487 MovieClip Frame 24
_root.spawnDust2(_parent._x, _parent._y);
Symbol 487 MovieClip Frame 25
_root.spawnDust2(_parent._x, _parent._y);
Symbol 487 MovieClip Frame 26
_root.spawnDust2(_parent._x, _parent._y);
Symbol 487 MovieClip Frame 27
_root.spawnDust2(_parent._x, _parent._y);
Symbol 487 MovieClip Frame 28
_root.spawnDust2(_parent._x, _parent._y);
Symbol 487 MovieClip Frame 29
_root.spawnDust2(_parent._x, _parent._y);
Symbol 487 MovieClip Frame 30
_root.spawnDust2(_parent._x, _parent._y);
Symbol 487 MovieClip Frame 32
_root.removeEnemy(_parent.en);
stop();
Symbol 488 MovieClip [stalker_mc] Frame 1
stop();
Symbol 495 MovieClip [tile65] Frame 1
gotoAndStop(random(4) + 1);
Symbol 519 MovieClip Frame 14
gotoAndPlay (3);
Symbol 539 MovieClip Frame 1
if (_root.hero.alive) {
if (random(2) == 0) {
_root.playBrute_s();
}
} else if (random(5) == 0) {
_root.playBrute_s();
}
Symbol 539 MovieClip Frame 3
if (_parent.dis < 30) {
if (_parent._x > _root.hero._x) {
_root.updateHealthBar(4 * _root.difficulty, -1);
} else {
_root.updateHealthBar(4 * _root.difficulty, 1);
}
}
Symbol 539 MovieClip Frame 8
_parent.attacking = false;
Symbol 550 MovieClip Frame 10
_parent.entry = false;
Symbol 561 MovieClip Frame 7
if (_parent.jump) {
stop();
}
Symbol 561 MovieClip Frame 23
_root.rumble_s.start(0, 1);
Symbol 561 MovieClip Frame 25
_root.spawnDust2(_parent._x, _parent._y);
Symbol 561 MovieClip Frame 26
_root.spawnDust2(_parent._x, _parent._y);
Symbol 561 MovieClip Frame 27
_root.spawnDust2(_parent._x, _parent._y);
Symbol 561 MovieClip Frame 28
_root.spawnDust2(_parent._x, _parent._y);
Symbol 561 MovieClip Frame 29
_root.spawnDust2(_parent._x, _parent._y);
Symbol 561 MovieClip Frame 30
_root.spawnDust2(_parent._x, _parent._y);
Symbol 561 MovieClip Frame 31
_root.spawnDust2(_parent._x, _parent._y);
Symbol 561 MovieClip Frame 33
_root.removeEnemy(_parent.en);
stop();
Symbol 562 MovieClip [brute_mc] Frame 1
stop();
Symbol 606 MovieClip Frame 1
if (random(3) == 0) {
_root.playBehemoth_s();
} else {
_root.belch_s.start(0, 1);
}
Symbol 606 MovieClip Frame 5
if (_parent.attacktype > 2) {
_parent.attacking = false;
}
Symbol 606 MovieClip Frame 10
_parent.attacking = false;
Symbol 627 MovieClip Frame 1
if (random(2) == 0) {
_root.playBehemoth_s();
}
_root.smash_s.start(0, 1);
_root.rocksmash_s.start(0, 1);
Symbol 627 MovieClip Frame 12
_root.shootSlime(_parent._x, _parent._y - 20, (_root.hero._x + random(40)) - 20, ((((_root.hero._y - 15) + random(30)) - 15) + random(40)) - 20, "rock", 20);
Symbol 627 MovieClip Frame 15
_parent.attacking = false;
Symbol 640 MovieClip Frame 12
_parent.entry = false;
Symbol 651 MovieClip Frame 7
if (_parent.jump) {
stop();
}
Symbol 651 MovieClip Frame 21
_root.rumble_s.start(0, 1);
Symbol 651 MovieClip Frame 23
_root.spawnDust2(_parent._x, _parent._y);
Symbol 651 MovieClip Frame 24
_root.spawnDust2(_parent._x, _parent._y);
Symbol 651 MovieClip Frame 25
_root.spawnDust2(_parent._x, _parent._y);
Symbol 651 MovieClip Frame 26
_root.spawnDust2(_parent._x, _parent._y);
Symbol 651 MovieClip Frame 27
_root.spawnDust2(_parent._x, _parent._y);
Symbol 651 MovieClip Frame 28
_root.spawnDust2(_parent._x, _parent._y);
Symbol 651 MovieClip Frame 29
_root.spawnDust2(_parent._x, _parent._y);
Symbol 651 MovieClip Frame 30
_root.spawnDust2(_parent._x, _parent._y);
Symbol 651 MovieClip Frame 33
_root.removeEnemy(_parent.en);
stop();
Symbol 652 MovieClip [behemoth_mc] Frame 1
stop();
Symbol 663 MovieClip [tile57] Frame 1
stop();
Symbol 663 MovieClip [tile57] Frame 8
stop();
Symbol 667 MovieClip [bricks_mc] Frame 1
gotoAndStop(random(3) + 1);
Symbol 674 MovieClip [tile67] Frame 1
gotoAndStop(random(8) + 1);
this._x = this._x + (random(10) - 5);
_root.changeColor(this);
Symbol 693 MovieClip Frame 96
stop();
Symbol 700 Button
on (release) {
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
_root.hud_mc.hud_store.removeMovieClip();
_root._quality = "LOW";
}
Symbol 703 Button
on (release) {
if (_root.alreadysubmittedscore) {
hiscore._visible = false;
}
play();
}
Symbol 709 Button
on (release) {
if ((!_root.alreadysubmittedscore) && (_visible)) {
_root.alreadysubmittedscore = true;
hiScores.setDetails(424, int(_root.currentlevel.substr(1, 1)) - 2, "the-cursed-beneath", "YSc25KDhYVraB8Z", false, _root.tempscore, _root.tempscore, "Points", false);
_parent.gotoAndStop(1);
gotoAndStop (2);
_root._quality = "MEDIUM";
}
}
Symbol 754 MovieClip [ZattikkaHiScores] Frame 1
#initclip 18
Object.registerClass("ZattikkaHiScores", ZattikkaHiScores);
#endinitclip
Symbol 763 MovieClip Frame 1
stop();
function updateScore() {
_root.tempscore = Math.round(((_root.hero_kills * 10) + (Math.round(_root.hero_shotshit / _root.hero_shotsfired) * 300)) + (_root.hero.health * 4));
score.text = "SCORE: " + _root.tempscore;
}
updateScore();
_root.alreadysubmittedscore = false;
Instance of Symbol 754 MovieClip [ZattikkaHiScores] "hiScores" in Symbol 763 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Symbol 763 MovieClip Frame 2
stop();
Symbol 796 MovieClip [hud_store] Frame 1
stop();
Instance of Symbol 763 MovieClip "hiscore" in Symbol 796 MovieClip [hud_store] Frame 1
onClipEvent (load) {
}
Symbol 796 MovieClip [hud_store] Frame 2
function updateLevels() {
gunlevellabel = "";
if (_root.hero_weapons[1] == 3) {
gunlevellabel = gunlevellabel.concat("MAX\n");
} else if (_root.hero_weapons[1] != 0) {
gunlevellabel = gunlevellabel.concat(("LVL " + _root.hero_weapons[1]) + newline);
} else {
gunlevellabel = gunlevellabel.concat("BUY\n");
}
if (_root.hero_weapons[2] == 3) {
gunlevellabel = gunlevellabel.concat("MAX\n");
} else if (_root.hero_weapons[2] != 0) {
gunlevellabel = gunlevellabel.concat(("LVL " + _root.hero_weapons[2]) + newline);
} else {
gunlevellabel = gunlevellabel.concat("BUY\n");
}
if (_root.hero_weapons[3] == 3) {
gunlevellabel = gunlevellabel.concat("MAX\n");
} else if (_root.hero_weapons[3] != 0) {
gunlevellabel = gunlevellabel.concat(("LVL " + _root.hero_weapons[3]) + newline);
} else {
gunlevellabel = gunlevellabel.concat("BUY\n");
}
if (_root.hero_weapons[4] == 3) {
gunlevellabel = gunlevellabel.concat("MAX\n");
} else if (_root.hero_weapons[4] != 0) {
gunlevellabel = gunlevellabel.concat(("LVL " + _root.hero_weapons[4]) + newline);
} else {
gunlevellabel = gunlevellabel.concat("BUY\n");
}
if (_root.hero_weapons[5] == 3) {
gunlevellabel = gunlevellabel.concat("MAX\n");
} else if (_root.hero_weapons[5] != 0) {
gunlevellabel = gunlevellabel.concat(("LVL " + _root.hero_weapons[5]) + newline);
} else {
gunlevellabel = gunlevellabel.concat("BUY\n");
}
if (_root.hero_weapons[6] == 3) {
gunlevellabel = gunlevellabel.concat("MAX\n");
} else if (_root.hero_weapons[6] != 0) {
gunlevellabel = gunlevellabel.concat(("LVL " + _root.hero_weapons[6]) + newline);
} else {
gunlevellabel = gunlevellabel.concat("BUY\n");
}
if (_root.hero_weapons[7] == 3) {
gunlevellabel = gunlevellabel.concat("MAX\n");
} else if (_root.hero_weapons[7] != 0) {
gunlevellabel = gunlevellabel.concat(("LVL " + _root.hero_weapons[7]) + newline);
} else {
gunlevellabel = gunlevellabel.concat("BUY\n");
}
gunlevellabel = gunlevellabel.concat(newline);
if (_root.hero_weapons[0] == 3) {
gunlevellabel = gunlevellabel.concat("MAX\n");
} else if (_root.hero_weapons[0] != 0) {
gunlevellabel = gunlevellabel.concat(("LVL " + _root.hero_weapons[0]) + newline);
} else {
gunlevellabel = gunlevellabel.concat("BUY\n");
}
gunleveltext.text = gunlevellabel;
pointslabeltext.text = "5\n2";
}
function updatePoints(_ptns) {
pointslevellabel = "";
pointslevellabel = pointslevellabel.concat(_root.hero_points + newline);
pointslevellabel = pointslevellabel.concat(_ptns);
pointslabeltext.text = pointslevellabel;
}
updateLevels();
updatePoints(" ");
updateCost = [[1, 150, 500], [1, 100, 400], [200, 300, 400], [300, 500, 700], [300, 500, 700], [500, 600, 750], [700, 1000, 1300], [700, 1000, 1300]];
btn1.onRollOver = function () {
if (_root.hero_weapons[1] < 3) {
updateLevels();
updatePoints(updateCost[1][_root.hero_weapons[1]]);
}
};
btn1.onRollOut = function () {
if (_root.hero_weapons[1] < 3) {
updateLevels();
updatePoints(" ");
}
};
btn1.onRelease = function () {
if (_root.hero_weapons[1] < 3) {
if (_root.hero_points >= updateCost[1][_root.hero_weapons[1]]) {
_root.hero_points = _root.hero_points - updateCost[1][_root.hero_weapons[1]];
_root.hero_weapons[1] = _root.hero_weapons[1] + 1;
updateLevels();
if (_root.hero_weapons[1] < 3) {
updatePoints(updateCost[1][_root.hero_weapons[1]]);
} else {
updatePoints(" ");
}
} else {
updatePoints("not enough");
}
}
};
btn2.onRollOver = function () {
if (_root.hero_weapons[2] < 3) {
updateLevels();
updatePoints(updateCost[2][_root.hero_weapons[2]]);
}
};
btn2.onRollOut = function () {
if (_root.hero_weapons[2] < 3) {
updateLevels();
updatePoints(" ");
}
};
btn2.onRelease = function () {
if (_root.hero_weapons[2] < 3) {
if (_root.hero_points >= updateCost[2][_root.hero_weapons[2]]) {
_root.hero_points = _root.hero_points - updateCost[2][_root.hero_weapons[2]];
_root.hero_weapons[2] = _root.hero_weapons[2] + 1;
updateLevels();
if (_root.hero_weapons[2] < 3) {
updatePoints(updateCost[2][_root.hero_weapons[2]]);
} else {
updatePoints(" ");
}
} else {
updatePoints("not enough");
}
}
};
btn3.onRollOver = function () {
if (_root.hero_weapons[3] < 3) {
updateLevels();
updatePoints(updateCost[3][_root.hero_weapons[3]]);
}
};
btn3.onRollOut = function () {
if (_root.hero_weapons[3] < 3) {
updateLevels();
updatePoints(" ");
}
};
btn3.onRelease = function () {
if (_root.hero_weapons[3] < 3) {
if (_root.hero_points >= updateCost[3][_root.hero_weapons[3]]) {
_root.hero_points = _root.hero_points - updateCost[3][_root.hero_weapons[3]];
_root.hero_weapons[3] = _root.hero_weapons[3] + 1;
updateLevels();
if (_root.hero_weapons[3] < 3) {
updatePoints(updateCost[3][_root.hero_weapons[3]]);
} else {
updatePoints(" ");
}
} else {
updatePoints("not enough");
}
}
};
btn4.onRollOver = function () {
if (_root.hero_weapons[4] < 3) {
updateLevels();
updatePoints(updateCost[4][_root.hero_weapons[4]]);
}
};
btn4.onRollOut = function () {
if (_root.hero_weapons[4] < 3) {
updateLevels();
updatePoints(" ");
}
};
btn4.onRelease = function () {
if (_root.hero_weapons[4] < 3) {
if (_root.hero_points >= updateCost[4][_root.hero_weapons[4]]) {
_root.hero_points = _root.hero_points - updateCost[4][_root.hero_weapons[4]];
_root.hero_weapons[4] = _root.hero_weapons[4] + 1;
updateLevels();
if (_root.hero_weapons[4] < 3) {
updatePoints(updateCost[4][_root.hero_weapons[4]]);
} else {
updatePoints(" ");
}
} else {
updatePoints("not enough");
}
}
};
btn5.onRollOver = function () {
if (_root.hero_weapons[5] < 3) {
updateLevels();
updatePoints(updateCost[5][_root.hero_weapons[5]]);
}
};
btn5.onRollOut = function () {
if (_root.hero_weapons[5] < 3) {
updateLevels();
updatePoints(" ");
}
};
btn5.onRelease = function () {
if (_root.hero_weapons[5] < 3) {
if (_root.hero_points >= updateCost[5][_root.hero_weapons[5]]) {
_root.hero_points = _root.hero_points - updateCost[5][_root.hero_weapons[5]];
_root.hero_weapons[5] = _root.hero_weapons[5] + 1;
updateLevels();
if (_root.hero_weapons[5] < 3) {
updatePoints(updateCost[5][_root.hero_weapons[5]]);
} else {
updatePoints(" ");
}
} else {
updatePoints("not enough");
}
}
};
btn6.onRollOver = function () {
if (_root.hero_weapons[6] < 3) {
updateLevels();
updatePoints(updateCost[6][_root.hero_weapons[6]]);
}
};
btn6.onRollOut = function () {
if (_root.hero_weapons[6] < 3) {
updateLevels();
updatePoints(" ");
}
};
btn6.onRelease = function () {
if (_root.hero_weapons[6] < 3) {
if (_root.hero_points >= updateCost[6][_root.hero_weapons[6]]) {
_root.hero_points = _root.hero_points - updateCost[6][_root.hero_weapons[6]];
_root.hero_weapons[6] = _root.hero_weapons[6] + 1;
updateLevels();
if (_root.hero_weapons[6] < 3) {
updatePoints(updateCost[6][_root.hero_weapons[6]]);
} else {
updatePoints(" ");
}
} else {
updatePoints("not enough");
}
}
};
btn7.onRollOver = function () {
if (_root.hero_weapons[7] < 3) {
updateLevels();
updatePoints(updateCost[7][_root.hero_weapons[7]]);
}
};
btn7.onRollOut = function () {
if (_root.hero_weapons[7] < 3) {
updateLevels();
updatePoints(" ");
}
};
btn7.onRelease = function () {
if (_root.hero_weapons[7] < 3) {
if (_root.hero_points >= updateCost[7][_root.hero_weapons[7]]) {
_root.hero_points = _root.hero_points - updateCost[7][_root.hero_weapons[7]];
_root.hero_weapons[7] = _root.hero_weapons[7] + 1;
updateLevels();
if (_root.hero_weapons[7] < 3) {
updatePoints(updateCost[7][_root.hero_weapons[7]]);
} else {
updatePoints(" ");
}
} else {
updatePoints("not enough");
}
}
};
btn0.onRollOver = function () {
if (_root.hero_weapons[0] < 3) {
updateLevels();
updatePoints(updateCost[0][_root.hero_weapons[0]]);
}
};
btn0.onRollOut = function () {
if (_root.hero_weapons[0] < 3) {
updateLevels();
updatePoints(" ");
}
};
btn0.onRelease = function () {
if (_root.hero_weapons[0] < 3) {
if (_root.hero_points >= updateCost[0][_root.hero_weapons[0]]) {
_root.hero_points = _root.hero_points - updateCost[0][_root.hero_weapons[0]];
_root.hero_weapons[0] = _root.hero_weapons[0] + 1;
updateLevels();
if (_root.hero_weapons[0] < 3) {
updatePoints(updateCost[0][_root.hero_weapons[0]]);
} else {
updatePoints(" ");
}
} else {
updatePoints("not enough");
}
}
_root.hud_mc.updateHealthBar();
};
if (type == 1) {
btn8._visible = false;
}
btn8.onRollOver = function () {
updatePoints("35");
};
btn8.onRollOut = function () {
updatePoints(" ");
};
btn8.onRelease = function () {
if (_root.hero.health != _root.hero.maxhealth) {
if (_root.hero_points >= 35) {
_root.updateHealthBar(-1000);
_root.hero_points = _root.hero_points - 35;
updatePoints("35");
} else {
updatePoints("not enough");
}
} else {
updatePoints("max health");
}
};
Symbol 796 MovieClip [hud_store] Frame 96
stop();
Symbol 800 Button
on (release) {
_root.beep_s.start(0, 2);
_root.nextLevel(_root.currentid, "restart");
}
Symbol 803 Button
on (release) {
_root.beep_s.start(0, 2);
_root.gotoAndStop(4);
_root.destroyLevel();
}
Symbol 806 MovieClip [hud_deathscreen] Frame 1
if (_root.currentlevel != "01") {
_root.changeTrack();
}
Symbol 806 MovieClip [hud_deathscreen] Frame 96
stop();
_root.playHeroDeath_s();
Symbol 817 MovieClip [hud_gameover] Frame 473
stop();
Symbol 822 Button
on (release) {
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
_root.hud_mc.hud_pause.removeMovieClip();
}
Symbol 842 Button
on (release) {
play();
}
Symbol 845 MovieClip [hud_pause] Frame 1
function spacebar_btn() {
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
_root.hud_mc.hud_pause.removeMovieClip();
}
stop();
Symbol 845 MovieClip [hud_pause] Frame 6
function spacebar_btn() {
play();
}
if (_root.veteranplayer) {
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
_root.hud_mc.hud_pause.removeMovieClip();
} else {
_root.veteranplayer = true;
}
Symbol 845 MovieClip [hud_pause] Frame 93
_root.seq_pt++;
_root.nextSequence(_root.seq_pt);
_root.hud_mc.hud_pause.removeMovieClip();
Symbol 848 MovieClip [blacktrans] Frame 28
_root.changeTrack();
Symbol 848 MovieClip [blacktrans] Frame 76
_root.gong_s.start(0, 1);
Symbol 848 MovieClip [blacktrans] Frame 81
_root.startLevel(type);
Symbol 848 MovieClip [blacktrans] Frame 124
this.removeMovieClip();
Instance of Symbol 881 MovieClip in Symbol 883 MovieClip Frame 1
onClipEvent (mouseDown) {
if ((((_root._xmouse > this._x) && (_root._xmouse < (this._x + this._width))) && (_root._ymouse > this._y)) && (_root._ymouse < (this._y + this._height))) {
_root.getURL("http://www.badhed.com?ref=the-cursed-beneath_PRELOADER", "_blank");
}
}
Symbol 1023 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 1024 MovieClip [__Packages.mochi.as2.MochiAd] Frame 0
class mochi.as2.MochiAd
{
function MochiAd () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
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 _local23 = 11000;
var _local19 = options.ad_timeout;
if (options.skip) {
_local19 = 0;
}
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 _local22 = options.color;
delete options.color;
var _local20 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local20);
_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(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local24, 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 = _local23;
chk.ad_timeout = _local19;
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;
mochi.as2.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
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) {
mochi.as2.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) {
mochi.as2.MochiAd.containerNotify(clip, {id:"hostLoadPcnt", pcnt:_local2}, clip._mochiad._containerLCName);
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 _local10 = {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, _local10);
var clip = options.clip;
var _local9 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var _local3 = clip._mochiad;
_local3.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local11 = _local5[0];
var _local8 = _local5[1];
_local3._x = _local11 * 0.5;
_local3._y = _local8 * 0.5;
var chk = _local3.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local9;
chk.started = getTimer();
chk.showing = false;
_local3.lc.adLoaded = options.ad_loaded;
_local3.lc.adSkipped = options.ad_skipped;
_local3.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
_local3.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local21 = false;
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;
mochi.as2.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) {
mochi.as2.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 _local12 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local12);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local6 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local6._mochiad_loaded) {
return(null);
}
var _local11 = options.depth;
delete options.depth;
var mc = _local6.createEmptyMovieClip("_mochiad", _local11);
var _local10 = _getRes(options);
options.res = (_local10[0] + "x") + _local10[1];
options.server = options.server + options.id;
delete options.id;
_local6._mochiad_loaded = true;
if (_local6._url.indexOf("http") != 0) {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
}
var _local4 = mc.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local9 = _local4.server;
delete _local4.server;
var _local13 = _allowDomains(_local9);
mc.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
mochi.as2.MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new Object();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = mc;
_local5.name = _local8;
_local5.hostname = _local13;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
mc.lc = _local5;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
_local4.lc = _local8;
_local4.st = getTimer();
if (!options.skip) {
_local4.loadMovie(_local9 + ".swf", "POST");
}
return(mc);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
containerNotify(clip, {id:"unload"}, clip._mochiad._containerLCName);
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);
containerRpcResult(clip, callbackID, _local4, clip._mochiad._containerLCName);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
containerRpcResult(clip, callbackID, _local3, clip._mochiad._containerLCName);
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);
}
static function containerNotify(clip, args, lcName) {
var _local1 = clip._mochiad._mochiad_ctr.ad.app;
if (_local1.notify) {
_local1.notify(args);
} else {
new LocalConnection().send(lcName, "notify", args);
}
}
static function containerRpcResult(clip, callbackID, val, lcName) {
var _local1 = clip._mochiad._mochiad_ctr.ad.app;
if (_local1.rpcResult) {
_local1.rpcResult(callbackID, val);
} else {
new LocalConnection().send(lcName, "rpcResult", callbackID, val);
}
}
}
Symbol 1025 MovieClip [__Packages.mochi.as2.MochiSync] Frame 0
class mochi.as2.MochiSync
{
var _syncContainer;
function MochiSync () {
_syncContainer = {};
}
function getProp(name) {
return(_syncContainer[name]);
}
function setProp(name, value) {
if (_syncContainer[name] == value) {
return(undefined);
}
_syncContainer[name] = value;
mochi.as2.MochiServices.send("sync_propUpdate", {name:name, value:value});
}
function triggerEvent(eventType, args) {
switch (eventType) {
case SYNC_REQUEST :
mochi.as2.MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY :
_syncContainer[args.name] = args.value;
}
}
static var SYNC_REQUEST = "SyncRequest";
static var SYNC_PROPERTY = "UpdateProperty";
}
Symbol 1026 MovieClip [__Packages.mochi.as2.MochiServices] Frame 0
class mochi.as2.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _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("3.8 as2");
}
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) {
warnID(id, false);
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
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 _local6 = "_mochiservices_com_" + id;
var _local5 = new MovieClipLoader();
var _local3 = {};
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servURL) {
_servURL = urlOptions().servURL;
}
var _local4 = _servURL + _services;
if (urlOptions().servicesURL) {
_local4 = urlOptions().servicesURL;
}
allowDomains(_local4);
_clip = clip.createEmptyMovieClip(_local6, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
listen();
if (_local3.waitInterval != null) {
clearInterval(_local3.waitInterval);
}
_local3.onLoadError = loadError;
_local3.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_local3.onLoadComplete = function (target_mc) {
target_mc.MochiServices = mochi.as2.MochiServices;
};
_local3.startTime = getTimer();
_local3.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_local3.waitInterval = setInterval(_local3, "wait", 1000);
_local5.addListener(_local3);
_local5.loadClip((((((_local4 + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options)) + "&api_version=") + getVersion(), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
return(_clip);
}
static function loadError(target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
disconnect();
onError.apply(null, [errorCode]);
}
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.as2.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.as2.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.as2.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.onEvent = function (pkg) {
switch (pkg.target) {
case "events" :
mochi.as2.MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins" :
mochi.as2.MochiSocial.triggerEvent(pkg.event, pkg.args);
break;
case "sync" :
mochi.as2.MochiServices.servicesSync.triggerEvent(pkg.event, pkg.args);
}
};
_listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
};
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function updateCopy(args) {
send("coins_updateCopy", args, null, null);
}
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)) {
trace("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName);
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 = {};
var _local6;
if (_root._url.indexOf("mochiad_options") != -1) {
var _local2 = (_root._url.indexOf("mochiad_options") + "mochiad_options".length) + 1;
_local6 = _root._url.substr(_local2, _root._url.length);
} else if (_root.mochiad_options) {
_local6 = _root.mochiad_options;
}
if (_local6) {
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 warnID(bid, leaderboard) {
bid = bid.toLowerCase();
if (bid.length != 16) {
trace(("WARNING: " + (leaderboard ? "board" : "game")) + " ID is not the appropriate length");
return(undefined);
}
if (bid == "1e113c7239048b3f") {
if (leaderboard) {
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
}
return(undefined);
}
if (bid == "84993a1de4031cd8") {
if (leaderboard) {
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
}
return(undefined);
}
var _local1 = 0;
while (_local1 < bid.length) {
switch (bid.charAt(_local1)) {
case "0" :
case "1" :
case "2" :
case "3" :
case "4" :
case "5" :
case "6" :
case "7" :
case "8" :
case "9" :
case "a" :
case "b" :
case "c" :
case "d" :
case "e" :
case "f" :
break;
default :
trace("WARNING: Board ID contains illegal characters: " + bid);
return(undefined);
}
_local1++;
}
}
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.as2.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.as2.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static function setContainer(clip) {
}
static function stayOnTop(clip) {
}
static var _servURL = "http://www.mochiads.com/static/lib/services/";
static var _services = "services.swf";
static var _mochiLC = "MochiLC.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
static var servicesSync = new mochi.as2.MochiSync();
}
Symbol 1027 MovieClip [__Packages.mochi.as2.MochiEventDispatcher] Frame 0
class mochi.as2.MochiEventDispatcher
{
var eventTable;
function MochiEventDispatcher () {
eventTable = {};
}
function buildDelegate(thisObject, thatObject) {
var _local2 = {thisObject:thisObject, thatObject:thatObject};
if (thatObject != undefined) {
var funct = ((typeof(thatObject) == "string") ? (thisObject[thatObject]) : (thatObject));
_local2.delegate = function (args) {
funct.call(thisObject, args);
};
} else {
_local2.delegate = thisObject;
}
return(_local2);
}
function compareDelegate(d_A, d_B) {
if ((d_A.thisObject != d_B.thisObject) || (d_A.thatObject != d_B.thatObject)) {
return(false);
}
return(true);
}
function addEventListener(event, thisObject, thatObject) {
removeEventListener(event, thisObject, thatObject);
eventTable[event].push(buildDelegate(thisObject, thatObject));
}
function removeEventListener(event, thisObject, thatObject) {
var _local3 = buildDelegate(thisObject, thatObject);
if (eventTable[event] == undefined) {
eventTable[event] = [];
return(undefined);
}
for (var _local4 in eventTable[event]) {
if (!compareDelegate(eventTable[event][_local4], _local3)) {
continue;
}
eventTable[event].splice(Number(_local4), 1);
}
}
function triggerEvent(event, args) {
if (eventTable[event] == undefined) {
return(undefined);
}
for (var _local4 in eventTable[event]) {
eventTable[event][_local4].delegate(args);
}
}
}
Symbol 1028 MovieClip [__Packages.mochi.as2.MochiEvents] Frame 0
class mochi.as2.MochiEvents
{
function MochiEvents () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function startSession(achievementID) {
mochi.as2.MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
static function setNotifications(clip, style) {
var _local2 = {};
for (var _local3 in style) {
_local2[_local3] = style[_local3];
}
_local2.clip = clip;
mochi.as2.MochiServices.send("events_setNotifications", _local2, null, null);
}
static function addEventListener(eventType, thisObject, thatObject) {
_dispatcher.addEventListener(eventType, thisObject, thatObject);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, thisObject, thatObject) {
_dispatcher.removeEventListener(eventType, thisObject, thatObject);
}
static function startPlay(tag) {
if (tag == undefined) {
tag = "gameplay";
}
mochi.as2.MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
static function endPlay() {
mochi.as2.MochiServices.send("events_clearRoundID", null, null, null);
}
static function trackEvent(tag, value) {
mochi.as2.MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
static var ACHIEVEMENT_RECEIVED = "AchievementReceived";
static var ALIGN_TOP_LEFT = "ALIGN_TL";
static var ALIGN_TOP = "ALIGN_T";
static var ALIGN_TOP_RIGHT = "ALIGN_TR";
static var ALIGN_LEFT = "ALIGN_L";
static var ALIGN_CENTER = "ALIGN_C";
static var ALIGN_RIGHT = "ALIGN_R";
static var ALIGN_BOTTOM_LEFT = "ALIGN_BL";
static var ALIGN_BOTTOM = "ALIGN_B";
static var ALIGN_BOTTOM_RIGHT = "ALIGN_BR";
static var FORMAT_SHORT = "ShortForm";
static var FORMAT_LONG = "LongForm";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 1029 MovieClip [__Packages.mochi.as2.MochiSocial] Frame 0
class mochi.as2.MochiSocial
{
function MochiSocial () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showLoginWidget(options) {
mochi.as2.MochiServices.setContainer();
mochi.as2.MochiServices.stayOnTop();
mochi.as2.MochiServices.send("coins_showLoginWidget", {options:options});
}
static function hideLoginWidget() {
mochi.as2.MochiServices.send("coins_hideLoginWidget");
}
static function requestLogin() {
mochi.as2.MochiServices.send("coins_requestLogin");
}
static function getUserInfo() {
mochi.as2.MochiServices.send("coins_getUserInfo");
}
static function saveUserProperties(properties) {
mochi.as2.MochiServices.send("coins_saveUserProperties", properties);
}
static function addEventListener(eventType, delegate) {
_dispatcher.addEventListener(eventType, delegate);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, delegate) {
_dispatcher.removeEventListener(eventType, delegate);
}
static var LOGGED_IN = "LoggedIn";
static var LOGGED_OUT = "LoggedOut";
static var LOGIN_SHOW = "LoginShow";
static var LOGIN_HIDE = "LoginHide";
static var LOGIN_SHOWN = "LoginShown";
static var PROFILE_SHOW = "ProfileShow";
static var PROFILE_HIDE = "ProfileHide";
static var PROPERTIES_SAVED = "PropertySaved";
static var WIDGET_LOADED = "WidgetLoaded";
static var USER_INFO = "UserInfo";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var NO_USER = "NoUser";
static var PROPERTIES_SIZE = "PropertiesSize";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 710 MovieClip [__Packages.mx.core.UIObject] Frame 0
class mx.core.UIObject extends MovieClip
{
var _width, _height, _x, _y, _parent, _minHeight, _minWidth, _visible, dispatchEvent, _xscale, _yscale, methodTable, onEnterFrame, tfList, __width, __height, moveTo, lineTo, createTextField, attachMovie, buildDepthTable, findNextAvailableDepth, idNames, childrenCreated, _name, createAccessibilityImplementation, _endInit, validateNow, hasOwnProperty, initProperties, stylecache, className, ignoreClassStyleDeclaration, _tf, fontFamily, fontSize, color, marginLeft, marginRight, fontStyle, fontWeight, textAlign, textIndent, textDecoration, embedFonts, styleName, enabled;
function UIObject () {
super();
constructObject();
}
function get width() {
return(_width);
}
function get height() {
return(_height);
}
function get left() {
return(_x);
}
function get x() {
return(_x);
}
function get top() {
return(_y);
}
function get y() {
return(_y);
}
function get right() {
return(_parent.width - (_x + width));
}
function get bottom() {
return(_parent.height - (_y + height));
}
function getMinHeight(Void) {
return(_minHeight);
}
function setMinHeight(h) {
_minHeight = h;
}
function get minHeight() {
return(getMinHeight());
}
function set minHeight(h) {
setMinHeight(h);
//return(minHeight);
}
function getMinWidth(Void) {
return(_minWidth);
}
function setMinWidth(w) {
_minWidth = w;
}
function get minWidth() {
return(getMinWidth());
}
function set minWidth(w) {
setMinWidth(w);
//return(minWidth);
}
function setVisible(x, noEvent) {
if (x != _visible) {
_visible = x;
if (noEvent != true) {
dispatchEvent({type:(x ? "reveal" : "hide")});
}
}
}
function get visible() {
return(_visible);
}
function set visible(x) {
setVisible(x, false);
//return(visible);
}
function get scaleX() {
return(_xscale);
}
function set scaleX(x) {
_xscale = x;
//return(scaleX);
}
function get scaleY() {
return(_yscale);
}
function set scaleY(y) {
_yscale = y;
//return(scaleY);
}
function doLater(obj, fn) {
if (methodTable == undefined) {
methodTable = new Array();
}
methodTable.push({obj:obj, fn:fn});
onEnterFrame = doLaterDispatcher;
}
function doLaterDispatcher(Void) {
delete onEnterFrame;
if (invalidateFlag) {
redraw();
}
var _local3 = methodTable;
methodTable = new Array();
if (_local3.length > 0) {
var _local2;
while (_local2 = _local3.shift() , _local2 != undefined) {
_local2.obj[_local2.fn]();
}
}
}
function cancelAllDoLaters(Void) {
delete onEnterFrame;
methodTable = new Array();
}
function invalidate(Void) {
invalidateFlag = true;
onEnterFrame = doLaterDispatcher;
}
function invalidateStyle(Void) {
invalidate();
}
function redraw(bAlways) {
if (invalidateFlag || (bAlways)) {
invalidateFlag = false;
var _local2;
for (_local2 in tfList) {
tfList[_local2].draw();
}
draw();
dispatchEvent({type:"draw"});
}
}
function draw(Void) {
}
function move(x, y, noEvent) {
var _local3 = _x;
var _local2 = _y;
_x = x;
_y = y;
if (noEvent != true) {
dispatchEvent({type:"move", oldX:_local3, oldY:_local2});
}
}
function setSize(w, h, noEvent) {
var _local3 = __width;
var _local2 = __height;
__width = w;
__height = h;
size();
if (noEvent != true) {
dispatchEvent({type:"resize", oldWidth:_local3, oldHeight:_local2});
}
}
function size(Void) {
_width = __width;
_height = __height;
}
function drawRect(x1, y1, x2, y2) {
moveTo(x1, y1);
lineTo(x2, y1);
lineTo(x2, y2);
lineTo(x1, y2);
lineTo(x1, y1);
}
function createLabel(name, depth, text) {
createTextField(name, depth, 0, 0, 0, 0);
var _local2 = this[name];
_local2._color = textColorList;
_local2._visible = false;
_local2.__text = text;
if (tfList == undefined) {
tfList = new Object();
}
tfList[name] = _local2;
_local2.invalidateStyle();
invalidate();
_local2.styleName = this;
return(_local2);
}
function createObject(linkageName, id, depth, initobj) {
return(attachMovie(linkageName, id, depth, initobj));
}
function createClassObject(className, id, depth, initobj) {
var _local3 = className.symbolName == undefined;
if (_local3) {
Object.registerClass(className.symbolOwner.symbolName, className);
}
var _local4 = mx.core.UIObject(createObject(className.symbolOwner.symbolName, id, depth, initobj));
if (_local3) {
Object.registerClass(className.symbolOwner.symbolName, className.symbolOwner);
}
return(_local4);
}
function createEmptyObject(id, depth) {
return(createClassObject(mx.core.UIObject, id, depth));
}
function destroyObject(id) {
var _local2 = this[id];
if (_local2.getDepth() < 0) {
var _local4 = buildDepthTable();
var _local5 = findNextAvailableDepth(0, _local4, "up");
var _local3 = _local5;
_local2.swapDepths(_local3);
}
_local2.removeMovieClip();
delete this[id];
}
function getSkinIDName(tag) {
return(idNames[tag]);
}
function setSkin(tag, linkageName, initObj) {
if (_global.skinRegistry[linkageName] == undefined) {
mx.skins.SkinElement.registerElement(linkageName, mx.skins.SkinElement);
}
return(createObject(linkageName, getSkinIDName(tag), tag, initObj));
}
function createSkin(tag) {
var _local2 = getSkinIDName(tag);
createEmptyObject(_local2, tag);
return(this[_local2]);
}
function createChildren(Void) {
}
function _createChildren(Void) {
createChildren();
childrenCreated = true;
}
function constructObject(Void) {
if (_name == undefined) {
return(undefined);
}
init();
_createChildren();
createAccessibilityImplementation();
_endInit();
if (validateNow) {
redraw(true);
} else {
invalidate();
}
}
function initFromClipParameters(Void) {
var _local4 = false;
var _local2;
for (_local2 in clipParameters) {
if (hasOwnProperty(_local2)) {
_local4 = true;
this["def_" + _local2] = this[_local2];
delete this[_local2];
}
}
if (_local4) {
for (_local2 in clipParameters) {
var _local3 = this["def_" + _local2];
if (_local3 != undefined) {
this[_local2] = _local3;
}
}
}
}
function init(Void) {
__width = _width;
__height = _height;
if (initProperties == undefined) {
initFromClipParameters();
} else {
initProperties();
}
if (_global.cascadingStyles == true) {
stylecache = new Object();
}
}
function getClassStyleDeclaration(Void) {
var _local4 = this;
var _local3 = className;
while (_local3 != undefined) {
if (ignoreClassStyleDeclaration[_local3] == undefined) {
if (_global.styles[_local3] != undefined) {
return(_global.styles[_local3]);
}
}
_local4 = _local4.__proto__;
_local3 = _local4.className;
}
}
function setColor(color) {
}
function __getTextFormat(tf, bAll) {
var _local8 = stylecache.tf;
if (_local8 != undefined) {
var _local3;
for (_local3 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local3])) {
if (tf[_local3] == undefined) {
tf[_local3] = _local8[_local3];
}
}
}
return(false);
}
var _local6 = false;
for (var _local3 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local3])) {
if (tf[_local3] == undefined) {
var _local5 = _tf[_local3];
if (_local5 != undefined) {
tf[_local3] = _local5;
} else if ((_local3 == "font") && (fontFamily != undefined)) {
tf[_local3] = fontFamily;
} else if ((_local3 == "size") && (fontSize != undefined)) {
tf[_local3] = fontSize;
} else if ((_local3 == "color") && (color != undefined)) {
tf[_local3] = color;
} else if ((_local3 == "leftMargin") && (marginLeft != undefined)) {
tf[_local3] = marginLeft;
} else if ((_local3 == "rightMargin") && (marginRight != undefined)) {
tf[_local3] = marginRight;
} else if ((_local3 == "italic") && (fontStyle != undefined)) {
tf[_local3] = fontStyle == _local3;
} else if ((_local3 == "bold") && (fontWeight != undefined)) {
tf[_local3] = fontWeight == _local3;
} else if ((_local3 == "align") && (textAlign != undefined)) {
tf[_local3] = textAlign;
} else if ((_local3 == "indent") && (textIndent != undefined)) {
tf[_local3] = textIndent;
} else if ((_local3 == "underline") && (textDecoration != undefined)) {
tf[_local3] = textDecoration == _local3;
} else if ((_local3 == "embedFonts") && (embedFonts != undefined)) {
tf[_local3] = embedFonts;
} else {
_local6 = true;
}
}
}
}
if (_local6) {
var _local9 = styleName;
if (_local9 != undefined) {
if (typeof(_local9) != "string") {
_local6 = _local9.__getTextFormat(tf, true, this);
} else if (_global.styles[_local9] != undefined) {
_local6 = _global.styles[_local9].__getTextFormat(tf, true, this);
}
}
}
if (_local6) {
var _local10 = getClassStyleDeclaration();
if (_local10 != undefined) {
_local6 = _local10.__getTextFormat(tf, true, this);
}
}
if (_local6) {
if (_global.cascadingStyles) {
if (_parent != undefined) {
_local6 = _parent.__getTextFormat(tf, false);
}
}
}
if (_local6) {
_local6 = _global.style.__getTextFormat(tf, true, this);
}
return(_local6);
}
function _getTextFormat(Void) {
var _local2 = stylecache.tf;
if (_local2 != undefined) {
return(_local2);
}
_local2 = new TextFormat();
__getTextFormat(_local2, true);
stylecache.tf = _local2;
if (enabled == false) {
var _local3 = getStyle("disabledColor");
_local2.color = _local3;
}
return(_local2);
}
function getStyleName(Void) {
var _local2 = styleName;
if (_local2 != undefined) {
if (typeof(_local2) != "string") {
return(_local2.getStyleName());
}
return(_local2);
}
if (_parent != undefined) {
return(_parent.getStyleName());
}
return(undefined);
}
function getStyle(styleProp) {
var _local3;
_global.getStyleCounter++;
if (this[styleProp] != undefined) {
return(this[styleProp]);
}
var _local6 = styleName;
if (_local6 != undefined) {
if (typeof(_local6) != "string") {
_local3 = _local6.getStyle(styleProp);
} else {
var _local7 = _global.styles[_local6];
_local3 = _local7.getStyle(styleProp);
}
}
if (_local3 != undefined) {
return(_local3);
}
var _local7 = getClassStyleDeclaration();
if (_local7 != undefined) {
_local3 = _local7[styleProp];
}
if (_local3 != undefined) {
return(_local3);
}
if (_global.cascadingStyles) {
if (mx.styles.StyleManager.isInheritingStyle(styleProp) || (mx.styles.StyleManager.isColorStyle(styleProp))) {
var _local5 = stylecache;
if (_local5 != undefined) {
if (_local5[styleProp] != undefined) {
return(_local5[styleProp]);
}
}
if (_parent != undefined) {
_local3 = _parent.getStyle(styleProp);
} else {
_local3 = _global.style[styleProp];
}
if (_local5 != undefined) {
_local5[styleProp] = _local3;
}
return(_local3);
}
}
if (_local3 == undefined) {
_local3 = _global.style[styleProp];
}
return(_local3);
}
static function mergeClipParameters(o, p) {
for (var _local3 in p) {
o[_local3] = p[_local3];
}
return(true);
}
static var symbolName = "UIObject";
static var symbolOwner = mx.core.UIObject;
static var version = "2.0.2.127";
static var textColorList = {color:1, disabledColor:1};
var invalidateFlag = false;
var lineWidth = 1;
var lineColor = 0;
var tabEnabled = false;
var clipParameters = {visible:1, minHeight:1, minWidth:1, maxHeight:1, maxWidth:1, preferredHeight:1, preferredWidth:1};
}
Symbol 711 MovieClip [__Packages.mx.core.UIComponent] Frame 0
class mx.core.UIComponent extends mx.core.UIObject
{
var __width, __height, invalidate, stylecache, removeEventListener, dispatchEvent, drawFocus, addEventListener, _xscale, _yscale, _focusrect, watch, enabled;
function UIComponent () {
super();
}
function get width() {
return(__width);
}
function get height() {
return(__height);
}
function setVisible(x, noEvent) {
super.setVisible(x, noEvent);
}
function enabledChanged(id, oldValue, newValue) {
setEnabled(newValue);
invalidate();
delete stylecache.tf;
return(newValue);
}
function setEnabled(enabled) {
invalidate();
}
function getFocus() {
var selFocus = Selection.getFocus();
return(((selFocus === null) ? null : (eval (selFocus))));
}
function setFocus() {
Selection.setFocus(this);
}
function getFocusManager() {
var _local2 = this;
while (_local2 != undefined) {
if (_local2.focusManager != undefined) {
return(_local2.focusManager);
}
_local2 = _local2._parent;
}
return(undefined);
}
function onKillFocus(newFocus) {
removeEventListener("keyDown", this);
removeEventListener("keyUp", this);
dispatchEvent({type:"focusOut"});
drawFocus(false);
}
function onSetFocus(oldFocus) {
addEventListener("keyDown", this);
addEventListener("keyUp", this);
dispatchEvent({type:"focusIn"});
if (getFocusManager().bDrawFocus != false) {
drawFocus(true);
}
}
function findFocusInChildren(o) {
if (o.focusTextField != undefined) {
return(o.focusTextField);
}
if (o.tabEnabled == true) {
return(o);
}
return(undefined);
}
function findFocusFromObject(o) {
if (o.tabEnabled != true) {
if (o._parent == undefined) {
return(undefined);
}
if (o._parent.tabEnabled == true) {
o = o._parent;
} else if (o._parent.tabChildren) {
o = findFocusInChildren(o._parent);
} else {
o = findFocusFromObject(o._parent);
}
}
return(o);
}
function pressFocus() {
var _local3 = findFocusFromObject(this);
var _local2 = getFocus();
if (_local3 != _local2) {
_local2.drawFocus(false);
if (getFocusManager().bDrawFocus != false) {
_local3.drawFocus(true);
}
}
}
function releaseFocus() {
var _local2 = findFocusFromObject(this);
if (_local2 != getFocus()) {
_local2.setFocus();
}
}
function isParent(o) {
while (o != undefined) {
if (o == this) {
return(true);
}
o = o._parent;
}
return(false);
}
function size() {
}
function init() {
super.init();
_xscale = 100;
_yscale = 100;
_focusrect = _global.useFocusRect == false;
watch("enabled", enabledChanged);
if (enabled == false) {
setEnabled(false);
}
}
function dispatchValueChangedEvent(value) {
dispatchEvent({type:"valueChanged", value:value});
}
static var symbolName = "UIComponent";
static var symbolOwner = mx.core.UIComponent;
static var version = "2.0.2.127";
static var kStretch = 5000;
var focusEnabled = true;
var tabEnabled = true;
var origBorderStyles = {themeColor:16711680};
var clipParameters = {};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.core.UIComponent.prototype.clipParameters, mx.core.UIObject.prototype.clipParameters);
}
Symbol 712 MovieClip [__Packages.ZattikkaHiScores] Frame 0
class ZattikkaHiScores extends mx.core.UIComponent
{
var _visible, movEntryScreen, movInfoScreen, gameId, levelId, gameCode, gameKey, lowIsBest, score, msg1, msg2, g5UserExists, btnGFTP, fbUserExists, caller, getURL, g5User, fbUser, fbSessionKey;
function ZattikkaHiScores () {
super();
debug(("[ZattikkaHiScores VERSION " + VERSION_NUM) + "]");
_visible = false;
}
function setDetails(gameId, levelId, gameCode, gameKey, lowIsBest, score, msg1, msg2, testMode) {
debug((((((((((("[ZattikkaHiScores::setDetails], gameId = " + gameId) + ", levelId = ") + levelId) + ", gameCode = ") + gameCode) + ", lowIsBest = ") + lowIsBest) + ", score = ") + score) + ", testMode = ") + testMode);
initServerURL(testMode);
entryScreen = movEntryScreen;
infoScreen = movInfoScreen;
entryScreen._visible = false;
infoScreen._visible = false;
this.gameId = gameId;
this.levelId = levelId;
this.gameCode = gameCode;
this.gameKey = gameKey;
this.lowIsBest = lowIsBest;
this.score = score;
this.msg1 = msg1;
this.msg2 = msg2;
if (!userManuallySet) {
try {
grabG5User();
if (!g5UserExists) {
grabFacebookUser();
}
} catch(err:Error) {
}
}
var self = this;
btnGFTP.onRelease = function () {
self.btn_GFTP();
};
entryScreen.btnSubmit.onRelease = function () {
self.btn_submitScore();
};
entryScreen.btnTwitter.onRelease = function () {
self.btn_twitterTweet();
};
entryScreen.btnFacebook.onRelease = function () {
self.btn_facebookFeed();
};
infoScreen.btnView.onRelease = function () {
self.btn_viewScore();
};
infoScreen.btnBack.onRelease = function () {
self.btn_back();
};
if (fbUserExists) {
btn_submitScore();
} else {
showEntryScreen();
}
_visible = true;
}
function getHiScores(caller, gameId, levelId, numRows, lowIsBest, testMode) {
debug((((((((("[ZattikkaHiScores::getHiScores] gameId = " + gameId) + ", levelId = ") + levelId) + ", numRows = ") + numRows) + ", lowIsBest = ") + lowIsBest) + ", testMode = ") + testMode);
initServerURL(testMode);
this.caller = caller;
var _local2 = new LoadVars();
_local2.gameId = gameId;
_local2.levelId = levelId;
_local2.platformId = 0;
_local2.viewPlatformId = 0;
_local2.userId = "";
_local2.numRows = numRows;
_local2.lowIsBest = lowIsBest;
hitServer(HS_ACTION, EVENT_GET_HI_SCORES, _local2);
}
function viewHiScores(gameId, testMode) {
debug((("[ZattikkaHiScores::viewHiScores] gameId = " + gameId) + ", testMode = ") + testMode);
initServerURL(testMode);
var _local2 = (SERVER_URL + HS_ACTION) + EVENT_VIEW_HI_SCORES;
_local2 = _local2 + ("&gameId=" + gameId);
getURL(_local2, "_blank");
}
function initServerURL(testMode) {
if ((testMode != undefined) && (testMode)) {
SERVER_URL = TEST_SERVER_URL;
} else {
try {
if ((_root.svrUrl != null) && (_root.svrUrl.length > 0)) {
SERVER_URL = String(_root.svrUrl);
}
} catch(err:Error) {
}
}
debug("[ZattikkaHiScores::initServerURL] SERVER_URL = " + SERVER_URL);
}
function setG5User(userId, userName) {
g5User = new Array(userId, userName);
userManuallySet = true;
debug((("[ZattikkaHiScores::setG5User] userId = " + g5User[0]) + ", userName = ") + g5User[1]);
}
function setFacebookUser(userId, userName, sessionKey) {
fbUser = new Array(userId, userName);
fbSessionKey = sessionKey;
userManuallySet = true;
debug((("[ZattikkaHiScores::setFacebookUser] userId = " + fbUser[0]) + ", userName = ") + fbUser[1]);
}
function grabG5User() {
g5User = flash.external.ExternalInterface.call("getG5User");
g5UserExists = ((g5User == null) ? false : (!isNaN(g5User[0])));
debug("[ZattikkaHiScores::grabG5User] " + (g5UserExists ? ((("userId = " + g5User[0]) + ", userName = ") + g5User[1]) : "g5User is empty"));
}
function grabFacebookUser() {
fbUser = flash.external.ExternalInterface.call("getFBUser");
fbUserExists = ((fbUser == null) ? false : (!isNaN(fbUser[0])));
fbSessionKey = flash.external.ExternalInterface.call("getFBSessionKey");
debug("[ZattikkaHiScores::grabFacebookUser] " + (fbUserExists ? ((((("userId = " + fbUser[0]) + ", userName = ") + fbUser[1]) + ", sessionKey = ") + fbSessionKey) : "fbUser is empty"));
}
function showEntryScreen() {
entryScreen.txtMsgLine1.text = msg1;
entryScreen.txtMsgLine2.text = msg2;
entryScreen.movNameAuto._visible = g5UserExists || (fbUserExists);
entryScreen.movNameManual._visible = (!g5UserExists) && (!fbUserExists);
entryScreen.movNameAuto.txtName.text = (g5UserExists ? (g5User[1]) : ((fbUserExists ? (fbUser[1]) : "")));
entryScreen.movNameManual.txtName.text = "";
entryScreen._visible = true;
infoScreen._visible = false;
}
function showInfoMessage(msg, error) {
infoScreen.txtInfo.text = msg;
infoScreen.btnBack._visible = error;
infoScreen.btnView._visible = (!error) && (!fbUserExists);
infoScreen._visible = true;
entryScreen._visible = false;
}
function btn_GFTP() {
getURL(GFTP_URL, "_blank");
}
function btn_submitScore() {
if (((!g5UserExists) && (!fbUserExists)) && (entryScreen.movNameManual.txtName.text.length == 0)) {
showInfoMessage(MSG_PLEASE_ENTER_NICKNAME, true);
} else {
submitScore();
}
}
function btn_twitterTweet() {
if (((!g5UserExists) && (!fbUserExists)) && (entryScreen.movNameManual.txtName.text.length == 0)) {
showInfoMessage(MSG_PLEASE_ENTER_NICKNAME, true);
} else {
twitterTweet();
}
}
function btn_facebookFeed() {
if (fbUserExists) {
facebookFeed();
} else {
facebookFeedExternal();
}
}
function btn_viewScore() {
viewScore();
}
function btn_back() {
setDetails(gameId, levelId, gameCode, gameKey, lowIsBest, score, msg1, msg2);
}
function submitScore() {
showInfoMessage(MSG_SUBMITTING_DETAILS, false);
infoScreen._visible = true;
entryScreen._visible = false;
var _local9 = (fbUserExists ? (HS_PLATFORM_FACEBOOK) : (HS_PLATFORM_WEB));
var _local5 = "";
var _local7 = "";
if (fbUserExists) {
_local7 = fbUser[0];
_local5 = fbUser[1];
} else if (g5UserExists) {
_local7 = g5User[0];
_local5 = g5User[1];
} else {
_local5 = entryScreen.movNameManual.txtName.text;
}
var _local8 = String(new Date().getTime());
var _local10 = _local8.split("");
_local10.reverse();
var _local6 = xor(_local10.join(""), gameKey, false);
var _local2 = "";
_local2 = _local2 + (gameId + ",");
_local2 = _local2 + (levelId + ",");
_local2 = _local2 + (_local9 + ",");
_local2 = _local2 + (score + ",");
_local2 = _local2 + (_local7 + ",");
_local2 = _local2 + (replaceAll(_local5, ",", "") + ",");
_local2 = _local2 + ",";
_local2 = _local2 + String(lowIsBest);
var _local4 = xor(_local2, _local6, false);
debug((("key [" + _local6.length) + "] = ") + _local6);
debug((("plain [" + _local2.length) + "] = ") + _local2);
debug((("cipher [" + _local4.length) + "] = ") + _local4);
_local4 = (getRandomString(5) + _local4) + getRandomString(5);
var _local3 = new LoadVars();
_local3.gameId = gameId;
_local3.platformId = _local9;
_local3.time = _local8;
_local3.data = _local4;
_local3.returnMessage = true;
hitServer(HS_ACTION, EVENT_SUBMIT_HI_SCORE, _local3);
}
function twitterTweet() {
var _local2 = (SERVER_URL + TW_ACTION) + EVENT_POST_TWEET;
_local2 = _local2 + ("&gameId=" + gameId);
_local2 = _local2 + ("&levelId=" + levelId);
_local2 = _local2 + ("&score=" + score);
getURL(_local2, "_blank");
submitScore();
}
function facebookFeed() {
var _local2 = new LoadVars();
_local2.gameId = gameId;
_local2.levelId = levelId;
_local2.score = score;
_local2.sessionKey = fbSessionKey;
_local2.returnMessage = true;
hitServer(FB_ACTION, EVENT_PUBLISH_HI_SCORE_FEED, _local2);
}
function facebookFeedExternal() {
var _local2 = (SERVER_URL + FB_ACTION) + EVENT_PUBLISH_HI_SCORE_FEED_EXTERNAL;
_local2 = _local2 + ("&gameId=" + gameId);
_local2 = _local2 + ("&levelId=" + levelId);
_local2 = _local2 + ("&score=" + score);
getURL(_local2, "_blank");
}
function hitServer(stripesAction, stripesEvent, vars) {
debug((("[ZattikkaHiScores::hitServer] url = " + SERVER_URL) + stripesAction) + stripesEvent);
var self = this;
var _local2 = new XML();
vars.addRequestHeader(["Content-Type", "application/x-www-form-urlencoded; charset=utf-8"]);
vars.sendAndLoad((SERVER_URL + stripesAction) + stripesEvent, _local2, "POST");
_local2.onLoad = function (success) {
self.loadHandler(stripesEvent, success, this);
};
}
function viewScore() {
var _local2 = (SERVER_URL + HS_ACTION) + EVENT_VIEW_HI_SCORE;
_local2 = _local2 + ("&gameId=" + gameId);
_local2 = _local2 + ("&levelId=" + levelId);
_local2 = _local2 + ("&platformId=" + HS_PLATFORM_WEB);
_local2 = _local2 + ("&gameCode=" + gameCode);
if (g5UserExists) {
_local2 = _local2 + ("&userId=" + g5User[0]);
} else {
_local2 = _local2 + ("&name=" + entryScreen.movNameManual.txtName.text);
}
getURL(_local2, "_blank");
}
function loadHandler(stripesEvent, success, xml) {
debug((((("[ZattikkaHiScores::loadHandler] stripesEvent = " + stripesEvent) + ", success = ") + success) + ", xml = ") + xml.toString());
if (!success) {
if (stripesEvent == EVENT_GET_HI_SCORES) {
caller.getHiScores_Error();
} else {
showInfoMessage(MSG_SERVER_ERROR, true);
}
} else {
var _local3 = xml.firstChild;
var _local2 = _local3.attributes.code;
switch (stripesEvent) {
case EVENT_SUBMIT_HI_SCORE :
showInfoMessage(_local3.attributes.msg, _local2 == -1);
if (fbUserExists && ((_local2 == 1) || (_local2 == 2))) {
try {
flash.external.ExternalInterface.call("refreshFBHiScores", score, levelId);
flash.external.ExternalInterface.call("streamPublish_FBConnect", msg1, levelId);
} catch(err:Error) {
}
}
break;
case EVENT_PUBLISH_HI_SCORE_FEED :
submitScore();
break;
case EVENT_GET_HI_SCORES :
caller.getHiScores_Callback(xml);
}
}
}
function xor(plain, key, traceChar) {
var _local7 = "";
var _local4 = 0;
var _local2 = 0;
while (_local4 < plain.length) {
if (_local2 >= key.length) {
_local2 = 0;
}
var _local3 = (plain.charCodeAt(_local4) ^ key.charCodeAt(_local2)) + 1;
if (traceChar) {
debug((("charCode = " + _local3) + " = ") + String.fromCharCode(_local3));
}
_local7 = _local7 + String.fromCharCode(_local3);
_local4++;
_local2++;
}
return(_local7);
}
function getRandom(min, max) {
return(Math.floor(Math.random() * ((max - min) + 1)) + min);
}
function getRandomString(len) {
var _local3 = "";
var _local2 = 0;
while (_local2 < len) {
_local3 = _local3 + String.fromCharCode(getRandom(48, 122));
_local2++;
}
return(_local3);
}
function replaceAll(str, toReplace, replaceWith) {
var _local3 = "";
var _local1 = 0;
while (_local1 < str.length) {
if (str.charAt(_local1) == toReplace) {
_local3 = _local3 + replaceWith;
} else {
_local3 = _local3 + str.charAt(_local1);
}
_local1++;
}
return(_local3);
}
function debug(msg) {
trace(msg);
com.hexagonstar.util.debug.Debug.trace(msg);
}
static var VERSION_NUM = "1.0.16 (AS2)";
static var LIVE_SERVER_URL = "http://api.zattikka.com";
static var TEST_SERVER_URL = "http://api.staging.zattikka.com";
static var SERVER_URL = LIVE_SERVER_URL;
static var GFTP_URL = "http://www.gamesfortheplanet.com";
static var HS_PLATFORM_WEB = 0;
static var HS_PLATFORM_FACEBOOK = 1;
static var HS_ACTION = "/HiScore.action?";
static var EVENT_SUBMIT_HI_SCORE = "SubmitHiScore=";
static var EVENT_VIEW_HI_SCORE = "ViewHiScore=";
static var EVENT_VIEW_HI_SCORES = "ViewHiScores=";
static var EVENT_GET_HI_SCORES = "GetHiScores=";
static var FB_ACTION = "/Facebook.action?";
static var EVENT_PUBLISH_HI_SCORE_FEED = "PublishHiScoreFeed=";
static var EVENT_PUBLISH_HI_SCORE_FEED_EXTERNAL = "PublishHiScoreFeedExternal=";
static var TW_ACTION = "/Twitter.action?";
static var EVENT_POST_TWEET = "PostTweet=";
static var MSG_PLEASE_ENTER_NICKNAME = "Please enter your nickname.";
static var MSG_SUBMITTING_DETAILS = "Submitting hi-score details to the server, please wait.";
static var MSG_SERVER_ERROR = "Could not contact server, please try again in a few minutes.";
var entryScreen = null;
var infoScreen = null;
static var symbolName = "ZattikkaHiScores";
static var symbolOwner = ZattikkaHiScores;
var className = "ZattikkaHiScores";
var userManuallySet = false;
}
Symbol 755 MovieClip [__Packages.mx.skins.SkinElement] Frame 0
class mx.skins.SkinElement extends MovieClip
{
var _visible, _x, _y, _width, _height;
function SkinElement () {
super();
}
static function registerElement(name, className) {
Object.registerClass(name, ((className == undefined) ? (mx.skins.SkinElement) : (className)));
_global.skinRegistry[name] = true;
}
function __set__visible(visible) {
_visible = visible;
}
function move(x, y) {
_x = x;
_y = y;
}
function setSize(w, h) {
_width = w;
_height = h;
}
}
Symbol 756 MovieClip [__Packages.mx.styles.CSSTextStyles] Frame 0
class mx.styles.CSSTextStyles
{
function CSSTextStyles () {
}
static function addTextStyles(o, bColor) {
o.addProperty("textAlign", function () {
return(this._tf.align);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.align = x;
});
o.addProperty("fontWeight", function () {
return(((this._tf.bold != undefined) ? ((this._tf.bold ? "bold" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.bold = x == "bold";
});
if (bColor) {
o.addProperty("color", function () {
return(this._tf.color);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.color = x;
});
}
o.addProperty("fontFamily", function () {
return(this._tf.font);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.font = x;
});
o.addProperty("textIndent", function () {
return(this._tf.indent);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.indent = x;
});
o.addProperty("fontStyle", function () {
return(((this._tf.italic != undefined) ? ((this._tf.italic ? "italic" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.italic = x == "italic";
});
o.addProperty("marginLeft", function () {
return(this._tf.leftMargin);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.leftMargin = x;
});
o.addProperty("marginRight", function () {
return(this._tf.rightMargin);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.rightMargin = x;
});
o.addProperty("fontSize", function () {
return(this._tf.size);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.size = x;
});
o.addProperty("textDecoration", function () {
return(((this._tf.underline != undefined) ? ((this._tf.underline ? "underline" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.underline = x == "underline";
});
o.addProperty("embedFonts", function () {
return(this._tf.embedFonts);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.embedFonts = x;
});
}
}
Symbol 757 MovieClip [__Packages.mx.styles.StyleManager] Frame 0
class mx.styles.StyleManager
{
function StyleManager () {
}
static function registerInheritingStyle(styleName) {
inheritingStyles[styleName] = true;
}
static function isInheritingStyle(styleName) {
return(inheritingStyles[styleName] == true);
}
static function registerColorStyle(styleName) {
colorStyles[styleName] = true;
}
static function isColorStyle(styleName) {
return(colorStyles[styleName] == true);
}
static function registerColorName(colorName, colorValue) {
colorNames[colorName] = colorValue;
}
static function isColorName(colorName) {
return(colorNames[colorName] != undefined);
}
static function getColorName(colorName) {
return(colorNames[colorName]);
}
static var inheritingStyles = {color:true, direction:true, fontFamily:true, fontSize:true, fontStyle:true, fontWeight:true, textAlign:true, textIndent:true};
static var colorStyles = {barColor:true, trackColor:true, borderColor:true, buttonColor:true, color:true, dateHeaderColor:true, dateRollOverColor:true, disabledColor:true, fillColor:true, highlightColor:true, scrollTrackColor:true, selectedDateColor:true, shadowColor:true, strokeColor:true, symbolBackgroundColor:true, symbolBackgroundDisabledColor:true, symbolBackgroundPressedColor:true, symbolColor:true, symbolDisabledColor:true, themeColor:true, todayIndicatorColor:true, shadowCapColor:true, borderCapColor:true, focusColor:true};
static var colorNames = {black:0, white:16777215, red:16711680, green:65280, blue:255, magenta:16711935, yellow:16776960, cyan:65535, haloGreen:8453965, haloBlue:2881013, haloOrange:16761344};
static var TextFormatStyleProps = {font:true, size:true, color:true, leftMargin:false, rightMargin:false, italic:true, bold:true, align:true, indent:true, underline:false, embedFonts:false};
static var TextStyleMap = {textAlign:true, fontWeight:true, color:true, fontFamily:true, textIndent:true, fontStyle:true, lineHeight:true, marginLeft:true, marginRight:true, fontSize:true, textDecoration:true, embedFonts:true};
}
Symbol 758 MovieClip [__Packages.mx.styles.CSSStyleDeclaration] Frame 0
class mx.styles.CSSStyleDeclaration
{
var _tf;
function CSSStyleDeclaration () {
}
function __getTextFormat(tf, bAll) {
var _local5 = false;
if (_tf != undefined) {
var _local2;
for (_local2 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local2])) {
if (tf[_local2] == undefined) {
var _local3 = _tf[_local2];
if (_local3 != undefined) {
tf[_local2] = _local3;
} else {
_local5 = true;
}
}
}
}
} else {
_local5 = true;
}
return(_local5);
}
function getStyle(styleProp) {
var _local2 = this[styleProp];
var _local3 = mx.styles.StyleManager.getColorName(_local2);
return(((_local3 == undefined) ? (_local2) : (_local3)));
}
static function classConstruct() {
mx.styles.CSSTextStyles.addTextStyles(mx.styles.CSSStyleDeclaration.prototype, true);
return(true);
}
static var classConstructed = classConstruct();
static var CSSTextStylesDependency = mx.styles.CSSTextStyles;
}
Symbol 759 MovieClip [__Packages.com.hexagonstar.util.debug.Debug] Frame 0
class com.hexagonstar.util.debug.Debug
{
static var _fpsMeter, _stage, _stopWatch, _connection;
function Debug () {
}
static function trace() {
var _local2 = ((arguments[1] != undefined) ? (arguments[1]) : 1);
if ((_local2 >= _filterLevel) && (_local2 < 7)) {
send("onData", arguments[0], _local2, 0);
}
}
static function traceObj(obj, depth, level) {
if (!depth) {
depth = 64;
}
if (!level) {
level = 1;
}
if ((level >= _filterLevel) && (level < 7)) {
send("onData", obj, level, depth);
}
}
static function inspect(obj) {
send("onInspect", obj, 1, -1);
}
static function hexDump(obj) {
send("onHexDump", obj, 0, 0);
}
static function clear() {
trace("[%CLR%]", 5);
}
static function delimiter() {
trace("[%DLT%]", 5);
}
static function pause() {
trace("[%PSE%]", 5);
}
static function time() {
trace("[%TME%]", 5);
}
static function monitor(stage, topFPS, pollInterval) {
if (_isPollingFPS) {
stop();
}
if (_isEnabled && (!_fpsMeter)) {
_isPollingFPS = true;
_topFPS = topFPS;
_stage = stage;
_fpsMeter = new com.hexagonstar.util.debug.FPSMeter(_stage, pollInterval);
_fpsMeter.start();
}
}
static function mark(color) {
if (!color) {
color = 16711935 /* 0xFF00FF */;
}
send("onMarker", color, 1, -1);
}
static function stop() {
if (_fpsMeter) {
_isPollingFPS = false;
_fpsMeter.stop();
_fpsMeter = null;
_stage = null;
}
}
static function timerStart(title) {
if (_isEnabled) {
if (!_stopWatch) {
_stopWatch = new com.hexagonstar.util.debug.StopWatch();
}
_stopWatch.start(title);
}
}
static function timerStop() {
if (_stopWatch) {
_stopWatch.stop();
}
}
static function timerReset() {
if (_stopWatch) {
_stopWatch.reset();
}
}
static function timerInMilliSeconds() {
if (_stopWatch) {
trace(_stopWatch.__get__timeInMilliSeconds() + "ms");
}
}
static function timerInSeconds() {
if (_stopWatch) {
trace(_stopWatch.__get__timeInSeconds() + "s");
}
}
static function timerToString() {
if (_stopWatch) {
trace(_stopWatch.toString());
}
}
static function timerStopToString(reset) {
if (_stopWatch) {
_stopWatch.stop();
trace(_stopWatch.toString());
if (reset) {
_stopWatch.reset();
}
}
}
static function get filterLevel() {
return(_filterLevel);
}
static function set filterLevel(v) {
if ((v >= 0) && (v < 5)) {
_filterLevel = v;
}
//return(filterLevel);
}
static function get enabled() {
return(_isEnabled);
}
static function set enabled(v) {
_isEnabled = v;
//return(enabled);
}
static function onFPSUpdate() {
send("onFPS", ((((_fpsMeter.__get__fps() + ",") + _topFPS) + ",") + _fpsMeter.__get__frt()) + ",0");
}
static function onStatus() {
}
static function send(m, d, l, r) {
if (_isEnabled) {
if (!_isConnected) {
_isConnected = true;
_connection = new LocalConnection();
}
if (r == undefined) {
r = 0;
}
var _local2 = 0;
if (typeof(d) == "string") {
_local2 = String(d).length;
} else if (typeof(d) == "object") {
}
if (_local2 > 39000) {
storeDataLSO(m, d);
m = "onLargeData";
d = null;
}
var _local4 = _connection.send("_alcon_lc", m, d, l, r, "");
if (!_local4) {
trace("[%ERR%]");
}
}
}
static function storeDataLSO(m, d) {
var _local1 = SharedObject.getLocal("alcon", "/");
_local1.data.alconMethod = m;
_local1.data.alconData = d;
try {
var _local2 = String(_local1.flush());
if (_local2 == "pending") {
return(undefined);
}
} catch(e:Error) {
}
}
static var LEVEL_DEBUG = 0;
static var LEVEL_INFO = 1;
static var LEVEL_WARN = 2;
static var LEVEL_ERROR = 3;
static var LEVEL_FATAL = 4;
static var _filterLevel = 0;
static var _isConnected = false;
static var _isPollingFPS = false;
static var _isEnabled = true;
static var _topFPS = 25;
}
Symbol 760 MovieClip [__Packages.com.hexagonstar.util.debug.FPSMeter] Frame 0
class com.hexagonstar.util.debug.FPSMeter
{
var _stage, _pollInterval, _isRunning, _intervalID, _fps, _frt, _ms;
function FPSMeter (stage, pollInterval) {
_stage = stage;
_pollInterval = ((!pollInterval) ? 500 : (pollInterval));
reset();
}
function start() {
if (!_isRunning) {
_isRunning = true;
var ref = this;
_intervalID = setInterval(function () {
com.hexagonstar.util.debug.Debug.onFPSUpdate();
}, _pollInterval);
_stage.onEnterFrame = function () {
var _local1 = getTimer();
ref._delay++;
if (ref._delay >= ref._delayMax) {
ref._delay = 0;
ref._fps = (1000 * ref._delayMax) / (_local1 - ref._prev);
ref._prev = _local1;
}
ref._frt = _local1 - ref._ms;
ref._ms = _local1;
};
}
}
function stop() {
if (_isRunning) {
clearInterval(_intervalID);
reset();
}
}
function reset() {
_fps = 0;
_frt = 0;
_ms = 0;
_isRunning = false;
}
function get fps() {
return(_fps);
}
function get frt() {
return(_frt);
}
var _delayMax = 10;
}
Symbol 761 MovieClip [__Packages.com.hexagonstar.util.debug.StopWatch] Frame 0
class com.hexagonstar.util.debug.StopWatch
{
var _title, _startTimeKeys, _stopTimeKeys;
function StopWatch () {
reset();
}
function start(title) {
if (!_started) {
_title = (title ? (title) : "");
_started = true;
_startTimeKeys.push(getTimer());
}
}
function stop() {
if (_started) {
var _local2 = getTimer();
_stopTimeKeys[_startTimeKeys.length - 1] = _local2;
_started = false;
}
}
function reset() {
_startTimeKeys = [];
_stopTimeKeys = [];
_started = false;
}
function toString() {
var _local5 = "\n ********************* [STOPWATCH] *********************";
if (_title != "") {
_local5 = _local5 + ("\n * " + _title);
}
var _local2 = 0;
_local2 = 0;
while (_local2 < _startTimeKeys.length) {
var _local4 = _startTimeKeys[_local2];
var _local3 = _stopTimeKeys[_local2];
_local5 = _local5 + (((((("\n * started [" + format(_local4)) + "ms] stopped [") + format(_local3)) + "ms] time [") + format(_local3 - _local4)) + "ms]");
_local2++;
}
if (_local2 == 0) {
_local5 = _local5 + "\n * never started.";
} else {
_local5 = _local5 + (("\n * total runnning time: " + timeInSeconds) + "s");
}
_local5 = _local5 + "\n *******************************************************";
return(_local5);
}
function get started() {
return(_started);
}
function get timeInMilliSeconds() {
if (_started) {
_stopTimeKeys[_startTimeKeys.length - 1] = getTimer();
}
var _local3 = 0;
var _local2 = 0;
while (_local2 < _startTimeKeys.length) {
_local3 = _local3 + (_stopTimeKeys[_local2] - _startTimeKeys[_local2]);
_local2++;
}
return(_local3);
}
function get timeInSeconds() {
return(timeInMilliSeconds / 1000);
}
function format(v) {
var _local2 = "";
var _local3 = v.toString().length;
var _local1 = 0;
while (_local1 < (5 - _local3)) {
_local2 = _local2 + "0";
_local1++;
}
return(_local2 + v);
}
var _started = false;
}
Symbol 889 Button
on (release) {
_root.beep_s.start(0, 2);
_root.play();
}
Instance of Symbol 881 MovieClip in Symbol 890 MovieClip Frame 1
onClipEvent (mouseDown) {
if ((((_root._xmouse > this._x) && (_root._xmouse < (this._x + this._width))) && (_root._ymouse > this._y)) && (_root._ymouse < (this._y + this._height))) {
_root.getURL("http://www.badhed.com?ref=the-cursed-beneath_SPLASH", "_blank");
}
}
Symbol 890 MovieClip Frame 90
stop();
Symbol 938 MovieClip Frame 1
stop();
Symbol 959 MovieClip Frame 1
function showTooltip(_msg_head, _msg_body) {
tooltip_mc = pathToRoot.attachMovie("tooltip", "tooltip" + pathToRoot.getNextHighestDepth(), pathToRoot.getNextHighestDepth());
tooltip_mc.head_txt.text = _msg_head;
tooltip_mc.body_txt.text = _msg_body;
tooltip_mc.head_txt.autoSize = true;
tooltip_mc.body_txt.autoSize = true;
tooltip_mc.bg_mc._width = 220;
tooltip_mc.head_txt._width = 210;
tooltip_mc.body_txt._width = 210;
var _local2 = tooltip_mc.body_txt._height + 4;
var _local3 = tooltip_mc.body_txt._width + 10;
tooltip_mc.bg_mc._height = _local2;
tooltip_mc._x = -tooltip_mc._width;
tooltip_mc._y = -tooltip_mc._height;
tooltip_mc.onEnterFrame = function () {
this.tempX = pathToRoot._xmouse;
this.tempY = pathToRoot._ymouse;
if ((this.tempX + (tooltip_mc._width / 2)) > gameWidth) {
this._x = gameWidth - tooltip_mc._width;
} else {
this._x = this.tempX - (tooltip_mc._width / 2);
}
if ((this.tempY + tooltip_mc._height) > gameHeight) {
this._y = (this.tempY - tooltip_mc._height) - paddingY;
}
};
}
function hideTooltip() {
delete tooltip_mc.onEnterFrame;
removeMovieClip(tooltip_mc);
}
var pathToRoot = _root;
var tooltip_mc;
var paddingX = 0;
var paddingY = 8;
var gameWidth = 600;
var gameHeight = 480;
stop();
btn2.onRollOver = function () {
if (_parent._parent._currentframe < 90) {
showTooltip("Credits", "- Developed by www.jflashgaming.com \n- Art by Ian Maclean \n- Additional art by M Krein, Thin \n- Audio from Opuzz, EvilDog, Pitx \n- Thanks to Nikki, Brad");
}
};
btn2.onRollOut = (box1_btn.onDragOut = function () {
hideTooltip();
});
btn1.onRollOver = function () {
if (_parent._parent._currentframe < 90) {
showTooltip("Instructions", "- W,S,A,D or Arrow Keys to Move \n- Mouse to shoot \n- 1-8 or Mouse Wheel to change weapons \n- R to reload");
}
};
btn1.onRollOut = (box2_btn.onDragOut = function () {
hideTooltip();
});
btn0.onRelease = function () {
if (_root.hero_lastlevel != "01A") {
gotoAndStop (2);
} else if (_parent._parent._currentframe < 90) {
_parent._parent.gotoAndPlay(90);
}
_root.beep_s.start(0, 2);
};
Symbol 959 MovieClip Frame 2
btn2.onRelease = function () {
gotoAndStop (1);
_root.beep_s.start(0, 2);
};
if (_root.hero_lastlevel == "01A") {
btn1._visible = false;
}
btn1.onRollOver = function () {
if (_parent._parent._currentframe < 90) {
if (_root.hero_lastlevel == "02A") {
showTooltip("Instructions", "1. The Cursed Beneath");
} else if (_root.hero_lastlevel == "03A") {
showTooltip("Instructions", "2. Onward Alone");
} else if (_root.hero_lastlevel == "04A") {
showTooltip("Instructions", "3. They are changing...");
} else if (_root.hero_lastlevel == "05A") {
showTooltip("Instructions", "4. Brute strength");
} else if (_root.hero_lastlevel == "06A") {
showTooltip("Instructions", "5. Alone in the dark");
} else if (_root.hero_lastlevel == "07A") {
showTooltip("Instructions", "6. Too late to turn back");
}
}
};
btn1.onRollOut = (box2_btn.onDragOut = function () {
hideTooltip();
});
btn1.onRelease = function () {
if (_parent._parent._currentframe < 90) {
_parent._parent.gotoAndPlay(90);
}
_root.beep_s.start(0, 2);
};
btn0.onRollOver = function () {
if (_parent._parent._currentframe < 90) {
showTooltip("Instructions", "Start from the beginning with all your weapons. To clear your game data press the delete save button");
}
};
btn0.onRollOut = (box2_btn.onDragOut = function () {
hideTooltip();
});
btn0.onRelease = function () {
if (_parent._parent._currentframe < 90) {
_root.hero_lastlevel = "01A";
_parent._parent.gotoAndPlay(90);
}
_root.beep_s.start(0, 2);
};
Symbol 992 MovieClip Frame 11
stop();
Instance of Symbol 959 MovieClip "buttons" in Symbol 1004 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 992 MovieClip "pressanykey" in Symbol 1004 MovieClip Frame 37
onClipEvent (load) {
if (_parent.desy != _parent.origy) {
this._visible = false;
}
}
Symbol 1004 MovieClip Frame 85
stop();
Symbol 1008 Button
on (press) {
_root.deleteSave();
_parent.updateScore();
}
Symbol 1011 Button
on (release) {
if (_root.global_s.getVolume() == 0) {
_root.global_s.setVolume(80);
} else {
_root.global_s.setVolume(0);
}
updateOptions();
}
Symbol 1012 Button
on (release) {
if (_root.effects) {
_root.effects = false;
} else {
_root.effects = true;
}
updateOptions();
}
Symbol 1013 Button
on (release) {
if (_root.difficultymod == 1) {
_root.difficultymod = 2;
} else if (_root.difficultymod == 2) {
_root.difficultymod = 3;
} else {
_root.difficultymod = 1;
}
updateOptions();
}
Symbol 1017 MovieClip Frame 1
function updateOptions() {
if (_root.global_s.getVolume() == 0) {
txt1.text = "music off";
} else {
txt1.text = "music on";
}
if (_root.effects) {
txt2.text = "effects on";
} else {
txt2.text = "effects off";
}
if (_root.difficultymod == 1) {
txt3.text = "difficulty: easy";
} else if (_root.difficultymod == 2) {
txt3.text = "difficulty: normal";
} else {
txt3.text = "difficulty: hard";
}
}
updateOptions();
Symbol 1020 Button
on (release) {
_root.getURL("http://www.badhed.com?ref=the-cursed-beneath_TITLE", "_blank");
}
Symbol 1022 MovieClip Frame 1
_root.loadGame();
var urlString = _root._url;
if (urlString.indexOf("flashgamelicense.com") == -1) {
}
if (_root.global_s.getVolume() == 5) {
}
Instance of Symbol 1004 MovieClip "title_mc" in Symbol 1022 MovieClip Frame 1
onClipEvent (load) {
this.origy = this._y;
this.desy = this._y;
}
onClipEvent (keyDown) {
this.desy = this.origy + 0.1;
if (this.pressanykey._visible) {
_root.beep_s.start(0, 2);
}
this.pressanykey._visible = false;
this.buttons._visible = true;
}
onClipEvent (mouseDown) {
this.desy = this.origy + 0.1;
if (this.pressanykey._visible) {
_root.beep_s.start(0, 2);
}
this.pressanykey._visible = false;
this.buttons._visible = true;
}
onClipEvent (enterFrame) {
if (this._y < (this.desy - 0.5)) {
this._y++;
} else if (this._y > (this.desy + 0.5)) {
this._y--;
}
}
Instance of Symbol 1017 MovieClip "options_mc" in Symbol 1022 MovieClip Frame 1
onClipEvent (enterFrame) {
if ((_root._xmouse > 500) && (_root._ymouse < 50)) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 1022 MovieClip Frame 89
stop();
Symbol 1022 MovieClip Frame 136
stop();
this.title_mc.buttons.hideTooltip();
_root.gotoAndStop(5);