Frame 1
MovieClip.prototype.tween = function (prop, target, a, s) {
var _local3 = this;
var _local2 = 9999900 /* 0x98961C */;
var name = ("mc" + prop);
var d = ((i = 0));
var _local1 = ["_x", "_y", "_rotation", "_alpha", "_xscale", "_yscale", "_width", "_height"];
i = 0;
while (i < _local1.length) {
if (prop == _local1[i]) {
_local2 = _local2 + i;
break;
}
i++;
}
var mc = _local3.createEmptyMovieClip(name, _local2);
mc.onEnterFrame = function () {
var _local1 = this;
d = (((_local1._parent[prop] - target) / a) + d) / s;
_local1._parent[prop] = _local1._parent[prop] - d;
if ((d > -0.1) && (d < 0.1)) {
d = int(target);
_local1._parent[prop] = d;
delete _local1.onEnterFrame;
_local1.removeMovieClip();
}
};
};
MovieClip.prototype.jitter = function (i, s) {
var _local1 = this;
var depth = 9999990;
var _local2 = "jitter";
var ox = _local1._x;
var oy = _local1._y;
var iterations = i;
var spread = s;
var _local3 = _local1.createEmptyMovieClip(_local2, depth);
_local3.onEnterFrame = function () {
var _local1 = this;
i--;
_local1._parent._x = (ox - (spread * 0.5)) + random(spread);
_local1._parent._y = (oy - (spread * 0.5)) + random(spread);
if (i == 0) {
_local1._parent._x = ox;
_local1._parent._y = oy;
delete _local1.onEnterFrame;
_local1.removeMovieClip();
}
};
};
setTint = function (mc, ra, rb, ga, gb, ba, bb) {
var _local2 = new Color(mc);
var _local1 = {ra:ra, rb:rb, ga:ga, gb:gb, ba:ba, bb:bb, aa:100, ab:0};
_local2.setTransform(_local1);
};
clearTint = function (mc) {
setTint(mc, 100, 0, 100, 0, 100, 0);
};
drawBound = function (oX, oY, offX, offY, bwidth, bheight, layer, n, c) {
var boundLeft = (bwidth * 0.5);
var boundRight = (bwidth * 0.5);
var boundTop = (bheight * 0.5);
var boundBottom = (bheight * 0.5);
var originX = game.getScreenCoords((oX - boundLeft) + offX, (oY - boundTop) + offY).x;
var originY = game.getScreenCoords((oX - boundLeft) + offX, (oY - boundTop) + offY).y;
var point1X = game.getScreenCoords((oX + boundRight) + offX, (oY - boundTop) + offY).x;
var point1Y = game.getScreenCoords((oX + boundRight) + offX, (oY - boundTop) + offY).y;
var point2X = game.getScreenCoords((oX + boundRight) + offX, (oY + boundBottom) + offY).x;
var point2Y = game.getScreenCoords((oX + boundRight) + offX, (oY + boundBottom) + offY).y;
var point3X = game.getScreenCoords((oX - boundLeft) + offX, (oY + boundBottom) + offY).x;
var point3Y = game.getScreenCoords((oX - boundLeft) + offX, (oY + boundBottom) + offY).y;
var mc = layer.createEmptyMovieClip("bound" + n, n);
if (c == 1) {
var f = 16711680;
var linef = 16711680;
} else {
var f = 255;
var linef = 16711935;
}
with (mc) {
beginFill(f, 20);
lineStyle(1, linef, 100);
moveTo(point2X, point2Y);
lineTo(point3X, point3Y);
lineTo(originX, originY);
lineTo(point1X, point1Y);
endFill();
}
};
fscommand ("allowscale", false);
fscommand ("fullscreen", false);
fscommand ("showmenu", false);
_quality = "high";
_global._timeline = _level0;
play();
Frame 4
function fastSIN(pangle) {
var _local1 = pangle % 360;
((_local1 > 0) ? ((sign = 1)) : ((sign = -1)));
_local1 = Math.abs(_local1);
if (_local1 == 0) {
return(0);
}
return(sinLUT[_local1] * sign);
}
function fastCOS(pangle) {
var _local1 = Math.abs(pangle % 360);
if (_local1 == 0) {
return(1);
}
return(cosLUT[_local1]);
}
function findangle(x1, y1, x2, y2) {
var _local3 = x2 - x1;
var _local2 = y2 - y1;
var _local1 = Math.atan(_local3 / _local2) / 0.01745329;
((y1 < y2) ? (_local1 = 180 - _local1) : (_local1 = 360 - _local1));
_local1 = _local1 % 360;
return(_local1);
}
cosLUT = new Array(1, 0.999, 0.999, 0.998, 0.996, 0.995, 0.993, 0.99, 0.988, 0.985, 0.982, 0.978, 0.974, 0.97, 0.966, 0.961, 0.956, 0.951, 0.946, 0.94, 0.934, 0.927, 0.921, 0.914, 0.906, 0.899, 0.891, 0.883, 0.875, 0.866, 0.857, 0.848, 0.839, 0.829, 0.819, 0.809, 0.799, 0.788, 0.777, 0.766, 0.755, 0.743, 0.731, 0.719, 0.707, 0.695, 0.682, 0.669, 0.656, 0.643, 0.629, 0.616, 0.602, 0.588, 0.574, 0.559, 0.545, 0.53, 0.515, 0.5, 0.485, 0.469, 0.454, 0.438, 0.423, 0.407, 0.391, 0.375, 0.358, 0.342, 0.326, 0.309, 0.292, 0.276, 0.259, 0.242, 0.225, 0.208, 0.191, 0.174, 0.156, 0.139, 0.122, 0.105, 0.087, 0.07, 0.052, 0.035, 0.017, 0, -0.017, -0.035, -0.052, -0.07, -0.087, -0.105, -0.122, -0.139, -0.156, -0.174, -0.191, -0.208, -0.225, -0.242, -0.259, -0.276, -0.292, -0.309, -0.326, -0.342, -0.358, -0.375, -0.391, -0.407, -0.423, -0.438, -0.454, -0.469, -0.485, -0.5, -0.515, -0.53, -0.545, -0.559, -0.574, -0.588, -0.602, -0.616, -0.629, -0.643, -0.656, -0.669, -0.682, -0.695, -0.707, -0.719, -0.731, -0.743, -0.755, -0.766, -0.777, -0.788, -0.799, -0.809, -0.819, -0.829, -0.839, -0.848, -0.857, -0.866, -0.875, -0.883, -0.891, -0.899, -0.906, -0.914, -0.921, -0.927, -0.934, -0.94, -0.946, -0.951, -0.956, -0.961, -0.966, -0.97, -0.974, -0.978, -0.982, -0.985, -0.988, -0.99, -0.993, -0.995, -0.996, -0.998, -0.999, -0.999, -1, -1, -1, -0.999, -0.999, -0.998, -0.996, -0.995, -0.993, -0.99, -0.988, -0.985, -0.982, -0.978, -0.974, -0.97, -0.966, -0.961, -0.956, -0.951, -0.946, -0.94, -0.934, -0.927, -0.921, -0.914, -0.906, -0.899, -0.891, -0.883, -0.875, -0.866, -0.857, -0.848, -0.839, -0.829, -0.819, -0.809, -0.799, -0.788, -0.777, -0.766, -0.755, -0.743, -0.731, -0.719, -0.707, -0.695, -0.682, -0.669, -0.656, -0.643, -0.629, -0.616, -0.602, -0.588, -0.574, -0.559, -0.545, -0.53, -0.515, -0.5, -0.485, -0.469, -0.454, -0.438, -0.423, -0.407, -0.391, -0.375, -0.358, -0.342, -0.326, -0.309, -0.292, -0.276, -0.259, -0.242, -0.225, -0.208, -0.191, -0.174, -0.156, -0.139, -0.122, -0.105, -0.087, -0.07, -0.052, -0.035, -0.017, 0, 0.017, 0.035, 0.052, 0.07, 0.087, 0.105, 0.122, 0.139, 0.156, 0.174, 0.191, 0.208, 0.225, 0.242, 0.259, 0.276, 0.292, 0.309, 0.326, 0.342, 0.358, 0.375, 0.391, 0.407, 0.423, 0.438, 0.454, 0.469, 0.485, 0.5, 0.515, 0.53, 0.545, 0.559, 0.574, 0.588, 0.602, 0.616, 0.629, 0.643, 0.656, 0.669, 0.682, 0.695, 0.707, 0.719, 0.731, 0.743, 0.755, 0.766, 0.777, 0.788, 0.799, 0.809, 0.819, 0.829, 0.839, 0.848, 0.857, 0.866, 0.875, 0.883, 0.891, 0.899, 0.906, 0.914, 0.921, 0.927, 0.934, 0.94, 0.946, 0.951, 0.956, 0.961, 0.966, 0.97, 0.974, 0.978, 0.982, 0.985, 0.988, 0.99, 0.993, 0.995, 0.996, 0.998, 0.999, 0.999, 1, 1);
sinLUT = new Array(0.017, 0.035, 0.052, 0.07, 0.087, 0.105, 0.122, 0.139, 0.156, 0.174, 0.191, 0.208, 0.225, 0.242, 0.259, 0.276, 0.292, 0.309, 0.326, 0.342, 0.358, 0.375, 0.391, 0.407, 0.423, 0.438, 0.454, 0.469, 0.485, 0.5, 0.515, 0.53, 0.545, 0.559, 0.574, 0.588, 0.602, 0.616, 0.629, 0.643, 0.656, 0.669, 0.682, 0.695, 0.707, 0.719, 0.731, 0.743, 0.755, 0.766, 0.777, 0.788, 0.799, 0.809, 0.819, 0.829, 0.839, 0.848, 0.857, 0.866, 0.875, 0.883, 0.891, 0.899, 0.906, 0.914, 0.921, 0.927, 0.934, 0.94, 0.946, 0.951, 0.956, 0.961, 0.966, 0.97, 0.974, 0.978, 0.982, 0.985, 0.988, 0.99, 0.993, 0.995, 0.996, 0.998, 0.999, 0.999, 1, 1, 1, 0.999, 0.999, 0.998, 0.996, 0.995, 0.993, 0.99, 0.988, 0.985, 0.982, 0.978, 0.974, 0.97, 0.966, 0.961, 0.956, 0.951, 0.946, 0.94, 0.934, 0.927, 0.921, 0.914, 0.906, 0.899, 0.891, 0.883, 0.875, 0.866, 0.857, 0.848, 0.839, 0.829, 0.819, 0.809, 0.799, 0.788, 0.777, 0.766, 0.755, 0.743, 0.731, 0.719, 0.707, 0.695, 0.682, 0.669, 0.656, 0.643, 0.629, 0.616, 0.602, 0.588, 0.574, 0.559, 0.545, 0.53, 0.515, 0.5, 0.485, 0.469, 0.454, 0.438, 0.423, 0.407, 0.391, 0.375, 0.358, 0.342, 0.326, 0.309, 0.292, 0.276, 0.259, 0.242, 0.225, 0.208, 0.191, 0.174, 0.156, 0.139, 0.122, 0.105, 0.087, 0.07, 0.052, 0.035, 0.017, 0, -0.017, -0.035, -0.052, -0.07, -0.087, -0.105, -0.122, -0.139, -0.156, -0.174, -0.191, -0.208, -0.225, -0.242, -0.259, -0.276, -0.292, -0.309, -0.326, -0.342, -0.358, -0.375, -0.391, -0.407, -0.423, -0.438, -0.454, -0.469, -0.485, -0.5, -0.515, -0.53, -0.545, -0.559, -0.574, -0.588, -0.602, -0.616, -0.629, -0.643, -0.656, -0.669, -0.682, -0.695, -0.707, -0.719, -0.731, -0.743, -0.755, -0.766, -0.777, -0.788, -0.799, -0.809, -0.819, -0.829, -0.839, -0.848, -0.857, -0.866, -0.875, -0.883, -0.891, -0.899, -0.906, -0.914, -0.921, -0.927, -0.934, -0.94, -0.946, -0.951, -0.956, -0.961, -0.966, -0.97, -0.974, -0.978, -0.982, -0.985, -0.988, -0.99, -0.993, -0.995, -0.996, -0.998, -0.999, -0.999, -1, -1, -1, -0.999, -0.999, -0.998, -0.996, -0.995, -0.993, -0.99, -0.988, -0.985, -0.982, -0.978, -0.974, -0.97, -0.966, -0.961, -0.956, -0.951, -0.946, -0.94, -0.934, -0.927, -0.921, -0.914, -0.906, -0.899, -0.891, -0.883, -0.875, -0.866, -0.857, -0.848, -0.839, -0.829, -0.819, -0.809, -0.799, -0.788, -0.777, -0.766, -0.755, -0.743, -0.731, -0.719, -0.707, -0.695, -0.682, -0.669, -0.656, -0.643, -0.629, -0.616, -0.602, -0.588, -0.574, -0.559, -0.545, -0.53, -0.515, -0.5, -0.485, -0.469, -0.454, -0.438, -0.423, -0.407, -0.391, -0.375, -0.358, -0.342, -0.326, -0.309, -0.292, -0.276, -0.259, -0.242, -0.225, -0.208, -0.191, -0.174, -0.156, -0.139, -0.122, -0.105, -0.087, -0.07, -0.052, -0.035, -0.017, 0);
Frame 7
bulletObj = function (x, z, angle, bpower, zIndex) {
var _local1 = this;
var _local2 = z;
var _local3 = x;
_local1.bounds = {width:6, height:6, offsetx:0, offsetz:0};
_local1.type = bpower;
_local1.x = _local3;
_local1.z = _local2;
_local1.tilesize = game.tileW;
_local1.getMyTile(_local3, _local2);
_local1.zIndex = zIndex;
_local1.zBase = 1;
_local1.depth = _local1.getzDepth();
_local1.mc = game.createObjectIn(game.zsort, bpower, ("pbullet" + _local1.depth) + random(999), _local3, _local2, _local1.depth);
_local1.renderID = game.renderManager.addObj(_local1);
_local1.mc._x = 1000;
_local1.mc._y = 1000;
_local1.angle = angle;
switch (bpower) {
case "bullet" :
soundcontrol("dFire");
_local1.power = 3;
_local1.speed = 8;
break;
case "bullet2" :
soundcontrol("dFire");
_local1.power = 5;
_local1.speed = 10;
break;
case "megabullet" :
soundcontrol("megagun");
_local1.bounds = {width:10, height:10, offsetx:0, offsetz:0};
_local1.power = 7;
_local1.speed = 10;
}
_local1.vx = _local1.speed * _timeline.fastSIN(_local1.angle);
_local1.vz = _local1.speed * (-_timeline.fastCOS(_local1.angle));
_local1.tx = _local1.mc.sortorigin_mc._width * 0.5;
_local1.tz = _local1.mc.sortorigin_mc._height * 0.5;
_local1.ACTIVE = 1;
_local1.FADE = 2;
_local1.KILL = 3;
_local1.action = _local1.ACTIVE;
};
bulletObj.prototype.update = function () {
var _local1 = this;
switch (_local1.action) {
case _local1.ACTIVE :
_local1.getVelocity();
return;
case _local1.KILL :
_local1.mc.objRef = _local1;
_local1.mc.gotoAndPlay("die");
_local1.action = _local1.IDLE;
return;
case _local1.IDLE :
return;
}
};
bulletObj.prototype.getVelocity = function () {
var _local1 = this;
var _local3 = (_local1.x + _local1.vx) - _local1.tx;
var _local2 = _local1.z + _local1.vz;
_local1.collideWithEnemies();
_local1.collideWithTiles(_local3, _local2);
_local1.renderToScreen();
_local1.x = _local1.x + _local1.vx;
_local1.z = _local1.z + _local1.vz;
};
bulletObj.prototype.getMyTile = function (x, z) {
var _local1 = this;
_local1.xtile = Math.round(x / _local1.tilesize);
_local1.ztile = Math.round(z / _local1.tilesize);
};
bulletObj.prototype.getzDepth = function () {
var _local1 = this;
var _local2 = game.getZDepth(_local1.xtile, _local1.ztile);
return((_local2 + _local1.zBase) + _local1.zIndex);
};
bulletObj.prototype.collideWithTiles = function (x, z) {
var _local1 = this;
_local1.getMyTile(x, z);
var _local2 = game.mapdata[_local1.ztile][_local1.xtile];
if ((_local2.type == "door") && (_local2.doortype == "blastdoor")) {
if (_local1.type == "megabullet") {
if (_local2.open == 0) {
if (game.enemyManager.rectCollision(_local2, _local2.hitbounds, _local1, _local1.bounds)) {
game.openBlastDoor(_local1.ztile, _local1.xtile);
var _local3 = game.enemyManager.getExplosionDepth();
if (_local3 != null) {
new explosionObj(_local1.xtile, _local1.ztile, "blastexplosion", _local3);
}
_local1.action = _local1.KILL;
}
}
} else {
_local1.action = _local1.kill;
}
}
if (_local2.height == 1) {
if (!(_local2.type === "furniture")) {
} else if (_local2.destroy(_local1.power) == true) {
var _local3 = game.enemyManager.getExplosionDepth();
if (_local3 != null) {
new explosionObj(_local1.xtile, _local1.ztile, "explosion", _local3);
}
if (_local2.ID == 201) {
game.swapTileTo(6, _local1.ztile, _local1.xtile);
} else if (_local2.ID == 200) {
game.swapTileTo(4, _local1.ztile, _local1.xtile);
} else if (_local2.ID == 216) {
var mc = _local2.mc.tile_mc.furniture_mc.furniture_mc;
mc.gotoAndPlay("die");
game.field.jitter(100, 7);
Dalek.action = Dalek.BLOWUP;
}
}
_local1.action = _local1.KILL;
}
};
bulletObj.prototype.collideWithEnemies = function () {
var _local2 = this;
var elist = game.enemyManager.enemylist;
var _local3 = 0;
while (_local3 < elist.length) {
var _local1 = elist[_local3];
if (game.enemyManager.rectCollision(_local1, _local1.hitbounds, _local2, _local2.bounds)) {
if (_local1.nameID == "sentry") {
if (_local1.action == _local1.ACTIVE) {
_local1.damage(_local2.power);
_local2.action = _local2.KILL;
}
} else if ((_local1.action != _local1.IDLE) && (_local1.action != _local1.PAUSE)) {
_local1.damage(_local2.power);
_local2.action = _local2.KILL;
}
}
_local3++;
}
};
bulletObj.prototype.renderToScreen = function () {
var _local1 = this;
_local1.mc.swapDepths(_local1.getzDepth());
var _local2 = game.getScreenCoords(_local1.x, _local1.z);
_local1.mc._x = _local2.x;
_local1.mc._y = _local2.y;
};
bulletObj.prototype.destroy = function () {
var _local1 = this;
Dalek.bulletCount--;
game.renderManager.removeObj(_local1);
removeMovieClip(_local1.mc);
delete _local1.mc;
};
enemybulletObj = function (x, z, angle, speed, power, zIndex) {
var _local1 = this;
var _local2 = angle;
var _local3 = z;
_local1.bounds = {width:8, height:8, offsetx:0, offsetz:0};
_local1.x = x;
_local1.z = _local3;
_local1.tilesize = game.tileW;
_local1.getMyTile(x, _local3);
_local1.otile = game.mapdata[_local1.ztile][_local1.xtile];
_local1.zIndex = zIndex;
_local1.zBase = 20;
_local1.depth = _local1.getzDepth();
_local1.mc = game.createObjectIn(game.zsort, "enemybullet", ("ebullet" + _local1.depth) + random(999), x, _local3, _local1.depth);
_local1.renderID = game.renderManager.addObj(_local1);
if (_local2 > 360) {
_local2 = _local2 - 360;
}
if (_local2 < 360) {
_local2 = _local2 + 360;
}
_local1.angle = Math.round(_local2);
_local1.speed = speed;
_local1.power = power;
_local1.vx = _local1.speed * _timeline.fastSIN(_local1.angle);
_local1.vz = _local1.speed * (-_timeline.fastCOS(_local1.angle));
_local1.tx = _local1.mc.sortorigin_mc._width * 0.5;
_local1.tz = _local1.mc.sortorigin_mc._height * 0.5;
_local1.ACTIVE = 1;
_local1.FADE = 2;
_local1.KILL = 3;
_local1.action = _local1.ACTIVE;
};
enemybulletObj.prototype.update = function () {
var _local1 = this;
switch (_local1.action) {
case _local1.ACTIVE :
_local1.getVelocity();
return;
case _local1.KILL :
_local1.mc.objRef = _local1;
_local1.mc.gotoAndPlay("die");
_local1.action = _local1.IDLE;
return;
case _local1.IDLE :
return;
}
};
enemybulletObj.prototype.getVelocity = function () {
var _local1 = this;
var _local3 = (_local1.x + _local1.vx) - _local1.tx;
var _local2 = _local1.z + _local1.vz;
_local1.collideWithPlayer();
_local1.collideWithTiles(_local3, _local2);
_local1.renderToScreen();
_local1.x = _local1.x + _local1.vx;
_local1.z = _local1.z + _local1.vz;
};
enemybulletObj.prototype.getMyTile = function (x, z) {
var _local1 = this;
_local1.xtile = Math.round(x / _local1.tilesize);
_local1.ztile = Math.round(z / _local1.tilesize);
};
enemybulletObj.prototype.getzDepth = function () {
var _local1 = this;
var _local2 = game.getZDepth(_local1.xtile, _local1.ztile);
return((_local2 + _local1.zBase) + _local1.zIndex);
};
enemybulletObj.prototype.collideWithTiles = function (x, z) {
var _local1 = this;
_local1.getMyTile(x, z);
var _local2 = game.mapdata[_local1.ztile][_local1.xtile];
if (_local2.height == 1) {
if (!(_local2.type === "furniture")) {
} else if (_local2.destroy(_local1.power) == true) {
if (_local2.ID == 201) {
game.swapTileTo(6, _local1.ztile, _local1.xtile);
} else if (_local2.ID == 200) {
game.swapTileTo(4, _local1.ztile, _local1.xtile);
}
var _local3 = game.enemyManager.getExplosionDepth();
if (_local3 != null) {
new explosionObj(_local1.xtile, _local1.ztile, "explosion", _local3);
}
}
_local1.action = _local1.KILL;
}
};
enemybulletObj.prototype.collideWithPlayer = function () {
var _local1 = this;
if (Dalek.action == Dalek.ACTIVE) {
if (game.enemyManager.rectCollision(Dalek, Dalek.hitbounds, _local1, _local1.bounds)) {
Dalek.damage(_local1.power);
_local1.action = _local1.KILL;
}
}
};
enemybulletObj.prototype.renderToScreen = function () {
var _local1 = this;
_local1.mc.swapDepths(_local1.getzDepth());
var _local2 = game.getScreenCoords(_local1.x, _local1.z);
_local1.mc._x = _local2.x;
_local1.mc._y = _local2.y;
};
enemybulletObj.prototype.destroy = function () {
var _local1 = this;
game.enemyManager.eBCount--;
game.renderManager.removeObj(_local1);
removeMovieClip(_local1.mc);
delete _local1.mc;
};
explosionObj = function (x, z, linkMC, zIndex) {
var _local1 = this;
soundcontrol("barrelexplode");
_local1.halftile = game.tileW * 0.5;
_local1.xtile = x;
_local1.ztile = z;
_local1.x = x * game.tileW;
_local1.z = z * game.tileH;
_local1.zIndex = zIndex;
_local1.zBase = 60;
_local1.life = 18;
_local1.depth = _local1.getzDepth();
_local1.mc = game.createObjectIn(game.zsort, linkMC, "explosion" + (_local1.depth + random(999)), 1000, 1000, _local1.depth);
_local1.renderToScreen();
_local1.mc.obj = _local1;
_local1.mc.onEnterFrame = function () {
this.obj.update();
};
};
explosionObj.prototype.getzDepth = function () {
var _local1 = this;
var _local2 = game.getZDepth(_local1.xtile, _local1.ztile);
return((_local2 + _local1.zBase) + _local1.zIndex);
};
explosionObj.prototype.update = function () {
var _local1 = this;
_local1.life--;
if (_local1.life <= 0) {
_local1.destroy();
}
};
explosionObj.prototype.renderToScreen = function () {
var _local1 = this;
_local1.mc.swapDepths(_local1.getzDepth());
var _local2 = game.getScreenCoords(_local1.x, _local1.z);
_local1.mc._x = _local2.x + game.tileW;
_local1.mc._y = _local2.y;
};
explosionObj.prototype.destroy = function () {
var _local1 = this;
game.enemyManager.pCount--;
removeMovieClip(_local1.mc);
delete _local1.mc;
};
savedGame = SharedObject.getLocal("savedGame");
initSaved = function () {
savedGame.data.value = {param1:1, param2:0, param3:0, param4:0, param5:0, param6:0, param7:0};
};
saveExists = function () {
if (savedGame.data.value == null) {
initSaved();
return(false);
}
return(true);
};
outputSaveVars = function () {
var _local1 = savedGame.data.value;
for (var _local2 in _local1) {
trace(_local1[_local2]);
}
};
saveGame = function (level, deaths, gtime, secondplay, hit, miss, acuurate) {
savedGame.clear();
savedGame.data.value = {param1:level, param2:deaths, param3:gtime, param4:secondplay, param5:hit, param6:miss, param7:accuracy};
var _local1 = savedGame.flush(3000);
trace(_local1 + " = save result true or false");
};
wipeSaved = function () {
trace("wiping sharedObject");
savedGame.clear();
initSaved();
};
debugSaved = function () {
savedGame.data.value = {param1:4, param2:0, param3:0, param4:0, param5:8, param6:23, param7:1};
var saving = savedGame.flush(3000);
};
play();
Frame 12
playerObj = function (x, z, mapLink) {
var _local1 = this;
_local1.name = "dalek";
_local1.mc = game.createObjectIn(game.zsort, "dalek", "dalek", x, z, game.getZDepth(x, z));
_local1.renderID = game.renderManager.addObj(_local1);
_local1.bounds = {width:30, height:30, offsetX:(_local1.mc.offset_mc._width * 0.5) - 5, offsetZ:-5};
_local1.hitbounds = {width:10, height:10, offsetX:(_local1.mc.offset_mc._width * 0.5) - 5, offsetZ:-5};
_local1.hwidth = _local1.bounds.width * 0.5;
_local1.hheight = _local1.bounds.height * 0.5;
_local1.cbounds = {width:_local1.hwidth, height:_local1.hheight, offsetX:_local1.mc.offset_mc._width * 0.5, offsetZ:0};
_local1.boost1 = 4;
_local1.boost2 = 7;
_local1.speed = _local1.boost1;
_local1.vx = 0;
_local1.vy = 0;
_local1.vz = 0;
_local1.tboost1 = 4;
_local1.tboost2 = 9;
_local1.tspeed = _local1.tboost1;
_local1.tangle = 0;
_local1.tframes = 36;
_local1.tpercent = 360 / _local1.tframes;
_local1.bdir = 0;
_local1.bspeed = 4;
_local1.bangle = 0;
_local1.bframes = 36;
_local1.tpercent = 360 / _local1.bframes;
_local1.rePos(x, z);
_local1.tile = {};
_local1.zBase = 51;
_local1.ACTIVE = 1;
_local1.IDLE = 2;
_local1.KILL = 3;
_local1.OPENDOOR = 4;
_local1.SCRIPTDOOR = 5;
_local1.TWEENFROMDOOR = 6;
_local1.TWEENKILLDOOR = 7;
_local1.BLOWUP = 8;
_local1.action = _local1.ACTIVE;
_local1.shieldFlag = false;
_local1.energy = 100;
_local1.shield = 100;
_local1.shieldRating = 1;
_local1.sDefense1 = 1.5;
_local1.sDefense2 = 3;
_local1.shieldTiming = 0;
_local1.shieldMax = 70;
_local1.shieldRecover = 2;
_local1.bulletCount = 0;
_local1.bulletMax = 10;
_local1.bulletIndex = -1;
_local1.bulletPwr1 = "bullet";
_local1.bulletPwr2 = "bullet2";
_local1.bulletPwr3 = "megabullet";
_local1.bulletPwr = _local1.bulletPwr1;
_local1.fDelay = 10;
_local1.fTimer = 0;
_local1.fAnim = 0;
_local1.fAnimMax = 9;
_local1.fOn = 0;
_local1.punchradius = 7;
_local1.pFlag = 0;
_local1.pAnim = 0;
_local1.pAnimMax = 5;
_local1.pbounds = {width:15, height:15, offsetX:0, offsetZ:0};
_local1.gunBlock = false;
_local1.gunFlag = false;
_local1.origin = {x:_local1.x + _local1.bounds.offsetX, z:_local1.z};
_local1.weapons = {};
_local1.selectedWeapons = [0, 0];
_local1.lastweapon = 0;
_local1.hoverOn = false;
_local1.hoverTimer = 0;
_local1.hoverMax = 3;
_local1.yf = _local1.mc.feet_mc._y;
_local1.ym = _local1.mc.mid_mc._y;
_local1.yh = _local1.mc.head_mc._y;
_local1.initDialog();
_local1.accessError = 0;
_local1.accessTimer = 0;
_local1.accessMax = 30;
_local1.accessDoor = {};
_local1.deathMax = 100;
_local1.deathTimer = _local1.deathMax;
_local1.tDoorTimer = 0;
_local1.tDoorMsecs = 31;
_local1.tDoorPMax = 160;
_local1.tDoorPause = _local1.tDoorPMax;
_local1.tDoorTile = 0;
_local1.tDoorx = 0;
_local1.tDoorz = 0;
_local1.tdoc = "";
_local1.tDocFight = 0;
_local1.endTimerMax = 100;
_local1.endTimer = _local1.endTimerMax;
_local1.createWeapons();
_local1.switchShield(false);
_local1.addMouseInput();
_local1.displayShield();
_local1.displayEnergy();
_local1.detectAll();
_local1.reStartInfo = {map:mapLink, x:x, z:z, direction:0};
_local1.renderToScreen();
};
playerObj.prototype.switchShield = function (toggle) {
((toggle == true) ? ((_timeline.osd.shieldbar_mc._visible = true)) : ((_timeline.osd.shieldbar_mc._visible = false)));
this.shieldFlag = toggle;
};
playerObj.prototype.adjustShield = function (amount) {
var _local1 = this;
var _local2 = _local1.shield + (amount / _local1.shieldRating);
if (_local2 > 100) {
_local1.shield = 100;
} else if (_local2 < 0) {
_local1.shield = 0;
_local1.adjustEnergy(_local2);
} else {
_local1.shield = Math.round(_local2);
}
_local1.displayShield();
};
playerObj.prototype.displayShield = function () {
var _local1 = _level0.osd.shieldbar_mc;
_local1.gotoAndStop(this.shield + 1);
};
playerObj.prototype.damage = function (dmg) {
var _local1 = this;
if (_local1.action == _local1.ACTIVE) {
if (_local1.shieldFlag == false) {
_local1.mc.hit_mc.gotoAndPlay("in");
_timeline.setTint(_local1.mc, 100, 150, 100, 150, 100, 255);
_local1.adjustEnergy(-dmg);
} else {
_local1.shieldTiming = _local1.shieldMax;
_local1.mc.hit_mc.gotoAndPlay("in");
_timeline.setTint(_local1.mc, 100, 150, 100, 150, 100, 255);
_local1.adjustShield(-dmg);
}
soundcontrol("dalekhit");
}
};
playerObj.prototype.adjustEnergy = function (amount) {
var _local1 = this;
var _local2 = _local1.energy + Math.round(amount);
if (_local2 > 100) {
_local1.energy = 100;
} else if (_local2 <= 0) {
_local1.energy = 0;
_local1.displayEnergy();
_local1.mc.hit_mc.gotoAndPlay("die");
soundcontrol("dalekdeath");
_local1.action = _local1.KILL;
} else {
_local1.energy = _local2;
}
_local1.displayEnergy();
};
playerObj.prototype.displayEnergy = function () {
var _local1 = _level0.osd.energybar_mc;
_local1.gotoAndStop(this.energy + 1);
};
playerObj.prototype.createWeapons = function () {
var _local3 = this;
_local3.weapons = [];
var _local2 = ["none", "shield1", "gun1", "hover", "processor", "turret", "gun2", "vision", "shield2", "speed", "gun3"];
var lvlStartInfo = _timeline.startArray[_gamelevel].weapons;
var weaponsOn = false;
if (_secondPlay) {
weaponsOn = true;
}
var _local1 = 0;
while (_local1 < _local2.length) {
_local3.weapons[_local1] = {name:_local2[_local1], active:false, collected:weaponsOn};
if (lvlStartInfo[_local1] == 1) {
_local3.weapons[_local1].collected = true;
}
_local1++;
}
_local3.startingWeapons();
};
playerObj.prototype.startingWeapons = function () {
if (_secondPlay) {
if (_gamelevel == 9) {
var _local1 = [6, 5];
} else {
var _local1 = [10, 5];
}
} else {
switch (_gamelevel) {
case 1 :
return;
case 2 :
var _local1 = [4, 0];
// unexpected jump
case 3 :
_local1 = [2, 4];
// unexpected jump
case 4 :
case 5 :
_local1 = [2, 5];
// unexpected jump
case 6 :
case 7 :
case 8 :
case 9 :
_local1 = [6, 5];
// unexpected jump
case 10 :
_local1 = [10, 5];
default :
this.changeWeapons(_local1);
}
}
this.changeWeapons(_local1);
};
playerObj.prototype.changeWeapons = function (equiptArray) {
var _local1 = this;
var _local2 = 0;
while (_local2 < _local1.selectedWeapons.length) {
if (_local1.selectedWeapons[_local2] != 0) {
var _local3 = _local1.weapons[_local1.selectedWeapons[_local2]];
_local3.active = false;
switch (_local3.name) {
case "shield1" :
_local1.switchShield(false);
_local1.shieldRating = 0;
break;
case "gun1" :
_local1.gunFlag = false;
_local1.bulletPwr = _local1.bulletPwr1;
break;
case "hover" :
_timeline.tile3.prototype.walkable = false;
_timeline.tile6.prototype.walkable = false;
break;
case "turret" :
_local1.tspeed = _local1.tboost1;
break;
case "gun2" :
_local1.gunFlag = false;
_local1.bulletPwr = _local1.bulletPwr1;
break;
case "vision" :
_local1.mineDisplay(false);
_local1.cloakDisplay(true);
break;
case "shield2" :
_local1.switchShield(false);
_local1.shieldRating = 0;
break;
case "speed" :
_local1.speed = _local1.boost1;
break;
case "gun3" :
_local1.gunFlag = false;
_local1.bulletPwr = _local1.bulletPwr1;
}
}
_local2++;
}
_local2 = 0;
while (_local2 < equiptArray.length) {
if (equiptArray[_local2] != 0) {
var _local3 = _local1.weapons[equiptArray[_local2]];
_local3.active = true;
switch (_local3.name) {
case "shield1" :
_local1.switchShield(true);
_local1.shieldRating = _local1.sDefense1;
break;
case "gun1" :
_local1.gunflag = true;
_local1.bulletPwr = _local1.bulletPwr1;
break;
case "hover" :
_timeline.tile3.prototype.walkable = true;
_timeline.tile6.prototype.walkable = true;
break;
case "turret" :
_local1.tspeed = _local1.tboost2;
break;
case "gun2" :
_local1.gunflag = true;
_local1.bulletPwr = _local1.bulletPwr2;
break;
case "vision" :
_local1.mineDisplay(true);
_local1.cloakDisplay(false);
break;
case "shield2" :
_local1.switchShield(true);
_local1.shieldRating = _local1.sDefense2;
break;
case "speed" :
_local1.speed = _local1.boost2;
break;
case "gun3" :
_local1.gunflag = true;
_local1.bulletPwr = _local1.bulletPwr3;
}
}
_local2++;
}
_local1.selectedWeapons = equiptArray.slice(0);
};
playerObj.prototype.addMouseInput = function () {
var _local1 = this;
_local1.mouseListener = new Object();
_local1.mouseListener.ref = _local1;
_local1.mouseListener.onMouseDown = function () {
var _local1 = this;
if (_local1.ref.gunBlock == false) {
if (_local1.ref.gunflag == true) {
_local1.ref.fOn = 1;
} else {
_local1.ref.fire();
}
}
};
_local1.mouseListener.onMouseUp = function () {
this.ref.fOn = 0;
};
Mouse.addListener(_local1.mouseListener);
Mouse.hide();
cursor.startDrag(true);
cursor._visible = 1;
};
playerObj.prototype.removeMouseInput = function () {
Mouse.removeListener(this.mouseListener);
delete this.mouseListener;
Mouse.show();
cursor.stopDrag();
cursor._visible = 0;
};
playerObj.prototype.checkCollisions = function () {
var _local1 = this;
_local1.getMyCorners();
if (_local1.vz < 0) {
if (_local1.upleft && (_local1.upright)) {
_local1.z = _local1.z + (_local1.vz * _local1.speed);
} else {
_local1.z = _local1.ztile * game.tileW;
}
}
if (_local1.vz > 0) {
if (_local1.downleft && (_local1.downright)) {
_local1.z = _local1.z + (_local1.vz * _local1.speed);
} else {
_local1.z = ((_local1.ztile + 1) * game.tileW) - _local1.bounds.height;
}
}
if (_local1.vx < 0) {
if (_local1.downleft && (_local1.upleft)) {
_local1.x = _local1.x + (_local1.vx * _local1.speed);
} else {
_local1.x = _local1.xtile * game.tileW;
}
}
if (_local1.vx > 0) {
if (_local1.upright && (_local1.downright)) {
_local1.x = _local1.x + (_local1.vx * _local1.speed);
} else {
_local1.x = ((_local1.xtile + 1) * game.tileW) - _local1.bounds.width;
}
}
if ((_local1.vx != 0) || (_local1.vz != 0)) {
_local1.detectAll();
_local1.renderToScreen();
}
};
playerObj.prototype.getMyCorners = function (x, y, ob) {
var _local1 = this;
var _local2 = _local1.getNewVelocity();
var downZ = Math.floor(((_local2.z + _local1.bounds.height) - 1) / game.tileH);
var _local3 = Math.floor(_local2.z / game.tileH);
var leftX = Math.floor(_local2.x / game.tileW);
var rightX = Math.floor(((_local2.x + _local1.bounds.width) - 1) / game.tileW);
_local1.upleft = game.mapdata[_local3][leftX].walkable;
_local1.downleft = game.mapdata[downZ][leftX].walkable;
_local1.upright = game.mapdata[_local3][rightX].walkable;
_local1.downright = game.mapdata[downZ][rightX].walkable;
};
playerObj.prototype.detectEndDoor = function (id) {
switch (id) {
case 110 :
_timeline.loadLevel(2);
return;
case 124 :
_timeline.loadLevel(3);
return;
case 140 :
_timeline.loadLevel(4);
return;
case 164 :
_timeline.loadLevel(5);
return;
case 182 :
_timeline.loadLevel(6);
return;
case 600 :
_timeline.loadLevel(7);
return;
case 616 :
_timeline.loadLevel(8);
return;
case 630 :
_timeline.loadLevel(9);
return;
case 652 :
_timeline.loadLevel(10);
return;
case 658 :
trace("end");
}
};
playerObj.prototype.detectAll = function () {
var _local1 = this;
_local1.tile = _local1.detectCurrentTile();
_local1.detectEnemies();
_local1.detectScanInfo();
_local1.detectTileTypes();
};
playerObj.prototype.detectEnemies = function () {
var _local2 = this;
var _local3 = 0;
while (_local3 < game.enemyManager.enemylist.length) {
var _local1 = game.enemyManager.enemylist[_local3];
if ((_local1.action != _local1.IDLE) && (_local1.action != _local1.PAUSE)) {
if (_local1.nameID != "sentry") {
var hit = game.enemyManager.rectCollision(_local1, _local1.bounds, _local2, _local2.hitbounds);
if (hit == true) {
if (vx != 0) {
_local2.vx = 0;
_local2.x = _local2.oldx;
}
if (vz != 0) {
_local2.vz = 0;
_local2.z = _local2.oldz;
}
}
}
}
_local3++;
}
};
playerObj.prototype.detectTileTypes = function () {
var _local1 = this;
switch (_local1.tile.type) {
case "door" :
if (_local1.tile.doortype != "stairs") {
if (_local1.tile.open == true) {
if (game.enemyManager.rectCollision(_local1.tile, _local1.tile.bounds, _local1, _local1.bounds)) {
_local1.action = _local1.OPENDOOR;
}
}
} else if (_local1.weapons[3].active == true) {
_local1.applyHover(1);
if (game.enemyManager.rectCollision(_local1.tile, _local1.tile.bounds, _local1, _local1.bounds)) {
_local1.action = _local1.OPENDOOR;
}
}
return;
case "normal" :
if (_local1.tile.ID == 5) {
soundcontrol("barrelexplode");
game.swapTileTo(4, _local1.ztile, _local1.xtile);
_local1.damage(200);
}
if ((_local1.tile.ID == 3) || (_local1.tile.ID == 6)) {
_local1.applyHover(true);
}
return;
case "weapon" :
var _local2 = _local1.tile.pickuptext;
var _local3 = _local1.tile.weaponID;
game.deleteTile(_local1.ztile, _local1.xtile);
game.createTile(1, _local1.ztile, _local1.xtile);
_local1.displayWeaponDialog(_local2, _local3);
}
};
playerObj.prototype.detectCurrentTile = function () {
var _local1 = this;
_local1.xtile = Math.round(_local1.x / game.tileW);
_local1.ztile = Math.round(_local1.z / game.tileH);
var _local2 = _local1.xtile - _local1.oldxtile;
var _local3 = _local1.oldztile - _local1.ztile;
if ((_local2 != 0) || (_local3 != 0)) {
_local1.exitTile();
}
_local1.oldxtile = _local1.xtile;
_local1.oldztile = _local1.ztile;
return(game.mapdata[_local1.ztile][_local1.xtile]);
};
playerObj.prototype.exitTile = function () {
var _local1 = this;
if (_local1.closeDialogFlag == 1) {
_local1.closeDialogFlag = 0;
_local1.hideScanDialog();
}
if (_local1.hoverOn) {
_local1.applyHover(false);
}
};
playerObj.prototype.isAccessingDoor = function (acc, obj) {
var _local1 = this;
var _local2 = _local1.weapons[4].active;
if ((_local2 != true) && (acc == true)) {
_local1.accessError = 20;
soundcontrol("error");
cursor.scan_mc.gotoAndStop(2);
} else {
switch (acc) {
case true :
soundcontrol("scanimageopen");
_local1.accessDoor = obj;
cursor.accessing_mc._visible = true;
_local1.accessTimer = _local1.accessMax;
return;
case false :
cursor.accessing_mc._visible = false;
cursor.scan_mc.gotoAndStop(1);
_local1.accessTimer = 0;
return;
case "onup" :
cursor.accessing_mc._visible = false;
_local1.accessTimer = 0;
case "hover" :
if (!_local1.weapons[4].active) {
break;
}
cursor.scan_mc.gotoAndStop(3);
}
}
};
playerObj.prototype.showAccess = function (percent) {
var _local1 = 100 - Math.round(percent);
cursor.accessing_mc.gotoAndStop(percent + 1);
if (_local1 == 100) {
soundcontrol("dooropen");
cursor.accessing_mc._visible = false;
cursor.scan_mc.gotoAndStop(1);
this.accessTimer = 0;
this.accessDoor.doormc.gotoAndPlay("open");
}
};
playerObj.prototype.initDialog = function () {
var _local1 = this;
_local1.dialogFlag = 0;
_local1.pictureFlag = 0;
_local1.closeDialogFlag = 0;
_local1.lastDialogText = "";
_local1.lastDialogTile = {};
_local1.dialogTimer = 0;
_local1.dialogMax = 140;
};
playerObj.prototype.detectScanInfo = function () {
var _local2 = this;
var _local1 = _maptext[_local2.ztile][_local2.xtile];
if ((_local1.picture != null) && (_local1.text != null)) {
_local2.displayPictureScanDialog(_local1.picture, _local1.text);
} else if ((_local1.picture == null) && (_local1.text != null)) {
_local2.displayScanDialog(_local1.text);
}
};
playerObj.prototype.displayPictureScanDialog = function (dialogpic, dialogtext) {
var _local1 = this;
if (_local1.lastDialogText != dialogtext) {
_local1.hideScanDialog();
}
if ((_local1.dialogFlag == 0) && (_local1.closeDialogFlag == 0)) {
_local1.dialogFlag = 1;
_local1.pictureFlag = 1;
_local1.lastDialogText = dialogtext;
_local1.lastDialogTile = _local1.tile;
var _local2 = _timeline.textdialog;
_local2.output = _local1.lastDialogText;
_local2.pic = dialogpic;
_local2.gotoAndStop("in");
_local1.dialogTimer = _local1.dialogMax;
}
};
playerObj.prototype.displayScanDialog = function (dialogtext) {
var _local1 = this;
if (_local1.lastDialogText != dialogtext) {
_local1.hideScanDialog();
}
if ((_local1.dialogFlag == 0) && (_local1.closeDialogFlag == 0)) {
_local1.dialogFlag = 1;
_local1.lastDialogText = dialogtext;
_local1.lastDialogTile = _local1.tile;
var _local2 = _timeline.textdialog;
_local2.output = _local1.lastDialogText;
_local2.pic = null;
_local2.gotoAndStop("in");
_local1.dialogTimer = _local1.dialogMax;
}
};
playerObj.prototype.hideScanDialog = function () {
var _local2 = this;
if (_local2.dialogFlag == 1) {
var _local1 = _timeline.textdialog;
_local1.output = "";
_local1.gotoAndStop("out");
_local2.dialogFlag = 0;
_local2.closeDialogFlag = 0;
_local2.pictureFlag = 0;
}
};
playerObj.prototype.applyHover = function (hoverflag) {
var _local1 = this;
if (hoverflag) {
if (_local1.mc.shadow_mc._currentframe == 1) {
_local1.mc.shadow_mc.gotoAndPlay("in");
}
_local1.hoverOn = true;
_local1.hoverTimer = _local1.hoverMax;
var _local2 = 10;
_local1.mc.feet_mc.tween("_y", _local1.yf - _local2, 3, 3);
_local1.mc.mid_mc.tween("_y", _local1.ym - _local2, 3, 3);
_local1.mc.head_mc.tween("_y", _local1.yh - _local2, 3, 3);
_local1.gunBlock = true;
} else {
_local1.mc.shadow_mc.gotoAndStop("out");
_local1.hoverOn = false;
_local1.hoverTimer = _local1.hoverMax;
_local1.mc.feet_mc.tween("_y", _local1.yf, 3, 3);
_local1.mc.mid_mc.tween("_y", _local1.ym, 3, 3);
_local1.mc.head_mc.tween("_y", _local1.yh, 3, 3);
_local1.gunBlock = false;
}
};
playerObj.prototype.displayWeaponDialog = function (dialogtext, weaponID) {
var _local1 = _timeline.weapondialog;
_local1.gotoAndPlay("in");
_local1.output = dialogtext;
this.lastweapon = weaponID;
game.renderManager.action = game.renderManager.WEAPONDIALOG;
};
playerObj.prototype.mineDisplay = function (showmine) {
var z = (this.ztile - game.halfvisz);
while (z <= (this.ztile + game.halfvisz)) {
var _local2 = this.xtile - game.halfvisx;
while (_local2 <= (this.xtile + game.halfvisx)) {
var _local1 = game.mapdata[z][_local2];
var _local3 = _local1.ID;
if (_local3 == 5) {
if (showmine) {
var frame = (1 + random(25));
_local1.mc.tile_mc.gotoAndPlay("in");
_local1.mc.tile_mc.mine_mc.gotoAndPlay(frame);
} else {
_local1.mc.tile_mc.gotoAndStop("out");
}
}
_local2++;
}
z++;
}
};
playerObj.prototype.cloakDisplay = function (bool) {
var _local3 = game.enemyManager.enemylist;
var _local1 = 0;
while (_local1 < _local3.length) {
var _local2 = _local3[_local1];
_local2.switchCloak(bool);
_local1++;
}
};
playerObj.prototype.fire = function () {
var _local1 = this;
if (_local1.action == _local1.ACTIVE) {
if (_local1.gunflag == true) {
if ((_local1.fTimer == 0) && (_local1.bulletCount < _local1.bulletMax)) {
_local1.fTimer = _local1.fDelay;
_local1.bulletCount++;
((_local1.bulletIndex > (_local1.bulletMax - 1)) ? ((_local1.bulletIndex = 0)) : (_local1.bulletIndex++));
_local1.fAnim = _local1.fAnimMax;
_local1.mc.mid_mc.fire_mc._visible = 1;
new bulletObj(_local1.origin.x, _local1.origin.z, Math.floor(_local1.tangle), _local1.bulletPwr, _local1.bulletIndex);
}
} else {
soundcontrol("punch");
_local1.pFlag = 0;
_local1.pAnim = _local1.pAnimMax;
_local1.mc.mid_mc.punch_mc._visible = 1;
_local1.mc.mid_mc.idle_mc._visible = 0;
}
}
};
playerObj.prototype.punchCollision = function () {
var checkhit = 0;
var punchpower = 3;
var m = {};
m.x = this.origin.x + (25 * _timeline.fastSIN(this.tangle));
m.z = this.origin.z + (25 * (-_timeline.fastCOS(this.tangle)));
var _local2 = 0;
while (_local2 < game.enemyManager.enemylist.length) {
var _local1 = game.enemyManager.enemylist[_local2];
var _local3 = game.enemyManager.rectCollision(_local1, _local1.hitbounds, m, this.pbounds);
if (_local3 == true) {
checkhit = true;
_local1.damage(2);
}
_local2++;
}
if (checkhit) {
this.pFlag = 1;
}
};
playerObj.prototype.getKeyInput = function () {
var _local1 = this;
var _local2 = 0;
if (Key.isDown(39) || (Key.isDown(68))) {
_local2 = 90;
_local1.vx = 1;
_local1.vz = 0;
} else if (Key.isDown(37) || (Key.isDown(65))) {
_local2 = 270;
_local1.vx = -1;
_local1.vz = 0;
} else if (Key.isDown(38) || (Key.isDown(87))) {
_local2 = 360;
_local1.vz = -1;
_local1.vx = 0;
} else if (Key.isDown(40) || (Key.isDown(83))) {
_local2 = 180;
_local1.vz = 1;
_local1.vx = 0;
} else {
_local1.vx = (_local1.vz = 0);
}
if (_local2 != 0) {
_local1.bdir = _local2;
}
_local1.origin = {x:_local1.x + _local1.bounds.offsetX, z:_local1.z};
_local1.mc.feet_mc.gotoAndStop(_local1.getRotFrame(_local1.bdir, "bangle", _local1.bspeed));
_local1.mc.head_mc.gotoAndStop(_local1.getRotFrame(_local1.bdir, "bangle", _local1.bspeed));
if (_local1.tspeed == _local1.tboost2) {
var _local3 = {x:_root._xmouse, y:_root._ymouse};
game.zsort.globalToLocal(_local3);
var mousepos = game.getGameCoords(_local3.x, _local3.y);
var newangle = Math.round(_timeline.findAngle(_local1.origin.x, _local1.origin.z, mousepos.x, mousepos.z));
if (newangle != _local1.tangle) {
_local1.mc.mid_mc.idle_mc.gotoAndStop(_local1.getRotFrame(newangle, "tangle", _local1.tspeed));
}
} else {
_local1.mc.mid_mc.idle_mc.gotoAndStop(_local1.getRotFrame(_local1.bdir, "bangle", _local1.bspeed));
_local1.tangle = _local1.bangle;
}
};
playerObj.prototype.getNewVelocity = function () {
var _local1 = this;
var _local2 = {};
var vx = (_local1.vx * _local1.speed);
var _local3 = _local1.vz * _local1.speed;
_local2.x = _local1.x + vx;
_local2.z = _local1.z + _local3;
return(_local2);
};
playerObj.prototype.getzDepth = function () {
var _local1 = this;
var _local2 = game.getZDepth(_local1.xtile, _local1.ztile);
return(_local2 + _local1.zBase);
};
playerObj.prototype.getRotFrame = function (newangle, anglevar, speedvar) {
var _local2 = speedvar;
var _local3 = this;
var diff = (newangle - _local3[anglevar]);
var absdiff = Math.abs(diff);
var _local1 = _local3[anglevar];
if (absdiff < _local2) {
_local1 = newangle;
} else if (absdiff < 180) {
((diff > 0) ? (_local1 = _local1 + _local2) : (_local1 = _local1 - _local2));
} else {
((diff > 0) ? (_local1 = _local1 - _local2) : (_local1 = _local1 + _local2));
}
if (_local1 < 0) {
_local1 = _local1 + 360;
}
if (_local1 > 360) {
_local1 = _local1 - 360;
}
_local3[anglevar] = _local1;
var frame = (Math.floor(_local3[anglevar] / _local3.tpercent) + 1);
return(frame);
};
playerObj.prototype.rePos = function (x, z) {
var _local1 = this;
_local1.x = x * game.tileW;
_local1.z = z * game.tileH;
_local1.xtile = (_local1.oldxtile = x);
_local1.ztile = (_local1.oldztile = z);
};
playerObj.prototype.reStart = function (x, z) {
var _local1 = this;
var _local2 = z;
var _local3 = x;
_local1.rePos(_local3, _local2);
_local1.gunBlock = false;
cursor.scan_mc.gotoAndStop(1);
_local1.applyHover(0);
_local1.initDialog = {};
_local1.removeMouseInput();
_local1.addMouseInput();
_local1.reSetTimers();
_local1.mc = game.createObjectIn(game.zsort, "dalek", "dalek", _local3, _local2, game.getZDepth(_local3, _local2));
_local1.reDirect(_local1.reStartInfo.direction);
_local1.renderID = game.renderManager.addObj(_local1);
_local1.detectAll();
_local1.renderToScreen();
game.moveCameraTo(_local1.x, _local1.z);
_local1.action = _local1.ACTIVE;
};
playerObj.prototype.reSetTimers = function () {
var _local1 = this;
_local1.fOn = 0;
_local1.fTimer = 0;
_local1.pAnim = 0;
_local1.shieldTiming = 0;
_local1.tDoorTimer = 0;
_local1.tDoorMsecs = 0;
_local1.dialogTimer = 0;
_local1.accessTimer = 0;
_local1.bulletCount = 0;
_local1.bulletIndex = -1;
_local1.tDocFight = 0;
};
playerObj.prototype.reDirect = function (direction) {
var _local1 = this;
switch (direction) {
case 1 :
trace("geort here1");
_local1.mc.feet_mc.gotoAndStop(27);
_local1.mc.head_mc.gotoAndStop(27);
_local1.mc.mid_mc.idle_mc.gotoAndStop(27);
_local1.tangle = (_local1.bangle = 270);
return;
case 2 :
trace("geort here2");
_local1.mc.feet_mc.gotoAndStop(36);
_local1.mc.head_mc.gotoAndStop(36);
_local1.mc.mid_mc.idle_mc.gotoAndStop(36);
_local1.tangle = (_local1.bangle = 0);
return;
case 3 :
trace("geort here3");
_local1.mc.feet_mc.gotoAndStop(18);
_local1.mc.head_mc.gotoAndStop(18);
_local1.mc.mid_mc.idle_mc.gotoAndStop(18);
_local1.tangle = (_local1.bangle = 180);
return;
case 4 :
trace("geort here4");
_local1.mc.feet_mc.gotoAndStop(9);
_local1.mc.head_mc.gotoAndStop(9);
_local1.mc.mid_mc.idle_mc.gotoAndStop(9);
_local1.tangle = (_local1.bangle = 90);
}
};
playerObj.prototype.reSet = function () {
var _local1 = this;
if ((_local1.weapons[1].active == true) || (_local1.weapons[8].active == true)) {
_local1.switchShield(true);
} else {
_local1.switchShield(false);
}
_local1.lastweapon = 0;
_local1.createWeapons();
_local1.energy = 100;
_local1.shield = 100;
_local1.tDoorTimer = 0;
_local1.tDoorMsecs = 31;
_local1.displayShield();
_local1.displayEnergy();
};
playerObj.prototype.initDocFight = function (x, z, doctext) {
var _local1 = this;
_local1.rePos(x, z);
_local1.renderToScreen();
_local1.mc._visible = 0;
game.moveCameraTo(_local1.x, _local1.z);
_local1.tdoc = new doctorObj(z, x);
_local1.tdoc.faceDir(2);
_local1.tDoorText = doctext;
_local1.tDocFight = 1;
_local1.tDoorPause = _local1.tDoorPMax;
_local1.action = _local1.SCRIPTDOOR;
};
playerObj.prototype.initDoorTimer = function (x, z, timer, doctext) {
var _local1 = this;
_local1.rePos(x, z);
_local1.renderToScreen();
_local1.mc._visible = 0;
_local1.tDoorTimer = Math.round(timer / 31);
_local1.tDoorx = x;
_local1.tDoorz = z;
_local1.tDoorText = doctext;
_timeline.blasttime_mc.timer = _local1.tDoorTimer;
_timeline.blasttime_mc.milli = "00";
game.moveCameraTo(_local1.x, _local1.z);
};
playerObj.prototype.startDoorTimer = function (frame) {
var _local1 = this;
_local1.tDoorTile = game.mapdata[_local1.ztile][_local1.xtile];
var _local2 = _local1.getDoorDir(_local1.tDoorTile.frame);
_local1.tdoc = new doctorObj(_local1.ztile + _local2.z, _local1.xtile + _local2.x, 999, 999, 999, 4);
_local1.tdoc.faceDir(_local1.tDoorTile.frame);
_local1.tDoorPause = _local1.tDoorPMax;
_local1.action = _local1.SCRIPTDOOR;
};
playerObj.prototype.initDoor2Player = function () {
var _local1 = this;
var _local3 = _local1.x;
var _local2 = _local1.z;
_local1.Stx = Math.round(_local1.reStartInfo.x * game.tileW);
_local1.Stz = Math.round(_local1.reStartInfo.z * game.tileH);
_local1.x = _local1.Stx;
_local1.z = _local1.Stz;
_local1.mc._visible = 1;
_local1.renderToScreen();
_local1.x = _local3;
_local1.z = _local2;
_local1.detectCurrentTile();
_local1.action = _local1.TWEENFROMDOOR;
};
playerObj.prototype.getDoorDir = function (frame) {
var _local1 = {x:0, z:0};
switch (frame) {
case 1 :
_local1.x = 1;
_local1.z = 0;
return(_local1);
case 2 :
_local1.x = 0;
_local1.z = 1;
return(_local1);
case 3 :
_local1.x = 0;
_local1.z = -1;
return(_local1);
case 4 :
_local1.x = -1;
_local1.z = 0;
return(_local1);
}
return(undefined);
};
playerObj.prototype.loadMap = function () {
var _local1 = this;
game.parsemap(_local1.reStartInfo.map, _local1.reStartInfo.x, _local1.reStartInfo.z, 0);
};
playerObj.prototype.update = function () {
var _local1 = this;
switch (_local1.action) {
case _local1.ACTIVE :
if (_local1.fOn == 1) {
_local1.fire();
}
if (_local1.fTimer > 0) {
_local1.fTimer--;
}
if (_local1.fAnim > 0) {
var frame = _local1.mc.mid_mc.idle_mc._currentframe;
_local1.mc.mid_mc.fire_mc.gotoAndStop(frame);
_local1.fAnim--;
if (_local1.fAnim == 0) {
_local1.mc.mid_mc.fire_mc._visible = 0;
}
}
if (_local1.pAnim > 0) {
_local1.pAnim--;
var frame = _local1.mc.mid_mc.idle_mc._currentframe;
_local1.mc.mid_mc.punch_mc.gotoAndStop(frame);
if (_local1.pFlag == 0) {
_local1.punchCollision();
}
if (_local1.pAnim == 0) {
_local1.mc.mid_mc.punch_mc._visible = 0;
_local1.mc.mid_mc.idle_mc._visible = 1;
}
}
if (_local1.shieldTiming > 0) {
_local1.shieldTiming--;
}
if ((_local1.shieldTiming == 0) && (_local1.shield < 100)) {
_local1.adjustShield(_local1.shieldRecover);
}
if (_local1.tDoorTimer > 0) {
_local1.tDoorMsecs--;
var _local2 = "0" add Math.round(100 * (_local1.tDoorMsecs / 31));
if (_local1.tDoorMsecs <= 0) {
_local1.tDoorTimer--;
_timeline.blasttime_mc.timer = _local1.tDoorTimer;
_local1.tDoorMsecs = 31;
}
if (_local1.tDoorTimer <= 0) {
_local1.action = _local1.TWEENKILLDOOR;
}
_local2 = _local2.substr(_local2.length - 2, _local2.length);
_timeline.blasttime_mc.milli = _local2;
}
if (_local1.dialogTimer > 0) {
_local1.dialogTimer--;
if (_local1.dialogTimer == 0) {
if (_local1.lastDialogTile == _local1.tile) {
_local1.closeDialogFlag = 1;
} else {
_local1.hideScanDialog();
}
}
}
if (_local1.accessError > 0) {
_local1.accessError--;
if (_local1.accessError == 0) {
cursor.scan_mc.gotoAndStop(1);
}
}
if (_local1.accessTimer > 0) {
_local1.accessTimer--;
var percent = ((_local1.accessTimer / _local1.accessMax) * 100);
_local1.showAccess(percent);
}
_local1.getKeyInput();
_local1.checkCollisions();
game.updateCamera(_local1.x, _local1.z);
return;
case _local1.KILL :
_local1.deathTimer--;
if (_local1.deathTimer == 0) {
_local1.deathTimer = _local1.deathMax;
_global._timeline.restartLevel();
_local1.action = _local1.IDLE;
}
return;
case _local1.OPENDOOR :
_local1.hideScanDialog();
_local1.dialogTimer = 0;
_local1.detectEndDoor(_local1.tile.ID);
game.renderManager.action = game.renderManager.IDLE;
_local1.reStartInfo = {map:_local1.tile.maplink, x:_local1.tile.startx, z:_local1.tile.startz, direction:_local1.tile.frame};
_timeline.transition.gotoAndPlay("in");
_local1.action = _local1.IDLE;
return;
case _local1.SCRIPTDOOR :
if (_local1.tDoorPause > -15) {
_local1.tDoorPause--;
if (_local1.tDoorPause == (_local1.tDoorPMax - 10)) {
_local1.displayScanDialog(_local1.tDoorText);
}
if (_local1.tDoorPause == 0) {
_local1.hideScanDialog();
}
if (_local1.tDoorPause == -15) {
if (_local1.tDocFight == 1) {
_local1.tDoorPause--;
_timeline.blasttime_mc.gotoAndPlay("docbar");
_timeline.blasttime_mc.dochealth_mc.gotoAndStop(100);
soundcontrol("dalekboss");
_local1.initDoor2Player();
} else {
_local1.tdoc.walkDir();
_local1.tDoorPause--;
_local1.action == _local1.IDLE;
}
}
}
return;
case _local1.TWEENFROMDOOR :
if ((_local1.restartInfo.x == _local1.xtile) && (_local1.restartInfo.z == _local1.ztile)) {
_local1.x = _local1.Stx;
_local1.z = _local1.Stz;
if (_local1.tDocFight == 1) {
_local1.action = _local1.ACTIVE;
_local1.tdoc.action = _local1.tdoc.PAUSE;
} else {
_local1.Stx = Math.round(_local1.tDoorx * game.tileW);
_local1.Stz = Math.round(_local1.tDoorz * game.tileH);
_local1.tDoorTimer--;
_timeline.blasttime_mc.timer = _local1.tDoorTimer;
_local1.action = _local1.ACTIVE;
}
}
var dx = (_local1.Stx - _local1.x);
var dy = (_local1.Stz - _local1.z);
_local1.x = _local1.x + (dx / 50);
_local1.z = _local1.z + (dy / 50);
game.updateCamera(_local1.x, _local1.z);
_local1.detectCurrentTile();
return;
case _local1.TWEENKILLDOOR :
if ((_local1.tDoorx == _local1.xtile) && (_local1.tDoorz == _local1.ztile)) {
soundcontrol("timeddoor");
_local1.x = _local1.Stx;
_local1.z = _local1.Stz;
var doorobj = game.mapdata[_local1.tDoorz][_local1.tDoorx];
doorobj.doormc.gotoAndPlay("close");
_local1.action = _local1.IDLE;
}
var dx = (_local1.Stx - _local1.x);
var dy = (_local1.Stz - _local1.z);
_local1.x = _local1.x + (dx / 60);
_local1.z = _local1.z + (dy / 60);
game.updateCamera(_local1.x, _local1.z);
_local1.detectCurrentTile();
return;
case _local1.BLOWUP :
if (random(5) == 1) {
var _local3 = game.enemyManager.getExplosionDepth();
if (_local3 != null) {
var x = ((_local1.xtile - 3) + random(6));
var z = ((_local1.ztile - 3) + random(6));
new explosionObj(x, z, "explosion", _local3);
}
}
_local1.endTimer--;
if (_local1.endTimer == 0) {
_local1.endTimer = _local1.endTimerMax;
_local1.action = _local1.IDLE;
_timeline.whitetransition_mc.gotoAndPlay("in");
}
game.updateCamera(_local1.x, _local1.z);
return;
case _local1.IDLE :
return;
}
};
playerObj.prototype.renderToScreen = function () {
var _local1 = this;
_local1.mc.swapDepths(_local1.getzDepth());
_local1.oldx = _local1.x;
_local1.oldz = _local1.z;
var _local2 = game.getScreenCoords(_local1.x + _local1.hwidth, _local1.z + _local1.hheight);
_local1.mc._x = _local2.x + game.tileW;
_local1.mc._y = _local2.y;
};
playerObj.prototype.destroy = function () {
var _local1 = this;
game.renderManager.removeObj(_local1);
_local1.mc.removeMovieClip();
delete _local1.mc;
};
play();
Frame 16
function EnemyManagerObj(mc) {
var _local1 = this;
_local1.enemyCount = 0;
_local1.enemylist = new Array();
_local1.eBDepth = -1;
_local1.eDepth = -1;
_local1.eBCount = 0;
_local1.eCount = 0;
_local1.eBMax = 6;
_local1.eMax = 10;
_local1.pDepth = -1;
_local1.pCount = 0;
_local1.pMax = 8;
_local1.guardsInRoom = 0;
_local1.maxGuards = 0;
_local1.enemiesReady = false;
}
function RenderManagerObj(mc) {
var _local1 = this;
_local1.init(mc);
_local1.keyListener = new Object();
_local1.keyListener.obj = _local1;
_local1.keyListener.onKeyUp = function () {
var _local1 = this;
if (Key.getCode() == 32) {
if (Dalek.action == Dalek.ACTIVE) {
if (_local1.obj.action == _local1.obj.ACTIVE) {
if (Dalek.pictureFlag == 1) {
_local1.obj.action = _local1.obj.SHOWPIC;
} else if (Dalek.tile.ID != 3) {
_local1.obj.action = _local1.obj.EQUIP;
}
} else if (_local1.obj.action == _local1.obj.EPAUSE) {
_local1.obj.action = _local1.obj.OFFEQUIP;
} else if (_local1.obj.action == _local1.obj.PPAUSE) {
_local1.obj.action = _local1.obj.CLOSEPIC;
}
}
}
};
Key.addListener(_local1.keyListener);
}
EnemyManagerObj.prototype.init = function () {
var _local1 = this;
_local1.maxGuards = _local1.guardsInRoom;
_local1.enemiesReady = true;
};
EnemyManagerObj.prototype.getExplosionDepth = function () {
var _local1 = this;
if ((_local1.pCount + 1) <= _local1.pMax) {
_local1.pCount++;
if (_local1.pDepth > _local1.pMax) {
_local1.pDepth = 0;
} else {
_local1.pDepth++;
}
return(_local1.pDepth);
}
return(null);
};
EnemyManagerObj.prototype.getEnemyDepth = function () {
var _local1 = this;
if ((_local1.eCount + 1) <= _local1.eMax) {
_local1.eCount++;
if (_local1.eDepth > _local1.eMax) {
_local1.eDepth = 0;
} else {
_local1.eDepth++;
}
return(_local1.eDepth);
}
return(null);
};
EnemyManagerObj.prototype.getEnemyBDepth = function () {
var _local1 = this;
if ((_local1.eBCount + 1) <= _local1.eBMax) {
_local1.eBCount++;
if (_local1.eBDepth > _local1.eBMax) {
_local1.eBDepth = 0;
} else {
_local1.eBDepth++;
}
return(_local1.eBDepth);
}
return(null);
};
EnemyManagerObj.prototype.rectCollision = function (obs1, oB1, obs2, oB2) {
var _local1 = oB2;
var _local2 = oB1;
var _local3 = obs2;
var l1 = ((obs1.x - _local2.width) + _local2.offsetX);
var r1 = ((obs1.x + _local2.width) + _local2.offsetX);
var t1 = ((obs1.z - _local2.height) + _local2.offsetZ);
var b1 = ((obs1.z + _local2.height) + _local2.offsetZ);
var l2 = ((_local3.x - _local1.width) + _local1.offsetX);
var r2 = ((_local3.x + _local1.width) + _local1.offsetX);
var t2 = ((_local3.z - _local1.height) + _local1.offsetZ);
var b2 = ((_local3.z + _local1.height) + _local1.offsetZ);
if (((t1 < b2) && (t2 < b1)) && ((l1 < r2) && (l2 < r1))) {
return(true);
}
return(false);
};
EnemyManagerObj.prototype.drawCollision = function (obs1, oB1, obs2, oB2) {
var _local1 = oB2;
var _local2 = oB1;
_timeline.drawBound(obs1.x, obs1.z, _local2.offsetX, _local2.offsetZ, _local2.width, _local2.height, game.zsort, 5000, 1);
_timeline.drawBound(obs2.x, obs2.z, _local1.offsetX, _local1.offsetZ, _local1.width, _local1.height, game.zsort, 5001, 1);
};
EnemyManagerObj.prototype.playerRectCollision = function (pl, obs) {
var _local1 = pl;
var _local2 = obs;
var l1 = ((_local1.x - _local1.hitbounds.width) + _local1.hitbounds.offsetX);
var r1 = ((_local1.x + _local1.hitbounds.width) + _local1.hitbounds.offsetX);
var t1 = ((_local1.z - _local1.hitbounds.height) + _local1.hitbounds.offsetZ);
var b1 = ((_local1.z + _local1.hitbounds.height) + _local1.hitbounds.offsetZ);
var _local3 = (_local2.x - _local2.bounds.width) + _local2.bounds.offsetX;
var r2 = ((_local2.x + _local2.bounds.width) + _local2.bounds.offsetX);
var t2 = ((_local2.z - _local2.bounds.height) + _local2.bounds.offsetZ);
var b2 = ((_local2.z + _local2.bounds.height) + _local2.bounds.offsetZ);
if (((t1 < b2) && (t2 < b1)) && ((l1 < r2) && (_local3 < r1))) {
return(true);
}
return(false);
};
EnemyManagerObj.prototype.addEnemy = function (obj) {
var _local1 = this;
var _local2 = _local1.enemylist.length;
_local1.enemylist.push(obj);
_local1.enemyCount++;
return(_local2);
};
EnemyManagerObj.prototype.removeEnemy = function (obj) {
var _local2 = this;
if (obj.nameID != "sentry") {
_local2.eCount--;
_local2.guardsInRoom--;
if (_local2.guardsInRoom <= 0) {
game.openEnemyLock();
}
}
var _local3 = obj.enemyID;
_local2.enemylist.splice(_local3, 1);
var numObjs = _local2.enemylist.length;
var _local1 = _local3;
while (_local1 < numObjs) {
_local2.enemylist[_local1].enemyID = _local1;
_local1++;
}
};
RenderManagerObj.prototype.init = function (src_mc) {
var _local1 = this;
_local1.layer_mc = src_mc;
_local1.objCount = 0;
_local1.obj_array = new Array();
_local1.ACTIVE = 1;
_local1.EQUIP = 2;
_local1.OFFEQUIP = 3;
_local1.SHOWPIC = 4;
_local1.CLOSEPIC = 5;
_local1.IDLE = 6;
_local1.EPAUSE = 7;
_local1.PPAUSE = 8;
_local1.action = _local1.ACTIVE;
_local1.layer_mc.obj = _local1;
_local1.layer_mc.onEnterFrame = function () {
this.obj.update();
};
};
RenderManagerObj.prototype.addObj = function (obj) {
var _local1 = this;
var _local2 = _local1.obj_array.length;
_local1.obj_array.push(obj);
_local1.objCount++;
return(_local2);
};
RenderManagerObj.prototype.removeObj = function (obj) {
var _local2 = obj.renderID;
this.obj_array.splice(_local2, 1);
var _local3 = this.obj_array.length;
var _local1 = _local2;
while (_local1 < _local3) {
this.obj_array[_local1].renderID = _local1;
_local1++;
}
};
RenderManagerObj.prototype.update = function () {
var _local1 = this;
switch (_local1.action) {
case _local1.ACTIVE :
var _local2 = 0;
while (_local2 < _local1.obj_array.length) {
var _local3 = _local1.obj_array[_local2];
_local3.update();
_local2++;
}
return;
case _local1.SHOWPIC :
soundcontrol("scanimageclose");
Dalek.removeMouseInput();
_timeline.textdialog.displayPicture();
_local1.action = _local1.PPAUSE;
return;
case _local1.CLOSEPIC :
soundcontrol("scanimageclose");
Dalek.addMouseInput();
var mc = _timeline.textdialog;
mc.output = "";
mc.pic_mc.gotoAndPlay("out");
Dalek.pictureFlag = 0;
Dalek.closeDialogFlag = 1;
_local1.action = _local1.ACTIVE;
return;
case _local1.EQUIP :
soundcontrol("equipopen");
Dalek.removeMouseInput();
_timeline.pause.gotoAndPlay("in");
_local1.action = _local1.EPAUSE;
return;
case _local1.OFFEQUIP :
soundcontrol("equipclose");
_timeline.pause.pausedetails_mc.confirmSelected();
Dalek.addMouseInput();
_timeline.pause.gotoAndPlay("out");
_local1.action = _local1.ACTIVE;
return;
case _local1.WEAPONDIALOG :
Dalek.removeMouseInput();
_local1.action = _local1.IDLE;
case _local1.IDLE :
return;
case _local1.EPAUSE :
return;
case _local1.PPAUSE :
}
};
Tile = function (walkable, zsort, height) {
var _local1 = this;
_local1.ID = null;
_local1.type = "normal";
_local1.scaninfo = null;
_local1.mc = null;
_local1.height = height;
_local1.walkable = walkable;
_local1.zsort = zsort;
};
Tile.prototype.init = function () {
var _local1 = this;
if (_local1.ID == 0) {
} else {
_local1.mc.gotoAndStop(_local1.ID);
}
};
Door = function (maplink, stx, stz, doortype, frame, open) {
var _local1 = this;
_local1.maplink = maplink;
_local1.startx = stx;
_local1.startz = stz;
_local1.doortype = doortype;
_local1.frame = frame;
_local1.open = open;
_local1.ID = null;
_local1.type = "door";
_local1.scaninfo = null;
_local1.mc = null;
_local1.height = false;
_local1.walkable = true;
_local1.bounds = _local1.returnBounds();
((frame >= 3) ? ((_local1.zsort = 1)) : ((_local1.zsort = 0)));
};
Door.prototype.init = function () {
var _local1 = this;
_local1.mc.gotoAndStop(15);
_local1.mc.tile_mc.gotoAndStop(_local1.doortype);
_local1.mc.tile_mc.door_mc.gotoAndStop(_local1.frame);
if (_local1.doortype == "encripted") {
_local1.doormc = _local1.mc.tile_mc.door_mc.slide_mc;
_local1.mc.obj = _local1;
}
if (_local1.doortype == "enemylocked") {
_local1.doormc = _local1.mc.tile_mc.door_mc.slide_mc;
_local1.mc.obj = _local1;
if (_local1.open == 1) {
_local1.doormc.gotoAndStop("idle");
}
}
if (_local1.doortype == "blasttimer") {
_local1.doormc = _local1.mc.tile_mc.door_mc.slide_mc;
_local1.mc.obj = _local1;
}
if (_local1.doortype == "blastdoor") {
_local1.hitbounds = _local1.returnHitbounds();
_local1.doormc = _local1.mc.tile_mc.door_mc.slide_mc;
if (_local1.open == 1) {
_local1.doormc.gotoAndStop("open");
} else {
_local1.doormc.gotoAndStop("closed");
}
}
};
Door.prototype.returnBounds = function () {
switch (this.frame) {
case 1 :
return({width:7, height:7, offsetX:22, offsetZ:-2});
case 2 :
return({width:7, height:7, offsetX:44, offsetZ:-10});
case 3 :
return({width:7, height:7, offsetX:40, offsetZ:20});
case 4 :
return({width:7, height:15, offsetX:62, offsetZ:-2});
}
};
Door.prototype.returnHitbounds = function () {
switch (this.frame) {
case 1 :
return({width:7, height:15, offsetX:22, offsetZ:-2});
case 2 :
return({width:15, height:7, offsetX:44, offsetZ:-10});
case 3 :
return({width:15, height:7, offsetX:40, offsetZ:20});
case 4 :
return({width:7, height:15, offsetX:62, offsetZ:-2});
}
};
Door.prototype.slideCallback = function () {
var _local1 = this;
if (_local1.doortype == "encripted") {
_local1.open = true;
}
if (_local1.doortype == "enemylocked") {
game.swapLock();
}
if (_local1.doortype == "blasttimer") {
Dalek.action = Dalek.KILL;
}
};
Furniture = function (frame, health, height) {
var _local1 = this;
_local1.frame = frame;
_local1.health = health;
if (_local1.health == 0) {
_local1.health = null;
}
_local1.ID = null;
_local1.type = "furniture";
_local1.scaninfo = null;
_local1.mc = null;
_local1.height = height;
_local1.walkable = false;
_local1.zsort = true;
};
Furniture.prototype.init = function () {
var _local1 = this;
_local1.mc.gotoAndStop(16);
_local1.mc.tileframe = _local1.frame;
};
Furniture.prototype.destroy = function (amt) {
var _local1 = this;
if ((_local1.health != null) || (_local1.health != undefined)) {
if (_local1.health > 0) {
_local1.health = _local1.health - amt;
if (_local1.health <= 0) {
return(true);
}
if (_local1.frame == 15) {
var _local2 = _local1.mc.tile_mc.furniture_mc.furniture_mc;
_local2.gotoAndPlay("in");
}
return(false);
}
} else {
return(false);
}
return(undefined);
};
Weapon = function (weaponName, weaponID) {
var _local1 = this;
_local1.ID = null;
_local1.type = "weapon";
_local1.pickuptext = (weaponName add " integrated").toUpperCase();
_local1.weaponID = Number(weaponID);
_local1.mc = null;
_local1.height = false;
_local1.walkable = true;
_local1.zsort = true;
};
Weapon.prototype.init = function () {
var _local1 = this;
_local1.mc.gotoAndStop(50);
_local1.mc.tile_mc.gotoAndStop(_local1.weaponID + 1);
};
Sentry = function (level, fireang, rateOf, fRnd, range) {
var _local1 = this;
var _local2 = level;
_local1.fireangle = fireang;
if (_local2 == 6) {
_local1.health = 999;
_local1.power = 40;
} else if (_local2 == 7) {
_local1.health = 999;
_local1.power = 80;
} else {
_local1.health = 6;
_local1.power = 3 + (2 * _local2);
}
_local1.rest = 120 - (24 * _local2);
_local1.range = range;
_local1.speed = 3 + (0.8 * _local2);
_local1.firerate = rateOf;
_local1.firernd = fRnd;
_local1.ID = null;
_local1.type = "sentry";
_local1.scaninfo = null;
_local1.mc = null;
_local1.height = false;
_local1.walkable = false;
_local1.zsort = true;
};
Sentry.prototype.init = function () {
this.mc.gotoAndStop(18);
};
Scientist = function (level) {
var _local1 = this;
_local1.health = 3;
_local1.speed = 2 + (0.4 * level);
_local1.type = "scientist";
};
Guard = function (level) {
var _local1 = this;
var _local2 = level;
_local1.health = 4 * _local2;
_local1.speed = 2 + (0.4 * _local2);
_local1.range = 120 - (24 * _local2);
_local1.bspeed = 7 + (1.2 * _local2);
_local1.bpower = 4 + (3.4 * _local2);
_local1.type = "guard";
};
Soldier = function (level, cloak) {
var _local1 = this;
var _local2 = level;
_local1.health = 6 * _local2;
_local1.speed = 3 + (0.4 * _local2);
_local1.range = 120 - (24 * _local2);
_local1.bspeed = 7 + (1.2 * _local2);
_local1.bpower = 5 + (4 * _local2);
if (cloak == 1) {
_local1.type = "cloaked";
} else {
_local1.type = "soldier";
}
};
Doctor = function () {
this.type = "doctor";
};
Tile0 = function () {
};
Tile0.prototype = new Tile(0, 0, 1);
Tile1 = function () {
};
Tile1.prototype = new Tile(1, 0, 0);
Tile2 = function () {
};
Tile2.prototype = new Tile(0, 1, 1);
Tile3 = function () {
};
Tile3.prototype = new Tile(0, 0, 0);
Tile4 = function () {
};
Tile4.prototype = new Tile(1, 0, 0);
Tile5 = function () {
};
Tile5.prototype = new Tile(1, 0, 0);
Tile6 = function () {
};
Tile6.prototype = new Tile(0, 0, 0);
Tile20 = function () {
};
Tile20.prototype = new Tile(1, 1, 0);
Tile21 = function () {
};
Tile21.prototype = new Tile(1, 1, 0);
Tile22 = function () {
};
Tile22.prototype = new Tile(1, 1, 0);
Tile23 = function () {
};
Tile23.prototype = new Tile(1, 1, 0);
Tile100 = function () {
};
Tile100.prototype = new Door(2, 7, 9, "enemylocked", 2, 0);
Tile101 = function () {
};
Tile101.prototype = new Door(6, 9, 5, "encripted", 1, 0);
Tile102 = function () {
};
Tile102.prototype = new Door(1, 7, 2, "door", 3, 1);
Tile103 = function () {
};
Tile103.prototype = new Door(5, 9, 4, "encripted", 1, 0);
Tile104 = function () {
};
Tile104.prototype = new Door(4, 4, 9, "encripted", 2, 0);
Tile105 = function () {
};
Tile105.prototype = new Door(3, 7, 9, "enemylocked", 2, 0);
Tile106 = function () {
};
Tile106.prototype = new Door(2, 17, 2, "door", 3, 1);
Tile107 = function () {
};
Tile107.prototype = new Door(2, 4, 2, "door", 3, 1);
Tile108 = function () {
};
Tile108.prototype = new Door(2, 2, 4, "door", 4, 1);
Tile109 = function () {
};
Tile109.prototype = new Door(1, 2, 5, "door", 4, 1);
Tile110 = function () {
};
Tile110.prototype = new Door(7, 9, 5, "encripted", 1, 0);
Tile111 = function () {
};
Tile111.prototype = new Door(1, 1, 1, "doorclosed", 4, 0);
Tile112 = function () {
};
Tile112.prototype = new Door(8, 19, 8, "door", 1, 1);
Tile113 = function () {
};
Tile113.prototype = new Door(7, 2, 8, "door", 4, 1);
Tile114 = function () {
};
Tile114.prototype = new Door(9, 8, 19, "encripted", 2, 0);
Tile115 = function () {
};
Tile115.prototype = new Door(11, 9, 3, "enemylocked", 1, 0);
Tile116 = function () {
};
Tile116.prototype = new Door(8, 8, 2, "door", 3, 1);
Tile117 = function () {
};
Tile117.prototype = new Door(10, 9, 8, "door", 1, 1);
Tile118 = function () {
};
Tile118.prototype = new Door(9, 2, 17, "door", 4, 1);
Tile119 = function () {
};
Tile119.prototype = new Door(8, 2, 13, "door", 4, 1);
Tile120 = function () {
};
Tile120.prototype = new Door(12, 9, 9, "door", 1, 1);
Tile121 = function () {
};
Tile121.prototype = new Door(13, 5, 9, "encripted", 2, 0);
Tile122 = function () {
};
Tile122.prototype = new Door(11, 2, 9, "door", 4, 1);
Tile123 = function () {
};
Tile123.prototype = new Door(11, 5, 2, "door", 3, 1);
Tile124 = function () {
};
Tile124.prototype = new Door(14, 9, 4, "encripted", 1, 0);
Tile125 = function () {
};
Tile125.prototype = new Door(1, 1, 1, "doorclosed", 4, 0);
Tile126 = function () {
};
Tile126.prototype = new Door(15, 2, 2, "door", 3, 1);
Tile127 = function () {
};
Tile127.prototype = new Door(14, 2, 9, "door", 2, 1);
Tile128 = function () {
};
Tile128.prototype = new Door(16, 9, 7, "encripted", 1, 0);
Tile129 = function () {
};
Tile129.prototype = new Door(15, 2, 7, "door", 4, 1);
Tile130 = function () {
};
Tile130.prototype = new Door(20, 6, 9, "stairs", 2, 1);
Tile131 = function () {
};
Tile131.prototype = new Door(17, 29, 15, "encripted", 1, 0);
Tile132 = function () {
};
Tile132.prototype = new Door(16, 1, 5, "door", 4, 1);
Tile133 = function () {
};
Tile133.prototype = new Door(19, 9, 5, "encripted", 1, 0);
Tile134 = function () {
};
Tile134.prototype = new Door(19, 2, 9, "door", 2, 1);
Tile135 = function () {
};
Tile135.prototype = new Door(18, 9, 6, "encripted", 1, 0);
Tile136 = function () {
};
Tile136.prototype = new Door(17, 12, 26, "door", 4, 1);
Tile137 = function () {
};
Tile137.prototype = new Door(17, 12, 5, "door", 4, 1);
Tile138 = function () {
};
Tile138.prototype = new Door(17, 2, 12, "door", 3, 1);
Tile139 = function () {
};
Tile139.prototype = new Door(16, 6, 2, "stairs", 3, 1);
Tile140 = function () {
};
Tile140.prototype = new Door(21, 5, 9, "encripted", 2, 0);
Tile141 = function () {
};
Tile141.prototype = new Door(1, 1, 1, "doorclosed", 3, 0);
Tile142 = function () {
};
Tile142.prototype = new Door(22, 6, 9, "door", 2, 1);
Tile143 = function () {
};
Tile143.prototype = new Door(21, 6, 2, "door", 3, 1);
Tile144 = function () {
};
Tile144.prototype = new Door(23, 9, 5, "door", 1, 1);
Tile145 = function () {
};
Tile145.prototype = new Door(29, 5, 9, "encripted", 2, 0);
Tile146 = function () {
};
Tile146.prototype = new Door(24, 2, 5, "door", 4, 1);
Tile147 = function () {
};
Tile147.prototype = new Door(22, 2, 5, "door", 4, 1);
Tile148 = function () {
};
Tile148.prototype = new Door(22, 9, 6, "door", 1, 1);
Tile149 = function () {
};
Tile149.prototype = new Door(25, 5, 2, "door", 3, 1);
Tile150 = function () {
};
Tile150.prototype = new Door(24, 5, 9, "door", 2, 1);
Tile151 = function () {
};
Tile151.prototype = new Door(26, 2, 5, "door", 4, 1);
Tile152 = function () {
};
Tile152.prototype = new Door(1, 1, 1, "doorclosed", 3, 0);
Tile153 = function () {
};
Tile153.prototype = new Door(25, 9, 5, "door", 1, 1);
Tile154 = function () {
};
Tile154.prototype = new Door(27, 15, 2, "stairs", 3, 1);
Tile155 = function () {
};
Tile155.prototype = new Door(26, 5, 9, "stairs", 2, 1);
Tile156 = function () {
};
Tile156.prototype = new Door(28, 5, 9, "stairs", 2, 1);
Tile157 = function () {
};
Tile157.prototype = new Door(27, 5, 12, "stairs", 3, 1);
Tile158 = function () {
};
Tile158.prototype = new Door(25, 5, 9, "door", 2, 1);
Tile159 = function () {
};
Tile159.prototype = new Door(22, 5, 2, "door", 3, 1);
Tile160 = function () {
};
Tile160.prototype = new Door(30, 5, 9, "door", 2, 1);
Tile161 = function () {
};
Tile161.prototype = new Door(29, 5, 2, "door", 3, 1);
Tile162 = function () {
};
Tile162.prototype = new Door(31, 9, 6, "enemylocked", 1, 0);
Tile163 = function () {
};
Tile163.prototype = new Door(30, 2, 6, "door", 4, 1);
Tile164 = function () {
};
Tile164.prototype = new Door(32, 9, 3, "encripted", 1, 0);
Tile165 = function () {
};
Tile165.prototype = new Door(1, 1, 1, "doorclosed", 4, 0);
Tile166 = function () {
};
Tile166.prototype = new Door(34, 14, 19, "encripted", 2, 0);
Tile167 = function () {
};
Tile167.prototype = new Door(33, 9, 7, "door", 1, 1);
Tile168 = function () {
};
Tile168.prototype = new Door(32, 2, 7, "door", 4, 1);
Tile169 = function () {
};
Tile169.prototype = new Door(34, 4, 19, "door", 2, 1);
Tile170 = function () {
};
Tile170.prototype = new Door(33, 5, 2, "door", 3, 1);
Tile171 = function () {
};
Tile171.prototype = new Door(35, 4, 19, "stairs", 2, 1);
Tile172 = function () {
};
Tile172.prototype = new Door(35, 13, 9, "stairs", 2, 1);
Tile173 = function () {
};
Tile173.prototype = new Door(32, 4, 2, "door", 3, 1);
Tile174 = function () {
};
Tile174.prototype = new Door(34, 4, 12, "stairs", 3, 1);
Tile175 = function () {
};
Tile175.prototype = new Door(34, 13, 2, "stairs", 3, 1);
Tile176 = function () {
};
Tile176.prototype = new Door(36, 9, 2, "encripted", 1, 0);
Tile177 = function () {
};
Tile177.prototype = new Door(35, 2, 2, "door", 4, 1);
Tile178 = function () {
};
Tile178.prototype = new Door(37, 3, 2, "door", 3, 1);
Tile179 = function () {
};
Tile179.prototype = new Door(36, 6, 9, "door", 2, 1);
Tile180 = function () {
};
Tile180.prototype = new Door(38, 9, 8, "encripted", 1, 0);
Tile181 = function () {
};
Tile181.prototype = new Door(37, 2, 28, "door", 4, 1);
Tile182 = function () {
};
Tile182.prototype = new Door(39, 9, 4, "encripted", 1, 0);
Tile183 = function () {
};
Tile183.prototype = new Door(1, 1, 1, "doorclosed", 4, 0);
Tile184 = function () {
};
Tile184.prototype = new Door(41, 3, 9, "door", 2, 1);
Tile185 = function () {
};
Tile185.prototype = new Door(40, 9, 3, "door", 1, 1);
Tile186 = function () {
};
Tile186.prototype = new Door(39, 2, 4, "door", 4, 1);
Tile187 = function () {
};
Tile187.prototype = new Door(43, 3, 19, "encripted", 2, 0);
Tile188 = function () {
};
Tile188.prototype = new Door(39, 4, 2, "door", 3, 1);
Tile189 = function () {
};
Tile189.prototype = new Door(43, 9, 15, "encripted", 1, 0);
Tile190 = function () {
};
Tile190.prototype = new Door(42, 6, 9, "door", 2, 1);
Tile191 = function () {
};
Tile191.prototype = new Door(41, 6, 2, "door", 3, 1);
Tile192 = function () {
};
Tile192.prototype = new Door(41, 2, 5, "door", 4, 1);
Tile193 = function () {
};
Tile193.prototype = new Door(40, 3, 2, "door", 3, 1);
Tile194 = function () {
};
Tile194.prototype = new Door(44, 6, 9, "door", 2, 1);
Tile195 = function () {
};
Tile195.prototype = new Door(43, 6, 2, "door", 3, 1);
Tile196 = function () {
};
Tile196.prototype = new Door(45, 9, 5, "enemylocked", 1, 0);
Tile197 = function () {
};
Tile197.prototype = new Door(44, 2, 4, "door", 4, 1);
Tile198 = function () {
};
Tile198.prototype = new Door(46, 14, 2, "door", 3, 1);
Tile199 = function () {
};
Tile199.prototype = new Door(45, 4, 9, "door", 2, 1);
Tile600 = function () {
};
Tile600.prototype = new Door(47, 9, 4, "enemylocked", 1, 0);
Tile601 = function () {
};
Tile601.prototype = new Door(1, 1, 1, "doorclosed", 4, 0);
Tile602 = function () {
};
Tile602.prototype = new Door(48, 19, 16, "encripted", 1, 0);
Tile603 = function () {
};
Tile603.prototype = new Door(47, 2, 6, "door", 4, 1);
Tile604 = function () {
};
Tile604.prototype = new Door(50, 5, 9, "enemylocked", 2, 0);
Tile605 = function () {
};
Tile605.prototype = new Door(49, 9, 3, "door", 1, 1);
Tile606 = function () {
};
Tile606.prototype = new Door(48, 2, 23, "door", 4, 1);
Tile607 = function () {
};
Tile607.prototype = new Door(48, 5, 2, "door", 3, 1);
Tile608 = function () {
};
Tile608.prototype = new Door(51, 9, 3, "encripted", 1, 0);
Tile609 = function () {
};
Tile609.prototype = new Door(50, 2, 3, "door", 4, 1);
Tile610 = function () {
};
Tile610.prototype = new Door(52, 3, 2, "door", 3, 1);
Tile611 = function () {
};
Tile611.prototype = new Door(51, 3, 9, "door", 2, 1);
Tile612 = function () {
};
Tile612.prototype = new Door(53, 29, 5, "encripted", 1, 0);
Tile613 = function () {
};
Tile613.prototype = new Door(52, 2, 15, "door", 4, 1);
Tile614 = function () {
};
Tile614.prototype = new Door(54, 9, 7, "door", 1, 1);
Tile615 = function () {
};
Tile615.prototype = new Door(53, 2, 17, "door", 4, 1);
Tile616 = function () {
};
Tile616.prototype = new Door(55, 5, 9, "encripted", 2, 0);
Tile617 = function () {
};
Tile617.prototype = new Door(1, 1, 1, "doorclosed", 3, 0);
Tile618 = function () {
};
Tile618.prototype = new Door(57, 6, 19, "door", 2, 1);
Tile619 = function () {
};
Tile619.prototype = new Door(56, 9, 6, "encripted", 1, 0);
Tile620 = function () {
};
Tile620.prototype = new Door(55, 2, 6, "door", 4, 1);
Tile621 = function () {
};
Tile621.prototype = new Door(55, 6, 2, "door", 3, 1);
Tile622 = function () {
};
Tile622.prototype = new Door(58, 15, 9, "stairs", 2, 1);
Tile623 = function () {
};
Tile623.prototype = new Door(57, 5, 2, "stairs", 3, 1);
Tile624 = function () {
};
Tile624.prototype = new Door(59, 6, 2, "stairs", 3, 1);
Tile625 = function () {
};
Tile625.prototype = new Door(58, 6, 9, "stairs", 2, 1);
Tile626 = function () {
};
Tile626.prototype = new Door(61, 9, 9, "encripted", 1, 0);
Tile627 = function () {
};
Tile627.prototype = new Door(60, 9, 8, "door", 1, 1);
Tile628 = function () {
};
Tile628.prototype = new Door(59, 6, 8, "door", 4, 1);
Tile629 = function () {
};
Tile629.prototype = new Door(59, 4, 16, "door", 4, 1);
Tile630 = function () {
};
Tile630.prototype = new Door(62, 9, 5, "encripted", 1, 0);
Tile631 = function () {
};
Tile631.prototype = new Door(1, 1, 1, "door", 4, 0);
Tile632 = function () {
};
Tile632.prototype = new Door(63, 9, 5, "encripted", 1, 0);
Tile633 = function () {
};
Tile633.prototype = new Door(62, 2, 5, "door", 4, 1);
Tile635 = function () {
};
Tile635.prototype = new Door(64, 5, 29, "enemylocked", 2, 0);
Tile636 = function () {
};
Tile636.prototype = new Door(63, 5, 2, "blastdoor", 3, 0);
Tile638 = function () {
};
Tile638.prototype = new Door(65, 13, 19, "blasttimer", 2, 1);
Tile639 = function () {
};
Tile639.prototype = new Door(1, 1, 1, "blastdoor", 3, 0);
Tile641 = function () {
};
Tile641.prototype = new Door(66, 9, 5, "blasttimer", 1, 1);
Tile642 = function () {
};
Tile642.prototype = new Door(1, 1, 1, "blastdoor", 4, 0);
Tile643 = function () {
};
Tile643.prototype = new Door(67, 19, 19, "blasttimer", 1, 1);
Tile644 = function () {
};
Tile644.prototype = new Door(1, 1, 1, "blastdoor", 4, 0);
Tile645 = function () {
};
Tile645.prototype = new Door(71, 8, 9, "blastdoor", 2, 0);
Tile646 = function () {
};
Tile646.prototype = new Door(68, 9, 9, "blasttimer", 1, 1);
Tile647 = function () {
};
Tile647.prototype = new Door(69, 2, 19, "blastdoor", 4, 0);
Tile648 = function () {
};
Tile648.prototype = new Door(1, 1, 1, "blastdoor", 4, 0);
Tile649 = function () {
};
Tile649.prototype = new Door(70, 9, 9, "blastopen", 1, 1);
Tile650 = function () {
};
Tile650.prototype = new Door(69, 2, 19, "blastopen", 4, 1);
Tile651 = function () {
};
Tile651.prototype = new Door(69, 8, 2, "blastopen", 3, 1);
Tile652 = function () {
};
Tile652.prototype = new Door(72, 6, 9, "blastdoor", 2, 0);
Tile653 = function () {
};
Tile653.prototype = new Door(1, 1, 1, "door", 3, 0);
Tile654 = function () {
};
Tile654.prototype = new Door(73, 6, 9, "door", 2, 1);
Tile655 = function () {
};
Tile655.prototype = new Door(72, 6, 2, "door", 3, 1);
Tile656 = function () {
};
Tile656.prototype = new Door(74, 6, 9, "enemylocked", 2, 0);
Tile657 = function () {
};
Tile657.prototype = new Door(73, 6, 2, "door", 3, 1);
Tile658 = function () {
};
Tile658.prototype = new Door(1, 1, 1, "blastdoor", 2, 0);
Tile698 = function () {
};
Tile698.prototype = new Door(69, 2, 19, "blastdoor", 4, 1);
Tile699 = function () {
};
Tile699.prototype = new Door(1, 1, 1, "door", 1, 1);
Tile200 = function () {
};
Tile200.prototype = new Furniture(1, 3, 1);
Tile201 = function () {
};
Tile201.prototype = new Furniture(1, 3, 1);
Tile203 = function () {
};
Tile203.prototype = new Furniture(2, 8, 1);
Tile204 = function () {
};
Tile204.prototype = new Furniture(3, 8, 1);
Tile205 = function () {
};
Tile205.prototype = new Furniture(4, 0, 1);
Tile206 = function () {
};
Tile206.prototype = new Furniture(5, 0, 1);
Tile207 = function () {
};
Tile207.prototype = new Furniture(7, 0, 1);
Tile208 = function () {
};
Tile208.prototype = new Furniture(6, 0, 1);
Tile209 = function () {
};
Tile209.prototype = new Furniture(8, 0, 1);
Tile210 = function () {
};
Tile210.prototype = new Furniture(9, 0, 1);
Tile211 = function () {
};
Tile211.prototype = new Furniture(10, 0, 1);
Tile212 = function () {
};
Tile212.prototype = new Furniture(11, 0, 1);
Tile213 = function () {
};
Tile213.prototype = new Furniture(12, 0, 1);
Tile214 = function () {
};
Tile214.prototype = new Furniture(13, 0, 0);
Tile215 = function () {
};
Tile215.prototype = new Furniture(14, 0, 1);
Tile216 = function () {
};
Tile216.prototype = new Furniture(15, 15, 1);
Tile401 = function () {
};
Tile401.prototype = new Sentry(1, 0, 30, 1, 14);
Tile402 = function () {
};
Tile402.prototype = new Sentry(2, 0, 25, 1, 14);
Tile403 = function () {
};
Tile403.prototype = new Sentry(3, 0, 25, 1, 14);
Tile404 = function () {
};
Tile404.prototype = new Sentry(4, 0, 20, 1, 14);
Tile405 = function () {
};
Tile405.prototype = new Sentry(5, 0, 15, 1, 14);
Tile406 = function () {
};
Tile406.prototype = new Scientist(1);
Tile407 = function () {
};
Tile407.prototype = new Scientist(2);
Tile408 = function () {
};
Tile408.prototype = new Scientist(3);
Tile409 = function () {
};
Tile409.prototype = new Scientist(4);
Tile410 = function () {
};
Tile410.prototype = new Scientist(5);
Tile411 = function () {
};
Tile411.prototype = new Guard(1);
Tile412 = function () {
};
Tile412.prototype = new Guard(2);
Tile413 = function () {
};
Tile413.prototype = new Guard(3);
Tile414 = function () {
};
Tile414.prototype = new Guard(4);
Tile415 = function () {
};
Tile415.prototype = new Guard(5);
Tile416 = function () {
};
Tile416.prototype = new Soldier(1, 0);
Tile417 = function () {
};
Tile417.prototype = new Soldier(2, 0);
Tile418 = function () {
};
Tile418.prototype = new Soldier(3, 0);
Tile419 = function () {
};
Tile419.prototype = new Soldier(4, 0);
Tile420 = function () {
};
Tile420.prototype = new Soldier(5, 0);
Tile421 = function () {
};
Tile421.prototype = new Doctor();
Tile430 = function () {
};
Tile430.prototype = new Soldier(1, 1);
Tile431 = function () {
};
Tile431.prototype = new Soldier(2, 1);
Tile432 = function () {
};
Tile432.prototype = new Soldier(3, 1);
Tile433 = function () {
};
Tile433.prototype = new Soldier(4, 1);
Tile434 = function () {
};
Tile434.prototype = new Soldier(5, 1);
Tile450 = function () {
};
Tile450.prototype = new Sentry(6, 270, 8, 0, 24);
Tile451 = function () {
};
Tile451.prototype = new Sentry(6, 90, 8, 0, 24);
Tile452 = function () {
};
Tile452.prototype = new Sentry(6, 270, 40, 0, 30);
Tile453 = function () {
};
Tile453.prototype = new Sentry(6, 180, 10, 0, 19);
Tile454 = function () {
};
Tile454.prototype = new Sentry(6, 360, 10, 0, 19);
Tile455 = function () {
};
Tile455.prototype = new Sentry(6, 180, 40, 0, 12);
Tile456 = function () {
};
Tile456.prototype = new Sentry(7, 270, 8, 0, 10);
Tile457 = function () {
};
Tile457.prototype = new Sentry(6, 270, 8, 0, 10);
Tile500 = function () {
};
Tile500.prototype = new Weapon("shield generator", 1);
Tile501 = function () {
};
Tile501.prototype = new Weapon("60khz energy weapon", 2);
Tile502 = function () {
};
Tile502.prototype = new Weapon("anti-gravity", 3);
Tile503 = function () {
};
Tile503.prototype = new Weapon("bio-processor", 4);
Tile504 = function () {
};
Tile504.prototype = new Weapon("gearing system", 5);
Tile505 = function () {
};
Tile505.prototype = new Weapon("120khz energy weapon", 6);
Tile506 = function () {
};
Tile506.prototype = new Weapon("inter-spectral vision", 7);
Tile507 = function () {
};
Tile507.prototype = new Weapon("advanced shield generator", 8);
Tile508 = function () {
};
Tile508.prototype = new Weapon("speed boost", 9);
Tile509 = function () {
};
Tile509.prototype = new Weapon("alien gun", 10);
sentryObj = function (obj, z, x) {
var _local1 = this;
var _local2 = obj;
_local1.nameID = "sentry";
_local1.bounds = {width:16, height:16, offsetX:14, offsetZ:8};
_local1.hitbounds = {width:16, height:16, offsetX:14, offsetZ:8};
_local1.xtile = x;
_local1.ztile = z;
_local1.x = ((x * game.tileW) + _local1.bounds.width) + _local1.bounds.offsetX;
_local1.z = ((z * game.tileH) - _local1.bounds.height) + _local1.bounds.offsetZ;
_local1.wmc = _local2.mc;
_local1.mc = _local2.mc.tile_mc;
_local1.renderID = game.renderManager.addObj(_local1);
_local1.enemyID = game.enemyManager.addEnemy(_local1);
_local1.obj = _local2;
_local1.fireangle = _local2.fireangle;
_local1.firerate = _local2.firerate;
_local1.oFirerate = _local2.firerate;
_local1.firernd = _local2.firernd;
_local1.speed = _local2.speed;
_local1.power = _local2.power;
_local1.range = _local2.range;
_local1.health = _local2.health;
_local1.basehealth = _local1.health;
_local1.timer = 0;
_local1.rest = _local2.rest;
_local1.ACTIVATE = 0;
_local1.ACTIVE = 1;
_local1.IDLE = 2;
_local1.DEACTIVATE = 3;
_local1.KILL = 4;
_local1.LOWER = 5;
_local1.action = _local1.IDLE;
};
sentryObj.prototype.getzDepth = function () {
var _local1 = this;
var _local2 = game.getZDepth(_local1.xtile, _local1.ztile);
return((_local2 + _local1.zBase) + _local1.zIndex);
};
sentryObj.prototype.fire = function () {
var _local1 = this;
var depth = game.enemyManager.getEnemyBDepth();
if (depth != null) {
var dx = (_local1.x + _local1.bounds.width);
var _local3 = _local1.z + _local1.bounds.height;
var _local2 = _local1.fireangle;
if (_local2 == 0) {
_local2 = _timeline.findAngle(dx, _local3, Dalek.x + Dalek.bounds.offsetX, Dalek.z);
}
new enemybulletObj(dx, _local3, _local2, _local1.speed, _local1.power, depth);
}
};
sentryObj.prototype.update = function () {
var _local1 = this;
if (Dalek.action == 1) {
switch (_local1.action) {
case _local1.ACTIVATE :
if (_local1.mc._currentframe == 14) {
_local1.action = _local1.ACTIVE;
}
return;
case _local1.ACTIVE :
if (_local1.firernd == 1) {
if (random(_local1.firerate) == 1) {
_local1.fire();
}
} else {
_local1.firerate--;
if (_local1.firerate == 0) {
_local1.fire();
_local1.firerate = _local1.oFirerate;
}
}
var _local3 = Dalek.ztile - _local1.ztile;
var _local2 = Dalek.xtile - _local1.xtile;
if (_local1.isInRange(_local3, _local2) == false) {
_local1.action = _local1.DEACTIVATE;
}
return;
case _local1.KILL :
return;
case _local1.DEACTIVATE :
_local1.health = _local1.baseHealth;
_local1.mc.gotoAndPlay("popin");
_local1.action = _local1.LOWER;
return;
case _local1.LOWER :
if (_local1.mc._currentframe == 1) {
_local1.obj.walkable = true;
_local1.action = _local1.IDLE;
}
return;
case _local1.IDLE :
if (_local1.timer > 0) {
_local1.timer--;
}
if (_local1.timer == 0) {
_local3 = Dalek.ztile - _local1.ztile;
_local2 = Dalek.xtile - _local1.xtile;
if (_local1.stoodOn(_local3, _local2) == false) {
if (_local1.isMidRange(_local3, _local2)) {
_local1.mc.gotoAndPlay("popout");
_local1.obj.walkable = false;
_local1.action = _local1.ACTIVATE;
}
}
}
return;
}
}
};
sentryObj.prototype.stoodOn = function (dx, dy) {
if ((dx == 0) && (dy == 0)) {
return(true);
}
return(false);
};
sentryObj.prototype.isMidRange = function (dx, dy) {
var _local1 = (dx * dx) + (dy * dy);
if ((_local1 < this.range) && (_local1 > 2)) {
return(true);
}
return(false);
};
sentryObj.prototype.isInRange = function (dx, dy) {
var _local1 = (dx * dx) + (dy * dy);
if (_local1 < this.range) {
return(true);
}
return(false);
};
sentryObj.prototype.damage = function (dmg) {
var _local1 = this;
if (_local1.action == _local1.ACTIVE) {
soundcontrol("electric");
_local1.health = _local1.health - dmg;
_local1.mc.hit_mc.gotoAndPlay("in");
if (_local1.health <= 0) {
_local1.timer = _local1.rest;
_local1.action = _local1.DEACTIVATE;
}
}
};
sentryObj.prototype.destroy = function () {
var _local1 = this;
game.renderManager.removeObj(_local1);
game.enemyManager.removeEnemy(_local1);
removeMovieClip(_local1.wmc);
delete _local1.wmc;
};
enemyGuardObj = function (z, x, guardtype, health, speed, range, bpower, bspeed, cloak) {
var _local1 = this;
var _local2 = guardtype;
_local1.nameID = _local2;
game.enemyManager.guardsInRoom++;
_local1.halftile = game.tileW * 0.5;
_local1.xtile = x;
_local1.ztile = z;
_local1.x = x * game.tileW;
_local1.z = z * game.tileH;
_local1.oldx = _local1.x;
_local1.oldz = _local1.z;
_local1.depth = game.enemyManager.getEnemyDepth();
_local1.zIndex = _local1.depth;
_local1.zBase = 31;
_local1.mc = game.createObjectIn(game.zsort, _local2, _local2 + (_local1.depth + random(999)), 1000, 1000, _local1.depth);
_local1.mc._visible = 0;
_local1.renderID = game.renderManager.addObj(_local1);
_local1.enemyID = game.enemyManager.addEnemy(_local1);
_local1.bounds = {width:24, height:24, offsetX:(_local1.mc.offset_mc._width * 0.5) - 5, offsetZ:0};
_local1.hitbounds = {width:24, height:24, offsetX:(_local1.mc.offset_mc._width * 0.5) - 4, offsetZ:0};
_local1.hwidth = _local1.bounds.width * 0.5;
_local1.hheight = _local1.bounds.height * 0.5;
_local1.cbounds = {width:hwidth, height:hheight, offsetX:_local1.mc.offset_mc._width * 0.5, offsetZ:0};
_local1.health = health;
_local1.vx = 0;
_local1.vz = 0;
_local1.mx = 0;
_local1.mz = 0;
_local1.tx = _local1.mc.sortorigin_mc._width * 0.5;
_local1.tz = _local1.mc.sortorigin_mc._height * 0.5;
_local1.currentDirection = 0;
_local1.speed = speed;
_local1.fAngle = 0;
_local1.fSpeed = bspeed;
_local1.fPower = bpower;
_local1.fBase = 0;
_local1.fRange = 30;
_local1.fTiming = 1;
_local1.rangeactive = 170000 /* 0x029810 */;
_local1.rangeseek = 30000;
_local1.rangeoutseek = 50000;
_local1.s = {x:0, z:0};
_local1.e = {x:0, z:0};
_local1.closedPath = [];
_local1.openPath = [];
_local1.cp = -1;
_local1.pathFound = false;
_local1.pathEvery = 3;
_local1.pathCheck = 0;
_local1.pathIndex = 0;
_local1.lastTile = 0;
_local1.safeTimer = 0;
_local1.safeMax = 40;
_local1.killFlag = 0;
_local1.IDLE = 1;
_local1.INTOPAUSE = 2;
_local1.PAUSE = 3;
_local1.INTOPLOD = 4;
_local1.PLOD = 5;
_local1.INTOALIGN = 6;
_local1.ALIGN = 7;
_local1.INTOSEEK = 8;
_local1.SEEK = 9;
_local1.INTOSETTLE = 10;
_local1.SETTLE = 11;
_local1.action = _local1.PAUSE;
_local1.cloakEnable = cloak;
if (_local1.cloakEnable) {
_local1.cloakOn = 1;
} else {
_local1.cloakOn = 0;
}
_local1.cloakSwitch = 1;
_local1.cloakTimer = 5;
_local1.dalekTile = 0;
_local1.bTime = getTimer();
_local1.rndTime = Math.ceil(Math.random() * 1000);
_local1.getDirectionalVector();
_local1.renderToScreen();
};
enemyGuardObj.prototype.getzDepth = function () {
var _local1 = this;
var _local2 = game.getZDepth(_local1.xtile, _local1.ztile);
return((_local2 + _local1.zBase) + _local1.zIndex);
};
enemyGuardObj.prototype.fire = function () {
var _local1 = this;
var _local2 = game.enemyManager.getEnemyBDepth();
if (_local2 != null) {
if (_local1.nameID == "guard") {
soundcontrol("pistol");
} else {
soundcontrol("mgun");
}
new enemybulletObj(_local1.x + _local1.bounds.offsetX, _local1.z, _local1.fAngle, _local1.fSpeed, _local1.fPower, _local2);
}
};
enemyGuardObj.prototype.facePlayer = function () {
var _local1 = this;
var _local2 = _timeline.findAngle(_local1.x + _local1.bounds.offsetX, _local1.z, Dalek.x + Dalek.bounds.offsetX, Dalek.z);
var _local3 = 1;
_local1.fAngle = 0;
if ((_local2 >= 45) && (_local2 < 135)) {
_local3 = 2;
_local1.fAngle = 90;
} else if ((_local2 >= 135) && (_local2 < 225)) {
_local3 = 3;
_local1.fAngle = 180;
} else if ((_local2 >= 225) && (_local2 < 315)) {
_local3 = 4;
_local1.fAngle = 270;
}
_local1.mc.gotoAndStop(_local3);
};
enemyGuardObj.prototype.getPredictedVelocity = function (z, x) {
var _local2 = this;
var _local1 = {};
_local1.x = _local2.x + _local2.vx;
_local1.z = _local2.z + _local2.vz;
return(_local1);
};
enemyGuardObj.prototype.distanceToPlayer = function () {
var _local2 = this.x - Dalek.x;
var _local1 = this.z - Dalek.z;
return((_local2 * _local2) + (_local1 * _local1));
};
enemyGuardObj.prototype.damage = function (dmg) {
var _local1 = this;
if (_local1.killFlag == 0) {
if ((_local1.action != _local1.PAUSE) || (_local1.action != _local1.IDLE)) {
_local1.health = _local1.health - dmg;
_timeline.setTint(_local1.mc, 100, 230, 100, 150, 100, 230);
_local1.mc.hit_mc.gotoAndPlay("in");
soundcontrol("damage");
if (_local1.health <= 0) {
soundcontrol("enemydeath");
setAccuracy(1, 0);
_local1.mc.obj = _local1;
_timeline.clearTint(_local1.mc);
_local1.action = _local1.IDLE;
_local1.mc.hit_mc.gotoAndPlay("die");
_local1.killFlag = 1;
}
}
}
};
enemyGuardObj.prototype.getRndDir = function () {
var _local3 = this;
var _local2;
var _local1 = 0;
while (_local1 < 4) {
_local2 = Math.floor(Math.random() * 4);
if (_local3.canMove(_local2)) {
return(_local2);
}
_local1++;
}
return(null);
};
enemyGuardObj.prototype.getDirectionalVector = function (forcedDirection) {
var _local1 = this;
if (forcedDirection == null) {
_local1.currentDirection = _local1.getRndDir();
_local1.mc.gotoAndStop(_local1.currentDirection + 1);
} else {
_local1.currentDirection = forcedDirection;
}
switch (_local1.currentDirection) {
case 0 :
_local1.vz = -1;
_local1.vx = 0;
_local1.fAngle = 360;
break;
case 1 :
_local1.vz = 0;
_local1.vx = 1;
_local1.fAngle = 90;
break;
case 2 :
_local1.vz = 1;
_local1.vx = 0;
_local1.fAngle = 180;
break;
case 3 :
_local1.vz = 0;
_local1.vx = -1;
_local1.fAngle = 270;
break;
default :
_local1.vz = 0;
_local1.vx = 0;
}
_local1.mc.gotoAndStop(_local1.currentDirection + 1);
_local1.vz = _local1.vz * _local1.speed;
_local1.vx = _local1.vx * _local1.speed;
};
enemyGuardObj.prototype.canMove = function (dir) {
var _local1 = this;
var _local2 = dir;
if (_local2 == _local1.currentDirection) {
return(false);
}
if (_local2 == 0) {
if (game.mapdata[_local1.ztile - 1][_local1.xtile].walkable == 0) {
return(false);
}
} else if (_local2 == 1) {
if (game.mapdata[_local1.ztile][_local1.xtile + 1].walkable == 0) {
return(false);
}
} else if (_local2 == 2) {
if (game.mapdata[_local1.ztile + 1][_local1.xtile].walkable == 0) {
return(false);
}
} else if (_local2 == 3) {
if (game.mapdata[_local1.ztile][_local1.xtile - 1].walkable == 0) {
return(false);
}
}
return(true);
};
enemyGuardObj.prototype.changeDirectionInterval = function () {
var _local1 = this;
if ((getTimer() - _local1.bTime) >= (1000 + _local1.rndTime)) {
if (_local1.inCentreTile()) {
_local1.rndTime = Math.ceil(Math.random() * 1000);
_local1.bTime = getTimer();
_local1.getDirectionalVector();
}
}
};
enemyGuardObj.prototype.checkCollisions = function () {
var _local1 = this;
_local1.getMyCorners();
if (_local1.vz < 0) {
if (_local1.upleft && (_local1.upright)) {
_local1.z = _local1.z + _local1.vz;
} else {
_local1.z = _local1.ztile * game.tileW;
_local1.getDirectionalVector();
}
}
if (_local1.vz > 0) {
if (_local1.downleft && (_local1.downright)) {
_local1.z = _local1.z + _local1.vz;
} else {
_local1.z = ((_local1.ztile + 1) * game.tileW) - _local1.bounds.height;
_local1.getDirectionalVector();
}
}
if (_local1.vx < 0) {
if (_local1.downleft && (_local1.upleft)) {
_local1.x = _local1.x + _local1.vx;
} else {
_local1.x = _local1.xtile * game.tileW;
_local1.getDirectionalVector();
}
}
if (_local1.vx > 0) {
if (_local1.upright && (_local1.downright)) {
_local1.x = _local1.x + _local1.vx;
} else {
_local1.x = ((_local1.xtile + 1) * game.tileW) - _local1.bounds.width;
_local1.getDirectionalVector();
}
}
};
enemyGuardObj.prototype.getMyCorners = function () {
var _local1 = this;
var _local2 = _local1.getPredictedVelocity();
var downZ = Math.floor(((_local2.z + _local1.bounds.height) - 1) / game.tileH);
var _local3 = Math.floor(_local2.z / game.tileH);
var leftX = Math.floor(_local2.x / game.tileW);
var rightX = Math.floor(((_local2.x + _local1.bounds.width) - 1) / game.tileW);
_local1.upleft = game.mapdata[_local3][leftX].walkable;
_local1.downleft = game.mapdata[downZ][leftX].walkable;
_local1.upright = game.mapdata[_local3][rightX].walkable;
_local1.downright = game.mapdata[downZ][rightX].walkable;
};
enemyGuardObj.prototype.collideEnemies = function () {
};
enemyGuardObj.prototype.collidePlayer = function () {
var _local1 = this;
if (game.enemyManager.rectCollision(_local1, _local1.bounds, Dalek, Dalek.hitbounds)) {
_local1.x = _local1.oldx;
_local1.z = _local1.oldz;
if (_local1.action == _local1.PLOD) {
_local1.getDirectionalVector();
}
if (_local1.action == _local1.SEEK) {
_local1.action = _local1.INTOSETTLE;
}
if (_local1.action == _local1.ALIGN) {
_local1.action = _local1.INTOSETTLE;
}
}
};
enemyGuardObj.prototype.cueAlign = function () {
var _local1 = this;
_local1.xtile = Math.round(_local1.x / game.tileW);
_local1.ztile = Math.round(_local1.z / game.tileH);
_local1.mx = _local1.xtile * game.tileW;
_local1.mz = _local1.ztile * game.tileH;
};
enemyGuardObj.prototype.getTileCoords = function () {
var _local1 = this;
_local1.xtile = Math.round(_local1.x / game.tileW);
_local1.ztile = Math.round(_local1.z / game.tileH);
};
enemyGuardObj.prototype.getTileID = function () {
return((this.ztile + "_") + this.xtile);
};
enemyGuardObj.prototype.getDalekID = function () {
return((Dalek.ztile + "_") + Dalek.xtile);
};
enemyGuardObj.prototype.inCentreTile = function () {
var _local2 = 0.5;
var _local1 = game.tileW;
var rX = (this.x % _local1);
var _local3 = this.z % _local1;
if ((rX / _local1) < _local2) {
return(true);
}
if ((_local3 / _local1) < _local2) {
return(true);
}
return(false);
};
enemyGuardObj.prototype.changeTargetTile = function (pIndex) {
var _local1 = this;
_local1.pathIndex = pIndex;
var x = _local1.closedPath[_local1.pathIndex][1];
var _local3 = _local1.closedPath[_local1.pathIndex][2];
_local1.mx = x * game.tileW;
_local1.mz = _local3 * game.tileH;
_local1.getTileCoords();
var _local2 = 3;
if (_local3 > _local1.ztile) {
_local2 = 2;
} else if (x > _local1.xtile) {
_local2 = 1;
} else if (_local3 < _local1.ztile) {
_local2 = 0;
}
_local1.getDirectionalVector(_local2);
};
enemyGuardObj.prototype.nextNode = function () {
var _local1 = this;
_local1.pathIndex++;
if (_local1.pathIndex < _local1.closedPath.length) {
_local1.changeTargetTile(_local1.pathIndex);
}
};
enemyGuardObj.prototype.checklistNode = function () {
var _local1 = this;
if (_local1.pathFound == false) {
_local1.getDirectionalVector();
_local1.mc.enemy_mc.gotoAndPlay(1);
_local1.safeTimer = _local1.safeMax;
_local1.action = _local1.INTOPLOD;
}
if (_local1.closedPath.length <= 0) {
_local1.action = _local1.INTOSETTLE;
} else if (_local1.pathIndex >= _local1.closedPath.length) {
_local1.action = _local1.INTOSETTLE;
}
};
enemyGuardObj.prototype.moveToCoord = function () {
var _local1 = this;
if (_local1.vz < 0) {
if (_local1.mz <= (_local1.z + _local1.vz)) {
_local1.z = _local1.z + _local1.vz;
} else {
_local1.z = _local1.mz;
}
} else if (_local1.vz > 0) {
if (_local1.mz >= (_local1.z + _local1.vz)) {
_local1.z = _local1.z + _local1.vz;
} else {
_local1.z = _local1.mz;
}
} else if (_local1.vx > 0) {
if (_local1.mx >= (_local1.x + _local1.vx)) {
_local1.x = _local1.x + _local1.vx;
} else {
_local1.x = _local1.mx;
}
} else if (_local1.vx < 0) {
if (_local1.mx <= (_local1.x + _local1.vx)) {
_local1.x = _local1.x + _local1.vx;
} else {
_local1.x = _local1.mx;
}
}
if ((_local1.mx == _local1.x) && (_local1.mz == _local1.z)) {
var _local2 = _local1.getTileID();
if (_local2 != _local1.lastTile) {
_local1.lastTile = _local2;
_local1.checklistNode();
_local1.nextNode();
}
}
};
enemyGuardObj.prototype.centreOnTile = function () {
var _local1 = this;
if ((_local1.mx == _local1.x) && (_local1.mz == _local1.z)) {
_local1.action = _local1.INTOSEEK;
}
var _local3 = _local1.mx - _local1.x;
var _local2 = _local1.mz - _local1.z;
if (_local3 > 0) {
_local1.vx = _local1.speed;
if (_local1.mx >= (_local1.x + _local1.vx)) {
_local1.x = _local1.x + _local1.vx;
} else {
_local1.x = _local1.mx;
}
}
if (_local3 < 0) {
_local1.vx = -_local1.speed;
if (_local1.mx <= (_local1.x + _local1.vx)) {
_local1.x = _local1.x + _local1.vx;
} else {
_local1.x = _local1.mx;
}
}
if (_local2 < 0) {
_local1.vz = -_local1.speed;
if (_local1.mz <= (_local1.z + _local1.vz)) {
_local1.z = _local1.z + _local1.vz;
} else {
_local1.z = _local1.mz;
}
}
if (_local2 > 0) {
_local1.vz = _local1.speed;
if (_local1.mz >= (_local1.z + _local1.vz)) {
_local1.z = _local1.z + _local1.vz;
} else {
_local1.z = _local1.mz;
}
}
};
enemyGuardObj.prototype.pathStart = function () {
var _local1 = this;
_local1.s = {x:_local1.xtile, z:_local1.ztile};
_local1.e = {x:Dalek.xtile, z:Dalek.ztile};
_local1.closedPath = [];
_local1.openPath = [];
_local1.cp = -1;
_local1.pathFound = false;
_local1.cuePath(_local1.s.z, _local1.s.x);
};
enemyGuardObj.prototype.cuePath = function (cz, cx) {
var _local1 = this;
var _local2 = cz;
var _local3 = cx;
_local1.maxPaths = 0;
_local1.lastCost = 100000 /* 0x0186A0 */;
_local1.s.x = _local3;
_local1.s.z = _local2;
_local1.maxPaths++;
_local1.addPath(_local2 + 1, _local3);
_local1.maxPaths++;
_local1.addPath(_local2 - 1, _local3);
_local1.maxPaths++;
_local1.addPath(_local2, _local3 + 1);
_local1.maxPaths++;
_local1.addPath(_local2, _local3 - 1);
};
enemyGuardObj.prototype.addPath = function (az, ax) {
var _local1 = this;
var _local3 = az;
var node = game.mapdata[_local3][ax];
if ((node != undefined) && (node.walkable == 1)) {
var _local2 = ax * _local3;
var g = (Math.abs(ax - _local1.s.x) + Math.abs(_local3 - _local1.s.z));
var h = (Math.abs(ax - _local1.e.x) + Math.abs(_local3 - _local1.e.z));
var f = (g + h);
if ((_local1.openPath[_local2] == null) || (f < _local1.openPath[_local2][0])) {
_local1.openPath[_local2] = [];
_local1.openPath[_local2][0] = f;
_local1.openPath[_local2][1] = ax;
_local1.openPath[_local2][2] = _local3;
if ((f <= _local1.lastCost) && ((ax * _local3) != (s.x * s.z))) {
_local1.lastCost = f;
_local1.bestPath = _local2;
}
}
}
if ((ax == _local1.e.x) && (_local3 == _local1.e.z)) {
_local1.pathFound = true;
_local1.changeTargetTile(0);
}
if (_local1.maxPaths == 4) {
_local1.finalPath();
}
};
enemyGuardObj.prototype.finalPath = function () {
var _local1 = this;
if (!_local1.pathFound) {
_local1.cp++;
var _local2 = _local1.cp;
_local1.closedPath[_local2] = [];
_local1.closedPath[_local2] = _local1.openPath[_local1.bestPath];
var _local3 = _local1.closedPath[_local2][1];
var cpZ = _local1.closedPath[_local2][2];
game.mapdata[cpZ][_local3].mc.debug_mc.gotoAndPlay("on");
if (_local1.closedPath[_local2] != _local1.closedPath[_local2 - 1]) {
_local1.cuePath(cpZ, _local3);
} else {
trace("no path");
}
}
};
enemyGuardObj.prototype.update = function () {
var _local1 = this;
if (Dalek.action == 1) {
switch (_local1.action) {
case _local1.INTOSETTLE :
_local1.getTileCoords();
_local1.dalekTile = _local1.getDalekID();
_local1.facePlayer();
_local1.mc.enemy_mc.gotoAndStop("idle");
_local1.action = _local1.SETTLE;
return;
case _local1.SETTLE :
if (_local1.fTiming > 0) {
_local1.fTiming--;
if (_local1.fTiming == 0) {
_local1.fTiming = 10 + random(20);
_local1.fire();
}
}
if (random(10) == 1) {
var _local2 = _local1.getDalekID();
if (_local2 != _local1.dalekTile) {
_local1.action = _local1.INTOALIGN;
}
}
_local1.collidePlayer();
_local1.facePlayer();
_local1.renderToScreen();
return;
case _local1.INTOALIGN :
_local1.cueAlign();
_local1.mc.enemy_mc.gotoAndPlay(1);
_local1.action = _local1.ALIGN;
return;
case _local1.ALIGN :
_local1.centreOnTile();
_local1.collidePlayer();
_local1.renderToScreen();
return;
case _local1.INTOSEEK :
_local1.getTileCoords();
_local1.pathStart();
_local1.action = _local1.SEEK;
return;
case _local1.SEEK :
if (_local1.distanceToPlayer() > _local1.rangeoutseek) {
_local1.action = _local1.INTOPLOD;
}
_local1.checklistNode();
_local1.getTileCoords();
_local1.moveToCoord();
_local1.collidePlayer();
_local1.renderToScreen();
if (random(40) == 0) {
_local1.fire();
}
return;
case _local1.INTOPLOD :
_local1.mc._visible = 1;
_local1.action = _local1.PLOD;
return;
case _local1.PLOD :
if ((_local1.vx == 0) && (_local1.vz == 0)) {
_local1.getDirectionalVector();
}
if (_local1.safeTimer > 0) {
_local1.safeTimer--;
}
if (_local1.safeTimer == 0) {
if (_local1.distanceToPlayer() <= _local1.rangeseek) {
_local1.action = _local1.INTOALIGN;
}
if (_local1.distanceToPlayer() > _local1.rangeactive) {
_local1.action = _local1.INTOPAUSE;
}
}
_local1.getTileCoords();
_local1.checkCollisions();
_local1.collidePlayer();
_local1.renderToScreen();
return;
case _local1.INTOPAUSE :
_local1.mc._visible = 0;
_local1.action = _local1.PAUSE;
return;
case _local1.PAUSE :
if (_local1.distanceToPlayer() <= _local1.rangeactive) {
_local1.action = _local1.INTOPLOD;
}
return;
case _local1.IDLE :
return;
}
}
};
enemyGuardObj.prototype.switchCloak = function (bool) {
if (this.cloakEnable) {
this.cloakOn = bool;
}
};
enemyGuardObj.prototype.sortCloak = function (bool) {
var _local1 = this;
if (_local1.cloakEnable == 1) {
if (_local1.cloakOn == 1) {
_local1.mc._alpha = 0;
}
if (_local1.cloakOn == 0) {
_local1.cloakTimer--;
if (_local1.cloakTimer == 0) {
_local1.cloakTimer = 1;
if (_local1.cloakSwitch == 1) {
_local1.mc._alpha = 100;
_local1.cloakSwitch = 0;
} else {
_local1.mc._alpha = 40;
_local1.cloakSwitch = 1;
}
}
}
}
};
enemyGuardObj.prototype.renderToScreen = function () {
var _local1 = this;
_local1.sortCloak();
_local1.mc.swapDepths(_local1.getzDepth());
_local1.oldx = _local1.x;
_local1.oldz = _local1.z;
var _local2 = game.getScreenCoords(_local1.x + _local1.hwidth, _local1.z + _local1.hheight);
_local1.mc._x = _local2.x + game.tileW;
_local1.mc._y = _local2.y;
};
enemyGuardObj.prototype.destroy = function () {
var _local1 = this;
game.renderManager.removeObj(_local1);
game.enemyManager.removeEnemy(_local1);
removeMovieClip(_local1.mc);
delete _local1.mc;
};
enemyScientistObj = function (z, x, health, speed) {
var _local1 = this;
_local1.nameID = "scientist";
game.enemyManager.guardsInRoom++;
_local1.halftile = game.tileW * 0.5;
_local1.xtile = x;
_local1.ztile = z;
_local1.x = x * game.tileW;
_local1.z = z * game.tileH;
_local1.oldx = _local1.x;
_local1.oldz = _local1.z;
_local1.depth = game.enemyManager.getEnemyDepth();
_local1.zIndex = _local1.depth;
_local1.zBase = 31;
_local1.mc = game.createObjectIn(game.zsort, "scientist", "scientist" + (_local1.depth + random(999)), 1000, 1000, _local1.depth);
_local1.mc._visible = 0;
_local1.renderID = game.renderManager.addObj(_local1);
_local1.enemyID = game.enemyManager.addEnemy(_local1);
_local1.bounds = {width:30, height:30, offsetX:_local1.mc.offset_mc._width * 0.5, offsetZ:0};
_local1.hitbounds = {width:20, height:20, offsetX:_local1.mc.offset_mc._width * 0.5, offsetZ:0};
_local1.hwidth = _local1.bounds.width * 0.5;
_local1.hheight = _local1.bounds.height * 0.5;
_local1.cbounds = {width:hwidth, height:hheight, offsetX:_local1.mc.offset_mc._width * 0.5, offsetZ:0};
_local1.health = health;
_local1.speed = speed;
_local1.vx = 0;
_local1.vz = 0;
_local1.mx = 0;
_local1.mz = 0;
_local1.tx = _local1.mc.sortorigin_mc._width * 0.5;
_local1.tz = _local1.mc.sortorigin_mc._height * 0.5;
_local1.currentDirection = 0;
_local1.rangeactive = 170000 /* 0x029810 */;
_local1.fAangle = 0;
_local1.killFlag = 0;
_local1.IDLE = 1;
_local1.PAUSE = 3;
_local1.PLOD = 5;
_local1.action = _local1.PAUSE;
_local1.bTime = getTimer();
_local1.rndTime = Math.ceil(Math.random() * 1500);
_local1.getDirectionalVector();
_local1.renderToScreen();
};
enemyScientistObj.prototype.getzDepth = function () {
var _local1 = this;
var _local2 = game.getZDepth(_local1.xtile, _local1.ztile);
return((_local2 + _local1.zBase) + _local1.zIndex);
};
enemyScientistObj.prototype.getPredictedVelocity = function (z, x) {
var _local2 = this;
var _local1 = {};
_local1.x = _local2.x + _local2.vx;
_local1.z = _local2.z + _local2.vz;
return(_local1);
};
enemyScientistObj.prototype.distanceToPlayer = function () {
var _local2 = this.x - Dalek.x;
var _local1 = this.z - Dalek.z;
return((_local2 * _local2) + (_local1 * _local1));
};
enemyScientistObj.prototype.damage = function (dmg) {
var _local1 = this;
if (_local1.killFlag == 0) {
if ((_local1.action != _local1.PAUSE) || (_local1.action != _local1.IDLE)) {
_local1.health = _local1.health - dmg;
_timeline.setTint(_local1.mc, 100, 255, 100, 150, 100, 150);
_local1.mc.hit_mc.gotoAndPlay("in");
soundcontrol("damage");
if (_local1.health <= 0) {
soundcontrol("enemydeath");
setAccuracy(1, 0);
_local1.mc.obj = _local1;
_timeline.clearTint(_local1.mc);
_local1.action = _local1.IDLE;
_local1.mc.hit_mc.gotoAndPlay("die");
_local1.killFlag = 1;
}
}
}
};
enemyScientistObj.prototype.getRndDir = function () {
var _local3 = this;
var _local2;
var _local1 = 0;
while (_local1 < 4) {
_local2 = Math.floor(Math.random() * 4);
if (_local3.canMove(_local2)) {
return(_local2);
}
_local1++;
}
return(null);
};
enemyScientistObj.prototype.getDirectionalVector = function (forcedDirection) {
var _local1 = this;
if (forcedDirection == null) {
_local1.currentDirection = _local1.getRndDir();
_local1.mc.gotoAndStop(_local1.currentDirection + 1);
} else {
_local1.currentDirection = forcedDirection;
}
switch (_local1.currentDirection) {
case 0 :
_local1.vz = -1;
_local1.vx = 0;
break;
case 1 :
_local1.vz = 0;
_local1.vx = 1;
break;
case 2 :
_local1.vz = 1;
_local1.vx = 0;
break;
case 3 :
_local1.vz = 0;
_local1.vx = -1;
break;
default :
_local1.vz = 0;
_local1.vx = 0;
}
_local1.vz = _local1.vz * _local1.speed;
_local1.vx = _local1.vx * _local1.speed;
};
enemyScientistObj.prototype.canMove = function (dir) {
var _local1 = this;
var _local2 = dir;
if (_local2 == _local1.currentDirection) {
return(false);
}
if (_local2 == 0) {
if (game.mapdata[_local1.ztile - 1][_local1.xtile].walkable == 0) {
return(false);
}
} else if (_local2 == 1) {
if (game.mapdata[_local1.ztile][_local1.xtile + 1].walkable == 0) {
return(false);
}
} else if (_local2 == 2) {
if (game.mapdata[_local1.ztile + 1][_local1.xtile].walkable == 0) {
return(false);
}
} else if (_local2 == 3) {
if (game.mapdata[_local1.ztile][_local1.xtile - 1].walkable == 0) {
return(false);
}
}
return(true);
};
enemyScientistObj.prototype.changeDirectionInterval = function () {
var _local1 = this;
if ((getTimer() - _local1.bTime) >= (1000 + _local1.rndTime)) {
if (_local1.inCentreTile()) {
_local1.rndTime = Math.ceil(Math.random() * 2000);
_local1.bTime = getTimer();
_local1.getDirectionalVector();
}
}
};
enemyScientistObj.prototype.checkCollisions = function () {
var _local1 = this;
_local1.getMyCorners();
if (_local1.vz < 0) {
if (_local1.upleft && (_local1.upright)) {
_local1.z = _local1.z + _local1.vz;
} else {
_local1.z = _local1.ztile * game.tileW;
_local1.getDirectionalVector();
}
}
if (_local1.vz > 0) {
if (_local1.downleft && (_local1.downright)) {
_local1.z = _local1.z + _local1.vz;
} else {
_local1.z = ((_local1.ztile + 1) * game.tileW) - _local1.bounds.height;
_local1.getDirectionalVector();
}
}
if (_local1.vx < 0) {
if (_local1.downleft && (_local1.upleft)) {
_local1.x = _local1.x + _local1.vx;
} else {
_local1.x = _local1.xtile * game.tileW;
_local1.getDirectionalVector();
}
}
if (_local1.vx > 0) {
if (_local1.upright && (_local1.downright)) {
_local1.x = _local1.x + _local1.vx;
} else {
_local1.x = ((_local1.xtile + 1) * game.tileW) - _local1.bounds.width;
_local1.getDirectionalVector();
}
}
};
enemyScientistObj.prototype.getMyCorners = function () {
var _local1 = this;
var _local2 = _local1.getPredictedVelocity();
var downZ = Math.floor(((_local2.z + _local1.bounds.height) - 1) / game.tileH);
var _local3 = Math.floor(_local2.z / game.tileH);
var leftX = Math.floor(_local2.x / game.tileW);
var rightX = Math.floor(((_local2.x + _local1.bounds.width) - 1) / game.tileW);
_local1.upleft = game.mapdata[_local3][leftX].walkable;
_local1.downleft = game.mapdata[downZ][leftX].walkable;
_local1.upright = game.mapdata[_local3][rightX].walkable;
_local1.downright = game.mapdata[downZ][rightX].walkable;
};
enemyScientistObj.prototype.collideEnemies = function () {
var elist = game.enemyManager.enemylist;
};
enemyScientistObj.prototype.collidePlayer = function () {
var _local1 = this;
if (game.enemyManager.rectCollision(_local1, _local1.hitbounds, Dalek, Dalek.cbounds)) {
_local1.x = _local1.oldx;
_local1.z = _local1.oldz;
_local1.getDirectionalVector();
}
};
enemyScientistObj.prototype.getTileCoords = function () {
var _local1 = this;
_local1.xtile = Math.round(_local1.x / game.tileW);
_local1.ztile = Math.round(_local1.z / game.tileH);
};
enemyScientistObj.prototype.inCentreTile = function () {
var _local2 = 0.5;
var _local1 = game.tileW;
var rX = (this.x % _local1);
var _local3 = this.z % _local1;
if ((rX / _local1) < _local2) {
return(true);
}
if ((_local3 / _local1) < _local2) {
return(true);
}
return(false);
};
enemyScientistObj.prototype.update = function () {
var _local1 = this;
if (Dalek.action == 1) {
switch (_local1.action) {
case _local1.PLOD :
if ((_local1.vx == 0) && (_local1.vz == 0)) {
_local1.getDirectionalVector();
}
if (_local1.distanceToPlayer() > _local1.rangeactive) {
_local1.mc._visible = 0;
_local1.action = _local1.PAUSE;
}
_local1.getTileCoords();
_local1.changeDirectionInterval();
_local1.checkCollisions();
_local1.collideEnemies();
_local1.collidePlayer();
_local1.renderToScreen();
return;
case _local1.PAUSE :
if (_local1.distanceToPlayer() <= _local1.rangeactive) {
_local1.mc._visible = 1;
_local1.action = _local1.PLOD;
}
return;
case _local1.IDLE :
return;
}
}
};
enemyScientistObj.prototype.renderToScreen = function () {
var _local1 = this;
_local1.mc.swapDepths(_local1.getzDepth());
_local1.oldx = _local1.x;
_local1.oldz = _local1.z;
var _local2 = game.getScreenCoords(_local1.x + _local1.hwidth, _local1.z + _local1.hheight);
_local1.mc._x = _local2.x + game.tileW;
_local1.mc._y = _local2.y;
};
enemyScientistObj.prototype.destroy = function () {
var _local1 = this;
game.renderManager.removeObj(_local1);
game.enemyManager.removeEnemy(_local1);
removeMovieClip(_local1.mc);
delete _local1.mc;
};
doctorObj = function (z, x, health, speed, range, bpower, bspeed) {
var _local1 = this;
_local1.nameID = "doctor";
game.enemyManager.guardsInRoom++;
_local1.halftile = game.tileW * 0.5;
_local1.xtile = x;
_local1.ztile = z;
_local1.x = x * game.tileW;
_local1.z = z * game.tileH;
_local1.oldx = _local1.x;
_local1.oldz = _local1.z;
_local1.depth = game.enemyManager.getEnemyDepth();
_local1.zIndex = _local1.depth;
_local1.zBase = 50;
_local1.mc = game.createObjectIn(game.zsort, "doctor", "doctor" + (_local1.depth + random(999)), 1000, 1000, _local1.depth);
_local1.mc._visible = 1;
_local1.renderID = game.renderManager.addObj(_local1);
_local1.enemyID = game.enemyManager.addEnemy(_local1);
_local1.bounds = {width:24, height:24, offsetX:(_local1.mc.offset_mc._width * 0.5) - 5, offsetZ:0};
_local1.hitbounds = {width:24, height:24, offsetX:(_local1.mc.offset_mc._width * 0.5) - 4, offsetZ:0};
_local1.hwidth = _local1.bounds.width * 0.5;
_local1.hheight = _local1.bounds.height * 0.5;
_local1.cbounds = {width:hwidth, height:hheight, offsetX:_local1.mc.offset_mc._width * 0.5, offsetZ:0};
_local1.vx = 0;
_local1.vz = 0;
_local1.mx = 0;
_local1.mz = 0;
_local1.tx = _local1.mc.sortorigin_mc._width * 0.5;
_local1.tz = _local1.mc.sortorigin_mc._height * 0.5;
_local1.currentDirection = 0;
_local1.speed = 3;
_local1.maxhealth = 100;
_local1.health = _local1.maxhealth;
_local1.fAangle = 0;
_local1.fSpeed = 9;
_local1.fPower = 20;
_local1.fBase = 0;
_local1.fRange = 30;
_local1.fTiming = 1;
_local1.rangeactive = 170000 /* 0x029810 */;
_local1.rangeseek = 50000;
_local1.rangeoutseek = 70000 /* 0x011170 */;
_local1.s = {x:0, z:0};
_local1.e = {x:0, z:0};
_local1.closedPath = [];
_local1.openPath = [];
_local1.cp = -1;
_local1.pathFound = false;
_local1.pathEvery = 3;
_local1.pathCheck = 0;
_local1.pathIndex = 0;
_local1.lastTile = 0;
_local1.safeTimer = 0;
_local1.safeMax = 40;
_local1.IDLE = 1;
_local1.INTOPAUSE = 2;
_local1.PAUSE = 3;
_local1.INTOPLOD = 4;
_local1.PLOD = 5;
_local1.INTOALIGN = 6;
_local1.ALIGN = 7;
_local1.INTOSEEK = 8;
_local1.SEEK = 9;
_local1.INTOSETTLE = 10;
_local1.SETTLE = 11;
_local1.SCRIPTDOOR = 12;
_local1.action = _local1.IDLE;
_local1.dalekTile = 0;
_local1.bTime = getTimer();
_local1.rndTime = Math.ceil(Math.random() * 1000);
_local1.getDirectionalVector();
_local1.renderToScreen();
};
doctorObj.prototype.getzDepth = function () {
var _local1 = this;
var _local2 = game.getZDepth(_local1.xtile, _local1.ztile);
return((_local2 + _local1.zBase) + _local1.zIndex);
};
doctorObj.prototype.fire = function () {
var _local1 = this;
var _local2 = game.enemyManager.getEnemyBDepth();
if (_local2 != null) {
soundcontrol("megagun");
new enemybulletObj(_local1.x + _local1.bounds.offsetX, _local1.z, _local1.fAngle, _local1.fSpeed, _local1.fPower, _local2);
}
_local2 = game.enemyManager.getEnemyBDepth();
if (_local2 != null) {
soundcontrol("megagun");
new enemybulletObj(_local1.x + _local1.bounds.offsetX, _local1.z, _local1.fAngle + 30, _local1.fSpeed, _local1.fPower, _local2);
}
_local2 = game.enemyManager.getEnemyBDepth();
if (_local2 != null) {
soundcontrol("megagun");
new enemybulletObj(_local1.x + _local1.bounds.offsetX, _local1.z, _local1.fAngle - 30, _local1.fSpeed, _local1.fPower, _local2);
}
};
doctorObj.prototype.facePlayer = function () {
var _local1 = this;
var _local2 = _timeline.findAngle(_local1.x + _local1.bounds.offsetX, _local1.z, Dalek.x + Dalek.bounds.offsetX, Dalek.z);
var _local3 = 1;
_local1.fAngle = 0;
if ((_local2 >= 45) && (_local2 < 135)) {
_local3 = 2;
_local1.fAngle = 90;
} else if ((_local2 >= 135) && (_local2 < 225)) {
_local3 = 3;
_local1.fAngle = 180;
} else if ((_local2 >= 225) && (_local2 < 315)) {
_local3 = 4;
_local1.fAngle = 270;
}
_local1.mc.gotoAndStop(_local3);
};
doctorObj.prototype.getPredictedVelocity = function (z, x) {
var _local2 = this;
var _local1 = {};
_local1.x = _local2.x + _local2.vx;
_local1.z = _local2.z + _local2.vz;
return(_local1);
};
doctorObj.prototype.distanceToPlayer = function () {
var _local2 = this.x - Dalek.x;
var _local1 = this.z - Dalek.z;
return((_local2 * _local2) + (_local1 * _local1));
};
doctorObj.prototype.damage = function (dmg) {
var _local1 = this;
if ((_local1.action != _local1.PAUSE) || (_local1.action != _local1.IDLE)) {
_local1.health = _local1.health - dmg;
_local1.mc.setTint(100, 255, 100, 150, 100, 150);
_local1.mc.hit_mc.gotoAndPlay("in");
var _local2 = _timeline.blasttime_mc.dochealth_mc;
var _local3 = Math.round((_local1.health / _local1.maxhealth) * 100);
_local2.gotoAndStop(_local3);
if (_local1.health <= 0) {
soundcontrol("enemydeath");
setAccuracy(1, 0);
_local1.mc.obj = _local1;
_local1.mc.setTint(100, 255, 100, 255, 100, 255);
game.swapTileTo(509, _local1.ztile, _local1.xtile);
_local2.gotoAndStop(1);
_local1.action = _local1.IDLE;
_local1.mc.hit_mc.gotoAndPlay("die");
}
}
};
doctorObj.prototype.faceDir = function (dir) {
var _local1 = this;
_local1.speed = 4;
_local1.scriptDir = dir;
switch (dir) {
case 1 :
_local1.getDirectionalVector(3);
_local1.mc.gotoAndStop(2);
break;
case 2 :
_local1.getDirectionalVector(0);
_local1.mc.gotoAndStop(3);
break;
case 3 :
_local1.getDirectionalVector(2);
_local1.mc.gotoAndStop(1);
break;
case 4 :
_local1.getDirectionalVector(1);
_local1.mc.gotoAndStop(4);
}
_local1.mc.enemy_mc.gotoAndStop("idle");
};
doctorObj.prototype.walkDir = function () {
var _local1 = this;
switch (_local1.scriptDir) {
case 1 :
_local1.mc.gotoAndStop(4);
break;
case 2 :
_local1.mc.gotoAndStop(1);
break;
case 3 :
_local1.mc.gotoAndStop(2);
break;
case 4 :
_local1.mc.gotoAndStop(3);
}
_local1.sdTiming = 15;
_local1.action = _local1.SCRIPTDOOR;
};
doctorObj.prototype.getRndDir = function () {
var _local2 = this;
var _local1;
do {
_local1 = Math.floor(Math.random() * 4);
} while (!_local2.canMove(_local1));
return(_local1);
};
doctorObj.prototype.getDirectionalVector = function (forcedDirection) {
var _local1 = this;
if (forcedDirection == null) {
_local1.currentDirection = _local1.getRndDir();
_local1.mc.gotoAndStop(_local1.currentDirection + 1);
} else {
_local1.currentDirection = forcedDirection;
}
switch (_local1.currentDirection) {
case 0 :
_local1.vz = -1;
_local1.vx = 0;
_local1.fAngle = 360;
break;
case 1 :
_local1.vz = 0;
_local1.vx = 1;
_local1.fAngle = 90;
break;
case 2 :
_local1.vz = 1;
_local1.vx = 0;
_local1.fAngle = 180;
break;
case 3 :
_local1.vz = 0;
_local1.vx = -1;
_local1.fAngle = 270;
}
_local1.mc.gotoAndStop(_local1.currentDirection + 1);
_local1.vz = _local1.vz * _local1.speed;
_local1.vx = _local1.vx * _local1.speed;
};
doctorObj.prototype.canMove = function (dir) {
var _local1 = this;
var _local2 = dir;
if (_local2 == _local1.currentDirection) {
return(false);
}
if (_local2 == 0) {
if (game.mapdata[_local1.ztile - 1][_local1.xtile].walkable == 0) {
return(false);
}
} else if (_local2 == 1) {
if (game.mapdata[_local1.ztile][_local1.xtile + 1].walkable == 0) {
return(false);
}
} else if (_local2 == 2) {
if (game.mapdata[_local1.ztile + 1][_local1.xtile].walkable == 0) {
return(false);
}
} else if (_local2 == 3) {
if (game.mapdata[_local1.ztile][_local1.xtile - 1].walkable == 0) {
return(false);
}
}
return(true);
};
doctorObj.prototype.changeDirectionInterval = function () {
var _local1 = this;
if ((getTimer() - _local1.bTime) >= (1000 + _local1.rndTime)) {
if (_local1.inCentreTile()) {
_local1.rndTime = Math.ceil(Math.random() * 1000);
_local1.bTime = getTimer();
_local1.getDirectionalVector();
}
}
};
doctorObj.prototype.checkCollisions = function () {
var _local1 = this;
_local1.getMyCorners();
if (_local1.vz < 0) {
if (_local1.upleft && (_local1.upright)) {
_local1.z = _local1.z + _local1.vz;
} else {
_local1.z = _local1.ztile * game.tileW;
_local1.getDirectionalVector();
}
}
if (_local1.vz > 0) {
if (_local1.downleft && (_local1.downright)) {
_local1.z = _local1.z + _local1.vz;
} else {
_local1.z = ((_local1.ztile + 1) * game.tileW) - _local1.bounds.height;
_local1.getDirectionalVector();
}
}
if (_local1.vx < 0) {
if (_local1.downleft && (_local1.upleft)) {
_local1.x = _local1.x + _local1.vx;
} else {
_local1.x = _local1.xtile * game.tileW;
_local1.getDirectionalVector();
}
}
if (_local1.vx > 0) {
if (_local1.upright && (_local1.downright)) {
_local1.x = _local1.x + _local1.vx;
} else {
_local1.x = ((_local1.xtile + 1) * game.tileW) - _local1.bounds.width;
_local1.getDirectionalVector();
}
}
};
doctorObj.prototype.getMyCorners = function () {
var _local1 = this;
var _local2 = _local1.getPredictedVelocity();
var downZ = Math.floor(((_local2.z + _local1.bounds.height) - 1) / game.tileH);
var _local3 = Math.floor(_local2.z / game.tileH);
var leftX = Math.floor(_local2.x / game.tileW);
var rightX = Math.floor(((_local2.x + _local1.bounds.width) - 1) / game.tileW);
_local1.upleft = game.mapdata[_local3][leftX].walkable;
_local1.downleft = game.mapdata[downZ][leftX].walkable;
_local1.upright = game.mapdata[_local3][rightX].walkable;
_local1.downright = game.mapdata[downZ][rightX].walkable;
};
doctorObj.prototype.collideEnemies = function () {
};
doctorObj.prototype.collidePlayer = function () {
var _local1 = this;
if (game.enemyManager.rectCollision(_local1, _local1.bounds, Dalek, Dalek.hitbounds)) {
_local1.x = _local1.oldx;
_local1.z = _local1.oldz;
if (_local1.action == _local1.PLOD) {
_local1.getDirectionalVector();
}
if (_local1.action == _local1.SEEK) {
_local1.action = _local1.INTOSETTLE;
}
if (_local1.action == _local1.ALIGN) {
_local1.action = _local1.INTOSETTLE;
}
}
};
doctorObj.prototype.cueAlign = function () {
var _local1 = this;
_local1.xtile = Math.round(_local1.x / game.tileW);
_local1.ztile = Math.round(_local1.z / game.tileH);
_local1.mx = _local1.xtile * game.tileW;
_local1.mz = _local1.ztile * game.tileH;
};
doctorObj.prototype.getTileCoords = function () {
var _local1 = this;
_local1.xtile = Math.round(_local1.x / game.tileW);
_local1.ztile = Math.round(_local1.z / game.tileH);
};
doctorObj.prototype.getTileID = function () {
return((this.ztile + "_") + this.xtile);
};
doctorObj.prototype.getDalekID = function () {
return((Dalek.ztile + "_") + Dalek.xtile);
};
doctorObj.prototype.inCentreTile = function () {
var _local2 = 0.5;
var _local1 = game.tileW;
var rX = (this.x % _local1);
var _local3 = this.z % _local1;
if ((rX / _local1) < _local2) {
return(true);
}
if ((_local3 / _local1) < _local2) {
return(true);
}
return(false);
};
doctorObj.prototype.changeTargetTile = function (pIndex) {
var _local1 = this;
_local1.pathIndex = pIndex;
var x = _local1.closedPath[_local1.pathIndex][1];
var _local3 = _local1.closedPath[_local1.pathIndex][2];
_local1.mx = x * game.tileW;
_local1.mz = _local3 * game.tileH;
_local1.getTileCoords();
var _local2 = 3;
if (_local3 > _local1.ztile) {
_local2 = 2;
} else if (x > _local1.xtile) {
_local2 = 1;
} else if (_local3 < _local1.ztile) {
_local2 = 0;
}
_local1.getDirectionalVector(_local2);
};
doctorObj.prototype.nextNode = function () {
var _local1 = this;
_local1.pathIndex++;
if (_local1.pathIndex < _local1.closedPath.length) {
_local1.changeTargetTile(_local1.pathIndex);
}
};
doctorObj.prototype.checklistNode = function () {
var _local1 = this;
if (_local1.pathFound == false) {
_local1.getDirectionalVector();
_local1.mc.enemy_mc.gotoAndPlay(1);
_local1.safeTimer = _local1.safeMax;
_local1.action = _local1.INTOPLOD;
}
if (_local1.closedPath.length <= 0) {
trace("no nodes in list");
_local1.action = _local1.INTOSETTLE;
} else if (_local1.pathIndex >= _local1.closedPath.length) {
trace("reached max in list");
_local1.action = _local1.INTOSETTLE;
}
};
doctorObj.prototype.moveToCoord = function () {
var _local1 = this;
if (_local1.vz < 0) {
if (_local1.mz <= (_local1.z + _local1.vz)) {
_local1.z = _local1.z + _local1.vz;
} else {
_local1.z = _local1.mz;
}
} else if (_local1.vz > 0) {
if (_local1.mz >= (_local1.z + _local1.vz)) {
_local1.z = _local1.z + _local1.vz;
} else {
_local1.z = _local1.mz;
}
} else if (_local1.vx > 0) {
if (_local1.mx >= (_local1.x + _local1.vx)) {
_local1.x = _local1.x + _local1.vx;
} else {
_local1.x = _local1.mx;
}
} else if (_local1.vx < 0) {
if (_local1.mx <= (_local1.x + _local1.vx)) {
_local1.x = _local1.x + _local1.vx;
} else {
_local1.x = _local1.mx;
}
}
if ((_local1.mx == _local1.x) && (_local1.mz == _local1.z)) {
var _local2 = _local1.getTileID();
if (_local2 != _local1.lastTile) {
_local1.lastTile = _local2;
_local1.checklistNode();
_local1.nextNode();
}
}
};
doctorObj.prototype.centreOnTile = function () {
var _local1 = this;
if ((_local1.mx == _local1.x) && (_local1.mz == _local1.z)) {
_local1.action = _local1.INTOSEEK;
}
var _local3 = _local1.mx - _local1.x;
var _local2 = _local1.mz - _local1.z;
if (_local3 > 0) {
_local1.vx = _local1.speed;
if (_local1.mx >= (_local1.x + _local1.vx)) {
_local1.x = _local1.x + _local1.vx;
} else {
_local1.x = _local1.mx;
}
}
if (_local3 < 0) {
_local1.vx = -_local1.speed;
if (_local1.mx <= (_local1.x + _local1.vx)) {
_local1.x = _local1.x + _local1.vx;
} else {
_local1.x = _local1.mx;
}
}
if (_local2 < 0) {
_local1.vz = -_local1.speed;
if (_local1.mz <= (_local1.z + _local1.vz)) {
_local1.z = _local1.z + _local1.vz;
} else {
_local1.z = _local1.mz;
}
}
if (_local2 > 0) {
_local1.vz = _local1.speed;
if (_local1.mz >= (_local1.z + _local1.vz)) {
_local1.z = _local1.z + _local1.vz;
} else {
_local1.z = _local1.mz;
}
}
};
doctorObj.prototype.pathStart = function () {
var _local1 = this;
_local1.s = {x:_local1.xtile, z:_local1.ztile};
_local1.e = {x:Dalek.xtile, z:Dalek.ztile};
_local1.closedPath = [];
_local1.openPath = [];
_local1.cp = -1;
_local1.pathFound = false;
_local1.cuePath(_local1.s.z, _local1.s.x);
};
doctorObj.prototype.cuePath = function (cz, cx) {
var _local1 = this;
var _local2 = cz;
var _local3 = cx;
_local1.maxPaths = 0;
_local1.lastCost = 100000 /* 0x0186A0 */;
_local1.s.x = _local3;
_local1.s.z = _local2;
_local1.maxPaths++;
_local1.addPath(_local2 + 1, _local3);
_local1.maxPaths++;
_local1.addPath(_local2 - 1, _local3);
_local1.maxPaths++;
_local1.addPath(_local2, _local3 + 1);
_local1.maxPaths++;
_local1.addPath(_local2, _local3 - 1);
};
doctorObj.prototype.addPath = function (az, ax) {
var _local1 = this;
var _local3 = az;
var node = game.mapdata[_local3][ax];
if ((node != undefined) && (node.walkable == 1)) {
var _local2 = ax * _local3;
var g = (Math.abs(ax - _local1.s.x) + Math.abs(_local3 - _local1.s.z));
var h = (Math.abs(ax - _local1.e.x) + Math.abs(_local3 - _local1.e.z));
var f = (g + h);
if ((_local1.openPath[_local2] == null) || (f < _local1.openPath[_local2][0])) {
_local1.openPath[_local2] = [];
_local1.openPath[_local2][0] = f;
_local1.openPath[_local2][1] = ax;
_local1.openPath[_local2][2] = _local3;
if ((f <= _local1.lastCost) && ((ax * _local3) != (s.x * s.z))) {
_local1.lastCost = f;
_local1.bestPath = _local2;
}
}
}
if ((ax == _local1.e.x) && (_local3 == _local1.e.z)) {
_local1.pathFound = true;
_local1.changeTargetTile(0);
}
if (_local1.maxPaths == 4) {
_local1.finalPath();
}
};
doctorObj.prototype.finalPath = function () {
var _local1 = this;
if (!_local1.pathFound) {
_local1.cp++;
var _local2 = _local1.cp;
_local1.closedPath[_local2] = [];
_local1.closedPath[_local2] = _local1.openPath[_local1.bestPath];
var _local3 = _local1.closedPath[_local2][1];
var cpZ = _local1.closedPath[_local2][2];
game.mapdata[cpZ][_local3].mc.debug_mc.gotoAndPlay("on");
if (_local1.closedPath[_local2] != _local1.closedPath[_local2 - 1]) {
_local1.cuePath(cpZ, _local3);
} else {
trace("no path");
}
}
};
doctorObj.prototype.update = function () {
var _local1 = this;
switch (_local1.action) {
case _local1.INTOSETTLE :
_local1.getTileCoords();
_local1.dalekTile = _local1.getDalekID();
_local1.facePlayer();
_local1.mc.enemy_mc.gotoAndStop("idle");
_local1.action = _local1.SETTLE;
return;
case _local1.SETTLE :
if (_local1.fTiming > 0) {
_local1.fTiming--;
if (_local1.fTiming == 0) {
_local1.fTiming = 10 + random(20);
_local1.fire();
}
}
if (random(10) == 1) {
var _local2 = _local1.getDalekID();
if (_local2 != _local1.dalekTile) {
_local1.action = _local1.INTOALIGN;
}
}
_local1.collidePlayer();
_local1.facePlayer();
_local1.renderToScreen();
return;
case _local1.INTOALIGN :
_local1.cueAlign();
_local1.mc.enemy_mc.gotoAndPlay(1);
_local1.action = _local1.ALIGN;
return;
case _local1.ALIGN :
_local1.centreOnTile();
_local1.collidePlayer();
_local1.renderToScreen();
return;
case _local1.INTOSEEK :
_local1.getTileCoords();
_local1.pathStart();
_local1.action = _local1.SEEK;
return;
case _local1.SEEK :
if (_local1.distanceToPlayer() > _local1.rangeoutseek) {
_local1.action = _local1.INTOPLOD;
}
_local1.checklistNode();
_local1.getTileCoords();
_local1.moveToCoord();
_local1.collidePlayer();
_local1.renderToScreen();
if (random(40) == 0) {
_local1.fire();
}
return;
case _local1.INTOPLOD :
_local1.mc._visible = 1;
_local1.action = _local1.PLOD;
return;
case _local1.PLOD :
if (_local1.safeTimer > 0) {
_local1.safeTimer--;
}
if (_local1.safeTimer == 0) {
if (_local1.distanceToPlayer() <= _local1.rangeseek) {
_local1.action = _local1.INTOALIGN;
}
if (_local1.distanceToPlayer() > _local1.rangeactive) {
_local1.action = _local1.INTOPAUSE;
}
}
_local1.getTileCoords();
_local1.checkCollisions();
_local1.collidePlayer();
_local1.renderToScreen();
return;
case _local1.INTOPAUSE :
_local1.mc._visible = 0;
_local1.action = _local1.PAUSE;
return;
case _local1.PAUSE :
if (_local1.distanceToPlayer() <= _local1.rangeactive) {
_local1.action = _local1.INTOPLOD;
}
return;
case _local1.SCRIPTDOOR :
_local1.sdTiming--;
if (_local1.sdTiming > 0) {
_local1.z = _local1.z + _local1.vz;
_local1.x = _local1.x + _local1.vx;
_local1.renderToScreen();
}
if (_local1.sdTiming < 0) {
_local1.mc._alpha = _local1.mc._alpha - 10;
if (_local1.mc._alpha <= 0) {
Dalek.initDoor2Player();
_local1.destroy();
}
}
return;
case _local1.IDLE :
return;
}
};
doctorObj.prototype.renderToScreen = function () {
var _local1 = this;
_local1.mc.swapDepths(_local1.getzDepth());
_local1.oldx = _local1.x;
_local1.oldz = _local1.z;
var _local2 = game.getScreenCoords(_local1.x + _local1.hwidth, _local1.z + _local1.hheight);
_local1.mc._x = _local2.x + game.tileW;
_local1.mc._y = _local2.y;
};
doctorObj.prototype.destroy = function () {
var _local1 = this;
game.renderManager.removeObj(_local1);
game.enemyManager.removeEnemy(_local1);
removeMovieClip(_local1.mc);
delete _local1.mc;
};
Frame 20
gameObj = function (tW, tH, btW, btH, viX, viZ) {
var _local1 = this;
_local1.tileW = tW;
_local1.tileH = tH;
_local1.bigtileW = btW;
_local1.bigtileH = btH;
_local1.visx = viX;
_local1.visz = viZ;
_local1.halfvisx = Math.ceil(_local1.visx * 0.5);
_local1.halfvisz = Math.ceil(_local1.visz * 0.5);
_local1.field = _timeline.container;
_local1.enemyManager = new EnemyManagerObj();
_local1.renderManager = new RenderManagerObj(_local1.field);
_local1.level = 1;
_local1.xmlmapID = 0;
_local1.enemyLocks = [];
_local1.locksOpen = false;
_local1.blastDoors = [];
_local1.blastLocks = [];
_local1.mapdata = [];
};
gameObj.prototype.getZDepth = function (x, z) {
return(((41 * z) + (42 * x)) * 100);
};
gameObj.prototype.createObjectIn = function (layer, linkID, name, x, y, depth) {
var _local2 = depth;
if (typeof(_local2) == undefined) {
_local2 = this.getZDepth(x, y);
}
var _local1 = layer.attachMovie(linkID, name, _local2, {_x:x, _y:y});
return(_local1);
};
gameObj.prototype.createPlayer = function (tilex, tilez, xmlID) {
_global.Dalek = new playerObj(tilex, tilez, xmlID);
};
gameObj.prototype.openEnemyLock = function () {
var _local3 = this;
var _local1 = _local3.enemyLocks[_local3.xmlmapID];
if (_local1.open == false) {
_local1.open = true;
var z = _local1.z;
var x = _local1.x;
var _local2 = _local3.mapdata[z][x];
if (_local3.displayTile(z, x)) {
_local2.doormc.gotoAndPlay("open");
} else {
_local2.open = 1;
}
soundcontrol("dooropen");
}
};
gameObj.prototype.checkEnemyLock = function (obj) {
var _local1 = this.enemyLocks[this.xmlmapID];
if (_local1.open == true) {
obj.open = 1;
obj.init();
}
};
gameObj.prototype.swapLock = function () {
var _local3 = this;
var _local2 = _local3.enemyLocks[_local3.xmlmapID];
var z = _local2.z;
var x = _local2.x;
var _local1 = _local3.mapdata[z][x];
_local1.open = 1;
_local1.doormc.gotoAndStop("idle");
};
gameObj.prototype.openBlastDoor = function (z, x) {
var _local1 = this;
var _local2 = _local1.mapdata[z][x];
_local2.open = 1;
if (_local2.ID == 647) {
_local1.swapTileTo(698, z, x);
} else {
var mc = _local2.doormc;
mc.gotoAndStop("open");
}
var bLockData = _local1.blastLocks[_local1.xmlmapID];
var blastName = ((x + "_") + z);
var _local3 = _local1.getBlastDoor(bLockData, blastName);
if (_local3 != null) {
_local3.open = 1;
}
};
gameObj.prototype.addBlastDoor = function (z, x) {
var _local1 = (x + "_") + z;
var _local2 = {name:_local1, z:z, x:x, open:0};
this.blastDoors.push(_local2);
};
gameObj.prototype.checkBlastDoor = function (z, x, obj) {
var _local3 = this;
var _local2 = _local3.blastLocks[_local3.xmlmapID];
var _local1 = (x + "_") + z;
var doorObj = _local3.getBlastDoor(_local2, _local1);
if (doorObj.open) {
obj.open = 1;
}
};
gameObj.prototype.getBlastDoor = function (bLockData, blastName) {
var _local3 = bLockData;
var _local1 = 0;
while (_local1 < _local3.length) {
var _local2 = _local3[_local1];
if (_local2.name == blastName) {
return(_local2);
}
_local1++;
}
return(null);
};
gameObj.prototype.parseMap = function (xmlID, startx, startz, recurse) {
this.mapdata = [];
var Config = {};
Config.array = [];
Config.shapes = [];
Config.locks = [];
Config.blast = [];
Config.scandata = [];
Config.decals = [];
Config.timer = [];
Config.doctor = [];
Config.introtext = [];
var xmlConfig = new XML();
xmlConfig.ignoreWhite = true;
xmlConfig.objRef = this;
xmlConfig.onLoad = function (success) {
trace("Recurse" + recurse);
if (success != 1) {
recurse++;
if (recurse < 30) {
this.objRef.parseMap(xmlID, startx, startz, recurse);
return;
}
_timeline.gotoAndPlay("options");
} else {
trace("Fulllload" + recurse);
var root = this.firstChild.childNodes;
var items = root.length;
var _local2 = 0;
while (_local2 < items) {
var varname = root[_local2].nodeName;
var _local3 = root[_local2].childNodes[0].nodeValue;
var _local1 = _local3.split(",");
switch (varname) {
case "shape" :
Config.shapes.push(_local1);
break;
case "info" :
Config.scandata.push(_local1);
break;
case "lock" :
Config.locks.push(_local1);
break;
case "blast" :
Config.blast.push(_local1);
break;
case "decal" :
Config.decals.push(_local1);
break;
case "timer" :
Config.timer.push(_local1);
break;
case "doctor" :
Config.doctor.push(_local1);
break;
case "introtext" :
Config.introtext.push(_local1);
break;
default :
Config.array.push(_local1);
}
_local2++;
}
this.objRef.buildMap(Config, startx, startz);
delete Config;
delete this;
}
};
this.xmlmapID = xmlID;
var XMLmapdata = (("maps/map" + this.xmlmapID) + ".xml");
xmlConfig.load(XMLmapdata);
var tmc = _timeline.transition;
var i = 0;
var loadtimer = setInterval(function () {
var _local1 = Math.ceil((xmlConfig.getBytesLoaded() / xmlConfig.getBytesTotal()) * 100);
if (String(_local1) == "NaN") {
_local1 = 0;
}
if (i == 0) {
i++;
if (_local1 == 100) {
tmc.loading_mc.percent = "100 %";
tmc.gotoAndPlay("out");
tmc.loading_mc._alpha = 0;
clearInterval(loadtimer);
} else {
tmc.loading_mc._alpha = 100;
}
}
if (_local1 == 100) {
tmc.loading_mc.percent = "100 %";
tmc.gotoAndPlay("out");
tmc.loading_mc._alpha = 0;
clearInterval(loadtimer);
}
}, 31);
};
gameObj.prototype.buildMap = function (map, startx, startz) {
var _local1 = this;
var _local2 = map;
var mapWidth = _local2.array[0].length;
var _local3 = _local2.array.length;
_local1.locksOpen = false;
_local1.initLayers(_local2.shapes);
_local1.initDecals(_local2.decals);
_local1.enemyManager = new EnemyManagerObj();
_local1.renderManager = new RenderManagerObj(_local1.field);
_local1.initCamera(startx, startz);
((_global.Dalek == undefined) ? (_local1.createPlayer(startx, startz, _local1.xmlmapID)) : (Dalek.reStart(startx, startz)));
var docScript = _local1.initTimer(_local2.timer);
_local1.initDoctor(_local2.doctor);
_local1.storeMap(mapWidth, _local3, _local2.array);
if (docScript) {
Dalek.startDoorTimer();
}
_local1.initBlast(_local2.blast);
_local1.initELocks(_local2.locks);
_local1.initScanText(_local2.scandata, _local3);
_local1.enemyManager.init();
_local1.initIntroText(_local2.introtext);
};
gameObj.prototype.storeMap = function (mapW, mapH, mapAr) {
var _local2 = 0;
while (_local2 < mapH) {
var rowArray = [];
var _local1 = 0;
while (_local1 < mapW) {
var _local3 = mapAr[_local2][_local1];
var tileobj = this.sortTiles(_local3, _local2, _local1);
rowArray.push(tileobj);
_local1++;
}
this.mapdata.push(rowArray);
_local2++;
}
};
gameObj.prototype.initELocks = function (eLockdata) {
var _local1 = this;
var _local2 = eLockdata;
if (_local2.length > 0) {
var x = Number(_local2[0][0]);
var z = Number(_local2[0][1]);
var _local3 = {x:x, z:z, open:false};
var lockObj = _local1.enemyLocks[_local1.xmlmapID];
if (typeof(lockObj) != "object") {
_local1.enemyLocks[_local1.xmlmapID] = _local3;
} else if (_local1.enemyLocks[_local1.xmlmapID].open == true) {
_local1.locksOpen = true;
_local1.swapLock();
}
} else {
_local1.locksOpen = null;
}
};
gameObj.prototype.initBlast = function (blastdoors) {
if (blastdoors.length > 0) {
this.blastDoors = [];
var bLockData = this.blastLocks[this.xmlmapID];
if (bLockData == null) {
var _local1 = 0;
while (_local1 < blastdoors.length) {
var _local2 = blastdoors[_local1];
var x = Number(_local2[0]);
var _local3 = Number(_local2[1]);
this.addBlastDoor(_local3, x);
_local1++;
}
this.blastLocks[this.xmlmapID] = this.blastDoors;
}
}
};
gameObj.prototype.initLayers = function (bigtiles) {
var _local1 = this;
_local1.bg = _local1.field.createEmptyMovieClip("bg", 1);
_local1.decal = _local1.field.createEmptyMovieClip("decal", 2);
_local1.nozsort = _local1.field.createEmptyMovieClip("noz", 3);
_local1.debug = _local1.field.createEmptyMovieClip("debug", 4);
_local1.zsort = _local1.field.createEmptyMovieClip("zsort", 5);
var floorset = 1;
if ((_global._gamelevel >= 5) && (_global._gamelevel <= 9)) {
floorset = 2;
} else if (_global._gamelevel == 10) {
floorset = 3;
}
var _local2 = 0;
while (_local2 < bigtiles.length) {
var _local3 = bigtiles[_local2];
var x = Number(_local3[1]);
var z = Number(_local3[0]);
var pos = _local1.getScreenCoords(x * _local1.bigtileW, z * _local1.bigtileH);
var depth = _local1.getZDepth(x, z);
var shapemc = _local1.createObjectIn(_local1.bg, "floor" + floorset, "squarebase" + _local2, pos.x + _local1.tileW, pos.y + _local1.tileH, depth);
shapemc.gotoAndStop(Number(_local3[2]));
_local2++;
}
};
gameObj.prototype.initDecals = function (decals) {
var _local1 = this;
var _local2 = 0;
while (_local2 < decals.length) {
var _local3 = decals[_local2];
var z = _local3[1];
var x = _local3[0];
var pos = _local1.getScreenCoords(x * _local1.tileW, z * _local1.tileH);
var depth = _local1.getZDepth(x, z);
var decalmc = _local1.createObjectIn(_local1.decal, "decal", "decal" + _local2, pos.x, pos.y, depth);
decalmc.gotoAndStop(_local3[2]);
_local2++;
}
};
gameObj.prototype.initScanText = function (sdata, mapH) {
var _local2 = sdata;
_global._maptext = [];
if (_local2.length > 0) {
var j = 0;
while (j < mapH) {
_maptext[j] = new Array();
j++;
}
var _local1 = 0;
while (_local1 < _local2.length) {
var z = Number(_local2[_local1][1]);
var x = Number(_local2[_local1][0]);
var _local3 = String(_local2[_local1][2]);
if (_local3 == "0") {
_local3 = null;
}
var picturedata = String(_local2[_local1][3]);
if (picturedata == "0") {
picturedata = null;
}
var txtobj = {text:_local3, picture:picturedata};
this.mapdata[z][x].scaninfo = "yes";
_maptext[z][x] = txtobj;
_local1++;
}
return(1);
}
return(undefined);
};
gameObj.prototype.initTimer = function (timerdata) {
var _local1 = timerdata;
if (_local1.length > 0) {
var _local3 = Number(_local1[0][1]);
var x = Number(_local1[0][0]);
var _local2 = Number(_local1[0][2]);
var txt = String(_local1[0][3]);
_timeline.blasttime_mc.gotoAndStop("start");
Dalek.initDoorTimer(x, _local3, _local2, txt);
return(1);
}
_timeline.blasttime_mc.gotoAndStop("pause");
return(0);
};
gameObj.prototype.initDoctor = function (docdata) {
var _local1 = docdata;
if (_local1.length > 0) {
var _local2 = Number(_local1[0][1]);
var x = Number(_local1[0][0]);
var _local3 = String(_local1[0][2]);
Dalek.initDocFight(x, _local2, _local3);
}
};
gameObj.prototype.initIntroText = function (introdata) {
if (introdata.length > 0) {
var _local1 = String(introdata[0][0]);
Dalek.displayScanDialog(_local1);
}
};
gameObj.prototype.displayTile = function (z, x) {
var _local1 = this;
if ((z >= (_local1.camera.ztile - _local1.halfvisz)) && (z <= (_local1.camera.ztile + _local1.halfvisz))) {
if ((x >= (_local1.camera.xtile - _local1.halfvisx)) && (x <= (_local1.camera.xtile + _local1.halfvisx))) {
return(true);
}
return(false);
}
return(false);
};
gameObj.prototype.createTile = function (id, z, x) {
var _local1 = this.sortTiles(id, z, x);
this.mapdata[z][x] = _local1;
};
gameObj.prototype.deleteTile = function (z, x) {
var _local1 = this.mapdata[z][x];
if (_local1.sentry != undefined) {
_local1.sentry.destroy();
} else if (_local1.type == "enemylocked") {
var _local2 = _local1.mc.tile_mc.door_mc.slide_mc._currentframe;
_local1.mc.removeMovieClip();
if ((_local2 > 1) && (_local2 != 20)) {
this.swapLock();
}
} else if (_local1.mc != undefined) {
_local1.mc.removeMovieClip();
}
};
gameObj.prototype.swapTileTo = function (tileid, z, x) {
this.deleteTile(z, x);
this.createTile(tileid, z, x);
};
gameObj.prototype.createTileIn = function (zsort, obj, z, x) {
var _local1 = obj;
var _local2 = this;
var name = ((("T_" + z) + "_") + x);
var xpos = (x * _local2.tileW);
var ypos = (z * _local2.tileH);
var screenpos = _local2.getScreenCoords(xpos, ypos);
var _local3 = "";
((zsort == true) ? (_local3 = "zsort") : (_local3 = "nozsort"));
var depth = _local2.getZDepth(x, z);
if (_local1.type == "door") {
_local1.x = xpos;
_local1.z = ypos;
if (_local1.frame >= 3) {
depth = depth + 80;
}
}
var mc = _local2.createObjectIn(_local2[_local3], "tile", name, screenpos.x, screenpos.y, depth);
_local1.mc = mc;
_local1.init();
};
gameObj.prototype.sortTiles = function (id, z, x) {
var _local2 = id;
var _local3 = z;
var _local1 = new eval (["Tile" + _local2])();
_local1.ID = Number(_local2);
if (_local2 == 0) {
return(_local1);
}
if (_local2 == 1) {
return(_local1);
}
if ((_local2 >= 300) && (_local2 <= 399)) {
return(_local1);
}
if ((_local2 >= 406) && (_local2 <= 449)) {
if (this.enemyManager.enemiesReady == false) {
switch (_local1.type) {
case "scientist" :
new enemyScientistObj(_local3, x, _local1.health, _local1.speed);
break;
case "guard" :
new enemyGuardObj(_local3, x, _local1.type, _local1.health, _local1.speed, _local1.range, _local1.bpower, _local1.bspeed, 0);
break;
case "soldier" :
new enemyGuardObj(_local3, x, _local1.type, _local1.health, _local1.speed, _local1.range, _local1.bpower, _local1.bspeed, 0);
break;
case "cloaked" :
new enemyGuardObj(_local3, x, "soldier", _local1.health, _local1.speed, _local1.range, _local1.bpower, _local1.bspeed, 1);
break;
case "doctor" :
}
}
_local1 = new eval (["Tile1"])();
_local1.ID = 1;
return(_local1);
}
if (_local2 > 0) {
if (this.displayTile(_local3, x) == true) {
if (_local1.type == "weapon") {
var wps = Dalek.weapons;
var w = _local1.weaponID;
if (wps[w].collected == true) {
_local1 = new eval (["Tile1"])();
_local1.ID = 1;
return(_local1);
}
}
this.createTileIn(_local1.zsort, _local1, _local3, x);
if ((_local1.type == "door") && (_local1.doortype == "blastdoor")) {
this.checkBlastDoor(_local3, x, _local1);
_local1.init();
}
if ((_local1.type == "door") && (_local1.doortype == "enemylocked")) {
this.checkEnemyLock(_local1);
_local1.init();
}
if (_local1.type == "sentry") {
_local1.sentry = new sentryObj(_local1, _local3, x);
}
if ((_local2 == 5) && (Dalek.weapons[7].active == true)) {
var frame = (1 + random(25));
_local1.mc.tile_mc.gotoAndPlay("in");
_local1.mc.tile_mc.mine_mc.gotoAndPlay(frame);
}
}
return(_local1);
}
return(undefined);
};
gameObj.prototype.blitRow = function (dir) {
var _local3 = this;
var zIn = (Dalek.ztile - (dir * game.halfvisz));
var zOut = ((Dalek.ztile + (dir * game.halfvisz)) + (dir * 1));
var xstart = (Dalek.xtile - _local3.halfvisx);
var xend = ((Dalek.xtile + _local3.halfvisx) + 1);
var _local1 = xstart;
while (_local1 < xend) {
var _local2 = _local3.mapdata[zIn][_local1].ID;
if (_local2 >= 0) {
_local3.createTile(_local2, zIn, _local1);
}
_local3.deleteTile(zOut, _local1);
_local1++;
}
};
gameObj.prototype.blitColumn = function (dir) {
var _local3 = this;
var xIn = (Dalek.xtile + (dir * game.halfvisx));
var xOut = ((Dalek.xtile - (dir * game.halfvisx)) + (dir * -1));
var zstart = (Dalek.ztile - _local3.halfvisz);
var zend = ((Dalek.ztile + _local3.halfvisz) + 1);
var _local1 = zstart;
while (_local1 < zend) {
var _local2 = _local3.mapdata[_local1][xIn].ID;
if (_local2 >= 0) {
_local3.createTile(_local2, _local1, xIn);
}
_local3.deleteTile(_local1, xOut);
_local1++;
}
};
gameObj.prototype.blitMissing = function () {
var _local2 = this;
var z = (Dalek.ztile - _local2.halfvisz);
while (z <= (Dalek.ztile + _local2.halfvisz)) {
var _local1 = Dalek.xtile - _local2.halfvisx;
while (_local1 <= (Dalek.xtile + _local2.halfvisx)) {
var obj = _local2.mapdata[z][_local1];
var _local3 = obj.ID;
if (_local3 >= 0) {
if (String(obj.mc) == "") {
_local2.createTile(_local3, z, _local1);
}
}
_local1++;
}
z++;
}
};
gameObj.prototype.initCamera = function (xtile, ztile) {
var _local1 = this;
_local1.camera = {damping:12};
_local1.camera.xtile = (_local1.camera.oldxtile = xtile);
_local1.camera.ztile = (_local1.camera.oldztile = ztile);
_local1.camera.x = xtile * _local1.tileW;
_local1.camera.z = ztile * _local1.tileH;
_local1.camera.hScreenwidth = 250 - _local1.tileW;
_local1.camera.hScreenheight = 150;
};
gameObj.prototype.updateCamera = function (x, z) {
var _local1 = this;
_local1.camera.xtile = Math.round(x / _local1.tileW);
_local1.camera.ztile = Math.round(z / _local1.tileH);
var _local3 = _local1.camera.xtile - _local1.camera.oldxtile;
var zDiff = (_local1.camera.oldztile - _local1.camera.ztile);
if (_local3 != 0) {
game.blitColumn(_local3);
}
if (zDiff != 0) {
game.blitRow(zDiff);
}
_local1.camera.oldxtile = _local1.camera.xtile;
_local1.camera.oldztile = _local1.camera.ztile;
var _local2 = _local1.getScreenCoords(x, z);
_local1.zsort.localToGlobal(_local2);
var dx = (_local2.x - _local1.camera.hScreenwidth);
var dy = ((_local2.y - _local1.camera.hScreenheight) - 30);
_local1.field._x = _local1.field._x - (dx / _local1.camera.damping);
_local1.field._y = _local1.field._y - (dy / _local1.camera.damping);
};
gameObj.prototype.moveCameraTo = function (x, z) {
var _local1 = this;
var _local2 = _local1.camera.damping;
_local1.camera.damping = 1;
_local1.updateCamera(x, z);
_local1.camera.damping = _local2;
};
gameObj.prototype.getScreenCoords = function (x, z) {
var _local1 = {};
var _local3 = x - z;
var _local2 = (x + z) * 0.5;
_local1.x = _local3;
_local1.y = _local2;
return(_local1);
};
gameObj.prototype.getGameCoords = function (xiso, yiso) {
var _local1 = {};
var _local2 = (0.5 * xiso) + yiso;
var _local3 = _local2 - xiso;
_local1.x = _local2;
_local1.z = _local3;
return(_local1);
};
gameObj.prototype.destroy = function () {
var _local1 = this;
delete _local1.enemyManager;
delete _local1.renderManager;
game.renderManager.removeObj(_local1);
_local1.field.removeMovieClip();
delete _local1.field;
};
function newGameCookie() {
var _local2 = _global;
popup_mc._visible = 0;
wipeSaved();
controls_mc._visible = 1;
var _local1 = savedGame.data.value;
_local2._gamelevel = Number(_local1.param1);
_local2._totalDeaths = Number(_local1.param2);
_local2._totalTime = Number(_local1.param3);
_local2._secondPlay = Number(_local1.param4);
_local2._aHit = Number(_local1.param5);
_local2._aMiss = Number(_local1.param6);
_local2._accuracy = Number(_local1.param7);
controls_mc.gotoAndPlay("newgame");
}
_global._gamelevel = 1;
_global._timeline = _level0;
_global._totalDeaths = 0;
_global._startTime = 0;
_global._totalTime = 0;
_global._accuracy = 0;
_global._aHit = 0;
_global._aMiss = 0;
_global._tilesetArray = [];
_global._startflag = 0;
_global._secondPlay = 0;
_global.setAccuracy = function (hit, miss) {
_global._aHit = _global._aHit + hit;
};
popup_mc._visible = 0;
var gameoption = "newgame";
if (saveExists() == true) {
var sharedObj = savedGame.data.value;
var secondplay = Number(sharedObj.param4);
_global._gamelevel = Number(sharedObj.param1);
_global._totalDeaths = Number(sharedObj.param2);
_global._totalTime = Number(sharedObj.param3);
_global._secondPlay = Number(sharedObj.param4);
_global._aHit = Number(sharedObj.param5);
_global._aMiss = Number(sharedObj.param6);
_global._accuracy = Number(sharedObj.param7);
if (secondplay == 1) {
if (_gamelevel == 1) {
gameoption = "secondplay";
} else {
gameoption = "secondplayload";
}
} else {
gameoption = "loadgame";
}
outputSaveVars();
}
trace(gameoption);
controls_mc.gotoAndPlay(gameoption);
stop();
Frame 26
function getpercent(mc) {
return((mc.getBytesLoaded() / mc.getBytesTotal()) * 100);
}
function continuegame(mc) {
loadgame_mc._visible = 0;
restoring_mc._visible = 0;
start_mc._visible = 1;
}
function startgame(mc) {
clearInterval(backstory_mc.timing);
gotoAndStop ("tilesetload");
}
if (getpercent(this) == 100) {
continuegame();
}
this.onEnterFrame = function () {
var _local1 = this;
if (getpercent(_local1) == 100) {
delete _local1.onEnterFrame;
continuegame();
}
loadgame_mc.ploaded = ((_local1.getBytesLoaded() + " / ") + _local1.getBytesTotal()) + " KB";
var _local2 = loadgame_mc.ploaded_txt.textWidth;
loadgame_mc.ploaded_txt._x = 65 - _local2;
};
stop();
Instance of Symbol 25 MovieClip "backstory_mc" in Frame 26
onClipEvent (load) {
_alpha = 0;
var page = 2;
var endpage = _totalframes;
var fade = 0;
var mc = this;
mc.gotoAndStop(2);
mc.tween("_alpha", 100, 1.5, 4);
_level0.cpage = page - 1;
_level0.mpage = "/" add (endpage - 1);
timing = setInterval(function () {
if (fade == 1) {
page++;
if (page > endpage) {
page = 2;
}
_timeline.cpage = page - 1;
mc.gotoAndStop(page);
mc.tween("_alpha", 100, 1.5, 4);
} else if (fade == 0) {
mc.tween("_alpha", 0, 1.5, 4);
} else if (fade == 2) {
fade = -1;
}
fade++;
}, 3500);
}
Frame 33
_quality = "high";
var glev = _global._gamelevel;
lvl = glev;
leveldesc_mc.gotoAndStop(glev);
play();
Instance of Symbol 645 MovieClip in Frame 33
onClipEvent (load) {
oy = _y;
h = Math.ceil(_height / 3);
point = h + oy;
}
onClipEvent (enterFrame) {
this._y = this._y + 2;
if (this._y >= 35) {
this._y = -195;
}
}
Frame 34
function initsets(lvl) {
tSet = _tilesetArray[lvl - 1];
tSetItems = tSet.length;
i = 0;
loadsets(i);
}
function loadsets(index) {
var _local1 = tSet[index];
loadtilemovie(_local1);
}
function nextset(id) {
i++;
if (i >= tSetItems) {
loadOK = 1;
startme();
} else {
loadsets(i);
}
}
function loadtilemovie(swf) {
var mc = import_mc.createEmptyMovieClip("container", 1);
mc._visible = 0;
mc.loadMovie(("tilesets/" + swf) + ".swf");
_level0.loadtileset_mc.loadtype = "INITIALIZING " add swf.toUpperCase();
timing = setInterval(function () {
var p = Math.ceil((mc.getBytesLoaded() / mc.getBytesTotal()) * 100);
var _local1 = _level0.loadtileset_mc;
var _local2 = ((mc.getBytesLoaded() + " / ") + mc.getBytesTotal()) + " KB";
if (((mc.getBytesTotal() == null) || (mc.getBytesTotal() == undefined)) || (mc.getBytesTotal() == -1)) {
_local2 = "";
}
_local1.ploaded = _local2;
var _local3 = _local1.ploaded_txt.textWidth;
_local1.ploaded_txt._x = 65 - _local3;
if (p == 100) {
clearInterval(timing);
ref.nextset();
}
}, 15);
}
function startme() {
if ((pTimeOK == 1) && (loadOk == 1)) {
transition_mc.gotoAndStop("fadeout");
}
}
function gotoTileFrame() {
gotoAndPlay("level" + _gamelevel);
}
_global._tilesetArray = [];
_tilesetArray.push(["bg_01", "tileset1", "furniture1", "enemy_scientist", "floorset1"]);
_tilesetArray.push(["bg_02", "tileset1", "furniture1", "enemy_scientist", "floorset1"]);
_tilesetArray.push(["bg_03", "tileset1", "furniture1", "enemy_scientist", "floorset1"]);
_tilesetArray.push(["bg_04", "tileset1", "decal2", "decal4", "furniture1", "furniture2", "enemy_scientist", "enemy_guard", "floorset2"]);
_tilesetArray.push(["bg_05", "tileset1", "decal4", "furniture1", "furniture2", "enemy_scientist", "enemy_guard", "enemy_soldier", "floorset2"]);
_tilesetArray.push(["bg_06", "tileset1", "decal4", "furniture1", "furniture2", "enemy_soldier", "floorset2"]);
_tilesetArray.push(["bg_07", "tileset1", "decal4", "furniture1", "furniture2", "enemy_guard", "enemy_soldier", "floorset2"]);
_tilesetArray.push(["bg_04", "tileset1", "decal3", "decal4", "furniture1", "furniture2", "enemy_soldier", "floorset2"]);
_tilesetArray.push(["bg_09", "tileset1", "decal4", "furniture1", "furniture2", "enemy_scientist", "enemy_soldier", "enemy_doctor", "floorset2"]);
_tilesetArray.push(["bg_10", "tileset1", "decal5", "furniture3"]);
var pTime = 0;
var pTimeOK = 0;
var loadOK = 0;
var ref = this;
initsets(_global._gamelevel);
ptiming = setInterval(function () {
clearInterval(ptiming);
pTimeOK = 1;
ref.startme();
}, 3000);
stop();
Frame 39
function startLevel(lvl) {
_global.game = new gameObj(44.5, 44.5, 444, 444, 14, 14);
var _local1 = startArray[lvl].map;
var _local3 = startArray[lvl].x;
var _local2 = startArray[lvl].z;
game.parsemap(_local1, _local3, _local2, 0);
playbgsound();
_global._startTime = getTimer();
}
function restartCallback() {
if (game.enemyManager.guardsInRoom >= 2) {
soundcontrol("dalekexterminate");
}
if (Dalek.weapons[7].active == true) {
Dalek.cloakDisplay(0);
}
if (_global._startflag == 0) {
_global._startflag = 1;
game.moveCameraTo(Dalek.x, Dalek.z);
Dalek.reSet();
trace("dalek reset");
}
}
function restartLevel() {
var _local1 = _global;
stopbgsound();
_local1._startflag = 0;
_local1._totalDeaths++;
_local1._timeline.gotoAndPlay("tilesetload");
}
function loadLevel(lvl) {
var _local1 = _global;
stopbgsound();
_local1._startflag = 0;
var _local2 = getTimer() - _local1._startTime;
_local1._totalTime = _local1._totalTime + _local2;
_local1._startTime = _local1._totalTime;
_local1._gamelevel = lvl;
setFlashCookie();
_local1._timeline.gotoAndPlay("tilesetload");
}
function setFlashCookie() {
trace("-------------------");
trace(_gamelevel);
trace(_totalTime);
trace(_totalDeaths);
trace(_secondPlay);
trace(_aHit);
trace(_aMiss);
trace(_accuracy);
trace("-------------------");
saveGame(_gamelevel, _totalDeaths, _totalTime, _secondPlay, _aHit, _aMiss, _accuracy);
}
_quality = "low";
_global.soundcontrol = function (frame) {
sound_mc.gotoAndPlay(frame);
};
bgsoundObj = new Sound(bgm_mc);
loadbgsound = function (soundID) {
var _local1 = this;
var ref = _local1;
var vol = 0;
var volmax = 75;
var spd = 1;
bgsoundObj.setVolume(0);
bgm_mc.onEnterFrame = function () {
vol = vol + spd;
ref.bgsoundObj.setVolume(vol);
if (vol > volmax) {
ref.bgsoundObj.setVolume(volmax);
delete this.onEnterFrame;
}
};
bgsoundObj.attachSound(soundID);
bgsoundObj.start();
bgsoundObj.onSoundComplete = function () {
this.start();
};
};
stopbgsound = function (soundID) {
bgsoundObj.stop();
};
playbgsound = function (soundID) {
stopbgsound();
bgsoundObj = new Sound(bgm_mc);
if (_gamelevel == 10) {
loadbgsound("bg_10");
} else if (_gamelevel == 8) {
loadbgsound("bg_04");
} else {
loadbgsound("bg_0" + _gamelevel);
}
};
startArray = [];
startArray.push("");
startArray.push({map:1, x:7, z:7, weapons:[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dir:2});
startArray.push({map:7, x:9, z:5, weapons:[0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], dir:2});
startArray.push({map:14, x:9, z:4, weapons:[0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0], dir:1});
startArray.push({map:21, x:5, z:9, weapons:[0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0], dir:2});
startArray.push({map:32, x:9, z:3, weapons:[0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], dir:2});
startArray.push({map:39, x:9, z:4, weapons:[0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0], dir:2});
startArray.push({map:47, x:9, z:6, weapons:[0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0], dir:2});
startArray.push({map:55, x:5, z:9, weapons:[0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], dir:2});
startArray.push({map:62, x:9, z:5, weapons:[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], dir:0});
startArray.push({map:72, x:6, z:9, weapons:[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], dir:2});
startLevel(_global._gamelevel);
stop();
Frame 46
_quality = "high";
_global.Dalek.destroy();
_global.game.destroy();
Mouse.show();
whitetransition_mc.gotoAndPlay("out");
var timediff = (getTimer() - _global._startTime);
var finalTime = ((_global._totalTime = _global._totalTime + timediff));
var secs = (finalTime / 1000);
var mins = Math.round(secs / 60);
var rmins = (mins % 60);
if (rmins < 10) {
rmins = "0" + rmins;
}
var hours = Math.floor(mins / 60);
var realTime = ((hours + "'") + rmins);
r_time = realTime;
r_restarts = _global._totalDeaths;
r_rank = "";
if (finalTime > 3600000) {
r_rank = "D";
} else if ((finalTime > 2400000) && (finalTime <= 3600000)) {
r_rank = "C";
} else if ((finalTime > 1800000) && (finalTime <= 1800000)) {
r_rank = "B";
} else if ((finalTime > 1200000) && (finalTime <= 1800000)) {
r_rank = "A";
} else if (finalTime < 1200000) {
r_rank = "S";
}
if (_aHit < 40) {
r_rank = "E";
}
if (((finalTime < 1200000) && (r_restarts == 0)) && (_aHit > 40)) {
r_rank = "SS";
}
result_mc.gotoAndStop(r_rank);
saveGame(1, 0, 0, 1, 0, 0, 0);
stop();
Frame 54
if (_gamelevel == 1) {
gotoAndPlay ("game");
} else {
play();
}
Frame 55
if (_gamelevel == 2) {
gotoAndPlay ("game");
} else {
play();
}
Frame 56
if (_gamelevel == 3) {
gotoAndPlay ("game");
} else {
play();
}
Frame 57
if (_gamelevel == 4) {
gotoAndPlay ("game");
} else {
play();
}
Frame 58
if (_gamelevel == 5) {
gotoAndPlay ("game");
} else {
play();
}
Frame 59
if (_gamelevel == 6) {
gotoAndPlay ("game");
} else {
play();
}
Frame 60
if (_gamelevel == 7) {
gotoAndPlay ("game");
} else {
play();
}
Frame 61
if (_gamelevel == 8) {
gotoAndPlay ("game");
} else {
play();
}
Frame 62
if (_gamelevel == 9) {
gotoAndPlay ("game");
} else {
play();
}
Frame 63
if (_gamelevel == 10) {
gotoAndPlay ("game");
} else {
play();
}
Symbol 1 MovieClip [decal] Frame 1
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 2
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 3
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 4
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 5
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 6
var mc = this.attachMovie("decal2", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 7
var mc = this.attachMovie("decal2", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 8
var mc = this.attachMovie("decal2", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 9
var mc = this.attachMovie("decal2", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 10
var mc = this.attachMovie("decal3", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 11
var mc = this.attachMovie("decal3", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 12
var mc = this.attachMovie("decal3", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 13
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 14
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 15
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 16
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 17
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 18
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 19
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 20
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 21
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 22
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 23
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 24
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 25
var mc = this.attachMovie("decal4", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 26
var mc = this.attachMovie("decal4", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 27
var mc = this.attachMovie("decal4", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 28
var mc = this.attachMovie("decal4", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 29
var mc = this.attachMovie("decal4", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
trace(mc + " arrow");
stop();
Symbol 1 MovieClip [decal] Frame 30
var mc = this.attachMovie("decal4", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
trace(mc + " arrow");
stop();
Symbol 1 MovieClip [decal] Frame 31
var mc = this.attachMovie("decal4", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
trace(mc + " arrow");
stop();
Symbol 1 MovieClip [decal] Frame 32
var mc = this.attachMovie("decal4", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
trace(mc + " arrow");
stop();
Symbol 1 MovieClip [decal] Frame 33
var mc = this.attachMovie("decal4", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 34
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 35
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 36
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 37
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 38
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 39
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 40
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 41
var mc = this.attachMovie("tileset1", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 1 MovieClip [decal] Frame 42
var mc = this.attachMovie("decal5", "decal_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 25 MovieClip Frame 1
stop();
Symbol 25 MovieClip Frame 2
stop();
Symbol 27 MovieClip Frame 1
stop();
Symbol 27 MovieClip Frame 2
play();
Symbol 27 MovieClip Frame 35
gotoAndPlay ("in");
Symbol 29 Button
on (press) {
_parent.gotoAndStop("coreload");
}
on (rollOver, dragOver) {
newgame_mc.gotoAndPlay("in");
}
on (rollOut, dragOut) {
newgame_mc.gotoAndStop("out");
}
Symbol 31 MovieClip Frame 1
stop();
Symbol 31 MovieClip Frame 2
play();
Symbol 31 MovieClip Frame 35
gotoAndPlay ("in");
Symbol 32 Button
on (press) {
_parent.popup_mc._visible = 1;
this._visible = 0;
}
on (rollOver, dragOver) {
newgame_mc.gotoAndPlay("in");
}
on (rollOut, dragOut) {
newgame_mc.gotoAndStop("out");
}
Symbol 33 Button
on (press) {
_parent.gotoAndStop("coreload");
}
on (rollOver, dragOver) {
continue_mc.gotoAndPlay("in");
}
on (rollOut, dragOut) {
continue_mc.gotoAndStop("out");
}
Symbol 35 MovieClip Frame 1
stop();
Symbol 35 MovieClip Frame 2
play();
Symbol 35 MovieClip Frame 35
gotoAndPlay ("in");
Symbol 36 Button
on (press) {
_parent.gotoAndStop("coreload");
}
on (rollOver, dragOver) {
splay_mc.gotoAndPlay("in");
}
on (rollOut, dragOut) {
splay_mc.gotoAndStop("out");
}
Symbol 38 MovieClip Frame 1
stop();
Symbol 38 MovieClip Frame 2
play();
Symbol 38 MovieClip Frame 35
gotoAndPlay ("in");
Symbol 39 Button
on (press) {
_parent.gotoAndStop("coreload");
}
on (rollOver, dragOver) {
splaycont_mc.gotoAndPlay("in");
}
on (rollOut, dragOut) {
splaycont_mc.gotoAndStop("out");
}
Symbol 40 MovieClip Frame 1
stop();
Symbol 40 MovieClip Frame 10
stop();
Symbol 40 MovieClip Frame 18
stop();
Symbol 45 Button
on (press) {
_visible = 0;
_parent.controls_mc._visible = 1;
}
Symbol 49 Button
on (press) {
_parent.newGameCookie();
}
Symbol 64 MovieClip Frame 1
_visible = 0;
this.onPress = function () {
_parent.startgame();
};
Symbol 71 MovieClip [bullet] Frame 1
sortorigin_mc._visible = 0;
play();
Symbol 71 MovieClip [bullet] Frame 4
stop();
Symbol 71 MovieClip [bullet] Frame 5
play();
Symbol 71 MovieClip [bullet] Frame 10
this.objRef.destroy();
stop();
Symbol 76 MovieClip [enemybullet] Frame 1
sortorigin_mc._visible = 0;
play();
Symbol 76 MovieClip [enemybullet] Frame 4
stop();
Symbol 76 MovieClip [enemybullet] Frame 5
play();
Symbol 76 MovieClip [enemybullet] Frame 10
this.objRef.destroy();
stop();
Symbol 84 MovieClip [megabullet] Frame 1
sortorigin_mc._visible = 0;
play();
Symbol 84 MovieClip [megabullet] Frame 4
stop();
Symbol 84 MovieClip [megabullet] Frame 5
play();
Symbol 84 MovieClip [megabullet] Frame 10
this.objRef.destroy();
stop();
Symbol 89 MovieClip [bullet2] Frame 1
sortorigin_mc._visible = 0;
play();
Symbol 89 MovieClip [bullet2] Frame 4
stop();
Symbol 89 MovieClip [bullet2] Frame 5
play();
Symbol 89 MovieClip [bullet2] Frame 10
this.objRef.destroy();
stop();
Symbol 121 MovieClip [explosion] Frame 18
stop();
Symbol 124 MovieClip [blastexplosion] Frame 18
stop();
Symbol 128 MovieClip Frame 1
stop();
Symbol 133 MovieClip Frame 1
stop();
Symbol 133 MovieClip Frame 2
hover_sound.gotoAndPlay("play");
play();
Symbol 133 MovieClip Frame 29
gotoAndPlay ("loop");
Symbol 206 MovieClip Frame 1
stop();
Symbol 279 MovieClip Frame 1
stop();
Symbol 352 MovieClip Frame 1
stop();
Symbol 425 MovieClip Frame 1
stop();
Symbol 426 MovieClip Frame 1
fire_mc._visible = 0;
punch_mc._visible = 0;
stop();
Symbol 499 MovieClip Frame 1
stop();
Symbol 500 MovieClip Frame 1
stop();
Symbol 500 MovieClip Frame 2
play();
Symbol 500 MovieClip Frame 4
_timeline.clearTint(this._parent);
Symbol 500 MovieClip Frame 8
gotoAndStop (1);
Symbol 500 MovieClip Frame 9
play();
Symbol 500 MovieClip Frame 10
_timeline.setTint(this._parent, 100, 150, 100, 150, 100, 255);
Symbol 500 MovieClip Frame 13
_timeline.clearTint(this._parent);
Symbol 500 MovieClip Frame 16
gotoAndPlay ("die");
Symbol 501 MovieClip [dalek] Frame 1
offset_mc._visible = 0;
stop();
Symbol 513 MovieClip Frame 1
play();
Symbol 514 MovieClip Frame 1
stop();
Symbol 514 MovieClip Frame 2
play();
Symbol 514 MovieClip Frame 18
stop();
Symbol 524 MovieClip Frame 1
stop();
Symbol 531 MovieClip Frame 1
stop();
Symbol 535 MovieClip Frame 1
stop();
Symbol 540 MovieClip Frame 1
stop();
Symbol 540 MovieClip Frame 2
play();
Symbol 540 MovieClip Frame 9
_parent._parent._parent.obj.slideCallback();
stop();
Symbol 540 MovieClip Frame 10
stop();
Symbol 542 Button
on (press) {
var obj = _parent._parent.obj;
if (obj.open == 0) {
Dalek.isAccessingDoor(true, obj);
}
}
on (rollOver) {
Dalek.gunBlock = true;
Dalek.isAccessingDoor("hover");
}
on (release) {
if (_parent._parent.obj.open == 0) {
Dalek.isAccessingDoor("onup");
}
}
on (rollOut, dragOut) {
Dalek.isAccessingDoor(false);
Dalek.gunBlock = false;
}
Symbol 548 MovieClip Frame 1
stop();
Symbol 549 MovieClip Frame 1
stop();
Symbol 560 MovieClip Frame 1
stop();
Symbol 560 MovieClip Frame 2
play();
Symbol 560 MovieClip Frame 8
_parent._parent._parent.obj.slideCallback();
Symbol 560 MovieClip Frame 9
stop();
Symbol 571 MovieClip Frame 1
stop();
Symbol 571 MovieClip Frame 2
play();
Symbol 571 MovieClip Frame 8
_parent._parent._parent.obj.slideCallback();
Symbol 571 MovieClip Frame 9
stop();
Symbol 572 MovieClip Frame 1
stop();
Symbol 576 MovieClip Frame 1
stop();
Symbol 576 MovieClip Frame 2
stop();
Symbol 579 MovieClip Frame 1
stop();
Symbol 579 MovieClip Frame 2
stop();
Symbol 580 MovieClip Frame 1
stop();
Symbol 583 MovieClip Frame 1
stop();
Symbol 584 MovieClip Frame 1
stop();
Symbol 585 MovieClip Frame 1
var mc = this.attachMovie("furniture1", "furniture_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
stop();
Symbol 585 MovieClip Frame 2
var mc = this.attachMovie("furniture1", "furniture_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 585 MovieClip Frame 3
var mc = this.attachMovie("furniture1", "furniture_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 585 MovieClip Frame 4
var mc = this.attachMovie("furniture1", "furniture_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 585 MovieClip Frame 5
var mc = this.attachMovie("furniture1", "furniture_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 585 MovieClip Frame 6
var mc = this.attachMovie("furniture1", "furniture_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 585 MovieClip Frame 7
var mc = this.attachMovie("furniture1", "furniture_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 585 MovieClip Frame 8
var mc = this.attachMovie("furniture1", "furniture_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 585 MovieClip Frame 9
var mc = this.attachMovie("furniture1", "furniture_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 585 MovieClip Frame 10
var mc = this.attachMovie("furniture2", "furniture_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 585 MovieClip Frame 11
var mc = this.attachMovie("furniture2", "furniture_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 585 MovieClip Frame 12
var mc = this.attachMovie("furniture2", "furniture_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 585 MovieClip Frame 13
var mc = this.attachMovie("furniture2", "furniture_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 585 MovieClip Frame 14
var mc = this.attachMovie("furniture3", "furniture_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 585 MovieClip Frame 15
var mc = this.attachMovie("furniture3", "furniture_mc", 1);
mc.gotoAndStop(this._currentframe);
stop();
Symbol 591 MovieClip Frame 18
stop();
Symbol 592 MovieClip Frame 1
stop();
Symbol 592 MovieClip Frame 2
play();
Symbol 593 MovieClip Frame 1
stop();
Symbol 593 MovieClip Frame 5
play();
Symbol 593 MovieClip Frame 14
stop();
Symbol 593 MovieClip Frame 20
play();
Symbol 593 MovieClip Frame 29
gotoAndStop ("idle");
Symbol 603 MovieClip Frame 1
_x = (-20 + random(40));
_y = (-25 + random(20));
speed = 3 + random(2);
rate = 5;
rspeed = -10 + random(20);
life = 100;
if (name eq "spark_mc") {
stop();
} else {
play();
}
Symbol 603 MovieClip Frame 2
life = life - rate;
_rotation = (_rotation + rspeed);
_xscale = life;
_yscale = life;
_alpha = life;
if (life <= 0) {
gotoAndStop (4);
} else {
play();
}
Symbol 603 MovieClip Frame 3
gotoAndPlay(_currentframe - 1);
Symbol 603 MovieClip Frame 4
removeMovieClip(this);
stop();
Symbol 624 MovieClip Frame 1
stop();
Symbol 625 MovieClip [tile] Frame 1
offset_mc._visible = 0;
mydepth = this.getDepth();
stop();
Symbol 625 MovieClip [tile] Frame 16
tile_mc.gotoAndPlay(tileframe);
Instance of Symbol 624 MovieClip "tile_mc" in Symbol 625 MovieClip [tile] Frame 50
onClipEvent (load) {
function makespark() {
spark_mc.duplicateMovieClip("sparkmc_" + (d++), d);
}
d = 0;
max = 10;
i = 7;
spark_mc._visible = 0;
}
onClipEvent (enterFrame) {
if (_currentframe > 1) {
if (i > 0) {
i--;
if (i == 0) {
i = max + random(15);
makespark();
}
}
}
}
Symbol 642 MovieClip Frame 1
stop();
Symbol 649 MovieClip Frame 45
stop();
Symbol 654 MovieClip Frame 1
play();
Symbol 654 MovieClip Frame 10
stop();
Symbol 654 MovieClip Frame 17
play();
Symbol 654 MovieClip Frame 24
_parent.gotoTileFrame();
stop();
Symbol 659 MovieClip Frame 1
play();
Symbol 677 MovieClip Frame 1
stop();
Symbol 678 MovieClip Frame 1
stop();
Symbol 679 MovieClip Frame 1
_visible = 0;
stop();
Symbol 679 MovieClip Frame 2
_visible = 1;
stop();
Symbol 679 MovieClip Frame 12
_visible = 1;
stop();
Symbol 686 MovieClip Frame 1
stop();
Symbol 695 MovieClip Frame 1
stop();
Symbol 696 MovieClip Frame 1
accessing_mc._visible = false;
Symbol 704 MovieClip Frame 1
stop();
Symbol 711 MovieClip Frame 1
stop();
Symbol 712 MovieClip Frame 1
shieldbar_mc._visible = 0;
Symbol 718 MovieClip Frame 7
play();
Symbol 718 MovieClip Frame 33
gotoAndPlay ("repeat");
Symbol 722 MovieClip Frame 1
play();
Symbol 722 MovieClip Frame 10
stop();
Symbol 742 MovieClip Frame 1
stop();
Symbol 742 MovieClip Frame 6
stop();
Symbol 744 Button
on (press) {
game.renderManager.action = game.renderManager.CLOSEPIC;
}
on (rollOver) {
exitBtn.gotoAndPlay("over");
}
on (rollOut, releaseOutside) {
exitBtn.gotoAndPlay("out");
}
Symbol 745 MovieClip Frame 1
stop();
Symbol 745 MovieClip Frame 2
_quality = "high";
play();
Symbol 745 MovieClip Frame 21
var i = 0;
loading_mc._alpha = 0;
var photocontainer_mc = container_mc.createEmptyMovieClip("photo_mc", 1);
photocontainer_mc.loadMovie(loadpath);
var tmc = this;
loadtimer = setInterval(function () {
trace("loadpic interval");
var _local1 = Math.ceil((photocontainer_mc.getBytesLoaded() / photocontainer_mc.getBytesTotal()) * 100);
if (i == 0) {
i++;
if (_local1 == 100) {
clearInterval(tmc.loadtimer);
} else {
loading_mc._alpha = 100;
}
}
_level0.output = _local1;
if (_local1 == 100) {
tmc.loading_mc._alpha = 0;
clearInterval(tmc.loadtimer);
}
tmc.loading_mc.percent = _local1;
}, 15);
stop();
Instance of Symbol 736 MovieClip "scanline_mc" in Symbol 745 MovieClip Frame 21
onClipEvent (enterFrame) {
_y = (_y+1);
if (_y >= 385) {
_y = 270;
}
}
Symbol 745 MovieClip Frame 22
_quality = "low";
play();
Symbol 745 MovieClip Frame 40
_quality = "low";
_parent.gotoAndStop(1);
stop();
Symbol 746 MovieClip Frame 1
function reset() {
text_mc._visible = 0;
pic_mc._visible = 0;
text_mc.output = "";
}
function displayPicture() {
trace("here");
text_mc._visible = 0;
pic_mc.loadpath = pic;
pic_mc._visible = 1;
pic_mc.gotoAndPlay("in");
}
function showText() {
text_mc.output = output.toUpperCase();
if (pic_mc._visible == 1) {
pic_mc._visible = 0;
}
if (pic != null) {
text_mc.access_mc._visible = 1;
} else {
text_mc.access_mc._visible = 0;
}
if (text_mc._visible == 0) {
text_mc._visible = 1;
}
text_mc.gotoAndPlay("in");
}
pic = null;
stop();
Symbol 746 MovieClip Frame 2
showText();
stop();
Symbol 746 MovieClip Frame 3
stop();
Symbol 753 MovieClip Frame 1
stop();
Symbol 753 MovieClip Frame 2
play();
Symbol 753 MovieClip Frame 18
play();
Symbol 753 MovieClip Frame 19
Dalek.loadMap();
stop();
Symbol 753 MovieClip Frame 40
play();
Symbol 753 MovieClip Frame 45
_global._timeline.restartCallback();
Symbol 773 MovieClip Frame 1
stop();
Symbol 797 MovieClip Frame 1
stop();
Symbol 801 MovieClip Frame 1
marker.num = itemnum;
myColour = new Color(marker);
myColour.setRGB(bcolour);
Symbol 804 Button
on (press) {
confirmSelected();
}
on (rollOver) {
exitBtn.gotoAndPlay("over");
}
on (rollOut, releaseOutside) {
exitBtn.gotoAndPlay("out");
}
Symbol 810 MovieClip Frame 3
stop();
Symbol 810 MovieClip Frame 4
play();
Symbol 810 MovieClip Frame 30
gotoAndPlay ("loop");
Symbol 811 MovieClip Frame 1
stop();
Symbol 811 MovieClip Frame 2
this.hitMC.onRollOver = function () {
_parent.rollOverControl(this._parent.wIndex);
};
this.hitMC.onRollOut = function () {
_parent.rollOutControl(this._parent.wIndex);
};
this.hitMC.onDragOut = function () {
_parent.rollOutControl(this._parent.wIndex);
};
this.hitMC.onPress = function () {
_parent.pressControl(this._parent.wIndex);
};
stop();
Symbol 812 MovieClip Frame 1
marker.num = itemnum;
myColour = new Color(marker);
myColour.setRGB(bcolour);
Symbol 817 MovieClip Frame 1
play();
Symbol 817 MovieClip Frame 80
_parent.switchme();
Symbol 818 MovieClip Frame 1
play();
Symbol 818 MovieClip Frame 80
_parent.switchme();
Symbol 819 MovieClip Frame 1
play();
Symbol 819 MovieClip Frame 60
_parent.switchme();
Symbol 820 MovieClip Frame 1
play();
Symbol 820 MovieClip Frame 80
_parent.switchme();
Symbol 821 MovieClip Frame 1
function switchme() {
var _local2 = this._totalframes;
var _local1 = Math.ceil(Math.random() * _local2);
var _local3 = Math.floor(Math.random() * 4);
switch (_local3) {
case 0 :
_xscale = -100;
_yscale = 100;
break;
case 1 :
_xscale = 100;
_yscale = 100;
break;
case 2 :
_xscale = 100;
_yscale = -100;
break;
case 3 :
_xscale = -100;
_yscale = -100;
}
this.gotoAndStop(_local1);
}
stop();
Symbol 821 MovieClip Frame 2
stop();
Symbol 821 MovieClip Frame 3
stop();
Symbol 821 MovieClip Frame 4
stop();
Symbol 822 MovieClip Frame 1
function displayWeapons() {
equiptWeapons = Dalek.selectedWeapons.slice(0);
((equiptWeapons[0] != 0) ? ((equipIndex = 1)) : ((equipIndex = 0)));
var _local3 = 0;
var _local2 = 0;
var _local1 = 1;
while (_local1 < Dalek.weapons.length) {
if (Dalek.weapons[_local1].collected == true) {
unlockWeapon(_local1);
if (((_local1 == 2) || (_local1 == 6)) || (_local1 == 10)) {
_local2 = _local1;
}
if (_local1 == 1) {
_local3 = _local1;
}
}
_local1++;
}
Dalek.weapons[Dalek.lastweapon].collected = true;
unlockWeapon(Dalek.lastweapon);
if ((_local3 == 1) && (Dalek.lastweapon == 8)) {
trace("upgrade shield");
upgrade_mc.gotoAndPlay("upgrade1");
if (equiptWeapons[0] == 1) {
equiptWeapons[0] = 8;
} else if (equiptWeapons[1] == 1) {
equiptWeapons[1] = 8;
}
}
if ((_local2 == 2) && (Dalek.lastweapon == 6)) {
trace("upgrade gun2");
upgrade_mc.gotoAndPlay("upgrade2");
if (equiptWeapons[0] == 2) {
equiptWeapons[0] = 6;
} else if (equiptWeapons[1] == 2) {
equiptWeapons[1] = 6;
}
}
if ((_local2 == 6) && (Dalek.lastweapon == 10)) {
trace("upgrade gun3");
upgrade_mc.gotoAndPlay("upgrade3");
if (equiptWeapons[0] == 6) {
equiptWeapons[0] = 10;
} else if (equiptWeapons[1] == 6) {
equiptWeapons[1] = 10;
}
}
}
function displaySelected() {
var _local1 = 0;
while (_local1 < 2) {
var _local2 = getWeaponName(equiptWeapons[_local1]);
this[("selection" add (_local1 + 1)) add "_mc"].isoweapons_mc.gotoAndStop(_local2);
var _local3 = weaponToButton(_local2);
if (equiptWeapons[_local1] != 0) {
var hover = this["hover" add (_local1 + 1)];
hover.tween("_x", _local3._x, 1.5, 3);
hover.tween("_y", _local3._y, 1.5, 3);
}
_local1++;
}
}
function confirmSelected() {
displaySelected();
Dalek.changeWeapons(equiptWeapons);
var _local1 = game.renderManager;
_local1.action = _local1.OFFEQUIP;
}
function getWeaponName(index) {
return(Dalek.weapons[Number(index)].name);
}
function weaponToButton(name) {
var _local3 = name;
var _local2 = _local3;
var _local1 = _local3.substr(0, _local3.length - 1);
if ((_local1 == "shield") || (_local1 == "gun")) {
_local2 = _local1;
}
return(this[_local2]);
}
function unlockWeapon(index) {
var _local2 = String(getWeaponName(index));
var _local1 = weaponToButton(_local2);
_local1.gotoAndStop("active");
_local1.wIndex = index;
_local1.weaponicon_mc.gotoAndStop(_local2);
}
rollOverControl = function (wIndex) {
soundcontrol("over");
var _local1 = getWeaponName(wIndex);
weaponinfo_mc.gotoAndStop(_local1);
isoweapons_mc.gotoAndStop(_local1);
var _local2 = weaponToButton(_local1);
_local2.fade_mc.gotoAndPlay("loop");
};
rollOutControl = function (wIndex) {
weaponinfo_mc.gotoAndStop("none");
isoweapons_mc.gotoAndStop("none");
if (wIndex != undefined) {
var _local1 = getWeaponName(wIndex);
var _local2 = weaponToButton(_local1);
_local2.fade_mc.gotoAndStop("off");
}
};
pressControl = function (wIndex) {
var _local1 = wIndex;
if ((_local1 != equiptWeapons[0]) && (_local1 != equiptWeapons[1])) {
soundcontrol("artifact");
equiptWeapons[equipIndex] = _local1;
if (equipIndex >= 1) {
equipIndex = -1;
}
equipIndex++;
displaySelected();
}
};
displayWeapons();
displaySelected();
rollOutControl();
hits = _aHit;
stop();
Instance of Symbol 624 MovieClip "isoweapons_mc" in Symbol 822 MovieClip Frame 1
onClipEvent (load) {
spark_mc._visible = 0;
}
Instance of Symbol 801 MovieClip "selection1_mc" in Symbol 822 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
itemnum = 1;
bcolour = 62718;
}
Instance of Symbol 801 MovieClip "selection2_mc" in Symbol 822 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
itemnum = 2;
bcolour = 63231;
}
Instance of Symbol 812 MovieClip "hover1" in Symbol 822 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
itemnum = 1;
bcolour = 63231;
}
Instance of Symbol 812 MovieClip "hover2" in Symbol 822 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
itemnum = 2;
bcolour = 63231;
}
Symbol 823 MovieClip Frame 1
stop();
Symbol 823 MovieClip Frame 2
play();
Instance of Symbol 624 MovieClip "isoweapons_mc" in Symbol 823 MovieClip Frame 8
onClipEvent (load) {
spark_mc._visible = 0;
}
Instance of Symbol 801 MovieClip "selection1_mc" in Symbol 823 MovieClip Frame 8
//component parameters
onClipEvent (initialize) {
itemnum = 1;
bcolour = 62718;
}
Instance of Symbol 801 MovieClip "selection2_mc" in Symbol 823 MovieClip Frame 8
//component parameters
onClipEvent (initialize) {
itemnum = 2;
bcolour = 63231;
}
Instance of Symbol 812 MovieClip "hover1" in Symbol 823 MovieClip Frame 8
//component parameters
onClipEvent (initialize) {
itemnum = 1;
bcolour = 63231;
}
Instance of Symbol 812 MovieClip "hover2" in Symbol 823 MovieClip Frame 8
//component parameters
onClipEvent (initialize) {
itemnum = 2;
bcolour = 63231;
}
Symbol 823 MovieClip Frame 11
stop();
Symbol 823 MovieClip Frame 12
play();
Instance of Symbol 624 MovieClip "isoweapons_mc" in Symbol 823 MovieClip Frame 12
onClipEvent (load) {
spark_mc._visible = 0;
}
Instance of Symbol 801 MovieClip "selection1_mc" in Symbol 823 MovieClip Frame 12
//component parameters
onClipEvent (initialize) {
itemnum = 1;
bcolour = 62718;
}
Instance of Symbol 801 MovieClip "selection2_mc" in Symbol 823 MovieClip Frame 12
//component parameters
onClipEvent (initialize) {
itemnum = 2;
bcolour = 63231;
}
Instance of Symbol 812 MovieClip "hover1" in Symbol 823 MovieClip Frame 12
//component parameters
onClipEvent (initialize) {
itemnum = 1;
bcolour = 63231;
}
Instance of Symbol 812 MovieClip "hover2" in Symbol 823 MovieClip Frame 12
//component parameters
onClipEvent (initialize) {
itemnum = 2;
bcolour = 63231;
}
Symbol 823 MovieClip Frame 17
gotoAndStop (1);
Symbol 828 MovieClip Frame 1
stop();
Symbol 834 MovieClip Frame 1
stop();
Symbol 834 MovieClip Frame 2
_quality = "high";
play();
Symbol 834 MovieClip Frame 6
soundcontrol("pickup");
Symbol 834 MovieClip Frame 64
play();
Symbol 834 MovieClip Frame 79
_quality = "low";
output = "";
game.renderManager.action = game.renderManager.EQUIP;
gotoAndStop (1);
Symbol 837 MovieClip Frame 1
stop();
Symbol 837 MovieClip Frame 2
play();
Symbol 837 MovieClip Frame 29
_parent.gotoAndStop("endscreen");
stop();
Symbol 837 MovieClip Frame 37
play();
Symbol 837 MovieClip Frame 44
stop();
Symbol 858 MovieClip Frame 1
stop();
Symbol 858 MovieClip Frame 2
gotoAndStop ("off");
Symbol 858 MovieClip Frame 8
gotoAndStop ("off");
Symbol 858 MovieClip Frame 14
gotoAndStop ("off");
Symbol 858 MovieClip Frame 20
gotoAndStop ("off");
Symbol 858 MovieClip Frame 26
gotoAndStop ("off");
Symbol 858 MovieClip Frame 33
gotoAndStop ("off");
Symbol 858 MovieClip Frame 40
gotoAndStop ("off");
Symbol 858 MovieClip Frame 47
gotoAndStop ("off");
Symbol 858 MovieClip Frame 55
gotoAndStop ("off");
Symbol 858 MovieClip Frame 61
gotoAndStop ("off");
Symbol 858 MovieClip Frame 68
gotoAndStop ("off");
Symbol 858 MovieClip Frame 75
gotoAndStop ("off");
Symbol 858 MovieClip Frame 83
gotoAndStop ("off");
Symbol 858 MovieClip Frame 90
gotoAndStop ("off");
Symbol 858 MovieClip Frame 97
gotoAndStop ("off");
Symbol 858 MovieClip Frame 105
gotoAndStop ("off");
Symbol 858 MovieClip Frame 112
gotoAndStop ("off");
Symbol 858 MovieClip Frame 119
gotoAndStop ("off");
Symbol 858 MovieClip Frame 127
gotoAndStop ("off");
Symbol 858 MovieClip Frame 133
gotoAndStop ("off");
Symbol 858 MovieClip Frame 139
gotoAndStop ("off");
Symbol 858 MovieClip Frame 145
gotoAndStop ("off");
Symbol 858 MovieClip Frame 151
gotoAndStop ("off");
Symbol 873 MovieClip Frame 1
stop();
Symbol 887 MovieClip Frame 1
stop();
Symbol 890 MovieClip Frame 1
stop();
Symbol 893 MovieClip Frame 1
stop();
Symbol 901 MovieClip Frame 1
stop();
Symbol 905 MovieClip Frame 1
stop();
Symbol 908 MovieClip Frame 1
stop();
Symbol 911 MovieClip Frame 1
stop();
Symbol 914 MovieClip Frame 1
stop();
Symbol 918 MovieClip Frame 1
stop();
Symbol 923 MovieClip Frame 1
stop();