Instance of Symbol 521 MovieClip "mcLoader" in Frame 1
onClipEvent (load) {
_root.stop();
}
onClipEvent (enterFrame) {
i = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
txtPercentLoaded = i;
trace((((i + " getBytesLoaded:") + _root.getBytesLoaded()) + " getBytesTotal:") + _root.getBytesTotal());
if (i >= 100) {
this.gotoAndStop(2);
}
}
Frame 233
function setDefaultKeys() {
keyQualityToggle = 79;
keyMusicOnOff = 77;
keyPauseGame = 80;
trace("setting default keys");
key_pLMoveRight = 68;
key_pLMoveLeft = 65;
key_pLMoveUp = 87;
key_pLMoveDown = 83;
key_pLWalking = 16;
key_pLNextWeapon = 69;
key_pLPrevWeapon = 81;
key_pLUse = 87;
key_pLJump = 32;
key_pLMap = 50;
key_pLInventory = 51;
}
function displayKeyAssignments() {
arrKeyCodeValue = new Array();
arrKeyCodeValue[8] = "Backspace";
arrKeyCodeValue[9] = "Tab";
arrKeyCodeValue[12] = "Clear";
arrKeyCodeValue[13] = "Enter";
arrKeyCodeValue[16] = "Shift";
arrKeyCodeValue[17] = "Control";
arrKeyCodeValue[18] = "Alt";
arrKeyCodeValue[20] = "Caps Lock";
arrKeyCodeValue[27] = "Esc";
arrKeyCodeValue[32] = "Spacebar";
arrKeyCodeValue[33] = "Page Up";
arrKeyCodeValue[34] = "Page Down";
arrKeyCodeValue[35] = "End";
arrKeyCodeValue[36] = "Home";
arrKeyCodeValue[37] = "Left Arrow";
arrKeyCodeValue[38] = "Up Arrow";
arrKeyCodeValue[39] = "Right Arrow";
arrKeyCodeValue[40] = "Down Arrow";
arrKeyCodeValue[45] = "Insert";
arrKeyCodeValue[46] = "Delete";
arrKeyCodeValue[47] = "Help";
arrKeyCodeValue[48] = "0";
arrKeyCodeValue[49] = "1";
arrKeyCodeValue[50] = "2";
arrKeyCodeValue[51] = "3";
arrKeyCodeValue[52] = "4";
arrKeyCodeValue[53] = "5";
arrKeyCodeValue[54] = "6";
arrKeyCodeValue[55] = "7";
arrKeyCodeValue[56] = "8";
arrKeyCodeValue[57] = "9";
arrKeyCodeValue[65] = "A";
arrKeyCodeValue[66] = "B";
arrKeyCodeValue[67] = "C";
arrKeyCodeValue[68] = "D";
arrKeyCodeValue[69] = "E";
arrKeyCodeValue[70] = "F";
arrKeyCodeValue[71] = "G";
arrKeyCodeValue[72] = "H";
arrKeyCodeValue[73] = "I";
arrKeyCodeValue[74] = "J";
arrKeyCodeValue[75] = "K";
arrKeyCodeValue[76] = "L";
arrKeyCodeValue[77] = "M";
arrKeyCodeValue[78] = "N";
arrKeyCodeValue[79] = "O";
arrKeyCodeValue[80] = "P";
arrKeyCodeValue[81] = "Q";
arrKeyCodeValue[82] = "R";
arrKeyCodeValue[83] = "S";
arrKeyCodeValue[84] = "T";
arrKeyCodeValue[85] = "U";
arrKeyCodeValue[86] = "V";
arrKeyCodeValue[87] = "W";
arrKeyCodeValue[88] = "X";
arrKeyCodeValue[89] = "Y";
arrKeyCodeValue[90] = "Z";
arrKeyCodeValue[96] = "Numpad 0";
arrKeyCodeValue[97] = "Numpad 1";
arrKeyCodeValue[98] = "Numpad 2";
arrKeyCodeValue[99] = "Numpad 3";
arrKeyCodeValue[100] = "Numpad 4";
arrKeyCodeValue[101] = "Numpad 5";
arrKeyCodeValue[102] = "Numpad 6";
arrKeyCodeValue[103] = "Numpad 7";
arrKeyCodeValue[104] = "Numpad 8";
arrKeyCodeValue[105] = "Numbpad 9";
arrKeyCodeValue[106] = "Numpad Multiply";
arrKeyCodeValue[107] = "Numpad Add";
arrKeyCodeValue[108] = "Numpad Enter";
arrKeyCodeValue[109] = "Numpad Subtract";
arrKeyCodeValue[110] = "Numpad Decimal";
arrKeyCodeValue[111] = "Numpad Divide";
arrKeyCodeValue[112] = "F1";
arrKeyCodeValue[113] = "F2";
arrKeyCodeValue[114] = "F3";
arrKeyCodeValue[115] = "F4";
arrKeyCodeValue[116] = "F5";
arrKeyCodeValue[117] = "F6";
arrKeyCodeValue[118] = "F7";
arrKeyCodeValue[119] = "F8";
arrKeyCodeValue[120] = "F9";
arrKeyCodeValue[121] = "F10";
arrKeyCodeValue[122] = "F11";
arrKeyCodeValue[123] = "F12";
arrKeyCodeValue[124] = "F13";
arrKeyCodeValue[125] = "F14";
arrKeyCodeValue[126] = "F15";
arrKeyCodeValue[144] = "Num Lock";
arrKeyCodeValue[186] = ";";
arrKeyCodeValue[187] = "=";
arrKeyCodeValue[189] = "-";
arrKeyCodeValue[191] = "/";
arrKeyCodeValue[192] = "`";
arrKeyCodeValue[219] = "[";
arrKeyCodeValue[220] = "\\";
arrKeyCodeValue[221] = "]";
arrKeyCodeValue[222] = "'";
menuWindowMC.keyRotateLeftMC.txtKey = arrKeyCodeValue[keyRotateLeft];
menuWindowMC.keyRotateRightMC.txtKey = arrKeyCodeValue[keyRotateRight];
menuWindowMC.keyThrustOnMC.txtKey = arrKeyCodeValue[keyThrustOn];
menuWindowMC.keyQualityToggleMC.txtKey = arrKeyCodeValue[keyQualityToggle];
menuWindowMC.keyMusicOnOffMC.txtKey = arrKeyCodeValue[keyMusicOnOff];
trace("displaying key " + arrKeyCodeValue[221]);
trace("displaying key " + arrKeyCodeValue[221]);
}
function displayKeyValue(obj) {
obj.status = "none";
eval (obj).txtKey = _root.arrKeyCodeValue[_root[obj._name]];
}
function setKeyValue(obj) {
if (obj.status == "selected") {
obj.status = "none";
_root[obj._name] = Key.getCode();
obj.txtKey = _root.arrKeyCodeValue[_root[obj._name]];
}
obj.gotoAndStop(1);
}
function highlightKey(obj) {
if (obj.hitTest(_root._xmouse, _root._ymouse, 1)) {
obj.status = "selected";
obj.gotoAndStop(2);
} else {
obj.status = "none";
obj.gotoAndStop(1);
}
}
function getAngle2toAngle1direction(angle1, angle2) {
angleDiff = angle1 - angle2;
if ((angle1 * angle2) < 0) {
if (angle1 < 0) {
angle1 = angle1 + 180;
angleDiff = -(angle1 - angle2);
} else {
angle2 = angle2 + 180;
angleDiff = -(angle1 - angle2);
}
}
if (angleDiff > 0) {
return(1);
}
return(-1);
}
function setCutSceneDialogue() {
trace((("dialogueArr " + g_missionNo) + "_") + g_taskNo);
dialogueArr = [];
switch ((g_missionNo + "_") + g_taskNo) {
case "1_1" :
addNewDialogueLine("Sp", "Excellent job on your first assignment, Sam. You are ready \nfor a real assignment now. ");
addNewDialogueLine("Sam", "I'm looking forward to it.");
addNewDialogueLine("Sp", "All right, let's get started. This assignment will require \nflexibility. First off, there are some changes. ");
addNewDialogueLine("Sam", "Change? I don't like change that much. Can't I have a \nchoice?");
addNewDialogueLine("Sp", "Since you asked nicely, you can have a choice. You can \neither accept the change or not. That is your choice.");
addNewDialogueLine("Sam", "What happens if I don't accept the assignment?");
addNewDialogueLine("Sp", "You will be of no use to us and therefore will be incinerated. ");
addNewDialogueLine("Sam", "Ooooh! That's not good. I guess I have no choice but to \naccept the change.");
addNewDialogueLine("Sp", "That's the spirit! Here are your new basic movements.");
addNewDialogueLine("Sp", "To roll, move left or right and then press the Down key. \n You may also abort a roll if you wish.");
break;
case "1_2" :
addNewDialogueLine("Sp", "This session will help you practice your climbing skills. ");
addNewDialogueLine("Sp", "You can climb ladders, pipes and other vertical objects \ndepending on the circumstances. ");
addNewDialogueLine("Sp", "How can you climb? Go to any climbable object and press \nthe Grab key. ");
addNewDialogueLine("Sp", "Also, you can press the Grab key during a jump to get on \na climbable object");
addNewDialogueLine("Sp", "On the object, press the Up key to go up and the Down key \n to go down. ");
addNewDialogueLine("Sp", "Simple, right? To leave the object, simply jump off or go to the \nbottom where you'll drop off automatically.");
addNewDialogueLine("Sp", "NOTE: Don't fall too much. You can injure or kill yourself. \nDamage amount depends on height of fall.");
break;
case "1_3" :
addNewDialogueLine("Sp", "This session will introduce you to hanging. You can grab ropes \nand ledges.");
addNewDialogueLine("Sp", "When you are close to something that you can grab (usually \nduring a jump), press the Grab key to grab the object. ");
addNewDialogueLine("Sp", "NOTE: Don't fall too much. You can injure or kill yourself. \nDamage amount depends on height of fall.");
break;
case "1_4" :
addNewDialogueLine("Sp", "To access doors, go to the door and press the Up key.");
break;
case "1_5" :
addNewDialogueLine("Sp", "This training session will introduce you to lock picking. \nWalk to the safe, press the Up key. ");
addNewDialogueLine("Sp", "Then click the START button and follow the path to the \nFINISH within the allowed time. If you go off the path or ");
addNewDialogueLine("Sp", "the time is up you will have to start from the beginning. \nSome safes are alarmed. If you fail, you will have to ");
addNewDialogueLine("Sp", "disable the alarm first. Go to the red button and press \nthe Up key.");
break;
case "1_6" :
addNewDialogueLine("Sp", "Hello, Sam. Welcome to the Virtual Survival Simulation Center. \nYour objective is simple, stay alive as long as you can.");
addNewDialogueLine("Sp", "Good luck.");
break;
case "10_1" :
addNewDialogueLine("Sp", "Now that you are trained, you are ready ready for the \nassignment.");
addNewDialogueLine("Sp", "Are you hungry Sam?");
addNewDialogueLine("Sam", "Strange but Im not.");
addNewDialogueLine("Sp", "Well, I am");
addNewDialogueLine("Sp", "Why don't you bring me some cheese?");
addNewDialogueLine("Sam", "Cheese?");
addNewDialogueLine("Sp", "Its not just any kind of cheese.");
addNewDialogueLine("Sam", "Oh, I see, \"Cheese\".");
addNewDialogueLine("Sp", "Um, yes \"Cheese\".");
addNewDialogueLine("Sp", "Should be a simple assignment, you don't need to take a lot \nof things with you.");
addNewDialogueLine("Sp", "We can keep in touch with this state of the art communicator.");
addNewDialogueLine("Sam", "Great. One question though\u2026");
addNewDialogueLine("Sam", "Why is it pink???");
addNewDialogueLine("Sp", "Pink is the only color that reflects all visible and infrared light. \nIt will render you invisible in virtually any situation.");
addNewDialogueLine("Sam", "Really?");
addNewDialogueLine("Sp", "Unfortunately, no, hehehe. I'm just messing with you. ");
addNewDialogueLine("Sp", "That's the only one left All the others were taken.");
addNewDialogueLine("Sam", "ARGH!!!");
addNewDialogueLine("Sam", "Why do I have to put up with this?!");
addNewDialogueLine("Sp", "Remember the choice?");
addNewDialogueLine("Sam", "Right, right. Still, why pink? ");
addNewDialogueLine("Sp", "Think of it this way. It's much better than finding yourself \ncompletely naked in an unknown place.");
addNewDialogueLine("Sam", "That's true.");
addNewDialogueLine("Sam", "Still\u2026 I mean, c'mon!! Who would need pink?");
addNewDialogueLine("Sp", "Are you done, Sam? ");
addNewDialogueLine("Sam", "Yes.");
addNewDialogueLine("Sp", "All right then, let's try it. Can you hear me?");
addNewDialogueLine("Sam", "Yes, I can.");
addNewDialogueLine("Sp", "Good. Soon a helicopter will take you and drop you off at \nthe target location. ");
addNewDialogueLine("Sp", " I'll give you more instructions along the way. ");
addNewDialogueLine("None", "[ approx 25 to 53 minutes later ]");
addNewDialogueLine("None", "");
break;
case "10_2" :
addNewDialogueLine("None", "");
addNewDialogueLine("Sam", "What the\u2026?");
addNewDialogueLine("Sp", "Sam, youve been spotted. The mission is over. \nGet back to the drop off point. ");
addNewDialogueLine("Sp", "Just one more thing. Sensors indicate some kind of rocket \nlaunch activity. Avoid the rockets.");
break;
case "10_3" :
addNewDialogueLine("None", "");
addNewDialogueLine("Sp", "Oh boy, there goes the helicopter. Seems like we cannot \nget you out of there. Find a way inside and destroy the ");
addNewDialogueLine("Sp", "equipment in the control room. That way they wont be \nable to detect the approaching helicopter. ");
addNewDialogueLine("Sp", " Oh, and since you're there, don't forget to find the cheese.");
addNewDialogueLine("Sam", "Oh, it should be a simple mission. Yeah right!!!");
addNewDialogueLine("Sp", "Sam, don''t be a cry baby! Now is not the time!");
addNewDialogueLine("Sp", "If you get stuck, you may have to blast your way out.");
break;
case "10_4" :
addNewDialogueLine("Sp", "Seems like you entered the building. Here you will be able to \nuse the map with the Map key to locate yourself.");
addNewDialogueLine("Sp", "Intelligence indicates that the building is heavily secured. You \nwill need to find keys to access certain parts of the building.");
addNewDialogueLine("Sp", "Your tasks are: 1) Destroy the equipment in the control room \n2) Find the cheese. 3) Return to the drop off point.");
break;
case "10_5" :
addNewDialogueLine("Sp", "Sam, I have a good news and a bad news. ");
addNewDialogueLine("Sam", "Whats the bad news?");
addNewDialogueLine("Sp", "The rock that you just blasted caused some major explosion \nand the nearby lake is approaching you very fast.");
addNewDialogueLine("Sam", "What''s the good news then?");
addNewDialogueLine("Sp", "You are able to run fast!");
addNewDialogueLine("Sam", "Super!");
break;
case "10_6" :
addNewDialogueLine("None", "[Back at the usual place]");
addNewDialogueLine("Sp", "Excellent! You got the cheese and came back in one piece!");
addNewDialogueLine("Sam", "Can I go home now?");
addNewDialogueLine("Sp", "No, not yet. There's more to do.");
addNewDialogueLine("Sam", "Let me guess, you aren't allowed to tell me where I am.");
addNewDialogueLine("Sp", "That's right. You're still a sharp cookie");
addNewDialogueLine("Sam", "Can you tell me at least what's inside the cheese? What \nmakes this piece of \"cheese\" so special?");
addNewDialogueLine("Sp", "Gold, secret documents, money?");
addNewDialogueLine("Sp", "You're right, There's something really valuable in \nthe \"cheese\"");
addNewDialogueLine("Sp", "Holes.");
addNewDialogueLine("Sam", "Holes? I don't get it.");
addNewDialogueLine("Sp", "Yes, the perfect amount of holes that give the cheese an \nunimaginably great taste.");
addNewDialogueLine("Sam", "Sheesh\u2026 can I at least have some of that chesese?");
addNewDialogueLine("Sp", "No, sorry. There isn't any left. It's all gone. If it's any \nconsolation, you're efforts really paid off.");
addNewDialogueLine("Sam", "I feel like I'm in a bad dream.");
addNewDialogueLine("Sp", "Maybe you are Sam.");
addNewDialogueLine("Sam", "Then all I need to do is pinch myself and I'll wake up.");
addNewDialogueLine("Sam", " [pinch] ");
addNewDialogueLine("Sam", "Ouch, this hurts\u2026 and hmm. Still here.");
addNewDialogueLine("Sp", "Oh, by the way, did you see Bob?");
addNewDialogueLine("Sam", "Bob? Should I have?");
addNewDialogueLine("Sp", "Where did you think our intelligence came from?");
addNewDialogueLine("Sam", "Nope, haven't met anyone named Bob.");
addNewDialogueLine("Sp", "This is not good. Get ready for your next assignment, Sam!");
addNewDialogueLine("None", "");
break;
}
testArray = dialogueArr;
arrNo = testArray.length;
while ((arrNo--) > 0) {
trace(((((" tempEnemyArr :: " + arrNo) + " :: ") + testArray[arrNo][0]) + " :: ") + testArray[arrNo][1]);
}
}
function addNewDialogueLine(currSpeaker, currText) {
trace("addNewDialogueLine");
moveToNextFrame = true;
dialogueArr.push([currSpeaker, currText, moveToNextFrame]);
}
function continueDialogue() {
trace(((dialogueArr.length + dialogueArr[0][0]) + " ") + dialogueArr[0][1]);
if (dialogueArr.length == 0) {
_root.game_start();
} else {
menuWindowMC.cutScenesMC.speakerHeadMC.gotoAndStop(dialogueArr[0][0]);
menuWindowMC.cutScenesMC.txtDialogue = dialogueArr[0][1];
if (dialogueArr[0][2]) {
menuWindowMC.cutScenesMC.nextFrame();
}
dialogueArr.splice(0, 1);
}
}
function updateTimer(time, targetMC) {
targetMC = eval (targetMC);
temp60s = int(time / 60);
temp10s = int((time - (temp60s * 60)) / 10);
temp1s = int((time - (temp60s * 60)) - (temp10s * 10));
displayDigit(targetMC.time_60s_MC, temp60s);
displayDigit(targetMC.time_10s_MC, temp10s);
displayDigit(targetMC.time_1s_MC, temp1s);
}
function displayDigit(numericDigitMC, value) {
if (value == 0) {
numericDigitMC.gotoAndStop(10);
} else {
numericDigitMC.gotoAndStop(value);
}
}
function playSound(sndOwner, sndOwnerMC, soundType, percentToPlay) {
if (Math_random() < percentToPlay) {
arrNo = soundArr.length;
while ((arrNo--) > 0) {
soundObj = soundArr[arrNo];
if ((sndOwner == soundObj.owner) && (soundType == soundObj.soundType)) {
if (soundType == "getsHurt") {
soundNo = 1 + int(soundObj.noOfSounds * Math_random());
} else {
soundNo = "";
}
sndOwnerMC = new Sound();
sndOwnerMC.attachSound(soundObj.soundName + soundNo);
sndOwnerMC.start(0.1, 1);
}
}
}
}
function displayMessage(message) {
statusWindowMC.txtMessage = message;
displayMessageFr = 2 * FPS;
}
Abs = Math.abs;
GetTimer = getTimer;
Math_random = Math.random;
Key_isDown = Key.isDown;
function bgndObj(type, distance, doorSide) {
this.type = type;
this.distance = distance;
this.doorSide = doorSide;
}
function removeAttachedMCs() {
temp_pL_MC = game_MC.pL_MC;
removeMovieClip("game_MC.pL_MC");
trace(" temp_pL_MC gone ------------------------");
removeMovieClip("game_MC.projectileAttachMC");
removeMovieClip("game_MC.pickUpItemMC");
removeMovieClip("game_MC.enemyAttachMC");
removeMovieClip("game_MC.ricochetAttachMC");
removeMovieClip("game_MC.smokeTrailAttachMC");
removeMovieClip("game_MC.explosionParticleAttachMC");
removeMovieClip("game_MC.bgndMC");
removeMovieClip("game_MC.platformMC");
}
function checkLevelCode(levelCode) {
levelCodeArrNo = levelCodeArr.length;
trace("levelCode: " + levelCode);
invalidCode = true;
i = 1;
while (i < levelCodeArr.length) {
j = 1;
while (j < levelCodeArr[i].length) {
trace((((((levelCode + " levelCodeArr[") + i) + "][") + j) + "]: ") + levelCodeArr[i][j].code);
if (levelCode == levelCodeArr[i][j].code) {
eval (("menuWindowMC.mission_" + i) + "_tasks_MC").gotoAndStop("mission_" + i);
k = 1;
while (k < j) {
eval (("menuWindowMC.mission_" + i) + "_tasks_MC").nextFrame();
k++;
}
levelCodeArr[i][j].unlocked = true;
k = 1;
while (k <= j) {
levelCodeArr[i][k].unlocked = true;
k++;
}
invalidCode = false;
trace((((("unlocked mission: " + i) + " task: ") + j) + " with code ") + levelCodeArr[i][j].code);
}
j++;
}
i++;
}
i = 1;
while (i < levelCodeArr.length) {
j = 1;
while (j < levelCodeArr[i].length) {
trace((((("levelCodeArr[" + i) + "][") + j) + "]: ") + levelCodeArr[i][j].unlocked);
j++;
}
i++;
}
if (invalidCode) {
menuWindowMC.txtLevelCode = "Invalid Code";
}
}
function displayUnlockedLevels() {
i = 1;
while (i < levelCodeArr.length) {
j = 1;
while (j < levelCodeArr[i].length) {
if (levelCodeArr[i][j].unlocked) {
eval (("menuWindowMC.mission_" + i) + "_tasks_MC").gotoAndStop("mission_" + i);
k = 1;
while (k < j) {
eval (("menuWindowMC.mission_" + i) + "_tasks_MC").nextFrame();
k++;
}
}
j++;
}
i++;
}
}
function game_Restart() {
temp_g_missionNo = g_missionNo;
temp_g_taskNo = g_taskNo;
game_init();
pL.currentMission = "";
g_taskNo = temp_g_taskNo;
g_missionNo = temp_g_missionNo;
game_start();
}
function game_start() {
stopAllSounds();
g_stat = "play";
g_alarmON = false;
_quality = game_quality;
if (playGameMusic) {
musicSndNo = 1;
musicSnd = new Sound();
musicSnd.attachSound("music" + musicSndNo);
musicSnd.start(0, 1000);
}
menuWindowMC.gotoAndStop("game_start");
onEnterFrame = onEnterFrame_game;
onMouseDown = onMouseDown_game;
onMouseUp = onMouseUp_game;
createEmptyMovieClip("_keyListener", 1);
Key.addListener(_keyListener);
_keyListener.onKeyDown = onKeyDown_game;
menuWindowMC.swapDepths(1000);
game_MC.mapMC.swapDepths(1070);
game_MC.inventoryMC.swapDepths(1075);
doorButtonsMC.swapDepths(1090);
gameCoverMC.swapDepths(1100);
game_MC.crossHairMC.swapDepths(1550);
displayMessage("");
Mouse.hide();
if (pL.currentMission != g_missionNo) {
pL = new Player(levelCodeArr[g_missionNo][g_taskNo].pL_x, levelCodeArr[g_missionNo][g_taskNo].pL_y, 100, "F00000", 100);
pL.weaponsArr = [];
arrNo = 0;
while (arrNo < weaponsArr.length) {
pL.weaponsArr.push(weaponsArr[arrNo]);
arrNo++;
}
pL.grenadeThrowVelocity = 0;
pL.health = 100;
pL_changeWeapon(0);
} else {
pL.x = levelCodeArr[g_missionNo][g_taskNo].pL_x;
pL.y = levelCodeArr[g_missionNo][g_taskNo].pL_y;
}
game_MC.attachMovie("stickman", "pL_MC", pL.layerDepth);
pL_changeWeapon(1);
pL_changeWeapon(-1);
pL_checkHealth();
statusWindowMC.pL_ReloadMC.barMC._xscale = 100;
pL.target = "game_MC.pL_MC";
[pL.target]._x = pL.x;
[pL.target]._y = pL.y;
pL.mouseDown = false;
i = 0;
while (i < pL.weaponsArr.length) {
pL.weaponsArr[i].currReloadFr = 0;
i++;
}
pL.status = "walk";
if (pL.currentMission != g_missionNo) {
roomArr = [];
doorArr = [];
pickUpItemArr = [];
lockArr = [];
buttonArr = [];
switch (g_missionNo) {
case 0 :
pL_setWeaponAmmo([0, 0, 0, 0, 0, 0, 0, 0, 0]);
pL_setWeaponAmmo(["inf", "inf", "inf", "inf", "inf", "inf", "inf", "inf", "inf"]);
setRoomConnections(1, 4, 0, 0, 2);
doorArr.push({roomNo:1, doorNo:1, x:100, y:180, type:"noDoor", connRoom:2, connDoor:2});
doorArr.push({roomNo:1, doorNo:2, x:150, y:180, type:"noDoor", connRoom:2, connDoor:1});
doorArr.push({roomNo:1, doorNo:3, x:190, y:180, type:"knob", connRoom:2, connDoor:3});
doorArr.push({roomNo:1, doorNo:3, x:300, y:roomArr[1].bufferBot, type:"finishedMission", connRoom:4, connDoor:1});
doorArr.push({roomNo:2, doorNo:1, x:100, y:180, type:"noDoor", connRoom:1, connDoor:2});
doorArr.push({roomNo:2, doorNo:2, x:150, y:180, type:"noDoor", connRoom:1, connDoor:1});
doorArr.push({roomNo:2, doorNo:3, x:190, y:180, type:"knob", connRoom:1, connDoor:3});
pickUpItemArr.push(new pickUpItem(true, 1, 1, 150, 180, "uzi", 30));
pickUpItemArr.push(new pickUpItem(true, 2, 1, 150, 180, "health", 10));
break;
case 1 :
setRoomConnections(1, 0, 0, 0, 2);
setRoomConnections(2, 0, 0, 1, 3);
setRoomConnections(3, 0, 0, 2, 4);
setRoomConnections(4, 0, 0, 3, 5);
setRoomConnections(5, 0, 0, 4, 6);
setRoomConnections(6, 0, 0, 5, 7);
doorArr.push({roomNo:4, doorNo:1, x:120, y:210, type:"knob", connRoom:5, connDoor:1});
doorArr.push({roomNo:5, doorNo:1, x:120, y:210, type:"knob", connRoom:4, connDoor:1});
lockArr.push({type:"smallSafe", roomNo:6, x:240, y:210, content:"health", status:"closed"});
buttonArr.push({type:"alarm", roomNo:6, x:330, y:210, action:"alarmOFF", status:"closed"});
pL_setWeaponAmmo(["inf", "inf", "inf", "inf", "inf", 0, "inf", "inf", 0]);
break;
case 2 :
break;
case 10 :
pL.currentMission = g_missionNo;
pL_setWeaponAmmo(["inf", "inf", "inf", "inf", "inf", "inf", "inf", "inf", "inf"]);
pL_setWeaponAmmo(["inf", 30, 30, 0, 0, 0, 0, 0, 0]);
setRoomConnections(1, 4, 0, 0, 2);
setRoomConnections(2, 0, 0, 1, 3);
setRoomConnections(3, 0, 0, 2, 4);
setRoomConnections(4, 0, 0, 3, 5);
setRoomConnections(5, 0, 0, 4, 6);
setRoomConnections(6, 0, 0, 5, 7);
setRoomConnections(7, 0, 0, 6, 8);
setRoomConnections(8, 0, 0, 7, 9);
setRoomConnections(9, 0, 12, 10, 8);
setRoomConnections(10, 0, 11, 5, 9);
setRoomConnections(11, 10, 0, 0, 12);
setRoomConnections(12, 9, 0, 11, 13);
setRoomConnections(13, 0, 16, 12, 14);
setRoomConnections(14, 0, 15, 13, 19);
setRoomConnections(15, 0, 0, 0, 16);
setRoomConnections(16, 0, 0, 15, 0);
setRoomConnections(17, 0, 0, 0, 0);
setRoomConnections(18, 0, 0, 0, 19);
setRoomConnections(19, 0, 0, 18, 20);
setRoomConnections(20, 0, 0, 19, 0);
setRoomConnections(21, 0, 0, 0, 0);
setRoomConnections(22, 0, 0, 0, 23);
setRoomConnections(23, 0, 0, 22, 24);
setRoomConnections(24, 0, 0, 23, 25);
setRoomConnections(25, 0, 0, 24, 0);
setRoomConnections(26, 0, 0, 0, 27);
setRoomConnections(27, 32, 0, 26, 0);
setRoomConnections(28, 0, 0, 0, 29);
setRoomConnections(29, 0, 0, 28, 30);
setRoomConnections(30, 0, 0, 29, 0);
setRoomConnections(31, 0, 0, 0, 32);
setRoomConnections(32, 37, 27, 31, 33);
setRoomConnections(33, 0, 0, 32, 34);
setRoomConnections(34, 0, 0, 33, 35);
setRoomConnections(35, 0, 0, 34, 0);
setRoomConnections(36, 41, 0, 0, 37);
setRoomConnections(37, 42, 32, 36, 38);
setRoomConnections(38, 43, 0, 37, 39);
setRoomConnections(39, 44, 0, 38, 40);
setRoomConnections(40, 45, 0, 39, 0);
setRoomConnections(41, 46, 36, 0, 42);
setRoomConnections(42, 47, 37, 41, 43);
setRoomConnections(43, 48, 38, 42, 44);
setRoomConnections(44, 49, 39, 43, 45);
setRoomConnections(45, 50, 40, 44, 0);
setRoomConnections(46, 51, 41, 0, 47);
setRoomConnections(47, 52, 42, 46, 48);
setRoomConnections(48, 53, 43, 47, 49);
setRoomConnections(49, 54, 44, 48, 50);
setRoomConnections(50, 55, 45, 49, 0);
setRoomConnections(51, 56, 46, 0, 52);
setRoomConnections(52, 57, 47, 51, 53);
setRoomConnections(53, 58, 48, 52, 54);
setRoomConnections(54, 59, 49, 53, 55);
setRoomConnections(55, 60, 50, 54, 0);
setRoomConnections(56, 0, 51, 0, 57);
setRoomConnections(57, 0, 52, 56, 58);
setRoomConnections(58, 0, 53, 57, 59);
setRoomConnections(59, 0, 54, 58, 60);
setRoomConnections(60, 0, 55, 59, 0);
setRoomConnections(101, 0, 0, 0, 0);
setRoomConnections(102, 0, 108, 0, 0);
setRoomConnections(108, 102, 109, 0, 0);
setRoomConnections(109, 108, 110, 0, 0);
setRoomConnections(110, 109, 0, 0, 111);
setRoomConnections(111, 0, 0, 110, 112);
setRoomConnections(112, 0, 0, 111, 113);
setRoomConnections(113, 0, 0, 112, 114);
setRoomConnections(114, 0, 0, 113, 115);
setRoomConnections(115, 0, 0, 114, 0);
setRoomConnections(116, 0, 0, 0, 117);
setRoomConnections(117, 0, 0, 116, 118);
setRoomConnections(118, 0, 0, 117, 119);
setRoomConnections(119, 0, 0, 118, 120);
setRoomConnections(120, 0, 0, 119, 0);
setRoomConnections(121, 0, 0, 0, 122);
setRoomConnections(122, 0, 0, 121, 0);
setRoomConnections(123, 0, 0, 0, 124);
setRoomConnections(124, 0, 0, 123, 125);
setRoomConnections(125, 0, 0, 124, 0);
setRoomConnections(126, 0, 0, 0, 127);
setRoomConnections(127, 0, 0, 126, 0);
setRoomConnections(128, 0, 0, 0, 129);
setRoomConnections(129, 0, 0, 128, 130);
setRoomConnections(130, 0, 0, 129, 0);
setRoomConnections(131, 0, 0, 0, 132);
setRoomConnections(132, 0, 0, 131, 0);
setRoomConnections(133, 0, 0, 0, 134);
setRoomConnections(134, 0, 0, 133, 135);
setRoomConnections(135, 0, 0, 134, 0);
setRoomConnections(136, 0, 0, 0, 137);
setRoomConnections(137, 0, 0, 136, 138);
setRoomConnections(138, 0, 0, 137, 139);
setRoomConnections(139, 0, 0, 138, 140);
setRoomConnections(140, 0, 0, 139, 0);
setRoomConnections(141, 0, 0, 0, 142);
setRoomConnections(142, 0, 0, 141, 143);
setRoomConnections(143, 0, 0, 142, 144);
setRoomConnections(144, 0, 0, 143, 145);
setRoomConnections(145, 0, 0, 144, 0);
setRoomConnections(146, 0, 0, 0, 147);
setRoomConnections(147, 0, 0, 146, 0);
setRoomConnections(148, 0, 0, 0, 0);
setRoomConnections(149, 0, 0, 0, 150);
setRoomConnections(150, 0, 0, 149, 0);
setRoomConnections(151, 0, 0, 0, 152);
setRoomConnections(152, 0, 0, 151, 0);
setRoomConnections(153, 0, 0, 0, 0);
setRoomConnections(154, 0, 0, 0, 155);
setRoomConnections(155, 0, 0, 154, 0);
setRoomConnections(156, 0, 51, 0, 157);
setRoomConnections(157, 0, 52, 156, 158);
setRoomConnections(158, 0, 53, 157, 159);
setRoomConnections(159, 0, 54, 158, 160);
setRoomConnections(160, 0, 55, 159, 0);
setRoomConnections(216, 0, 0, 0, 217);
setRoomConnections(217, 0, 0, 216, 218);
setRoomConnections(218, 0, 0, 217, 219);
setRoomConnections(219, 0, 0, 218, 0);
setRoomConnections(236, 0, 0, 0, 237);
setRoomConnections(237, 0, 0, 236, 238);
setRoomConnections(238, 0, 0, 237, 0);
setRoomConnections(241, 0, 0, 0, 242);
setRoomConnections(242, 0, 0, 241, 243);
setRoomConnections(243, 0, 0, 242, 244);
setRoomConnections(244, 0, 0, 243, 0);
setRoomConnections(246, 0, 0, 0, 247);
setRoomConnections(247, 0, 0, 246, 248);
setRoomConnections(248, 0, 0, 247, 249);
setRoomConnections(249, 0, 0, 248, 0);
setRoomConnections(251, 0, 0, 0, 252);
setRoomConnections(252, 0, 0, 251, 253);
setRoomConnections(253, 0, 0, 252, 254);
setRoomConnections(254, 0, 0, 253, 0);
setRoomConnections(258, 0, 0, 0, 0);
doorArr.push({roomNo:1, doorNo:1, x:150, y:250, type:"noDoor", connRoom:101, connDoor:1});
doorArr.push({roomNo:2, doorNo:1, x:275, y:250, type:"noDoor", connRoom:102, connDoor:1});
doorArr.push({roomNo:15, doorNo:1, x:260, y:245, type:"knob", connRoom:115, connDoor:1});
doorArr.push({roomNo:16, doorNo:1, x:210, y:245, type:"knob", connRoom:116, connDoor:1});
doorArr.push({roomNo:17, doorNo:1, x:295, y:245, type:"knob", connRoom:117, connDoor:1});
doorArr.push({roomNo:18, doorNo:1, x:220, y:245, type:"knob", connRoom:118, connDoor:1});
doorArr.push({roomNo:21, doorNo:1, x:110, y:210, type:"knob", connRoom:121, connDoor:1});
doorArr.push({roomNo:22, doorNo:1, x:360, y:210, type:"knob", connRoom:122, connDoor:1});
doorArr.push({roomNo:23, doorNo:1, x:220, y:210, type:"knob", connRoom:123, connDoor:1});
doorArr.push({roomNo:27, doorNo:1, x:290, y:210, type:"knob", connRoom:127, connDoor:1});
doorArr.push({roomNo:29, doorNo:1, x:360, y:210, type:"knob", connRoom:129, connDoor:1});
doorArr.push({roomNo:34, doorNo:1, x:360, y:210, type:"knob", connRoom:134, connDoor:1});
doorArr.push({roomNo:36, doorNo:1, x:360, y:250, type:"knob", connRoom:136, connDoor:1});
doorArr.push({roomNo:51, doorNo:1, x:270, y:210, type:"knob", connRoom:151, connDoor:1});
doorArr.push({roomNo:53, doorNo:1, x:260, y:210, type:"knob", connRoom:153, connDoor:1});
doorArr.push({roomNo:58, doorNo:1, x:290, y:190, type:"knob", connRoom:158, connDoor:1});
doorArr.push({roomNo:101, doorNo:1, x:150, y:250, type:"noDoor", connRoom:1, connDoor:1});
doorArr.push({roomNo:102, doorNo:1, x:275, y:250, type:"noDoor", connRoom:2, connDoor:1});
doorArr.push({roomNo:115, doorNo:1, x:260, y:245, type:"knob", connRoom:15, connDoor:1});
doorArr.push({roomNo:116, doorNo:1, x:210, y:245, type:"knob", connRoom:16, connDoor:1});
doorArr.push({roomNo:116, doorNo:2, x:110, y:245, type:"knob", connRoom:216, connDoor:1});
doorArr.push({roomNo:117, doorNo:1, x:295, y:245, type:"knob", connRoom:17, connDoor:1});
doorArr.push({roomNo:118, doorNo:1, x:220, y:245, type:"knob", connRoom:18, connDoor:1});
doorArr.push({roomNo:121, doorNo:1, x:110, y:210, type:"knob", connRoom:21, connDoor:1});
doorArr.push({roomNo:122, doorNo:1, x:360, y:210, type:"knob", connRoom:22, connDoor:1});
doorArr.push({roomNo:123, doorNo:1, x:220, y:210, type:"knob", connRoom:23, connDoor:1});
doorArr.push({roomNo:127, doorNo:1, x:290, y:210, type:"knob", connRoom:27, connDoor:1});
doorArr.push({roomNo:129, doorNo:1, x:360, y:210, type:"knob", connRoom:29, connDoor:1});
doorArr.push({roomNo:134, doorNo:1, x:360, y:210, type:"knob", connRoom:34, connDoor:1});
doorArr.push({roomNo:136, doorNo:1, x:360, y:250, type:"knob", connRoom:36, connDoor:1});
doorArr.push({roomNo:138, doorNo:1, x:220, y:250, type:"knob", connRoom:238, connDoor:1});
doorArr.push({roomNo:141, doorNo:1, x:100, y:210, type:"knob", connRoom:241, connDoor:1});
doorArr.push({roomNo:146, doorNo:1, x:100, y:210, type:"knob", connRoom:246, connDoor:1});
doorArr.push({roomNo:148, doorNo:1, x:130, y:210, type:"knob", connRoom:248, connDoor:1});
doorArr.push({roomNo:149, doorNo:1, x:130, y:210, type:"knob", connRoom:249, connDoor:1});
doorArr.push({roomNo:151, doorNo:1, x:270, y:210, type:"knob", connRoom:51, connDoor:1});
doorArr.push({roomNo:151, doorNo:2, x:100, y:210, type:"knob", connRoom:251, connDoor:1});
doorArr.push({roomNo:153, doorNo:2, x:115, y:210, type:"knob", connRoom:253, connDoor:1});
doorArr.push({roomNo:153, doorNo:1, x:260, y:210, type:"knob", connRoom:53, connDoor:1});
doorArr.push({roomNo:154, doorNo:1, x:130, y:210, type:"knob", connRoom:254, connDoor:1});
doorArr.push({roomNo:158, doorNo:1, x:290, y:190, type:"knob", connRoom:58, connDoor:1});
doorArr.push({roomNo:216, doorNo:1, x:110, y:245, type:"knob", connRoom:116, connDoor:2});
doorArr.push({roomNo:238, doorNo:1, x:220, y:250, type:"knob", connRoom:138, connDoor:1});
doorArr.push({roomNo:241, doorNo:1, x:100, y:210, type:"knob", connRoom:141, connDoor:1});
doorArr.push({roomNo:246, doorNo:1, x:100, y:210, type:"knob", connRoom:146, connDoor:1});
doorArr.push({roomNo:248, doorNo:1, x:130, y:210, type:"knob", connRoom:148, connDoor:1});
doorArr.push({roomNo:249, doorNo:1, x:130, y:210, type:"knob", connRoom:149, connDoor:1});
doorArr.push({roomNo:251, doorNo:1, x:100, y:210, type:"knob", connRoom:151, connDoor:2});
doorArr.push({roomNo:253, doorNo:1, x:115, y:210, type:"knob", connRoom:153, connDoor:2});
doorArr.push({roomNo:254, doorNo:1, x:130, y:210, type:"knob", connRoom:154, connDoor:1});
doorArr.push({roomNo:120, doorNo:1, x:335, y:245, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:125, doorNo:1, x:335, y:210, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:130, doorNo:1, x:335, y:210, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:135, doorNo:1, x:335, y:210, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:140, doorNo:1, x:335, y:250, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:145, doorNo:1, x:335, y:210, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:150, doorNo:1, x:335, y:210, type:"doublesliding", noOfDoors:30});
doorArr.push({roomNo:155, doorNo:1, x:335, y:210, type:"doublesliding", noOfDoors:30});
setDoorAccess(138, 1, "key_warehouse");
setDoorAccess(120, 1, "key_basement");
setDoorAccess(125, 1, "key_basement");
setDoorAccess(130, 1, "key_basement");
setDoorAccess(135, 1, "key_basement");
setDoorAccess(145, 1, "key_building");
setDoorAccess(150, 1, "key_building");
setDoorAccess(155, 1, "key_building");
setDoorAccess(153, 2, "electric");
setDoorAccess(248, 1, "electric");
setDoorAccess(253, 1, "electric");
if (testing_only) {
}
lockArr.push({type:"locker", roomNo:17, x:125, y:245, content:"key_basement", status:"closed"});
lockArr.push({type:"locker", roomNo:21, x:300, y:209, content:"health", status:"closed"});
lockArr.push({type:"locker", roomNo:152, x:295, y:210, content:"key_building", status:"closed"});
lockArr.push({type:"smallSafe", roomNo:153, x:320, y:210, content:"key_warehouse", status:"closed"});
lockArr.push({type:"largeSafe", roomNo:236, x:109, y:250, content:"cheese", status:"closed"});
buttonArr.push({type:"alarm", roomNo:119, x:135, y:245, action:"alarmOFF", status:"closed"});
buttonArr.push({type:"alarm", roomNo:124, x:135, y:210, action:"alarmOFF", status:"closed"});
buttonArr.push({type:"switch1", roomNo:126, x:340, y:211, action:"open_controlRoom", status:"closed"});
buttonArr.push({type:"alarm", roomNo:129, x:208, y:210, action:"alarmOFF", status:"closed"});
buttonArr.push({type:"alarm", roomNo:134, x:135, y:210, action:"alarmOFF", status:"closed"});
buttonArr.push({type:"alarm", roomNo:139, x:135, y:250, action:"alarmOFF", status:"closed"});
buttonArr.push({type:"alarm", roomNo:144, x:135, y:210, action:"alarmOFF", status:"closed"});
buttonArr.push({type:"alarm", roomNo:149, x:190, y:210, action:"alarmOFF", status:"closed"});
buttonArr.push({type:"alarm", roomNo:154, x:190, y:210, action:"alarmOFF", status:"closed"});
pickUpItemArr.push(new pickUpItem(true, 20, 1, 338, 245, "uzi", 20));
pickUpItemArr.push(new pickUpItem(true, 28, 1, 100, 211, "machineGun", 50));
pickUpItemArr.push(new pickUpItem(true, 101, 2, 275, 250, "blasterGun", 20));
pickUpItemArr.push(new pickUpItem(true, 101, 1, 238, 250, "health", 25));
pickUpItemArr.push(new pickUpItem(true, 128, 1, 100, 211, "miniGun", 50));
pickUpItemArr.push(new pickUpItem(true, 128, 2, 130, 211, "rocketLauncher", 10));
pickUpItemArr.push(new pickUpItem(true, 128, 3, 160, 211, "flameThrower", 50));
pickUpItemArr.push(new pickUpItem(true, 158, 1, 190, 191, "health", 25));
pickUpItemArr.push(new pickUpItem(true, 158, 2, 220, 191, "rocketLauncher", 10));
pickUpItemArr.push(new pickUpItem(true, 158, 3, 250, 191, "flameThrower", 50));
pickUpItemArr.push(new pickUpItem(true, 219, 1, 338, 245, "uzi", 20));
break;
case 2 :
break;
}
}
game_MC.waterMC._visible = false;
if ((g_missionNo == 10) && (g_taskNo == 5)) {
Water = [];
Water.w = 0;
Water.h = 0;
if (g_difficulty < 1) {
vx = 65 / FPS;
} else if (g_difficulty == 1) {
vx = 78 / FPS;
} else if (g_difficulty > 1) {
vx = 85 / FPS;
}
Water.vx = vx;
Water.vy = Water.vx / 2;
Water.maxW = 2180;
Water.maxH = 820;
Water.screenXarr = [];
Water.screenXarr[1] = 114;
Water.screenXarr[2] = 113;
Water.screenXarr[3] = 112;
Water.screenXarr[4] = 111;
Water.screenXarr[5] = 110;
Water.screenYarr = [];
Water.screenYarr[1] = 110;
Water.screenYarr[2] = 109;
Water.screenYarr[3] = 108;
Water.screenYarr[4] = 102;
Water.movement = "horizontal";
game_MC.waterMC._x = sw;
game_MC.waterMC._y = 100;
game_MC.waterMC._visible = true;
}
g_roomNo = levelCodeArr[g_missionNo][g_taskNo].roomNo;
room_init();
game_FrNo = 0;
startTime = getTimer();
levelCompleteCounter = 0;
statusWindowMC.missionMessageMC._visible = false;
statusWindowMC.missionMessageMC.gotoAndStop(1);
showMap = false;
}
function setDoorAccess(roomNo, doorNo, accessKey) {
i = 0;
while (i < doorArr.length) {
doorObj = doorArr[i];
if ((doorObj.roomNo == roomNo) && (doorObj.doorNo == doorNo)) {
doorObj.accessKey = accessKey;
}
i++;
}
}
function setRoomConnections(roomNo, topNo, bottomNo, leftNo, rightNo) {
roomArr[roomNo] = {bufferTop:40, bufferBot:300, bufferLeft:0, bufferRight:440};
roomArr[roomNo].top = topNo;
roomArr[roomNo].bottom = bottomNo;
roomArr[roomNo].left = leftNo;
roomArr[roomNo].right = rightNo;
}
function room_init() {
currRoom_FrNo = 0;
projectileArr = [];
explosionParticleArr = [];
platformArr = [];
environmentArr = [];
fadeAwayArr = [];
climbingItemArr = [];
noOfBgndItemCreated = 0;
game_MC.createEmptyMovieClip("bgndMC", 20);
noOfpickUpItemCreated = 0;
game_MC.createEmptyMovieClip("pickUpItemMC", 40);
noOfEnemyCreated = 0;
game_MC.createEmptyMovieClip("enemyAttachMC", 60);
noOfPlatformCreated = 0;
game_MC.createEmptyMovieClip("platformMC", 120);
noOfExplosionParticleCreated = 0;
game_MC.createEmptyMovieClip("ExplosionParticleAttachMC", 140);
pL_noOfProjCreated = 0;
game_MC.createEmptyMovieClip("projectileAttachMC", 160);
noOfSmokeTrailCreated = 0;
game_MC.createEmptyMovieClip("smokeTrailAttachMC", 180);
noOfRicochetCreated = 0;
game_MC.createEmptyMovieClip("ricochetAttachMC", 200);
statusWindowMC.txtScreenNo = g_roomNo;
if (g_roomNo < 100) {
game_MC.bgnd_MC.gotoAndStop(("mission_" + g_missionNo) + "_1");
foreground_MC.gotoAndStop(("mission_" + g_missionNo) + "_1");
i = 1;
while (i < g_roomNo) {
game_MC.bgnd_MC.nextFrame();
foreground_MC.nextFrame();
i++;
}
} else if ((g_roomNo > 100) && (g_roomNo < 200)) {
game_MC.bgnd_MC.gotoAndStop(("mission_" + g_missionNo) + "_101");
foreground_MC.gotoAndStop(("mission_" + g_missionNo) + "_101");
i = 1;
while (i < (g_roomNo - 100)) {
game_MC.bgnd_MC.nextFrame();
foreground_MC.nextFrame();
i++;
}
} else {
game_MC.bgnd_MC.gotoAndStop(("mission_" + g_missionNo) + "_201");
foreground_MC.gotoAndStop(("mission_" + g_missionNo) + "_201");
i = 1;
while (i < (g_roomNo - 200)) {
game_MC.bgnd_MC.nextFrame();
foreground_MC.nextFrame();
i++;
}
}
roomBufferTop = 40;
roomBufferBottom = sh - 40;
roomBufferLeft = 0;
roomBufferRight = sw;
trace("----------- room_init----------------------");
switch (g_missionNo) {
case 1 :
switch (g_roomNo) {
case 1 :
createPlatform("black", 0, 260, 440, 105);
createPlatform("black", 0, 10, 20, 270);
createPlatform("black", 419, 2, 20, 211);
createPlatform("black", 93, 41, 27, 198);
createPlatform("black", 263, 41, 27, 198);
createPlatform("black", 175, 240, 29, 23);
createPlatform("black", 335, 240, 29, 23);
break;
case 2 :
createPlatform("black", 0, 240, 75, 105);
createPlatform("black", 397, 260, 42, 40);
createPlatform("black", 0, 10, 10, 270);
createPlatform("black", 43, 109, 100, 5);
createPlatform("black", 190, 40, 10, 109);
createPlatform("black", 150, 185, 100, 5);
createPlatform("black", 430, 13, 10, 187);
climbingItemArr.push({type:"pipe", x:27, y:40, w:6, h:199});
climbingItemArr.push({type:"pipe", x:170, y:40, w:6, h:145});
climbingItemArr.push({type:"pipe", x:220, y:40, w:6, h:145});
climbingItemArr.push({type:"pipe", x:418, y:40, w:6, h:106});
climbingItemArr.push({type:"pipe", x:275, y:40, w:6, h:91});
climbingItemArr.push({type:"pipe", x:322, y:40, w:6, h:91});
climbingItemArr.push({type:"pipe", x:367, y:40, w:6, h:74});
climbingItemArr.push({type:"pipe", x:420, y:166, w:6, h:93});
createEnvironment("water", 75, 260, 328, 41);
break;
case 3 :
createPlatform("black", 0, 240, 75, 105);
createPlatform("black", 171, 235, 75, 105);
createPlatform("black", 387, 260, 75, 40);
createPlatform("black", 0, 10, 10, 270);
createPlatform("black", 0, 130, 75, 25);
createPlatform("black", 0, 95, 25, 40);
createPlatform("black", 227, 90, 35, 223);
createEnvironment("water", 55, 260, 120, 41);
climbingItemArr.push({type:"rope", x:24, y:166, w:150, h:6});
climbingItemArr.push({type:"rope", x:53, y:87, w:147, h:6});
climbingItemArr.push({type:"rope", x:16, y:47, w:395, h:6});
climbingItemArr.push({type:"rope", x:280, y:125, w:134, h:6});
climbingItemArr.push({type:"rope", x:281, y:210, w:134, h:6});
climbingItemArr.push({type:"rope", x:280, y:164, w:32, h:6});
climbingItemArr.push({type:"rope", x:385, y:85, w:32, h:6});
createPlatform("black", 211, 155, 35, 72);
createPlatform("black", 429, 2, 10, 211);
createPlatform("black", 193, 195, 68, 105);
createEnvironment("water", 268, 260, 120, 41);
break;
case 4 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", -2, 110, 77, 115);
createPlatform("white", 358, 110, 77, 115);
break;
case 5 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", -2, 110, 77, 115);
break;
case 6 :
createPlatform("white", 0, 0, 439, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", -2, 110, 77, 114);
break;
case 7 :
createPlatform("black", 0, 260, 439, 65);
createPlatform("black", 0, 10, 10, 270);
createPlatform("black", 0, 35, 440, 15);
createPlatform("black", 430, 13, 10, 312);
break;
}
break;
case 2 :
switch (g_roomNo) {
case 1 :
createPlatform("black", 0, 260, 439, 65);
createPlatform("black", 0, 10, 10, 270);
createPlatform("black", 0, 35, 440, 15);
createPlatform("black", 430, 13, 10, 312);
break;
default :
}
break;
case 10 :
setMission10platforms();
break;
}
i = 0;
while (i < doorArr.length) {
if (noOfPlatformCreated > 500) {
noOfPlatformCreated = 0;
}
doorObj = doorArr[i];
if (doorObj.roomNo == g_roomNo) {
doorID = "door_" + doorObj.type;
doorBgndID = doorID + "_bgnd";
game_MC.bgndMC.attachMovie(doorBgndID, ((doorBgndID + "_") + doorObj.doorNo) + "_MC", ++noOfPlatformCreated);
doorBgndMC = eval (((("game_MC.bgndMC." + doorBgndID) + "_") + doorObj.doorNo) + "_MC");
game_MC.bgndMC.attachMovie(doorID, ((doorID + "_") + doorObj.doorNo) + "_MC", ++noOfPlatformCreated);
doorMC = eval (((("game_MC.bgndMC." + doorID) + "_") + doorObj.doorNo) + "_MC");
doorMC._x = (doorBgndMC._x = doorObj.x);
doorMC._y = (doorBgndMC._y = doorObj.y);
doorObj.target = doorMC;
doorObj.bgndTarget = doorBgndMC;
}
i++;
}
i = 0;
while (i < lockArr.length) {
if (noOfPlatformCreated > 500) {
noOfPlatformCreated = 0;
}
lockObj = lockArr[i];
if (lockObj.roomNo == g_roomNo) {
lockID = "lock_" + lockObj.type;
game_MC.bgndMC.attachMovie(lockID, lockID + "_MC", ++noOfPlatformCreated);
lockMC = eval (("game_MC.bgndMC." + lockID) + "_MC");
lockMC._x = lockObj.x;
lockMC._y = lockObj.y;
lockObj.target = lockMC;
lockMC.gotoAndStop(lockObj.status);
}
i++;
}
i = 0;
while (i < destroyItemArr.length) {
if (noOfPlatformCreated > 500) {
noOfPlatformCreated = 0;
}
destroyItemObj = destroyItemArr[i];
if (destroyItemObj.roomNo == g_roomNo) {
destroyItemID = "destroyItem_" + destroyItemObj.type;
game_MC.bgndMC.attachMovie(destroyItemID, destroyItemID + "_MC", ++noOfPlatformCreated);
destroyItemMC = eval (("game_MC.bgndMC." + destroyItemID) + "_MC");
destroyItemMC._x = destroyItemObj.x;
destroyItemMC._y = destroyItemObj.y;
destroyItemObj.target = destroyItemMC;
destroyItemMC.gotoAndStop(destroyItemObj.status);
}
i++;
}
i = 0;
while (i < buttonArr.length) {
if (noOfPlatformCreated > 500) {
noOfPlatformCreated = 0;
}
buttonObj = buttonArr[i];
if (buttonObj.roomNo == g_roomNo) {
buttonID = "button_" + buttonObj.type;
game_MC.bgndMC.attachMovie(buttonID, buttonID + "_MC", ++noOfPlatformCreated);
buttonMC = eval (("game_MC.bgndMC." + buttonID) + "_MC");
buttonMC._x = buttonObj.x;
buttonMC._y = buttonObj.y;
buttonObj.target = buttonMC;
buttonMC.gotoAndStop(buttonObj.status);
}
i++;
}
i = 0;
while (i < pickUpItemArr.length) {
if (noOfpickUpItemCreated > 500) {
noOfpickUpItemCreated = 0;
}
itemObj = pickUpItemArr[i];
if (itemObj.available && (itemObj.roomNo == g_roomNo)) {
itemID = "pickUpItem";
game_MC.pickUpItemMC.attachMovie(itemID, ((itemID + "_") + itemObj.itemNo) + "_MC", ++noOfpickUpItemCreated);
pickUpItemMC = eval (((("game_MC.pickUpItemMC." + itemID) + "_") + itemObj.itemNo) + "_MC");
pickUpItemMC.gotoAndStop(itemObj.type);
pickUpItemMC._x = itemObj.x;
pickUpItemMC._y = itemObj.y;
itemObj.w = pickUpItemMC._width;
itemObj.h = pickUpItemMC._height;
itemObj.registration = "bottomCenter";
}
i++;
}
enemyArr = [];
tempEnemyArr = [];
if (!roomArr[g_roomNo].visited) {
switch (g_missionNo) {
case 0 :
switch (g_roomNo) {
case 1 :
break;
case 2 :
}
break;
case 1 :
switch (g_roomNo) {
case 7 :
foreground_MC.txtKills = 0;
i = 0;
while (i < 2) {
tempEnemyArr.push(new Stickman((2 * i) * FPS, sw * Math_Random(), 260, 1, selectRandomStickManColor(), "pL_follow", selectRandomStickManWeapon(), 24, 12, 0, 440, 0, 320, 0, 440, 0, 320));
i++;
}
break;
default :
}
break;
case 10 :
switch (g_roomNo) {
case 19 :
case 31 :
case 42 :
break;
default :
g_missionType = "";
}
switch (g_roomNo) {
case 37 :
createPlatform("ManholeCover", 335, 240, 70, 10, 0, 0, 0, 0, 0, 0, true, 9);
createPlatform("ManholeCover", 187, 160, 25, 5, 0, 0, 0, 0, 0, 0, true, 9);
break;
case 115 :
if (g_taskNo == 3) {
createPlatform("Boulder", 250, 220, 46, 25, 0, 0, 0, 0, 0, 0, true, 9);
}
break;
case 57 :
createPlatform("ManholeCover", 125, 185, 48, 5, 0, 0, 0, 0, 0, 0, true, 9);
break;
case 148 :
createPlatform("ControlRoomMachine", 200, 175, 18, 36, 0, 0, 0, 0, 0, 0, true, 20);
createPlatform("ControlRoomMachine", 250, 175, 18, 36, 0, 0, 0, 0, 0, 0, true, 20);
createPlatform("ControlRoomMachine", 300, 175, 18, 36, 0, 0, 0, 0, 0, 0, true, 20);
}
switch (g_taskNo) {
case 1 :
switch (g_roomNo) {
case 2 :
tempEnemyArr.push(new Mine(0, 1, 212, 250));
break;
case 3 :
tempEnemyArr.push(new Mine(0, 1, 212, 250));
break;
case 4 :
tempEnemyArr.push(new Mine(0, 1, 252, 250));
tempEnemyArr.push(new Mine(0, 1, 322, 250));
tempEnemyArr.push(new Stickman(0, 220, 250, 1, "000000", "pL_follow", "pistol", 24, 12, 0, 440, 0, 320, 160, 240, 0, 320));
break;
case 5 :
tempEnemyArr.push(new Mine(0, 1, 62, 250));
tempEnemyArr.push(new Mine(0, 1, 322, 250));
tempEnemyArr.push(new Mine(0, 1, 93, 249));
tempEnemyArr.push(new Mine(0, 1, 252, 250));
tempEnemyArr.push(new Stickman(0, 375, 250, 1, "FFFFFF", "pL_follow", "pistol", 24, 12, 0, 440, 0, 320, 335, 395, 0, 320));
break;
case 6 :
tempEnemyArr.push(new Mine(0, 1, 62, 250));
tempEnemyArr.push(new Mine(0, 1, 322, 250));
tempEnemyArr.push(new Mine(0, 1, 133, 249));
tempEnemyArr.push(new Mine(0, 1, 252, 250));
tempEnemyArr.push(new Stickman(0, 169, 250, 1, "000000", "pL_follow", "pistol", 24, 1, 0, 440, 0, 320, 129, 209, 0, 320));
tempEnemyArr.push(new Stickman(0, 400, 250, 1, "000000", "pL_follow", "pistol", 24, 1, 0, 440, 0, 320, 340, 420, 0, 320));
break;
case 7 :
tempEnemyArr.push(new Mine(0, 1, 62, 250));
tempEnemyArr.push(new Mine(0, 1, 322, 250));
tempEnemyArr.push(new Mine(0, 1, 193, 249));
tempEnemyArr.push(new Mine(0, 1, 252, 250));
break;
case 8 :
}
break;
case 2 :
i = 0;
while (i <= 40) {
tempEnemyArr.push(new Rocket(((i * 0.5) * FPS) / g_difficulty, 40 + (Math_Random() * sw), 80, 1, (100 / FPS) * g_difficulty));
i++;
}
break;
case 3 :
switch (g_roomNo) {
case 1 :
tempEnemyArr.push(new Mine(0, 1, 212, 250));
tempEnemyArr.push(new Stickman(0, 50, 250, 2, "x", "pL_follow", "uzi", 24, 12, 0, 440, 0, 320, 30, 70, 0, 320));
break;
case 108 :
tempEnemyArr.push(new Stickman(0, 250, 245, 2, "x", "pL_follow", "pistol", 24, 3, 0, 440, 185, 250, 210, 290, 0, 320));
break;
case 109 :
tempEnemyArr.push(new Stickman(0, 274, 242, 2, "x", "pL_follow", "pistol", 24, 3, 0, 440, 0, 320, 254, 294, 0, 320));
break;
case 110 :
tempEnemyArr.push(new Stickman(0, 280, 245, 2, "x", "pL_follow", "pistol", 24, 3, 0, 440, 0, 320, 200, 340, 0, 320));
break;
case 111 :
tempEnemyArr.push(new Stickman(0, 90, 245, 2, "x", "pL_follow", "pistol", 24, 3, 0, 440, 0, 320, 50, 130, 0, 320));
tempEnemyArr.push(new Stickman(0, 340, 245, 2, "x", "pL_follow", "blasterGun", 24, 3, 0, 440, 0, 320, 300, 380, 0, 320));
break;
case 112 :
tempEnemyArr.push(new Stickman(0, 233, 196, 2, "x", "pL_follow", "pistol", 24, 3, 0, 440, 0, 320, 193, 273, 0, 320));
break;
case 113 :
tempEnemyArr.push(new Stickman(0, 132, 211, 2, "x", "pL_follow", "blasterGun", 24, 24, 0, 440, 0, 320, 112, 132, 0, 320));
break;
case 114 :
tempEnemyArr.push(new Stickman(0, 345, 244, 2, "x", "pL_follow", "blasterGun", 24, 24, 0, 440, 0, 320, 265, 385, 0, 320));
break;
case 115 :
tempEnemyArr.push(new Stickman(0, 177, 245, 3, "x", "pL_follow", "uzi", 24, 12, 0, 440, 0, 320, 97, 217, 0, 320));
break;
case 116 :
break;
case 236 :
tempEnemyArr.push(new Laser(0, 325, 250));
break;
case 237 :
tempEnemyArr.push(new Laser(0, 125, 250));
break;
}
break;
case 4 :
switch (g_roomNo) {
case 17 :
tempEnemyArr.push(new Stickman(0, 155, 245, 1, "x", "pL_follow", "pistol", 24, 1, 0, 440, 0, 320, 115, 235, 0, 320));
break;
case 18 :
tempEnemyArr.push(new Stickman(0, 365, 245, 1, "x", "pL_follow", "pistol", 24, 1, 0, 440, 0, 320, 325, 445, 0, 320));
break;
case 19 :
break;
case 20 :
tempEnemyArr.push(new Stickman(0, 155, 245, 1, "x", "pL_follow", "pistol", 24, 1, 0, 440, 0, 320, 115, 235, 0, 320));
tempEnemyArr.push(new Stickman(0, 205, 245, 1, "x", "pL_follow", "pistol", 24, 1, 0, 440, 0, 320, 165, 285, 0, 320));
break;
case 21 :
break;
case 22 :
break;
case 23 :
tempEnemyArr.push(new Stickman(0, 170, 210, 1, "x", "pL_follow", "pistol", 24, 1, 0, 440, 0, 320, 130, 250, 0, 320));
break;
case 24 :
tempEnemyArr.push(new Stickman(0, 160, 210, 1, "x", "pL_follow", "pistol", 24, 1, 0, 440, 0, 320, 120, 240, 0, 320));
tempEnemyArr.push(new Stickman(0, 250, 210, 1, "x", "pL_follow", "pistol", 24, 1, 0, 440, 0, 320, 210, 330, 0, 320));
break;
case 25 :
break;
case 26 :
break;
case 27 :
break;
case 28 :
tempEnemyArr.push(new Stickman(0, 220, 210, 1, "x", "pL_follow", "pistol", 24, 1, 0, 440, 0, 320, 180, 300, 0, 320));
break;
case 29 :
tempEnemyArr.push(new Stickman(0, 250, 210, 1, "x", "pL_follow", "pistol", 24, 1, 0, 440, 0, 320, 210, 330, 0, 320));
break;
case 30 :
break;
case 31 :
break;
case 32 :
break;
case 33 :
tempEnemyArr.push(new Stickman(0, 250, 210, 1, "x", "pL_follow", "uzi", 24, 14.4, 0, 440, 0, 320, 210, 330, 0, 320));
break;
case 34 :
break;
case 35 :
tempEnemyArr.push(new Stickman(0, 250, 210, 1, "x", "pL_follow", "pistol", 24, 24, 0, 440, 0, 320, 210, 330, 0, 320));
break;
case 36 :
tempEnemyArr.push(new Stickman(0, 202, 250, 1, "x", "pL_follow", "machineGun", 24, 24, 0, 440, 0, 320, 162, 362, 0, 320));
break;
case 37 :
tempEnemyArr.push(new Stickman(0, 250, 250, 1, "x", "pL_follow", "pistol", 24, 24, 0, 440, 0, 320, 130, 330, 0, 320));
break;
case 38 :
break;
case 39 :
tempEnemyArr.push(new Stickman(0, 250, 250, 1, "x", "pL_follow", "machineGun", 24, 16.8, 0, 440, 0, 320, 210, 330, 0, 320));
tempEnemyArr.push(new Stickman(0, 120, 250, 1, "x", "pL_follow", "machineGun", 28.8, 19.2, 0, 440, 0, 320, 80, 200, 0, 320));
break;
case 40 :
tempEnemyArr.push(new Stickman(0, 250, 250, 1, "x", "pL_follow", "machineGun", 24, 24, 0, 440, 0, 320, 210, 330, 0, 320));
break;
case 58 :
tempEnemyArr.push(new Stickman(0, 250, 190, 1, "x", "pL_follow", "uzi", 24, 14.4, 0, 440, 0, 320, 170, 330, 0, 320));
break;
case 59 :
break;
case 60 :
break;
case 118 :
tempEnemyArr.push(new Stickman(0, 177, 245, 3, "x", "pL_follow", "uzi", 24, 12, 0, 440, 0, 320, 97, 217, 0, 320));
break;
case 119 :
break;
case 120 :
break;
case 121 :
break;
case 122 :
break;
case 123 :
tempEnemyArr.push(new Stickman(0, 170, 210, 1, "x", "pL_follow", "pistol", 24, 1, 0, 440, 0, 320, 130, 250, 0, 320));
break;
case 124 :
tempEnemyArr.push(new Stickman(0, 160, 210, 1, "x", "pL_follow", "pistol", 24, 1, 0, 440, 0, 320, 120, 240, 0, 320));
tempEnemyArr.push(new Stickman(0, 250, 210, 1, "x", "pL_follow", "pistol", 24, 1, 0, 440, 0, 320, 210, 330, 0, 320));
break;
case 125 :
break;
case 126 :
break;
case 127 :
break;
case 128 :
tempEnemyArr.push(new Stickman(0, 180, 210, 1, "x", "pL_follow", "rocketLauncher", 24, 1, 0, 440, 0, 320, 140, 260, 0, 320));
break;
case 129 :
tempEnemyArr.push(new Stickman(0, 250, 210, 1, "x", "pL_follow", "pistol", 24, 1, 0, 440, 0, 320, 210, 330, 0, 320));
break;
case 130 :
break;
case 131 :
break;
case 132 :
break;
case 133 :
tempEnemyArr.push(new Stickman(0, 250, 210, 1, "x", "pL_follow", "uzi", 24, 14.4, 0, 440, 0, 320, 210, 330, 0, 320));
break;
case 134 :
break;
case 135 :
tempEnemyArr.push(new Stickman(0, 250, 210, 1, "x", "pL_follow", "pistol", 24, 24, 0, 440, 0, 320, 210, 330, 0, 320));
break;
case 136 :
tempEnemyArr.push(new Stickman(0, 202, 250, 1, "x", "pL_follow", "machineGun", 24, 24, 0, 440, 0, 320, 162, 362, 0, 320));
break;
case 137 :
tempEnemyArr.push(new Stickman(0, 250, 250, 1, "x", "pL_follow", "pistol", 24, 24, 0, 440, 0, 320, 130, 330, 0, 320));
break;
case 138 :
break;
case 139 :
tempEnemyArr.push(new Stickman(0, 250, 250, 1, "x", "pL_follow", "machineGun", 24, 16.8, 0, 440, 0, 320, 210, 330, 0, 320));
tempEnemyArr.push(new Stickman(0, 120, 250, 1, "x", "pL_follow", "machineGun", 28.8, 19.2, 0, 440, 0, 320, 80, 200, 0, 320));
break;
case 140 :
tempEnemyArr.push(new Stickman(0, 250, 250, 1, "x", "pL_follow", "machineGun", 24, 24, 0, 440, 0, 320, 210, 330, 0, 320));
break;
case 141 :
tempEnemyArr.push(new Stickman(0, 254, 210, 1, "x", "pL_follow", "machineGun", 24, 24, 0, 440, 0, 320, 134, 374, 0, 320));
break;
case 142 :
break;
case 143 :
tempEnemyArr.push(new Stickman(0, 254, 210, 1, "x", "pL_follow", "machineGun", 24, 24, 0, 440, 0, 320, 134, 374, 0, 320));
break;
case 144 :
tempEnemyArr.push(new Stickman(0, 202, 210, 1, "x", "pL_follow", "uzi", 24, 24, 0, 440, 0, 320, 82, 322, 0, 320));
break;
case 145 :
tempEnemyArr.push(new Stickman(0, 139, 210, 1, "x", "pL_follow", "machineGun", 24, 24, 0, 440, 0, 320, 19, 259, 0, 320));
break;
case 146 :
tempEnemyArr.push(new Stickman(0, 233, 210, 1, "x", "pL_follow", "machineGun", 24, 24, 0, 440, 0, 320, 113, 353, 0, 320));
break;
case 147 :
tempEnemyArr.push(new Stickman(0, 191, 210, 1, "x", "pL_follow", "rocketLauncher", 24, 24, 0, 440, 0, 320, 71, 311, 0, 320));
break;
case 148 :
tempEnemyArr.push(new Stickman(0, 212, 210, 1, "x", "pL_follow", "machineGun", 24, 24, 0, 440, 0, 320, 172, 252, 0, 320));
break;
case 149 :
tempEnemyArr.push(new Stickman(0, 223, 210, 1, "x", "pL_follow", "uzi", 24, 24, 0, 440, 0, 320, 103, 343, 0, 320));
break;
case 150 :
break;
case 151 :
tempEnemyArr.push(new Stickman(0, 191, 210, 1, "x", "pL_follow", "blasterGun", 24, 24, 0, 440, 0, 320, 71, 311, 0, 320));
break;
case 152 :
tempEnemyArr.push(new Stickman(0, 223, 210, 1, "x", "pL_follow", "machineGun", 24, 24, 0, 440, 0, 320, 103, 343, 0, 320));
break;
case 153 :
tempEnemyArr.push(new Stickman(0, 139, 210, 1, "x", "pL_follow", "machineGun", 24, 24, 0, 440, 0, 320, 99, 179, 0, 320));
break;
case 154 :
break;
case 155 :
tempEnemyArr.push(new Stickman(0, 223, 210, 1, "x", "pL_follow", "blasterGun", 24, 24, 0, 440, 0, 320, 103, 343, 0, 320));
break;
case 217 :
tempEnemyArr.push(new Stickman(0, 177, 245, 3, "x", "pL_follow", "uzi", 24, 12, 0, 440, 0, 320, 97, 217, 0, 320));
break;
case 218 :
tempEnemyArr.push(new Stickman(0, 198, 245, 3, "x", "pL_follow", "uzi", 24, 12, 0, 440, 0, 320, 118, 238, 0, 320));
break;
case 236 :
tempEnemyArr.push(new Laser(0, 325, 250));
break;
case 237 :
tempEnemyArr.push(new Laser(0, 125, 250));
break;
case 238 :
tempEnemyArr.push(new Stickman(0, 118, 250, 1, "x", "pL_follow", "machineGun", 24, 24, 0, 440, 0, 320, 58, 158, 0, 320));
break;
case 243 :
tempEnemyArr.push(new Stickman(0, 219, 210, 3, "x", "pL_follow", "uzi", 24, 12, 0, 440, 0, 320, 139, 259, 0, 320));
break;
case 246 :
tempEnemyArr.push(new Stickman(0, 219, 210, 3, "x", "pL_follow", "uzi", 24, 12, 0, 440, 0, 320, 139, 259, 0, 320));
break;
case 248 :
tempEnemyArr.push(new Stickman(0, 223, 210, 1, "x", "pL_follow", "machineGun", 24, 24, 0, 440, 0, 320, 103, 343, 0, 320));
break;
case 251 :
tempEnemyArr.push(new Stickman(0, 219, 210, 3, "x", "pL_follow", "machineGun", 24, 12, 0, 440, 0, 320, 139, 259, 0, 320));
break;
case 252 :
tempEnemyArr.push(new Stickman(0, 187, 210, 3, "x", "pL_follow", "blasterGun", 24, 12, 0, 440, 0, 320, 107, 227, 0, 320));
break;
case 253 :
tempEnemyArr.push(new Stickman(0, 219, 210, 3, "x", "pL_follow", "machineGun", 24, 12, 0, 440, 0, 320, 139, 259, 0, 320));
break;
case 254 :
tempEnemyArr.push(new Stickman(0, 219, 210, 3, "x", "pL_follow", "uzi", 24, 12, 0, 440, 0, 320, 139, 259, 0, 320));
}
case "x" :
}
break;
case 2999 :
tempEnemyArr.push(new Stickman(0, "pistol", 220, 250, 1, "000000", "pL_follow", 0, 440, 0, 320, 210, 230, 0, 320));
tempEnemyArr.push(new Stickman(0, "machineGun", 320, 180, 6, "FFFFFF", "pL_follow", 0, sw, 0, sh, 0, sw, 0, sh));
tempEnemyArr.push(new Stickman(0, "flameThrower", 40, 180, 6, "000000", "pL_follow", 0, sw, 0, sh, 0, sw, 0, sh));
break;
}
} else {
trace("---------RESTORING ENEMIES -------------------------");
updateRestoredEnemies = true;
if (roomArr[g_roomNo].enemyArr.length > 0) {
enemyArr = roomArr[g_roomNo].enemyArr;
enemyNo = enemyArr.length;
while ((enemyNo--) > 0) {
enemyObj = enemyArr[enemyNo];
if ((noOfEnemyCreated++) > 200) {
noOfEnemyCreated = 0;
}
game_MC.enemyAttachMC.attachMovie(enemyObj.type + enemyObj.typeNo, (((enemyObj.type + enemyObj.typeNo) + "_") + noOfEnemyCreated) + "_MC", noOfEnemyCreated);
enemyMC = eval ((((("game_MC.enemyAttachMC." + enemyObj.type) + enemyObj.typeNo) + "_") + noOfEnemyCreated) + "_MC");
enemyMC._x = enemyObj.x;
enemyMC._y = enemyObj.y;
enemyObj.target = enemyMC;
enemyMC._xscale = enemyMC._xscale * enemyObj.direction;
enemyMC.gotoAndStop(enemyObj.status);
multiPartNo = enemyObj.multiPartArr.length;
while ((multiPartNo--) > 0) {
partObj = enemyObj.multiPartArr[multiPartNo];
if (partObj.damagable) {
partMC = eval ((((enemyObj.target + ".") + partObj.name) + partObj.id) + "_MC");
currFrameNo = 1 + int(partMC._totalframes * (1 - (partObj.health / partObj.fullHealth)));
partMC.gotoAndStop(currFrameNo);
}
}
switch (enemyObj.type) {
case "stickman" :
enemyObj.armRotation = 30;
enemyMC.arms_MC._rotation = (enemyMC.weapon_MC._rotation = enemyObj.armRotation);
enemyMC.arms_MC.gotoAndStop(enemyObj.weaponType);
with (enemyMC.weapon_MC) {
gotoAndStop(enemyObj.weaponType);
flash_MC._x = (lineOfFire_MC._x = nozzle_MC._x);
flash_MC._y = (lineOfFire_MC._y = nozzle_MC._y);
flash_MC.gotoAndStop(1);
lineOfFire_MC.gotoAndStop(1);
}
enemyMC.head_MC.flash_MC.gotoAndStop(1);
enemyMC.body_MC.flash_MC.gotoAndStop(1);
break;
default :
}
}
}
platfromNo = roomArr[g_roomNo].platformArr.length;
while ((platfromNo--) > 0) {
P = roomArr[g_roomNo].platformArr[platfromNo];
createPlatform(P.type, P.x, P.y, P.w, P.h, P.vx, P.vy, P.moveXmin, P.moveXmax, P.moveYmin, P.moveYmax, P.damageble, P.health);
platfromObj = platformArr[platformArr.length - 1];
platfromObj.fullHealth = P.fullHealth;
platfromMC = platfromObj.target;
platfromMC.gotoAndStop(1 + int(platfromMC._totalframes * (1 - (platfromObj.health / platfromObj.fullHealth))));
}
}
if ((g_alarmON && (g_missionNo == 10)) && (enemyArr.length <= 0)) {
y = 0;
switch (g_roomNo) {
case 248 :
case 249 :
case 253 :
case 254 :
y = 210;
break;
case 138 :
case 139 :
y = 250;
}
if (y > 0) {
if (Math.random() > 0.5) {
weaponType = "uzi";
} else {
weaponType = "pistol";
}
xmin = 100;
xmax = 300;
createAlarmEnemy = true;
tempEnemyArr.push(new Stickman(0, x, y, 2, "x", "pL_follow", weaponType, 24, 12, 0, 440, 0, 320, xmin, xmax, 0, 320));
}
}
tempEnemyArr.sortOn("showUpFr");
testArray = tempEnemyArr;
arrNo = testArray.length;
while ((arrNo--) > 0) {
trace(((((" tempEnemyArr :: " + arrNo) + " :: ") + testArray[arrNo].showUpFr) + " :: ") + testArray[arrNo].type);
}
nextEnemyFrNo = tempEnemyArr[0].showUpFr;
if (tempEnemyArr.length > 0) {
moreEnemyToCome = true;
}
}
function selectRandomStickManColor() {
return(stickManColorArr[int(stickManColorArr.length * Math_random())]);
}
function selectRandomStickManWeapon() {
return(stickManWeaponArr[int(stickManColorArr.length * Math_random())]);
}
function reachedroomBuffer(bufferSide) {
saveRoomData();
trace((("g_missionNo: " + g_missionNo) + " :: g_roomNo: ") + g_roomNo);
trace("bufferSide: " + bufferSide);
trace("pL.y: " + pL.y);
switch (bufferSide) {
case "top" :
g_roomNo = roomArr[g_roomNo].top;
pL.y = roomArr[g_roomNo].bufferBot - grav;
break;
case "bottom" :
g_roomNo = roomArr[g_roomNo].bottom;
pL.y = roomArr[g_roomNo].bufferTop;
break;
case "left" :
g_roomNo = roomArr[g_roomNo].left;
pL.x = roomArr[g_roomNo].bufferRight;
break;
case "right" :
g_roomNo = roomArr[g_roomNo].right;
pL.x = roomArr[g_roomNo].bufferLeft;
break;
}
if (g_roomNo == levelCodeArr[g_missionNo][g_taskNo + 1].roomNo) {
game_over("missionComplete");
} else {
trace((("g_missionNo: " + g_missionNo) + " :: g_roomNo: ") + g_roomNo);
room_init();
checkPlatformCollision(pL);
if (pL.climbOrHang) {
foundItem = false;
arrNo = climbingItemArr.length;
while ((arrNo--) > 0) {
climbingObj = climbingItemArr[arrNo];
if (pL.climbingItem.type == climbingObj.type) {
if (bufferSide == "left") {
if (Abs((pL.y - pL.h) - climbingObj.y) < climbingObj.h) {
if ((pL.x > climbingObj.x) && (pL.x < (climbingObj.x + climbingObj.w))) {
foundItem = true;
pL.y = climbingObj.y + pL.h;
}
}
} else if (bufferSide == "right") {
if (Abs((pL.y - pL.h) - climbingObj.y) < climbingObj.h) {
if ((pL.x > climbingObj.x) && (pL.x < (climbingObj.x + climbingObj.w))) {
foundItem = true;
pL.y = climbingObj.y + pL.h;
}
}
} else if (bufferSide == "top") {
if (Abs(pL.x - climbingObj.x) < (climbingObj.w / 2)) {
if ((pL.y > climbingObj.y) && (pL.y < (climbingObj.y + climbingObj.h))) {
foundItem = true;
pL.x = climbingObj.x;
}
}
} else if (bufferSide == "bottom") {
if (Abs(pL.x - climbingObj.x) < (climbingObj.w / 2)) {
if ((pL.y > climbingObj.y) && (pL.y < (climbingObj.y + climbingObj.h))) {
foundItem = true;
pL.x = climbingObj.x;
}
}
}
if (foundItem) {
pL.climbingItem = climbingObj;
arrNo = 0;
}
}
}
}
}
}
function startMissionTask(tempMissionNo, tempTaskNo) {
g_missionNo = tempMissionNo;
g_taskNo = tempTaskNo;
showCutScenes();
}
function resetGameDifficulty() {
g_difficulty = 0;
}
function setGameDifficulty(tempDifficulty) {
switch (tempDifficulty) {
case "easy" :
g_difficulty = 0.5;
break;
case "med" :
g_difficulty = 1;
break;
case "hard" :
g_difficulty = 2;
break;
}
delete pL;
menuWindowMC.gotoAndStop("level_select");
}
function showCutScenes() {
menuWindowMC.gotoAndStop("cutscenes");
menuWindowMC.cutScenesMC.gotoAndStop((("mission_" + g_missionNo) + "_") + g_taskNo);
menuWindowMC.cutScenesMC.txtLevelNo = g_missionNo;
menuWindowMC.cutScenesMC.txtLevelCode = levelCodeArr[g_missionNo][g_taskNo].code;
setCutSceneDialogue();
menuWindowMC.cutScenesMC.speakerHeadMC.gotoAndStop(dialogueArr[0][0]);
menuWindowMC.cutScenesMC.txtDialogue = dialogueArr[0][1];
["menuWindowMC.pL_missionButtonsMC"].removeMovieClip();
missionButtonsMC = menuWindowMC.pL_missionButtonsMC;
missionButtonsMC.removeMovieClip();
dialogueArr.splice(0, 1);
if (playGameMusic) {
musicSndNo = 1;
musicSnd = new Sound();
musicSnd.attachSound("cutSceneMusic" + musicSndNo);
musicSnd.start(0, 1000);
}
}
function pL_setWeaponAmmo(ammoArr) {
i = 0;
while (i < pL.weaponsArr.length) {
if ((ammoArr[i] == "inf") || (ammoArr[i] > 0)) {
pL.weaponsArr[i].available = true;
pL.weaponsArr[i].ammo = ammoArr[i];
} else {
pL.weaponsArr[i].available = false;
pL.weaponsArr[i].ammo = 0;
}
pL.weaponsArr[i].currReloadFr = 0;
i++;
}
}
function setStickManColor(targetMC, tempColor) {
tempColor = "0x" + tempColor;
currColor = new Color(targetMC.head_MC);
currColor.setRGB(tempColor);
currColor = new Color(targetMC.body_MC);
currColor.setRGB(tempColor);
currColor = new Color(targetMC.legs_MC);
currColor.setRGB(tempColor);
currColor = new Color(targetMC.arms_MC);
currColor.setRGB(tempColor);
}
function saveRoomData() {
trace("save Room Data ------------------------------");
if (!roomArr[g_roomNo].visited) {
roomArr[g_roomNo].visited = true;
}
if (enemyArr.length > 0) {
roomArr[g_roomNo].enemyArr = [];
roomArr[g_roomNo].enemyArr = enemyArr;
enemyNo = enemyArr.length;
while ((enemyNo--) > 0) {
objWeaponSoundStop(enemyArr[enemyNo]);
}
}
roomArr[g_roomNo].platformArr = [];
platfromNo = platformArr.length;
while ((platfromNo--) > 0) {
if (platformArr[platfromNo].damageble && (platformArr[platfromNo].health > 0)) {
roomArr[g_roomNo].platformArr.push(platformArr[platfromNo]);
}
}
}
function game_over(status) {
trace("game_over status: " + status);
_quality = "HIGH";
musicSnd.stop("music" + musicSndNo);
objWeaponSoundStop(pL);
enemyNo = enemyArr.length;
while ((enemyNo--) > 0) {
objWeaponSoundStop(enemyArr[enemyNo]);
}
removeAttachedMCs();
delete onEnterFrame;
delete onMouseDown;
delete onMouseUp;
delete _keyListener;
_keyListener.onKeyDown = "";
objWeaponSoundStop(pL);
menuWindowMC._visible = true;
Mouse.show();
switch (status) {
case "missionComplete" :
levelCodeArr[g_missionNo][g_taskNo].unlocked = true;
menuWindowMC.cutScenesMC.txtLevelCode = levelCodeArr[g_missionNo][g_taskNo].code;
if (g_taskNo >= levelCodeArr[g_missionNo].length) {
g_missionNo++;
} else {
g_taskNo++;
}
showCutScenes(g_missionNo, g_taskNo);
return;
case "pL_dead" :
menuWindowMC._visible = true;
menuWindowMC.gotoAndStop("pL_dies");
return;
case "timeIsUp" :
menuWindowMC.gotoAndStop("cutscenes");
return;
}
}
function Player(x, y, health, skinColor, layerDepth) {
this.x = x;
this.y = y;
this.z = 0;
this.status = "";
this.fullHealth = (this.health = health);
this.skinColor = skinColor;
this.h = 30;
this.w = 10;
this.classification = "pL";
this.shape = "rectangle";
this.registration = "bottomCenter";
this.jumpSpeed = 230 / FPS;
this.runSpeed = 120 / FPS;
this.walkSpeed = 60 / FPS;
this.climbSpeed = 60 / FPS;
this.hangSpeed = 60 / FPS;
this.minFallDamageSpeed = 300 / FPS;
this.maxFallDamageSpeed = 500 / FPS;
this.minFallDamage = 0;
if (g_difficulty < 1) {
maxFallDamage = 10;
} else if (g_difficulty == 1) {
maxFallDamage = 25;
} else if (g_difficulty > 1) {
maxFallDamage = 101;
}
this.maxFallDamage = maxFallDamage;
this.maxFallGrabSpeed = 300 / FPS;
this.rollAngSpeed = 500 / FPS;
this.roll_vx = 80 / FPS;
this.rollCounterFr = 1 * FPS;
this.armRotationY = 21;
this.multiPartArr = [];
this.multiPartArr_roll = [];
this.multiPartArr_general = [];
this.multiPartArr[0] = {name:"all", shape:"circle", registration:"bottomCenter", rad:6, health:health};
this.multiPartArr_roll = this.multiPartArr;
this.multiPartArr = [];
this.multiPartArr[0] = {name:"head", shape:"circle", registration:"bottomCenter", rad:4, health:health};
this.multiPartArr[1] = {name:"body", shape:"rectangle", registration:"bottomCenter", health:health};
this.multiPartArr[2] = {name:"legs", shape:"rectangle", registration:"bottomCenter", health:health};
this.multiPartArr_general = this.multiPartArr;
this.layerDepth = layerDepth;
this.key = [];
this.key.basement = false;
this.key.building = false;
this.key.warehouse = false;
this.cheese = false;
if (testing_only) {
this.cheese = true;
this.key.basement = true;
this.key.building = true;
this.key.warehouse = true;
}
this.noOfControlRoomMachines = 0;
}
function Weapon(available, type, ammo, reloadFr, attackDamage) {
this.available = available;
this.type = type;
this.ammo = ammo;
this.reloadFr = reloadFr;
this.currReloadFr = 0;
this.attackDamage = attackDamage;
}
function pickUpItem(available, roomNo, itemNo, x, y, type, quantity) {
this.available = available;
this.roomNo = roomNo;
this.itemNo = itemNo;
this.x = x;
this.y = y;
this.type = type;
this.quantity = quantity;
}
function Projectile(targetMC, type, originObj, x, y, ux, uy, attackDamage) {
this.targetMC = targetMC;
this.type = type;
this.originObj = originObj;
this.x = x;
this.y = y;
switch (type) {
case "rocketLauncher" :
velocity = 400 / FPS;
break;
case "flameThrower" :
velocity = 150 / FPS;
this.timer = 1 * FPS;
break;
case "grenade" :
velocity = 10 + ((pL.grenadeThrowVelocity * 10) / FPS);
this.timer = 2 * FPS;
break;
case "zombieSpit" :
case "GiantSpiderSpit" :
case "GiantWaspSpit" :
case "DemonSpit" :
velocity = 150 / FPS;
break;
}
this.vx = velocity * ux;
this.vy = velocity * uy;
this.attackDamage = attackDamage;
}
function Stickman(showUpFr, x, y, health, skinColor, pathName, weaponType, nextAttackFr, attackIntervalFr, noticeXmin, noticeXmax, noticeYmin, noticeYmax, moveXmin, moveXmax, moveYmin, moveYmax) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "stickman";
this.typeNo = typeNo;
this.x = x;
this.y = y;
if (g_difficulty < 1) {
health = 1;
} else if (g_difficulty == 1) {
health = 2;
} else if (g_difficulty > 1) {
health = 3;
}
this.fullHealth = (this.health = health);
this.v = 100 / FPS;
this.jumpSpeed = 230 / FPS;
this.runSpeed = 100 / FPS;
this.walkSpeed = 40 / FPS;
this.climbSpeed = 40 / FPS;
this.hangSpeed = 40 / FPS;
this.maxFallSpeed = 10000;
this.shape = "rectangle";
this.registration = "bottomCenter";
if (skinColor == "x") {
skinColor = selectRandomStickManColor();
}
this.skinColor = skinColor;
this.w = 40;
this.h = 40;
this.armRotationY = 21;
this.armRotation = 0;
this.pathName = pathName;
this.status = "stand";
this.noticedTarget = false;
this.noticeXmin = noticeXmin;
this.noticeXmax = noticeXmax;
this.noticeYmin = noticeYmin;
this.noticeYmax = noticeYmax;
this.moveXmin = moveXmin;
this.moveXmax = moveXmax;
this.moveYmin = moveYmin;
this.moveYmax = moveYmax;
this.attackDist = 50;
this.gunRotSpeed = 72 / FPS;
switch (weaponType) {
case "pistol" :
case "blasterGun" :
attackIntervalFr = 0.5 * FPS;
break;
case "uzi" :
case "machineGun" :
case "miniGun" :
attackIntervalFr = 1 * FPS;
break;
case "flameThrower" :
attackIntervalFr = 2 * FPS;
break;
case "rocketLauncher" :
attackIntervalFr = 4;
break;
case "laser" :
case "grenade" :
break;
}
this.currNextAttackFr = (this.nextAttackFr = nextAttackFr / g_difficulty);
this.currAttackIntervalFr = (this.attackIntervalFr = attackIntervalFr);
this.weaponType = weaponType;
arrNo = weaponsArr.length;
while ((arrNo--) > 0) {
W = weaponsArr[arrNo];
if (W.type == weaponType) {
this.weaponReloadFr = W.reloadFr;
this.attackDamage = W.attackDamage;
}
}
switch (typeNo) {
case 1 :
break;
case 2 :
this.attackDist = 150;
this.nextAttackFr = FPS;
this.attackDamage = 10;
}
this.multiPartArr = [];
this.multiPartArr[0] = {name:"head", shape:"circle", registration:"bottomCenter", rad:4, hitable:true, damagable:false, damagePercent:1};
this.multiPartArr[1] = {name:"body", shape:"rectangle", registration:"bottomCenter", hitable:true, damagable:false, damagePercent:0.5};
this.multiPartArr[2] = {name:"legs", shape:"rectangle", registration:"bottomCenter", hitable:true, damagable:false, damagePercent:0.25};
this.explosionBodyPartsArr = [];
this.explosionBodyPartsArr.push({name:"head", noOfParts:1});
this.explosionBodyPartsArr.push({name:"leg", noOfParts:6});
this.direction = 1;
}
function Rocket(showUpFr, x, y, health, vy) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "rocket";
this.typeNo = "";
this.x = x;
this.y = y;
this.fullHealth = (this.health = health);
this.vy = vy;
this.shape = "rectangle";
this.registration = "bottomCenter";
this.w = 5;
this.h = 18;
this.attackDamage = 15;
this.direction = 1;
}
function Bat(showUpFr, typeNo, x, y, health, v, pathName, noticeXmin, noticeXmax, noticeYmin, noticeYmax, moveXmin, moveXmax, moveYmin, moveYmax) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "bat";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.fullHealth = (this.health = health);
this.v = v;
this.shape = "circle";
this.registration = "bottomCenter";
this.rad = 5;
this.attackDamage = 3;
this.pathName = pathName;
this.status = "stand";
this.noticedTarget = false;
this.noticeXmin = noticeXmin;
this.noticeXmax = noticeXmax;
this.noticeYmin = noticeYmin;
this.noticeYmax = noticeYmax;
this.moveXmin = moveXmin;
this.moveXmax = moveXmax;
this.moveYmin = moveYmin;
this.moveYmax = moveYmax;
this.multiPartArr = [];
this.multiPartArr[0] = {name:"head", damageable:true, shape:"circle", registration:"bottomCenter", rad:5, health:4, fullHealth:4};
this.multiPartArr[1] = {name:"wing", id:"L", damageable:true, shape:"circle", registration:"center", rad:4, health:1, fullHealth:1};
this.multiPartArr[2] = {name:"wing", id:"R", damageable:true, shape:"circle", registration:"center", rad:4, health:1, fullHealth:1};
this.explosionBodyPartsArr = [];
this.explosionBodyPartsArr.push({name:"head", noOfParts:1});
this.explosionBodyPartsArr.push({name:"wing", noOfParts:2});
this.nextCheckPointX = x;
this.nextCheckPointY = y;
this.reachedCheckPointDist = 5;
this.direction = 1;
}
function Crawler(showUpFr, typeNo, x, y, health, v, pathName, noticeXmin, noticeXmax, noticeYmin, noticeYmax, moveXmin, moveXmax, moveYmin, moveYmax) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "crawler";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.fullHealth = (this.health = health);
this.v = v;
this.shape = "rectangle";
this.registration = "bottomCenter";
this.w = 40;
this.h = 40;
this.pathName = pathName;
this.status = "stand";
this.noticedTarget = false;
this.noticeXmin = noticeXmin;
this.noticeXmax = noticeXmax;
this.noticeYmin = noticeYmin;
this.noticeYmax = noticeYmax;
this.moveXmin = moveXmin;
this.moveXmax = moveXmax;
this.moveYmin = moveYmin;
this.moveYmax = moveYmax;
switch (typeNo) {
case 1 :
this.attackDist = 135;
this.nextAttackFr = 1 * FPS;
this.attackDamage = 10;
break;
case 2 :
this.attackDist = 150;
this.nextAttackFr = FPS;
this.attackDamage = 10;
}
this.multiPartArr = [];
this.multiPartArr[0] = {name:"head", damageable:true, shape:"circle", registration:"bottomCenter", rad:5, health:health, fullHealth:health};
this.multiPartArr[1] = {name:"leg", id:"F", damageable:true, shape:"rectangle", registration:"middleLeft", health:health, fullHealth:health};
this.multiPartArr[2] = {name:"leg", id:"B", damageable:true, shape:"rectangle", registration:"middleLeft", health:health, fullHealth:health};
this.explosionBodyPartsArr = [];
this.explosionBodyPartsArr.push({name:"head", noOfParts:1});
this.explosionBodyPartsArr.push({name:"leg", noOfParts:6});
this.direction = 1;
}
function Grass(showUpFr, typeNo, x, y, health) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "grass";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.fullHealth = (this.health = health);
this.status = "stand";
this.attackDamage = 3;
this.currAttackFr = 0;
this.nextAttackFr = 1 * FPS;
this.attackDist = 15;
this.direction = 1;
}
function Mine(showUpFr, typeNo, x, y) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "mine";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.status = "wait";
this.attackDist = 25;
this.attackDamage = 5;
this.attackFr = 0.5 * FPS;
this.direction = 1;
trace("------------this.type: " + this.type);
trace("------------this.type: " + this.type);
trace("------------this.type: " + this.type);
trace("------------this.type: " + this.type);
}
function Laser(showUpFr, x, y) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "laser";
this.x = x;
this.y = y;
this.patternArr = [];
this.patternArr = Laser_pattern1_Arr;
this.nextPatternFr = 1 * FPS;
this.patternNo = 0;
this.currPattern = this.patternArr[this.patternNo];
this.attackDamage = 4;
this.direction = 1;
trace("------------this.type: " + this.type);
trace("------------this.type: " + this.type);
trace("------------this.type: " + this.type);
trace("------------this.type: " + this.type);
}
function Wasp(showUpFr, typeNo, x, y, health, v, pathName, noticeXmin, noticeXmax, noticeYmin, noticeYmax, moveXmin, moveXmax, moveYmin, moveYmax) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "wasp";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.fullHealth = (this.health = health);
this.v = v;
this.shape = "rectangle";
this.registration = "bottomCenter";
this.w = 10;
this.h = 4;
this.attackDamage = 3;
this.pathName = pathName;
this.status = "stand";
this.noticedTarget = false;
this.noticeXmin = noticeXmin;
this.noticeXmax = noticeXmax;
this.noticeYmin = noticeYmin;
this.noticeYmax = noticeYmax;
this.moveXmin = moveXmin;
this.moveXmax = moveXmax;
this.moveYmin = moveYmin;
this.moveYmax = moveYmax;
this.multiPartArr = [];
this.multiPartArr[0] = {name:"body", damageable:true, shape:"circle", registration:"bottomCenter", rad:3, health:health};
this.multiPartArr[1] = {name:"head", damageable:true, shape:"circle", registration:"center", rad:4, health:health / 2, fullHealth:health / 2};
this.explosionBodyPartsArr = [];
this.explosionBodyPartsArr.push({name:"body", noOfParts:1});
this.explosionBodyPartsArr.push({name:"head", noOfParts:1});
this.nextCheckPointX = x;
this.nextCheckPointY = y;
this.reachedCheckPointDist = 5;
this.direction = 1;
}
function Zombie(showUpFr, typeNo, x, y, health, v, pathName, noticeXmin, noticeXmax, noticeYmin, noticeYmax, moveXmin, moveXmax, moveYmin, moveYmax) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "zombie";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.fullHealth = (this.health = health);
this.v = v;
this.shape = "rectangle";
this.registration = "bottomCenter";
this.w = 10;
this.h = 30;
this.pathName = pathName;
this.status = "stand";
this.noticedTarget = false;
this.noticeXmin = noticeXmin;
this.noticeXmax = noticeXmax;
this.noticeYmin = noticeYmin;
this.noticeYmax = noticeYmax;
this.moveXmin = moveXmin;
this.moveXmax = moveXmax;
this.moveYmin = moveYmin;
this.moveYmax = moveYmax;
switch (typeNo) {
case 1 :
this.attackDist = 15;
this.nextAttackFr = 10;
this.attackDamage = 5;
break;
case 2 :
this.attackDist = 150;
this.nextAttackFr = FPS;
this.attackDamage = 10;
}
this.multiPartArr = [];
this.multiPartArr[0] = {name:"head", damageable:true, shape:"circle", registration:"bottomCenter", rad:4, health:health / 2, fullHealth:health / 2};
this.multiPartArr[1] = {name:"body", damageable:true, shape:"rectangle", registration:"bottomCenter", health:health / 2, fullHealth:health / 2};
this.multiPartArr[2] = {name:"legs", damageable:true, shape:"rectangle", registration:"bottomCenter", health:health / 2, fullHealth:health / 2};
this.multiPartArr[3] = {name:"arms", damageable:true, shape:"rectangle", registration:"middleLeft", health:health / 2, fullHealth:health / 2};
this.explosionBodyPartsArr = [];
this.explosionBodyPartsArr.push({name:"head", noOfParts:1});
this.explosionBodyPartsArr.push({name:"body", noOfParts:2});
this.explosionBodyPartsArr.push({name:"leg", noOfParts:4});
this.explosionBodyPartsArr.push({name:"arm", noOfParts:2});
this.direction = 1;
}
function GiantSpider(showUpFr, typeNo, x, y, health, v, pathName) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "GiantSpider";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.fullHealth = (this.health = health);
this.v = v;
this.shape = "rectangle";
this.registration = "bottomCenter";
this.w = 30;
this.h = 52;
this.status = "attack";
this.attackDamage = 5;
this.attackType = 1;
this.currAttackFr = (this.nextAttackFr = 3 * FPS);
this.currCrawlerSpawnFr = (this.nextCrawlerSpawnFr = 15 * FPS);
this.pathName = pathName;
this.checkPointArrNo = 0;
tempPathArr = eval (("checkPoint" + this.pathName) + "_arr");
this.nextCheckPointX = tempPathArr[this.checkPointArrNo][0];
this.nextCheckPointY = tempPathArr[this.checkPointArrNo][1];
this.multiPartArr = [];
this.multiPartArr[0] = {name:"head", damageable:true, shape:"circle", registration:"bottomCenter", rad:15, health:health};
this.multiPartArr[1] = {name:"abdomen", damageable:true, shape:"circle", registration:"bottomCenter", rad:15, health:health};
this.multiPartArr[2] = {name:"tail", id:"F", damageable:true, shape:"circle", registration:"center", rad:2, health:health, fullHealth:health};
this.multiPartArr[3] = {name:"tail", id:"B", damageable:true, shape:"circle", registration:"center", rad:2, health:health, fullHealth:health};
this.explosionBodyPartsArr = [];
this.explosionBodyPartsArr.push({name:"head", noOfParts:4});
this.explosionBodyPartsArr.push({name:"abdomen", noOfParts:1});
this.explosionBodyPartsArr.push({name:"tail", noOfParts:2});
this.reachedCheckPointDist = 5;
this.direction = 1;
}
function GiantWasp(showUpFr, typeNo, x, y, health, v, pathName) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "GiantWasp";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.fullHealth = (this.health = health);
this.v = v;
this.shape = "circle";
this.registration = "center";
this.rad = 40;
this.status = "attack";
this.attackDamage = 5;
this.attackType = 1;
this.currAttackFr = (this.nextAttackFr = 3 * FPS);
this.currCrawlerSpawnFr = (this.nextCrawlerSpawnFr = 5 * FPS);
this.pathName = pathName;
this.checkPointArrNo = 0;
tempPathArr = eval (("checkPoint" + this.pathName) + "_arr");
this.nextCheckPointX = tempPathArr[this.checkPointArrNo][0];
this.nextCheckPointY = tempPathArr[this.checkPointArrNo][1];
this.multiPartArr = [];
this.multiPartArr[0] = {name:"head", damageable:true, shape:"circle", registration:"bottomCenter", rad:7.5, health:health};
this.multiPartArr[1] = {name:"abdomen", damageable:true, shape:"circle", registration:"bottomCenter", rad:10, health:health};
this.multiPartArr[2] = {name:"tail", id:"F", damageable:true, shape:"circle", registration:"bottomCenter", rad:7.5, health:health, fullHealth:health};
this.multiPartArr[3] = {name:"tail", id:"B", damageable:true, shape:"circle", registration:"bottomCenter", rad:6, health:health, fullHealth:health};
this.explosionBodyPartsArr = [];
this.explosionBodyPartsArr.push({name:"head", noOfParts:4});
this.explosionBodyPartsArr.push({name:"abdomen", noOfParts:1});
this.explosionBodyPartsArr.push({name:"eye", noOfParts:2});
this.explosionBodyPartsArr.push({name:"leg", noOfParts:12});
this.reachedCheckPointDist = 5;
this.direction = 1;
}
function Demon(showUpFr, typeNo, x, y, health, v, pathName) {
this.showUpFr = showUpFr;
this.classification = "enemy";
this.type = "Demon";
this.typeNo = typeNo;
this.x = x;
this.y = y;
this.fullHealth = (this.health = health);
this.v = v;
this.shape = "circle";
this.registration = "center";
this.rad = 40;
this.status = "attack";
this.attackDamage = 5;
this.attackType = 1;
this.currAttackFr = (this.nextAttackFr = 3 * FPS);
this.currCrawlerSpawnFr = (this.nextCrawlerSpawnFr = 7 * FPS);
this.pathName = pathName;
this.checkPointArrNo = 0;
tempPathArr = eval (("checkPoint" + this.pathName) + "_arr");
this.nextCheckPointX = tempPathArr[this.checkPointArrNo][0];
this.nextCheckPointY = tempPathArr[this.checkPointArrNo][1];
this.multiPartArr = [];
this.multiPartArr[0] = {name:"head", damageable:true, shape:"circle", registration:"bottomCenter", rad:7.5, health:health};
this.multiPartArr[1] = {name:"abdomen", damageable:true, shape:"circle", registration:"bottomCenter", rad:10, health:health};
this.multiPartArr[2] = {name:"tail", id:"F", damageable:true, shape:"circle", registration:"bottomCenter", rad:7.5, health:health, fullHealth:health};
this.multiPartArr[3] = {name:"tail", id:"B", damageable:true, shape:"circle", registration:"bottomCenter", rad:6, health:health, fullHealth:health};
this.explosionBodyPartsArr = [];
this.explosionBodyPartsArr.push({name:"head", noOfParts:1});
this.explosionBodyPartsArr.push({name:"arm", noOfParts:2});
this.explosionBodyPartsArr.push({name:"body", noOfParts:3});
this.reachedCheckPointDist = 5;
this.direction = 1;
}
function nextCP(tempObj) {
tempObj.checkPointArrNo++;
tempPathArr = eval (("checkPoint" + tempObj.pathName) + "_arr");
if (tempObj.checkPointArrNo >= tempPathArr.length) {
tempObj.checkPointArrNo = 0;
}
tempObj.nextCheckPointX = tempPathArr[tempObj.checkPointArrNo][0];
tempObj.nextCheckPointY = tempPathArr[tempObj.checkPointArrNo][1];
}
function ExplosionParticle(targetMC, debryType, x, y, vx, vy, rotSpeed, startSize, finishSize, durationFr, smokeTrail) {
this.targetMC = targetMC;
this.type = debryType;
this.debryType = debryType;
this.x = x;
this.y = y;
this.vx = vx;
this.vy = vy;
this.rotSpeed = rotSpeed;
this.startSize = startSize;
this.finishSize = finishSize;
this.durationFr = durationFr;
this.sizeChangePerFr = (startSize - finishSize) / durationFr;
this.smokeTrail = smokeTrail;
}
function Platform(target, type, x, y, w, h, vx, vy, moveXmin, moveXmax, moveYmin, moveYmax) {
this.target = target;
this.type = type;
this.classification = "platform";
this.x = x;
this.y = y;
this.w = w;
this.h = h;
this.shape = "rectangle";
this.registration = "topLeft";
this.vx = vx;
this.vy = vy;
this.moveXmin = moveXmin;
this.moveXmax = moveXmax;
this.moveYmin = moveYmin;
this.moveYmax = moveYmax;
}
function createRicochet(type, typeNo, x, y, angle) {
if ((noOfRicochetCreated++) > 500) {
noOfRicochetCreated = 0;
}
game_MC.ricochetAttachMC.attachMovie(type + typeNo, (((type + typeNo) + "_") + noOfRicochetCreated) + "_MC", noOfRicochetCreated);
ricMC = eval ((((("game_MC.ricochetAttachMC." + type) + typeNo) + "_") + noOfRicochetCreated) + "_MC");
ricMC._x = x;
ricMC._y = y;
ricMC._rotation = angle;
ricMC._xscale = int(25 + (75 * Math_random()));
ricMC._yscale = int(50 + (50 * Math_random()));
if (Math_random() > 0.5) {
ricMC._yscale = ricMC._yscale * -1;
}
}
function createExplosionParticle(debryType, x, y, v, angleDeg, startSize, finishSize, durationFr, smokeTrail) {
if ((noOfExplosionParticleCreated++) > 500) {
noOfExplosionParticleCreated = 0;
}
game_MC.explosionParticleAttachMC.attachMovie(debryType, ((debryType + "_") + noOfExplosionParticleCreated) + "_MC", noOfExplosionParticleCreated);
targetMC = eval (((("game_MC.explosionParticleAttachMC." + debryType) + "_") + noOfExplosionParticleCreated) + "_MC");
targetMC._x = x;
targetMC._y = y;
targetMC._xscale = (targetMC._yscale = startSize);
targetMC._rotation = angleDeg;
angleDeg = angleDeg + int(30 * (0.5 - Math_random()));
vx = v * Math.cos((angleDeg / 180) * PI);
vy = v * Math.sin((angleDeg / 180) * PI);
rotSpeed = vel;
explosionParticleArr.push(new ExplosionParticle(targetMC, debryType, x, y, vx, vy, rotSpeed, startSize, finishSize, durationFr, smokeTrail));
}
function createProjectile(originObj, weaponType, x, y, ux, uy, attackDamage) {
if ((pL_noOfProjCreated++) > 500) {
pL_noOfProjCreated = 0;
}
game_MC.projectileAttachMC.attachMovie(weaponType, ((weaponType + "_") + pL_noOfProjCreated) + "_MC", pL_noOfProjCreated);
projMC = eval (((("game_MC.projectileAttachMC." + weaponType) + "_") + pL_noOfProjCreated) + "_MC");
projMC._x = x;
projMC._y = y;
switch (weaponType) {
case "rocketLauncher" :
projMC._rotation = originObj.weaponAngleDeg;
break;
case "flameThrower" :
projMC._rotation = originObj.weaponAngleDeg;
break;
case "grenade" :
game_MC.pL_MC.weapon_MC.arms_MC.gotoAndPlay("throw");
break;
case "zombieSpit" :
case "GiantSpiderSpit" :
case "GiantWaspSpit" :
case "DemonSpit" :
break;
}
projectileArr.push(new Projectile(projMC, weaponType, originObj, x, y, ux, uy, attackDamage));
}
function createPlatform(type, x, y, w, h, vx, vy, moveXmin, moveXmax, moveYmin, moveYmax, damageble, health) {
if ((noOfPlatformCreated++) > 500) {
noOfPlatformCreated = 0;
}
platformType = "platform_" + type;
game_MC.platformMC.attachMovie(platformType, ((platformType + "_") + noOfPlatformCreated) + "_MC", noOfPlatformCreated);
platformMC = eval (((("game_MC.platformMC." + platformType) + "_") + noOfPlatformCreated) + "_MC");
platformMC._x = x;
platformMC._y = y;
platformMC._width = w;
platformMC._height = h;
PlatformObj = [];
PlatformObj.target = platformMC;
PlatformObj.type = type;
PlatformObj.classification = "platform";
PlatformObj.x = x;
PlatformObj.y = y;
PlatformObj.w = w;
PlatformObj.h = h;
if ((vx > 0) || (vy > 0)) {
PlatformObj.vx = vx;
PlatformObj.vy = vy;
PlatformObj.moveXmin = moveXmin;
PlatformObj.moveXmax = moveXmax;
PlatformObj.moveYmin = moveYmin;
PlatformObj.moveYmax = moveYmax;
}
if (damageble) {
PlatformObj.damageble = damageble;
PlatformObj.health = (PlatformObj.fullHealth = health);
}
PlatformObj.shape = "rectangle";
PlatformObj.registration = "topLeft";
platformArr.push(PlatformObj);
}
function createEnvironment(type, x, y, w, h) {
if ((noOfPlatformCreated++) > 500) {
noOfPlatformCreated = 0;
}
environmentType = "environment_" + type;
game_MC.platformMC.attachMovie(environmentType, ((environmentType + "_") + noOfPlatformCreated) + "_MC", noOfPlatformCreated);
environmentMC = eval (((("game_MC.platformMC." + environmentType) + "_") + noOfPlatformCreated) + "_MC");
environmentMC._x = x;
environmentMC._y = y;
environmentMC._width = w;
environmentMC._height = h;
environmentObj = [];
environmentObj.target = environmentMC;
environmentObj.type = type;
environmentObj.classification = "platform";
environmentObj.x = x;
environmentObj.y = y;
environmentObj.w = w;
environmentObj.h = h;
environmentObj.shape = "rectangle";
environmentObj.registration = "topLeft";
environmentArr.push(environmentObj);
}
function pL_changeWeapon(direction) {
objWeaponSoundStop(pL);
if (direction == 0) {
pL.currWeaponNo = 0;
} else {
tempCurrWeaponNo = pL.currWeaponNo;
i = 0;
while (i < pL.weaponsArr.length) {
tempCurrWeaponNo = tempCurrWeaponNo + direction;
if (tempCurrWeaponNo < 0) {
tempCurrWeaponNo = pL.weaponsArr.length - 1;
} else if (tempCurrWeaponNo >= pL.weaponsArr.length) {
tempCurrWeaponNo = 0;
}
if (pL.weaponsArr[tempCurrWeaponNo].available) {
if ((pL.weaponsArr[tempCurrWeaponNo].ammo == "inf") || (pL.weaponsArr[tempCurrWeaponNo].ammo > 0)) {
pL_oldWeaponNo = pL.currWeaponNo;
pL.currWeaponNo = tempCurrWeaponNo;
with (game_MC.pL_MC.weapon_MC) {
gotoAndStop(pL.weaponsArr[tempCurrWeaponNo].type);
flash_MC._x = (lineOfFire_MC._x = nozzle_MC._x);
flash_MC._y = (lineOfFire_MC._y = nozzle_MC._y);
}
game_MC.pL_MC.arms_MC.gotoAndStop(pL.weaponsArr[tempCurrWeaponNo].type);
statusWindowMC.pL_weaponDisplayMC.gotoAndStop(pL.weaponsArr[tempCurrWeaponNo].type);
statusWindowMC.txtAmmo = pL.weaponsArr[tempCurrWeaponNo].ammo;
pL.weaponsArr[pL_oldWeaponNo].currReloadFr = pL.weaponsArr[pL_oldWeaponNo].currReloadFr + game_FrNo;
if (pL.weaponsArr[pL.currWeaponNo].currReloadFr < game_FrNo) {
statusWindowMC.txtReloading = (pL.weaponsArr[pL.currWeaponNo].currReloadFr = 0);
statusWindowMC.pL_ReloadMC.barMC._xscale = 100;
} else {
statusWindowMC.txtReloading = (pL.weaponsArr[pL.currWeaponNo].currReloadFr = pL.weaponsArr[pL.currWeaponNo].currReloadFr - game_FrNo);
statusWindowMC.pL_ReloadMC.barMC._xscale = (100 * (pL.weaponsArr[pL.currWeaponNo].reloadFr - pL.weaponsArr[pL.currWeaponNo].currReloadFr)) / pL.weaponsArr[pL.currWeaponNo].reloadFr;
}
i = pL.weaponsArr.length;
}
}
i++;
}
}
pL.weaponType = pL.weaponsArr[pL.currWeaponNo].type;
pL.attackDamage = pL.weaponsArr[pL.currWeaponNo].attackDamage;
game_MC.pL_MC.weapon_MC.flash_MC.gotoAndStop(1);
game_MC.pL_MC.weapon_MC.lineOfFire_MC.gotoAndStop(1);
game_MC.pL_MC.head_MC.flash_MC.gotoAndStop(1);
game_MC.pL_MC.body_MC.flash_MC.gotoAndStop(1);
pL.mouseDown = false;
}
function pL_updateWeaponFlash() {
with (game_MC.pL_MC.weapon_MC) {
gotoAndStop(pL.weaponsArr[tempCurrWeaponNo].type);
flash_MC._x = (lineOfFire_MC._x = nozzle_MC._x);
flash_MC._y = (lineOfFire_MC._y = nozzle_MC._y);
}
}
function objWeaponSoundStop(obj) {
obj.continuousSoundPlaying = false;
obj.weaponFireSnd.stop(obj.weaponType + "_fire");
}
function lineObjectIntersectionDist(line_x, line_y, line_ux, line_uy, object) {
tempdistancesObj = [];
tempdistancesObj.classification = object.classification;
if (object.shape == "rectangle") {
if (object.registration == "bottomCenter") {
object_xmin = object.x - (object.w / 2);
object_xmax = object.x + (object.w / 2);
object_ymin = object.y - object.h;
object_ymax = object.y;
} else if (object.registration == "topLeft") {
object_xmin = object.x;
object_xmax = object.x + object.w;
object_ymin = object.y;
object_ymax = object.y + object.h;
} else if (object.registration == "middleLeft") {
object_xmin = object.x;
object_xmax = object.x + object.w;
object_ymin = object.y - (object.h / 2);
object_ymax = object.y + (object.h / 2);
} else if (object.registration == "center") {
object_xmin = object.x - (object.w / 2);
object_xmax = object.x + (object.w / 2);
object_ymin = object.y - (object.h / 2);
object_ymax = object.y + (object.h / 2);
}
if ((line_x > object_xmin) && (line_x < object_xmax)) {
if ((line_y > object_ymin) && (line_y < object_ymax)) {
tempdistancesObj.minDist = 1;
tempdistancesObj.minX = line_x;
tempdistancesObj.minY = line_y;
tempdistancesObj.maxDist = 2;
tempdistancesObj.maxX = line_x;
tempdistancesObj.maxY = line_y;
return(tempdistancesObj);
}
}
dist = Math.sqrt(((object_xmin - line_x) * (object_xmin - line_x)) + ((object_ymin - line_y) * (object_ymin - line_y)));
dist_alongLineToOrigin = (line_uy * (object_ymin - line_y)) + (line_ux * (object_xmin - line_x));
sameSide = false;
if (object_xmin > line_x) {
if (line_ux > 0) {
sameSide = true;
}
} else if (object_xmax < line_x) {
if (line_ux < 0) {
sameSide = true;
}
} else if (object_ymin > line_y) {
if (line_uy > 0) {
sameSide = true;
}
} else if (object_ymax < line_y) {
if (line_uy < 0) {
sameSide = true;
}
}
if (sameSide) {
dist_LT = (line_ux * (object_ymin - line_y)) - (line_uy * (object_xmin - line_x));
dist_RT = (line_ux * (object_ymin - line_y)) - (line_uy * (object_xmax - line_x));
dist_LB = (line_ux * (object_ymax - line_y)) - (line_uy * (object_xmin - line_x));
dist_RB = (line_ux * (object_ymax - line_y)) - (line_uy * (object_xmax - line_x));
dist_min = dist_LT;
if (dist_RT < dist_min) {
dist_min = dist_RT;
}
if (dist_LB < dist_min) {
dist_min = dist_LB;
}
if (dist_RB < dist_min) {
dist_min = dist_RB;
}
dist_max = dist_LT;
if (dist_RT > dist_max) {
dist_max = dist_RT;
}
if (dist_LB > dist_max) {
dist_max = dist_LB;
}
if (dist_RB > dist_max) {
dist_max = dist_RB;
}
if (dist_min < 0) {
if (dist_max > 0) {
hitWall_1 = [];
hitWall_1.name = "";
hitWall_2 = [];
hitWall_2.name = "";
if ((dist_LT * dist_LB) < 0) {
hitWall_1.name = "left";
hitWall_1.hitX = object_xmin;
hitWall_1.hitY = line_y + (((object_xmin - line_x) * line_uy) / line_ux);
}
if ((dist_RB * dist_RT) < 0) {
if (hitWall_1.name != "") {
hitWall_2.name = "rigth";
hitWall_2.hitX = object_xmax;
hitWall_2.hitY = line_y + (((object_xmax - line_x) * line_uy) / line_ux);
} else {
hitWall_1.name = "rigth";
hitWall_1.hitX = object_xmax;
hitWall_1.hitY = line_y + (((object_xmax - line_x) * line_uy) / line_ux);
}
}
if ((dist_LB * dist_RB) < 0) {
if (hitWall_1.name != "") {
hitWall_2.name = "top";
hitWall_2.hitY = object_ymax;
hitWall_2.hitX = line_x + (((object_ymax - line_y) * line_ux) / line_uy);
} else {
hitWall_1.name = "top";
hitWall_1.hitY = object_ymax;
hitWall_1.hitX = line_x + (((object_ymax - line_y) * line_ux) / line_uy);
}
}
if ((dist_LT * dist_RT) < 0) {
hitWall_2.hitY = object_ymin;
hitWall_2.hitX = line_x + (((object_ymin - line_y) * line_ux) / line_uy);
hitWall_2.name = "bottom";
}
dist_1 = Math.sqrt(((hitWall_1.hitX - line_x) * (hitWall_1.hitX - line_x)) + ((hitWall_1.hitY - line_y) * (hitWall_1.hitY - line_y)));
dist_2 = Math.sqrt(((hitWall_2.hitX - line_x) * (hitWall_2.hitX - line_x)) + ((hitWall_2.hitY - line_y) * (hitWall_2.hitY - line_y)));
if (dist_1 < dist_2) {
tempdistancesObj.minDist = dist_1;
tempdistancesObj.minX = hitWall_1.hitX;
tempdistancesObj.minY = hitWall_1.hitY;
tempdistancesObj.maxDist = dist_2;
tempdistancesObj.maxX = hitWall_2.hitX;
tempdistancesObj.maxY = hitWall_2.hitY;
} else {
tempdistancesObj.minDist = dist_2;
tempdistancesObj.minX = hitWall_2.hitX;
tempdistancesObj.minY = hitWall_2.hitY;
tempdistancesObj.maxDist = dist_1;
tempdistancesObj.maxX = hitWall_1.hitX;
tempdistancesObj.maxY = hitWall_1.hitY;
}
return(tempdistancesObj);
}
}
}
} else if (object.shape == "circle") {
if (object.registration == "bottomCenter") {
ux = Math.sin((object.rotation * PI) / 180);
uy = Math.cos((object.rotation * PI) / 180);
object_x = object.x + ((object.rad * ux) * object.parentDirection);
object_y = object.y - (object.rad * uy);
} else if (object.registration == "center") {
object_x = object.x;
object_y = object.y;
}
temp_dx = line_x - object_x;
temp_dy = line_y - object_y;
if (((temp_dx * temp_dx) + (temp_dy * temp_dy)) < (object.rad * object.rad)) {
tempdistancesObj.minDist = 1;
tempdistancesObj.minX = line_x;
tempdistancesObj.minY = line_y;
tempdistancesObj.maxDist = 2;
tempdistancesObj.maxX = line_x;
tempdistancesObj.maxY = line_y;
return(tempdistancesObj);
}
dist_perpLineToOrigin = (line_ux * (object_y - line_y)) - (line_uy * (object_x - line_x));
dist_alongLineToOrigin = (line_uy * (object_y - line_y)) + (line_ux * (object_x - line_x));
if (dist_alongLineToOrigin > 0) {
if (Abs(dist_perpLineToOrigin) < object.rad) {
modifierDist = Math.sqrt((object.rad * object.rad) - (dist_perpLineToOrigin * dist_perpLineToOrigin));
tempdistancesObj.minDist = dist_alongLineToOrigin - modifierDist;
tempdistancesObj.maxDist = dist_alongLineToOrigin + modifierDist;
return(tempdistancesObj);
}
}
}
return(0);
}
function lineOfFireHitsWall(tempLine_x, tempLine_y, tempLine_ux, tempLine_uy) {
dist_LT = (tempLine_ux * (roomBufferTop - tempLine_y)) - (tempLine_uy * (roomBufferLeft - tempLine_x));
dist_RT = (tempLine_ux * (roomBufferTop - tempLine_y)) - (tempLine_uy * (roomBufferRight - tempLine_x));
dist_LB = (tempLine_ux * (roomBufferBottom - tempLine_y)) - (tempLine_uy * (roomBufferLeft - tempLine_x));
dist_RB = (tempLine_ux * (roomBufferBottom - tempLine_y)) - (tempLine_uy * (roomBufferRight - tempLine_x));
if ((dist_LT > 0) && (dist_LB < 0)) {
temp_dx = roomBufferLeft - tempLine_x;
temp_dy = (temp_dx * tempLine_uy) / tempLine_ux;
temp_angle = 0;
} else if ((dist_RB > 0) && (dist_RT < 0)) {
temp_dx = roomBufferRight - tempLine_x;
temp_dy = (temp_dx * tempLine_uy) / tempLine_ux;
temp_angle = 180;
} else if ((dist_LB < 0) && (dist_RB > 0)) {
temp_dy = roomBufferTop - tempLine_y;
temp_dx = (temp_dy * tempLine_ux) / tempLine_uy;
temp_angle = 90;
} else if ((dist_LB > 0) && (dist_RB < 0)) {
temp_dy = roomBufferBottom - tempLine_y;
temp_dx = (temp_dy * tempLine_ux) / tempLine_uy;
temp_angle = -90;
}
temp_x = tempLine_x + temp_dx;
temp_y = tempLine_y + temp_dy;
createRicochet("ricochet", 2, temp_x, temp_y, temp_angle);
shortestLineOfFireDist = 1000;
}
function objectGetsHurt(tempObj, damage, temp_x, temp_y, temp_ux, temp_uy) {
if (tempObj.classification == "pL") {
if (pL.status != "dies") {
pL.health = pL.health - (damage * g_difficulty);
if (pL.health <= 0) {
objWeaponSoundStop(pL);
pL.mouseDown = false;
pL.health = 0;
pL.status = "dies";
game_MC.pL_MC.gotoAndStop("dies");
startLevelCompleteCountdown("pL_dead");
i = 1;
while (i < 28) {
createExplosionParticle("bloodsplatterRed1", temp_x, temp_y, 5 * (0.2 + (0.8 * Math.random())), -180 * Math.random(), 15 + (15 * Math.random()), 20, 5 * FPS, false);
i++;
}
playSound("pL", "game_MC", "dies", 1);
} else {
pL_getsHurtCounterFr = FPS / 2;
playSound("pL", "game_MC", "getsHurt", 0.5);
}
temp_angle = (180 / PI) * Math.acos(temp_ux / 1);
if (temp_uy < 0) {
temp_angle = temp_angle * -1;
}
i = 1;
while (i < (damage / 2)) {
createExplosionParticle("bloodsplatterRed1", temp_x, temp_y, 5 * (0.4 + (0.6 * Math.random())), (temp_angle - 180) + (50 * (0.5 - Math.random())), 15 + (15 * Math.random()), 20, 5 * FPS, false);
i++;
}
i = 1;
while (i < (1.5 * damage)) {
createExplosionParticle("bloodsplatterRed1", temp_x, temp_y, (damage * 2) * (0.4 + (0.6 * Math.random())), temp_angle + (30 * (0.5 - Math.random())), 15 + (15 * Math.random()), 20, 5 * FPS, false);
i++;
}
pL_checkHealth();
}
} else if (tempObj.classification == "platform") {
if (tempObj.damageble) {
tempObj.health = tempObj.health - damage;
tempObjMC = eval (tempObj.target);
if (tempObj.health <= 0) {
tempObjMC.removeMovieClip();
noOfDebry = 5;
i = 1;
while (i <= noOfDebry) {
x = tempObj.x + ((i * tempObj.w) / noOfDebry);
y = tempObj.y + (tempObj.h / 2);
debrySize = 100;
startAngle = -90;
createExplosionParticle("debry1", x, y, 4 + (3 * Math.random()), startAngle + (90 * (0.5 - Math.random())), debrySize, debrySize, 5 * FPS, false);
i++;
}
if (tempObj.type == "ControlRoomMachine") {
pL.noOfControlRoomMachines++;
trace("pL.noOfControlRoomMachines: " + pL.noOfControlRoomMachines);
}
platformArr.splice(tempObj.arrayNo, 1);
} else if (tempObjMC._totalframes > 1) {
tempObjMC.gotoAndStop(1 + int(tempObjMC._totalframes * (1 - (tempObj.health / tempObj.fullHealth))));
}
}
} else {
if (tempObj.multiPart.name != "") {
if (tempObj.multiPart.hitable) {
tempObj.health = tempObj.health - (tempObj.multiPart.damagePercent * damage);
} else {
tempObj.health = tempObj.health - damage;
}
if ((tempObj.health <= 0) || (tempObj.multiPart.health <= 0)) {
}
} else {
tempObj.health = tempObj.health - damage;
}
if (tempObj.health <= 0) {
tempObj.health = 0;
tempObjMC = eval (tempObj.target);
tempObjMC.gotoAndStop("explosionParts");
multiPartNo = tempObj.explosionBodyPartsArr.length;
while ((multiPartNo--) > 0) {
partObj = tempObj.multiPartArr[multiPartNo];
explosionObj = tempObj.explosionBodyPartsArr[multiPartNo];
if (damage > 20) {
v_adjust = 20;
} else {
v_adjust = damage;
}
v_adjust = v_adjust / 4;
temp_v = 4 + ((v_adjust * Math_random()) / 2);
subNo = 1;
while (subNo <= explosionObj.noOfParts) {
multiPartMC = eval (((tempObj.target + ".") + explosionObj.name) + subNo);
temp_x = tempObjMC._x + multiPartMC._x;
temp_y = tempObjMC._y + multiPartMC._y;
temp_angle = temp_angle + (20 * (-0.5 + Math_random()));
temp_angle = -90 + (150 * (-0.5 + Math_random()));
createExplosionParticle((tempObj.type + "_") + explosionObj.name, temp_x, temp_y, temp_v, temp_angle, 100, 100, 5 * FPS, false);
explosionPartMC = eval (explosionParticleArr[explosionParticleArr.length - 1].targetMC);
explosionPartMC._rotation = multiPartMC._rotation;
explosionPartMC.gotoAndStop(explosionPartMC._totalframes - int(explosionPartMC._totalframes * (partObj.health / partObj.fullHealth)));
subNo++;
}
}
tempObjMC.gotoAndStop("dies");
fadeAwayArr.push({targetMC:tempObjMC, alpha:100});
objWeaponSoundStop(tempObj);
enemyArr.splice(tempObj.arrayNo, 1);
switch (tempObj.type) {
case "mine" :
i = 1;
while (i < 3) {
debrySize = 50;
startAngle = -90;
createExplosionParticle("debry1", enemyMC._x, enemyMC._y, 4 + (3 * Math.random()), startAngle + (90 * (0.5 - Math.random())), debrySize, debrySize, 5 * FPS, false);
i++;
}
break;
case "stickman" :
setStickManColor(tempObjMC, tempObj.skinColor);
case "zombie" :
case "crawler" :
case "bat" :
case "wasp" :
case "GiantSpider" :
case "GiantWasp" :
i = 1;
while (i < 10) {
i++;
}
break;
case "demon" :
break;
default :
switch (tempObj.shape) {
case "circle" :
enemyArea = (4 * tempObj.rad) * tempObj.rad;
break;
case "rectangle" :
enemyArea = tempObj.w * tempObj.h;
}
noOfDebry = 2 + (enemyArea / 80);
if ((enemyArea / 3) > 100) {
debrySize = 100;
} else if ((enemyArea / 3) < 30) {
debrySize = 30;
} else {
debrySize = 30 + ((enemyArea * 70) / 300);
}
startAngle = 360 * Math.random();
i = 1;
for(;;){
if (i >= 3) {
break;
}
createExplosionParticle("debry1", enemyMC._x, enemyMC._y, noOfDebry, startAngle - ((i * 360) / (enemyArea / 50)), debrySize, 0, 0, false);
i++;
};
}
playSound(tempObj.type, tempObj.target, "dies", 1);
if ((g_missionNo == 1) && (g_taskNo == 6)) {
foreground_MC.txtKills++;
}
} else {
if (tempObj.multiPart.name != "") {
enemyMC = eval ((((tempObj.target + ".") + tempObj.multiPart.name) + tempObj.multiPart.id) + "_MC");
if (tempObj.multiPart.damagable && (enemyMC._totalframes > 1)) {
enemyMC.gotoAndStop(1 + int(enemyMC._totalframes * (1 - (tempObj.multiPart.health / tempObj.multiPart.fullHealth))));
goToFr = 1 + int(enemyMC._totalframes * (1 - (tempObj.multiPart.health / tempObj.multiPart.fullHealth)));
}
}
temp_angle = (180 / PI) * Math.acos(temp_ux / 1);
if (temp_uy < 0) {
temp_angle = temp_angle * -1;
}
switch (tempObj.type) {
case "stickman" :
case "zombie" :
case "crawler" :
case "bat" :
case "wasp" :
case "GiantSpider" :
case "GiantWasp" :
case "Demon" :
case "rocket" :
i = 1;
while (i < 3) {
createExplosionParticle("bloodsplatterRed1", temp_x, temp_y, 8 * (0.2 + (0.8 * Math.random())), (temp_angle - 180) + (40 * (0.5 - Math.random())), 15 + (15 * Math.random()), 20, (0.5 + (0.5 * Math.random())) * FPS, false);
i++;
}
i = 1;
while (i < (3 + damage)) {
createExplosionParticle("bloodsplatterRed1", temp_x, temp_y, 8 * (0.2 + (0.8 * Math.random())), temp_angle + (40 * (0.5 - Math.random())), 15 + (15 * Math.random()), 20, (0.5 + (0.5 * Math.random())) * FPS, false);
i++;
}
playSound(tempObj.type, tempObj.target, "getsHurt", 0.6);
}
}
statusWindowMC.EnemyStatusMC._visible = true;
statusWindowMC.EnemyStatusMC.gotoAndStop(tempObj.type + tempObj.typeNo);
statusWindowMC.EnemyStatusMC.heathMC.barMC._xscale = (100 * tempObj.health) / tempObj.fullHealth;
enemyStatusDisplayFr = 3 * FPS;
}
}
function pL_checkHealth() {
if (pL.health > 100) {
pL.health = 100;
} else if (pL.health <= 0) {
if (testing_only) {
pL.health = 50;
} else {
pL.health = 0;
game_over("pL_dead");
}
}
statusWindowMC.pL_heathMC.barMC._xscale = pL.health;
}
function sgExplodes(sgObj) {
switch (sgObj.type) {
case "turret" :
case "flying" :
case "walker" :
case "rocket" :
explosionRadius = 80;
explosionDamage = 10;
break;
case "rocketLauncher" :
explosionRadius = 40;
explosionDamage = sgObj.attackDamage / 2;
break;
case "flameThrower" :
break;
case "grenade" :
explosionRadius = 20;
explosionDamage = sgObj.attackDamage / 2;
break;
case "bloodsplatterRed1" :
case "bloodsplatterGreen1" :
explosionRadius = 0;
explosionDamage = 0;
case "zombieSpit" :
case "GiantSpiderSpit" :
case "GiantWaspSpit" :
case "DemonSpit" :
explosionRadius = 20;
explosionDamage = sgObj.attackDamage / 2;
break;
case "mine" :
explosionRadius = 25;
explosionDamage = sgObj.attackDamage;
}
if (sgObj.originObj.classification == "pL") {
enemyNo = enemyArr.length;
while ((enemyNo--) > 0) {
}
}
temp_dx = pL.x - sgObj.x;
temp_dy = (pL.y - (pL.h / 2)) - sgObj.y;
temp_dist = Math.sqrt((temp_dx * temp_dx) + (temp_dy * temp_dy));
if (temp_dist < explosionRadius) {
temp_ux = temp_dx / temp_dist;
temp_uy = temp_dy / temp_dist;
temp_x = pL.x + (temp_ux * dist);
temp_y = (pL.y - (pL.h / 2)) + (temp_uy * temp_dist);
damage = sgObj.attackDamage * (1 - (temp_dist / explosionRadius));
objectGetsHurt(pL, damage, pL.x, pL.y - (pL.h / 2), temp_ux, temp_uy);
}
}
function checkPlatformCollision(obj) {
obj.xmin = obj.x - (obj.w / 2);
obj.xmax = obj.x + (obj.w / 2);
obj.ymin = obj.y - obj.h;
obj.ymax = obj.y;
platfromNo = platformArr.length;
while ((platfromNo--) > 0) {
P = platformArr[platfromNo];
if (P.vx != 0) {
if ((P.x < P.moveXmin) || ((P.xmin + P.w) > P.moveXmax)) {
P.vx = P.vx * -1;
}
P.target._x = (P.x = P.x + P.vx);
}
if (P.vy != 0) {
if ((P.y < P.moveYmin) || ((P.ymin + P.w) > P.moveYmax)) {
P.vy = P.vy * -1;
}
P.target._y = (P.y = P.y + P.vy);
}
P.xmin = P.x;
P.xmax = P.xmin + P.w;
P.ymin = P.y;
P.ymax = P.ymin + P.h;
if ((obj.xmax > P.xmin) && (obj.xmin < P.xmax)) {
if ((P.ymin <= obj.ymax) && (P.ymin >= (((obj.ymax - obj.vy) + P.vy) - 1))) {
if (obj.vy > obj.maxFallDamageSpeed) {
obj.health = obj.health - obj.maxFallDamage;
pL_checkHealth();
} else if (obj.vy > obj.minFallDamageSpeed) {
obj.health = obj.health - (obj.minFallDamage + (((obj.maxFallDamage - obj.minFallDamage) * (obj.vy - obj.minFallDamageSpeed)) / (obj.maxFallDamageSpeed - obj.minFallDamageSpeed)));
pL_checkHealth();
}
obj.y = (obj.ymax = P.ymin - P.vx);
obj.vy = 0;
obj.jumping = false;
if (P.vx != 0) {
obj.x = obj.x + ((obj.vx = P.vx));
obj.xmin = obj.x - (obj.w / 2);
obj.xmax = obj.x + (obj.w / 2);
}
if (P.vy != 0) {
}
} else if ((P.ymax >= obj.ymin) && (P.ymax <= (((obj.ymin - obj.vy) + P.vy) + 1))) {
obj.ymin = P.ymax;
obj.y = obj.ymin + obj.h;
obj.vy = 0;
}
if ((obj.ymax > P.ymin) && (obj.ymin < P.ymax)) {
if ((P.xmin <= obj.xmax) && (P.xmin >= ((obj.xmax - obj.vx) + P.vx))) {
obj.xmax = P.xmin;
obj.xmin = obj.xmax - obj.w;
obj.vx = 0;
} else if ((P.xmax >= obj.xmin) && (P.xmax <= ((obj.xmin - obj.vx) + P.vx))) {
obj.xmin = P.xmax;
obj.xmax = obj.xmin + obj.w;
obj.vx = 0;
}
}
}
}
obj.x = (obj.xmin + obj.xmax) / 2;
}
function checkEnvironmentCollision(obj) {
obj.xmin = obj.x - (obj.w / 2);
obj.xmax = obj.x + (obj.w / 2);
obj.ymin = obj.y - obj.h;
obj.ymax = obj.y;
enviroNo = environmentArr.length;
while ((enviroNo--) > 0) {
E = environmentArr[enviroNo];
E.xmin = E.x;
E.xmax = E.xmin + E.w;
E.ymin = E.y;
E.ymax = E.ymin + E.h;
if (obj.ymin > E.ymin) {
if (obj.xmin > E.xmin) {
if (obj.xmax < E.xmax) {
pL.health = -1;
pL_checkHealth();
}
}
}
}
}
function moveObjectTowardObject(movementType, moveObject, towardObject) {
switch (movementType) {
case "x" :
return;
case "y" :
return;
case "xy" :
return;
}
}
function checkIfLineOfFireHitAnything(firingObj, checkPL, checkEnemies, checkPlatforms) {
nothingHitDist = 1000;
shortestLineOfFireObj = [];
shortestLineOfFireObj.minDist = nothingHitDist;
currDistObj = [];
hitObject = [];
hitObject.classification = "nothing";
firingObj_MC = eval (firingObj.target);
tempLineObj = firingObj_MC.weapon_MC.lineOfFire_MC;
nozzleX = firingObj_MC.weapon_MC.nozzle_MC._x;
nozzleY = (firingObj_MC.weapon_MC.nozzle_MC._y * firingObj_MC.weapon_MC._xscale) / 100;
tempLine_x = (firingObj.x + (firingObj.weapon_ux * nozzleX)) - (firingObj.weapon_uy * nozzleY);
tempLine_y = ((firingObj.y - firingObj.armRotationY) + (firingObj.weapon_ux * nozzleY)) + (firingObj.weapon_uy * nozzleX);
if (checkPL && (pL.z == 0)) {
multiPartObj = pL;
currDistObj = lineObjectIntersectionDist(tempLine_x, tempLine_y, firingObj.weapon_ux, firingObj.weapon_uy, multiPartObj);
if (currDistObj.minDist > 0) {
if (currDistObj.minDist < shortestLineOfFireObj.minDist) {
if (multiPartObj.multiPartArr.length <= 0) {
shortestLineOfFireObj = currDistObj;
hitObject = multiPartObj;
hitObject.arrayNo = enemyNo;
} else {
multiPartNo = multiPartObj.multiPartArr.length;
while ((multiPartNo--) > 0) {
partObj = multiPartObj.multiPartArr[multiPartNo];
if (partObj.health > 0) {
partMC = eval ((((multiPartObj.target + ".") + partObj.name) + partObj.id) + "_MC");
if (multiPartObj.vx < 0) {
partObj.parentDirection = -1;
} else {
partObj.parentDirection = 1;
}
partObj.parentDirection = multiPartObj.direction;
partObj.x = partMC._parent._x + (partMC._x * partObj.parentDirection);
partObj.y = partMC._parent._y + partMC._y;
if (partObj.shape == "circle") {
partObj.rotation = partMC._rotation;
} else if (partObj.shape == "rectangle") {
partObj.w = partMC._width;
partObj.h = partMC._height;
}
currDistObj = lineObjectIntersectionDist(tempLine_x, tempLine_y, firingObj.weapon_ux, firingObj.weapon_uy, partObj);
if ((currDistObj.minDist > 0) && (currDistObj.minDist < shortestLineOfFireObj.minDist)) {
shortestLineOfFireObj = currDistObj;
hitObject = multiPartObj;
hitObject.multiPart = partObj;
hitObject.arrayNo = enemyNo;
}
}
}
}
}
}
}
if (checkEnemies) {
enemyNo = enemyArr.length;
while ((enemyNo--) > 0) {
enemyObj = enemyArr[enemyNo];
currDistObj = lineObjectIntersectionDist(tempLine_x, tempLine_y, firingObj.weapon_ux, firingObj.weapon_uy, enemyObj);
if (currDistObj.minDist > 0) {
if (currDistObj.minDist < shortestLineOfFireObj.minDist) {
if (enemyObj.multiPartArr.length <= 0) {
shortestLineOfFireObj = currDistObj;
hitObject = enemyObj;
hitObject.arrayNo = enemyNo;
} else {
multiPartNo = enemyObj.multiPartArr.length;
while ((multiPartNo--) > 0) {
partObj = enemyObj.multiPartArr[multiPartNo];
if (tempObj.multiPart.hitable) {
}
if (partObj.hitable > 0) {
partMC = eval ((((enemyObj.target + ".") + partObj.name) + partObj.id) + "_MC");
partObj.x = enemyObj.target._x + (partMC._x * enemyObj.direction);
partObj.y = enemyObj.target._y + partMC._y;
if (partObj.shape == "circle") {
partObj.rotation = partMC._rotation;
} else if (partObj.shape == "rectangle") {
partObj.w = partMC._width;
partObj.h = partMC._height;
}
partObj.parentDirection = enemyObj.direction;
currDistObj = lineObjectIntersectionDist(tempLine_x, tempLine_y, firingObj.weapon_ux, firingObj.weapon_uy, partObj);
if ((currDistObj.minDist > 0) && (currDistObj.minDist < shortestLineOfFireObj.minDist)) {
shortestLineOfFireObj = currDistObj;
hitObject = enemyObj;
hitObject.multiPart = partObj;
hitObject.arrayNo = enemyNo;
}
}
}
}
}
}
}
}
if (checkPlatforms) {
platformNo = platformArr.length;
while ((platformNo--) > 0) {
currDistObj = lineObjectIntersectionDist(tempLine_x, tempLine_y, firingObj.weapon_ux, firingObj.weapon_uy, platformArr[platformNo]);
currDist = currDistObj.minDist;
if (currDistObj.minDist > 0) {
if (currDistObj.minDist < shortestLineOfFireObj.minDist) {
shortestLineOfFireObj = currDistObj;
hitObject = platformArr[platformNo];
hitObject.arrayNo = platformNo;
}
}
}
}
if (shortestLineOfFireObj.minDist > 0) {
switch (hitObject.classification) {
case "pL" :
temp_x = tempLine_x + (shortestLineOfFireObj.minDist * firingObj.weapon_ux);
temp_y = tempLine_y + (shortestLineOfFireObj.minDist * firingObj.weapon_uy);
objectGetsHurt(hitObject, firingObj.attackDamage, temp_x, temp_y, firingObj.weapon_ux, firingObj.weapon_uy);
case "platform" :
temp_angle = (180 / Math.PI) * Math.atan(firingObj.weapon_uy / firingObj.weapon_ux);
temp_x = tempLine_x + (shortestLineOfFireObj.minDist * firingObj.weapon_ux);
temp_y = tempLine_y + (shortestLineOfFireObj.minDist * firingObj.weapon_uy);
createRicochet("ricochet", 1, temp_x, temp_y, firingObj.weaponAngleDeg + 180);
objectGetsHurt(hitObject, firingObj.attackDamage, temp_x, temp_y, firingObj.weapon_ux, firingObj.weapon_uy);
break;
case "enemy" :
temp_angle = (180 / Math.PI) * Math.atan(firingObj.weapon_uy / firingObj.weapon_ux);
temp_x = tempLine_x + (shortestLineOfFireObj.minDist * firingObj.weapon_ux);
temp_y = tempLine_y + (shortestLineOfFireObj.minDist * firingObj.weapon_uy);
objectGetsHurt(hitObject, firingObj.attackDamage, temp_x, temp_y, firingObj.weapon_ux, firingObj.weapon_uy);
temp_x = tempLine_x + (shortestLineOfFireObj.maxDist * firingObj.weapon_ux);
temp_y = tempLine_y + (shortestLineOfFireObj.maxDist * firingObj.weapon_uy);
break;
case "nothing" :
}
} else {
shortestLineOfFireObj.minDist = 1000;
}
firingObj_MC.weapon_MC.flash_MC.gotoAndPlay(firingObj.weaponType);
firingObj_MC.weapon_MC.lineOfFire_MC.gotoAndPlay(2);
firingObj_MC.weapon_MC.lineOfFire_MC._width = shortestLineOfFireObj.minDist;
}
function doorIsOpen() {
if (pL.currDoor.usage == "enter") {
if ((pL.x == pL.currDoor.x) && (pL.y == pL.currDoor.y)) {
pL.status = "wait";
game_MC.pL_MC.swapDepths(20 + pL.currDoor.target.getDepth());
game_MC.pL_MC.attachMovie("door_" + pL.currDoor.type, "accessedDoorMC", 50);
game_MC.pL_MC.accessedDoorMC.gotoAndPlay("close");
pL.z = 1;
} else {
pL.currDoor.target.gotoAndPlay("close");
pL.currDoor.usage = "none";
}
} else if (pL.currDoor.usage == "exit") {
pL.z = 0;
pL.status = "walk";
game_MC.pL_MC.accessedDoorMC.removeMovieClip();
pL.currDoor.target.gotoAndPlay("close");
game_MC.pL_MC.swapDepths(pL.layerDepth);
}
}
function doorIsClosed() {
if (pL.currDoor.usage == "enter") {
pL.z = 1;
pL.currDoor.target.gotoAndStop(1);
if (pL.currDoor.noOfDoors >= 3) {
Mouse.show();
doorButtonsMC._visible = true;
crossHairMC._visible = false;
doorButtonsMC._x = pL.currDoor.x + 80;
doorButtonsMC._y = pL.currDoor.y;
doorButtonsMC.gotoAndStop(pL.currDoor.noOfDoors);
} else if (pL.currDoor.type == "finishedMission") {
startLevelCompleteCountdown("missionComplete");
trace("----------- missionComplete ----------------------");
} else if (pL.currDoor.connRoom != g_roomNo) {
saveRoomData();
g_roomNo = pL.currDoor.connRoom;
g_doorNo = pL.currDoor.connDoor;
i = 0;
while (i < doorArr.length) {
doorObj = doorArr[i];
if ((doorObj.roomNo == g_roomNo) && (doorObj.doorNo == g_doorNo)) {
pL.currDoor = doorObj;
room_init();
doorID = "door_" + pL.currDoor.type;
doorMC = eval (((("game_MC.bgndMC." + doorID) + "_") + g_doorNo) + "_MC");
pL.currDoor.target = doorMC;
pL.x = pL.currDoor.x;
pL.y = pL.currDoor.y;
pL.currDoor.target.gotoAndStop("open");
game_MC.pL_MC.attachMovie("door_" + pL.currDoor.type, "accessedDoorMC", 50);
game_MC.pL_MC.accessedDoorMC.gotoAndPlay("open");
pL.currDoor.usage = "exit";
i = doorArr.length;
}
i++;
}
} else {
move_pLtoSelectedDoor();
}
} else if (pL.currDoor.usage == "exit") {
}
}
function move_pLtoSelectedDoor() {
ableToAccessDoor = true;
if (pL.currDoor.noOfDoors >= 3) {
saveRoomData();
temp_doorNo = 0;
selected_doorNo = pL.currDoor.connDoor;
i = 0;
while (i < doorArr.length) {
doorObj = doorArr[i];
if (doorObj.noOfDoors >= 3) {
temp_doorNo++;
if (selected_doorNo == temp_doorNo) {
pL.currDoor.connDoor = (g_doorNo = doorObj.doorNo);
if ((doorObj.accessKey == "key_basement") && (!pL.key.basement)) {
ableToAccessDoor = false;
} else if ((doorObj.accessKey == "key_building") && (!pL.key.building)) {
ableToAccessDoor = false;
} else if ((doorObj.accessKey == "key_warehouse") && (!pL.key.warehouse)) {
ableToAccessDoor = false;
}
if (ableToAccessDoor) {
if (g_roomNo != doorObj.roomNo) {
g_roomNo = doorObj.roomNo;
room_init();
}
} else {
displayMessage("ACCESS DENIED");
}
}
}
i++;
}
}
if (ableToAccessDoor) {
g_doorNo = pL.currDoor.connDoor;
i = 0;
while (i < doorArr.length) {
doorObj = doorArr[i];
if ((doorObj.roomNo == g_roomNo) && (doorObj.doorNo == g_doorNo)) {
doorID = "door_" + doorObj.type;
doorMC = eval (((("game_MC.bgndMC." + doorID) + "_") + g_doorNo) + "_MC");
pL.currDoor = doorObj;
pL.currDoor.target = doorMC;
pL.x = (pL_MC._x = doorMC._x);
pL.y = (pL_MC._y = doorMC._y);
}
i++;
}
pL.currDoor.usage = "exit";
game_MC.pL_MC.attachMovie("door_" + pL.currDoor.type, "accessedDoorMC", 50);
game_MC.pL_MC.accessedDoorMC.gotoAndPlay("open");
pL.currDoor.target.gotoAndStop("open");
doorButtonsMC._visible = false;
crossHairMC._visible = true;
}
}
trace("=====================================================================");
trace((("xtype: " + xtype) + " :: xtype: ") + xtype);
i = 1;
while (i < 10) {
trace("multiPartObj: " + multiPartObj);
i++;
}
Array.prototype.sortOn = function (p) {
Array.$sortprop = p;
var sortfunc = function (a, b) {
var p = Array.$sortprop;
return(b[p] < a[p]);
};
this.sort(sortfunc);
delete Array.$sortprop;
};
if (firstTimeToLoad == undefined) {
firstTimeToLoad = false;
setDefaultKeys();
FPS = 24;
sw = 440;
sh = 320;
PI = 3.1415;
grav = 24 / FPS;
g = [];
g_missionNo = 1;
g_taskNo = 1;
g_difficulty = 0;
soundArr = [];
soundArr.push({owner:"grass", soundType:"attack", soundName:"swoosh1"});
soundArr.push({owner:"bat", soundType:"getsHurt", soundName:"ee"});
soundArr.push({owner:"bat", soundType:"dies", soundName:"eeee1"});
soundArr.push({owner:"wasp", soundType:"getsHurt", soundName:"ee"});
soundArr.push({owner:"wasp", soundType:"dies", soundName:"eeee1"});
soundArr.push({owner:"crawler", soundType:"attack", soundName:"pew1"});
soundArr.push({owner:"crawler", soundType:"getsHurt", noOfSounds:3, soundName:"thud"});
soundArr.push({owner:"crawler", soundType:"dies", soundName:"squish_long"});
soundArr.push({owner:"zombie", soundType:"getsHurt", noOfSounds:3, soundName:"squish"});
soundArr.push({owner:"zombie", soundType:"dies", soundName:"squish_long"});
soundArr.push({owner:"GiantSpider", soundType:"dies", soundName:"squish_long"});
soundArr.push({owner:"GiantSpider", soundType:"getsHurt", noOfSounds:3, soundName:"squish"});
soundArr.push({owner:"GiantWasp", soundType:"dies", soundName:"squish_long"});
soundArr.push({owner:"GiantWasp", soundType:"getsHurt", noOfSounds:3, soundName:"squish"});
soundArr.push({owner:"Demon", soundType:"dies", soundName:"squish_long"});
soundArr.push({owner:"Demon", soundType:"getsHurt", noOfSounds:3, soundName:"squish"});
levelCodeArr = [];
levelCodeArr[1] = [];
levelCodeArr[1][1] = {code:"training", unlocked:true, roomNo:1, pL_x:35, pL_y:258};
levelCodeArr[1][2] = {code:"spidersense", unlocked:true, roomNo:2, pL_x:55, pL_y:239};
levelCodeArr[1][3] = {code:"thechoice", unlocked:true, roomNo:3, pL_x:40, pL_y:239};
levelCodeArr[1][4] = {code:"stinger", unlocked:true, roomNo:4, pL_x:325, pL_y:209};
levelCodeArr[1][5] = {code:"stinger", unlocked:true, roomNo:6, pL_x:105, pL_y:209};
levelCodeArr[1][6] = {code:"21", unlocked:true, roomNo:7, pL_x:20, pL_y:260};
levelCodeArr[10] = [];
levelCodeArr[10][1] = {code:"briefing", unlocked:true, roomNo:3, pL_x:35, pL_y:249};
levelCodeArr[10][2] = {code:"ohno", unlocked:false, roomNo:7, pL_x:415, pL_y:249};
levelCodeArr[10][3] = {code:"otherway", unlocked:false, roomNo:3, pL_x:50, pL_y:249};
levelCodeArr[10][4] = {code:"hunger", unlocked:false, roomNo:16, pL_x:30, pL_y:244};
levelCodeArr[10][5] = {code:"splash", unlocked:false, roomNo:114, pL_x:390, pL_y:244};
levelCodeArr[10][6] = {code:"COMPLETE", unlocked:false, roomNo:3, pL_x:0, pL_y:0};
i = 1;
while (i < levelCodeArr.length) {
j = 1;
while (j < levelCodeArr[i].length) {
trace((((("levelCodeArr[" + i) + "][") + j) + "]: ") + levelCodeArr[i][j].code);
trace((((("levelCodeArr[" + i) + "][") + j) + "]: ") + levelCodeArr[i][j].unlocked);
j++;
}
i++;
}
checkPointPath1_arr = [];
currCheckPointPath_arr = checkPointPath1_arr;
currCheckPointPath_arr.push([320, 110]);
currCheckPointPath_arr.push([120, 110]);
checkPointPath2_arr = [];
currCheckPointPath_arr = checkPointPath2_arr;
currCheckPointPath_arr.push([320, 70]);
currCheckPointPath_arr.push([120, 70]);
currCheckPointPath_arr.push([120, 160]);
currCheckPointPath_arr.push([320, 160]);
checkPointPath3_arr = [];
currCheckPointPath_arr = (checkPointPath3_arr = []);
currCheckPointPath_arr.push([220, 50]);
currCheckPointPath_arr.push([140, 100]);
currCheckPointPath_arr.push([220, 150]);
currCheckPointPath_arr.push([300, 100]);
checkPointPath4_arr = [];
currCheckPointPath_arr = checkPointPath4_arr;
currCheckPointPath_arr.push([220, 100]);
currCheckPointPath_arr.push([160, 130]);
currCheckPointPath_arr.push([160, 190]);
currCheckPointPath_arr.push([220, 220]);
currCheckPointPath_arr.push([280, 190]);
currCheckPointPath_arr.push([280, 130]);
checkPointPath5_arr = [];
currCheckPointPath_arr = checkPointPath5_arr;
currCheckPointPath_arr.push([320, 110]);
currCheckPointPath_arr.push([120, 110]);
currCheckPointPath_arr.push([320, 160]);
currCheckPointPath_arr.push([120, 160]);
currCheckPointPath_arr.push([320, 210]);
currCheckPointPath_arr.push([120, 210]);
testArray = checkPointPath1_arr;
arrNo = checkPointPath1_arr.length;
while ((arrNo--) > 0) {
trace(((((" checkPointPath_1_arr :: " + arrNo) + " :: ") + testArray[arrNo][0]) + " :: ") + testArray[arrNo][1]);
}
weaponsArr = [];
weaponsArr.push(new Weapon(true, "pistol", "inf", FPS / 3, 1));
weaponsArr.push(new Weapon(true, "blasterGun", "inf", FPS * 0.66, 3));
weaponsArr.push(new Weapon(true, "uzi", 40, 4, 1));
weaponsArr.push(new Weapon(true, "machineGun", "inf", 4, 1));
weaponsArr.push(new Weapon(true, "miniGun", 50, 3, 1));
weaponsArr.push(new Weapon(true, "laser", "inf", FPS, 4 / FPS, 1));
weaponsArr.push(new Weapon(true, "rocketLauncher", "inf", 3 * FPS, 12));
weaponsArr.push(new Weapon(true, "flameThrower", "inf", 2, 1));
weaponsArr.push(new Weapon(true, "grenade", "inf", FPS, 4));
stickManColorArr = new Array("000000", "111111", "0000FF", "00FF00", "FF0000", "FF00FF", "00FFFF", "FFFF00");
stickManWeaponArr = new Array("pistol", "blasterGun", "uzi", "machineGun", "miniGun", "rocketLauncher", "flameThrower");
Laser_pattern1_Arr = [];
Laser_pattern1_Arr.push({bar1:1, bar2:0, bar3:1, bar4:0});
Laser_pattern1_Arr.push({bar1:0, bar2:1, bar3:0, bar4:1});
Laser_pattern1_Arr.push({bar1:1, bar2:0, bar3:1, bar4:0});
Laser_pattern1_Arr.push({bar1:1, bar2:1, bar3:0, bar4:1});
Laser_pattern1_Arr.push({bar1:1, bar2:0, bar3:0, bar4:1});
Laser_pattern1_Arr.push({bar1:1, bar2:1, bar3:1, bar4:1});
playGameMusic = true;
}
function onEnterFrame_game() {
statusWindowMC.txtPLz = pL.z;
game_FrNo++;
currRoom_FrNo++;
if (testing_only) {
if (Key_isDown(17)) {
pL.x = _xmouse;
pL.y = _ymouse;
pL.vy = 0;
}
}
pL.moveStatus = false;
pL.prevStatus = pL.status;
if (pL.status == "wait") {
} else if (pL.status == "dies") {
if (levelCompleteCounter <= 35) {
pL.vx = 0;
}
pL.x = pL.x + pL.vx;
pL.y = pL.y + ((pL.vy = pL.vy + grav));
checkPlatformCollision(pL);
checkEnvironmentCollision(pL);
} else {
if ((pL.status == "climb_move") || (pL.status == "climb_stop")) {
if (Key_isDown(key_pLMoveUp)) {
if ((pL.y - pL.h) < pL.climbingItem.y) {
pL.status = "climb_stop";
pL.vy = 0;
pL.y = (pL.climbingItem.y + pL.h) - 1;
} else {
pL.vy = -pL.climbSpeed;
pL.status = "climb_move";
}
} else if (Key_isDown(key_pLMoveDown)) {
if (pL.y > ((pL.climbingItem.y + pL.climbingItem.h) - 2)) {
pL.status = "climb_stop";
pL.vy = 0.1;
pL.y = (pL.climbingItem.y + pL.climbingItem.h) - 1;
pL.status = "jump";
pL.jumping = true;
} else {
pL.vy = pL.climbSpeed;
pL.status = "climb_move";
}
} else {
pL.vy = 0;
pL.status = "climb_stop";
}
if (Key_isDown(key_pLJump)) {
pL.vy = pL.vy - (pL.jumpSpeed / 2);
pL.status = "jump";
}
} else if ((pL.status == "hang_move") || (pL.status == "hang_stop")) {
if (Key_isDown(key_pLMoveLeft)) {
if ((pL.x - (pL.w / 2)) < pL.climbingItem.x) {
pL.status = "hang_stop";
pL.vx = 0;
pL.x = (pL.climbingItem.x + (pL.w / 2)) - 1;
} else {
pL.vx = -pL.hangSpeed;
pL.status = "hang_move";
}
} else if (Key_isDown(key_pLMoveRight)) {
if ((pL.x + (pL.w / 2)) > (pL.climbingItem.x + pL.climbingItem.w)) {
pL.status = "hang_stop";
pL.vx = 0;
pL.x = ((pL.climbingItem.x + pL.climbingItem.w) - (pL.w / 2)) + 1;
} else {
pL.vx = pL.hangSpeed;
pL.status = "hang_move";
}
} else {
pL.vx = 0;
pL.status = "hang_stop";
}
if (Key_isDown(key_pLJump)) {
pL.status = "jump";
}
} else if (pL.status == "roll") {
pL.multiPartArr = pL.multiPartArr_roll;
obj = [];
obj.xmin = pL.x - (pL.w / 2);
obj.xmax = pL.x + (pL.w / 2);
obj.ymin = pL.y - 30;
obj.ymax = pL.y;
collision = false;
platfromNo = platformArr.length;
while ((platfromNo--) > 0) {
P = platformArr[platfromNo];
P.target.hitTest;
if ((obj.xmax > P.xmin) && (obj.xmin < P.xmax)) {
if ((P.ymax >= obj.ymin) && (P.ymax <= obj.ymax)) {
collision = true;
if (pL.currRollCounterFr <= 1) {
pL.currRollCounterFr = 1;
}
}
}
}
if ((pL.currRollCounterFr--) > 0) {
game_MC.pL_MC.all_MC._rotation = game_MC.pL_MC.all_MC._rotation + pL.rollAngSpeed;
if (Key_isDown(key_pLJump) && (!collision)) {
pL.vy = pL.vy - pL.jumpSpeed;
pL.status = "jump";
pL.jumping = true;
}
} else if (!collision) {
pL.status = "stand";
pL.vx = 0;
}
} else if (pL.status == "kneel") {
if (Key_isDown(key_pLMoveDown)) {
pL.status = "kneel";
pL.vx = 0;
} else {
pL.status = "stand";
pL.vx = 0;
}
} else {
pL.multiPartArr = pL.multiPartArr_general;
pL.walking = false;
if ((!pL.jumping) && (Key_isDown(key_pLWalking))) {
pL.walking = true;
}
if (Key_isDown(key_pLMoveDown)) {
pL.moveStatus = true;
if (Key_isDown(key_pLMoveLeft)) {
pL.status = "roll";
pL.vx = -pL.roll_vx;
pL.rollAngSpeed = -Abs(pL.rollAngSpeed);
pL.currRollCounterFr = pL.rollCounterFr;
} else if (Key_isDown(key_pLMoveRight)) {
pL.status = "roll";
pL.vx = pL.roll_vx;
pL.rollAngSpeed = Abs(pL.rollAngSpeed);
pL.currRollCounterFr = pL.rollCounterFr;
} else {
pL.status = "kneel";
pL.armRotationY = game_MC.pL_MC.arms_MC._y;
i = 0;
while (i < pickUpItemArr.length) {
itemObj = pickUpItemArr[i];
if (itemObj.available && (itemObj.roomNo == g_roomNo)) {
itemID = "pickUpItem";
pickUpItemMC = eval (((("game_MC.pickUpItemMC." + itemID) + "_") + itemObj.itemNo) + "_MC");
if ((Abs(pL.x - itemObj.x) < 15) && (Abs(itemObj.y - pL.y) < 5)) {
switch (itemObj.type) {
case "health" :
pL.health = pL.health + (itemObj.quantity / g_difficulty);
if (pL.health >= 100) {
pL.health = 100;
}
statusWindowMC.pL_heathMC.barMC._xscale = pL.health;
displayMessage("Health");
break;
case "key_basement" :
pL.key.basement = true;
displayMessage("Basement Elevator Key");
break;
case "key_building" :
pL.key.building = true;
displayMessage("Building Elevator Key");
break;
case "key_warehouse" :
pL.key.warehouse = true;
displayMessage("Warehouse Key");
break;
case "cheese" :
pL.cheese = true;
displayMessage("Found the Cheese");
break;
default :
i = 0;
for(;;){
if (i >= pL.weaponsArr.length) {
break;
}
if (pL.weaponsArr[i].type == itemObj.type) {
pL.weaponsArr[i].available = true;
if (pL.weaponsArr[i].ammo != "inf") {
pL.weaponsArr[i].ammo = pL.weaponsArr[i].ammo + itemObj.quantity;
statusWindowMC.txtAmmo = pL.weaponsArr[pL.currWeaponNo].ammo;
}
}
i++;
};
}
itemObj.available = false;
pickUpItemMC.removeMovieClip();
}
}
i++;
}
}
} else if (Key_isDown(key_pLMoveLeft)) {
pL.moveStatus = true;
if (pL.walking) {
pL.status = "walk";
pL.vx = (-pL.runSpeed) / 3;
} else {
pL.status = "run";
pL.vx = -pL.runSpeed;
}
} else if (Key_isDown(key_pLMoveRight)) {
pL.moveStatus = true;
if (pL.walking) {
pL.status = "walk";
pL.vx = pL.runSpeed / 3;
} else {
pL.status = "run";
pL.vx = pL.runSpeed;
}
} else if (!pL.moveStatus) {
pL.vx = 0;
pL.status = "stand";
}
if (Key_isDown(key_pLJump)) {
if (!pL.jumping) {
if (pL.vy == 0) {
pL.vy = pL.vy - pL.jumpSpeed;
pL.moveStatus = true;
}
}
pL.jumping = true;
}
if (Key_isDown(key_pLMoveUp)) {
if (pL.vy < pL.maxFallGrabSpeed) {
arrNo = climbingItemArr.length;
while ((arrNo--) > 0) {
climbingObj = climbingItemArr[arrNo];
switch (climbingObj.type) {
case "pipe" :
if (Abs(pL.x - climbingObj.x) < (climbingObj.w / 2)) {
if ((pL.y - pL.h) > climbingObj.y) {
if (pL.y < ((climbingObj.y + climbingObj.h) + 4)) {
pL.status = "climb_move";
pL.vx = 0;
pL.vy = 0;
pL.x = climbingObj.x;
pL.climbingItem = climbingObj;
objWeaponSoundStop(pL);
}
}
}
break;
case "rope" :
if ((pL.x > climbingObj.x) && (pL.x < (climbingObj.x + climbingObj.w))) {
if ((pL.y - pL.h) > (climbingObj.y - climbingObj.h)) {
if ((pL.y - pL.h) < (climbingObj.y + climbingObj.h)) {
pL.status = "hang_move";
pL.vx = 0;
pL.vy = 0;
pL.y = climbingObj.y + 33;
pL.climbingItem = climbingObj;
objWeaponSoundStop(pL);
}
}
}
break;
}
}
}
}
if (pL.jumping) {
if ((((pL.status != "hang_stop") && (pL.status != "hang_move")) && (pL.status != "climb_move")) && (pL.status != "climb_stop")) {
pL.status = "jump";
}
}
}
if (pL.vx > 0) {
game_MC.pL_MC.legs_MC._xscale = 100;
} else if (pL.vx < 0) {
game_MC.pL_MC.legs_MC._xscale = -100;
}
if ((((pL.status == "hang_stop") || (pL.status == "hang_move")) || (pL.status == "climb_move")) || (pL.status == "climb_stop")) {
pL.climbOrHang = true;
pL.weaponInHand = false;
} else {
pL.climbOrHang = false;
pL.weaponInHand = true;
pL.vy = pL.vy + grav;
}
if (pL.status == "roll") {
pL.weaponInHand = false;
}
if (pL.vy > pL.maxFallSpeed) {
}
if (pL.weaponInHand) {
pL_weapon_dx = _xmouse - pL.x;
pL_weapon_dy = _ymouse - (pL.y - pL.armRotationY);
pL_weapon_dist = (dist = Math.sqrt((pL_weapon_dx * pL_weapon_dx) + (pL_weapon_dy * pL_weapon_dy)));
dx_adjust = pL_weapon_dx / Abs(pL_weapon_dx);
dy_adjust = pL_weapon_dy / Abs(pL_weapon_dy);
nozzleY = (game_MC.pL_MC.weapon_MC.nozzle_MC._y * dx_adjust) * dy_adjust;
angleRad = Math.acos(pL_weapon_dx / dist) - Math.asin(nozzleY / dist);
angleRad = angleRad * (pL_weapon_dy / Abs(pL_weapon_dy));
if (pL_weapon_dx < 0) {
}
pL.weaponAngleDeg = 57.2957795130823 * angleRad;
pL.weapon_ux = (ux = Math.cos(angleRad));
pL.weapon_uy = (uy = Math.sin(angleRad));
if (pL.mouseDown) {
if (pL.weaponsArr[pL.currWeaponNo].currReloadFr <= 0) {
if (pL.weaponType == "grenade") {
if ((++pL.grenadeThrowVelocity) >= 15) {
pL.grenadeThrowVelocity = 15;
}
statusWindowMC.txtGrenadeThrow = pL.grenadeThrowVelocity;
pL.weaponsArr[pL.currWeaponNo].currReloadFr = 0;
} else if ((pL.weaponsArr[pL.currWeaponNo].ammo > 0) || (pL.weaponsArr[pL.currWeaponNo].ammo == "inf")) {
if (pL.weaponsArr[pL.currWeaponNo].ammo != "inf") {
statusWindowMC.txtAmmo = --pL.weaponsArr[pL.currWeaponNo].ammo;
}
pL.weaponsArr[pL.currWeaponNo].currReloadFr = pL.weaponsArr[pL.currWeaponNo].reloadFr;
switch (pL.weaponType) {
case "pistol" :
case "blasterGun" :
case "laser" :
pL.weaponFireSnd.start(0, 1);
case "uzi" :
case "machineGun" :
case "miniGun" :
checkIfLineOfFireHitAnything(pL, false, true, true);
game_MC.pL_MC.head_MC.flash_MC.gotoAndPlay(2);
game_MC.pL_MC.body_MC.flash_MC.gotoAndPlay(2);
break;
case "grenade" :
break;
case "rocketLauncher" :
case "flameThrower" :
game_MC.pL_MC.weapon_MC.flash_MC.gotoAndPlay(pL.weaponType);
game_MC.pL_MC.head_MC.flash_MC.gotoAndPlay(2);
game_MC.pL_MC.body_MC.flash_MC.gotoAndPlay(2);
nozzleX = game_MC.pL_MC.weapon_MC.nozzle_MC._x;
nozzleY = (game_MC.pL_MC.weapon_MC.nozzle_MC._y * game_MC.pL_MC.weapon_MC._xscale) / 100;
temp_x = (pL.x + (pL.weapon_ux * nozzleX)) - (pL.weapon_uy * nozzleY);
temp_y = ((pL.y - pL.armRotationY) + (pL.weapon_ux * nozzleY)) + (pL.weapon_uy * nozzleX);
createProjectile(pL, pL.weaponType, temp_x, temp_y, pL.weapon_ux, pL.weapon_uy, pL.attackDamage);
break;
}
} else {
objWeaponSoundStop(pL);
displayMessage("Out of ammo");
}
}
}
}
}
if ((--pL.weaponsArr[pL.currWeaponNo].currReloadFr) < 0) {
pL.weaponsArr[pL.currWeaponNo].currReloadFr = 0;
} else {
statusWindowMC.txtReloading = pL.weaponsArr[pL.currWeaponNo].currReloadFr;
statusWindowMC.pL_ReloadMC.barMC._xscale = (100 * (pL.weaponsArr[pL.currWeaponNo].reloadFr - pL.weaponsArr[pL.currWeaponNo].currReloadFr)) / pL.weaponsArr[pL.currWeaponNo].reloadFr;
}
with (game_MC) {
crossHairMC._x = _xmouse;
crossHairMC._y = _ymouse;
crossHairMC._rotation = pL.weaponAngleDeg;
if (pL.climbOrHang) {
game_MC.pL_MC.arms_MC._rotation = 0;
pL_MC.head_MC._rotation = 0;
} else if (pL_weapon_dx > 0) {
game_MC.pL_MC.arms_MC._xscale = (pL_MC.weapon_MC._xscale = 100);
game_MC.pL_MC.arms_MC._rotation = (pL_MC.weapon_MC._rotation = pL.weaponAngleDeg);
pL_MC.head_MC._xscale = 100;
pL_MC.head_MC._rotation = pL.weaponAngleDeg;
pL_MC.body_MC._xscale = 100;
} else {
game_MC.pL_MC.arms_MC._xscale = (pL_MC.weapon_MC._xscale = -100);
game_MC.pL_MC.arms_MC._rotation = (pL_MC.weapon_MC._rotation = pL.weaponAngleDeg + 180);
pL_MC.head_MC._xscale = -100;
pL_MC.head_MC._rotation = pL.weaponAngleDeg + 180;
pL_MC.body_MC._xscale = -100;
}
if (pL.status != pL.prevStatus) {
game_MC.pL_MC.gotoAndStop(pL.status);
game_MC.pL_MC.arms_MC.gotoAndStop(pL.weaponType);
pL_MC.weapon_MC.gotoAndStop(pL.weaponType);
pL_updateWeaponFlash();
pL.armRotationY = Abs(game_MC.pL_MC.arms_MC._y);
pL.h = eval (pL.target).hitAreaMC._height;
}
}
pL.x = pL.x + pL.vx;
pL.y = pL.y + pL.vy;
checkPlatformCollision(pL);
checkEnvironmentCollision(pL);
if (pL.x < roomBufferLeft) {
pL.y = pL.y - grav;
reachedroomBuffer("left");
} else if (pL.x > roomBufferRight) {
pL.y = pL.y - grav;
reachedroomBuffer("right");
}
if (pL.y < roomBufferTop) {
reachedroomBuffer("top");
} else if (pL.y > sh) {
reachedroomBuffer("bottom");
}
game_MC.pL_MC._x = pL.x;
game_MC.pL_MC._y = pL.y;
if (projectileArr.length > 0) {
projectileNo = projectileArr.length;
while ((projectileNo--) > 0) {
projObj = projectileArr[projectileNo];
projectileMC = eval (projObj.targetMC);
projExplode = false;
switch (projObj.type) {
case "rocketLauncher" :
break;
case "grenade" :
projObj.vy = projObj.vy + grav;
case "flameThrower" :
if ((--projObj.timer) < 0) {
projExplode = true;
}
break;
case "zombieSpit" :
projObj.vy = projObj.vy + (grav / 8);
break;
case "GiantSpiderSpit" :
case "GiantWaspSpit" :
case "DemonSpit" :
break;
}
projObj.x = projObj.x + projObj.vx;
projObj.y = projObj.y + projObj.vy;
projectileMC._x = projObj.x;
projectileMC._y = projObj.y;
projCollision = false;
if (projObj.originObj.classification == "pL") {
enemyNo = enemyArr.length;
while ((enemyNo--) > 0) {
enemyMC = eval (enemyArr[enemyNo].target);
if (projectileMC.hitTest(enemyMC.hitAreaMC)) {
projCollision = true;
enemyArr[enemyNo].arrayNo = enemyNo;
objectGetsHurt(enemyArr[enemyNo], projObj.attackDamage);
projExplode = true;
}
}
} else if (projObj.originObj.classification == "enemy") {
if (projectileMC.hitTest(game_MC.pL_MC.hitAreaMC)) {
projCollision = true;
direction = projObj.vx / Abs(projObj.vx);
projExplode = true;
}
}
switch (projObj.type) {
case "grenade" :
projObj.rad = 2;
obj = projObj;
obj.xmin = obj.x - obj.rad;
obj.xmax = obj.x + obj.rad;
obj.ymin = obj.y - obj.rad;
obj.ymax = obj.y + obj.rad;
platfromNo = platformArr.length;
while ((platfromNo--) > 0) {
P = platformArr[platfromNo];
P.xmin = P.x;
P.xmax = P.xmin + P.w;
P.ymin = P.y;
P.ymax = P.ymin + P.h;
if ((obj.xmax > P.xmin) && (obj.xmin < P.xmax)) {
if ((P.ymin <= obj.ymax) && (P.ymin >= (obj.ymax - obj.vy))) {
obj.y = (P.ymin - (obj.ymax - P.ymin)) - obj.rad;
obj.vy = (-0.6) * Abs(obj.vy);
obj.vx = obj.vx * 0.8;
} else if ((P.ymax >= obj.ymin) && (P.ymax <= (obj.ymin - obj.vy))) {
obj.y = (P.ymax + (P.ymax - obj.ymax)) + obj.rad;
obj.vy = 0.6 * Abs(obj.vy);
obj.vx = obj.vx * 0.8;
}
if ((obj.ymax > P.ymin) && (obj.ymin < P.ymax)) {
if ((P.xmin <= obj.xmax) && (P.xmin >= (obj.xmax - obj.vx))) {
obj.x = (P.xmin - (obj.xmax - P.xmin)) - obj.rad;
obj.vx = obj.vx * (-1);
obj.vy = obj.vy * 0.6;
} else if ((P.xmax >= obj.xmin) && (P.xmax <= (obj.xmin - obj.vx))) {
obj.x = (P.xmax + (P.xmax - obj.xmax)) + obj.rad;
obj.vx = obj.vx * (-1);
obj.vy = obj.vy * 0.6;
}
}
}
}
break;
case "rocketLauncher" :
case "flameThrower" :
case "zombieSpit" :
case "GiantSpiderSpit" :
case "GiantWaspSpit" :
case "DemonSpit" :
platfromNo = platformArr.length;
for(;;){
if ((platfromNo--) <= 0) {
break;
}
P = platformArr[platfromNo];
platfromMC = eval (platformArr[platfromNo].target);
if (projectileMC.hitTest(platfromMC)) {
P.arrayNo = platfromNo;
objectGetsHurt(P, 3, projObj, x, projObj.y, projObj.weapon_ux, projObj.weapon_uy);
projExplode = true;
}
};
}
if (projObj.y < roomBufferTop) {
projCollision = "removeOnly";
collisionDirection = "y";
projectileMC._y = roomBufferTop;
} else if (projObj.y > roomBufferBottom) {
projCollision = "removeOnly";
collisionDirection = "y";
projectileMC._y = roomBufferBottom;
}
if (projObj.x < roomBufferLeft) {
projCollision = "removeOnly";
collisionDirection = "x";
projectileMC._x = roomBufferLeft;
} else if (projObj.x > roomBufferRight) {
projCollision = "removeOnly";
collisionDirection = "x";
projectileMC._x = roomBufferRight;
}
if (projCollision == true) {
} else if (projCollision == "removeOnly") {
projectileArr.splice(projectileNo, 1);
projectileMC.removeMovieClip();
}
if (projExplode) {
sgExplodes(projObj);
projectileMC.gotoAndPlay("explode");
projectileArr.splice(projectileNo, 1);
}
}
}
if (moreEnemyToCome) {
while ((currRoom_FrNo > nextEnemyFrNo) && (moreEnemyToCome)) {
enemyArr.push(tempEnemyArr[0]);
enemyObj = tempEnemyArr[0];
if ((noOfEnemyCreated++) > 200) {
noOfEnemyCreated = 0;
}
game_MC.enemyAttachMC.attachMovie(enemyObj.type + enemyObj.typeNo, (((enemyObj.type + enemyObj.typeNo) + "_") + noOfEnemyCreated) + "_MC", noOfEnemyCreated);
enemyMC = eval ((((("game_MC.enemyAttachMC." + enemyObj.type) + enemyObj.typeNo) + "_") + noOfEnemyCreated) + "_MC");
enemyMC._x = enemyObj.x;
enemyMC._y = enemyObj.y;
enemyObj.target = enemyMC;
switch (enemyObj.type) {
case "stickman" :
enemyObj.armRotation = 30;
enemyMC.arms_MC._rotation = (enemyMC.weapon_MC._rotation = enemyObj.armRotation);
enemyMC.arms_MC.gotoAndStop(enemyObj.weaponType);
with (enemyMC.weapon_MC) {
gotoAndStop(enemyObj.weaponType);
flash_MC._x = (lineOfFire_MC._x = nozzle_MC._x);
flash_MC._y = (lineOfFire_MC._y = nozzle_MC._y);
flash_MC.gotoAndStop(1);
lineOfFire_MC.gotoAndStop(1);
}
enemyMC.head_MC.flash_MC.gotoAndStop(1);
enemyMC.body_MC.flash_MC.gotoAndStop(1);
break;
default :
}
tempEnemyArr.splice(0, 1);
nextEnemyFrNo = tempEnemyArr[0].showUpFr;
if (tempEnemyArr.length <= 0) {
moreEnemyToCome = false;
}
}
} else if (updateRestoredEnemies) {
updateRestoredEnemies = false;
enemyNo = enemyArr.length;
while ((enemyNo--) > 0) {
enemyObj = enemyArr[enemyNo];
multiPartNo = enemyObj.multiPartArr.length;
while ((multiPartNo--) > 0) {
partObj = enemyObj.multiPartArr[multiPartNo];
partMC = eval ((((enemyObj.target + ".") + partObj.name) + partObj.id) + "_MC");
currFrameNo = 1 + int(partMC._totalframes * (1 - (partObj.health / partObj.fullHealth)));
partMC.gotoAndStop(currFrameNo);
}
}
}
if ((g_missionNo == 10) && (g_taskNo == 2)) {
if (tempEnemyArr.length < 30) {
i = 0;
while (i <= 10) {
tempEnemyArr.push(new Rocket(((i * 0.5) * FPS) / g_difficulty, 40 + (Math_Random() * sw), 80, 1, 100 / FPS));
i++;
}
}
} else if ((g_missionNo == 1) && (g_taskNo == 6)) {
if (tempEnemyArr.length < 3) {
showUpFr = tempEnemyArr[tempEnemyArr.length - 1].showUpFr + FPS;
tempEnemyArr.push(new Stickman(showUpFr, sw * Math_Random(), 260, 1, selectRandomStickManColor(), "pL_follow", selectRandomStickManWeapon(), 24, 12, 0, 440, 0, 320, 0, 440, 0, 320));
}
}
enemyNo = enemyArr.length;
while ((enemyNo--) > 0) {
enemyObj = enemyArr[enemyNo];
enemyMC = eval (enemyObj.target);
enemyPL_dx = pL.x - enemyObj.x;
enemyPL_dy = (pL.y - (pL.h / 2)) - enemyObj.y;
enemyPL_dist = Math.sqrt((enemyPL_dx * enemyPL_dx) + (enemyPL_dy * enemyPL_dy));
enemyPL_ux = enemyPL_dx / enemyPL_dist;
enemyPL_uy = enemyPL_dy / enemyPL_dist;
enemyPL_angle = Math.acos(enemyPL_dx / enemyPL_dist) * (enemyPL_dy / Abs(enemyPL_dy));
enemyPL_angleDeg = 57.2957795130823 * enemyPL_angle;
switch (enemyObj.type) {
case "bat" :
if (!enemyObj.noticedTarget) {
enemyObj.attackTarget = pL;
if ((enemyObj.attackTarget.x > enemyObj.noticeXmin) && (enemyObj.attackTarget.x < enemyObj.noticeXmax)) {
if ((enemyObj.attackTarget.y > enemyObj.noticeYmin) && (enemyObj.attackTarget.y < enemyObj.noticeYmax)) {
enemyObj.noticedTarget = true;
enemyObj.status = "move";
}
}
if (enemyObj.health < enemyObj.fullHealth) {
enemyObj.noticedTarget = true;
enemyObj.status = "move";
}
} else {
if (enemyObj.pathName == "pL_follow") {
enemyCP_dx = enemyObj.nextCheckPointX - enemyObj.x;
if (Abs(enemyCP_dx) < enemyObj.reachedCheckPointDist) {
enemyCP_dy = enemyObj.nextCheckPointY - enemyObj.y;
if (Abs(enemyCP_dy) < enemyObj.reachedCheckPointDist) {
enemyCP_dx = pL.x - enemyObj.x;
enemyCP_dy = (pL.y - (pL.h / 2)) - enemyObj.y;
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
flyDist = 20 + (5 * Math_random());
enemyObj.nextCheckPointX = (enemyObj.x + (flyDist * enemyCP_ux)) + (5 * ((-0.5) + Math_random()));
enemyObj.nextCheckPointY = (enemyObj.y + (flyDist * enemyCP_uy)) + (15 * ((-0.5) + Math_random()));
enemyObj.status = "attack";
}
}
enemyCP_dx = enemyObj.nextCheckPointX - enemyObj.x;
enemyCP_dy = enemyObj.nextCheckPointY - enemyObj.y;
}
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
enemyObj.x = enemyObj.x + ((enemyObj.vx = enemyCP_ux * enemyObj.v));
enemyObj.y = enemyObj.y + ((enemyObj.vy = enemyCP_uy * enemyObj.v));
if (enemyObj.status == "attack") {
if (game_MC.pL_MC.hitAreaMC.hitTest(enemyMC._x, enemyMC._y, false)) {
objectGetsHurt(pL, enemyObj.attackDamage, enemyObj.x, enemyObj.y, 0.7 * enemyObj.direction, -0.7);
enemyObj.status = "move";
enemyCP_dx = (sw / 2) - enemyObj.x;
enemyCP_dy = 0;
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
flyDist = 40 + (20 * Math_random());
enemyObj.nextCheckPointX = (enemyObj.x + (flyDist * enemyCP_ux)) + (5 * ((-0.5) + Math_random()));
enemyObj.nextCheckPointY = (enemyObj.y + (flyDist * enemyCP_uy)) + (25 * ((-0.5) + Math_random()));
playSound(enemyObj.type, enemyObj.target, "attack", 1);
}
}
enemyMC._x = enemyObj.x;
enemyMC._y = enemyObj.y;
}
break;
case "wasp" :
if (!enemyObj.noticedTarget) {
enemyObj.attackTarget = pL;
if ((enemyObj.attackTarget.x > enemyObj.noticeXmin) && (enemyObj.attackTarget.x < enemyObj.noticeXmax)) {
if ((enemyObj.attackTarget.y > enemyObj.noticeYmin) && (enemyObj.attackTarget.y < enemyObj.noticeYmax)) {
enemyObj.noticedTarget = true;
enemyObj.status = "move";
}
}
if (enemyObj.health < enemyObj.fullHealth) {
enemyObj.noticedTarget = true;
enemyObj.status = "move";
}
} else {
if (enemyObj.pathName == "pL_follow") {
enemyCP_dx = enemyObj.nextCheckPointX - enemyObj.x;
if (Abs(enemyCP_dx) < enemyObj.reachedCheckPointDist) {
enemyCP_dy = enemyObj.nextCheckPointY - enemyObj.y;
if (Abs(enemyCP_dy) < enemyObj.reachedCheckPointDist) {
enemyCP_dx = pL.x - enemyObj.x;
enemyCP_dy = (pL.y - (pL.h / 2)) - enemyObj.y;
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
flyDist = 20 + (5 * Math_random());
enemyObj.nextCheckPointX = (enemyObj.x + (flyDist * enemyCP_ux)) + (5 * ((-0.5) + Math_random()));
enemyObj.nextCheckPointY = (enemyObj.y + (flyDist * enemyCP_uy)) + (15 * ((-0.5) + Math_random()));
enemyObj.status = "attack";
}
}
enemyCP_dx = enemyObj.nextCheckPointX - enemyObj.x;
enemyCP_dy = enemyObj.nextCheckPointY - enemyObj.y;
}
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
enemyObj.x = enemyObj.x + ((enemyObj.vx = enemyCP_ux * enemyObj.v));
enemyObj.y = enemyObj.y + ((enemyObj.vy = enemyCP_uy * enemyObj.v));
if (enemyObj.vx < 0) {
enemyObj.direction = -1;
} else {
enemyObj.direction = 1;
}
enemyMC._xscale = enemyObj.direction * 100;
if (enemyObj.status == "attack") {
if (game_MC.pL_MC.hitAreaMC.hitTest(enemyMC._x, enemyMC._y, false)) {
objectGetsHurt(pL, enemyObj.attackDamage, enemyObj.x, enemyObj.y, 0.7 * enemyObj.direction, -0.7);
enemyObj.status = "move";
enemyCP_dx = (sw / 2) - enemyObj.x;
enemyCP_dy = 0;
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
flyDist = 40 + (20 * Math_random());
enemyObj.nextCheckPointX = (enemyObj.x + (flyDist * enemyCP_ux)) + (5 * ((-0.5) + Math_random()));
enemyObj.nextCheckPointY = (enemyObj.y + (flyDist * enemyCP_uy)) + (25 * ((-0.5) + Math_random()));
playSound(enemyObj.type, enemyObj.target, "attack", 1);
}
}
enemyMC._x = enemyObj.x;
enemyMC._y = enemyObj.y;
}
break;
case "crawler" :
if (!enemyObj.noticedTarget) {
enemyObj.attackTarget = pL;
if ((enemyObj.attackTarget.x > enemyObj.noticeXmin) && (enemyObj.attackTarget.x < enemyObj.noticeXmax)) {
if ((enemyObj.attackTarget.y > enemyObj.noticeYmin) && (enemyObj.attackTarget.y < enemyObj.noticeYmax)) {
enemyObj.noticedTarget = true;
enemyObj.status = "move";
}
}
if (enemyObj.health < enemyObj.fullHealth) {
enemyObj.noticedTarget = true;
enemyObj.status = "move";
}
}
if (enemyObj.status == "move") {
if (enemyPL_dx < 0) {
enemyObj.vx = -enemyObj.v;
enemyObj.direction = -1;
} else {
enemyObj.vx = enemyObj.v;
enemyObj.direction = 1;
}
enemyObj.x = enemyObj.x + enemyObj.vx;
if (enemyObj.vx > 0) {
enemyMC._xscale = 100;
enemyMC.gotoAndStop("walk");
} else if (enemyObj.vx < 0) {
enemyMC._xscale = -100;
enemyMC.gotoAndStop("walk");
}
enemyReachedMoveLimit = false;
if (enemyObj.x < enemyObj.moveXmin) {
enemyReachedMoveLimit = true;
enemyObj.x = enemyObj.moveXmin;
} else if (enemyObj.x > enemyObj.moveXmax) {
enemyReachedMoveLimit = true;
enemyObj.x = enemyObj.moveXmax;
}
if (enemyObj.y < enemyObj.moveYmin) {
enemyReachedMoveLimit = true;
enemyObj.y = enemyObj.moveXmin;
} else if (enemyObj.y > enemyObj.moveYmax) {
enemyReachedMoveLimit = true;
enemyObj.y = enemyObj.moveYmax;
}
if (enemyReachedMoveLimit) {
enemyObj.status = "stand";
enemyMC.gotoAndStop("stand");
}
}
if (enemyObj.noticedTarget) {
if ((enemyObj.currAttackFr--) < 0) {
enemyObj.currAttackFr = 0;
}
if ((Abs(enemyPL_dx) < enemyObj.attackDist) && (enemyObj.currAttackFr < 0)) {
switch (enemyObj.typeNo) {
case 1 :
enemyPL_dx = pL.x - (enemyObj.x + (enemyObj.direction * enemyMC.head_MC._x));
enemyPL_dy = (pL.y - pL.h) - (enemyObj.y + enemyMC.head_MC._y);
enemyPL_dist = Math.sqrt((enemyPL_dx * enemyPL_dx) + (enemyPL_dy * enemyPL_dy));
enemyPL_ux = enemyPL_dx / enemyPL_dist;
enemyPL_uy = enemyPL_dy / enemyPL_dist;
enemyPL_angle = Math.acos(enemyPL_dx / enemyPL_dist) * (enemyPL_dy / Abs(enemyPL_dy));
enemyPL_angleDeg = (180 / Math.PI) * enemyPL_angle;
if (enemyObj.direction > 0) {
enemyMC.head_MC._rotation = enemyPL_angleDeg;
} else {
enemyMC.head_MC._rotation = (-180) - enemyPL_angleDeg;
}
enemyMC.head_MC._rotation = enemyMC.head_MC._rotation + 90;
temp_x = enemyObj.x + (enemyObj.direction * enemyMC.head_MC._x);
temp_y = enemyObj.y + enemyMC.head_MC._y;
createProjectile(enemyObj, "zombieSpit", temp_x, temp_y, enemyPL_ux, enemyPL_uy, 5);
playSound(enemyObj.type, enemyObj.target, "attack", 1);
break;
case 2 :
}
enemyObj.vx = 0;
enemyObj.currAttackFr = enemyObj.nextAttackFr;
enemyObj.status = "attack";
enemyMC.gotoAndStop("attack");
}
}
if (enemyObj.status == "attack") {
if (enemyObj.currAttackFr > 0) {
} else {
enemyObj.status = "move";
}
}
enemyMC._x = enemyObj.x;
break;
case "zombie" :
if (!enemyObj.noticedTarget) {
enemyObj.attackTarget = pL;
if ((enemyObj.attackTarget.x > enemyObj.noticeXmin) && (enemyObj.attackTarget.x < enemyObj.noticeXmax)) {
if ((enemyObj.attackTarget.y > enemyObj.noticeYmin) && (enemyObj.attackTarget.y < enemyObj.noticeYmax)) {
enemyObj.noticedTarget = true;
enemyObj.status = "walk";
}
}
if (enemyObj.health < enemyObj.fullHealth) {
enemyObj.noticedTarget = true;
enemyObj.status = "walk";
}
} else {
if (enemyObj.status != "attack") {
if (enemyPL_dx < 0) {
enemyObj.vx = -enemyObj.v;
enemyObj.direction = -1;
} else {
enemyObj.vx = enemyObj.v;
enemyObj.direction = 1;
}
enemyObj.x = enemyObj.x + enemyObj.vx;
if ((enemyObj.vx > 0) || (enemyObj.vx < 0)) {
enemyMC._xscale = enemyObj.direction * 100;
}
enemyReachedMoveLimit = false;
if (enemyObj.x < enemyObj.moveXmin) {
enemyReachedMoveLimit = true;
enemyObj.x = enemyObj.moveXmin;
} else if (enemyObj.x > enemyObj.moveXmax) {
enemyReachedMoveLimit = true;
enemyObj.x = enemyObj.moveXmax;
}
if (enemyObj.y < enemyObj.moveYmin) {
enemyReachedMoveLimit = true;
enemyObj.y = enemyObj.moveXmin;
} else if (enemyObj.y > enemyObj.moveYmax) {
enemyReachedMoveLimit = true;
enemyObj.y = enemyObj.moveYmax;
}
if (enemyReachedMoveLimit) {
enemyObj.status = "stand";
enemyMC.gotoAndStop("stand");
}
}
if ((enemyObj.currAttackFr--) < 0) {
enemyObj.currAttackFr = 0;
}
if ((Abs(enemyPL_dx) < enemyObj.attackDist) && (enemyObj.currAttackFr < 0)) {
switch (enemyObj.typeNo) {
case 1 :
break;
case 2 :
temp_x = enemyObj.x + (enemyObj.direction * (enemyMC.head_MC._width / 2));
temp_y = (enemyObj.y + enemyMC.head_MC._y) - (enemyMC.head_MC._height / 2);
createProjectile(enemyObj, "zombieSpit", temp_x, temp_y, 0.9 * enemyObj.direction, -0.15, 5);
}
enemyObj.vx = 0;
enemyObj.currAttackFr = enemyObj.nextAttackFr;
enemyObj.status = "attack";
enemyMC.gotoAndStop("attack");
playSound(enemyObj.type, enemyObj.target, "attack", 1);
}
if (enemyObj.status == "attack") {
if (enemyObj.currAttackFr > 0) {
if (enemyMC.arms_MC.arm_MC.attackPoint_MC.hitTest(game_MC.pL_MC.hitAreaMC)) {
temp_x = (enemyMC._x + enemyMC.arms_MC._x) + enemyMC.arms_MC.attackPoint_MC._x;
temp_y = (enemyMC._y + enemyMC.arms_MC._y) + enemyMC.arms_MC.attackPoint_MC._y;
objectGetsHurt(pL, enemyObj.attackDamage, temp_x, temp_y, 0.7 * enemyObj.direction, -0.7);
}
} else {
enemyObj.status = "walk";
}
}
enemyMC._x = enemyObj.x;
if (enemyObj.status != enemyObj.prevStatus) {
enemyMC.gotoAndStop(enemyObj.status);
multiPartNo = enemyObj.multiPartArr.length;
while ((multiPartNo--) > 0) {
partObj = enemyObj.multiPartArr[multiPartNo];
partMC = eval ((((enemyObj.target + ".") + partObj.name) + partObj.id) + "_MC");
currFrameNo = 1 + int(partMC._totalframes * (1 - (partObj.health / partObj.fullHealth)));
partMC.gotoAndStop(currFrameNo);
}
}
enemyObj.prevStatus = enemyObj.status;
}
break;
case "mine" :
if (Abs(enemyPL_dx) < enemyObj.attackDist) {
enemyObj.status = "attack";
enemyMC.gotoAndStop("attack");
}
if (enemyObj.status == "attack") {
if ((enemyObj.attackFr--) < 0) {
objectGetsHurt(enemyObj, 1);
sgExplodes(enemyObj);
enemyMC.gotoAndPlay("dies");
enemyArr.splice(enemyNo, 1);
}
}
break;
case "laser" :
if ((enemyObj.currPatternFr--) < 0) {
enemyObj.currPatternFr = enemyObj.nextPatternFr;
enemyObj.currPattern = enemyObj.patternArr[enemyObj.patternNo];
if ((++enemyObj.patternNo) >= enemyObj.patternArr.length) {
enemyObj.patternNo = 0;
}
currLaserPattern = enemyObj.patternArr[enemyObj.patternNo];
if (currLaserPattern.bar1) {
visibility = true;
} else {
visibility = false;
}
eval (enemyMC.bar1)._visible = visibility;
if (currLaserPattern.bar2) {
visibility = true;
} else {
visibility = false;
}
eval (enemyMC.bar2)._visible = visibility;
if (currLaserPattern.bar3) {
visibility = true;
} else {
visibility = false;
}
eval (enemyMC.bar3)._visible = visibility;
if (currLaserPattern.bar4) {
visibility = true;
} else {
visibility = false;
}
eval (enemyMC.bar4)._visible = visibility;
}
if (enemyMC.hitTest(eval (game_MC.pL_MC.hitAreaMC))) {
arrNo = 4;
while ((arrNo--) > 0) {
enemyBarMC = eval ((enemyMC + ".bar") + (arrNo + 1));
if (enemyBarMC._visible) {
if (enemyBarMC.hitTest(game_MC.pL_MC.hitAreaMC)) {
x = enemyObj.x + enemyBarMC._x;
y = enemyObj.y + enemyBarMC._y;
objectGetsHurt(pL, enemyObj.attackDamage, x, y, 0, -1);
if (!g_alarmON) {
g_alarmON = true;
displayMessage("Silent alarm is ON");
}
}
}
}
}
testArray = checkPointPath1_arr;
arrNo = checkPointPath1_arr.length;
while ((arrNo--) > 0) {
}
if (Abs(enemyPL_dx) < enemyObj.attackDist) {
enemyObj.status = "attack";
enemyMC.gotoAndStop("attack");
}
if (enemyObj.status == "attack") {
if ((enemyObj.attackFr--) < 0) {
objectGetsHurt(enemyObj, 1);
sgExplodes(enemyObj);
enemyMC.gotoAndPlay("dies");
enemyArr.splice(enemyNo, 1);
}
}
break;
case "rocket" :
enemyMC._y = (enemyObj.y = enemyObj.y + enemyObj.vy);
if (enemyObj.y > 250) {
sgExplodes(enemyObj);
enemyMC.gotoAndPlay("dies");
enemyArr.splice(enemyNo, 1);
}
break;
case "stickman" :
if (!enemyObj.noticedTarget) {
enemyObj.attackTarget = pL;
if ((enemyObj.attackTarget.x > enemyObj.noticeXmin) && (enemyObj.attackTarget.x < enemyObj.noticeXmax)) {
if ((enemyObj.attackTarget.y > enemyObj.noticeYmin) && (enemyObj.attackTarget.y < enemyObj.noticeYmax)) {
enemyObj.noticedTarget = true;
}
}
if (enemyObj.health < enemyObj.fullHealth) {
enemyObj.noticedTarget = true;
}
if (enemyObj.noticedTarget) {
enemyObj.status = "move";
enemyObj.currNextAttackFr = enemyObj.nextAttackFr;
}
} else {
if (enemyPL_dx < 0) {
enemyObj.vx = -enemyObj.walkSpeed;
enemyObj.direction = -1;
} else {
enemyObj.vx = enemyObj.walkSpeed;
enemyObj.direction = 1;
}
if (Abs(pL.x - enemyObj.x) <= 30) {
enemyObj.vx = 1.5 * enemyObj.walkSpeed;
} else if (Abs(pL.x - enemyObj.x) <= enemyObj.attackDist) {
enemyObj.vx = 0;
}
enemyObj.x = enemyObj.x + enemyObj.vx;
if (enemyObj.vx > 0) {
enemyMC.legs_MC._xscale = 100;
enemyMC.gotoAndStop("walk");
enemyObj.status = "walk";
} else if (enemyObj.vx < 0) {
enemyMC.legs_MC._xscale = -100;
enemyMC.gotoAndStop("walk");
enemyObj.status = "walk";
} else {
enemyObj.status = "stand";
enemyMC.gotoAndStop("stand");
}
enemyMC.legs_MC.play();
enemyReachedMoveLimit = false;
if (enemyObj.x < enemyObj.moveXmin) {
enemyReachedMoveLimit = true;
enemyObj.x = enemyObj.moveXmin;
} else if (enemyObj.x > enemyObj.moveXmax) {
enemyReachedMoveLimit = true;
enemyObj.x = enemyObj.moveXmax;
}
if (enemyObj.y < enemyObj.moveYmin) {
enemyReachedMoveLimit = true;
enemyObj.y = enemyObj.moveXmin;
} else if (enemyObj.y > enemyObj.moveYmax) {
enemyReachedMoveLimit = true;
enemyObj.y = enemyObj.moveYmax;
}
if (enemyReachedMoveLimit) {
enemyObj.status = "stand";
enemyMC.gotoAndStop("stand");
}
enemyPL_dx = pL.x - enemyObj.x;
enemyPL_dy = (pL.y - pL.armRotationY) - (enemyObj.y - enemyObj.armRotationY);
enemyPL_dist = Math.sqrt((enemyPL_dx * enemyPL_dx) + (enemyPL_dy * enemyPL_dy));
dx_adjust = enemyPL_dx / Abs(enemyPL_dx);
if (enemyPL_dy != 0) {
dy_adjust = enemyPL_dy / Abs(enemyPL_dy);
} else {
dy_adjust = 1;
}
dy_adjust = enemyPL_dy / Abs(enemyPL_dy);
nozzleY = (enemyMC.weapon_MC.nozzle_MC._y * dx_adjust) * dy_adjust;
angleRad = Math.acos(enemyPL_dx / enemyPL_dist) - Math.asin(nozzleY / enemyPL_dist);
if (enemyPL_dy != 0) {
angleRad = angleRad * (enemyPL_dy / Abs(enemyPL_dy));
} else {
angleRad = 0;
if (enemyPL_dx < 0) {
angleRad = -PI;
}
}
enemyObj.weaponAngleDeg = (180 / Math.PI) * angleRad;
enemyObj.weapon_ux = Math.cos(angleRad);
enemyObj.weapon_uy = Math.sin(angleRad);
enemyObj.armRotation = (180 / Math.PI) * angleRad;
if (enemyPL_dx > 0) {
enemyMC.arms_MC._xscale = (enemyMC.weapon_MC._xscale = 100);
enemyMC.arms_MC._rotation = (enemyMC.weapon_MC._rotation = enemyObj.armRotation);
enemyMC.head_MC._xscale = 100;
enemyMC.head_MC._rotation = enemyObj.armRotation;
enemyMC.body_MC._xscale = 100;
} else {
enemyMC.arms_MC._xscale = (enemyMC.weapon_MC._xscale = -100);
enemyMC.arms_MC._rotation = (enemyMC.weapon_MC._rotation = enemyObj.armRotation + 180);
enemyMC.head_MC._xscale = -100;
enemyMC.head_MC._rotation = enemyObj.armRotation + 180;
enemyMC.body_MC._xscale = -100;
}
if ((enemyObj.currNextAttackFr--) < 0) {
if ((enemyObj.currAttackIntervalFr--) > 0) {
if ((--enemyObj.currReloadFr) < 0) {
switch (enemyObj.weaponType) {
case "pistol" :
case "blasterGun" :
case "laser" :
enemyObj.weaponFireSnd = new Sound();
enemyObj.weaponFireSnd.attachSound(enemyObj.weaponType + "_fire");
enemyObj.weaponFireSnd.start(0, 1);
case "uzi" :
case "machineGun" :
case "miniGun" :
checkIfLineOfFireHitAnything(enemyObj, true, false, true);
eval (enemyObj.target + ".head_MC.flash_MC").gotoAndPlay(2);
enemyMC.body_MC.flash_MC.gotoAndPlay(2);
if (!enemyObj.continuousSoundPlaying) {
enemyObj.continuousSoundPlaying = true;
enemyObj.weaponFireSnd = new Sound();
enemyObj.weaponFireSnd.attachSound(enemyObj.weaponType + "_fire");
enemyObj.weaponFireSnd.start(0, 1000);
}
break;
case "grenade" :
break;
case "rocketLauncher" :
case "flameThrower" :
enemyMC.weapon_MC.flash_MC.gotoAndPlay(enemyObj.weaponType);
enemyMC.head_MC.flash_MC.gotoAndPlay(2);
enemyMC.body_MC.flash_MC.gotoAndPlay(2);
nozzleX = enemyObj.target.weapon_MC.nozzle_MC._x;
nozzleY = (enemyObj.target.weapon_MC.nozzle_MC._y * enemyObj.target.weapon_MC._xscale) / 100;
temp_x = (enemyObj.x + (enemyObj.weapon_ux * nozzleX)) - (enemyObj.weapon_uy * nozzleY);
temp_y = ((enemyObj.y - enemyObj.armRotationY) + (enemyObj.weapon_ux * nozzleY)) + (enemyObj.weapon_uy * nozzleX);
createProjectile(enemyObj, enemyObj.weaponType, temp_x, temp_y, enemyObj.weapon_ux, enemyObj.weapon_uy, enemyObj.attackDamage);
break;
}
enemyObj.currReloadFr = enemyObj.weaponReloadFr;
}
} else {
enemyObj.currNextAttackFr = enemyObj.nextAttackFr;
enemyObj.currAttackIntervalFr = enemyObj.attackIntervalFr;
objWeaponSoundStop(enemyObj);
}
}
}
if (enemyObj.status == "attack") {
if (enemyObj.currNextAttackFr > 0) {
} else {
enemyObj.status = "move";
}
}
setStickManColor(enemyMC, enemyObj.skinColor);
enemyMC._x = enemyObj.x;
enemyMC._xscale = 100;
break;
case "stickman2" :
if (!enemyObj.noticedTarget) {
enemyObj.attackTarget = pL;
if ((enemyObj.attackTarget.x > enemyObj.noticeXmin) && (enemyObj.attackTarget.x < enemyObj.noticeXmax)) {
if ((enemyObj.attackTarget.y > enemyObj.noticeYmin) && (enemyObj.attackTarget.y < enemyObj.noticeYmax)) {
enemyObj.noticedTarget = true;
}
}
if (enemyObj.health < enemyObj.fullHealth) {
enemyObj.noticedTarget = true;
}
if (enemyObj.noticedTarget) {
enemyObj.status = "move";
enemyObj.currNextAttackFr = enemyObj.nextAttackFr;
}
} else {
if (enemyPL_dx < 0) {
enemyObj.vx = -enemyObj.walkSpeed;
enemyObj.direction = -1;
} else {
enemyObj.vx = enemyObj.walkSpeed;
enemyObj.direction = 1;
}
if (Abs(pL.x - enemyObj.x) <= 30) {
enemyObj.vx = 1.5 * enemyObj.walkSpeed;
} else if (Abs(pL.x - enemyObj.x) <= enemyObj.attackDist) {
enemyObj.vx = 0;
}
enemyObj.x = enemyObj.x + enemyObj.vx;
if (enemyObj.vx > 0) {
enemyMC.legs_MC._xscale = 100;
enemyMC.gotoAndStop("walk");
enemyObj.status = "walk";
} else if (enemyObj.vx < 0) {
enemyMC.legs_MC._xscale = -100;
enemyMC.gotoAndStop("walk");
enemyObj.status = "walk";
} else {
enemyObj.status = "stand";
enemyMC.gotoAndStop("stand");
}
enemyMC.legs_MC.play();
enemyReachedMoveLimit = false;
if (enemyObj.x < enemyObj.moveXmin) {
enemyReachedMoveLimit = true;
enemyObj.x = enemyObj.moveXmin;
} else if (enemyObj.x > enemyObj.moveXmax) {
enemyReachedMoveLimit = true;
enemyObj.x = enemyObj.moveXmax;
}
if (enemyObj.y < enemyObj.moveYmin) {
enemyReachedMoveLimit = true;
enemyObj.y = enemyObj.moveXmin;
} else if (enemyObj.y > enemyObj.moveYmax) {
enemyReachedMoveLimit = true;
enemyObj.y = enemyObj.moveYmax;
}
if (enemyReachedMoveLimit) {
enemyObj.status = "stand";
enemyMC.gotoAndStop("stand");
}
enemyPL_dx = pL.x - enemyObj.x;
enemyPL_dy = (pL.y - pL.armRotationY) - (enemyObj.y - enemyObj.armRotationY);
enemyPL_dist = Math.sqrt((enemyPL_dx * enemyPL_dx) + (enemyPL_dy * enemyPL_dy));
dx_adjust = enemyPL_dx / Abs(enemyPL_dx);
if (enemyPL_dy != 0) {
dy_adjust = enemyPL_dy / Abs(enemyPL_dy);
} else {
dy_adjust = 1;
}
dy_adjust = enemyPL_dy / Abs(enemyPL_dy);
nozzleY = (enemyMC.weapon_MC.nozzle_MC._y * dx_adjust) * dy_adjust;
angleRad = Math.acos(enemyPL_dx / enemyPL_dist) - Math.asin(nozzleY / enemyPL_dist);
if (enemyPL_dy != 0) {
angleRad = angleRad * (enemyPL_dy / Abs(enemyPL_dy));
} else {
angleRad = 0;
if (enemyPL_dx < 0) {
angleRad = -PI;
}
}
angleDeg = (180 / Math.PI) * angleRad;
enemyObj.weaponAngleDeg = (180 / Math.PI) * angleRad;
if (enemyObj.armRotation > 180) {
enemyObj.armRotation = enemyObj.armRotation - 360;
} else if (enemyObj.armRotation < -180) {
enemyObj.armRotation = enemyObj.armRotation + 360;
}
trace(" ===================================== ");
trace("enemyObj.armRotation - before: " + enemyObj.armRotation);
enemyObj.armRotation = enemyObj.armRotation + (getAngle2toAngle1direction(enemyObj.armRotation, enemyObj.weaponAngleDeg + 180) * enemyObj.gunRotSpeed);
angleRad = (enemyObj.armRotation / 180) * Math.PI;
enemyObj.weapon_ux = Math.cos(angleRad);
enemyObj.weapon_uy = Math.sin(angleRad);
if (enemyObj.direction > 0) {
}
trace((("enemyObj.weaponAngleDeg: " + enemyObj.weaponAngleDeg) + " :: angleDeg: ") + angleDeg);
trace("enemyObj.armRotation: " + enemyObj.armRotation);
if (enemyObj.direction > 0) {
enemyMC.arms_MC._xscale = (enemyMC.weapon_MC._xscale = 100);
enemyMC.head_MC._rotation = (eenemyMC.arms_MC._rotation = (enemyMC.weapon_MC._rotation = enemyObj.armRotation));
enemyMC.body_MC._xscale = (enemyMC.head_MC._xscale = 100);
} else {
enemyMC.arms_MC._xscale = (enemyMC.weapon_MC._xscale = -100);
enemyMC.head_MC._rotation = (enemyMC.arms_MC._rotation = (enemyMC.weapon_MC._rotation = enemyObj.armRotation + 180));
enemyMC.body_MC._xscale = (enemyMC.head_MC._xscale = -100);
}
if ((enemyObj.currNextAttackFr--) < 0) {
if ((enemyObj.currAttackIntervalFr--) > 0) {
if ((--enemyObj.currReloadFr) < 0) {
switch (enemyObj.weaponType) {
case "pistol" :
case "blasterGun" :
case "laser" :
enemyObj.weaponFireSnd = new Sound();
enemyObj.weaponFireSnd.attachSound(enemyObj.weaponType + "_fire");
enemyObj.weaponFireSnd.start(0, 1);
case "uzi" :
case "machineGun" :
case "miniGun" :
checkIfLineOfFireHitAnything(enemyObj, true, false, true);
eval (enemyObj.target + ".head_MC.flash_MC").gotoAndPlay(2);
enemyMC.body_MC.flash_MC.gotoAndPlay(2);
if (!enemyObj.continuousSoundPlaying) {
enemyObj.continuousSoundPlaying = true;
enemyObj.weaponFireSnd = new Sound();
enemyObj.weaponFireSnd.attachSound(enemyObj.weaponType + "_fire");
enemyObj.weaponFireSnd.start(0, 1000);
}
break;
case "grenade" :
break;
case "rocketLauncher" :
case "flameThrower" :
enemyMC.weapon_MC.flash_MC.gotoAndPlay(enemyObj.weaponType);
enemyMC.head_MC.flash_MC.gotoAndPlay(2);
enemyMC.body_MC.flash_MC.gotoAndPlay(2);
nozzleX = enemyObj.target.weapon_MC.nozzle_MC._x;
nozzleY = (enemyObj.target.weapon_MC.nozzle_MC._y * enemyObj.target.weapon_MC._xscale) / 100;
temp_x = (enemyObj.x + (enemyObj.weapon_ux * nozzleX)) - (enemyObj.weapon_uy * nozzleY);
temp_y = ((enemyObj.y - enemyObj.armRotationY) + (enemyObj.weapon_ux * nozzleY)) + (enemyObj.weapon_uy * nozzleX);
createProjectile(enemyObj, enemyObj.weaponType, temp_x, temp_y, enemyObj.weapon_ux, enemyObj.weapon_uy, enemyObj.attackDamage);
break;
}
enemyObj.currReloadFr = enemyObj.weaponReloadFr;
}
} else {
enemyObj.currNextAttackFr = enemyObj.nextAttackFr;
enemyObj.currAttackIntervalFr = enemyObj.attackIntervalFr;
objWeaponSoundStop(enemyObj);
}
}
}
if (enemyObj.status == "attack") {
if (enemyObj.currNextAttackFr > 0) {
} else {
enemyObj.status = "move";
}
}
setStickManColor(enemyMC, enemyObj.skinColor);
enemyMC._x = enemyObj.x;
enemyMC._xscale = 100;
break;
case "walker" :
if (enemyPL_dx < 0) {
enemyObj.weaponAngle = enemyObj.weaponAngle - enemyObj.gunRotSpeed;
} else {
enemyObj.weaponAngle = enemyObj.weaponAngle + enemyObj.gunRotSpeed;
}
if ((enemyObj.weaponAngle < -180) || (enemyObj.weaponAngle > 90)) {
enemyObj.weaponAngle = -180;
} else if (enemyObj.weaponAngle > 0) {
enemyObj.weaponAngle = 0;
}
if (enemyPL_dx < 0) {
enemyMC.gotoAndStop("walk");
enemyObj.vx = -enemyObj.v;
} else {
enemyMC.gotoAndStop("walk");
enemyObj.vx = enemyObj.v;
}
damage = 1;
enemyMC._x = (enemyObj.x = enemyObj.x + enemyObj.vx);
enemyMC.wheel_MC._rotation = enemyMC.wheel_MC._rotation + (4 * enemyObj.vx);
enemyMC.weapon_MC._rotation = enemyObj.weaponAngle;
break;
case "flying" :
if (enemyObj.pathName == "pL_follow") {
if (game_MC.pL_MC.hitAreaMC.hitTest(enemyMC)) {
enemyMC.gotoAndPlay("dies");
enemyArr.splice(enemyNo, 1);
}
enemyCP_dx = pL.x - enemyObj.x;
enemyCP_dy = (pL.y - (pL.h / 2)) - enemyObj.y;
} else {
enemyCP_dx = enemyObj.nextCheckPointX - enemyObj.x;
enemyCP_dy = enemyObj.nextCheckPointY - enemyObj.y;
if (Abs(enemyCP_dx) < reachedCheckPointDist) {
if (Abs(enemyCP_dy) < reachedCheckPointDist) {
nextCP(enemyObj);
}
}
}
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
thrust_x = enemyCP_ux * enemyObj.v;
thrust_y = enemyCP_uy * enemyObj.v;
enemyObj.vx = thrust_x;
enemyObj.vy = thrust_y;
if (enemyObj.weaponAngle > 180) {
enemyObj.weaponAngle = enemyObj.weaponAngle - 360;
} else if (enemyObj.weaponAngle < -180) {
enemyObj.weaponAngle = enemyObj.weaponAngle + 360;
}
enemyObj.weaponAngle = enemyObj.weaponAngle + (getAngle2toAngle1direction(enemyPL_angleDeg, enemyObj.weaponAngle) * enemyObj.gunRotSpeed);
if (enemyObj.nextAttackIntervalFr > 0) {
if ((--enemyObj.nextAttackFr) <= 0) {
enemyObj.nextAttackFr = enemyObj.nextAttackIntervalFr;
weaponAngleRad = (enemyObj.weaponAngle / 180) * Math.PI;
enemyObj.weapon_ux = Math.cos(weaponAngleRad);
enemyObj.weapon_uy = Math.sin(weaponAngleRad);
checkIfLineOfFireHitAnything(enemyObj, true, false, true);
}
}
enemyMC._x = (enemyObj.x = enemyObj.x + enemyObj.vx);
enemyMC._y = (enemyObj.y = enemyObj.y + enemyObj.vy);
enemyMC.weapon_MC._rotation = enemyObj.weaponAngle;
break;
case "Demon" :
enemyCP_dx = enemyObj.nextCheckPointX - enemyObj.x;
enemyCP_dy = enemyObj.nextCheckPointY - enemyObj.y;
if (Abs(enemyCP_dx) < enemyObj.reachedCheckPointDist) {
if (Abs(enemyCP_dy) < enemyObj.reachedCheckPointDist) {
nextCP(enemyObj);
if (enemyObj.vx > 0) {
enemyObj.nextAttackFr = 0.3 * FPS;
} else {
enemyObj.nextAttackFr = 1 * FPS;
}
enemyObj.currAttackFr = enemyObj.nextAttackFr;
}
}
enemyCP_dist = Math.sqrt((enemyCP_dx * enemyCP_dx) + (enemyCP_dy * enemyCP_dy));
enemyCP_ux = enemyCP_dx / enemyCP_dist;
enemyCP_uy = enemyCP_dy / enemyCP_dist;
enemyObj.vx = enemyCP_ux * enemyObj.v;
enemyObj.vy = enemyCP_uy * enemyObj.v;
if ((enemyObj.currAttackFr--) < 0) {
enemyObj.currAttackFr = 0;
}
if (enemyObj.currAttackFr < 0) {
enemyObj.status = "attack";
enemyObj.currAttackFr = enemyObj.nextAttackFr;
temp_x = enemyObj.x;
temp_y = enemyObj.y;
if (enemyObj.vx > 0) {
createProjectile(enemyObj, "DemonSpit", temp_x, temp_y, enemyPL_ux, enemyPL_uy, 5);
} else {
enemyObj.projectileNo++;
if (enemyObj.projectileNo > 5) {
enemyObj.projectileNo = 1;
}
temp_dx = (25 + (enemyObj.projectileNo * ((sw - (2 * 25)) / 5))) - enemyObj.x;
temp_dy = 250 - enemyObj.y;
temp_dist = Math.sqrt((temp_dx * temp_dx) + (temp_dy * temp_dy));
temp_ux = temp_dx / temp_dist;
temp_uy = temp_dy / temp_dist;
createProjectile(enemyObj, "DemonSpit", temp_x, temp_y, temp_ux, temp_uy, 5);
}
}
if ((enemyObj.currCrawlerSpawnFr--) < 0) {
enemyObj.currCrawlerSpawnFr = enemyObj.nextCrawlerSpawnFr;
tempNo = Math_random();
if (tempNo < 0.33) {
tempEnemyArr.push(new Crawler(0 * FPS, 1, roomBufferRight - 10, 260, 10, 30 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
} else if (tempNo < 0.66) {
tempEnemyArr.push(new Crawler(0 * FPS, 1, roomBufferLeft + 10, 260, 10, 30 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
} else {
tempEnemyArr.push(new Wasp(0, 1, enemyObj.x, enemyObj.y, 3, 80 / FPS, "pL_follow", 0, 440, 0, 320, 0, 440, 0, 320));
}
moreEnemyToCome = true;
}
enemyMC._x = (enemyObj.x = enemyObj.x + enemyObj.vx);
enemyMC._y = (enemyObj.y = enemyObj.y + enemyObj.vy);
break;
}
}
if ((enemyStatusDisplayFr--) == 0) {
statusWindowMC.EnemyStatusMC.gotoAndStop("none");
statusWindowMC.EnemyStatusMC.heathMC.barMC._xscale = 100;
statusWindowMC.EnemyStatusMC._visible = false;
} else if (enemyStatusDisplayFr < 0) {
enemyStatusDisplayFr = -2;
}
if (explosionParticleArr.length > 0) {
explosionParticleNo = explosionParticleArr.length;
while ((explosionParticleNo--) > 0) {
explosionParticleObj = explosionParticleArr[explosionParticleNo];
explosionParticleMC = eval (explosionParticleObj.targetMC);
if (explosionParticleObj.smokeTrail) {
explosionParticleObj.vy = explosionParticleObj.vy + (grav / 20);
explosionParticleObj.vx = explosionParticleObj.vx * 0.95;
explosionParticleObj.vy = explosionParticleObj.vy * 0.95;
} else {
explosionParticleObj.vy = explosionParticleObj.vy + (grav / 3);
explosionParticleObj.vx = explosionParticleObj.vx * 0.98;
explosionParticleObj.vy = explosionParticleObj.vy * 0.98;
}
explosionParticleObj.x = explosionParticleObj.x + explosionParticleObj.vx;
explosionParticleObj.y = explosionParticleObj.y + explosionParticleObj.vy;
explosionParticleMC._x = explosionParticleObj.x;
explosionParticleMC._y = explosionParticleObj.y;
explosionParticleMC._rotation = explosionParticleMC._rotation + (4 * explosionParticleObj.vx);
explosionParticleMC._xscale = (explosionParticleMC._yscale = explosionParticleMC._yscale - explosionParticleObj.sizeChangePerFr);
explosionParticleExplode = false;
explosionParticleCollision = false;
platfromNo = platformArr.length;
while ((platfromNo--) > 0) {
P = platformArr[platfromNo];
if (explosionParticleMC.hitTest(P.target)) {
explosionParticleExplode = true;
}
}
bufferDist = 30;
if (explosionParticleObj.y < (roomBufferTop - bufferDist)) {
explosionParticleCollision = "removeOnly";
collisionDirection = "y";
explosionParticleMC._y = roomBufferTop;
} else if (explosionParticleObj.y > (roomBufferBottom + bufferDist)) {
explosionParticleCollision = "removeOnly";
collisionDirection = "y";
explosionParticleMC._y = roomBufferBottom;
}
if (explosionParticleObj.x < (roomBufferLeft - bufferDist)) {
explosionParticleCollision = "removeOnly";
collisionDirection = "x";
explosionParticleMC._x = roomBufferLeft;
} else if (explosionParticleObj.x > (roomBufferRight + bufferDist)) {
explosionParticleCollision = "removeOnly";
collisionDirection = "x";
explosionParticleMC._x = roomBufferRight;
}
if (explosionParticleCollision == true) {
explosionParticleObj.rotSpeed = explosionParticleObj.rotSpeed * (-0.8 * (0.5 - Math_random()));
if ((explosionParticleObj.debryType == "bloodsplatterRed1") || (explosionParticleObj.debryType == "bloodsplatterGreen1")) {
explosionParticleExplode = true;
}
if (collisionDirection == "x") {
explosionParticleObj.vx = explosionParticleObj.vx * -1;
} else if (collisionDirection == "y") {
explosionParticleObj.vy = explosionParticleObj.vy * -0.7;
if ((explosionParticleObj.bounceNo++) > 3) {
explosionParticleExplode = true;
}
}
} else if (explosionParticleCollision == "removeOnly") {
explosionParticleArr.splice(explosionParticleNo, 1);
explosionParticleMC.removeMovieClip();
}
if (explosionParticleObj.smokeTrail) {
smokeColor = "white";
game_MC.smokeTrailAttachMC.attachMovie(smokeColor + "Smoke", (((smokeColor + "Smoke") + "_") + noOfSmokeTrailCreated) + "_MC", noOfSmokeTrailCreated);
targetMC = eval ((((("game_MC.smokeTrailAttachMC." + smokeColor) + "Smoke") + "_") + noOfSmokeTrailCreated) + "_MC");
targetMC._x = explosionParticleObj.x;
targetMC._y = explosionParticleObj.y;
targetMC._rotation = targetMC._rotation + (3 * explosionParticleObj.vx);
targetMC._xscale = (targetMC._yscale = explosionParticleMC._xscale);
}
switch (explosionParticleObj.debryType) {
case "zombie_head" :
case "zombie_body" :
case "zombie_arm" :
case "zombie_leg" :
if (Math_random() > 0.5) {
createExplosionParticle("bloodsplatterGreen1", explosionParticleObj.x, explosionParticleObj.y, 4 * (0.5 + (0.5 * Math.random())), (-180) * Math_random(), 15 + (15 * Math.random()), 20, 5, false);
}
break;
case "demon" :
}
if ((explosionParticleObj.durationFr--) <= 0) {
explosionParticleExplode = true;
}
if (explosionParticleExplode) {
explosionParticleMC.gotoAndPlay("explode");
explosionParticleArr.splice(explosionParticleNo, 1);
switch (explosionParticleObj.debryType) {
case "zombie_head" :
case "zombie_body" :
case "zombie_arm" :
case "zombie_leg" :
fadeAwayArr.push({targetMC:explosionParticleMC, alpha:100});
break;
case "demon" :
}
if ((noOfSmokeTrailCreated++) > 500) {
noOfSmokeTrailCreated = 0;
}
}
}
}
if ((g_missionNo == 10) && (g_taskNo == 5)) {
if (Water.movement == "horizontal") {
Water.w = Water.w + Water.vx;
while (Water.w > (Water.roomNo * sw)) {
Water.roomNo++;
}
if (g_roomNo == Water.screenXarr[Water.roomNo]) {
game_MC.waterMC._x = (Water.roomNo * sw) - Water.w;
environmentArr = [];
environmentObj = [];
environmentObj.type = "water";
environmentObj.x = game_MC.waterMC._x;
environmentObj.y = game_MC.waterMC._y;
environmentObj.w = game_MC.waterMC._width;
environmentObj.h = game_MC.waterMC._height;
environmentObj.shape = "rectangle";
environmentObj.registration = "topLeft";
environmentArr.push(environmentObj);
} else {
game_MC.waterMC._x = sw + 10;
}
if (Water.w > Water.maxW) {
Water.roomNo = 1;
Water.movement = "vertical";
Water.h = sh - game_MC.waterMC._y;
game_MC.waterMC._x = 0;
game_MC.waterMC._y = sh;
}
} else if (Water.movement == "vertical") {
if (Water.h < Water.maxH) {
Water.h = Water.h + Water.vy;
while (Water.h > (Water.roomNo * 260)) {
Water.roomNo++;
}
if (g_roomNo == Water.screenYarr[Water.roomNo]) {
Water.screenY = 300 - (Water.h - ((Water.roomNo - 1) * 260));
game_MC.waterMC._y = Water.screenY;
} else {
game_MC.waterMC._y = sh;
}
environmentArr = [];
environmentObj = [];
environmentObj.type = "water";
environmentObj.x = game_MC.waterMC._x;
environmentObj.y = game_MC.waterMC._y;
environmentObj.w = game_MC.waterMC._width;
environmentObj.h = game_MC.waterMC._height;
environmentObj.shape = "rectangle";
environmentObj.registration = "topLeft";
environmentArr.push(environmentObj);
} else {
game_MC.waterMC._y = 300 - (Water.h - ((Water.roomNo - 1) * 260));
}
}
}
arrNo = fadeAwayArr.length;
while ((arrNo--) > 0) {
fadeAwayObj = fadeAwayArr[arrNo];
eval (fadeAwayObj.targetMC)._alpha = (fadeAwayObj.alpha = fadeAwayObj.alpha - 4);
if (fadeAwayObj.alpha <= 0) {
eval (fadeAwayObj.targetMC).removeMovieClip();
fadeAwayArr.splice(arrNo, 1);
}
}
if ((displayMessageFr--) < 0) {
statusWindowMC.txtMessage = "";
}
currentTime = int((getTimer() - startTime) / 1000);
updateTimer(currentTime, _root);
if (levelCompleteCounter > 0) {
levelCompleteCounter--;
if (levelCompleteCounter == 0) {
game_over(g.missionFinishedReason);
}
} else if (g_missionType == "destroyEnemies") {
if ((enemyArr.length <= 0) && (tempEnemyArr.length <= 0)) {
if (explosionParticleArr.length <= 0) {
startLevelCompleteCountdown("missionComplete");
}
}
} else if (g_missionType == "timeTrial") {
if (currentTime < 0) {
startLevelCompleteCountdown("missionComplete");
}
}
}
function startLevelCompleteCountdown(reason) {
statusWindowMC.missionMessageMC._visible = true;
statusWindowMC.missionMessageMC.gotoAndStop(reason);
g.missionFinishedReason = reason;
if (!(reason === "missionComplete")) {
}
levelCompleteCounter = 2 * FPS;
missionMessageMC._visible = true;
level_finish_time = getTimer();
}
function PauseGame(pauseReason) {
g_stat = "paused";
tempOnEnterFrame = onEnterFrame;
tempOnMouseDown = onMouseDown;
tempOnMouseUp = onMouseUp;
delete onEnterFrame;
delete onMouseDown;
delete onMouseUp;
Mouse.show();
menuWindowMC._visible = true;
menuWindowMC.gotoAndStop(pauseReason);
pause_start_time = getTimer();
objWeaponSoundStop(pL);
enemyNo = enemyArr.length;
while ((enemyNo--) > 0) {
objWeaponSoundStop(enemyArr[enemyNo]);
}
}
trace((("projectileMC: " + projectileMC) + " :: enemyMC: ") + enemyMC);
onKeyDown_game = function () {
currKey = Key.getCode();
if (currKey == keyQualityToggle) {
if (_quality == "HIGH") {
_quality = "LOW";
} else if (_quality == "LOW") {
_quality = "MEDIUM";
} else if (_quality == "MEDIUM") {
_quality = "HIGH";
}
mcQualityStatus.gotoAndPlay(2);
mcQualityStatus.txtQuality = (game_quality = _quality);
}
if (g_stat == "play") {
if (Key_isDown(key_pLNextWeapon)) {
pL_changeWeapon(1);
} else if (Key_isDown(key_pLPrevWeapon)) {
pL_changeWeapon(-1);
} else if (Key_isDown(key_pLMoveUp) && (pL.z == 0)) {
i = 0;
while (i < doorArr.length) {
doorObj = doorArr[i];
if (doorObj.roomNo == g_roomNo) {
doorID = "door_" + doorObj.type;
doorBgndID = doorID + "_bgnd";
if ((Abs(pL.x - doorObj.x) < 15) && (Abs(doorObj.y - pL.y) < 5)) {
ableToAccessDoor = true;
accessKey = doorObj.accessKey;
if ((doorObj.accessKey == "key_basement") && (!pL.key.basement)) {
ableToAccessDoor = false;
} else if ((doorObj.accessKey == "key_building") && (!pL.key.building)) {
ableToAccessDoor = false;
} else if ((doorObj.accessKey == "key_warehouse") && (!pL.key.warehouse)) {
ableToAccessDoor = false;
} else if (doorObj.accessKey == "electric") {
ableToAccessDoor = false;
}
if (ableToAccessDoor) {
pL.currDoor = doorObj;
pL.currDoor.target = doorObj.target;
pL.currDoor.usage = "enter";
pL.x = doorObj.x;
pL.y = doorObj.y;
pL.currDoor.target.gotoAndPlay("open");
} else {
displayMessage("ACCESS DENIED");
}
}
}
i++;
}
i = 0;
while (i < lockArr.length) {
lockObj = lockArr[i];
if (lockObj.roomNo == g_roomNo) {
if ((Abs(pL.x - lockObj.x) < 15) && (Abs(lockObj.y - pL.y) < 5)) {
if (lockObj.status == "closed") {
if (g_alarmON && ((lockObj.type == "smallSafe") || (lockObj.type == "largeSafe"))) {
displayMessage("Locked. Disable alarm.");
} else {
pL.x = lockObj.x + 20;
pL.y = lockObj.y;
pL.currLock = lockObj;
if ((g_roomNo == 17) || (g_roomNo == 6)) {
lockNo = 1;
timeLimit = 3;
} else if ((g_roomNo == 21) || (g_roomNo == 152)) {
lockNo = 2;
timeLimit = 4;
} else if (g_roomNo == 153) {
lockNo = 3;
timeLimit = 8;
} else if (g_roomNo == 236) {
lockNo = 4;
timeLimit = 8;
}
if (g_difficulty == 1) {
timeLimit = timeLimit * 2;
} else if (g_difficulty < 1) {
timeLimit = timeLimit * 3;
}
pL.currLock.timeLimit = timeLimit;
pL.currLock.type = lockObj.type;
PauseGame("Locks");
menuWindowMC.locksMC.pathMC.gotoAndStop(lockNo);
if (Math_random() > 0.5) {
menuWindowMC.locksMC.pathMC._yscale = -100;
}
}
}
}
}
i++;
}
i = 0;
while (i < buttonArr.length) {
buttonObj = buttonArr[i];
if (buttonObj.roomNo == g_roomNo) {
if ((Abs(pL.x - buttonObj.x) < 15) && (Abs(buttonObj.y - pL.y) < 5)) {
if (buttonObj.status == "closed") {
if (buttonObj.action == "open_controlRoom") {
buttonObj.status = "open";
setDoorAccess(148, 1, "");
setDoorAccess(248, 1, "");
setDoorAccess(153, 2, "");
setDoorAccess(253, 1, "");
displayMessage("Electric security locks are OFF");
} else if (buttonObj.action == "alarmOFF") {
g_alarmON = false;
displayMessage("Alarm is OFF");
}
}
buttonObj.target.gotoAndStop(buttonObj.status);
}
}
i++;
}
} else if (currKey == key_pLMap) {
if ((((g_roomNo >= 16) && (g_roomNo <= 60)) || ((g_roomNo >= 116) && (g_roomNo <= 160))) || ((g_roomNo >= 216) && (g_roomNo <= 260))) {
PauseGame("Map");
with (menuWindowMC.mapMC) {
if (g_roomNo < 100) {
pL_mapMC._y = pL_room_1._y;
g_tempRoomNo = g_roomNo;
} else if ((g_roomNo > 100) && (g_roomNo < 200)) {
pL_mapMC._y = pL_room_100._y;
g_tempRoomNo = g_roomNo - 100;
} else {
pL_mapMC._y = pL_room_200._y;
g_tempRoomNo = g_roomNo - 200;
}
if ((g_tempRoomNo >= 16) && (g_tempRoomNo <= 20)) {
floorNo = "b4";
minRoomNo = 16;
} else if ((g_tempRoomNo >= 21) && (g_tempRoomNo <= 25)) {
floorNo = "b3";
minRoomNo = 21;
} else if ((g_tempRoomNo >= 26) && (g_tempRoomNo <= 30)) {
floorNo = "b2";
minRoomNo = 26;
} else if ((g_tempRoomNo >= 31) && (g_tempRoomNo <= 35)) {
floorNo = "b1";
minRoomNo = 31;
} else if ((g_tempRoomNo >= 36) && (g_tempRoomNo <= 40)) {
floorNo = "f1";
minRoomNo = 36;
} else if ((g_tempRoomNo >= 41) && (g_tempRoomNo <= 45)) {
floorNo = "f2";
minRoomNo = 41;
} else if ((g_tempRoomNo >= 46) && (g_tempRoomNo <= 50)) {
floorNo = "f3";
minRoomNo = 46;
} else if ((g_tempRoomNo >= 51) && (g_tempRoomNo <= 55)) {
floorNo = "f4";
minRoomNo = 51;
} else if ((g_tempRoomNo >= 56) && (g_tempRoomNo <= 60)) {
floorNo = "f5";
minRoomNo = 56;
}
pL_mapMC._x = 88 * ((g_tempRoomNo - minRoomNo) + (pL.x / sw));
gotoAndStop(floorNo);
}
}
} else if (currKey == keyMusicOnOff) {
if (!playGameMusic) {
musicSndNo = 1;
musicSnd = new Sound();
musicSnd.attachSound("music" + musicSndNo);
musicSnd.start(0, 1000);
playGameMusic = true;
} else {
musicSnd.stop("music" + musicSndNo);
playGameMusic = false;
}
} else if (currKey == key_pLInventory) {
PauseGame("Inventory");
if (pL.key.basement) {
menuWindowMC.inventoryMC.key_1_MC.gotoAndStop("key_basement");
menuWindowMC.inventoryMC.txtKey1 = "Basement Elevator Key";
} else {
menuWindowMC.inventoryMC.key_1_MC.gotoAndStop("none");
menuWindowMC.inventoryMC.txtKey1 = "";
}
if (pL.key.building) {
menuWindowMC.inventoryMC.key_2_MC.gotoAndStop("key_building");
menuWindowMC.inventoryMC.txtKey2 = "Building Elevator Key";
} else {
menuWindowMC.inventoryMC.key_2_MC.gotoAndStop("none");
menuWindowMC.inventoryMC.txtKey2 = "";
}
if (pL.key.warehouse) {
menuWindowMC.inventoryMC.key_3_MC.gotoAndStop("key_warehouse");
menuWindowMC.inventoryMC.txtKey3 = "Warehouse Door Key";
} else {
menuWindowMC.inventoryMC.key_3_MC.gotoAndStop("none");
menuWindowMC.inventoryMC.txtKey3 = "";
}
} else if (currKey == keyPauseGame) {
PauseGame("pause");
}
} else if (g_stat == "paused") {
if (((currKey == keyPauseGame) || (currKey == key_pLMap)) || (currKey == key_pLInventory)) {
onEnterFrame = tempOnEnterFrame;
onMouseDown = tempOnMouseDown;
onMouseUp = tempOnMouseUp;
g_stat = "play";
menuWindowMC.gotoAndStop("game_start");
startTime = startTime + (getTimer() - pause_start_time);
Mouse.hide();
}
}
};
onMouseDown_game = function () {
Mouse.hide();
if (pL.weaponInHand) {
pL.mouseDown = true;
pL.weaponFireSnd = new Sound();
if ((pL.weaponsArr[pL.currWeaponNo].ammo > 0) || (pL.weaponsArr[pL.currWeaponNo].ammo == "inf")) {
pL.weaponFireSnd.attachSound(pL.weaponType + "_fire");
}
switch (pL.weaponType) {
case "pistol" :
return;
case "blasterGun" :
return;
case "uzi" :
case "machineGun" :
case "miniGun" :
pL.weaponFireSnd.start(0, 1000);
return;
case "laser" :
return;
case "rocketLauncher" :
return;
case "grenade" :
case "flameThrower" :
return;
}
}
};
onMouseUp_game = function () {
pL.mouseDown = false;
if (pL.weaponType == "grenade") {
if (pL.grenadeThrowVelocity > 0) {
nozzleX = game_MC.pL_MC.weapon_MC.nozzle_MC._x;
nozzleY = (game_MC.pL_MC.weapon_MC.nozzle_MC._y * game_MC.pL_MC.weapon_MC._xscale) / 100;
temp_x = (pL.x + (pL.weapon_ux * nozzleX)) - (pL.weapon_uy * nozzleY);
temp_y = ((pL.y - pL.armRotationY) + (pL.weapon_ux * nozzleY)) + (pL.weapon_uy * nozzleX);
createProjectile(pL, pL.weaponType, temp_x, temp_y, pL.weapon_ux, pL.weapon_uy, pL.attackDamage);
pL.weaponsArr[pL.currWeaponNo].currReloadFr = pL.weaponsArr[pL.currWeaponNo].reloadFr;
statusWindowMC.txtAmmo = --pL.weaponsArr[pL.currWeaponNo].ammo;
statusWindowMC.txtGrenadeThrow = (pL.grenadeThrowVelocity = 0);
}
}
switch (pL.weaponType) {
case "pistol" :
return;
case "blasterGun" :
return;
case "uzi" :
case "machineGun" :
case "miniGun" :
objWeaponSoundStop(pL);
return;
}
};
Frame 234
function setMission10platforms() {
if ((g_taskNo == 1) && (g_roomNo == 3)) {
createPlatform("invisible", 0, 40, 18, 240);
} else if ((g_taskNo == 3) && (g_roomNo == 3)) {
createPlatform("invisible", 420, 0, 20, 260);
} else if ((g_taskNo == 4) && (g_roomNo == 115)) {
trace("pL.cheese: " + pL.cheese);
trace("pL.noOfControlRoomMachines: " + pL.noOfControlRoomMachines);
if (pL.cheese && (pL.noOfControlRoomMachines >= 3)) {
createPlatform("Boulder", 22, 195, 46, 65, 0, 0, 0, 0, 0, 0, true, 19);
} else {
createPlatform("black", 0, 160, 80, 118);
}
}
trace("SETTING PLATFORMS " + g_roomNo);
trace("SETTING PLATFORMS " + g_roomNo);
trace("SETTING PLATFORMS " + g_roomNo);
trace("SETTING PLATFORMS " + g_roomNo);
trace("SETTING PLATFORMS " + g_roomNo);
trace("SETTING PLATFORMS " + g_roomNo);
trace("SETTING PLATFORMS " + g_roomNo);
trace("SETTING PLATFORMS " + g_roomNo);
trace("SETTING PLATFORMS " + g_roomNo);
trace("SETTING PLATFORMS " + g_roomNo);
trace("g_taskNo " + g_taskNo);
if (!(g_roomNo === 1)) {
}
switch (g_roomNo) {
case 0 :
return;
case 1 :
createPlatform("black", 0, 250, 440, 40);
createPlatform("invisible", 0, 165, 18, 240);
return;
case 2 :
createPlatform("black", 0, 250, 440, 40);
return;
case 3 :
createPlatform("black", 0, 250, 440, 40);
return;
case 4 :
createPlatform("black", 0, 250, 440, 40);
return;
case 5 :
createPlatform("black", 0, 250, 440, 40);
return;
case 6 :
createPlatform("black", 0, 250, 440, 40);
return;
case 7 :
createPlatform("black", 0, 250, 440, 40);
createPlatform("invisible", 427, 27, 30, 236);
return;
case 8 :
return;
case 9 :
return;
case 10 :
return;
case 11 :
return;
case 12 :
return;
case 13 :
return;
case 14 :
return;
case 15 :
createPlatform("grey", 0, 0, 440, 160);
createPlatform("grey", -1, 245, 440, 40);
createPlatform("grey", -2, 147, 177, 115);
return;
case 16 :
createPlatform("grey", 0, 0, 440, 160);
createPlatform("grey", 0, 245, 440, 40);
createPlatform("grey", 388, 50, 52, 225);
return;
case 17 :
createPlatform("grey", 0, 0, 440, 175);
createPlatform("grey", -1, 245, 440, 40);
createPlatform("grey", -2, 147, 102, 115);
createPlatform("grey", 338, 147, 102, 115);
return;
case 18 :
createPlatform("grey", 0, 0, 440, 160);
createPlatform("grey", -1, 245, 440, 40);
createPlatform("grey", -2, 147, 52, 115);
return;
case 19 :
createPlatform("grey", 0, 0, 440, 160);
createPlatform("grey", 0, 245, 440, 40);
return;
case 20 :
createPlatform("grey", 0, 0, 440, 160);
createPlatform("grey", 0, 245, 440, 40);
createPlatform("grey", 388, 50, 52, 225);
return;
case 21 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
createPlatform("grey", -2, 110, 77, 115);
createPlatform("grey", 348, 110, 92, 115);
return;
case 22 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
createPlatform("grey", -2, 110, 52, 115);
return;
case 23 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
return;
case 24 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
return;
case 25 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
createPlatform("grey", 388, 110, 52, 115);
return;
case 26 :
createPlatform("black", 0, 0, 440, 125);
createPlatform("black", -1, 210, 440, 85);
createPlatform("black", -2, 60, 52, 165);
return;
case 27 :
createPlatform("black", 388, 0, 65, 325);
createPlatform("black", 0, 0, 330, 125);
createPlatform("black", 2, 210, 437, 80);
climbingItemArr.push({type:"pipe", x:358, y:4, w:6, h:205});
return;
case 28 :
createPlatform("grey", 0, 0, 440, 75);
createPlatform("grey", -1, 210, 440, 85);
createPlatform("grey", -2, 60, 52, 165);
createPlatform("grey", 388, 60, 52, 65);
return;
case 29 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
return;
case 30 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
createPlatform("grey", 388, 110, 52, 115);
return;
case 31 :
climbingItemArr.push({type:"rope", x:65, y:71, w:400, h:6});
createPlatform("black", 0, 0, 65, 325);
createPlatform("black", 0, 210, 444, 125);
createPlatform("black", 0, 0, 440, 63);
createPlatform("black", 40, 130, 404, 20);
return;
case 32 :
climbingItemArr.push({type:"rope", x:-24, y:81, w:415, h:6});
createPlatform("black", 388, 0, 65, 63);
createPlatform("black", 0, 210, 330, 125);
createPlatform("black", 0, 0, 350, 63);
createPlatform("black", 100, 130, 353, 20);
climbingItemArr.push({type:"pipe", x:71, y:0, w:6, h:209});
climbingItemArr.push({type:"pipe", x:358, y:146, w:6, h:177});
climbingItemArr.push({type:"rope", x:353, y:44, w:30, h:6});
createPlatform("black", 0, 130, 50, 20);
createPlatform("invisible", 0, 143, 30, 87);
createPlatform("black", 388, 140, 65, 180);
return;
case 33 :
climbingItemArr.push({type:"rope", x:59, y:141, w:160, h:6});
createPlatform("grey", 0, 0, 440, 62);
createPlatform("grey", -1, 210, 440, 85);
createPlatform("grey", -2, 130, 52, 165);
createPlatform("grey", 388, 60, 52, 65);
return;
case 34 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
return;
case 35 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
createPlatform("grey", 388, 110, 52, 115);
return;
case 36 :
createPlatform("black", 0, 250, 440, 63);
createPlatform("invisible", -1, 0, 10, 320);
return;
case 37 :
createPlatform("black", 388, 250, 65, 325);
createPlatform("invisible", 128, 150, 62, 10);
climbingItemArr.push({type:"pipe", x:150, y:0, w:6, h:151});
climbingItemArr.push({type:"pipe", x:200, y:120, w:6, h:129});
climbingItemArr.push({type:"rope", x:353, y:273, w:30, h:6});
createPlatform("black", 0, 250, 350, 63);
createPlatform("invisible", 210, 150, 68, 10);
createPlatform("invisible", 128, 136, 3, 14);
createPlatform("invisible", 275, 136, 3, 14);
return;
case 38 :
createPlatform("black", 0, 250, 440, 63);
return;
case 39 :
createPlatform("black", 0, 250, 440, 63);
return;
case 40 :
createPlatform("black", 0, 250, 440, 63);
createPlatform("invisible", 429, 0, 10, 320);
return;
case 41 :
createPlatform("invisible", 0, 0, 10, 320);
climbingItemArr.push({type:"rope", x:18, y:137, w:444, h:6});
createPlatform("invisible", 210, 210, 100, 10);
createPlatform("invisible", 212, 195, 3, 14);
createPlatform("invisible", 306, 195, 3, 14);
return;
case 42 :
climbingItemArr.push({type:"rope", x:161, y:137, w:310, h:6});
climbingItemArr.push({type:"pipe", x:150, y:0, w:6, h:325});
climbingItemArr.push({type:"rope", x:-32, y:137, w:172, h:6});
return;
case 43 :
climbingItemArr.push({type:"rope", x:-22, y:137, w:480, h:6});
createPlatform("invisible", 210, 210, 100, 10);
createPlatform("invisible", 212, 195, 3, 14);
createPlatform("invisible", 306, 195, 3, 14);
return;
case 44 :
climbingItemArr.push({type:"rope", x:-32, y:137, w:372, h:6});
climbingItemArr.push({type:"pipe", x:350, y:0, w:6, h:240});
climbingItemArr.push({type:"rope", x:360, y:137, w:110, h:6});
return;
case 45 :
climbingItemArr.push({type:"rope", x:-22, y:137, w:444, h:6});
createPlatform("invisible", 429, 0, 10, 320);
createPlatform("invisible", 210, 210, 100, 10);
createPlatform("invisible", 212, 195, 3, 14);
createPlatform("invisible", 306, 195, 3, 14);
return;
case 46 :
createPlatform("invisible", -1, 0, 10, 320);
return;
case 47 :
createPlatform("invisible", 210, 210, 100, 10);
climbingItemArr.push({type:"pipe", x:150, y:0, w:6, h:325});
createPlatform("invisible", 212, 195, 3, 14);
createPlatform("invisible", 306, 195, 3, 14);
return;
case 48 :
return;
case 49 :
climbingItemArr.push({type:"pipe", x:350, y:0, w:6, h:325});
return;
case 50 :
createPlatform("invisible", 429, 0, 10, 320);
return;
case 51 :
createPlatform("invisible", -1, 0, 10, 320);
climbingItemArr.push({type:"rope", x:18, y:137, w:444, h:6});
createPlatform("invisible", 210, 210, 100, 10);
createPlatform("invisible", 212, 195, 3, 14);
createPlatform("invisible", 306, 195, 3, 14);
return;
case 52 :
createPlatform("invisible", 210, 210, 100, 10);
climbingItemArr.push({type:"rope", x:161, y:137, w:310, h:6});
createPlatform("invisible", 212, 195, 3, 14);
createPlatform("invisible", 306, 195, 3, 14);
climbingItemArr.push({type:"pipe", x:150, y:0, w:6, h:325});
climbingItemArr.push({type:"rope", x:-32, y:137, w:172, h:6});
return;
case 53 :
createPlatform("invisible", 210, 210, 100, 10);
climbingItemArr.push({type:"rope", x:-22, y:137, w:480, h:6});
createPlatform("invisible", 212, 195, 3, 14);
createPlatform("invisible", 306, 195, 3, 14);
return;
case 54 :
climbingItemArr.push({type:"rope", x:-32, y:137, w:372, h:6});
climbingItemArr.push({type:"pipe", x:350, y:45, w:6, h:312});
climbingItemArr.push({type:"rope", x:360, y:137, w:110, h:6});
return;
case 55 :
climbingItemArr.push({type:"rope", x:-22, y:137, w:444, h:6});
createPlatform("invisible", 429, 0, 10, 320);
return;
case 56 :
createPlatform("invisible", 0, 190, 440, 10);
createPlatform("invisible", 0, 40, 10, 150);
return;
case 57 :
createPlatform("invisible", 160, 190, 280, 10);
createPlatform("invisible", 0, 190, 139, 10);
climbingItemArr.push({type:"pipe", x:148, y:140, w:6, h:190});
return;
case 58 :
createPlatform("invisible", 0, 190, 440, 10);
createPlatform("invisible", 430, 40, 10, 150);
return;
case 59 :
return;
case 60 :
return;
case 61 :
return;
case 62 :
return;
case 63 :
return;
case 64 :
return;
case 101 :
createPlatform("black", 0, 250, 440, 101);
createPlatform("black", 0, 40, 440, 135);
createPlatform("black", 0, 140, 100, 135);
createPlatform("black", 370, 155, 70, 105);
return;
case 102 :
createPlatform("black", 60, 250, 90, 40);
createPlatform("black", 0, 40, 29, 255);
createPlatform("black", 0, 40, 440, 110);
createPlatform("black", 325, 50, 115, 220);
climbingItemArr.push({type:"pipe", x:40, y:199, w:6, h:151});
createPlatform("black", 200, 125, 137, 63);
createPlatform("black", 25, 135, 125, 53);
createPlatform("black", 200, 250, 240, 40);
return;
case 103 :
return;
case 104 :
return;
case 105 :
return;
case 106 :
return;
case 107 :
return;
case 108 :
climbingItemArr.push({type:"pipe", x:40, y:9, w:6, h:341});
climbingItemArr.push({type:"rope", x:100, y:199, w:175, h:6});
climbingItemArr.push({type:"pipe", x:341, y:205, w:6, h:119});
createPlatform("black", 60, 10, 90, 80);
createPlatform("black", 375, 100, 65, 220);
createPlatform("black", 200, 245, 111, 80);
createPlatform("black", 65, 245, 85, 80);
createPlatform("black", 200, 10, 240, 176);
createPlatform("black", 0, 10, 29, 315);
createPlatform("black", 65, 135, 85, 53);
return;
case 109 :
climbingItemArr.push({type:"pipe", x:40, y:9, w:6, h:315});
climbingItemArr.push({type:"rope", x:37, y:84, w:113, h:6});
climbingItemArr.push({type:"pipe", x:341, y:-15, w:6, h:150});
createPlatform("black", 375, 0, 65, 325);
createPlatform("black", 200, -5, 111, 80);
createPlatform("black", 65, -5, 85, 80);
createPlatform("black", 0, 10, 29, 315);
createPlatform("black", 65, 94, 21, 231);
createPlatform("black", 108, 135, 42, 190);
createPlatform("black", 200, 135, 42, 190);
climbingItemArr.push({type:"rope", x:210, y:84, w:138, h:6});
climbingItemArr.push({type:"pipe", x:97, y:94, w:6, h:230});
climbingItemArr.push({type:"pipe", x:350, y:176, w:6, h:145});
createPlatform("black", 200, 135, 200, 40);
createPlatform("black", 232, 242, 85, 80);
return;
case 110 :
climbingItemArr.push({type:"pipe", x:97, y:4, w:6, h:241});
climbingItemArr.push({type:"pipe", x:350, y:0, w:6, h:245});
createPlatform("black", 375, 0, 65, 175);
createPlatform("black", 0, 10, 29, 315);
createPlatform("black", 65, 4, 21, 191);
createPlatform("black", 108, 5, 42, 170);
createPlatform("black", 200, 5, 113, 170);
createPlatform("black", 18, 245, 422, 40);
climbingItemArr.push({type:"pipe", x:40, y:0, w:6, h:97});
return;
case 111 :
createPlatform("black", 0, 0, 150, 175);
createPlatform("black", 254, 5, 190, 170);
createPlatform("black", 0, 245, 440, 40);
createPlatform("black", 122, 19, 183, 118);
createPlatform("black", 164, 216, 75, 38);
createPlatform("invisible", -59, 172, 45, 55);
return;
case 112 :
createPlatform("black", 0, 0, 125, 175);
createPlatform("black", 344, 5, 96, 170);
createPlatform("black", 0, 245, 440, 40);
createPlatform("black", 122, 19, 228, 94);
createPlatform("black", 184, 196, 99, 58);
createPlatform("black", 144, 216, 75, 38);
createPlatform("black", 256, 221, 54, 29);
return;
case 113 :
createPlatform("black", 354, 135, 86, 35);
createPlatform("black", 0, 245, 440, 40);
createPlatform("black", 2, 19, 440, 118);
createPlatform("black", 302, 216, 38, 38);
createPlatform("black", 149, 137, 31, 35);
createPlatform("black", 2, 137, 73, 35);
createPlatform("black", 98, 211, 40, 38);
createPlatform("invisible", -60, 172, 45, 55);
createPlatform("black", 251, 137, 31, 35);
createPlatform("black", 198, 213, 38, 38);
return;
case 114 :
createPlatform("black", 0, 0, 150, 175);
createPlatform("black", 254, 5, 190, 170);
createPlatform("black", 0, 245, 440, 40);
createPlatform("invisible", 213, 221, 30, 29);
createPlatform("black", 122, 19, 183, 118);
createPlatform("invisible", 157, 221, 30, 29);
return;
case 115 :
createPlatform("black", 0, 0, 440, 175);
createPlatform("black", 0, 245, 440, 40);
createPlatform("black", 388, 142, 52, 118);
return;
case 116 :
createPlatform("grey", 0, 0, 440, 175);
createPlatform("grey", -1, 245, 440, 40);
createPlatform("grey", -2, 147, 77, 115);
return;
case 117 :
createPlatform("grey", 0, 0, 440, 175);
createPlatform("grey", 0, 245, 440, 40);
return;
case 118 :
createPlatform("grey", 0, 0, 440, 175);
createPlatform("grey", 0, 245, 440, 40);
return;
case 119 :
createPlatform("grey", 0, 0, 440, 175);
createPlatform("grey", 0, 245, 440, 40);
return;
case 120 :
createPlatform("grey", 0, 0, 440, 175);
createPlatform("grey", 0, 245, 440, 40);
createPlatform("grey", 388, 50, 52, 225);
return;
case 121 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
createPlatform("grey", -2, 110, 52, 115);
return;
case 122 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
createPlatform("grey", 388, 110, 52, 115);
return;
case 123 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
createPlatform("grey", -2, 110, 52, 115);
return;
case 124 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
return;
case 125 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
createPlatform("grey", 388, 110, 52, 115);
return;
case 126 :
createPlatform("grey", 0, 0, 440, 75);
createPlatform("grey", -1, 210, 440, 85);
createPlatform("grey", -2, 60, 52, 165);
createPlatform("grey", 388, 60, 52, 65);
return;
case 127 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
createPlatform("grey", 388, 110, 52, 115);
return;
case 128 :
createPlatform("grey", 0, 0, 440, 75);
createPlatform("grey", -1, 210, 440, 85);
createPlatform("grey", -2, 60, 52, 165);
createPlatform("grey", 388, 60, 52, 65);
return;
case 129 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
return;
case 130 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
createPlatform("grey", 388, 110, 52, 115);
return;
case 131 :
return;
case 132 :
return;
case 133 :
createPlatform("grey", 0, 0, 440, 75);
createPlatform("grey", -1, 210, 440, 85);
createPlatform("grey", -2, 60, 52, 165);
createPlatform("grey", 388, 60, 52, 65);
return;
case 134 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
return;
case 135 :
createPlatform("grey", 0, 0, 440, 125);
createPlatform("grey", -1, 210, 440, 85);
createPlatform("grey", 388, 110, 52, 115);
return;
case 136 :
createPlatform("white", 0, 0, 440, 75);
createPlatform("white", -1, 250, 440, 85);
createPlatform("white", -2, 60, 52, 201);
return;
case 137 :
createPlatform("white", 0, 0, 440, 75);
createPlatform("white", -1, 250, 440, 85);
return;
case 138 :
createPlatform("white", 0, 0, 440, 75);
createPlatform("white", -1, 250, 440, 85);
return;
case 139 :
createPlatform("white", 0, 0, 440, 75);
createPlatform("white", -1, 250, 440, 85);
return;
case 140 :
createPlatform("white", 0, 0, 440, 75);
createPlatform("white", -1, 250, 440, 85);
createPlatform("white", 388, 60, 52, 201);
return;
case 141 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", 0, 110, 52, 115);
return;
case 142 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
return;
case 143 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
return;
case 144 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
return;
case 145 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", 388, 110, 52, 115);
return;
case 146 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", 0, 110, 52, 115);
return;
case 147 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", 388, 110, 52, 115);
return;
case 148 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", -2, 110, 77, 115);
createPlatform("white", 348, 110, 92, 115);
return;
case 149 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", 0, 110, 52, 115);
return;
case 150 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", 388, 110, 52, 115);
return;
case 151 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", 0, 110, 52, 115);
return;
case 152 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", 388, 110, 52, 115);
return;
case 153 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", -2, 110, 77, 115);
createPlatform("white", 348, 110, 92, 115);
return;
case 154 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", 0, 110, 52, 115);
return;
case 155 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", 388, 110, 52, 115);
return;
case 156 :
return;
case 157 :
return;
case 158 :
createPlatform("invisible", 0, 190, 440, 60);
createPlatform("invisible", 340, 40, 70, 150);
createPlatform("invisible", 100, 40, 68, 150);
createPlatform("invisible", 130, 40, 251, 87);
return;
case 159 :
return;
case 160 :
return;
case 161 :
return;
case 162 :
return;
case 163 :
return;
case 164 :
return;
case 165 :
return;
case 166 :
return;
case 201 :
return;
case 202 :
return;
case 203 :
return;
case 204 :
return;
case 205 :
return;
case 206 :
return;
case 207 :
return;
case 208 :
return;
case 209 :
return;
case 210 :
return;
case 211 :
return;
case 212 :
return;
case 213 :
return;
case 214 :
return;
case 215 :
return;
case 216 :
createPlatform("grey", 0, 0, 440, 175);
createPlatform("grey", -1, 245, 440, 40);
createPlatform("grey", -2, 147, 77, 115);
return;
case 217 :
createPlatform("grey", 0, 0, 440, 175);
createPlatform("grey", 0, 245, 440, 40);
return;
case 218 :
createPlatform("grey", 0, 0, 440, 175);
createPlatform("grey", 0, 245, 440, 40);
return;
case 219 :
createPlatform("grey", 0, 0, 440, 175);
createPlatform("grey", 0, 245, 440, 40);
createPlatform("grey", 388, 50, 52, 225);
return;
case 220 :
return;
case 221 :
return;
case 222 :
return;
case 223 :
return;
case 224 :
return;
case 225 :
return;
case 226 :
return;
case 227 :
return;
case 228 :
return;
case 229 :
return;
case 230 :
return;
case 231 :
return;
case 232 :
return;
case 233 :
return;
case 234 :
return;
case 235 :
return;
case 236 :
createPlatform("white", 0, 0, 440, 200);
createPlatform("white", -1, 250, 440, 85);
createPlatform("white", -2, 60, 52, 201);
return;
case 237 :
createPlatform("white", 0, 0, 440, 200);
createPlatform("white", -1, 250, 440, 85);
return;
case 238 :
createPlatform("white", 0, 0, 440, 200);
createPlatform("white", -1, 250, 440, 85);
createPlatform("white", 388, 60, 52, 201);
return;
case 239 :
return;
case 240 :
return;
case 241 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", 0, 110, 52, 115);
return;
case 242 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
return;
case 243 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
return;
case 244 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", 388, 110, 52, 115);
return;
case 245 :
return;
case 246 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", 0, 110, 52, 115);
return;
case 247 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
return;
case 248 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
return;
case 249 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", 388, 110, 52, 115);
return;
case 250 :
return;
case 251 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", 0, 110, 52, 115);
return;
case 252 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
return;
case 253 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
return;
case 254 :
createPlatform("white", 0, 0, 440, 125);
createPlatform("white", -1, 210, 440, 85);
createPlatform("white", 388, 110, 52, 115);
return;
case 255 :
return;
case 256 :
return;
case 257 :
return;
case 258 :
return;
case 259 :
return;
case 260 :
return;
case 261 :
return;
case 262 :
return;
case 263 :
return;
case 264 :
return;
case 265 :
case 266 :
}
}
stop();
Symbol 24 MovieClip Frame 1
_rotation = (360 * Math.random());
Symbol 24 MovieClip Frame 10
stop();
Symbol 25 MovieClip [laser] Frame 1
trace("ATTACHED MINE ==========");
stop();
Symbol 25 MovieClip [laser] Frame 13
this.removeMovieClip();
Symbol 30 MovieClip [platform_ControlRoomMachine] Frame 1
trace("1 - created platform " + platformType);
stop();
Symbol 32 MovieClip [platform_grey] Frame 1
platformType = "white";
if (_root.trace_platforms) {
trace(((((((((("createPlatform(\"" + platformType) + "\", ") + int(_x)) + ", ") + int(_y)) + ", ") + int(_width)) + ", ") + int(_height)) + ")");
}
Symbol 34 MovieClip [platform_white] Frame 1
platformType = "white";
if (_root.trace_platforms) {
trace(((((((((("createPlatform(\"" + platformType) + "\", ") + int(_x)) + ", ") + int(_y)) + ", ") + int(_width)) + ", ") + int(_height)) + ")");
}
Symbol 36 MovieClip [environment_water_NOT] Frame 1
trace("1 - created platform " + platformType);
Symbol 40 MovieClip [platform_Boulder] Frame 1
trace("1 - created platform " + platformType);
stop();
Symbol 42 MovieClip [platform_ManholeCover] Frame 1
trace("1 - created platform " + platformType);
stop();
Symbol 44 MovieClip [platform_generic] Frame 1
trace("1 - created platform " + platformType);
Symbol 48 Button
on (release) {
_root.g_missionNo = buttonNo;
_root.showCutScenes();
}
Symbol 52 MovieClip [missionButton] Frame 1
stop();
Symbol 59 MovieClip Frame 1
stop();
Symbol 62 MovieClip Frame 1
stop();
Symbol 65 MovieClip Frame 1
stop();
Symbol 66 MovieClip [crawler_head] Frame 1
stop();
Symbol 67 MovieClip [crawler1] Frame 1
stop();
Instance of Symbol 53 MovieClip "hitAreaMC" in Symbol 67 MovieClip [crawler1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 67 MovieClip [crawler1] Frame 5
this.removeMovieClip();
stop();
Symbol 69 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 1
stop();
Symbol 77 MovieClip Frame 1
_visible = false;
Symbol 81 MovieClip Frame 2
stop();
Symbol 91 MovieClip Frame 1
stop();
Symbol 95 MovieClip Frame 1
stop();
Symbol 99 MovieClip Frame 1
stop();
Symbol 104 MovieClip Frame 1
stop();
Symbol 113 MovieClip Frame 1
stop();
Symbol 113 MovieClip Frame 3
gotoAndStop (1);
Symbol 113 MovieClip Frame 5
gotoAndStop (1);
Symbol 113 MovieClip Frame 7
gotoAndStop (1);
Symbol 113 MovieClip Frame 9
gotoAndStop (1);
Symbol 113 MovieClip Frame 11
gotoAndStop (1);
Symbol 113 MovieClip Frame 13
gotoAndStop (1);
Symbol 113 MovieClip Frame 16
gotoAndStop (1);
Symbol 113 MovieClip Frame 18
gotoAndStop (1);
Symbol 113 MovieClip Frame 20
gotoAndStop (1);
Symbol 126 MovieClip Frame 1
stop();
Symbol 127 MovieClip Frame 1
stop();
Symbol 128 MovieClip [zombie2] Frame 1
stop();
Instance of Symbol 53 MovieClip "hitAreaMC" in Symbol 128 MovieClip [zombie2] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 128 MovieClip [zombie2] Frame 7
this.removeMovieClip();
stop();
Symbol 130 MovieClip Frame 1
stop();
Symbol 132 MovieClip [zombie1] Frame 1
stop();
Instance of Symbol 53 MovieClip "hitAreaMC" in Symbol 132 MovieClip [zombie1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 132 MovieClip [zombie1] Frame 8
this.removeMovieClip();
stop();
Symbol 133 MovieClip [zombie_head] Frame 1
stop();
Symbol 134 MovieClip [crawler_leg] Frame 1
stop();
Symbol 136 MovieClip [zombie_leg] Frame 1
stop();
Symbol 137 MovieClip [zombie_arm] Frame 1
stop();
Symbol 139 MovieClip [zombie_body] Frame 1
stop();
Symbol 144 MovieClip [flameThrower] Frame 14
this._rotation = int(360 * Math.random());
Symbol 144 MovieClip [flameThrower] Frame 23
this.removeMovieClip();
Symbol 146 MovieClip [rocketLauncher] Frame 1
stop();
Symbol 146 MovieClip [rocketLauncher] Frame 11
this.removeMovieClip();
Symbol 148 MovieClip [DemonSpit] Frame 1
stop();
Symbol 148 MovieClip [DemonSpit] Frame 5
this.removeMovieClip();
Symbol 150 MovieClip [GiantWaspSpit] Frame 1
stop();
Symbol 150 MovieClip [GiantWaspSpit] Frame 5
this.removeMovieClip();
Symbol 152 MovieClip [GiantSpiderSpit] Frame 1
stop();
Symbol 152 MovieClip [GiantSpiderSpit] Frame 5
this.removeMovieClip();
Symbol 154 MovieClip [zombieSpit] Frame 1
stop();
Symbol 154 MovieClip [zombieSpit] Frame 5
this.removeMovieClip();
Symbol 155 MovieClip [grenade] Frame 1
stop();
Symbol 155 MovieClip [grenade] Frame 7
this.removeMovieClip();
Symbol 158 MovieClip [wasp_body] Frame 1
stop();
Symbol 162 MovieClip [wasp_head] Frame 1
stop();
Symbol 164 MovieClip [wasp1] Frame 1
trace("ATTACHED FLIER ==========");
stop();
Instance of Symbol 53 MovieClip "hitAreaMC" in Symbol 164 MovieClip [wasp1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 164 MovieClip [wasp1] Frame 3
this.removeMovieClip();
Symbol 168 MovieClip [Demon_head] Frame 1
stop();
Symbol 169 MovieClip [Demon_body] Frame 1
stop();
Symbol 177 MovieClip [Demon1] Frame 1
stop();
Instance of Symbol 53 MovieClip "hitAreaMC" in Symbol 177 MovieClip [Demon1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 177 MovieClip [Demon1] Frame 3
this.removeMovieClip();
Symbol 181 MovieClip [GiantSpider_abdomen] Frame 1
stop();
Symbol 186 MovieClip Frame 1
stop();
Symbol 188 MovieClip [GiantSpider_eye] Frame 1
stop();
Symbol 193 MovieClip [GiantSpider1] Frame 1
trace("ATTACHED FLIER ==========");
stop();
Instance of Symbol 53 MovieClip "hitAreaMC" in Symbol 193 MovieClip [GiantSpider1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 184 MovieClip in Symbol 193 MovieClip [GiantSpider1] Frame 1
onClipEvent (load) {
this.gotoAndPlay("step");
}
Instance of Symbol 184 MovieClip in Symbol 193 MovieClip [GiantSpider1] Frame 1
onClipEvent (load) {
this.gotoAndPlay("step");
}
Instance of Symbol 184 MovieClip in Symbol 193 MovieClip [GiantSpider1] Frame 1
onClipEvent (load) {
this.gotoAndPlay("step");
}
Instance of Symbol 190 MovieClip [GiantSpider_leg] "leg7" in Symbol 193 MovieClip [GiantSpider1] Frame 2
onClipEvent (load) {
this.gotoAndPlay("step");
}
Instance of Symbol 190 MovieClip [GiantSpider_leg] "leg8" in Symbol 193 MovieClip [GiantSpider1] Frame 2
onClipEvent (load) {
this.gotoAndPlay("step");
}
Instance of Symbol 190 MovieClip [GiantSpider_leg] "leg9" in Symbol 193 MovieClip [GiantSpider1] Frame 2
onClipEvent (load) {
this.gotoAndPlay("step");
}
Instance of Symbol 190 MovieClip [GiantSpider_leg] "leg1" in Symbol 193 MovieClip [GiantSpider1] Frame 2
onClipEvent (load) {
this.gotoAndPlay("step");
}
Instance of Symbol 190 MovieClip [GiantSpider_leg] "leg2" in Symbol 193 MovieClip [GiantSpider1] Frame 2
onClipEvent (load) {
this.gotoAndPlay("step");
}
Instance of Symbol 190 MovieClip [GiantSpider_leg] "leg3" in Symbol 193 MovieClip [GiantSpider1] Frame 2
onClipEvent (load) {
this.gotoAndPlay("step");
}
Symbol 193 MovieClip [GiantSpider1] Frame 3
this.removeMovieClip();
Symbol 195 MovieClip [mine1] Frame 1
trace("ATTACHED MINE ==========");
stop();
Symbol 195 MovieClip [mine1] Frame 13
this.removeMovieClip();
Symbol 200 MovieClip Frame 9
_parent.gotoAndStop("stand");
Symbol 208 MovieClip [bat_wing] Frame 1
trace("ATTACHED WING");
stop();
Symbol 212 MovieClip [bat_head] Frame 1
stop();
Symbol 213 MovieClip [grass1] Frame 1
trace("ATTACHED FLIER ==========");
stop();
Symbol 213 MovieClip [grass1] Frame 4
this.removeMovieClip();
Symbol 214 MovieClip [bat1] Frame 1
trace("ATTACHED FLIER ==========");
stop();
Instance of Symbol 53 MovieClip "hitAreaMC" in Symbol 214 MovieClip [bat1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 214 MovieClip [bat1] Frame 3
this.removeMovieClip();
Symbol 217 MovieClip [bloodsplatter0] Frame 1
Symbol 217 MovieClip [bloodsplatter0] Frame 6
this.removeMovieCLip();
Symbol 221 MovieClip [ricochet2] Frame 4
this.removeMovieCLip();
Symbol 224 MovieClip [ricochet1] Frame 4
this.removeMovieCLip();
Symbol 227 MovieClip [explosion1] Frame 5
this.removeMovieCLip();
Symbol 232 MovieClip [debry1] Frame 1
trace("ATTACH EXPLOSION DEBRY");
this.gotoAndStop(1 + int(3 * Math.random()));
stop();
Symbol 232 MovieClip [debry1] Frame 5
this.removeMovieClip();
Symbol 235 MovieClip [bloodsplatterGreen1] Frame 1
stop();
Symbol 235 MovieClip [bloodsplatterGreen1] Frame 4
this.removeMovieClip();
Symbol 237 MovieClip [bloodsplatterRed1] Frame 1
stop();
Symbol 237 MovieClip [bloodsplatterRed1] Frame 13
this.removeMovieClip();
Symbol 240 MovieClip [whiteSmoke] Frame 8
this.removeMovieClip();
Symbol 254 MovieClip [door_doublesliding] Frame 1
stop();
Symbol 254 MovieClip [door_doublesliding] Frame 2
play();
Symbol 254 MovieClip [door_doublesliding] Frame 14
_root.doorIsOpen();
stop();
Symbol 254 MovieClip [door_doublesliding] Frame 15
play();
Symbol 254 MovieClip [door_doublesliding] Frame 23
_root.doorIsClosed();
Symbol 260 MovieClip [door_finishedMission] Frame 1
stop();
Symbol 260 MovieClip [door_finishedMission] Frame 2
play();
Symbol 260 MovieClip [door_finishedMission] Frame 12
_root.doorIsOpen();
stop();
Symbol 260 MovieClip [door_finishedMission] Frame 13
play();
Symbol 260 MovieClip [door_finishedMission] Frame 21
_root.doorIsClosed();
Symbol 262 MovieClip [door_noDoor] Frame 1
stop();
Symbol 262 MovieClip [door_noDoor] Frame 2
play();
Symbol 262 MovieClip [door_noDoor] Frame 4
_root.doorIsOpen();
stop();
Symbol 262 MovieClip [door_noDoor] Frame 5
play();
Symbol 262 MovieClip [door_noDoor] Frame 6
_root.doorIsClosed();
Symbol 266 MovieClip [button_switch1] Frame 1
stop();
Symbol 269 MovieClip [lock_smallSafe] Frame 1
stop();
Symbol 271 MovieClip [lock_largeSafe] Frame 1
stop();
Symbol 274 MovieClip [lock_locker] Frame 1
stop();
Symbol 279 MovieClip [door_knob] Frame 1
stop();
Symbol 279 MovieClip [door_knob] Frame 2
play();
Symbol 279 MovieClip [door_knob] Frame 12
_root.doorIsOpen();
stop();
Symbol 279 MovieClip [door_knob] Frame 13
play();
Symbol 279 MovieClip [door_knob] Frame 21
_root.doorIsClosed();
Symbol 281 MovieClip [door_doublesliding_bgnd] Frame 1
stop();
Symbol 283 MovieClip [door_finishMission_bgnd] Frame 1
stop();
Symbol 284 MovieClip [door_knob_bgnd] Frame 1
stop();
Symbol 288 MovieClip Frame 1
_visible = false;
_parent._parent.checkAreasArr.push(_name);
Symbol 294 MovieClip Frame 1
_visible = false;
stop();
Symbol 308 MovieClip Frame 1
stop();
Symbol 312 Button
on (release) {
finishMC.finishTime = getTimer() + (_root.pL.currLock.timeLimit * 1000);
trace("pL.currLock.timeLimit " + _root.pL.currLock.timeLimit);
Mouse.show();
pathMC._visible = true;
}
Symbol 318 MovieClip Frame 1
stop();
Symbol 322 MovieClip [Locks] Frame 1
checkAreasArr = [];
R = _root;
stop();
Instance of Symbol 318 MovieClip "finishMC" in Symbol 322 MovieClip [Locks] Frame 1
onClipEvent (load) {
P = _parent;
R = _root;
failedAttempt = false;
continueGame = false;
R.updateTimer(R.pL.currLock.timeLimit, P);
trace("timeLimit " + R.pL.currLock.timeLimit);
}
onClipEvent (enterFrame) {
if (finishTime > 0) {
trace("currentTime " + currentTime);
if (P.pathMC.hitTest(R._xmouse + R._x, R._ymouse + R._y, true)) {
trace("checkAreasArr.length " + P.checkAreasArr.length);
arrNo = P.checkAreasArr.length;
CA = eval ("P.pathMC." + P.checkAreasArr[0]);
trace("CA " + CA);
if (CA.hitTest(R._xmouse + R._x, R._ymouse + R._y, true)) {
P.checkAreasArr.splice(0, 1);
}
currentTime = int((finishTime - getTimer()) / 1000);
R.updateTimer(currentTime, P._target);
if (currentTime < 1) {
failedAttempt = true;
} else if (P.finishMC.hitTest(R._xmouse + R._x, R._ymouse + R._y, false)) {
if (P.checkAreasArr.length > 0) {
failedAttempt = true;
} else {
g_alarmON = false;
R.displayMessage("Success");
R.pL.currLock.target.gotoAndStop("open");
R.pL.currLock.status = "open";
trace("R.pickUpItemArr.length " + R.pickUpItemArr.length);
R.pickUpItemArr.push(new R.pickUpItem(true, R.g_roomNo, 1, R.pL.currLock.x, R.pL.currLock.y, R.pL.currLock.content, 25));
trace("R.pL.currLock.content " + R.pL.currLock.content);
trace("R.pickUpItemArr.length " + R.pickUpItemArr.length);
itemObj = R.pickUpItemArr[R.pickUpItemArr.length - 1];
itemID = "pickUpItem";
R.game_MC.pickUpItemMC.attachMovie(itemID, ((itemID + "_") + itemObj.itemNo) + "_MC", ++R.noOfpickUpItemCreated);
pickUpItemMC = eval (((("R.game_MC.pickUpItemMC." + itemID) + "_") + itemObj.itemNo) + "_MC");
pickUpItemMC.gotoAndStop(itemObj.type);
pickUpItemMC._x = R.pL.currLock.x;
pickUpItemMC._y = R.pL.currLock.y;
itemObj.w = pickUpItemMC._width;
itemObj.h = pickUpItemMC._height;
itemObj.registration = "bottomCenter";
Mouse.hide();
P.gotoAndPlay("success");
}
}
} else {
failedAttempt = true;
}
if (failedAttempt) {
failedAttempt = false;
trace("failed Attempt");
R.displayMessage("Failure");
if ((R.pL.currLock.type == "smallSafe") || (R.pL.currLock.type == "largeSafe")) {
R.g_alarmON = true;
R.displayMessage("Alarm is ON");
}
Mouse.hide();
P.gotoAndPlay("failure");
}
if (continueGame) {
R.onEnterFrame = R.tempOnEnterFrame;
R.onMouseDown = R.tempOnMouseDown;
R.onMouseUp = R.tempOnMouseUp;
R.g_stat = "play";
R.menuWindowMC.gotoAndStop("game_start");
R.startTime = R.startTime + (getTimer() - R.pause_start_time);
Mouse.hide();
_parent.removeMovieClip();
}
}
}
Symbol 322 MovieClip [Locks] Frame 26
R.onEnterFrame = R.tempOnEnterFrame;
R.onMouseDown = R.tempOnMouseDown;
R.onMouseUp = R.tempOnMouseUp;
R.g_stat = "play";
R.menuWindowMC.gotoAndStop("game_start");
R.startTime = R.startTime + (getTimer() - R.pause_start_time);
Mouse.hide();
Symbol 322 MovieClip [Locks] Frame 55
R.onEnterFrame = R.tempOnEnterFrame;
R.onMouseDown = R.tempOnMouseDown;
R.onMouseUp = R.tempOnMouseUp;
R.g_stat = "play";
R.menuWindowMC.gotoAndStop("game_start");
R.startTime = R.startTime + (getTimer() - R.pause_start_time);
Mouse.hide();
Symbol 336 MovieClip [pickUpItem] Frame 1
stop();
Symbol 353 MovieClip Frame 9
stop();
Symbol 354 MovieClip [rocket] Frame 1
trace("ATTACHED FLIER ==========");
stop();
Symbol 354 MovieClip [rocket] Frame 5
play();
Symbol 354 MovieClip [rocket] Frame 13
this.removeMovieClip();
Symbol 383 MovieClip Frame 1
stop();
Symbol 413 MovieClip Frame 9
stop();
Symbol 414 MovieClip [stickman] Frame 1
stop();
Instance of Symbol 53 MovieClip "hitAreaMC" in Symbol 414 MovieClip [stickman] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 402 MovieClip "arms_MC" in Symbol 414 MovieClip [stickman] Frame 6
onClipEvent (load) {
this.stop();
}
Instance of Symbol 402 MovieClip "arms_MC" in Symbol 414 MovieClip [stickman] Frame 6
onClipEvent (load) {
gotoAndStop (1);
}
Instance of Symbol 403 MovieClip "arms_MC" in Symbol 414 MovieClip [stickman] Frame 8
onClipEvent (load) {
this.stop();
}
Symbol 416 MovieClip [platform_black] Frame 1
trace("1 - created platform " + platformType);
Symbol 419 MovieClip [button_alarm] Frame 1
stop();
Symbol 423 MovieClip [door_knob] Frame 1
if (_root.trace_doors) {
_root.setDoorValues(this);
trace(((((((((((("doorArr.push({roomNo:" + roomNo) + ", doorNo:") + doorNo) + ", x:") + x) + ", y:") + y) + ", type:\"knob\", connRoom:") + connRoom) + ", connDoor:") + connDoor) + "});");
}
stop();
Symbol 423 MovieClip [door_knob] Frame 2
play();
Symbol 423 MovieClip [door_knob] Frame 12
_root.doorIsOpen();
stop();
Symbol 423 MovieClip [door_knob] Frame 13
play();
Symbol 423 MovieClip [door_knob] Frame 21
_root.doorIsClosed();
Symbol 424 Button [missionButton]
on (release) {
_root.levelNo = idNo;
_root.g.practiceMode = true;
trace((_parent.idNo + " : ") + idNo);
_root.levelInit();
_parent.gotoAndStop("game_start");
_parent.removePracticeLevelButtons();
}
Symbol 444 MovieClip Frame 1
stop();
Symbol 449 MovieClip [GiantWasp_abdomen] Frame 1
stop();
Symbol 451 MovieClip [GiantWasp_head] Frame 1
stop();
Symbol 454 MovieClip [GiantWasp_tail] Frame 1
stop();
Symbol 457 MovieClip [GiantWasp1] Frame 1
stop();
Instance of Symbol 53 MovieClip "hitAreaMC" in Symbol 457 MovieClip [GiantWasp1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 457 MovieClip [GiantWasp1] Frame 3
this.removeMovieClip();
Symbol 462 MovieClip Frame 1
stop();
Symbol 464 MovieClip Frame 1
stop();
Symbol 469 MovieClip [walker1] Frame 1
stop();
Symbol 469 MovieClip [walker1] Frame 14
this.removeMovieClip();
Symbol 475 MovieClip [flying3] Frame 1
trace("ATTACHED FLIER ==========");
stop();
Symbol 475 MovieClip [flying3] Frame 15
this.removeMovieClip();
Symbol 477 MovieClip Frame 1
stop();
Symbol 482 MovieClip [flying2] Frame 1
trace("ATTACHED FLIER ==========");
stop();
Symbol 482 MovieClip [flying2] Frame 15
this.removeMovieClip();
Symbol 485 MovieClip [flying1] Frame 1
trace("ATTACHED FLIER ==========");
stop();
Symbol 485 MovieClip [flying1] Frame 15
this.removeMovieClip();
Symbol 491 MovieClip [turret1] Frame 1
stop();
Symbol 491 MovieClip [turret1] Frame 13
this.removeMovieClip();
Symbol 497 MovieClip [stationary3] Frame 1
stop();
Symbol 497 MovieClip [stationary3] Frame 11
this.removeMovieClip();
Symbol 503 MovieClip [stationary2] Frame 1
stop();
Symbol 503 MovieClip [stationary2] Frame 15
this.removeMovieClip();
Symbol 506 MovieClip [stationary1] Frame 1
stop();
Symbol 506 MovieClip [stationary1] Frame 15
this.removeMovieClip();
Symbol 508 Button
on (release) {
gotoAndPlay (233);
}
Symbol 520 Button
on (release) {
_root.play();
}
Symbol 521 MovieClip Frame 1
stop();
Symbol 521 MovieClip Frame 2
Symbol 535 Button
on (release) {
getURL ("http://www.crazymonkeygames.com", "_blank");
}
Symbol 539 Button
on (release) {
getURL ("http://www.crazymonkeygames.com", "_blank");
}
Symbol 553 MovieClip Frame 131
stop();
Symbol 600 Button
on (release) {
gotoAndStop (1);
txtFrameNo++;
gotoAndStop(txtFrameNo);
roomNo++;
if (trace_caseANDbrek) {
trace(("break;\ncase " + roomNo) + " :");
}
_root.roomBuffer = [];
}
Symbol 601 Button
on (release) {
gotoAndStop (1);
txtFrameNo--;
gotoAndStop(txtFrameNo);
roomNo = 0;
}
Symbol 602 Button
on (release) {
roomNo = roomNo + 100;
trace("roomNo: " + roomNo);
}
Symbol 605 Button
on (release) {
roomNo = roomNo - 100;
trace("roomNo: " + roomNo);
}
Symbol 606 Button
on (release) {
gotoAndStop (16);
txtFrameNo = _currentframe;
}
Symbol 609 Button
on (release) {
gotoAndStop (80);
txtFrameNo = _currentframe;
}
Symbol 611 Button
on (release) {
gotoAndStop (146);
txtFrameNo = _currentframe;
}
Symbol 612 Button
on (release) {
_root.txtFrameNo = _currentframe;
_root.start = true;
}
Symbol 713 MovieClip Frame 1
stop();
Instance of Symbol 614 MovieClip in Symbol 713 MovieClip Frame 16
onClipEvent (enterFrame) {
if ((counter--) <= 0) {
counter = 1;
counterBool = true;
}
if (_root.start && (counterBool)) {
_root.gotoAndStop(1);
_root.txtFrameNo++;
_root.gotoAndStop(_root.txtFrameNo);
_root.roomNo++;
if (_root.trace_caseANDbrek) {
trace(("break;\ncase " + _root.roomNo) + " :");
}
counterBool = false;
}
}
Instance of Symbol 614 MovieClip in Symbol 713 MovieClip Frame 80
onClipEvent (enterFrame) {
if ((counter--) <= 0) {
counter = 1;
counterBool = true;
}
if (_root.start && (counterBool)) {
_root.gotoAndStop(1);
_root.txtFrameNo++;
_root.gotoAndStop(_root.txtFrameNo);
_root.roomNo++;
if (_root.trace_caseANDbrek) {
trace(("break;\ncase " + _root.roomNo) + " :");
}
counterBool = false;
}
}
Instance of Symbol 614 MovieClip in Symbol 713 MovieClip Frame 87
onClipEvent (enterFrame) {
if ((counter--) <= 0) {
counter = 1;
counterBool = true;
}
if (_root.start && (counterBool)) {
_root.gotoAndStop(1);
_root.txtFrameNo++;
_root.gotoAndStop(_root.txtFrameNo);
_root.roomNo++;
if (_root.trace_caseANDbrek) {
trace(("break;\ncase " + _root.roomNo) + " :");
}
counterBool = false;
}
}
Symbol 720 MovieClip Frame 1
Symbol 721 MovieClip Frame 1
stop();
Symbol 744 MovieClip Frame 1
stop();
Symbol 746 Button
on (release) {
_root.pL.currDoor.connDoor = 1;
_root.move_pLtoSelectedDoor();
}
Symbol 747 Button
on (release) {
_root.pL.currDoor.connDoor = 3;
_root.move_pLtoSelectedDoor();
}
Symbol 750 Button
on (release) {
_root.pL.currDoor.connDoor = 5;
_root.move_pLtoSelectedDoor();
}
Symbol 752 Button
on (release) {
_root.pL.currDoor.connDoor = 7;
_root.move_pLtoSelectedDoor();
}
Symbol 754 Button
on (release) {
_root.pL.currDoor.connDoor = 2;
_root.move_pLtoSelectedDoor();
}
Symbol 756 Button
on (release) {
_root.pL.currDoor.connDoor = 4;
_root.move_pLtoSelectedDoor();
}
Symbol 758 Button
on (release) {
_root.pL.currDoor.connDoor = 6;
_root.move_pLtoSelectedDoor();
}
Symbol 760 Button
on (release) {
_root.pL.currDoor.connDoor = 8;
_root.move_pLtoSelectedDoor();
}
Symbol 762 MovieClip Frame 1
_visible = false;
stop();
Symbol 775 MovieClip Frame 1
stop();
Symbol 784 MovieClip Frame 1
stop();
Symbol 796 MovieClip Frame 1
stop();
Instance of Symbol 53 MovieClip "hitAreaMC" in Symbol 796 MovieClip Frame 11
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 53 MovieClip "hitAreaMC" in Symbol 796 MovieClip Frame 12
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 53 MovieClip "hitAreaMC" in Symbol 796 MovieClip Frame 13
onClipEvent (load) {
this._visible = false;
}
Symbol 801 Button
on (release) {
g_levelNo = txt_levelNo;
game_over("missionComplete");
}
Symbol 803 Button
on (release) {
g_levelNo = (txt_levelNo = 0);
}
Symbol 804 Button
on (release) {
g_levelNo = txt_levelNo++;
}
Symbol 805 Button
on (release) {
g_levelNo = txt_levelNo--;
}
Symbol 811 MovieClip Frame 1
stop();
Symbol 813 Button
on (release) {
_root.resetGameDifficulty();
gotoAndStop (4);
}
Symbol 816 Button
on (release) {
gotoAndStop (7);
_root.displayKeyAssignments();
}
Symbol 824 Button
on (release) {
gotoAndStop (8);
}
Symbol 828 Button
on (release) {
getURL ("http://www.crazymonkeygames.com", "_blank");
}
Symbol 832 Button
on (release) {
getURL ("http://www.crazymonkeygames.com/Stickman-Sam.html", "_blank");
}
Symbol 837 Button
on (release) {
getURL ("http://www.io3creations.com", "_blank");
}
Symbol 839 Button
on (release) {
getURL ("http://www.crazymonkeygames.com/Stickman-Sam-2.html", "_blank");
}
Symbol 842 Button
on (release) {
trace("player level code: " + _root.pL_levelCode);
_root.checkLevelCode(txtLevelCode);
}
Symbol 847 MovieClip Frame 1
_x = 0;
_y = 0;
Symbol 848 Button
on (release) {
i = 1;
while (i < _root.levelCodeArr.length) {
j = 1;
while (j < _root.levelCodeArr[i].length) {
_root.levelCodeArr[i][j].unlocked = true;
j++;
}
i++;
}
_root.displayUnlockedLevels();
}
Symbol 853 Button
on (release) {
_root.startMissionTask(1, 1);
}
Symbol 855 Button
on (release) {
_root.startMissionTask(1, 2);
}
Symbol 857 Button
on (release) {
_root.startMissionTask(1, 3);
}
Symbol 859 Button
on (release) {
_root.startMissionTask(1, 4);
}
Symbol 861 Button
on (release) {
_root.startMissionTask(1, 5);
}
Symbol 863 Button
on (release) {
_root.startMissionTask(1, 6);
}
Symbol 867 Button
on (release) {
_root.startMissionTask(10, 1);
}
Symbol 869 Button
on (release) {
_root.startMissionTask(10, 2);
}
Symbol 871 Button
on (release) {
_root.startMissionTask(10, 3);
}
Symbol 873 Button
on (release) {
_root.startMissionTask(10, 4);
}
Symbol 875 Button
on (release) {
_root.startMissionTask(10, 5);
}
Symbol 879 Button
on (release) {
_root.startMissionTask(2, 1);
}
Symbol 881 Button
on (release) {
_root.startMissionTask(2, 2);
}
Symbol 883 Button
on (release) {
_root.startMissionTask(2, 3);
}
Symbol 885 Button
on (release) {
_root.startMissionTask(2, 4);
}
Symbol 887 Button
on (release) {
_root.startMissionTask(2, 5);
}
Symbol 889 Button
on (release) {
_root.startMissionTask(2, 6);
}
Symbol 891 MovieClip Frame 1
stop();
Symbol 892 Button
on (release) {
_root.testing_only = true;
}
Symbol 896 Button
on (release) {
gotoAndStop (1);
}
Symbol 897 Button
on (release) {
_root.setGameDifficulty("med");
}
Symbol 898 Button
on (release) {
_root.setGameDifficulty("hard");
}
Symbol 900 Button
on (release) {
_root.setGameDifficulty("easy");
}
Symbol 914 MovieClip Frame 1
Symbol 919 Button
on (release) {
_root.continueDialogue();
}
Symbol 924 Button
on (release) {
_root.game_start();
}
Symbol 931 MovieClip Frame 1
stop();
Symbol 931 MovieClip Frame 2
stop();
Symbol 975 MovieClip Frame 1
if (_root.trace_locks) {
type = "smallSafe";
_root.setLockValues(this);
trace(((((((((("lockArr.push({type:\"" + type) + "\", roomNo:") + roomNo) + ", x:") + x) + ", y:") + y) + ", content: \"") + content) + "\" , status: \"closed\"});");
}
stop();
Symbol 975 MovieClip Frame 2
play();
Symbol 983 MovieClip Frame 89
stop();
Symbol 989 MovieClip Frame 68
stop();
_root.continueDialogue();
Symbol 995 MovieClip Frame 1
stop();
Symbol 995 MovieClip Frame 2
Symbol 995 MovieClip Frame 10
_root.displayKeyAssignments();
Instance of Symbol 931 MovieClip "key_pLMoveLeft" in Symbol 995 MovieClip Frame 10
onClipEvent (load) {
_root.displayKeyValue(this);
}
Instance of Symbol 931 MovieClip "key_pLMoveRight" in Symbol 995 MovieClip Frame 10
onClipEvent (load) {
_root.displayKeyValue(this);
}
Instance of Symbol 931 MovieClip "key_pLMoveUp" in Symbol 995 MovieClip Frame 10
onClipEvent (load) {
_root.displayKeyValue(this);
}
Instance of Symbol 931 MovieClip "key_pLNextWeapon" in Symbol 995 MovieClip Frame 10
onClipEvent (load) {
_root.displayKeyValue(this);
}
Instance of Symbol 931 MovieClip "key_pLPrevWeapon" in Symbol 995 MovieClip Frame 10
onClipEvent (load) {
_root.displayKeyValue(this);
}
Instance of Symbol 931 MovieClip "key_pLMap" in Symbol 995 MovieClip Frame 10
onClipEvent (load) {
_root.displayKeyValue(this);
}
Instance of Symbol 931 MovieClip "key_pLInventory" in Symbol 995 MovieClip Frame 10
onClipEvent (load) {
_root.displayKeyValue(this);
}
Instance of Symbol 931 MovieClip "key_pLJump" in Symbol 995 MovieClip Frame 10
onClipEvent (load) {
_root.displayKeyValue(this);
}
Instance of Symbol 53 MovieClip "hitAreaMC" in Symbol 995 MovieClip Frame 10
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 931 MovieClip "key_pLMoveDown" in Symbol 995 MovieClip Frame 10
onClipEvent (load) {
_root.displayKeyValue(this);
}
Instance of Symbol 931 MovieClip "key_pLMoveDown" in Symbol 995 MovieClip Frame 11
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLMoveRight" in Symbol 995 MovieClip Frame 11
onClipEvent (load) {
_root.displayKeyValue(this);
}
Instance of Symbol 931 MovieClip "key_pLMoveDown" in Symbol 995 MovieClip Frame 11
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLMoveLeft" in Symbol 995 MovieClip Frame 12
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLMoveRight" in Symbol 995 MovieClip Frame 12
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLMoveUp" in Symbol 995 MovieClip Frame 12
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLNextWeapon" in Symbol 995 MovieClip Frame 12
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLPrevWeapon" in Symbol 995 MovieClip Frame 12
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLWalking" in Symbol 995 MovieClip Frame 12
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLMap" in Symbol 995 MovieClip Frame 12
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLInventory" in Symbol 995 MovieClip Frame 12
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLMoveDown" in Symbol 995 MovieClip Frame 12
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLJump" in Symbol 995 MovieClip Frame 12
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Symbol 995 MovieClip Frame 15
_root.displayKeyAssignments();
Instance of Symbol 53 MovieClip "hitAreaMC" in Symbol 995 MovieClip Frame 15
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 402 MovieClip "arms_MC" in Symbol 995 MovieClip Frame 15
onClipEvent (load) {
this.stop();
}
Instance of Symbol 402 MovieClip "arms_MC" in Symbol 995 MovieClip Frame 15
onClipEvent (load) {
gotoAndStop (1);
}
Instance of Symbol 931 MovieClip "key_pLMoveDown" in Symbol 995 MovieClip Frame 15
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLMoveUp" in Symbol 995 MovieClip Frame 15
onClipEvent (load) {
_root.displayKeyValue(this);
}
Instance of Symbol 931 MovieClip "key_pLMoveUp" in Symbol 995 MovieClip Frame 15
onClipEvent (load) {
_root.displayKeyValue(this);
}
Instance of Symbol 931 MovieClip "key_pLJump" in Symbol 995 MovieClip Frame 15
onClipEvent (load) {
_root.displayKeyValue(this);
}
Instance of Symbol 931 MovieClip "key_pLMoveDown" in Symbol 995 MovieClip Frame 15
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 53 MovieClip "hitAreaMC" in Symbol 995 MovieClip Frame 15
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 402 MovieClip "arms_MC" in Symbol 995 MovieClip Frame 15
onClipEvent (load) {
this.stop();
}
Instance of Symbol 402 MovieClip "arms_MC" in Symbol 995 MovieClip Frame 15
onClipEvent (load) {
gotoAndStop (1);
}
Symbol 995 MovieClip Frame 22
_root.displayKeyAssignments();
Instance of Symbol 931 MovieClip "key_pLMoveUp" in Symbol 995 MovieClip Frame 22
onClipEvent (load) {
_root.displayKeyValue(this);
}
Instance of Symbol 931 MovieClip "key_pLJump" in Symbol 995 MovieClip Frame 22
onClipEvent (load) {
_root.displayKeyValue(this);
}
Instance of Symbol 53 MovieClip "hitAreaMC" in Symbol 995 MovieClip Frame 22
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 403 MovieClip "arms_MC" in Symbol 995 MovieClip Frame 22
onClipEvent (load) {
this.stop();
}
Instance of Symbol 931 MovieClip "key_pLMoveLeft" in Symbol 995 MovieClip Frame 22
onClipEvent (load) {
_root.displayKeyValue(this);
}
Instance of Symbol 931 MovieClip "key_pLMoveRight" in Symbol 995 MovieClip Frame 22
onClipEvent (load) {
_root.displayKeyValue(this);
}
Symbol 995 MovieClip Frame 25
_root.displayKeyAssignments();
Instance of Symbol 931 MovieClip "key_pLMoveUp" in Symbol 995 MovieClip Frame 25
onClipEvent (load) {
_root.displayKeyValue(this);
}
Instance of Symbol 423 MovieClip [door_knob] in Symbol 995 MovieClip Frame 25
onClipEvent (load) {
doorNo = 1;
connRoom = 1;
connDoor = 1;
}
Symbol 995 MovieClip Frame 32
_root.displayKeyAssignments();
Instance of Symbol 975 MovieClip in Symbol 995 MovieClip Frame 32
onClipEvent (load) {
content = "health";
}
Instance of Symbol 419 MovieClip [button_alarm] in Symbol 995 MovieClip Frame 32
onClipEvent (load) {
action = "alarmOFF";
}
Instance of Symbol 931 MovieClip "key_pLMoveUp" in Symbol 995 MovieClip Frame 32
onClipEvent (load) {
_root.displayKeyValue(this);
}
Symbol 1019 Button
on (release) {
if (_currentframe < _totalframes) {
nextFrame();
}
}
Symbol 1020 Button
on (release) {
if (_currentframe > 1) {
prevFrame();
}
}
Symbol 1047 MovieClip Frame 1
stop();
Symbol 1060 MovieClip Frame 1
stop();
Symbol 1066 Button
on (release) {
_root.game_Restart();
}
Symbol 1067 MovieClip Frame 1
Mouse.show();
_quality = "HIGH";
_root._keyListener.onKeyDown = "";
stopAllSounds();
stop();
Symbol 1067 MovieClip Frame 3
_root.displayUnlockedLevels();
Instance of Symbol 931 MovieClip "key_pLMoveLeft" in Symbol 1067 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLMoveRight" in Symbol 1067 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLMoveUp" in Symbol 1067 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "keyQualityToggle" in Symbol 1067 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "keyMusicOnOff" in Symbol 1067 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "keyPauseGame" in Symbol 1067 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLNextWeapon" in Symbol 1067 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLPrevWeapon" in Symbol 1067 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLWalking" in Symbol 1067 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLMap" in Symbol 1067 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLInventory" in Symbol 1067 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLMoveDown" in Symbol 1067 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}
Instance of Symbol 931 MovieClip "key_pLJump" in Symbol 1067 MovieClip Frame 7
onClipEvent (load) {
_root.displayKeyValue(this);
}
onClipEvent (keyUp) {
_root.setKeyValue(this);
}
onClipEvent (mouseUp) {
_root.highlightKey(this);
}