Combined Code
movieClip 12 blank {
}
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;
urls_allowed = ['www.ninjakiwi.com', 'www.ninjakiwifiles.com', 'Developers'];
_level0.onEnterFrame = function () {
loaderbar.gotoAndStop(pct);
if (_level0.pct < 100) {
_level0.pct = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
var v2 = Math.round(_level0.pct) + '%';
_level0.startmsg = 'Loading... ' + v2;
} else {
_level0.pct = 100;
_level0.startmsg = 'Press Spacebar to start!';
}
if (Key.isDown(32)) {
if (!pds) {
pds = true;
if (_level0.pct == 100) {
_level0.gotoAndStop('resources');
}
}
} else {
pds = false;
}
};
}
// unknown tag 88 length 95
// unknown tag 88 length 62
// unknown tag 88 length 83
// unknown tag 88 length 85
movieClip 25 missile_arrow {
}
movieClip 30 {
frame 1 {
stop();
}
frame 3 {
stop();
}
frame 13 {
gotoAndPlay(3);
}
}
movieClip 32 b_006 {
frame 1 {
stop();
}
}
movieClip 34 h_006 {
frame 1 {
stop();
}
}
movieClip 36 ab_006 {
}
movieClip 38 at_006 {
}
movieClip 41 h_005 {
frame 1 {
stop();
}
}
movieClip 43 goldcoins {
frame 1 {
stop();
}
}
movieClip 45 ab_005 {
}
movieClip 47 at_005 {
}
movieClip 50 ab_004 {
}
movieClip 52 at_004 {
}
movieClip 54 b_004 {
frame 1 {
stop();
}
}
movieClip 56 h_004 {
frame 1 {
stop();
}
}
movieClip 62 b_003 {
frame 1 {
stop();
}
}
movieClip 64 h_003 {
frame 1 {
stop();
}
}
movieClip 66 ab_003 {
}
movieClip 68 at_003 {
}
movieClip 71 b_011 {
frame 1 {
stop();
}
}
movieClip 73 h_011 {
frame 1 {
stop();
}
}
movieClip 75 ab_011 {
}
movieClip 77 at_011 {
}
movieClip 79 {
}
movieClip 81 tile_boom {
}
movieClip 83 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 87 b_002 {
frame 1 {
stop();
}
}
movieClip 89 h_002 {
frame 1 {
stop();
}
}
movieClip 91 at_002 {
}
movieClip 93 ab_002 {
}
movieClip 96 h_008 {
frame 1 {
stop();
}
}
movieClip 98 ab_008 {
}
movieClip 101 h_009 {
frame 1 {
stop();
}
}
movieClip 103 gem_blue {
}
movieClip 105 gem_red {
}
movieClip 107 gem_green {
}
movieClip 109 b_007 {
frame 1 {
stop();
}
}
movieClip 111 at_007 {
}
movieClip 113 h_007 {
frame 1 {
stop();
}
}
movieClip 115 ab_007 {
}
movieClip 119 ab_001 {
}
movieClip 121 b_001 {
frame 1 {
stop();
}
}
movieClip 149 h_001 {
frame 1 {
stop();
}
}
movieClip 151 at_001 {
}
movieClip 154 ironkey {
frame 1 {
stop();
}
}
movieClip 159 {
}
movieClip 161 {
frame 1 {
stop();
}
frame 10 {
_level0.gotoAndStop(this.nextframe);
}
frame 11 {
_level0.faded = false;
}
}
frame 2 {
stop();
_level0.onEnterFrame = function () {
stop();
};
}
movieClip 165 {
}
// unknown tag 88 length 87
movieClip 171 {
}
instance of movieClip 171 {
onClipEvent (release) {
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = '__mochibot__';
mbc = 'mochibot.com';
g = _global ? _global : _level0._root;
if (g[mb + swfid]) {
return g[mb + swfid];
}
s = System.security;
x = mc._root.getSWFVersion;
fv = x ? mc.getSWFVersion() : (_global ? 6 : 5);
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == 'localWithFile') {
return null;
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = (fv == 5) ? /:$version : System.capabilities.version;
u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&swfid=' + escape(swfid) + '&l=' + lv + '&f=' + mc + (sb ? '&sb=' + sb : '') + (trk ? '&t=1' : '');
lv = fv > 6 ? mc.getNextHighestDepth() : (g[mb + 'level'] ? g[mb + 'level'] + 1 : lv);
g[mb + 'level'] = lv;
if (fv == 5) {
res = '_level' + lv;
if (!eval(res)) {
loadMovieNum(u, lv);
}
return res;
}
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
return res;
}
var vertDropHeroes_Click = '421f93f0';
getURL('http://www.ninjakiwi.com', '_blank');
__com_mochibot__(vertDropHeroes_Click, this, 10301, true);
}
}
frame 3 {
_level0.onEnterFrame = function () {
stop();
};
}
frame 3 {
function shadeObj(anyped) {
var v2 = new Color(anyped);
var v1 = new Object();
v1 = {'ra': '0', 'rb': '0', 'ga': '0', 'gb': '0', 'ba': '0', 'bb': '0', 'aa': '100', 'ab': '0'};
v2.setTransform(v1);
}
function whiteoutObj(anyped) {
var v2 = new Color(anyped);
var v1 = new Object();
v1 = {'ra': '100', 'rb': '100', 'ga': '100', 'gb': '100', 'ba': '100', 'bb': '100', 'aa': '100', 'ab': '0'};
v2.setTransform(v1);
}
function unshadeObj(anyped) {
var v2 = new Color(anyped);
var v1 = new Object();
v1 = {'ra': '100', 'rb': '0', 'ga': '100', 'gb': '0', 'ba': '100', 'bb': '0', 'aa': '100', 'ab': '0'};
v2.setTransform(v1);
}
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 v4 = 0;
var v1 = 0;
var v3 = 0;
if (seconds > 0) {
while (seconds >= 60) {
seconds -= 60;
v1 += 1;
}
}
v4 = seconds;
if (v1 > 0) {
while (v1 >= 60) {
v1 -= 60;
v3 += 1;
}
}
if (v1 < 10) {
v1 = '0' + v1;
}
if (v4 < 10) {
v4 = '0' + v4;
}
return v3 + ':' + v1 + ':' + v4;
}
function dd(ddnum) {
if (ddnum < 10) {
return '0' + ddnum;
} else {
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 v1 = dialogChar.shift();
if (v1 == undefined) {
dialogbox.char = 'Dr Frix';
} else {
dialogbox.char = v1;
}
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 += 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 v4 = false;
var v3;
dind = 0;
while (dind <= propCount) {
var v1;
v1 = stage['prop' + dd(dind)];
if (v1.isDead) {
v4 = true;
v1.removeMovieClip();
stage.attachMovie(objname, 'prop' + dd(dind), dind + lyroffset);
v3 = stage['prop' + dd(dind)];
v3.isDead = false;
v3._visible = true;
v3.defLayer = dind + lyroffset;
v3.swapDepths(dind + lyroffset);
dind = propCount + 999;
}
++dind;
}
if (!v4) {
stage.attachMovie(objname, 'prop' + dd(propCount), propCount + lyroffset);
v3 = stage['prop' + dd(propCount)];
v3.isDead = false;
v3.index = propCount;
v3.defLayer = propCount + lyroffset;
propCount += 1;
}
v3._x = pos_x;
v3._y = pos_y;
v3.objname = objname;
return v3;
}
function removeProp(anyobj) {
anyobj.isDead = true;
anyobj._visible = false;
tTiles[anyobj.tilex][anyobj.tiley + dyOffset] = undefined;
if (anyobj.index == propCount - 1) {
var v1 = propCount - 1;
while (v1 >= 1) {
var v2 = stage['prop' + dd(v1)];
if (v2.isDead) {
removeMovieClip(v2);
propCount -= 1;
} else {
v1 = -1;
}
--v1;
}
}
}
function spawnObject(objname, objclass, pos_x, pos_y, lyroffset) {
if (objCount == undefined) {
objCount = 0;
}
var v4 = false;
var v3;
dind = 0;
while (dind <= objCount) {
var v1;
v1 = stage['obj' + dd(dind)];
if (v1.isDead) {
v4 = true;
v1.removeMovieClip();
stage.attachMovie(objname, 'obj' + dd(dind), dind + lyroffset);
v3 = stage['obj' + dd(dind)];
v3.isDead = false;
v3._visible = true;
v3.defLayer = dind + lyroffset;
v3.swapDepths(dind + lyroffset);
dind = objCount + 999;
}
++dind;
}
if (!v4) {
stage.attachMovie(objname, 'obj' + dd(objCount), objCount + lyroffset);
v3 = stage['obj' + dd(objCount)];
v3.isDead = false;
v3.index = objCount;
v3.defLayer = objCount + lyroffset;
objCount += 1;
}
v3._x = pos_x;
v3._y = pos_y;
v3.objname = objname;
v3.objclass = objclass;
v3.dying = false;
return v3;
}
function removeObject(anyobj) {
anyobj.isDead = true;
anyobj._visible = false;
if (anyobj.index == objCount - 1) {
var v1 = objCount - 1;
while (v1 >= 1) {
var v2 = stage['obj' + dd(v1)];
if (v2.isDead) {
removeMovieClip(v2);
objCount -= 1;
} else {
v1 = -1;
}
--v1;
}
}
}
function attachEffect(anyped, effectname) {
if (fxCount == undefined) {
fxCount = 0;
}
stage.attachMovie(effectname, 'sfx' + dd(fxCount), fxCount + 60000);
var v1 = stage['sfx' + dd(fxCount)];
fxCount += 1;
if (fxCount > 20) {
fxCount = 0;
}
v1._x = anyped._x;
v1._y = anyped._y;
v1._rotation = randbtwn(0, 360);
lastFx = v1;
}
function floatWords(anyped, wordtxt) {
if (fxCount == undefined) {
fxCount = 0;
}
stage.attachMovie('floatwords', 'sfx' + dd(fxCount), fxCount + 60000);
var v1 = stage['sfx' + dd(fxCount)];
v1.word.txt = wordtxt;
fxCount += 1;
if (fxCount > 20) {
fxCount = 0;
}
v1._x = anyped._x;
v1._y = anyped._y - 20;
}
function setColor(rClip, rBase, gBase, bBase) {
var v5 = rBase;
var v6 = gBase;
var v4 = bBase;
var v2 = v5.toString(16);
if (v5 < 16) {
v2 = '0' + v2;
}
var v1 = v6.toString(16);
if (v6 < 16) {
v1 = '0' + v1;
}
var v3 = v4.toString(16);
if (v4 < 16) {
v3 = '0' + v3;
}
var v8 = v2 + v1 + v3;
var v7 = parseInt(v8, 16);
var v9 = new Color(rClip);
v9.setRGB(v7);
}
function spitOne(anyarray) {
var v1 = randbtwn(0, anyarray.length - 1);
var v3 = anyarray[v1];
anyarray.splice(v1, 1);
return v3;
}
function fireMissile(anyped, b_rot, b_type, b_hp) {
var v1 = spawnObject('missile', 'missile', anyped._x, anyped._y, 50000);
v1.attachMovie('missile_' + b_type, 'missile', 0);
v1._x += 12 + anyped._xscale / 100;
v1.hp = 1;
v1.unblockable = false;
v1.speed = 20;
if (anyped.owner == 2) {
v1.speed = 12;
}
if (b_type == 'shuriken' && anyped.owner != 1 && anyped.owner != 3) {
v1.speed = 6;
}
if (b_type == 'fireball' && anyped.owner != 1 && anyped.owner != 3) {
v1.speed = 8;
v1.unblockable = true;
} else {
if (b_type == 'familiar') {
v1.speed = 10;
} else {
if (b_type == 'scimitar') {
v1.speed = 10;
} else {
if (b_type == 'geyser' && anyped.owner != 1 && anyped.owner != 3) {
v1.speed = 4;
v1.unblockable = true;
} else {
if (b_type == 'trunk') {
v1.speed = 8;
v1.unblockable = true;
} else {
if (b_type == 'snowball') {
v1.speed = 8;
v1.unblockable = true;
} else {
if (b_type == 'icebolt') {
v1.speed = 12;
v1.unblockable = true;
} else {
if (b_type == 'shadowbolt') {
v1.speed = 10;
v1.unblockable = true;
} else {
if (b_type == 'magmaball') {
v1.speed = 5;
}
}
}
}
}
}
}
}
}
v1.owner = anyped.owner;
v1._rotation = b_rot;
v1.b_type = b_type;
v1.hp = b_hp;
if (anyped == eBoss) {
v1._x -= 25 * anyped._xscale / 100;
v1._y += 25;
}
return v1;
}
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');
}
}
};
}
movieClip 174 {
}
movieClip 175 shield {
}
movieClip 177 h_011b {
frame 1 {
stop();
}
}
movieClip 179 b_004b {
frame 1 {
stop();
}
}
movieClip 181 b_008 {
frame 1 {
stop();
}
}
movieClip 182 at_008 {
}
movieClip 184 {
}
movieClip 196 {
frame 1 {
stop();
}
}
movieClip 207 {
frame 1 {
stop();
}
}
movieClip 221 {
frame 1 {
stop();
}
}
movieClip 231 {
frame 1 {
stop();
}
}
movieClip 241 {
frame 1 {
stop();
}
}
movieClip 252 {
frame 1 {
stop();
}
}
movieClip 253 assaultrifle {
frame 1 {
this._xscale = _level0.randbtwn(80, 120);
stop();
}
}
movieClip 254 {
frame 1 {
stop();
}
}
movieClip 256 {
frame 1 {
stop();
}
}
movieClip 258 {
frame 1 {
stop();
}
}
movieClip 260 {
}
movieClip 262 {
}
movieClip 264 {
}
movieClip 265 {
frame 1 {
stop();
}
frame 5 {
if (_parent._parent._parent.jump) {
gotoAndPlay('flail');
}
}
frame 8 {
if (_parent._parent._parent.jump) {
gotoAndPlay('flail');
}
}
frame 11 {
if (!_parent._parent._parent.jump) {
gotoAndPlay('swing');
} else {
gotoAndPlay('flail');
}
}
frame 18 {
if (!_parent._parent._parent.jump) {
gotoAndPlay('swing');
} else {
gotoAndPlay('flail');
}
}
frame 29 {
gotoAndStop(1);
}
}
movieClip 266 {
}
movieClip 267 {
}
movieClip 268 char {
}
movieClip 269 tile_blank1 {
frame 1 {
stop();
}
}
movieClip 271 {
}
movieClip 275 {
}
movieClip 277 {
}
movieClip 279 fx_bigexplosion {
frame 30 {
stop();
removeMovieClip(this);
}
}
movieClip 281 {
}
movieClip 282 tile_spike {
frame 1 {
stop();
}
}
movieClip 284 {
frame 1 {
stop();
}
}
movieClip 285 {
}
movieClip 286 {
}
movieClip 288 {
frame 1 {
stop();
}
}
movieClip 295 {
frame 7 {
stop();
}
}
movieClip 298 {
}
movieClip 300 fx_explosion {
frame 8 {
stop();
removeMovieClip(this);
}
}
movieClip 302 {
frame 1 {
stop();
}
}
movieClip 303 pickup {
}
movieClip 305 redpotion {
frame 1 {
stop();
}
}
// unknown tag 88 length 73
movieClip 309 {
}
movieClip 310 floatwords {
frame 15 {
removeMovieClip(this);
}
}
movieClip 312 manapotion {
frame 1 {
stop();
}
}
movieClip 316 tile_cage {
frame 1 {
stop();
}
}
movieClip 319 effect_ninjasmoke {
frame 11 {
removeMovieClip(this);
}
}
movieClip 320 missile {
}
// unknown tag 88 length 117
movieClip 331 {
}
movieClip 332 tile_start {
frame 1 {
stop();
}
}
movieClip 338 missile_fireball {
}
movieClip 342 {
}
movieClip 344 tile_princess {
frame 1 {
stop();
}
}
movieClip 346 b_009 {
frame 1 {
stop();
}
}
movieClip 348 ab_009 {
}
movieClip 350 at_009 {
}
movieClip 352 missile_spear {
}
movieClip 356 missile_holybolt {
}
movieClip 363 ring_red {
frame 7 {
stop();
}
}
movieClip 365 {
}
movieClip 367 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 368 tile_blank2 {
frame 1 {
stop();
}
}
movieClip 370 {
}
movieClip 371 {
}
movieClip 373 char_body1 {
}
movieClip 375 b_012 {
frame 1 {
stop();
}
}
movieClip 377 ab_012 {
}
movieClip 379 at_012 {
}
movieClip 381 h_012 {
frame 1 {
stop();
}
}
movieClip 383 {
}
movieClip 384 {
}
movieClip 385 char_body2 {
}
movieClip 387 b_013 {
frame 1 {
stop();
}
}
movieClip 389 ab_013 {
}
movieClip 391 at_013 {
}
movieClip 393 h_013b {
frame 1 {
stop();
}
}
movieClip 396 tile_sliding {
frame 1 {
stop();
}
}
movieClip 398 grass1 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 400 grass2 {
}
movieClip 402 grass3 {
}
movieClip 404 grass6 {
}
movieClip 406 grass5 {
}
movieClip 408 grass4 {
}
movieClip 410 temple_floor4 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 412 temple_floor5 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 414 temple_floor6 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 416 temple_floor1 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 418 temple_floor2 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 424 torch {
}
movieClip 425 temple_floor3 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 427 ab_013b {
}
movieClip 429 h_013 {
frame 1 {
stop();
}
}
movieClip 432 tile_idolhead {
frame 1 {
stop();
}
}
movieClip 434 missile_dart {
}
movieClip 436 {
}
movieClip 438 {
}
movieClip 447 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 448 tile_blank3 {
frame 1 {
stop();
}
}
movieClip 455 {
frame 7 {
stop();
}
}
movieClip 458 {
}
movieClip 460 fx_sandcloud {
frame 8 {
stop();
removeMovieClip(this);
}
}
movieClip 462 b_014 {
frame 1 {
stop();
}
}
movieClip 464 ab_014 {
}
movieClip 466 at_014 {
}
movieClip 468 h_014 {
frame 1 {
stop();
}
}
movieClip 470 {
}
movieClip 471 missile_shuriken {
}
movieClip 478 {
}
movieClip 480 b_005 {
frame 1 {
stop();
}
}
movieClip 482 b_010 {
frame 1 {
stop();
}
}
movieClip 484 ab_010 {
}
movieClip 486 at_010 {
}
movieClip 488 h_010 {
frame 1 {
stop();
}
}
movieClip 489 {
}
movieClip 491 tile_key {
frame 1 {
stop();
}
}
movieClip 493 {
}
movieClip 494 tile_gold {
frame 1 {
stop();
}
}
movieClip 496 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 497 tile_blank4 {
frame 1 {
stop();
}
}
movieClip 499 b_015 {
frame 1 {
stop();
}
}
movieClip 501 ab_015 {
}
movieClip 503 at_015 {
}
movieClip 505 h_015 {
frame 1 {
stop();
}
}
movieClip 508 {
}
movieClip 509 tile_ice {
frame 1 {
stop();
}
}
movieClip 512 {
}
movieClip 513 fx_iceexplosion {
frame 30 {
stop();
removeMovieClip(this);
}
}
movieClip 515 snow1 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 517 snow2 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 519 snow3 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 521 snow4 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 526 {
}
movieClip 527 {
}
movieClip 528 {
}
movieClip 529 tile_exit {
frame 1 {
stop();
}
}
movieClip 531 b_016 {
frame 1 {
stop();
}
}
movieClip 533 ab_016 {
}
movieClip 535 at_016 {
}
movieClip 537 h_016 {
frame 1 {
stop();
}
}
movieClip 539 b_005b {
frame 1 {
stop();
}
}
movieClip 541 ab_005b {
}
movieClip 543 at_005b {
}
movieClip 545 h_005b {
frame 1 {
stop();
}
}
movieClip 547 b_005c {
frame 1 {
stop();
}
}
movieClip 549 ab_005c {
}
movieClip 551 at_005c {
}
movieClip 553 h_005c {
frame 1 {
stop();
}
}
movieClip 555 b_006b {
frame 1 {
stop();
}
}
movieClip 557 {
}
movieClip 559 ab_006b {
}
movieClip 561 at_006b {
}
movieClip 563 h_006b {
frame 1 {
stop();
}
}
movieClip 565 b_006c {
frame 1 {
stop();
}
}
movieClip 567 ab_006c {
}
movieClip 569 at_006c {
}
movieClip 571 h_006c {
frame 1 {
stop();
}
}
movieClip 573 b_005d {
frame 1 {
stop();
}
}
movieClip 575 ab_005d {
}
movieClip 577 at_005d {
}
movieClip 579 h_005d {
frame 1 {
stop();
}
}
movieClip 582 b_010b {
frame 1 {
stop();
}
}
movieClip 584 at_004b {
}
movieClip 586 h_010b {
frame 1 {
stop();
}
}
movieClip 588 ab_004b {
}
movieClip 590 {
}
movieClip 592 missile_shadow {
}
movieClip 594 h_004b {
frame 1 {
stop();
}
}
movieClip 596 missile_breaker {
}
movieClip 598 h_004c {
frame 1 {
stop();
}
}
movieClip 600 h_004d {
frame 1 {
stop();
}
}
movieClip 602 ab_011b {
}
movieClip 604 b_003b {
frame 1 {
stop();
}
}
movieClip 606 h_003b {
frame 1 {
stop();
}
}
movieClip 608 ab_003b {
}
movieClip 610 at_003b {
}
movieClip 612 b_003c {
frame 1 {
stop();
}
}
movieClip 614 h_003c {
frame 1 {
stop();
}
}
movieClip 616 ab_003c {
}
movieClip 618 at_003c {
}
movieClip 620 b_003d {
frame 1 {
stop();
}
}
movieClip 622 b_003e {
frame 1 {
stop();
}
}
movieClip 624 h_003e {
frame 1 {
stop();
}
}
movieClip 659 {
frame 1 {
stop();
}
}
movieClip 661 b_017 {
frame 1 {
stop();
}
}
movieClip 663 ab_017 {
}
movieClip 665 at_017 {
}
movieClip 667 h_017 {
frame 1 {
stop();
}
}
movieClip 669 ab_017b {
}
movieClip 671 h_017b {
frame 1 {
stop();
}
}
movieClip 673 b_006d {
frame 1 {
stop();
}
}
movieClip 675 ab_006d {
}
movieClip 677 at_006d {
}
movieClip 679 h_006d {
frame 1 {
stop();
}
}
movieClip 681 tile_icicle {
frame 1 {
stop();
}
}
movieClip 685 missile_icebolt {
}
movieClip 688 {
}
movieClip 689 missile_familiar {
}
movieClip 691 h_011d {
frame 1 {
stop();
}
}
movieClip 693 b_011c {
frame 1 {
stop();
}
}
movieClip 695 ab_011c {
}
movieClip 697 at_011c {
}
movieClip 699 h_011c {
frame 1 {
stop();
}
}
movieClip 701 b_011e {
frame 1 {
stop();
}
}
movieClip 703 h_011e {
frame 1 {
stop();
}
}
movieClip 705 b_006e {
frame 1 {
stop();
}
}
movieClip 707 ab_006e {
}
movieClip 708 at_006e {
}
movieClip 710 h_006e {
frame 1 {
stop();
}
}
movieClip 712 b_005e {
frame 1 {
stop();
}
}
movieClip 714 h_005e {
frame 1 {
stop();
}
}
movieClip 716 b_011f {
frame 1 {
stop();
}
}
movieClip 718 ab_011f {
}
movieClip 720 at_011f {
}
movieClip 722 h_011f {
frame 1 {
stop();
}
}
movieClip 724 {
}
movieClip 725 missile_scimitar {
}
movieClip 727 b_018 {
frame 1 {
stop();
}
}
movieClip 729 ab_018 {
}
movieClip 731 at_018 {
}
movieClip 733 h_018 {
frame 1 {
stop();
}
}
movieClip 735 b_003f {
frame 1 {
stop();
}
}
movieClip 737 h_003f {
frame 1 {
stop();
}
}
movieClip 739 tile_geyser {
frame 1 {
stop();
}
}
movieClip 744 missile_geyser {
}
movieClip 746 {
}
movieClip 748 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 749 tile_blank5 {
frame 1 {
stop();
}
}
movieClip 751 {
}
movieClip 752 tile_bossledge {
frame 1 {
stop();
}
}
movieClip 756 {
}
movieClip 760 {
}
movieClip 763 {
}
movieClip 764 boss1 {
}
movieClip 768 {
}
movieClip 771 {
}
movieClip 774 {
}
movieClip 775 boss2 {
}
movieClip 778 {
}
movieClip 779 missile_trunk {
}
movieClip 781 cave1 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 783 cave2 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 785 cave3 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 787 cave6 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 789 cave5 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 791 cave4 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 793 tile_magma {
frame 1 {
stop();
}
}
movieClip 795 tile_firevent {
frame 1 {
stop();
}
}
movieClip 802 {
frame 7 {
stop();
}
}
movieClip 804 {
}
movieClip 806 fx_steamcloud {
frame 8 {
stop();
removeMovieClip(this);
}
}
movieClip 809 effect_slash {
frame 3 {
stop();
}
}
movieClip 813 {
}
movieClip 814 effect_berserk {
}
movieClip 817 fx_jumpcloud {
frame 7 {
stop();
removeMovieClip(this);
}
}
movieClip 821 {
}
movieClip 825 {
}
movieClip 828 {
}
movieClip 829 boss3 {
}
movieClip 833 {
}
movieClip 835 {
}
movieClip 838 {
}
movieClip 839 boss4 {
}
movieClip 841 {
}
movieClip 842 tile_gold_sliding {
frame 1 {
stop();
}
}
movieClip 845 missile_snowball {
}
movieClip 847 {
}
movieClip 848 fx_goldexplosion {
frame 30 {
stop();
removeMovieClip(this);
}
}
movieClip 850 b_019 {
frame 1 {
stop();
}
}
movieClip 852 ab_019 {
}
movieClip 853 at_019 {
}
movieClip 855 h_019 {
frame 1 {
stop();
}
}
movieClip 860 missile_shadowbolt {
}
movieClip 865 missile_magmaball {
}
movieClip 867 {
}
movieClip 869 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 870 tile_blank6 {
frame 1 {
stop();
}
}
movieClip 872 outpost1 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 873 outpost2 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 874 outpost3 {
frame 1 {
gotoAndStop(_level0.randbtwn(1, 6));
}
}
movieClip 877 playerindicator {
frame 1 {
stop();
}
}
movieClip 879 b_001b {
frame 1 {
stop();
}
}
movieClip 881 b_001c {
frame 1 {
stop();
}
}
movieClip 885 {
}
movieClip 886 fx_explodemarker1 {
frame 32 {
stop();
removeMovieClip(this);
}
}
movieClip 890 {
}
movieClip 892 fx_explodemarker2 {
frame 32 {
stop();
removeMovieClip(this);
}
}
button 894 {
on (release) {
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = '__mochibot__';
mbc = 'mochibot.com';
g = _global ? _global : _level0._root;
if (g[mb + swfid]) {
return g[mb + swfid];
}
s = System.security;
x = mc._root.getSWFVersion;
fv = x ? mc.getSWFVersion() : (_global ? 6 : 5);
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == 'localWithFile') {
return null;
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = (fv == 5) ? /:$version : System.capabilities.version;
u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&swfid=' + escape(swfid) + '&l=' + lv + '&f=' + mc + (sb ? '&sb=' + sb : '') + (trk ? '&t=1' : '');
lv = fv > 6 ? mc.getNextHighestDepth() : (g[mb + 'level'] ? g[mb + 'level'] + 1 : lv);
g[mb + 'level'] = lv;
if (fv == 5) {
res = '_level' + lv;
if (!eval(res)) {
loadMovieNum(u, lv);
}
return res;
}
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
return res;
}
var vertDropHeroes_Click = '421f93f0';
getURL('http://www.ninjakiwi.com', '_blank');
__com_mochibot__(vertDropHeroes_Click, this, 10301, true);
}
}
movieClip 897 {
}
movieClip 899 {
}
movieClip 901 {
}
movieClip 903 {
}
movieClip 905 {
}
movieClip 907 {
}
movieClip 920 {
}
movieClip 928 {
}
movieClip 931 {
}
movieClip 937 {
}
movieClip 938 {
frame 1 {
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = '__mochibot__';
mbc = 'mochibot.com';
g = _global ? _global : _level0._root;
if (g[mb + swfid]) {
return g[mb + swfid];
}
s = System.security;
x = mc._root.getSWFVersion;
fv = x ? mc.getSWFVersion() : (_global ? 6 : 5);
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == 'localWithFile') {
return null;
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = (fv == 5) ? /:$version : System.capabilities.version;
u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&swfid=' + escape(swfid) + '&l=' + lv + '&f=' + mc + (sb ? '&sb=' + sb : '') + (trk ? '&t=1' : '');
lv = fv > 6 ? mc.getNextHighestDepth() : (g[mb + 'level'] ? g[mb + 'level'] + 1 : lv);
g[mb + 'level'] = lv;
if (fv == 5) {
res = '_level' + lv;
if (!eval(res)) {
loadMovieNum(u, lv);
}
return res;
}
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
return res;
}
var vertDropHeroes_Splash = '9e22fb7e';
__com_mochibot__(vertDropHeroes_Splash, this, 10301, true);
}
frame 199 {
stop();
_level0.nextFrame();
}
}
frame 4 {
var nerdook_skip = 0;
var sOption = 1;
var sfxLevel = 3;
var qualityLevel = 2;
_level0.onEnterFrame = function () {
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;
}
};
}
movieClip 943 {
}
movieClip 953 {
frame 30 {
stop();
}
}
instance of movieClip 953 {
onClipEvent (release) {
getURL('http://www.kongregate.com/accounts/nerdook', '_blank');
}
}
frame 5 {
function loadData() {
mData = SharedObject.getLocal(g_dataFile);
var v2 = 1;
while (v2 <= 30) {
if (mData.data['trFound' + dd(v2)] == undefined) {
mData.data['trFound' + dd(v2)] = false;
}
trFound[v2] = mData.data['trFound' + dd(v2)];
++v2;
}
var v4 = 1;
while (v4 <= 30) {
if (mData.data['maskUnlocked' + dd(v4)] == undefined) {
mData.data['maskUnlocked' + dd(v4)] = false;
}
maskUnlocked[v4] = mData.data['maskUnlocked' + dd(v4)];
++v4;
}
var v3 = 1;
while (v3 <= 6) {
if (mData.data['selItem' + dd(v3)] == undefined) {
mData.data['selItem' + dd(v3)] = 7;
}
_level0['selItem' + v3] = mData.data['selItem' + dd(v3)];
++v3;
}
var v1 = 1;
while (v1 <= 5) {
if (mData.data['hScoreTotal' + dd(v1)] == undefined) {
mData.data['hScoreName' + dd(v1)] = '-----';
mData.data['hScoreTotal' + dd(v1)] = 0;
}
hScoreName[v1] = mData.data['hScoreName' + dd(v1)];
hScoreTotal[v1] = mData.data['hScoreTotal' + dd(v1)];
++v1;
}
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 = '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 v2 = 1;
while (v2 <= 30) {
mData.data['trFound' + dd(v2)] = trFound[v2];
++v2;
}
var v4 = 1;
while (v4 <= 30) {
mData.data['maskUnlocked' + dd(v4)] = maskUnlocked[v4];
++v4;
}
var v3 = 1;
while (v3 <= 6) {
mData.data['selItem' + dd(v3)] = _level0['selItem' + v3];
++v3;
}
var v1 = 1;
while (v1 <= 5) {
mData.data['hScoreName' + dd(v1)] = hScoreName[v1];
mData.data['hScoreTotal' + dd(v1)] = hScoreTotal[v1];
++v1;
}
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. Gain 1 gold for each block destroyed.';
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 += 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 += 1;
} else {
if (startX > castleX) {
tWalk4[startX][startY] = true;
tWalk2[startX - 1][startY] = true;
startX -= 1;
}
}
} else {
if (startY < castleY) {
tWalk3[startX][startY] = true;
tWalk1[startX][startY + 1] = true;
startY += 1;
} else {
if (startY > castleY) {
tWalk1[startX][startY] = true;
tWalk3[startX][startY - 1] = true;
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 += 1;
} else {
tWalk4[thisTempleX][thisTempleY] = true;
tWalk2[thisTempleX - 1][thisTempleY] = true;
thisTempleX -= 1;
}
} else {
if (startTempleY <= 3) {
tWalk3[thisTempleX][thisTempleY] = true;
tWalk1[thisTempleX][thisTempleY + 1] = true;
thisTempleY += 1;
} else {
tWalk1[thisTempleX][thisTempleY] = true;
tWalk3[thisTempleX][thisTempleY - 1] = true;
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 -= 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 += 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 = 5;
p1medals = 0;
p2medals = 0;
makeFade('2player');
} else {
if (sOption == 5) {
makeFade('highscore');
} else {
if (sOption == 6) {
makeFade('medals');
} else {
if (sOption == 7) {
makeFade('developer');
} else {
if (sOption == 8) {
var vertDropHeroes_Click = '421f93f0';
getURL('http://www.ninjakiwi.com', '_blank');
__com_mochibot__(vertDropHeroes_Click, this, 10301, true);
}
}
}
}
}
}
}
}
}
} else {
pds = false;
}
} else {
instructions = 'Press Enter when done typing!';
pnamebox._alpha = 100;
words._alpha = 50;
backdrop._alpha = 50;
}
};
}
movieClip 955 {
}
button 964 {
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;
}
}
button 965 {
on (rollOver) {
_level0.sOption = 2;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
_level0.makeFade('options');
}
}
button 966 {
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');
}
}
button 967 {
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');
}
}
button 968 {
on (rollOver) {
_level0.sOption = 5;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
_level0.makeFade('highscore');
}
}
button 969 {
on (rollOver) {
_level0.sOption = 6;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
_level0.makeFade('medals');
}
}
button 970 {
on (rollOver) {
_level0.sOption = 7;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
_level0.makeFade('developer');
}
}
button 971 {
on (rollOver) {
_level0.sOption = 8;
_level0.mainmenutxt = _level0.mainmenuDesc[_level0.sOption];
_level0.words.gotoAndStop(_level0.sOption);
}
on (release) {
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = '__mochibot__';
mbc = 'mochibot.com';
g = _global ? _global : _level0._root;
if (g[mb + swfid]) {
return g[mb + swfid];
}
s = System.security;
x = mc._root.getSWFVersion;
fv = x ? mc.getSWFVersion() : (_global ? 6 : 5);
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == 'localWithFile') {
return null;
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = (fv == 5) ? /:$version : System.capabilities.version;
u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&swfid=' + escape(swfid) + '&l=' + lv + '&f=' + mc + (sb ? '&sb=' + sb : '') + (trk ? '&t=1' : '');
lv = fv > 6 ? mc.getNextHighestDepth() : (g[mb + 'level'] ? g[mb + 'level'] + 1 : lv);
g[mb + 'level'] = lv;
if (fv == 5) {
res = '_level' + lv;
if (!eval(res)) {
loadMovieNum(u, lv);
}
return res;
}
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
return res;
}
var vertDropHeroes_Click = '421f93f0';
getURL('http://www.ninjakiwi.com', '_blank');
__com_mochibot__(vertDropHeroes_Click, this, 10301, true);
}
}
movieClip 1028 {
frame 1 {
stop();
}
}
movieClip 1035 {
frame 1 {
stop();
if (_level0.sfxLevel == 3) {
gotoAndStop(2);
}
}
}
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;
}
};
}
movieClip 1046 {
}
button 1067 {
on (release) {
_level0.makeFade('chaptermenu');
}
}
button 1068 {
on (release) {
_level0.heroDead = true;
_level0.gotoAndStop('mainmenu');
}
}
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 -= 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 += 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 += 10;
} else {
if (pchar_map._x > mapDestTile._x + 5) {
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 += 10;
} else {
if (pchar_map._y > mapDestTile._y + 5) {
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 += 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 v1 = _level0['x' + mapCurX + 'y' + (mapCurY - 1)];
if (v1.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 -= 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 v1 = _level0['x' + mapCurX + 'y' + (mapCurY + 1)];
if (v1.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 += 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 v1 = _level0['x' + (mapCurX - 1) + 'y' + mapCurY];
if (v1.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 -= 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 v1 = _level0['x' + (mapCurX + 1) + 'y' + mapCurY];
if (v1.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 += 1;
warning = '';
}
}
}
refreshIcons();
}
} else {
pdt = false;
}
if (Key.isDown(81)) {
if (!pdq) {
pdq = true;
heroDead = true;
gotoAndStop('mainmenu');
}
} else {
pdq = false;
}
};
}
movieClip 1072 {
}
movieClip 1075 {
}
movieClip 1076 {
instance of movieClip 1075 {
onClipEvent (release) {
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = '__mochibot__';
mbc = 'mochibot.com';
g = _global ? _global : _level0._root;
if (g[mb + swfid]) {
return g[mb + swfid];
}
s = System.security;
x = mc._root.getSWFVersion;
fv = x ? mc.getSWFVersion() : (_global ? 6 : 5);
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == 'localWithFile') {
return null;
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = (fv == 5) ? /:$version : System.capabilities.version;
u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&swfid=' + escape(swfid) + '&l=' + lv + '&f=' + mc + (sb ? '&sb=' + sb : '') + (trk ? '&t=1' : '');
lv = fv > 6 ? mc.getNextHighestDepth() : (g[mb + 'level'] ? g[mb + 'level'] + 1 : lv);
g[mb + 'level'] = lv;
if (fv == 5) {
res = '_level' + lv;
if (!eval(res)) {
loadMovieNum(u, lv);
}
return res;
}
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
return res;
}
var vertDropHeroes_Click = '421f93f0';
getURL('http://www.ninjakiwi.com', '_blank');
__com_mochibot__(vertDropHeroes_Click, this, 10301, true);
}
}
}
movieClip 1080 {
frame 1 {
stop();
if (_level0.sfxLevel == 3) {
gotoAndStop(2);
}
}
}
movieClip 1088 {
frame 1 {
stop();
}
}
movieClip 1090 {
}
movieClip 1096 {
frame 1 {
stop();
}
}
movieClip 1100 {
frame 1 {
stop();
}
}
movieClip 1105 {
frame 1 {
stop();
}
}
movieClip 1109 {
frame 1 {
stop();
}
}
movieClip 1112 {
frame 1 {
stop();
}
}
movieClip 1114 {
}
movieClip 1123 {
frame 1 {
stop();
}
}
movieClip 1129 {
frame 1 {
stop();
}
}
movieClip 1130 {
}
movieClip 1133 {
}
movieClip 1135 {
}
movieClip 1136 {
}
frame 8 {
function refreshAllRows() {
var v3 = 1;
while (v3 <= 5) {
var v1 = slide['row' + v3];
var v2 = 1;
while (v2 <= 7) {
invItem = v1['item' + v2];
invIndex = v2 + (v3 - 1) * 6;
if (v2 == v1.selItem) {
invItem._alpha = 100;
if (v3 == activeRow) {
invbox._y = invItem._y + v1._y + slide._y;
if (trFound[invIndex]) {
invbox.title = trName[invIndex];
invbox.desc = trDesc[invIndex];
_level0['selItem' + v3] = v1.selItem;
} else {
invbox.title = '???';
invbox.desc = 'You haven\'t found this Artifact yet! Explore more Temples.';
_level0['selItem' + v3] = 7;
}
}
} else {
invItem._alpha = 50;
}
if (trFound[invIndex]) {
invItem.gotoAndStop(invIndex);
} else {
invItem.gotoAndStop(31);
}
if (v2 == 7) {
invItem.gotoAndStop(32);
if (v3 == activeRow && v2 == v1.selItem) {
invbox.title = 'None';
invbox.desc = 'No special bonus for this character!';
}
}
v1.selectbox._x = v1['item' + v1.selItem]._x;
v1.selectbox._y = v1['item' + v1.selItem]._y;
++v2;
}
++v3;
}
}
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 v1 = 0;
while (v1 <= 6) {
var v2 = slide['row' + v1];
if (v1 == activeRow) {
v2._alpha = 100;
} else {
v2._alpha = 25;
}
++v1;
}
if (activeRow >= 1 && activeRow <= 5) {
invbox._visible = true;
} else {
invbox._visible = false;
}
if (Key.isDown(38) || Key.isDown(87)) {
if (!pd4d) {
pd4d = true;
activeRow -= 1;
if (activeRow < 0) {
activeRow = 6;
}
refreshAllRows();
}
} else {
if (Key.isDown(40) || Key.isDown(83)) {
if (!pd4d) {
pd4d = true;
activeRow += 1;
if (activeRow > 6) {
activeRow = 0;
}
refreshAllRows();
}
} else {
if (Key.isDown(39) || Key.isDown(68)) {
if (!pd4d) {
pd4d = true;
var v4 = slide['row' + activeRow];
if (activeRow == 0) {
var v3 = false;
while (!v3) {
currentMask += 1;
if (currentMask > 25) {
currentMask = 0;
}
if (maskUnlocked[currentMask]) {
v3 = true;
}
}
v4.head.gotoAndStop(currentMask + 1);
} else {
v4.selItem += 1;
if (v4.selItem > 7) {
v4.selItem = 1;
}
}
refreshAllRows();
}
} else {
if (Key.isDown(37) || Key.isDown(65)) {
if (!pd4d) {
pd4d = true;
var v4 = slide['row' + activeRow];
if (activeRow == 0) {
var v3 = false;
while (!v3) {
currentMask -= 1;
if (currentMask < 0) {
currentMask = 25;
}
if (maskUnlocked[currentMask]) {
v3 = true;
}
}
v4.head.gotoAndStop(currentMask + 1);
} else {
v4.selItem -= 1;
if (v4.selItem < 1) {
v4.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;
}
};
}
movieClip 1157 {
}
movieClip 1158 {
}
movieClip 1161 {
}
movieClip 1163 {
}
movieClip 1165 {
}
movieClip 1167 {
}
movieClip 1169 {
}
movieClip 1173 {
}
movieClip 1174 {
}
movieClip 1176 {
frame 1 {
stop();
}
}
movieClip 1185 {
}
movieClip 1188 {
}
button 1189 {
on (release) {
if (_level0.firstLoad) {
_level0.firstLoad = false;
_level0.gotoAndStop('instructions');
} else {
_level0.gotoAndStop('faux_loading');
}
}
}
button 1190 {
on (release) {
_level0.heroDead = true;
if (!_level0.survivalMode) {
_level0.gotoAndStop('chaptermenu');
} else {
_level0.gotoAndStop('mainmenu');
}
}
}
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 += 1;
if (load_time % 5 == 0) {
thisText += 1;
loadtxt = loadText[thisText];
}
if (load_time >= 30) {
gotoAndStop('game_main');
}
};
}
movieClip 1192 {
frame 1 {
stop();
if (_level0.sfxLevel == 3) {
gotoAndStop(2);
}
}
}
frame 10 {
function checkStrike(anytarget, anyped) {
if (anyped.omniStrike > 0 && anyped.omniCool == 0) {
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 += anytarget.bounty;
killEnemy(anytarget);
}
}
}
function checkHint(hintnum) {
if (!hintShown[hintnum]) {
hintShown[hintnum] = true;
return true;
} else {
return false;
}
}
function unlockMask(maskNum) {
if (!maskUnlocked[maskNum]) {
unlockedMask = true;
maskUnlocked[maskNum] = true;
maskNew[maskNum] = true;
}
}
function killEnemy(anyped) {
noKills = false;
enemiesKilled += 1;
attachEffect(anyped, 'fx_explosion');
gold += anyped.bounty;
floatWords(anyped, '+' + anyped.bounty + ' gp!');
snd_poof.start();
if (anyped.c_type == 'shade') {
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 += 1;
} else {
if (anytile.tileType == 'bossgold') {
attachEffect(anytile, 'fx_goldexplosion');
} else {
attachEffect(anytile, 'fx_bigexplosion');
}
}
if (anytile.tileType == 'normal') {
snd_pop.start();
smashBlock += 1;
}
lastFx._x += 25;
anytile.tileType = '';
removeProp(anytile);
limboBlock += 1;
}
function bossHit(dmg) {
if (eBoss.hit == 0) {
eBoss.hp -= dmg;
eBoss.hit = 60;
attachEffect(eBoss, 'effect_ninjasmoke');
snd_poof.start();
var v1 = randbtwn(1, 10);
if (v1 <= 2 && pchar.hp < hpmax) {
spawnPickup('redpotion', eBoss.xloc, eBoss.yloc);
} else {
if (v1 <= 4 && pchar.mana <= pchar.maxMana - 5) {
spawnPickup('manapotion', eBoss.xloc, eBoss.yloc);
} else {
if (v1 == 5) {
spawnPickup('gem_green', eBoss.xloc, eBoss.yloc);
} else {
if (v1 == 6) {
spawnPickup('gem_blue', eBoss.xloc, eBoss.yloc);
} else {
if (v1 == 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 += 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 v2 = randbtwn(1, 10);
if (v2 <= 2 && pchar.hp < hpmax) {
spawnPickup('redpotion', anytile.tilex, anytile.tiley + 1);
} else {
if (v2 <= 4 && pchar.mana <= pchar.maxMana - 5) {
spawnPickup('manapotion', anytile.tilex, anytile.tiley + 1);
} else {
if (v2 == 5) {
spawnPickup('gem_green', anytile.tilex, anytile.tiley + 1);
} else {
if (v2 == 6) {
spawnPickup('gem_blue', anytile.tilex, anytile.tiley + 1);
} else {
if (v2 == 7) {
spawnPickup('gem_red', anytile.tilex, anytile.tiley + 1);
} else {
spawnPickup('goldcoins', anytile.tilex, anytile.tiley + 1);
}
}
}
}
}
}
function specialAbility(anyped) {
if (twoPlayer) {
var v4 = new Array();
if (anyped == pchar) {
v4 = p1SelItem;
} else {
if (anyped == schar) {
v4 = p2SelItem;
}
}
selectItem1 = v4[1];
selectItem2 = v4[2];
selectItem3 = v4[3];
selectItem4 = v4[4];
selectItem5 = v4[5];
}
if (anyped.hero == 'paladin') {
if (tBlocked[anyped.xloc][anyped.yloc + dyOffset + 1]) {
var v5 = tTiles[anyped.xloc][anyped.yloc + dyOffset + 1];
if (!v5.isDead && v5.tileType == 'normal') {
var v3 = 3;
if (selectItem3 == 1) {
v3 = 5;
} else {
if (selectItem3 == 2) {
v3 = 0;
}
}
if (anyped.mana >= v3) {
anyped.mana -= v3;
floatWords(anyped, 'stomp!');
anyped.top.body.arm.gotoAndPlay('attack_melee');
anyped.cd_anim = 10;
breakBlock(v5);
if (selectItem3 == 1) {
dblock = 1;
while (dblock <= 5) {
var v2 = tTiles[anyped.xloc][anyped.yloc + dyOffset + 1 + dblock];
if (v2.tileType == 'normal') {
breakBlock(v2);
} else {
if (v2.tileType == 'explosive') {
breakBlock(v2);
makePickup(v2);
}
}
++dblock;
}
}
anyped.jump = true;
anyped._y -= 1;
anyped.ymove = -10;
} else {
floatWords(anyped, 'no mana!');
}
}
}
} else {
if (anyped.hero == 'ranger') {
var v3 = 1;
if (selectItem4 == 3) {
v3 = 2;
}
if (anyped.mana >= v3) {
anyped.mana -= v3;
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 v3 = 3;
if (selectItem5 == 3) {
v3 = 2;
}
if (selectItem5 == 5) {
v3 = 10;
}
if (shadowCount == 0) {
if (anyped.mana >= v3) {
anyped.mana -= v3;
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 v3 = 3;
if (selectItem2 == 1) {
v3 = 3;
} else {
if (selectItem2 == 2) {
v3 = 1;
} else {
if (selectItem2 == 3) {
v3 = 3;
} else {
if (selectItem2 == 4) {
v3 = 4;
} else {
if (selectItem2 == 5) {
v3 = 10;
}
}
}
}
}
if (anyped.mana >= v3) {
anyped.mana -= v3;
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 v3 = 10;
if (selectItem1 == 1) {
v3 = 5;
} else {
if (selectItem1 == 2) {
v3 = 5;
} else {
if (selectItem1 == 4) {
v3 = 1;
}
}
}
if (anyped.mana >= v3) {
if (selectItem1 == 1) {
anyped.mana -= v3;
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 -= v3;
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 -= v3;
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 -= v3;
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 v1;
if (c_type == 'pchar') {
v1 = spawnObject('char', 'char', c_x * 50 + 25, c_y * 50 - 25, 51000);
} else {
v1 = spawnObject('char', 'char', c_x * 50 + 25, c_y * 50 - 25, 50000);
}
v1.jump = false;
v1.jump2 = false;
v1.actwidth = 14;
v1.actheight = 22;
v1.c_type = c_type;
v1.x = v1._x;
v1.y = v1._y;
v1.cd_anim = 0;
v1.owner = 2;
v1.noStomp = false;
v1.canJump = 0;
v1.armed = true;
v1.bounty = 1;
v1.basespeed = 1;
v1.ranged = '';
if (c_type == 'pchar') {
v1.top.body.head.attachMovie('h_001', 'head', 10);
v1.top.body.body.attachMovie('b_001', 'body', 10);
v1.top.body.arm.arm1.attachMovie('at_001', 'arm', 10);
v1.top.body.arm.arm2.attachMovie('ab_001', 'arm', 10);
v1.armed = false;
v1.jumpstrength = 20;
v1.hero = 'normal';
canfall(v1);
return v1;
}
if (c_type == 'goblin') {
v1.top.body.head.attachMovie('h_002', 'head', 10);
v1.top.body.body.attachMovie('b_002', 'body', 10);
v1.top.body.arm.arm1.attachMovie('at_002', 'arm', 10);
v1.top.body.arm.arm2.attachMovie('ab_002', 'arm', 10);
v1.ranged = '';
v1.xmove = 1;
v1.bounty = 2;
if (randbtwn(1, 10) <= 5) {
v1.xmove = -1;
}
canfall(v1);
return v1;
}
if (c_type == 'troll') {
v1.top.body.head.attachMovie('h_008', 'head', 10);
v1.top.body.body.attachMovie('b_008', 'body', 10);
v1.top.body.arm.arm1.attachMovie('at_008', 'arm', 10);
v1.top.body.arm.arm2.attachMovie('ab_008', 'arm', 10);
v1.ranged = 'spear';
v1.xmove = 1;
v1.canJump = 12;
v1.bounty = 2;
if (randbtwn(1, 10) <= 5) {
v1.xmove = -1;
}
canfall(v1);
return v1;
}
if (c_type == 'shaman') {
v1.top.body.head.attachMovie('h_009', 'head', 10);
v1.top.body.body.attachMovie('b_009', 'body', 10);
v1.top.body.arm.arm1.attachMovie('at_009', 'arm', 10);
v1.top.body.arm.arm2.attachMovie('ab_009', 'arm', 10);
v1.ranged = 'spear';
v1.noStomp = true;
v1.xmove = 1;
v1.bounty = 3;
v1.canJump = 12;
if (randbtwn(1, 10) <= 5) {
v1.xmove = -1;
}
canfall(v1);
return v1;
}
if (c_type == 'skeleton') {
v1.top.body.head.attachMovie('h_013b', 'head', 10);
v1.top.body.body.attachMovie('b_013', 'body', 10);
v1.top.body.arm.arm1.attachMovie('at_013', 'arm', 10);
v1.top.body.arm.arm2.attachMovie('ab_013', 'arm', 10);
v1.ranged = '';
v1.xmove = 1;
v1.bounty = 2;
if (randbtwn(1, 10) <= 5) {
v1.xmove = -1;
}
canfall(v1);
return v1;
}
if (c_type == 'skarcher') {
v1.top.body.head.attachMovie('h_013', 'head', 10);
v1.top.body.body.attachMovie('b_013', 'body', 10);
v1.top.body.arm.arm1.attachMovie('at_013', 'arm', 10);
v1.top.body.arm.arm2.attachMovie('ab_013b', 'arm', 10);
v1.ranged = 'arrow';
v1.xmove = 1;
v1.bounty = 2;
if (randbtwn(1, 10) <= 5) {
v1.xmove = -1;
}
canfall(v1);
return v1;
}
if (c_type == 'sandwarrior') {
v1.top.body.head.attachMovie('h_014', 'head', 10);
v1.top.body.body.attachMovie('b_014', 'body', 10);
v1.top.body.arm.arm1.attachMovie('at_014', 'arm', 10);
v1.top.body.arm.arm2.attachMovie('ab_014', 'arm', 10);
v1.ranged = 'shuriken';
v1.xmove = 1;
v1.bounty = 2;
v1.canJump = 15;
if (randbtwn(1, 10) <= 5) {
v1.xmove = -1;
}
canfall(v1);
return v1;
}
if (c_type == 'cactus') {
v1.top.body.head.attachMovie('h_016', 'head', 10);
v1.top.body.body.attachMovie('b_016', 'body', 10);
v1.top.body.arm.arm1.attachMovie('at_016', 'arm', 10);
v1.top.body.arm.arm2.attachMovie('ab_016', 'arm', 10);
v1.ranged = '';
v1.xmove = 1;
v1.bounty = 3;
v1.canJump = 12;
if (randbtwn(1, 10) <= 5) {
v1.xmove = -1;
}
canfall(v1);
return v1;
}
if (c_type == 'yeti') {
v1.top.body.head.attachMovie('h_015', 'head', 10);
v1.top.body.body.attachMovie('b_015', 'body', 10);
v1.top.body.arm.arm1.attachMovie('at_015', 'arm', 10);
v1.top.body.arm.arm2.attachMovie('ab_015', 'arm', 10);
v1.ranged = '';
v1.xmove = 1;
v1.bounty = 3;
v1.canJump = 12;
if (randbtwn(1, 10) <= 5) {
v1.xmove = -1;
}
canfall(v1);
return v1;
}
if (c_type == 's_goblin') {
v1.top.body.head.attachMovie('h_017b', 'head', 10);
v1.top.body.body.attachMovie('b_017', 'body', 10);
v1.top.body.arm.arm1.attachMovie('at_017', 'arm', 10);
v1.top.body.arm.arm2.attachMovie('ab_017b', 'arm', 10);
v1.ranged = '';
v1.xmove = 1;
v1.bounty = 2;
if (randbtwn(1, 10) <= 5) {
v1.xmove = -1;
}
canfall(v1);
return v1;
}
if (c_type == 's_troll') {
v1.top.body.head.attachMovie('h_017', 'head', 10);
v1.top.body.body.attachMovie('b_017', 'body', 10);
v1.top.body.arm.arm1.attachMovie('at_017', 'arm', 10);
v1.top.body.arm.arm2.attachMovie('ab_017', 'arm', 10);
v1.ranged = 'spear';
v1.xmove = 1;
v1.canJump = 12;
v1.bounty = 2;
if (randbtwn(1, 10) <= 5) {
v1.xmove = -1;
}
canfall(v1);
return v1;
}
if (c_type == 'shade') {
v1.top.body.head.attachMovie('h_019', 'head', 10);
v1.top.body.body.attachMovie('b_019', 'body', 10);
v1.top.body.arm.arm1.attachMovie('at_019', 'arm', 10);
v1.top.body.arm.arm2.attachMovie('ab_019', 'arm', 10);
v1.ranged = '';
v1.xmove = 3;
v1.bounty = 2;
v1.basespeed = 3;
v1.canJump = 15;
if (randbtwn(1, 10) <= 5) {
v1.xmove = -3;
}
}
canfall(v1);
return v1;
}
function spawnPickup(p_type, p_x, p_y) {
var v1;
v1 = spawnObject('pickup', 'pickup', p_x * 50 + 25, p_y * 50 - 5, 50000);
v1.icon.attachMovie(p_type, 'icon', 0);
v1.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 -= 25;
pchar.gold = 0;
schar = spawnChar('pchar', 4, 1);
schar.owner = 3;
schar.hp = hpmax;
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 v1 = 1;
while (v1 <= 25) {
replaceTile(-randbtwn(4, 13));
++v1;
}
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 = 3;
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 = 2.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 = 1.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 = 3.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 = 3;
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 for 1 gp each.', '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 = 5;
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 || 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(61)) {
addTip('The Assassin\'s Amulet makes your Thief invulnerable for 2 seconds after escaping.', '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 = 3;
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 = 3;
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 v3 = randbtwn(1, 9);
var v1 = randbtwn(16, 16);
for (;;) {
if (!(tBlocked[v3][oriY + v1 + dyOffset] || tTiles[v3][oriY + v1 + dyOffset].tileType == 'key' || tTiles[v3][oriY + v1 + dyOffset].tileType == 'boss' || oriY + v1 + dyOffset == 1 || tTiles[v3][oriY + v1 + dyOffset] != undefined)) break;
v3 = randbtwn(1, 9);
v1 = randbtwn(15, 17);
}
tType = randbtwn(2, 60);
nextChest += 1;
if (nextChest >= 5) {
nextChest = 0;
tType = 1;
}
if (thisDepth >= targetDepth - 30 && !princessSpawned) {
princessSpawned = true;
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');
}
}
}
if (!survivalMode && !twoPlayer && cIcon == 2 && levelsCompleted > 4 || survivalMode && levelsCompleted % 5 == 4 || twoPlayer && cIcon > 1) {
if (thisDepth >= mRn(targetDepth * 0.7) && !bossSpawned) {
bossSpawned = true;
tType = -10;
}
}
if (tType == -10) {
var v5 = new Array();
v5[1] = 1;
v5[2] = 2;
v5[3] = 8;
v5[4] = 9;
v5[5] = randbtwn(3, 4);
v5[6] = randbtwn(6, 7);
v5[7] = randbtwn(3, 6);
v5[8] = randbtwn(4, 7);
v5[9] = 5;
v5[10] = 3;
v5[11] = 4;
v5[12] = 5;
v5[13] = 6;
v5[14] = 7;
var v4 = new Array();
v4[1] = 0;
v4[2] = 0;
v4[3] = 0;
v4[4] = 0;
v4[5] = randbtwn(0, 1);
v4[6] = randbtwn(0, 1);
v4[7] = -2;
v4[8] = -2;
v4[9] = 1;
v4[10] = 1;
v4[11] = 2;
v4[12] = 2;
v4[13] = 2;
v4[14] = 1;
sweep = 1;
while (sweep <= 14) {
xSw = v5[sweep];
yVar = v4[sweep];
if (tBlocked[xSw][oriY + v1 + dyOffset + yVar]) {
sideTile = tTiles[xSw][oriY + v1 + dyOffset + yVar];
removeProp(sideTile);
tBlocked[xSw][oriY + v1 + dyOffset + yVar] = false;
limboBlock += 1;
}
if (sweep <= 4) {
tTiles[xSw][oriY + v1 + dyOffset + yVar] = spawnProp('tile_bossledge', xSw * 50, (oriY + v1 + yVar) * 50, 10);
} else {
tTiles[xSw][oriY + v1 + dyOffset + yVar] = spawnProp('tile_gold', xSw * 50, (oriY + v1 + yVar) * 50, 10);
}
if (sweep > 4) {
tTiles[xSw][oriY + v1 + dyOffset + yVar].tileType = 'bossgold';
} else {
tTiles[xSw][oriY + v1 + dyOffset + yVar].tileType = 'solidgold';
}
tTiles[xSw][oriY + v1 + dyOffset + yVar].tilex = xSw;
tTiles[xSw][oriY + v1 + dyOffset + yVar].tiley = oriY + v1 + yVar;
tTiles[xSw][oriY + v1 + dyOffset + yVar].swapDepths(50000 - (xSw + (oriY + v1 + yVar) * 10));
tBlocked[xSw][oriY + v1 + dyOffset + yVar] = true;
limboBlock -= 1;
if (tBlocked[xSw][oriY + v1 + dyOffset - 1 + yVar]) {
sideTile = tTiles[xSw][oriY + v1 + dyOffset - 1 + yVar];
removeProp(sideTile);
tBlocked[xSw][oriY + v1 + dyOffset - 1 + yVar] = false;
limboBlock += 1;
}
if (sweep <= 4) {
if (tBlocked[xSw][oriY + v1 + dyOffset - 2 + yVar]) {
sideTile = tTiles[xSw][oriY + v1 + dyOffset - 2 + yVar];
removeProp(sideTile);
tBlocked[xSw][oriY + v1 + dyOffset - 2 + yVar] = false;
limboBlock += 1;
}
}
++sweep;
}
eBoss = spawnObject('boss' + bossNum, 'char', 75, (oriY + v1) * 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 v6 = spawnProp('tile_princess', v3 * 50, (oriY + v1) * 50, 10);
} else {
var v6 = spawnProp('tile_exit', v3 * 50, (oriY + v1) * 50, 10);
}
dressHero(v6, 'princess1');
tBlocked[v3][oriY + v1 + dyOffset] = true;
v6.tileType = 'cage';
v6.heroType = 'princess';
wrongTile2 = tTiles[v3][oriY + v1 + dyOffset - 1];
removeProp(wrongTile2);
tBlocked[v3][oriY + v1 + dyOffset - 1] = false;
closex = 1;
while (closex <= 9) {
sideWing = tTiles[closex][oriY + v1 + dyOffset + 1];
removeProp(sideWing);
tTiles[closex][oriY + v1 + dyOffset + 1] = spawnProp('tile_gold', closex * 50, (oriY + v1 + 1) * 50, 10);
tBlocked[closex][oriY + v1 + dyOffset + 1] = true;
tTiles[closex][oriY + v1 + dyOffset + 1].tileType = 'solidgold';
tTiles[closex][oriY + v1 + dyOffset + 1].swapDepths(50000 - (closex + (oriY + v1 + 1) * 10));
++closex;
}
if ((cIcon != 2 || survivalMode || twoPlayer) && !(twoPlayer && cIcon == 5)) {
tBlocked[v3][oriY + v1 + dyOffset] = false;
v6.tileType = 'key';
}
} else {
if (tType == 1) {
var v6 = spawnProp('tile_boom', v3 * 50, (oriY + v1) * 50, 10);
tBlocked[v3][oriY + v1 + dyOffset] = true;
v6.tileType = 'explosive';
} else {
if (tType <= 20 && nextSpecialBlock >= 3) {
nextSpecialBlock = 0;
var v6 = spawnProp('tile_cage', v3 * 50, (oriY + v1) * 50, 10);
tBlocked[v3][oriY + v1 + dyOffset] = true;
v6.tileType = 'cage';
v6.heroType = lastHero;
while (v6.heroType == lastHero) {
htype = randbtwn(1, 10);
if (htype <= 2) {
v6.heroType = 'paladin';
} else {
if (htype <= 4) {
v6.heroType = 'ranger';
} else {
if (htype <= 6) {
v6.heroType = 'thief';
} else {
if (htype <= 8) {
v6.heroType = 'mage';
} else {
if (htype <= 10) {
v6.heroType = 'barbarian';
}
}
}
}
}
}
lastHero = v6.heroType;
if (twoPlayer) {
selectItem1 = 7;
selectItem2 = 7;
selectItem3 = 7;
selectItem4 = 7;
selectItem5 = 7;
}
dressHero(v6, v6.heroType);
} else {
if (tType <= 30 && nextSpecialBlock >= 3 && cMapType != 13) {
nextSpecialBlock = 0;
var v6 = spawnProp('tile_spike', v3 * 50, (oriY + v1) * 50, 10);
tBlocked[v3][oriY + v1 + dyOffset] = true;
v6.tileType = 'spike';
} else {
if (cIcon == 2 && tType <= 40 && nextSpecialBlock >= 3) {
nextSpecialBlock = 0;
var v6 = spawnProp('tile_sliding', v3 * 50, (oriY + v1) * 50, 10);
tBlocked[v3][oriY + v1 + dyOffset] = true;
v6.tileType = 'sliding';
v6.count = 0;
v6.tileStatus = true;
} else {
if (cIcon == 2 && tType <= 50 && nextSpecialBlock >= 3) {
nextSpecialBlock = 0;
var v6 = spawnProp('tile_idolhead', v3 * 50, (oriY + v1) * 50, 10);
tBlocked[v3][oriY + v1 + dyOffset] = true;
v6.tileType = 'idolhead';
v6.count = 0;
v6.owner = 2;
if (v3 > 5) {
v6.tileStatus = true;
} else {
v6.tileStatus = false;
v6.gotoAndStop(2);
}
} else {
if (cIcon == 4 && tType <= 40 && nextSpecialBlock >= 3) {
nextSpecialBlock = 0;
var v6 = spawnProp('tile_icicle', v3 * 50, (oriY + v1) * 50, 10);
tBlocked[v3][oriY + v1 + dyOffset] = true;
v6.tileType = 'icicle';
v6.count = 0;
v6.tileStatus = true;
} else {
if (cIcon == 4 && tType <= 50 && nextSpecialBlock >= 3) {
nextSpecialBlock = 0;
var v6 = spawnProp('tile_geyser', v3 * 50, (oriY + v1) * 50, 10);
tBlocked[v3][oriY + v1 + dyOffset] = true;
v6.tileType = 'geyser';
v6.count = 0;
v6.tileStatus = true;
} else {
if (cIcon == 5 && tType <= 40 && nextSpecialBlock >= 3) {
nextSpecialBlock = 0;
var v6 = spawnProp('tile_magma', v3 * 50, (oriY + v1) * 50, 10);
tBlocked[v3][oriY + v1 + dyOffset] = true;
v6.tileType = 'magma';
v6.count = 0;
v6.tileStatus = true;
} else {
if (cIcon == 5 && tType <= 50 && nextSpecialBlock >= 3) {
nextSpecialBlock = 0;
var v6 = spawnProp('tile_firevent', v3 * 50, (oriY + v1) * 50, 10);
tBlocked[v3][oriY + v1 + dyOffset] = true;
v6.tileType = 'firevent';
v6.count = 0;
v6.tileStatus = true;
} else {
nextSpecialBlock += 1;
var v6 = spawnProp('tile_blank' + cIcon, v3 * 50, (oriY + v1) * 50, 10);
v6.block._rotation = randbtwn(0, 3) * 90;
tBlocked[v3][oriY + v1 + dyOffset] = true;
if (randbtwn(0, 10) <= 5) {
v6.block.txt = '';
}
v6.tileType = 'normal';
v6.sand = false;
v6.count = 0;
if (randbtwn(1, 20) <= 5 && !tBlocked[v3][oriY + v1 - 1 + dyOffset]) {
if (thisDepth > 50) {
var v7 = randbtwn(1, 5);
if (thisDepth < 100) {
v7 = 1;
}
if (cIcon == 1) {
if (v7 <= 2) {
spawnChar('goblin', v3, oriY + v1);
} else {
if (v7 <= 4) {
spawnChar('troll', v3, oriY + v1);
} else {
if (cMapType != 13) {
spawnChar('shaman', v3, oriY + v1);
}
}
}
} else {
if (cIcon == 2) {
if (v7 <= 3) {
spawnChar('skeleton', v3, oriY + v1);
} else {
spawnChar('skarcher', v3, oriY + v1);
}
} else {
if (cIcon == 3) {
if (v7 <= 3) {
spawnChar('sandwarrior', v3, oriY + v1);
} else {
spawnChar('cactus', v3, oriY + v1);
}
} else {
if (cIcon == 4) {
if (v7 <= 2) {
spawnChar('s_goblin', v3, oriY + v1);
} else {
if (v7 <= 4) {
spawnChar('s_troll', v3, oriY + v1);
} else {
spawnChar('yeti', v3, oriY + v1);
}
}
} else {
if (cIcon == 5) {
if (v7 <= 2) {
spawnChar('goblin', v3, oriY + v1);
} else {
if (v7 <= 4) {
spawnChar('troll', v3, oriY + v1);
} else {
spawnChar('shaman', v3, oriY + v1);
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
v6.tilex = v3;
v6.tiley = oriY + v1;
tTiles[v3][oriY + v1 + dyOffset] = v6;
v6.swapDepths(50000 - (v3 + (oriY + v1) * 10));
checkTop(v6);
if (cIcon == 3) {
if (v6.tileType == 'normal') {
if (randbtwn(1, 10) <= 3) {
if (!tBlocked[tx][ty - 1 + dyOffset]) {
v6.gotoAndStop(3);
v6.sand = false;
}
}
}
}
}
function checkTop(anytile) {
tx = anytile.tilex;
ty = anytile.tiley;
anytile.count = 2;
if (anytile.tileType == 'normal') {
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 += 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 += 1;
}
if (anytile.tileType == 'spike' && tTiles[tx][ty + 1 + dyOffset].tileType == 'cage') {
tBlocked[tx][ty + dyOffset] = false;
removeProp(anytile);
limboBlock += 1;
}
}
}
}
function openCage(anytile, anyped) {
gold += 3;
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 v3 = new Array();
if (anyped == pchar) {
v3 = p1SelItem;
} else {
if (anyped == schar) {
v3 = p2SelItem;
}
}
selectItem1 = v3[1];
selectItem2 = v3[2];
selectItem3 = v3[3];
selectItem4 = v3[4];
selectItem5 = v3[5];
}
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 += 1;
gold += 3 * comboBonus;
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 -= 1;
}
var v1 = 1;
while (v1 <= 20) {
if (limboBlock > 0 && randbtwn(1, 10) <= 7) {
replaceTile(-dyOffset - 2);
limboBlock -= 1;
} else {
v1 = 99;
}
++v1;
}
}
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;
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 v2 = new Array();
if (anyped == pchar) {
v2 = p1SelItem;
} else {
if (anyped == schar) {
v2 = p2SelItem;
}
}
selectItem1 = v2[1];
selectItem2 = v2[2];
selectItem3 = v2[3];
selectItem4 = v2[4];
selectItem5 = v2[5];
}
if (anyped.shield) {
anyped.shield = false;
anyped.fx_shield.removeMovieClip();
} else {
if (!(selectItem3 == 2 && anyped.hero == 'paladin')) {
noHurt = false;
anyped.hp -= 1;
anyped.hit = 60;
snd_squeak.start();
attachEffect(anyped, 'effect_ninjasmoke');
shadowCount = 0;
if (selectItem3 == 6 && anyped.mana >= 5) {
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 v2 = 0;
while (v2 <= 17) {
if (v2 == -1) {
var v1 = 1;
while (v1 <= 9) {
tBlocked[v1][v2] = false;
tTiles[rx][ry] = undefined;
++v1;
}
} else {
var v1 = 1;
while (v1 <= 9) {
tBlocked[v1][v2] = tBlocked[v1][v2 + 1];
tTiles[v1][v2] = tTiles[v1][v2 + 1];
tTiles[v1][v2 + 1] = undefined;
++v1;
}
}
++v2;
}
}
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;
} else {
return false;
}
}
function activateTile(anyped, tilex, tiley) {
var v2 = tTiles[tilex][tiley + dyOffset];
if (!v2.isDead && v2 != undefined && v2.tileType != '') {
if (v2.tileType == 'explosive') {
snd_box.start();
breakBlock(v2);
chestsOpened += 1;
if (anyped.objclass == 'char') {
anyped.jump = true;
anyped._y -= 1;
anyped.ymove = -12;
}
makePickup(v2);
if (checkHint(7)) {
addTip('Breaking open chests will always reveal potions, gold coins, or other useful items!', 'normal');
}
} else {
if (v2.tileType == 'icicle') {
breakBlock(v2);
if (anyped.objclass == 'char') {
anyped.jump = true;
anyped._y -= 1;
anyped.ymove = -12;
}
} else {
if (v2.tileType == 'ice') {
enemyChar = spawnChar('yeti', tilex, tiley);
enemyChar.y += 120;
enemyChar._y = enemyChar._y;
breakBlock(v2);
if (anyped.objclass == 'char') {
anyped.jump = true;
anyped.y -= 20;
anyped.ymove = -12;
}
if (checkHint(32)) {
addTip('Watch out, breaking the ice will release the enemy inside!', 'normal');
}
} else {
if (v2.tileType == 'spike') {
if (anyped.objclass == 'char') {
if (selectItem5 == 4 && anyped.hero == 'thief' && anyped.mana >= 5) {
anyped.mana -= 5;
escapeThief(anyped);
} else {
if (anyped.hit == 0) {
loseHP(anyped);
}
anyped.jump = true;
anyped._y -= 1;
anyped.ymove = -12;
}
if (checkHint(14)) {
addTip('Avoid jumping on spikes: touching them takes away 1 health point.', 'normal');
}
}
} else {
if (v2.tileType == 'magma') {
if (anyped.objclass == 'char') {
anyped.jump = true;
anyped._y -= 1;
anyped.ymove = -20;
attachEffect(anyped, 'fx_steamcloud');
}
} else {
if (v2.tileType == 'cage') {
if (anyped.objclass == 'missile') {
anyped.hp -= 1;
if (selectItem4 == 6 && v2.heroType != 'princess') {
gold += 3;
makePickup(v2);
floatWords(v2, '+3 gp!');
v2.tileType = '';
attachEffect(v2, 'fx_explosion');
v2.gotoAndStop(3);
snd_box.start();
tBlocked[v2.tilex][v2.tiley + dyOffset] = false;
}
}
} else {
if (v2.tileType == 'normal') {
if (cIcon == 3) {
if (v2.sand) {
if (v2.count <= 0) {
attachEffect(v2, 'fx_sandcloud');
lastFx._x += 25;
tBlocked[tilex][tiley + dyOffset] = false;
removeProp(v2);
limboBlock += 1;
if (checkHint(26)) {
addTip('Desert sands are treacherously unstable: try to stay on the solid rocks!', 'normal');
}
} else {
v2.count -= 1;
}
}
}
if (anyped.objclass == 'missile') {
if (anyped.b_type == 'fireball' || anyped.b_type == 'familiar') {
breakBlock(v2);
} else {
if (anyped.b_type == 'breaker') {
breakBlock(v2);
gold += 1;
if (anyped.owner == 1) {
pchar.gold += 1;
} else {
if (anyped.owner == 3) {
schar.gold += 1;
}
}
floatWords(v2, '+1 gp!');
snd_cash.start();
} else {
if (anyped.b_type == 'icebolt') {
tBlocked[tilex][tiley + dyOffset] = false;
v2.tileType = '';
removeProp(v2);
var v5 = spawnProp('tile_icicle', tilex * 50, tiley * 50, 10);
tBlocked[tilex][tiley + dyOffset] = true;
v5.tileType = 'icicle';
v5.tilex = tilex;
v5.tiley = tiley;
tTiles[tilex][tiley + dyOffset] = v5;
v5.swapDepths(50000 - (tilex + tiley * 10));
}
}
}
}
}
}
}
}
}
}
}
if (anyped.objclass == 'missile' && v2.tileType != 'boss') {
if (anyped.b_type == 'shuriken') {
anyped._rotation = randbtwn(0, 360);
}
if (anyped.b_type != 'shadow' && anyped.b_type != 'scimitar') {
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 -= 1;
anyped.ymove = -anyped.jumpstrength;
timesJumped += 1;
} else {
if (anyped.doublejump) {
if (!anyped.jump2) {
snd_jump.start();
timesDJumped += 1;
if (selectItem4 == 5 && anyped.hero == 'ranger' && anyped.mana >= 1) {
anyped.mana -= 1;
anyped.ymove = -10;
} else {
anyped.jump2 = true;
anyped.ymove = -12;
attachEffect(anyped, 'fx_jumpcloud');
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;
if (cIcon == 2 && !survivalMode && !twoPlayer) {
targetDepth = 600;
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 += 15 * levelsCompleted;
gameObj1 = 'Get to the 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 *= 3;
cIcon = levelsCompleted + 1;
backdrop.gotoAndStop(cIcon);
if (sfxLevel == 3) {
musiccontrol.gotoAndStop(cIcon + 2);
}
} else {
if (sfxLevel == 3) {
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 -= 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 -= 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 -= 1;
if (frames % 10 == 0) {
gold += 1;
shadowCaster.gold += 1;
}
}
if (necroSpecial > 0) {
necroSpecial -= 1;
if (necroSpecial <= 0) {
unshadeObj(stage);
backdrop.gotoAndStop(cIcon);
}
}
if (sancSpecial > 0) {
sancSpecial -= 1;
if (sancSpecial <= 0) {
backdrop.gotoAndStop(cIcon);
}
}
if (pchar.omniCool > 0) {
pchar.omniCool -= 1;
}
if (pchar.omniStop > 0) {
pchar.omniStop -= 1;
if (pchar.omniStop == 0) {
pchar.omniStrike = 0;
}
}
if (schar.omniCool > 0) {
schar.omniCool -= 1;
}
if (schar.omniStop > 0) {
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 -= 1;
if (frames <= 0) {
frames = 30;
seconds += 1;
if (seconds % 2 == 0) {
if (pchar.mana < pchar.maxMana) {
pchar.mana += 1;
}
if (schar.mana < schar.maxMana) {
schar.mana += 1;
}
}
if (scrollSpeed > 0) {
upScroll += 1;
}
if (seconds >= 3) {
targetbox._visible = false;
}
}
clocktxt = displayLongTime(seconds);
if (upScroll >= 7 && !princessSpawned) {
upScroll = 0;
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 += 1;
if (tipshow > 0) {
tipbox._visible = true;
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 v20 = tTiles[pchar.xloc][pchar.yloc + dyOffset + 1];
var v21 = tTiles[pchar.xloc][pchar.yloc + dyOffset];
if (twoPlayer) {
var v18 = tTiles[schar.xloc][schar.yloc + dyOffset + 1];
var v22 = tTiles[schar.xloc][schar.yloc + dyOffset];
}
if (v21.tileType == 'key' || v22.tileType == 'key') {
levelComplete = true;
deadHero = pchar.hero;
makeFade('gameover');
pchar.dead = true;
backdrop.gotoAndStop(7);
_level0.onEnterFrame = function () {
if (pchar._xscale > 0) {
pchar._xscale -= 10;
} else {
pchar._xscale += 10;
}
pchar._yscale -= 10;
pchar._rotation += 10;
};
}
if (v20.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 (v18.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 (v20.tileType == 'cage' && pchar.ymove <= 3) {
openCage(v20, pchar);
}
}
} else {
pdown = false;
}
if (twoPlayer) {
if (Key.isDown(83)) {
if (!p2down) {
p2down = true;
if (v18.tileType == 'cage' && schar.ymove <= 3) {
openCage(v18, schar);
}
}
} else {
p2down = false;
}
}
if (aiBuddy) {
if (v18.tileType == 'cage') {
openCage(v18, 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' && v20.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;
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 {
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 -= 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 -= (eBoss._y + stage._y - 275) / 20;
} else {
boss_bar._visible = false;
lockSpot = 220;
var v19;
if (twoPlayer) {
if (pchar.y > schar.y) {
v19 = pchar;
} else {
v19 = schar;
}
} else {
v19 = pchar;
}
if (!lockScrolling) {
if (v19._y + stage._y > lockSpot) {
stage._y -= (v19._y + stage._y - lockSpot) / 15;
startScroll = true;
}
}
if (startScroll && survivalMode) {
stage._y -= scrollSpeed * 2;
} else {
if (shadowCount > 0) {
stage._y -= 2;
}
}
}
if (!pchar.dead) {
thisDepth = mRn((-stage._y + 300) / 10);
if (thisDepth < targetDepth) {
thisDepthtxt = mRn(targetDepth - thisDepth) + ' m to go!';
} else {
thisDepthtxt = '';
}
if (thisDepth > targetDepth) {
bigbigwords = gameObj1;
} else {
if (thisDepth >= targetDepth - 50) {
bigbigwords = mRn(targetDepth - thisDepth) + ' m to the ' + gameObj2 + '!';
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 -= 1;
pchar.hp = hpmax;
dressHero(pchar, 'normal');
penalty = mRn(pchar.gold / 4);
pchar.gold -= penalty;
floatWords(pchar, 'PENALTY -' + penalty + 'gp!');
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 -= 1;
schar.hp = hpmax;
dressHero(schar, 'normal');
penalty = mRn(schar.gold / 4);
schar.gold -= penalty;
floatWords(schar, 'PENALTY -' + penalty + 'gp!');
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 v12 = 0;
while (v12 <= propCount) {
var v3 = stage['prop' + dd(v12)];
if (!v3.isDead) {
if (v3.tileType == 'explosive') {
if (sancSpecial > 0 && v3._y + stage._y < 500) {
v3.isDead = true;
breakBlock(v3);
makePickup(v3);
snd_pop.start();
}
}
if (bossSpawned && eBoss == undefined) {
if (!goldBroken && frames % 10 == 0) {
if (v3.tileType == 'bossgold' && v3._y + stage._y < 500) {
v3.isDead = true;
breakBlock(v3);
goldBroken = true;
snd_pop.start();
}
}
}
if (bossSpawned && eBoss != undefined && eBoss._y + stage._y < 350) {
if (!bossClearance && frames % 15 == 0) {
if (v3.tileType != 'bossgold' && v3.tileType != 'solidgold' && v3.tileType != 'icicle' && v3._y + stage._y < 500) {
v3.isDead = true;
breakBlock(v3);
bossClearance = true;
}
}
}
if (v3.tileType == 'sliding') {
v3.count += 1;
if (v3.count >= 90) {
v3.count = 0;
v3.tileStatus = !v3.tileStatus;
if (v3.tileStatus) {
v3.gotoAndStop(1);
tBlocked[v3.tilex][v3.tiley + dyOffset] = true;
if (pchar.xloc == v3.tilex) {
if (pchar.yloc == v3.tiley) {
pchar.jump = true;
pchar.ymove = -12;
}
}
} else {
v3.gotoAndStop(2);
tBlocked[v3.tilex][v3.tiley + dyOffset] = false;
}
}
}
if (v3.tileType == 'geyser') {
v3.count += 1;
if (v3.count >= 100) {
v3.count = 0;
var v15 = fireMissile(v3, -90, 'geyser', 1);
attachEffect(v3, 'fx_explosion');
v15._y -= 50;
v15._x += 12;
lastFx._y += 25;
lastFx._x += 25;
}
}
if (v3.tileType == 'firevent') {
v3.count += 1;
if (v3.count >= 100) {
v3.count = 0;
v15 = fireMissile(v3, -45, 'magmaball', 1);
v15._y -= 50;
v15._x += 12;
v15 = fireMissile(v3, 225, 'magmaball', 1);
v15._y -= 50;
v15._x += 12;
attachEffect(v3, 'fx_explosion');
lastFx._y += 25;
lastFx._x += 25;
}
}
if (v3.tileType == 'idolhead') {
v3.count += 1;
if (v3.count >= 100) {
v3.count = 0;
if (v3.tileStatus) {
v15 = fireMissile(v3, 180, 'dart', 1);
} else {
v15 = fireMissile(v3, 0, 'dart', 1);
}
attachEffect(v3, 'fx_explosion');
v15._y += 25;
lastFx._y += 25;
lastFx._x += 25;
}
}
if (v3.heroType == 'princess' || v3.tileType == 'key') {
if (v3._y + stage._y <= 400) {
lockScrolling = true;
}
}
if (v3._y + stage._y < -50) {
currentY = v3.tiley;
limboBlock += 1;
v3.isDead = true;
removeProp(v3);
if (v3.heroType == 'princess' || v3.tileType == 'key') {
heroDead = true;
deadHero = pchar.hero;
makeFade('gameover');
pchar.dead = true;
_level0.onEnterFrame = null;
deathNote = gameObj3;
}
}
}
++v12;
}
var v16 = false;
var v17 = true;
var v14 = false;
var v13 = 0;
if (objCount == undefined) {
objCount = 0;
}
var v11 = 0;
while (v11 <= objCount) {
var v1 = stage['obj' + dd(v11)];
if (!v1.isDead) {
v1.xTile = Math.ceil((v1._x + v1._xscale / 100) / 50) - 1;
v1.yTile = Math.ceil((v1._y + 1) / 50) - 1;
v1.bodyTile = Math.ceil((v1._y - 5) / 50) - 1;
v1.nextTile = Math.ceil((v1._x + 12 * v1._xscale / 100) / 50) - 1;
v1.landTile = Math.ceil((v1._y + 25) / 50) - 1;
if (v1.objclass == 'missile') {
var v10 = v1._rotation;
v10 = (v10 / 180) * mPi;
v1._x += v1.speed * mCo(v10) * v1._xscale / 100;
v1._y += v1.speed * mSi(v10) * v1._xscale / 100;
if (v1._x < -50 || v1._x > 550 || v1._y + stage._y > 550 || v1._y + stage._y < -50) {
removeObject(v1);
}
if (v1.owner == 1 || v1.owner == 3) {
activateTile(v1, v1.xTile, v1.yTile);
} else {
if (tBlocked[v1.xTile][v1.yTile + dyOffset] && v1.b_type != 'dart' && v1.b_type != 'geyser' && v1.b_type != 'icebolt' && v1.b_type != 'fireball' && v1.b_type != 'snowball' && v1.b_type != 'trunk') {
v1.hp = 0;
}
if (v1.b_type == 'snowball') {
if (tTiles[v1.xTile][v1.yTile + dyOffset].tileType == 'icicle' || tTiles[v1.xTile][v1.yTile + dyOffset].tileType == 'normal') {
breakBlock(tTiles[v1.xTile][v1.yTile + dyOffset]);
limboBlock += 1;
} else {
if (!tBlocked[v1.xTile][v1.yTile + dyOffset]) {
if (randbtwn(1, 30) == 2) {
if (v1.xTile >= 3 && v1.xTile <= 7 && v1._y + stage._y > 150) {
var v6 = spawnProp('tile_icicle', v1.xTile * 50, v1.yTile * 50, 10);
tBlocked[v1.xTile][v1.yTile + dyOffset] = true;
v6.tileType = 'icicle';
v6.tilex = v1.xTile;
v6.tiley = v1.yTile;
tTiles[v1.xTile][v1.yTile + dyOffset] = v6;
v6.swapDepths(50000 - (v1.xTile + v1.yTile * 10));
limboBlock -= 1;
removeObject(v1);
}
}
}
}
}
}
if (v1.b_type == 'familiar') {
if (v1._rotation == 0) {
if (tBlocked[v1.xTile + 1][v1.yTile + dyOffset] || v1.xTile == 9) {
activateTile(v1, v1.xTile + 1, v1.yTile);
v1._rotation = randbtwn(0, 3) * 90;
}
} else {
if (v1._rotation == 90) {
if (tBlocked[v1.xTile][v1.yTile + dyOffset + 1]) {
activateTile(v1, v1.xTile, v1.yTile + 1);
v1._rotation = randbtwn(0, 3) * 90;
}
} else {
if (v1._rotation == 180) {
if (tBlocked[v1.xTile - 1][v1.yTile + dyOffset] || v1.xTile == 1) {
activateTile(v1, v1.xTile - 1, v1.yTile);
v1._rotation = randbtwn(0, 3) * 90;
}
} else {
if (v1._rotation == 270) {
if (tBlocked[v1.xTile][v1.yTile + dyOffset - 1]) {
activateTile(v1, v1.xTile, v1.yTile - 1);
v1._rotation = randbtwn(0, 3) * 90;
}
}
}
}
}
}
if (v1.b_type == 'scimitar') {
v1._rotation += v1.spindir;
}
if (v1.hp <= 0) {
attachEffect(v1, 'fx_explosion');
removeObject(v1);
}
if (v1.yloc == schar.yloc && Math.abs(v1.xloc - schar.xloc) <= 2) {
v16 = true;
}
}
if (v1.objclass == 'char') {
corners(v1.x, v1.y + v1.ymove, v1);
v1.xloc = int(v1.x / 50);
v1.yloc = int((v1.y + v1.ymove) / 50);
if (v1.ymove < -2) {
v1.ymove *= gGravity;
if (v1.ymove > -2) {
v1.ymove = -v1.ymove;
}
} else {
if (v1.ymove < gTerminal) {
v1.ymove += 0.1;
v1.ymove *= 2 - gGravity;
}
}
if (v1.ymove < 0) {
if (v1.cURi && v1.cULi) {
v1.y += v1.ymove;
} else {
v1.y = v1.yloc * 50 + v1.actheight;
v1.ymove = 2;
}
} else {
if (v1.ymove > 0) {
if (v1.cBLi && v1.cBRi) {
v1.y += v1.ymove;
} else {
v1.y = (v1.yloc + 1) * 50 - v1.actheight;
v1.ymove = 0;
v1.jump = false;
v1.jump2 = false;
if (v1.owner == 1 || v1.owner == 3) {
if (shadowCount == 0) {
activateTile(v1, v1.xTile, v1.yTile + 1);
}
}
}
}
}
corners(v1.x + v1.xmove, v1.y, v1);
v1.xloc = int(v1.x / 50);
v1.yloc = int(v1.y / 50);
if (v1.cd_anim > 0) {
v1.cd_anim -= 1;
}
if (v1.xmove == 0) {
if (!v1.jump && v1.cd_anim == 0) {
v1.top.body.arm.gotoAndStop(1);
}
v1.legs.gotoAndStop(1);
} else {
if (v1.xmove < 0) {
if (!v1.armed) {
v1.top.body.arm.play();
}
v1.legs.play();
if (v1.cULi && v1.cMLi && v1.cBLi && v1._x > 50 + v1.actwidth) {
v1._xscale = -100;
v1.x += v1.xmove;
canfall(v1);
} else {}
} else {
if (v1.xmove > 0) {
if (!v1.armed) {
v1.top.body.arm.play();
}
v1.legs.play();
if (v1.cURi && v1.cMRi && v1.cBRi && v1._x < 500 - v1.actwidth) {
v1._xscale = 100;
v1.x += v1.xmove;
canfall(v1);
} else {}
}
}
}
v1._x = v1.x;
v1._y = v1.y;
}
if (v1.objclass == 'pickup') {
if (v1.xloc == schar.xloc) {
v14 = true;
}
}
if (v1 != pchar && (v1 != schar || aiBuddy) && v1.objclass == 'char') {
if (v1 != schar) {
if (v1._y + stage._y < 0 || v1._y + stage._y > 850) {
removeObject(v1);
}
}
if (randbtwn(1, 60) == 1) {
v1.xmove = (randbtwn(0, 2) - 1) * v1.basespeed;
}
if (v1.owner == 2) {
if (v1.yloc == schar.yloc) {
if (v1.xloc == schar.xloc) {
v17 = true;
}
}
if (thiObj.yloc == schar.yloc) {
if (v1.xloc < schar.xloc) {
v13 = -1;
} else {
if (v1.xloc > schar.xloc) {
v13 = 1;
}
}
}
if (necroSpecial > 0) {
if (v1 == eBoss) {
bossHit(1);
} else {
if (v1._y + stage._y < 500) {
necroCaster.gold += v1.bounty;
killEnemy(v1);
}
}
}
if (v1._y + stage._y < 500) {
checkStrike(v1, pchar);
checkStrike(v1, schar);
}
if (!v1.jump) {
if (!v1.cMRi && !v1.cLRi && !v1.cMLi && !v1.cLLi) {
removeObject(v1);
}
}
}
if (v1.canJump > 0) {
if (randbtwn(1, 60) == 1) {
if (!v1.jump) {
v1.jump = true;
v1.ymove = -v1.canJump;
}
}
}
if (v1 == schar) {
var v4 = new Array();
var v7 = new Array();
var v8 = new Array();
aib = 1;
while (aib <= 3) {
v4[aib] = '';
v7[aib] = false;
v8[aib] = false;
aibx = 1;
while (aibx <= 5) {
if (tBlocked[schar.xloc + aib - 2][schar.yloc + dyOffset + aibx]) {
v4[aib] = tTiles[schar.xloc + aib - 2][schar.yloc + dyOffset + aibx].tileType;
if (v4[aib] == 'spike' || v4[aib] == 'firevent') {
v7[aib] = true;
} else {
if (v4[aib] == 'cage' || v4[aib] == 'explosive') {
v8[aib] = true;
}
}
aibx = 99;
}
++aibx;
}
++aib;
}
if (v1.ranged != '' && v1.mana > 3) {
if (v13 == -1) {
v1._xscale = -100;
specialAbility(v1);
} else {
if (v13 == 1) {
v1._xscale = 100;
specialAbility(v1);
}
}
}
if (randbtwn(1, 10) == 3) {
if (v1.yloc > pchar.yloc + 2) {
if (v1.xmove != 0 || v14) {
v1.xmove = 0;
} else {
if (randbtwn(1, 60) == 2) {
v1.xmove = v1.basespeed;
if (randbtwn(1, 10) <= 5) {
v1.xmove = -v1.xmove;
}
}
}
} else {
if (v14) {
v1.xmove = 0;
}
if (randbtwn(1, 10) <= 5) {
if (v1.xmove == 0) {
v1.xmove = v1.basespeed;
if (randbtwn(1, 10) <= 5) {
v1.xmove = -v1.xmove;
}
}
}
if (randbtwn(1, 20) == 5 || v16 || v17 && v1.yloc > -dyOffset + 3) {
makeJump(v1);
}
}
if (randbtwn(1, 5) == 3 && v1.mana > 5) {
specialAbility(v1);
}
if (v7[1] && v1.xmove < 0) {
v1.xmove = -v1.xmove;
}
if (v7[2] && v1.xmove == 0) {
v1.xmove = v1.basespeed;
if (randbtwn(1, 10) <= 5) {
v1.xmove = -v1.xmove;
}
}
if (v7[3] && v1.xmove > 0) {
v1.xmove = -v1.xmove;
}
if (v8[1] && v1.xmove >= 0) {
v1.xmove = -v1.basespeed;
}
if (v8[2] && v1.xmove != 0) {
v1.xmove = 0;
}
if (v8[3] && v1.xmove <= 0) {
v1.xmove = v1.basespeed;
}
}
}
if (v1.objclass == 'char') {
if (!v1.jump) {
if (v1.xmove < 0 && (v1.cBLi || !v1.cMLi) || v1.xmove > 0 && (v1.cBRi || !v1.cMRi)) {
if (v1.owner != 1 && v1.owner != 3 || randbtwn(1, 10) == 2) {
v1.xmove = -v1.xmove;
} else {
if (v1 == schar) {
if (randbtwn(1, 10) == 3) {
makeJump(v1);
}
} else {
v1.jump = true;
v1.ymove = -v1.canJump;
}
}
if (v1.owner == 1 || v1.owner == 3) {
if (v1.xmove < 0 && v1._x <= 70) {
v1.xmove = -v1.xmove;
} else {
if (v1.xmove > 0 && v1._x >= 480) {
v1.xmove = -v1.xmove;
}
}
}
}
}
}
if (v1._y + stage._y < 500) {
if (v1.ranged != '') {
if (v1.cd_anim == 0) {
v1.cd_anim = 90;
v1.top.body.arm.gotoAndPlay('attack_melee');
if (v1 == eBoss) {
if (v1._xscale > 0) {
if (bossNum == 1) {
fireMissile(v1, 45, v1.ranged, 1);
fireMissile(v1, 0, v1.ranged, 1);
fireMissile(v1, -45, v1.ranged, 1);
} else {
if (bossNum == 2) {
mis1 = fireMissile(v1, 0, v1.ranged, 1);
mis2 = fireMissile(v1, -90, v1.ranged, 1);
} else {
if (bossNum == 3) {
fireMissile(v1, -45, v1.ranged, 1);
fireMissile(v1, 0, v1.ranged, 1);
if (shadeNum < 3) {
newShade = spawnChar('shade', randbtwn(3, 9), -dyOffset + randbtwn(4, 6));
shadeNum += 1;
}
attachEffect(newShade, 'effect_ninjasmoke');
} else {
if (bossNum == 4) {
fireMissile(v1, -45, 'icebolt', 1);
fireMissile(v1, 0, 'icebolt', 1);
fireMissile(v1, 30, v1.ranged, 1);
fireMissile(v1, 60, v1.ranged, 1);
}
}
}
}
} else {
if (bossNum == 1) {
fireMissile(v1, 225, v1.ranged, 1);
fireMissile(v1, 180, v1.ranged, 1);
fireMissile(v1, 135, v1.ranged, 1);
} else {
if (bossNum == 2) {
mis1 = fireMissile(v1, 180, v1.ranged, 1);
mis2 = fireMissile(v1, -90, v1.ranged, 1);
} else {
if (bossNum == 3) {
fireMissile(v1, 225, v1.ranged, 1);
fireMissile(v1, 180, v1.ranged, 1);
if (shadeNum < 3) {
newShade = spawnChar('shade', randbtwn(3, 9), -dyOffset + randbtwn(4, 6));
shadeNum += 1;
}
attachEffect(newShade, 'effect_ninjasmoke');
} else {
if (bossNum == 4) {
fireMissile(v1, 225, 'icebolt', 1);
fireMissile(v1, 180, 'icebolt', 1);
fireMissile(v1, 150, v1.ranged, 1);
fireMissile(v1, 120, v1.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 (v1._xscale > 0) {
fireMissile(v1, 0, v1.ranged, 1);
} else {
fireMissile(v1, 180, v1.ranged, 1);
}
}
}
}
}
}
var v9 = 1;
while (v9 <= objCount) {
var v2 = stage['obj' + dd(v9)];
if (shadowCount == 0) {
if (!v2.isDead) {
if (v1.owner == 1 || v1.owner == 3) {
if (v1 != v2) {
if (v1.owner != v2.owner) {
if (v2.box.hitTest(v1.box)) {
if (twoPlayer) {
selectItem1 = 7;
selectItem2 = 7;
selectItem3 = 7;
selectItem4 = 7;
selectItem5 = 7;
var v5 = new Array();
if (v1 == pchar) {
v5 = p1SelItem;
} else {
if (v1 == schar) {
v5 = p2SelItem;
}
}
selectItem1 = v5[1];
selectItem2 = v5[2];
selectItem3 = v5[3];
selectItem4 = v5[4];
selectItem5 = v5[5];
}
if (v1.objclass == 'missile') {
if (v1.owner == 1 && v2.owner == 3 || v1.owner == 3 && v2.owner == 1) {
v2.jump = true;
v2.ymove = -10;
} else {
if (v2.objclass == 'char') {
if (v2 == eBoss) {
bossHit(1);
v1.hp = 0;
} else {
if (v1.b_type == 'holybolt') {
spawnPickup('redpotion', v2.xloc, v2.yloc + 1);
} else {
if (v1.b_type == 'icebolt') {
v6 = spawnProp('tile_icicle', v2.xloc * 50, v2.yloc * 50, 10);
tBlocked[v2.xloc][v2.yloc + dyOffset] = true;
v6.tileType = 'icicle';
v6.tilex = v2.xloc;
v6.tiley = v2.yloc;
tTiles[v2.xloc][v2.yloc + dyOffset] = v6;
v6.swapDepths(50000 - (v2.xloc + v2.yloc * 10));
limboBlock -= 1;
removeObject(v1);
}
}
if (v1.b_type == 'shuriken') {
v1._rotation = randbtwn(0, 360);
} else {
v1.hp -= 1;
}
if (v1.owner == 1) {
pchar.gold += v2.bounty;
} else {
if (v1.owner == 3) {
schar.gold += v2.bounty;
}
}
killEnemy(v2);
}
}
}
} else {
if (v2.objclass == 'missile') {
if (v1.owner == 1 && v2.owner == 3 || v1.owner == 3 && v2.owner == 1) {
v1.jump = true;
v1.ymove = -10;
} else {
if (v1.hit == 0) {
if (v2.b_type == 'geyser' || v2.b_type == 'snowball') {
v1.jump = true;
v1.ymove = -15;
} else {
if (selectItem5 == 4 && v1.hero == 'thief' && v1.mana >= 5) {
v1.mana -= 5;
escapeThief(v1);
} else {
if (v1.hero == 'paladin' && selectItem3 == 3 && !v2.unblockable) {
v2.hp = 0;
fireMissile(v1, v2._rotation + 180, v2.b_type, 1);
v1.top.body.arm.gotoAndPlay('attack_melee');
v1.cd_anim = 10;
} else {
if (v1.hero == 'barbarian' && selectItem1 == 3 && !v2.unblockable) {
v2.hp = 0;
fireMissile(v1, v2._rotation - 45 + 180, v2.b_type, 1);
fireMissile(v1, v2._rotation + 45 + 180, v2.b_type, 1);
v1.top.body.arm.gotoAndPlay('attack_melee');
v1.cd_anim = 10;
} else {
if (v1.hero != 'paladin' || v1._xscale > 0 && v2._rotation == 0 || v1._xscale < 0 && v2._rotation == 180 || selectItem3 == 4) {
loseHP(v1);
}
}
}
}
}
v2.hp = 0;
}
}
} else {
if (v2.objclass == 'char') {
if (v1.owner == 1 && v2.owner == 3 || v1.owner == 3 && v2.owner == 1) {
if (v1.ymove > 3 && v1._y < v2._y && (!v2.jump || v2.jump && v2.ymove < 0)) {
v1.jump = true;
v1.ymove = -10;
if (v2.jump) {
v2.ymove = 3;
}
} else {
if (v2.ymove > 3 && v2._y < v1._y && (!v1.jump || v1.jump && v1.ymove < 0)) {
v2.jump = true;
v2.ymove = -10;
if (v1.jump) {
v1.ymove = 3;
}
}
}
} else {
if (v1.armed) {
if (v2 == eBoss) {
if (eBoss.hit == 0) {
bossHit(1);
v1.top.body.arm.gotoAndPlay('attack_melee');
v1.cd_anim = 10;
} else {
if (selectItem5 == 4 && v1.hero == 'thief' && v1.mana >= 5) {
v1.mana -= 5;
escapeThief(v1);
} else {
if (v1.hit == 0) {
loseHP(v1);
v1.jump = true;
v1.ymove = -10;
}
}
}
} else {
attachEffect(v2, 'effect_slash');
v1.top.body.arm.gotoAndPlay('attack_melee');
v1.cd_anim = 10;
if (selectItem1 == 5) {
if (v1.hero == 'barbarian') {
if (v1.berserk) {
gold += v2.bounty;
v1.gold += v2.bounty;
floatWords(v2, '+' + v2.bounty + ' gp!');
if (v1.hp < hpmax) {
v1.hp += 1;
}
}
}
}
v1.gold += v2.bounty;
killEnemy(v2);
}
} else {
if (v1.ymove > 0 && v1._y < v2._y - 5) {
if (!v2.noStomp) {
if (v2 == eBoss) {
bossHit(1);
} else {
v1.gold += v2.bounty;
killEnemy(v2);
if (selectItem1 == 5) {
if (v1.hero == 'barbarian') {
if (v1.berserk) {
if (v1.hp < hpmax) {
v1.hp += 1;
}
}
}
}
}
} else {
if (selectItem5 == 4 && v1.hero == 'thief' && v1.mana >= 5) {
v1.mana -= 5;
escapeThief(v1);
} else {
if (v1.hit == 0) {
loseHP(v1);
}
}
if (checkHint(21)) {
addTip('Watch out: these enemies hurt you if you try to jump on their heads.', 'normal');
}
}
v1.jump = true;
v1.ymove = -10;
if (checkHint(12)) {
addTip('Most (but not all!) enemies can be killed by jumping on their heads.', 'normal');
}
} else {
if (selectItem5 == 4 && v1.hero == 'thief' && v1.mana >= 5) {
v1.mana -= 5;
escapeThief(v1);
} else {
if (v1.hit == 0) {
loseHP(v1);
v2.top.body.arm.gotoAndPlay('attack_melee');
v2.cd_anim = 10;
}
}
}
}
}
} else {
if (v2.objclass == 'pickup') {
attachEffect(v2, 'fx_explosion');
if (v2.ptype == 'redpotion') {
floatWords(pchar, '+hp!');
snd_btn.start();
if (v1.hp < hpmax) {
v1.hp += 1;
}
} else {
if (v2.ptype == 'manapotion') {
snd_btn.start();
floatWords(v1, '+mana!');
v1.mana += 5;
if (selectItem2 == 6) {
v1.mana += 5;
}
if (v1.mana > pchar.maxMana) {
v1.mana = pchar.maxMana;
}
} else {
if (v2.ptype == 'goldcoins') {
if (selectItem5 == 6) {
floatWords(v1, '+3 gp!');
gold += 3;
v1.gold += 3;
} else {
floatWords(v1, '+1 gp!');
gold += 1;
v1.gold += 1;
}
snd_cash.start();
} else {
if (v2.ptype == 'gem_green') {
if (selectItem5 == 6) {
floatWords(v1, '+4 gp!');
gold += 4;
v1.gold += 4;
} else {
floatWords(v1, '+2 gp!');
gold += 2;
v1.gold += 2;
}
snd_cash.start();
} else {
if (v2.ptype == 'gem_blue') {
if (selectItem5 == 6) {
floatWords(v1, '+5 gp!');
gold += 5;
v1.gold += 5;
} else {
floatWords(v1, '+3 gp!');
gold += 3;
v1.gold += 3;
}
snd_cash.start();
} else {
if (v2.ptype == 'gem_red') {
if (selectItem5 == 6) {
floatWords(v1, '+7 gp!');
gold += 7;
v1.gold += 7;
} else {
floatWords(v1, '+5 gp!');
gold += 5;
v1.gold += 5;
}
snd_cash.start();
}
}
}
}
}
}
removeObject(v2);
}
}
}
}
}
}
}
}
}
}
++v9;
}
}
++v11;
}
}
prevOffset = dyOffset;
};
}
movieClip 1209 {
}
movieClip 1213 {
}
movieClip 1215 {
frame 1 {
stop();
}
}
// unknown tag 88 length 51
movieClip 1218 stage {
}
movieClip 1222 {
}
movieClip 1225 {
}
movieClip 1229 {
}
movieClip 1231 {
}
movieClip 1233 {
}
movieClip 1240 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
movieClip 1245 {
}
movieClip 1249 {
}
movieClip 1252 {
}
movieClip 1256 {
}
movieClip 1264 {
}
movieClip 1268 {
}
movieClip 1269 {
}
movieClip 1279 {
}
movieClip 1283 {
}
movieClip 1287 {
}
frame 11 {
stop();
targetDone.gotoAndStop(1);
if (heroDead) {
snd_badnews.start();
if (survivalMode) {
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);
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 += 1;
totalgold += gold;
_root.kongregateStats.submit('01_Level_Complete', 1);
if (gold >= targetGold) {
_root.kongregateStats.submit('02_Gold_Target', 1);
targetDone._visible = true;
if (twoPlayer) {
lives += 2;
targetDone.reward = '2 Extra Lives Awarded!';
} else {
if (!survivalMode) {
lives += 1;
targetDone.reward = 'Extra Life Awarded';
} else {
targetDone.reward = '25 Bonus Gold!';
totalgold += 25;
}
}
} else {
if (survivalMode) {
resulttxt = 'Not enough gold!';
targetDone.reward = 'You failed to reach the target!';
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 += 1;
targetDone.medal.gotoAndStop(2);
} else {
if (p2gold > p1gold) {
p2medals += 1;
targetDone.medal.gotoAndStop(3);
}
}
}
if (!survivalMode) {
if (cIcon != 2) {
keys += 1;
keyShow._visible = true;
keyShow.gotoAndStop(1);
} else {
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 <= 30) {
unlockMask(19);
} else {
if (seconds >= 120) {
unlockMask(20);
}
}
if (sameHero) {
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 += 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;
}
};
}
movieClip 1291 {
frame 1 {
stop();
if (_level0.sfxLevel == 3) {
gotoAndStop(2);
}
}
}
movieClip 1306 {
frame 1 {
stop();
}
}
movieClip 1307 {
frame 1 {
stop();
}
}
movieClip 1312 {
frame 1 {
stop();
}
}
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;
}
};
}
movieClip 1319 {
frame 1 {
stop();
if (_level0.sfxLevel == 3) {
gotoAndStop(2);
}
}
}
movieClip 1330 {
}
instance of movieClip 1330 {
onClipEvent (release) {
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = '__mochibot__';
mbc = 'mochibot.com';
g = _global ? _global : _level0._root;
if (g[mb + swfid]) {
return g[mb + swfid];
}
s = System.security;
x = mc._root.getSWFVersion;
fv = x ? mc.getSWFVersion() : (_global ? 6 : 5);
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == 'localWithFile') {
return null;
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = (fv == 5) ? /:$version : System.capabilities.version;
u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&swfid=' + escape(swfid) + '&l=' + lv + '&f=' + mc + (sb ? '&sb=' + sb : '') + (trk ? '&t=1' : '');
lv = fv > 6 ? mc.getNextHighestDepth() : (g[mb + 'level'] ? g[mb + 'level'] + 1 : lv);
g[mb + 'level'] = lv;
if (fv == 5) {
res = '_level' + lv;
if (!eval(res)) {
loadMovieNum(u, lv);
}
return res;
}
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
return res;
}
var vertDropHeroes_Click = '421f93f0';
getURL('http://www.ninjakiwi.com', '_blank');
__com_mochibot__(vertDropHeroes_Click, this, 10301, true);
}
}
frame 13 {
randTr = randbtwn(1, 30);
head.gotoAndStop(currentMask + 1);
watchDog = 0;
for (;;) {
if (!(trFound[randTr] && watchDog < 100)) break;
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 += 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 += lives * 100;
goldDisplay = mRn(totalgold) + ' gp';
gameComplete = true;
saveScore = true;
singleCompletion = true;
if (!twoPlayer) {
unlockMask(17);
winmsg = 'Your Hero married the Princess and they lived happily ever after!';
_root.kongregateStats.submit('05_Game_Won_Story', 1);
} else {
_root.kongregateStats.submit('06_Game_Won_2Player', 1);
if (p1medals > p2medals) {
body.attachMovie('b_001b', 'body', 10);
winmsg = 'Player 1 married the Princess and they lived happily ever after!';
} else {
body.attachMovie('b_001c', 'body', 10);
winmsg = 'Player 2 married the Princess and they lived happily ever after!';
}
}
_level0.onEnterFrame = function () {
if (Key.isDown(32)) {
if (!pds) {
pds = true;
if (unlockedMask) {
makeFade('medals');
} else {
makeFade('highscore');
}
}
} else {
pds = false;
}
};
}
instance of movieClip 1330 {
onClipEvent (release) {
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = '__mochibot__';
mbc = 'mochibot.com';
g = _global ? _global : _level0._root;
if (g[mb + swfid]) {
return g[mb + swfid];
}
s = System.security;
x = mc._root.getSWFVersion;
fv = x ? mc.getSWFVersion() : (_global ? 6 : 5);
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == 'localWithFile') {
return null;
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = (fv == 5) ? /:$version : System.capabilities.version;
u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&swfid=' + escape(swfid) + '&l=' + lv + '&f=' + mc + (sb ? '&sb=' + sb : '') + (trk ? '&t=1' : '');
lv = fv > 6 ? mc.getNextHighestDepth() : (g[mb + 'level'] ? g[mb + 'level'] + 1 : lv);
g[mb + 'level'] = lv;
if (fv == 5) {
res = '_level' + lv;
if (!eval(res)) {
loadMovieNum(u, lv);
}
return res;
}
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
return res;
}
var vertDropHeroes_Click = '421f93f0';
getURL('http://www.ninjakiwi.com', '_blank');
__com_mochibot__(vertDropHeroes_Click, this, 10301, true);
}
}
button 1350 {
on (release) {
if (_level0.unlockedMask) {
_level0.makeFade('medals');
} else {
_level0.makeFade('highscore');
}
}
}
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;
}
};
}
movieClip 1357 {
}
movieClip 1361 {
}
button 1362 {
on (release) {
_level0.makeFade('mainmenu');
}
}
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;
}
};
}
button 1374 {
on (release) {
_level0.makeFade('treasure');
}
}
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 v1 = medalx + (medaly - 1) * 5;
thisMedal._alpha = 100;
if (maskUnlocked[v1]) {
maskname = maskNames[v1];
maskdesc = maskDesc[v1];
} else {
maskname = '?? Locked ??';
maskdesc = maskDesc[v1];
}
} 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 += 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, without using other heroes.';
maskNames[7] = 'Red Headband';
maskDesc[7] = 'Complete a level as a Barbarian, without using other heroes.';
maskNames[8] = 'Leaf Headband';
maskDesc[8] = 'Complete a level as a Ranger, without using other heroes.';
maskNames[9] = 'Iron Helmet';
maskDesc[9] = 'Complete a level as a Paladin, without using other heroes.';
maskNames[10] = 'Thief Mask';
maskDesc[10] = 'Complete a level as a Thief, without using other heroes.';
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 30 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 -= 1;
}
refreshMedalSelect();
}
} else {
if (Key.isDown(40) || Key.isDown(83)) {
if (!pd4d) {
pd4d = true;
if (maskCurY < 5) {
maskCurY += 1;
}
refreshMedalSelect();
}
} else {
if (Key.isDown(39) || Key.isDown(68)) {
if (!pd4d) {
pd4d = true;
if (maskCurX < 5) {
maskCurX += 1;
}
refreshMedalSelect();
}
} else {
if (Key.isDown(37) || Key.isDown(65)) {
if (!pd4d) {
pd4d = true;
if (maskCurX > 1) {
maskCurX -= 1;
}
refreshMedalSelect();
}
} else {
pd4d = false;
}
}
}
}
if (Key.isDown(32)) {
if (!pds) {
pds = true;
var v1 = 1;
while (v1 <= 30) {
maskNew[v1] = false;
++v1;
}
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;
}
};
}
movieClip 1379 {
frame 1 {
stop();
}
}
button 1386 {
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');
}
}
}
frame 18 {
_level0.onEnterFrame = function () {
if (Key.isDown(32)) {
if (!pds) {
pds = true;
makeFade('mainmenu');
}
} else {
pds = false;
}
};
}
// unknown tag 88 length 79
movieClip 1394 {
}
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 -= 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 += 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 -= 1;
if (sfxLevel < 1) {
sfxLevel = 3;
}
} else {
if (optChoice == 2) {
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;
}
};
}
movieClip 1398 {
frame 1 {
stop();
}
}
instance optbox1 of movieClip 1398 {
onClipEvent (rollOver) {
_level0.optxt3 = 'Reset all Data';
_level0['optbox' + _level0.optChoice].gotoAndStop(1);
_level0.optChoice = 1;
_level0['optbox' + _level0.optChoice].gotoAndStop(2);
}
onClipEvent (release) {
_level0.sfxLevel -= 1;
if (_level0.sfxLevel < 1) {
_level0.sfxLevel = 3;
}
}
}
instance optbox2 of movieClip 1398 {
onClipEvent (rollOver) {
_level0.optxt3 = 'Reset all Data';
_level0['optbox' + _level0.optChoice].gotoAndStop(1);
_level0.optChoice = 2;
_level0['optbox' + _level0.optChoice].gotoAndStop(2);
}
onClipEvent (release) {
_level0.qualityLevel -= 1;
if (_level0.qualityLevel < 1) {
_level0.qualityLevel = 3;
}
}
}
instance optbox3 of movieClip 1398 {
onClipEvent (rollOver) {
_level0.optxt3 = 'Reset all Data';
_level0['optbox' + _level0.optChoice].gotoAndStop(1);
_level0.optChoice = 3;
_level0['optbox' + _level0.optChoice].gotoAndStop(2);
}
onClipEvent (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 optbox4 of movieClip 1398 {
onClipEvent (rollOver) {
_level0.optxt3 = 'Reset all Data';
_level0['optbox' + _level0.optChoice].gotoAndStop(1);
_level0.optChoice = 4;
_level0['optbox' + _level0.optChoice].gotoAndStop(2);
}
onClipEvent (release) {
_level0.makeFade('mainmenu');
}
}
frame 20 {
_level0.onEnterFrame = function () {
if (Key.isDown(32)) {
if (!pds) {
pds = true;
makeFade('faux_loading');
}
} else {
pds = false;
}
};
}
// unknown tag 88 length 70
button 1425 {
on (release) {
_level0.makeFade('faux_loading');
}
}
frame 21 {
_level0.onEnterFrame = function () {
if (Key.isDown(32)) {
if (!pds) {
pds = true;
makeFade('2playersetup');
}
} else {
pds = false;
}
};
}
button 1441 {
on (release) {
_level0.makeFade('2playersetup');
}
}
frame 22 {
function refreshAll2P() {
var v2 = 1;
while (v2 <= 2) {
var v1 = 0;
while (v1 <= 5) {
thisBox = _level0['box' + v2 + '' + v1];
thisInvBox = _level0['invbox' + v2];
thisBoxIndex = (v1 - 1) * 6 + _level0['p' + v2 + 'SelItem'][v1];
if (v1 == 0) {
thisBox.head.gotoAndStop(_level0['p' + v2 + 'Mask'] + 1);
} else {
thisBox.icon.gotoAndStop(thisBoxIndex);
if (_level0['p' + v2 + 'SelItem'][v1] == 7) {
thisBox.icon.gotoAndStop(32);
thisBoxIndex = 0;
}
}
if (v1 == _level0['p' + v2 + '_selection']) {
thisBox._alpha = 100;
thisInvBox._y = thisBox._y;
thisInvBox.title = trName[thisBoxIndex];
thisInvBox.desc = trDesc[thisBoxIndex];
} else {
thisBox._alpha = 50;
}
if (_level0['p' + v2 + '_selection'] == 0) {
thisInvBox._y = -200;
}
++v1;
}
++v2;
}
}
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 -= 1;
if (p1_selection < 0) {
p1_selection = 5;
}
refreshAll2P();
}
} else {
if (Key.isDown(40)) {
if (!pd4d) {
pd4d = true;
p1_selection += 1;
if (p1_selection > 5) {
p1_selection = 0;
}
refreshAll2P();
}
} else {
if (Key.isDown(39)) {
if (!pd4d) {
pd4d = true;
var v1 = slide['row' + activeRow];
if (p1_selection == 0) {
p1Mask += 1;
if (p1Mask > 25) {
p1Mask = 0;
}
} else {
p1SelItem[p1_selection] += 1;
if (p1SelItem[p1_selection] > 7) {
p1SelItem[p1_selection] = 1;
}
}
refreshAll2P();
}
} else {
if (Key.isDown(37)) {
if (!pd4d) {
pd4d = true;
var v1 = slide['row' + activeRow];
if (p1_selection == 0) {
p1Mask -= 1;
if (p1Mask < 0) {
p1Mask = 25;
}
} else {
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 -= 1;
if (p2_selection < 0) {
p2_selection = 5;
}
refreshAll2P();
}
} else {
if (Key.isDown(83)) {
if (!pd4db) {
pd4db = true;
p2_selection += 1;
if (p2_selection > 5) {
p2_selection = 0;
}
refreshAll2P();
}
} else {
if (Key.isDown(68)) {
if (!pd4db) {
pd4db = true;
var v1 = slide['row' + activeRow];
if (p2_selection == 0) {
p2Mask += 1;
if (p2Mask > 25) {
p2Mask = 0;
}
} else {
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 -= 1;
if (p2Mask < 0) {
p2Mask = 25;
}
} else {
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();
}
};
}
movieClip 1458 {
}
movieClip 1460 {
}
movieClip 1462 {
}
movieClip 1463 {
}
movieClip 1464 {
}
movieClip 1465 {
}
movieClip 1468 {
}
movieClip 1470 {
}
movieClip 1472 {
}
movieClip 1474 {
}
movieClip 1476 {
}
movieClip 1478 {
}
movieClip 1480 {
}
movieClip 1482 {
}
movieClip 1485 {
}