Frame 1
function loadFin() {
gotoAndStop ("game");
}
stop();
loader.onEnterFrame = function () {
var _local3 = this._parent.getBytesLoaded();
var _local2 = this._parent.getBytesTotal();
if ((_local2 > 0) && (_local2 == _local3)) {
this._parent.loadFin();
} else {
this.loadAmount.htmlText = ("" + Math.floor((100 / _local2) * _local3)) + "%\n of\n433k";
}
};
Frame 4
gotoAndStop (1);
Frame 32
function Point(x, y) {
this.x = x;
this.y = y;
}
function beginWipe() {
wipeOver._visible = true;
wipeOver.func = showStart;
wipeOver.gotoAndPlay(2);
delete startScreen.backButton.onRelease;
if (sfxOn) {
var _local1 = new Sound();
_local1.attachSound("_lwhoosh");
_local1.start();
}
}
function showStart() {
startScreen.gotoAndStop("startScreen");
startScreen._visible = true;
charStats._visible = false;
shop._visible = false;
options._visible = false;
gameover._visible = false;
wipeOver._visible = false;
startScreen.startButton.onRelease = startWipe;
startScreen.controls.onRelease = controlsWipe;
startScreen.credits.onRelease = creditsWipe;
startScreen.options.onRelease = optionsWipe;
}
function startWipe() {
wipeOver._visible = true;
wipeOver.func = startGame;
wipeOver.gotoAndPlay(2);
delete startScreen.startButton.onRelease;
delete startScreen.controls.onRelease;
delete startScreen.credits.onRelease;
if (sfxOn) {
var _local1 = new Sound();
_local1.attachSound("_lwhoosh");
_local1.start();
}
}
function creditsWipe() {
wipeOver._visible = true;
wipeOver.func = showCredits;
wipeOver.gotoAndPlay(2);
delete startScreen.startButton.onRelease;
delete startScreen.controls.onRelease;
delete startScreen.credits.onRelease;
delete startScreen.options.onRelease;
if (sfxOn) {
var _local1 = new Sound();
_local1.attachSound("_lwhoosh");
_local1.start();
}
}
function showCredits() {
startScreen.gotoAndStop("creditsScreen");
startScreen.backButton.onRelease = beginWipe;
}
function controlsWipe() {
wipeOver._visible = true;
wipeOver.func = showControls;
wipeOver.gotoAndPlay(2);
delete startScreen.startButton.onRelease;
delete startScreen.controls.onRelease;
delete startScreen.credits.onRelease;
delete startScreen.options.onRelease;
if (sfxOn) {
var _local1 = new Sound();
_local1.attachSound("_lwhoosh");
_local1.start();
}
}
function showControls() {
startScreen.gotoAndStop("controlsScreen");
startScreen.backButton.onRelease = beginWipe;
}
function optionsWipe() {
wipeOver._visible = true;
wipeOver.func = showOptions;
wipeOver.gotoAndPlay(2);
delete startScreen.startButton.onRelease;
delete startScreen.controls.onRelease;
delete startScreen.credits.onRelease;
delete startScreen.options.onRelease;
if (sfxOn) {
var _local1 = new Sound();
_local1.attachSound("_lwhoosh");
_local1.start();
}
}
function showOptions() {
startScreen.gotoAndStop("optionsScreen");
startScreen.backButton.onRelease = beginWipe;
}
function startGame() {
startScreen._visible = false;
crossHair._visible = true;
level = 1;
makeLevel(level);
row = Math.floor(Math.random() * sSize);
collumn = Math.floor(Math.random() * sSize);
inGame = true;
p = new Player();
var _local1 = {num:4};
var _local3 = new Room(level, row, collumn, true, _local1);
gui.options.onRelease = pauseGame;
canPause = true;
paused = false;
}
function gameOver() {
crossHair._visible = false;
inGame = false;
delete theScreen.onEnterFrame;
gameover._visible = true;
gameover.gotoAndPlay(2);
var _local1 = 0;
while (_local1 < 5) {
delete gui["weaponButton" + _local1].onRelease;
_local1++;
}
delete gui.options.onRelease;
themeSounds[0].stop();
if (sfxOn) {
var _local2 = new Sound();
_local2.attachSound("_lgameover");
_local2.start();
}
}
function quitGame() {
options._visible = false;
gameOver();
}
function makeLevel(lev) {
roomsDone = 0;
sNum = 0;
sSize = 10;
mapRow = new Array();
var _local1 = 0;
while (_local1 < sSize) {
mapRow[_local1] = new Array();
_local1++;
}
soundSetup();
}
function pauseGame() {
if (canPause && (inGame)) {
if (sfxOn) {
var _local2 = new Sound();
_local2.attachSound("_lclick1");
_local2.start();
}
if (!paused) {
delete theScreen.onEnterFrame;
theScreen._visible = false;
paused = true;
options._visible = true;
var _local1 = 0;
while (_local1 < 5) {
delete gui["weaponButton" + _local1].onRelease;
_local1++;
}
} else {
removeMap();
paused = false;
options._visible = false;
charStats._visible = false;
theScreen._visible = true;
theScreen.onEnterFrame = detectKeys;
p.changeAmmo();
}
}
}
function finishExit() {
theScreen.removeMovieClip();
showShop();
}
function nextLevel() {
level++;
makeLevel(level);
var _local1 = {num:4};
row = Math.floor(Math.random() * sSize);
collumn = Math.floor(Math.random() * sSize);
var _local3 = new Room(level, row, collumn, true, _local1);
}
function endPopulate() {
populateStats();
charStats.back._visible = false;
charStats.cont._visible = true;
charStats.cont.onRelease = beginWipe;
theScreen.removeMovieClip();
Mouse.show();
}
function populateStats() {
charStats.cont._visible = false;
charStats._visible = true;
charStats.title.text = names[Math.floor(score / pointsSpace)];
charStats.lev.text = "Level - " + level;
charStats.mon.text = "Money - " + money;
charStats.points.text = "Points - " + score;
charStats.health.text = (("Health - " + p.hp) + "/") + p.maxhp;
charStats.arm.text = (("Armour - " + p.armour) + "/") + p.maxArmour;
charStats.speed.text = "Speed - " + (p.speedLevel + 1);
var _local1 = 0;
while (_local1 < 5) {
charStats["wLev" + _local1].text = p.weapons[_local1] + 1;
charStats["wAmmo" + _local1].text = p.ammo[_local1];
_local1++;
}
}
function Enemy() {
this.init(arguments);
}
function Zombie() {
this.hitSound = "_lhitSound1";
this.clipName = "Zombie";
this.givePowerUp = false;
this.rad = 11;
this.myFunction = headTowards;
this.hpFactor = 1;
this.hpBase = 8;
this.score = 10;
this.speed = 3;
this.stayDist = this.speed;
this.hitDamage = 5;
this.wussiness = 10;
this.init(arguments[0], arguments[1], arguments[2], arguments[3]);
}
function Soldier() {
this.hitSound = "_lsoldierHit";
this.clipName = "Soldier";
this.givePowerUp = false;
this.rad = 11;
this.myFunction = headTowardsAndShoot;
this.hpFactor = 1;
this.hpBase = 5;
this.score = 12;
this.speed = 2;
this.stayDist = 60;
this.hitDamage = 4;
this.wussiness = 5;
this.shotType = [0];
this.shotPower = [5];
this.shootTime = 30;
this.shotFunc = singleAtPlayer;
this.init(arguments[0], arguments[1], arguments[2], arguments[3]);
}
function Demon() {
this.hitSound = "_lhitSound1";
this.clipName = "Zombie";
this.givePowerUp = false;
this.rad = 11;
this.myFunction = headTowardsAndShoot;
this.hpFactor = 2;
this.hpBase = 10;
this.score = 24;
this.speed = 3;
this.stayDist = this.speed;
this.hitDamage = 5;
this.wussiness = 10;
this.shotType = [0];
this.shotPower = [8];
this.shootTime = 60;
this.shotFunc = singleAtPlayer;
this.init(arguments[0], arguments[1], arguments[2], arguments[3]);
}
function Sludgeman() {
this.hitSound = "_lhitSound1";
this.clipName = "Sludgeman";
this.givePowerUp = false;
this.rad = 11;
this.myFunction = headTowardsAndShoot;
this.hpFactor = 3;
this.hpBase = 12;
this.score = 24;
this.speed = 2;
this.stayDist = this.speed;
this.hitDamage = 5;
this.wussiness = 10;
this.shotType = [2];
this.shotPower = [4];
this.shootTime = 60;
this.shotFunc = singleAtPlayer;
this.init(arguments[0], arguments[1], arguments[2], arguments[3]);
}
function Boss0() {
this.moveUp = true;
this.moveCount = 0;
this.hitSound = "_lclick1";
this.clipName = "Boss0";
this.givePowerUp = true;
this.rad = 25;
this.myFunction = boss0Move;
this.hpFactor = 20;
this.hpBase = 100;
this.score = 120;
this.speed = 2;
this.hitDamage = 8;
this.wussiness = 10;
this.shotType = [0, 3];
this.shotPower = [10, 40];
this.shootTime = 30;
this.shotFunc = [singleAtPlayer, rocketShot];
this.isBoss = true;
this.init(arguments[0], arguments[1], arguments[2], arguments[3]);
}
function Boss1() {
this.moveUp = true;
this.moveCount = 0;
this.hitSound = "_lhitSound1";
this.clipName = "Boss1";
this.givePowerUp = true;
this.rad = 25;
this.myFunction = boss1Move;
this.hpFactor = 20;
this.hpBase = 100;
this.score = 120;
this.speed = 2;
this.hitDamage = 8;
this.wussiness = 10;
this.shotType = [0, 3];
this.shotPower = [10, 40];
this.shootTime = 30;
this.shotFunc = [singleAtPlayer, rocketShot];
this.isBoss = true;
this.init(arguments[0], arguments[1], arguments[2], arguments[3]);
}
function walkTile(slow) {
this.walkable = true;
this.shootThrough = true;
this.walkFunction = null;
this.damage = 0;
this.shootFunction = null;
this.hp = 0;
this.efFunction = null;
this.speedFactor = slow;
this.initFunc = null;
this.freeTile = true;
}
function permWall(shootThrough) {
this.walkable = false;
this.shootThrough = shootThrough;
this.walkFunction = null;
this.damage = 0;
this.shootFunction = null;
this.hp = 0;
this.efFunction = null;
this.speedFactor = 0;
this.initFunc = null;
}
function walkDamageTile(dam, slow) {
this.walkable = true;
this.shootThrough = true;
this.walkFunction = null;
this.damage = dam;
this.shootFunction = null;
this.hp = 0;
this.efFunction = damagePlayer;
this.speedFactor = slow;
this.initFunc = null;
}
function destroyableTile(hp, destroyFunction, destroyedTile) {
this.walkable = false;
this.shootThrough = false;
this.walkFunction = null;
this.damage = 0;
this.shootFunction = destroyable;
this.hp = hp;
this.efFunction = null;
this.speedFactor = 0;
this.destroyFunction = changeTile;
this.destroyedTile = destroyedTile;
this.initFunc = null;
}
function laserFence(tileNum) {
this.walkable = true;
this.shootThrough = true;
this.walkFunction = null;
this.damage = 50;
this.shootFunction = null;
this.hp = 0;
this.efFunction = damagePlayer;
this.speedFactor = 0.5;
this.laserFence = true;
this.initFunc = null;
this.destroyedTile = tileNum;
this.destroyFunction = changeTile;
}
function laserFenceGenerator(destroyedTile) {
this.walkable = false;
this.shootThrough = false;
this.walkFunction = null;
this.damage = 0;
this.shootFunction = destroyable;
this.hp = 10;
this.efFunction = null;
this.speedFactor = 0;
this.destroyFunction = destroyLaserFence;
this.destroyedTile = destroyedTile;
this.initFunc = laserFenceGenSetUp;
this.num = null;
}
function walkSwitch(num) {
this.walkable = true;
this.shootThrough = true;
this.walkFunction = toggleTiles;
this.damage = 0;
this.shootFunction = null;
this.hp = 0;
this.efFunction = null;
this.speedFactor = 1;
this.destroyFunction = null;
this.initFunc = associateTiles;
this.num = num;
}
function switchTile(num, onTile, offTile) {
this.num = num;
this.onTile = onTile;
this.offTile = offTile;
this.state = "on";
var _local2 = tileDesc[onTile];
this.walkable = _local2.walkable;
this.shootThrough = _local2.shootThrough;
this.walkFunction = _local2.walkFunction;
this.damage = _local2.damage;
this.shootFunction = _local2.shootFunction;
this.hp = _local2.hp;
this.efFunction = _local2.efFunction;
this.speedFactor = _local2.speedFactor;
this.destroyFunction = null;
this.initFunc = switchedTiles;
}
function switchTile(num, onTile, offTile) {
this.num = num;
this.onTile = onTile;
this.offTile = offTile;
this.state = "on";
var _local2 = tileDesc[onTile];
this.walkable = _local2.walkable;
this.shootThrough = _local2.shootThrough;
this.walkFunction = _local2.walkFunction;
this.damage = _local2.damage;
this.shootFunction = _local2.shootFunction;
this.hp = _local2.hp;
this.efFunction = _local2.efFunction;
this.speedFactor = _local2.speedFactor;
this.destroyFunction = null;
this.initFunc = switchedTiles;
}
function monsterSpawners(monsterType, hp) {
this.walkable = false;
this.shootThrough = false;
this.walkFunction = null;
this.damage = 0;
this.shootFunction = destroyable;
this.hp = hp;
this.efFunction = spawnMonsters;
this.speedFactor = 0;
this.destroyFunction = null;
this.initFunc = monsterSpawn;
this.num = monsterType;
this.monsterType = monsterTypes[monsterType];
this.spawnInterval = 60;
if (hp == 20) {
this.destroyedTile = 152;
} else {
this.destroyedTile = 143;
}
this.destroyFunction = destroyMonsterSpawner;
}
function tileWalkFunction(walkFunction, initFunction) {
this.walkable = true;
this.shootThrough = true;
this.walkFunction = walkFunction;
this.damage = 0;
this.shootFunction = null;
this.hp = 0;
this.efFunction = null;
this.speedFactor = 1;
this.initFunc = initFunction;
}
function doorTile(walkFunction, num) {
this.onTile = num;
this.offTile = num + 10;
this.walkable = true;
this.shootThrough = true;
this.walkFunction = walkFunction;
this.damage = 0;
this.shootFunction = null;
this.hp = 0;
this.efFunction = null;
this.speedFactor = 1;
this.initFunc = null;
}
function ccTile(num, statesArray, compFunction) {
this.num = num;
this.statesArray = statesArray;
this.walkable = true;
this.shootThrough = true;
this.walkFunction = cChange;
this.damage = 0;
this.shootFunction = null;
this.hp = 0;
this.efFunction = null;
this.speedFactor = 1;
this.initFunc = cChangeInit;
this.compFunction = compFunction;
}
function specialSpawner(num) {
this.walkable = true;
this.shootThrough = true;
this.walkFunction = null;
this.damage = 0;
this.shootFunction = null;
this.hp = 0;
this.efFunction = null;
this.speedFactor = 1;
this.destroyFunction = null;
this.destroyedTile = null;
this.initFunc = makeSpecial;
this.num = num;
}
function rBarrierTile(onTile, offTile) {
this.onTile = onTile;
this.offTile = offTile;
this.state = "on";
var _local2 = tileDesc[onTile];
this.walkable = _local2.walkable;
this.shootThrough = _local2.shootThrough;
this.walkFunction = _local2.walkFunction;
this.damage = _local2.damage;
this.shootFunction = _local2.shootFunction;
this.hp = _local2.hp;
this.efFunction = _local2.efFunction;
this.speedFactor = _local2.speedFactor;
this.destroyFunction = null;
this.initFunc = barrierAssoc;
}
function specialSpawner(num) {
this.walkable = true;
this.shootThrough = true;
this.walkFunction = null;
this.damage = 0;
this.shootFunction = null;
this.hp = 0;
this.efFunction = null;
this.speedFactor = 1;
this.destroyFunction = null;
this.destroyedTile = null;
this.initFunc = makeSpecial;
this.num = num;
}
function bossSpawner(num) {
this.walkable = true;
this.shootThrough = true;
this.walkFunction = null;
this.damage = 0;
this.shootFunction = null;
this.hp = 0;
this.efFunction = null;
this.speedFactor = 1;
this.destroyFunction = null;
this.destroyedTile = null;
this.initFunc = spawnBoss;
this.num = num;
}
function Sprite() {
}
function getAngle(x1, y1, x2, y2) {
return(Math.atan2(y2 - y1, x2 - x1) / PiRads);
}
function getMyCorners(x, y, ob) {
downY = Math.floor(((y + ob.rad) - 1) / tileH);
upY = Math.floor((y - ob.rad) / tileH);
leftX = Math.floor((x - ob.rad) / tileW);
rightX = Math.floor(((x + ob.rad) - 1) / tileW);
ob.upleft = currentRoom.tiles[upY][leftX].walkable;
ob.downleft = currentRoom.tiles[downY][leftX].walkable;
ob.upright = currentRoom.tiles[upY][rightX].walkable;
ob.downright = currentRoom.tiles[downY][rightX].walkable;
}
function enemyBrain() {
if (count > 15) {
for (var _local1 in currentRoom.currentEnemies) {
currentRoom.currentEnemies[_local1].myFunction();
}
}
}
function moveBullets() {
for (var _local8 in currentRoom.bullets) {
var _local1 = currentRoom.bullets[_local8];
var _local5 = _local1.getTile();
if (_local5.shootThrough) {
_local1.mc._x = (_local1.x = _local1.x + _local1.dirx);
_local1.mc._y = (_local1.y = _local1.y + _local1.diry);
if (_local1.pShot) {
for (var _local7 in currentRoom.currentEnemies) {
var _local2 = currentRoom.currentEnemies[_local7];
var _local4 = _local1.x - _local2.x;
var _local3 = _local1.y - _local2.y;
if (Math.sqrt((_local4 * _local4) + (_local3 * _local3)) < _local2.rad) {
_local2.hurtMe(_local1.power);
if (!_local1.shootThrough) {
_local1.mc.gotoAndPlay("explode");
if (_local1.splashDamage) {
_local1.doSplashDamge();
}
if (sfxOn) {
var _local6 = new Sound();
_local6.attachSound(_local1.explodeSound);
_local6.start();
}
delete currentRoom.bullets[_local8];
}
}
}
} else {
var _local4 = _local1.x - p.x;
var _local3 = _local1.y - p.y;
if (Math.sqrt((_local4 * _local4) + (_local3 * _local3)) < p.rad) {
_local1.mc.gotoAndPlay("explode");
if (_local1.splashDamage) {
_local1.doSplashDamge();
}
p.hurtMe(_local1.power);
_local1.mc.gotoAndPlay("explode");
delete currentRoom.bullets[_local8];
}
}
} else {
_local1.mc.gotoAndPlay("explode");
if (_local1.splashDamage) {
_local1.doSplashDamge();
}
if (_local5.shootFunction != null) {
_local5.shootFunction(_local1.power);
}
if (sfxOn) {
var _local6 = new Sound();
_local6.attachSound(_local1.explodeSound);
_local6.start();
}
delete currentRoom.bullets[_local8];
}
}
for (var _local8 in currentRoom.mines) {
var _local1 = currentRoom.mines[_local8];
for (var _local7 in currentRoom.currentEnemies) {
var _local2 = currentRoom.currentEnemies[_local7];
var _local4 = _local1.x - _local2.x;
var _local3 = _local1.y - _local2.y;
if (Math.sqrt((_local4 * _local4) + (_local3 * _local3)) < (5 + _local2.rad)) {
_local1.mc.gotoAndPlay("explode");
if (_local1.splashDamage) {
_local1.doSplashDamge();
}
_local2.hurtMe(_local1.power);
_local1.mc.gotoAndPlay("explode");
delete currentRoom.mines[_local8];
}
}
}
}
function tileFunction() {
for (i in currentRoom.efTiles) {
currentRoom.efTiles[i].efFunction();
}
}
function detectKeys() {
var _local6 = p;
var _local5 = false;
var _local4 = p.getAngle(_xmouse - roomX, _ymouse - roomY);
p.mc._rotation = (p.angle = _local4 - 90);
var _local3 = 0;
var _local2 = 0;
if (Key.isDown(39) || (Key.isDown(68))) {
_local3++;
}
if (Key.isDown(37) || (Key.isDown(65))) {
_local3--;
}
if (Key.isDown(38) || (Key.isDown(87))) {
_local2--;
}
if (Key.isDown(40) || (Key.isDown(83))) {
_local2++;
}
if ((_local3 != 0) || (_local2 != 0)) {
p.moveChar(_local3, _local2);
p.mc.mc.walk.play();
_local5 = true;
} else {
p.mc.mc.walk.stop();
}
if ((_xmouse < (roomX + 375)) && (_ymouse < (roomY + 375))) {
Mouse.hide();
crossHair._x = _xmouse;
crossHair._y = _ymouse;
} else {
Mouse.show();
}
_root.enemyBrain();
_root.moveBullets();
_root.tileFunction();
count++;
}
function headTowards() {
if (this.free) {
var _local3 = 0;
var _local4 = 0;
var _local2 = this.speed;
if (this.gotoP) {
this.xTo = p.x;
this.yTo = p.y;
}
if (this.x < (this.xTo - _local2)) {
_local3 = 1;
} else if (this.x > (this.xTo + _local2)) {
_local3 = -1;
}
if (this.y < (this.yTo - _local2)) {
_local4 = 1;
} else if (this.y > (this.yTo + _local2)) {
_local4 = -1;
}
this.mc._rotation = this.moveChar(_local3, _local4);
if ((!this.moving) && (this.gotoP)) {
this.budgetPF(_local3, _local4);
}
if (!this.gotoP) {
if (((this.gotoCount++) > 20) || (this.currentTile == this.gotoTile)) {
this.gotoP = true;
}
}
}
}
function headTowardsAndShoot() {
if (this.free) {
if (!this.shooting) {
var _local3 = 0;
var _local4 = 0;
var _local2 = this.stayDist;
if (this.gotoP) {
this.xTo = p.x;
this.yTo = p.y;
}
if (this.x < (this.xTo - _local2)) {
_local3 = 1;
} else if (this.x > (this.xTo + _local2)) {
_local3 = -1;
}
if (this.y < (this.yTo - _local2)) {
_local4 = 1;
} else if (this.y > (this.yTo + _local2)) {
_local4 = -1;
}
this.mc._rotation = this.moveChar(_local3, _local4);
if ((!this.moving) && (this.gotoP)) {
this.budgetPF(_local3, _local4);
}
if (!this.gotoP) {
if (((this.gotoCount++) > 20) || (this.currentTile == this.gotoTile)) {
this.gotoP = true;
}
}
if ((this.shootCounter++) > this.shootTime) {
this.shootCounter = Math.floor(Math.random() * this.shootTime);
this.shotFunc();
this.mc._rotation = this.getAngle(p.x, p.y) + 90;
this.shooting = true;
this.shootWait = 0;
}
} else if ((this.shootWait++) > 10) {
this.shooting = false;
}
}
}
function boss0Move() {
if (this.free) {
if (!this.shooting) {
var _local3 = 0;
var _local2 = 0;
if (!this.moveUp) {
if (((this.moveCount--) < 0) || (this.y < (this.rad + 35))) {
this.moveUp = true;
this.moveCount = Math.random() * 40;
} else {
_local2 = -1;
}
} else if (((this.moveCount--) < 0) || (this.y > (340 - this.rad))) {
this.moveUp = false;
this.moveCount = Math.random() * 40;
} else {
_local2 = 1;
}
this.moveChar(_local3, _local2);
this.mc.mc.turret._rotation = this.getAngle(p.x, p.y) - 90;
if ((this.shootCounter++) > this.shootTime) {
this.mc.mc.turret.gotoAndPlay("shoot");
this.shootCounter = Math.floor(Math.random() * this.shootTime);
if (Math.random() > 0.2) {
this.doShot("atPlayer", 0);
} else {
this.doShot("atPlayer", 1);
}
this.shooting = true;
this.shootWait = 0;
}
} else if ((this.shootWait++) > 10) {
this.shooting = false;
}
}
}
function boss1Move() {
if (this.free) {
if (!this.shooting) {
var _local3 = 0;
var _local2 = 0;
if (!this.moveUp) {
if (((this.moveCount--) < 0) || (this.x < (this.rad + 35))) {
this.moveUp = true;
this.moveCount = Math.random() * 40;
} else {
_local3 = -1;
}
} else if (((this.moveCount--) < 0) || (this.x > (340 - this.rad))) {
this.moveUp = false;
this.moveCount = Math.random() * 40;
} else {
_local3 = 1;
}
this.moveChar(_local3, _local2);
this.mc.mc.turret._rotation = this.getAngle(p.x, p.y) - 90;
if ((this.shootCounter++) > this.shootTime) {
this.mc.mc.turret.gotoAndPlay("shoot");
this.shootCounter = Math.floor(Math.random() * this.shootTime);
if (Math.random() > 0.2) {
this.doShot("atPlayer", 0);
} else {
this.doShot("atPlayer", 1);
}
this.shooting = true;
this.shootWait = 0;
}
} else if ((this.shootWait++) > 10) {
this.shooting = false;
}
}
}
function specialEF() {
var _local6 = this.x - p.x;
var _local5 = this.y - p.y;
if (Math.sqrt((_local6 * _local6) + (_local5 * _local5)) < ((p.rad + this.rad) + 5)) {
currentRoom.specialGot = true;
if (sfxOn) {
var _local3 = new Sound();
_local3.attachSound("_lscale");
_local3.start();
}
this.mc.gotoAndPlay("got");
var _local2 = theScreen.attachMovie("_linfo", "inf" + exNum, explosionsDepth + exNum);
_local2._x = this.x;
_local2._y = this.y;
if ((++exNum) > 50) {
exNum = 0;
}
switch (this.pType) {
case 0 :
var _local4 = 100 * level;
_local2.txt.txt0.htmlText = (_local2.txt.txt1.htmlText = "POINTS\n+" + _local4);
score = score + _local4;
break;
case 1 :
_local4 = 100 * level;
_local2.txt.txt0.htmlText = (_local2.txt.txt1.htmlText = "MONEY\n+$" + _local4);
money = money + _local4;
break;
case 2 :
_local2.txt.txt0.htmlText = (_local2.txt.txt1.htmlText = "HEALTH\nBONUS");
p.maxhp = p.maxhp + upgrades[0].increment;
p.hp = p.maxhp;
upgrades[0].timesBought++;
p.doHealth();
break;
case 3 :
_local2.txt.txt0.htmlText = (_local2.txt.txt1.htmlText = "ARMOUR\nBONUS");
p.maxArmour = p.maxArmour + upgrades[1].increment;
p.armour = p.maxArmour;
upgrades[1].timesBought++;
p.doArmour();
break;
case 4 :
_local2.txt.txt0.htmlText = (_local2.txt.txt1.htmlText = "SPEED\nUPGRADE");
p.speedLevel = p.speedLevel + upgrades[2].increment;
p.speed = p.speed + p.speedInc;
upgrades[2].timesBought++;
break;
case 5 :
_local2.txt.txt0.htmlText = (_local2.txt.txt1.htmlText = "AMMO\nBONUS");
p.ammo[1] = p.ammo[1] + 20;
p.ammo[2] = p.ammo[2] + 20;
p.ammo[3] = p.ammo[3] + 4;
p.ammo[4] = p.ammo[4] + 5;
p.changeAmmo();
}
delete currentRoom.currentEnemies[this.num];
}
}
function rocketShot() {
this.doShot("atPlayer", 1);
}
function singleAtPlayer() {
this.doShot("atPlayer", 0);
}
function Shot(shotType, x, y, power, angle, pShot) {
var _local2 = shotBehaviours[shotType];
if (pShot) {
this.mc = theScreen.attachMovie("_l" + _local2.clipName, "shot" + n, shotDepth + n);
} else {
this.mc = theScreen.attachMovie("_l" + _local2.clipName, "shot" + n, shotDepth + n);
}
this.pShot = pShot;
this.id = "shot" + n;
n++;
currentRoom.bullets[this.id] = this;
this.shotType = shotType;
this.hittable = true;
this.mc._rotation = angle;
this.mc.myObject = this;
this.shootThrough = _local2.shootThrough;
this.splashDamage = _local2.splashDamage;
this.splashRadius = _local2.splashRadius;
this.explodeSound = _local2.explodeSound;
var _local3 = _local2.speed;
this.power = power;
this.dirx = _local3 * Math.cos(angle * PiRads);
this.diry = _local3 * Math.sin(angle * PiRads);
this.mc._x = (this.x = x + (_local2.startDist * this.dirx));
this.mc._y = (this.y = y + (_local2.startDist * this.diry));
if (shotType == 4) {
this.mc.swapDepths(minesDepth + (minesD++));
this.mc._rotation = 0;
if (minesD > 299) {
minesD = 0;
}
currentRoom.mines[this.id] = this;
} else {
currentRoom.bullets[this.id] = this;
}
}
function playerShoot() {
if ((count - p.lastShot) > p.cooldown) {
p.lastShot = count;
p.doShot();
}
}
function shotDescObj(power, angle) {
this.power = power;
this.angle = angle;
}
function sqrShotObj() {
this.soundN = "_lshotSound0";
this.explodeSound = "_lexplosion1";
this.startDist = 2;
this.cost = 100;
this.ammoCost = 10;
this.shootThrough = false;
this.coolDown = 7;
this.speed = 7;
this.clipName = "bullet";
this.splashDamage = false;
this.levels = new Array();
var _local2 = 0;
while (_local2 < 9) {
this.levels[_local2] = new Array();
this.levels[_local2].push(new shotDescObj((_local2 * 4) + 9, -2));
this.levels[_local2].push(new shotDescObj((_local2 * 4) + 9, 2));
_local2++;
}
_local2 = 9;
while (_local2 < 18) {
this.levels[_local2] = new Array();
this.levels[_local2].push(new shotDescObj((_local2 * 4) + 9, -3));
this.levels[_local2].push(new shotDescObj((_local2 * 4) + 9, 3));
this.levels[_local2].push(new shotDescObj((_local2 * 4) + 9, 0));
_local2++;
}
_local2 = 18;
while (_local2 < 20) {
this.levels[_local2] = new Array();
this.levels[_local2].push(new shotDescObj((_local2 * 4) + 9, -3));
this.levels[_local2].push(new shotDescObj((_local2 * 4) + 9, 1));
this.levels[_local2].push(new shotDescObj((_local2 * 4) + 9, -1));
this.levels[_local2].push(new shotDescObj((_local2 * 4) + 9, 3));
_local2++;
}
}
function defShotObj() {
this.soundN = "_lshotSound0";
this.explodeSound = "_lexplosion1";
this.startDist = 2;
this.cost = 50;
this.shootThrough = false;
this.coolDown = 7;
this.speed = 8;
this.clipName = "bullet";
this.splashDamage = false;
this.levels = new Array();
var _local2 = 0;
while (_local2 < 20) {
this.levels[_local2] = new Array();
this.levels[_local2].push(new shotDescObj((_local2 * 5) + 9, 0));
_local2++;
}
}
function plasmaObj() {
this.soundN = "_lplasmaEx";
this.explodeSound = "_lphaser";
this.startDist = 2;
this.cost = 50;
this.shootThrough = true;
this.coolDown = 7;
this.speed = 7;
this.clipName = "plasma";
this.splashDamage = false;
this.levels = new Array();
var _local2 = 0;
while (_local2 < 20) {
this.levels[_local2] = new Array();
this.levels[_local2].push(new shotDescObj((_local2 * 4) + 6, 0));
_local2++;
}
}
function mineObj() {
this.soundN = "_lclick";
this.explodeSound = "_lexplosion0";
this.startDist = 2;
this.cost = 50;
this.ammoCost = 50;
this.shootThrough = false;
this.coolDown = 12;
this.speed = 0;
this.clipName = "mine";
this.splashDamage = true;
this.splashRadius = 65;
this.levels = new Array();
var _local2 = 0;
while (_local2 < 20) {
this.levels[_local2] = new Array();
this.levels[_local2].push(new shotDescObj((_local2 * 15) + 30, 0));
_local2++;
}
}
function missileObj() {
this.soundN = "_lshotSound3";
this.explodeSound = "_lexplosion0";
this.startDist = 5;
this.cost = 50;
this.ammoCost = 100;
this.shootThrough = false;
this.coolDown = 24;
this.speed = 7;
this.clipName = "missile";
this.splashDamage = true;
this.splashRadius = 40;
this.levels = new Array();
var _local2 = 0;
while (_local2 < 20) {
this.levels[_local2] = new Array();
this.levels[_local2].push(new shotDescObj((_local2 * 12) + 20, 0));
_local2++;
}
}
function chooseWeapon() {
if (sfxOn) {
var _local2 = new Sound();
_local2.attachSound("_lchangeWeapon");
_local2.start();
}
p.shotType = this.num;
p.changeAmmo();
}
function Player() {
this.width = 8;
this.height = 8;
this.rad = 9;
this.speed = 4;
this.speedLevel = 0;
this.speedInc = 0.1;
this.shotType = 0;
this.weaponLevel = 0;
this.cooldown = 7;
this.xDispl = 5;
this.yDispl = 8;
this.maxArmour = 100;
this.armour = this.maxArmour;
this.maxhp = 200;
this.hp = this.maxhp;
this.weapons = [0, 0, 0, 0, 0, 0, 0];
this.ammo = [999, 30, 30, 2, 5, 0, 0];
score = 0;
money = 0;
}
function Powerup(x, y, type) {
this.num = enemyD++;
currentRoom.currentEnemies[this.num] = this;
this.mc = theScreen.attachMovie("_lpowerup", "enemy" + num, enemyDepth + this.num);
this.mc.mc.gotoAndStop(type + 1);
this.pType = type;
this.mc.myObject = this;
this.xTile = x;
this.yTile = y;
this.powerup = true;
this.currentTile = currentRoom.tiles[y][x];
this.x = (this.xTile * tileW) + (tileW / 2);
this.y = (this.yTile * tileH) + (tileH / 2);
this.mc._x = this.x;
this.mc._y = this.y;
this.hittable = true;
this.rad = 3;
this.myFunction = specialEF;
}
function Room(lev, row, collumn, exitRoute, entryPoint) {
currentRoom = this;
this.init();
this.done = false;
this.specialGot = false;
this.barrierDone = false;
this.collumn = collumn;
this.row = row;
if (exitRoute) {
this.exitRoute = true;
}
this.mc.tc._visible = false;
mapRow[row][collumn] = this;
this.doors = [null, null, null, null, null];
var _local9 = level * 0.05;
if (_local9 > 0.2) {
_local9 = 0.2;
}
var _local7 = new Array();
var _local12 = 0.7 - _local9;
var _local13 = 0.9 - _local9;
var _local14 = 0.7 + _local9;
var _local6 = [false, false, false, false, false];
if (roomsDone == 0) {
var _local8 = [0, 4, 8, 12, 16, 20];
var _local3 = 0;
while (level < _local8[_local3]) {
_local3++;
}
_local3 = Math.ceil(Math.random() * _local3);
var _local2 = 0;
while (_local2 <= _local3) {
_local6[Math.floor(Math.random() * 5)] = true;
_local2++;
}
}
if (entryPoint.isTeleporter) {
this.doors[4] = new Teleport(this, entryPoint);
this.teleport = true;
if (entryPoint.exitRoute && (!exitFound)) {
this.exitRoute = true;
}
var _local11 = 4;
} else {
var _local11 = entryPoint.num;
if (((Math.random() > _local13) || (_local6[4])) || (roomsDone == 0)) {
_local7.push(4);
this.doors[4] = new Teleport(this, entryPoint);
this.teleport = true;
}
}
if (mapRow[row - 1][collumn] != undefined) {
if (mapRow[row - 1][collumn].doors[3] != undefined) {
this.doors[0] = new Door(0, this);
if (mapRow[row - 1][collumn].doors[3].exitRoute && (!exitFound)) {
this.exitRoute = true;
}
}
} else if (((Math.random() > _local12) || (_local6[0])) && (row > 0)) {
_local7.push(0);
this.doors[0] = new Door(0, this);
}
if (mapRow[row + 1][collumn] != undefined) {
if (mapRow[row + 1][collumn].doors[0] != undefined) {
this.doors[3] = new Door(3, this);
if (mapRow[row + 1][collumn].doors[0].exitRoute && (!exitFound)) {
this.exitRoute = true;
}
}
} else if (((Math.random() > _local12) || (_local6[3])) && (row < (sSize - 1))) {
_local7.push(3);
this.doors[3] = new Door(3, this);
}
if (mapRow[row][collumn - 1] != undefined) {
if (mapRow[row][collumn - 1].doors[2] != undefined) {
this.doors[1] = new Door(1, this);
if (mapRow[row][collumn - 1].doors[2].exitRoute && (!exitFound)) {
this.exitRoute = true;
}
}
} else if (((Math.random() > _local12) || (_local6[1])) && (collumn > 0)) {
_local7.push(1);
this.doors[1] = new Door(1, this);
}
if (mapRow[row][collumn + 1] != undefined) {
if (mapRow[row][collumn + 1].doors[1] != undefined) {
this.doors[2] = new Door(2, this);
if (mapRow[row][collumn + 1].doors[1].exitRoute && (!exitFound)) {
this.exitRoute = true;
}
}
} else if (((Math.random() > _local12) || (_local6[2])) && (collumn < (sSize - 1))) {
_local7.push(2);
this.doors[2] = new Door(2, this);
}
if (this.exitRoute) {
if (((Math.random() > _local14) && (roomsDone > level)) || (_local7.length == 0)) {
this.isExit = true;
} else {
this.isExit = false;
this.doors[_local7[Math.floor(Math.random() * _local7.length)]].exitRoute = true;
}
}
if (this.isExit) {
this.map = exitMaps[_local11][Math.floor(Math.random() * exitMaps[_local11].length)];
} else if ((Math.random() > 0.75) && (level > 1)) {
this.map = levelMaps[_local11][Math.floor(Math.random() * exitMaps[_local11].length)];
} else {
this.map = levelMaps[5][Math.floor(Math.random() * levelMaps[5].length)];
}
roomsDone++;
this.makeRoom(entryPoint);
}
function Tile(tType, y, x) {
this.walkedOn = false;
this.id = (("tile" + y) + "_") + x;
this.mc = theScreen.attachMovie("_ltile", this.id, tileDepth + (tileD++));
this.mc._x = x * tileW;
this.mc._y = y * tileH;
this.mc.myObject = this;
this.x = x;
this.y = y;
this.mc.gotoAndStop(tType + 1);
this.tType = tType;
var _local2 = tileDesc[tType];
this.walkable = _local2.walkable;
this.shootThrough = _local2.shootThrough;
this.walkFunction = _local2.walkFunction;
this.damage = _local2.damage;
this.shootFunction = _local2.shootFunction;
this.hp = level * _local2.hp;
this.destroyFunction = _local2.destroyFunction;
this.destroyedTile = _local2.destroyedTile;
this.monsterType = _local2.monsterType;
this.num = _local2.num;
this.freeTile = _local2.freeTile == true;
this.onTile = _local2.onTile;
this.offTile = _local2.offTile;
this.state = _local2.state;
this.initFunc = _local2.initFunc;
if (_local2.statesArray != undefined) {
this.compFunction = _local2.compFunction;
this.statesArray = _local2.statesArray;
}
this.efFunction = _local2.efFunction;
if (this.efFunction != null) {
currentRoom.efTiles[this.id] = this;
this.dCount = 0;
}
if (_local2.laserFence) {
this.laserFence = true;
this.generators = 0;
}
this.speedFactor = _local2.speedFactor;
}
function Door(num, room) {
this.exitRoute = false;
this.num = num;
}
function Teleport(theRoom, entryPoint) {
this.exitRoute = false;
this.dest = entryPoint;
this.myRoom = theRoom;
this.isTeleporter = true;
this.num = 4;
}
function openDoors() {
var _local3 = currentRoom.doorTiles;
if (currentRoom.doorsLocked) {
var _local1 = 0;
while (_local1 < _local3.length) {
_local3[_local1].changeTileTo(_local3[_local1].onTile);
_local1++;
}
}
_local3 = currentRoom.entryTiles;
var _local1 = 0;
while (_local1 < _local3.length) {
_local3[_local1].changeTileTo(_local3[_local1].onTile);
_local1++;
}
currentRoom.done = true;
if (currentRoom.barrierA.length > 0) {
for (_local1 in currentRoom.barrierA) {
currentRoom.barrierA[_local1].changeTileTo(currentRoom.barrierA[_local1].offTile);
if (sfxOn) {
var _local2 = new Sound();
_local2.attachSound("_ldoorClose");
_local2.start();
}
}
currentRoom.barrierDone = true;
delete currentRoom.barrierA;
}
}
function openEntryDoor() {
var _local3 = currentRoom.entryTiles;
var _local2 = 0;
while (_local2 < _local3.length) {
_local3[_local2].changeTileTo(_local3[_local2].onTile);
_local2++;
}
if (this._parent.sfxOn) {
var _local4 = new Sound();
_local4.attachSound("_ldoorClose");
_local4.start();
}
}
function lockDoors() {
theScreen.tNum = 0;
currentRoom.doorsLocked = true;
theScreen.onEnterFrame = function () {
var _local3 = currentRoom.doorTiles;
if ((this.tNum % 4) == 0) {
var _local2 = this.tNum / 4;
if (_local2 < _local3.length) {
_local3[_local2].changeTileTo(_local3[_local2].offTile);
if (this._parent.sfxOn) {
var _local4 = new Sound();
_local4.attachSound("_ldoorClose");
_local4.start();
}
} else {
delete this.tNum;
this.onEnterFrame = detectKeys;
}
}
this.tNum++;
};
}
function lockEntryDoor() {
theScreen.tNum = 0;
theScreen.onEnterFrame = function () {
var _local3 = currentRoom.entryTiles;
if ((this.tNum % 4) == 0) {
var _local2 = this.tNum / 4;
if (_local2 < _local3.length) {
_local3[_local2].changeTileTo(_local3[_local2].offTile);
if (this._parent.sfxOn) {
var _local4 = new Sound();
_local4.attachSound("_ldoorClose");
_local4.start();
}
} else {
delete this.tNum;
this.onEnterFrame = detectKeys;
}
}
this.tNum++;
};
}
function removeMap() {
sMap.removeMovieClip();
mapLines.removeMovieClip();
mapBack._visible = false;
options._visible = true;
}
function showMap() {
options._visible = false;
mapBack._visible = true;
sMap = this._parent._parent.createEmptyMovieClip("mapBG", mapDepth);
mapLines = this._parent._parent.createEmptyMovieClip("mapBGLines", mapLinesDepth);
sMap._x = (mapLines._x = roomX);
sMap._y = (mapLines._y = roomY);
var _local2 = (375 - (2 * sSize)) / sSize;
var _local11 = (_local2 + 2) * sSize;
sMap.beginFill(2236962, 100);
sMap.lineStyle(0, 0, 0);
sMap.moveTo(-2, -2);
sMap.lineTo(_local11 + 2, -2);
sMap.lineTo(_local11 + 2, _local11 + 2);
sMap.lineTo(-2, _local11 + 2);
sMap.lineTo(-2, -2);
sMap.endFill();
var _local10 = 0;
while (_local10 < sSize) {
var _local8 = 0;
while (_local8 < sSize) {
var _local3 = mapRow[_local10][_local8];
var _local5 = 1 + ((_local2 + 2) * _local8);
var _local4 = 1 + ((_local2 + 2) * _local10);
sMap.lineStyle(0, 0, 50);
if (_local3 == undefined) {
sMap.beginFill(1118481, 0);
} else if (_local3 != undefined) {
if (_local3.isExit) {
sMap.beginFill(14540066, 100);
} else {
sMap.beginFill(14540253, 100);
}
if (_local3 == currentRoom) {
ch = sMap.attachMovie("pMarker", "px", 0);
ch._x = _local5 + (_local2 / 2);
ch._y = _local4 + (_local2 / 2);
}
}
sMap.moveTo(_local5, _local4);
sMap.lineTo(_local5 + _local2, _local4);
sMap.lineTo(_local5 + _local2, _local4 + _local2);
sMap.lineTo(_local5, _local4 + _local2);
sMap.lineTo(_local5, _local4);
sMap.endFill();
if (_local3 != undefined) {
if (_local3.doors[4] != null) {
var _local7 = _local5 + (_local2 / 2);
var _local6 = _local4 + (_local2 / 2);
sMap.lineStyle(0, 255, 100);
sMap.beginFill(6711039);
sMap.moveTo(_local7, _local6 - 3);
sMap.lineTo(_local7 + 3, _local6);
sMap.lineTo(_local7 - 3, _local6);
sMap.lineTo(_local7, _local6 - 3);
sMap.endFill();
sMap.beginFill(85);
sMap.moveTo(_local7 - 3, _local6);
sMap.lineTo(_local7 + 3, _local6);
sMap.lineTo(_local7, _local6 + 3);
sMap.lineTo(_local7 - 3, _local6);
sMap.endFill();
var _local9 = _local3.doors[4].dest;
if (_local9.isTeleporter) {
mapLines.lineStyle(1, 13421823, 70);
mapLines.moveTo(_local7, _local6);
mapLines.lineTo(((_local2 + 2) * _local9.myRoom.collumn) + (_local2 / 2), ((_local2 + 2) * _local9.myRoom.row) + (_local2 / 2));
}
}
if (_local3.doors[0] != null) {
drapMapSquare((_local5 + (_local2 / 2)) - 1, _local4 - 2);
}
if (_local3.doors[1] != null) {
drapMapSquare(_local5 - 2, (_local4 + (_local2 / 2)) - 1);
}
if (_local3.doors[2] != null) {
drapMapSquare(_local5 + _local2, (_local4 + (_local2 / 2)) - 1);
}
if (_local3.doors[3] != null) {
drapMapSquare((_local5 + (_local2 / 2)) - 1, _local4 + _local2);
}
}
_local8++;
}
_local10++;
}
}
function drapMapSquare(x, y) {
sMap.lineStyle(2, 16777215, 100);
sMap.beginFill(85);
sMap.moveTo(x, y);
sMap.lineTo(x + 2, y);
sMap.lineTo(x + 2, y + 2);
sMap.lineTo(x, y + 2);
sMap.lineTo(x, y);
sMap.endFill();
}
function toggleSFX() {
if (sfxOn) {
sfxOn = false;
options.sfxTickbox.gotoAndStop(2);
startScreen.sfxTickbox.gotoAndStop(2);
} else {
sfxOn = true;
options.sfxTickbox.gotoAndStop(1);
startScreen.sfxTickbox.gotoAndStop(1);
}
}
function toggleMusic() {
if (musicOn) {
musicOn = false;
options.musicTickbox.gotoAndStop(2);
startScreen.musicTickbox.gotoAndStop(2);
themeSounds[0].stop();
} else {
musicOn = true;
options.musicTickbox.gotoAndStop(1);
startScreen.musicTickbox.gotoAndStop(1);
if (inGame) {
soundSetup();
}
}
}
function setMusicVolume(vol) {
musicVol = vol;
themeSounds[0].setVolume(musicVol);
options.musicBar.slideButton._x = -75 + (1.5 * vol);
}
function soundSetup() {
if (musicOn) {
soundMC = this.createEmptyMovieClip("sMC", 0);
themeSounds = [];
maxReps = [0, 2, 2, 2, 2, 2, 2, 2, 2];
clips = [0, 1, 4, 5, 6, 8];
var _local2 = 0;
while (_local2 < 9) {
themeSounds[_local2] = new Sound(soundMC);
themeSounds[_local2].attachSound("music" + _local2);
themeSounds[_local2].onSoundComplete = doNextSound;
_local2++;
}
themeSounds[0].setVolume(musicVol);
themeSounds[0].start();
themeSounds[0].onSoundComplete = doNextSound;
soundNum = 1;
}
}
function doNextSound() {
var _local1 = Math.ceil(Math.random() * 2) * 2;
while (_local1 == cSound) {
_local1 = Math.ceil(Math.random() * 2) * 2;
}
cSound = _local1;
var _local2 = clips[Math.ceil(Math.random() * 5)];
clipNum.text = _local2;
themeSounds[_local2].start(0, cSound);
}
function showShop() {
canPause = false;
delete gui.options.onRelease;
populateUpgrades();
shop._visible = true;
shop.contButton.onRelease = removeShop;
var _local1 = 0;
while (_local1 < 5) {
delete gui["weaponButton" + _local1].onRelease;
_local1++;
}
shop.onEnterFrame = function () {
Mouse.show();
};
themeSounds[0].stop();
if (musicOn) {
shopSound = new Sound(soundMC);
shopSound.attachSound("_lshop");
shopSound.start(0, 9999);
}
}
function removeShop() {
delete shop.onEnterFrame;
shop._visible = false;
shopSound.stop();
nextLevel();
}
function populateUpgrades() {
if (sfxOn) {
var _local7 = new Sound();
_local7.attachSound("_lclick");
_local7.start();
}
shop.gotoAndStop("upgrades");
shop.points.text = score;
shop.mon.text = money;
delete shop.upgrades.onRelease;
shop.supplies.onRelease = populateSupplies;
shop.specials.onRelease = populateSpecials;
var _local2 = 0;
while (_local2 < 8) {
switch (_local2) {
case 0 :
var _local4 = p.maxhp;
break;
case 1 :
_local4 = p.maxArmour;
break;
case 2 :
_local4 = p.speedLevel + 1;
break;
case 3 :
_local4 = p.weapons[0];
break;
case 4 :
_local4 = p.weapons[1];
break;
case 5 :
_local4 = p.weapons[2];
break;
case 6 :
_local4 = p.weapons[3];
break;
case 7 :
_local4 = p.weapons[4];
}
var _local3 = upgrades[_local2];
var _local6 = _local4 + _local3.increment;
var _local5 = _local3.cost + (_local3.cost * _local3.timesBought);
if (_local3.timesBought < _local3.maxLevel) {
shop["effect" + _local2].text = (_local4 + "->") + _local6;
shop["cost" + _local2].text = _local5;
} else {
shop["effect" + _local2].text = _local4;
shop["cost" + _local2].text = "-";
}
if ((money < _local5) || (shop["cost" + _local2].text == "-")) {
shop["buyButton" + _local2]._visible = false;
} else {
shop["buyButton" + _local2]._visible = true;
shop["buyButton" + _local2].num = _local2;
shop["buyButton" + _local2].onRelease = function () {
this._parent._parent.buyUpgrade(this.num);
};
}
_local2++;
}
}
function buyUpgrade(num) {
switch (num) {
case 0 :
p.maxhp = p.maxhp + upgrades[num].increment;
p.hp = p.hp + upgrades[num].increment;
break;
case 1 :
p.maxArmour = p.maxArmour + upgrades[num].increment;
p.armour = p.armour + upgrades[num].increment;
break;
case 2 :
p.speedLevel = p.speedLevel + upgrades[num].increment;
p.speed = p.speed + p.speedInc;
break;
case 3 :
p.weapons[0] = p.weapons[0] + upgrades[num].increment;
break;
case 4 :
p.weapons[1] = p.weapons[1] + upgrades[num].increment;
break;
case 5 :
p.weapons[2] = p.weapons[2] + upgrades[num].increment;
break;
case 6 :
p.weapons[3] = p.weapons[3] + upgrades[num].increment;
break;
case 7 :
p.weapons[4] = p.weapons[4] + upgrades[num].increment;
}
var _local2 = upgrades[num];
money = money - (_local2.cost + (_local2.cost * _local2.timesBought));
_local2.timesBought++;
p.doHealth();
p.doArmour();
populateUpgrades();
}
function Upgrade(increment, cost, costIncrease, maxLevel) {
this.increment = increment;
this.cost = cost;
this.costIncrease = costIncrease;
this.maxLevel = maxLevel - 1;
this.timesBought = 0;
}
function buildUpgradeBase() {
upgrades = [];
upgrades.push(new Upgrade(25, 50, 25, 999));
upgrades.push(new Upgrade(25, 50, 25, 999));
upgrades.push(new Upgrade(1, 50, 25, 20));
upgrades.push(new Upgrade(1, 100, 50, 20));
upgrades.push(new Upgrade(1, 100, 50, 20));
upgrades.push(new Upgrade(1, 100, 50, 20));
upgrades.push(new Upgrade(1, 100, 50, 20));
upgrades.push(new Upgrade(1, 100, 50, 20));
}
function populateSupplies() {
if (sfxOn) {
var _local8 = new Sound();
_local8.attachSound("_lclick");
_local8.start();
}
shop.gotoAndStop("supplies");
shop.points.text = score;
shop.mon.text = money;
shop.upgrades.onRelease = populateUpgrades;
delete shop.supplies.onRelease;
shop.specials.onRelease = populateSpecials;
var _local2 = 0;
while (_local2 < 6) {
switch (_local2) {
case 0 :
var _local5 = p.hp;
if (p.maxhp < 9999) {
var _local6 = p.maxhp;
} else {
var _local6 = 9999;
}
break;
case 1 :
_local5 = p.armour;
if (p.maxArmour < 9999) {
var _local6 = p.maxArmour;
} else {
var _local6 = 9999;
}
break;
case 2 :
_local5 = p.ammo[1];
var _local6 = 999;
break;
case 3 :
_local5 = p.ammo[2];
_local6 = 999;
break;
case 4 :
_local5 = p.ammo[3];
_local6 = 999;
break;
case 5 :
_local5 = p.ammo[4];
_local6 = 999;
}
var _local4 = supplies[_local2];
var _local7 = _local4.cost + (_local4.costIncrease * upgrades[_local4.ugNum].timesBought);
var _local3 = _local5 + _local4.amount;
if (_local3 > _local6) {
_local3 = _local6;
}
shop["effect" + _local2].text = (_local5 + "->") + _local3;
shop["cost" + _local2].text = _local7;
if ((money < _local7) || (_local3 == _local5)) {
shop["buyButton" + _local2]._visible = false;
} else {
shop["buyButton" + _local2]._visible = true;
shop["buyButton" + _local2].num = _local2;
shop["buyButton" + _local2].nextVal = _local3;
shop["buyButton" + _local2].onRelease = function () {
this._parent._parent.buySupply(this.num, this.nextVal);
};
}
_local2++;
}
}
function buySupply(num, newVal) {
switch (num) {
case 0 :
p.hp = newVal;
break;
case 1 :
p.armour = newVal;
break;
case 2 :
p.ammo[1] = newVal;
break;
case 3 :
p.ammo[2] = newVal;
break;
case 4 :
p.ammo[3] = newVal;
break;
case 5 :
p.ammo[4] = newVal;
}
var _local2 = supplies[num];
money = money - (_local2.cost + (_local2.costIncrease * upgrades[_local2.ugNum].timesBought));
p.doHealth();
p.doArmour();
populateSupplies();
}
function Supply(amount, cost, costIncrease, ugNum) {
this.amount = amount;
this.cost = cost;
this.costIncrease = costIncrease;
this.ugNum = ugNum;
}
function buildSupplyBase() {
supplies = [];
supplies.push(new Supply(50, 50, 0, 0));
supplies.push(new Supply(50, 50, 0, 1));
supplies.push(new Supply(10, 100, 10, 4));
supplies.push(new Supply(10, 100, 10, 5));
supplies.push(new Supply(1, 100, 20, 6));
supplies.push(new Supply(1, 50, 10, 7));
}
function populateSpecials() {
if (sfxOn) {
var _local4 = new Sound();
_local4.attachSound("_lclick");
_local4.start();
}
shop.gotoAndStop("specials");
shop.points.text = score;
shop.mon.text = money;
shop.upgrades.onRelease = populateUpgrades;
shop.supplies.onRelease = populateSupplies;
delete shop.specials.onRelease;
var _local2 = 0;
while (_local2 < 6) {
var _local3 = specials[_local2];
shop["effect" + _local2].text = _local3.amount;
shop["cost" + _local2].text = _local3.cost;
if (money < _local3.cost) {
shop["buyButton" + _local2]._visible = false;
} else {
shop["buyButton" + _local2]._visible = true;
shop["buyButton" + _local2].num = _local2;
shop["buyButton" + _local2].onRelease = function () {
this._parent._parent.buySpecial(this.num);
};
}
_local2++;
}
}
function buySpecial(num) {
sp = specials[num];
if (num < 4) {
score = score + sp.amount;
} else {
level = level + sp.amount;
}
money = money - sp.cost;
populateSpecials();
}
function Special(amount, cost) {
this.amount = amount;
this.cost = cost;
}
function buildSpecialBase() {
specials = [];
specials.push(new Special(10, 10));
specials.push(new Special(100, 100));
specials.push(new Special(1000, 1000));
specials.push(new Special(9999, 9999));
specials.push(new Special(1, 500));
specials.push(new Special(10, 2000));
}
function monsterSpawn() {
this.count = Math.floor(Math.random() * 170);
this.spawnInterval = 280;
this.spawnTiles = [];
this.hp = this.hp + ((this.hp / 2) * level);
this.score = (this.hp / 2) * level;
currentRoom.possibleEnemies++;
var _local4 = this.y - 1;
while (_local4 < (this.y + 2)) {
var _local3 = this.x - 1;
while (_local3 < (this.x + 2)) {
var _local2 = currentRoom.tiles[_local4][_local3];
if ((_local2.walkable && (_local2.damage == 0)) && (_local2 != this)) {
this.spawnTiles.push(_local2);
}
_local3++;
}
_local4++;
}
}
function associateTiles() {
}
function switchedTiles() {
if (currentRoom.switchT[this.num] == undefined) {
currentRoom.switchT[this.num] = [];
}
currentRoom.switchT[this.num].push(this);
this.mc.gotoAndStop(this.onTile + 1);
}
function laserFenceGenSetUp() {
this.fenceTiles = [];
var _local3 = this.x + 1;
var _local2 = this.y;
while (currentRoom.tiles[_local2][_local3].laserFence) {
this.fenceTiles.push(currentRoom.tiles[_local2][_local3]);
currentRoom.tiles[_local2][_local3].generators++;
_local3++;
}
_local3 = this.x - 1;
_local2 = this.y;
while (currentRoom.tiles[_local2][_local3].laserFence) {
this.fenceTiles.push(currentRoom.tiles[_local2][_local3]);
currentRoom.tiles[_local2][_local3].generators++;
_local3--;
}
_local3 = this.x;
_local2 = this.y + 1;
while (currentRoom.tiles[_local2][_local3].laserFence) {
this.fenceTiles.push(currentRoom.tiles[_local2][_local3]);
currentRoom.tiles[_local2][_local3].generators++;
_local2++;
}
_local3 = this.x;
_local2 = this.y - 1;
while (currentRoom.tiles[_local2][_local3].laserFence) {
this.fenceTiles.push(currentRoom.tiles[_local2][_local3]);
currentRoom.tiles[_local2][_local3].generators++;
_local2--;
}
}
function cChangeInit() {
if (currentRoom.ccT[this.num] == undefined) {
currentRoom.ccT[this.num] = [];
}
this.state = 0;
this.numStates = this.statesArray.length;
currentRoom.ccT[this.num].push(this);
this.mc.gotoAndStop(this.statesArray[this.state] + 1);
}
function makeSpecial() {
if (!currentRoom.specialGot) {
var _local2 = this.num;
if (_local2 > 5) {
_local2 = Math.floor(Math.random() * 6);
}
var _local3 = new Powerup(this.x, this.y, _local2);
}
}
function barrierAssoc() {
if (!currentRoom.barrierDone) {
currentRoom.barrierA.push(this);
} else {
this.changeTileTo(this.offTile);
}
}
function spawnBoss() {
if (!currentRoom.done) {
var _local2 = new bosses[this.num](enemyD++, this.x, this.y);
}
}
function destroyable(power) {
this.hp = this.hp - power;
if (this.hp <= 0) {
this.destroyFunction();
}
}
function changeTile() {
delete currentRoom.efTiles[this.id];
this.tType = this.destroyedTile;
var _local2 = tileDesc[this.tType];
this.walkable = _local2.walkable;
this.shootThrough = _local2.shootThrough;
this.walkFunction = _local2.walkFunction;
this.damage = _local2.damage;
this.shootFunction = _local2.shootFunction;
this.hp = _local2.hp;
this.efFunction = _local2.efFunction;
this.speedFactor = _local2.speedFactor;
this.efFunction = _local2.efFunction;
this.destroyedTile = _local2.destroyedTile;
if (this.efFunction != null) {
currentRoom.efTiles[this.id] = this;
}
this.mc.gotoAndStop(this.tType + 1);
}
function destroyMonsterSpawner() {
if ((--currentRoom.possibleEnemies) == 0) {
currentRoom.allKilledFunc();
}
delete currentRoom.efTiles[this.id];
this.tType = this.destroyedTile;
var _local2 = tileDesc[this.tType];
this.walkable = _local2.walkable;
this.shootThrough = _local2.shootThrough;
this.walkFunction = _local2.walkFunction;
this.damage = _local2.damage;
this.shootFunction = _local2.shootFunction;
this.hp = _local2.hp;
this.efFunction = _local2.efFunction;
this.speedFactor = _local2.speedFactor;
this.efFunction = _local2.efFunction;
this.destroyedTile = _local2.destroyedTile;
if (this.efFunction != null) {
currentRoom.efTiles[this.id] = this;
}
money = money + this.score;
score = score + this.score;
this.mc.gotoAndStop(this.tType + 1);
this.makeExplosion();
}
function destroyLaserFence() {
this.destroyed = true;
for (i in this.fenceTiles) {
if ((--this.fenceTiles[i].generators) == 0) {
this.fenceTiles[i].destroyFunction();
}
}
this.mc.gotoAndStop(this.destroyedTile + 1);
this.shootFunction = null;
this.makeExplosion();
money = money + (4 * level);
score = score + (5 + (5 * level));
}
function damagePlayer() {
if ((this.dCount++) > 4) {
this.dCount = 0;
if (p.currentTile == this) {
p.hurtMe(this.damage);
}
for (var _local3 in currentRoom.currentEnemies) {
var _local2 = currentRoom.currentEnemies[_local3];
if ((_local2.currentTile == this) && (this.damage > _local2.wussiness)) {
_local2.hurtMe(this.damage);
}
}
}
}
function spawnMonsters() {
if (((this.count++) > this.spawnInterval) && (currentRoom.possibleEnemies < 11)) {
this.count = Math.floor(Math.random() * this.spawnInterval);
var _local5 = this.spawnTiles;
var _local2 = _local5[Math.floor(Math.random() * _local5.length)];
var _local3 = true;
for (var _local4 in currentRoom.currentEnemies) {
if (currentRoom.currentEnemies[_local4].currentTile == _local2) {
_local3 = false;
}
}
if (p.currentTile == _local2) {
_local3 = false;
}
if (_local3) {
if (sfxOn) {
var _local6 = new Sound();
_local6.attachSound("_lspawn");
_local6.start();
}
var _local8 = new this.monsterType(enemyD++, _local2.x, _local2.y);
var _local7 = theScreen.attachMovie("_lteleportInStuff", "ex" + exNum, explosionsDepth + exNum);
_local7._x = (_local2.x * tileW) + (tileW / 2);
_local7._y = (_local2.y * tileW) + (tileW / 2);
if ((++exNum) > 50) {
exNum = 0;
}
_local7 = theScreen.attachMovie("_lspawnlight", "ex" + exNum, explosionsDepth + exNum);
_local7._x = (this.x * tileW) + (tileW / 2);
_local7._y = (this.y * tileW) + (tileW / 2);
if ((++exNum) > 50) {
exNum = 0;
}
}
}
}
function toggleTiles() {
var _local2 = currentRoom.switchT[this.num];
for (var _local3 in _local2) {
toggleTile(_local2[_local3]);
}
if (sfxOn) {
var _local4 = new Sound();
_local4.attachSound("_ldoorClose");
_local4.start();
}
}
function cChange() {
this.state++;
if (this.state == this.numStates) {
this.state = 0;
}
this.mc.gotoAndStop(this.statesArray[this.state] + 1);
var _local2 = true;
var _local3 = this.statesArray.length - 1;
for (i in currentRoom.ccT[this.num]) {
if (currentRoom.ccT[this.num][i].state != _local3) {
_local2 = false;
}
}
if (_local2) {
this.compFunction();
for (i in currentRoom.ccT[this.num]) {
currentRoom.ccT[this.num][i].walkFunction = null;
}
}
}
function doorWalk() {
delete theScreen.onEnterFrame;
theScreen.removeMovieClip();
switch (this.num) {
case 0 :
row--;
break;
case 1 :
collumn--;
break;
case 2 :
collumn++;
break;
case 3 :
row++;
}
if (mapRow[row][collumn] == undefined) {
var _local3 = new Room(1, row, collumn, this.exitRoute, currentRoom.doors[this.num]);
} else {
var _local2 = currentRoom.doors[this.num];
currentRoom = mapRow[row][collumn];
mapRow[row][collumn].makeRoom(_local2);
}
}
function doTeleport() {
delete theScreen.onEnterFrame;
canPause = false;
this.mc.mc.gotoAndPlay(2);
this.mc.countDown = 30;
if (sfxOn) {
var _local2 = new Sound();
_local2.attachSound("_lteleport");
_local2.start();
}
var _local3 = theScreen.attachMovie("_lteleportStuff", "tel", playerDepth - 1);
_local3._x = (this.x * tileW) + (tileW / 2);
_local3._y = (this.y * tileW) + (tileW / 2);
this.mc.onEnterFrame = function () {
if ((this.countDown--) > 0) {
p.mc._rotation = p.mc._rotation + 20;
p.mc._alpha = p.mc._alpha - 4;
} else {
this.myObject.finishTeleport();
}
};
}
function exitLevel() {
delete theScreen.onEnterFrame;
canPause = false;
delete gui.options.onRelease;
var _local2 = 0;
while (_local2 < 5) {
delete gui["weaponButton" + _local2].onRelease;
_local2++;
}
p.mc._x = (this.x * tileW) + (tileW / 2);
p.mc._y = (this.y * tileH) + (tileH / 2);
if (sfxOn) {
var _local4 = new Sound();
_local4.attachSound("_lexit");
_local4.start();
}
var _local3 = theScreen.attachMovie("_linfo", "inf" + exNum, explosionsDepth + exNum);
_local3._x = (this.x * tileW) + (tileW / 2);
_local3._y = (this.y * tileH) + (tileH / 2);
if ((++exNum) > 50) {
exNum = 0;
}
var _local5 = 100 * level;
_local3.txt.txt0.htmlText = (_local3.txt.txt1.htmlText = "LEVEL BONUS\n$" + _local5);
p.mc.gotoAndPlay("exit");
money = money + _local5;
}
function toggleTile(t) {
if (t.state == "on") {
var _local2 = tileDesc[t.offTile];
t.state = "off";
t.mc.gotoAndStop(t.offTile + 1);
} else {
var _local2 = tileDesc[t.onTile];
t.state = "on";
t.mc.gotoAndStop(t.onTile + 1);
}
delete currentRoom.efTiles[t.id];
t.walkable = _local2.walkable;
t.efFunction = _local2.efFunction;
t.shootThrough = _local2.shootThrough;
t.walkFunction = _local2.walkFunction;
t.hp = _local2.hp;
t.damage = _local2.damage;
t.efFunction = _local2.efFunction;
t.speedFactor = _local2.speedFactor;
t.dCount = 0;
if (t.efFunction != null) {
currentRoom.efTiles[t.id] = t;
} else {
delete currentRoom.efTiles[t.id];
}
}
function traceYay() {
if (currentRoom.colourUnlock) {
var _local3 = currentRoom.doorTiles;
var _local1 = 0;
while (_local1 < _local3.length) {
_local3[_local1].changeTileTo(_local3[_local1].onTile);
_local1++;
}
_local3 = currentRoom.entryTiles;
_local1 = 0;
while (_local1 < _local3.length) {
_local3[_local1].changeTileTo(_local3[_local1].onTile);
_local1++;
}
} else if (currentRoom.barrierA.length > 0) {
for (var _local1 in currentRoom.barrierA) {
currentRoom.barrierA[_local1].changeTileTo(currentRoom.barrierA[_local1].offTile);
if (sfxOn) {
var _local2 = new Sound();
_local2.attachSound("_ldoorClose");
_local2.start();
}
}
currentRoom.barrierDone = true;
delete currentRoom.barrierA;
}
}
function colourchangeKill() {
}
Function.prototype.extend = function (superClass) {
this.prototype.__proto__ = superClass.prototype;
this.prototype.__constructor__ = superClass;
ASSetPropFlags(this.prototype, ["__constructor__"], 1);
};
ASSetPropFlags(Function.prototype, ["extend"], 1);
MovieClip.prototype.mcExtends = function (superClass) {
if (typeof(superClass) == "function") {
this.__proto__ = superClass.prototype;
if (typeof(this.attachMovie) == "undefined") {
var _local4 = this.__proto__;
var _local3 = _local4.__proto__.__proto__;
while (_local3 != null) {
_local3 = _local3.__proto__;
_local4 = _local4.__proto__;
}
_local4.__proto__ = MovieClip.prototype;
}
arguments.splice(0, 1);
superClass.apply(this, arguments);
} else {
trace("mcExtends: Incorrect superClass type or path - " + typeof(superClass));
}
};
ASSetPropFlags(MovieClip.prototype, ["mcExtends"], 1);
num = 0;
PiRads = (Math.PI/180);
roomX = 12;
roomY = 12;
tileW = 25;
tileH = 25;
mapWidth = 15;
mapHeight = 15;
var midTile = Math.floor(mapWidth / 2);
startX0 = [midTile, mapWidth - 1, 0, midTile, midTile];
startY0 = [mapHeight - 1, midTile, midTile, 0, midTile];
startX1 = [midTile, mapWidth - 2, 1, midTile, midTile];
startY1 = [mapHeight - 2, midTile, midTile, 1, midTile];
doorPos = [];
doorPos[0] = [new Point(midTile - 1, 0), new Point(midTile, 0), new Point(midTile + 1, 0)];
doorPos[1] = [new Point(0, midTile - 1), new Point(0, midTile), new Point(0, midTile + 1)];
doorPos[2] = [new Point(mapWidth - 1, midTile - 1), new Point(mapWidth - 1, midTile), new Point(mapWidth - 1, midTile + 1)];
doorPos[3] = [new Point(midTile - 1, mapHeight - 1), new Point(midTile, mapHeight - 1), new Point(midTile + 1, mapHeight - 1)];
telePortPos = [new Point(midTile, midTile), new Point(3, 3), new Point(11, 3), new Point(11, 3), new Point(11, 11)];
screenDepth = 1;
crossHairsDepth = 2;
optionsDepth = 3;
mapDepth = 4;
mapLinesDepth = 5;
mapBackDepth = 6;
charStatsDepth = 7;
shopDepth = 8;
gameoverDepth = 9;
startScreenDepth = 10;
wipeOverDepth = 20;
guiDepth = 12343455 /* 0xBC589F */;
tileDepth = 0;
deadDepth = 1000;
minesDepth = 1200;
playerDepth = 1500;
enemyDepth = 2000;
shotDepth = 3000;
explosionsDepth = 4000;
names = ["FLUFFY", "WIMP", "RECRUIT", "INTERN", "PAINMERCHANT", "KILLERNATOR", "FRAGMEISTER", "BLOODDRENCHED", "HURTMAKER", "GOON", "DESTROYER", "FK'ER", "BERSERKER"];
pointsSpace = 1000;
crossHair.swapDepths(crossHairsDepth);
mapBack.swapDepths(mapBackDepth);
charStats.swapDepths(charStatsDepth);
shop.swapDepths(shopDepth);
gui.swapDepths(guiDepth);
options.swapDepths(optionsDepth);
gameover.swapDepths(gameoverDepth);
startScreen.swapDepths(startScreenDepth);
wipeOver.swapDepths(wipeOverDepth);
Enemy.extend(Sprite);
Enemy.prototype.init = function (num, x, y) {
this.level = level;
this.num = num;
this.hp = this.hpBase + (this.hpFactor * level);
this.score = this.score * level;
this.hitDamage = this.hitDamage * level;
var _local2 = 0;
while (_local2 < this.shotPower.length) {
this.shotPower[_local2] = this.shotPower[_local2] * level;
_local2++;
}
currentRoom.currentEnemies[this.num] = this;
this.mc = theScreen.attachMovie("_l" + this.clipName, "enemy" + num, enemyDepth + num);
this.mc.myObject = this;
this.xTile = x;
this.yTile = y;
this.currentTile = currentRoom.tiles[y][x];
this.x = (this.xTile * tileW) + (tileW / 2);
this.y = (this.yTile * tileH) + (tileH / 2);
this.mc._x = this.x;
this.mc._y = this.y;
this.gotoP = Math.random() * 60;
this.hittable = true;
this.free = true;
this.shootCounter = 0;
this.gotoP = true;
currentRoom.possibleEnemies++;
};
Zombie.extend(Enemy);
Soldier.extend(Enemy);
Demon.extend(Enemy);
Sludgeman.extend(Enemy);
Boss0.extend(Enemy);
Boss1.extend(Enemy);
Enemy.prototype.hurtMe = function (damage) {
if (sfxOn) {
var _local2 = new Sound();
_local2.attachSound(this.hitSound);
_local2.start();
}
this.hp = this.hp - damage;
if (this.hp <= 0) {
score = score + this.score;
money = money + this.score;
this.hittable = false;
this.mc.gotoAndPlay("destroy");
this.mc.swapDepths(deadDepth + (deadD++));
if (deadD > 199) {
deadD = 0;
}
if ((--currentRoom.possibleEnemies) == 0) {
currentRoom.allKilledFunc();
}
if (this.givePowerUp) {
var _local3 = new Powerup(this.currentTile.x, this.currentTile.y, Math.floor(Math.random() * 6));
}
if (this.isBoss) {
if (currentRoom.barrierA.length > 0) {
for (i in currentRoom.barrierA) {
currentRoom.barrierA[i].changeTileTo(currentRoom.barrierA[i].offTile);
}
currentRoom.barrierDone = true;
if (sfxOn) {
var _local2 = new Sound();
_local2.attachSound("_ldoorClose");
_local2.start();
}
delete currentRoom.barrierA;
}
}
delete currentRoom.currentEnemies[this.num];
} else {
this.mc.gotoAndPlay("hurt");
}
};
Enemy.prototype.checkCols = function (x, y) {
var _local6 = (y + this.rad) - 1;
var _local5 = (y - this.rad) + 1;
var _local7 = (x - this.rad) + 1;
var _local8 = (x + this.rad) - 1;
for (var _local11 in currentRoom.currentEnemies) {
var _local2 = currentRoom.currentEnemies[_local11];
if (_local2 != this) {
var _local3 = x - _local2.x;
var _local4 = y - _local2.y;
if (Math.sqrt((_local3 * _local3) + (_local4 * _local4)) < ((_local2.rad + this.rad) - 1)) {
_local3 = _local7 - _local2.x;
_local4 = _local5 - _local2.y;
this.upleft = Math.sqrt((_local3 * _local3) + (_local4 * _local4)) < (_local2.rad - 1);
_local4 = _local6 - _local2.y;
this.downleft = Math.sqrt((_local3 * _local3) + (_local4 * _local4)) < (_local2.rad - 1);
_local3 = _local8 - _local2.x;
_local4 = _local5 - _local2.y;
this.upright = Math.sqrt((_local3 * _local3) + (_local4 * _local4)) < (_local2.rad - 1);
_local4 = _local6 - _local2.y;
this.downright = Math.sqrt((_local3 * _local3) + (_local4 * _local4)) < (_local2.rad - 1);
}
}
}
};
Enemy.prototype.getCorners = function (x, y) {
downY = Math.floor(((y + this.rad) - 1) / tileH);
upY = Math.floor((y - this.rad) / tileH);
leftX = Math.floor((x - this.rad) / tileW);
rightX = Math.floor(((x + this.rad) - 1) / tileW);
this.upleft = currentRoom.tiles[upY][leftX].walkable && (currentRoom.tiles[upY][leftX].damage < this.wussiness);
this.downleft = currentRoom.tiles[downY][leftX].walkable && (currentRoom.tiles[downY][leftX].damage < this.wussiness);
this.upright = currentRoom.tiles[upY][rightX].walkable && (currentRoom.tiles[upY][rightX].damage < this.wussiness);
this.downright = currentRoom.tiles[downY][rightX].walkable && (currentRoom.tiles[downY][rightX].damage < this.wussiness);
};
Enemy.prototype.budgetPF = function (dirx, diry) {
var _local2 = 0;
var _local3 = 0;
var _local4 = this.currentTile.y;
var _local5 = this.currentTile.x;
var _local13 = currentRoom.tiles[_local4 - 1][_local5].walkable && (currentRoom.tiles[_local4 - 1][_local5].damage < this.wussiness);
var _local14 = currentRoom.tiles[_local4 + 1][_local5].walkable && (currentRoom.tiles[_local4 + 1][_local5].damage < this.wussiness);
var _local12 = currentRoom.tiles[_local4][_local5 - 1].walkable && (currentRoom.tiles[_local4][_local5 - 1].damage < this.wussiness);
var _local15 = currentRoom.tiles[_local4][_local5 + 1].walkable && (currentRoom.tiles[_local4][_local5 + 1].damage < this.wussiness);
var _local9 = ((_local13 && (_local12)) && (currentRoom.tiles[_local4 - 1][_local5 - 1].walkable)) && (currentRoom.tiles[_local4 - 1][_local5 - 1].damage < this.wussiness);
var _local6 = ((_local14 && (_local12)) && (currentRoom.tiles[_local4 + 1][_local5 - 1].walkable)) && (currentRoom.tiles[_local4 + 1][_local5 - 1].damage < this.wussiness);
var _local7 = ((_local13 && (_local12)) && (currentRoom.tiles[_local4 - 1][_local5 + 1].walkable)) && (currentRoom.tiles[_local4 - 1][_local5 + 1].damage < this.wussiness);
var _local8 = ((_local14 && (_local15)) && (currentRoom.tiles[_local4 + 1][_local5 + 1].walkable)) && (currentRoom.tiles[_local4 + 1][_local5 + 1].damage < this.wussiness);
if (diry == 1) {
if ((dirx == 1) && (_local6)) {
_local2 = -1;
_local3 = 1;
} else if ((dirx == -1) && (_local8)) {
_local2 = 1;
_local3 = 1;
} else if (_local6 && (!_local8)) {
_local2 = -1;
_local3 = 1;
} else if ((!_local6) && (_local8)) {
_local2 = 1;
_local3 = 1;
} else if (Math.random() > 0.5) {
_local2 = 1;
_local3 = 1;
} else {
_local2 = -1;
_local3 = 1;
}
} else if (diry == -1) {
if ((dirx == 1) && (_local9)) {
_local2 = -1;
_local3 = -1;
} else if ((dirx == -1) && (_local7)) {
_local2 = 1;
_local3 = -1;
} else if (_local6 && (!_local7)) {
_local2 = -1;
_local3 = -1;
} else if ((!_local6) && (_local7)) {
_local2 = 1;
_local3 = -1;
} else if (Math.random() > 0.5) {
_local2 = 1;
_local3 = -1;
} else {
_local2 = -1;
_local3 = -1;
}
} else if (dirx == 1) {
if ((diry == 1) && (_local7)) {
_local2 = 1;
_local3 = -1;
} else if ((diry == -1) && (_local8)) {
_local2 = 1;
_local3 = 1;
} else if (_local7 && (!_local8)) {
_local2 = 1;
_local3 = -1;
} else if ((!_local7) && (_local8)) {
_local2 = 1;
_local3 = 1;
} else if (Math.random() > 0.5) {
_local2 = 1;
_local3 = 1;
} else {
_local2 = 1;
_local3 = -1;
}
} else if (dirx == -1) {
if ((diry == 1) && (_local9)) {
_local2 = -1;
_local3 = -1;
} else if ((diry == -1) && (_local6)) {
_local2 = -1;
_local3 = 1;
} else if (_local9 && (!_local6)) {
_local2 = -1;
_local3 = -1;
} else if ((!_local9) && (_local6)) {
_local2 = -1;
_local3 = 1;
} else if (Math.random() > 0.5) {
_local2 = -1;
_local3 = 1;
} else {
_local2 = -1;
_local3 = -1;
}
}
this.xTo = (currentRoom.tiles[_local4 + _local3][_local5 + _local2].x * tileW) + (tileW / 2);
this.yTo = (currentRoom.tiles[_local4 + _local3][_local5 + _local2].y * tileH) + (tileH / 2);
this.gotoTile = currentRoom.tiles[_local4 + _local3][_local5 + _local2];
this.gotoP = false;
this.gotoCount = 0;
};
enemiesDef = [];
enemiesDef[0] = [];
enemiesDef[1] = [Zombie, Zombie];
enemiesDef[2] = [Soldier, Soldier];
enemiesDef[3] = [Demon, Demon];
enemiesDef[4] = [Sludgeman, Sludgeman];
monsterTypes = [Zombie, Soldier, Demon, Sludgeman];
tileDesc = [];
var i = 0;
while (i < 20) {
tileDesc[i] = new walkTile(1);
i++;
}
var i = 20;
while (i < 40) {
tileDesc[i] = new permWall(false);
i++;
}
tileDesc[28] = new permWall(true);
tileDesc[40] = new walkDamageTile(10, 1);
tileDesc[41] = new walkDamageTile(5, 0.6);
tileDesc[42] = new walkTile(0.6);
tileDesc[43] = new permWall(true);
var i = 44;
while (i < 56) {
tileDesc[i] = new walkTile(0.6);
i++;
}
var i = 55;
while (i < 65) {
tileDesc[i] = new walkTile(0.8);
i++;
}
tileDesc[65] = new laserFenceGenerator(67);
tileDesc[66] = new laserFenceGenerator(142);
tileDesc[67] = new permWall(false);
tileDesc[142] = new permWall(false);
var i = 68;
while (i < 74) {
tileDesc[i] = new laserFence(i - 68);
i++;
}
var i = 74;
while (i < 80) {
tileDesc[i] = new laserFence(i - 74);
i++;
}
var i = 80;
while (i < 86) {
tileDesc[i] = new laserFence(i - 80);
i++;
}
var i = 86;
while (i < 92) {
tileDesc[i] = new laserFence(i - 86);
i++;
}
var i = 92;
while (i < 102) {
tileDesc[i] = new destroyableTile(10, changeTile, i + 10);
i++;
}
tileDesc[92] = new destroyableTile(10, changeTile, 102);
tileDesc[93] = new destroyableTile(15, changeTile, 103);
tileDesc[94] = new destroyableTile(5, changeTile, 104);
tileDesc[95] = new destroyableTile(30, changeTile, 105);
var i = 102;
while (i < 112) {
tileDesc[i] = new destroyableTile(10, changeTile, i - 102);
i++;
}
var i = 112;
while (i < 122) {
tileDesc[i] = new walkSwitch(i - 112);
i++;
}
var i = 122;
while (i < 132) {
tileDesc[i] = new switchTile(i - 122, i - 122, i - 82);
i++;
}
var i = 132;
while (i < 142) {
tileDesc[i] = new switchTile(i - 132, i - 92, i - 132);
i++;
}
tileDesc[122] = new switchTile(0, 60, 40);
tileDesc[132] = new switchTile(0, 40, 60);
tileDesc[123] = new switchTile(1, 0, 41);
tileDesc[133] = new switchTile(1, 41, 0);
tileDesc[124] = new switchTile(2, 0, 40);
tileDesc[134] = new switchTile(2, 40, 0);
tileDesc[125] = new switchTile(3, 0, 28);
tileDesc[135] = new switchTile(3, 28, 0);
var i = 144;
while (i < 158) {
tileDesc[i] = new monsterSpawners(i - 144, 20);
i++;
}
var i = 148;
while (i < 152) {
tileDesc[i] = new monsterSpawners(i - 148, 40);
i++;
}
tileDesc[152] = new permWall(true);
tileDesc[143] = new permWall(true);
var i = 161;
while (i < 165) {
tileDesc[i] = new doorTile(doorWalk, i);
i++;
}
var i = 165;
while (i < 171) {
var a = [165, 166];
tileDesc[i] = new ccTile(i - 165, a, traceYay);
i++;
}
var i = 171;
while (i < 175) {
tileDesc[i] = new permWall(false);
i++;
}
tileDesc[175] = new doorTile(doTeleport, 175);
tileDesc[176] = new doorTile(null, 176);
tileDesc[217] = new tileWalkFunction(exitLevel, null);
var i = 153;
while (i < 161) {
tileDesc[i] = new walkTile(1);
i++;
}
tileDesc[185] = new walkTile(1);
tileDesc[186] = new walkTile(1);
var i = 187;
while (i < 197) {
tileDesc[i] = new specialSpawner(i - 187);
i++;
}
var i = 197;
while (i < 207) {
tileDesc[i] = new rBarrierTile(28 + i, 0);
i++;
}
tileDesc[197] = new rBarrierTile(29, 0);
tileDesc[198] = new rBarrierTile(30, 0);
tileDesc[199] = new rBarrierTile(31, 0);
tileDesc[200] = new rBarrierTile(28, 0);
tileDesc[201] = new rBarrierTile(40, 0);
var i = 207;
while (i < 217) {
tileDesc[i] = new bossSpawner(i - 207);
i++;
}
levelMaps = [];
var i = 0;
while (i < 6) {
levelMaps[i] = [];
i++;
}
levelMaps[0].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 150, 20], [22, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 93, 0, 0, 20], [22, 0, 93, 166, 166, 166, 166, 166, 166, 166, 166, 166, 93, 0, 20], [22, 0, 0, 166, 0, 0, 0, 0, 0, 0, 0, 166, 0, 0, 20], [22, 0, 0, 166, 0, 0, 0, 0, 0, 0, 0, 166, 0, 0, 20], [22, 0, 41, 166, 0, 0, 0, 0, 0, 0, 0, 166, 41, 0, 20], [22, 0, 41, 166, 0, 0, 0, 0, 0, 0, 0, 166, 41, 0, 20], [22, 0, 41, 166, 0, 0, 0, 0, 0, 0, 0, 166, 41, 0, 20], [22, 0, 0, 166, 0, 0, 0, 0, 0, 0, 0, 166, 0, 0, 20], [22, 0, 0, 166, 166, 166, 166, 166, 166, 166, 166, 166, 0, 0, 20], [22, 0, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 0, 20], [22, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 93, 0, 0, 20], [22, 149, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 149, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [0, 2, 1, 1]]);
levelMaps[0].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 0, 0, 0, 0, 94, 0, 0, 0, 94, 0, 0, 0, 0, 20], [22, 0, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 147, 94, 0, 0, 0, 94, 147, 0, 0, 0, 20], [22, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 20], [22, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 94, 94, 0, 0, 0, 94, 94, 0, 0, 0, 20], [22, 94, 0, 0, 0, 94, 0, 5, 0, 94, 0, 0, 0, 94, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 12, 13, 0, 0, 0, 20], [22, 0, 0, 94, 0, 94, 0, 0, 0, 94, 0, 94, 0, 0, 20], [22, 0, 94, 0, 0, 94, 10, 0, 0, 94, 0, 0, 94, 0, 20], [22, 145, 0, 0, 0, 94, 4, 0, 10, 94, 0, 0, 0, 145, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [0, 0, 4, 3]]);
levelMaps[1].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 149, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 65, 68, 69, 68, 65, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 83, 135, 135, 135, 80, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 80, 135, 193, 135, 80, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 80, 135, 135, 135, 84, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 65, 68, 68, 68, 65, 0, 20], [22, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 93, 93, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 115, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [1, 0, 1, 2]]);
levelMaps[1].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 148, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, 151, 20], [22, 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 123, 123, 123, 123, 123, 123, 123, 123, 0, 0, 0, 0, 20], [22, 0, 123, 123, 123, 123, 123, 123, 123, 123, 0, 0, 0, 0, 20], [22, 0, 123, 133, 133, 133, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 113, 133, 193, 133, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 123, 133, 133, 133, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 123, 123, 123, 123, 123, 123, 123, 123, 0, 0, 0, 0, 20], [22, 0, 123, 123, 123, 123, 123, 123, 123, 123, 0, 0, 0, 0, 20], [22, 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 148, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, 151, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [0, 0, 1, 2]]);
levelMaps[2].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 93, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 40, 40, 40, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 40, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 40, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 40, 40, 0, 0, 0, 0, 16, 0, 0, 0, 0, 20], [22, 0, 0, 40, 40, 0, 0, 0, 0, 16, 0, 0, 0, 0, 20], [22, 40, 40, 40, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 93, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [0, 0, 2, 2, 2]]);
levelMaps[2].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 94, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 150, 94, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 94, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 148, 94, 94, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 94, 165, 165, 165, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 94, 165, 165, 165, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 94, 165, 165, 165, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 148, 94, 94, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 94, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 150, 94, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 94, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 193, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [4, 2, 2, 2]]);
levelMaps[3].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 0, 134, 134, 134, 134, 0, 0, 0, 134, 134, 134, 134, 0, 20], [22, 0, 134, 134, 134, 134, 134, 0, 134, 134, 134, 134, 134, 0, 20], [22, 0, 134, 134, 134, 134, 134, 0, 134, 134, 134, 134, 134, 0, 20], [22, 0, 134, 134, 124, 124, 124, 124, 124, 124, 124, 134, 134, 0, 20], [22, 0, 134, 134, 124, 124, 124, 124, 124, 124, 124, 134, 134, 0, 20], [22, 134, 134, 134, 124, 124, 0, 0, 0, 124, 124, 134, 134, 134, 20], [22, 0, 134, 134, 134, 134, 0, 0, 0, 134, 134, 134, 134, 0, 20], [22, 0, 134, 134, 124, 124, 0, 114, 0, 124, 124, 134, 134, 0, 20], [22, 0, 134, 134, 124, 124, 124, 124, 124, 124, 124, 134, 134, 0, 20], [22, 0, 134, 134, 124, 124, 124, 124, 124, 124, 124, 134, 134, 0, 20], [22, 0, 134, 134, 134, 134, 134, 0, 134, 134, 134, 134, 134, 0, 20], [22, 0, 0, 134, 134, 134, 134, 0, 134, 134, 134, 134, 0, 0, 20], [22, 149, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 149, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [0, 0, 3, 2]]);
levelMaps[3].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 41, 41, 41, 41, 41, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 41, 41, 41, 41, 41, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 147, 0, 0, 0, 0, 0, 147, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 95, 95, 95, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 95, 193, 95, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 95, 95, 95, 0, 0, 0, 0, 0, 20], [22, 0, 0, 144, 0, 0, 0, 0, 0, 0, 0, 144, 0, 0, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [0, 0, 3, 2]]);
levelMaps[4].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 40, 40, 40, 0, 40, 40, 40, 0, 0, 0, 20], [22, 0, 0, 0, 40, 56, 56, 56, 56, 56, 40, 0, 0, 0, 20], [22, 0, 0, 0, 40, 56, 56, 56, 56, 56, 40, 0, 0, 0, 20], [22, 0, 0, 0, 0, 56, 56, 56, 56, 56, 0, 0, 0, 0, 20], [22, 0, 0, 0, 40, 56, 56, 56, 56, 56, 40, 0, 0, 0, 20], [22, 0, 0, 0, 40, 56, 56, 56, 56, 56, 40, 0, 0, 0, 20], [22, 0, 0, 0, 40, 40, 40, 0, 40, 40, 40, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [0, 1, 1, 3]]);
levelMaps[4].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 61, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 11, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 134, 134, 134, 124, 134, 134, 134, 0, 0, 0, 20], [22, 0, 0, 0, 134, 0, 0, 0, 0, 0, 134, 0, 0, 0, 20], [22, 0, 0, 0, 134, 0, 0, 0, 1, 0, 134, 0, 0, 0, 20], [22, 0, 0, 0, 124, 0, 0, 0, 0, 0, 124, 0, 0, 0, 20], [22, 0, 0, 0, 134, 0, 0, 114, 0, 0, 134, 0, 0, 0, 20], [22, 0, 0, 0, 1, 134, 134, 124, 134, 134, 0, 0, 0, 0, 20], [22, 0, 0, 147, 0, 0, 0, 0, 0, 0, 0, 145, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [0, 0, 3, 4]]);
levelMaps[5].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 144, 0, 20], [22, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 20], [22, 0, 0, 0, 0, 144, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 65, 68, 68, 68, 65, 72, 68, 68, 68, 65, 0, 20], [22, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 20], [22, 122, 122, 122, 0, 0, 0, 80, 0, 132, 132, 132, 0, 0, 20], [22, 122, 122, 122, 0, 5, 0, 80, 0, 41, 41, 41, 5, 0, 20], [22, 112, 122, 122, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 20], [22, 132, 122, 122, 0, 0, 0, 80, 0, 92, 92, 92, 0, 0, 20], [22, 122, 122, 122, 0, 4, 0, 65, 0, 92, 92, 92, 0, 0, 20], [22, 0, 0, 0, 3, 0, 0, 0, 0, 92, 92, 92, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [1, 0, 2, 3]]);
levelMaps[5].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 92, 92, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 144, 0, 1, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 92, 92, 92, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 20], [22, 0, 0, 92, 92, 92, 1, 0, 3, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 1, 146, 0, 0, 0, 0, 0, 20], [22, 92, 92, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 20], [22, 0, 0, 0, 145, 0, 0, 0, 5, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 0, 0, 0, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [4, 0, 1, 2]]);
levelMaps[5].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 40, 40, 40, 0, 40, 40, 40, 0, 0, 0, 20], [22, 0, 0, 0, 40, 56, 56, 56, 56, 56, 40, 0, 0, 0, 20], [22, 0, 0, 0, 40, 56, 56, 56, 56, 56, 40, 0, 0, 0, 20], [22, 0, 0, 0, 0, 56, 56, 56, 56, 56, 0, 0, 0, 0, 20], [22, 0, 0, 0, 40, 56, 56, 56, 56, 56, 40, 0, 0, 0, 20], [22, 0, 0, 0, 40, 56, 56, 56, 56, 56, 40, 0, 0, 0, 20], [22, 0, 0, 0, 40, 40, 40, 0, 40, 40, 40, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [0, 1, 1, 3]]);
levelMaps[5].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 20], [22, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 65, 68, 68, 68, 68, 68, 68, 68, 65, 0, 0, 20], [22, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 20], [22, 0, 0, 80, 0, 124, 124, 124, 124, 124, 0, 80, 0, 3, 20], [22, 0, 0, 80, 0, 124, 145, 0, 124, 124, 0, 84, 0, 0, 20], [22, 0, 0, 80, 0, 124, 124, 0, 124, 124, 0, 80, 0, 0, 20], [22, 0, 0, 80, 0, 124, 124, 0, 146, 124, 0, 80, 0, 0, 20], [22, 0, 0, 80, 0, 124, 124, 124, 124, 124, 0, 80, 0, 0, 20], [22, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 20], [22, 0, 3, 65, 68, 68, 68, 68, 68, 78, 68, 65, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [0, 0, 1, 3]]);
levelMaps[5].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 144, 20], [22, 56, 56, 62, 56, 56, 56, 62, 56, 56, 60, 56, 59, 56, 20], [22, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 20], [22, 56, 56, 62, 45, 48, 48, 48, 48, 48, 47, 56, 56, 56, 20], [22, 56, 56, 62, 51, 42, 42, 42, 42, 42, 49, 61, 56, 56, 20], [22, 56, 56, 56, 51, 42, 42, 42, 42, 42, 49, 56, 56, 56, 20], [22, 56, 58, 56, 51, 42, 42, 42, 42, 42, 49, 56, 56, 56, 20], [22, 56, 56, 62, 51, 42, 42, 42, 42, 42, 49, 56, 56, 56, 20], [22, 56, 56, 62, 51, 42, 42, 42, 42, 42, 49, 56, 56, 56, 20], [22, 56, 56, 62, 46, 50, 50, 50, 50, 50, 44, 56, 56, 56, 20], [22, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 20], [22, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 20], [22, 144, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 57, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [0, 0, 1, 2]]);
levelMaps[5].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 20], [22, 0, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 0, 20], [22, 0, 165, 28, 28, 28, 28, 0, 28, 28, 28, 28, 165, 0, 20], [22, 0, 165, 28, 145, 0, 0, 0, 0, 0, 1, 28, 165, 0, 20], [22, 0, 165, 28, 0, 0, 0, 0, 0, 0, 0, 28, 165, 3, 20], [22, 0, 165, 28, 0, 0, 0, 0, 0, 0, 0, 28, 165, 0, 20], [22, 0, 165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 165, 0, 20], [22, 0, 165, 28, 197, 199, 197, 0, 0, 0, 0, 28, 165, 0, 20], [22, 0, 165, 28, 198, 187, 198, 0, 0, 0, 0, 28, 165, 0, 20], [22, 0, 165, 28, 197, 199, 197, 0, 0, 0, 145, 28, 165, 0, 20], [22, 0, 165, 28, 28, 28, 28, 0, 28, 28, 28, 28, 165, 0, 20], [22, 0, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 0, 20], [22, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [0, 0, 2, 3]]);
levelMaps[5].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 197, 197, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 193, 197, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [2, 1, 1, 3, 2, 2, 1]]);
levelMaps[5].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 149, 92, 0, 0, 0, 0, 0, 92, 148, 0, 0, 20], [22, 0, 0, 92, 92, 0, 0, 0, 0, 0, 92, 92, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 92, 92, 0, 0, 0, 0, 0, 92, 92, 0, 0, 20], [22, 0, 0, 148, 92, 0, 0, 0, 0, 0, 92, 149, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [0, 0, 2, 3]]);
levelMaps[5].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 145, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 65, 68, 68, 71, 68, 68, 68, 68, 68, 72, 68, 68, 65, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 65, 68, 68, 68, 69, 68, 68, 68, 68, 70, 68, 73, 65, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 20], [22, 145, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 146, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [0, 0, 4, 2]]);
levelMaps[5].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 40, 40, 40, 40, 40, 40, 0, 40, 40, 40, 40, 40, 40, 20], [22, 40, 40, 40, 40, 40, 40, 0, 40, 40, 40, 40, 40, 40, 20], [22, 40, 40, 40, 40, 40, 40, 0, 40, 40, 40, 40, 40, 40, 20], [22, 40, 40, 40, 146, 0, 0, 0, 0, 0, 147, 40, 40, 40, 20], [22, 40, 40, 40, 0, 0, 0, 0, 0, 0, 0, 40, 40, 40, 20], [22, 40, 40, 40, 0, 0, 0, 0, 0, 0, 0, 40, 40, 40, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 40, 40, 40, 1, 0, 0, 0, 0, 0, 0, 40, 40, 40, 20], [22, 40, 40, 40, 0, 0, 0, 0, 0, 0, 0, 40, 40, 40, 20], [22, 40, 40, 40, 144, 0, 0, 0, 0, 0, 145, 40, 40, 40, 20], [22, 40, 40, 40, 40, 40, 40, 0, 40, 40, 40, 40, 40, 40, 20], [22, 40, 40, 40, 40, 40, 40, 0, 40, 40, 40, 40, 40, 40, 20], [22, 40, 40, 40, 40, 40, 40, 0, 40, 40, 40, 40, 40, 40, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [0, 1, 4]]);
levelMaps[5].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 94, 94, 0, 0, 0, 0, 0, 94, 94, 0, 0, 20], [22, 0, 0, 149, 94, 0, 0, 0, 0, 0, 149, 94, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 166, 166, 0, 0, 0, 0, 0, 166, 166, 0, 0, 20], [22, 0, 0, 94, 166, 166, 0, 0, 0, 166, 166, 94, 0, 0, 20], [22, 0, 0, 94, 94, 166, 0, 0, 0, 166, 94, 94, 0, 0, 20], [22, 0, 0, 145, 94, 94, 1, 1, 1, 94, 94, 145, 0, 0, 20], [22, 199, 197, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 193, 198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [0, 0, 4, 1]]);
levelMaps[5].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 144, 0, 0, 0, 0, 0, 94, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 41, 0, 0, 0, 94, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 94, 0, 0, 20], [22, 0, 0, 0, 0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 41, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 145, 0, 0, 0, 0, 0, 0, 0, 147, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [2, 0, 4, 1]]);
exitMaps = [];
var i = 0;
while (i < 6) {
exitMaps[i] = [];
i++;
}
exitMaps[4].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 207, 0, 0, 20], [22, 0, 0, 0, 0, 165, 165, 165, 165, 165, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 165, 0, 0, 145, 165, 0, 0, 0, 0, 20], [22, 0, 1, 0, 0, 165, 0, 0, 0, 165, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 165, 0, 0, 0, 165, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 165, 145, 0, 0, 165, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 165, 165, 165, 165, 165, 0, 0, 0, 0, 20], [22, 199, 199, 199, 197, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 153, 154, 155, 198, 0, 5, 0, 0, 0, 1, 0, 0, 0, 20], [22, 156, 217, 157, 198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 158, 159, 160, 198, 0, 0, 0, 0, 0, 0, 6, 0, 0, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [1, 1, 1]]);
exitMaps[0].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 4, 0, 0, 0, 208, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 92, 92, 0, 0, 0, 92, 92, 0, 0, 0, 20], [22, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 20], [22, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 20], [22, 199, 199, 199, 197, 42, 42, 42, 42, 42, 42, 42, 42, 42, 20], [22, 153, 154, 155, 198, 62, 60, 62, 62, 60, 60, 60, 56, 56, 20], [22, 156, 217, 157, 198, 56, 56, 56, 56, 56, 61, 57, 56, 56, 20], [22, 158, 159, 160, 198, 62, 56, 56, 58, 56, 57, 6, 57, 145, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [2, 1, 1]]);
exitMaps[1].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 145, 122, 56, 56, 56, 56, 56, 56, 56, 56, 56, 122, 144, 20], [22, 122, 122, 56, 56, 56, 56, 56, 56, 56, 56, 56, 122, 122, 20], [22, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 20], [22, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 20], [22, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 20], [22, 56, 6, 0, 1, 56, 56, 56, 56, 56, 56, 56, 56, 56, 20], [22, 56, 0, 207, 0, 56, 112, 56, 56, 56, 56, 56, 56, 56, 20], [22, 56, 0, 6, 3, 56, 56, 56, 56, 56, 56, 56, 56, 56, 20], [22, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 20], [22, 56, 56, 56, 56, 56, 56, 56, 56, 56, 197, 199, 199, 199, 20], [22, 56, 56, 56, 56, 56, 56, 56, 56, 56, 198, 153, 154, 155, 20], [22, 122, 122, 56, 56, 56, 56, 56, 56, 56, 198, 156, 217, 157, 20], [22, 145, 122, 56, 56, 56, 56, 56, 56, 56, 198, 158, 159, 160, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [2, 1, 1]]);
exitMaps[3].push([[24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 25], [22, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 0, 20], [22, 0, 92, 92, 0, 0, 0, 0, 0, 92, 92, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 20], [22, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20], [22, 0, 0, 0, 1, 0, 3, 0, 0, 0, 197, 199, 199, 199, 20], [22, 0, 0, 92, 92, 0, 0, 92, 92, 0, 198, 153, 154, 155, 20], [22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 198, 156, 217, 157, 20], [22, 145, 0, 0, 0, 0, 0, 0, 0, 145, 198, 158, 159, 160, 20], [26, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 27], [3, 1, 1]]);
Sprite.prototype.getAngle = function (x, y) {
return(Math.atan2(y - this.y, x - this.x) / PiRads);
};
Sprite.prototype.getTile = function () {
return(currentRoom.tiles[Math.floor(this.y / tileH)][Math.floor(this.x / tileW)]);
};
Sprite.prototype.hurtMe = function (damage) {
var _local3 = 0;
while ((this.armour > 0) && (damage > 0)) {
this.armour = this.armour - 2;
damage = damage - 2;
_local3++;
}
damage = damage + _local3;
this.hp = this.hp - damage;
if (this.hp <= 0) {
this.hittable = false;
this.mc.gotoAndPlay("destroy");
this.mc.swapDepths(deadDepth + (deadD++));
if (deadD > 199) {
deadD = 0;
}
if (this != p) {
if ((--currentRoom.possibleEnemies) == 0) {
currentRoom.allKilledFunc();
}
delete currentRoom.currentEnemies[this.num];
}
} else {
this.mc.gotoAndPlay("hurt");
}
p.doHealth();
p.doArmour();
};
Sprite.prototype.moveChar = function (dirx, diry) {
var _local12 = null;
this.dirx = dirx;
this.diry = diry;
var _local6 = this.getTile();
var _local5 = _local6.speedFactor * this.speed;
if (diry != 0) {
this.getCorners(this.x, this.y + (_local5 * diry));
var _local3 = 0;
if (diry == -1) {
if (this.upleft and this.upright) {
_local3 = _local5 * diry;
this.y = this.y + _local3;
} else {
this.y = (this.yTile * tileH) + this.rad;
}
}
if (diry == 1) {
if (this.downleft and this.downright) {
_local3 = _local5 * diry;
this.y = this.y + _local3;
} else {
this.y = ((this.yTile + 1) * tileH) - this.rad;
}
}
}
if (dirx != 0) {
this.getCorners(this.x + (_local5 * dirx), this.y);
var _local4 = 0;
if (dirx == -1) {
if (this.downleft and this.upleft) {
_local4 = _local5 * dirx;
this.x = this.x + _local4;
} else {
this.x = (this.xTile * tileW) + this.rad;
}
}
if (dirx == 1) {
if (this.upright and this.downright) {
_local4 = _local5 * dirx;
this.x = this.x + _local4;
} else {
this.x = ((this.xTile + 1) * tileW) - this.rad;
}
}
}
for (var _local9 in currentRoom.currentEnemies) {
var _local2 = currentRoom.currentEnemies[_local9];
if (_local2 != this) {
var _local11 = this.x - _local2.x;
var _local10 = this.y - _local2.y;
if (Math.sqrt((_local11 * _local11) + (_local10 * _local10)) < ((_local2.rad + this.rad) - 1)) {
if ((_local4 > 0) && (this.x < _local2.x)) {
this.x = this.x - _local4;
} else if ((_local4 < 0) && (this.x > _local2.x)) {
this.x = this.x - _local4;
}
if ((_local3 > 0) && (this.y < _local2.y)) {
this.y = this.y - _local3;
} else if ((_local3 < 0) && (this.y > _local2.y)) {
this.y = this.y - _local3;
}
}
}
}
if (this == p) {
if (_local6 != this.currentTile) {
this.currentTile = _local6;
_local6.walkFunction(this);
}
} else {
if (_local6 != this.currentTile) {
this.currentTile = _local6;
}
var _local11 = this.x - p.x;
var _local10 = this.y - p.y;
if (Math.sqrt((_local11 * _local11) + (_local10 * _local10)) < ((p.rad + this.rad) - 1)) {
this.mc.mc.gotoAndPlay("hittingPlayer");
p.hurtMe(this.hitDamage);
this.free = false;
_local12 = this.getAngle(p.x, p.y) + 90;
if ((_local4 > 0) && (this.x < p.x)) {
this.x = this.x - _local4;
} else if ((_local4 < 0) && (this.x > p.x)) {
this.x = this.x - _local4;
}
if ((_local3 > 0) && (this.y < p.y)) {
this.y = this.y - _local3;
} else if ((_local3 < 0) && (this.y > p.y)) {
this.y = this.y - _local3;
}
} else if ((Math.abs(this.mc._x - this.x) + Math.abs(this.mc._y - this.y)) > 0.2) {
_local12 = this.getAngle(this.mc._x, this.mc._y) - 90;
this.mc.mc.walk.play();
this.moving = true;
} else {
this.mc.mc.walk.stop();
this.moving = false;
}
}
this.mc._x = this.x;
this.mc._y = this.y;
this.xTile = Math.floor(this.mc._x / tileW);
this.yTile = Math.floor(this.mc._y / tileH);
return(_local12);
};
Shot.extend(Sprite);
Shot.prototype.doSplashDamge = function () {
for (var _local3 in currentRoom.currentEnemies) {
var _local2 = currentRoom.currentEnemies[_local3];
var _local5 = this.x - _local2.x;
var _local4 = this.y - _local2.y;
if (Math.sqrt((_local5 * _local5) + (_local4 * _local4)) < (_local2.rad + this.splashRadius)) {
_local2.hurtMe(this.power);
}
}
var _local5 = this.x - p.x;
var _local4 = this.y - p.y;
if (Math.sqrt((_local5 * _local5) + (_local4 * _local4)) < (p.rad + this.power)) {
p.hurtMe(this.power);
}
};
Enemy.prototype.doShot = function (direction, i) {
this.mc.mc.gotoAndPlay("shooting");
if (direction == "atPlayer") {
var _local2 = this.getAngle(p.x, p.y);
} else {
var _local2 = direction;
}
var _local3 = new Shot(this.shotType[i], this.x, this.y, this.shotPower[i], _local2, false);
};
Player.prototype.doShot = function () {
var _local9 = shotBehaviours[this.shotType];
var _local3 = _local9.levels[this.weapons[this.shotType]];
var _local5 = getAngle(this.x, this.y, _xmouse - roomX, _ymouse - roomY) - 90;
var _local7 = this.xDispl * Math.cos((_local5 - 180) * PiRads);
var _local6 = this.yDispl * Math.sin((_local5 - 180) * PiRads);
_local5 = _local5 + (2 - (Math.random() * 4));
var _local2 = 0;
while (_local2 < _local3.length) {
var _local4 = new Shot(this.shotType, this.x + _local7, this.y + _local6, _local3[_local2].power, (_local3[_local2].angle + _local5) + 90, true);
_local2++;
}
if (sfxOn) {
var _local8 = new Sound();
_local8.attachSound(_local9.soundN);
_local8.start();
}
if (this.shotType > 0) {
while (((--this.ammo[this.shotType]) <= 0) && (this.shotType > 0)) {
this.shotType--;
}
this.changeAmmo();
}
this.mc.mc.gotoAndPlay("shooting" + this.shotType);
};
Player.prototype.changeAmmo = function () {
if (this.shotType == 0) {
gui.weaponButton0.light.gotoAndStop("inUse");
gui.ammo = "999";
} else {
gui.weaponButton0.light.gotoAndStop("available");
}
gui.weaponButton0.gotoAndStop(1);
gui.weaponButton0.onRelease = chooseWeapon;
var _local2 = 1;
while (_local2 < 5) {
gui["weaponButton" + _local2].gotoAndStop(1);
if (this.ammo[_local2] > 0) {
if (this.shotType == _local2) {
gui["weaponButton" + _local2].light.gotoAndStop("inUse");
gui.ammo = this.ammo[_local2];
} else {
gui["weaponButton" + _local2].light.gotoAndStop("available");
}
gui["weaponButton" + _local2].onRelease = chooseWeapon;
} else {
gui["weaponButton" + _local2].light.gotoAndStop("unavailable");
delete gui["weaponButton" + _local2].onRelease;
}
_local2++;
}
};
var i = 0;
while (i < 5) {
gui["weaponButton" + i].num = i;
i++;
}
shotBehaviours = [];
shotBehaviours[0] = new defShotObj();
shotBehaviours[1] = new sqrShotObj();
shotBehaviours[2] = new plasmaObj();
shotBehaviours[3] = new missileObj();
shotBehaviours[4] = new mineObj();
Player.extend(Sprite);
Player.prototype.addMC = function (entryPoint) {
this.mc = theScreen.attachMovie("_lchar", "char", playerDepth);
if ((entryPoint.num == 4) || (roomsDone == 1)) {
var _local4 = currentRoom.map[currentRoom.map.length - 1][0];
this.xTile = telePortPos[_local4].x;
this.yTile = telePortPos[_local4].y - 1;
var _local3 = theScreen.attachMovie("_lteleportInStuff", "ex" + exNum, explosionsDepth + exNum);
_local3._x = (this.xTile * tileW) + (tileW / 2);
_local3._y = (this.yTile * tileW) + (tileW / 2);
if ((++exNum) > 50) {
exNum = 0;
}
theScreen.countDown = 5;
theScreen.onEnterFrame = function () {
if ((this.countDown--) == 0) {
delete this.countDown;
currentRoom.startLevel();
}
};
} else {
this.xTile = startX0[entryPoint.num];
this.yTile = startY0[entryPoint.num];
this.sDir = entryPoint.num;
theScreen.countDown = 10;
theScreen.yDest = (startY1[entryPoint.num] * tileH) + (tileH / 2);
theScreen.xDest = (startX1[entryPoint.num] * tileW) + (tileW / 2);
theScreen.onEnterFrame = function () {
if ((this.countDown--) <= 0) {
delete this.countDown;
currentRoom.startLevel();
} else {
switch (p.sDir) {
case 0 :
if (p.y > this.yDest) {
p.moveChar(0, -1);
p.mc._rotation = 180;
}
break;
case 1 :
if (p.x > this.xDest) {
p.moveChar(-1, 0);
p.mc._rotation = 90;
}
break;
case 2 :
if (p.x < this.xDest) {
p.moveChar(1, 0);
p.mc._rotation = -90;
}
break;
case 3 :
if (p.y >= this.yDest) {
break;
}
p.moveChar(0, 1);
p.mc._rotation = 0;
}
}
};
}
this.x = (this.xTile * tileW) + (tileW / 2);
this.y = (this.yTile * tileH) + (tileH / 2);
this.currentTile = this.getTile();
this.mc._x = this.x;
this.mc._y = this.y;
this.mc.myObject = this;
this.hittable = true;
this.mc.gotoAndStop(this.frame);
this.changeAmmo();
this.doArmour();
this.doHealth();
};
Player.prototype.hurtMe = function (damage) {
if (sfxOn) {
var _local4 = new Sound();
_local4.attachSound("_lhitSound0");
_local4.start();
}
var _local3 = 0;
while ((this.armour > 0) && (damage > 0)) {
this.armour = this.armour - 2;
damage = damage - 2;
_local3++;
}
if (this.armour < 0) {
this.armout = 0;
}
damage = damage + _local3;
this.hp = this.hp - damage;
if (this.hp <= 0) {
this.hp = 0;
this.hittable = false;
this.mc.gotoAndPlay("destroy");
this.mc.swapDepths(deadDepth + (deadD++));
if (deadD > 199) {
deadD = 0;
}
gameOver();
} else {
this.mc.gotoAndPlay("hurt");
}
this.doHealth();
this.doArmour();
};
Player.prototype.doHealth = function () {
if (this.hp > 0) {
gui.health.gotoAndStop(100 - Math.floor((99 / this.maxhp) * this.hp));
} else {
gui.health.gotoAndStop(100);
}
};
Player.prototype.doArmour = function () {
if (this.armour > 0) {
gui.armour.gotoAndStop(100 - Math.floor((99 / this.maxArmour) * this.armour));
} else {
gui.armour.gotoAndStop(100);
}
};
Player.prototype.getCorners = function (x, y) {
downY = Math.floor(((y + this.rad) - 1) / tileH);
upY = Math.floor((y - this.rad) / tileH);
leftX = Math.floor((x - this.rad) / tileW);
rightX = Math.floor(((x + this.rad) - 1) / tileW);
this.upleft = currentRoom.tiles[upY][leftX].walkable;
this.downleft = currentRoom.tiles[downY][leftX].walkable;
this.upright = currentRoom.tiles[upY][rightX].walkable;
this.downright = currentRoom.tiles[downY][rightX].walkable;
};
Room.prototype.makeRoom = function (entryPoint) {
theScreen = _root.createEmptyMovieClip("screen", screenDepth);
theScreen._x = roomX;
theScreen._y = roomY;
theScreen.onPress = playerShoot;
count = 0;
p.lastShot = 0;
n = 0;
exNum = 0;
var _local10 = this.map;
this.condition = _local10[_local10.length - 1][1];
this.tiles = [];
this.bullets = [];
this.mines = [];
this.efTiles = [];
this.doorTiles = [];
this.entryTiles = [];
this.switchT = [];
this.ccT = [];
this.barrierA = [];
this.possibleEnemies = 0;
this.allKilledFunc = null;
tileD = 0;
enemyD = 0;
deadD = 0;
minesD = 0;
var _local3 = [];
if ((entryPoint.num == 4) || (roomsDone == 1)) {
var _local18 = _local10[_local10.length - 1][0];
var _local13 = telePortPos[_local18].x;
var _local14 = telePortPos[_local18].y - 1;
} else {
var _local13 = startX1[entryPoint.num];
var _local14 = startY1[entryPoint.num];
}
var _local9 = 0;
while (_local9 < mapHeight) {
this.tiles[_local9] = [];
var _local5 = 0;
while (_local5 < mapWidth) {
var _local7 = _local10[_local9][_local5];
this.tiles[_local9][_local5] = new Tile(_local7, _local9, _local5);
if (this.tiles[_local9][_local5].freeTile) {
if ((Math.abs(_local13 - _local5) + Math.abs(_local14 - _local9)) > 5) {
_local3.push(this.tiles[_local9][_local5]);
}
}
_local5++;
}
_local9++;
}
_local9 = 0;
while (_local9 < 4) {
if (this.doors[_local9] != null) {
var _local5 = 0;
while (_local5 < doorPos[_local9].length) {
var _local16 = this.tiles[doorPos[_local9][_local5].y][doorPos[_local9][_local5].x];
_local16.changeTileTo(161 + _local9);
_local16.num = _local9;
_local16.onTile = tileDesc[161 + _local9].onTile;
_local16.offTile = tileDesc[161 + _local9].offTile;
this.doorTiles.push(_local16);
_local5++;
}
}
_local9++;
}
switch (entryPoint.num) {
case 0 :
var _local12 = 3;
break;
case 1 :
_local12 = 2;
break;
case 2 :
_local12 = 1;
break;
case 3 :
_local12 = 0;
break;
case 4 :
_local12 = 4;
}
if (_local12 < 4) {
var _local5 = 0;
while (_local5 < doorPos[_local12].length) {
this.entryTiles.push(this.tiles[doorPos[_local12][_local5].y][doorPos[_local12][_local5].x]);
_local5++;
}
} else {
var _local18 = _local10[_local10.length - 1][0];
this.entryTiles.push(this.tiles[telePortPos[_local18].y][telePortPos[_local18].x]);
this.entryTiles.push(this.tiles[telePortPos[_local18].y - 1][telePortPos[_local18].x]);
}
if (this.doors[4] != null) {
var _local18 = _local10[_local10.length - 1][0];
var _local16 = this.tiles[telePortPos[_local18].y][telePortPos[_local18].x];
_local16.changeTileTo(175);
_local16.onTile = tileDesc[175].onTile;
_local16.offTile = tileDesc[175].offTile;
_local16.num = 4;
this.doorTiles.push(_local16);
_local18 = _local10[_local10.length - 1][0];
_local16 = this.tiles[telePortPos[_local18].y - 1][telePortPos[_local18].x];
_local16.changeTileTo(176);
_local16.onTile = tileDesc[176].onTile;
_local16.offTile = tileDesc[176].offTile;
this.doorTiles.push(_local16);
}
var _local19 = _local10[_local10.length];
this.currentEnemies = [];
var _local15 = _local10[_local10.length - 1];
_local9 = 2;
while (_local9 < _local15.length) {
var _local8 = enemiesDef[_local15[_local9]];
var _local5 = 0;
while (_local5 < _local8.length) {
var _local4 = Math.floor(Math.random() * _local3.length);
while (_local3[_local4] == "used") {
_local4 = Math.floor(Math.random() * _local3.length);
}
var _local11 = new _local8[_local5](enemyD++, _local3[_local4].x, _local3[_local4].y);
_local3[_local4] = "used";
_local5++;
}
_local9++;
}
_local9 = 0;
while (_local9 < mapHeight) {
var _local5 = 0;
while (_local5 < mapWidth) {
var _local6 = this.tiles[_local9][_local5];
if (_local6.initFunc != null) {
_local6.initFunc();
}
_local5++;
}
_local9++;
}
p.addMC(entryPoint);
};
Room.prototype.startLevel = function () {
canPause = true;
gui.options.onRelease = pauseGame;
if ((this.condition > 0) && (!this.done)) {
switch (this.condition) {
case 1 :
if ((level > 1) || (this.isExit)) {
lockDoors();
} else {
lockEntryDoor();
}
this.allKilledFunc = openDoors;
break;
case 2 :
if ((level > 1) || (this.isExit)) {
lockDoors();
} else {
lockEntryDoor();
this.allKilledFunc = openEntryDoor;
}
this.colourUnlock = true;
}
} else {
this.colourUnlock = false;
this.allKilledFunc = openEntryDoor;
lockEntryDoor();
}
};
mapBack._visible = false;
mapBack.onRelease = removeMap;
sfxOn = true;
musicOn = true;
setMusicVolume(50);
buildUpgradeBase();
buildSupplyBase();
buildSpecialBase();
bosses = [Boss0, Boss1];
Tile.prototype.changeTileTo = function (tNum) {
delete currentRoom.efTiles[this.id];
this.tType = tNum;
var _local2 = tileDesc[this.tType];
this.walkable = _local2.walkable;
this.shootThrough = _local2.shootThrough;
this.walkFunction = _local2.walkFunction;
this.damage = _local2.damage;
this.shootFunction = _local2.shootFunction;
this.hp = _local2.hp;
this.efFunction = _local2.efFunction;
this.speedFactor = _local2.speedFactor;
this.efFunction = _local2.efFunction;
this.destroyedTile = _local2.destroyedTile;
if (this.efFunction != null) {
currentRoom.efTiles[this.id] = this;
}
this.mc.gotoAndStop(this.tType + 1);
};
Tile.prototype.makeExplosion = function () {
var _local3 = theScreen.attachMovie("_lexplosion", "ex" + exNum, explosionsDepth + exNum);
_local3._x = (this.x * tileW) + (tileW / 2);
_local3._y = (this.y * tileW) + (tileW / 2);
if ((++exNum) > 50) {
exNum = 0;
}
if (sfxOn) {
var _local2 = new Sound();
_local2.attachSound("_lexplosion0");
_local2.start();
}
};
Tile.prototype.finishTeleport = function () {
theScreen.removeMovieClip();
var _local4 = currentRoom.doors[4];
if (_local4.dest.isTeleporter) {
currentRoom = _local4.dest.myRoom;
row = currentRoom.row;
collumn = currentRoom.collumn;
mapRow[row][collumn].makeRoom(_local4);
} else {
var _local2 = Math.floor(Math.random() * sSize);
var _local3 = Math.floor(Math.random() * sSize);
while (mapRow[_local3][_local2] != undefined) {
_local2 = Math.floor(Math.random() * sSize);
_local3 = Math.floor(Math.random() * sSize);
}
row = _local3;
collumn = _local2;
var _local5 = new Room(1, row, collumn, this.exitRoute, _local4);
_local4.dest = _local5.doors[4];
}
};
showStart();
stop();
Symbol 15 MovieClip Frame 1
stop();
Symbol 15 MovieClip Frame 2
play();
Symbol 15 MovieClip Frame 11
this._parent.myObject.free = true;
Symbol 15 MovieClip Frame 12
play();
Symbol 15 MovieClip Frame 18
this._parent.myObject.free = true;
Symbol 22 MovieClip [_lSludgeman] Frame 1
stop();
Symbol 22 MovieClip [_lSludgeman] Frame 9
if (this.myObject.hittable) {
gotoAndStop (1);
}
Symbol 22 MovieClip [_lSludgeman] Frame 10
play();
Symbol 22 MovieClip [_lSludgeman] Frame 30
this.removeMovieClip();
Symbol 33 MovieClip [_lexplosion] Frame 1
ex0._x = (Math.random() * 12) - 6;
ex0._y = (Math.random() * 12) - 6;
Symbol 33 MovieClip [_lexplosion] Frame 5
ex1._x = (Math.random() * 12) - 6;
ex1._y = (Math.random() * 12) - 6;
Symbol 33 MovieClip [_lexplosion] Frame 8
ex2._x = (Math.random() * 12) - 6;
ex2._y = (Math.random() * 12) - 6;
Symbol 33 MovieClip [_lexplosion] Frame 18
this.removeMovieClip();
Symbol 46 MovieClip [_lbullet] Frame 1
stop();
Symbol 46 MovieClip [_lbullet] Frame 2
play();
Symbol 46 MovieClip [_lbullet] Frame 6
this.removeMovieClip();
Symbol 51 MovieClip [_linfo] Frame 28
this.removeMovieClip();
Symbol 62 MovieClip [_lmine] Frame 1
stop();
Symbol 62 MovieClip [_lmine] Frame 2
play();
Symbol 62 MovieClip [_lmine] Frame 10
this.removeMovieClip();
Symbol 72 MovieClip Frame 11
gotoAndPlay ("loop");
Symbol 77 MovieClip [_lmissile] Frame 1
stop();
Symbol 77 MovieClip [_lmissile] Frame 2
play();
Symbol 77 MovieClip [_lmissile] Frame 11
this.removeMovieClip();
Symbol 88 MovieClip [_lplasma] Frame 1
stop();
Symbol 88 MovieClip [_lplasma] Frame 2
play();
Symbol 88 MovieClip [_lplasma] Frame 7
this.removeMovieClip();
Symbol 105 MovieClip Frame 1
stop();
Symbol 106 MovieClip [_lpowerup] Frame 12
stop();
Symbol 106 MovieClip [_lpowerup] Frame 13
play();
Symbol 106 MovieClip [_lpowerup] Frame 23
this.removeMovieClip();
Symbol 109 MovieClip [_lspawnlight] Frame 7
this.removeMovieClip();
Symbol 116 MovieClip [_lteleportInStuff] Frame 7
stop();
this.removeMovieClip();
Symbol 122 MovieClip Frame 1
this._rotation = Math.random() * 360;
this._xscale = (this._yscale = 80 + (Math.random() * 40));
gotoAndPlay(Math.ceil(Math.random() * 8));
Symbol 280 MovieClip Frame 1
stop();
Symbol 280 MovieClip Frame 2
stop();
Symbol 343 MovieClip [_ltile] Frame 1
stop();
Symbol 349 MovieClip Frame 1
Symbol 372 MovieClip Frame 1
stop();
Symbol 372 MovieClip Frame 2
play();
Symbol 372 MovieClip Frame 5
this._parent.myObject.free = true;
if (this._parent.myObject.hittable) {
gotoAndStop (1);
}
Symbol 372 MovieClip Frame 6
play();
Symbol 372 MovieClip Frame 9
this._parent.myObject.free = true;
if (this._parent.myObject.hittable) {
gotoAndStop (1);
}
Symbol 372 MovieClip Frame 10
play();
Symbol 372 MovieClip Frame 22
this._parent.myObject.free = true;
if (this._parent.myObject.hittable) {
gotoAndStop (1);
}
Symbol 373 MovieClip [_lchar] Frame 1
stop();
Symbol 373 MovieClip [_lchar] Frame 3
play();
Symbol 373 MovieClip [_lchar] Frame 6
if (this.myObject.hittable) {
gotoAndStop (1);
}
Symbol 373 MovieClip [_lchar] Frame 10
play();
Symbol 373 MovieClip [_lchar] Frame 20
this.removeMovieClip();
Symbol 373 MovieClip [_lchar] Frame 53
stop();
this._parent._parent.finishExit();
Symbol 397 MovieClip Frame 1
stop();
Symbol 397 MovieClip Frame 2
play();
Symbol 397 MovieClip Frame 17
this._parent.myObject.free = true;
Symbol 397 MovieClip Frame 18
play();
Symbol 397 MovieClip Frame 26
this._parent.myObject.free = true;
Symbol 406 MovieClip [_lZombie] Frame 1
stop();
Symbol 406 MovieClip [_lZombie] Frame 9
if (this.myObject.hittable) {
gotoAndStop (1);
}
Symbol 406 MovieClip [_lZombie] Frame 10
play();
Symbol 406 MovieClip [_lZombie] Frame 31
this.removeMovieClip();
Symbol 413 MovieClip Frame 1
stop();
Symbol 413 MovieClip Frame 2
play();
Symbol 413 MovieClip Frame 10
this._parent.myObject.free = true;
Symbol 413 MovieClip Frame 11
play();
Symbol 413 MovieClip Frame 13
this._parent.myObject.free = true;
Symbol 421 MovieClip [_lSoldier] Frame 1
stop();
Symbol 421 MovieClip [_lSoldier] Frame 9
if (this.myObject.hittable) {
gotoAndStop (1);
}
Symbol 421 MovieClip [_lSoldier] Frame 10
play();
Symbol 421 MovieClip [_lSoldier] Frame 33
this.removeMovieClip();
Symbol 430 MovieClip Frame 1
stop();
Symbol 430 MovieClip Frame 2
play();
Symbol 431 MovieClip Frame 1
play();
Symbol 431 MovieClip Frame 3
this._parent.myObject.free = true;
Symbol 434 MovieClip [_lBoss0] Frame 1
stop();
Symbol 434 MovieClip [_lBoss0] Frame 6
play();
Symbol 434 MovieClip [_lBoss0] Frame 9
if (this.myObject.hittable) {
gotoAndStop (1);
}
Symbol 434 MovieClip [_lBoss0] Frame 10
play();
Symbol 434 MovieClip [_lBoss0] Frame 45
this.removeMovieClip();
Symbol 436 MovieClip Frame 1
play();
Symbol 436 MovieClip Frame 3
this._parent.myObject.free = true;
Symbol 437 MovieClip [_lBoss1] Frame 1
stop();
Symbol 437 MovieClip [_lBoss1] Frame 6
play();
Symbol 437 MovieClip [_lBoss1] Frame 9
if (this.myObject.hittable) {
gotoAndStop (1);
}
Symbol 437 MovieClip [_lBoss1] Frame 10
play();
Symbol 437 MovieClip [_lBoss1] Frame 45
this.removeMovieClip();
Symbol 467 MovieClip Frame 1
stop();
Symbol 467 MovieClip Frame 2
stop();
Symbol 467 MovieClip Frame 3
stop();
Symbol 471 MovieClip Frame 1
stop();
Symbol 471 MovieClip Frame 2
stop();
Symbol 471 MovieClip Frame 3
stop();
Symbol 473 MovieClip Frame 1
stop();
Symbol 473 MovieClip Frame 2
stop();
Symbol 473 MovieClip Frame 3
stop();
Symbol 476 MovieClip Frame 1
stop();
Symbol 476 MovieClip Frame 2
stop();
Symbol 482 MovieClip Frame 1
stop();
Symbol 482 MovieClip Frame 2
stop();
Symbol 482 MovieClip Frame 3
stop();
Symbol 483 MovieClip Frame 1
slideConstr = 75;
slideButton.onPress = function () {
this.startDrag(false, -slideConstr, 0, slideConstr, 0);
this.gotoAndStop(2);
};
slideButton.onRelease = (slideButton.onReleaseOutside = function () {
this.stopDrag();
this.gotoAndStop(1);
var _local2 = Math.ceil((100 / (slideConstr * 2)) * (this._x + slideConstr));
this._parent._parent._parent.setMusicVolume(_local2);
});
slideButton.onRollOver = function () {
this.gotoAndStop(3);
};
slideButton.onRollOut = function () {
this.gotoAndStop(1);
};
bg.onRelease = function () {
var _local2 = Math.ceil((100 / (slideConstr * 2)) * (this._xmouse + slideConstr));
slideButton._x = this._xmouse;
this._parent._parent._parent.setMusicVolume(_local2);
};
slideButton._x = -75 + (1.5 * this._parent._parent.musicVol);
Symbol 485 MovieClip Frame 1
stop();
Symbol 485 MovieClip Frame 2
stop();
Symbol 485 MovieClip Frame 3
stop();
Symbol 487 MovieClip Frame 1
stop();
Symbol 487 MovieClip Frame 2
stop();
Symbol 487 MovieClip Frame 3
stop();
Symbol 490 MovieClip Frame 1
stop();
Symbol 490 MovieClip Frame 2
stop();
Symbol 490 MovieClip Frame 3
stop();
Symbol 491 MovieClip Frame 1
returnToGame.onRelease = this._parent.pauseGame;
viewMap.onRelease = this._parent.showMap;
sfxButton.onRelease = this._parent.toggleSFX;
musicButton.onRelease = this._parent.toggleMusic;
viewChar.onRelease = this._parent.populateStats;
quitButton.onRelease = this._parent.quitGame;
Symbol 496 MovieClip Frame 1
stop();
Symbol 496 MovieClip Frame 2
stop();
Symbol 496 MovieClip Frame 3
stop();
Symbol 505 MovieClip Frame 1
stop();
Symbol 505 MovieClip Frame 2
stop();
Symbol 510 MovieClip Frame 1
stop();
Symbol 510 MovieClip Frame 2
stop();
Symbol 515 MovieClip Frame 1
stop();
Symbol 515 MovieClip Frame 2
stop();
Symbol 520 MovieClip Frame 1
stop();
Symbol 520 MovieClip Frame 2
stop();
Symbol 528 MovieClip Frame 1
stop();
Symbol 528 MovieClip Frame 2
stop();
Symbol 528 MovieClip Frame 3
stop();
Symbol 531 MovieClip Frame 1
stop();
Symbol 531 MovieClip Frame 2
stop();
Symbol 531 MovieClip Frame 3
stop();
Symbol 534 MovieClip Frame 1
stop();
Symbol 534 MovieClip Frame 2
stop();
Symbol 534 MovieClip Frame 3
stop();
Symbol 538 MovieClip Frame 1
stop();
Symbol 538 MovieClip Frame 2
stop();
me.onRelease = function () {
getURL ("http://www.utterlysuperb.com", "_blank");
};
pnflash.onRelease = function () {
getURL ("http://www.pnflashgames.com", "_blank");
};
tonypa.onRelease = function () {
getURL ("http://www.tonypa.pri.ee/tbw/", "_blank");
};
Symbol 538 MovieClip Frame 3
stop();
Symbol 538 MovieClip Frame 4
stop();
sfxButton.onRelease = this._parent.toggleSFX;
musicButton.onRelease = this._parent.toggleMusic;
if (!this._parent.sfxOn) {
sfxTickbox.gotoAndStop(2);
}
if (!this._parent.musicOn) {
musicTickbox.gotoAndStop(2);
}
Symbol 549 MovieClip Frame 1
stop();
Symbol 549 MovieClip Frame 2
stop();
Symbol 549 MovieClip Frame 3
stop();
Symbol 563 MovieClip Frame 1
stop();
Symbol 563 MovieClip Frame 2
stop();
Symbol 625 MovieClip Frame 1
stop();
Symbol 625 MovieClip Frame 2
stop();
Symbol 625 MovieClip Frame 3
stop();
Symbol 647 MovieClip Frame 1
back.onRelease = function () {
this._parent._visible = false;
this._parent._parent.options._visible = true;
};
Symbol 658 MovieClip Frame 1
stop();
Symbol 658 MovieClip Frame 2
play();
Symbol 658 MovieClip Frame 23
this._parent.endPopulate();
Symbol 658 MovieClip Frame 72
this._visible = false;
Symbol 661 MovieClip Frame 1
stop();
Symbol 661 MovieClip Frame 2
play();
Symbol 661 MovieClip Frame 6
this.func();
Symbol 661 MovieClip Frame 10
this._visible = false;
Symbol 668 MovieClip Frame 1
stop();
Symbol 674 MovieClip Frame 1
stop();
Symbol 674 MovieClip Frame 2
stop();
Symbol 674 MovieClip Frame 3
stop();
Symbol 679 MovieClip Frame 1
stop();
Symbol 679 MovieClip Frame 2
stop();
Symbol 684 MovieClip Frame 1
stop();
Symbol 684 MovieClip Frame 2
stop();
Symbol 689 MovieClip Frame 1
stop();
Symbol 689 MovieClip Frame 2
stop();
Symbol 694 MovieClip Frame 1
stop();
Symbol 694 MovieClip Frame 2
stop();
Symbol 699 MovieClip Frame 1
stop();
Symbol 699 MovieClip Frame 2
stop();
Symbol 702 MovieClip Frame 1
stop();
Symbol 702 MovieClip Frame 2
stop();
Symbol 710 MovieClip Frame 1
stop();