Frame 1
copyright1 = "2005 4T2 Multimedia Ltd";
copyright2 = "www.4T2.co.uk";
copyright3 = "Enjoy the code ripper boy - let us know how you get on with it!";
gotoAndPlay (200);
Frame 201
function rand(Rstart, Rfinish) {
return(random((Rfinish - Rstart) + 1) + Rstart);
}
function encrypter(original, seed) {
var _local4 = 0;
var _local3 = 0;
while (_local3 <= original.length) {
if (!isNaN(original.substr(_local3, 1))) {
_local4 = _local4 + parseInt(original.substr(_local3, 1), 10);
}
_local3++;
}
if (_local4 < 10) {
_local4 = String("0000" + _local4);
} else if (_local4 < 100) {
_local4 = String("000" + _local4);
} else if (_local4 < 1000) {
_local4 = String("00" + _local4);
} else if (_local4 < 10000) {
_local4 = String("0" + _local4);
}
var _local1 = String((("ROB" + seed) + original) + _local4);
var _local2 = rand(5, (_local1.length / 2) - 1);
var _local5 = rand(8, (_local1.length / 2) - 1);
if ((_local5 == _local2) || (_local5 == (_local2 * 3))) {
_local5--;
}
if (_local2 > 99) {
_local2 = 99;
}
if (_local5 > 99) {
_local5 = 99;
}
var _local7 = rand(10, 99);
_local3 = 0;
while (_local3 < _local7) {
_local1 = (String(_local1.substr(_local2, _local5)) + String(_local1.substr(0, _local2))) + String(_local1.substr(_local5 + _local2, _local1.length));
_local1 = String(_local1.substr(_local2, _local1.length)) + String(_local1.substring(0, _local2));
_local3++;
}
var _local9 = _local2;
if (_local9 < 10) {
_local9 = String("0" + _local9);
}
var _local8 = _local5;
if (_local8 < 10) {
_local8 = String("0" + _local8);
}
_local1 = ((String(_local1) + String(_local9)) + String(_local8)) + String(_local7);
return(_local1);
}
function encrypt(original, seed) {
if (original.length < 20) {
original = ("ZQa" + original) + "EQZXT0123456789";
}
return(encrypter(encrypter(original, seed) + encrypter(original, seed), seed));
}
function decrypter(original, seed) {
var _local3 = Number(original.substr(original.length - 6, 2));
var _local4 = Number(original.substr(original.length - 4, 2));
var _local6 = Number(original.substr(original.length - 2, 2));
original = String(original.substr(0, original.length - 6));
var _local2 = 0;
while (_local2 < _local6) {
original = original.substr(original.length - _local3) + original.substr(0, original.length - _local3);
original = (original.substr(_local4, _local3) + original.substring(0, _local4)) + original.substr(_local4 + _local3, original.length);
_local2++;
}
var _local7 = parseInt(original.substr(-5, 5), 10);
var _local5 = 0;
_local2 = 4;
while (_local2 <= (original.length - 5)) {
if (!isNaN(original.substr(_local2, 1))) {
_local5 = _local5 + parseInt(original.substr(_local2, 1), 10);
}
_local2++;
}
if (((original.substr(0, 3) == "ROB") && (original.substr(3, 1) == seed)) && (_local7 == _local5)) {
return(original.substr(4, original.length - 9));
}
return(false);
}
function decrypt(original, seed) {
var _local2 = decrypter(original, seed);
var _local3 = decrypter(_local2.substr(0, _local2.length / 2), seed);
var _local4 = decrypter(_local2.substr(_local2.length / 2), seed);
if (_local3 == _local4) {
var _local1 = _local3;
if (_local1.substr(0, 3) == "ZQa") {
_local1 = _local1.substr(3, _local1.length - 18);
}
return(_local1);
}
return(false);
}
function newMomentum(angle, speed) {
if (angle <= 90) {
angle = 90 + (90 - angle);
} else if ((angle > 90) && (angle <= 180)) {
angle = 90 - (angle - 90);
} else if ((angle > 180) && (angle <= 270)) {
angle = 360 - (angle - 180);
} else {
angle = 270 - (angle - 270);
}
angle = ROUND(angle);
return(new Float(ALLTHETRIG[angle].x * speed, ALLTHETRIG[angle].y * speed));
}
function bestDirection(curAngle, newAngle, turning) {
var _local4 = newAngle;
var _local7 = ABS(curAngle - newAngle);
if (_local7 > turning) {
var _local2 = newAngle;
var _local3 = newAngle;
if (_local2 > curAngle) {
_local2 = _local2 - 360;
}
if (_local3 < curAngle) {
_local3 = _local3 + 360;
}
var _local9 = curAngle - _local2;
var _local6 = _local3 - curAngle;
if (_local9 < _local6) {
_local4 = checkAngleRange(curAngle - turning);
} else {
_local4 = checkAngleRange(curAngle + turning);
}
}
return(_local4);
}
function checkAngleRange(angle) {
if (angle < 0) {
angle = angle + 360;
}
if (angle >= 360) {
angle = angle - 360;
}
return(angle);
}
function initiateTrig() {
ALLTHETRIG = new Array();
var _local1 = 0;
while (_local1 <= 360) {
ALLTHETRIG[_local1] = trigstore(_local1);
_local1++;
}
}
function Float(x, y) {
this.x = x;
this.y = y;
}
function distance(x1, y1, x2, y2) {
var _local2 = x1 - x2;
var _local1 = y1 - y2;
return(SQRT((_local2 * _local2) + (_local1 * _local1)));
}
function trig(angle) {
var _local2 = FLOOR(angle / 360);
angle = angle - (_local2 * 360);
return(ALLTHETRIG[ROUND(angle)]);
}
function trigstore(angle) {
var _local4 = Math.floor(angle / 360);
angle = angle - (_local4 * 360);
var _local3;
var _local2;
if ((angle >= 0) && (angle <= 90)) {
_local3 = COS(RAD * (90 - angle));
_local2 = SIN(RAD * (90 - angle));
} else if ((angle > 90) and (angle <= 180)) {
_local3 = COS(RAD * (angle - 90));
_local2 = -SIN(RAD * (angle - 90));
} else if ((angle > 180) and (angle <= 270)) {
_local3 = -SIN(RAD * (angle - 180));
_local2 = -COS(RAD * (angle - 180));
} else if ((angle > 270) and (angle <= 360)) {
_local3 = -COS(RAD * (angle - 270));
_local2 = SIN(RAD * (angle - 270));
}
if (ABS(_local3) < 1E-5) {
_local3 = 0;
}
if (ABS(_local2) < 1E-5) {
_local2 = 0;
}
return(new Float(_local3, _local2));
}
function limit(value, minimum, maximum) {
if (value > maximum) {
value = maximum;
}
if (value < minimum) {
value = minimum;
}
return(value);
}
function reverseTrig(x, y) {
var _local1 = Math.atan(y / x) * (180 / PI);
if (x >= 0) {
_local1 = 90 - _local1;
} else {
_local1 = 270 - _local1;
}
if (isNaN(_local1)) {
_local1 = 0;
}
return(_local1);
}
function MIN(a, b) {
var _local1 = ((a < b) ? (a) : (b));
return(_local1);
}
function MAX(a, b) {
var _local1 = ((a > b) ? (a) : (b));
return(_local1);
}
function SGN(a) {
if (a > 0) {
return(1);
}
if (a == 0) {
return(0);
}
if (a < 0) {
return(-1);
}
}
Array.prototype.inArray = function (search) {
var _local4 = this.length;
var _local2 = 0;
while (_local2 < this.length) {
if (this[_local2] == search) {
return(true);
}
_local2++;
}
return(false);
};
function composite(which, movie) {
animsDone[which] = "done";
cachedBitmaps[which] = new Object();
i = 0;
while (i < animCells[which].length) {
var _local5 = animCells[which][i];
var _local2 = _root.attachMovie(movie, "tempMovie", 100);
_local2.gotoAndStop(i + 1);
var _local4 = (cachedBitmaps[which][_local5] = new flash.display.BitmapData(_local2._width, _local2._height, true, 16711680));
_local4.draw(_local2);
_local2.removeMovieClip();
i++;
}
}
animsDone = new Array();
cachedBitmaps = new Array();
animSequences = new Array();
animTimes = new Array();
animCells = new Array();
blocks = new Array();
blocks[1] = new Array(1, 1, 1, 1);
blocks[2] = new Array(2, 2, 2, 6, 6, 3);
blocks[3] = new Array(3, 3, 3, 3, 6, 6, 6);
blocks[4] = new Array(4, 4, 4, 6, 3, 3, 1);
blocks[5] = new Array(5, 5, 5, 5, 7, 7, 7);
blocks[6] = new Array(4, 4, 4, 5, 7, 7, 6, 6, 6);
animCells[1] = new Array("bentleftalot", "bentleftalittle", "bentrightalittle", "bentrightalot");
animSequences[1] = new Array("bentleftalittle", "bentleftalot", "bentleftalittle", "bentrightalittle", "bentrightalot", "bentrightalittle");
animTimes[1] = new Array(4, 4, 4, 4, 4, 4, 4);
animCells[2] = new Array("staight", "leg2up", "leg3up", "leg4up");
animSequences[2] = new Array("staight", "leg2up", "leg3up", "leg4up", "leg3up", "leg2up");
animTimes[2] = new Array(10, 10, 10, 10, 10, 10, 10);
animCells[3] = new Array("closed_rightlegs", "open", "closed_leftlegs", "down", "open_tail2", "closed", "in");
animSequences[3] = new Array("closed_rightlegs", "open", "closed_leftlegs", "open", "down", "open_tail2", "in", "open_tail2", "in", "open_tail2", "closed");
animTimes[3] = new Array(15, 3, 15, 6, 15, 10, 5, 5, 5, 10, 10);
animCells[4] = new Array("straight", "leftalittle", "leftalot", "rightalittle", "rightalot");
animSequences[4] = new Array("straight", "leftalittle", "leftalot", "leftalittle", "straight", "rightalittle", "rightalot", "rightalittle");
animTimes[4] = new Array(4, 4, 4, 4, 4, 4, 4, 4);
animCells[5] = new Array("straight", "rightalittle", "rightalot", "leftalittle", "leftalot");
animSequences[5] = new Array("straight", "rightalittle", "rightalot", "straight", "leftalittle", "leftalot");
animTimes[5] = new Array(4, 4, 4, 4, 4, 4);
animCells[6] = new Array("open", "slightlyclosed", "closed", "whatever");
animSequences[6] = new Array("open", "slightlyclosed", "closed", "whatever");
animTimes[6] = new Array(4, 4, 4, 4);
animCells[7] = new Array("bentleftfull", "bentleftalittle", "bentrightfull", "bentrightalittle");
animSequences[7] = new Array("bentleftfull", "bentleftalittle", "bentrightfull", "bentrightalittle", "bentrightfull", "bentleftalittle");
animTimes[7] = new Array(4, 4, 4, 4, 4, 4);
animCells[8] = new Array("closed_rightlegs", "open", "closed_leftlegs", "down", "open_tail2", "closed", "in", "in_tail2", "closed_tail2");
animSequences[8] = new Array("closed_rightlegs", "open", "closed_leftlegs", "open_tail2", "down", "open", "in", "open", "in_tail2", "open_tail2", "closed", "closed_tail2");
animTimes[8] = new Array(5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
animCells[9] = new Array("straight", "leftalittle", "leftalot", "rightalittle", "rightalot", "leftalittle2", "straight2");
animSequences[9] = new Array("straight", "leftalittle", "leftalot", "leftalittle2", "straight2", "rightalittle");
animTimes[9] = new Array(4, 4, 4, 4, 4, 4, 4, 4);
animCells[10] = new Array("staight", "leg2up", "leg3up", "leg4up");
animSequences[10] = new Array("staight", "leg2up", "leg3up", "leg4up", "leg3up", "leg2up");
animTimes[10] = new Array(5, 5, 5, 5, 5, 5, 5);
animCells[11] = new Array("bentleftfull", "bentleftalittle", "middle", "bentrightfull", "bentrightalittle");
animSequences[11] = new Array("bentleftfull", "bentleftalittle", "middle", "bentrightfull", "bentrightalittle");
animTimes[11] = new Array(4, 4, 4, 4, 4, 4, 4);
animCells[12] = new Array("armsup", "armsmiddle", "armsdown");
animSequences[12] = new Array("armsmiddle", "armsup", "armsmiddle", "armsdown");
animTimes[12] = new Array(4, 4, 4, 4);
animCells[13] = new Array("armsout", "armsmiddle", "armsdown");
animSequences[13] = new Array("armsmiddle", "armsout", "armsmiddle", "armsdown");
animTimes[13] = new Array(4, 4, 4, 4);
animCells[14] = new Array("straight", "rightalittle", "rightalot", "leftalittle", "leftalot");
animSequences[14] = new Array("straight", "rightalittle", "rightalot", "straight", "leftalittle", "leftalot");
animTimes[14] = new Array(4, 4, 4, 4, 4, 4, 4, 4);
animCells[15] = new Array("closed_rightlegs", "open", "closed_leftlegs", "down", "open_tail2", "closed", "in", "in2");
animSequences[15] = new Array("closed_rightlegs", "open", "closed_leftlegs", "open", "down", "open_tail2", "in", "open_tail2", "in2", "open_tail2", "closed");
animTimes[15] = new Array(15, 3, 15, 6, 15, 10, 5, 5, 5, 10, 10);
animCells[16] = new Array("armsout", "armsmiddle", "armsdown", "snapclaw");
animSequences[16] = new Array("armsout", "armsmiddle", "armsdown", "snapclaw", "armsdown", "snapclaw", "armsdown", "armsmiddle");
animTimes[16] = new Array(4, 4, 4, 4, 4, 4, 4, 4);
animCells[17] = new Array("straight", "straightopen", "rightalittle", "rightalot", "leftalittle", "leftalot");
animSequences[17] = new Array("straight", "straightopen", "straight", "rightalittle", "rightalot", "straight", "leftalittle", "leftalot");
animTimes[17] = new Array(4, 4, 4, 4, 4, 4, 4, 4);
animCells[18] = new Array("open", "slightlyclosed", "closed");
animSequences[18] = new Array("slightlyclosed", "open", "slightlyclosed", "closed");
animTimes[18] = new Array(4, 4, 4, 4, 4, 4, 4);
animCells[19] = new Array("straight", "rightalittle", "rightalot", "leftalittle", "leftalot");
animSequences[19] = new Array("straight", "rightalittle", "rightalot", "leftalittle", "leftalot");
animTimes[19] = new Array(4, 4, 4, 4, 4, 4);
animCells[20] = new Array("open", "slightlyclosed", "closed", "whatever");
animSequences[20] = new Array("open", "slightlyclosed", "closed", "whatever");
animTimes[20] = new Array(4, 4, 4, 4);
animCells[21] = new Array("straight", "rightalittle", "rightalot", "leftalittle");
animSequences[21] = new Array("straight", "rightalittle", "rightalot", "leftalittle");
animTimes[21] = new Array(4, 4, 4, 4, 4, 4, 4);
animCells.bigcrab_move = new Array("1", "2", "3", "4", "5", "6", "7");
animSequences.bigcrab_move = new Array("1", "2", "3", "2", "1", "4", "5", "4", "7", "6", "7", "6");
animTimes.bigcrab_move = new Array(6, 6, 6, 6, 6, 6, 6, 6, 2, 2, 2, 2);
animCells.bigcrab_attack = new Array("closed", "open", "drawback", "legmove");
animSequences.bigcrab_attack = new Array("open", "closed", "open", "closed", "drawback", "legmove", "drawback", "closed");
animTimes.bigcrab_attack = new Array(3, 3, 3, 3, 3, 3, 20, 3);
animCells.biglobster_move = new Array("1", "2", "3");
animSequences.biglobster_move = new Array("1", "2", "3", "2");
animTimes.biglobster_move = new Array(3, 3, 6, 3);
animCells.biglobster_attack = new Array("1", "2", "3", "4");
animSequences.biglobster_attack = new Array("1", "2", "3", "4", "3", "4", "3", "2", "1");
animTimes.biglobster_attack = new Array(20, 3, 3, 3, 3, 3, 3, 3, 3);
animCells.bigfangfish_move = new Array("1", "2", "3", "4", "5", "6", "7");
animSequences.bigfangfish_move = new Array("1", "2", "3", "4", "5", "6", "7", "6", "5", "4", "3", "2");
animTimes.bigfangfish_move = new Array(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
animCells.bigsquid_move = new Array("1", "2", "3", "4", "5", "6");
animSequences.bigsquid_move = new Array("1", "2", "3", "4", "5", "6", "1", "6", "5", "4", "3");
animTimes.bigsquid_move = new Array(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
animCells.bigshark_move = new Array("s1", "s2", "s3", "s4", "s5", "s6");
animSequences.bigshark_move = new Array("s1", "s2", "s3", "s4", "s5", "s6");
animTimes.bigshark_move = new Array(3, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4);
function Giant(parent, species) {
this.parent = parent;
this.game = this.parent.parent.parent;
this.species = species;
this.active = true;
this.radarColor = "giant";
this.setAttributes();
this.lastStrength = (this.origStrength = this.strength);
this.impact = 40;
var _local2 = 0;
while (_local2 < this.allstates.length) {
if (animsDone[(this.species + "_") + this.allstates[_local2]] != "done") {
composite((this.species + "_") + this.allstates[_local2], (this.species + "_") + this.allstates[_local2]);
}
_local2++;
}
this.anim = (this.species + "_") + this.state;
this.fireCounter = (this.animCounter = (this.animMarker = 0));
this.MC = this.parent.MC.createEmptyMovieClip("giant", 1000);
this.animHolder = this.MC.createEmptyMovieClip("giantholder", 1);
this.animHolder.attachBitmap(cachedBitmaps[this.anim][animSequences[this.anim][this.animMarker]], 1, "auto", true);
this.animHolder._x = (-this.animHolder._width) / 2;
this.animHolder._y = (-this.animHolder._height) / 2;
this.draw();
this.game.hud.showGiantStrength(this.species);
}
Giant.prototype.handle = function () {
if (this.strength != this.lastStrength) {
this.game.hud.changeGiantStrength(this.strength, this.origStrength);
this.game.sfx.play(this.sound + "Hit", 100, 0);
}
if (this.strength == 0) {
this.active = false;
this.parent.giant = "none";
this.game.giants[this.game.currentLevel] = "";
this.parent.manualComplete();
this.impactHero(this.impact);
this.game.sfx.play("music_giant_stop", 100, 0);
this.game.sfx.play(this.sound + "Destroyed", 100, 0);
this.doExplosion();
saveAward(this.species);
if (this.species == "bigsquid") {
this.parent.treasure.collect();
}
return(undefined);
}
this.move();
this.checkEdges();
this.collide();
this.animate();
this.draw();
this.lastStrength = this.strength;
this.parent.parent.radar.blobs.push({posX:this.posX, posY:this.posY, radarColor:this.radarColor});
};
Giant.prototype.draw = function () {
this.MC._x = this.posX;
this.MC._y = this.posY;
this.MC._rotation = this.angle;
this.filters = new Array();
if (this.strength != this.lastStrength) {
this.filters.push(this.parent.filterHit);
}
if (random(20) == 1) {
this.parent.doBubble(this.posX - ((SIN(this.angle * RAD) * this.size) / 2), this.posY + ((COS(this.angle * RAD) * this.size) / 2));
}
this.parent.doShadow(this);
this.MC.filters = this.filters;
};
Giant.prototype.animate = function () {
this.animCounter++;
if (this.animCounter == animTimes[this.anim][this.animMarker]) {
this.animCounter = 0;
this.animMarker++;
if (this.animMarker >= animSequences[this.anim].length) {
this.animMarker = 0;
}
this.animHolder.attachBitmap(cachedBitmaps[this.anim][animSequences[this.anim][this.animMarker]], 1, "auto", true);
}
};
Giant.prototype.move = function () {
if (this.waitCounter) {
this.waitCounter++;
if (this.waitCounter == this.waitTime) {
this.waitCounter = 0;
this.speed = this.speed * this.slowDown;
}
}
this.movementCounter++;
if (this.movementCounter == this.moveFor) {
if (this.allstates.length > 1) {
this.state = this.allstates[1];
this.anim = (this.species + "_") + this.state;
this.animCounter = (this.animMarker = 0);
}
this.behaviour = this.allbehaviours[1];
} else if ((this.movementCounter >= this.moveFor) && (this.movementCounter < (this.moveFor + this.stopFor))) {
this.fire();
if (this.behaviour == "none") {
return(undefined);
}
} else if (this.movementCounter == (this.moveFor + this.stopFor)) {
this.movementCounter = 0;
this.hasFired = 0;
this.state = this.allstates[0];
this.behaviour = (this.behaviour = (this.allbehaviours[2] ? (this.allbehaviours[2]) : (this.allbehaviours[0])));
this.anim = (this.species + "_") + this.state;
this.animCounter = (this.animMarker = 0);
if (this.behaviour == "reposition") {
var _local5 = this.posX - this.startingX;
var _local4 = this.posY - this.startingY;
this.angle = checkAngleRange(ROUND((ATAN2(_local4, _local5) / RAD) + 270));
var _local2 = newMomentum(this.angle, this.speed);
this.momentumX = _local2.x;
this.momentumY = _local2.y;
}
}
if (this.behaviour == "reposition") {
this.movementCounter = 0;
var _local5 = this.posX - this.startingX;
var _local4 = this.posY - this.startingY;
var _local6 = (_local5 * _local5) + (_local4 * _local4);
var _local3 = (this.size + 100) / 2;
if ((_local3 * _local3) >= _local6) {
this.behaviour = this.allbehaviours[0];
this.angle = 90;
}
} else if (this.behaviour == "target") {
this.targetAngle();
var speed = this.speed;
if (speed > 15) {
speed = 15;
}
var _local2 = newMomentum(this.angle, speed);
this.momentumX = _local2.x;
this.momentumY = _local2.y;
} else if (this.behaviour == "circle") {
this.angle = this.angle + 2;
if (this.angle > 360) {
this.angle = 1;
}
var _local2 = newMomentum(this.angle, this.speed);
this.momentumX = _local2.x;
this.momentumY = _local2.y;
} else if ((this.behaviour == "side") && (random(120) == 1)) {
this.momentumX = this.momentumX * -1;
}
this.posX = this.posX + this.momentumX;
this.posY = this.posY + this.momentumY;
};
Giant.prototype.fire = function () {
if ((!this.fireFreq) || (this.hasFired == this.fireFreq)) {
return(undefined);
}
if (random(20) == 1) {
this.hasFired++;
var _local2 = this.parent.newEnemy(this.weapon, ANGRY, this.posX, this.posY, random(360));
this.parent.enemies[_local2].angerTime = "forever";
}
};
Giant.prototype.checkEdges = function () {
if (this.posX < (this.size2 + this.ajar)) {
this.posX = this.size2 + this.ajar;
this.momentumX = this.momentumX * -1;
if (this.species != "bigcrab") {
this.angle = ROUND(reverseTrig(this.momentumX, -this.momentumY));
}
return(undefined);
}
if (this.posX > ((this.parent.width - this.size2) - this.ajar)) {
this.posX = (this.parent.width - this.size2) - this.ajar;
this.momentumX = this.momentumX * -1;
if (this.species != "bigcrab") {
this.angle = ROUND(reverseTrig(this.momentumX, -this.momentumY));
}
return(undefined);
}
if (this.posY < (this.size2 + this.ajar)) {
this.posY = this.size2 + this.ajar;
this.momentumY = this.momentumY * -1;
if (this.species != "bigcrab") {
this.angle = ROUND(reverseTrig(this.momentumX, -this.momentumY));
}
return(undefined);
}
if (this.posY > ((this.parent.height - this.size2) - this.ajar)) {
this.posY = (this.parent.height - this.size2) - this.ajar;
this.momentumY = this.momentumY * -1;
if (this.species != "bigcrab") {
this.angle = ROUND(reverseTrig(this.momentumX, -this.momentumY));
}
return(undefined);
}
};
Giant.prototype.collide = function () {
var _local2 = this.parent.hero;
var _local5 = this.posX - _local2.posX;
var _local4 = this.posY - _local2.posY;
var _local7 = (_local5 * _local5) + (_local4 * _local4);
var _local6 = (this.size + _local2.size) / 2;
if ((_local6 * _local6) >= _local7) {
var _local3 = SQRT(_local7);
_local5 = _local5 / _local3;
_local4 = _local4 / _local3;
_local3 = _local3 - _local6;
_local2.posX = _local2.posX + (_local5 * _local3);
_local2.posY = _local2.posY + (_local4 * _local3);
if (_local2.hitCounter || (_local2.age < 20)) {
return(undefined);
}
this.game.timer = this.game.timer - this.damage;
_local2.hitCounter = 1;
if (!this.waitCounter) {
this.speed = this.speed / this.slowDown;
}
this.waitCounter = 1;
}
};
Giant.prototype.setAttributes = function () {
this.movementCounter = (this.waitCounter = (this.weapon = (this.hasFired = (this.waitTime = 0))));
this.ajar = 50;
this.behaviour = "none";
this.slowDown = 2;
if (this.species == "bigcrab") {
this.posX = random(this.parent.width);
this.posY = 100;
this.angle = 180;
this.allstates = new Array("move", "attack");
this.state = this.allstates[0];
this.allbehaviours = new Array("side", "none");
this.behaviour = this.allbehaviours[0];
this.sound = "crab";
this.block = 2;
this.size = 150;
this.damage = 10;
this.speed = 10;
this.strength = 30;
this.moveFor = 200;
this.stopFor = 80;
this.fireFreq = 1;
this.weapon = 2;
this.parent.maxEnemies = 4;
} else if (this.species == "biglobster") {
this.posX = random(this.parent.width2);
this.posY = random(this.parent.height2);
this.angle = 90;
this.allstates = new Array("move", "attack");
this.state = this.allstates[1];
this.allbehaviours = new Array("target", "none");
this.behaviour = this.allbehaviours[0];
this.sound = "lobster";
this.block = 3;
this.size = 180;
this.damage = 12;
this.speed = 10;
this.turning = 10;
this.strength = 40;
this.moveFor = 200;
this.stopFor = 100;
this.movementCounter = this.moveFor + 1;
} else if (this.species == "bigfangfish") {
this.posX = 700;
this.posY = 250;
this.angle = 90;
this.allstates = new Array("move");
this.state = this.allstates[0];
this.allbehaviours = new Array("circle", "none");
this.behaviour = this.allbehaviours[0];
this.sound = "fangfish";
this.block = 4;
this.size = 150;
this.damage = 13;
this.speed = 16;
this.fireFreq = 4;
this.weapon = 1;
this.strength = 55;
this.moveFor = 200;
this.stopFor = 100;
} else if (this.species == "bigshark") {
this.posX = (this.startingX = 750);
this.posY = (this.startingY = 200);
this.angle = 90;
this.allstates = new Array("move");
this.state = this.allstates[0];
this.allbehaviours = new Array("circle", "target", "reposition");
this.behaviour = this.allbehaviours[0];
this.sound = "shark";
this.block = 5;
this.size = 180;
this.damage = 12;
this.speed = 18;
this.turning = 20;
this.strength = 50;
this.moveFor = 200;
this.stopFor = 150;
} else if (this.species == "bigsquid") {
this.posX = random(this.parent.width2);
this.posY = random(this.parent.height2);
this.targetAngle();
this.allstates = new Array("move");
this.state = this.allstates[0];
this.allbehaviours = new Array("target", "none");
this.behaviour = this.allbehaviours[0];
this.sound = "squid";
this.block = 6;
this.size = 220;
this.damage = 13;
this.speed = 15;
this.turning = 10;
this.strength = 60;
this.moveFor = 200;
this.stopFor = 100;
}
this.size2 = this.size / 2;
this.origSpeed = this.speed;
if (this.species == "bigcrab") {
var _local3 = checkAngleRange(this.angle + 90);
var _local2 = newMomentum(_local3, this.speed);
} else {
var _local2 = newMomentum(this.angle, this.speed);
}
this.momentumX = _local2.x;
this.momentumY = _local2.y;
};
Giant.prototype.targetAngle = function () {
var _local3 = this.posX - this.parent.hero.posX;
var _local2 = this.posY - this.parent.hero.posY;
var _local4 = checkAngleRange(ROUND((ATAN2(_local2, _local3) / RAD) + 270));
this.angle = bestDirection(this.angle, _local4, this.turning);
};
Giant.prototype.impactHero = function (impact) {
var _local4 = this.parent.hero.posX - this.posX;
var _local3 = this.parent.hero.posY - this.posY;
var _local5 = MIN(SQRT((_local4 * _local4) + (_local3 * _local3)) - SCREENX, SCREENX) / SCREENX;
impact = (this.impact * _local5) * 0.25;
var _local6 = ATAN2(_local3, _local4);
this.parent.hero.inertiaX = this.parent.hero.inertiaX - (COS(_local6) * impact);
this.parent.hero.inertiaY = this.parent.hero.inertiaY + (SIN(_local6) * impact);
_local6 = checkAngle(_local6 / RAD);
if (_local6 > this.parent.hero.angle) {
impact = impact * -1;
}
this.parent.hero.steer = this.parent.hero.steer + ((((impact * impact) * impact) * ((100 - this.parent.hero.size) / 100)) * 0.1);
};
Giant.prototype.doExplosion = function () {
this.MC = this.parent.MC.attachMovie("cloudExplosion", "cloudExplosion", 1000);
this.MC._x = this.posX + 50;
this.MC._y = this.posY + 50;
var _local4 = this.MC.attachMovie("cloudExplosion", "cloudExplosion", 1);
_local4._x = -50;
_local4._y = -50;
_local4 = this.MC.attachMovie("cloudExplosion", "cloudExplosion", 2);
_local4._x = 20;
_local4._y = -30;
var _local2 = (i2 = blocks[this.block].length);
while (_local2-- , _local2 > -1) {
var _local3 = _local4.attachMovie("blockfly", "blockfly", _local2);
_local3._rotation = random(360);
_local3.block.gotoAndStop(blocks[this.block][_local2]);
}
_local2 = i2;
while (_local2-- , _local2 > -1) {
var _local3 = _local4.attachMovie("blockfly", "blockfly", _local2 + 10);
_local3._rotation = random(360);
_local3._x = (_local3._y = 20);
_local3.block.gotoAndStop(blocks[this.block][_local2]);
}
_local2 = i2;
while (_local2-- , _local2 > -1) {
var _local3 = _local4.attachMovie("blockfly", "blockfly", _local2 + 10);
_local3._rotation = random(360);
_local3._x = (_local3._y = -20);
_local3.block.gotoAndStop(blocks[this.block][_local2]);
}
this.parent.doExplosion(this.posX, this.posY, this.impact);
};
function Treasure(parent, state, posX, posY, angle) {
this.parent = parent;
this.game = this.parent.parent.parent;
this.state = state;
this.posX = posX;
this.posY = posY;
this.angle = angle;
this.size = 80;
this.MC = this.parent.MC.attachMovie("treasure", "treasure", 50);
this.MC._x = this.posX;
this.MC._y = this.posY;
this.MC._rotation = this.angle;
this.radarColor = "treasure";
this.flashCounter = 0;
if (this.state > 1) {
this.MC.gotoAndStop("open");
}
}
Treasure.prototype.handle = function () {
if (this.state == 3) {
if (this.parent.level == this.game.totalLevels) {
this.game.gameOutcome = "victory";
this.game.gameOver();
}
return(undefined);
}
if (this.state != 2) {
return(undefined);
}
this.flashCounter++;
if (this.flashCounter <= 4) {
this.parent.parent.radar.blobs.push({posX:this.posX, posY:this.posY, radarColor:this.radarColor});
} else if (this.flashCounter == 8) {
this.flashCounter = 0;
}
var _local2 = this.parent.hero;
var _local5 = this.posX - _local2.posX;
var _local4 = this.posY - _local2.posY;
var _local6 = (_local5 * _local5) + (_local4 * _local4);
var _local3 = (this.size + _local2.size) / 2;
if ((_local3 * _local3) >= _local6) {
this.collect();
}
};
Treasure.prototype.activate = function () {
if (this.state == 3) {
return(undefined);
}
this.state = 2;
this.game.sfx.play("sonar", 100, 0);
this.game.theTreasure["state" + this.parent.level] = this.state;
};
Treasure.prototype.collect = function () {
this.state = 3;
this.MC.gotoAndPlay("opening");
this.game.sfx.play("treasure", 100, 0);
var _local2 = this.game.completeLevel(this.state);
if (!_local2) {
this.game.sfx.play("gottreasure", 100, 0);
}
if (!FIRSTS.depths) {
this.game.hud.showHint("depths");
}
if (this.parent.level == 1) {
this.parent.showLifeline();
}
if (!local_data.data.TREASURE.inArray(this.parent.level)) {
local_data.data.TREASURE[local_data.data.TREASURE.length] = this.parent.level;
local_data.flush();
if (local_data.data.TREASURE.length == this.game.totalLevels) {
saveAward("alltreasure");
}
}
};
function Radar(parent) {
this.parent = parent;
this.MC = this.parent.parent.hud.MC.attachMovie("radar", "radar", 1);
this.mask = this.MC.attachMovie("radar_mask", "radar_mask", 2);
this.MC.setMask(this.mask);
this.MClines = this.parent.parent.hud.MC.attachMovie("radar_lines", "radar_lines", 2);
this.width = 80;
this.height = 80;
this.width2 = this.width / 2;
this.height2 = this.height / 2;
this.MC._x = (this.MClines._x = 10);
this.MC._y = (this.MClines._y = (SCREENY - this.height) - 10);
this.blobs = new Array();
}
Radar.prototype.handle = function () {
this.screenMC = this.MC.createEmptyMovieClip("screenMC", 1);
this.screenMC._x = this.width * 0.1;
this.screenMC._y = this.height * 0.1;
this.arena = this.parent.arena;
for (var _local4 in this.blobs) {
var _local2 = this.blobs[_local4];
var _local3 = this.screenMC.attachMovie("blob", "blob" + _local4, _local4);
_local3._x = ((_local2.posX / this.arena.width) * this.width) * 0.8;
_local3._y = ((_local2.posY / this.arena.height) * this.height) * 0.8;
_local3.colors.gotoAndStop(_local2.radarColor);
}
this.blobs = new Array();
};
Radar.prototype.doExplosion = function (posX, posY, ref) {
var _local2 = this.MC.attachMovie("radarExplosion", "radarExplosion" + ref, ref + 50);
_local2._x = ((posX / this.arena.width) * this.width) * 0.8;
_local2._y = ((posY / this.arena.height) * this.height) * 0.8;
};
function Shot(parent, depth, type, posX, posY, speed, angle) {
this.parent = parent;
this.depth = depth;
this.type = type;
this.posX = posX;
this.posY = posY;
this.angle = angle;
this.startX = posX;
this.startY = posY;
this.explosion = false;
this.explostionCounter = 0;
this.stoppable = true;
this.impact = 10;
this.sound = "none";
this.speed = speed * 7;
if (this.type == 1) {
this.speed = this.speed + 20;
this.range = 30000;
this.size = 10;
this.sound = "harpoon";
this.damage = 20;
} else if (this.type == 2) {
this.speed = this.speed + 30;
this.range = 70000 /* 0x011170 */;
this.size = 15;
this.sound = "harpoon";
this.damage = 25;
} else if (this.type == 3) {
this.speed = this.speed + 50;
this.range = 80000 /* 0x013880 */;
this.size = 10;
this.sound = "laser";
this.damage = 35;
this.stoppable = false;
} else if (this.type == 4) {
this.speed = (speed * 9) + 30;
this.range = 50000;
this.size = 30;
this.stoppable = false;
this.explosion = true;
this.explosionTime = 15;
this.explosionSize = 90;
this.sound = "torpedo";
this.damage = 50;
} else if (this.type == 5) {
this.speed = this.speed + 30;
this.range = 70000 /* 0x011170 */;
this.size = 30;
this.stoppable = false;
this.explosion = true;
this.explosionTime = 15;
this.explosionSize = 90;
this.sound = "torpedo";
this.damage = 50;
} else if (this.type == 6) {
this.speed = this.speed + 50;
this.range = 90000 /* 0x015F90 */;
this.size = 40;
this.stoppable = false;
this.sound = "laser";
this.damage = 100;
} else if (this.type == 7) {
this.speed = this.speed + 60;
this.range = 80000 /* 0x013880 */;
this.size = 30;
this.sound = "harpoon";
this.damage = 30;
} else if (this.type == 8) {
this.speed = 8;
this.range = 70000 /* 0x011170 */;
this.size = 15;
this.damage = 5;
} else if (this.type == 9) {
this.speed = 10;
this.range = random(900000) + 60000;
this.size = 15;
this.damage = 5;
}
this.active = true;
var _local2 = newMomentum(this.angle, this.speed);
this.momentumX = _local2.x;
this.momentumY = _local2.y;
this.MC = this.parent.MC.attachMovie("shot", "shot" + this.depth, this.depth + 2000);
this.MC.gotoAndPlay(this.type);
this.posX = this.posX - this.momentumX;
this.posY = this.posY - this.momentumY;
this.draw();
if (this.sound != "none") {
var _local3 = this.sound;
_local3 = _local3 + (random(3) + 1);
this.parent.parent.parent.sfx.play(_local3, 50, 0);
}
}
Shot.prototype.handle = function () {
if (!this.active) {
this.MC.removeMovieClip();
return(undefined);
}
if (this.explostionCounter) {
this.explostionCounter++;
if (this.explostionCounter == this.explosionTime) {
this.active = false;
}
return(undefined);
}
this.move();
this.collide();
this.draw();
};
Shot.prototype.move = function () {
this.posX = this.posX + this.momentumX;
this.posY = this.posY + this.momentumY;
var _local3 = this.posX - this.startX;
var _local2 = this.posY - this.startY;
var _local4 = (_local3 * _local3) + (_local2 * _local2);
if (_local4 >= this.range) {
if (this.explosion) {
this.MC.mybullet.gotoAndPlay("explode");
this.size = this.explosionSize;
this.explostionCounter++;
} else {
this.active = false;
}
if (this.type == 9) {
var _local5 = this.parent.newEnemy(2, 1, this.posX, this.posY, this.angle);
this.parent.enemies[_local5].fireFreq = 0;
}
}
};
Shot.prototype.collide = function () {
if (this.type > 7) {
var _local8 = this.parent.hero;
if (_local8.hitCounter || (_local8.age < 20)) {
return(undefined);
}
var _local6 = this.posX - _local8.posX;
var _local5 = this.posY - _local8.posY;
var _local7 = (_local6 * _local6) + (_local5 * _local5);
var _local4 = (this.size + _local8.size) / 2;
if ((_local4 * _local4) >= _local7) {
_local8.hitCounter = 1;
this.parent.parent.parent.timer = this.parent.parent.parent.timer - this.damage;
this.active = false;
}
}
for (var _local9 in this.parent.enemies) {
var _local2 = this.parent.enemies[_local9];
if ((_local2.active && (_local2.state != CAPTURED)) && ((_local2.species == 1) || (this.type <= 7))) {
var _local6 = this.posX - _local2.posX;
var _local5 = this.posY - _local2.posY;
var _local7 = (_local6 * _local6) + (_local5 * _local5);
var _local4 = this.size + _local2.size;
if ((_local4 * _local4) >= _local7) {
if (this.stoppable) {
this.active = false;
}
if (this.type > 7) {
_local2.active = false;
_local2.doExplosion();
} else {
_local2.hitCounter++;
this.impactEnemy(_local2);
}
}
}
}
if (this.type > 7) {
return(undefined);
}
if (this.parent.giant != "none") {
var _local6 = this.posX - this.parent.giant.posX;
var _local5 = this.posY - this.parent.giant.posY;
var _local7 = (_local6 * _local6) + (_local5 * _local5);
var _local4 = this.size + this.parent.giant.size;
if ((_local4 * _local4) >= _local7) {
if (this.stoppable) {
this.active = false;
}
this.parent.giant.strength--;
}
}
for (var _local9 in this.parent.terminals) {
var _local3 = this.parent.terminals[_local9];
if (_local3.state > 1) {
var _local6 = this.posX - _local3.posX;
var _local5 = this.posY - _local3.posY;
var _local7 = (_local6 * _local6) + (_local5 * _local5);
var _local4 = this.size + _local3.size;
if ((_local4 * _local4) >= _local7) {
this.active = false;
_local3.hitCounter = 1;
_local3.strength = _local3.strength - this.damage;
break;
}
}
}
};
Shot.prototype.draw = function () {
this.MC._x = this.posX;
this.MC._y = this.posY;
this.MC._rotation = this.angle;
};
Shot.prototype.impactEnemy = function (enemy) {
enemy.bounceX = (this.momentumX * this.damage) / enemy.size;
enemy.bounceY = (this.momentumY * this.damage) / enemy.size;
enemy.bounceCount = 10;
this.parent.doBubble(enemy.posX, enemy.posY, true);
};
function Terminal(parent, depth, state, infection, posX, posY, angle) {
this.parent = parent;
this.game = this.parent.parent.parent;
this.ref = depth;
this.depth = depth;
this.posX = posX;
this.posY = posY;
this.angle = angle;
this.infection = infection;
this.state = state;
this.size = 180;
this.speed = (this.spawn = (this.hitCounter = (this.flashCounter = (this.openedCounter = 0))));
this.spawnTarget = (this.strength = 100);
this.resetHitCounter = 10;
this.impact = 30;
this.radarColor = "terminal" + this.state;
this.MC = this.parent.MC.attachMovie("terminal", "terminal" + this.depth, this.depth + 100);
this.MC._x = this.posX;
this.posX = ((this.angle == 360) ? (this.posX + 250) : (this.posX - 250));
this.MC._y = this.posY;
this.MC._rotation = this.angle;
this.MC.gotoAndStop("state" + this.state);
}
Terminal.prototype.handle = function () {
this.draw();
if (this.state == 2) {
if (this.strength <= 0) {
this.closeMe();
} else if (this.strength >= 1) {
this.strength++;
if (this.strength == 100) {
this.state = 3;
}
}
} else if ((this.state == 3) && (this.strength < 100)) {
this.state = 2;
}
if (this.hitCounter == 1) {
this.game.sfx.play("caveHit", 80, 0);
}
if (this.hitCounter) {
this.hitCounter++;
if (this.hitCounter == this.resetHitCounter) {
this.hitCounter = 0;
}
}
if (this.state == 3) {
this.hull = 0;
this.spawn++;
if (this.spawn >= this.spawnTarget) {
this.spawn = 0;
var _local2 = checkAngleRange((this.angle + 180) + (random(80) - 40));
this.parent.newEnemy(this.infection, 1, this.posX, this.posY, _local2);
}
}
this.radarColor = "terminal" + this.state;
if (!this.openedCounter) {
this.parent.parent.radar.blobs.push({posX:this.posX, posY:this.posY, radarColor:this.radarColor});
} else {
this.openedCounter++;
this.flashCounter++;
if (this.flashCounter <= 4) {
this.parent.parent.radar.blobs.push({posX:this.posX, posY:this.posY, radarColor:this.radarColor});
} else if (this.flashCounter == 8) {
this.flashCounter = 0;
}
if (this.openedCounter == 36) {
this.openedCounter = 0;
}
}
this.parent.parent.parent.theTerminals[this.parent.level]["state" + this.ref] = this.state;
if (!FIRSTS.cave) {
dx = this.posX - this.parent.hero.posX;
dy = this.posY - this.parent.hero.posY;
distance = (dx * dx) + (dy * dy);
if (distance < 70000) {
this.game.hud.showHint("cave");
}
}
};
Terminal.prototype.draw = function () {
this.filters = new Array();
if (this.hitCounter == 1) {
this.filters.push(this.parent.filterHit);
}
this.MC.filters = this.filters;
};
Terminal.prototype.openMe = function () {
if (this.state == 1) {
this.MC.gotoAndPlay("caveOpened");
var _local3 = ABS(this.posX - this.parent.hero.posX);
var _local2 = ROUND((_local3 / (this.parent.width - 200)) * 100);
if (this.posX < this.parent.hero.posX) {
_local2 = -_local2;
}
this.game.sfx.play("caveOpened", 100, _local2);
}
this.state = 3;
this.hitCounter = (this.flashCounter = 0);
this.openedCounter = 1;
this.strength = 100;
};
Terminal.prototype.closeMe = function () {
this.hitCounter = (this.strength = 0);
this.state = 1;
this.MC.gotoAndPlay("caveClosed");
var _local7 = ABS(this.posX - this.parent.hero.posX);
var _local5 = ROUND((_local7 / (this.parent.width - 200)) * 100);
if (this.posX < this.parent.hero.posX) {
_local5 = -_local5;
}
this.game.sfx.play("caveClosed", 100, _local5);
var _local4 = this.parent.hero.posX - this.posX;
var _local3 = this.parent.hero.posY - this.posY;
var _local6 = MIN(SQRT((_local4 * _local4) + (_local3 * _local3)) - SCREENX, SCREENX) / SCREENX;
var _local2 = (this.impact * _local6) * 0.25;
var _local8 = ATAN2(_local3, _local4);
this.parent.hero.inertiaX = this.parent.hero.inertiaX - (COS(_local8) * _local2);
this.parent.hero.inertiaY = this.parent.hero.inertiaY + (SIN(_local8) * _local2);
_local8 = checkAngle(_local8 / RAD);
if (_local8 > this.parent.hero.angle) {
_local2 = _local2 * -1;
}
this.parent.hero.steer = this.parent.hero.steer + ((((_local2 * _local2) * _local2) * ((100 - this.parent.hero.size) / 100)) * 0.1);
this.parent.doExplosion(this.posX, this.posY, this.impact);
};
function Enemy(parent, depth, species, state, posX, posY, angle) {
this.parent = parent;
this.game = this.parent.parent.parent;
this.depth = depth;
this.species = species;
this.posX = posX;
this.posY = posY;
this.angle = checkAngleRange(angle);
this.lastAngle = "none";
this.state = state;
this.curAngle = (this.bounceX = (this.bounceY = (this.bounceCount = 0)));
this.active = true;
this.nextTarget = (this.myEnemy = "none");
this.checkPrey = 20;
if (this.state == BLOCK) {
this.radarColor = "block";
} else if (this.species <= 6) {
this.radarColor = "enemy";
} else {
this.radarColor = "mutant";
}
this.origRadarColor = this.radarColor;
if (this.state == ANGRY) {
this.radarColor = "mutant";
this.nextTarget = "hero";
}
this.age = (this.hitCounter = (this.lastHitCounter = (this.stateCounter = (this.movementCounter = (this.findPreyCounter = (this.angleCounter = 0))))));
if (this.depth % 2) {
this.age++;
}
this.setAttributes();
if (this.state == ANGRY) {
this.changeAngle = this.changeAngleAngry;
}
if (animsDone[this.species] != "done") {
composite(this.species, this.speciesName);
if ((this.species > 6) && (!local_data.data.CROSSBREADS.inArray(this.species))) {
local_data.data.CROSSBREADS[local_data.data.CROSSBREADS.length] = this.species;
local_data.flush();
if (local_data.data.CROSSBREADS.length == TOTAL_CROSSBREADS) {
saveAward("allcrossbreads");
}
}
}
if (this.state == BLOCK) {
this.MC = this.parent.MC.attachMovie("block", "enemy" + this.depth, this.depth + 80);
this.MC.gotoAndStop(this.species);
} else {
this.animCounter = (this.animMarker = (this.animTurned = 0));
this.animDirection = "left";
this.MC = this.parent.MC.createEmptyMovieClip("enemy" + this.depth, this.depth + 80);
this.animHolder = this.MC.createEmptyMovieClip("holder" + this.depth, 1);
this.animHolder.attachBitmap(cachedBitmaps[this.species][animSequences[this.species][this.animMarker]], 1, "auto", true);
this.animHolder._x = (-this.animHolder._width) / 2;
this.animHolder._y = (-this.animHolder._height) / 2;
}
if (this.species > 6) {
this.game.hud.showMessage("crossbread");
this.game.sfx.play("sonar", 100, 0);
}
this.draw();
}
NORMAL = 1;
STUNNED = 2;
ANGRY = 3;
BLOCK = 4;
DEAD = 5;
CAPTURED = 6;
Enemy.prototype.handle = function () {
if (this.state == DEAD) {
return(undefined);
}
if (this.parent.parent.level != this.game.currentLevel) {
return(undefined);
}
this.age++;
if (this.age == 60) {
this.MC.swapDepths(this.depth + 500);
}
if (!this.active) {
this.parent.freeEnemySlots.push(this.depth);
this.parent.parent.radar.doExplosion(this.posX, this.posY, this.depth);
this.MC.removeMovieClip();
this.state = DEAD;
return(undefined);
}
this.findPreyCounter++;
if ((this.findPreyCounter > this.checkPrey) && (this.state == BLOCK)) {
trace("AH");
}
if (((this.species <= 6) && (this.findPreyCounter == this.checkPrey)) && ((this.state == NORMAL) || (this.state == BLOCK))) {
this.getTarget();
}
this.animate();
this.move();
this.collide();
this.draw();
this.fire();
this.changeState();
this.parent.parent.radar.blobs.push({posX:this.posX, posY:this.posY, radarColor:this.radarColor});
};
Enemy.prototype.draw = function () {
this.MC._x = this.posX;
this.MC._y = this.posY;
if (this.state != BLOCK) {
if (this.curAngle < 0) {
this.curAngle = this.curAngle + 360;
} else if (this.curAngle > 360) {
this.curAngle = this.curAngle - 360;
}
var _local2 = this.curAngle - this.angle;
if (ABS(_local2) > 180) {
_local2 = (-(360 - ABS(_local2))) * SGN(_local2);
}
this.curAngle = this.curAngle - (_local2 * 0.25);
this.MC._rotation = this.curAngle;
}
if ((this.state == CAPTURED) && (this.parent.hero.xyscale != 100)) {
this.MC._xscale = (this.MC._yscale = this.parent.hero.xyscale);
}
if (this.MC._visible) {
this.filters = new Array();
if (this.hitCounter != this.lastHitCounter) {
this.filters.push(this.parent.filterHit);
} else if ((this.state == STUNNED) || (this.state == CAPTURED)) {
this.filters.push(this.parent.filterFreeze);
} else if ((this.state == ANGRY) && (this.angerTime != "forever")) {
this.filters.push(this.parent.filterAngry);
}
}
if (this.hitCounter != this.lastHitCounter) {
this.game.sfx.play(this.sound + "Hit", 100, 0);
}
this.lastHitCounter = this.hitCounter;
this.parent.doShadow(this);
this.MC.filters = this.filters;
};
Enemy.prototype.animate = function () {
if (((this.state != NORMAL) && (this.state != ANGRY)) && (this.state != STUNNED)) {
return(undefined);
}
if (!this.MC._visible) {
return(undefined);
}
this.animCounter++;
if (this.animCounter == animTimes[this.species][this.animMarker]) {
this.animCounter = 0;
this.animMarker++;
if (this.animMarker >= animSequences[this.species].length) {
this.animMarker = 0;
}
this.animHolder.attachBitmap(cachedBitmaps[this.species][animSequences[this.species][this.animMarker]], 1, "auto", true);
}
if (!this.animMaxTurn) {
return(undefined);
}
if (this.animDirection == "left") {
this.animTurned++;
this.MC._rotation++;
if (this.animTurned == this.animMaxTurn) {
this.animDirection = "right";
}
} else {
this.animTurned--;
this.MC._rotation--;
if (this.animTurned == (-this.animMaxTurn)) {
this.animDirection = "left";
}
}
};
Enemy.prototype.move = function () {
if (this.state == CAPTURED) {
this.angle = this.parent.hero.angle + 90;
var _local2 = newMomentum(this.parent.hero.angle, this.parent.hero.size - 10);
this.posX = this.parent.hero.posX + _local2.x;
this.posY = this.parent.hero.posY + _local2.y;
return(undefined);
}
if (this.behaviour == "side") {
this.moveSide();
} else if (this.behaviour == "cross") {
this.moveCross();
} else if (this.behaviour == "circle") {
this.moveCircle();
} else if (this.behaviour == "bursts") {
this.moveBursts();
} else if ((this.behaviour == "random") && (this.nextTarget != "none")) {
this.moveToTarget();
}
if (this.bounceCount) {
var _local3 = this.bounceCount / 10;
this.posX = this.posX + (_local3 * this.bounceX);
this.posY = this.posY + (_local3 * this.bounceY);
this.bounceCount--;
}
if (!this.speed) {
return(undefined);
}
if (this.state == STUNNED) {
this.posX = this.posX + (this.momentumX / 3);
this.posY = this.posY + (this.momentumY / 3);
} else {
this.posX = this.posX + this.momentumX;
this.posY = this.posY + this.momentumY;
}
if (this.state == ANGRY) {
this.posX = this.posX + this.momentumX;
this.posY = this.posY + this.momentumY;
}
this.checkEdges();
};
Enemy.prototype.moveSide = function () {
if (this.nextTarget != "none") {
if ((this.state == ANGRY) || (this.nextTarget != "hero")) {
this.moveToTarget();
} else {
this.parallelTarget();
}
return(undefined);
}
this.movementCounter++;
if ((this.movementCounter > this.moveFor) && (random(40) == 1)) {
this.movementCounter = 0;
if (this.angle % 90) {
var _local3 = random(4) + 1;
this.angle = _local3 * 90;
dir = checkAngleRange(this.angle + 90);
var _local2 = newMomentum(dir, this.speed);
this.momentumX = _local2.x;
this.momentumY = _local2.y;
}
if (this.angle % 180) {
this.momentumX = this.momentumX * -1;
} else {
this.momentumY = this.momentumY * -1;
}
}
};
Enemy.prototype.parallelTarget = function () {
var _local3 = this.parent.hero.posX;
var _local2 = this.parent.hero.posY;
if (this.angle % 180) {
if ((ABS(this.posY - _local2) > 20) && (((_local2 < this.posY) && (this.momentumY > 0)) || ((_local2 > this.posY) && (this.momentumY < 0)))) {
this.momentumY = this.momentumY * -1;
}
} else if ((ABS(this.posX - _local3) > 20) && (((_local3 < this.posX) && (this.momentumX > 0)) || ((_local3 > this.posX) && (this.momentumX < 0)))) {
this.momentumX = this.momentumX * -1;
}
};
Enemy.prototype.moveCross = function () {
this.movementCounter++;
if ((this.state == ANGRY) || ((this.nextTarget != "none") && (this.nextTarget != "hero"))) {
this.moveToTarget();
return(undefined);
}
if ((this.nextTarget == "hero") && (this.speed == this.sideSpeed)) {
this.movementCounter = this.moveFor;
}
if (this.movementCounter >= this.moveFor) {
this.movementCounter = 0;
if (this.nextTarget == "none") {
this.angle = random(360);
} else {
this.angle = this.targetAngle();
}
this.speed = this.crossSpeed;
var _local2 = newMomentum(this.angle, this.speed);
this.momentumX = _local2.x;
this.momentumY = _local2.y;
}
};
Enemy.prototype.moveBursts = function () {
if ((this.state == ANGRY) || ((this.nextTarget != "none") && (this.nextTarget != "hero"))) {
if (!this.speed) {
this.speed = this.origSpeed;
}
this.moveToTarget();
return(undefined);
}
if (this.scatter && (this.movementCounter == this.stopFor)) {
this.speed = this.origSpeed + 5;
this.angle = random(360);
var _local2 = newMomentum(this.angle, this.speed);
this.momentumX = _local2.x;
this.momentumY = _local2.y;
} else if ((((this.leader == false) && (this.followFish != "none")) && (this.withGroup == false)) && (!this.scatter)) {
this.movementCounter = 0;
this.moveToTarget();
return(undefined);
}
this.movementCounter++;
if (this.movementCounter < this.stopFor) {
this.speed = 0;
} else if (this.movementCounter == this.stopFor) {
if ((this.leader == false) && (this.followFish != "none")) {
this.angle = this.parent.enemies[this.followFish].angle;
} else if (this.nextTarget == "none") {
this.angle = random(360);
} else {
this.angle = this.targetAngle();
}
this.speed = this.origSpeed;
var _local2 = newMomentum(this.angle, this.speed);
this.momentumX = _local2.x;
this.momentumY = _local2.y;
} else if ((this.movementCounter >= (this.moveFor + this.stopFor)) && (!this.scatter)) {
this.movementCounter = 0;
} else if ((this.movementCounter > this.stopFor) && (!this.scatter)) {
this.moveToTarget();
}
};
Enemy.prototype.moveCircle = function () {
if (this.nextTarget != "none") {
this.moveToTarget();
return(undefined);
}
if (this.nextAngle != "none") {
this.angle = bestDirection(this.angle, this.nextAngle, this.turning);
if (this.angle == this.nextAngle) {
this.nextAngle = "none";
if ((((this.angle == 89) || (this.angle == 179)) || (this.angle == 269)) || (this.angle == 359)) {
this.angle++;
} else if (((this.angle == 91) || (this.angle == 181)) || (this.angle == 271)) {
this.angle--;
} else if (this.angle == 1) {
this.angle = 360;
}
}
var _local4 = newMomentum(this.angle, this.speed);
this.momentumX = _local4.x;
this.momentumY = _local4.y;
return(undefined);
}
var _local3 = (this.size2 + 150) * 2;
var _local2 = ((random(5) == 1) ? true : false);
if ((this.posX < _local3) && (this.angle == 270)) {
if (this.posY < this.parent.height2) {
this.nextAngle = (_local2 ? 91 : 225);
} else {
this.nextAngle = (_local2 ? 89 : 315);
}
} else if ((this.posX > (this.parent.width - _local3)) && (this.angle == 90)) {
if (this.posY < this.parent.height2) {
this.nextAngle = (_local2 ? 269 : 135);
} else {
this.nextAngle = (_local2 ? 271 : 45);
}
} else if ((this.posY < _local3) && (this.angle == 360)) {
if (this.posX < this.parent.width2) {
this.nextAngle = (_local2 ? 179 : 45);
} else {
this.nextAngle = (_local2 ? 181 : 315);
}
} else if ((this.posY > (this.parent.height - _local3)) && (this.angle == 180)) {
if (this.posX < this.parent.width2) {
this.nextAngle = (_local2 ? 1 : 135);
} else {
this.nextAngle = (_local2 ? 359 : 225);
}
}
};
Enemy.prototype.checkEdges = function () {
if (this.posX < (this.size2 + this.ajar)) {
this.posX = this.size2 + this.ajar;
if ((this.behaviour == "cross") || (this.behaviour == "circle")) {
this.edgeDecision("left");
return(undefined);
}
this.momentumX = this.momentumX * -1;
if (this.behaviour != "side") {
this.angle = ROUND(reverseTrig(this.momentumX, -this.momentumY));
}
return(undefined);
}
if (this.posX > ((this.parent.width - this.size2) - this.ajar)) {
this.posX = (this.parent.width - this.size2) - this.ajar;
if ((this.behaviour == "cross") || (this.behaviour == "circle")) {
this.edgeDecision("right");
return(undefined);
}
this.momentumX = this.momentumX * -1;
if (this.behaviour != "side") {
this.angle = ROUND(reverseTrig(this.momentumX, -this.momentumY));
}
return(undefined);
}
if (this.posY < (this.size2 + this.ajar)) {
this.posY = this.size2 + this.ajar;
if ((this.behaviour == "cross") || (this.behaviour == "circle")) {
this.edgeDecision("top");
return(undefined);
}
this.momentumY = this.momentumY * -1;
if (this.behaviour != "side") {
this.angle = ROUND(reverseTrig(this.momentumX, -this.momentumY));
}
return(undefined);
}
if (this.posY > ((this.parent.height - this.size2) - this.ajar)) {
this.posY = (this.parent.height - this.size2) - this.ajar;
if ((this.behaviour == "cross") || (this.behaviour == "circle")) {
this.edgeDecision("bottom");
return(undefined);
}
this.momentumY = this.momentumY * -1;
if (this.behaviour != "side") {
this.angle = ROUND(reverseTrig(this.momentumX, -this.momentumY));
}
return(undefined);
}
};
Enemy.prototype.edgeDecision = function (side) {
if (this.age < 30) {
return(undefined);
}
this.movementCounter = 0;
var _local2 = 0;
if (side == "left") {
_local2 = ((this.angle > 270) ? 360 : 180);
} else if (side == "right") {
_local2 = ((this.angle <= 90) ? 360 : 180);
} else if (side == "top") {
_local2 = ((this.angle <= 90) ? 90 : 270);
} else if (side == "bottom") {
if ((this.angle > 90) && (this.angle <= 180)) {
_local2 = 90;
} else {
_local2 = 270;
}
}
if (this.behaviour == "cross") {
this.speed = this.sideSpeed;
this.angle = _local2;
var _local3 = newMomentum(this.angle, this.speed);
this.momentumX = _local3.x;
this.momentumY = _local3.y;
this.movementCounter++;
} else {
this.nextAngle = _local2;
}
};
Enemy.prototype.fire = function () {
if ((((!this.fireFreq) || (this.state == STUNNED)) || (this.state >= BLOCK)) || (this.age < 50)) {
return(undefined);
}
this.fireCounter++;
if (this.fireCounter == this.fireFreq) {
this.fireCounter = 0;
this.parent.newShot(this.weapon, this.posX, this.posY, 0, this.angle);
}
};
Enemy.prototype.moveToTarget = function () {
if (((this.leader == false) && (this.followFish != "none")) || (this.nextTarget != "none")) {
this.angleCounter++;
if (this.angleCounter == this.changeAngle) {
this.angleCounter = 0;
if (this.nextTarget != "none") {
var _local5 = this.targetAngle();
} else {
var _local3 = this.posX - this.parent.enemies[this.followFish].posX;
var _local2 = this.posY - this.parent.enemies[this.followFish].posY;
var _local6 = (_local3 * _local3) + (_local2 * _local2);
if (_local6 < 30000) {
this.withGroup = true;
this.movementCounter = this.parent.enemies[this.followFish].movementCounter - 1;
return(undefined);
}
this.withGroup = false;
var _local5 = checkAngleRange(ROUND((ATAN2(_local2, _local3) / RAD) + 270));
}
if (this.state == BLOCK) {
this.angle = _local5;
} else {
this.angle = bestDirection(this.angle, _local5, this.turning);
}
var _local4 = newMomentum(this.angle, this.speed);
this.momentumX = _local4.x;
this.momentumY = _local4.y;
}
}
};
Enemy.prototype.targetAngle = function () {
if (this.nextTarget == "hero") {
var _local3 = this.posX - this.parent.hero.posX;
var _local2 = this.posY - this.parent.hero.posY;
} else {
var _local3 = this.posX - this.parent.enemies[this.nextTarget].posX;
var _local2 = this.posY - this.parent.enemies[this.nextTarget].posY;
}
return(checkAngleRange(ROUND((ATAN2(_local2, _local3) / RAD) + 270)));
};
Enemy.prototype.getTarget = function () {
this.findPreyCounter = 0;
if (((this.leader == false) && (this.followFish != "none")) && (this.state != BLOCK)) {
this.nextTarget = this.parent.enemies[this.followFish].nextTarget;
if (this.nextTarget == "none") {
this.radarColor = this.origRadarColor;
} else {
this.radarColor = "mutant";
}
if ((!this.scatter) && (this.parent.enemies[this.followFish].scatter)) {
this.scatter = true;
this.movementCounter = this.stopFor;
} else if (this.scatter && (!this.parent.enemies[this.followFish].scatter)) {
this.scatter = false;
}
return(undefined);
}
var _local7 = false;
var _local6 = "none";
this.nextTarget = "none";
if ((this.species != 1) || (this.state == BLOCK)) {
if ((this.species == 4) && (this.state == NORMAL)) {
var _local8 = this.scatter;
this.scatter = false;
}
var _local5 = 1000000 /* 0x0F4240 */;
var _local3 = (dy = (distance = 0));
for (var _local9 in this.parent.enemies) {
var _local4 = false;
var _local2 = this.parent.enemies[_local9];
if (((_local2.species == (this.species - 1)) && (_local2.state == NORMAL)) && (this.state == NORMAL)) {
_local7 = true;
_local4 = true;
} else if (((this.state == BLOCK) && (_local2.state == BLOCK)) && (this.depth != _local2.depth)) {
_local4 = true;
if ((this.species != _local2.species) && (!FIRSTS.crossbread)) {
this.game.hud.showHint("crossbread");
}
}
if (_local4 && ((_local2.myEnemy == "none") || (_local2.myEnemy == this.depth))) {
_local3 = this.posX - _local2.posX;
dy = this.posY - _local2.posY;
distance = (_local3 * _local3) + (dy * dy);
if (distance < _local5) {
_local5 = distance;
_local6 = _local9;
}
}
if (((((this.species == 4) && (this.state == NORMAL)) && (!this.scatter)) && (_local2.species == 5)) && (_local2.active)) {
_local3 = this.posX - _local2.posX;
dy = this.posY - _local2.posY;
distance = (_local3 * _local3) + (dy * dy);
if (distance < _local5) {
this.scatter = true;
if (!_local8) {
this.movementCounter = this.stopFor;
}
}
}
}
}
if ((!_local7) && (this.state != BLOCK)) {
var _local3 = this.posX - this.parent.hero.posX;
dy = this.posY - this.parent.hero.posY;
distance = (_local3 * _local3) + (dy * dy);
if (distance < this.range) {
_local7 = true;
_local6 = "hero";
}
}
if (this.state != BLOCK) {
this.radarColor = this.origRadarColor;
}
if (_local6 != "none") {
if ((this.nextTarget != "none") && (this.nextTarget != "hero")) {
this.parent.enemies[this.nextTarget].myEnemy = "none";
}
this.nextTarget = _local6;
if (this.nextTarget != "hero") {
this.parent.enemies[this.nextTarget].myEnemy = this.depth;
}
this.angleCounter = this.changeAngle - 1;
if ((this.behaviour == "bursts") && (this.movementCounter < this.stopFor)) {
this.movementCounter = this.stopFor - 1;
}
if (this.state != BLOCK) {
this.radarColor = "mutant";
}
}
};
Enemy.prototype.collide = function () {
if ((((this.age < 20) || (!this.active)) || (this.state == CAPTURED)) || (this.age % 2)) {
return(undefined);
}
if (this.MC._visible) {
var _local8 = this.parent.hero;
if ((this.state == BLOCK) && (this.stateCounter < 10)) {
return(undefined);
}
if ((this.state == STUNNED) && ((_local8.upCounter < 5) || (_local8.captured != "none"))) {
return(undefined);
}
var _local6 = this.posX - _local8.posX;
var _local5 = this.posY - _local8.posY;
var _local7 = (_local6 * _local6) + (_local5 * _local5);
var _local3 = (this.size + _local8.size) / 2;
if ((_local3 * _local3) >= _local7) {
if (this.state == STUNNED) {
this.stateCounter = 0;
this.state = CAPTURED;
_local8.captured = this.depth;
this.radarColor = this.origRadarColor;
this.game.sfx.play("clamping", 100, 0);
if (!FIRSTS.collected) {
this.game.hud.showHint("collected");
}
} else {
this.bounceX = _local8.inertiaX * 2;
this.bounceY = (-_local8.inertiaY) * 2;
this.bounceCount = 10;
var _local9 = SQRT(_local7);
_local6 = _local6 / _local9;
_local5 = _local5 / _local9;
_local9 = _local9 - _local3;
this.posX = this.posX - (_local6 * _local9);
this.posY = this.posY - (_local5 * _local9);
if (_local8.hitCounter || (_local8.age < 20)) {
return(undefined);
}
this.game.timer = this.game.timer - this.damage;
_local8.hitCounter = 1;
if ((this.state == ANGRY) && (this.angerTime != "forever")) {
this.state = NORMAL;
this.radarColor = this.origRadarColor;
this.stateCounter = (this.findPreyCounter = 0);
this.changeAngle = this.changeAngleNormal;
if (this.species <= 6) {
this.nextTarget = "none";
}
} else if (this.state == BLOCK) {
this.game.sfx.play("click", 100, 0);
this.stateCounter = 0;
_local8.hitCounter = 5;
}
}
}
}
if (this.state == STUNNED) {
return(undefined);
}
if ((this.state == BLOCK) || (((this.leader == false) && (this.followFish != "none")) && (this.movementCounter > this.stopFor))) {
for (var _local11 in this.parent.enemies) {
var _local10 = this.parent.enemies[_local11];
if ((_local10.depth != this.depth) && (_local10.state == this.state)) {
var _local6 = this.posX - _local10.posX;
var _local5 = this.posY - _local10.posY;
var _local7 = (_local6 * _local6) + (_local5 * _local5);
var _local3 = this.size + _local10.size;
if ((_local3 * _local3) >= _local7) {
if (this.state == BLOCK) {
if ((this.parent.enemies.length - 1) < this.parent.maxEnemies) {
this.active = false;
_local10.active = false;
this.handle();
_local10.handle();
this.parent.newEnemy(this.getNewSpecies(this.species, _local10.species), 3, this.posX, this.posY, this.angle);
}
} else if (random(20) == 1) {
this.angle = this.angle + (random(40) - 20);
var _local4 = newMomentum(this.angle, this.speed + 2);
this.momentumX = _local4.x;
this.momentumY = _local4.y;
}
}
}
}
if (this.state == BLOCK) {
return(undefined);
}
}
if (((this.nextTarget != "none") && (this.nextTarget != "hero")) && (this.parent.enemies[this.nextTarget].active)) {
var _local10 = this.parent.enemies[this.nextTarget];
var _local6 = this.posX - _local10.posX;
var _local5 = this.posY - _local10.posY;
var _local3 = this.size + _local10.size;
var _local7 = (_local6 * _local6) + (_local5 * _local5);
if ((_local3 * _local3) >= _local7) {
_local10.active = false;
_local10.doExplosion();
if (!FIRSTS.feeding) {
this.game.hud.showHint("feeding");
}
this.nextTarget = "none";
this.game.feedCount++;
return(undefined);
}
}
if (this.age < 50) {
return(undefined);
}
for (var _local11 in this.parent.terminals) {
var _local2 = this.parent.terminals[_local11];
if ((_local2.state < 3) && (_local2.infection == this.species)) {
var _local6 = this.posX - _local2.posX;
var _local5 = this.posY - _local2.posY;
var _local7 = (_local6 * _local6) + (_local5 * _local5);
var _local3 = this.size + _local2.size;
if ((_local3 * _local3) >= _local7) {
if (_local2.state == 1) {
this.active = false;
if (this.leader) {
this.parent.newLeader();
}
}
_local2.openMe();
}
}
}
};
Enemy.prototype.changeState = function () {
if (this.state == CAPTURED) {
return(undefined);
}
if (this.state == BLOCK) {
this.stateCounter++;
}
if (this.state == STUNNED) {
this.stateCounter++;
if (this.stateCounter == this.recoverTime) {
this.radarColor = "mutant";
this.state = ANGRY;
this.stateCounter = (this.hitCounter = (this.findPreyCounter = 0));
if ((this.nextTarget != "none") && (this.nextTarget != "hero")) {
this.parent.enemies[this.nextTarget].myEnemy = "none";
}
this.nextTarget = "hero";
this.changeAngle = this.changeAngleAngry;
this.angleCounter = this.changeAngle - 1;
return(undefined);
}
if (this.hitCounter && (this.stateCounter >= 10)) {
this.hitCounter = 0;
this.state = BLOCK;
this.radarColor = "block";
this.findPreyCounter = 0;
this.behaviour = "random";
this.damage = 1;
this.myEnemy = "none";
if ((this.nextTarget != "none") && (this.nextTarget != "hero")) {
this.parent.enemies[this.nextTarget].myEnemy = "none";
}
this.nextTarget = "none";
this.impactHero();
if (!this.speed) {
this.speed = this.origSpeed;
}
this.speed = this.speed / 2;
this.angle = random(360);
var _local2 = newMomentum(this.angle, this.speed);
this.momentumX = _local2.x;
this.momentumY = _local2.y;
if (this.species > 6) {
if (this.species == 7) {
this.species = 2;
} else if ((this.species == 8) || (this.species == 10)) {
this.species = 3;
} else if (((this.species == 9) || (this.species == 12)) || (this.species == 15)) {
this.species = 4;
} else if ((((this.species == 11) || (this.species == 14)) || (this.species == 17)) || (this.species == 19)) {
this.species = 5;
} else if (((((this.species == 13) || (this.species == 16)) || (this.species == 18)) || (this.species == 20)) || (this.species == 21)) {
this.species = 6;
}
}
this.MC.removeMovieClip();
this.MC = this.parent.MC.attachMovie("block", "enemy" + this.depth, this.depth + 500);
this.MC.gotoAndStop(this.species);
this.doExplosion();
return(undefined);
}
}
if ((this.hitCounter == this.getStunned) && ((this.state == NORMAL) || (this.state == ANGRY))) {
this.hitCounter = 0;
this.state = STUNNED;
if ((!FIRSTS.stunned) && (this.parent.level < 5)) {
this.game.hud.showHint("stunned");
} else if ((!FIRSTS.stunned2) && (this.parent.level >= 5)) {
this.game.hud.showHint("stunned2");
}
if (this.leader) {
this.parent.newLeader();
}
}
if ((this.hitCounter >= 1) && (this.state == BLOCK)) {
this.active = false;
this.parent.doRipple(this.posX, this.posY, true);
this.game.sfx.play("bubble", 100, 0);
if ((this.nextTarget != "none") && (this.nextTarget != "hero")) {
this.parent.enemies[this.nextTarget].myEnemy = "none";
}
}
};
Enemy.prototype.drop = function () {
this.state = NORMAL;
this.stateCounter = (this.findPreyCounter = (this.age = 0));
if (this.behaviour == "side") {
var _local3 = checkAngleRange(this.angle + 90);
var _local2 = newMomentum(_local3, this.speed);
} else {
var _local2 = newMomentum(this.angle, this.speed);
}
this.momentumX = _local2.x;
this.momentumY = _local2.y;
this.game.sfx.play("clamping", 100, 0);
};
Enemy.prototype.setAttributes = function () {
this.leader = false;
this.followFish = "none";
this.ajar = 50;
this.turning = 25;
this.impact = 9;
this.changeAngleAngry = 2;
this.range = 50000;
if (this.species == 1) {
this.speciesName = "snake";
this.sound = "snake";
this.behaviour = "random";
this.size = 20;
this.speed = 4;
this.fireFreq = 0;
this.getStunned = 1;
this.recoverTime = 100;
this.changeAngle = 20;
this.damage = 5;
this.impact = 7;
this.range = 50000;
} else if (this.species == 2) {
this.speciesName = "crab";
this.sound = "crab";
this.behaviour = "side";
this.size = 40;
this.speed = 5;
this.fireFreq = 40;
this.weapon = 8;
this.getStunned = 2;
this.recoverTime = 90;
this.changeAngle = 30;
this.damage = 8;
this.range = 80000 /* 0x013880 */;
} else if ((this.species == 3) || (this.species == 7)) {
if (this.species == 3) {
this.speciesName = "lobster";
this.sound = "lobster";
this.behaviour = "cross";
this.animMaxTurn = 18;
this.size = 45;
this.range = 100000 /* 0x0186A0 */;
} else {
this.speciesName = "snakecrab";
this.sound = "crab";
this.size = 35;
}
this.speed = 6;
this.fireFreq = 0;
this.getStunned = 3;
this.recoverTime = 80;
this.changeAngle = 20;
this.damage = 10;
} else if ((this.species == 4) || (this.species == 8)) {
if (this.species == 4) {
this.speciesName = "fangfish";
this.sound = "fangfish";
this.behaviour = "bursts";
this.followFish = this.parent.fishLeader;
} else {
this.speciesName = "snakelobster";
this.sound = "lobster";
this.animMaxTurn = 18;
}
this.size = 40;
this.speed = 7;
this.fireFreq = 0;
this.getStunned = 4;
this.recoverTime = 70;
this.changeAngle = 20;
this.damage = 15;
this.range = 300000 /* 0x0493E0 */;
} else if (((this.species == 5) || (this.species == 9)) || (this.species == 10)) {
this.speed = 8;
this.size = 40;
if (this.species == 5) {
this.speciesName = "shark";
this.sound = "shark";
this.behaviour = "circle";
this.speed = 9;
this.size = 60;
} else if (this.species == 9) {
this.speciesName = "snakefangfish";
this.sound = "fangfish";
} else {
this.speciesName = "crablobster";
this.sound = "lobster";
}
this.fireFreq = 0;
this.getStunned = 5;
this.recoverTime = 60;
this.changeAngle = 15;
this.damage = 17;
this.range = 160000 /* 0x027100 */;
this.impact = 11;
} else if (((this.species == 6) || (this.species == 11)) || (this.species == 12)) {
if (this.species == 6) {
this.speciesName = "squid";
this.sound = "squid";
this.behaviour = "bursts";
this.size = 70;
} else if (this.species == 11) {
this.speciesName = "snakeshark";
this.sound = "shark";
this.size = 50;
} else {
this.speciesName = "crabfangfish";
this.sound = "fangfish";
this.size = 35;
}
this.speed = 9;
this.fireFreq = 0;
this.getStunned = 9;
this.recoverTime = 50;
this.changeAngle = 12;
this.damage = 20;
this.impact = 12;
} else {
if (this.species == 13) {
this.speciesName = "snakesquid";
this.sound = "squid";
this.size = 70;
} else if (this.species == 14) {
this.speciesName = "crabshark";
this.sound = "shark";
this.size = 50;
} else if (this.species == 15) {
this.speciesName = "lobsterfangfish";
this.sound = "fangfish";
this.size = 40;
} else if (this.species == 16) {
this.speciesName = "crabsquid";
this.sound = "squid";
this.size = 70;
} else if (this.species == 17) {
this.speciesName = "lobstershark";
this.sound = "shark";
this.size = 50;
} else if (this.species == 18) {
this.speciesName = "lobstersquid";
this.sound = "squid";
this.size = 50;
} else if (this.species == 19) {
this.speciesName = "fangfishshark";
this.sound = "shark";
this.size = 50;
} else if (this.species == 20) {
this.speciesName = "fangfishsquid";
this.sound = "squid";
this.size = 70;
} else {
this.speciesName = "sharksquid";
this.sound = "squid";
this.size = 70;
}
this.speed = 9;
this.fireFreq = 0;
this.getStunned = 10;
this.recoverTime = 50;
this.damage = 25;
this.impact = 12;
}
this.size2 = this.size / 2;
this.changeAngleNormal = this.changeAngle;
if (this.fireFreq) {
this.fireCounter = random(this.fireFreq);
}
if (this.species > 6) {
this.behaviour = "random";
this.nextTarget = "hero";
}
if (this.behaviour == "circle") {
this.changeAngle = 4;
this.nextAngle = "none";
this.turning = 10;
} else if (this.behaviour == "bursts") {
this.movementCounter = random(this.stopFor);
this.origSpeed = this.speed;
this.scatter = false;
if (this.followFish != "none") {
this.withGroup = false;
this.stopFor = 100;
this.moveFor = 200;
this.changeAngle = 10;
} else {
this.stopFor = 100;
this.moveFor = 150;
this.speed = 15;
this.range = 400000 /* 0x061A80 */;
}
} else if (this.behaviour == "cross") {
this.moveFor = 200;
this.sideSpeed = this.speed;
this.crossSpeed = this.speed + 4;
this.speed = this.crossSpeed;
} else if (this.behaviour == "random") {
this.turning = 160;
}
if (this.behaviour == "side") {
this.moveFor = 40;
var _local3 = checkAngleRange(this.angle + 90);
var _local2 = newMomentum(_local3, this.speed);
} else {
var _local2 = newMomentum(this.angle, this.speed);
}
this.momentumX = _local2.x;
this.momentumY = _local2.y;
};
Enemy.prototype.getNewSpecies = function (species1, species2) {
var _local2 = 0;
if (species1 == species2) {
_local2 = species1;
} else if ((species1 == 1) && (species2 == 2)) {
_local2 = 7;
} else if ((species1 == 1) && (species2 == 3)) {
_local2 = 8;
} else if ((species1 == 1) && (species2 == 4)) {
_local2 = 9;
} else if ((species1 == 2) && (species2 == 3)) {
_local2 = 10;
} else if ((species1 == 1) && (species2 == 5)) {
_local2 = 11;
} else if ((species1 == 2) && (species2 == 4)) {
_local2 = 12;
} else if ((species1 == 1) && (species2 == 6)) {
_local2 = 13;
} else if ((species1 == 2) && (species2 == 5)) {
_local2 = 14;
} else if ((species1 == 3) && (species2 == 4)) {
_local2 = 15;
} else if ((species1 == 2) && (species2 == 6)) {
_local2 = 16;
} else if ((species1 == 3) && (species2 == 5)) {
_local2 = 17;
} else if ((species1 == 3) && (species2 == 6)) {
_local2 = 18;
} else if ((species1 == 4) && (species2 == 5)) {
_local2 = 19;
} else if ((species1 == 4) && (species2 == 6)) {
_local2 = 20;
} else if ((species1 == 5) && (species2 == 6)) {
_local2 = 21;
}
if (_local2 == 0) {
_local2 = this.getNewSpecies(species2, species1);
}
return(_local2);
};
Enemy.prototype.impactHero = function () {
var _local4 = this.parent.hero.posX - this.posX;
var _local3 = this.parent.hero.posY - this.posY;
var _local5 = MIN(SQRT((_local4 * _local4) + (_local3 * _local3)) - SCREENX, SCREENX) / SCREENX;
var _local2 = this.impact * _local5;
var _local6 = ATAN2(_local3, _local4);
this.parent.hero.inertiaX = this.parent.hero.inertiaX - (COS(_local6) * _local2);
this.parent.hero.inertiaY = this.parent.hero.inertiaY + (SIN(_local6) * _local2);
_local6 = checkAngle(_local6 / RAD);
if (_local6 > this.parent.hero.angle) {
_local2 = _local2 * -1;
}
this.parent.hero.steer = this.parent.hero.steer + ((((_local2 * _local2) * _local2) * ((100 - this.parent.hero.size) / 100)) * 0.1);
};
Enemy.prototype.doExplosion = function () {
this.game.sfx.play(this.sound + "Destroyed", 100, 0);
var _local4 = this.parent.MC.attachMovie("cloudExplosion", "cloudExplosion", 520 + this.depth);
_local4._x = this.posX;
_local4._y = this.posY;
_local4._xscale = (_local4._yscale = 50);
var _local3 = blocks[this.species].length;
while (_local3-- , _local3 > -1) {
var _local2 = _local4.attachMovie("blockfly", "blockfly", _local3);
_local2._rotation = random(360);
_local2._xscale = (_local2._yscale = 200);
_local2.block.gotoAndStop(blocks[this.species][_local3]);
}
this.parent.doExplosion(this.posX, this.posY, this.impact);
};
function Hero(parent, posX, posY, angle, xyscale) {
this.parent = parent;
this.game = this.parent.parent.parent;
this.posX = posX;
this.posY = posY;
this.angle = angle;
this.xyscale = xyscale;
this.active = true;
this.xyscale = limit(this.xyscale, 60, 150);
if (!CHEATMODE) {
this.type = this.game.completeLevels / this.game.levelCutoff;
if (ROUND(this.type) == this.type) {
this.type++;
} else {
this.type = CEIL(this.type);
}
} else {
this.type = CEIL(this.parent.level / this.game.levelCutoff);
}
this.MC = this.parent.MC.attachMovie("sub", "sub", 998);
this.MC.gotoAndStop(this.type);
this.MC.sub.gotoAndStop(1);
this.MC.hitZone._visible = false;
if (this.type == 5) {
saveAward("allsubs");
}
this.control = new Control(this, 37, 39, 38, 40, 32);
this.dx = (this.dy = (this.speed = (this.inertiaX = (this.inertiaY = (this.turn = (this.steer = 0))))));
this.brake = -0.75;
this.friction = 0.95;
this.radarColor = "hero";
this.captured = "none";
this.hitCounter = (this.age = (this.upCounter = (this.downCounter = (this.nextBoatCounter = 0))));
this.resetHitCounter = 20;
this.diveAnim = 25;
this.nextBoatAnim = 11;
this.setAttributes();
this.levelDirection = "none";
this.wasNear = true;
this.isChangingLevel = (this.allowControl = false);
}
Hero.prototype.handle = function () {
this.age++;
if (this.isChangingLevel) {
this.endLevelActions();
return(undefined);
}
if (!this.active) {
return(undefined);
}
if (this.nextBoatCounter) {
this.nextBoatCounter++;
}
if (this.nextBoatCounter == this.nextBoatAnim) {
this.type++;
this.MC.gotoAndStop(this.type);
this.setAttributes();
}
this.allowControl = true;
if (this.allowControl) {
this.control.handle();
this.useControls();
this.fire();
}
this.move();
this.draw();
if (this.hitCounter) {
if (this.hitCounter == 1) {
var _local2 = random(3) + 1;
this.game.sfx.play("heroHit" + _local2, 80, 0);
}
this.hitCounter++;
if (this.hitCounter == this.resetHitCounter) {
this.hitCounter = 0;
}
}
};
Hero.prototype.useControls = function () {
this.speed = 0;
this.steer = this.steer * 0.85;
if (this.control.DOWN) {
this.downCounter++;
this.speed = this.brake;
} else {
this.downCounter = 0;
}
if (this.control.UP) {
this.upCounter++;
this.speed = this.accelerate;
} else {
this.upCounter = 0;
}
if (this.control.RIGHT) {
this.steer = this.steer + this.turning;
this.turn++;
} else if (this.control.LEFT) {
this.steer = this.steer - this.turning;
this.turn--;
} else if (this.age % 2) {
if (this.turn > 0) {
this.turn--;
} else if (this.turn < 0) {
this.turn++;
}
}
this.turn = limit(this.turn, -3, 3);
var _local2 = this.turn + 1;
if (_local2 < 1) {
_local2 = _local2 + 8;
}
this.MC.sub.gotoAndStop(_local2);
this.angle = this.angle + this.steer;
this.angle = this.angle + (SIN((((this.age % 100) / 100) * PI) * 2) * 1);
this.angle = checkAngleRange(this.angle);
if (this.type == 1) {
this.upCounter = 0;
}
if ((this.captured != "none") && (this.downCounter > 10)) {
this.parent.enemies[this.captured - 1].drop();
this.captured = "none";
}
if (this.game.completeLevels && (this.age > this.diveAnim)) {
if ((this.speed <= (this.accelerate + 1)) && (this.MC.hitZone.hitTest(this.parent.lifelineMC.hitme))) {
if (this.wasNear) {
this.wasNear = false;
this.parent.lifelineMC.gotoAndStop("active");
if (this.parent.level == 1) {
this.parent.lifelineMC.upText._visible = false;
} else if (this.parent.level == this.game.totalLevels) {
this.parent.lifelineMC.downText._visible = false;
}
}
if (KEY_DOWN(65) || (KEY_DOWN(49))) {
this.changeLevel("up");
} else if (KEY_DOWN(90) || (KEY_DOWN(50))) {
this.changeLevel("down");
}
} else if ((!this.wasNear) && (this.MC.hitZone.hitTest(this.parent.lifelineMC.hitme2))) {
this.parent.lifelineMC.gotoAndPlay("over");
this.wasNear = true;
} else if (!this.MC.hitZone.hitTest(this.parent.lifelineMC.hitme2)) {
this.parent.lifelineMC.gotoAndStop("off");
this.wasNear = false;
}
}
};
Hero.prototype.move = function () {
this.inertiaX = this.inertiaX * this.friction;
this.inertiaY = this.inertiaY * this.friction;
this.dx = this.speed * SIN(this.angle * RAD);
this.dy = this.speed * COS(this.angle * RAD);
this.inertiaX = this.inertiaX + this.dx;
this.inertiaY = this.inertiaY + this.dy;
this.posX = this.posX + this.inertiaX;
this.posY = this.posY - this.inertiaY;
this.posX = this.posX + (SIN(this.age / 10) * 0.5);
this.posY = this.posY + COS(this.age / 22);
this.realspeed = SQRT((this.inertiaX * this.inertiaX) + (this.inertiaY * this.inertiaY));
this.posX = limit(this.posX, this.size2, this.parent.width - this.size2);
this.posY = limit(this.posY, this.size2, this.parent.height - this.size2);
};
Hero.prototype.fire = function () {
if (this.captured != "none") {
return(undefined);
}
var _local2 = false;
var _local3 = this.weapon;
if ((this.buildUp && (this.fireCount)) && (!this.control.FIRE)) {
if (this.fireCount >= this.fireAnim) {
_local3 = this.weapon2;
}
this.fireCount = 0;
_local2 = true;
this.MC.sub.buildUp.gotoAndStop(1);
}
if (this.fireCount) {
this.fireCount++;
if ((this.fireCount == this.firePause) && (!this.buildUp)) {
this.fireCount = 0;
}
}
if (this.bigCount) {
this.bigCount++;
if (this.bigCount == this.bigPause) {
this.bigCount = 0;
}
}
if (!_local2) {
if (this.control.FIRE && (!this.fireCount)) {
this.fireCount = 1;
if (this.buildUp) {
this.MC.sub.buildUp.gotoAndPlay(2);
} else {
_local2 = true;
if (this.bigCount) {
_local3 = this.weapon2;
} else if (this.backup) {
this.bigCount = 1;
}
}
}
}
if (_local2) {
var _local4 = newMomentum(this.angle, this.size / 2);
var _local5 = this.posX + _local4.x;
var _local6 = this.posY + _local4.y;
this.parent.newShot(_local3, _local5, _local6, Math.round(this.speed), this.angle);
}
};
Hero.prototype.draw = function () {
this.MC._x = this.posX;
this.MC._y = this.posY;
this.MC._rotation = this.angle;
if (this.xyscale < 100) {
this.xyscale = this.xyscale * 1.05;
this.MC._xscale = (this.MC._yscale = this.xyscale);
} else if (this.xyscale > 100) {
this.xyscale = this.xyscale * 0.952380952380952;
this.MC._xscale = (this.MC._yscale = this.xyscale);
}
this.parent.parent.radar.blobs.push({posX:this.posX, posY:this.posY, radarColor:this.radarColor});
this.filters = new Array();
if (this.hitCounter) {
this.parent.filterHit.alpha = 1 - (this.hitCounter / this.resetHitCounter);
this.filters.push(this.parent.filterHit);
}
if (this.control.UP || (random(20) == 1)) {
this.parent.doBubble(this.posX - ((SIN(this.angle * RAD) * this.size) / 2), this.posY + ((COS(this.angle * RAD) * this.size) / 2));
}
if (this.control.UP) {
this.parent.doRipple(this.posX - ((SIN(this.angle * RAD) * this.size) / 2), this.posY + ((COS(this.angle * RAD) * this.size) / 2));
}
this.parent.doShadow(this);
this.MC.filters = this.filters;
this.parent.filterHit.alpha = 1;
};
Hero.prototype.changeLevel = function (dir) {
var _local2 = this.game.checkLevelChange(dir);
if (!_local2) {
return(undefined);
}
this.levelDirection = dir;
this.isChangingLevel = true;
this.age = 0;
SUBANGLE = this.angle;
SUBPOSY = this.posX;
SUBPOSY = this.posY;
this.parent.diveAnim();
};
Hero.prototype.endLevelActions = function () {
this.xyscale = ((this.levelDirection == "up") ? (this.xyscale * 1.025) : (this.xyscale * 0.975609756097561));
this.MC._xscale = (this.MC._yscale = (SUBSCALE = this.xyscale));
this.parent.parent.radar.blobs.push({posX:this.posX, posY:this.posY, radarColor:this.radarColor});
if (this.age == this.diveAnim) {
this.game.changeLevel();
}
};
Hero.prototype.nextBoat = function () {
this.MC.bang.gotoAndPlay(2);
this.MC.creation.gotoAndPlay(2);
this.nextBoatCounter = 1;
this.game.sfx.play("newsub", 100, 0);
};
Hero.prototype.setAttributes = function () {
this.firePause = 8;
this.fireAnim = (this.bigCount = (this.fireCount = 0));
this.reload = (this.buildUp = (this.backup = false));
this.weapon = this.type;
if (this.type == 1) {
this.size = 40;
this.turning = 1.7;
this.accelerate = 1.3;
} else if (this.type == 2) {
this.size = 50;
this.turning = 1.7;
this.accelerate = 1.4;
this.firePause = 5;
} else if (this.type == 3) {
this.size = 60;
this.turning = 1.8;
this.accelerate = 1.6;
this.buildUp = true;
this.weapon2 = 6;
this.firePause = 35;
this.fireAnim = 10;
} else if (this.type == 4) {
this.size = 70;
this.turning = 1.9;
this.accelerate = 1.8;
this.firePause = 20;
} else if (this.type == 5) {
this.size = 70;
this.turning = 2;
this.accelerate = 2;
this.backup = true;
this.weapon2 = 7;
this.bigPause = 30;
}
this.size2 = this.size / 2;
};
Hero.prototype.doExplosion = function () {
this.active = false;
this.MC.removeMovieClip();
this.game.sfx.play("caveClosed", 100, 0);
var _local2 = this.parent.MC.attachMovie("shipExplosion", "shipExplosion", 998);
_local2._x = this.posX;
_local2._y = this.posY;
this.parent.doExplosion(this.posX, this.posY, 50);
};
function Arena(parent) {
this.doDisplacement = true;
this.parent = parent;
this.game = this.parent.parent;
this.level = this.parent.level;
this.bgColor = 2147549183;
this.bitmap = new flash.display.BitmapData(SCREENX, SCREENY, true, this.bgColor);
if (this.doDisplacement) {
this.displacement = this.bitmap.clone();
}
this.bounds = new flash.geom.Rectangle(0, 0, SCREENX, SCREENY);
this.rect = new flash.geom.Rectangle(0, 0, SCREENX, SCREENY);
this.origin = new flash.geom.Point(0, 0);
this.filterDS = new flash.filters.DropShadowFilter(50, 90, 0, 0.5, 8, 8, 1, 1);
this.filterHit = new flash.filters.GlowFilter(16777215, 1, 32, 32, 4, 1, true);
this.filterFreeze = new flash.filters.GlowFilter(8441087, 1, 8, 8, 2, 1, true);
this.filterAngry = new flash.filters.GlowFilter(16711680, 1, 16, 16, 2, 1, true);
this.filterOutline = new flash.filters.GlowFilter(0, 4, 4, 1, 4, 1);
this.createBGs();
this.createEffects();
if (SUBPOSX == "first") {
SUBPOSX = this.width2;
}
if (SUBPOSY == "first") {
SUBPOSY = this.height2;
}
this.hero = new Hero(this, SUBPOSX, SUBPOSY, SUBANGLE, SUBSCALE);
this.maxEnemies = 12;
this.fishLeader = (this.giant = "none");
this.enemies = new Array();
this.terminals = new Array();
this.freeEnemySlots = new Array();
this.shots = new Array();
this.currentShot = -1;
this.maxShots = 30;
if (this.game.completeLevels) {
this.showLifeline();
} else {
this.MCC.lifeline._visible = false;
this.MCB.lifeline._visible = false;
}
this.game.sfx.play("music_ingame_start", 100, 0);
this.count = (this.flashCounter = (this.totalEnemies = 0));
}
Arena.prototype.handle = function () {
this.count++;
this.hero.handle();
this.treasure.handle();
if (this.giant != "none") {
this.giant.handle();
}
var _local4 = this.shots.length;
var _local2 = -1;
while (_local2++ , _local2 < _local4) {
this.shots[_local2].handle();
}
_local4 = this.enemies.length;
_local2 = -1;
while (_local2++ , _local2 < _local4) {
this.enemies[_local2].handle();
}
if (!this.isComplete) {
var _local3 = false;
this.totalEnemies = 0;
if (this.giant != "none") {
_local3 = true;
}
_local4 = this.terminals.length;
_local2 = -1;
while (_local2++ , _local2 < _local4) {
this.terminals[_local2].handle();
if (this.terminals[_local2].state != 1) {
_local3 = true;
}
}
_local4 = this.enemies.length;
_local2 = -1;
while (_local2++ , _local2 < _local4) {
if (this.enemies[_local2].active) {
_local3 = true;
this.totalEnemies++;
}
}
if ((!_local3) && (this.treasure.posX)) {
this.isComplete = true;
this.treasure.activate();
_local4 = this.terminals.length;
_local2 = -1;
while (_local2++ , _local2 < _local4) {
this.terminals[_local2].hitCounter = 0;
this.terminals[_local2].draw();
}
if (!FIRSTS.cleared) {
this.game.hud.showHint("cleared");
} else {
this.game.hud.showMessage("cleared");
}
}
} else if (this.treasure.state == 3) {
this.flashCounter++;
if (this.flashCounter <= 4) {
this.parent.radar.blobs.push({posX:this.width2, posY:this.height2, radarColor:"centre"});
} else if (this.flashCounter == 8) {
this.flashCounter = 0;
}
}
this.move();
this.draw();
};
Arena.prototype.move = function () {
this.prevX = this.posX;
this.prevY = this.posY;
this.posX = limit(((-this.hero.posX) + SCREENX2) - ((COS((this.hero.angle - 90) * RAD) * 5) * this.hero.realspeed), -(this.width - SCREENX), 0);
this.posY = limit(((-this.hero.posY) + SCREENY2) - ((SIN((this.hero.angle - 90) * RAD) * 5) * this.hero.realspeed), -(this.height - SCREENY), 0);
};
Arena.prototype.draw = function () {
this.MCA._x = this.posX;
this.MCA._y = this.posY;
this.MCB._x = this.posX * this.ratioBX;
this.MCB._y = this.posY * this.ratioBY;
this.MCC._x = this.posX * this.ratioCX;
this.MCC._y = this.posY * this.ratioCY;
if (random(100) < 5) {
var _local5 = random(SCREENX) - this.posX;
var _local4 = random(SCREENY) - this.posY;
var _local3 = random(10) + 1;
while (_local3-- , _local3 > -1) {
this.doBubble(_local5, _local4);
}
}
if (random(100) == 1) {
var _local6 = random(2) + 1;
this.game.sfx.play("bubbles" + _local6, 100, 0);
}
this.bitmap.fillRect(this.bounds, this.bgColor);
this.bitmap.draw(this.MCzoomer);
var _local2 = this.MCcaustic;
_local2.clear();
matrix = new flash.geom.Matrix();
matrix.translate(this.posX / 5, this.posY / 5);
matrix.rotate(this.count / 100);
matrix.translate(this.widthA / 2, this.widthA / 2);
if (this.doDisplacement) {
_local2.beginBitmapFill(this["caustic_A" + ((this.count % 5) + 1)], matrix);
}
_local2.moveTo(0, 0);
_local2.lineTo(this.widthA, 0);
_local2.lineTo(this.widthA, this.heightA);
_local2.lineTo(0, this.heightA);
_local2.lineTo(0, 0);
_local2.endFill;
_local2._alpha = 25 + (COS(this.count / 20) * 20);
if (this.doDisplacement) {
this.displacement.fillRect(this.bounds, 2155905152);
matrix = new flash.geom.Matrix();
matrix.translate(SCREENX2, SCREENY2);
this.displacement.draw(this.diveMC, matrix);
matrix.translate(this.posX - SCREENX2, this.posY - SCREENY2);
this.MCcausticOverlay._visible = true;
this.displacement.draw(this.MCcaustic, matrix);
this.displacement.draw(this.ripplesMC, matrix);
this.MCcausticOverlay._visible = false;
this.filterD = new flash.filters.DisplacementMapFilter(this.displacement, this.origin, 1, 1, 100, 100, "clamp");
this.bitmap.applyFilter(this.bitmap, this.bounds, this.origin, this.filterD);
this.bitmap.draw(this.bubblesMC, matrix);
}
};
Arena.prototype.createBGs = function () {
this.MCzoomer = this.parent.MC.createEmptyMovieClip("arena", 2);
this.MCzoomer._visible = false;
this.parent.MC.attachBitmap(this.bitmap, 1);
this.MCA = this.MCzoomer.attachMovie("arena_A", "A", 3);
this.widthA = (this.width = this.MCA._width);
this.heightA = (this.height = this.MCA._height);
this.MC = this.MCA.createEmptyMovieClip("terrain", 1);
this.MCB = this.MCzoomer.attachMovie("arena_B", "B", 2);
this.widthB = this.MCB._width;
this.heightB = this.MCB._height;
this.ratioBX = (this.widthB - SCREENX) / (this.width - SCREENX);
this.ratioBY = (this.heightB - SCREENY) / (this.height - SCREENY);
this.MCC = this.MCzoomer.attachMovie("arena_C", "C", 1);
this.widthC = this.MCC._width;
this.heightC = this.MCC._height;
this.ratioCX = (this.widthC - SCREENX) / (this.width - SCREENX);
this.ratioCY = (this.heightC - SCREENY) / (this.height - SCREENY);
this.width2 = this.width / 2;
this.height2 = this.height / 2;
this.posX = (this.posY = 0);
this.ajar = 50;
};
Arena.prototype.createEffects = function () {
this.maxBubbles = (this.maxRipples = 40);
this.bubbleDepth = (this.rippleDepth = 0);
this.bubblesMC = this.MC.createEmptyMovieClip("bubbles", 50001);
this.ripplesMC = this.MC.createEmptyMovieClip("ripples", 50000);
this.MCcaustic = this.MCA.createEmptyMovieClip("caustic", 3);
if (this.doDisplacement) {
this.bubblesMC._visible = false;
this.ripplesMC._visible = false;
this.MCcausticOverlay = this.MCcaustic.createEmptyMovieClip("overlay", 10);
this.MCcausticOverlay.beginFill(8421504);
this.MCcausticOverlay.moveTo(0, 0);
this.MCcausticOverlay.lineTo(this.widthA, 0);
this.MCcausticOverlay.lineTo(this.widthA, this.heightA);
this.MCcausticOverlay.lineTo(0, this.heightA);
this.MCcausticOverlay.lineTo(0, 0);
this.MCcausticOverlay.endFill;
this.MCcausticOverlay._alpha = 80;
var _local2 = 6;
while (_local2-- , _local2 > 0) {
this["caustic_A" + _local2] = flash.display.BitmapData.loadBitmap("caustic_A" + _local2);
}
} else {
this.ripplesMC._alpha = 35;
}
};
Arena.prototype.showLifeline = function () {
this.lifelineMC = this.MC.attachMovie("landingpad", "landingpad", 2);
this.lifelineMC._x = this.width2 - 55;
this.lifelineMC._y = this.height2 - 55;
if (this.game.completeLevels == 1) {
this.MCC.lifeline._visible = true;
this.MCB.lifeline._visible = true;
}
};
Arena.prototype.newEnemy = function (species, state, posX, posY, angle) {
var _local2 = this.freeEnemySlots.shift();
if (!_local2) {
_local2 = this.enemies.length + 1;
}
if (_local2 <= this.maxEnemies) {
this.enemies[_local2 - 1] = new Enemy(this, _local2, species, state, posX, posY, angle);
if ((species == 4) && (this.fishLeader == "none")) {
this.fishLeader = _local2 - 1;
this.enemies[this.fishLeader].leader = true;
}
if (state == CAPTURED) {
this.hero.captured = _local2;
}
return(_local2 - 1);
}
return(false);
};
Arena.prototype.newGiant = function (species) {
this.game.sfx.play("music_ingame_stop", 100, 0);
this.game.sfx.play("music_giant_start", 100, 0);
this.giant = new Giant(this, species);
};
Arena.prototype.newTerminal = function (infection, state, posX, posY, angle) {
this.terminals.push(new Terminal(this, this.terminals.length + 1, state, infection, posX, posY, angle));
};
Arena.prototype.newTreasure = function (state, posX, posY, angle) {
this.treasure = new Treasure(this, state, posX, posY, angle);
this.isComplete = ((state == 3) ? true : false);
};
Arena.prototype.newShot = function (weapon, posX, posY, speed, angle) {
this.currentShot = ((this.currentShot < this.maxShots) ? (this.currentShot + 1) : 0);
this.shots[this.currentShot] = new Shot(this, this.currentShot, weapon, posX, posY, speed, angle);
};
Arena.prototype.doBubble = function (x, y, guarantee) {
if ((random(25) < 20) && (!guarantee)) {
return(undefined);
}
this.bubbleDepth++;
if (this.bubbleDepth > this.maxBubbles) {
this.bubbleDepth = 1;
}
var _local2 = this.bubblesMC.attachMovie("bubble", "bubble" + this.bubbleDepth, this.bubbleDepth);
var _local3 = random(360);
var _local4 = random(50) + 50;
_local2._x = x;
_local2._y = y;
_local2._rotation = _local3;
_local2._xscale = (_local2._yscale = _local4);
_local2.circle.blob.shape.gotoAndPlay(random(10));
_local2.circle.blob.shape._rotation = -_local3;
};
Arena.prototype.doRipple = function (x, y, guarantee) {
if (!this.doDisplacement) {
return(undefined);
}
if ((random(25) < 20) && (!guarantee)) {
return(undefined);
}
this.rippleDepth++;
if (this.rippleDepth > this.maxRipples) {
this.rippleDepth = 1;
}
var _local2 = this.ripplesMC.attachMovie("ripple", "ripple" + this.rippleDepth, this.rippleDepth);
_local2._x = x;
_local2._y = y;
};
Arena.prototype.doExplosion = function (x, y, impact) {
impact = impact * 5;
impact2 = impact / 2;
this.doBubble(x, y, true);
this.doRipple(x, y, true);
var _local5 = impact / 5;
while ((--i) > -1) {
this.doBubble((x + random(impact)) - impact2, (y + random(impact)) - impact2);
this.doRipple((x + random(impact)) - impact2, (y + random(impact)) - impact2);
}
};
Arena.prototype.manualComplete = function () {
for (var _local2 in this.enemies) {
this.enemies[_local2].active = false;
this.enemies[_local2].doExplosion();
}
for (var _local2 in this.terminals) {
this.terminals[_local2].closeMe();
}
for (var _local2 in this.shots) {
this.shots[_local2].active = false;
}
if (this.giant != "none") {
this.giant.strength = 0;
}
};
Arena.prototype.newLeader = function () {
var _local3 = this.fishLeader;
this.fishLeader = "none";
for (var _local4 in this.enemies) {
var _local2 = this.enemies[_local4];
if (_local2.species == 4) {
if (((_local2.state == 1) && (this.fishLeader == "none")) && (_local4 != _local3)) {
this.fishLeader = _local4;
_local2.followFish = "none";
_local2.leader = true;
} else {
_local2.followFish = this.fishLeader;
}
}
}
this.enemies[_local3].leader = false;
this.enemies[_local3].followFish = this.fishLeader;
};
Arena.prototype.diveAnim = function () {
if (this.game.levelDirection == "up") {
var _local5 = "ascend";
var _local4 = this.maxRipples / 2;
while (_local4-- , _local4 > -1) {
var _local3 = ((random(SCREENX) + SCREENX2) * 0.5) - this.posX;
var _local2 = ((random(SCREENY) + SCREENY2) * 0.5) - this.posY;
this.doRipple(_local3, _local2, true);
}
} else {
var _local5 = "descend";
var _local4 = this.maxBubbles / 2;
while (_local4-- , _local4 > -1) {
var _local3 = ((random(SCREENX) + SCREENX2) * 0.5) - this.posX;
var _local2 = ((random(SCREENY) + SCREENY2) * 0.5) - this.posY;
this.doBubble(_local3, _local2, true);
}
}
this.diveMC = this.MC.attachMovie(_local5, "dive", 50002);
this.diveMC._visible = false;
this.lifelineMC.gotoAndPlay(this.game.levelDirection);
this.gane.sfx.play("music_ingame_stop", 100, 0);
this.game.sfx.play("music_giant_stop", 100, 0);
this.game.sfx.play(_local5, 100, 0);
};
Arena.prototype.doShadow = function (what) {
if (((((what.posX + what.size2) < (-this.posX)) || ((what.posX - what.size2) > ((-this.posX) + SCREENX))) || ((what.posY + what.size2) < (-this.posY))) || ((what.posY - what.size2) > ((-this.posY) + SCREENY))) {
what.MC._visible = false;
return(undefined);
}
what.MC._visible = true;
var _local4 = -(what.posX - this.width2);
var _local3 = -(what.posY - this.height2);
var _local5 = SQRT((_local4 * _local4) + (_local3 * _local3)) / this.width2;
if (_local5 > 0.8) {
this.filterDS.distance = (1.1 - _local5) * 200;
this.filterDS.alpha = MIN((_local5 - 0.8) * 5, 0.65);
this.filterDS.angle = ATAN2(_local3, _local4) * (180 / PI);
what.filters.push(this.filterDS);
}
};
function Control(parent, left, right, up, down, fire) {
this.keyLEFT = left;
this.keyRIGHT = right;
this.keyUP = up;
this.keyDOWN = down;
this.keyFIRE = fire;
this.active = true;
this.LEFT = false;
this.RIGHT = false;
this.UP = false;
this.DOWN = false;
this.FIRE = false;
}
Control.prototype.handle = function () {
this.LEFT = false;
this.RIGHT = false;
this.UP = false;
this.DOWN = false;
this.FIRE = false;
if (!this.active) {
return(undefined);
}
if (KEY_DOWN(this.keyLEFT)) {
this.LEFT = true;
}
if (KEY_DOWN(this.keyRIGHT)) {
this.RIGHT = true;
}
if (KEY_DOWN(this.keyUP)) {
this.UP = true;
}
if (KEY_DOWN(this.keyDOWN)) {
this.DOWN = true;
}
if (KEY_DOWN(this.keyFIRE)) {
this.FIRE = true;
}
if (this.LEFT && (this.RIGHT)) {
this.LEFT = (this.RIGHT = false);
}
if (this.UP && (this.DOWN)) {
this.UP = (this.DOWN = false);
}
};
function Hud(parent) {
this.parent = parent;
this.MC = this.parent.MC.attachMovie("hud", "hud", 1000);
this.MC.messageUp.stop();
this.displayScore = 0;
this.levelCounter = (this.depthCounter = (this.levelDirection = (this.messageCounter = 0)));
this.levelMarkerMove = 21;
this.depthMarkerMove = 61;
this.giantStrengthOn = false;
this.messageAnim = 65;
this.nextMessage = "none";
}
Hud.prototype.handle = function () {
if (this.levelCounter) {
this.levelCounter++;
if (this.levelDirection == "up") {
this.MC.depth.currentLevel._y--;
} else {
this.MC.depth.currentLevel._y++;
}
if (this.levelCounter == this.levelMarkerMove) {
this.levelCounter = 0;
}
}
if (this.depthCounter) {
this.depthCounter++;
this.MC.depth.dial._y++;
if (this.depthCounter == this.depthMarkerMove) {
this.depthCounter = 0;
}
}
if (this.messageCounter) {
this.messageCounter++;
if (this.messageCounter == this.messageAnim) {
this.messageCounter = 0;
if (this.nextMessage != "none") {
this.showMessage(this.nextMessage);
this.nextMessage = "none";
}
}
}
if (this.giantStrengthOn) {
this.MC.giantstrength.bar.gotoAndStop(this.giant);
}
this.parent.level.radar.MC.timer.gotoAndStop(CEIL(this.parent.timer));
};
Hud.prototype.showMessage = function (which) {
if (this.messageCounter) {
this.nextMessage = which;
return(undefined);
}
this.MC.messageUp.gotoAndPlay(2);
this.MC.messageUp.message.gotoAndStop(which);
this.messageCounter = 1;
};
Hud.prototype.showHint = function (which) {
if (this.parent.currentLevel >= 9) {
FIRSTS[which] = true;
return(undefined);
}
clearInterval(this.interval);
this.interval = setInterval(this, "displayHint", 1000, which);
};
Hud.prototype.displayHint = function (which) {
clearInterval(this.interval);
this.parent.sfx.play("popup", 100, 0);
this.parent.active = false;
FIRSTS[which] = true;
this.MC.popupAnim.gotoAndPlay("reveal");
HINT = which;
};
Hud.prototype.completeLevel = function (level) {
var _local2 = this.MC.attachMovie("completeMarker", "completeMarker" + level, level + 50);
_local2._x = SCREENX - 9;
_local2._y = 2 + ((level - 1) * 18.5);
};
Hud.prototype.changeLevel = function (dir) {
if (this.giantStrengthOn) {
this.MC.giantstrength.gotoAndPlay("hide");
this.giantStrengthOn = false;
}
if ((dir == "up") || (dir == "down")) {
this.levelCounter = 1;
this.levelDirection = dir;
} else {
this.MC.depth.currentLevel._y = 10 + ((dir - 1) * 20);
}
};
Hud.prototype.openDepth = function () {
this.depthCounter = 1;
this.showMessage("newboat");
this.depthMarkerMove = 81;
};
Hud.prototype.showGiantStrength = function (species) {
this.giantStrengthOn = true;
this.giant = species;
this.MC.giantstrength.gotoAndPlay("reveal");
};
Hud.prototype.changeGiantStrength = function (strength, origStrength) {
if (!strength) {
this.MC.giantstrength.gotoAndPlay("hide");
this.giantStrengthOn = false;
} else {
var _local2 = ROUND((strength / origStrength) * 100);
this.MC.giantstrength.bar.strength._xscale = _local2;
}
};
function SFX(parent) {
this.parent = parent;
this.MC = this.parent.MC.attachMovie("soundFX", "soundFX", 3);
this.buffer = new Array();
}
SFX.prototype.handle = function () {
var _local2 = this.buffer.shift();
if (_local2.length) {
this.fire(_local2);
}
};
SFX.prototype.play = function (what) {
this.buffer.push(String(what));
};
SFX.prototype.fire = function (what) {
this.MC.gotoAndPlay(what);
};
function Level(parent, level) {
this.parent = parent;
this.parent.control.active = true;
this.MC = this.parent.MC.createEmptyMovieClip("mc", 10);
this.level = level;
this.radar = new Radar(this);
this.arena = new Arena(this);
this.arena.handle();
this.parent.flash();
}
Level.prototype.handle = function () {
this.arena.handle();
this.radar.handle();
};
function Game(parent) {
initiateTrig();
this.parent = parent;
this.active = true;
this.MC = _root.createEmptyMovieClip("Game", 1);
this.mask = this.MC.attachMovie("blank", "blank", 9999);
this.mask._width = SCREENX;
this.mask._height = SCREENY;
this.flasher = this.MC.attachMovie("flash", "flash", 9997);
this.flasher._width = SCREENX;
this.flasher._height = SCREENY;
this.MC.setMask(this.mask);
this.hud = new Hud(this);
this.sfx = new SFX(this, 1);
this.totalLevels = 20;
this.levelCutoff = 4;
if (local_data.data.TREASURE.length == this.totalLevels) {
local_data.data.TREASURE = new Array();
local_data.flush();
}
if (local_data.data.TREASURE.length >= 1) {
this.completeLevels = local_data.data.TREASURE.length;
this.currentLevel = (this.cheatNum = 0);
for (var _local3 in local_data.data.TREASURE) {
this.hud.completeLevel(local_data.data.TREASURE[_local3]);
if (local_data.data.TREASURE[_local3] > this.cheatNum) {
this.cheatNum = local_data.data.TREASURE[_local3];
}
}
this.cheatNum++;
var _local4 = this.cheatNum + 1;
var _local3 = 0;
while (_local3++ , _local3 < _local4) {
if (!local_data.data.TREASURE.inArray(_local3)) {
this.cheatNum = _local3;
break;
}
}
this.section = CEIL(this.cheatNum / this.levelCutoff);
this.hud.MC.depth.dial._y = this.hud.MC.depth.dial._y + this.hud.depthMarkerMove;
this.hud.depthMarkerMove = 81;
if (this.section > 1) {
this.hud.MC.depth.dial._y = this.hud.MC.depth.dial._y + (this.hud.depthMarkerMove * (this.section - 1));
}
} else {
this.currentLevel = (this.completeLevels = 0);
this.section = 1;
}
this.levelDesigns();
this.levelDirection = "down";
this.changeLevel();
this.score = (this.cheatNum = (this.cheatCount = (this.feedCount = (this.treasureCount = (this.endGameCounter = 0)))));
this.timer = 100;
this.endText = (this.gameOutcome = "");
this.endGameAt = 60;
this.doneWarning = false;
}
Game.prototype.handle = function () {
this.cheats();
this.hud.handle();
if (this.active) {
this.level.handle();
this.handleTimer();
}
this.sfx.handle();
};
Game.prototype.handleTimer = function () {
if ((this.timer < 35) && (!this.doneWarning)) {
this.doneWarning = true;
this.sfx.play("warning", 100, 0);
} else if (this.timer <= 0) {
this.gameOutcome = "gameover";
this.gameOver();
}
};
Game.prototype.calcFPS = function () {
this.currentTime = getTimer();
this.frameDuration = this.currentTime - this.previousTime;
this.previousTime = this.currentTime;
return(int(1000 / this.frameDuration));
};
Game.prototype.flash = function () {
this.flasher.gotoAndPlay(1);
};
Game.prototype.gameOver = function () {
this.endGameCounter++;
if (this.endGameCounter == 1) {
this.sfx.play("music_ingame_stop", 100, 0);
this.sfx.play("music_giant_stop", 100, 0);
if (this.gameOutcome == "gameover") {
this.level.arena.hero.doExplosion();
if (!this.treasureCount) {
this.endText = "Keep trying!\n\nYou did not collect any treasure this game.\n\n";
} else if (this.treasureCount == 1) {
this.endText = "Nice work mate!\n\nYou collected a treasure chest this game.\n\n";
} else {
this.endText = ("Nice work mate!\n\nYou collected " + this.treasureCount) + " treasure chests this game.\n\n";
}
this.endText = this.endText + (("You used the food chain " + this.feedCount) + " times\n\n");
} else {
this.endText = "You are the ultimate Aqua Raider!\n\nYou have collected all of the treasure possible!\n\nYou have piloted all of the ships!\n\n";
}
if (local_data.data.CROSSBREADS.length == TOTAL_CROSSBREADS) {
this.endText = this.endText + "You have encountered all of the crossbreeds possible in this trench. Congratulations. It does not get any harder than that!";
} else {
this.endText = this.endText + (((("During all of your adventures you have created " + local_data.data.CROSSBREADS.length) + " of the ") + TOTAL_CROSSBREADS) + " crossbreeds possible. There is still more to see!");
}
_root.endText = this.endText;
}
if (this.endGameCounter < this.endGameAt) {
return(undefined);
}
this.level.arena.music1.stop();
this.parent.state = this.gameOutcome;
};
Game.prototype.completeLevel = function (newState) {
this.hud.completeLevel(this.currentLevel);
this.theTreasure["state" + this.currentLevel] = newState;
this.completeLevels++;
this.treasureCount++;
if (this.completeLevels == 1) {
this.hud.depthCounter = 1;
}
isNewBoat = false;
this.section = this.completeLevels / this.levelCutoff;
if ((this.section == ROUND(this.section)) && (this.completeLevels != this.totalLevels)) {
this.timer = 100;
this.hud.openDepth();
this.level.arena.hero.nextBoat();
isNewBoat = true;
this.doneWarning = false;
}
this.section = FLOOR(this.section) + 1;
return(isNewBoat);
};
Game.prototype.changeLevel = function () {
if (!this.cheatNum) {
var _local3 = ((this.levelDirection == "up") ? (this.currentLevel - 1) : (this.currentLevel + 1));
} else {
var _local3 = (this.levelDirection = this.cheatNum);
this.cheatNum = 0;
}
if (this.currentLevel) {
this.enemyNums[this.currentLevel] = this.level.arena.totalEnemies;
this.theEnemies[this.currentLevel] = new Object();
var _local4 = 1;
var _local6 = this.level.arena.enemies.length;
while (_local6-- , _local6 > -1) {
var _local2 = this.level.arena.enemies[_local6];
if (_local2.state <= 4) {
this.theEnemies[this.currentLevel]["type" + _local4] = _local2.species;
this.theEnemies[this.currentLevel]["posX" + _local4] = _local2.posX;
this.theEnemies[this.currentLevel]["posY" + _local4] = _local2.posY;
this.theEnemies[this.currentLevel]["angle" + _local4] = _local2.angle;
this.theEnemies[this.currentLevel]["state" + _local4] = _local2.state;
_local4++;
} else if (_local2.state == 6) {
if (this.enemyNums[_local3] != this.level.arena.maxEnemies) {
this.enemyNums[_local3]++;
}
var _local5 = this.enemyNums[_local3];
this.enemyNums[this.currentLevel]--;
this.theEnemies[_local3]["type" + _local5] = _local2.species;
this.theEnemies[_local3]["angle" + _local5] = _local2.angle;
this.theEnemies[_local3]["state" + _local5] = _local2.state;
}
}
}
this.currentLevel = _local3;
if (this.level.arena.giant) {
this.level.arena.music1.stop();
}
this.level = new Level(this, this.currentLevel);
this.hud.changeLevel(this.levelDirection);
this.populateLevel();
};
Game.prototype.checkLevelChange = function (dir) {
this.levelDirection = dir;
var _local2 = true;
if ((this.currentLevel == 1) && (dir == "up")) {
_local2 = false;
} else if ((dir == "down") && (this.currentLevel != this.totalLevels)) {
if ((this.currentLevel == (this.totalLevels - 1)) && (this.completeLevels < (this.totalLevels - 1))) {
_local2 = false;
this.hud.showHint("lastlevel");
} else if ((this.currentLevel == 1) && (!this.completeLevels)) {
_local2 = false;
} else if ((ROUND(this.currentLevel / this.levelCutoff) == (this.currentLevel / this.levelCutoff)) && (this.completeLevels < this.currentLevel)) {
_local2 = false;
this.hud.showHint("wrongvehicle");
}
} else if ((dir == "down") && (this.currentLevel == this.totalLevels)) {
_local2 = false;
}
return(_local2);
};
Game.prototype.populateLevel = function () {
var _local5 = (posY = (angle = (state = (type = 0))));
var _local4 = this.theTerminals[this.currentLevel];
var _local6 = this.terminalNums[this.currentLevel] + 1;
var _local2 = 0;
while (_local2++ , _local2 < _local6) {
if (_local4["state" + _local2]) {
state = _local4["state" + _local2];
} else {
state = 3;
}
if (local_data.data.TREASURE.inArray(this.currentLevel)) {
state = 1;
}
this.level.arena.newTerminal(_local4["type" + _local2], state, _local4["posX" + _local2], _local4["posY" + _local2], _local4["angle" + _local2]);
}
if (local_data.data.TREASURE.inArray(this.currentLevel)) {
this.theTreasure["state" + this.currentLevel] = 3;
}
this.level.arena.newTreasure(this.theTreasure["state" + this.currentLevel], this.theTreasure["posX" + this.currentLevel], this.theTreasure["posY" + this.currentLevel], this.theTreasure["angle" + this.currentLevel]);
if (this.level.arena.isComplete && (this.hero.captured == "none")) {
return(undefined);
}
var _local3 = this.theEnemies[this.currentLevel];
_local6 = this.enemyNums[this.currentLevel] + 1;
_local2 = 0;
while (_local2++ , _local2 < _local6) {
if (_local3["state" + _local2]) {
state = _local3["state" + _local2];
} else {
state = 1;
}
if ((!this.level.arena.isComplete) || (state == CAPTURED)) {
if (_local3["posX" + _local2]) {
_local5 = _local3["posX" + _local2];
} else {
_local5 = random(this.level.arena.width);
}
if (_local3["posY" + _local2]) {
posY = _local3["posY" + _local2];
} else if ((_local5 > 450) && (_local5 < 1050)) {
if (random(2) == 1) {
posY = random(550);
} else {
posY = random(550) + 950;
}
} else {
posY = random(this.level.arena.height);
}
if (_local3["angle" + _local2]) {
angle = _local3["angle" + _local2];
} else if (type != 4) {
angle = random(360);
}
if (_local3["type" + _local2]) {
type = _local3["type" + _local2];
}
this.level.arena.newEnemy(type, state, _local5, posY, angle);
}
}
if (this.giants[this.currentLevel].length && (!this.level.arena.isComplete)) {
this.level.arena.newGiant(this.giants[this.currentLevel]);
}
};
Game.prototype.levelDesigns = function () {
this.theTreasure = new Object();
this.theTreasure = {posX1:350, posY1:1500, angle1:180, posX2:1470, posY2:1380, angle2:90, posX3:60, posY3:750, angle3:270, posX4:1270, posY4:1480, angle4:180, posX5:400, posY5:200, angle5:330, posX6:1470, posY6:1050, angle6:110, posX7:740, posY7:150, angle7:0, posX8:650, posY8:1460, angle8:330, posX9:1300, posY9:200, angle9:30, posX10:800, posY10:100, angle10:330, posX11:110, posY11:1150, angle11:50, posX12:1300, posY12:1300, angle12:0, posX13:1100, posY13:60, angle13:330, posX14:40, posY14:360, angle14:305, posX15:50, posY15:1450, angle15:290, posX16:100, posY16:80, angle16:270, posX17:500, posY17:1500, angle17:240, posX18:60, posY18:1100, angle18:230, posX19:1470, posY19:750, angle19:80, posX20:1400, posY20:50, angle20:30};
var _local2 = this.totalLevels + 1;
while (_local2-- , _local2 > 0) {
this.theTreasure["state" + _local2] = 1;
}
this.enemyNums = new Array(0, 3, 5, 8, 2, 9, 5, 8, 1, 10, 5, 10, 3, 10, 5, 8, 0, 10, 5, 10, 2);
this.theEnemies = new Array();
this.theEnemies[1] = new Object();
this.theEnemies[1] = {type1:1};
this.theEnemies[2] = new Object();
this.theEnemies[2] = {type1:2, angle1:90, posX1:50, angle2:180, posY2:50, angle3:270, posX3:1400, angle4:360, posY4:1400, angle5:180, posY5:50};
this.theEnemies[3] = new Object();
this.theEnemies[3] = {type1:1, type6:3};
this.theEnemies[4] = new Object();
this.theEnemies[4] = {type1:2, angle1:90, posX1:50, angle2:270, posX2:1400};
this.theEnemies[5] = new Object();
this.theEnemies[5] = {type1:1, type6:3};
this.theEnemies[6] = new Object();
this.theEnemies[6] = {type1:2, angle1:90, posX1:50, angle2:180, posY2:50, angle3:270, posX3:1400, angle4:360, posY4:1400, angle5:180, posY5:50};
this.theEnemies[7] = new Object();
this.theEnemies[7] = {type1:2, angle1:90, posX1:50, angle2:180, posY2:50, angle3:270, posX3:1400, angle4:360, posY4:1400, angle5:180, posY5:50, type6:4};
this.theEnemies[8] = new Object();
this.theEnemies[8] = {type1:4};
this.theEnemies[9] = new Object();
this.theEnemies[9] = {type1:1, type6:4};
this.theEnemies[10] = new Object();
this.theEnemies[10] = {type1:3};
this.theEnemies[11] = new Object();
this.theEnemies[11] = {type1:3, type6:5};
this.theEnemies[12] = new Object();
this.theEnemies[12] = {type1:4};
this.theEnemies[13] = new Object();
this.theEnemies[13] = {type1:1, type4:3, type7:5};
this.theEnemies[14] = new Object();
this.theEnemies[14] = {type1:4};
this.theEnemies[15] = new Object();
this.theEnemies[15] = {type1:4, type6:6};
this.theEnemies[16] = new Object();
this.theEnemies[17] = new Object();
this.theEnemies[17] = {type1:6, type4:4, type6:1};
this.theEnemies[18] = new Object();
this.theEnemies[18] = {type1:5};
this.theEnemies[19] = new Object();
this.theEnemies[19] = {type1:6, type5:4, type8:2, angle8:90, posX8:50, angle9:180, posY9:50, angle10:270, posX10:1400};
this.theEnemies[20] = new Object();
this.theEnemies[20] = {type1:6};
this.terminalNums = new Array(0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0);
this.theTerminals = new Array();
this.theTerminals[6] = new Object();
this.theTerminals[6] = {posX1:-70, posY1:0, angle1:360, type1:2};
this.theTerminals[10] = new Object();
this.theTerminals[10] = {posX1:1000, posY1:0, angle1:360, type1:3};
this.theTerminals[14] = new Object();
this.theTerminals[14] = {posX1:1100, posY1:1500, angle1:180, type1:4};
this.theTerminals[18] = new Object();
this.theTerminals[18] = {posX1:500, posY1:0, angle1:360, type1:5};
this.giants = new Array("", "", "", "", "bigcrab", "", "", "", "biglobster", "", "", "", "bigfangfish", "", "", "", "bigshark", "", "", "", "bigsquid");
};
Game.prototype.cheats = function () {
if (this.cheatCount && (this.cheatNum)) {
this.cheatCount++;
if (this.cheatCount == 40) {
this.cheatCount = 0;
this.changeLevel();
}
}
if (((!CHEATMODE) && (KEY_DOWN(52))) && (KEY_DOWN(50))) {
this.sfx.play("cheater", 100, 0);
CHEATMODE = true;
this.crackcount = 20;
}
if (this.crackcount) {
this.crackcount--;
}
if ((!CHEATMODE) || (this.crackcount)) {
return(undefined);
}
if (KEY_DOWN(84)) {
this.sfx.play("cheater", 100, 0);
this.timer = 100;
this.crackcount = 20;
return(undefined);
}
if (KEY_DOWN(109)) {
SOUND = "off";
this.crackcount = 20;
return(undefined);
}
if (KEY_DOWN(35)) {
this.sfx.play("cheater", 100, 0);
this.level.arena.manualComplete();
this.crackcount = 20;
return(undefined);
}
if (KEY_DOWN(77)) {
this.sfx.play("cheater", 100, 0);
local_data.data.AWARDS.bigcrab = "got";
local_data.data.AWARDS.biglobster = "got";
local_data.data.AWARDS.bigfangfish = "got";
local_data.data.AWARDS.bigshark = "got";
local_data.data.AWARDS.bigsquid = "got";
local_data.data.AWARDS.allcrossbreads = "got";
local_data.data.AWARDS.allsubs = "got";
local_data.data.AWARDS.alltreasure = "got";
this.crackcount = 20;
return(undefined);
}
var _local2 = 10;
while (_local2-- , _local2 > -1) {
if (KEY_DOWN(_local2 + 48)) {
this.sfx.play("cheater", 100, 0);
this.crackcount = 20;
if (this.cheatNum) {
this.cheatNum = (this.cheatNum + "") + _local2;
} else {
this.cheatNum = _local2;
this.cheatCount = 1;
}
break;
}
}
};
function Panel() {
this.MC = _root.attachMovie("panel", "panel", 2);
this.MC.parent = this;
this.counter = 0;
this.state = "intro";
this.instructionsPage = (this.instructionsPages = 1);
this.message = "";
this.sfx = new SFX(this);
this.transTime = 14;
}
Panel.prototype.handle = function () {
if (this.counter) {
this.counter++;
if (this.counter == this.transTime) {
this.startGame();
this.counter = 0;
}
}
this.draw();
if (this.state == "hidden") {
this.game.handle();
}
};
Panel.prototype.draw = function () {
if (this.state == "hidden") {
this.MC._visible = false;
_quality = "low";
return(undefined);
}
this.MC._visible = true;
_quality = "high";
this.MC.gotoAndStop(this.state);
if (this.state == "instructions") {
this.MC.gotoAndStop(this.state + this.instructionsPage);
}
this.MC.message = this.message;
};
Panel.prototype.startGame = function () {
this.MCtrans = _root.attachMovie("transitionIn", "transitionIn", 3);
this.MCtrans._x = SCREENX2;
this.MCtrans._y = SCREENY2;
this.state = "hidden";
this.game = new Game(this);
};
Panel.prototype.pressPlay = function () {
if (this.state == "hidden") {
return(undefined);
}
this.MCtrans = _root.attachMovie("transitionOut", "transitionOut", 3);
this.MCtrans._x = SCREENX2;
this.MCtrans._y = SCREENY2;
this.counter++;
stopAllSounds();
this.MC.gotoAndStop(this.state);
};
Panel.prototype.pressInstructions = function () {
this.sfx.play("static", 100, 0);
this.state = "instructions";
this.instructionsPage = 1;
};
Panel.prototype.pressMedals = function () {
this.sfx.play("static", 100, 0);
this.state = "medals";
};
Panel.prototype.pressBriefing = function () {
this.sfx.play("static", 100, 0);
this.state = "briefing";
local_data.data.TREASURE = new Array();
local_data.flush();
};
function saveAward(award) {
if (local_data.data.AWARDS[award] == "got") {
return(false);
}
_root.panel.game.hud.showMessage(award);
local_data.data.AWARDS[award] = "got";
local_data.flush();
return(true);
}
local_data = SharedObject.getLocal("user_data");
if (local_data.data.hasPlayed != "true") {
local_data.data.hasPlayed = "true";
local_data.data.AWARDS = new Array();
local_data.data.CROSSBREADS = new Array();
local_data.data.TREASURE = new Array();
local_data.flush();
}
DOWNLOADS = new Array(_level0.download1, _level0.download2, _level0.download3, _level0.download4, _level0.download5, _level0.download6, _level0.download7, _level0.download8);
fscommand ("allowscale", false);
fscommand ("showmenu", false);
fscommand ("trapallkeys", true);
_quality = "medium";
PI = Math.PI;
RAD = PI / 180;
FLOOR = int;
CEIL = Math.ceil;
ROUND = Math.round;
RANDOM = random;
COS = Math.cos;
SIN = Math.sin;
ABS = Math.abs;
SQRT = Math.sqrt;
ATAN2 = Math.atan2;
KEY_DOWN = Key.isDown;
SCREENX = 550;
SCREENY = 370;
SCREENX2 = SCREENX / 2;
SCREENY2 = SCREENY / 2;
CHEATMODE = false;
SOUND = "on";
SUBANGLE = 0;
SUBPOSX = "first";
SUBPOSY = "first";
SUBSCALE = 100;
HINT = "none";
TOTAL_CROSSBREADS = 15;
FIRSTS = new Array();
FIRSTS.stunned = false;
FIRSTS.stunned2 = false;
FIRSTS.collected = false;
FIRSTS.crossbread = false;
FIRSTS.cave = false;
FIRSTS.depths = false;
FIRSTS.cleared = false;
FIRSTS.wrongvehicle = false;
FIRSTS.lastlevel = false;
FIRSTS.bigcrab = false;
FIRSTS.biglobster = false;
FIRSTS.bigfangfish = false;
FIRSTS.bigshark = false;
FIRSTS.bigsquid = false;
panel = new Panel();
onEnterFrame = function () {
panel.handle();
};
stop();
Symbol 13 MovieClip Frame 41
stop();
Symbol 14 MovieClip Frame 11
stop();
Symbol 16 MovieClip [transitionOut] Frame 14
stop();
Symbol 146 MovieClip Frame 1
stop();
Symbol 146 MovieClip Frame 2
stop();
Symbol 146 MovieClip Frame 3
stop();
Symbol 146 MovieClip Frame 4
stop();
Symbol 146 MovieClip Frame 5
stop();
Symbol 147 MovieClip Frame 1
stop();
Symbol 147 MovieClip Frame 2
play();
Symbol 147 MovieClip Frame 6
stop();
Symbol 147 MovieClip Frame 11
gotoAndStop (1);
Symbol 180 MovieClip Frame 1
stop();
Symbol 180 MovieClip Frame 2
stop();
Symbol 180 MovieClip Frame 3
stop();
Symbol 180 MovieClip Frame 4
stop();
Symbol 180 MovieClip Frame 5
stop();
Symbol 180 MovieClip Frame 6
stop();
Symbol 180 MovieClip Frame 7
stop();
Symbol 180 MovieClip Frame 8
stop();
Symbol 180 MovieClip Frame 9
stop();
Symbol 180 MovieClip Frame 10
stop();
Symbol 180 MovieClip Frame 11
stop();
Symbol 181 MovieClip Frame 1
stop();
Symbol 181 MovieClip Frame 62
gotoAndStop (1);
Symbol 212 MovieClip Frame 1
stop();
Symbol 212 MovieClip Frame 2
stop();
Symbol 212 MovieClip Frame 3
stop();
Symbol 212 MovieClip Frame 4
stop();
Symbol 212 MovieClip Frame 5
stop();
Symbol 212 MovieClip Frame 6
stop();
Symbol 212 MovieClip Frame 7
stop();
Symbol 212 MovieClip Frame 8
stop();
Symbol 212 MovieClip Frame 9
stop();
Symbol 212 MovieClip Frame 10
stop();
Symbol 212 MovieClip Frame 11
stop();
Symbol 212 MovieClip Frame 12
stop();
Symbol 212 MovieClip Frame 13
stop();
Symbol 212 MovieClip Frame 14
stop();
Symbol 212 MovieClip Frame 15
stop();
Symbol 212 MovieClip Frame 16
stop();
Symbol 221 Button
on (release, keyPress "<Space>") {
_root.panel.game.level.arena.hero.fireCount = 1;
_root.panel.game.active = true;
_parent.gotoAndStop("blank");
}
Symbol 222 MovieClip Frame 10
stop();
Symbol 225 MovieClip Frame 1
stop();
Symbol 225 MovieClip Frame 2
popup.setMask(popupMask);
popup.hint.gotoAndStop(_root.HINT);
Symbol 225 MovieClip Frame 11
stop();
Symbol 241 MovieClip Frame 1
stop();
Symbol 247 MovieClip [ripple] Frame 25
this.removeMovieClip();
Symbol 323 MovieClip Frame 31
trace("here");
stop();
Symbol 326 MovieClip [giantExplosion] Frame 9
stop();
Symbol 337 MovieClip [arena_B] Frame 1
lifeline.stop();
Symbol 340 MovieClip [arena_C] Frame 1
lifeline.stop();
Symbol 388 MovieClip [snakefangfish] Frame 1
var cells = new Array("straight", "leftalittle", "leftalot", "rightalittle", "rightalot", "leftalittle2", "straight2");
var sequence = new Array("1 straight", "2 leftalittle", "3 leftalot", "4 leftalittle2", "3 straight2", "2 rightalittle", "1 rightalot", "2 rightalittle");
Symbol 393 MovieClip [snakelobster] Frame 1
Symbol 394 MovieClip [creatureExplosion] Frame 26
stop();
Symbol 395 MovieClip [block] Frame 1
stop();
Symbol 395 MovieClip [block] Frame 2
stop();
Symbol 395 MovieClip [block] Frame 3
stop();
Symbol 395 MovieClip [block] Frame 4
stop();
Symbol 395 MovieClip [block] Frame 5
stop();
Symbol 395 MovieClip [block] Frame 6
stop();
Symbol 395 MovieClip [block] Frame 7
stop();
Symbol 396 MovieClip [blockfly] Frame 21
stop();
Symbol 404 MovieClip [descend] Frame 25
stop();
this.removeMovieClip();
Symbol 407 MovieClip [ascend] Frame 25
stop();
this.removeMovieClip();
Symbol 414 MovieClip [treasure] Frame 1
stop();
Symbol 414 MovieClip [treasure] Frame 9
stop();
Symbol 421 MovieClip [terminal] Frame 1
stop();
Symbol 421 MovieClip [terminal] Frame 26
stop();
Symbol 421 MovieClip [terminal] Frame 45
gotoAndStop ("state3");
Symbol 424 MovieClip [bubble] Frame 40
this.removeMovieClip();
Symbol 425 MovieClip Frame 1
stop();
Symbol 425 MovieClip Frame 11
gotoAndStop (1);
Symbol 441 MovieClip Frame 1
stop();
Symbol 441 MovieClip Frame 12
gotoAndStop (1);
Symbol 456 MovieClip Frame 1
stop();
Symbol 456 MovieClip Frame 48
stop();
Symbol 493 MovieClip [sub] Frame 1
stop();
Symbol 493 MovieClip [sub] Frame 2
stop();
Symbol 493 MovieClip [sub] Frame 3
stop();
Symbol 493 MovieClip [sub] Frame 4
stop();
Symbol 493 MovieClip [sub] Frame 5
stop();
Symbol 515 MovieClip Frame 15
stop();
Symbol 516 MovieClip Frame 15
stop();
Symbol 517 MovieClip [landingpad] Frame 1
stop();
Symbol 517 MovieClip [landingpad] Frame 17
gotoAndPlay ("over");
Symbol 517 MovieClip [landingpad] Frame 19
stop();
Symbol 517 MovieClip [landingpad] Frame 20
stop();
Symbol 517 MovieClip [landingpad] Frame 21
stop();
Symbol 520 MovieClip [transitionIn] Frame 15
stop();
Symbol 534 MovieClip Frame 14
stop();
Symbol 540 MovieClip Frame 64
stop();
Symbol 544 MovieClip Frame 18
stop();
Symbol 549 MovieClip Frame 78
stop();
Symbol 557 MovieClip Frame 123
stop();
Symbol 564 Button
on (release, keyPress "<Space>") {
_root.panel.pressPlay();
}
Symbol 567 MovieClip Frame 1
stop();
Symbol 567 MovieClip Frame 2
stop();
Symbol 567 MovieClip Frame 3
stop();
Symbol 579 Button
on (release, keyPress "i") {
_root.panel.pressInstructions();
}
Symbol 584 Button
on (release) {
_root.panel.pressBriefing();
}
Symbol 585 Button
on (release) {
_root.panel.pressPlay();
}
Symbol 586 Button
on (release) {
_root.panel.pressMedals();
}
Symbol 591 MovieClip Frame 1
if (_root.local_data.data.TREASURE.length >= 1) {
playbutton.gotoAndStop(2);
}
Symbol 593 MovieClip Frame 34
stop();
Symbol 595 MovieClip Frame 227
screen.screen.playbutton._visible = false;
Symbol 595 MovieClip Frame 235
stop();
Symbol 608 Button
on (release) {
gotoAndPlay ("page2");
}
Symbol 614 Button
on (release) {
gotoAndPlay ("page3");
}
Symbol 621 Button
on (release) {
gotoAndPlay ("page1");
}
Symbol 626 Button
on (release) {
gotoAndPlay ("page4");
}
Symbol 627 Button
on (release) {
gotoAndPlay ("page2");
}
Symbol 633 Button
on (release) {
gotoAndPlay ("page5");
}
Symbol 634 Button
on (release) {
gotoAndPlay ("page3");
}
Symbol 647 Button
on (release) {
gotoAndPlay ("page6");
}
Symbol 648 Button
on (release) {
gotoAndPlay ("page4");
}
Symbol 667 Button
on (release) {
gotoAndPlay ("page5");
}
Symbol 668 MovieClip Frame 15
stop();
Symbol 668 MovieClip Frame 63
landingpad.gotoAndPlay("over");
Symbol 668 MovieClip Frame 104
gotoAndPlay ("page2");
Symbol 668 MovieClip Frame 105
stop();
Symbol 668 MovieClip Frame 183
gotoAndPlay ("page4");
Symbol 668 MovieClip Frame 184
stop();
Symbol 668 MovieClip Frame 207
stop();
Symbol 688 MovieClip Frame 1
diver.setMask(diverMask);
stop();
Symbol 702 MovieClip Frame 8
diver.setMask(diverMask);
Symbol 702 MovieClip Frame 12
stopAllSounds();
Symbol 702 MovieClip Frame 763
_root.panel.pressPlay();
stop();
Symbol 735 Button
on (release) {
getURL ("http://" + _root.DOWNLOADS[0], "_blank");
}
Symbol 736 Button
on (release) {
getURL ("http://" + _root.DOWNLOADS[1], "_blank");
}
Symbol 737 Button
on (release) {
getURL ("http://" + _root.DOWNLOADS[2], "_blank");
}
Symbol 738 Button
on (release) {
getURL ("http://" + _root.DOWNLOADS[3], "_blank");
}
Symbol 739 Button
on (release) {
getURL ("http://" + _root.DOWNLOADS[7], "_blank");
}
Symbol 740 Button
on (release) {
getURL ("http://" + _root.DOWNLOADS[6], "_blank");
}
Symbol 741 Button
on (release) {
getURL ("http://" + _root.DOWNLOADS[5], "_blank");
}
Symbol 742 Button
on (release) {
getURL ("http://" + _root.DOWNLOADS[4], "_blank");
}
Symbol 743 MovieClip Frame 1
if (_root.local_data.data.AWARDS.bigcrab != "got") {
bigcrab._visible = false;
btn1._visible = false;
}
if (_root.local_data.data.AWARDS.biglobster != "got") {
biglobster._visible = false;
btn2._visible = false;
}
if (_root.local_data.data.AWARDS.bigfangfish != "got") {
bigfangfish._visible = false;
btn3._visible = false;
}
if (_root.local_data.data.AWARDS.bigshark != "got") {
bigshark._visible = false;
btn4._visible = false;
}
if (_root.local_data.data.AWARDS.bigsquid != "got") {
bigsquid._visible = false;
btn5._visible = false;
}
if (_root.local_data.data.AWARDS.allcrossbreads != "got") {
allcrossbreads._visible = false;
btn6._visible = false;
}
if (_root.local_data.data.AWARDS.allsubs != "got") {
allsubs._visible = false;
btn7._visible = false;
}
if (_root.local_data.data.AWARDS.alltreasure != "got") {
alltreasure._visible = false;
btn8._visible = false;
}
Symbol 743 MovieClip Frame 34
stop();
Symbol 754 MovieClip Frame 1
diver.setMask(diverMask);
Symbol 755 Button
on (release) {
_root.panel.pressBriefing();
}
Symbol 756 Button
on (release) {
_root.panel.pressMedals();
}
Symbol 757 MovieClip Frame 1
if (_root.local_data.data.TREASURE.length >= 1) {
playbutton.gotoAndStop(2);
}
Symbol 758 MovieClip Frame 15
stop();
Symbol 759 MovieClip Frame 92
stop();
Symbol 760 MovieClip Frame 74
stop();
Symbol 766 MovieClip Frame 134
stop();
Symbol 767 MovieClip Frame 244
stop();
Symbol 806 MovieClip [soundFX] Frame 1
stop();
Symbol 806 MovieClip [soundFX] Frame 10
play();
Symbol 806 MovieClip [soundFX] Frame 24
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 25
play();
Symbol 806 MovieClip [soundFX] Frame 39
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 40
play();
Symbol 806 MovieClip [soundFX] Frame 54
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 55
play();
Symbol 806 MovieClip [soundFX] Frame 69
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 70
play();
Symbol 806 MovieClip [soundFX] Frame 84
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 85
play();
Symbol 806 MovieClip [soundFX] Frame 99
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 100
play();
Symbol 806 MovieClip [soundFX] Frame 114
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 115
play();
Symbol 806 MovieClip [soundFX] Frame 134
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 135
play();
Symbol 806 MovieClip [soundFX] Frame 147
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 148
play();
Symbol 806 MovieClip [soundFX] Frame 159
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 160
play();
Symbol 806 MovieClip [soundFX] Frame 171
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 172
play();
Symbol 806 MovieClip [soundFX] Frame 179
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 180
play();
Symbol 806 MovieClip [soundFX] Frame 189
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 190
play();
Symbol 806 MovieClip [soundFX] Frame 198
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 199
play();
Symbol 806 MovieClip [soundFX] Frame 207
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 208
play();
Symbol 806 MovieClip [soundFX] Frame 229
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 230
play();
Symbol 806 MovieClip [soundFX] Frame 239
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 240
play();
Symbol 806 MovieClip [soundFX] Frame 249
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 250
play();
Symbol 806 MovieClip [soundFX] Frame 258
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 259
play();
Symbol 806 MovieClip [soundFX] Frame 266
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 267
play();
Symbol 806 MovieClip [soundFX] Frame 278
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 279
play();
Symbol 806 MovieClip [soundFX] Frame 287
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 288
play();
Symbol 806 MovieClip [soundFX] Frame 294
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 295
play();
Symbol 806 MovieClip [soundFX] Frame 301
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 302
play();
Symbol 806 MovieClip [soundFX] Frame 307
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 308
play();
Symbol 806 MovieClip [soundFX] Frame 316
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 317
play();
Symbol 806 MovieClip [soundFX] Frame 325
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 326
play();
Symbol 806 MovieClip [soundFX] Frame 333
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 334
play();
Symbol 806 MovieClip [soundFX] Frame 346
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 347
play();
Symbol 806 MovieClip [soundFX] Frame 354
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 355
play();
Symbol 806 MovieClip [soundFX] Frame 364
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 365
play();
Symbol 806 MovieClip [soundFX] Frame 374
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 375
play();
Symbol 806 MovieClip [soundFX] Frame 386
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 387
play();
Symbol 806 MovieClip [soundFX] Frame 394
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 395
play();
Symbol 806 MovieClip [soundFX] Frame 402
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 403
play();
Symbol 806 MovieClip [soundFX] Frame 410
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 411
play();
Symbol 806 MovieClip [soundFX] Frame 420
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 421
play();
Symbol 806 MovieClip [soundFX] Frame 424
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 425
play();
Symbol 806 MovieClip [soundFX] Frame 443
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 444
play();
Symbol 806 MovieClip [soundFX] Frame 458
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 459
play();
Symbol 806 MovieClip [soundFX] Frame 466
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 467
play();
play();
Symbol 806 MovieClip [soundFX] Frame 480
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 481
play();
Symbol 806 MovieClip [soundFX] Frame 495
gotoAndStop (1);
Symbol 806 MovieClip [soundFX] Frame 496
play();
Symbol 806 MovieClip [soundFX] Frame 515
gotoAndStop (1);
Symbol 809 MovieClip [flash] Frame 11
stop();
Symbol 822 MovieClip Frame 15
stop();
Symbol 828 MovieClip Frame 1
stop();
Symbol 831 MovieClip Frame 1
stop();
Symbol 831 MovieClip Frame 15
stop();
Symbol 834 MovieClip [shot] Frame 1
stop();
Symbol 834 MovieClip [shot] Frame 2
stop();
Symbol 834 MovieClip [shot] Frame 3
stop();
Symbol 834 MovieClip [shot] Frame 4
stop();
Symbol 834 MovieClip [shot] Frame 5
stop();
Symbol 834 MovieClip [shot] Frame 6
stop();
Symbol 834 MovieClip [shot] Frame 7
stop();
Symbol 834 MovieClip [shot] Frame 8
stop();
Symbol 834 MovieClip [shot] Frame 9
stop();
Symbol 835 MovieClip [radarExplosion] Frame 12
stop();
Symbol 836 MovieClip [cloudExplosion] Frame 8
stop();
Symbol 837 MovieClip Frame 31
stop();
Symbol 838 MovieClip [shipExplosion] Frame 9
stop();