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 = [".armorgames.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 _local2 = Math.round(_level0.pct) + "%";
_level0.startmsg = "Loading... " + _local2;
} 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;
}
sitelock(urls_allowed);
};
Frame 2
stop();
_level0.onEnterFrame = function () {
stop();
};
Instance of Symbol 172 MovieClip in Frame 2
on (release) {
getURL ("http://www.armorgames.com", "_blank");
}
Frame 3
_level0.onEnterFrame = function () {
stop();
};
function shadeObj(anyped) {
var _local2 = new Color(anyped);
var _local1 = new Object();
_local1 = {ra:"0", rb:"0", ga:"0", gb:"0", ba:"0", bb:"0", aa:"100", ab:"0"};
_local2.setTransform(_local1);
}
function whiteoutObj(anyped) {
var _local2 = new Color(anyped);
var _local1 = new Object();
_local1 = {ra:"100", rb:"100", ga:"100", gb:"100", ba:"100", bb:"100", aa:"100", ab:"0"};
_local2.setTransform(_local1);
}
function unshadeObj(anyped) {
var _local2 = new Color(anyped);
var _local1 = new Object();
_local1 = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
_local2.setTransform(_local1);
}
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 _local4 = 0;
var _local1 = 0;
var _local3 = 0;
if (seconds > 0) {
while (seconds >= 60) {
seconds = seconds - 60;
_local1 = _local1 + 1;
}
}
_local4 = seconds;
if (_local1 > 0) {
while (_local1 >= 60) {
_local1 = _local1 - 60;
_local3 = _local3 + 1;
}
}
if (_local1 < 10) {
_local1 = "0" + _local1;
}
if (_local4 < 10) {
_local4 = "0" + _local4;
}
return((((_local3 + ":") + _local1) + ":") + _local4);
}
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 _local1 = dialogChar.shift();
if (_local1 == undefined) {
dialogbox.char = "Dr Frix";
} else {
dialogbox.char = _local1;
}
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 _local4 = false;
var _local3;
dind = 0;
while (dind <= propCount) {
var _local1;
_local1 = stage["prop" + dd(dind)];
if (_local1.isDead) {
_local4 = true;
_local1.removeMovieClip();
stage.attachMovie(objname, "prop" + dd(dind), dind + lyroffset);
_local3 = stage["prop" + dd(dind)];
_local3.isDead = false;
_local3._visible = true;
_local3.defLayer = dind + lyroffset;
_local3.swapDepths(dind + lyroffset);
dind = propCount + 999;
}
dind++;
}
if (!_local4) {
stage.attachMovie(objname, "prop" + dd(propCount), propCount + lyroffset);
_local3 = stage["prop" + dd(propCount)];
_local3.isDead = false;
_local3.index = propCount;
_local3.defLayer = propCount + lyroffset;
propCount = propCount + 1;
}
_local3._x = pos_x;
_local3._y = pos_y;
_local3.objname = objname;
return(_local3);
}
function removeProp(anyobj) {
anyobj.isDead = true;
anyobj._visible = false;
tTiles[anyobj.tilex][anyobj.tiley + dyOffset] = undefined;
if (anyobj.index == (propCount - 1)) {
var _local1 = propCount - 1;
while (_local1 >= 1) {
var _local2 = stage["prop" + dd(_local1)];
if (_local2.isDead) {
removeMovieClip(_local2);
propCount = propCount - 1;
} else {
_local1 = -1;
}
_local1--;
}
}
}
function spawnObject(objname, objclass, pos_x, pos_y, lyroffset) {
if (objCount == undefined) {
objCount = 0;
}
var _local4 = false;
var _local3;
dind = 0;
while (dind <= objCount) {
var _local1;
_local1 = stage["obj" + dd(dind)];
if (_local1.isDead) {
_local4 = true;
_local1.removeMovieClip();
stage.attachMovie(objname, "obj" + dd(dind), dind + lyroffset);
_local3 = stage["obj" + dd(dind)];
_local3.isDead = false;
_local3._visible = true;
_local3.defLayer = dind + lyroffset;
_local3.swapDepths(dind + lyroffset);
dind = objCount + 999;
}
dind++;
}
if (!_local4) {
stage.attachMovie(objname, "obj" + dd(objCount), objCount + lyroffset);
_local3 = stage["obj" + dd(objCount)];
_local3.isDead = false;
_local3.index = objCount;
_local3.defLayer = objCount + lyroffset;
objCount = objCount + 1;
}
_local3._x = pos_x;
_local3._y = pos_y;
_local3.objname = objname;
_local3.objclass = objclass;
_local3.dying = false;
return(_local3);
}
function removeObject(anyobj) {
anyobj.isDead = true;
anyobj._visible = false;
if (anyobj.index == (objCount - 1)) {
var _local1 = objCount - 1;
while (_local1 >= 1) {
var _local2 = stage["obj" + dd(_local1)];
if (_local2.isDead) {
removeMovieClip(_local2);
objCount = objCount - 1;
} else {
_local1 = -1;
}
_local1--;
}
}
}
function attachEffect(anyped, effectname) {
if (fxCount == undefined) {
fxCount = 0;
}
stage.attachMovie(effectname, "sfx" + dd(fxCount), fxCount + 60000);
var _local1 = stage["sfx" + dd(fxCount)];
fxCount = fxCount + 1;
if (fxCount > 20) {
fxCount = 0;
}
_local1._x = anyped._x;
_local1._y = anyped._y;
_local1._rotation = randbtwn(0, 360);
lastFx = _local1;
}
function floatWords(anyped, wordtxt) {
if (fxCount == undefined) {
fxCount = 0;
}
stage.attachMovie("floatwords", "sfx" + dd(fxCount), fxCount + 60000);
var _local1 = stage["sfx" + dd(fxCount)];
_local1.word.txt = wordtxt;
fxCount = fxCount + 1;
if (fxCount > 20) {
fxCount = 0;
}
_local1._x = anyped._x;
_local1._y = anyped._y - 20;
}
function setColor(rClip, rBase, gBase, bBase) {
var _local5 = rBase;
var _local6 = gBase;
var _local4 = bBase;
var _local2 = _local5.toString(16);
if (_local5 < 16) {
_local2 = "0" + _local2;
}
var _local1 = _local6.toString(16);
if (_local6 < 16) {
_local1 = "0" + _local1;
}
var _local3 = _local4.toString(16);
if (_local4 < 16) {
_local3 = "0" + _local3;
}
var _local8 = (_local2 + _local1) + _local3;
var _local7 = parseInt(_local8, 16);
var _local9 = new Color(rClip);
_local9.setRGB(_local7);
}
function spitOne(anyarray) {
var _local1 = randbtwn(0, anyarray.length - 1);
var _local3 = anyarray[_local1];
anyarray.splice(_local1, 1);
return(_local3);
}
function fireMissile(anyped, b_rot, b_type, b_hp) {
var _local1 = spawnObject("missile", "missile", anyped._x, anyped._y, 50000);
_local1.attachMovie("missile_" + b_type, "missile", 0);
_local1._x = _local1._x + (12 + (anyped._xscale / 100));
_local1.hp = 1;
_local1.unblockable = false;
_local1.speed = 20;
if (anyped.owner == 2) {
_local1.speed = 12;
}
if (((b_type == "shuriken") && (anyped.owner != 1)) && (anyped.owner != 3)) {
_local1.speed = 6;
}
if (((b_type == "fireball") && (anyped.owner != 1)) && (anyped.owner != 3)) {
_local1.speed = 8;
_local1.unblockable = true;
} else if (b_type == "familiar") {
_local1.speed = 10;
} else if (b_type == "scimitar") {
_local1.speed = 10;
} else if (((b_type == "geyser") && (anyped.owner != 1)) && (anyped.owner != 3)) {
_local1.speed = 4;
_local1.unblockable = true;
} else if (b_type == "trunk") {
_local1.speed = 8;
_local1.unblockable = true;
} else if (b_type == "snowball") {
_local1.speed = 8;
_local1.unblockable = true;
} else if (b_type == "icebolt") {
_local1.speed = 12;
_local1.unblockable = true;
} else if (b_type == "shadowbolt") {
_local1.speed = 10;
_local1.unblockable = true;
} else if (b_type == "magmaball") {
_local1.speed = 5;
}
_local1.owner = anyped.owner;
_local1._rotation = b_rot;
_local1.b_type = b_type;
_local1.hp = b_hp;
if (anyped == eBoss) {
_local1._x = _local1._x - ((25 * anyped._xscale) / 100);
_local1._y = _local1._y + 25;
}
return(_local1);
}
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 928 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 _local3 = 1;
while (_local3 <= 30) {
if (mData.data["trFound" + dd(_local3)] == undefined) {
mData.data["trFound" + dd(_local3)] = false;
}
trFound[_local3] = mData.data["trFound" + dd(_local3)];
_local3++;
}
var _local5 = 1;
while (_local5 <= 30) {
if (mData.data["maskUnlocked" + dd(_local5)] == undefined) {
mData.data["maskUnlocked" + dd(_local5)] = false;
}
maskUnlocked[_local5] = mData.data["maskUnlocked" + dd(_local5)];
_local5++;
}
var _local4 = 1;
while (_local4 <= 6) {
if (mData.data["selItem" + dd(_local4)] == undefined) {
mData.data["selItem" + dd(_local4)] = 7;
}
_level0["selItem" + _local4] = mData.data["selItem" + dd(_local4)];
_local4++;
}
var _local2 = 1;
while (_local2 <= 5) {
if (mData.data["hScoreTotal" + dd(_local2)] == undefined) {
mData.data["hScoreName" + dd(_local2)] = "-----";
mData.data["hScoreTotal" + dd(_local2)] = 0;
}
hScoreName[_local2] = mData.data["hScoreName" + dd(_local2)];
hScoreTotal[_local2] = mData.data["hScoreTotal" + dd(_local2)];
_local2++;
}
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 _local2 = 1;
while (_local2 <= 30) {
mData.data["trFound" + dd(_local2)] = trFound[_local2];
_local2++;
}
var _local4 = 1;
while (_local4 <= 30) {
mData.data["maskUnlocked" + dd(_local4)] = maskUnlocked[_local4];
_local4++;
}
var _local3 = 1;
while (_local3 <= 6) {
mData.data["selItem" + dd(_local3)] = _level0["selItem" + _local3];
_local3++;
}
var _local1 = 1;
while (_local1 <= 5) {
mData.data["hScoreName" + dd(_local1)] = hScoreName[_local1];
mData.data["hScoreTotal" + dd(_local1)] = hScoreTotal[_local1];
_local1++;
}
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) {
getURL ("http://www.armorgames.com", "_blank");
}
}
} 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 _local1 = _level0[(("x" + mapCurX) + "y") + (mapCurY - 1)];
if (((_local1.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 _local1 = _level0[(("x" + mapCurX) + "y") + (mapCurY + 1)];
if (((_local1.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 _local1 = _level0[(("x" + (mapCurX - 1)) + "y") + mapCurY];
if (((_local1.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 _local1 = _level0[(("x" + (mapCurX + 1)) + "y") + mapCurY];
if (((_local1.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 _local3 = 1;
while (_local3 <= 5) {
var _local1 = slide["row" + _local3];
var _local2 = 1;
while (_local2 <= 7) {
invItem = _local1["item" + _local2];
invIndex = _local2 + ((_local3 - 1) * 6);
if (_local2 == _local1.selItem) {
invItem._alpha = 100;
if (_local3 == activeRow) {
invbox._y = (invItem._y + _local1._y) + slide._y;
if (trFound[invIndex]) {
invbox.title = trName[invIndex];
invbox.desc = trDesc[invIndex];
_level0["selItem" + _local3] = _local1.selItem;
} else {
invbox.title = "???";
invbox.desc = "You haven't found this Artifact yet! Explore more Temples.";
_level0["selItem" + _local3] = 7;
}
}
} else {
invItem._alpha = 50;
}
if (trFound[invIndex]) {
invItem.gotoAndStop(invIndex);
} else {
invItem.gotoAndStop(31);
}
if (_local2 == 7) {
invItem.gotoAndStop(32);
if ((_local3 == activeRow) && (_local2 == _local1.selItem)) {
invbox.title = "None";
invbox.desc = "No special bonus for this character!";
}
}
_local1.selectbox._x = _local1["item" + _local1.selItem]._x;
_local1.selectbox._y = _local1["item" + _local1.selItem]._y;
_local2++;
}
_local3++;
}
}
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 _local1 = 0;
while (_local1 <= 6) {
var _local2 = slide["row" + _local1];
if (_local1 == activeRow) {
_local2._alpha = 100;
} else {
_local2._alpha = 25;
}
_local1++;
}
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 _local4 = slide["row" + activeRow];
if (activeRow == 0) {
var _local3 = false;
while (!_local3) {
currentMask = currentMask + 1;
if (currentMask > 25) {
currentMask = 0;
}
if (maskUnlocked[currentMask]) {
_local3 = true;
}
}
_local4.head.gotoAndStop(currentMask + 1);
} else {
_local4.selItem = _local4.selItem + 1;
if (_local4.selItem > 7) {
_local4.selItem = 1;
}
}
refreshAllRows();
}
} else if (Key.isDown(37) || (Key.isDown(65))) {
if (!pd4d) {
pd4d = true;
var _local4 = slide["row" + activeRow];
if (activeRow == 0) {
var _local3 = false;
while (!_local3) {
currentMask = currentMask - 1;
if (currentMask < 0) {
currentMask = 25;
}
if (maskUnlocked[currentMask]) {
_local3 = true;
}
}
_local4.head.gotoAndStop(currentMask + 1);
} else {
_local4.selItem = _local4.selItem - 1;
if (_local4.selItem < 1) {
_local4.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 _local1 = randbtwn(1, 10);
if ((_local1 <= 2) && (pchar.hp < hpmax)) {
spawnPickup("redpotion", eBoss.xloc, eBoss.yloc);
} else if ((_local1 <= 4) && (pchar.mana <= (pchar.maxMana - 5))) {
spawnPickup("manapotion", eBoss.xloc, eBoss.yloc);
} else if (_local1 == 5) {
spawnPickup("gem_green", eBoss.xloc, eBoss.yloc);
} else if (_local1 == 6) {
spawnPickup("gem_blue", eBoss.xloc, eBoss.yloc);
} else if (_local1 == 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 _local2 = randbtwn(1, 10);
if ((_local2 <= 2) && (pchar.hp < hpmax)) {
spawnPickup("redpotion", anytile.tilex, anytile.tiley + 1);
} else if ((_local2 <= 4) && (pchar.mana <= (pchar.maxMana - 5))) {
spawnPickup("manapotion", anytile.tilex, anytile.tiley + 1);
} else if (_local2 == 5) {
spawnPickup("gem_green", anytile.tilex, anytile.tiley + 1);
} else if (_local2 == 6) {
spawnPickup("gem_blue", anytile.tilex, anytile.tiley + 1);
} else if (_local2 == 7) {
spawnPickup("gem_red", anytile.tilex, anytile.tiley + 1);
} else {
spawnPickup("goldcoins", anytile.tilex, anytile.tiley + 1);
}
}
function specialAbility(anyped) {
if (twoPlayer) {
var _local4 = new Array();
if (anyped == pchar) {
_local4 = p1SelItem;
} else if (anyped == schar) {
_local4 = p2SelItem;
}
selectItem1 = _local4[1];
selectItem2 = _local4[2];
selectItem3 = _local4[3];
selectItem4 = _local4[4];
selectItem5 = _local4[5];
}
if (anyped.hero == "paladin") {
if (tBlocked[anyped.xloc][(anyped.yloc + dyOffset) + 1]) {
var _local5 = tTiles[anyped.xloc][(anyped.yloc + dyOffset) + 1];
if ((!_local5.isDead) && (_local5.tileType == "normal")) {
var _local3 = 3;
if (selectItem3 == 1) {
_local3 = 5;
} else if (selectItem3 == 2) {
_local3 = 0;
}
if (anyped.mana >= _local3) {
anyped.mana = anyped.mana - _local3;
floatWords(anyped, "stomp!");
anyped.top.body.arm.gotoAndPlay("attack_melee");
anyped.cd_anim = 10;
breakBlock(_local5);
if (selectItem3 == 1) {
dblock = 1;
while (dblock <= 5) {
var _local2 = tTiles[anyped.xloc][((anyped.yloc + dyOffset) + 1) + dblock];
if (_local2.tileType == "normal") {
breakBlock(_local2);
} else if (_local2.tileType == "explosive") {
breakBlock(_local2);
makePickup(_local2);
}
dblock++;
}
}
anyped.jump = true;
anyped._y = anyped._y - 1;
anyped.ymove = -10;
} else {
floatWords(anyped, "no mana!");
}
}
}
} else if (anyped.hero == "ranger") {
var _local3 = 1;
if (selectItem4 == 3) {
_local3 = 2;
}
if (anyped.mana >= _local3) {
anyped.mana = anyped.mana - _local3;
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 _local3 = 3;
if (selectItem5 == 3) {
_local3 = 2;
}
if (selectItem5 == 5) {
_local3 = 10;
}
if (shadowCount == 0) {
if (anyped.mana >= _local3) {
anyped.mana = anyped.mana - _local3;
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 _local3 = 3;
if (selectItem2 == 1) {
_local3 = 3;
} else if (selectItem2 == 2) {
_local3 = 1;
} else if (selectItem2 == 3) {
_local3 = 3;
} else if (selectItem2 == 4) {
_local3 = 4;
} else if (selectItem2 == 5) {
_local3 = 10;
}
if (anyped.mana >= _local3) {
anyped.mana = anyped.mana - _local3;
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 _local3 = 10;
if (selectItem1 == 1) {
_local3 = 5;
} else if (selectItem1 == 2) {
_local3 = 5;
} else if (selectItem1 == 4) {
_local3 = 1;
}
if (anyped.mana >= _local3) {
if (selectItem1 == 1) {
anyped.mana = anyped.mana - _local3;
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 - _local3;
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 - _local3;
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 - _local3;
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 _local1;
if (c_type == "pchar") {
_local1 = spawnObject("char", "char", (c_x * 50) + 25, (c_y * 50) - 25, 51000);
} else {
_local1 = spawnObject("char", "char", (c_x * 50) + 25, (c_y * 50) - 25, 50000);
}
_local1.jump = false;
_local1.jump2 = false;
_local1.actwidth = 14;
_local1.actheight = 22;
_local1.c_type = c_type;
_local1.x = _local1._x;
_local1.y = _local1._y;
_local1.cd_anim = 0;
_local1.owner = 2;
_local1.noStomp = false;
_local1.canJump = 0;
_local1.armed = true;
_local1.bounty = 1;
_local1.basespeed = 1;
_local1.ranged = "";
if (c_type == "pchar") {
_local1.top.body.head.attachMovie("h_001", "head", 10);
_local1.top.body.body.attachMovie("b_001", "body", 10);
_local1.top.body.arm.arm1.attachMovie("at_001", "arm", 10);
_local1.top.body.arm.arm2.attachMovie("ab_001", "arm", 10);
_local1.armed = false;
_local1.jumpstrength = 20;
_local1.hero = "normal";
} else if (c_type == "goblin") {
_local1.top.body.head.attachMovie("h_002", "head", 10);
_local1.top.body.body.attachMovie("b_002", "body", 10);
_local1.top.body.arm.arm1.attachMovie("at_002", "arm", 10);
_local1.top.body.arm.arm2.attachMovie("ab_002", "arm", 10);
_local1.ranged = "";
_local1.xmove = 1;
_local1.bounty = 2;
if (randbtwn(1, 10) <= 5) {
_local1.xmove = -1;
}
} else if (c_type == "troll") {
_local1.top.body.head.attachMovie("h_008", "head", 10);
_local1.top.body.body.attachMovie("b_008", "body", 10);
_local1.top.body.arm.arm1.attachMovie("at_008", "arm", 10);
_local1.top.body.arm.arm2.attachMovie("ab_008", "arm", 10);
_local1.ranged = "spear";
_local1.xmove = 1;
_local1.canJump = 12;
_local1.bounty = 2;
if (randbtwn(1, 10) <= 5) {
_local1.xmove = -1;
}
} else if (c_type == "shaman") {
_local1.top.body.head.attachMovie("h_009", "head", 10);
_local1.top.body.body.attachMovie("b_009", "body", 10);
_local1.top.body.arm.arm1.attachMovie("at_009", "arm", 10);
_local1.top.body.arm.arm2.attachMovie("ab_009", "arm", 10);
_local1.ranged = "spear";
_local1.noStomp = true;
_local1.xmove = 1;
_local1.bounty = 3;
_local1.canJump = 12;
if (randbtwn(1, 10) <= 5) {
_local1.xmove = -1;
}
} else if (c_type == "skeleton") {
_local1.top.body.head.attachMovie("h_013b", "head", 10);
_local1.top.body.body.attachMovie("b_013", "body", 10);
_local1.top.body.arm.arm1.attachMovie("at_013", "arm", 10);
_local1.top.body.arm.arm2.attachMovie("ab_013", "arm", 10);
_local1.ranged = "";
_local1.xmove = 1;
_local1.bounty = 2;
if (randbtwn(1, 10) <= 5) {
_local1.xmove = -1;
}
} else if (c_type == "skarcher") {
_local1.top.body.head.attachMovie("h_013", "head", 10);
_local1.top.body.body.attachMovie("b_013", "body", 10);
_local1.top.body.arm.arm1.attachMovie("at_013", "arm", 10);
_local1.top.body.arm.arm2.attachMovie("ab_013b", "arm", 10);
_local1.ranged = "arrow";
_local1.xmove = 1;
_local1.bounty = 2;
if (randbtwn(1, 10) <= 5) {
_local1.xmove = -1;
}
} else if (c_type == "sandwarrior") {
_local1.top.body.head.attachMovie("h_014", "head", 10);
_local1.top.body.body.attachMovie("b_014", "body", 10);
_local1.top.body.arm.arm1.attachMovie("at_014", "arm", 10);
_local1.top.body.arm.arm2.attachMovie("ab_014", "arm", 10);
_local1.ranged = "shuriken";
_local1.xmove = 1;
_local1.bounty = 2;
_local1.canJump = 15;
if (randbtwn(1, 10) <= 5) {
_local1.xmove = -1;
}
} else if (c_type == "cactus") {
_local1.top.body.head.attachMovie("h_016", "head", 10);
_local1.top.body.body.attachMovie("b_016", "body", 10);
_local1.top.body.arm.arm1.attachMovie("at_016", "arm", 10);
_local1.top.body.arm.arm2.attachMovie("ab_016", "arm", 10);
_local1.ranged = "";
_local1.xmove = 1;
_local1.bounty = 3;
_local1.canJump = 12;
if (randbtwn(1, 10) <= 5) {
_local1.xmove = -1;
}
} else if (c_type == "yeti") {
_local1.top.body.head.attachMovie("h_015", "head", 10);
_local1.top.body.body.attachMovie("b_015", "body", 10);
_local1.top.body.arm.arm1.attachMovie("at_015", "arm", 10);
_local1.top.body.arm.arm2.attachMovie("ab_015", "arm", 10);
_local1.ranged = "";
_local1.xmove = 1;
_local1.bounty = 3;
_local1.canJump = 12;
if (randbtwn(1, 10) <= 5) {
_local1.xmove = -1;
}
} else if (c_type == "s_goblin") {
_local1.top.body.head.attachMovie("h_017b", "head", 10);
_local1.top.body.body.attachMovie("b_017", "body", 10);
_local1.top.body.arm.arm1.attachMovie("at_017", "arm", 10);
_local1.top.body.arm.arm2.attachMovie("ab_017b", "arm", 10);
_local1.ranged = "";
_local1.xmove = 1;
_local1.bounty = 2;
if (randbtwn(1, 10) <= 5) {
_local1.xmove = -1;
}
} else if (c_type == "s_troll") {
_local1.top.body.head.attachMovie("h_017", "head", 10);
_local1.top.body.body.attachMovie("b_017", "body", 10);
_local1.top.body.arm.arm1.attachMovie("at_017", "arm", 10);
_local1.top.body.arm.arm2.attachMovie("ab_017", "arm", 10);
_local1.ranged = "spear";
_local1.xmove = 1;
_local1.canJump = 12;
_local1.bounty = 2;
if (randbtwn(1, 10) <= 5) {
_local1.xmove = -1;
}
} else if (c_type == "shade") {
_local1.top.body.head.attachMovie("h_019", "head", 10);
_local1.top.body.body.attachMovie("b_019", "body", 10);
_local1.top.body.arm.arm1.attachMovie("at_019", "arm", 10);
_local1.top.body.arm.arm2.attachMovie("ab_019", "arm", 10);
_local1.ranged = "";
_local1.xmove = 3;
_local1.bounty = 2;
_local1.basespeed = 3;
_local1.canJump = 15;
if (randbtwn(1, 10) <= 5) {
_local1.xmove = -3;
}
}
canfall(_local1);
return(_local1);
}
function spawnPickup(p_type, p_x, p_y) {
var _local1;
_local1 = spawnObject("pickup", "pickup", (p_x * 50) + 25, (p_y * 50) - 5, 50000);
_local1.icon.attachMovie(p_type, "icon", 0);
_local1.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 _local1 = 1;
while (_local1 <= 25) {
replaceTile(-randbtwn(4, 13));
_local1++;
}
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 _local3 = randbtwn(1, 9);
var _local1 = randbtwn(16, 16);
while ((((tBlocked[_local3][(oriY + _local1) + dyOffset] || (tTiles[_local3][(oriY + _local1) + dyOffset].tileType == "key")) || (tTiles[_local3][(oriY + _local1) + dyOffset].tileType == "boss")) || (((oriY + _local1) + dyOffset) == 1)) || (tTiles[_local3][(oriY + _local1) + dyOffset] != undefined)) {
_local3 = randbtwn(1, 9);
_local1 = 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 _local5 = new Array();
_local5[1] = 1;
_local5[2] = 2;
_local5[3] = 8;
_local5[4] = 9;
_local5[5] = randbtwn(3, 4);
_local5[6] = randbtwn(6, 7);
_local5[7] = randbtwn(3, 6);
_local5[8] = randbtwn(4, 7);
_local5[9] = 5;
_local5[10] = 3;
_local5[11] = 4;
_local5[12] = 5;
_local5[13] = 6;
_local5[14] = 7;
var _local4 = new Array();
_local4[1] = 0;
_local4[2] = 0;
_local4[3] = 0;
_local4[4] = 0;
_local4[5] = randbtwn(0, 1);
_local4[6] = randbtwn(0, 1);
_local4[7] = -2;
_local4[8] = -2;
_local4[9] = 1;
_local4[10] = 1;
_local4[11] = 2;
_local4[12] = 2;
_local4[13] = 2;
_local4[14] = 1;
sweep = 1;
while (sweep <= 14) {
xSw = _local5[sweep];
yVar = _local4[sweep];
if (tBlocked[xSw][((oriY + _local1) + dyOffset) + yVar]) {
sideTile = tTiles[xSw][((oriY + _local1) + dyOffset) + yVar];
removeProp(sideTile);
tBlocked[xSw][((oriY + _local1) + dyOffset) + yVar] = false;
limboBlock = limboBlock + 1;
}
if (sweep <= 4) {
tTiles[xSw][((oriY + _local1) + dyOffset) + yVar] = spawnProp("tile_bossledge", xSw * 50, ((oriY + _local1) + yVar) * 50, 10);
} else {
tTiles[xSw][((oriY + _local1) + dyOffset) + yVar] = spawnProp("tile_gold", xSw * 50, ((oriY + _local1) + yVar) * 50, 10);
}
if (sweep > 4) {
tTiles[xSw][((oriY + _local1) + dyOffset) + yVar].tileType = "bossgold";
} else {
tTiles[xSw][((oriY + _local1) + dyOffset) + yVar].tileType = "solidgold";
}
tTiles[xSw][((oriY + _local1) + dyOffset) + yVar].tilex = xSw;
tTiles[xSw][((oriY + _local1) + dyOffset) + yVar].tiley = (oriY + _local1) + yVar;
tTiles[xSw][((oriY + _local1) + dyOffset) + yVar].swapDepths(50000 - (xSw + (((oriY + _local1) + yVar) * 10)));
tBlocked[xSw][((oriY + _local1) + dyOffset) + yVar] = true;
limboBlock = limboBlock - 1;
if (tBlocked[xSw][(((oriY + _local1) + dyOffset) - 1) + yVar]) {
sideTile = tTiles[xSw][(((oriY + _local1) + dyOffset) - 1) + yVar];
removeProp(sideTile);
tBlocked[xSw][(((oriY + _local1) + dyOffset) - 1) + yVar] = false;
limboBlock = limboBlock + 1;
}
if (sweep <= 4) {
if (tBlocked[xSw][(((oriY + _local1) + dyOffset) - 2) + yVar]) {
sideTile = tTiles[xSw][(((oriY + _local1) + dyOffset) - 2) + yVar];
removeProp(sideTile);
tBlocked[xSw][(((oriY + _local1) + dyOffset) - 2) + yVar] = false;
limboBlock = limboBlock + 1;
}
}
sweep++;
}
eBoss = spawnObject("boss" + bossNum, "char", 75, ((oriY + _local1) * 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 _local6 = spawnProp("tile_princess", _local3 * 50, (oriY + _local1) * 50, 10);
dressHero(_local6, "princess1");
_local6.tileType = "cage";
_local6.heroType = "princess";
} else {
var _local6 = spawnProp("tile_exit", _local3 * 50, (oriY + _local1) * 50, 10);
}
tBlocked[_local3][(oriY + _local1) + dyOffset] = true;
wrongTile2 = tTiles[_local3][((oriY + _local1) + dyOffset) - 1];
removeProp(wrongTile2);
tBlocked[_local3][((oriY + _local1) + dyOffset) - 1] = false;
exitChances = exitChances + 1;
if (_local6.tileType == "cage") {
closex = 1;
while (closex <= 9) {
sideWing = tTiles[closex][((oriY + _local1) + dyOffset) + 1];
removeProp(sideWing);
tTiles[closex][((oriY + _local1) + dyOffset) + 1] = spawnProp("tile_gold", closex * 50, ((oriY + _local1) + 1) * 50, 10);
tBlocked[closex][((oriY + _local1) + dyOffset) + 1] = true;
tTiles[closex][((oriY + _local1) + dyOffset) + 1].tileType = "solidgold";
tTiles[closex][((oriY + _local1) + dyOffset) + 1].swapDepths(50000 - (closex + (((oriY + _local1) + 1) * 10)));
closex++;
}
}
if ((((cIcon != 2) || (survivalMode)) || (twoPlayer)) && (!(twoPlayer && (cIcon == 5)))) {
tBlocked[_local3][(oriY + _local1) + dyOffset] = false;
_local6.tileType = "key";
}
} else if (tType == 1) {
var _local6 = spawnProp("tile_boom", _local3 * 50, (oriY + _local1) * 50, 10);
tBlocked[_local3][(oriY + _local1) + dyOffset] = true;
_local6.tileType = "explosive";
} else if ((tType <= 20) && (nextSpecialBlock >= 3)) {
nextSpecialBlock = 0;
var _local6 = spawnProp("tile_cage", _local3 * 50, (oriY + _local1) * 50, 10);
tBlocked[_local3][(oriY + _local1) + dyOffset] = true;
_local6.tileType = "cage";
_local6.heroType = lastHero;
while (_local6.heroType == lastHero) {
htype = randbtwn(1, 10);
if (htype <= 2) {
_local6.heroType = "paladin";
} else if (htype <= 4) {
_local6.heroType = "ranger";
} else if (htype <= 6) {
_local6.heroType = "thief";
} else if (htype <= 8) {
_local6.heroType = "mage";
} else if (htype <= 10) {
_local6.heroType = "barbarian";
}
}
lastHero = _local6.heroType;
if (twoPlayer) {
selectItem1 = 7;
selectItem2 = 7;
selectItem3 = 7;
selectItem4 = 7;
selectItem5 = 7;
}
dressHero(_local6, _local6.heroType);
} else if (((tType <= 30) && (nextSpecialBlock >= 3)) && (cMapType != 13)) {
nextSpecialBlock = 0;
var _local6 = spawnProp("tile_spike", _local3 * 50, (oriY + _local1) * 50, 10);
tBlocked[_local3][(oriY + _local1) + dyOffset] = true;
_local6.tileType = "spike";
} else if (((cIcon == 2) && (tType <= 40)) && (nextSpecialBlock >= 3)) {
nextSpecialBlock = 0;
var _local6 = spawnProp("tile_sliding", _local3 * 50, (oriY + _local1) * 50, 10);
tBlocked[_local3][(oriY + _local1) + dyOffset] = true;
_local6.tileType = "sliding";
_local6.count = 0;
_local6.tileStatus = true;
} else if (((cIcon == 2) && (tType <= 50)) && (nextSpecialBlock >= 3)) {
nextSpecialBlock = 0;
var _local6 = spawnProp("tile_idolhead", _local3 * 50, (oriY + _local1) * 50, 10);
tBlocked[_local3][(oriY + _local1) + dyOffset] = true;
_local6.tileType = "idolhead";
_local6.count = 0;
_local6.owner = 2;
if (_local3 > 5) {
_local6.tileStatus = true;
} else {
_local6.tileStatus = false;
_local6.gotoAndStop(2);
}
} else if (((cIcon == 4) && (tType <= 40)) && (nextSpecialBlock >= 3)) {
nextSpecialBlock = 0;
var _local6 = spawnProp("tile_icicle", _local3 * 50, (oriY + _local1) * 50, 10);
tBlocked[_local3][(oriY + _local1) + dyOffset] = true;
_local6.tileType = "icicle";
_local6.count = 0;
_local6.tileStatus = true;
} else if (((cIcon == 4) && (tType <= 50)) && (nextSpecialBlock >= 3)) {
nextSpecialBlock = 0;
var _local6 = spawnProp("tile_geyser", _local3 * 50, (oriY + _local1) * 50, 10);
tBlocked[_local3][(oriY + _local1) + dyOffset] = true;
_local6.tileType = "geyser";
_local6.count = 0;
_local6.tileStatus = true;
} else if (((cIcon == 5) && (tType <= 40)) && (nextSpecialBlock >= 3)) {
nextSpecialBlock = 0;
var _local6 = spawnProp("tile_magma", _local3 * 50, (oriY + _local1) * 50, 10);
tBlocked[_local3][(oriY + _local1) + dyOffset] = true;
_local6.tileType = "magma";
_local6.count = 0;
_local6.tileStatus = true;
} else if (((cIcon == 5) && (tType <= 50)) && (nextSpecialBlock >= 3)) {
nextSpecialBlock = 0;
var _local6 = spawnProp("tile_firevent", _local3 * 50, (oriY + _local1) * 50, 10);
tBlocked[_local3][(oriY + _local1) + dyOffset] = true;
_local6.tileType = "firevent";
_local6.count = 0;
_local6.tileStatus = true;
} else {
nextSpecialBlock = nextSpecialBlock + 1;
var _local6 = spawnProp("tile_blank" + cIcon, _local3 * 50, (oriY + _local1) * 50, 10);
_local6.block._rotation = randbtwn(0, 3) * 90;
tBlocked[_local3][(oriY + _local1) + dyOffset] = true;
if (randbtwn(0, 10) <= 5) {
_local6.block.txt = "";
}
_local6.tileType = "normal";
_local6.sand = false;
_local6.count = 0;
if ((randbtwn(1, 20) <= 5) && (!tBlocked[_local3][((oriY + _local1) - 1) + dyOffset])) {
if (thisDepth > 50) {
var _local7 = randbtwn(1, 5);
if (thisDepth < 100) {
_local7 = 1;
}
if (cIcon == 1) {
if (_local7 <= 2) {
spawnChar("goblin", _local3, oriY + _local1);
} else if (_local7 <= 4) {
spawnChar("troll", _local3, oriY + _local1);
} else if (cMapType != 13) {
spawnChar("shaman", _local3, oriY + _local1);
}
} else if (cIcon == 2) {
if (_local7 <= 3) {
spawnChar("skeleton", _local3, oriY + _local1);
} else {
spawnChar("skarcher", _local3, oriY + _local1);
}
} else if (cIcon == 3) {
if (_local7 <= 3) {
spawnChar("sandwarrior", _local3, oriY + _local1);
} else {
spawnChar("cactus", _local3, oriY + _local1);
}
} else if (cIcon == 4) {
if (_local7 <= 2) {
spawnChar("s_goblin", _local3, oriY + _local1);
} else if (_local7 <= 4) {
spawnChar("s_troll", _local3, oriY + _local1);
} else {
spawnChar("yeti", _local3, oriY + _local1);
}
} else if (cIcon == 5) {
if (_local7 <= 2) {
spawnChar("goblin", _local3, oriY + _local1);
} else if (_local7 <= 4) {
spawnChar("troll", _local3, oriY + _local1);
} else {
spawnChar("shaman", _local3, oriY + _local1);
}
}
}
}
}
_local6.tilex = _local3;
_local6.tiley = oriY + _local1;
tTiles[_local3][(oriY + _local1) + dyOffset] = _local6;
_local6.swapDepths(50000 - (_local3 + ((oriY + _local1) * 10)));
checkTop(_local6);
if (cIcon == 3) {
if (_local6.tileType == "normal") {
if (randbtwn(1, 10) <= 3) {
if (!tBlocked[tx][(ty - 1) + dyOffset]) {
_local6.gotoAndStop(3);
_local6.sand = false;
}
}
}
}
}
function checkTop(anytile) {
tx = anytile.tilex;
ty = anytile.tiley;
anytile.count = 2;
if (anytile.tileType == "normal") {
var _local3 = 0;
var _local1 = 1;
while (_local1 <= 9) {
if (tBlocked[_local1][ty + dyOffset]) {
_local3 = _local3 + 1;
}
_local1++;
}
if (_local3 >= 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 _local3 = new Array();
if (anyped == pchar) {
_local3 = p1SelItem;
} else if (anyped == schar) {
_local3 = p2SelItem;
}
selectItem1 = _local3[1];
selectItem2 = _local3[2];
selectItem3 = _local3[3];
selectItem4 = _local3[4];
selectItem5 = _local3[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 _local1 = 1;
while (_local1 <= 20) {
if ((limboBlock > 0) && (randbtwn(1, 10) <= 7)) {
replaceTile((-dyOffset) - 2);
limboBlock = limboBlock - 1;
} else {
_local1 = 99;
}
_local1++;
}
}
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 _local2 = new Array();
if (anyped == pchar) {
_local2 = p1SelItem;
} else if (anyped == schar) {
_local2 = p2SelItem;
}
selectItem1 = _local2[1];
selectItem2 = _local2[2];
selectItem3 = _local2[3];
selectItem4 = _local2[4];
selectItem5 = _local2[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 _local2 = 0;
while (_local2 <= 17) {
if (_local2 == -1) {
var _local1 = 1;
while (_local1 <= 9) {
tBlocked[_local1][_local2] = false;
tTiles[rx][ry] = undefined;
_local1++;
}
} else {
var _local1 = 1;
while (_local1 <= 9) {
tBlocked[_local1][_local2] = tBlocked[_local1][_local2 + 1];
tTiles[_local1][_local2] = tTiles[_local1][_local2 + 1];
tTiles[_local1][_local2 + 1] = undefined;
_local1++;
}
}
_local2++;
}
}
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 _local2 = tTiles[tilex][tiley + dyOffset];
if (((!_local2.isDead) && (_local2 != undefined)) && (_local2.tileType != "")) {
if (_local2.tileType == "explosive") {
snd_box.start();
breakBlock(_local2);
chestsOpened = chestsOpened + 1;
if (anyped.objclass == "char") {
anyped.jump = true;
anyped._y = anyped._y - 1;
anyped.ymove = -12;
}
makePickup(_local2);
if (checkHint(7)) {
addTip("Breaking open chests will always reveal potions, gold coins, or other useful items!", "normal");
}
} else if (_local2.tileType == "icicle") {
breakBlock(_local2);
if (anyped.objclass == "char") {
anyped.jump = true;
anyped._y = anyped._y - 1;
anyped.ymove = -12;
}
} else if (_local2.tileType == "ice") {
enemyChar = spawnChar("yeti", tilex, tiley);
enemyChar.y = enemyChar.y + 120;
enemyChar._y = enemyChar._y;
breakBlock(_local2);
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 (_local2.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 (_local2.tileType == "magma") {
if (anyped.objclass == "char") {
anyped.jump = true;
anyped._y = anyped._y - 1;
anyped.ymove = -20;
attachEffect(anyped, "fx_steamcloud");
}
} else if (_local2.tileType == "cage") {
if (anyped.objclass == "missile") {
anyped.hp = anyped.hp - 1;
if ((selectItem4 == 6) && (_local2.heroType != "princess")) {
gold = gold + 3;
makePickup(_local2);
floatWords(_local2, "+3 gp!");
_local2.tileType = "";
attachEffect(_local2, "fx_explosion");
_local2.gotoAndStop(3);
snd_box.start();
tBlocked[_local2.tilex][_local2.tiley + dyOffset] = false;
}
}
} else if (_local2.tileType == "normal") {
if (cIcon == 3) {
if (_local2.sand) {
if (_local2.count <= 0) {
attachEffect(_local2, "fx_sandcloud");
lastFx._x = lastFx._x + 25;
tBlocked[tilex][tiley + dyOffset] = false;
removeProp(_local2);
limboBlock = limboBlock + 1;
if (checkHint(26)) {
addTip("Desert sands are treacherously unstable: try to stay on the solid rocks!", "normal");
}
} else {
_local2.count = _local2.count - 1;
}
}
}
if (anyped.objclass == "missile") {
if ((anyped.b_type == "fireball") || (anyped.b_type == "familiar")) {
breakBlock(_local2);
} else if (anyped.b_type == "breaker") {
breakBlock(_local2);
} else if (anyped.b_type == "icebolt") {
tBlocked[tilex][tiley + dyOffset] = false;
_local2.tileType = "";
removeProp(_local2);
var _local5 = spawnProp("tile_icicle", tilex * 50, tiley * 50, 10);
tBlocked[tilex][tiley + dyOffset] = true;
_local5.tileType = "icicle";
_local5.tilex = tilex;
_local5.tiley = tiley;
tTiles[tilex][tiley + dyOffset] = _local5;
_local5.swapDepths(50000 - (tilex + (tiley * 10)));
}
}
}
if ((anyped.objclass == "missile") && (_local2.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 _local20 = tTiles[pchar.xloc][(pchar.yloc + dyOffset) + 1];
var _local21 = tTiles[pchar.xloc][pchar.yloc + dyOffset];
if (twoPlayer) {
var _local18 = tTiles[schar.xloc][(schar.yloc + dyOffset) + 1];
var _local22 = tTiles[schar.xloc][schar.yloc + dyOffset];
}
if ((_local21.tileType == "key") || (_local22.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 ((_local20.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 ((_local18.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 ((_local20.tileType == "cage") && (pchar.ymove <= 3)) {
openCage(_local20, pchar);
}
}
} else {
pdown = false;
}
if (twoPlayer) {
if (Key.isDown(83)) {
if (!p2down) {
p2down = true;
if ((_local18.tileType == "cage") && (schar.ymove <= 3)) {
openCage(_local18, schar);
}
}
} else {
p2down = false;
}
}
if (aiBuddy) {
if (_local18.tileType == "cage") {
openCage(_local18, 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") && (_local20.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 _local19;
if (twoPlayer) {
if (pchar.y > schar.y) {
_local19 = pchar;
} else {
_local19 = schar;
}
} else {
_local19 = pchar;
}
if (!lockScrolling) {
if ((_local19._y + stage._y) > lockSpot) {
stage._y = stage._y - (((_local19._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 _local12 = 0;
while (_local12 <= propCount) {
var _local3 = stage["prop" + dd(_local12)];
if (!_local3.isDead) {
if (_local3.tileType == "explosive") {
if ((sancSpecial > 0) && ((_local3._y + stage._y) < 500)) {
_local3.isDead = true;
breakBlock(_local3);
makePickup(_local3);
snd_pop.start();
}
}
if (bossSpawned && (eBoss == undefined)) {
if ((!goldBroken) && ((frames % 10) == 0)) {
if ((_local3.tileType == "bossgold") && ((_local3._y + stage._y) < 500)) {
_local3.isDead = true;
breakBlock(_local3);
goldBroken = true;
snd_pop.start();
}
}
}
if ((bossSpawned && (eBoss != undefined)) && ((eBoss._y + stage._y) < 350)) {
if ((!bossClearance) && ((frames % 15) == 0)) {
if ((((_local3.tileType != "bossgold") && (_local3.tileType != "solidgold")) && (_local3.tileType != "icicle")) && ((_local3._y + stage._y) < 500)) {
_local3.isDead = true;
breakBlock(_local3);
bossClearance = true;
}
}
}
if (_local3.tileType == "sliding") {
_local3.count = _local3.count + 1;
if (_local3.count >= 90) {
_local3.count = 0;
_local3.tileStatus = !_local3.tileStatus;
if (_local3.tileStatus) {
_local3.gotoAndStop(1);
tBlocked[_local3.tilex][_local3.tiley + dyOffset] = true;
if (pchar.xloc == _local3.tilex) {
if (pchar.yloc == _local3.tiley) {
pchar.jump = true;
pchar.ymove = -12;
}
}
} else {
_local3.gotoAndStop(2);
tBlocked[_local3.tilex][_local3.tiley + dyOffset] = false;
}
}
}
if (_local3.tileType == "geyser") {
_local3.count = _local3.count + 1;
if (_local3.count >= 100) {
_local3.count = 0;
var _local15 = fireMissile(_local3, -90, "geyser", 1);
attachEffect(_local3, "fx_explosion");
_local15._y = _local15._y - 50;
_local15._x = _local15._x + 12;
lastFx._y = lastFx._y + 25;
lastFx._x = lastFx._x + 25;
}
}
if (_local3.tileType == "firevent") {
_local3.count = _local3.count + 1;
if (_local3.count >= 100) {
_local3.count = 0;
var _local15 = fireMissile(_local3, -45, "magmaball", 1);
_local15._y = _local15._y - 50;
_local15._x = _local15._x + 12;
_local15 = fireMissile(_local3, 225, "magmaball", 1);
_local15._y = _local15._y - 50;
_local15._x = _local15._x + 12;
attachEffect(_local3, "fx_explosion");
lastFx._y = lastFx._y + 25;
lastFx._x = lastFx._x + 25;
}
}
if (_local3.tileType == "idolhead") {
_local3.count = _local3.count + 1;
if (_local3.count >= 100) {
_local3.count = 0;
if (_local3.tileStatus) {
var _local15 = fireMissile(_local3, 180, "dart", 1);
} else {
var _local15 = fireMissile(_local3, 0, "dart", 1);
}
attachEffect(_local3, "fx_explosion");
_local15._y = _local15._y + 25;
lastFx._y = lastFx._y + 25;
lastFx._x = lastFx._x + 25;
}
}
if (_local3.heroType == "princess") {
if ((_local3._y + stage._y) <= 400) {
lockScrolling = true;
}
}
if ((_local3._y + stage._y) < -50) {
currentY = _local3.tiley;
limboBlock = limboBlock + 1;
_local3.isDead = true;
removeProp(_local3);
}
}
_local12++;
}
var _local16 = false;
var _local17 = true;
var _local14 = false;
var _local13 = 0;
if (objCount == undefined) {
objCount = 0;
}
var _local11 = 0;
while (_local11 <= objCount) {
var _local1 = stage["obj" + dd(_local11)];
if (!_local1.isDead) {
_local1.xTile = Math.ceil((_local1._x + (_local1._xscale / 100)) / 50) - 1;
_local1.yTile = Math.ceil((_local1._y + 1) / 50) - 1;
_local1.bodyTile = Math.ceil((_local1._y - 5) / 50) - 1;
_local1.nextTile = Math.ceil((_local1._x + ((12 * _local1._xscale) / 100)) / 50) - 1;
_local1.landTile = Math.ceil((_local1._y + 25) / 50) - 1;
if (_local1.objclass == "missile") {
var _local10 = _local1._rotation;
_local10 = (_local10 / 180) * mPi;
_local1._x = _local1._x + (((_local1.speed * mCo(_local10)) * _local1._xscale) / 100);
_local1._y = _local1._y + (((_local1.speed * mSi(_local10)) * _local1._xscale) / 100);
if ((((_local1._x < -50) || (_local1._x > 550)) || ((_local1._y + stage._y) > 550)) || ((_local1._y + stage._y) < -50)) {
removeObject(_local1);
}
if ((_local1.owner == 1) || (_local1.owner == 3)) {
activateTile(_local1, _local1.xTile, _local1.yTile);
} else {
if ((((((tBlocked[_local1.xTile][_local1.yTile + dyOffset] && (_local1.b_type != "dart")) && (_local1.b_type != "geyser")) && (_local1.b_type != "icebolt")) && (_local1.b_type != "fireball")) && (_local1.b_type != "snowball")) && (_local1.b_type != "trunk")) {
_local1.hp = 0;
}
if (_local1.b_type == "snowball") {
if ((tTiles[_local1.xTile][_local1.yTile + dyOffset].tileType == "icicle") || (tTiles[_local1.xTile][_local1.yTile + dyOffset].tileType == "normal")) {
breakBlock(tTiles[_local1.xTile][_local1.yTile + dyOffset]);
limboBlock = limboBlock + 1;
} else if (!tBlocked[_local1.xTile][_local1.yTile + dyOffset]) {
if (randbtwn(1, 30) == 2) {
if (((_local1.xTile >= 3) && (_local1.xTile <= 7)) && ((_local1._y + stage._y) > 150)) {
var _local6 = spawnProp("tile_icicle", _local1.xTile * 50, _local1.yTile * 50, 10);
tBlocked[_local1.xTile][_local1.yTile + dyOffset] = true;
_local6.tileType = "icicle";
_local6.tilex = _local1.xTile;
_local6.tiley = _local1.yTile;
tTiles[_local1.xTile][_local1.yTile + dyOffset] = _local6;
_local6.swapDepths(50000 - (_local1.xTile + (_local1.yTile * 10)));
limboBlock = limboBlock - 1;
removeObject(_local1);
}
}
}
}
}
if (_local1.b_type == "familiar") {
if (_local1._rotation == 0) {
if (tBlocked[_local1.xTile + 1][_local1.yTile + dyOffset] || (_local1.xTile == 9)) {
activateTile(_local1, _local1.xTile + 1, _local1.yTile);
_local1._rotation = randbtwn(0, 3) * 90;
}
} else if (_local1._rotation == 90) {
if (tBlocked[_local1.xTile][(_local1.yTile + dyOffset) + 1]) {
activateTile(_local1, _local1.xTile, _local1.yTile + 1);
_local1._rotation = randbtwn(0, 3) * 90;
}
} else if (_local1._rotation == 180) {
if (tBlocked[_local1.xTile - 1][_local1.yTile + dyOffset] || (_local1.xTile == 1)) {
activateTile(_local1, _local1.xTile - 1, _local1.yTile);
_local1._rotation = randbtwn(0, 3) * 90;
}
} else if (_local1._rotation == 270) {
if (tBlocked[_local1.xTile][(_local1.yTile + dyOffset) - 1]) {
activateTile(_local1, _local1.xTile, _local1.yTile - 1);
_local1._rotation = randbtwn(0, 3) * 90;
}
}
}
if (_local1.b_type == "scimitar") {
_local1._rotation = _local1._rotation + _local1.spindir;
}
if (_local1.hp <= 0) {
attachEffect(_local1, "fx_explosion");
removeObject(_local1);
}
if ((_local1.yloc == schar.yloc) && (Math.abs(_local1.xloc - schar.xloc) <= 2)) {
_local16 = true;
}
}
if (_local1.objclass == "char") {
corners(_local1.x, _local1.y + _local1.ymove, _local1);
_local1.xloc = int(_local1.x / 50);
_local1.yloc = int((_local1.y + _local1.ymove) / 50);
if (_local1.ymove < -2) {
_local1.ymove = _local1.ymove * gGravity;
if (_local1.ymove > -2) {
_local1.ymove = -_local1.ymove;
}
} else if (_local1.ymove < gTerminal) {
_local1.ymove = _local1.ymove + 0.1;
_local1.ymove = _local1.ymove * (2 - gGravity);
}
if (_local1.ymove < 0) {
if (_local1.cURi && (_local1.cULi)) {
_local1.y = _local1.y + _local1.ymove;
} else {
_local1.y = (_local1.yloc * 50) + _local1.actheight;
_local1.ymove = 2;
}
} else if (_local1.ymove > 0) {
if (_local1.cBLi && (_local1.cBRi)) {
_local1.y = _local1.y + _local1.ymove;
} else {
_local1.y = ((_local1.yloc + 1) * 50) - _local1.actheight;
_local1.ymove = 0;
_local1.jump = false;
_local1.jump2 = false;
if ((_local1.owner == 1) || (_local1.owner == 3)) {
if (shadowCount == 0) {
activateTile(_local1, _local1.xTile, _local1.yTile + 1);
}
}
}
}
corners(_local1.x + _local1.xmove, _local1.y, _local1);
_local1.xloc = int(_local1.x / 50);
_local1.yloc = int(_local1.y / 50);
if (_local1.cd_anim > 0) {
_local1.cd_anim = _local1.cd_anim - 1;
}
if (_local1.xmove == 0) {
if ((!_local1.jump) && (_local1.cd_anim == 0)) {
_local1.top.body.arm.gotoAndStop(1);
}
_local1.legs.gotoAndStop(1);
} else if (_local1.xmove < 0) {
if (!_local1.armed) {
_local1.top.body.arm.play();
}
_local1.legs.play();
if (((_local1.cULi && (_local1.cMLi)) && (_local1.cBLi)) && (_local1._x > (50 + _local1.actwidth))) {
_local1._xscale = -100;
_local1.x = _local1.x + _local1.xmove;
canfall(_local1);
}
} else if (_local1.xmove > 0) {
if (!_local1.armed) {
_local1.top.body.arm.play();
}
_local1.legs.play();
if (((_local1.cURi && (_local1.cMRi)) && (_local1.cBRi)) && (_local1._x < (500 - _local1.actwidth))) {
_local1._xscale = 100;
_local1.x = _local1.x + _local1.xmove;
canfall(_local1);
}
}
_local1._x = _local1.x;
_local1._y = _local1.y;
}
if (_local1.objclass == "pickup") {
if (_local1.xloc == schar.xloc) {
_local14 = true;
}
}
if (((_local1 != pchar) && ((_local1 != schar) || (aiBuddy))) && (_local1.objclass == "char")) {
if (_local1 != schar) {
if (((_local1._y + stage._y) < 0) || ((_local1._y + stage._y) > 850)) {
removeObject(_local1);
}
}
if (randbtwn(1, 60) == 1) {
_local1.xmove = (randbtwn(0, 2) - 1) * _local1.basespeed;
}
if (_local1.owner == 2) {
if (_local1.yloc == schar.yloc) {
if (_local1.xloc == schar.xloc) {
_local17 = true;
}
}
if (thiObj.yloc == schar.yloc) {
if (_local1.xloc < schar.xloc) {
_local13 = -1;
} else if (_local1.xloc > schar.xloc) {
_local13 = 1;
}
}
if (necroSpecial > 0) {
if (_local1 == eBoss) {
bossHit(1);
} else if ((_local1._y + stage._y) < 500) {
necroCaster.gold = necroCaster.gold + _local1.bounty;
killEnemy(_local1);
}
}
if ((_local1._y + stage._y) < 500) {
checkStrike(_local1, pchar);
checkStrike(_local1, schar);
}
if (!_local1.jump) {
if ((((!_local1.cMRi) && (!_local1.cLRi)) && (!_local1.cMLi)) && (!_local1.cLLi)) {
removeObject(_local1);
}
}
}
if (_local1.canJump > 0) {
if (randbtwn(1, 60) == 1) {
if (!_local1.jump) {
_local1.jump = true;
_local1.ymove = -_local1.canJump;
}
}
}
if (_local1 == schar) {
var _local4 = new Array();
var _local7 = new Array();
var _local8 = new Array();
aib = 1;
while (aib <= 3) {
_local4[aib] = "";
_local7[aib] = false;
_local8[aib] = false;
aibx = 1;
while (aibx <= 5) {
if (tBlocked[(schar.xloc + aib) - 2][(schar.yloc + dyOffset) + aibx]) {
_local4[aib] = tTiles[(schar.xloc + aib) - 2][(schar.yloc + dyOffset) + aibx].tileType;
if ((_local4[aib] == "spike") || (_local4[aib] == "firevent")) {
_local7[aib] = true;
} else if ((_local4[aib] == "cage") || (_local4[aib] == "explosive")) {
_local8[aib] = true;
}
aibx = 99;
}
aibx++;
}
aib++;
}
if ((_local1.ranged != "") && (_local1.mana > 3)) {
if (_local13 == -1) {
_local1._xscale = -100;
specialAbility(_local1);
} else if (_local13 == 1) {
_local1._xscale = 100;
specialAbility(_local1);
}
}
if (randbtwn(1, 10) == 3) {
if (_local1.yloc > (pchar.yloc + 2)) {
if ((_local1.xmove != 0) || (_local14)) {
_local1.xmove = 0;
} else if (randbtwn(1, 60) == 2) {
_local1.xmove = _local1.basespeed;
if (randbtwn(1, 10) <= 5) {
_local1.xmove = -_local1.xmove;
}
}
} else {
if (_local14) {
_local1.xmove = 0;
}
if (randbtwn(1, 10) <= 5) {
if (_local1.xmove == 0) {
_local1.xmove = _local1.basespeed;
if (randbtwn(1, 10) <= 5) {
_local1.xmove = -_local1.xmove;
}
}
}
if (((randbtwn(1, 20) == 5) || (_local16)) || (_local17 && (_local1.yloc > ((-dyOffset) + 3)))) {
makeJump(_local1);
}
}
if ((randbtwn(1, 5) == 3) && (_local1.mana > 5)) {
specialAbility(_local1);
}
if (_local7[1] && (_local1.xmove < 0)) {
_local1.xmove = -_local1.xmove;
}
if (_local7[2] && (_local1.xmove == 0)) {
_local1.xmove = _local1.basespeed;
if (randbtwn(1, 10) <= 5) {
_local1.xmove = -_local1.xmove;
}
}
if (_local7[3] && (_local1.xmove > 0)) {
_local1.xmove = -_local1.xmove;
}
if (_local8[1] && (_local1.xmove >= 0)) {
_local1.xmove = -_local1.basespeed;
}
if (_local8[2] && (_local1.xmove != 0)) {
_local1.xmove = 0;
}
if (_local8[3] && (_local1.xmove <= 0)) {
_local1.xmove = _local1.basespeed;
}
}
}
if (_local1.objclass == "char") {
if (!_local1.jump) {
if (((_local1.xmove < 0) && (_local1.cBLi || (!_local1.cMLi))) || ((_local1.xmove > 0) && (_local1.cBRi || (!_local1.cMRi)))) {
if (((_local1.owner != 1) && (_local1.owner != 3)) || (randbtwn(1, 10) == 2)) {
_local1.xmove = -_local1.xmove;
} else if (_local1 == schar) {
if (randbtwn(1, 10) == 3) {
makeJump(_local1);
}
} else {
_local1.jump = true;
_local1.ymove = -_local1.canJump;
}
if ((_local1.owner == 1) || (_local1.owner == 3)) {
if ((_local1.xmove < 0) && (_local1._x <= 70)) {
_local1.xmove = -_local1.xmove;
} else if ((_local1.xmove > 0) && (_local1._x >= 480)) {
_local1.xmove = -_local1.xmove;
}
}
}
}
}
if ((_local1._y + stage._y) < 500) {
if (_local1.ranged != "") {
if (_local1.cd_anim == 0) {
_local1.cd_anim = 90;
_local1.top.body.arm.gotoAndPlay("attack_melee");
if (_local1 == eBoss) {
if (_local1._xscale > 0) {
if (bossNum == 1) {
fireMissile(_local1, 45, _local1.ranged, 1);
fireMissile(_local1, 0, _local1.ranged, 1);
fireMissile(_local1, -45, _local1.ranged, 1);
} else if (bossNum == 2) {
mis1 = fireMissile(_local1, 0, _local1.ranged, 1);
mis2 = fireMissile(_local1, -90, _local1.ranged, 1);
} else if (bossNum == 3) {
fireMissile(_local1, -45, _local1.ranged, 1);
fireMissile(_local1, 0, _local1.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(_local1, -45, "icebolt", 1);
fireMissile(_local1, 0, "icebolt", 1);
fireMissile(_local1, 30, _local1.ranged, 1);
fireMissile(_local1, 60, _local1.ranged, 1);
}
} else if (bossNum == 1) {
fireMissile(_local1, 225, _local1.ranged, 1);
fireMissile(_local1, 180, _local1.ranged, 1);
fireMissile(_local1, 135, _local1.ranged, 1);
} else if (bossNum == 2) {
mis1 = fireMissile(_local1, 180, _local1.ranged, 1);
mis2 = fireMissile(_local1, -90, _local1.ranged, 1);
} else if (bossNum == 3) {
fireMissile(_local1, 225, _local1.ranged, 1);
fireMissile(_local1, 180, _local1.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(_local1, 225, "icebolt", 1);
fireMissile(_local1, 180, "icebolt", 1);
fireMissile(_local1, 150, _local1.ranged, 1);
fireMissile(_local1, 120, _local1.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 (_local1._xscale > 0) {
fireMissile(_local1, 0, _local1.ranged, 1);
} else {
fireMissile(_local1, 180, _local1.ranged, 1);
}
}
}
}
}
var _local9 = 1;
while (_local9 <= objCount) {
var _local2 = stage["obj" + dd(_local9)];
if (shadowCount == 0) {
if (!_local2.isDead) {
if ((_local1.owner == 1) || (_local1.owner == 3)) {
if (_local1 != _local2) {
if (_local1.owner != _local2.owner) {
if (_local2.box.hitTest(_local1.box)) {
if (twoPlayer) {
selectItem1 = 7;
selectItem2 = 7;
selectItem3 = 7;
selectItem4 = 7;
selectItem5 = 7;
var _local5 = new Array();
if (_local1 == pchar) {
_local5 = p1SelItem;
} else if (_local1 == schar) {
_local5 = p2SelItem;
}
selectItem1 = _local5[1];
selectItem2 = _local5[2];
selectItem3 = _local5[3];
selectItem4 = _local5[4];
selectItem5 = _local5[5];
}
if (_local1.objclass == "missile") {
if (((_local1.owner == 1) && (_local2.owner == 3)) || ((_local1.owner == 3) && (_local2.owner == 1))) {
_local2.jump = true;
_local2.ymove = -10;
} else if (_local2.objclass == "char") {
if (_local2 == eBoss) {
bossHit(1);
_local1.hp = 0;
} else {
if (_local1.b_type == "holybolt") {
spawnPickup("redpotion", _local2.xloc, _local2.yloc + 1);
} else if (_local1.b_type == "icebolt") {
var _local6 = spawnProp("tile_icicle", _local2.xloc * 50, _local2.yloc * 50, 10);
tBlocked[_local2.xloc][_local2.yloc + dyOffset] = true;
_local6.tileType = "icicle";
_local6.tilex = _local2.xloc;
_local6.tiley = _local2.yloc;
tTiles[_local2.xloc][_local2.yloc + dyOffset] = _local6;
_local6.swapDepths(50000 - (_local2.xloc + (_local2.yloc * 10)));
limboBlock = limboBlock - 1;
removeObject(_local1);
}
if (_local1.b_type == "shuriken") {
_local1._rotation = randbtwn(0, 360);
} else {
_local1.hp = _local1.hp - 1;
}
if (_local1.owner == 1) {
pchar.gold = pchar.gold + _local2.bounty;
} else if (_local1.owner == 3) {
schar.gold = schar.gold + _local2.bounty;
}
killEnemy(_local2);
}
}
} else if (_local2.objclass == "missile") {
if (((_local1.owner == 1) && (_local2.owner == 3)) || ((_local1.owner == 3) && (_local2.owner == 1))) {
_local1.jump = true;
_local1.ymove = -10;
} else if (_local1.hit == 0) {
if ((_local2.b_type == "geyser") || (_local2.b_type == "snowball")) {
_local1.jump = true;
_local1.ymove = -15;
} else if (((selectItem5 == 4) && (_local1.hero == "thief")) && (_local1.mana >= 5)) {
_local1.mana = _local1.mana - 5;
escapeThief(_local1);
} else if (((_local1.hero == "paladin") && (selectItem3 == 3)) && (!_local2.unblockable)) {
_local2.hp = 0;
fireMissile(_local1, _local2._rotation + 180, _local2.b_type, 1);
_local1.top.body.arm.gotoAndPlay("attack_melee");
_local1.cd_anim = 10;
} else if (((_local1.hero == "barbarian") && (selectItem1 == 3)) && (!_local2.unblockable)) {
_local2.hp = 0;
fireMissile(_local1, (_local2._rotation - 45) + 180, _local2.b_type, 1);
fireMissile(_local1, (_local2._rotation + 45) + 180, _local2.b_type, 1);
_local1.top.body.arm.gotoAndPlay("attack_melee");
_local1.cd_anim = 10;
} else if ((((_local1.hero != "paladin") || ((_local1._xscale > 0) && (_local2._rotation == 0))) || ((_local1._xscale < 0) && (_local2._rotation == 180))) || (selectItem3 == 4)) {
loseHP(_local1);
}
_local2.hp = 0;
}
} else if (_local2.objclass == "char") {
if (((_local1.owner == 1) && (_local2.owner == 3)) || ((_local1.owner == 3) && (_local2.owner == 1))) {
if (((_local1.ymove > 3) && (_local1._y < _local2._y)) && ((!_local2.jump) || (_local2.jump && (_local2.ymove < 0)))) {
_local1.jump = true;
_local1.ymove = -10;
if (_local2.jump) {
_local2.ymove = 3;
}
} else if (((_local2.ymove > 3) && (_local2._y < _local1._y)) && ((!_local1.jump) || (_local1.jump && (_local1.ymove < 0)))) {
_local2.jump = true;
_local2.ymove = -10;
if (_local1.jump) {
_local1.ymove = 3;
}
}
} else if (_local1.armed) {
if (_local2 == eBoss) {
if (eBoss.hit == 0) {
bossHit(1);
_local1.top.body.arm.gotoAndPlay("attack_melee");
_local1.cd_anim = 10;
} else if (((selectItem5 == 4) && (_local1.hero == "thief")) && (_local1.mana >= 5)) {
_local1.mana = _local1.mana - 5;
escapeThief(_local1);
} else if (_local1.hit == 0) {
loseHP(_local1);
_local1.jump = true;
_local1.ymove = -10;
}
} else {
attachEffect(_local2, "effect_slash");
_local1.top.body.arm.gotoAndPlay("attack_melee");
_local1.cd_anim = 10;
if (selectItem1 == 5) {
if (_local1.hero == "barbarian") {
if (_local1.berserk) {
gold = gold + _local2.bounty;
_local1.gold = _local1.gold + _local2.bounty;
floatWords(_local2, ("+" + _local2.bounty) + " gp!");
if (_local1.hp < hpmax) {
_local1.hp = _local1.hp + 1;
}
}
}
}
_local1.gold = _local1.gold + _local2.bounty;
killEnemy(_local2);
}
} else if ((_local1.ymove > 0) && (_local1._y < (_local2._y - 5))) {
if (!_local2.noStomp) {
if (_local2 == eBoss) {
bossHit(1);
} else {
_local1.gold = _local1.gold + _local2.bounty;
killEnemy(_local2);
if (selectItem1 == 5) {
if (_local1.hero == "barbarian") {
if (_local1.berserk) {
if (_local1.hp < hpmax) {
_local1.hp = _local1.hp + 1;
}
}
}
}
}
} else {
if (((selectItem5 == 4) && (_local1.hero == "thief")) && (_local1.mana >= 5)) {
_local1.mana = _local1.mana - 5;
escapeThief(_local1);
} else if (_local1.hit == 0) {
loseHP(_local1);
}
if (checkHint(21)) {
addTip("Watch out: these enemies hurt you if you try to jump on their heads.", "normal");
}
}
_local1.jump = true;
_local1.ymove = -10;
if (checkHint(12)) {
addTip("Most (but not all!) enemies can be killed by jumping on their heads.", "normal");
}
} else if (((selectItem5 == 4) && (_local1.hero == "thief")) && (_local1.mana >= 5)) {
_local1.mana = _local1.mana - 5;
escapeThief(_local1);
} else if (_local1.hit == 0) {
loseHP(_local1);
_local2.top.body.arm.gotoAndPlay("attack_melee");
_local2.cd_anim = 10;
}
} else if (_local2.objclass == "pickup") {
attachEffect(_local2, "fx_explosion");
if (_local2.ptype == "redpotion") {
floatWords(pchar, "+hp!");
snd_btn.start();
if (_local1.hp < hpmax) {
_local1.hp = _local1.hp + 1;
}
} else if (_local2.ptype == "manapotion") {
snd_btn.start();
floatWords(_local1, "+mana!");
_local1.mana = _local1.mana + 5;
if (selectItem2 == 6) {
_local1.mana = _local1.mana + 5;
}
if (_local1.mana > pchar.maxMana) {
_local1.mana = pchar.maxMana;
}
} else if (_local2.ptype == "goldcoins") {
if (selectItem5 == 6) {
floatWords(_local1, "+3 gp!");
gold = gold + 3;
_local1.gold = _local1.gold + 3;
} else {
floatWords(_local1, "+1 gp!");
gold = gold + 1;
_local1.gold = _local1.gold + 1;
}
snd_cash.start();
} else if (_local2.ptype == "gem_green") {
if (selectItem5 == 6) {
floatWords(_local1, "+4 gp!");
gold = gold + 4;
_local1.gold = _local1.gold + 4;
} else {
floatWords(_local1, "+2 gp!");
gold = gold + 2;
_local1.gold = _local1.gold + 2;
}
snd_cash.start();
} else if (_local2.ptype == "gem_blue") {
if (selectItem5 == 6) {
floatWords(_local1, "+5 gp!");
gold = gold + 5;
_local1.gold = _local1.gold + 5;
} else {
floatWords(_local1, "+3 gp!");
gold = gold + 3;
_local1.gold = _local1.gold + 3;
}
snd_cash.start();
} else if (_local2.ptype == "gem_red") {
if (selectItem5 == 6) {
floatWords(_local1, "+7 gp!");
gold = gold + 7;
_local1.gold = _local1.gold + 7;
} else {
floatWords(_local1, "+5 gp!");
gold = gold + 5;
_local1.gold = _local1.gold + 5;
}
snd_cash.start();
}
removeObject(_local2);
}
}
}
}
}
}
}
_local9++;
}
}
_local11++;
}
}
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 <= 60) {
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;
}
};
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;
}
};
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 _local1 = medalx + ((medaly - 1) * 5);
thisMedal._alpha = 100;
if (maskUnlocked[_local1]) {
maskname = maskNames[_local1];
maskdesc = maskDesc[_local1];
} else {
maskname = "?? Locked ??";
maskdesc = maskDesc[_local1];
}
} 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 60 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 _local1 = 1;
while (_local1 <= 30) {
maskNew[_local1] = false;
_local1++;
}
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 1376 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 1376 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 1376 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 1376 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 _local2 = 1;
while (_local2 <= 2) {
var _local1 = 0;
while (_local1 <= 5) {
thisBox = _level0[(("box" + _local2) + "") + _local1];
thisInvBox = _level0["invbox" + _local2];
thisBoxIndex = ((_local1 - 1) * 6) + _level0[("p" + _local2) + "SelItem"][_local1];
if (_local1 == 0) {
thisBox.head.gotoAndStop(_level0[("p" + _local2) + "Mask"] + 1);
} else {
thisBox.icon.gotoAndStop(thisBoxIndex);
if (_level0[("p" + _local2) + "SelItem"][_local1] == 7) {
thisBox.icon.gotoAndStop(32);
thisBoxIndex = 0;
}
}
if (_local1 == _level0[("p" + _local2) + "_selection"]) {
thisBox._alpha = 100;
thisInvBox._y = thisBox._y;
thisInvBox.title = trName[thisBoxIndex];
thisInvBox.desc = trDesc[thisBoxIndex];
} else {
thisBox._alpha = 50;
}
if (_level0[("p" + _local2) + "_selection"] == 0) {
thisInvBox._y = -200;
}
_local1++;
}
_local2++;
}
}
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 _local1 = 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 _local1 = 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 _local1 = 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 181 MovieClip [h_011b] Frame 1
stop();
Symbol 183 MovieClip [b_004b] Frame 1
stop();
Symbol 185 MovieClip [b_008] Frame 1
stop();
Symbol 200 MovieClip Frame 1
stop();
Symbol 211 MovieClip Frame 1
stop();
Symbol 225 MovieClip Frame 1
stop();
Symbol 235 MovieClip Frame 1
stop();
Symbol 245 MovieClip Frame 1
stop();
Symbol 256 MovieClip Frame 1
stop();
Symbol 257 MovieClip [assaultrifle] Frame 1
this._xscale = _level0.randbtwn(80, 120);
stop();
Symbol 258 MovieClip Frame 1
stop();
Symbol 260 MovieClip Frame 1
stop();
Symbol 262 MovieClip Frame 1
stop();
Symbol 269 MovieClip Frame 1
stop();
Symbol 269 MovieClip Frame 5
if (_parent._parent._parent.jump) {
gotoAndPlay ("flail");
}
Symbol 269 MovieClip Frame 8
if (_parent._parent._parent.jump) {
gotoAndPlay ("flail");
}
Symbol 269 MovieClip Frame 11
if (!_parent._parent._parent.jump) {
gotoAndPlay ("swing");
} else {
gotoAndPlay ("flail");
}
Symbol 269 MovieClip Frame 18
if (!_parent._parent._parent.jump) {
gotoAndPlay ("swing");
} else {
gotoAndPlay ("flail");
}
Symbol 269 MovieClip Frame 29
gotoAndStop (1);
Symbol 273 MovieClip [tile_blank1] Frame 1
stop();
Symbol 283 MovieClip [fx_bigexplosion] Frame 30
stop();
removeMovieClip(this);
Symbol 286 MovieClip [tile_spike] Frame 1
stop();
Symbol 288 MovieClip Frame 1
stop();
Symbol 292 MovieClip Frame 1
stop();
Symbol 299 MovieClip Frame 7
stop();
Symbol 304 MovieClip [fx_explosion] Frame 8
stop();
removeMovieClip(this);
Symbol 306 MovieClip Frame 1
stop();
Symbol 309 MovieClip [redpotion] Frame 1
stop();
Symbol 314 MovieClip [floatwords] Frame 15
removeMovieClip(this);
Symbol 316 MovieClip [manapotion] Frame 1
stop();
Symbol 320 MovieClip [tile_cage] Frame 1
stop();
Symbol 323 MovieClip [effect_ninjasmoke] Frame 11
removeMovieClip(this);
Symbol 336 MovieClip [tile_start] Frame 1
stop();
Symbol 348 MovieClip [tile_princess] Frame 1
stop();
Symbol 350 MovieClip [b_009] Frame 1
stop();
Symbol 367 MovieClip [ring_red] Frame 7
stop();
Symbol 371 MovieClip Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 372 MovieClip [tile_blank2] Frame 1
stop();
Symbol 379 MovieClip [b_012] Frame 1
stop();
Symbol 385 MovieClip [h_012] Frame 1
stop();
Symbol 391 MovieClip [b_013] Frame 1
stop();
Symbol 397 MovieClip [h_013b] Frame 1
stop();
Symbol 400 MovieClip [tile_sliding] Frame 1
stop();
Symbol 402 MovieClip [grass1] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 414 MovieClip [temple_floor4] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 416 MovieClip [temple_floor5] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 418 MovieClip [temple_floor6] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 420 MovieClip [temple_floor1] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 422 MovieClip [temple_floor2] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 429 MovieClip [temple_floor3] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 433 MovieClip [h_013] Frame 1
stop();
Symbol 436 MovieClip [tile_idolhead] Frame 1
stop();
Symbol 451 MovieClip Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 452 MovieClip [tile_blank3] Frame 1
stop();
Symbol 459 MovieClip Frame 7
stop();
Symbol 464 MovieClip [fx_sandcloud] Frame 8
stop();
removeMovieClip(this);
Symbol 466 MovieClip [b_014] Frame 1
stop();
Symbol 472 MovieClip [h_014] Frame 1
stop();
Symbol 484 MovieClip [b_005] Frame 1
stop();
Symbol 486 MovieClip [b_010] Frame 1
stop();
Symbol 492 MovieClip [h_010] Frame 1
stop();
Symbol 495 MovieClip [tile_key] Frame 1
stop();
Symbol 498 MovieClip [tile_gold] Frame 1
stop();
Symbol 500 MovieClip Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 501 MovieClip [tile_blank4] Frame 1
stop();
Symbol 503 MovieClip [b_015] Frame 1
stop();
Symbol 509 MovieClip [h_015] Frame 1
stop();
Symbol 513 MovieClip [tile_ice] Frame 1
stop();
Symbol 517 MovieClip [fx_iceexplosion] Frame 30
stop();
removeMovieClip(this);
Symbol 519 MovieClip [snow1] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 521 MovieClip [snow2] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 523 MovieClip [snow3] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 525 MovieClip [snow4] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 533 MovieClip [tile_exit] Frame 1
stop();
Symbol 535 MovieClip [b_016] Frame 1
stop();
Symbol 541 MovieClip [h_016] Frame 1
stop();
Symbol 543 MovieClip [b_005b] Frame 1
stop();
Symbol 549 MovieClip [h_005b] Frame 1
stop();
Symbol 551 MovieClip [b_005c] Frame 1
stop();
Symbol 557 MovieClip [h_005c] Frame 1
stop();
Symbol 559 MovieClip [b_006b] Frame 1
stop();
Symbol 567 MovieClip [h_006b] Frame 1
stop();
Symbol 569 MovieClip [b_006c] Frame 1
stop();
Symbol 575 MovieClip [h_006c] Frame 1
stop();
Symbol 577 MovieClip [b_005d] Frame 1
stop();
Symbol 583 MovieClip [h_005d] Frame 1
stop();
Symbol 586 MovieClip [b_010b] Frame 1
stop();
Symbol 590 MovieClip [h_010b] Frame 1
stop();
Symbol 598 MovieClip [h_004b] Frame 1
stop();
Symbol 602 MovieClip [h_004c] Frame 1
stop();
Symbol 604 MovieClip [h_004d] Frame 1
stop();
Symbol 608 MovieClip [b_003b] Frame 1
stop();
Symbol 610 MovieClip [h_003b] Frame 1
stop();
Symbol 616 MovieClip [b_003c] Frame 1
stop();
Symbol 618 MovieClip [h_003c] Frame 1
stop();
Symbol 624 MovieClip [b_003d] Frame 1
stop();
Symbol 626 MovieClip [b_003e] Frame 1
stop();
Symbol 628 MovieClip [h_003e] Frame 1
stop();
Symbol 663 MovieClip Frame 1
stop();
Symbol 665 MovieClip [b_017] Frame 1
stop();
Symbol 671 MovieClip [h_017] Frame 1
stop();
Symbol 675 MovieClip [h_017b] Frame 1
stop();
Symbol 677 MovieClip [b_006d] Frame 1
stop();
Symbol 683 MovieClip [h_006d] Frame 1
stop();
Symbol 685 MovieClip [tile_icicle] Frame 1
stop();
Symbol 695 MovieClip [h_011d] Frame 1
stop();
Symbol 697 MovieClip [b_011c] Frame 1
stop();
Symbol 703 MovieClip [h_011c] Frame 1
stop();
Symbol 705 MovieClip [b_011e] Frame 1
stop();
Symbol 707 MovieClip [h_011e] Frame 1
stop();
Symbol 709 MovieClip [b_006e] Frame 1
stop();
Symbol 714 MovieClip [h_006e] Frame 1
stop();
Symbol 716 MovieClip [b_005e] Frame 1
stop();
Symbol 718 MovieClip [h_005e] Frame 1
stop();
Symbol 720 MovieClip [b_011f] Frame 1
stop();
Symbol 726 MovieClip [h_011f] Frame 1
stop();
Symbol 731 MovieClip [b_018] Frame 1
stop();
Symbol 737 MovieClip [h_018] Frame 1
stop();
Symbol 739 MovieClip [b_003f] Frame 1
stop();
Symbol 741 MovieClip [h_003f] Frame 1
stop();
Symbol 743 MovieClip [tile_geyser] Frame 1
stop();
Symbol 752 MovieClip Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 753 MovieClip [tile_blank5] Frame 1
stop();
Symbol 756 MovieClip [tile_bossledge] Frame 1
stop();
Symbol 785 MovieClip [cave1] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 787 MovieClip [cave2] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 789 MovieClip [cave3] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 791 MovieClip [cave6] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 793 MovieClip [cave5] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 795 MovieClip [cave4] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 797 MovieClip [tile_magma] Frame 1
stop();
Symbol 799 MovieClip [tile_firevent] Frame 1
stop();
Symbol 806 MovieClip Frame 7
stop();
Symbol 810 MovieClip [fx_steamcloud] Frame 8
stop();
removeMovieClip(this);
Symbol 813 MovieClip [effect_slash] Frame 3
stop();
Symbol 821 MovieClip [fx_jumpcloud] Frame 7
stop();
removeMovieClip(this);
Symbol 846 MovieClip [tile_gold_sliding] Frame 1
stop();
Symbol 852 MovieClip [fx_goldexplosion] Frame 30
stop();
removeMovieClip(this);
Symbol 854 MovieClip [b_019] Frame 1
stop();
Symbol 859 MovieClip [h_019] Frame 1
stop();
Symbol 873 MovieClip Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 874 MovieClip [tile_blank6] Frame 1
stop();
Symbol 876 MovieClip [outpost1] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 877 MovieClip [outpost2] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 878 MovieClip [outpost3] Frame 1
gotoAndStop(_level0.randbtwn(1, 6));
Symbol 881 MovieClip [playerindicator] Frame 1
stop();
Symbol 883 MovieClip [b_001b] Frame 1
stop();
Symbol 885 MovieClip [b_001c] Frame 1
stop();
Symbol 890 MovieClip [fx_explodemarker1] Frame 32
stop();
removeMovieClip(this);
Symbol 896 MovieClip [fx_explodemarker2] Frame 32
stop();
removeMovieClip(this);
Symbol 910 Button
on (press) {
getURL ("http://www.armorgames.com", "_blank");
}
Symbol 913 MovieClip Frame 1
_root.stop();
gotoAndPlay (2);
Symbol 913 MovieClip Frame 218
_root.nextFrame();
Symbol 928 MovieClip Frame 30
stop();
Symbol 939 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 940 Button
on (rollOver) {
_level0.sOption = 2;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
_level0.makeFade("options");
}
Symbol 941 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 942 Button
on (rollOver) {
_level0.sOption = 4;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
_level0.twoPlayer = true;
_level0.lives = 5;
_level0.p1medals = 0;
_level0.p2medals = 0;
_level0.makeFade("2player");
}
Symbol 943 Button
on (rollOver) {
_level0.sOption = 5;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
_level0.makeFade("highscore");
}
Symbol 944 Button
on (rollOver) {
_level0.sOption = 6;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
_level0.makeFade("medals");
}
Symbol 945 Button
on (rollOver) {
_level0.sOption = 7;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
_level0.makeFade("developer");
}
Symbol 946 Button
on (rollOver) {
_level0.sOption = 8;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
getURL ("http://www.armorgames.com", "_blank");
}
Symbol 1003 MovieClip Frame 1
stop();
Symbol 1010 MovieClip Frame 1
stop();
if (_level0.sfxLevel == 3) {
gotoAndStop (2);
}
Symbol 1048 Button
on (release) {
_level0.makeFade("chaptermenu");
}
Symbol 1049 Button
on (release) {
_level0.heroDead = true;
_level0.gotoAndStop("mainmenu");
}
Symbol 1061 MovieClip Frame 1
stop();
if (_level0.sfxLevel != 2) {
gotoAndStop (2);
}
Symbol 1069 MovieClip Frame 1
stop();
Symbol 1077 MovieClip Frame 1
stop();
Symbol 1081 MovieClip Frame 1
stop();
Symbol 1086 MovieClip Frame 1
stop();
Symbol 1090 MovieClip Frame 1
stop();
Symbol 1093 MovieClip Frame 1
stop();
Symbol 1104 MovieClip Frame 1
stop();
Symbol 1110 MovieClip Frame 1
stop();
Symbol 1157 MovieClip Frame 1
stop();
Symbol 1170 Button
on (release) {
if (_level0.firstLoad) {
_level0.firstLoad = false;
_level0.gotoAndStop("instructions");
} else {
_level0.gotoAndStop("faux_loading");
}
}
Symbol 1171 Button
on (release) {
_level0.heroDead = true;
if (!_level0.survivalMode) {
_level0.gotoAndStop("chaptermenu");
} else {
_level0.gotoAndStop("mainmenu");
}
}
Symbol 1173 MovieClip Frame 1
stop();
if (_level0.sfxLevel != 2) {
gotoAndStop (2);
}
Symbol 1196 MovieClip Frame 1
stop();
Symbol 1222 MovieClip Frame 1
stop();
Symbol 1222 MovieClip Frame 2
stop();
Symbol 1273 MovieClip Frame 1
stop();
if (_level0.sfxLevel != 2) {
gotoAndStop (2);
}
Symbol 1288 MovieClip Frame 1
stop();
Symbol 1289 MovieClip Frame 1
stop();
Symbol 1294 MovieClip Frame 1
stop();
Symbol 1301 MovieClip Frame 1
stop();
if (_level0.sfxLevel != 2) {
gotoAndStop (2);
}
Symbol 1328 Button
on (release) {
if (_level0.unlockedMask) {
_level0.makeFade("medals");
} else {
_level0.makeFade("highscore");
}
}
Symbol 1340 Button
on (release) {
_level0.makeFade("mainmenu");
}
Symbol 1352 Button
on (release) {
_level0.makeFade("treasure");
}
Symbol 1357 MovieClip Frame 1
stop();
Symbol 1364 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 1376 MovieClip Frame 1
stop();
Symbol 1403 Button
on (release) {
_level0.makeFade("faux_loading");
}
Symbol 1419 Button
on (release) {
_level0.makeFade("2playersetup");
}