Frame 1
function sitelock(urls_allowed) {
lock = true;
for (x in urls_allowed) {
if (_url.indexOf(urls_allowed[x]) > 0) {
lock = false;
}
}
if (lock) {
gotoAndStop ("sitelock");
}
return(lock);
}
stop();
_quality = "MEDIUM";
fscommand ("allowscale", "true");
fscommand ("showmenu", "false");
Stage.showMenu = false;
_root.kongregateServices.connect();
var pct = 0;
var pressSpace = true;
var soundOn = true;
startbtn._visible = false;
urls_allowed = ["www.ninjakiwi.com", "www.ninjakiwifiles.com", "Developers"];
startbtn.onRelease = function () {
if (_level0.pct == 100) {
_level0.gotoAndStop("resources");
}
};
_level0.onEnterFrame = function () {
loaderbar.gotoAndStop(pct);
if (_level0.pct < 100) {
_level0.pct = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
var pct_loaded = (Math.round(_level0.pct) + "%");
_level0.startmsg = "Loading... " + pct_loaded;
} else {
_level0.pct = 100;
_level0.startmsg = "Press Spacebar to start!";
startbtn._visible = true;
}
if (Key.isDown(32)) {
if (!pds) {
pds = true;
if (_level0.pct == 100) {
_level0.gotoAndStop("resources");
}
}
} else {
pds = false;
}
};
Frame 2
stop();
_level0.onEnterFrame = function () {
stop();
};
Instance of Symbol 177 MovieClip in Frame 2
on (release) {
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);
}
var vertDropHeroes_Click = "421f93f0";
getURL ("http://www.ninjakiwi.com", "_blank");
__com_mochibot__(vertDropHeroes_Click, this, 10301, true);
}
Frame 3
_level0.onEnterFrame = function () {
stop();
};
function shadeObj(anyped) {
var thisColor1 = new Color(anyped);
var cTransform1 = new Object();
cTransform1 = {ra:"0", rb:"0", ga:"0", gb:"0", ba:"0", bb:"0", aa:"100", ab:"0"};
thisColor1.setTransform(cTransform1);
}
function whiteoutObj(anyped) {
var thisColor1 = new Color(anyped);
var cTransform1 = new Object();
cTransform1 = {ra:"100", rb:"100", ga:"100", gb:"100", ba:"100", bb:"100", aa:"100", ab:"0"};
thisColor1.setTransform(cTransform1);
}
function unshadeObj(anyped) {
var thisColor1 = new Color(anyped);
var cTransform1 = new Object();
cTransform1 = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
thisColor1.setTransform(cTransform1);
}
function makeFade(nextframe) {
if (nextframe != "") {
if (!faded) {
faded = true;
bigfader.nextframe = nextframe;
bigfader.gotoAndPlay("out");
} else {
faded = false;
}
}
}
function clearStage() {
stage.removeMovieClip();
objCount = 0;
propCount = 0;
stage2.attachMovie("stage", "stage", 100);
stage = stage2.stage;
}
function toggleSound() {
if (soundOn) {
soundOn = false;
soundicon.gotoAndStop(2);
gSound = new Sound();
gSound.setVolume(0);
} else {
soundOn = true;
soundicon.gotoAndStop(1);
gSound = new Sound();
gSound.setVolume(100);
}
}
function displayLongTime(seconds) {
var sec = 0;
var min = 0;
var hr = 0;
if (seconds > 0) {
while (seconds >= 60) {
seconds = seconds - 60;
min = min + 1;
}
}
sec = seconds;
if (min > 0) {
while (min >= 60) {
min = min - 60;
hr = hr + 1;
}
}
if (min < 10) {
min = "0" + min;
}
if (sec < 10) {
sec = "0" + sec;
}
return((((hr + ":") + min) + ":") + sec);
}
function dd(ddnum) {
if (ddnum < 10) {
return("0" + ddnum);
}
return(ddnum);
}
function randbtwn(min, max) {
return(mRn(mRd() * (max - min)) + min);
}
function addDialog(dtxt, dchar) {
dialogList.push(dtxt);
dialogChar.push(dchar);
}
function getDialog() {
dialogbox.fulltxt = dialogList.shift();
var dchar = dialogChar.shift();
if (dchar == undefined) {
dialogbox.char = "Dr Frix";
} else {
dialogbox.char = dchar;
}
dialogbox._visible = true;
dialogCount = 0;
}
function checkDialog() {
if ((dialogList.length > 0) && (!dialogbox._visible)) {
getDialog();
}
if (dialogbox.fulltxt != "") {
dialogbox.txt = dialogbox.fulltxt.slice(0, Math.min(dialogCount, dialogbox.fulltxt.length));
dialogCount = dialogCount + 1;
if (dialogCount >= (dialogbox.fulltxt.length + 60)) {
if (dialogList.length > 0) {
getDialog();
} else {
dialogbox.fulltxt = "";
dialogbox._visible = false;
}
}
}
}
function spawnProp(objname, pos_x, pos_y, lyroffset) {
if (propCount == undefined) {
propCount = 0;
}
var objFound = false;
var newObj;
dind = 0;
while (dind <= propCount) {
var tempObj;
tempObj = stage["prop" + dd(dind)];
if (tempObj.isDead) {
objFound = true;
tempObj.removeMovieClip();
stage.attachMovie(objname, "prop" + dd(dind), dind + lyroffset);
var newObj = stage["prop" + dd(dind)];
newObj.isDead = false;
newObj._visible = true;
newObj.defLayer = dind + lyroffset;
newObj.swapDepths(dind + lyroffset);
dind = propCount + 999;
}
dind++;
}
if (!objFound) {
stage.attachMovie(objname, "prop" + dd(propCount), propCount + lyroffset);
var newObj = stage["prop" + dd(propCount)];
newObj.isDead = false;
newObj.index = propCount;
newObj.defLayer = propCount + lyroffset;
propCount = propCount + 1;
}
newObj._x = pos_x;
newObj._y = pos_y;
newObj.objname = objname;
return(newObj);
}
function removeProp(anyobj) {
anyobj.isDead = true;
anyobj._visible = false;
tTiles[anyobj.tilex][anyobj.tiley + dyOffset] = undefined;
if (anyobj.index == (propCount - 1)) {
var obj_c = (propCount - 1);
while (obj_c >= 1) {
var checkObj = stage["prop" + dd(obj_c)];
if (checkObj.isDead) {
removeMovieClip(checkObj);
propCount = propCount - 1;
} else {
obj_c = -1;
}
obj_c--;
}
}
}
function spawnObject(objname, objclass, pos_x, pos_y, lyroffset) {
if (objCount == undefined) {
objCount = 0;
}
var objFound = false;
var newObj;
dind = 0;
while (dind <= objCount) {
var tempObj;
tempObj = stage["obj" + dd(dind)];
if (tempObj.isDead) {
objFound = true;
tempObj.removeMovieClip();
stage.attachMovie(objname, "obj" + dd(dind), dind + lyroffset);
var newObj = stage["obj" + dd(dind)];
newObj.isDead = false;
newObj._visible = true;
newObj.defLayer = dind + lyroffset;
newObj.swapDepths(dind + lyroffset);
dind = objCount + 999;
}
dind++;
}
if (!objFound) {
stage.attachMovie(objname, "obj" + dd(objCount), objCount + lyroffset);
var newObj = stage["obj" + dd(objCount)];
newObj.isDead = false;
newObj.index = objCount;
newObj.defLayer = objCount + lyroffset;
objCount = objCount + 1;
}
newObj._x = pos_x;
newObj._y = pos_y;
newObj.objname = objname;
newObj.objclass = objclass;
newObj.dying = false;
return(newObj);
}
function removeObject(anyobj) {
anyobj.isDead = true;
anyobj._visible = false;
if (anyobj.index == (objCount - 1)) {
var obj_c = (objCount - 1);
while (obj_c >= 1) {
var checkObj = stage["obj" + dd(obj_c)];
if (checkObj.isDead) {
removeMovieClip(checkObj);
objCount = objCount - 1;
} else {
obj_c = -1;
}
obj_c--;
}
}
}
function attachEffect(anyped, effectname) {
if (fxCount == undefined) {
fxCount = 0;
}
stage.attachMovie(effectname, "sfx" + dd(fxCount), fxCount + 60000);
var tmpFx = stage["sfx" + dd(fxCount)];
fxCount = fxCount + 1;
if (fxCount > 20) {
fxCount = 0;
}
tmpFx._x = anyped._x;
tmpFx._y = anyped._y;
tmpFx._rotation = randbtwn(0, 360);
lastFx = tmpFx;
}
function floatWords(anyped, wordtxt) {
if (fxCount == undefined) {
fxCount = 0;
}
stage.attachMovie("floatwords", "sfx" + dd(fxCount), fxCount + 60000);
var tmpFx = stage["sfx" + dd(fxCount)];
tmpFx.word.txt = wordtxt;
fxCount = fxCount + 1;
if (fxCount > 20) {
fxCount = 0;
}
tmpFx._x = anyped._x;
tmpFx._y = anyped._y - 20;
}
function setColor(rClip, rBase, gBase, bBase) {
var R = rBase;
var G = gBase;
var B = bBase;
var Rstr = R.toString(16);
if (R < 16) {
Rstr = "0" + Rstr;
}
var Gstr = G.toString(16);
if (G < 16) {
Gstr = "0" + Gstr;
}
var Bstr = B.toString(16);
if (B < 16) {
Bstr = "0" + Bstr;
}
var colorString = ((Rstr + Gstr) + Bstr);
var colorNumber = parseInt(colorString, 16);
var rColor = new Color(rClip);
rColor.setRGB(colorNumber);
}
function spitOne(anyarray) {
var anyindex = randbtwn(0, anyarray.length - 1);
var anyname = anyarray[anyindex];
anyarray.splice(anyindex, 1);
return(anyname);
}
function fireMissile(anyped, b_rot, b_type, b_hp) {
var newBlt = spawnObject("missile", "missile", anyped._x, anyped._y, 50000);
newBlt.attachMovie("missile_" + b_type, "missile", 0);
newBlt._x = newBlt._x + (12 + (anyped._xscale / 100));
newBlt.hp = 1;
newBlt.unblockable = false;
newBlt.speed = 20;
if (anyped.owner == 2) {
newBlt.speed = 12;
}
if (((b_type == "shuriken") && (anyped.owner != 1)) && (anyped.owner != 3)) {
newBlt.speed = 6;
}
if (((b_type == "fireball") && (anyped.owner != 1)) && (anyped.owner != 3)) {
newBlt.speed = 8;
newBlt.unblockable = true;
} else if (b_type == "familiar") {
newBlt.speed = 10;
} else if (b_type == "scimitar") {
newBlt.speed = 10;
} else if (((b_type == "geyser") && (anyped.owner != 1)) && (anyped.owner != 3)) {
newBlt.speed = 4;
newBlt.unblockable = true;
} else if (b_type == "trunk") {
newBlt.speed = 8;
newBlt.unblockable = true;
} else if (b_type == "snowball") {
newBlt.speed = 8;
newBlt.unblockable = true;
} else if (b_type == "icebolt") {
newBlt.speed = 12;
newBlt.unblockable = true;
} else if (b_type == "shadowbolt") {
newBlt.speed = 10;
newBlt.unblockable = true;
} else if (b_type == "magmaball") {
newBlt.speed = 5;
}
newBlt.owner = anyped.owner;
newBlt._rotation = b_rot;
newBlt.b_type = b_type;
newBlt.hp = b_hp;
if (anyped == eBoss) {
newBlt._x = newBlt._x - ((25 * anyped._xscale) / 100);
newBlt._y = newBlt._y + 25;
}
return(newBlt);
}
mRn = Math.round;
mRd = Math.random;
mSq = Math.sqrt;
mPw = Math.pow;
mMx = Math.max;
mMn = Math.min;
mAt = Math.atan;
mPi = Math.PI;
mSi = Math.sin;
mCo = Math.cos;
mFl = Math.floor;
mAb = Math.abs;
var dialogList = new Array();
var dialogChar = new Array();
var faded = false;
soundicon.onRelease = function () {
soundOn = !soundOn;
if (!soundOn) {
music.gotoAndStop(1);
} else if (gameMode == 1) {
music.gotoAndStop("story");
} else {
music.gotoAndStop("game");
}
};
Frame 4
var nerdook_skip = 0;
var sOption = 1;
var sfxLevel = 3;
var qualityLevel = 2;
_level0.onEnterFrame = function () {
nerdook_skip = nerdook_skip + 1;
if (nerdook_skip >= 80) {
gotoAndStop ("mainmenu");
}
if (Key.isDown(32)) {
if (!pds) {
pds = true;
if (_level0.pct == 100) {
gotoAndStop ("mainmenu");
}
}
} else {
pds = false;
}
};
Instance of Symbol 959 MovieClip in Frame 4
on (release) {
getURL ("http://www.kongregate.com/accounts/nerdook", "_blank");
}
Frame 5
if (sfxLevel == 1) {
optxt1 = "Sounds Off";
gSound = new Sound();
gSound.setVolume(0);
} else {
gSound = new Sound();
gSound.setVolume(100);
if (sfxLevel == 2) {
optxt1 = "SFX only";
} else if (sfxLevel == 3) {
optxt1 = "SFX & Music";
}
}
if (qualityLevel == 1) {
_quality = "LOW";
optxt2 = "Quality: Low";
} else if (qualityLevel == 2) {
_quality = "MEDIUM";
optxt2 = "Quality: Medium";
} else if (qualityLevel == 3) {
_quality = "HIGH";
optxt2 = "Quality: High";
}
btn_quality.onRelease = function () {
qualityLevel = qualityLevel - 1;
if (qualityLevel < 1) {
qualityLevel = 3;
}
if (qualityLevel == 1) {
_quality = "LOW";
optxt2 = "Quality: Low";
} else if (qualityLevel == 2) {
_quality = "MEDIUM";
optxt2 = "Quality: Medium";
} else if (qualityLevel == 3) {
_quality = "HIGH";
optxt2 = "Quality: High";
}
};
btn_sound.onRelease = function () {
if (sfxLevel == 1) {
sfxLevel = 3;
} else {
sfxLevel = 1;
}
if (sfxLevel == 1) {
optxt1 = "Sounds Off";
gSound = new Sound();
gSound.setVolume(0);
} else {
gSound = new Sound();
gSound.setVolume(100);
if (sfxLevel == 2) {
optxt1 = "SFX only";
} else if (sfxLevel == 3) {
optxt1 = "SFX & Music";
}
}
};
function loadData() {
mData = SharedObject.getLocal(g_dataFile);
var arti = 1;
while (arti <= 30) {
if (mData.data["trFound" + dd(arti)] == undefined) {
mData.data["trFound" + dd(arti)] = false;
}
trFound[arti] = mData.data["trFound" + dd(arti)];
arti++;
}
var maski = 1;
while (maski <= 30) {
if (mData.data["maskUnlocked" + dd(maski)] == undefined) {
mData.data["maskUnlocked" + dd(maski)] = false;
}
maskUnlocked[maski] = mData.data["maskUnlocked" + dd(maski)];
maski++;
}
var seli = 1;
while (seli <= 6) {
if (mData.data["selItem" + dd(seli)] == undefined) {
mData.data["selItem" + dd(seli)] = 7;
}
_level0["selItem" + seli] = mData.data["selItem" + dd(seli)];
seli++;
}
var hii = 1;
while (hii <= 5) {
if (mData.data["hScoreTotal" + dd(hii)] == undefined) {
mData.data["hScoreName" + dd(hii)] = "-----";
mData.data["hScoreTotal" + dd(hii)] = 0;
}
hScoreName[hii] = mData.data["hScoreName" + dd(hii)];
hScoreTotal[hii] = mData.data["hScoreTotal" + dd(hii)];
hii++;
}
if (mData.data.survScore == undefined) {
mData.data.survMaxLevel = 0;
mData.data.survName = "-----";
mData.data.survScore = 0;
}
survMaxLevel = mData.data.survMaxLevel;
survName = mData.data.survName;
survScore = mData.data.survScore;
if (mData.data.playerName == undefined) {
mData.data.playerName = _root.kongregateServices.getUsername();
if (mData.data.playerName == undefined) {
mData.data.playerName = "The Hero";
}
}
playerName = mData.data.playerName;
if (mData.data.gameComplete == undefined) {
mData.data.gameComplete = false;
}
gameComplete = mData.data.gameComplete;
if (mData.data.currentMask == undefined) {
mData.data.currentMask = 0;
}
currentMask = mData.data.currentMask;
mData.flush();
}
function saveData() {
mData = SharedObject.getLocal(g_dataFile);
var arti = 1;
while (arti <= 30) {
mData.data["trFound" + dd(arti)] = trFound[arti];
arti++;
}
var maski = 1;
while (maski <= 30) {
mData.data["maskUnlocked" + dd(maski)] = maskUnlocked[maski];
maski++;
}
var seli = 1;
while (seli <= 6) {
mData.data["selItem" + dd(seli)] = _level0["selItem" + seli];
seli++;
}
var hii = 1;
while (hii <= 5) {
mData.data["hScoreName" + dd(hii)] = hScoreName[hii];
mData.data["hScoreTotal" + dd(hii)] = hScoreTotal[hii];
hii++;
}
mData.data.survMaxLevel = survMaxLevel;
mData.data.survName = survName;
mData.data.survScore = survScore;
mData.data.playerName = playerName;
mData.data.gameComplete = gameComplete;
mData.data.currentMask = currentMask;
mData.flush();
}
stop();
var totalgold = 0;
var cIcon = 1;
var lives = 3;
var totalgold = 0;
var keys = 0;
var firstLoad = false;
var survivalMode = false;
var twoPlayer = false;
mainmenutxt = "";
var customHead = 1;
var customBody = 1;
var loseStreak = 0;
var trFound = new Array();
var trName = new Array();
var trDesc = new Array();
var levelsCompleted = 0;
selItem1 = 7;
selItem2 = 7;
selItem3 = 7;
selItem4 = 7;
selItem5 = 7;
maxBosses = 4;
bossNum = randbtwn(1, maxBosses);
prevBossNum = bossNum;
var hintShown = new Array();
trName[0] = "Default";
trDesc[0] = "No Artifact equipped for this hero.";
trName[1] = "Shadow Scimitar";
trDesc[1] = "Barbarian can create Shadow Clones of himself.";
trName[2] = "Berserker Mask";
trDesc[2] = "Barbarian can launch an invulnerable strike that teleports to all nearby enemies.";
trName[3] = "Broadsword";
trDesc[3] = "Barbarian can slice missiles and deflect them back at enemies.";
trName[4] = "Summoned Swords";
trDesc[4] = "Two rotating swords swirl around the barbarian.";
trName[5] = "Bloodlust";
trDesc[5] = "Killing enemies when berserk restores health and gives twice as much gold.";
trName[6] = "Rune of Revenge";
trDesc[6] = "All heroes gain 10 second invulnerability when down to 1 health.";
trName[7] = "Necromancer Robes";
trDesc[7] = "Mages can cast Soul Rip that kills every enemy within sight for an additional 1 gold per enemy.";
trName[8] = "Icicle Staff";
trDesc[8] = "Can turn enemies and normal blocks into smashable ice blocks.";
trName[9] = "Warlock's Familiar";
trDesc[9] = "Explosive familiar that can navigate independently.";
trName[10] = "Staff of Flames";
trDesc[10] = "Greatly increases the power of the Mage's fireball.";
trName[11] = "Sanctuary Staff";
trDesc[11] = "Fully restores hp and breaks every chest in view for 3 seconds.";
trName[12] = "Rune of Energy";
trDesc[12] = "Increases max mana by 15. Blue potions restore 10 mana.";
trName[13] = "Dragonlance Boots";
trDesc[13] = "Stomp affects every tile in view below the paladin.";
trName[14] = "Platemail Armor";
trDesc[14] = "Total invulnerability, but speed and jump height are halved. Can stomp for free.";
trName[15] = "Ironmirror Shield";
trDesc[15] = "Can deflect missiles back at enemies.";
trName[16] = "Chainlink Armor";
trDesc[16] = "Faster speed and jump height, but vulnerable to missiles.";
trName[17] = "Holy Shield";
trDesc[17] = "Gain a shield that acts like an extra hit point.";
trName[18] = "Rune of Endurance";
trDesc[18] = "All heroes will not be lost on damage, as long as they have mana remaining. Costs 5 mana per use.";
trName[19] = "Shadow Arrows";
trDesc[19] = "Arrows can pass through blocks and enemies.";
trName[20] = "Stonebreaker Arrows";
trDesc[20] = "Arrows can shatter a single block on impact.";
trName[21] = "Cleric Robes";
trDesc[21] = "Fires bolts that turn enemies into health potions.";
trName[22] = "Arrows of the Hydra";
trDesc[22] = "Fires 3 normal arrows at a spread angle.";
trName[23] = "Raven Wings";
trDesc[23] = "Enables infinite double jumps! Costs 1 mana per double jump.";
trName[24] = "Rune of Rescue";
trDesc[24] = "Missile weapons can break cages to reveal treasure and gain an additional 3 gold per cage.";
trName[25] = "Assassin's Amulet";
trDesc[25] = "Thief is invulnerable for 2 seconds after Escaping.";
trName[26] = "Wristblade Daggers";
trDesc[26] = "Thief gains a melee attack.";
trName[27] = "Black Shuriken";
trDesc[27] = "Thief loses Escape skill, but gains a missile attack.";
trName[28] = "Pendant of Evasion";
trDesc[28] = "Thief automatically Escapes just before taking damage.";
trName[29] = "Robe of Shadows";
trDesc[29] = "Thief can enter Shadow mode for 5 seconds, gaining 3 gold per second and making all blocks act like normal blocks.";
trName[30] = "Rune of Greed";
trDesc[30] = "All heroes gain 2 additional gold from treasure chest items.";
var bossName = new Array();
bossName[1] = "Flaming Fox";
bossName[2] = "Putrid Pig";
bossName[3] = "Jinxed Jackal";
bossName[4] = "Wicked Walrus";
var tnum = 1;
while (tnum <= 30) {
trFound[tnum] = false;
tnum++;
}
var top_gold = new Array();
top_gold[1] = 0;
top_gold[2] = 0;
top_gold[3] = 0;
top_gold[4] = 0;
var dead_heroes = new Array();
var dead_location = new Array();
var dead_method = new Array();
var dead_selItem1 = new Array();
var dead_selItem2 = new Array();
var dead_selItem3 = new Array();
var dead_selItem4 = new Array();
var dead_selItem5 = new Array();
var deadHero;
var deadLoc;
var deadMethod;
var tIcon = new Array();
var tWalk1 = new Array();
var tWalk2 = new Array();
var tWalk3 = new Array();
var tWalk4 = new Array();
var tDecor = new Array();
var tBlockNum = new Array();
var tMainLine = new Array();
desertX = randbtwn(2, 4);
desertY = randbtwn(2, 4);
templeX1 = randbtwn(1, 3);
templeY1 = randbtwn(1, 3);
templeX2 = randbtwn(4, 6);
templeY2 = randbtwn(1, 3);
templeX3 = randbtwn(1, 3);
templeY3 = randbtwn(4, 6);
templeX4 = randbtwn(4, 6);
templeY4 = randbtwn(4, 6);
var templeX = new Array();
var templeY = new Array();
castleX = 6;
mapCurX = 1;
if (randbtwn(1, 10) <= 5) {
mapCurX = 6;
castleX = 1;
}
castleY = 6;
mapCurY = 1;
if (randbtwn(1, 10) <= 5) {
mapCurY = 6;
castleY = 1;
}
var wmx = 1;
while (wmx <= 6) {
tIcon[wmx] = new Array();
tWalk1[wmx] = new Array();
tWalk2[wmx] = new Array();
tWalk3[wmx] = new Array();
tWalk4[wmx] = new Array();
tDecor[wmx] = new Array();
tBlockNum[wmx] = new Array();
tMainLine[wmx] = new Array();
var wmy = 1;
while (wmy <= 6) {
tIcon[wmx][wmy] = 1;
tBlockNum[wmx][wmy] = 0;
if ((wmx == templeX1) && (wmy == templeY1)) {
tIcon[wmx][wmy] = 2;
} else if ((wmx == templeX2) && (wmy == templeY2)) {
tIcon[wmx][wmy] = 2;
} else if ((wmx == templeX3) && (wmy == templeY3)) {
tIcon[wmx][wmy] = 2;
} else if ((wmx == templeX4) && (wmy == templeY4)) {
tIcon[wmx][wmy] = 2;
} else if (((((wmx >= desertX) && (wmx < (desertX + 3))) && (wmy >= desertY)) && (wmy < (desertY + 3))) && (randbtwn(1, 10) <= 7)) {
tIcon[wmx][wmy] = 3;
}
tWalk1[wmx][wmy] = true;
if (randbtwn(2, 3) == 3) {
tWalk1[wmx][wmy] = false;
}
tWalk2[wmx][wmy] = true;
if (randbtwn(2, 3) == 3) {
tWalk2[wmx][wmy] = false;
}
tWalk3[wmx][wmy] = true;
if (randbtwn(2, 3) == 3) {
tWalk3[wmx][wmy] = false;
}
tWalk4[wmx][wmy] = true;
if (randbtwn(2, 3) == 3) {
tWalk4[wmx][wmy] = false;
}
if ((wmx == castleX) && (wmy == castleY)) {
tIcon[wmx][wmy] = 2;
}
if (tIcon[wmx][wmy] == 2) {
tBlockNum[wmx][wmy] = -1;
templeX.push(wmx);
templeY.push(wmy);
if (!tWalk1[wmx][wmy]) {
if (!tWalk2[wmx][wmy]) {
if (!tWalk3[wmx][wmy]) {
if (!tWalk4[wmx][wmy]) {
randblock = randbtwn(1, 4);
_level0["tWalk" + randblock][wmx][wmy] = true;
}
}
}
}
}
tDecor[wmx][wmy] = 1;
if (randbtwn(1, 10) <= 5) {
if (tIcon[wmx][wmy] == 1) {
tDecor[wmx][wmy] = randbtwn(2, 3);
} else if (tIcon[wmx][wmy] == 3) {
tDecor[wmx][wmy] = randbtwn(6, 7);
} else if (tIcon[wmx][wmy] == 4) {
tDecor[wmx][wmy] = randbtwn(10, 11);
}
}
wmy++;
}
wmx++;
}
var levelsPlaced = 0;
while (levelsPlaced < 8) {
randx = randbtwn(1, 6);
randy = randbtwn(1, 6);
if (tBlockNum[randx][randy] == 0) {
if (!((randx == 1) && (randy == 1))) {
if (!((randx == 1) && (randy == 6))) {
if (!((randx == 6) && (randy == 1))) {
if (!((randx == 6) && (randy == 6))) {
levelsPlaced = levelsPlaced + 1;
tBlockNum[randx][randy] = 10;
templeX.push(randx);
templeY.push(randy);
if (tIcon[randx][randy] == 1) {
if (levelsPlaced < 4) {
tIcon[randx][randy] = 4;
tDecor[randx][randy] = randbtwn(10, 11);
} else if (levelsPlaced < 6) {
tIcon[randx][randy] = 5;
tDecor[randx][randy] = 99;
}
}
}
}
}
}
}
}
tIcon[mapCurX][mapCurY] = 1;
tBlockNum[mapCurX][mapCurY] = 0;
if ((mapCurX == 1) && (mapCurY == 1)) {
startX = 2;
startY = 1;
} else if ((mapCurX == 6) && (mapCurY == 1)) {
startX = 6;
startY = 2;
} else if ((mapCurX == 6) && (mapCurY == 6)) {
startX = 5;
startY = 6;
} else if ((mapCurX == 1) && (mapCurY == 6)) {
startX = 1;
startY = 5;
}
castleReached = false;
while (!castleReached) {
if (randbtwn(1, 10) <= 5) {
if (startX < castleX) {
tWalk2[startX][startY] = true;
tWalk4[startX + 1][startY] = true;
startX = startX + 1;
} else if (startX > castleX) {
tWalk4[startX][startY] = true;
tWalk2[startX - 1][startY] = true;
startX = startX - 1;
}
} else if (startY < castleY) {
tWalk3[startX][startY] = true;
tWalk1[startX][startY + 1] = true;
startY = startY + 1;
} else if (startY > castleY) {
tWalk1[startX][startY] = true;
tWalk3[startX][startY - 1] = true;
startY = startY - 1;
}
tMainLine[startX][startY] = true;
if (startX == castleX) {
if (startY == castleY) {
castleReached = true;
}
}
}
while (templeX.length > 0) {
thisTempleX = templeX.shift();
thisTempleY = templeY.shift();
startTempleX = thisTempleX;
startTempleY = thisTempleY;
mainLineReached = false;
while (!mainLineReached) {
if (randbtwn(1, 10) <= 5) {
if (startTempleX <= 3) {
tWalk2[thisTempleX][thisTempleY] = true;
tWalk4[thisTempleX + 1][thisTempleY] = true;
thisTempleX = thisTempleX + 1;
} else {
tWalk4[thisTempleX][thisTempleY] = true;
tWalk2[thisTempleX - 1][thisTempleY] = true;
thisTempleX = thisTempleX - 1;
}
} else if (startTempleY <= 3) {
tWalk3[thisTempleX][thisTempleY] = true;
tWalk1[thisTempleX][thisTempleY + 1] = true;
thisTempleY = thisTempleY + 1;
} else {
tWalk1[thisTempleX][thisTempleY] = true;
tWalk3[thisTempleX][thisTempleY - 1] = true;
thisTempleY = thisTempleY - 1;
}
if (thisTempleY == 1) {
startTempleY = 1;
} else if (thisTempleY == 6) {
startTempleY = 6;
}
if (thisTempleX == 1) {
startTempleX = 1;
} else if (thisTempleX == 6) {
startTempleX = 6;
}
if (tMainLine[thisTempleX][thisTempleY]) {
mainLineReached = true;
}
tMainLine[thisTempleX][thisTempleY] = true;
}
}
if ((mapCurX == 1) && (mapCurY == 1)) {
tWalk2[1][1] = true;
tWalk3[1][1] = false;
tIcon[2][1] = 1;
tBlockNum[2][1] = 13;
tWalk4[2][1] = true;
tWalk3[2][1] = true;
} else if ((mapCurX == 6) && (mapCurY == 1)) {
tWalk3[6][1] = true;
tWalk4[6][1] = false;
tIcon[6][2] = 1;
tBlockNum[6][2] = 13;
tWalk1[6][2] = true;
tWalk4[6][2] = true;
} else if ((mapCurX == 6) && (mapCurY == 6)) {
tWalk4[6][6] = true;
tWalk1[6][6] = false;
tIcon[5][6] = 1;
tBlockNum[5][6] = 13;
tWalk2[5][6] = true;
tWalk1[5][6] = true;
} else if ((mapCurX == 1) && (mapCurY == 6)) {
tWalk1[1][6] = true;
tWalk2[1][6] = false;
tIcon[1][5] = 1;
tBlockNum[1][5] = 13;
tWalk3[1][5] = true;
tWalk2[1][5] = true;
}
prevCurX = mapCurX;
prevCurY = mapCurY;
var hScoreName = new Array();
var hScoreTotal = new Array();
hScoreName[1] = "-----";
hScoreName[2] = "-----";
hScoreName[3] = "-----";
hScoreName[4] = "-----";
hScoreName[5] = "-----";
hScoreTotal[1] = 0;
hScoreTotal[2] = 0;
hScoreTotal[3] = 0;
hScoreTotal[4] = 0;
hScoreTotal[5] = 0;
var survMaxLevel = 0;
var survName = "-----";
var survScore = 0;
var maskUnlocked = new Array();
var maskNew = new Array();
maskUnlocked[0] = true;
currentMask = 0;
g_dataFile = "g_data";
loadData();
survivalMode = false;
survivalRounds = 0;
words.gotoAndStop(sOption);
mainmenuDesc = new Array();
mainmenuDesc[1] = "Starts a new Story Mode!";
mainmenuDesc[2] = "Modify game options from here";
mainmenuDesc[3] = "How long can your hero survive?";
mainmenuDesc[4] = "Play a game with a friend or AI";
mainmenuDesc[5] = "View the high score table";
mainmenuDesc[6] = "Browse through unlocked Masks";
mainmenuDesc[7] = "A short note from the developer";
mainmenuDesc[8] = "Play more games from our sponsors!";
mainmenutxt = mainmenuDesc[sOption];
_level0.onEnterFrame = function () {
if (Key.isDown(13)) {
Selection.setFocus("_level0.hiddenbox");
}
if (Selection.getFocus() != "_level0.pnamebox") {
instructions = "Type your name here and press Enter";
pnamebox._alpha = 50;
words._alpha = 100;
backdrop._alpha = 100;
if (Key.isDown(38) || (Key.isDown(87))) {
if (!pdu) {
pdu = true;
sOption = sOption - 1;
if (sOption < 1) {
sOption = 8;
}
mainmenutxt = mainmenuDesc[sOption];
words.gotoAndStop(sOption);
}
} else {
pdu = false;
}
if (Key.isDown(40) || (Key.isDown(83))) {
if (!pdd) {
pdd = true;
sOption = sOption + 1;
if (sOption > 8) {
sOption = 1;
}
mainmenutxt = mainmenuDesc[sOption];
words.gotoAndStop(sOption);
}
} else {
pdd = false;
}
if (Key.isDown(32)) {
if (!pds) {
pds = true;
saveData();
if (sOption == 1) {
makeFade("comic_opening");
survivalMode = false;
firstLoad = true;
} else if (sOption == 2) {
makeFade("options");
} else if (sOption == 3) {
survivalMode = true;
lives = 0;
makeFade("survival");
} else if (sOption == 4) {
twoPlayer = true;
lives = 3;
p1medals = 0;
p2medals = 0;
makeFade("2player");
} else if (sOption == 5) {
makeFade("highscore");
} else if (sOption == 6) {
makeFade("medals");
} else if (sOption == 7) {
makeFade("developer");
} else if (sOption == 8) {
var vertDropHeroes_Click = "421f93f0";
getURL ("http://www.ninjakiwi.com", "_blank");
__com_mochibot__(vertDropHeroes_Click, this, 10301, true);
}
}
} else {
pds = false;
}
} else {
instructions = "Press Enter when done typing!";
pnamebox._alpha = 100;
words._alpha = 50;
backdrop._alpha = 50;
}
};
Frame 6
hero.head.gotoAndStop(currentMask + 1);
_level0.onEnterFrame = function () {
if (Key.isDown(32)) {
if (!pds) {
pds = true;
makeFade("chaptermenu");
}
} else {
pds = false;
}
if (Key.isDown(81)) {
if (!pdq) {
pdq = true;
heroDead = true;
gotoAndStop ("mainmenu");
}
} else {
pdq = false;
}
};
Frame 7
goldDisplay = ("x " + mRn(totalgold)) + " gp";
lifeDisplay = "x " + lives;
keyDisplay = "x " + keys;
mapDestTile = _level0[(("x" + mapCurX) + "y") + mapCurY];
pchar_map._x = mapDestTile._x;
pchar_map._y = mapDestTile._y;
var levelLoad = false;
var loadCD = 0;
var numTemples = 0;
warning = "";
if (heroDead) {
mapDestTile = prevTile;
mapCurX = prevCurX;
mapCurY = prevCurY;
attachEffect(pchar_map, "effect_ninjasmoke");
} else {
attachEffect(pchar_map, "effect_ninjasmoke");
tBlockNum[mapCurX][mapCurY] = 0;
}
var wmx = 1;
while (wmx <= 6) {
var wmy = 1;
while (wmy <= 6) {
var mapTile = _level0[(("x" + wmx) + "y") + wmy];
mapTile.cIcon = tIcon[wmx][wmy];
mapTile.mapType = tBlockNum[wmx][wmy];
mapTile.tWalk1 = tWalk1[wmx][wmy];
mapTile.tWalk2 = tWalk2[wmx][wmy];
mapTile.tWalk3 = tWalk3[wmx][wmy];
mapTile.tWalk4 = tWalk4[wmx][wmy];
wmy++;
}
wmx++;
}
var wmx = 1;
while (wmx <= 6) {
var wmy = 1;
while (wmy <= 6) {
var mapTile = _level0[(("x" + wmx) + "y") + wmy];
mapTile.decor.gotoAndStop(tDecor[wmx][wmy]);
mapTile.mid.gotoAndStop(mapTile.cIcon);
mapTile.side1.gotoAndStop(mapTile.cIcon);
mapTile.side2.gotoAndStop(mapTile.cIcon);
mapTile.side3.gotoAndStop(mapTile.cIcon);
mapTile.side4.gotoAndStop(mapTile.cIcon);
mapTile.corner1.gotoAndStop(mapTile.cIcon);
mapTile.corner2.gotoAndStop(mapTile.cIcon);
mapTile.corner3.gotoAndStop(mapTile.cIcon);
mapTile.corner4.gotoAndStop(mapTile.cIcon);
var tTile = new Array();
tTile[1] = _level0[(("x" + wmx) + "y") + mRn(wmy - 1)];
tTile[2] = _level0[(("x" + mRn(wmx + 1)) + "y") + wmy];
tTile[3] = _level0[(("x" + wmx) + "y") + mRn(wmy + 1)];
tTile[4] = _level0[(("x" + mRn(wmx - 1)) + "y") + wmy];
var ctl = 1;
while (ctl <= 4) {
if (tTile[ctl].cIcon != mapTile.cIcon) {
mapTile["side" + ctl].wiggle._visible = true;
} else {
mapTile["side" + ctl].wiggle._visible = false;
}
comp1 = ctl;
comp2 = ctl - 1;
if (comp2 < 1) {
comp2 = 4;
}
if ((tTile[comp1].cIcon != mapTile.cIcon) && (tTile[comp2].cIcon != mapTile.cIcon)) {
mapTile["corner" + ctl].wiggle.gotoAndStop(1);
} else if ((tTile[comp1].cIcon != mapTile.cIcon) && (tTile[comp2].cIcon == mapTile.cIcon)) {
mapTile["corner" + ctl].wiggle.gotoAndStop(2);
}
if ((tTile[comp1].cIcon == mapTile.cIcon) && (tTile[comp2].cIcon != mapTile.cIcon)) {
mapTile["corner" + ctl].wiggle.gotoAndStop(3);
} else if ((tTile[comp1].cIcon == mapTile.cIcon) && (tTile[comp2].cIcon == mapTile.cIcon)) {
mapTile["corner" + ctl].wiggle.gotoAndStop(4);
}
comp3 = ctl + 2;
if (comp3 > 4) {
comp3 = comp3 - 4;
}
if (tTile[ctl]["tWalk" + comp3] && (mapTile["tWalk" + ctl])) {
mapTile["road" + ctl]._visible = true;
} else {
mapTile["road" + ctl]._visible = false;
}
ctl++;
}
var noRoads = false;
if (mapTile.road1._visible == false) {
if (mapTile.road2._visible == false) {
if (mapTile.road3._visible == false) {
if (mapTile.road4._visible == false) {
mapTile.roadmid.gotoAndStop(10);
noRoads = true;
}
}
}
}
if (!noRoads) {
if (tBlockNum[wmx][wmy] != 0) {
mapTile.roadmid.gotoAndStop(mapTile.cIcon + 1);
if (mapTile.cIcon == 2) {
numTemples = numTemples + 1;
}
} else if (mapTile.cIcon == 2) {
mapTile.mid.gotoAndStop(10);
mapTile.side1.gotoAndStop(10);
mapTile.side2.gotoAndStop(10);
mapTile.side3.gotoAndStop(10);
mapTile.side4.gotoAndStop(10);
mapTile.corner1.gotoAndStop(10);
mapTile.corner2.gotoAndStop(10);
mapTile.corner3.gotoAndStop(10);
mapTile.corner4.gotoAndStop(10);
}
}
wmy++;
}
wmx++;
}
var kingBanter = new Array();
kingBanter[1] = "You seem to be doing very well for a man of your abilities!";
kingBanter[2] = "What's taking so long? Other heroes are racing their way up the high score table, you know!";
kingBanter[3] = "Keep trying, and one day you might succeed.";
kingBanter[4] = "Look behind you, it's a three headed monkey!";
desctxt = kingBanter[randbtwn(1, kingBanter.length - 1)];
kingie.top.body.head.attachMovie("h_012", "head", 10);
kingie.top.body.body.attachMovie("b_012", "body", 10);
kingie.top.body.arm.arm1.attachMovie("at_012", "arm", 10);
kingie.top.body.arm.arm2.attachMovie("ab_012", "arm", 10);
lockSelItem1 = selItem1;
lockSelItem2 = selItem2;
lockSelItem3 = selItem3;
lockSelItem4 = selItem4;
lockSelItem5 = selItem5;
dh = 0;
while (dh <= 9) {
if (dead_heroes[dh] != undefined) {
selItem1 = dead_selItem1[dh];
selItem2 = dead_selItem2[dh];
selItem3 = dead_selItem3[dh];
selItem4 = dead_selItem4[dh];
selItem5 = dead_selItem5[dh];
var thisBody = bodypile.attachMovie("char_body" + dead_method[dh], "c" + dh, dh + 10);
dressHero(thisBody, dead_heroes[dh]);
thisBody._x = 100 + (dead_location[dh] % 25);
if (dead_method[dh] == 1) {
thisBody._rotation = (90 + (((dead_location[dh] % 10) / 9) * 10)) - 5;
} else if (dead_method[dh] == 2) {
thisBody._rotation = (-90 + (((dead_location[dh] % 10) / 9) * 10)) - 5;
}
thisBody._y = -25 * dh;
}
dh++;
}
selItem1 = lockSelItem1;
selItem2 = lockSelItem2;
selItem3 = lockSelItem3;
selItem4 = lockSelItem4;
selItem5 = lockSelItem5;
princessDisplay = "x " + numTemples;
_level0.onEnterFrame = function () {
if (pchar_map._x != mapDestTile._x) {
if (pchar_map._x < (mapDestTile._x - 5)) {
pchar_map._x = pchar_map._x + 10;
} else if (pchar_map._x > (mapDestTile._x + 5)) {
pchar_map._x = pchar_map._x - 10;
} else {
pchar_map._x = mapDestTile._x;
}
}
if (pchar_map._y != mapDestTile._y) {
if (pchar_map._y < (mapDestTile._y - 5)) {
pchar_map._y = pchar_map._y + 10;
} else if (pchar_map._y > (mapDestTile._y + 5)) {
pchar_map._y = pchar_map._y - 10;
} else {
pchar_map._y = mapDestTile._y;
}
}
if ((pchar_map._x == mapDestTile._x) && (pchar_map._y == mapDestTile._y)) {
if ((tBlockNum[mapCurX][mapCurY] != 0) && (!levelLoad)) {
levelLoad = true;
}
}
if (levelLoad) {
loadCD = loadCD + 1;
if (loadCD == 10) {
makeFade("treasure");
}
}
mapDestTile = _level0[(("x" + mapCurX) + "y") + mapCurY];
if (mapDestTile.cIcon != undefined) {
cIcon = mapDestTile.cIcon;
cMapType = mapDestTile.mapType;
}
if (Key.isDown(38) || (Key.isDown(87))) {
if (!pdu) {
pdu = true;
if (((pchar_map._x == mapDestTile._x) && (pchar_map._y == mapDestTile._y)) && (!levelLoad)) {
var tempTile = _level0[(("x" + mapCurX) + "y") + (mapCurY - 1)];
if (((tempTile.cIcon == 2) && (keys < 1)) && (tBlockNum[mapCurX][mapCurY - 1] != 0)) {
warning = "You need a Key!";
} else if ((mapCurY > 1) && (mapDestTile.road1._visible)) {
prevTile = mapDestTile;
prevCurX = mapCurX;
prevCurY = mapCurY;
mapCurY = mapCurY - 1;
warning = "";
}
}
refreshIcons();
}
} else {
pdu = false;
}
if (Key.isDown(40) || (Key.isDown(83))) {
if (!pdd) {
pdd = true;
if (((pchar_map._x == mapDestTile._x) && (pchar_map._y == mapDestTile._y)) && (!levelLoad)) {
var tempTile = _level0[(("x" + mapCurX) + "y") + (mapCurY + 1)];
if (((tempTile.cIcon == 2) && (keys < 1)) && (tBlockNum[mapCurX][mapCurY + 1] != 0)) {
warning = "You need a Key!";
} else if ((mapCurY < 6) && (mapDestTile.road3._visible)) {
prevTile = mapDestTile;
prevCurX = mapCurX;
prevCurY = mapCurY;
mapCurY = mapCurY + 1;
warning = "";
}
}
refreshIcons();
}
} else {
pdd = false;
}
if (Key.isDown(37) || (Key.isDown(65))) {
if (!pdl) {
pdl = true;
if (((pchar_map._x == mapDestTile._x) && (pchar_map._y == mapDestTile._y)) && (!levelLoad)) {
var tempTile = _level0[(("x" + (mapCurX - 1)) + "y") + mapCurY];
if (((tempTile.cIcon == 2) && (keys < 1)) && (tBlockNum[mapCurX - 1][mapCurY] != 0)) {
warning = "You need a Key!";
} else if ((mapCurX > 1) && (mapDestTile.road4._visible)) {
prevTile = mapDestTile;
prevCurX = mapCurX;
prevCurY = mapCurY;
mapCurX = mapCurX - 1;
warning = "";
}
}
refreshIcons();
}
} else {
pdl = false;
}
if (Key.isDown(39) || (Key.isDown(68))) {
if (!pdt) {
pdt = true;
if (((pchar_map._x == mapDestTile._x) && (pchar_map._y == mapDestTile._y)) && (!levelLoad)) {
var tempTile = _level0[(("x" + (mapCurX + 1)) + "y") + mapCurY];
if (((tempTile.cIcon == 2) && (keys < 1)) && (tBlockNum[mapCurX + 1][mapCurY] != 0)) {
warning = "You need a Key!";
} else if ((mapCurX < 6) && (mapDestTile.road2._visible)) {
prevTile = mapDestTile;
prevCurX = mapCurX;
prevCurY = mapCurY;
mapCurX = mapCurX + 1;
warning = "";
}
}
refreshIcons();
}
} else {
pdt = false;
}
if (Key.isDown(81)) {
if (!pdq) {
pdq = true;
heroDead = true;
gotoAndStop ("mainmenu");
}
} else {
pdq = false;
}
};
Frame 8
function refreshAllRows() {
var inum = 1;
while (inum <= 5) {
var invRow = slide["row" + inum];
var itnum = 1;
while (itnum <= 7) {
invItem = invRow["item" + itnum];
invIndex = itnum + ((inum - 1) * 6);
if (itnum == invRow.selItem) {
invItem._alpha = 100;
if (inum == activeRow) {
invbox._y = (invItem._y + invRow._y) + slide._y;
if (trFound[invIndex]) {
invbox.title = trName[invIndex];
invbox.desc = trDesc[invIndex];
_level0["selItem" + inum] = invRow.selItem;
} else {
invbox.title = "???";
invbox.desc = "You haven't found this Artifact yet! Explore more Temples.";
_level0["selItem" + inum] = 7;
}
}
} else {
invItem._alpha = 50;
}
if (trFound[invIndex]) {
invItem.gotoAndStop(invIndex);
} else {
invItem.gotoAndStop(31);
}
if (itnum == 7) {
invItem.gotoAndStop(32);
if ((inum == activeRow) && (itnum == invRow.selItem)) {
invbox.title = "None";
invbox.desc = "No special bonus for this character!";
}
}
invRow.selectbox._x = invRow["item" + invRow.selItem]._x;
invRow.selectbox._y = invRow["item" + invRow.selItem]._y;
itnum++;
}
inum++;
}
}
goldDisplay = ("x " + mRn(totalgold)) + " gp";
lifeDisplay = "x " + lives;
slide.row0.head.gotoAndStop(currentMask + 1);
var inum = 1;
while (inum <= 5) {
var invRow = slide["row" + inum];
invRow.selItem = _level0["selItem" + inum];
inum++;
}
activeRow = 0;
refreshAllRows();
_level0.onEnterFrame = function () {
var rnum = 0;
while (rnum <= 6) {
var inventoryRow = slide["row" + rnum];
if (rnum == activeRow) {
inventoryRow._alpha = 100;
} else {
inventoryRow._alpha = 25;
}
rnum++;
}
if ((activeRow >= 1) && (activeRow <= 5)) {
invbox._visible = true;
} else {
invbox._visible = false;
}
if (Key.isDown(38) || (Key.isDown(87))) {
if (!pd4d) {
pd4d = true;
activeRow = activeRow - 1;
if (activeRow < 0) {
activeRow = 6;
}
refreshAllRows();
}
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (!pd4d) {
pd4d = true;
activeRow = activeRow + 1;
if (activeRow > 6) {
activeRow = 0;
}
refreshAllRows();
}
} else if (Key.isDown(39) || (Key.isDown(68))) {
if (!pd4d) {
pd4d = true;
var invRow = slide["row" + activeRow];
if (activeRow == 0) {
var maskFound = false;
while (!maskFound) {
currentMask = currentMask + 1;
if (currentMask > 25) {
currentMask = 0;
}
if (maskUnlocked[currentMask]) {
maskFound = true;
}
}
invRow.head.gotoAndStop(currentMask + 1);
} else {
invRow.selItem = invRow.selItem + 1;
if (invRow.selItem > 7) {
invRow.selItem = 1;
}
}
refreshAllRows();
}
} else if (Key.isDown(37) || (Key.isDown(65))) {
if (!pd4d) {
pd4d = true;
var invRow = slide["row" + activeRow];
if (activeRow == 0) {
var maskFound = false;
while (!maskFound) {
currentMask = currentMask - 1;
if (currentMask < 0) {
currentMask = 25;
}
if (maskUnlocked[currentMask]) {
maskFound = true;
}
}
invRow.head.gotoAndStop(currentMask + 1);
} else {
invRow.selItem = invRow.selItem - 1;
if (invRow.selItem < 1) {
invRow.selItem = 7;
}
}
refreshAllRows();
}
} else {
pd4d = false;
}
if (Key.isDown(32)) {
if (!pds) {
pds = true;
if (activeRow == 6) {
if (firstLoad) {
firstLoad = false;
gotoAndStop ("instructions");
} else {
gotoAndStop ("faux_loading");
}
} else {
activeRow = 6;
}
}
} else {
pds = false;
}
if (Key.isDown(81)) {
if (!pdq) {
pdq = true;
heroDead = true;
if (!survivalMode) {
gotoAndStop ("chaptermenu");
} else {
gotoAndStop ("mainmenu");
}
}
} else {
pdq = false;
}
};
Frame 9
var load_time = 0;
var loadText = new Array();
var thisText = 0;
loadText[0] = "Loading level...";
loadText[1] = "Clearing cache...";
loadText[2] = "Generating world...";
loadText[3] = "Recalculating terrain...";
loadText[4] = "Loading variables...";
loadText[5] = "Game loaded!";
loadtxt = "Loading...";
_level0.onEnterFrame = function () {
load_time = load_time + 1;
if ((load_time % 5) == 0) {
thisText = thisText + 1;
loadtxt = loadText[thisText];
}
if (load_time >= 30) {
gotoAndStop ("game_main");
}
};
Frame 10
function checkStrike(anytarget, anyped) {
if ((anyped.omniStrike > 0) && (anyped.omniCool == 0)) {
anyped.omniStrike = anyped.omniStrike - 1;
anyped.omniCool = 5;
attachEffect(anyped, "effect_ninjasmoke");
anyped.x = (anytarget.xloc * 50) + 25;
anyped.y = (anytarget.yloc * 50) + 25;
attachEffect(anyped, "effect_ninjasmoke");
floatWords(anyped, "strike!");
anyped.jump = true;
anyped.ymove = 3;
anyped._x = anyped.x;
anyped._y = anyped.y;
anyped.berserk = true;
attachEffect(anyped, "ring_red");
anyped.hit = 30;
anyped.cd_anim = 10;
anyped.container.attachMovie("effect_berserk", "effect", 0);
if (anytarget == eBoss) {
bossHit(1);
} else {
attachEffect(anytarget, "effect_slash");
anyped.gold = anyped.gold + anytarget.bounty;
killEnemy(anytarget);
}
}
}
function checkHint(hintnum) {
if (!hintShown[hintnum]) {
hintShown[hintnum] = true;
return(true);
}
return(false);
}
function unlockMask(maskNum) {
if (!maskUnlocked[maskNum]) {
unlockedMask = true;
maskUnlocked[maskNum] = true;
maskNew[maskNum] = true;
}
}
function killEnemy(anyped) {
noKills = false;
enemiesKilled = enemiesKilled + 1;
attachEffect(anyped, "fx_explosion");
gold = gold + anyped.bounty;
floatWords(anyped, ("+" + anyped.bounty) + " gp!");
snd_poof.start();
if (anyped.c_type == "shade") {
shadeNum = shadeNum - 1;
}
removeObject(anyped);
}
function addTip(anytip, anyhero) {
if ((!survivalMode) && (!twoPlayer)) {
tipshow = 200;
tipbox.txt = anytip;
if (anyhero != "") {
dressHero(tipbox.char, anyhero);
}
}
}
function breakBlock(anytile) {
tBlocked[anytile.tilex][anytile.tiley + dyOffset] = false;
if ((anytile.tileType == "ice") || (anytile.tileType == "icicle")) {
attachEffect(anytile, "fx_iceexplosion");
snd_glass.start();
smashIce = smashIce + 1;
} else if (anytile.tileType == "bossgold") {
attachEffect(anytile, "fx_goldexplosion");
} else {
attachEffect(anytile, "fx_bigexplosion");
}
if (anytile.tileType == "normal") {
snd_pop.start();
smashBlock = smashBlock + 1;
}
lastFx._x = lastFx._x + 25;
anytile.tileType = "";
removeProp(anytile);
limboBlock = limboBlock + 1;
}
function bossHit(dmg) {
if (eBoss.hit == 0) {
eBoss.hp = eBoss.hp - dmg;
eBoss.hit = 60;
attachEffect(eBoss, "effect_ninjasmoke");
snd_poof.start();
var stype = randbtwn(1, 10);
if ((stype <= 2) && (pchar.hp < hpmax)) {
spawnPickup("redpotion", eBoss.xloc, eBoss.yloc);
} else if ((stype <= 4) && (pchar.mana <= (pchar.maxMana - 5))) {
spawnPickup("manapotion", eBoss.xloc, eBoss.yloc);
} else if (stype == 5) {
spawnPickup("gem_green", eBoss.xloc, eBoss.yloc);
} else if (stype == 6) {
spawnPickup("gem_blue", eBoss.xloc, eBoss.yloc);
} else if (stype == 7) {
spawnPickup("gem_red", eBoss.xloc, eBoss.yloc);
} else {
spawnPickup("goldcoins", eBoss.xloc, eBoss.yloc);
}
if (eBoss.hp <= 0) {
snd_pop.start();
attachEffect(eBoss, "fx_explosion");
gold = gold + eBoss.bounty;
floatWords(pchar, ("DEMON KILL! +" + eBoss.bounty) + " gp!");
removeObject(eBoss);
snd_cash.start();
eBoss = undefined;
} else if (eBoss._xscale == 100) {
eBoss._xscale = -100;
eBoss.x = 450;
} else {
eBoss._xscale = 100;
eBoss.x = 100;
}
}
}
function makePickup(anytile) {
var stype = randbtwn(1, 10);
if ((stype <= 2) && (pchar.hp < hpmax)) {
spawnPickup("redpotion", anytile.tilex, anytile.tiley + 1);
} else if ((stype <= 4) && (pchar.mana <= (pchar.maxMana - 5))) {
spawnPickup("manapotion", anytile.tilex, anytile.tiley + 1);
} else if (stype == 5) {
spawnPickup("gem_green", anytile.tilex, anytile.tiley + 1);
} else if (stype == 6) {
spawnPickup("gem_blue", anytile.tilex, anytile.tiley + 1);
} else if (stype == 7) {
spawnPickup("gem_red", anytile.tilex, anytile.tiley + 1);
} else {
spawnPickup("goldcoins", anytile.tilex, anytile.tiley + 1);
}
}
function specialAbility(anyped) {
if (twoPlayer) {
var selArray = new Array();
if (anyped == pchar) {
selArray = p1SelItem;
} else if (anyped == schar) {
selArray = p2SelItem;
}
selectItem1 = selArray[1];
selectItem2 = selArray[2];
selectItem3 = selArray[3];
selectItem4 = selArray[4];
selectItem5 = selArray[5];
}
if (anyped.hero == "paladin") {
if (tBlocked[anyped.xloc][(anyped.yloc + dyOffset) + 1]) {
var tempTile = tTiles[anyped.xloc][(anyped.yloc + dyOffset) + 1];
if ((!tempTile.isDead) && (tempTile.tileType == "normal")) {
var manaCost = 3;
if (selectItem3 == 1) {
manaCost = 5;
} else if (selectItem3 == 2) {
manaCost = 0;
}
if (anyped.mana >= manaCost) {
anyped.mana = anyped.mana - manaCost;
floatWords(anyped, "stomp!");
anyped.top.body.arm.gotoAndPlay("attack_melee");
anyped.cd_anim = 10;
breakBlock(tempTile);
if (selectItem3 == 1) {
dblock = 1;
while (dblock <= 5) {
var dragonTile = tTiles[anyped.xloc][((anyped.yloc + dyOffset) + 1) + dblock];
if (dragonTile.tileType == "normal") {
breakBlock(dragonTile);
} else if (dragonTile.tileType == "explosive") {
breakBlock(dragonTile);
makePickup(dragonTile);
}
dblock++;
}
}
anyped.jump = true;
anyped._y = anyped._y - 1;
anyped.ymove = -10;
} else {
floatWords(anyped, "no mana!");
}
}
}
} else if (anyped.hero == "ranger") {
var manaCost = 1;
if (selectItem4 == 3) {
manaCost = 2;
}
if (anyped.mana >= manaCost) {
anyped.mana = anyped.mana - manaCost;
anyped.top.body.arm.gotoAndPlay("attack_melee");
anyped.cd_anim = 10;
if (selectItem4 == 1) {
if (anyped._xscale > 0) {
fireMissile(anyped, 0, "shadow", 9);
} else {
fireMissile(anyped, 180, "shadow", 9);
}
} else if (selectItem4 == 2) {
if (anyped._xscale > 0) {
fireMissile(anyped, 0, "breaker", 1);
} else {
fireMissile(anyped, 180, "breaker", 1);
}
} else if (selectItem4 == 3) {
if (anyped._xscale > 0) {
fireMissile(anyped, 0, "holybolt", 1);
} else {
fireMissile(anyped, 180, "holybolt", 1);
}
} else if (selectItem4 == 4) {
if (anyped._xscale > 0) {
fireMissile(anyped, -45, "arrow", 1);
fireMissile(anyped, 0, "arrow", 1);
fireMissile(anyped, 45, "arrow", 1);
} else {
fireMissile(anyped, 135, "arrow", 1);
fireMissile(anyped, 180, "arrow", 1);
fireMissile(anyped, 225, "arrow", 1);
}
} else if (anyped._xscale > 0) {
fireMissile(anyped, 0, "arrow", 1);
} else {
fireMissile(anyped, 180, "arrow", 1);
}
} else {
floatWords(anyped, "no mana!");
}
} else if (anyped.hero == "thief") {
var manaCost = 3;
if (selectItem5 == 3) {
manaCost = 2;
}
if (selectItem5 == 5) {
manaCost = 10;
}
if (shadowCount == 0) {
if (anyped.mana >= manaCost) {
anyped.mana = anyped.mana - manaCost;
if (selectItem5 == 3) {
if (anyped._xscale > 0) {
fireMissile(anyped, 0, "shuriken", 3);
} else {
fireMissile(anyped, 180, "shuriken", 3);
}
} else if (selectItem5 == 5) {
shadeObj(stage);
shadowCount = 150;
backdrop.gotoAndStop(10);
attachEffect(anyped, "effect_ninjasmoke");
snd_poof.start();
shadowCaster = anyped;
} else {
escapeThief(anyped);
}
} else {
floatWords(anyped, "no mana!");
}
}
} else if (anyped.hero == "mage") {
var manaCost = 3;
if (selectItem2 == 1) {
manaCost = 3;
} else if (selectItem2 == 2) {
manaCost = 1;
} else if (selectItem2 == 3) {
manaCost = 3;
} else if (selectItem2 == 4) {
manaCost = 4;
} else if (selectItem2 == 5) {
manaCost = 10;
}
if (anyped.mana >= manaCost) {
anyped.mana = anyped.mana - manaCost;
anyped.top.body.arm.gotoAndPlay("attack_melee");
anyped.cd_anim = 10;
if (selectItem2 == 1) {
if (necroSpecial == 0) {
necroSpecial = 30;
shadeObj(stage);
backdrop.gotoAndStop(9);
necroCaster = anyped;
}
} else if (selectItem2 == 2) {
if (anyped._xscale > 0) {
fireMissile(anyped, 0, "icebolt", 1);
} else {
fireMissile(anyped, 180, "icebolt", 1);
}
} else if (selectItem2 == 3) {
if (anyped._xscale > 0) {
fireMissile(anyped, 0, "familiar", 10);
} else {
fireMissile(anyped, 180, "familiar", 10);
}
} else if (selectItem2 == 5) {
if (sancSpecial == 0) {
anyped.hp = hpmax;
sancSpecial = 90;
backdrop.gotoAndStop(8);
}
} else if (selectItem2 == 4) {
fireMissile(anyped, 0, "fireball", 2);
fireMissile(anyped, -90, "fireball", 2);
fireMissile(anyped, -45, "fireball", 2);
fireMissile(anyped, -135, "fireball", 2);
fireMissile(anyped, 180, "fireball", 2);
} else if (anyped._xscale > 0) {
fireMissile(anyped, 0, "fireball", 3);
} else {
fireMissile(anyped, 180, "fireball", 3);
}
} else {
floatWords(anyped, "no mana!");
}
} else if (anyped.hero == "barbarian") {
var manaCost = 10;
if (selectItem1 == 1) {
manaCost = 5;
} else if (selectItem1 == 2) {
manaCost = 5;
} else if (selectItem1 == 4) {
manaCost = 1;
}
if (anyped.mana >= manaCost) {
if (selectItem1 == 1) {
anyped.mana = anyped.mana - manaCost;
anyped.top.body.arm.gotoAndPlay("attack_melee");
anyped.cd_anim = 10;
newClone = spawnChar("anyped", anyped.xloc, anyped.yloc + 1);
newClone.owner = 1;
dressHero(newClone, "barbarian");
newClone._alpha = 50;
newClone.basespeed = 3;
newClone.canJump = 15;
newClone.xmove = (anyped._xscale / 100) * newClone.basespeed;
attachEffect(newClone, "effect_ninjasmoke");
newClone = spawnChar("anyped", anyped.xloc, anyped.yloc + 1);
newClone.owner = 1;
dressHero(newClone, "barbarian");
newClone._alpha = 50;
newClone.basespeed = -3;
newClone.canJump = 15;
newClone.xmove = (anyped._xscale / 100) * newClone.basespeed;
attachEffect(newClone, "effect_ninjasmoke");
snd_poof.start();
anyped.top.body.arm.gotoAndPlay("attack_melee");
anyped.cd_anim = 10;
} else if (selectItem1 == 2) {
if (anyped.omniStrike == 0) {
anyped.mana = anyped.mana - manaCost;
anyped.omniStrike = 12;
anyped.omniStop = 60;
anyped.berserk = true;
floatWords(anyped, "berserk!");
attachEffect(anyped, "ring_red");
anyped.hit = 30;
anyped.cd_anim = 10;
anyped.container.attachMovie("effect_berserk", "effect", 0);
}
} else if (selectItem1 == 4) {
anyped.mana = anyped.mana - manaCost;
blade1 = fireMissile(anyped, 0, "scimitar", 1);
blade2 = fireMissile(anyped, 180, "scimitar", 1);
if (anyped._xscale > 0) {
blade1.spindir = 6;
blade2.spindir = 6;
} else {
blade1.spindir = -6;
blade2.spindir = -6;
}
} else if (anyped.hit == 0) {
anyped.mana = anyped.mana - manaCost;
anyped.berserk = true;
floatWords(anyped, "berserk!");
attachEffect(anyped, "ring_red");
anyped.hit = 150;
anyped.top.body.arm.gotoAndPlay("attack_melee");
anyped.cd_anim = 10;
anyped.container.attachMovie("effect_berserk", "effect", 0);
}
} else {
floatWords(anyped, "no mana!");
}
}
}
function spawnChar(c_type, c_x, c_y) {
var newChar;
if (c_type == "pchar") {
newChar = spawnObject("char", "char", (c_x * 50) + 25, (c_y * 50) - 25, 51000);
} else {
newChar = spawnObject("char", "char", (c_x * 50) + 25, (c_y * 50) - 25, 50000);
}
newChar.jump = false;
newChar.jump2 = false;
newChar.actwidth = 14;
newChar.actheight = 22;
newChar.c_type = c_type;
newChar.x = newChar._x;
newChar.y = newChar._y;
newChar.cd_anim = 0;
newChar.owner = 2;
newChar.noStomp = false;
newChar.canJump = 0;
newChar.armed = true;
newChar.bounty = 1;
newChar.basespeed = 1;
newChar.ranged = "";
if (c_type == "pchar") {
newChar.top.body.head.attachMovie("h_001", "head", 10);
newChar.top.body.body.attachMovie("b_001", "body", 10);
newChar.top.body.arm.arm1.attachMovie("at_001", "arm", 10);
newChar.top.body.arm.arm2.attachMovie("ab_001", "arm", 10);
newChar.armed = false;
newChar.jumpstrength = 20;
newChar.hero = "normal";
} else if (c_type == "goblin") {
newChar.top.body.head.attachMovie("h_002", "head", 10);
newChar.top.body.body.attachMovie("b_002", "body", 10);
newChar.top.body.arm.arm1.attachMovie("at_002", "arm", 10);
newChar.top.body.arm.arm2.attachMovie("ab_002", "arm", 10);
newChar.ranged = "";
newChar.xmove = 1;
newChar.bounty = 2;
if (randbtwn(1, 10) <= 5) {
newChar.xmove = -1;
}
} else if (c_type == "troll") {
newChar.top.body.head.attachMovie("h_008", "head", 10);
newChar.top.body.body.attachMovie("b_008", "body", 10);
newChar.top.body.arm.arm1.attachMovie("at_008", "arm", 10);
newChar.top.body.arm.arm2.attachMovie("ab_008", "arm", 10);
newChar.ranged = "spear";
newChar.xmove = 1;
newChar.canJump = 12;
newChar.bounty = 2;
if (randbtwn(1, 10) <= 5) {
newChar.xmove = -1;
}
} else if (c_type == "shaman") {
newChar.top.body.head.attachMovie("h_009", "head", 10);
newChar.top.body.body.attachMovie("b_009", "body", 10);
newChar.top.body.arm.arm1.attachMovie("at_009", "arm", 10);
newChar.top.body.arm.arm2.attachMovie("ab_009", "arm", 10);
newChar.ranged = "spear";
newChar.noStomp = true;
newChar.xmove = 1;
newChar.bounty = 3;
newChar.canJump = 12;
if (randbtwn(1, 10) <= 5) {
newChar.xmove = -1;
}
} else if (c_type == "skeleton") {
newChar.top.body.head.attachMovie("h_013b", "head", 10);
newChar.top.body.body.attachMovie("b_013", "body", 10);
newChar.top.body.arm.arm1.attachMovie("at_013", "arm", 10);
newChar.top.body.arm.arm2.attachMovie("ab_013", "arm", 10);
newChar.ranged = "";
newChar.xmove = 1;
newChar.bounty = 2;
if (randbtwn(1, 10) <= 5) {
newChar.xmove = -1;
}
} else if (c_type == "skarcher") {
newChar.top.body.head.attachMovie("h_013", "head", 10);
newChar.top.body.body.attachMovie("b_013", "body", 10);
newChar.top.body.arm.arm1.attachMovie("at_013", "arm", 10);
newChar.top.body.arm.arm2.attachMovie("ab_013b", "arm", 10);
newChar.ranged = "arrow";
newChar.xmove = 1;
newChar.bounty = 2;
if (randbtwn(1, 10) <= 5) {
newChar.xmove = -1;
}
} else if (c_type == "sandwarrior") {
newChar.top.body.head.attachMovie("h_014", "head", 10);
newChar.top.body.body.attachMovie("b_014", "body", 10);
newChar.top.body.arm.arm1.attachMovie("at_014", "arm", 10);
newChar.top.body.arm.arm2.attachMovie("ab_014", "arm", 10);
newChar.ranged = "shuriken";
newChar.xmove = 1;
newChar.bounty = 2;
newChar.canJump = 15;
if (randbtwn(1, 10) <= 5) {
newChar.xmove = -1;
}
} else if (c_type == "cactus") {
newChar.top.body.head.attachMovie("h_016", "head", 10);
newChar.top.body.body.attachMovie("b_016", "body", 10);
newChar.top.body.arm.arm1.attachMovie("at_016", "arm", 10);
newChar.top.body.arm.arm2.attachMovie("ab_016", "arm", 10);
newChar.ranged = "";
newChar.xmove = 1;
newChar.bounty = 3;
newChar.canJump = 12;
if (randbtwn(1, 10) <= 5) {
newChar.xmove = -1;
}
} else if (c_type == "yeti") {
newChar.top.body.head.attachMovie("h_015", "head", 10);
newChar.top.body.body.attachMovie("b_015", "body", 10);
newChar.top.body.arm.arm1.attachMovie("at_015", "arm", 10);
newChar.top.body.arm.arm2.attachMovie("ab_015", "arm", 10);
newChar.ranged = "";
newChar.xmove = 1;
newChar.bounty = 3;
newChar.canJump = 12;
if (randbtwn(1, 10) <= 5) {
newChar.xmove = -1;
}
} else if (c_type == "s_goblin") {
newChar.top.body.head.attachMovie("h_017b", "head", 10);
newChar.top.body.body.attachMovie("b_017", "body", 10);
newChar.top.body.arm.arm1.attachMovie("at_017", "arm", 10);
newChar.top.body.arm.arm2.attachMovie("ab_017b", "arm", 10);
newChar.ranged = "";
newChar.xmove = 1;
newChar.bounty = 2;
if (randbtwn(1, 10) <= 5) {
newChar.xmove = -1;
}
} else if (c_type == "s_troll") {
newChar.top.body.head.attachMovie("h_017", "head", 10);
newChar.top.body.body.attachMovie("b_017", "body", 10);
newChar.top.body.arm.arm1.attachMovie("at_017", "arm", 10);
newChar.top.body.arm.arm2.attachMovie("ab_017", "arm", 10);
newChar.ranged = "spear";
newChar.xmove = 1;
newChar.canJump = 12;
newChar.bounty = 2;
if (randbtwn(1, 10) <= 5) {
newChar.xmove = -1;
}
} else if (c_type == "shade") {
newChar.top.body.head.attachMovie("h_019", "head", 10);
newChar.top.body.body.attachMovie("b_019", "body", 10);
newChar.top.body.arm.arm1.attachMovie("at_019", "arm", 10);
newChar.top.body.arm.arm2.attachMovie("ab_019", "arm", 10);
newChar.ranged = "";
newChar.xmove = 3;
newChar.bounty = 2;
newChar.basespeed = 3;
newChar.canJump = 15;
if (randbtwn(1, 10) <= 5) {
newChar.xmove = -3;
}
}
canfall(newChar);
return(newChar);
}
function spawnPickup(p_type, p_x, p_y) {
var newPickup;
newPickup = spawnObject("pickup", "pickup", (p_x * 50) + 25, (p_y * 50) - 5, 50000);
newPickup.icon.attachMovie(p_type, "icon", 0);
newPickup.ptype = p_type;
}
function newMap() {
clearStage();
stage._y = 220;
pchar = spawnChar("pchar", 4, 1);
pchar.owner = 1;
pchar.hp = hpmax;
pchar.maxMana = 15;
dressHero(pchar, "normal");
if (selectItem2 == 6) {
pchar.maxMana = 30;
}
pchar.mana = pchar.maxMana;
pchar.xspeed = 3;
pchar.hit = 0;
pchar.doublejump = false;
pchar.omniStrike = 0;
pchar.omniCool = 0;
if (twoPlayer) {
pchar.container.attachMovie("playerindicator", "pi", 100);
pchar.container.pi.gotoAndStop(1);
pchar.top.body.body.attachMovie("b_001b", "body", 10);
pchar.x = pchar.x - 25;
pchar.gold = 0;
schar = spawnChar("pchar", 4, 1);
schar.owner = 3;
schar.hp = hpmax;
schar.x = schar.x + 25;
schar.maxMana = 15;
dressHero(schar, "normal");
if (selectItem2 == 6) {
schar.maxMana = 30;
}
schar.mana = schar.maxMana;
schar.xspeed = 3;
schar.container.attachMovie("playerindicator", "pi", 100);
schar.container.pi.gotoAndStop(2);
schar.top.body.body.attachMovie("b_001c", "body", 10);
schar.hit = 0;
schar.doublejump = false;
schar.gold = 0;
schar.omniStrike = 0;
schar.omniCool = 0;
if (aiBuddy) {
schar.xmove = (schar._xscale / 100) * schar.basespeed;
}
}
tTiles[4][1] = spawnProp("tile_start", 200, 50, 49999);
tTiles[4][1].instructions.txt = gameObj1;
tBlocked[4][1] = true;
var i = 1;
while (i <= 25) {
replaceTile(-randbtwn(4, 13));
i++;
}
if (checkHint(1)) {
addTip("Press UP to jump, and arrow keys to move. Collect as much gold as you can and reach the exit at the bottom.", "normal");
}
}
function dressHero(anytile, herotype) {
if (herotype == "normal") {
anytile.top.body.head.attachMovie("h_001", "head", 10);
anytile.top.body.body.attachMovie("b_001", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_001", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_001", "arm", 10);
anytile.jumpstrength = 20;
anytile.hero = "normal";
anytile.armed = false;
anytile.xspeed = 4;
anytile.doublejump = false;
anytile.top.body.head.head.gotoAndStop(currentMask + 1);
if ((anytile == pchar) || (anytile == schar)) {
attachEffect(anytile, "effect_ninjasmoke");
}
if (twoPlayer) {
if (anytile == pchar) {
anytile.top.body.head.head.gotoAndStop(p1Mask + 1);
anytile.top.body.body.attachMovie("b_001b", "body", 10);
} else if (anytile == schar) {
anytile.top.body.head.head.gotoAndStop(p2Mask + 1);
anytile.top.body.body.attachMovie("b_001c", "body", 10);
}
}
} else if (herotype == "paladin") {
anytile.top.body.head.attachMovie("h_003", "head", 10);
anytile.top.body.body.attachMovie("b_003", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_003", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_003", "arm", 10);
anytile.jumpstrength = 15;
anytile.hero = "paladin";
anytile.armed = true;
anytile.xspeed = 3.5;
anytile.doublejump = false;
if (anytile == pchar) {
if (checkHint(2)) {
addTip("Paladins are slow but good at combat. Press Spacebar to STOMP and break the block you are standing on.", "paladin");
}
}
if (selectItem3 == 1) {
anytile.top.body.head.attachMovie("h_003b", "head", 10);
anytile.top.body.body.attachMovie("b_003b", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_003b", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_003b", "arm", 10);
if (anytile == pchar) {
if (checkHint(51)) {
addTip("Dragonlance Boots allows your Paladin to stomp more blocks at once.", "paladin");
}
}
} else if (selectItem3 == 2) {
anytile.top.body.head.attachMovie("h_003c", "head", 10);
anytile.top.body.body.attachMovie("b_003c", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_003c", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_003c", "arm", 10);
anytile.xspeed = 2.5;
anytile.jumpstrength = 8;
if (anytile == pchar) {
if (checkHint(52)) {
addTip("Platemail makes your Paladin invulnerable, but at the cost of mobility.", "paladin");
}
}
} else if (selectItem3 == 3) {
anytile.top.body.body.attachMovie("b_003d", "body", 10);
if (anytile == pchar) {
if (checkHint(53)) {
addTip("The Ironmirror Shield allows your Paladin to deflect most missiles back at the enemy.", "paladin");
}
}
} else if (selectItem3 == 4) {
anytile.top.body.head.attachMovie("h_003e", "head", 10);
anytile.top.body.body.attachMovie("b_003e", "body", 10);
anytile.xspeed = 4.5;
anytile.jumpstrength = 20;
if (anytile == pchar) {
if (checkHint(54)) {
addTip("Chainmail Paladins are more agile, but cannot block missiles.", "paladin");
}
}
} else if (selectItem3 == 5) {
anytile.top.body.head.attachMovie("h_003f", "head", 10);
anytile.top.body.body.attachMovie("b_003f", "body", 10);
if (anytile == pchar) {
if (checkHint(55)) {
addTip("Holy Shield grants you an additional shield whenever you rescue a Paladin.", "paladin");
}
}
}
} else if (herotype == "ranger") {
anytile.top.body.head.attachMovie("h_004", "head", 10);
anytile.top.body.body.attachMovie("b_004", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_004", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_004", "arm", 10);
anytile.jumpstrength = 15;
anytile.hero = "ranger";
anytile.armed = false;
anytile.xspeed = 4;
anytile.doublejump = true;
if (anytile == pchar) {
if (checkHint(3)) {
addTip("Rangers are agile and have a ranged attack. Press Spacebar to fire ARROWs. Rangers can double jump.", "ranger");
}
}
if (selectItem4 == 1) {
anytile.top.body.head.attachMovie("h_010b", "head", 10);
anytile.top.body.body.attachMovie("b_010b", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_004b", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_004b", "arm", 10);
if (anytile == pchar) {
if (checkHint(56)) {
addTip("Shadow arrows can penetrate blocks and enemies.", "ranger");
}
}
} else if (selectItem4 == 2) {
anytile.top.body.head.attachMovie("h_004b", "head", 10);
if (anytile == pchar) {
if (checkHint(57)) {
addTip("Stonebreaker arrows can smash blocks when hit.", "ranger");
}
}
}
if (selectItem4 == 3) {
anytile.top.body.head.attachMovie("h_010", "head", 10);
anytile.top.body.body.attachMovie("b_010", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_010", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_010", "arm", 10);
if (anytile == pchar) {
if (checkHint(58)) {
addTip("Enemies killed by the cleric will turn into health potions.", "ranger");
}
}
} else if (selectItem4 == 4) {
anytile.top.body.head.attachMovie("h_004d", "head", 10);
if (anytile == pchar) {
if (checkHint(59)) {
addTip("Hydra arrows allows you to fire three arrows at once.", "ranger");
}
}
}
if (selectItem4 == 5) {
anytile.top.body.head.attachMovie("h_004c", "head", 10);
anytile.top.body.body.attachMovie("b_004b", "body", 10);
if (anytile == pchar) {
if (checkHint(60)) {
addTip("Raven Wings allows your hero to have multiple double jumps, for 1 mana each.", "ranger");
}
}
}
} else if (herotype == "thief") {
anytile.top.body.head.attachMovie("h_005", "head", 10);
anytile.top.body.body.attachMovie("b_005", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_005", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_005", "arm", 10);
anytile.jumpstrength = 22;
anytile.hero = "thief";
anytile.armed = false;
anytile.xspeed = 6;
anytile.doublejump = true;
if (anytile == pchar) {
if (checkHint(4)) {
addTip("Thieves are the fastest and most agile hero. Press Spacear to ESCAPE to a random location nearby. Thieves can double jump.", "thief");
}
}
if (selectItem5 == 1) {
anytile.top.body.head.attachMovie("h_005b", "head", 10);
anytile.top.body.body.attachMovie("b_005b", "body", 10);
if (anytile == pchar) {
if (checkHint(61)) {
addTip("The Assassin's Amulet makes your Thief invulnerable for 2 seconds after escaping.", "thief");
}
}
} else if (selectItem5 == 3) {
anytile.top.body.head.attachMovie("h_005b", "head", 10);
anytile.top.body.body.attachMovie("b_005b", "body", 10);
if (anytile == pchar) {
if (checkHint(76)) {
addTip("The Black Shuriken allows your hero to attack enemies from a distance. Sometimes it bounces!", "thief");
}
}
} else if (selectItem5 == 2) {
anytile.top.body.head.attachMovie("h_005d", "head", 10);
anytile.top.body.body.attachMovie("b_005d", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_005d", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_005d", "arm", 10);
anytile.armed = true;
if (anytile == pchar) {
if (checkHint(62)) {
addTip("The Wristblades grant your Thief the ability to kill enemies at close range.", "thief");
}
}
} else if (selectItem5 == 4) {
anytile.top.body.head.attachMovie("h_005e", "head", 10);
anytile.top.body.body.attachMovie("b_005e", "body", 10);
if (anytile == pchar) {
if (checkHint(63)) {
addTip("The Pendant allows your Thief to teleport away just before taking damage.", "thief");
}
}
} else if (selectItem5 == 5) {
anytile.top.body.head.attachMovie("h_005c", "head", 10);
anytile.top.body.body.attachMovie("b_005c", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_005c", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_005c", "arm", 10);
if (anytile == pchar) {
if (checkHint(64)) {
addTip("The Robe of Shadows allows the Thief to enter Shadow Mode.", "thief");
}
}
}
} else if (herotype == "mage") {
anytile.top.body.head.attachMovie("h_006", "head", 10);
anytile.top.body.body.attachMovie("b_006", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_006", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_006", "arm", 10);
anytile.jumpstrength = 20;
anytile.hero = "mage";
anytile.armed = false;
anytile.xspeed = 4;
anytile.doublejump = false;
if (anytile == pchar) {
if (checkHint(5)) {
addTip("Mages can press Spacebar to cast a FIREBALL that breaks blocks and smashes enemies.", "mage");
}
}
if (selectItem2 == 1) {
anytile.top.body.head.attachMovie("h_006d", "head", 10);
anytile.top.body.body.attachMovie("b_006d", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_006d", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_006d", "arm", 10);
if (anytile == pchar) {
if (checkHint(65)) {
addTip("Necromancers can instantly kill every enemy on screen for a small mana cost.", "mage");
}
}
} else if (selectItem2 == 2) {
anytile.top.body.head.attachMovie("h_006c", "head", 10);
anytile.top.body.body.attachMovie("b_006c", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_006c", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_006c", "arm", 10);
if (anytile == pchar) {
if (checkHint(66)) {
addTip("The Icicle Staff can turn blocks and enemies into ice.", "mage");
}
}
} else if (selectItem2 == 3) {
anytile.top.body.head.attachMovie("h_006e", "head", 10);
anytile.top.body.body.attachMovie("b_006e", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_006e", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_006e", "arm", 10);
if (anytile == pchar) {
if (checkHint(67)) {
addTip("The Familiar will destroy enemies, chests and normal blocks. Flies around in an erratic pattern.", "mage");
}
}
} else if (selectItem2 == 4) {
anytile.top.body.head.attachMovie("h_006b", "head", 10);
anytile.top.body.body.attachMovie("b_006b", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_006b", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_006b", "arm", 10);
if (anytile == pchar) {
if (checkHint(68)) {
addTip("The Staff of Flames allows the Mage to shoot 5 fireballs in a wide arc around himself.", "mage");
}
}
} else if (selectItem2 == 5) {
anytile.top.body.head.attachMovie("h_006c", "head", 10);
anytile.top.body.body.attachMovie("b_006c", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_006c", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_006c", "arm", 10);
if (anytile == pchar) {
if (checkHint(69)) {
addTip("The Sanctuary Staff instantly heals the Mage to full health and destroys all chests in sight.", "mage");
}
}
}
} else if (herotype == "barbarian") {
anytile.top.body.head.attachMovie("h_011", "head", 10);
anytile.top.body.body.attachMovie("b_011", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_011", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_011", "arm", 10);
anytile.jumpstrength = 12;
anytile.hero = "barbarian";
anytile.armed = true;
anytile.xspeed = 4;
anytile.doublejump = true;
if (anytile == pchar) {
if (checkHint(18)) {
addTip("Barbarians can press Spacebar to go BERSERK where he is immune to all damage for 5 seconds. Can double jump.", "barbarian");
}
}
if (selectItem1 == 1) {
anytile.top.body.head.attachMovie("h_011f", "head", 10);
anytile.top.body.body.attachMovie("b_011f", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_011f", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_011f", "arm", 10);
if (anytile == pchar) {
if (checkHint(70)) {
addTip("The Shadow Scimitar allows the Barbarian to summon two clones of himself.", "barbarian");
}
}
} else if (selectItem1 == 2) {
anytile.top.body.head.attachMovie("h_011e", "head", 10);
if (anytile == pchar) {
if (checkHint(71)) {
addTip("The Berserker Mask allows the Barbarian to teleport to every enemy in sight and eliminate them quickly.", "barbarian");
}
}
} else if (selectItem1 == 3) {
anytile.top.body.head.attachMovie("h_011b", "head", 10);
anytile.top.body.arm.arm2.attachMovie("ab_011b", "arm", 10);
if (anytile == pchar) {
if (checkHint(72)) {
addTip("The Broadsword allows the Barbarian to slice most missiles in half.", "barbarian");
}
}
} else if (selectItem1 == 4) {
anytile.top.body.head.attachMovie("h_011c", "head", 10);
anytile.top.body.body.attachMovie("b_011c", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_011c", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_011c", "arm", 10);
if (anytile == pchar) {
if (checkHint(73)) {
addTip("The Barbarian can now summon two magical Blades that swirl around, killing enemies and opening chests.", "barbarian");
}
}
} else if (selectItem1 == 5) {
anytile.top.body.head.attachMovie("h_011d", "head", 10);
if (anytile == pchar) {
if (checkHint(74)) {
addTip("With bloodlust, the Barbarian gains extra health and gold from enemy kills when berserk.", "barbarian");
}
}
}
} else if (herotype == "princess1") {
anytile.top.body.head.attachMovie("h_007", "head", 10);
anytile.top.body.body.attachMovie("b_007", "body", 10);
anytile.top.body.arm.arm1.attachMovie("at_007", "arm", 10);
anytile.top.body.arm.arm2.attachMovie("ab_007", "arm", 10);
}
anytile.canJump = anytile.jumpstrength;
anytile.basespeed = anytile.xspeed;
anytile.top.body.arm.gotoAndStop(1);
}
function replaceTile(oriY) {
spaceFound = false;
var rx = randbtwn(1, 9);
var ry = randbtwn(16, 16);
while ((((tBlocked[rx][(oriY + ry) + dyOffset] || (tTiles[rx][(oriY + ry) + dyOffset].tileType == "key")) || (tTiles[rx][(oriY + ry) + dyOffset].tileType == "boss")) || (((oriY + ry) + dyOffset) == 1)) || (tTiles[rx][(oriY + ry) + dyOffset] != undefined)) {
rx = randbtwn(1, 9);
ry = randbtwn(15, 17);
}
tType = randbtwn(2, 60);
nextChest = nextChest + 1;
if (nextChest >= 5) {
nextChest = 0;
tType = 1;
}
if ((gold >= targetGold) || (thisDepth >= targetDepth)) {
if (!princessSpawned) {
princessSpawned = true;
nextExitDepth = thisDepth + 50;
tType = 0;
if (cIcon == 2) {
if (checkHint(9)) {
addTip("You have found the Princess! Find a way to rescue her!", "normal");
}
} else if (checkHint(81)) {
addTip("Get to the exit to escape from this location!", "normal");
}
} else if (thisDepth >= nextExitDepth) {
princessSpawned = false;
}
}
if ((((((!survivalMode) && (!twoPlayer)) && (cIcon == 2)) && (levelsCompleted > 2)) || (survivalMode && ((levelsCompleted % 5) == 4))) || (twoPlayer && (cIcon > 1))) {
if ((thisDepth >= mRn(targetDepth * 0.5)) && (!bossSpawned)) {
bossSpawned = true;
tType = -10;
}
}
if (tType == -10) {
var xSweep = new Array();
xSweep[1] = 1;
xSweep[2] = 2;
xSweep[3] = 8;
xSweep[4] = 9;
xSweep[5] = randbtwn(3, 4);
xSweep[6] = randbtwn(6, 7);
xSweep[7] = randbtwn(3, 6);
xSweep[8] = randbtwn(4, 7);
xSweep[9] = 5;
xSweep[10] = 3;
xSweep[11] = 4;
xSweep[12] = 5;
xSweep[13] = 6;
xSweep[14] = 7;
var ySweep = new Array();
ySweep[1] = 0;
ySweep[2] = 0;
ySweep[3] = 0;
ySweep[4] = 0;
ySweep[5] = randbtwn(0, 1);
ySweep[6] = randbtwn(0, 1);
ySweep[7] = -2;
ySweep[8] = -2;
ySweep[9] = 1;
ySweep[10] = 1;
ySweep[11] = 2;
ySweep[12] = 2;
ySweep[13] = 2;
ySweep[14] = 1;
sweep = 1;
while (sweep <= 14) {
xSw = xSweep[sweep];
yVar = ySweep[sweep];
if (tBlocked[xSw][((oriY + ry) + dyOffset) + yVar]) {
sideTile = tTiles[xSw][((oriY + ry) + dyOffset) + yVar];
removeProp(sideTile);
tBlocked[xSw][((oriY + ry) + dyOffset) + yVar] = false;
limboBlock = limboBlock + 1;
}
if (sweep <= 4) {
tTiles[xSw][((oriY + ry) + dyOffset) + yVar] = spawnProp("tile_bossledge", xSw * 50, ((oriY + ry) + yVar) * 50, 10);
} else {
tTiles[xSw][((oriY + ry) + dyOffset) + yVar] = spawnProp("tile_gold", xSw * 50, ((oriY + ry) + yVar) * 50, 10);
}
if (sweep > 4) {
tTiles[xSw][((oriY + ry) + dyOffset) + yVar].tileType = "bossgold";
} else {
tTiles[xSw][((oriY + ry) + dyOffset) + yVar].tileType = "solidgold";
}
tTiles[xSw][((oriY + ry) + dyOffset) + yVar].tilex = xSw;
tTiles[xSw][((oriY + ry) + dyOffset) + yVar].tiley = (oriY + ry) + yVar;
tTiles[xSw][((oriY + ry) + dyOffset) + yVar].swapDepths(50000 - (xSw + (((oriY + ry) + yVar) * 10)));
tBlocked[xSw][((oriY + ry) + dyOffset) + yVar] = true;
limboBlock = limboBlock - 1;
if (tBlocked[xSw][(((oriY + ry) + dyOffset) - 1) + yVar]) {
sideTile = tTiles[xSw][(((oriY + ry) + dyOffset) - 1) + yVar];
removeProp(sideTile);
tBlocked[xSw][(((oriY + ry) + dyOffset) - 1) + yVar] = false;
limboBlock = limboBlock + 1;
}
if (sweep <= 4) {
if (tBlocked[xSw][(((oriY + ry) + dyOffset) - 2) + yVar]) {
sideTile = tTiles[xSw][(((oriY + ry) + dyOffset) - 2) + yVar];
removeProp(sideTile);
tBlocked[xSw][(((oriY + ry) + dyOffset) - 2) + yVar] = false;
limboBlock = limboBlock + 1;
}
}
sweep++;
}
eBoss = spawnObject("boss" + bossNum, "char", 75, ((oriY + ry) * 50) - 50, 50000);
eBoss.actwidth = 50;
eBoss.actheight = 50;
eBoss.x = eBoss._x;
eBoss.y = eBoss._y;
eBoss.owner = 2;
eBoss.noStomp = false;
eBoss.canJump = 0;
eBoss.maxhp = 4;
eBoss.hp = eBoss.maxhp;
eBoss.cd_anim = 0;
eBoss.armed = true;
eBoss.bounty = 25;
eBoss.basespeed = 0;
eBoss.hit = 0;
if (bossNum == 1) {
eBoss.ranged = "fireball";
} else if (bossNum == 2) {
eBoss.ranged = "trunk";
} else if (bossNum == 3) {
eBoss.ranged = "shadowbolt";
} else if (bossNum == 4) {
eBoss.ranged = "snowball";
}
} else if (tType == 0) {
if ((((cIcon == 2) && (!survivalMode)) && (!twoPlayer)) || (twoPlayer && (cIcon == 5))) {
var thisTile = spawnProp("tile_princess", rx * 50, (oriY + ry) * 50, 10);
dressHero(thisTile, "princess1");
thisTile.tileType = "cage";
thisTile.heroType = "princess";
} else {
var thisTile = spawnProp("tile_exit", rx * 50, (oriY + ry) * 50, 10);
}
tBlocked[rx][(oriY + ry) + dyOffset] = true;
wrongTile2 = tTiles[rx][((oriY + ry) + dyOffset) - 1];
removeProp(wrongTile2);
tBlocked[rx][((oriY + ry) + dyOffset) - 1] = false;
exitChances = exitChances + 1;
if ((thisTile.tileType == "cage") || (exitChances >= 3)) {
closex = 1;
while (closex <= 9) {
sideWing = tTiles[closex][((oriY + ry) + dyOffset) + 1];
removeProp(sideWing);
tTiles[closex][((oriY + ry) + dyOffset) + 1] = spawnProp("tile_gold", closex * 50, ((oriY + ry) + 1) * 50, 10);
tBlocked[closex][((oriY + ry) + dyOffset) + 1] = true;
tTiles[closex][((oriY + ry) + dyOffset) + 1].tileType = "solidgold";
tTiles[closex][((oriY + ry) + dyOffset) + 1].swapDepths(50000 - (closex + (((oriY + ry) + 1) * 10)));
closex++;
}
}
if ((((cIcon != 2) || (survivalMode)) || (twoPlayer)) && (!(twoPlayer && (cIcon == 5)))) {
tBlocked[rx][(oriY + ry) + dyOffset] = false;
thisTile.tileType = "key";
}
} else if (tType == 1) {
var thisTile = spawnProp("tile_boom", rx * 50, (oriY + ry) * 50, 10);
tBlocked[rx][(oriY + ry) + dyOffset] = true;
thisTile.tileType = "explosive";
} else if ((tType <= 20) && (nextSpecialBlock >= 3)) {
nextSpecialBlock = 0;
var thisTile = spawnProp("tile_cage", rx * 50, (oriY + ry) * 50, 10);
tBlocked[rx][(oriY + ry) + dyOffset] = true;
thisTile.tileType = "cage";
thisTile.heroType = lastHero;
while (thisTile.heroType == lastHero) {
htype = randbtwn(1, 10);
if (htype <= 2) {
thisTile.heroType = "paladin";
} else if (htype <= 4) {
thisTile.heroType = "ranger";
} else if (htype <= 6) {
thisTile.heroType = "thief";
} else if (htype <= 8) {
thisTile.heroType = "mage";
} else if (htype <= 10) {
thisTile.heroType = "barbarian";
}
}
lastHero = thisTile.heroType;
if (twoPlayer) {
selectItem1 = 7;
selectItem2 = 7;
selectItem3 = 7;
selectItem4 = 7;
selectItem5 = 7;
}
dressHero(thisTile, thisTile.heroType);
} else if (((tType <= 30) && (nextSpecialBlock >= 3)) && (cMapType != 13)) {
nextSpecialBlock = 0;
var thisTile = spawnProp("tile_spike", rx * 50, (oriY + ry) * 50, 10);
tBlocked[rx][(oriY + ry) + dyOffset] = true;
thisTile.tileType = "spike";
} else if (((cIcon == 2) && (tType <= 40)) && (nextSpecialBlock >= 3)) {
nextSpecialBlock = 0;
var thisTile = spawnProp("tile_sliding", rx * 50, (oriY + ry) * 50, 10);
tBlocked[rx][(oriY + ry) + dyOffset] = true;
thisTile.tileType = "sliding";
thisTile.count = 0;
thisTile.tileStatus = true;
} else if (((cIcon == 2) && (tType <= 50)) && (nextSpecialBlock >= 3)) {
nextSpecialBlock = 0;
var thisTile = spawnProp("tile_idolhead", rx * 50, (oriY + ry) * 50, 10);
tBlocked[rx][(oriY + ry) + dyOffset] = true;
thisTile.tileType = "idolhead";
thisTile.count = 0;
thisTile.owner = 2;
if (rx > 5) {
thisTile.tileStatus = true;
} else {
thisTile.tileStatus = false;
thisTile.gotoAndStop(2);
}
} else if (((cIcon == 4) && (tType <= 40)) && (nextSpecialBlock >= 3)) {
nextSpecialBlock = 0;
var thisTile = spawnProp("tile_icicle", rx * 50, (oriY + ry) * 50, 10);
tBlocked[rx][(oriY + ry) + dyOffset] = true;
thisTile.tileType = "icicle";
thisTile.count = 0;
thisTile.tileStatus = true;
} else if (((cIcon == 4) && (tType <= 50)) && (nextSpecialBlock >= 3)) {
nextSpecialBlock = 0;
var thisTile = spawnProp("tile_geyser", rx * 50, (oriY + ry) * 50, 10);
tBlocked[rx][(oriY + ry) + dyOffset] = true;
thisTile.tileType = "geyser";
thisTile.count = 0;
thisTile.tileStatus = true;
} else if (((cIcon == 5) && (tType <= 40)) && (nextSpecialBlock >= 3)) {
nextSpecialBlock = 0;
var thisTile = spawnProp("tile_magma", rx * 50, (oriY + ry) * 50, 10);
tBlocked[rx][(oriY + ry) + dyOffset] = true;
thisTile.tileType = "magma";
thisTile.count = 0;
thisTile.tileStatus = true;
} else if (((cIcon == 5) && (tType <= 50)) && (nextSpecialBlock >= 3)) {
nextSpecialBlock = 0;
var thisTile = spawnProp("tile_firevent", rx * 50, (oriY + ry) * 50, 10);
tBlocked[rx][(oriY + ry) + dyOffset] = true;
thisTile.tileType = "firevent";
thisTile.count = 0;
thisTile.tileStatus = true;
} else {
nextSpecialBlock = nextSpecialBlock + 1;
var thisTile = spawnProp("tile_blank" + cIcon, rx * 50, (oriY + ry) * 50, 10);
thisTile.block._rotation = randbtwn(0, 3) * 90;
tBlocked[rx][(oriY + ry) + dyOffset] = true;
if (randbtwn(0, 10) <= 5) {
thisTile.block.txt = "";
}
thisTile.tileType = "normal";
thisTile.sand = false;
thisTile.count = 0;
if ((randbtwn(1, 20) <= 5) && (!tBlocked[rx][((oriY + ry) - 1) + dyOffset])) {
if (thisDepth > 50) {
var eType = randbtwn(1, 5);
if (thisDepth < 100) {
eType = 1;
}
if (cIcon == 1) {
if (eType <= 2) {
spawnChar("goblin", rx, oriY + ry);
} else if (eType <= 4) {
spawnChar("troll", rx, oriY + ry);
} else if (cMapType != 13) {
spawnChar("shaman", rx, oriY + ry);
}
} else if (cIcon == 2) {
if (eType <= 3) {
spawnChar("skeleton", rx, oriY + ry);
} else {
spawnChar("skarcher", rx, oriY + ry);
}
} else if (cIcon == 3) {
if (eType <= 3) {
spawnChar("sandwarrior", rx, oriY + ry);
} else {
spawnChar("cactus", rx, oriY + ry);
}
} else if (cIcon == 4) {
if (eType <= 2) {
spawnChar("s_goblin", rx, oriY + ry);
} else if (eType <= 4) {
spawnChar("s_troll", rx, oriY + ry);
} else {
spawnChar("yeti", rx, oriY + ry);
}
} else if (cIcon == 5) {
if (eType <= 2) {
spawnChar("goblin", rx, oriY + ry);
} else if (eType <= 4) {
spawnChar("troll", rx, oriY + ry);
} else {
spawnChar("shaman", rx, oriY + ry);
}
}
}
}
}
thisTile.tilex = rx;
thisTile.tiley = oriY + ry;
tTiles[rx][(oriY + ry) + dyOffset] = thisTile;
thisTile.swapDepths(50000 - (rx + ((oriY + ry) * 10)));
checkTop(thisTile);
if (cIcon == 3) {
if (thisTile.tileType == "normal") {
if (randbtwn(1, 10) <= 3) {
if (!tBlocked[tx][(ty - 1) + dyOffset]) {
thisTile.gotoAndStop(3);
thisTile.sand = false;
}
}
}
}
}
function checkTop(anytile) {
tx = anytile.tilex;
ty = anytile.tiley;
anytile.count = 2;
if (anytile.tileType == "normal") {
var blocksHere = 0;
var rc = 1;
while (rc <= 9) {
if (tBlocked[rc][ty + dyOffset]) {
blocksHere = blocksHere + 1;
}
rc++;
}
if (blocksHere >= 6) {
tBlocked[tx][ty + dyOffset] = false;
removeProp(anytile);
limboBlock = limboBlock + 1;
} else {
if (tBlocked[tx][(ty + 1) + dyOffset]) {
if (tTiles[tx][(ty + 1) + dyOffset].tileType == "normal") {
tTiles[tx][(ty + 1) + dyOffset].gotoAndStop(1);
tTiles[tx][(ty + 1) + dyOffset].sand = false;
}
if ((tTiles[tx][(ty + 1) + dyOffset].tileType == "spike") || (tTiles[tx][(ty + 1) + dyOffset].tileType == "cage")) {
tBlocked[tx][ty + dyOffset] = false;
removeProp(anytile);
limboBlock = limboBlock + 1;
}
}
if (!tBlocked[tx][(ty - 1) + dyOffset]) {
anytile.gotoAndStop(2);
if (cIcon == 3) {
anytile.sand = true;
}
if (cIcon == 1) {
anytile.subblock.attachMovie("grass" + randbtwn(1, 6), "subblock", 0);
} else if (cIcon == 2) {
anytile.subblock.attachMovie("temple_floor" + randbtwn(1, 6), "subblock", 0);
} else if (cIcon == 4) {
anytile.subblock.attachMovie("snow" + randbtwn(1, 5), "subblock", 0);
} else if (cIcon == 5) {
anytile.subblock.attachMovie("cave" + randbtwn(1, 6), "subblock", 0);
}
}
}
} else if ((anytile.tileType == "spike") || (anytile.tileType == "cage")) {
if ((tBlocked[tx][(ty - 1) + dyOffset] && (tTiles[tx][(ty - 1) + dyOffset].tileType != "solidgold")) && (tTiles[tx][(ty - 1) + dyOffset].tileType != "cage")) {
tBlocked[tx][(ty - 1) + dyOffset] = false;
removeProp(tTiles[tx][(ty - 1) + dyOffset]);
limboBlock = limboBlock + 1;
}
if ((anytile.tileType == "spike") && (tTiles[tx][(ty + 1) + dyOffset].tileType == "cage")) {
tBlocked[tx][ty + dyOffset] = false;
removeProp(anytile);
limboBlock = limboBlock + 1;
}
}
}
function openCage(anytile, anyped) {
gold = gold + 3;
anyped.gold = anyped.gold + 3;
scrollSpeed = 0.3;
floatWords(anytile, "+5 mana +3 gp!");
anytile.tileType = "";
attachEffect(anytile, "fx_explosion");
anytile.gotoAndStop(3);
attachEffect(anyped, "effect_ninjasmoke");
snd_box.start();
anyped.jump = true;
anyped.ymove = -8;
anyped.berserk = false;
anyped.container.effect.removeMovieClip();
anyped.hit = 0;
noRescue = false;
if (twoPlayer) {
var selArray = new Array();
if (anyped == pchar) {
selArray = p1SelItem;
} else if (anyped == schar) {
selArray = p2SelItem;
}
selectItem1 = selArray[1];
selectItem2 = selArray[2];
selectItem3 = selArray[3];
selectItem4 = selArray[4];
selectItem5 = selArray[5];
}
anyped.mana = anyped.mana + 5;
if (anyped.mana > anyped.maxMana) {
anyped.mana = anyped.maxMana;
}
if (anytile.heroType == "paladin") {
if (selectItem3 == 5) {
anyped.attachMovie("shield", "fx_shield", 0);
anyped.shield = true;
}
}
if (sameHeroName == "") {
sameHeroName = anytile.heroType;
} else if (sameHeroName != anytile.heroType) {
sameHero = false;
}
if (anytile.heroType == "princess") {
levelComplete = true;
deadHero = pchar.hero;
makeFade("gameover");
anyped.dead = true;
_level0.onEnterFrame = null;
} else if (anytile.heroType != anyped.hero) {
comboBonus = 1;
dressHero(anyped, anytile.heroType);
} else {
comboBonus = comboBonus + 1;
gold = gold + (3 * comboBonus);
anyped.gold = anyped.gold + (3 * comboBonus);
floatWords(anyped, ("combo bonus! +" + (3 * comboBonus)) + " gp");
if (checkHint(13)) {
addTip("If you open a cage with a hero of the same class as you, you will gain a cumulative combo bonus!", "normal");
}
}
tBlocked[anytile.tilex][anytile.tiley + dyOffset] = false;
}
function spawnBlock() {
if (randbtwn(1, 10) <= 9) {
replaceTile((-dyOffset) - 2);
limboBlock = limboBlock - 1;
}
var blocke = 1;
while (blocke <= 20) {
if ((limboBlock > 0) && (randbtwn(1, 10) <= 7)) {
replaceTile((-dyOffset) - 2);
limboBlock = limboBlock - 1;
} else {
blocke = 99;
}
blocke++;
}
}
function twoplayerDeath(anyped) {
floatWords(anyped, "oops!");
attachEffect(anyped, "effect_ninjasmoke");
snd_warp.start();
if (anyped == pchar) {
prandx = schar.xloc;
prandy = schar.yloc;
} else {
prandx = pchar.xloc;
prandy = pchar.yloc;
}
anyped.x = (prandx * 50) + 25;
anyped.y = (prandy * 50) + 25;
if ((anyped.y + stage._y) < 50) {
anyped.y = anyped.y + 150;
}
escapeDone = true;
anyped.jump = true;
anyped.ymove = 3;
anyped.berserk = true;
anyped._alpha = 100;
anyped.hit = 30;
anyped._x = anyped.x;
anyped._y = anyped.y;
if (anyped == pchar) {
attachEffect(anyped, "fx_explodemarker1");
} else {
attachEffect(anyped, "fx_explodemarker2");
}
}
function escapeThief(anyped) {
escapeDone = false;
while (!escapeDone) {
prandx = randbtwn(1, 9);
prandy = (-dyOffset) + randbtwn(3, 9);
if ((!tBlocked[prandx][(prandy + dyOffset) - 1]) && (tBlocked[prandx][prandy + dyOffset])) {
if (selectItem5 == 1) {
anyped.berserk = true;
floatWords(anyped, "amulet!");
attachEffect(anyped, "ring_red");
anyped.container.attachMovie("effect_berserk", "effect", 0);
anyped.hit = 60;
anyped.cd_anim = 10;
}
attachEffect(pchar, "effect_ninjasmoke");
snd_poof.start();
anyped.x = (prandx * 50) + 25;
anyped.y = (prandy * 50) - 25;
attachEffect(anyped, "effect_ninjasmoke");
floatWords(anyped, "escape!");
escapeDone = true;
anyped.jump = true;
anyped.ymove = 3;
anyped._x = anyped.x;
anyped._y = anyped.y;
attachEffect(anyped, "effect_ninjasmoke");
}
}
}
function loseHP(anyped) {
if (twoPlayer) {
selectItem1 = 7;
selectItem2 = 7;
selectItem3 = 7;
selectItem4 = 7;
selectItem5 = 7;
var selArray = new Array();
if (anyped == pchar) {
selArray = p1SelItem;
} else if (anyped == schar) {
selArray = p2SelItem;
}
selectItem1 = selArray[1];
selectItem2 = selArray[2];
selectItem3 = selArray[3];
selectItem4 = selArray[4];
selectItem5 = selArray[5];
}
if (anyped.shield) {
anyped.shield = false;
anyped.fx_shield.removeMovieClip();
} else if (!((selectItem3 == 2) && (anyped.hero == "paladin"))) {
noHurt = false;
anyped.hp = anyped.hp - 1;
anyped.hit = 60;
snd_squeak.start();
attachEffect(anyped, "effect_ninjasmoke");
shadowCount = 0;
if ((selectItem3 == 6) && (anyped.mana >= 5)) {
anyped.mana = anyped.mana - 5;
} else if (anyped.hp > 0) {
if (anyped.hero != "normal") {
dressHero(anyped, "normal");
if (checkHint(80)) {
addTip("Beware: if you are injured, you will lose the powers of the current Hero.", "normal");
}
}
}
if (anyped.hp == 1) {
if (selectItem1 == 6) {
anyped.berserk = true;
attachEffect(anyped, "ring_red");
anyped.hit = 300;
anyped.cd_anim = 10;
anyped.container.attachMovie("effect_berserk", "effect", 0);
}
}
}
}
function removeLine() {
var iy = 0;
while (iy <= 17) {
if (iy == -1) {
var ix = 1;
while (ix <= 9) {
tBlocked[ix][iy] = false;
tTiles[rx][ry] = undefined;
ix++;
}
} else {
var ix = 1;
while (ix <= 9) {
tBlocked[ix][iy] = tBlocked[ix][iy + 1];
tTiles[ix][iy] = tTiles[ix][iy + 1];
tTiles[ix][iy + 1] = undefined;
ix++;
}
}
iy++;
}
}
function corners(actx, acty, act) {
actwidth = act.actwidth;
actheight = act.actheight;
act.x1 = Math.ceil((actx - actwidth) / 50) - 1;
act.x2 = Math.ceil(((actx + actwidth) - 1) / 50) - 1;
act.y1 = Math.ceil((acty - actheight) / 50) - 1;
act.y2 = Math.ceil(((acty + actheight) - 1) / 50) - 1;
act.ym = Math.ceil(acty / 50) - 1;
act.cULi = canwalk(act.x1, act.y1);
act.cURi = canwalk(act.x2, act.y1);
act.cMLi = canwalk(act.x1, act.ym);
act.cMRi = canwalk(act.x2, act.ym);
act.cBLi = canwalk(act.x1, act.y2);
act.cBRi = canwalk(act.x2, act.y2);
}
function canfall(act) {
if (!act.jump) {
corners(act.x, act.y + 2, act);
if (act.cBRi and act.cBLi) {
act.ymove = 3;
act.jump = true;
}
}
}
function canwalk(tilex, tiley) {
if (!tBlocked[tilex][tiley + dyOffset]) {
return(true);
}
return(false);
}
function activateTile(anyped, tilex, tiley) {
var stepTile = tTiles[tilex][tiley + dyOffset];
if (((!stepTile.isDead) && (stepTile != undefined)) && (stepTile.tileType != "")) {
if (stepTile.tileType == "explosive") {
snd_box.start();
breakBlock(stepTile);
chestsOpened = chestsOpened + 1;
if (anyped.objclass == "char") {
anyped.jump = true;
anyped._y = anyped._y - 1;
anyped.ymove = -12;
}
makePickup(stepTile);
if (checkHint(7)) {
addTip("Breaking open chests will always reveal potions, gold coins, or other useful items!", "normal");
}
} else if (stepTile.tileType == "icicle") {
breakBlock(stepTile);
if (anyped.objclass == "char") {
anyped.jump = true;
anyped._y = anyped._y - 1;
anyped.ymove = -12;
}
} else if (stepTile.tileType == "ice") {
enemyChar = spawnChar("yeti", tilex, tiley);
enemyChar.y = enemyChar.y + 120;
enemyChar._y = enemyChar._y;
breakBlock(stepTile);
if (anyped.objclass == "char") {
anyped.jump = true;
anyped.y = anyped.y - 20;
anyped.ymove = -12;
}
if (checkHint(32)) {
addTip("Watch out, breaking the ice will release the enemy inside!", "normal");
}
} else if (stepTile.tileType == "spike") {
if (anyped.objclass == "char") {
if (((selectItem5 == 4) && (anyped.hero == "thief")) && (anyped.mana >= 5)) {
anyped.mana = anyped.mana - 5;
escapeThief(anyped);
} else {
if (anyped.hit == 0) {
loseHP(anyped);
}
anyped.jump = true;
anyped._y = anyped._y - 1;
anyped.ymove = -12;
}
if (checkHint(14)) {
addTip("Avoid jumping on spikes: touching them takes away 1 health point.", "normal");
}
}
} else if (stepTile.tileType == "magma") {
if (anyped.objclass == "char") {
anyped.jump = true;
anyped._y = anyped._y - 1;
anyped.ymove = -20;
attachEffect(anyped, "fx_steamcloud");
}
} else if (stepTile.tileType == "cage") {
if (anyped.objclass == "missile") {
anyped.hp = anyped.hp - 1;
if ((selectItem4 == 6) && (stepTile.heroType != "princess")) {
gold = gold + 3;
makePickup(stepTile);
floatWords(stepTile, "+3 gp!");
stepTile.tileType = "";
attachEffect(stepTile, "fx_explosion");
stepTile.gotoAndStop(3);
snd_box.start();
tBlocked[stepTile.tilex][stepTile.tiley + dyOffset] = false;
}
}
} else if (stepTile.tileType == "normal") {
if (cIcon == 3) {
if (stepTile.sand) {
if (stepTile.count <= 0) {
attachEffect(stepTile, "fx_sandcloud");
lastFx._x = lastFx._x + 25;
tBlocked[tilex][tiley + dyOffset] = false;
removeProp(stepTile);
limboBlock = limboBlock + 1;
if (checkHint(26)) {
addTip("Desert sands are treacherously unstable: try to stay on the solid rocks!", "normal");
}
} else {
stepTile.count = stepTile.count - 1;
}
}
}
if (anyped.objclass == "missile") {
if ((anyped.b_type == "fireball") || (anyped.b_type == "familiar")) {
breakBlock(stepTile);
} else if (anyped.b_type == "breaker") {
breakBlock(stepTile);
} else if (anyped.b_type == "icebolt") {
tBlocked[tilex][tiley + dyOffset] = false;
stepTile.tileType = "";
removeProp(stepTile);
var iceTile = spawnProp("tile_icicle", tilex * 50, tiley * 50, 10);
tBlocked[tilex][tiley + dyOffset] = true;
iceTile.tileType = "icicle";
iceTile.tilex = tilex;
iceTile.tiley = tiley;
tTiles[tilex][tiley + dyOffset] = iceTile;
iceTile.swapDepths(50000 - (tilex + (tiley * 10)));
}
}
}
if ((anyped.objclass == "missile") && (stepTile.tileType != "boss")) {
if (anyped.b_type == "shuriken") {
anyped._rotation = randbtwn(0, 360);
}
if ((anyped.b_type != "shadow") && (anyped.b_type != "scimitar")) {
anyped.hp = anyped.hp - 1;
}
if (anyped.hp == 0) {
attachEffect(anyped, "fx_explosion");
removeObject(anyped);
}
}
}
}
function togglePause() {
gamePaused = !gamePaused;
if (gamePaused) {
whiteoutObj(stage);
backdrop._alpha = 50;
bigbigwords = "Game Paused!";
pausetxt = "Press P to Unpause";
} else {
unshadeObj(stage);
backdrop._alpha = 100;
bigbigwords = "";
pausetxt = "";
}
}
function makeJump(anyped) {
if (!anyped.jump) {
if (scrollSpeed == 0) {
scrollSpeed = 0.3;
}
snd_jump.start();
anyped.jump = true;
anyped._y = anyped._y - 1;
anyped.ymove = -anyped.jumpstrength;
timesJumped = timesJumped + 1;
} else if (anyped.doublejump) {
if (!anyped.jump2) {
snd_jump.start();
timesDJumped = timesDJumped + 1;
if (((selectItem4 == 5) && (anyped.hero == "ranger")) && (anyped.mana >= 1)) {
anyped.mana = anyped.mana - 1;
anyped.ymove = -10;
} else {
anyped.jump2 = true;
anyped.ymove = -12;
attachEffect(anyped, "fx_jumpcloud");
lastFx._y = lastFx._y + 15;
}
}
}
}
stop();
musiccontrol.gotoAndStop(2);
snd_btn = new Sound(this);
snd_btn.attachSound("btn_down");
snd_jump = new Sound(this);
snd_jump.attachSound("jumpsound");
snd_cash = new Sound(this);
snd_cash.attachSound("cashregister");
snd_poof = new Sound(this);
snd_poof.attachSound("rocket");
snd_box = new Sound(this);
snd_box.attachSound("sodamachine");
snd_squeak = new Sound(this);
snd_squeak.attachSound("squeak");
snd_pop = new Sound(this);
snd_pop.attachSound("pop");
snd_glass = new Sound(this);
snd_glass.attachSound("glassbreak");
snd_warp = new Sound(this);
snd_warp.attachSound("warp");
snd_badnews = new Sound(this);
snd_badnews.attachSound("badnews");
backdrop.gotoAndStop(cIcon);
var frames = 0;
var objCount = 0;
var topLayer = 0;
var princessSpawned = false;
var bossSpawned = false;
var necroSpecial = 0;
var sancSpecial = 0;
var hpmax = 4;
var lockScrolling = false;
var p1gold = 0;
var p2gold = 0;
var selectItem1 = selItem1;
var selectItem2 = selItem2;
var selectItem3 = selItem3;
var selectItem4 = selItem4;
var selectItem5 = selItem5;
if (twoPlayer) {
selectItem1 = 7;
selectItem2 = 7;
selectItem3 = 7;
selectItem4 = 7;
selectItem5 = 7;
}
var tBlocked = new Array();
var tTiles = new Array();
var targetDepth = 500;
var seconds = 0;
var shadowCount = 0;
var omniStrike = 0;
var omniCool = 0;
var omniStop = 0;
var eBoss = undefined;
var shadeNum = 0;
var gamePaused = false;
var pausetxt = "";
var autoPauseTime = 0;
var exitChances = 0;
var nextBlockCheck = false;
var nextExitDepth = 0;
if (((cIcon == 2) && (!survivalMode)) && (!twoPlayer)) {
targetDepth = 600;
targetDepth = targetDepth + (20 * levelsCompleted);
gameObj1 = "Rescue the Princess!";
gameObj2 = "Princess";
gameObj3 = "You Failed to Save the Princess!";
gameObj4 = "You Rescued the Princess!";
} else {
if (cIcon == 1) {
targetDepth = 400;
} else if (cIcon == 3) {
targetDepth = 450;
} else if (cIcon == 4) {
targetDepth = 500;
}
targetDepth = targetDepth + (15 * levelsCompleted);
gameObj1 = "Get to Any Exit!";
gameObj2 = "Exit";
gameObj3 = "You Failed to Reach the Exit!";
gameObj4 = "You Got to the Exit!";
if (survivalMode) {
gameObj1 = "Survival Round " + mRn(levelsCompleted + 1);
}
}
if (twoPlayer) {
musiccontrol.gotoAndStop(2);
targetDepth = targetDepth * 1.5;
cIcon = levelsCompleted + 1;
backdrop.gotoAndStop(cIcon);
if (sfxLevel != 2) {
musiccontrol.gotoAndStop(cIcon + 2);
}
} else if (sfxLevel != 2) {
musiccontrol.gotoAndStop(cIcon + 2);
}
var gGravity = 0.85;
var gTerminal = 16;
var dyOffset = 0;
var prevOffset = 0;
var nextMarker = 0;
var limboBlock = 0;
var nextSpecialBlock = 3;
var scrollSpeed = 0;
var key = 3;
var gold = 0;
var thisDepth = 0;
var nextChest = 0;
var upScroll = 0;
var levelComplete = false;
var currentY = 0;
var lastHero = "normal";
var heroDead = false;
var tipshow = 0;
var prevGold = 0;
var unlockedMask = false;
var i = 1;
while (i <= 10) {
tBlocked[i - 1] = new Array();
tTiles[i - 1] = new Array();
i++;
}
var targetGold = (mRn((((targetDepth / 5) - 20) / 5) - 2) * 5);
targetbox.txt = targetGold + " gold";
targettxt = "Target: " + targetGold;
if (survivalMode) {
targettxt = "Target: " + mRn(targetGold + totalgold);
}
var noKills = true;
var noHurt = true;
var noRescue = true;
var smashBlock = 0;
var smashIce = 0;
var chestsOpened = 0;
var timesJumped = 0;
var timesDJumped = 0;
var enemiesKilled = 0;
var cloudDeath = false;
var sameHeroName = "";
var sameHero = true;
newMap();
_level0.onEnterFrame = function () {
if (Key.isDown(80)) {
if (!pdp) {
pdp = true;
togglePause();
}
} else {
pdp = false;
}
if (!gamePaused) {
hpbar.gotoAndStop(pchar.hp + 1);
manaTxt = (pchar.mana + "/") + pchar.maxMana;
manabar._xscale = (pchar.mana / pchar.maxMana) * 100;
if (twoPlayer) {
hpbar2.gotoAndStop(schar.hp + 1);
manaTxt2 = (schar.mana + "/") + schar.maxMana;
manabar2._xscale = (schar.mana / schar.maxMana) * 100;
goldbox1._visible = true;
goldbox1.txt = pchar.gold + " gp";
goldbox2._visible = true;
goldbox2.txt = schar.gold + " gp";
medalbox1._visible = true;
medalbox1.txt = "x " + p1medals;
medalbox2._visible = true;
medalbox2.txt = "x " + p2medals;
p1gold = pchar.gold;
p2gold = schar.gold;
lifeDisplay = "x " + lives;
} else {
hpbar2._visible = false;
manaTxt2 = "";
manabar2._visible = false;
goldbox1._visible = false;
goldbox2._visible = false;
medalbox1._visible = false;
medalbox2._visible = false;
}
if (pchar.mana == 0) {
if (checkHint(75)) {
addTip("When you run out of mana, you can wait for it to regenerate, or look for blue potions.", "normal");
}
}
keybar.gotoAndStop(mRn(key + 1));
if (pchar.hit > 0) {
pchar.hit = pchar.hit - 1;
if (pchar.berserk) {
if (pchar.hit == 0) {
pchar.berserk = false;
pchar.container.effect.removeMovieClip();
} else if ((frames % 15) == 0) {
attachEffect(pchar, "ring_red");
}
} else {
blink = pchar.hit % 2;
if (blink == 1) {
pchar._alpha = 20;
} else {
pchar._alpha = 100;
}
}
} else {
pchar._alpha = 100;
}
if (twoPlayer) {
if (schar.hit > 0) {
schar.hit = schar.hit - 1;
if (schar.berserk) {
if (schar.hit == 0) {
schar.berserk = false;
schar.container.effect.removeMovieClip();
} else if ((frames % 15) == 0) {
attachEffect(schar, "ring_red");
}
} else {
blink = schar.hit % 2;
if (blink == 1) {
schar._alpha = 20;
} else {
schar._alpha = 100;
}
}
} else {
schar._alpha = 100;
}
}
if (shadowCount > 0) {
shadowCount = shadowCount - 1;
if ((frames % 10) == 0) {
gold = gold + 1;
shadowCaster.gold = shadowCaster.gold + 1;
}
}
if (necroSpecial > 0) {
necroSpecial = necroSpecial - 1;
if (necroSpecial <= 0) {
unshadeObj(stage);
backdrop.gotoAndStop(cIcon);
}
}
if (sancSpecial > 0) {
sancSpecial = sancSpecial - 1;
if (sancSpecial <= 0) {
backdrop.gotoAndStop(cIcon);
}
}
if (pchar.omniCool > 0) {
pchar.omniCool = pchar.omniCool - 1;
}
if (pchar.omniStop > 0) {
pchar.omniStop = pchar.omniStop - 1;
if (pchar.omniStop == 0) {
pchar.omniStrike = 0;
}
}
if (schar.omniCool > 0) {
schar.omniCool = schar.omniCool - 1;
}
if (schar.omniStop > 0) {
schar.omniStop = schar.omniStop - 1;
if (schar.omniStop == 0) {
schar.omniStrike = 0;
}
}
if (prevshadowcount > 0) {
if (shadowCount <= 0) {
unshadeObj(stage);
backdrop.gotoAndStop(cIcon);
}
}
prevshadowcount = shadowCount;
if (stage._y < 0) {
dyOffset = Math.ceil(stage._y / 50) - 1;
if (prevOffset > dyOffset) {
removeLine();
if (limboBlock > 0) {
spawnBlock();
}
}
}
frames = frames - 1;
if (frames <= 0) {
frames = 30;
seconds = seconds + 1;
if ((seconds % 2) == 0) {
if (pchar.mana < pchar.maxMana) {
pchar.mana = pchar.mana + 1;
}
if (schar.mana < schar.maxMana) {
schar.mana = schar.mana + 1;
}
}
if (scrollSpeed > 0) {
upScroll = upScroll + 1;
}
if (seconds >= 3) {
targetbox._visible = false;
}
}
clocktxt = displayLongTime(seconds);
if ((upScroll >= 7) && (!princessSpawned)) {
upScroll = 0;
scrollSpeed = scrollSpeed + 0.1;
if (tipshow == 0) {
if (scrollSpeed > 1) {
if (survivalMode) {
if (checkHint(22)) {
addTip("The map will gradually scroll faster and faster: rescue heroes to slow it down.", "normal");
}
}
}
}
}
nextMarker = nextMarker + 1;
if (tipshow > 0) {
tipbox._visible = true;
tipshow = tipshow - 1;
tipbox._y = Math.max(pchar._y + stage._y, 200);
} else {
tipbox._visible = false;
}
if (Key.isDown(37) || (Key.isDown(65) && (!twoPlayer))) {
pchar._xscale = -100;
pchar.xmove = -pchar.xspeed;
if (scrollSpeed == 0) {
scrollSpeed = 0.3;
}
} else if (Key.isDown(39) || (Key.isDown(68) && (!twoPlayer))) {
pchar._xscale = 100;
pchar.xmove = pchar.xspeed;
if (scrollSpeed == 0) {
scrollSpeed = 0.3;
}
} else {
pchar.xmove = 0;
}
if (Key.isDown(38) || (Key.isDown(87) && (!twoPlayer))) {
if (!pup) {
pup = true;
makeJump(pchar);
}
} else {
pup = false;
}
if (twoPlayer && (!aiBuddy)) {
if (Key.isDown(65)) {
schar._xscale = -100;
schar.xmove = -schar.xspeed;
if (scrollSpeed == 0) {
scrollSpeed = 0.3;
}
} else if (Key.isDown(68)) {
schar._xscale = 100;
schar.xmove = schar.xspeed;
if (scrollSpeed == 0) {
scrollSpeed = 0.3;
}
} else {
schar.xmove = 0;
}
if (Key.isDown(87)) {
if (!p2up) {
p2up = true;
makeJump(schar);
}
} else {
p2up = false;
}
}
spacebar._visible = false;
spacebar.txt = "";
var tempTile = tTiles[pchar.xloc][(pchar.yloc + dyOffset) + 1];
var ppupTile = tTiles[pchar.xloc][pchar.yloc + dyOffset];
if (twoPlayer) {
var tempTile2 = tTiles[schar.xloc][(schar.yloc + dyOffset) + 1];
var ppupTile2 = tTiles[schar.xloc][schar.yloc + dyOffset];
}
if ((ppupTile.tileType == "key") || (ppupTile2.tileType == "key")) {
levelComplete = true;
deadHero = pchar.hero;
makeFade("gameover");
pchar.dead = true;
backdrop.gotoAndStop(7);
_level0.onEnterFrame = function () {
if (pchar._xscale > 0) {
pchar._xscale = pchar._xscale - 10;
} else {
pchar._xscale = pchar._xscale + 10;
}
pchar._yscale = pchar._yscale - 10;
pchar._rotation = pchar._rotation + 10;
};
}
if ((tempTile.tileType == "cage") && (pchar.ymove <= 3)) {
rescue_sign._x = pchar._x + stage._x;
rescue_sign._y = pchar._y + stage._y;
if (checkHint(8)) {
addTip("When standing on a cage, press DOWN to open it and free the hero inside!", "normal");
}
} else {
rescue_sign._y = -200;
}
if (twoPlayer) {
if ((tempTile2.tileType == "cage") && (schar.ymove <= 3)) {
rescue_sign2._x = schar._x + stage._x;
rescue_sign2._y = schar._y + stage._y;
if (checkHint(8)) {
addTip("When standing on a cage, press DOWN to open it and free the hero inside! You will gain gold and mana.", "normal");
}
} else {
rescue_sign2._y = -200;
}
}
if (Key.isDown(40) || (Key.isDown(83) && (!twoPlayer))) {
if (!pdown) {
pdown = true;
if ((tempTile.tileType == "cage") && (pchar.ymove <= 3)) {
openCage(tempTile, pchar);
}
}
} else {
pdown = false;
}
if (twoPlayer) {
if (Key.isDown(83)) {
if (!p2down) {
p2down = true;
if ((tempTile2.tileType == "cage") && (schar.ymove <= 3)) {
openCage(tempTile2, schar);
}
}
} else {
p2down = false;
}
}
if (aiBuddy) {
if (tempTile2.tileType == "cage") {
openCage(tempTile2, schar);
}
}
if (pchar.hero == "ranger") {
spacebar._visible = true;
spacebar.txt = "Shoot Arrow (1 Mana)";
if (selectItem4 == 3) {
spacebar.txt = "Holy Bolt (2 Mana)";
}
} else if ((pchar.hero == "paladin") && (tempTile.tileType == "normal")) {
if (pchar.ymove <= 3) {
spacebar._visible = true;
spacebar.txt = "Stomp (3 Mana)";
if (selectItem3 == 1) {
spacebar.txt = "Dragon Stomp (5 Mana)";
}
if (selectItem3 == 2) {
spacebar.txt = "Platemail Stomp (0 Mana)";
}
}
} else if (pchar.hero == "thief") {
spacebar._visible = true;
spacebar.txt = "Escape (3 Mana)";
if (selectItem5 == 3) {
spacebar.txt = "Shuriken (2 Mana)";
} else if (selectItem5 == 5) {
spacebar.txt = "Shadow (10 Mana)";
}
} else if (pchar.hero == "mage") {
spacebar._visible = true;
spacebar.txt = "Fireball (3 Mana)";
if (selectItem2 == 1) {
spacebar.txt = "Soul Rip (3 Mana)";
} else if (selectItem2 == 2) {
spacebar.txt = "Ice Bolt (1 Mana)";
} else if (selectItem2 == 3) {
spacebar.txt = "Familiar (3 Mana)";
} else if (selectItem2 == 4) {
spacebar.txt = "Flame Fan (4 Mana)";
} else if (selectItem2 == 5) {
spacebar.txt = "Sanctuary (10 Mana)";
}
} else if (pchar.hero == "barbarian") {
if (pchar.hit == 0) {
spacebar._visible = true;
spacebar.txt = "Berserk (10 Mana)";
}
if (selectItem1 == 1) {
spacebar.txt = "Shadow Clone (5 Mana)";
} else if (selectItem1 == 2) {
spacebar.txt = "Omnistrike (5 Mana)";
} else if (selectItem1 == 4) {
spacebar.txt = "Summon Blades (1 Mana)";
}
}
if (Key.isDown(81)) {
if (!pdq) {
pdq = true;
if (twoPlayer || (pchar.hero == "normal")) {
heroDead = true;
deathNote = "You gave up!";
deadMethod = 1;
attachEffect(pchar, "fx_explosion");
pchar.dead = true;
deadHero = pchar.hero;
deadLoc = thisDepth;
deadMethod = 2;
makeFade("gameover");
_level0.onEnterFrame = null;
} else {
attachEffect(pchar, "effect_ninjasmoke");
dressHero(pchar, "normal");
}
}
} else {
pdq = false;
}
if (twoPlayer) {
if (Key.isDown(13) || (Key.isDown(32))) {
if (!pds1) {
pds1 = true;
specialAbility(pchar);
}
} else {
pds1 = false;
}
if (Key.isDown(16)) {
if (!pds2) {
pds2 = true;
specialAbility(schar);
}
} else {
pds2 = false;
}
} else if (Key.isDown(32)) {
if (!pds) {
pds = true;
specialAbility(pchar);
}
} else {
pds = false;
}
if (eBoss.hit > 0) {
eBoss.hit = eBoss.hit - 1;
eblink = eBoss.hit % 2;
if (eblink == 1) {
eBoss._alpha = 20;
} else {
eBoss._alpha = 100;
}
} else {
eBoss._alpha = 100;
}
if ((bossSpawned && (eBoss != undefined)) && ((eBoss._y + stage._y) < 500)) {
boss_bar._visible = true;
boss_bar.txtname = bossName[bossNum];
boss_bar.lifebar._xscale = (eBoss.hp / eBoss.maxhp) * 100;
stage._y = stage._y - (((eBoss._y + stage._y) - 275) / 20);
} else {
boss_bar._visible = false;
lockSpot = 220;
var lowchar;
if (twoPlayer) {
if (pchar.y > schar.y) {
lowchar = pchar;
} else {
lowchar = schar;
}
} else {
lowchar = pchar;
}
if (!lockScrolling) {
if ((lowchar._y + stage._y) > lockSpot) {
stage._y = stage._y - (((lowchar._y + stage._y) - lockSpot) / 15);
startScroll = true;
}
}
if (startScroll && (survivalMode)) {
stage._y = stage._y - (scrollSpeed * 2);
} else if (shadowCount > 0) {
stage._y = stage._y - 2;
}
}
if (!pchar.dead) {
thisDepth = mRn(((-stage._y) + 300) / 10);
if ((gold > targetGold) || (thisDepth > targetDepth)) {
bigbigwords = gameObj1;
backdrop._alpha = 40;
} else {
bigbigwords = "";
}
}
if (!twoPlayer) {
if (!pchar.dead) {
if ((((((pchar._y + stage._y) < 0) && (!pchar.jump)) || ((pchar._y + stage._y) < -30)) || ((pchar._y + stage._y) > 525)) || (pchar.hp <= 0)) {
deadHero = pchar.hero;
deadLoc = thisDepth;
if (pchar.hp <= 0) {
deathNote = "Your Hero was Killed!";
heroDead = true;
deadMethod = 2;
} else if ((((pchar._y + stage._y) < 0) && (!pchar.jump)) || ((pchar._y + stage._y) < -30)) {
deathNote = "Your Hero Was Too Slow!";
deadMethod = 2;
heroDead = true;
cloudDeath = true;
} else if ((pchar._y + stage._y) > 525) {
deathNote = "Your Hero Fell To His Death!";
heroDead = true;
deadMethod = 1;
}
attachEffect(pchar, "fx_explosion");
pchar.dead = true;
makeFade("gameover");
_level0.onEnterFrame = null;
}
}
} else {
if (!pchar.dead) {
if (((pchar._y + stage._y) < 25) || (pchar.hp <= 0)) {
twoplayerDeath(pchar);
}
if (pchar.hp <= 0) {
snd_badnews.start();
lives = lives - 1;
pchar.hp = hpmax;
dressHero(pchar, "normal");
penalty = mRn(pchar.gold / 4);
pchar.gold = pchar.gold - penalty;
floatWords(pchar, ("PENALTY -" + penalty) + "gp!");
schar.gold = schar.gold + penalty;
floatWords(schar, ("BONUS +" + penalty) + "gp!");
}
}
if (!schar.dead) {
if (((schar._y + stage._y) < 25) || (schar.hp <= 0)) {
twoplayerDeath(schar);
}
if (schar.hp <= 0) {
snd_badnews.start();
lives = lives - 1;
schar.hp = hpmax;
dressHero(schar, "normal");
penalty = mRn(schar.gold / 4);
schar.gold = schar.gold - penalty;
floatWords(schar, ("PENALTY -" + penalty) + "gp!");
pchar.gold = pchar.gold + penalty;
floatWords(pchar, ("BONUS +" + penalty) + "gp!");
}
}
if (lives < 0) {
deathNote = "You ran out of lives!";
heroDead = true;
deadMethod = 2;
attachEffect(pchar, "fx_explosion");
attachEffect(schar, "fx_explosion");
pchar.dead = true;
schar.dead = true;
makeFade("gameover");
_level0.onEnterFrame = null;
}
}
if (!survivalMode) {
goldDisplay = ("x " + mRn(gold)) + " gp";
} else {
goldDisplay = ("x " + mRn(gold + totalgold)) + " gp";
}
goldBroken = false;
bossClearance = false;
var prop_i = 0;
while (prop_i <= propCount) {
var thisProp = stage["prop" + dd(prop_i)];
if (!thisProp.isDead) {
if (thisProp.tileType == "explosive") {
if ((sancSpecial > 0) && ((thisProp._y + stage._y) < 500)) {
thisProp.isDead = true;
breakBlock(thisProp);
makePickup(thisProp);
snd_pop.start();
}
}
if (bossSpawned && (eBoss == undefined)) {
if ((!goldBroken) && ((frames % 10) == 0)) {
if ((thisProp.tileType == "bossgold") && ((thisProp._y + stage._y) < 500)) {
thisProp.isDead = true;
breakBlock(thisProp);
goldBroken = true;
snd_pop.start();
}
}
}
if ((bossSpawned && (eBoss != undefined)) && ((eBoss._y + stage._y) < 350)) {
if ((!bossClearance) && ((frames % 15) == 0)) {
if ((((thisProp.tileType != "bossgold") && (thisProp.tileType != "solidgold")) && (thisProp.tileType != "icicle")) && ((thisProp._y + stage._y) < 500)) {
thisProp.isDead = true;
breakBlock(thisProp);
bossClearance = true;
}
}
}
if (thisProp.tileType == "sliding") {
thisProp.count = thisProp.count + 1;
if (thisProp.count >= 90) {
thisProp.count = 0;
thisProp.tileStatus = !thisProp.tileStatus;
if (thisProp.tileStatus) {
thisProp.gotoAndStop(1);
tBlocked[thisProp.tilex][thisProp.tiley + dyOffset] = true;
if (pchar.xloc == thisProp.tilex) {
if (pchar.yloc == thisProp.tiley) {
pchar.jump = true;
pchar.ymove = -12;
}
}
} else {
thisProp.gotoAndStop(2);
tBlocked[thisProp.tilex][thisProp.tiley + dyOffset] = false;
}
}
}
if (thisProp.tileType == "geyser") {
thisProp.count = thisProp.count + 1;
if (thisProp.count >= 100) {
thisProp.count = 0;
var newDart = fireMissile(thisProp, -90, "geyser", 1);
attachEffect(thisProp, "fx_explosion");
newDart._y = newDart._y - 50;
newDart._x = newDart._x + 12;
lastFx._y = lastFx._y + 25;
lastFx._x = lastFx._x + 25;
}
}
if (thisProp.tileType == "firevent") {
thisProp.count = thisProp.count + 1;
if (thisProp.count >= 100) {
thisProp.count = 0;
var newDart = fireMissile(thisProp, -45, "magmaball", 1);
newDart._y = newDart._y - 50;
newDart._x = newDart._x + 12;
var newDart = fireMissile(thisProp, 225, "magmaball", 1);
newDart._y = newDart._y - 50;
newDart._x = newDart._x + 12;
attachEffect(thisProp, "fx_explosion");
lastFx._y = lastFx._y + 25;
lastFx._x = lastFx._x + 25;
}
}
if (thisProp.tileType == "idolhead") {
thisProp.count = thisProp.count + 1;
if (thisProp.count >= 100) {
thisProp.count = 0;
if (thisProp.tileStatus) {
var newDart = fireMissile(thisProp, 180, "dart", 1);
} else {
var newDart = fireMissile(thisProp, 0, "dart", 1);
}
attachEffect(thisProp, "fx_explosion");
newDart._y = newDart._y + 25;
lastFx._y = lastFx._y + 25;
lastFx._x = lastFx._x + 25;
}
}
if (thisProp.heroType == "princess") {
if ((thisProp._y + stage._y) <= 400) {
lockScrolling = true;
}
}
if ((thisProp._y + stage._y) < -50) {
currentY = thisProp.tiley;
limboBlock = limboBlock + 1;
thisProp.isDead = true;
removeProp(thisProp);
}
}
prop_i++;
}
var aiMissileAlert = false;
var aiEnemyAlert = true;
var aiPickup = false;
var aiThreat = 0;
if (objCount == undefined) {
objCount = 0;
}
var obj_i = 0;
while (obj_i <= objCount) {
var thisObj = stage["obj" + dd(obj_i)];
if (!thisObj.isDead) {
thisObj.xTile = Math.ceil((thisObj._x + (thisObj._xscale / 100)) / 50) - 1;
thisObj.yTile = Math.ceil((thisObj._y + 1) / 50) - 1;
thisObj.bodyTile = Math.ceil((thisObj._y - 5) / 50) - 1;
thisObj.nextTile = Math.ceil((thisObj._x + ((12 * thisObj._xscale) / 100)) / 50) - 1;
thisObj.landTile = Math.ceil((thisObj._y + 25) / 50) - 1;
if (thisObj.objclass == "missile") {
var bltAngle = thisObj._rotation;
bltAngle = (bltAngle / 180) * mPi;
thisObj._x = thisObj._x + (((thisObj.speed * mCo(bltAngle)) * thisObj._xscale) / 100);
thisObj._y = thisObj._y + (((thisObj.speed * mSi(bltAngle)) * thisObj._xscale) / 100);
if ((((thisObj._x < -50) || (thisObj._x > 550)) || ((thisObj._y + stage._y) > 550)) || ((thisObj._y + stage._y) < -50)) {
removeObject(thisObj);
}
if ((thisObj.owner == 1) || (thisObj.owner == 3)) {
activateTile(thisObj, thisObj.xTile, thisObj.yTile);
} else {
if ((((((tBlocked[thisObj.xTile][thisObj.yTile + dyOffset] && (thisObj.b_type != "dart")) && (thisObj.b_type != "geyser")) && (thisObj.b_type != "icebolt")) && (thisObj.b_type != "fireball")) && (thisObj.b_type != "snowball")) && (thisObj.b_type != "trunk")) {
thisObj.hp = 0;
}
if (thisObj.b_type == "snowball") {
if ((tTiles[thisObj.xTile][thisObj.yTile + dyOffset].tileType == "icicle") || (tTiles[thisObj.xTile][thisObj.yTile + dyOffset].tileType == "normal")) {
breakBlock(tTiles[thisObj.xTile][thisObj.yTile + dyOffset]);
limboBlock = limboBlock + 1;
} else if (!tBlocked[thisObj.xTile][thisObj.yTile + dyOffset]) {
if (randbtwn(1, 30) == 2) {
if (((thisObj.xTile >= 3) && (thisObj.xTile <= 7)) && ((thisObj._y + stage._y) > 150)) {
var iceTile = spawnProp("tile_icicle", thisObj.xTile * 50, thisObj.yTile * 50, 10);
tBlocked[thisObj.xTile][thisObj.yTile + dyOffset] = true;
iceTile.tileType = "icicle";
iceTile.tilex = thisObj.xTile;
iceTile.tiley = thisObj.yTile;
tTiles[thisObj.xTile][thisObj.yTile + dyOffset] = iceTile;
iceTile.swapDepths(50000 - (thisObj.xTile + (thisObj.yTile * 10)));
limboBlock = limboBlock - 1;
removeObject(thisObj);
}
}
}
}
}
if (thisObj.b_type == "familiar") {
if (thisObj._rotation == 0) {
if (tBlocked[thisObj.xTile + 1][thisObj.yTile + dyOffset] || (thisObj.xTile == 9)) {
activateTile(thisObj, thisObj.xTile + 1, thisObj.yTile);
thisObj._rotation = randbtwn(0, 3) * 90;
}
} else if (thisObj._rotation == 90) {
if (tBlocked[thisObj.xTile][(thisObj.yTile + dyOffset) + 1]) {
activateTile(thisObj, thisObj.xTile, thisObj.yTile + 1);
thisObj._rotation = randbtwn(0, 3) * 90;
}
} else if (thisObj._rotation == 180) {
if (tBlocked[thisObj.xTile - 1][thisObj.yTile + dyOffset] || (thisObj.xTile == 1)) {
activateTile(thisObj, thisObj.xTile - 1, thisObj.yTile);
thisObj._rotation = randbtwn(0, 3) * 90;
}
} else if (thisObj._rotation == 270) {
if (tBlocked[thisObj.xTile][(thisObj.yTile + dyOffset) - 1]) {
activateTile(thisObj, thisObj.xTile, thisObj.yTile - 1);
thisObj._rotation = randbtwn(0, 3) * 90;
}
}
}
if (thisObj.b_type == "scimitar") {
thisObj._rotation = thisObj._rotation + thisObj.spindir;
}
if (thisObj.hp <= 0) {
attachEffect(thisObj, "fx_explosion");
removeObject(thisObj);
}
if ((thisObj.yloc == schar.yloc) && (Math.abs(thisObj.xloc - schar.xloc) <= 2)) {
aiMissileAlert = true;
}
}
if (thisObj.objclass == "char") {
corners(thisObj.x, thisObj.y + thisObj.ymove, thisObj);
thisObj.xloc = int(thisObj.x / 50);
thisObj.yloc = int((thisObj.y + thisObj.ymove) / 50);
if (thisObj.ymove < -2) {
thisObj.ymove = thisObj.ymove * gGravity;
if (thisObj.ymove > -2) {
thisObj.ymove = -thisObj.ymove;
}
} else if (thisObj.ymove < gTerminal) {
thisObj.ymove = thisObj.ymove + 0.1;
thisObj.ymove = thisObj.ymove * (2 - gGravity);
}
if (thisObj.ymove < 0) {
if (thisObj.cURi && (thisObj.cULi)) {
thisObj.y = thisObj.y + thisObj.ymove;
} else {
thisObj.y = (thisObj.yloc * 50) + thisObj.actheight;
thisObj.ymove = 2;
}
} else if (thisObj.ymove > 0) {
if (thisObj.cBLi && (thisObj.cBRi)) {
thisObj.y = thisObj.y + thisObj.ymove;
} else {
thisObj.y = ((thisObj.yloc + 1) * 50) - thisObj.actheight;
thisObj.ymove = 0;
thisObj.jump = false;
thisObj.jump2 = false;
if ((thisObj.owner == 1) || (thisObj.owner == 3)) {
if (shadowCount == 0) {
activateTile(thisObj, thisObj.xTile, thisObj.yTile + 1);
}
}
}
}
corners(thisObj.x + thisObj.xmove, thisObj.y, thisObj);
thisObj.xloc = int(thisObj.x / 50);
thisObj.yloc = int(thisObj.y / 50);
if (thisObj.cd_anim > 0) {
thisObj.cd_anim = thisObj.cd_anim - 1;
}
if (thisObj.xmove == 0) {
if ((!thisObj.jump) && (thisObj.cd_anim == 0)) {
thisObj.top.body.arm.gotoAndStop(1);
}
thisObj.legs.gotoAndStop(1);
} else if (thisObj.xmove < 0) {
if (!thisObj.armed) {
thisObj.top.body.arm.play();
}
thisObj.legs.play();
if (((thisObj.cULi && (thisObj.cMLi)) && (thisObj.cBLi)) && (thisObj._x > (50 + thisObj.actwidth))) {
thisObj._xscale = -100;
thisObj.x = thisObj.x + thisObj.xmove;
canfall(thisObj);
}
} else if (thisObj.xmove > 0) {
if (!thisObj.armed) {
thisObj.top.body.arm.play();
}
thisObj.legs.play();
if (((thisObj.cURi && (thisObj.cMRi)) && (thisObj.cBRi)) && (thisObj._x < (500 - thisObj.actwidth))) {
thisObj._xscale = 100;
thisObj.x = thisObj.x + thisObj.xmove;
canfall(thisObj);
}
}
thisObj._x = thisObj.x;
thisObj._y = thisObj.y;
}
if (thisObj.objclass == "pickup") {
if (thisObj.xloc == schar.xloc) {
aiPickup = true;
}
}
if (((thisObj != pchar) && ((thisObj != schar) || (aiBuddy))) && (thisObj.objclass == "char")) {
if (thisObj != schar) {
if (((thisObj._y + stage._y) < 0) || ((thisObj._y + stage._y) > 850)) {
removeObject(thisObj);
}
}
if (randbtwn(1, 60) == 1) {
thisObj.xmove = (randbtwn(0, 2) - 1) * thisObj.basespeed;
}
if (thisObj.owner == 2) {
if (thisObj.yloc == schar.yloc) {
if (thisObj.xloc == schar.xloc) {
aiEnemyAlert = true;
}
}
if (thiObj.yloc == schar.yloc) {
if (thisObj.xloc < schar.xloc) {
aiThreat = -1;
} else if (thisObj.xloc > schar.xloc) {
aiThreat = 1;
}
}
if (necroSpecial > 0) {
if (thisObj == eBoss) {
bossHit(1);
} else if ((thisObj._y + stage._y) < 500) {
necroCaster.gold = necroCaster.gold + thisObj.bounty;
killEnemy(thisObj);
}
}
if ((thisObj._y + stage._y) < 500) {
checkStrike(thisObj, pchar);
checkStrike(thisObj, schar);
}
if (!thisObj.jump) {
if ((((!thisObj.cMRi) && (!thisObj.cLRi)) && (!thisObj.cMLi)) && (!thisObj.cLLi)) {
removeObject(thisObj);
}
}
}
if (thisObj.canJump > 0) {
if (randbtwn(1, 60) == 1) {
if (!thisObj.jump) {
thisObj.jump = true;
thisObj.ymove = -thisObj.canJump;
}
}
}
if (thisObj == schar) {
var aiBrick = new Array();
var aiBrickDanger = new Array();
var aiBrickGood = new Array();
aib = 1;
while (aib <= 3) {
aiBrick[aib] = "";
aiBrickDanger[aib] = false;
aiBrickGood[aib] = false;
aibx = 1;
while (aibx <= 5) {
if (tBlocked[(schar.xloc + aib) - 2][(schar.yloc + dyOffset) + aibx]) {
aiBrick[aib] = tTiles[(schar.xloc + aib) - 2][(schar.yloc + dyOffset) + aibx].tileType;
if ((aiBrick[aib] == "spike") || (aiBrick[aib] == "firevent")) {
aiBrickDanger[aib] = true;
} else if ((aiBrick[aib] == "cage") || (aiBrick[aib] == "explosive")) {
aiBrickGood[aib] = true;
}
aibx = 99;
}
aibx++;
}
aib++;
}
if ((thisObj.ranged != "") && (thisObj.mana > 3)) {
if (aiThreat == -1) {
thisObj._xscale = -100;
specialAbility(thisObj);
} else if (aiThreat == 1) {
thisObj._xscale = 100;
specialAbility(thisObj);
}
}
if (randbtwn(1, 10) == 3) {
if (thisObj.yloc > (pchar.yloc + 2)) {
if ((thisObj.xmove != 0) || (aiPickup)) {
thisObj.xmove = 0;
} else if (randbtwn(1, 60) == 2) {
thisObj.xmove = thisObj.basespeed;
if (randbtwn(1, 10) <= 5) {
thisObj.xmove = -thisObj.xmove;
}
}
} else {
if (aiPickup) {
thisObj.xmove = 0;
}
if (randbtwn(1, 10) <= 5) {
if (thisObj.xmove == 0) {
thisObj.xmove = thisObj.basespeed;
if (randbtwn(1, 10) <= 5) {
thisObj.xmove = -thisObj.xmove;
}
}
}
if (((randbtwn(1, 20) == 5) || (aiMissileAlert)) || (aiEnemyAlert && (thisObj.yloc > ((-dyOffset) + 3)))) {
makeJump(thisObj);
}
}
if ((randbtwn(1, 5) == 3) && (thisObj.mana > 5)) {
specialAbility(thisObj);
}
if (aiBrickDanger[1] && (thisObj.xmove < 0)) {
thisObj.xmove = -thisObj.xmove;
}
if (aiBrickDanger[2] && (thisObj.xmove == 0)) {
thisObj.xmove = thisObj.basespeed;
if (randbtwn(1, 10) <= 5) {
thisObj.xmove = -thisObj.xmove;
}
}
if (aiBrickDanger[3] && (thisObj.xmove > 0)) {
thisObj.xmove = -thisObj.xmove;
}
if (aiBrickGood[1] && (thisObj.xmove >= 0)) {
thisObj.xmove = -thisObj.basespeed;
}
if (aiBrickGood[2] && (thisObj.xmove != 0)) {
thisObj.xmove = 0;
}
if (aiBrickGood[3] && (thisObj.xmove <= 0)) {
thisObj.xmove = thisObj.basespeed;
}
}
}
if (thisObj.objclass == "char") {
if (!thisObj.jump) {
if (((thisObj.xmove < 0) && (thisObj.cBLi || (!thisObj.cMLi))) || ((thisObj.xmove > 0) && (thisObj.cBRi || (!thisObj.cMRi)))) {
if (((thisObj.owner != 1) && (thisObj.owner != 3)) || (randbtwn(1, 10) == 2)) {
thisObj.xmove = -thisObj.xmove;
} else if (thisObj == schar) {
if (randbtwn(1, 10) == 3) {
makeJump(thisObj);
}
} else {
thisObj.jump = true;
thisObj.ymove = -thisObj.canJump;
}
if ((thisObj.owner == 1) || (thisObj.owner == 3)) {
if ((thisObj.xmove < 0) && (thisObj._x <= 70)) {
thisObj.xmove = -thisObj.xmove;
} else if ((thisObj.xmove > 0) && (thisObj._x >= 480)) {
thisObj.xmove = -thisObj.xmove;
}
}
}
}
}
if ((thisObj._y + stage._y) < 500) {
if (thisObj.ranged != "") {
if (thisObj.cd_anim == 0) {
thisObj.cd_anim = 90;
thisObj.top.body.arm.gotoAndPlay("attack_melee");
if (thisObj == eBoss) {
if (thisObj._xscale > 0) {
if (bossNum == 1) {
fireMissile(thisObj, 45, thisObj.ranged, 1);
fireMissile(thisObj, 0, thisObj.ranged, 1);
fireMissile(thisObj, -45, thisObj.ranged, 1);
} else if (bossNum == 2) {
mis1 = fireMissile(thisObj, 0, thisObj.ranged, 1);
mis2 = fireMissile(thisObj, -90, thisObj.ranged, 1);
} else if (bossNum == 3) {
fireMissile(thisObj, -45, thisObj.ranged, 1);
fireMissile(thisObj, 0, thisObj.ranged, 1);
if (shadeNum < 3) {
newShade = spawnChar("shade", randbtwn(3, 9), (-dyOffset) + randbtwn(4, 6));
shadeNum = shadeNum + 1;
}
attachEffect(newShade, "effect_ninjasmoke");
} else if (bossNum == 4) {
fireMissile(thisObj, -45, "icebolt", 1);
fireMissile(thisObj, 0, "icebolt", 1);
fireMissile(thisObj, 30, thisObj.ranged, 1);
fireMissile(thisObj, 60, thisObj.ranged, 1);
}
} else if (bossNum == 1) {
fireMissile(thisObj, 225, thisObj.ranged, 1);
fireMissile(thisObj, 180, thisObj.ranged, 1);
fireMissile(thisObj, 135, thisObj.ranged, 1);
} else if (bossNum == 2) {
mis1 = fireMissile(thisObj, 180, thisObj.ranged, 1);
mis2 = fireMissile(thisObj, -90, thisObj.ranged, 1);
} else if (bossNum == 3) {
fireMissile(thisObj, 225, thisObj.ranged, 1);
fireMissile(thisObj, 180, thisObj.ranged, 1);
if (shadeNum < 3) {
newShade = spawnChar("shade", randbtwn(3, 9), (-dyOffset) + randbtwn(4, 6));
shadeNum = shadeNum + 1;
}
attachEffect(newShade, "effect_ninjasmoke");
} else if (bossNum == 4) {
fireMissile(thisObj, 225, "icebolt", 1);
fireMissile(thisObj, 180, "icebolt", 1);
fireMissile(thisObj, 150, thisObj.ranged, 1);
fireMissile(thisObj, 120, thisObj.ranged, 1);
}
if (bossNum == 2) {
mis1._rotation = 90;
mis1._x = (randbtwn(3, 4) * 50) + 25;
mis1._y = (-stage._y) + 75;
mis2._rotation = 90;
mis2._x = (randbtwn(6, 7) * 50) + 25;
mis2._y = (-stage._y) + 75;
}
} else if (thisObj._xscale > 0) {
fireMissile(thisObj, 0, thisObj.ranged, 1);
} else {
fireMissile(thisObj, 180, thisObj.ranged, 1);
}
}
}
}
}
var tobj_i = 1;
while (tobj_i <= objCount) {
var tempObj = stage["obj" + dd(tobj_i)];
if (shadowCount == 0) {
if (!tempObj.isDead) {
if ((thisObj.owner == 1) || (thisObj.owner == 3)) {
if (thisObj != tempObj) {
if (thisObj.owner != tempObj.owner) {
if (tempObj.box.hitTest(thisObj.box)) {
if (twoPlayer) {
selectItem1 = 7;
selectItem2 = 7;
selectItem3 = 7;
selectItem4 = 7;
selectItem5 = 7;
var selArray = new Array();
if (thisObj == pchar) {
selArray = p1SelItem;
} else if (thisObj == schar) {
selArray = p2SelItem;
}
selectItem1 = selArray[1];
selectItem2 = selArray[2];
selectItem3 = selArray[3];
selectItem4 = selArray[4];
selectItem5 = selArray[5];
}
if (thisObj.objclass == "missile") {
if (((thisObj.owner == 1) && (tempObj.owner == 3)) || ((thisObj.owner == 3) && (tempObj.owner == 1))) {
tempObj.jump = true;
tempObj.ymove = -10;
} else if (tempObj.objclass == "char") {
if (tempObj == eBoss) {
bossHit(1);
thisObj.hp = 0;
} else {
if (thisObj.b_type == "holybolt") {
spawnPickup("redpotion", tempObj.xloc, tempObj.yloc + 1);
} else if (thisObj.b_type == "icebolt") {
var iceTile = spawnProp("tile_icicle", tempObj.xloc * 50, tempObj.yloc * 50, 10);
tBlocked[tempObj.xloc][tempObj.yloc + dyOffset] = true;
iceTile.tileType = "icicle";
iceTile.tilex = tempObj.xloc;
iceTile.tiley = tempObj.yloc;
tTiles[tempObj.xloc][tempObj.yloc + dyOffset] = iceTile;
iceTile.swapDepths(50000 - (tempObj.xloc + (tempObj.yloc * 10)));
limboBlock = limboBlock - 1;
removeObject(thisObj);
}
if (thisObj.b_type == "shuriken") {
thisObj._rotation = randbtwn(0, 360);
} else {
thisObj.hp = thisObj.hp - 1;
}
if (thisObj.owner == 1) {
pchar.gold = pchar.gold + tempObj.bounty;
} else if (thisObj.owner == 3) {
schar.gold = schar.gold + tempObj.bounty;
}
killEnemy(tempObj);
}
}
} else if (tempObj.objclass == "missile") {
if (((thisObj.owner == 1) && (tempObj.owner == 3)) || ((thisObj.owner == 3) && (tempObj.owner == 1))) {
thisObj.jump = true;
thisObj.ymove = -10;
} else if (thisObj.hit == 0) {
if ((tempObj.b_type == "geyser") || (tempObj.b_type == "snowball")) {
thisObj.jump = true;
thisObj.ymove = -15;
} else if (((selectItem5 == 4) && (thisObj.hero == "thief")) && (thisObj.mana >= 5)) {
thisObj.mana = thisObj.mana - 5;
escapeThief(thisObj);
} else if (((thisObj.hero == "paladin") && (selectItem3 == 3)) && (!tempObj.unblockable)) {
tempObj.hp = 0;
fireMissile(thisObj, tempObj._rotation + 180, tempObj.b_type, 1);
thisObj.top.body.arm.gotoAndPlay("attack_melee");
thisObj.cd_anim = 10;
} else if (((thisObj.hero == "barbarian") && (selectItem1 == 3)) && (!tempObj.unblockable)) {
tempObj.hp = 0;
fireMissile(thisObj, (tempObj._rotation - 45) + 180, tempObj.b_type, 1);
fireMissile(thisObj, (tempObj._rotation + 45) + 180, tempObj.b_type, 1);
thisObj.top.body.arm.gotoAndPlay("attack_melee");
thisObj.cd_anim = 10;
} else if ((((thisObj.hero != "paladin") || ((thisObj._xscale > 0) && (tempObj._rotation == 0))) || ((thisObj._xscale < 0) && (tempObj._rotation == 180))) || (selectItem3 == 4)) {
loseHP(thisObj);
}
tempObj.hp = 0;
}
} else if (tempObj.objclass == "char") {
if (((thisObj.owner == 1) && (tempObj.owner == 3)) || ((thisObj.owner == 3) && (tempObj.owner == 1))) {
if (((thisObj.ymove > 3) && (thisObj._y < tempObj._y)) && ((!tempObj.jump) || (tempObj.jump && (tempObj.ymove < 0)))) {
thisObj.jump = true;
thisObj.ymove = -10;
if (tempObj.jump) {
tempObj.ymove = 3;
}
} else if (((tempObj.ymove > 3) && (tempObj._y < thisObj._y)) && ((!thisObj.jump) || (thisObj.jump && (thisObj.ymove < 0)))) {
tempObj.jump = true;
tempObj.ymove = -10;
if (thisObj.jump) {
thisObj.ymove = 3;
}
}
} else if (thisObj.armed) {
if (tempObj == eBoss) {
if (eBoss.hit == 0) {
bossHit(1);
thisObj.top.body.arm.gotoAndPlay("attack_melee");
thisObj.cd_anim = 10;
} else if (((selectItem5 == 4) && (thisObj.hero == "thief")) && (thisObj.mana >= 5)) {
thisObj.mana = thisObj.mana - 5;
escapeThief(thisObj);
} else if (thisObj.hit == 0) {
loseHP(thisObj);
thisObj.jump = true;
thisObj.ymove = -10;
}
} else {
attachEffect(tempObj, "effect_slash");
thisObj.top.body.arm.gotoAndPlay("attack_melee");
thisObj.cd_anim = 10;
if (selectItem1 == 5) {
if (thisObj.hero == "barbarian") {
if (thisObj.berserk) {
gold = gold + tempObj.bounty;
thisObj.gold = thisObj.gold + tempObj.bounty;
floatWords(tempObj, ("+" + tempObj.bounty) + " gp!");
if (thisObj.hp < hpmax) {
thisObj.hp = thisObj.hp + 1;
}
}
}
}
thisObj.gold = thisObj.gold + tempObj.bounty;
killEnemy(tempObj);
}
} else if ((thisObj.ymove > 0) && (thisObj._y < (tempObj._y - 5))) {
if (!tempObj.noStomp) {
if (tempObj == eBoss) {
bossHit(1);
} else {
thisObj.gold = thisObj.gold + tempObj.bounty;
killEnemy(tempObj);
if (selectItem1 == 5) {
if (thisObj.hero == "barbarian") {
if (thisObj.berserk) {
if (thisObj.hp < hpmax) {
thisObj.hp = thisObj.hp + 1;
}
}
}
}
}
} else {
if (((selectItem5 == 4) && (thisObj.hero == "thief")) && (thisObj.mana >= 5)) {
thisObj.mana = thisObj.mana - 5;
escapeThief(thisObj);
} else if (thisObj.hit == 0) {
loseHP(thisObj);
}
if (checkHint(21)) {
addTip("Watch out: these enemies hurt you if you try to jump on their heads.", "normal");
}
}
thisObj.jump = true;
thisObj.ymove = -10;
if (checkHint(12)) {
addTip("Most (but not all!) enemies can be killed by jumping on their heads.", "normal");
}
} else if (((selectItem5 == 4) && (thisObj.hero == "thief")) && (thisObj.mana >= 5)) {
thisObj.mana = thisObj.mana - 5;
escapeThief(thisObj);
} else if (thisObj.hit == 0) {
loseHP(thisObj);
tempObj.top.body.arm.gotoAndPlay("attack_melee");
tempObj.cd_anim = 10;
}
} else if (tempObj.objclass == "pickup") {
attachEffect(tempObj, "fx_explosion");
if (tempObj.ptype == "redpotion") {
floatWords(pchar, "+hp!");
snd_btn.start();
if (thisObj.hp < hpmax) {
thisObj.hp = thisObj.hp + 1;
}
} else if (tempObj.ptype == "manapotion") {
snd_btn.start();
floatWords(thisObj, "+mana!");
thisObj.mana = thisObj.mana + 5;
if (selectItem2 == 6) {
thisObj.mana = thisObj.mana + 5;
}
if (thisObj.mana > pchar.maxMana) {
thisObj.mana = pchar.maxMana;
}
} else if (tempObj.ptype == "goldcoins") {
if (selectItem5 == 6) {
floatWords(thisObj, "+3 gp!");
gold = gold + 3;
thisObj.gold = thisObj.gold + 3;
} else {
floatWords(thisObj, "+1 gp!");
gold = gold + 1;
thisObj.gold = thisObj.gold + 1;
}
snd_cash.start();
} else if (tempObj.ptype == "gem_green") {
if (selectItem5 == 6) {
floatWords(thisObj, "+4 gp!");
gold = gold + 4;
thisObj.gold = thisObj.gold + 4;
} else {
floatWords(thisObj, "+2 gp!");
gold = gold + 2;
thisObj.gold = thisObj.gold + 2;
}
snd_cash.start();
} else if (tempObj.ptype == "gem_blue") {
if (selectItem5 == 6) {
floatWords(thisObj, "+5 gp!");
gold = gold + 5;
thisObj.gold = thisObj.gold + 5;
} else {
floatWords(thisObj, "+3 gp!");
gold = gold + 3;
thisObj.gold = thisObj.gold + 3;
}
snd_cash.start();
} else if (tempObj.ptype == "gem_red") {
if (selectItem5 == 6) {
floatWords(thisObj, "+7 gp!");
gold = gold + 7;
thisObj.gold = thisObj.gold + 7;
} else {
floatWords(thisObj, "+5 gp!");
gold = gold + 5;
thisObj.gold = thisObj.gold + 5;
}
snd_cash.start();
}
removeObject(tempObj);
}
}
}
}
}
}
}
tobj_i++;
}
}
obj_i++;
}
}
prevOffset = dyOffset;
};
Frame 11
stop();
targetDone.gotoAndStop(1);
if (heroDead) {
snd_badnews.start();
if (survivalMode) {
totalgold = totalgold + gold;
}
gold = 0;
if (dead_heroes.length > 9) {
dead_heroes.splice(0, 1);
dead_location.splice(0, 1);
dead_method.splice(0, 1);
dead_selItem1.splice(0, 1);
dead_selItem2.splice(0, 1);
dead_selItem3.splice(0, 1);
dead_selItem4.splice(0, 1);
dead_selItem5.splice(0, 1);
}
dead_heroes.push(deadHero);
dead_location.push(deadLoc);
dead_method.push(deadMethod);
dead_selItem1.push(selItem1);
dead_selItem2.push(selItem2);
dead_selItem3.push(selItem3);
dead_selItem4.push(selItem4);
dead_selItem5.push(selItem5);
if (deathNote != "You gave up!") {
lives = lives - 1;
}
resulttxt = "Try again!";
}
goldtxt = ("Total Gold Earned: " + gold) + " gp";
timetxt = "Time Taken: " + displayLongTime(seconds);
targetDone._visible = false;
keyShow._visible = false;
if (levelComplete) {
loseStreak = 0;
bigmsg = gameObj4;
rescued[cIcon] = true;
resulttxt = "Great job!";
levelsCompleted = levelsCompleted + 1;
totalgold = totalgold + gold;
_root.kongregateStats.submit("01_Level_Complete", 1);
if (gold >= targetGold) {
_root.kongregateStats.submit("02_Gold_Target", 1);
targetDone._visible = true;
if (twoPlayer) {
targetDone.reward = "Great Job!";
} else if (!survivalMode) {
targetDone.reward = "Excellent Job!";
} else {
targetDone.reward = "25 Bonus Gold!";
totalgold = totalgold + 25;
}
} else if (survivalMode) {
resulttxt = "Not enough gold!";
targetDone.reward = "You failed to reach the target!";
lives = lives - 1;
targetDone._visible = true;
targetDone.gotoAndStop(2);
}
if (twoPlayer) {
targetDone._visible = true;
targetDone.gotoAndStop(4);
targetDone.p1goldtxt = p1gold + " gp";
targetDone.p2goldtxt = p2gold + " gp";
if (p1gold > p2gold) {
p1medals = p1medals + 1;
targetDone.medal.gotoAndStop(2);
} else if (p2gold > p1gold) {
p2medals = p2medals + 1;
targetDone.medal.gotoAndStop(3);
}
}
if (!survivalMode) {
if (cIcon != 2) {
keys = keys + 1;
keyShow._visible = true;
keyShow.gotoAndStop(1);
} else {
keys = keys - 1;
keyShow._visible = true;
keyShow.gotoAndStop(2);
keyShow.head.gotoAndStop(currentMask + 1);
}
}
if (bossSpawned) {
bossNum = randbtwn(1, maxBosses);
while (bossNum == prevBossNum) {
bossNum = randbtwn(1, maxBosses);
}
prevBossNum = bossNum;
if (!twoPlayer) {
unlockMask(18);
}
}
if (!twoPlayer) {
if ((gold > (targetGold * 1.5)) && (!survivalMode)) {
unlockMask(1);
}
if (gold >= targetGold) {
if (cIcon == 1) {
unlockMask(21);
} else if (cIcon == 2) {
unlockMask(25);
} else if (cIcon == 3) {
unlockMask(22);
} else if (cIcon == 4) {
unlockMask(23);
} else if (cIcon == 5) {
unlockMask(24);
}
}
if (seconds <= 45) {
unlockMask(19);
} else if (seconds >= 120) {
unlockMask(20);
}
if (deadHero == "mage") {
unlockMask(6);
} else if (deadHero == "barbarian") {
unlockMask(7);
} else if (deadHero == "ranger") {
unlockMask(8);
} else if (deadHero == "paladin") {
unlockMask(9);
} else if (deadHero == "thief") {
unlockMask(10);
}
if (noKills) {
unlockMask(2);
}
if (noHurt) {
unlockMask(3);
}
if (noRescue) {
unlockMask(4);
}
if (smashBlock >= 25) {
unlockMask(5);
}
if (chestsOpened >= 25) {
unlockMask(12);
}
if (timesJumped >= 25) {
unlockMask(13);
}
if (timesDJumped >= 25) {
unlockMask(14);
}
if (enemiesKilled >= 15) {
unlockMask(15);
}
}
} else {
loseStreak = loseStreak + 1;
bigmsg = deathNote;
targetDone._visible = true;
targetDone.gotoAndStop(3);
if (cloudDeath) {
unlockMask(16);
}
if (loseStreak >= 3) {
unlockMask(11);
}
}
saveData();
_level0.onEnterFrame = function () {
if (Key.isDown(32)) {
if (!pds) {
pds = true;
if (twoPlayer) {
if (levelComplete) {
if (cIcon == 5) {
makeFade("winscreen");
} else {
makeFade("game_main");
}
} else {
makeFade("mainmenu");
}
} else if (lives < 0) {
if (unlockedMask) {
makeFade("medals");
} else {
makeFade("end");
}
} else if (survivalMode) {
cIcon = (levelsCompleted % 5) + 1;
if (unlockedMask) {
makeFade("medals");
} else {
makeFade("game_main");
}
} else if (levelComplete && (cIcon == 2)) {
if (numTemples == 1) {
makeFade("winscreen");
} else {
makeFade("artifact");
}
} else if (gold >= targetGold) {
makeFade("artifact");
} else if (unlockedMask) {
makeFade("medals");
} else {
makeFade("chaptermenu");
}
}
} else {
pds = false;
}
};
Frame 12
goldDisplay = mRn(totalgold) + " gp";
saveScore = true;
head.gotoAndStop(currentMask + 1);
_level0.onEnterFrame = function () {
if (Key.isDown(32)) {
if (!pds) {
pds = true;
gotoAndStop ("highscore");
}
} else {
pds = false;
}
};
Instance of Symbol 1344 MovieClip in Frame 12
on (release) {
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);
}
var vertDropHeroes_Click = "421f93f0";
getURL ("http://www.ninjakiwi.com", "_blank");
__com_mochibot__(vertDropHeroes_Click, this, 10301, true);
}
Frame 13
randTr = randbtwn(1, 30);
head.gotoAndStop(currentMask + 1);
watchDog = 0;
while (trFound[randTr] && (watchDog < 100)) {
watchDog = watchDog + 1;
randTr = randbtwn(1, 30);
if (!trFound[randTr]) {
watchDog = 1000;
}
}
no_Artifacts = 0;
var arn = 1;
while (arn <= 30) {
if (trFound[arn]) {
no_Artifacts = no_Artifacts + 1;
}
arn++;
}
_root.kongregateStats.submit("04_Artifacts_Unlocked", no_Artifacts);
if (watchdog == 100) {
treasureicon.gotoAndStop(33);
artifactName = "Giant Golden Statue";
desc = "Adds 50 gold to your total gold count.";
} else {
treasureicon.gotoAndStop(randTr);
artifactName = trName[randTr];
desc = trDesc[randTr];
trFound[randTr] = true;
}
_level0.onEnterFrame = function () {
if (Key.isDown(32)) {
if (!pds) {
pds = true;
if (unlockedMask) {
makeFade("medals");
} else {
makeFade("chaptermenu");
}
}
} else {
pds = false;
}
};
saveData();
Frame 14
totalgold = totalgold + (lives * 100);
goldDisplay = mRn(totalgold) + " gp";
gameComplete = true;
saveScore = true;
singleCompletion = true;
if (!twoPlayer) {
unlockMask(17);
winmsg = "Your Hero married the Princess and they lived happily ever after!";
_root.kongregateStats.submit("05_Game_Won_Story", 1);
} else {
_root.kongregateStats.submit("06_Game_Won_2Player", 1);
if (p1medals > p2medals) {
body.attachMovie("b_001b", "body", 10);
winmsg = "Player 1 married the Princess and they lived happily ever after!";
} else {
body.attachMovie("b_001c", "body", 10);
winmsg = "Player 2 married the Princess and they lived happily ever after!";
}
}
_level0.onEnterFrame = function () {
if (Key.isDown(32)) {
if (!pds) {
pds = true;
if (unlockedMask) {
makeFade("medals");
} else {
makeFade("highscore");
}
}
} else {
pds = false;
}
};
Instance of Symbol 1344 MovieClip in Frame 14
on (release) {
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);
}
var vertDropHeroes_Click = "421f93f0";
getURL ("http://www.ninjakiwi.com", "_blank");
__com_mochibot__(vertDropHeroes_Click, this, 10301, true);
}
Frame 15
newBox._y = -500;
singleCompletion = false;
if (survivalMode) {
if (totalgold > survScore) {
survMaxLevel = levelsCompleted;
survName = playerName;
survScore = totalgold;
newBox._y = survival._y;
_root.kongregateStats.submit("High_Score_Survival", totalgold);
}
} else if (saveScore) {
if (twoPlayer) {
survName = "2-Player";
}
sbox = 1;
while (sbox <= 5) {
if (totalgold > hScoreTotal[sbox]) {
ubox = 5;
while (ubox > sbox) {
hScoreName[ubox] = hScoreName[ubox - 1];
hScoreTotal[ubox] = hScoreTotal[ubox - 1];
ubox--;
}
_root.kongregateStats.submit("High_Score_Story", totalgold);
hScoreName[sbox] = playerName;
hScoreTotal[sbox] = totalgold;
thisBox = _level0["story" + sbox];
newBox._y = thisBox._y;
sbox = 99;
}
sbox++;
}
}
sbox = 1;
while (sbox <= 5) {
thisBox = _level0["story" + sbox];
thisBox.txt1 = sbox;
thisBox.txt2 = hScoreName[sbox];
thisBox.txt3 = hScoreTotal[sbox] + " gp";
sbox++;
}
survival.txt1 = "Lvl " + survMaxLevel;
survival.txt2 = survName;
survival.txt3 = survScore;
saveData();
saveScore = false;
_level0.onEnterFrame = function () {
if (Key.isDown(32)) {
if (!pds) {
pds = true;
makeFade("mainmenu");
}
} else {
pds = false;
}
};
Frame 16
_level0.onEnterFrame = function () {
if (Key.isDown(32)) {
if (!pds) {
pds = true;
makeFade("treasure");
}
} else {
pds = false;
}
if (Key.isDown(81)) {
if (!pdq) {
pdq = true;
heroDead = true;
gotoAndStop ("mainmenu");
}
} else {
pdq = false;
}
};
Frame 17
function refreshMedalSelect() {
medalx = 1;
while (medalx <= 5) {
medaly = 1;
while (medaly <= 5) {
thisMedal = _level0[(("medal" + medalx) + "") + medaly];
if ((medaly == maskCurY) && (medalx == maskCurX)) {
var maskIndex = (medalx + ((medaly - 1) * 5));
thisMedal._alpha = 100;
if (maskUnlocked[maskIndex]) {
maskname = maskNames[maskIndex];
maskdesc = maskDesc[maskIndex];
} else {
maskname = "?? Locked ??";
maskdesc = maskDesc[maskIndex];
}
} else {
thisMedal._alpha = 25;
}
medaly++;
}
medalx++;
}
}
maskCurX = 1;
maskCurY = 1;
no_Masks = 0;
medalx = 1;
while (medalx <= 5) {
medaly = 1;
while (medaly <= 5) {
thisMedal = _level0[(("medal" + medalx) + "") + medaly];
maskIndex = medalx + ((medaly - 1) * 5);
thisMedal.mdx = medalx;
thisMedal.mdy = medaly;
thisMedal.head.gotoAndStop(maskIndex + 1);
if (!maskUnlocked[maskIndex]) {
thisMedal.head.gotoAndStop(30);
} else {
no_Masks = no_Masks + 1;
}
if (maskNew[maskIndex]) {
thisMedal.gotoAndStop(2);
maskCurX = medalx;
maskCurY = medaly;
}
thisMedal.onRollOver = function () {
maskCurX = this.mdx;
maskCurY = this.mdy;
refreshMedalSelect();
};
medaly++;
}
medalx++;
}
_root.kongregateStats.submit("03_Masks_Unlocked", no_Masks);
thisMedal = _level0[(("medal" + medalx) + "") + medaly];
var maskNames = new Array();
var maskDesc = new Array();
maskNames[1] = "Top Hat";
maskDesc[1] = "Complete a level with at least 150% of the gold target.";
maskNames[2] = "Bear Hat";
maskDesc[2] = "Complete a level without killing any enemies.";
maskNames[3] = "Cool Shades";
maskDesc[3] = "Complete a level without taking any damage.";
maskNames[4] = "Cowboy Hat";
maskDesc[4] = "Complete a level without rescuing any heroes.";
maskNames[5] = "Safety Helmet";
maskDesc[5] = "Complete a level after smashing at least 25 normal blocks.";
maskNames[6] = "Nerd Glasses";
maskDesc[6] = "Complete a level as a Mage.";
maskNames[7] = "Red Headband";
maskDesc[7] = "Complete a level as a Barbarian.";
maskNames[8] = "Leaf Headband";
maskDesc[8] = "Complete a level as a Ranger.";
maskNames[9] = "Iron Helmet";
maskDesc[9] = "Complete a level as a Paladin.";
maskNames[10] = "Thief Mask";
maskDesc[10] = "Complete a level as a Thief.";
maskNames[11] = "Jester Hat";
maskDesc[11] = "Fail to complete a level 3 times in a row.";
maskNames[12] = "Pirate Hat";
maskDesc[12] = "Complete a level after opening 25 chests.";
maskNames[13] = "Beanie Hat";
maskDesc[13] = "Complete a level after jumping 25 times.";
maskNames[14] = "Aviator Goggles";
maskDesc[14] = "Complete a level after double jumping 25 times.";
maskNames[15] = "Hockey Mask";
maskDesc[15] = "Complete a level after killing 15 enemies.";
maskNames[16] = "Gas Mask";
maskDesc[16] = "Get killed by the purple cloud.";
maskNames[17] = "Royal Crown";
maskDesc[17] = "Rescue the princess and complete the game.";
maskNames[18] = "Lion Skin";
maskDesc[18] = "Complete a level after defeating a Boss.";
maskNames[19] = "Cheetah Mask";
maskDesc[19] = "Complete a level in 45 seconds or less.";
maskNames[20] = "Turtle Shell";
maskDesc[20] = "Complete a level after 2 minutes.";
maskNames[21] = "Leafy Laurel";
maskDesc[21] = "Complete and achieve the gold target on a Forest level.";
maskNames[22] = "Cloth Headgear";
maskDesc[22] = "Complete and achieve the gold target on a Desert level.";
maskNames[23] = "Reindeer Mask";
maskDesc[23] = "Complete and achieve the gold target on a Snow level.";
maskNames[24] = "Scorched Face";
maskDesc[24] = "Complete and achieve the gold target on a Volcano level.";
maskNames[25] = "Golden Mask";
maskDesc[25] = "Complete and achieve the gold target on a Temple level.";
saveData();
refreshMedalSelect();
_level0.onEnterFrame = function () {
if (Key.isDown(38) || (Key.isDown(87))) {
if (!pd4d) {
pd4d = true;
if (maskCurY > 1) {
maskCurY = maskCurY - 1;
}
refreshMedalSelect();
}
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (!pd4d) {
pd4d = true;
if (maskCurY < 5) {
maskCurY = maskCurY + 1;
}
refreshMedalSelect();
}
} else if (Key.isDown(39) || (Key.isDown(68))) {
if (!pd4d) {
pd4d = true;
if (maskCurX < 5) {
maskCurX = maskCurX + 1;
}
refreshMedalSelect();
}
} else if (Key.isDown(37) || (Key.isDown(65))) {
if (!pd4d) {
pd4d = true;
if (maskCurX > 1) {
maskCurX = maskCurX - 1;
}
refreshMedalSelect();
}
} else {
pd4d = false;
}
if (Key.isDown(32)) {
if (!pds) {
pds = true;
var maski = 1;
while (maski <= 30) {
maskNew[maski] = false;
maski++;
}
if (unlockedMask) {
unlockedMask = false;
if (singleCompletion) {
makeFade("highscore");
} else if (lives < 0) {
makeFade("end");
} else if (survivalMode) {
makeFade("game_main");
} else {
makeFade("chaptermenu");
}
} else {
makeFade("mainmenu");
}
}
} else {
pds = false;
}
};
Frame 18
_level0.onEnterFrame = function () {
if (Key.isDown(32)) {
if (!pds) {
pds = true;
makeFade("mainmenu");
}
} else {
pds = false;
}
};
Frame 19
optChoice = 1;
_level0["optbox" + optChoice].gotoAndStop(2);
optxt3 = "Reset all Data";
_level0.onEnterFrame = function () {
if (sfxLevel == 1) {
optxt1 = "Sounds: Off";
gSound = new Sound();
gSound.setVolume(0);
} else {
gSound = new Sound();
gSound.setVolume(100);
if (sfxLevel == 2) {
optxt1 = "Sounds: SFX only";
} else if (sfxLevel == 3) {
optxt1 = "Sounds: SFX & Music";
}
}
if (qualityLevel == 1) {
_quality = "LOW";
optxt2 = "Quality: Low";
} else if (qualityLevel == 2) {
_quality = "MEDIUM";
optxt2 = "Quality: Medium";
} else if (qualityLevel == 3) {
_quality = "HIGH";
optxt2 = "Quality: High";
}
if (Key.isDown(38) || (Key.isDown(87))) {
if (!pd4d) {
pd4d = true;
optxt3 = "Reset all Data";
_level0["optbox" + optChoice].gotoAndStop(1);
optChoice = optChoice - 1;
if (optChoice < 1) {
optChoice = 4;
}
_level0["optbox" + optChoice].gotoAndStop(2);
}
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (!pd4d) {
pd4d = true;
optxt3 = "Reset all Data";
_level0["optbox" + optChoice].gotoAndStop(1);
optChoice = optChoice + 1;
if (optChoice > 4) {
optChoice = 1;
}
_level0["optbox" + optChoice].gotoAndStop(2);
}
} else {
pd4d = false;
}
if (Key.isDown(32)) {
if (!pds) {
pds = true;
if (optChoice == 1) {
sfxLevel = sfxLevel - 1;
if (sfxLevel < 1) {
sfxLevel = 3;
}
} else if (optChoice == 2) {
qualityLevel = qualityLevel - 1;
if (qualityLevel < 1) {
qualityLevel = 3;
}
} else if (optChoice == 3) {
if (optxt3 == "Reset all Data") {
optxt3 = "Confirm Reset?";
} else {
mData = SharedObject.getLocal(g_dataFile);
mData.clear();
optxt3 = "Data deleted.";
sOption = 1;
makeFade("mainmenu");
}
} else if (optChoice == 4) {
makeFade("mainmenu");
}
}
} else {
pds = false;
}
};
Instance of Symbol 1412 MovieClip "optbox1" in Frame 19
on (rollOver) {
_level0.optxt3 = "Reset all Data";
_level0["optbox" + _level0.optChoice].gotoAndStop(1);
_level0.optChoice = 1;
_level0["optbox" + _level0.optChoice].gotoAndStop(2);
}
on (release) {
_level0.sfxLevel = _level0.sfxLevel - 1;
if (_level0.sfxLevel < 1) {
_level0.sfxLevel = 3;
}
}
Instance of Symbol 1412 MovieClip "optbox2" in Frame 19
on (rollOver) {
_level0.optxt3 = "Reset all Data";
_level0["optbox" + _level0.optChoice].gotoAndStop(1);
_level0.optChoice = 2;
_level0["optbox" + _level0.optChoice].gotoAndStop(2);
}
on (release) {
_level0.qualityLevel = _level0.qualityLevel - 1;
if (_level0.qualityLevel < 1) {
_level0.qualityLevel = 3;
}
}
Instance of Symbol 1412 MovieClip "optbox3" in Frame 19
on (rollOver) {
_level0.optxt3 = "Reset all Data";
_level0["optbox" + _level0.optChoice].gotoAndStop(1);
_level0.optChoice = 3;
_level0["optbox" + _level0.optChoice].gotoAndStop(2);
}
on (release) {
if (_level0.optxt3 == "Reset all Data") {
_level0.optxt3 = "Confirm Reset?";
} else {
_level0.mData = SharedObject.getLocal(_level0.g_dataFile);
_level0.mData.clear();
_level0.optxt3 = "Data deleted.";
_level0.sOption = 1;
_level0.makeFade("mainmenu");
}
}
Instance of Symbol 1412 MovieClip "optbox4" in Frame 19
on (rollOver) {
_level0.optxt3 = "Reset all Data";
_level0["optbox" + _level0.optChoice].gotoAndStop(1);
_level0.optChoice = 4;
_level0["optbox" + _level0.optChoice].gotoAndStop(2);
}
on (release) {
_level0.makeFade("mainmenu");
}
Frame 20
_level0.onEnterFrame = function () {
if (Key.isDown(32)) {
if (!pds) {
pds = true;
makeFade("faux_loading");
}
} else {
pds = false;
}
};
Frame 21
_level0.onEnterFrame = function () {
if (Key.isDown(32)) {
if (!pds) {
pds = true;
makeFade("2playersetup");
}
} else {
pds = false;
}
};
Frame 22
function refreshAll2P() {
var pn = 1;
while (pn <= 2) {
var pbox = 0;
while (pbox <= 5) {
thisBox = _level0[(("box" + pn) + "") + pbox];
thisInvBox = _level0["invbox" + pn];
thisBoxIndex = ((pbox - 1) * 6) + _level0[("p" + pn) + "SelItem"][pbox];
if (pbox == 0) {
thisBox.head.gotoAndStop(_level0[("p" + pn) + "Mask"] + 1);
} else {
thisBox.icon.gotoAndStop(thisBoxIndex);
if (_level0[("p" + pn) + "SelItem"][pbox] == 7) {
thisBox.icon.gotoAndStop(32);
thisBoxIndex = 0;
}
}
if (pbox == _level0[("p" + pn) + "_selection"]) {
thisBox._alpha = 100;
thisInvBox._y = thisBox._y;
thisInvBox.title = trName[thisBoxIndex];
thisInvBox.desc = trDesc[thisBoxIndex];
} else {
thisBox._alpha = 50;
}
if (_level0[("p" + pn) + "_selection"] == 0) {
thisInvBox._y = -200;
}
pbox++;
}
pn++;
}
}
var aiBuddy = false;
ai_box._visible = aiBuddy;
p1_selection = 0;
p2_selection = 0;
p1SelItem = new Array();
p2SelItem = new Array();
p1SelItem[1] = 7;
p1SelItem[2] = 7;
p1SelItem[3] = 7;
p1SelItem[4] = 7;
p1SelItem[5] = 7;
p1Mask = 0;
p2SelItem[1] = 7;
p2SelItem[2] = 7;
p2SelItem[3] = 7;
p2SelItem[4] = 7;
p2SelItem[5] = 7;
p2Mask = 0;
refreshAll2P();
_level0.onEnterFrame = function () {
if (Key.isDown(38)) {
if (!pd4d) {
pd4d = true;
p1_selection = p1_selection - 1;
if (p1_selection < 0) {
p1_selection = 5;
}
refreshAll2P();
}
} else if (Key.isDown(40)) {
if (!pd4d) {
pd4d = true;
p1_selection = p1_selection + 1;
if (p1_selection > 5) {
p1_selection = 0;
}
refreshAll2P();
}
} else if (Key.isDown(39)) {
if (!pd4d) {
pd4d = true;
var invRow = slide["row" + activeRow];
if (p1_selection == 0) {
p1Mask = p1Mask + 1;
if (p1Mask > 25) {
p1Mask = 0;
}
} else {
p1SelItem[p1_selection] = p1SelItem[p1_selection] + 1;
if (p1SelItem[p1_selection] > 7) {
p1SelItem[p1_selection] = 1;
}
}
refreshAll2P();
}
} else if (Key.isDown(37)) {
if (!pd4d) {
pd4d = true;
var invRow = slide["row" + activeRow];
if (p1_selection == 0) {
p1Mask = p1Mask - 1;
if (p1Mask < 0) {
p1Mask = 25;
}
} else {
p1SelItem[p1_selection] = p1SelItem[p1_selection] - 1;
if (p1SelItem[p1_selection] < 1) {
p1SelItem[p1_selection] = 7;
}
}
refreshAll2P();
}
} else {
pd4d = false;
}
if (Key.isDown(87)) {
if (!pd4db) {
pd4db = true;
p2_selection = p2_selection - 1;
if (p2_selection < 0) {
p2_selection = 5;
}
refreshAll2P();
}
} else if (Key.isDown(83)) {
if (!pd4db) {
pd4db = true;
p2_selection = p2_selection + 1;
if (p2_selection > 5) {
p2_selection = 0;
}
refreshAll2P();
}
} else if (Key.isDown(68)) {
if (!pd4db) {
pd4db = true;
var invRow = slide["row" + activeRow];
if (p2_selection == 0) {
p2Mask = p2Mask + 1;
if (p2Mask > 25) {
p2Mask = 0;
}
} else {
p2SelItem[p2_selection] = p2SelItem[p2_selection] + 1;
if (p2SelItem[p2_selection] > 7) {
p2SelItem[p2_selection] = 1;
}
}
refreshAll2P();
}
} else if (Key.isDown(65)) {
if (!pd4db) {
pd4db = true;
if (p2_selection == 0) {
p2Mask = p2Mask - 1;
if (p2Mask < 0) {
p2Mask = 25;
}
} else {
p2SelItem[p2_selection] = p2SelItem[p2_selection] - 1;
if (p2SelItem[p2_selection] < 1) {
p2SelItem[p2_selection] = 7;
}
}
refreshAll2P();
}
} else {
pd4db = false;
}
if (Key.isDown(32)) {
if (!pds) {
pds = true;
makeFade("faux_loading");
}
} else {
pds = false;
}
if (Key.isDown(80)) {
if (!pdq) {
pdq = true;
aiBuddy = !aiBuddy;
ai_box._visible = aiBuddy;
p2SelItem[1] = randbtwn(1, 7);
p2SelItem[2] = randbtwn(1, 7);
p2SelItem[3] = randbtwn(1, 7);
p2SelItem[4] = randbtwn(1, 7);
p2SelItem[5] = randbtwn(1, 7);
p2Mask = randbtwn(0, 25);
}
} else {
pdq = false;
}
if (Key.isDown(81)) {
p1SelItem[1] = randbtwn(1, 7);
p1SelItem[2] = randbtwn(1, 7);
p1SelItem[3] = randbtwn(1, 7);
p1SelItem[4] = randbtwn(1, 7);
p1SelItem[5] = randbtwn(1, 7);
p1Mask = randbtwn(0, 25);
p2SelItem[1] = randbtwn(1, 7);
p2SelItem[2] = randbtwn(1, 7);
p2SelItem[3] = randbtwn(1, 7);
p2SelItem[4] = randbtwn(1, 7);
p2SelItem[5] = randbtwn(1, 7);
p2Mask = randbtwn(0, 25);
refreshAll2P();
}
};
Symbol 30 MovieClip Frame 1
stop();
Symbol 30 MovieClip Frame 3
stop();
Symbol 30 MovieClip Frame 13
gotoAndPlay (3);
Symbol 32 MovieClip [b_006] Frame 1
stop();
Symbol 34 MovieClip [h_006] Frame 1
stop();
Symbol 41 MovieClip [h_005] Frame 1
stop();
Symbol 43 MovieClip [goldcoins] Frame 1
stop();
Symbol 54 MovieClip [b_004] Frame 1
stop();
Symbol 56 MovieClip [h_004] Frame 1
stop();
Symbol 62 MovieClip [b_003] Frame 1
stop();
Symbol 64 MovieClip [h_003] Frame 1
stop();
Symbol 71 MovieClip [b_011] Frame 1
stop();
Symbol 73 MovieClip [h_011] Frame 1
stop();
Symbol 83 MovieClip Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 87 MovieClip [b_002] Frame 1
stop();
Symbol 89 MovieClip [h_002] Frame 1
stop();
Symbol 96 MovieClip [h_008] Frame 1
stop();
Symbol 101 MovieClip [h_009] Frame 1
stop();
Symbol 109 MovieClip [b_007] Frame 1
stop();
Symbol 113 MovieClip [h_007] Frame 1
stop();
Symbol 121 MovieClip [b_001] Frame 1
stop();
Symbol 149 MovieClip [h_001] Frame 1
stop();
Symbol 154 MovieClip [ironkey] Frame 1
stop();
Symbol 167 MovieClip Frame 1
stop();
Symbol 167 MovieClip Frame 10
_level0.gotoAndStop(this.nextframe);
Symbol 167 MovieClip Frame 11
_level0.faded = false;
Symbol 183 MovieClip [h_011b] Frame 1
stop();
Symbol 185 MovieClip [b_004b] Frame 1
stop();
Symbol 187 MovieClip [b_008] Frame 1
stop();
Symbol 202 MovieClip Frame 1
stop();
Symbol 213 MovieClip Frame 1
stop();
Symbol 227 MovieClip Frame 1
stop();
Symbol 237 MovieClip Frame 1
stop();
Symbol 247 MovieClip Frame 1
stop();
Symbol 258 MovieClip Frame 1
stop();
Symbol 259 MovieClip [assaultrifle] Frame 1
this._xscale = _level0.randbtwn(80, 120);
stop();
Symbol 260 MovieClip Frame 1
stop();
Symbol 262 MovieClip Frame 1
stop();
Symbol 264 MovieClip Frame 1
stop();
Symbol 271 MovieClip Frame 1
stop();
Symbol 271 MovieClip Frame 5
if (_parent._parent._parent.jump) {
gotoAndPlay ("flail");
}
Symbol 271 MovieClip Frame 8
if (_parent._parent._parent.jump) {
gotoAndPlay ("flail");
}
Symbol 271 MovieClip Frame 11
if (!_parent._parent._parent.jump) {
gotoAndPlay ("swing");
} else {
gotoAndPlay ("flail");
}
Symbol 271 MovieClip Frame 18
if (!_parent._parent._parent.jump) {
gotoAndPlay ("swing");
} else {
gotoAndPlay ("flail");
}
Symbol 271 MovieClip Frame 29
gotoAndStop (1);
Symbol 275 MovieClip [tile_blank1] Frame 1
stop();
Symbol 285 MovieClip [fx_bigexplosion] Frame 30
stop();
removeMovieClip(this);
Symbol 288 MovieClip [tile_spike] Frame 1
stop();
Symbol 290 MovieClip Frame 1
stop();
Symbol 294 MovieClip Frame 1
stop();
Symbol 301 MovieClip Frame 7
stop();
Symbol 306 MovieClip [fx_explosion] Frame 8
stop();
removeMovieClip(this);
Symbol 308 MovieClip Frame 1
stop();
Symbol 311 MovieClip [redpotion] Frame 1
stop();
Symbol 316 MovieClip [floatwords] Frame 15
removeMovieClip(this);
Symbol 318 MovieClip [manapotion] Frame 1
stop();
Symbol 322 MovieClip [tile_cage] Frame 1
stop();
Symbol 325 MovieClip [effect_ninjasmoke] Frame 11
removeMovieClip(this);
Symbol 338 MovieClip [tile_start] Frame 1
stop();
Symbol 350 MovieClip [tile_princess] Frame 1
stop();
Symbol 352 MovieClip [b_009] Frame 1
stop();
Symbol 369 MovieClip [ring_red] Frame 7
stop();
Symbol 373 MovieClip Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 374 MovieClip [tile_blank2] Frame 1
stop();
Symbol 381 MovieClip [b_012] Frame 1
stop();
Symbol 387 MovieClip [h_012] Frame 1
stop();
Symbol 393 MovieClip [b_013] Frame 1
stop();
Symbol 399 MovieClip [h_013b] Frame 1
stop();
Symbol 402 MovieClip [tile_sliding] Frame 1
stop();
Symbol 404 MovieClip [grass1] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 416 MovieClip [temple_floor4] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 418 MovieClip [temple_floor5] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 420 MovieClip [temple_floor6] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 422 MovieClip [temple_floor1] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 424 MovieClip [temple_floor2] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 431 MovieClip [temple_floor3] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 435 MovieClip [h_013] Frame 1
stop();
Symbol 438 MovieClip [tile_idolhead] Frame 1
stop();
Symbol 453 MovieClip Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 454 MovieClip [tile_blank3] Frame 1
stop();
Symbol 461 MovieClip Frame 7
stop();
Symbol 466 MovieClip [fx_sandcloud] Frame 8
stop();
removeMovieClip(this);
Symbol 468 MovieClip [b_014] Frame 1
stop();
Symbol 474 MovieClip [h_014] Frame 1
stop();
Symbol 486 MovieClip [b_005] Frame 1
stop();
Symbol 488 MovieClip [b_010] Frame 1
stop();
Symbol 494 MovieClip [h_010] Frame 1
stop();
Symbol 497 MovieClip [tile_key] Frame 1
stop();
Symbol 500 MovieClip [tile_gold] Frame 1
stop();
Symbol 502 MovieClip Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 503 MovieClip [tile_blank4] Frame 1
stop();
Symbol 505 MovieClip [b_015] Frame 1
stop();
Symbol 511 MovieClip [h_015] Frame 1
stop();
Symbol 515 MovieClip [tile_ice] Frame 1
stop();
Symbol 519 MovieClip [fx_iceexplosion] Frame 30
stop();
removeMovieClip(this);
Symbol 521 MovieClip [snow1] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 523 MovieClip [snow2] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 525 MovieClip [snow3] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 527 MovieClip [snow4] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 535 MovieClip [tile_exit] Frame 1
stop();
Symbol 537 MovieClip [b_016] Frame 1
stop();
Symbol 543 MovieClip [h_016] Frame 1
stop();
Symbol 545 MovieClip [b_005b] Frame 1
stop();
Symbol 551 MovieClip [h_005b] Frame 1
stop();
Symbol 553 MovieClip [b_005c] Frame 1
stop();
Symbol 559 MovieClip [h_005c] Frame 1
stop();
Symbol 561 MovieClip [b_006b] Frame 1
stop();
Symbol 569 MovieClip [h_006b] Frame 1
stop();
Symbol 571 MovieClip [b_006c] Frame 1
stop();
Symbol 577 MovieClip [h_006c] Frame 1
stop();
Symbol 579 MovieClip [b_005d] Frame 1
stop();
Symbol 585 MovieClip [h_005d] Frame 1
stop();
Symbol 588 MovieClip [b_010b] Frame 1
stop();
Symbol 592 MovieClip [h_010b] Frame 1
stop();
Symbol 600 MovieClip [h_004b] Frame 1
stop();
Symbol 604 MovieClip [h_004c] Frame 1
stop();
Symbol 606 MovieClip [h_004d] Frame 1
stop();
Symbol 610 MovieClip [b_003b] Frame 1
stop();
Symbol 612 MovieClip [h_003b] Frame 1
stop();
Symbol 618 MovieClip [b_003c] Frame 1
stop();
Symbol 620 MovieClip [h_003c] Frame 1
stop();
Symbol 626 MovieClip [b_003d] Frame 1
stop();
Symbol 628 MovieClip [b_003e] Frame 1
stop();
Symbol 630 MovieClip [h_003e] Frame 1
stop();
Symbol 665 MovieClip Frame 1
stop();
Symbol 667 MovieClip [b_017] Frame 1
stop();
Symbol 673 MovieClip [h_017] Frame 1
stop();
Symbol 677 MovieClip [h_017b] Frame 1
stop();
Symbol 679 MovieClip [b_006d] Frame 1
stop();
Symbol 685 MovieClip [h_006d] Frame 1
stop();
Symbol 687 MovieClip [tile_icicle] Frame 1
stop();
Symbol 697 MovieClip [h_011d] Frame 1
stop();
Symbol 699 MovieClip [b_011c] Frame 1
stop();
Symbol 705 MovieClip [h_011c] Frame 1
stop();
Symbol 707 MovieClip [b_011e] Frame 1
stop();
Symbol 709 MovieClip [h_011e] Frame 1
stop();
Symbol 711 MovieClip [b_006e] Frame 1
stop();
Symbol 716 MovieClip [h_006e] Frame 1
stop();
Symbol 718 MovieClip [b_005e] Frame 1
stop();
Symbol 720 MovieClip [h_005e] Frame 1
stop();
Symbol 722 MovieClip [b_011f] Frame 1
stop();
Symbol 728 MovieClip [h_011f] Frame 1
stop();
Symbol 733 MovieClip [b_018] Frame 1
stop();
Symbol 739 MovieClip [h_018] Frame 1
stop();
Symbol 741 MovieClip [b_003f] Frame 1
stop();
Symbol 743 MovieClip [h_003f] Frame 1
stop();
Symbol 745 MovieClip [tile_geyser] Frame 1
stop();
Symbol 754 MovieClip Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 755 MovieClip [tile_blank5] Frame 1
stop();
Symbol 758 MovieClip [tile_bossledge] Frame 1
stop();
Symbol 787 MovieClip [cave1] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 789 MovieClip [cave2] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 791 MovieClip [cave3] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 793 MovieClip [cave6] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 795 MovieClip [cave5] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 797 MovieClip [cave4] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 799 MovieClip [tile_magma] Frame 1
stop();
Symbol 801 MovieClip [tile_firevent] Frame 1
stop();
Symbol 808 MovieClip Frame 7
stop();
Symbol 812 MovieClip [fx_steamcloud] Frame 8
stop();
removeMovieClip(this);
Symbol 815 MovieClip [effect_slash] Frame 3
stop();
Symbol 823 MovieClip [fx_jumpcloud] Frame 7
stop();
removeMovieClip(this);
Symbol 848 MovieClip [tile_gold_sliding] Frame 1
stop();
Symbol 854 MovieClip [fx_goldexplosion] Frame 30
stop();
removeMovieClip(this);
Symbol 856 MovieClip [b_019] Frame 1
stop();
Symbol 861 MovieClip [h_019] Frame 1
stop();
Symbol 875 MovieClip Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 876 MovieClip [tile_blank6] Frame 1
stop();
Symbol 878 MovieClip [outpost1] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 879 MovieClip [outpost2] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 880 MovieClip [outpost3] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 883 MovieClip [playerindicator] Frame 1
stop();
Symbol 885 MovieClip [b_001b] Frame 1
stop();
Symbol 887 MovieClip [b_001c] Frame 1
stop();
Symbol 892 MovieClip [fx_explodemarker1] Frame 32
stop();
removeMovieClip(this);
Symbol 898 MovieClip [fx_explodemarker2] Frame 32
stop();
removeMovieClip(this);
Symbol 900 Button
on (release) {
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);
}
var vertDropHeroes_Click = "421f93f0";
getURL ("http://www.ninjakiwi.com", "_blank");
__com_mochibot__(vertDropHeroes_Click, this, 10301, true);
}
Symbol 944 MovieClip Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
var vertDropHeroes_Splash = "9e22fb7e";
__com_mochibot__(vertDropHeroes_Splash, this, 10301, true);
Symbol 944 MovieClip Frame 199
stop();
_level0.nextFrame();
Symbol 959 MovieClip Frame 30
stop();
Symbol 970 Button
on (rollOver) {
_level0.sOption = 1;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
_level0.makeFade("comic_opening");
_level0.survivalMode = false;
_level0.firstLoad = true;
}
Symbol 971 Button
on (rollOver) {
_level0.sOption = 2;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
_level0.makeFade("options");
}
Symbol 972 Button
on (rollOver) {
_level0.sOption = 3;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
_level0.survivalMode = true;
_level0.lives = 0;
_level0.makeFade("survival");
}
Symbol 973 Button
on (rollOver) {
_level0.sOption = 4;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
_level0.twoPlayer = true;
_level0.lives = 3;
_level0.p1medals = 0;
_level0.p2medals = 0;
_level0.makeFade("2player");
}
Symbol 974 Button
on (rollOver) {
_level0.sOption = 5;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
_level0.makeFade("highscore");
}
Symbol 975 Button
on (rollOver) {
_level0.sOption = 6;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
_level0.makeFade("medals");
}
Symbol 976 Button
on (rollOver) {
_level0.sOption = 7;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
_level0.makeFade("developer");
}
Symbol 977 Button
on (rollOver) {
_level0.sOption = 8;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
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);
}
var vertDropHeroes_Click = "421f93f0";
getURL ("http://www.ninjakiwi.com", "_blank");
__com_mochibot__(vertDropHeroes_Click, this, 10301, true);
}
Symbol 1034 MovieClip Frame 1
stop();
Symbol 1041 MovieClip Frame 1
stop();
if (_level0.sfxLevel == 3) {
gotoAndStop (2);
}
Symbol 1080 Button
on (release) {
_level0.makeFade("chaptermenu");
}
Symbol 1081 Button
on (release) {
_level0.heroDead = true;
_level0.gotoAndStop("mainmenu");
}
Instance of Symbol 1088 MovieClip in Symbol 1089 MovieClip Frame 1
on (release) {
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);
}
var vertDropHeroes_Click = "421f93f0";
getURL ("http://www.ninjakiwi.com", "_blank");
__com_mochibot__(vertDropHeroes_Click, this, 10301, true);
}
Symbol 1093 MovieClip Frame 1
stop();
if (_level0.sfxLevel != 2) {
gotoAndStop (2);
}
Symbol 1101 MovieClip Frame 1
stop();
Symbol 1109 MovieClip Frame 1
stop();
Symbol 1113 MovieClip Frame 1
stop();
Symbol 1118 MovieClip Frame 1
stop();
Symbol 1122 MovieClip Frame 1
stop();
Symbol 1125 MovieClip Frame 1
stop();
Symbol 1136 MovieClip Frame 1
stop();
Symbol 1142 MovieClip Frame 1
stop();
Symbol 1189 MovieClip Frame 1
stop();
Symbol 1202 Button
on (release) {
if (_level0.firstLoad) {
_level0.firstLoad = false;
_level0.gotoAndStop("instructions");
} else {
_level0.gotoAndStop("faux_loading");
}
}
Symbol 1203 Button
on (release) {
_level0.heroDead = true;
if (!_level0.survivalMode) {
_level0.gotoAndStop("chaptermenu");
} else {
_level0.gotoAndStop("mainmenu");
}
}
Symbol 1205 MovieClip Frame 1
stop();
if (_level0.sfxLevel != 2) {
gotoAndStop (2);
}
Symbol 1228 MovieClip Frame 1
stop();
Symbol 1254 MovieClip Frame 1
stop();
Symbol 1254 MovieClip Frame 2
stop();
Symbol 1305 MovieClip Frame 1
stop();
if (_level0.sfxLevel != 2) {
gotoAndStop (2);
}
Symbol 1320 MovieClip Frame 1
stop();
Symbol 1321 MovieClip Frame 1
stop();
Symbol 1326 MovieClip Frame 1
stop();
Symbol 1333 MovieClip Frame 1
stop();
if (_level0.sfxLevel != 2) {
gotoAndStop (2);
}
Symbol 1364 Button
on (release) {
if (_level0.unlockedMask) {
_level0.makeFade("medals");
} else {
_level0.makeFade("highscore");
}
}
Symbol 1376 Button
on (release) {
_level0.makeFade("mainmenu");
}
Symbol 1388 Button
on (release) {
_level0.makeFade("treasure");
}
Symbol 1393 MovieClip Frame 1
stop();
Symbol 1400 Button
on (release) {
var maski = 1;
while (maski <= 30) {
_level0.maskNew[maski] = false;
maski++;
}
if (_level0.unlockedMask) {
_level0.unlockedMask = false;
if (_level0.singleCompletion) {
_level0.makeFade("highscore");
} else if (_level0.lives < 0) {
_level0.makeFade("end");
} else if (_level0.survivalMode) {
_level0.makeFade("game_main");
} else {
_level0.makeFade("chaptermenu");
}
} else {
_level0.makeFade("mainmenu");
}
}
Symbol 1412 MovieClip Frame 1
stop();
Symbol 1439 Button
on (release) {
_level0.makeFade("faux_loading");
}
Symbol 1455 Button
on (release) {
_level0.makeFade("2playersetup");
}