Frame 1
currentDomain = _url.split("/");
currentDomain = currentDomain[2];
currentDomain = "www.bubblebox.com";
_root.kongregateServices.connect();
sitelock.useHandCursor = false;
var CPMStarContentSpotID = "967QB6D57E6A";
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie("http://server.cpmstar.com/adviewas2.swf?contentspotid=" + CPMStarContentSpotID);
counter = 0;
sitelock._visible = false;
if ((currentDomain == "www.bubblebox.com") || (currentDomain == "www.robotjam.com")) {
onEnterFrame = function () {
loadprogress = (this.getBytesLoaded() / this.getBytesTotal()) * 100;
if (loadprogress >= 100) {
counter++;
if (counter == 50) {
playBtn._visible = true;
gs.TweenFilterLite.to(playBtn, 5, {_alpha:100});
loadBar._visible = false;
delete this.onEnterFrame;
}
}
loader.loadBar._xscale = loadprogress;
};
} else {
sitelock._visible = true;
}
stop();
playBtn._visible = false;
playBtn._alpha = 0;
playBtn.onRelease = function () {
play();
};
playBtn.onRollOver = function () {
this.gotoAndPlay("over");
};
playBtn.onRollOut = function () {
this.gotoAndPlay("out");
};
playBtn.onDragOut = function () {
this.gotoAndPlay("out");
};
Frame 7
this.createEmptyMovieClip("gunShotHolder", this.getNextHighestDepth());
gunShot = new Sound(gunShotHolder);
gunShot.attachSound("gunShot");
gunShot.setVolume(20);
this.createEmptyMovieClip("musicHolder1", this.getNextHighestDepth());
music1 = new Sound(musicHolder1);
music1.attachSound("music1");
music1.start(0, 999);
music1.setVolume(0);
this.createEmptyMovieClip("soundtrack1Holder", this.getNextHighestDepth());
soundtrack1 = new Sound(soundtrack1Holder);
soundtrack1.attachSound("soundtrack1");
soundtrack1.start(0, 999);
soundtrack1.setVolume(0);
this.createEmptyMovieClip("heartbeatHolder", this.getNextHighestDepth());
heartbeat = new Sound(heartbeatHolder);
heartbeat.attachSound("heartbeat");
heartbeat.start(0, 999);
heartbeat.setVolume(0);
this.createEmptyMovieClip("heartbeatIrregularHolder", this.getNextHighestDepth());
heartbeatIrregular = new Sound(heartbeatIrregularHolder);
heartbeatIrregular.attachSound("heartbeatIrregular");
heartbeatIrregular.start(0, 999);
heartbeatIrregular.setVolume(0);
this.createEmptyMovieClip("windowsmashHolder", this.getNextHighestDepth());
windowsmash = new Sound(windowsmashHolder);
windowsmash.attachSound("windowsmash");
this.createEmptyMovieClip("lightsmashHolder", this.getNextHighestDepth());
lightsmash = new Sound(lightsmashHolder);
lightsmash.attachSound("lightsmash");
this.createEmptyMovieClip("zoomInHolder", this.getNextHighestDepth());
zoomIn = new Sound(zoomInHolder);
zoomIn.attachSound("zoomIn");
this.createEmptyMovieClip("zoomOutHolder", this.getNextHighestDepth());
zoomOut = new Sound(zoomOutHolder);
zoomOut.attachSound("zoomOut");
this.createEmptyMovieClip("reloadGunHolder", this.getNextHighestDepth());
reloadGun = new Sound(reloadGunHolder);
reloadGun.attachSound("reload");
reloadGun.setVolume(30);
this.createEmptyMovieClip("bodyFall1Holder", this.getNextHighestDepth());
bodyFall1 = new Sound(bodyFall1Holder);
bodyFall1.attachSound("bodyFall1");
this.createEmptyMovieClip("bodyFall2Holder", this.getNextHighestDepth());
bodyFall2 = new Sound(bodyFall2Holder);
bodyFall2.attachSound("bodyFall2");
this.createEmptyMovieClip("headShotHolder", this.getNextHighestDepth());
headShot = new Sound(headShotHolder);
headShot.attachSound("headShot");
this.createEmptyMovieClip("alarmHolder", this.getNextHighestDepth());
alarm = new Sound(alarmHolder);
alarm.attachSound("alarm");
alarm.setVolume(30);
this.createEmptyMovieClip("breathInHolder", this.getNextHighestDepth());
breathIn = new Sound(breathInHolder);
breathIn.attachSound("breathIn");
breathIn.setVolume(20);
this.createEmptyMovieClip("breathOutHolder", this.getNextHighestDepth());
breathOut = new Sound(breathOutHolder);
breathOut.attachSound("breathOut");
breathOut.setVolume(20);
this.createEmptyMovieClip("cityHolder", this.getNextHighestDepth());
city = new Sound(cityHolder);
city.attachSound("city");
city.setVolume(0);
city.start(0, 999);
this.createEmptyMovieClip("beachHolder", this.getNextHighestDepth());
beach = new Sound(beachHolder);
beach.attachSound("beach");
beach.setVolume(0);
beach.start(0, 999);
this.createEmptyMovieClip("rainHolder", this.getNextHighestDepth());
rain = new Sound(rainHolder);
rain.attachSound("rain");
rain.setVolume(0);
rain.start(0, 999);
this.createEmptyMovieClip("airportHolder", this.getNextHighestDepth());
airport = new Sound(airportHolder);
airport.attachSound("airport");
airport.setVolume(0);
airport.start(0, 999);
this.createEmptyMovieClip("thearchesHolder", this.getNextHighestDepth());
thearches = new Sound(thearchesHolder);
thearches.attachSound("thearches");
thearches.setVolume(0);
thearches.start(0, 999);
this.createEmptyMovieClip("nightHolder", this.getNextHighestDepth());
night = new Sound(nightHolder);
night.attachSound("night");
night.setVolume(0);
night.start(0, 999);
this.createEmptyMovieClip("stationHolder", this.getNextHighestDepth());
station = new Sound(stationHolder);
station.attachSound("station");
station.setVolume(0);
station.start(0, 999);
Frame 15
stop();
Frame 24
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
var menuToPlay = "";
var mission = 0;
var shotsFired = 0;
var kills = 0;
var headShots = 0;
var bodyShots = 0;
var misses = 0;
var bonus = 0;
so = SharedObject.getLocal("sniperYear2.5");
if (so.data.mission == undefined) {
so.data.mission = 0;
so.data.headShots = 0;
so.data.bodyShots = 0;
so.data.misses = 0;
so.data.bonus = 0;
} else {
headShots = so.data.headShots;
bodyShots = so.data.bodyShots;
misses = so.data.misses;
mission = so.data.mission;
bonus = so.data.bonus;
}
gs.TweenFilterLite.to(musicHolder1, 5, {volume:40});
gs.TweenFilterLite.to(sniperLogo, 1, {_alpha:0});
stop();
Stage.scaleMode = "noScale";
titleScreen.robotBtn.onRelease = function () {
getURL ("http://www.robotjam.com", "_blank");
};
titleScreen.stuBtn.onRelease = function () {
getURL ("http://www.hogton.com", "_blank");
};
titleScreen.playBtn.onRelease = function () {
if (so.data.mission == 0) {
menuToPlay = "instructions";
fader.play();
} else {
menuToPlay = "continueGame";
fader.play();
}
};
titleScreen.moreGamesBtn.onRelease = function () {
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1521&subid=moregames", "_blank");
};
titleScreen.hiscoresBtn.onRelease = function () {
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1521&subid=scores&action=viewscores", "_blank");
};
__com_mochibot__("c486d0a5", this, 10301, true);
Frame 44
savedGame.continueBtn.onRollOver = function () {
this.gotoAndPlay("over");
};
savedGame.continueBtn.onRollOut = function () {
this.gotoAndPlay("out");
};
savedGame.continueBtn.onDragOut = function () {
this.gotoAndPlay("out");
};
savedGame.continueBtn.onRelease = function () {
menuToPlay = "briefing";
fader.play();
};
savedGame.newGameBtn.onRollOver = function () {
this.gotoAndPlay("over");
};
savedGame.newGameBtn.onRollOut = function () {
this.gotoAndPlay("out");
};
savedGame.newGameBtn.onDragOut = function () {
this.gotoAndPlay("out");
};
savedGame.newGameBtn.onRelease = function () {
menuToPlay = "instructions";
fader.play();
mission = 0;
so.data.bonus = 0;
so.data.mission = 0;
so.data.headShots = 0;
so.data.bodyShots = 0;
so.data.misses = 0;
_root.headShots = 0;
_root.bodyShots = 0;
_root.misses = 0;
_root.bonus = 0;
};
savedGame.missionNumber.text = "YOUR SAVED MISSION : " + (mission + 1);
Frame 55
instructions.easyBtn.onRollOver = function () {
this.gotoAndPlay("over");
};
instructions.easyBtn.onRollOut = function () {
this.gotoAndPlay("out");
};
instructions.easyBtn.onDragOut = function () {
this.gotoAndPlay("out");
};
instructions.easyBtn.onRelease = function () {
menuToPlay = "briefing";
fader.play();
};
instructions.hardBtn.onRollOver = function () {
this.gotoAndPlay("over");
};
instructions.hardBtn.onRollOut = function () {
this.gotoAndPlay("out");
};
instructions.hardBtn.onDragOut = function () {
this.gotoAndPlay("out");
};
var alreadyShown = false;
Frame 69
var fail1 = "We said no kill no civilians, you will have to pay more attention.";
var fail2 = "Too slow, your reaction times are lacking. You will have to do better.";
var fail3 = "Breaking the windows alerted security, you failed the assignment. We need stealth on this job.";
var fail4 = "You killed your accomplice, the man with the briefcase is on our side. We cannot tolerate this failure.";
var fail5 = "You didn't take out all the enemies. That shot alerted them and they were not all eliminated.";
var fail6 = "The special forces made it to the exit, you failed in your mission.";
var fail7 = "That wasn't the spy you killed, you will have to be more observant. ";
var fail8 = "The enemy heard your shots, you blew your cover.";
var fail9 = "That wasnt one of our targets, you have failed your mission.";
var fail10 = "The security camera picked up the kill. Be more careful.";
var fail11 = "The guard spotted your shot and issued a lock down, you blew your cover.";
var fail12 = "You blew up one of our servers, we have lost valuable data.";
var fail13 = "The bodyguards were able to raise the alarm and destroy the details. You need to be a lot quicker than that.";
var fail14 = "You blew up the helicopter but he wasnt on board, with that warning we will never find him.";
var fail15 = "Samson was evacuated, your bullets could not pierce the armor of the helicopter.";
var fail16 = "You aborted the mission.";
var fail17 = "You were spotted by the enemy, you will have to be more cunning.";
var briefheader0 = "Mission 1: Targets";
var briefing0 = "Location: Docklands --- London\n\nAgent. You have had years of training, but we need to see your skills in a live environment. There are 6 targets we have placed. Show your accuracy under pressure. You have 60 seconds. \n\nDo not eliminate any innocents. \n\n --- Samson, Black Ops.";
var debriefing0 = "Nice job you have proved yourself, but the next job won't just be targets.";
var onScreen0 = "HIT 6 TARGETS IN 60 SECONDS, DO NOT KILL ANYONE.";
var briefheader1 = "Mission 2: Red Sea";
var briefing1 = "Location: La Habana bay --- Cuba\n\nAgent. \nThe target is the Captain of a Yacht used to transport various items to the US mainland. This is counter to our interests. The passengers are not to be harmed.\n\nConsider this your entrance exam. Make sure we see the kill. \n\n --- Samson, Black Ops.";
var debriefing1 = "Nice job but that was an easy assignment.";
var onScreen1 = "KILL THE CAPTAIN.";
var briefheader2 = "Mission 3: Urban Heat";
var briefing2 = "You make quite an impression, Agent.\n\n An ambitious competitor is planning to murder a diplomat in Prague. The diplomat is not our concern but our competitor needs to learn their place in the world. Identify the assassin, kill him... I know the gentlemen involved; removing his smug face would please me greatly. Stealth is of importance. \n\n --- Samson, Black Ops.";
var debriefing2 = "Excellent, the diplomat sends his congratulations. We were also able to get in and clear up the mess undetected. Good job.";
var onScreen2 = "TAKE OUT THE ASSASSIN, BREAK NO WINDOWS.";
var briefheader3 = "Mission 4: Trick Shot";
var briefing3 = "Location: Istanbul --- Turkey\nAgent, Your work continues to satisfy.The next assignment requires a little thought, the assassin you killed had left a truck parked up in a multi story car park, 3 accomplices are waiting for his arrival.We need all 3 dead, we cant let any get away.We have an man on the scene take your lead from him, he'll have a briefcase. \n\n --- Samson, Black Ops.";
var debriefing3 = "All 3 taken down, you work well in a team.";
var onScreen3 = "ELIMINATE THE 3 AGENTS, YOU ONLY HAVE ONE SHOT AT THIS";
var briefheader4 = "Mission 5: Best Defence";
var briefing4 = "Location: Beijing --- China\n\nAgent. We have a situation.\nOur installation in Beijing has been compromised, our competitor's handiwork we assume.\n Chinese special forces are preparing an assault. We need to stop them exiting the facility while all trace of our identity is purged.\n Can you do that? \n\n --- Samson, Black Ops.";
var debriefing4 = "Excellent work, not an easy assignment that one.";
var onScreen4 = "DEFEND THE FACILITY, DO NOT LET ANY OF THE SPECIAL OPS EXIT";
var briefheader5 = "Mission 6: Infiltrate";
var briefing5 = "Location: Calamar --- Columbia\n\nAgent, we are at war. \nOur operation has been infiltrated, our security compromised and our enemy increasingly bold. Too bold.\nWe've found their Columbian centre of global communications, we need you to get inside and install a tracker in their system. Knock out security, its complex and covered on many levels. There are flaws in the setup.\n\n --- Samson, Black Ops.";
var debriefing5 = "Nice, our team was able to obtain vital data from that raid. Excellent work agent";
var onScreen5 = "TAKE OUT ALL THE SECURITY, DO NOT BE SEEN.";
var briefheader6 = "Mission 7: Accidents will happen";
var briefing6 = "Location: London --- England\n\nAgent. We have a mission that requires a little cunning. \nWe have a double agent inside the nexus agency. We need him to get into the server room and put in a tap so we can identify 3 secret agents in the building. Get him in there and eliminate them. \n\n --- Samson, Black Ops.";
var debriefing6 = "Nice job agent, all three defectors were taken out. It's also sent out a message to our competitors..";
var onScreen6 = "GET OUR MAN INTO THE SERVER ROOM, KILL THE IDENTIFIED AGENTS";
var briefheader7 = "Mission 8: Heart Ache";
var briefing7 = "Location: El Cuervo --- Mexico\n\nAh Agent, I do very much enjoy your work.\n We've rooted out most of competitors spies, we know at least one remains in our Mexico operation, he'll be worried, and attempting escape.\nUse the heartbeat sensor to find him, kill him, make sure he does not get away.\n\n --- Samson, Black Ops.";
var debriefing7 = "Good job, you took out the traitor. Our plans for the raid wont be compromised. We are sending you into Columbia next to provide backup.";
var onScreen7 = "KILL THE SPY, HE HAS AN IRREGULAR HEARTBEAT";
var briefheader8 = "Mission 9: Double Cross";
var briefing8 = "Location: Calamar --- Columbia\n\nAgent. \nYou are in position at our competitor's stronghold?Yes\nGood. We're wiping them out. And in the interests of complete security, we're eliminating any Agent we're not totally sure of. And that means you. We have agents in place to intercept, you will not get out alive. \n\n --- Samson, Black Ops.";
var debriefing8 = "Samson was not who you thought, who have you been working for all this time. ";
var onScreen8 = "TAKE OUT THE SPECIAL OPS IN THE JUNGLE.";
var briefheader9 = "Mission 10: Safe house";
var briefing9 = "Location: New York --- USA\n\nAgent, this is Nexus Operations. We want to recruit you. You have been working for the wrong team. Your safe house has been compromised and has vital information. We know there are 6 snipers waiting for you. You can't let any of them know you are coming. Luckily the weather is in your favour.\n\n --- Bailer, Nexus Corp.";
var debriefing9 = "That sent out a message, they picked the wrong agent to mess with. With access to your safe house you are now able to get more details to track him down.";
var onScreen9 = "KILL THE SNIPERS, DO NOT LET THEM HEAR YOUR SHOTS. ";
var briefheader10 = "Mission 11: Lights Out";
var briefing10 = "Location: Florida --- USA\n\n We know where Samson is located, or we think. His villa on the keys is guarded like a fortress. We need you to take out the guards get in and bring him out alive.\n\n ---Bailer, Nexus Corp.\n\n --- Bailer, Nexus Corp.";
var debriefing10 = "You entered but Samson wasn't there. We found plans to his secret off shore hideout.";
var onScreen10 = "TAKE OUT 5 GUARDS. FIND A WAY TO DISTRACT THEM FOR LONG ENOUGH. ";
var briefheader11 = "Mission 12: Barrel of Fun";
var briefing11 = "Location : We've tracked Samson to this oil rig but we think he's planning an evacuation We have spotted a chopper on route to get him although it looks armor plated.\n\n --- Bailer, Nexus Corp.";
var debriefing11 = "We surveyed the debris, it was inconclusive, we found no dna linking Samson to the accident.";
var onScreen11 = "TAKE OUT SAMSON.";
briefing.continueBtn.onRelease = function () {
menuToPlay = "lvl" + mission;
fader.play();
gs.TweenFilterLite.to(musicHolder1, 4, {volume:0});
};
briefing.continueBtn.onRollOver = function () {
this.gotoAndPlay("over");
};
briefing.continueBtn.onRollOut = function () {
this.gotoAndPlay("out");
};
briefing.continueBtn.onDragOut = function () {
this.gotoAndPlay("out");
};
briefing.missionNumber.text = this["briefheader" + mission].toUpperCase();
if (Stage.displayState == "fullScreen") {
womanFace._visible = false;
}
tempString = this["briefing" + mission];
var briefingArray = tempString.split("");
var counter = 0;
var spaceCounter = 0;
onEnterFrame = function () {
if (alreadyShown == false) {
spaceCounter++;
briefing.brieftext.text = briefing.brieftext.text + briefingArray[counter];
if ((spaceCounter >= 60) && (briefingArray[counter] == " ")) {
trace("next space");
briefing.brieftext.text = briefing.brieftext.text + newline;
spaceCounter = 0;
}
if (briefingArray[counter] == newline) {
spaceCounter = 0;
}
if (counter == (briefingArray.length - 1)) {
delete onEnterFrame;
}
counter++;
} else {
briefing.brieftext.text = this["briefing" + mission];
delete onEnterFrame;
}
};
logoBtn.onRelease = function () {
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1312&subid=briefingScreen", "_blank");
};
Instance of Symbol 1123 MovieClip "abort" in Frame 80
/* no clip actions */
Frame 156
gs.TweenFilterLite.to(heartbeatHolder, 1, {volume:0});
gs.TweenFilterLite.to(heartbeatIrregularHolder, 1, {volume:0});
alreadyShown = false;
debrief.continueBtn.onRelease = function () {
if (mission <= 11) {
menuToPlay = "briefing";
fader.play();
} else {
menuToPlay = "gameOver";
fader.play();
}
};
logoBtn.onRelease = function () {
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1312&subid=missionComplete", "_blank");
};
debrief.tina.gotoAndStop(1);
if (mission == 0) {
debrief.tina.gotoAndStop(5);
}
if (mission == 3) {
debrief.tina.gotoAndStop(3);
}
if (mission == 7) {
debrief.tina.gotoAndStop(2);
}
if (mission == 9) {
debrief.tina.gotoAndStop(4);
}
debrief.continueBtn.onRollOver = function () {
this.gotoAndPlay("over");
};
debrief.continueBtn.onRollOut = function () {
this.gotoAndPlay("out");
};
debrief.continueBtn.onDragOut = function () {
this.gotoAndPlay("out");
};
Mouse.show();
var totalScore = ((((headShots * 100) + (bodyShots * 50)) + bonus) - (misses * 50));
debrief.accuracy.text = "TOTAL SCORE ::" + totalScore;
debrief.debrief.text = this["debriefing" + mission];
mission++;
debrief.headShots.text = headShots;
debrief.bodyShots.text = bodyShots;
debrief.misses.text = "-" + misses;
debrief.bonus.text = bonus / 10;
so.data.bonus = bonus;
so.data.mission = mission;
so.data.headShots = headShots;
so.data.bodyShots = bodyShots;
so.data.misses = misses;
Frame 171
gs.TweenFilterLite.to(heartbeatHolder, 1, {volume:0});
gs.TweenFilterLite.to(heartbeatIrregularHolder, 1, {volume:0});
debriefFail.retryBtn.onRelease = function () {
menuToPlay = "briefing";
fader.play();
};
alreadyShown = true;
debriefFail.retryBtn.onRollOver = function () {
this.gotoAndPlay("over");
};
debriefFail.retryBtn.onRollOut = function () {
this.gotoAndPlay("out");
};
debriefFail.retryBtn.onDragOut = function () {
this.gotoAndPlay("out");
};
debriefFail.walkBtn.onRollOver = function () {
this.gotoAndPlay("over");
};
debriefFail.walkBtn.onRollOut = function () {
this.gotoAndPlay("out");
};
debriefFail.walkBtn.onDragOut = function () {
this.gotoAndPlay("out");
};
debriefFail.walkBtn.onRelease = function () {
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1521&subid=walkthrough&action=walkthrough_sniper2", "_blank");
};
Mouse.show();
debriefFail.debrief.text = this["fail" + failedReason];
bonus = so.data.bonus;
mission = so.data.mission;
headShots = so.data.headShots;
bodyShots = so.data.bodyShots;
misses = so.data.misses;
Frame 183
yourScore.text = totalScore;
stop();
sniper1.onRollOver = function () {
this.glow.gotoAndPlay("over");
};
sniper1.onRollOut = function () {
this.glow.gotoAndPlay("out");
};
sniper1.onRelease = function () {
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1521&subid=playSTBC1&action=play_sniper1", "_blank");
};
ScoreAPI = new LocalConnection();
ScoreAPI.send(_root.com_mindjolt_api, "submitScore", percentage);
_root.kongregateScores.submit(score);
if (currentDomain.indexOf("mindjolt") != -1) {
scoreBox._visible = false;
} else {
scoreBox._visible = true;
}
backMenu.onRelease = function () {
_root.menuToPlay = "menu";
_root.fader.play();
this.enabled = false;
};
so.data.mission = 0;
so.data.headShots = 0;
so.data.bodyShots = 0;
so.data.misses = 0;
so.data.bonus = 0;
headShots = 0;
bodyShots = 0;
misses = 0;
mission = 0;
bonus = 0;
Symbol 29 MovieClip Frame 1
stop();
Symbol 29 MovieClip Frame 10
stop();
Symbol 3364 MovieClip [__Packages.gs.TweenLite] Frame 0
class gs.TweenLite
{
static var _e, _gc;
var tweenID, endTargetID, vars, duration, delay, target, _endTarget, tweens, extraTweens, initTime, _active, color, colorParts, _sound, startTime, __get__endTarget;
function TweenLite ($target, $duration, $vars) {
_cnt++;
tweenID = "tw" + _cnt;
endTargetID = getID($target, true);
if (($vars.overwrite != false) && ($target != undefined)) {
delete _all[endTargetID];
_all[endTargetID] = {info:[$target, endTargetID]};
}
_all[endTargetID][tweenID] = this;
vars = $vars;
duration = $duration;
delay = $vars.delay || 0;
if ($duration == 0) {
duration = 0.001;
if (delay == 0) {
vars.runBackwards = true;
}
}
target = (_endTarget = $target);
if (typeof(vars.ease) != "function") {
vars.ease = easeOut;
}
if (vars.easeParams != undefined) {
vars.proxiedEase = vars.ease;
vars.ease = easeProxy;
}
if (vars.mcColor != undefined) {
vars.tint = vars.mcColor;
}
if (typeof(vars.autoAlpha) == "number") {
vars._alpha = vars.autoAlpha;
}
tweens = {};
extraTweens = {};
initTime = getTimer();
if (vars.runBackwards == true) {
initTweenVals();
}
_active = false;
if (($duration == 0) && (delay == 0)) {
complete(true);
} else {
if (_e._visible != false) {
if (!_root.tweenLite_mc) {
var _local5 = _root.getNextHighestDepth() || 9999;
_e = _root.createEmptyMovieClip("tweenLite_mc", _local5);
_e.swapDepths(-1);
} else {
_e = _root.tweenLite_mc;
}
_e._visible = false;
clearInterval(_gc);
_gc = setInterval(killGarbage, 2000);
}
_e.onEnterFrame = executeAll;
}
}
function initTweenVals() {
var _local5 = delay - ((getTimer() - initTime) / 1000);
var _local8;
if (target instanceof Array) {
var _local7 = vars.endArray || ([]);
var _local2 = 0;
while (_local2 < _local7.length) {
if ((target[_local2] != _local7[_local2]) && (target[_local2] != undefined)) {
tweens[_local2.toString()] = {o:target, s:target[_local2], c:_local7[_local2] - target[_local2]};
}
_local2++;
}
} else {
for (var _local27 in vars) {
if ((((((((((((((_local27 == "delay") || (_local27 == "ease")) || (_local27 == "overwrite")) || (_local27 == "onComplete")) || (_local27 == "onCompleteParams")) || (_local27 == "runBackwards")) || (_local27 == "onUpdate")) || (_local27 == "onUpdateParams")) || (_local27 == "autoAlpha")) || (_local27 == "_autoAlpha")) || (_local27 == "onStart")) || (_local27 == "onStartParams")) || (_local27 == "easeParams")) || (_local27 == "mcColor")) {
} else if ((_local27 == "tint") && ((typeof(target) == "movieclip") || (target instanceof TextField))) {
color = new Color(target);
colorParts = color.getTransform();
var _local6;
var _local4;
if ((vars[_local27] == null) || (vars[_local27] == "")) {
if (vars._alpha != undefined) {
_local4 = vars._alpha;
delete vars._alpha;
delete tweens._alpha;
} else {
_local4 = target._alpha;
}
_local6 = {rb:0, gb:0, bb:0, ra:_local4, ga:_local4, ba:_local4, ease:vars.ease, delay:_local5, overwrite:false, runBackwards:vars.runBackwards};
} else {
_local6 = {rb:vars[_local27] >> 16, gb:(vars[_local27] >> 8) & 255, bb:vars[_local27] & 255, ra:0, ga:0, ba:0, ease:vars.ease, delay:_local5, overwrite:false, runBackwards:vars.runBackwards};
}
var _local10 = new gs.TweenLite(colorParts, duration, _local6);
var _local11 = new gs.TweenLite(this, duration, {colorProxy:1, delay:_local5, overwrite:false, runBackwards:vars.runBackwards});
_local10.endTarget = (_local11.endTarget = target);
} else if ((_local27 == "volume") && (typeof(target) == "movieclip")) {
_sound = new Sound(target);
var _local9 = new gs.TweenLite(this, duration, {volumeProxy:vars[_local27], ease:easeOut, delay:_local5, overwrite:false, runBackwards:vars.runBackwards});
_local9.endTarget = target;
} else if (target[_local27] != undefined) {
if (typeof(vars[_local27]) == "number") {
_local8 = vars[_local27] - target[_local27];
} else {
_local8 = Number(vars[_local27]);
}
tweens[_local27] = {o:target, s:target[_local27], c:_local8};
} else {
extraTweens[_local27] = {o:target, s:0, c:0, v:vars[_local27]};
}
}
}
if (vars.runBackwards == true) {
var _local3;
for (var _local27 in tweens) {
_local3 = tweens[_local27];
_local3.s = _local3.s + _local3.c;
_local3.c = _local3.c * -1;
_local3.o[_local27] = _local3.s;
}
if (vars.onUpdate != undefined) {
vars.onUpdate.apply(null, vars.onUpdateParams);
}
}
if (typeof(vars.autoAlpha) == "number") {
target._visible = !((vars.runBackwards == true) && (target._alpha == 0));
}
}
static function to($target, $duration, $vars) {
return(new gs.TweenLite($target, $duration, $vars));
}
static function from($target, $duration, $vars) {
$vars.runBackwards = true;
return(new gs.TweenLite($target, $duration, $vars));
}
static function delayedCall($delay, $onComplete, $onCompleteParams) {
return(new gs.TweenLite($onComplete, 0, {delay:$delay, onComplete:$onComplete, onCompleteParams:$onCompleteParams, overwrite:false}));
}
static function removeTween($t) {
_all[$t.endTargetID][$t.tweenID] = {active:false};
delete _all[$t.endTargetID][$t.tweenID];
}
static function killTweensOf($tg, $complete) {
var _local3 = getID($tg, true);
if ($complete) {
var _local1 = _all[_local3];
for (var _local2 in _local1) {
_local1[_local2].complete(false);
}
}
delete _all[_local3];
}
function complete($skipRender) {
if ($skipRender != true) {
startTime = 0;
render(duration * 1000);
return(undefined);
}
if ((typeof(vars.autoAlpha) == "number") && (target._alpha == 0)) {
target._visible = false;
}
if (vars.onComplete) {
vars.onComplete.apply(null, vars.onCompleteParams);
}
removeTween(this);
}
static function getID($tg, $lookup) {
var _local3;
if ($lookup) {
var _local1 = _all;
if (typeof($tg) == "movieclip") {
if (_local1[String($tg)] != undefined) {
return(String($tg));
}
_local3 = String($tg);
_all[_local3] = {info:[$tg, _local3]};
return(_local3);
}
for (var _local4 in _local1) {
if (_local1[_local4].info[0] == $tg) {
return(_local4);
}
}
}
_cnt++;
_local3 = "t" + _cnt;
_all[_local3] = {info:[$tg, _local3]};
return(_local3);
}
function render(t) {
var _local4 = (t - startTime) / 1000;
if (_local4 > duration) {
_local4 = duration;
}
var _local2;
var _local3 = vars.ease(_local4, 0, 1, duration);
for (var _local5 in tweens) {
_local2 = tweens[_local5];
_local2.o[_local5] = _local2.s + (_local3 * _local2.c);
}
if (vars.onUpdate != undefined) {
vars.onUpdate.apply(null, vars.onUpdateParams);
}
if (_local4 == duration) {
complete(true);
}
}
static function executeAll() {
var _local2 = _all;
var _local3 = getTimer();
var _local1;
for (var _local5 in _local2) {
for (var _local4 in _local2[_local5]) {
_local1 = _local2[_local5][_local4];
if (_local1.active) {
_local1.render(_local3);
}
}
}
}
static function killGarbage() {
if (_e.onEnterFrame != null) {
var _local1 = _all;
var _local2;
var _local3;
var _local5;
var _local6 = 0;
var _local4 = 0;
for (_local3 in _local1) {
_local4 = 0;
for (_local5 in _local1[_local3]) {
_local2 = _local1[_local3][_local5];
if (_local2.tweens == undefined) {
} else {
_local4++;
}
}
if (_local4 == 0) {
delete _local1[_local3];
} else {
_local6++;
}
}
if (_local6 == 0) {
_e.onEnterFrame = null;
}
}
}
static function easeOut($t, $b, $c, $d) {
$t = $t / $d;
return((((-$c) * $t) * ($t - 2)) + $b);
}
function easeProxy($t, $b, $c, $d) {
var _local3 = this;
return(_local3.proxiedEase.apply(null, arguments.concat(_local3.easeParams)));
}
function get active() {
if (_active) {
return(true);
}
if (((getTimer() - initTime) / 1000) > delay) {
_active = true;
startTime = initTime + (delay * 1000);
if (vars.runBackwards != true) {
initTweenVals();
} else if (typeof(vars.autoAlpha) == "number") {
target._visible = true;
}
if (duration == 0.001) {
startTime = startTime - 1;
}
if (vars.onStart != undefined) {
vars.onStart.apply(null, vars.onStartParams);
}
return(true);
}
return(false);
}
function set endTarget($t) {
_all[endTargetID][tweenID] = {active:false};
delete _all[endTargetID][tweenID];
endTargetID = getID($t, true);
_endTarget = $t;
_all[endTargetID][tweenID] = this;
//return(__get__endTarget());
}
function set volumeProxy($n) {
_sound.setVolume($n);
//return(volumeProxy);
}
function get volumeProxy() {
return(_sound.getVolume());
}
function set colorProxy($n) {
color.setTransform(colorParts);
//return(colorProxy);
}
function get colorProxy() {
return(0);
}
static var version = 5.8;
static var _all = new Object();
static var _cnt = -16000;
static var killDelayedCallsTo = killTweensOf;
}
Symbol 3365 MovieClip [__Packages.gs.TweenFilterLite] Frame 0
class gs.TweenFilterLite extends gs.TweenLite
{
var _mc, _clrsa, vars, _matrix, tweens, _f, _endMatrix, initTime, delay, _clrMtxTw, duration, _fType, extraTweens, __get__active, startTime, complete;
function TweenFilterLite ($mc, $duration, $vars) {
super($mc, $duration, $vars);
_mc = $mc;
_clrsa = [];
if (vars.runBackwards == true) {
initTweenVals();
}
if ((gs.TweenLite.version < 5.8) || (gs.TweenLite.version == undefined)) {
trace("ERROR! Please update your TweenLite class. TweenFilterLite requires a more recent version. Download updates at http://www.TweenLite.com.");
}
}
function initTweenVals() {
if (_mc != undefined) {
super.initTweenVals();
if (vars.type != undefined) {
_clrsa = [];
_matrix = _idMatrix.slice();
if ((vars.quality == undefined) || (isNaN(vars.quality))) {
vars.quality = 2;
}
if (vars.runBackwards == true) {
for (var _local3 in tweens) {
tweens[_local3].flipped = true;
}
}
switch (vars.type.toLowerCase()) {
case "blur" :
setFilter(flash.filters.BlurFilter, ["blurX", "blurY", "quality"], new flash.filters.BlurFilter(0, 0, vars.quality));
break;
case "glow" :
setFilter(flash.filters.GlowFilter, ["alpha", "blurX", "blurY", "color", "quality", "strength", "inner", "knockout"], new flash.filters.GlowFilter(16777215, 0, 0, 0, vars.strength || 1, vars.quality, vars.inner, vars.knockout));
break;
case "colormatrix" :
case "color" :
case "colormatrixfilter" :
case "colorize" :
setFilter(flash.filters.ColorMatrixFilter, [], new flash.filters.ColorMatrixFilter(_matrix));
_matrix = _f.matrix;
if (vars.relative == true) {
_endMatrix = _matrix.slice();
} else {
_endMatrix = _idMatrix.slice();
}
_endMatrix = setBrightness(_endMatrix, vars.brightness);
_endMatrix = setContrast(_endMatrix, vars.contrast);
_endMatrix = setHue(_endMatrix, vars.hue);
_endMatrix = setSaturation(_endMatrix, vars.saturation);
_endMatrix = setThreshold(_endMatrix, vars.threshold);
if (!isNaN(vars.colorize)) {
_endMatrix = colorize(_endMatrix, vars.colorize, vars.amount);
} else if (!isNaN(vars.color)) {
_endMatrix = colorize(_endMatrix, vars.color, vars.amount);
}
var _local4 = delay - ((getTimer() - initTime) / 1000);
_clrMtxTw = new gs.TweenLite(_matrix, duration, {endArray:_endMatrix, ease:vars.ease, delay:_local4, overwrite:false, runBackwards:vars.runBackwards});
_clrMtxTw.__set__endTarget(_mc);
break;
case "shadow" :
case "dropshadow" :
setFilter(flash.filters.DropShadowFilter, ["alpha", "angle", "blurX", "blurY", "color", "distance", "quality", "strength", "inner", "knockout", "hideObject"], new flash.filters.DropShadowFilter(0, 45, 0, 0, 0, 0, 1, vars.quality, vars.inner, vars.knockout, vars.hideObject));
break;
case "bevel" :
setFilter(flash.filters.BevelFilter, ["angle", "blurX", "blurY", "distance", "highlightAlpha", "highlightColor", "quality", "shadowAlpha", "shadowColor", "strength"], new flash.filters.BevelFilter(0, 0, 16777215, 0.5, 0, 0.5, 2, 2, 0, vars.quality));
}
if (vars.runBackwards == true) {
flipFilterVals();
}
}
}
}
function setFilter($filterType, $props, $defaultFilter) {
_fType = $filterType;
var _local7 = _mc.filters;
var _local3;
var _local8;
_local3 = 0;
while (_local3 < _local7.length) {
if (_local7[_local3] instanceof $filterType) {
_f = _local7[_local3];
break;
}
_local3++;
}
if (_f == undefined) {
_local7.push($defaultFilter);
_mc.filters = _local7;
_f = $defaultFilter;
}
var _local2;
var _local6;
_local3 = 0;
while (_local3 < $props.length) {
_local2 = $props[_local3];
if (tweens[_local2] != undefined) {
_local6 = tweens[_local2];
delete tweens[_local2];
} else if (extraTweens[_local2] != undefined) {
_local6 = extraTweens[_local2];
} else {
_local6 = null;
}
if (_local6 != null) {
if (((((((_local2 == "brightness") || (_local2 == "colorize")) || (_local2 == "amount")) || (_local2 == "saturation")) || (_local2 == "contrast")) || (_local2 == "hue")) || (_local2 == "threshold")) {
} else if (((_local2 == "color") || (_local2 == "highlightColor")) || (_local2 == "shadowColor")) {
var _local4 = HEXtoRGB(_f[_local2]);
var _local5 = HEXtoRGB(vars[_local2]);
_clrsa.push({p:_local2, e:vars.ease, sr:_local4.rb, cr:_local5.rb - _local4.rb, sg:_local4.gb, cg:_local5.gb - _local4.gb, sb:_local4.bb, cb:_local5.bb - _local4.bb});
} else if ((((_local2 == "quality") || (_local2 == "inner")) || (_local2 == "knockout")) || (_local2 == "hideObject")) {
_f[_local2] = vars[_local2];
} else {
if (typeof(vars[_local2]) == "number") {
_local8 = vars[_local2] - _f[_local2];
} else {
_local8 = Number(vars[_local2]);
}
tweens[_local2] = {o:_f, p:_local2, s:_f[_local2], c:_local8};
}
}
_local3++;
}
}
static function to($target, $duration, $vars, $delay, $onComplete, $onCompleteParams, $overwrite) {
return(new gs.TweenFilterLite($target, $duration, $vars, $delay, $onComplete, $onCompleteParams, $overwrite));
}
static function from($target, $duration, $vars, $delay, $onComplete, $onCompleteParams, $overwrite) {
$vars.runBackwards = true;
return(new gs.TweenFilterLite($target, $duration, $vars, $delay, $onComplete, $onCompleteParams, $overwrite));
}
function flipFilterVals() {
var _local6 = __get__active();
var _local3;
var _local2;
for (var _local7 in tweens) {
if (tweens[_local7].flipped != true) {
_local2 = tweens[_local7];
_local2.s = _local2.s + _local2.c;
_local2.c = _local2.c * -1;
_local2.o[_local7] = _local2.s;
_local2.flipped = true;
}
}
_local3 = 0;
while (_local3 < _clrsa.length) {
_local2 = _clrsa[_local3];
_local2.sr = _local2.sr + _local2.cr;
_local2.cr = _local2.cr * -1;
_local2.sg = _local2.sg + _local2.cg;
_local2.cg = _local2.cg * -1;
_local2.sb = _local2.sb + _local2.cb;
_local2.cb = _local2.cb * -1;
if (!_local6) {
_f[_local2.p] = ((_local2.sr << 16) | (_local2.sg << 8)) | _local2.sb;
}
_local3++;
}
if (_local6 && (duration != 0.001)) {
render(getTimer());
} else {
if (_endMatrix) {
_f.matrix = _matrix;
}
var _local4 = _mc.filters;
var _local5 = [];
_local3 = 0;
while (_local3 < _local4.length) {
if (_local4[_local3] instanceof _fType) {
_local5.push(_f);
} else {
_local5.push(_local4[_local3]);
}
_local3++;
}
_mc.filters = _local5;
}
if (vars.onUpdate != undefined) {
vars.onUpdate.apply(null, vars.onUpdateParams);
}
}
function render($t) {
var _local10 = ($t - startTime) / 1000;
if (_local10 > duration) {
_local10 = duration;
}
var _local4 = vars.ease(_local10, 0, 1, duration);
var _local2;
var _local3;
var _local8;
var _local9;
var _local7;
for (var _local11 in tweens) {
_local2 = tweens[_local11];
_local2.o[_local11] = _local2.s + (_local4 * _local2.c);
}
_local3 = 0;
while (_local3 < _clrsa.length) {
_local2 = _clrsa[_local3];
_local8 = _local2.sr + (_local4 * _local2.cr);
_local9 = _local2.sg + (_local4 * _local2.cg);
_local7 = _local2.sb + (_local4 * _local2.cb);
_f[_local2.p] = ((_local8 << 16) | (_local9 << 8)) | _local7;
_local3++;
}
if (_endMatrix) {
_f.matrix = _matrix;
}
var _local5 = _mc.filters;
var _local6 = [];
_local3 = 0;
while (_local3 < _local5.length) {
if (_local5[_local3] instanceof _fType) {
_local6.push(_f);
} else {
_local6.push(_local5[_local3]);
}
_local3++;
}
_mc.filters = _local6;
if (vars.onUpdate != undefined) {
vars.onUpdate.apply(null, vars.onUpdateParams);
}
if (_local10 == duration) {
complete(true);
}
}
function HEXtoRGB($n) {
return({rb:$n >> 16, gb:($n >> 8) & 255, bb:$n & 255});
}
static function colorize($m, $color, $amount) {
if (($color == undefined) || (isNaN($color))) {
return($m);
}
if ($amount == undefined) {
$amount = 1;
}
var _local3 = (($color >> 16) & 255) / 255;
var _local5 = (($color >> 8) & 255) / 255;
var _local2 = ($color & 255) / 255;
var _local4 = 1 - $amount;
var _local7 = [_local4 + (($amount * _local3) * _lumR), ($amount * _local3) * _lumG, ($amount * _local3) * _lumB, 0, 0, ($amount * _local5) * _lumR, _local4 + (($amount * _local5) * _lumG), ($amount * _local5) * _lumB, 0, 0, ($amount * _local2) * _lumR, ($amount * _local2) * _lumG, _local4 + (($amount * _local2) * _lumB), 0, 0, 0, 0, 0, 1, 0];
return(applyMatrix(_local7, $m));
}
static function setThreshold($m, $n) {
if (($n == undefined) || (isNaN($n))) {
return($m);
}
var _local2 = [_lumR * 256, _lumG * 256, _lumB * 256, 0, -256 * $n, _lumR * 256, _lumG * 256, _lumB * 256, 0, -256 * $n, _lumR * 256, _lumG * 256, _lumB * 256, 0, -256 * $n, 0, 0, 0, 1, 0];
return(applyMatrix(_local2, $m));
}
static function setHue($m, $n) {
if (($n == undefined) || (isNaN($n))) {
return($m);
}
$n = $n * (Math.PI/180);
var _local1 = Math.cos($n);
var _local2 = Math.sin($n);
var _local4 = [(_lumR + (_local1 * (1 - _lumR))) + (_local2 * (-_lumR)), (_lumG + (_local1 * (-_lumG))) + (_local2 * (-_lumG)), (_lumB + (_local1 * (-_lumB))) + (_local2 * (1 - _lumB)), 0, 0, (_lumR + (_local1 * (-_lumR))) + (_local2 * 0.143), (_lumG + (_local1 * (1 - _lumG))) + (_local2 * 0.14), (_lumB + (_local1 * (-_lumB))) + (_local2 * -0.283), 0, 0, (_lumR + (_local1 * (-_lumR))) + (_local2 * (-(1 - _lumR))), (_lumG + (_local1 * (-_lumG))) + (_local2 * _lumG), (_lumB + (_local1 * (1 - _lumB))) + (_local2 * _lumB), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return(applyMatrix(_local4, $m));
}
static function setBrightness($m, $n) {
if (($n == undefined) || (isNaN($n))) {
return($m);
}
$n = ($n * 100) - 100;
return(applyMatrix([1, 0, 0, 0, $n, 0, 1, 0, 0, $n, 0, 0, 1, 0, $n, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], $m));
}
static function setSaturation($m, $n) {
if (($n == undefined) || (isNaN($n))) {
return($m);
}
var _local4 = 1 - $n;
var _local3 = _local4 * _lumR;
var _local5 = _local4 * _lumG;
var _local2 = _local4 * _lumB;
var _local6 = [_local3 + $n, _local5, _local2, 0, 0, _local3, _local5 + $n, _local2, 0, 0, _local3, _local5, _local2 + $n, 0, 0, 0, 0, 0, 1, 0];
return(applyMatrix(_local6, $m));
}
static function setContrast($m, $n) {
if (($n == undefined) || (isNaN($n))) {
return($m);
}
$n = $n + 0.01;
var _local2 = [$n, 0, 0, 0, 128 * (1 - $n), 0, $n, 0, 0, 128 * (1 - $n), 0, 0, $n, 0, 128 * (1 - $n), 0, 0, 0, 1, 0];
return(applyMatrix(_local2, $m));
}
static function applyMatrix($m, $m2) {
if (((($m == undefined) || (!($m instanceof Array))) || ($m2 == undefined)) || (!($m2 instanceof Array))) {
return($m2);
}
var _local7 = [];
var _local2 = 0;
var _local5 = 0;
var _local6 = 0;
while (_local6 < 4) {
var _local1 = 0;
while (_local1 < 5) {
if (_local1 == 4) {
_local5 = $m[_local2 + 4];
} else {
_local5 = 0;
}
_local7[_local2 + _local1] = (((($m[_local2] * $m2[_local1]) + ($m[_local2 + 1] * $m2[_local1 + 5])) + ($m[_local2 + 2] * $m2[_local1 + 10])) + ($m[_local2 + 3] * $m2[_local1 + 15])) + _local5;
_local1++;
}
_local2 = _local2 + 5;
_local6++;
}
return(_local7);
}
static var version = 5.8;
static var _idMatrix = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
static var _lumR = 0.212671;
static var _lumG = 0.71516;
static var _lumB = 0.072169;
static var delayedCall = gs.TweenLite.delayedCall;
static var killTweensOf = gs.TweenLite.killTweensOf;
static var killDelayedCallsTo = gs.TweenLite.killDelayedCallsTo;
}
Symbol 3366 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 87 MovieClip Frame 1
stop();
Symbol 87 MovieClip Frame 10
stop();
Symbol 89 MovieClip Frame 1
this._parent.stop();
this.link.onRelease = function () {
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1521&subid=splash", "_blank");
};
Symbol 89 MovieClip Frame 151
this._parent.stop();
this.link.onRelease = function () {
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=XXXX&subid=splash", "_blank");
};
Symbol 89 MovieClip Frame 161
stop();
this._parent.play();
Symbol 99 MovieClip Frame 1
stop();
Symbol 99 MovieClip Frame 10
stop();
Symbol 104 MovieClip Frame 1
stop();
Symbol 108 MovieClip Frame 1
moreGamesBtn.onRollOver = function () {
this.gotoAndPlay("over");
};
moreGamesBtn.onRollOut = function () {
this.gotoAndPlay("out");
};
moreGamesBtn.onDragOut = function () {
this.gotoAndPlay("out");
};
playBtn.onRollOver = function () {
this.gotoAndPlay("over");
};
playBtn.onRollOut = function () {
this.gotoAndPlay("out");
};
playBtn.onDragOut = function () {
this.gotoAndPlay("out");
};
hiscoresBtn.onRollOver = function () {
this.gotoAndPlay("over");
};
hiscoresBtn.onRollOut = function () {
this.gotoAndPlay("out");
};
hiscoresBtn.onDragOut = function () {
this.gotoAndPlay("out");
};
trace(_parent.currentDomain);
if (_parent.currentDomain.indexOf("mindjolt") != -1) {
hiscoresBtn._visible = false;
} else {
hiscoresBtn._visible = true;
}
Symbol 108 MovieClip Frame 191
stop();
Symbol 110 MovieClip Frame 1
stop();
this._visible = false;
Symbol 110 MovieClip Frame 2
this._visible = true;
Symbol 110 MovieClip Frame 8
_parent.gotoAndStop(_parent.menuToPlay);
Symbol 114 MovieClip Frame 1
stop();
Symbol 114 MovieClip Frame 5
stop();
Symbol 116 MovieClip Frame 1
box_color.onRollOver = function () {
box_color_play = 1;
};
box_color.onRollOut = function () {
box_color_play = 0;
};
box_color.onEnterFrame = function () {
if ((box_color._currentframe != box_color._totalframes) || (box_color._currentframe != 0)) {
if (box_color_play == 1) {
box_color.nextFrame();
}
if (box_color_play == 0) {
box_color.prevFrame();
}
}
};
box_color.onRelease = function () {
trace("fullScreen");
_root.toggleFullScreen();
};
Symbol 127 MovieClip Frame 1
stop();
Symbol 127 MovieClip Frame 10
stop();
Symbol 131 MovieClip Frame 1
stop();
Symbol 131 MovieClip Frame 10
stop();
Symbol 368 MovieClip Frame 302
stop();
randMove = Math.round(Math.random() * 3);
switch (randMove) {
case 1 :
gotoAndPlay ("idleLeft");
break;
case 2 :
gotoAndPlay ("idleRight");
break;
case 3 :
gotoAndPlay ("idleWatch");
}
Symbol 386 MovieClip Frame 1
box_color.onRollOver = function () {
box_color_play = 1;
};
box_color.onRollOut = function () {
box_color_play = 0;
};
box_color.onEnterFrame = function () {
if ((box_color._currentframe != box_color._totalframes) || (box_color._currentframe != 0)) {
if (box_color_play == 1) {
box_color.nextFrame();
}
if (box_color_play == 0) {
box_color.prevFrame();
}
}
};
Symbol 390 MovieClip Frame 1
stop();
Symbol 470 MovieClip Frame 23
stop();
Symbol 470 MovieClip Frame 46
stop();
Symbol 470 MovieClip Frame 69
stop();
Symbol 471 MovieClip Frame 1
man.stop();
Symbol 477 MovieClip Frame 1
stop();
Symbol 477 MovieClip Frame 39
stop();
Symbol 477 MovieClip Frame 61
stop();
Symbol 608 MovieClip Frame 1
var frequency = 0;
onEnterFrame = function () {
frequency = Math.random() * 1000;
if ((frequency >= 995) && (_parent.alive == true)) {
delete this.onEnterFrame;
play();
}
};
stop();
Symbol 608 MovieClip Frame 197
gotoAndPlay ("idle");
Symbol 608 MovieClip Frame 230
stop();
Symbol 608 MovieClip Frame 268
stop();
Symbol 784 MovieClip Frame 98
randMove = Math.round(Math.random() * 3);
switch (randMove) {
case 1 :
gotoAndPlay ("idleLeft");
break;
case 2 :
gotoAndPlay ("idleRight");
break;
case 3 :
gotoAndPlay ("idleWatch");
}
Symbol 784 MovieClip Frame 204
randMove = Math.round(Math.random() * 3);
switch (randMove) {
case 1 :
gotoAndPlay ("idleLeft");
break;
case 2 :
gotoAndPlay ("idleRight");
break;
case 3 :
gotoAndPlay ("idleWatch");
}
Symbol 784 MovieClip Frame 302
stop();
randMove = Math.round(Math.random() * 3);
switch (randMove) {
case 1 :
gotoAndPlay ("idleLeft");
break;
case 2 :
gotoAndPlay ("idleRight");
break;
case 3 :
gotoAndPlay ("idleWatch");
}
Symbol 784 MovieClip Frame 336
stop();
Symbol 784 MovieClip Frame 393
stop();
Symbol 784 MovieClip Frame 439
stop();
Symbol 983 MovieClip Frame 101
gotoAndPlay ("idle");
Symbol 983 MovieClip Frame 106
stop();
Symbol 983 MovieClip Frame 156
stop();
Symbol 983 MovieClip Frame 211
stop();
Symbol 1106 MovieClip Frame 1
gotoAndPlay(Math.round(Math.random() * 10));
Symbol 1106 MovieClip Frame 33
gotoAndPlay ("walk");
Symbol 1106 MovieClip Frame 46
if (this.halfTurn) {
stop();
}
Symbol 1106 MovieClip Frame 115
gotoAndPlay ("run");
Symbol 1106 MovieClip Frame 149
stop();
Symbol 1106 MovieClip Frame 189
stop();
Symbol 1106 MovieClip Frame 227
stop();
Symbol 1107 MovieClip Frame 961
stop();
Symbol 1118 MovieClip Frame 25
if (regular == true) {
gotoAndPlay ("regular");
} else {
gotoAndPlay ("irregular");
}
Symbol 1118 MovieClip Frame 125
if (regular == true) {
gotoAndPlay ("regular");
} else {
gotoAndPlay ("irregular");
}
Symbol 1121 MovieClip Frame 1
function resetShots() {
i = 1;
while (i <= 20) {
headShotArray[i] = false;
bodyShotArray[i] = false;
i++;
}
}
function initMission(menOnLevel) {
var _local2 = 1;
while (_local2 <= menOnLevel) {
this["man" + _local2].alive = true;
trace((_local2 + ":live=") + this["man" + _local2].alive);
_local2++;
}
}
function newScopeMove(reloadFinished) {
if (reloadFinished) {
reload = false;
sniperScope.scope.blocked._visible = false;
}
breathCount++;
if ((breathCount % 2) == 0) {
_parent.breathIn.start(0, 1);
randomx = (Math.random() * scopeWobble) - (scopeWobble / 2);
randomy = (Math.random() * scopeWobble) - (scopeWobble / 2);
gs.TweenFilterLite.to(sniperScope.scope, 2, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
} else {
_parent.breathOut.start(0, 1);
randomx = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
randomy = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
gs.TweenFilterLite.to(sniperScope.scope, 4, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
}
}
function shotFired() {
sniperScope.scope.blocked._visible = true;
reload = true;
checkForHits();
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_y:sniperScope.scope._y - 60, ease:mx.transitions.easing.Strong.easeOut, onComplete:recoil});
}
function recoil() {
_parent.reloadGun.start(0, 1);
gs.TweenFilterLite.to(sniperScope.scope, 0.5, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (lights == true) {
var _local3 = 1;
while (_local3 <= lightsNumber) {
if (this["light" + _local3].collision.hitTest(point.x, point.y, 1)) {
this["light" + _local3].gotoAndStop("off");
_parent.lightsmash.start(0, 1);
_local4 = true;
break;
}
_local3++;
}
}
if (windows == true) {
var _local3 = 1;
while (_local3 <= windowsNumber) {
if (this["window" + _local3].hitTest(point.x, point.y, 1)) {
this["window" + _local3].gotoAndStop(2 + Math.round(Math.random() * 4));
if (thunder) {
_parent.windowsmash.setVolume(30);
} else {
_parent.windowsmash.setVolume(100);
}
_parent.windowsmash.start(0, 1);
windowsBroken = true;
_local4 = true;
break;
}
_local3++;
}
}
if (bombOnLevel == true) {
if (bomb.hitTest(point.x, point.y, 1)) {
_parent.headShots++;
bomb.play();
_local4 = true;
_local6 = true;
}
}
if (foreground.hitTest(point.x, point.y, 1) == false) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = true;
_local4 = true;
trace("bodyShot");
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = false;
headShotArray[_local3] = true;
_local4 = true;
}
if ((headShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.headShots++;
_local6 = true;
}
var _local5 = this["man" + _local3]._height;
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("headshot");
exploder(_local5);
sniperScope.swapDepths(this.getNextHighestDepth());
} else if ((bodyShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(sniperScope_.x, sniperScope_.y);
sniperScope.swapDepths(this.getNextHighestDepth());
}
if (foreground.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.y);
sniperScope.swapDepths(this.getNextHighestDepth());
_parent.misses++;
}
if (_local4) {
checkLevelOver();
}
}
function cleanLevel(success) {
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:40});
Key.removeListener(myListener);
Mouse.removeListener(mouseListener);
gs.TweenFilterLite.killTweensOf(this.sniperScope.scope, 1);
gs.TweenFilterLite.killTweensOf(this.sniperScope, 1);
resetShots();
if (success) {
successMission();
} else {
failedMission();
}
}
function failedMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionFailed});
}
function missionFailed() {
_parent.menuToPlay = "missionFailed";
_parent.fader.play();
}
function successMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionComplete});
}
function missionComplete() {
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
function resetZoom() {
_parent.levelart._xscale = 100;
_parent.levelart._yscale = 100;
scopeZoom = false;
_parent.levelart._x = 0;
_parent.levelart._y = 0;
}
function scopeHideEnd() {
scopeHiding = false;
}
function convCoords(object, Enemy) {
var _local1 = new Object();
_local1.x = object._x;
_local1.y = object._y;
Enemy.localToGlobal(_local1);
return(_local1);
}
function distanceFromMouse(object) {
var _local1 = object._y - sniperScope._y;
var _local2 = object._x - sniperScope._x;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
return(_local3);
}
function abortMission() {
trace("MISSION ABORT");
_parent.failedReason = 16;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.soundtrack1Holder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatIrregularHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.rainHolder, 4, {volume:0});
}
function createExploder(startX, startY, floor) {
nCount++;
var life = 20;
var _local5 = 4 - (Math.random() * 8);
var _local4 = 4 - (Math.random() * 8);
var _local3 = Math.round(Math.random() * 100);
var _local2 = "explodePart" + nCount;
this.attachMovie("brains", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:_local3, _yscale:_local3});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
this[_local2].life = Math.round(Math.random() * 25);
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.dy = this.dy + 0.5;
if (this.counter >= this.life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 30) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
var _local2 = "bloodPart" + bCount;
this.attachMovie("blood", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:scale, _yscale:scale});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
var _local3 = Math.round(Math.random() * 80);
this[_local2]._xscale = _local3;
this[_local2]._yscale = _local3;
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
if ((this._y + (this._height / 2)) > floor) {
this._y = floor - (this._height / 2);
this.dy = this.dy * this.elasticity;
}
this.dy = this.dy + 0.5;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function smoker(smokex, smokey) {
smokeCount++;
var life = 150;
var _local2 = "smokePart" + smokeCount;
if (scopeZoom == false) {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
} else {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:_xmouse, _y:_ymouse, _xscale:50, _yscale:50});
}
this[_local2].onEnterFrame = function () {
this.counter++;
if (this.counter >= life) {
this._alpha = this._alpha - 1;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function checkLevelOver() {
if ((headShotArray[1] == true) || (bodyShotArray[1] == true)) {
man2._visible = true;
}
if ((headShotArray[2] == true) || (bodyShotArray[2] == true)) {
man3._visible = true;
}
if ((headShotArray[3] == true) || (bodyShotArray[3] == true)) {
man4._visible = true;
}
if ((headShotArray[4] == true) || (bodyShotArray[4] == true)) {
man5._visible = true;
}
if ((headShotArray[5] == true) || (bodyShotArray[5] == true)) {
man6._visible = true;
}
if ((headShotArray[6] == true) || (bodyShotArray[6] == true)) {
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
_parent.bonus = _parent.bonus + (_parent.countdown.seconds * 10);
cleanLevel(true);
_parent.countdown.finished = true;
}
if (((((((headShotArray[7] == true) || (bodyShotArray[7] == true)) || ((headShotArray[8] == true) || (bodyShotArray[8] == true))) || ((headShotArray[9] == true) || (bodyShotArray[9] == true))) || ((headShotArray[10] == true) || (bodyShotArray[10] == true))) || ((headShotArray[11] == true) || (bodyShotArray[11] == true))) || ((headShotArray[12] == true) || (bodyShotArray[12] == true))) {
_parent.failedReason = 1;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
}
function levelEnd() {
_parent.failedReason = 2;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
Mouse.hide();
var scopeWobble = 1;
var scopeWobbleBack = 1;
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
var scopeZoom = false;
var windowsBroken = false;
sniperScope.scope.blocked._visible = false;
_parent.brief.smallBrief.text = _root["onScreen" + _parent.mission];
resetShots();
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
if (!reload) {
_parent.shotsFired++;
_parent.gunShot.start(0, 1);
shotFired();
}
};
Mouse.addListener(mouseListener);
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_x:0, _y:0, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
var myListener = new Object();
myListener.onKeyDown = function () {
var _local3 = -_xmouse;
var _local2 = -_ymouse;
if ((Key.getCode() == 32) && (!scopeZoom)) {
_parent.levelart._xscale = 200;
_parent.levelart._yscale = 200;
scopeZoom = true;
_parent.levelart._x = _local3;
_parent.levelart._y = _local2;
_parent.zoomIn.start(0, 1);
} else if ((Key.getCode() == 32) && (scopeZoom)) {
resetZoom();
_parent.zoomOut.start(0, 1);
}
trace("scopeZoom=" + scopeZoom);
};
Key.addListener(myListener);
onEnterFrame = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
_parent.blob._x = point.x;
_parent.blob._y = point.y;
if (heartbeat) {
checkBeats();
}
if (explode) {
bombCheck();
}
if (checkVision) {
visionTest();
}
};
if (heartbeat) {
sniperScope.heartRate._visible = true;
} else {
sniperScope.heartRate._visible = true;
}
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:70});
menOnLevel = 12;
initMission(menOnLevel);
var targetToHit = Array(0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
_parent.countdown.seconds = 60;
var i = 1;
while (i <= 6) {
this["man" + i]._visible = false;
i++;
}
man1._visible = true;
Symbol 1123 MovieClip Frame 1
this.onRollOver = function () {
Mouse.show();
_parent.abortOver = true;
box_color_play = 1;
};
this.onRollOut = function () {
Mouse.hide();
box_color_play = 0;
_parent.abortOver = false;
};
this.onEnterFrame = function () {
if ((box_color._currentframe != box_color._totalframes) || (box_color._currentframe != 0)) {
if (box_color_play == 1) {
box_color.nextFrame();
}
if (box_color_play == 0) {
box_color.prevFrame();
}
}
};
this.onRelease = function () {
_parent.levelart.abortMission();
};
Symbol 1135 MovieClip Frame 1
var counter = 25;
var seconds;
var hundreds = 100;
var finished = false;
var pausedTimer = false;
onEnterFrame = function () {
if (!paused) {
counter--;
hundreds = hundreds - 4;
hunds.text = hundreds;
if (counter == 0) {
seconds--;
if (seconds < 10) {
secs.text = "0" + seconds;
} else {
secs.text = seconds;
}
hundreds = 100;
counter = 25;
if (seconds < 0) {
gotoAndStop ("finished");
delete this.onEnterFrame;
}
}
}
if (finished) {
delete this.onEnterFrame;
}
};
stop();
Symbol 1135 MovieClip Frame 5
_parent.levelart.levelEnd();
Symbol 1268 MovieClip Frame 34
gotoAndPlay ("idle");
Symbol 1268 MovieClip Frame 36
gotoAndPlay ("run");
Symbol 1268 MovieClip Frame 66
stop();
Symbol 1268 MovieClip Frame 120
stop();
Symbol 1268 MovieClip Frame 166
stop();
Symbol 1462 MovieClip Frame 124
gotoAndPlay ("idle");
Symbol 1462 MovieClip Frame 170
stop();
Symbol 1462 MovieClip Frame 216
stop();
Symbol 1646 MovieClip Frame 1
gotoAndPlay(Math.round(Math.random() * 100));
Symbol 1646 MovieClip Frame 175
gotoAndPlay (2);
Symbol 1646 MovieClip Frame 219
stop();
Symbol 1646 MovieClip Frame 263
stop();
Symbol 1681 MovieClip Frame 32
if (_parent.alive) {
gotoAndPlay ("walk");
}
Symbol 1681 MovieClip Frame 41
gotoAndPlay ("idle");
Symbol 1681 MovieClip Frame 75
gotoAndPlay ("walk");
Symbol 1681 MovieClip Frame 125
gotoAndPlay ("run");
Symbol 1681 MovieClip Frame 158
stop();
Symbol 1681 MovieClip Frame 199
stop();
Symbol 1681 MovieClip Frame 237
stop();
Symbol 1682 MovieClip Frame 1
man.gotoAndStop("idle");
Symbol 1696 MovieClip Frame 14
gotoAndPlay ("loop");
Symbol 1700 MovieClip Frame 1
stop();
Symbol 1700 MovieClip Frame 15
gotoAndStop ("idle");
Symbol 1700 MovieClip Frame 49
stop();
Symbol 1702 MovieClip Frame 1
function resetShots() {
i = 1;
while (i <= 20) {
headShotArray[i] = false;
bodyShotArray[i] = false;
i++;
}
}
function initMission(menOnLevel) {
var _local2 = 1;
while (_local2 <= menOnLevel) {
this["man" + _local2].alive = true;
trace((_local2 + ":live=") + this["man" + _local2].alive);
_local2++;
}
}
function newScopeMove(reloadFinished) {
if (reloadFinished) {
reload = false;
sniperScope.scope.blocked._visible = false;
}
breathCount++;
if ((breathCount % 2) == 0) {
_parent.breathIn.start(0, 1);
randomx = (Math.random() * scopeWobble) - (scopeWobble / 2);
randomy = (Math.random() * scopeWobble) - (scopeWobble / 2);
gs.TweenFilterLite.to(sniperScope.scope, 2, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
} else {
_parent.breathOut.start(0, 1);
randomx = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
randomy = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
gs.TweenFilterLite.to(sniperScope.scope, 4, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
}
}
function shotFired() {
sniperScope.scope.blocked._visible = true;
reload = true;
checkForHits();
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_y:sniperScope.scope._y - 60, ease:mx.transitions.easing.Strong.easeOut, onComplete:recoil});
}
function recoil() {
_parent.reloadGun.start(0, 1);
gs.TweenFilterLite.to(sniperScope.scope, 0.5, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (lights == true) {
var _local3 = 1;
while (_local3 <= lightsNumber) {
if (this["light" + _local3].collision.hitTest(point.x, point.y, 1)) {
this["light" + _local3].gotoAndStop("off");
_parent.lightsmash.start(0, 1);
_local4 = true;
break;
}
_local3++;
}
}
if (windows == true) {
var _local3 = 1;
while (_local3 <= windowsNumber) {
if (this["window" + _local3].hitTest(point.x, point.y, 1)) {
this["window" + _local3].gotoAndStop(2 + Math.round(Math.random() * 4));
if (thunder) {
_parent.windowsmash.setVolume(30);
} else {
_parent.windowsmash.setVolume(100);
}
_parent.windowsmash.start(0, 1);
windowsBroken = true;
_local4 = true;
break;
}
_local3++;
}
}
if (bombOnLevel == true) {
if (bomb.hitTest(point.x, point.y, 1)) {
_parent.headShots++;
bomb.play();
_local4 = true;
_local6 = true;
}
}
if (foreground.hitTest(point.x, point.y, 1) == false) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = true;
_local4 = true;
trace("bodyShot");
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = false;
headShotArray[_local3] = true;
_local4 = true;
}
if ((headShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.headShots++;
_local6 = true;
}
var _local5 = this["man" + _local3]._height;
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("headshot");
exploder(_local5);
sniperScope.swapDepths(this.getNextHighestDepth());
} else if ((bodyShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(sniperScope_.x, sniperScope_.y);
sniperScope.swapDepths(this.getNextHighestDepth());
}
if (foreground.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.y);
sniperScope.swapDepths(this.getNextHighestDepth());
_parent.misses++;
}
if (_local4) {
checkLevelOver();
}
}
function cleanLevel(success) {
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:40});
Key.removeListener(myListener);
Mouse.removeListener(mouseListener);
gs.TweenFilterLite.killTweensOf(this.sniperScope.scope, 1);
gs.TweenFilterLite.killTweensOf(this.sniperScope, 1);
resetShots();
if (success) {
successMission();
} else {
failedMission();
}
}
function failedMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionFailed});
}
function missionFailed() {
_parent.menuToPlay = "missionFailed";
_parent.fader.play();
}
function successMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionComplete});
}
function missionComplete() {
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
function resetZoom() {
_parent.levelart._xscale = 100;
_parent.levelart._yscale = 100;
scopeZoom = false;
_parent.levelart._x = 0;
_parent.levelart._y = 0;
}
function scopeHideEnd() {
scopeHiding = false;
}
function convCoords(object, Enemy) {
var _local1 = new Object();
_local1.x = object._x;
_local1.y = object._y;
Enemy.localToGlobal(_local1);
return(_local1);
}
function distanceFromMouse(object) {
var _local1 = object._y - sniperScope._y;
var _local2 = object._x - sniperScope._x;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
return(_local3);
}
function abortMission() {
trace("MISSION ABORT");
_parent.failedReason = 16;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.soundtrack1Holder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatIrregularHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.rainHolder, 4, {volume:0});
}
function createExploder(startX, startY, floor) {
nCount++;
var life = 20;
var _local5 = 4 - (Math.random() * 8);
var _local4 = 4 - (Math.random() * 8);
var _local3 = Math.round(Math.random() * 100);
var _local2 = "explodePart" + nCount;
this.attachMovie("brains", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:_local3, _yscale:_local3});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
this[_local2].life = Math.round(Math.random() * 25);
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.dy = this.dy + 0.5;
if (this.counter >= this.life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 30) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
var _local2 = "bloodPart" + bCount;
this.attachMovie("blood", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:scale, _yscale:scale});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
var _local3 = Math.round(Math.random() * 80);
this[_local2]._xscale = _local3;
this[_local2]._yscale = _local3;
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
if ((this._y + (this._height / 2)) > floor) {
this._y = floor - (this._height / 2);
this.dy = this.dy * this.elasticity;
}
this.dy = this.dy + 0.5;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function smoker(smokex, smokey) {
smokeCount++;
var life = 150;
var _local2 = "smokePart" + smokeCount;
if (scopeZoom == false) {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
} else {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:_xmouse, _y:_ymouse, _xscale:50, _yscale:50});
}
this[_local2].onEnterFrame = function () {
this.counter++;
if (this.counter >= life) {
this._alpha = this._alpha - 1;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function checkLevelOver() {
if ((headShotArray[8] == true) || (bodyShotArray[8] == true)) {
cleanLevel(true);
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
}
if (bodyShotArray[9] == true) {
man9.alive = true;
}
if ((((((((((((((headShotArray[1] == true) || (bodyShotArray[1] == true)) || (headShotArray[2] == true)) || (bodyShotArray[2] == true)) || (headShotArray[3] == true)) || (bodyShotArray[3] == true)) || (headShotArray[4] == true)) || (bodyShotArray[4] == true)) || (headShotArray[5] == true)) || (bodyShotArray[5] == true)) || (headShotArray[6] == true)) || (bodyShotArray[6] == true)) || (headShotArray[7] == true)) || (bodyShotArray[7] == true)) {
cleanLevel(false);
_parent.failedReason = 1;
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
}
}
Mouse.hide();
var scopeWobble = 1;
var scopeWobbleBack = 1;
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
var scopeZoom = false;
var windowsBroken = false;
sniperScope.scope.blocked._visible = false;
_parent.brief.smallBrief.text = _root["onScreen" + _parent.mission];
resetShots();
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
if (!reload) {
_parent.shotsFired++;
_parent.gunShot.start(0, 1);
shotFired();
}
};
Mouse.addListener(mouseListener);
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_x:0, _y:0, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
var myListener = new Object();
myListener.onKeyDown = function () {
var _local3 = -_xmouse;
var _local2 = -_ymouse;
if ((Key.getCode() == 32) && (!scopeZoom)) {
_parent.levelart._xscale = 200;
_parent.levelart._yscale = 200;
scopeZoom = true;
_parent.levelart._x = _local3;
_parent.levelart._y = _local2;
_parent.zoomIn.start(0, 1);
} else if ((Key.getCode() == 32) && (scopeZoom)) {
resetZoom();
_parent.zoomOut.start(0, 1);
}
trace("scopeZoom=" + scopeZoom);
};
Key.addListener(myListener);
onEnterFrame = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
_parent.blob._x = point.x;
_parent.blob._y = point.y;
if (heartbeat) {
checkBeats();
}
if (explode) {
bombCheck();
}
if (checkVision) {
visionTest();
}
};
if (heartbeat) {
sniperScope.heartRate._visible = true;
} else {
sniperScope.heartRate._visible = true;
}
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:70});
menOnLevel = 9;
initMission(menOnLevel);
var targetToHit = Array(0, 0, 0, 0, 0, 0, 0, 1, 1, 1);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 1702 MovieClip Frame 806
stop();
Symbol 1833 MovieClip Frame 98
gotoAndPlay ("idle");
Symbol 1833 MovieClip Frame 101
stop();
Symbol 1833 MovieClip Frame 146
stop();
Symbol 1833 MovieClip Frame 182
stop();
Symbol 1995 MovieClip Frame 1
var frequency = 0;
onEnterFrame = function () {
frequency = Math.random() * 1000;
if ((frequency >= 995) && (_parent.alive == true)) {
delete this.onEnterFrame;
play();
}
};
stop();
Symbol 1995 MovieClip Frame 131
gotoAndPlay ("idle");
Symbol 1995 MovieClip Frame 186
stop();
Symbol 1995 MovieClip Frame 241
stop();
Symbol 2198 MovieClip Frame 101
gotoAndPlay ("idle");
Symbol 2198 MovieClip Frame 156
stop();
Symbol 2198 MovieClip Frame 211
stop();
Symbol 2353 MovieClip Frame 1
var frequency = 0;
onEnterFrame = function () {
frequency = Math.random() * 1000;
if ((frequency >= 995) && (_parent.alive == true)) {
delete this.onEnterFrame;
play();
}
};
stop();
Symbol 2353 MovieClip Frame 149
gotoAndPlay ("idle");
Symbol 2353 MovieClip Frame 199
stop();
Symbol 2353 MovieClip Frame 264
stop();
Symbol 2361 MovieClip Frame 1
stop();
Symbol 2368 MovieClip Frame 1
stop();
Symbol 2373 MovieClip Frame 1
stop();
Symbol 2373 MovieClip Frame 17
stop();
Symbol 2375 MovieClip Frame 1
function resetShots() {
i = 1;
while (i <= 20) {
headShotArray[i] = false;
bodyShotArray[i] = false;
i++;
}
}
function initMission(menOnLevel) {
var _local2 = 1;
while (_local2 <= menOnLevel) {
this["man" + _local2].alive = true;
trace((_local2 + ":live=") + this["man" + _local2].alive);
_local2++;
}
}
function newScopeMove(reloadFinished) {
if (reloadFinished) {
reload = false;
sniperScope.scope.blocked._visible = false;
}
breathCount++;
if ((breathCount % 2) == 0) {
_parent.breathIn.start(0, 1);
randomx = (Math.random() * scopeWobble) - (scopeWobble / 2);
randomy = (Math.random() * scopeWobble) - (scopeWobble / 2);
gs.TweenFilterLite.to(sniperScope.scope, 2, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
} else {
_parent.breathOut.start(0, 1);
randomx = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
randomy = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
gs.TweenFilterLite.to(sniperScope.scope, 4, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
}
}
function shotFired() {
sniperScope.scope.blocked._visible = true;
reload = true;
checkForHits();
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_y:sniperScope.scope._y - 60, ease:mx.transitions.easing.Strong.easeOut, onComplete:recoil});
}
function recoil() {
_parent.reloadGun.start(0, 1);
gs.TweenFilterLite.to(sniperScope.scope, 0.5, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (lights == true) {
var _local3 = 1;
while (_local3 <= lightsNumber) {
if (this["light" + _local3].collision.hitTest(point.x, point.y, 1)) {
this["light" + _local3].gotoAndStop("off");
_parent.lightsmash.start(0, 1);
_local4 = true;
break;
}
_local3++;
}
}
if (windows == true) {
var _local3 = 1;
while (_local3 <= windowsNumber) {
if (this["window" + _local3].hitTest(point.x, point.y, 1)) {
this["window" + _local3].gotoAndStop(2 + Math.round(Math.random() * 4));
if (thunder) {
_parent.windowsmash.setVolume(30);
} else {
_parent.windowsmash.setVolume(100);
}
_parent.windowsmash.start(0, 1);
windowsBroken = true;
_local4 = true;
break;
}
_local3++;
}
}
if (bombOnLevel == true) {
if (bomb.hitTest(point.x, point.y, 1)) {
_parent.headShots++;
bomb.play();
_local4 = true;
_local6 = true;
}
}
if (foreground.hitTest(point.x, point.y, 1) == false) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = true;
_local4 = true;
trace("bodyShot");
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = false;
headShotArray[_local3] = true;
_local4 = true;
}
if ((headShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.headShots++;
_local6 = true;
}
var _local5 = this["man" + _local3]._height;
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("headshot");
exploder(_local5);
sniperScope.swapDepths(this.getNextHighestDepth());
} else if ((bodyShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(sniperScope_.x, sniperScope_.y);
sniperScope.swapDepths(this.getNextHighestDepth());
}
if (foreground.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.y);
sniperScope.swapDepths(this.getNextHighestDepth());
_parent.misses++;
}
if (_local4) {
checkLevelOver();
}
}
function cleanLevel(success) {
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:40});
Key.removeListener(myListener);
Mouse.removeListener(mouseListener);
gs.TweenFilterLite.killTweensOf(this.sniperScope.scope, 1);
gs.TweenFilterLite.killTweensOf(this.sniperScope, 1);
resetShots();
if (success) {
successMission();
} else {
failedMission();
}
}
function failedMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionFailed});
}
function missionFailed() {
_parent.menuToPlay = "missionFailed";
_parent.fader.play();
}
function successMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionComplete});
}
function missionComplete() {
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
function resetZoom() {
_parent.levelart._xscale = 100;
_parent.levelart._yscale = 100;
scopeZoom = false;
_parent.levelart._x = 0;
_parent.levelart._y = 0;
}
function scopeHideEnd() {
scopeHiding = false;
}
function convCoords(object, Enemy) {
var _local1 = new Object();
_local1.x = object._x;
_local1.y = object._y;
Enemy.localToGlobal(_local1);
return(_local1);
}
function distanceFromMouse(object) {
var _local1 = object._y - sniperScope._y;
var _local2 = object._x - sniperScope._x;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
return(_local3);
}
function abortMission() {
trace("MISSION ABORT");
_parent.failedReason = 16;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.soundtrack1Holder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatIrregularHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.rainHolder, 4, {volume:0});
}
function createExploder(startX, startY, floor) {
nCount++;
var life = 20;
var _local5 = 4 - (Math.random() * 8);
var _local4 = 4 - (Math.random() * 8);
var _local3 = Math.round(Math.random() * 100);
var _local2 = "explodePart" + nCount;
this.attachMovie("brains", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:_local3, _yscale:_local3});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
this[_local2].life = Math.round(Math.random() * 25);
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.dy = this.dy + 0.5;
if (this.counter >= this.life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 30) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
var _local2 = "bloodPart" + bCount;
this.attachMovie("blood", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:scale, _yscale:scale});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
var _local3 = Math.round(Math.random() * 80);
this[_local2]._xscale = _local3;
this[_local2]._yscale = _local3;
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
if ((this._y + (this._height / 2)) > floor) {
this._y = floor - (this._height / 2);
this.dy = this.dy * this.elasticity;
}
this.dy = this.dy + 0.5;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function smoker(smokex, smokey) {
smokeCount++;
var life = 150;
var _local2 = "smokePart" + smokeCount;
if (scopeZoom == false) {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
} else {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:_xmouse, _y:_ymouse, _xscale:50, _yscale:50});
}
this[_local2].onEnterFrame = function () {
this.counter++;
if (this.counter >= life) {
this._alpha = this._alpha - 1;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function checkLevelOver() {
trace("windowsBroken=" + windowsBroken);
if ((headShotArray[9] == true) && (!windowOpen)) {
windowOpen = true;
gs.TweenFilterLite.to(windowUp, 1, {delay:5, _y:windowUp._y - 30});
gs.TweenFilterLite.to(window8, 1, {delay:5, _y:window8._y - 30});
}
if (((headShotArray[10] == true) || (bodyShotArray[10] == true)) && (windowsBroken == false)) {
trace("windowsBrokenEnd=" + windowsBroken);
trace(headShotArray[10]);
trace(bodyShotArray[10]);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
cleanLevel(true);
}
if (windowsBroken) {
cleanLevel(false);
_parent.failedReason = 3;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
}
Mouse.hide();
var scopeWobble = 1;
var scopeWobbleBack = 1;
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
var scopeZoom = false;
var windowsBroken = false;
sniperScope.scope.blocked._visible = false;
_parent.brief.smallBrief.text = _root["onScreen" + _parent.mission];
resetShots();
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
if (!reload) {
_parent.shotsFired++;
_parent.gunShot.start(0, 1);
shotFired();
}
};
Mouse.addListener(mouseListener);
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_x:0, _y:0, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
var myListener = new Object();
myListener.onKeyDown = function () {
var _local3 = -_xmouse;
var _local2 = -_ymouse;
if ((Key.getCode() == 32) && (!scopeZoom)) {
_parent.levelart._xscale = 200;
_parent.levelart._yscale = 200;
scopeZoom = true;
_parent.levelart._x = _local3;
_parent.levelart._y = _local2;
_parent.zoomIn.start(0, 1);
} else if ((Key.getCode() == 32) && (scopeZoom)) {
resetZoom();
_parent.zoomOut.start(0, 1);
}
trace("scopeZoom=" + scopeZoom);
};
Key.addListener(myListener);
onEnterFrame = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
_parent.blob._x = point.x;
_parent.blob._y = point.y;
if (heartbeat) {
checkBeats();
}
if (explode) {
bombCheck();
}
if (checkVision) {
visionTest();
}
};
if (heartbeat) {
sniperScope.heartRate._visible = true;
} else {
sniperScope.heartRate._visible = true;
}
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
var lights = true;
var lightsNumber = 50;
var windows = true;
var windowsNumber = 20;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:70});
menOnLevel = 10;
initMission(menOnLevel);
var windowOpen = false;
var targetToHit = Array(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 2380 MovieClip Frame 1
this.blindtower = true;
this.blindguard = true;
Symbol 2392 MovieClip Frame 1
stop();
Symbol 2395 MovieClip Frame 1
stop();
Symbol 2398 MovieClip Frame 1
stop();
Symbol 2406 MovieClip Frame 1
this._visible = false;
stop();
Symbol 2406 MovieClip Frame 7
_parent.explode = true;
Symbol 2406 MovieClip Frame 8
_parent.explode = false;
Symbol 2437 MovieClip Frame 33
gotoAndPlay ("walk");
Symbol 2437 MovieClip Frame 115
gotoAndPlay ("run");
Symbol 2437 MovieClip Frame 159
stop();
Symbol 2437 MovieClip Frame 197
stop();
Symbol 2438 MovieClip Frame 427
_parent.bomb._visible = true;
_parent.bomb._y = -160;
Symbol 2438 MovieClip Frame 698
stop();
Symbol 2439 MovieClip Frame 1
function resetShots() {
i = 1;
while (i <= 20) {
headShotArray[i] = false;
bodyShotArray[i] = false;
i++;
}
}
function initMission(menOnLevel) {
var _local2 = 1;
while (_local2 <= menOnLevel) {
this["man" + _local2].alive = true;
trace((_local2 + ":live=") + this["man" + _local2].alive);
_local2++;
}
}
function newScopeMove(reloadFinished) {
if (reloadFinished) {
reload = false;
sniperScope.scope.blocked._visible = false;
}
breathCount++;
if ((breathCount % 2) == 0) {
_parent.breathIn.start(0, 1);
randomx = (Math.random() * scopeWobble) - (scopeWobble / 2);
randomy = (Math.random() * scopeWobble) - (scopeWobble / 2);
gs.TweenFilterLite.to(sniperScope.scope, 2, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
} else {
_parent.breathOut.start(0, 1);
randomx = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
randomy = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
gs.TweenFilterLite.to(sniperScope.scope, 4, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
}
}
function shotFired() {
sniperScope.scope.blocked._visible = true;
reload = true;
checkForHits();
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_y:sniperScope.scope._y - 60, ease:mx.transitions.easing.Strong.easeOut, onComplete:recoil});
}
function recoil() {
_parent.reloadGun.start(0, 1);
gs.TweenFilterLite.to(sniperScope.scope, 0.5, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (lights == true) {
var _local3 = 1;
while (_local3 <= lightsNumber) {
if (this["light" + _local3].collision.hitTest(point.x, point.y, 1)) {
this["light" + _local3].gotoAndStop("off");
_parent.lightsmash.start(0, 1);
_local4 = true;
break;
}
_local3++;
}
}
if (windows == true) {
var _local3 = 1;
while (_local3 <= windowsNumber) {
if (this["window" + _local3].hitTest(point.x, point.y, 1)) {
this["window" + _local3].gotoAndStop(2 + Math.round(Math.random() * 4));
if (thunder) {
_parent.windowsmash.setVolume(30);
} else {
_parent.windowsmash.setVolume(100);
}
_parent.windowsmash.start(0, 1);
windowsBroken = true;
_local4 = true;
break;
}
_local3++;
}
}
if (bombOnLevel == true) {
if (bomb.hitTest(point.x, point.y, 1)) {
_parent.headShots++;
bomb.play();
_local4 = true;
_local6 = true;
}
}
if (foreground.hitTest(point.x, point.y, 1) == false) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = true;
_local4 = true;
trace("bodyShot");
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = false;
headShotArray[_local3] = true;
_local4 = true;
}
if ((headShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.headShots++;
_local6 = true;
}
var _local5 = this["man" + _local3]._height;
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("headshot");
exploder(_local5);
sniperScope.swapDepths(this.getNextHighestDepth());
} else if ((bodyShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(sniperScope_.x, sniperScope_.y);
sniperScope.swapDepths(this.getNextHighestDepth());
}
if (foreground.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.y);
sniperScope.swapDepths(this.getNextHighestDepth());
_parent.misses++;
}
if (_local4) {
checkLevelOver();
}
}
function cleanLevel(success) {
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:40});
Key.removeListener(myListener);
Mouse.removeListener(mouseListener);
gs.TweenFilterLite.killTweensOf(this.sniperScope.scope, 1);
gs.TweenFilterLite.killTweensOf(this.sniperScope, 1);
resetShots();
if (success) {
successMission();
} else {
failedMission();
}
}
function failedMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionFailed});
}
function missionFailed() {
_parent.menuToPlay = "missionFailed";
_parent.fader.play();
}
function successMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionComplete});
}
function missionComplete() {
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
function resetZoom() {
_parent.levelart._xscale = 100;
_parent.levelart._yscale = 100;
scopeZoom = false;
_parent.levelart._x = 0;
_parent.levelart._y = 0;
}
function scopeHideEnd() {
scopeHiding = false;
}
function convCoords(object, Enemy) {
var _local1 = new Object();
_local1.x = object._x;
_local1.y = object._y;
Enemy.localToGlobal(_local1);
return(_local1);
}
function distanceFromMouse(object) {
var _local1 = object._y - sniperScope._y;
var _local2 = object._x - sniperScope._x;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
return(_local3);
}
function abortMission() {
trace("MISSION ABORT");
_parent.failedReason = 16;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.soundtrack1Holder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatIrregularHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.rainHolder, 4, {volume:0});
}
function createExploder(startX, startY, floor) {
nCount++;
var life = 20;
var _local5 = 4 - (Math.random() * 8);
var _local4 = 4 - (Math.random() * 8);
var _local3 = Math.round(Math.random() * 100);
var _local2 = "explodePart" + nCount;
this.attachMovie("brains", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:_local3, _yscale:_local3});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
this[_local2].life = Math.round(Math.random() * 25);
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.dy = this.dy + 0.5;
if (this.counter >= this.life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 30) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
var _local2 = "bloodPart" + bCount;
this.attachMovie("blood", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:scale, _yscale:scale});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
var _local3 = Math.round(Math.random() * 80);
this[_local2]._xscale = _local3;
this[_local2]._yscale = _local3;
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
if ((this._y + (this._height / 2)) > floor) {
this._y = floor - (this._height / 2);
this.dy = this.dy * this.elasticity;
}
this.dy = this.dy + 0.5;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function smoker(smokex, smokey) {
smokeCount++;
var life = 150;
var _local2 = "smokePart" + smokeCount;
if (scopeZoom == false) {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
} else {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:_xmouse, _y:_ymouse, _xscale:50, _yscale:50});
}
this[_local2].onEnterFrame = function () {
this.counter++;
if (this.counter >= life) {
this._alpha = this._alpha - 1;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function checkLevelOver() {
if ((((headShotArray[1] == true) || (bodyShotArray[1] == true)) && ((headShotArray[2] == true) || (bodyShotArray[2] == true))) && ((headShotArray[3] == true) || (bodyShotArray[3] == true))) {
trace("mission complete");
cleanLevel(true);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
if (((headShotArray[1] == true) || (bodyShotArray[1] == true)) && ((headShotArray[2] == false) || (bodyShotArray[2] == false))) {
trace("man1");
man2.man.gotoAndPlay("crouch");
man2.stop();
man3.man.gotoAndPlay("crouch");
man3.stop();
cleanLevel(false);
_parent.failedReason = 5;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
if (((headShotArray[2] == true) || (bodyShotArray[2] == true)) && ((headShotArray[1] == false) || (bodyShotArray[1] == false))) {
trace("man2");
man1.man.gotoAndPlay("crouch");
man1.stop();
man3.man.gotoAndPlay("crouch");
man3.stop();
cleanLevel(false);
_parent.failedReason = 5;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
if (((headShotArray[3] == true) || (bodyShotArray[3] == true)) && ((headShotArray[2] == false) || (bodyShotArray[2] == false))) {
trace("man3");
man1.man.gotoAndPlay("crouch");
man1.stop();
man2.man.gotoAndPlay("crouch");
man2.stop();
cleanLevel(false);
_parent.failedReason = 5;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
if ((headShotArray[4] == true) || (bodyShotArray[4] == true)) {
trace("man4");
cleanLevel(false);
_parent.failedReason = 4;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
}
function bombCheck() {
if (bomb.hitTest(man1) && (man1.alive)) {
man1.alive = false;
man1.stop();
man1.man.gotoAndPlay("bodyShot");
bodyShotArray[1] = true;
}
if (bomb.hitTest(man2) && (man2.alive)) {
man2.alive = false;
man2.stop();
man2.man.gotoAndPlay("bodyShot");
bodyShotArray[2] = true;
}
if (bomb.hitTest(man3) && (man3.alive)) {
man3.alive = false;
man3.stop();
man3.man.gotoAndPlay("bodyShot");
bodyShotArray[3] = true;
}
if (bomb.hitTest(man4) && (man4.alive)) {
man4.alive = false;
man4.stop();
man4.man.gotoAndPlay("bodyShot");
bodyShotArray[4] = true;
}
checkLevelOver();
}
Mouse.hide();
var scopeWobble = 1;
var scopeWobbleBack = 1;
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
var scopeZoom = false;
var windowsBroken = false;
sniperScope.scope.blocked._visible = false;
_parent.brief.smallBrief.text = _root["onScreen" + _parent.mission];
resetShots();
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
if (!reload) {
_parent.shotsFired++;
_parent.gunShot.start(0, 1);
shotFired();
}
};
Mouse.addListener(mouseListener);
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_x:0, _y:0, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
var myListener = new Object();
myListener.onKeyDown = function () {
var _local3 = -_xmouse;
var _local2 = -_ymouse;
if ((Key.getCode() == 32) && (!scopeZoom)) {
_parent.levelart._xscale = 200;
_parent.levelart._yscale = 200;
scopeZoom = true;
_parent.levelart._x = _local3;
_parent.levelart._y = _local2;
_parent.zoomIn.start(0, 1);
} else if ((Key.getCode() == 32) && (scopeZoom)) {
resetZoom();
_parent.zoomOut.start(0, 1);
}
trace("scopeZoom=" + scopeZoom);
};
Key.addListener(myListener);
onEnterFrame = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
_parent.blob._x = point.x;
_parent.blob._y = point.y;
if (heartbeat) {
checkBeats();
}
if (explode) {
bombCheck();
}
if (checkVision) {
visionTest();
}
};
if (heartbeat) {
sniperScope.heartRate._visible = true;
} else {
sniperScope.heartRate._visible = true;
}
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
menOnLevel = 4;
initMission(menOnLevel);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:70});
var lights = true;
var lightsNumber = 8;
var windows = true;
var windowsNumber = 2;
var bombOnLevel = true;
var explode = false;
var targetToHit = Array(0, 1, 1, 1, 0);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 2442 MovieClip Frame 1
stop();
Symbol 2553 MovieClip Frame 32
gotoAndPlay ("walk");
Symbol 2553 MovieClip Frame 79
stop();
Symbol 2553 MovieClip Frame 119
stop();
Symbol 2554 MovieClip Frame 1
stop();
var counter = 1;
onEnterFrame = function () {
counter++;
if (counter == myStart) {
gotoAndPlay(myStartFrame);
play();
delete eval (this.onEnterFrame());
}
};
Symbol 2554 MovieClip Frame 1699
_parent.levelEndFail();
stop();
Symbol 2556 MovieClip Frame 1
function resetShots() {
i = 1;
while (i <= 20) {
headShotArray[i] = false;
bodyShotArray[i] = false;
i++;
}
}
function initMission(menOnLevel) {
var _local2 = 1;
while (_local2 <= menOnLevel) {
this["man" + _local2].alive = true;
trace((_local2 + ":live=") + this["man" + _local2].alive);
_local2++;
}
}
function newScopeMove(reloadFinished) {
if (reloadFinished) {
reload = false;
sniperScope.scope.blocked._visible = false;
}
breathCount++;
if ((breathCount % 2) == 0) {
_parent.breathIn.start(0, 1);
randomx = (Math.random() * scopeWobble) - (scopeWobble / 2);
randomy = (Math.random() * scopeWobble) - (scopeWobble / 2);
gs.TweenFilterLite.to(sniperScope.scope, 2, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
} else {
_parent.breathOut.start(0, 1);
randomx = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
randomy = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
gs.TweenFilterLite.to(sniperScope.scope, 4, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
}
}
function shotFired() {
sniperScope.scope.blocked._visible = true;
reload = true;
checkForHits();
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_y:sniperScope.scope._y - 60, ease:mx.transitions.easing.Strong.easeOut, onComplete:recoil});
}
function recoil() {
_parent.reloadGun.start(0, 1);
gs.TweenFilterLite.to(sniperScope.scope, 0.5, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (lights == true) {
var _local3 = 1;
while (_local3 <= lightsNumber) {
if (this["light" + _local3].collision.hitTest(point.x, point.y, 1)) {
this["light" + _local3].gotoAndStop("off");
_parent.lightsmash.start(0, 1);
_local4 = true;
break;
}
_local3++;
}
}
if (windows == true) {
var _local3 = 1;
while (_local3 <= windowsNumber) {
if (this["window" + _local3].hitTest(point.x, point.y, 1)) {
this["window" + _local3].gotoAndStop(2 + Math.round(Math.random() * 4));
if (thunder) {
_parent.windowsmash.setVolume(30);
} else {
_parent.windowsmash.setVolume(100);
}
_parent.windowsmash.start(0, 1);
windowsBroken = true;
_local4 = true;
break;
}
_local3++;
}
}
if (bombOnLevel == true) {
if (bomb.hitTest(point.x, point.y, 1)) {
_parent.headShots++;
bomb.play();
_local4 = true;
_local6 = true;
}
}
if (foreground.hitTest(point.x, point.y, 1) == false) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = true;
_local4 = true;
trace("bodyShot");
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = false;
headShotArray[_local3] = true;
_local4 = true;
}
if ((headShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.headShots++;
_local6 = true;
}
var _local5 = this["man" + _local3]._height;
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("headshot");
exploder(_local5);
sniperScope.swapDepths(this.getNextHighestDepth());
} else if ((bodyShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(sniperScope_.x, sniperScope_.y);
sniperScope.swapDepths(this.getNextHighestDepth());
}
if (foreground.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.y);
sniperScope.swapDepths(this.getNextHighestDepth());
_parent.misses++;
}
if (_local4) {
checkLevelOver();
}
}
function cleanLevel(success) {
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:40});
Key.removeListener(myListener);
Mouse.removeListener(mouseListener);
gs.TweenFilterLite.killTweensOf(this.sniperScope.scope, 1);
gs.TweenFilterLite.killTweensOf(this.sniperScope, 1);
resetShots();
if (success) {
successMission();
} else {
failedMission();
}
}
function failedMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionFailed});
}
function missionFailed() {
_parent.menuToPlay = "missionFailed";
_parent.fader.play();
}
function successMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionComplete});
}
function missionComplete() {
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
function resetZoom() {
_parent.levelart._xscale = 100;
_parent.levelart._yscale = 100;
scopeZoom = false;
_parent.levelart._x = 0;
_parent.levelart._y = 0;
}
function scopeHideEnd() {
scopeHiding = false;
}
function convCoords(object, Enemy) {
var _local1 = new Object();
_local1.x = object._x;
_local1.y = object._y;
Enemy.localToGlobal(_local1);
return(_local1);
}
function distanceFromMouse(object) {
var _local1 = object._y - sniperScope._y;
var _local2 = object._x - sniperScope._x;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
return(_local3);
}
function abortMission() {
trace("MISSION ABORT");
_parent.failedReason = 16;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.soundtrack1Holder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatIrregularHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.rainHolder, 4, {volume:0});
}
function createExploder(startX, startY, floor) {
nCount++;
var life = 20;
var _local5 = 4 - (Math.random() * 8);
var _local4 = 4 - (Math.random() * 8);
var _local3 = Math.round(Math.random() * 100);
var _local2 = "explodePart" + nCount;
this.attachMovie("brains", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:_local3, _yscale:_local3});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
this[_local2].life = Math.round(Math.random() * 25);
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.dy = this.dy + 0.5;
if (this.counter >= this.life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 30) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
var _local2 = "bloodPart" + bCount;
this.attachMovie("blood", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:scale, _yscale:scale});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
var _local3 = Math.round(Math.random() * 80);
this[_local2]._xscale = _local3;
this[_local2]._yscale = _local3;
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
if ((this._y + (this._height / 2)) > floor) {
this._y = floor - (this._height / 2);
this.dy = this.dy * this.elasticity;
}
this.dy = this.dy + 0.5;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function smoker(smokex, smokey) {
smokeCount++;
var life = 150;
var _local2 = "smokePart" + smokeCount;
if (scopeZoom == false) {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
} else {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:_xmouse, _y:_ymouse, _xscale:50, _yscale:50});
}
this[_local2].onEnterFrame = function () {
this.counter++;
if (this.counter >= life) {
this._alpha = this._alpha - 1;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function checkLevelOver() {
if ((window3._currentframe != 1) && (!windowSmash3)) {
lightWall1._visible = true;
windowSmash3 = true;
walls.nextFrame();
}
if ((window1._currentframe != 1) && (!windowSmash1)) {
lightWall2._visible = true;
windowSmash1 = true;
walls.nextFrame();
}
if ((window2._currentframe != 1) && (!windowSmash2)) {
lightWall2._visible = true;
windowSmash2 = true;
walls.nextFrame();
}
if ((window4._currentframe != 1) && (!windowSmash4)) {
lightWall3._visible = true;
windowSmash4 = true;
walls.nextFrame();
}
if ((window5._currentframe != 1) && (!windowSmash5)) {
lightWall4._visible = true;
windowSmash5 = true;
walls.nextFrame();
}
if ((window6._currentframe != 1) && (!windowSmash6)) {
lightWall5._visible = true;
windowSmash6 = true;
walls.nextFrame();
}
if ((((((((((headShotArray[1] == true) || (bodyShotArray[1] == true)) && ((headShotArray[2] == true) || (bodyShotArray[2] == true))) && ((headShotArray[3] == true) || (bodyShotArray[3] == true))) && ((headShotArray[4] == true) || (bodyShotArray[4] == true))) && ((headShotArray[5] == true) || (bodyShotArray[5] == true))) && ((headShotArray[6] == true) || (bodyShotArray[6] == true))) && ((headShotArray[7] == true) || (bodyShotArray[7] == true))) && ((headShotArray[8] == true) || (bodyShotArray[8] == true))) && ((headShotArray[9] == true) || (bodyShotArray[9] == true))) {
clearSounds();
_parent.bonus = _parent.bonus + (_parent.countdown.seconds * 10);
_parent.countdown.finished = true;
cleanLevel(true);
}
}
function clearSounds() {
gs.TweenFilterLite.to(_parent.soundtrack1Holder, 4, {volume:0});
}
function levelEndFail() {
_parent.failedReason = 6;
clearSounds();
cleanLevel(false);
}
function levelEnd() {
clearSounds();
cleanLevel(true);
}
Mouse.hide();
var scopeWobble = 1;
var scopeWobbleBack = 1;
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
var scopeZoom = false;
var windowsBroken = false;
sniperScope.scope.blocked._visible = false;
_parent.brief.smallBrief.text = _root["onScreen" + _parent.mission];
resetShots();
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
if (!reload) {
_parent.shotsFired++;
_parent.gunShot.start(0, 1);
shotFired();
}
};
Mouse.addListener(mouseListener);
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_x:0, _y:0, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
var myListener = new Object();
myListener.onKeyDown = function () {
var _local3 = -_xmouse;
var _local2 = -_ymouse;
if ((Key.getCode() == 32) && (!scopeZoom)) {
_parent.levelart._xscale = 200;
_parent.levelart._yscale = 200;
scopeZoom = true;
_parent.levelart._x = _local3;
_parent.levelart._y = _local2;
_parent.zoomIn.start(0, 1);
} else if ((Key.getCode() == 32) && (scopeZoom)) {
resetZoom();
_parent.zoomOut.start(0, 1);
}
trace("scopeZoom=" + scopeZoom);
};
Key.addListener(myListener);
onEnterFrame = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
_parent.blob._x = point.x;
_parent.blob._y = point.y;
if (heartbeat) {
checkBeats();
}
if (explode) {
bombCheck();
}
if (checkVision) {
visionTest();
}
};
if (heartbeat) {
sniperScope.heartRate._visible = true;
} else {
sniperScope.heartRate._visible = true;
}
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
menOnLevel = 9;
_parent.countdown.seconds = 90;
initMission(menOnLevel);
var lights = true;
var lightsNumber = 8;
var windows = true;
var windowsNumber = 6;
gs.TweenFilterLite.to(_parent.soundtrack1Holder, 4, {volume:40});
var manStarts = Array(0, 60, 160, 200, 350, 450, 550, 650, 760, 860);
var manStartsFrame = Array(0, 0, 650, 0, 330, 900, 330, 1050, 650, 900);
var targetToHit = Array(0, 1, 1, 1, 1, 1, 1, 1, 1, 1);
var i = 1;
while (i <= 5) {
this["lightWall" + i]._visible = false;
i++;
}
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
this["man" + i].stop();
this["man" + i].myStart = manStarts[i];
this["man" + i].myStartFrame = manStartsFrame[i];
i++;
}
Symbol 2561 MovieClip Frame 1
man.stop();
seeing = true;
Symbol 2561 MovieClip Frame 150
man.gotoAndPlay("walk");
Symbol 2561 MovieClip Frame 272
man.gotoAndPlay("turn");
Symbol 2561 MovieClip Frame 301
seeing = false;
Symbol 2561 MovieClip Frame 424
man.stop();
Symbol 2561 MovieClip Frame 523
man.gotoAndPlay("turn");
Symbol 2561 MovieClip Frame 550
seeing = true;
gotoAndPlay (145);
Symbol 2564 MovieClip Frame 1
stop();
Symbol 2572 MovieClip Frame 1
stop();
Symbol 2572 MovieClip Frame 36
stop();
Symbol 2573 MovieClip Frame 1
stop();
Symbol 2573 MovieClip Frame 10
stop();
Symbol 2574 MovieClip Frame 1
function resetShots() {
i = 1;
while (i <= 20) {
headShotArray[i] = false;
bodyShotArray[i] = false;
i++;
}
}
function initMission(menOnLevel) {
var _local2 = 1;
while (_local2 <= menOnLevel) {
this["man" + _local2].alive = true;
trace((_local2 + ":live=") + this["man" + _local2].alive);
_local2++;
}
}
function newScopeMove(reloadFinished) {
if (reloadFinished) {
reload = false;
sniperScope.scope.blocked._visible = false;
}
breathCount++;
if ((breathCount % 2) == 0) {
_parent.breathIn.start(0, 1);
randomx = (Math.random() * scopeWobble) - (scopeWobble / 2);
randomy = (Math.random() * scopeWobble) - (scopeWobble / 2);
gs.TweenFilterLite.to(sniperScope.scope, 2, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
} else {
_parent.breathOut.start(0, 1);
randomx = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
randomy = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
gs.TweenFilterLite.to(sniperScope.scope, 4, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
}
}
function shotFired() {
sniperScope.scope.blocked._visible = true;
reload = true;
checkForHits();
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_y:sniperScope.scope._y - 60, ease:mx.transitions.easing.Strong.easeOut, onComplete:recoil});
}
function recoil() {
_parent.reloadGun.start(0, 1);
gs.TweenFilterLite.to(sniperScope.scope, 0.5, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (lights == true) {
var _local3 = 1;
while (_local3 <= lightsNumber) {
if (this["light" + _local3].collision.hitTest(point.x, point.y, 1)) {
this["light" + _local3].gotoAndStop("off");
_parent.lightsmash.start(0, 1);
_local4 = true;
break;
}
_local3++;
}
}
if (windows == true) {
var _local3 = 1;
while (_local3 <= windowsNumber) {
if (this["window" + _local3].hitTest(point.x, point.y, 1)) {
this["window" + _local3].gotoAndStop(2 + Math.round(Math.random() * 4));
if (thunder) {
_parent.windowsmash.setVolume(30);
} else {
_parent.windowsmash.setVolume(100);
}
_parent.windowsmash.start(0, 1);
windowsBroken = true;
_local4 = true;
break;
}
_local3++;
}
}
if (bombOnLevel == true) {
if (bomb.hitTest(point.x, point.y, 1)) {
_parent.headShots++;
bomb.play();
_local4 = true;
_local6 = true;
}
}
if (foreground.hitTest(point.x, point.y, 1) == false) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = true;
_local4 = true;
trace("bodyShot");
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = false;
headShotArray[_local3] = true;
_local4 = true;
}
if ((headShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.headShots++;
_local6 = true;
}
var _local5 = this["man" + _local3]._height;
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("headshot");
exploder(_local5);
sniperScope.swapDepths(this.getNextHighestDepth());
} else if ((bodyShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(sniperScope_.x, sniperScope_.y);
sniperScope.swapDepths(this.getNextHighestDepth());
}
if (foreground.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.y);
sniperScope.swapDepths(this.getNextHighestDepth());
_parent.misses++;
}
if (_local4) {
checkLevelOver();
}
}
function cleanLevel(success) {
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:40});
Key.removeListener(myListener);
Mouse.removeListener(mouseListener);
gs.TweenFilterLite.killTweensOf(this.sniperScope.scope, 1);
gs.TweenFilterLite.killTweensOf(this.sniperScope, 1);
resetShots();
if (success) {
successMission();
} else {
failedMission();
}
}
function failedMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionFailed});
}
function missionFailed() {
_parent.menuToPlay = "missionFailed";
_parent.fader.play();
}
function successMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionComplete});
}
function missionComplete() {
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
function resetZoom() {
_parent.levelart._xscale = 100;
_parent.levelart._yscale = 100;
scopeZoom = false;
_parent.levelart._x = 0;
_parent.levelart._y = 0;
}
function scopeHideEnd() {
scopeHiding = false;
}
function convCoords(object, Enemy) {
var _local1 = new Object();
_local1.x = object._x;
_local1.y = object._y;
Enemy.localToGlobal(_local1);
return(_local1);
}
function distanceFromMouse(object) {
var _local1 = object._y - sniperScope._y;
var _local2 = object._x - sniperScope._x;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
return(_local3);
}
function abortMission() {
trace("MISSION ABORT");
_parent.failedReason = 16;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.soundtrack1Holder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatIrregularHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.rainHolder, 4, {volume:0});
}
function createExploder(startX, startY, floor) {
nCount++;
var life = 20;
var _local5 = 4 - (Math.random() * 8);
var _local4 = 4 - (Math.random() * 8);
var _local3 = Math.round(Math.random() * 100);
var _local2 = "explodePart" + nCount;
this.attachMovie("brains", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:_local3, _yscale:_local3});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
this[_local2].life = Math.round(Math.random() * 25);
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.dy = this.dy + 0.5;
if (this.counter >= this.life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 30) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
var _local2 = "bloodPart" + bCount;
this.attachMovie("blood", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:scale, _yscale:scale});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
var _local3 = Math.round(Math.random() * 80);
this[_local2]._xscale = _local3;
this[_local2]._yscale = _local3;
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
if ((this._y + (this._height / 2)) > floor) {
this._y = floor - (this._height / 2);
this.dy = this.dy * this.elasticity;
}
this.dy = this.dy + 0.5;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function smoker(smokex, smokey) {
smokeCount++;
var life = 150;
var _local2 = "smokePart" + smokeCount;
if (scopeZoom == false) {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
} else {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:_xmouse, _y:_ymouse, _xscale:50, _yscale:50});
}
this[_local2].onEnterFrame = function () {
this.counter++;
if (this.counter >= life) {
this._alpha = this._alpha - 1;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function checkLevelOver() {
if ((headShotArray[3] == 1) || (bodyShotArray[3] == 1)) {
if (man1.seeing) {
trace("gameover on man test");
}
man3.gotoAndStop("off");
}
if ((headShotArray[5] == 1) || (bodyShotArray[5] == 1)) {
if (man1.seeing) {
gameOverCondition();
}
man5.gotoAndStop("off");
}
if ((headShotArray[1] == 1) || (bodyShotArray[1] == 1)) {
if (man3.vision.hitTest(man1)) {
gameOverCondition();
}
}
if ((headShotArray[2] == 1) || (bodyShotArray[2] == 1)) {
man2.gotoAndStop("off");
}
if ((headShotArray[3] == 1) || (bodyShotArray[3] == 1)) {
if (man2.vision.hitTest(man3)) {
gameOverCondition();
}
}
if ((headShotArray[4] == 1) || (bodyShotArray[4] == 1)) {
if (man5.vision.hitTest(man4)) {
gameOverCondition();
}
man4.gotoAndStop("off");
}
if ((((((headShotArray[1] == 1) || (bodyShotArray[1] == 1)) && ((headShotArray[2] == 1) || (bodyShotArray[2] == 1))) && ((headShotArray[3] == 1) || (bodyShotArray[3] == 1))) && ((headShotArray[4] == 1) || (bodyShotArray[4] == 1))) && ((headShotArray[5] == 1) || (bodyShotArray[5] == 1))) {
cleanLevel(true);
fadeSound();
}
}
function visionTest() {
if ((((headShotArray[3] == 1) || (bodyShotArray[3] == 1)) || ((headShotArray[3] == 1) || (bodyShotArray[3] == 1))) && (man1.seeing)) {
man1.stop();
man1.man.gotoAndPlay("crouch");
gameOverCondition();
}
}
function gameOverCondition() {
_parent.failedReason = 17;
_parent.alarm.start(0, 1);
cleanLevel(false);
fadeSound();
}
function fadeSound() {
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
}
Mouse.hide();
var scopeWobble = 1;
var scopeWobbleBack = 1;
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
var scopeZoom = false;
var windowsBroken = false;
sniperScope.scope.blocked._visible = false;
_parent.brief.smallBrief.text = _root["onScreen" + _parent.mission];
resetShots();
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
if (!reload) {
_parent.shotsFired++;
_parent.gunShot.start(0, 1);
shotFired();
}
};
Mouse.addListener(mouseListener);
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_x:0, _y:0, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
var myListener = new Object();
myListener.onKeyDown = function () {
var _local3 = -_xmouse;
var _local2 = -_ymouse;
if ((Key.getCode() == 32) && (!scopeZoom)) {
_parent.levelart._xscale = 200;
_parent.levelart._yscale = 200;
scopeZoom = true;
_parent.levelart._x = _local3;
_parent.levelart._y = _local2;
_parent.zoomIn.start(0, 1);
} else if ((Key.getCode() == 32) && (scopeZoom)) {
resetZoom();
_parent.zoomOut.start(0, 1);
}
trace("scopeZoom=" + scopeZoom);
};
Key.addListener(myListener);
onEnterFrame = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
_parent.blob._x = point.x;
_parent.blob._y = point.y;
if (heartbeat) {
checkBeats();
}
if (explode) {
bombCheck();
}
if (checkVision) {
visionTest();
}
};
if (heartbeat) {
sniperScope.heartRate._visible = true;
} else {
sniperScope.heartRate._visible = true;
}
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
var lights = true;
var lightsNumber = 3;
var windows = true;
var windowsNumber = 3;
var checkVision = true;
var menOnLevel = 5;
initMission(menOnLevel);
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:50});
var targetToHit = Array(0, 1, 1, 1, 1, 1);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 2589 MovieClip Frame 1
stop();
Symbol 2611 MovieClip Frame 1
gotoAndPlay(Math.round(Math.random() * 40));
Symbol 2611 MovieClip Frame 40
gotoAndPlay (2);
Symbol 2614 MovieClip Frame 1
stop();
Symbol 2614 MovieClip Frame 14
stop();
Symbol 2622 MovieClip Frame 2
man.stop();
stop();
Symbol 2622 MovieClip Frame 142
man.gotoAndStop("idle");
Symbol 2622 MovieClip Frame 317
man.gotoAndPlay("walk");
Symbol 2622 MovieClip Frame 489
man.halfTurn = true;
man.gotoAndPlay("turn");
Symbol 2622 MovieClip Frame 509
stop();
man.stop();
_parent.transmit1._visible = true;
_parent.transmit2._visible = true;
_parent.transmit3._visible = true;
_parent.serverHacked = true;
Symbol 2623 MovieClip Frame 1
stop();
Symbol 2624 MovieClip Frame 1
stop();
Symbol 2624 MovieClip Frame 10
stop();
_parent.cameraOff = true;
Symbol 2625 MovieClip Frame 1
man.stop();
seeing = true;
Symbol 2625 MovieClip Frame 150
man.gotoAndPlay("walk");
Symbol 2625 MovieClip Frame 194
_parent.cameraCanSee = true;
Symbol 2625 MovieClip Frame 272
man.gotoAndPlay("turn");
Symbol 2625 MovieClip Frame 301
seeing = false;
Symbol 2625 MovieClip Frame 380
_parent.cameraCanSee = false;
Symbol 2625 MovieClip Frame 424
man.stop();
Symbol 2625 MovieClip Frame 523
man.gotoAndPlay("turn");
Symbol 2625 MovieClip Frame 550
seeing = true;
gotoAndPlay (145);
Symbol 2631 MovieClip Frame 1
function resetShots() {
i = 1;
while (i <= 20) {
headShotArray[i] = false;
bodyShotArray[i] = false;
i++;
}
}
function initMission(menOnLevel) {
var _local2 = 1;
while (_local2 <= menOnLevel) {
this["man" + _local2].alive = true;
trace((_local2 + ":live=") + this["man" + _local2].alive);
_local2++;
}
}
function newScopeMove(reloadFinished) {
if (reloadFinished) {
reload = false;
sniperScope.scope.blocked._visible = false;
}
breathCount++;
if ((breathCount % 2) == 0) {
_parent.breathIn.start(0, 1);
randomx = (Math.random() * scopeWobble) - (scopeWobble / 2);
randomy = (Math.random() * scopeWobble) - (scopeWobble / 2);
gs.TweenFilterLite.to(sniperScope.scope, 2, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
} else {
_parent.breathOut.start(0, 1);
randomx = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
randomy = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
gs.TweenFilterLite.to(sniperScope.scope, 4, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
}
}
function shotFired() {
sniperScope.scope.blocked._visible = true;
reload = true;
checkForHits();
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_y:sniperScope.scope._y - 60, ease:mx.transitions.easing.Strong.easeOut, onComplete:recoil});
}
function recoil() {
_parent.reloadGun.start(0, 1);
gs.TweenFilterLite.to(sniperScope.scope, 0.5, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (lights == true) {
var _local3 = 1;
while (_local3 <= lightsNumber) {
if (this["light" + _local3].collision.hitTest(point.x, point.y, 1)) {
this["light" + _local3].gotoAndStop("off");
_parent.lightsmash.start(0, 1);
_local4 = true;
break;
}
_local3++;
}
}
if (windows == true) {
var _local3 = 1;
while (_local3 <= windowsNumber) {
if (this["window" + _local3].hitTest(point.x, point.y, 1)) {
this["window" + _local3].gotoAndStop(2 + Math.round(Math.random() * 4));
if (thunder) {
_parent.windowsmash.setVolume(30);
} else {
_parent.windowsmash.setVolume(100);
}
_parent.windowsmash.start(0, 1);
windowsBroken = true;
_local4 = true;
break;
}
_local3++;
}
}
if (bombOnLevel == true) {
if (bomb.hitTest(point.x, point.y, 1)) {
_parent.headShots++;
bomb.play();
_local4 = true;
_local6 = true;
}
}
if (foreground.hitTest(point.x, point.y, 1) == false) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = true;
_local4 = true;
trace("bodyShot");
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = false;
headShotArray[_local3] = true;
_local4 = true;
}
if ((headShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.headShots++;
_local6 = true;
}
var _local5 = this["man" + _local3]._height;
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("headshot");
exploder(_local5);
sniperScope.swapDepths(this.getNextHighestDepth());
} else if ((bodyShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(sniperScope_.x, sniperScope_.y);
sniperScope.swapDepths(this.getNextHighestDepth());
}
if (foreground.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.y);
sniperScope.swapDepths(this.getNextHighestDepth());
_parent.misses++;
}
if (_local4) {
checkLevelOver();
}
}
function cleanLevel(success) {
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:40});
Key.removeListener(myListener);
Mouse.removeListener(mouseListener);
gs.TweenFilterLite.killTweensOf(this.sniperScope.scope, 1);
gs.TweenFilterLite.killTweensOf(this.sniperScope, 1);
resetShots();
if (success) {
successMission();
} else {
failedMission();
}
}
function failedMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionFailed});
}
function missionFailed() {
_parent.menuToPlay = "missionFailed";
_parent.fader.play();
}
function successMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionComplete});
}
function missionComplete() {
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
function resetZoom() {
_parent.levelart._xscale = 100;
_parent.levelart._yscale = 100;
scopeZoom = false;
_parent.levelart._x = 0;
_parent.levelart._y = 0;
}
function scopeHideEnd() {
scopeHiding = false;
}
function convCoords(object, Enemy) {
var _local1 = new Object();
_local1.x = object._x;
_local1.y = object._y;
Enemy.localToGlobal(_local1);
return(_local1);
}
function distanceFromMouse(object) {
var _local1 = object._y - sniperScope._y;
var _local2 = object._x - sniperScope._x;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
return(_local3);
}
function abortMission() {
trace("MISSION ABORT");
_parent.failedReason = 16;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.soundtrack1Holder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatIrregularHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.rainHolder, 4, {volume:0});
}
function createExploder(startX, startY, floor) {
nCount++;
var life = 20;
var _local5 = 4 - (Math.random() * 8);
var _local4 = 4 - (Math.random() * 8);
var _local3 = Math.round(Math.random() * 100);
var _local2 = "explodePart" + nCount;
this.attachMovie("brains", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:_local3, _yscale:_local3});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
this[_local2].life = Math.round(Math.random() * 25);
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.dy = this.dy + 0.5;
if (this.counter >= this.life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 30) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
var _local2 = "bloodPart" + bCount;
this.attachMovie("blood", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:scale, _yscale:scale});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
var _local3 = Math.round(Math.random() * 80);
this[_local2]._xscale = _local3;
this[_local2]._yscale = _local3;
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
if ((this._y + (this._height / 2)) > floor) {
this._y = floor - (this._height / 2);
this.dy = this.dy * this.elasticity;
}
this.dy = this.dy + 0.5;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function smoker(smokex, smokey) {
smokeCount++;
var life = 150;
var _local2 = "smokePart" + smokeCount;
if (scopeZoom == false) {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
} else {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:_xmouse, _y:_ymouse, _xscale:50, _yscale:50});
}
this[_local2].onEnterFrame = function () {
this.counter++;
if (this.counter >= life) {
this._alpha = this._alpha - 1;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function checkLevelOver() {
if (((((headShotArray[1] == 1) || (bodyShotArray[1] == 1)) && ((headShotArray[6] == 1) || (bodyShotArray[6] == 1))) && ((headShotArray[9] == 1) || (bodyShotArray[9] == 1))) && (serverHacked)) {
cleanLevel(true);
gs.TweenFilterLite.to(_parent.cityHolder, 3, {volume:0});
}
if ((((((headShotArray[3] == 1) || (bodyShotArray[3] == 1)) || ((headShotArray[5] == 1) || (bodyShotArray[5] == 1))) || ((headShotArray[4] == 1) || (bodyShotArray[4] == 1))) || ((headShotArray[7] == 1) || (bodyShotArray[7] == 1))) || ((headShotArray[8] == 1) || (bodyShotArray[8] == 1))) {
_parent.failedReason = 9;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 3, {volume:0});
}
if ((((bodyShotArray[10] == 1) || (bodyShotArray[11] == 1)) || (bodyShotArray[12] == 1)) || (bodyShotArray[13] == 1)) {
_parent.failedReason = 12;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 3, {volume:0});
}
if ((bodyShotArray[2] == 1) || (headShotArray[2] == 1)) {
_parent.failedReason = 4;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 3, {volume:0});
}
if ((headShotArray[14] == 1) || (bodyShotArray[14] == 1)) {
guardKilled = true;
if (cameraCanSee) {
_parent.alarm.start(0, 1);
_parent.failedReason = 10;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 3, {volume:0});
}
}
if ((headShotArray[15] == 1) || ((bodyShotArray[15] == 1) && (!guardKilled))) {
man14.stop();
man14.gotoAndPlay("crouch");
_parent.alarm.start(0, 1);
_parent.failedReason = 11;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 3, {volume:0});
}
if ((headShotArray[15] == 1) || (bodyShotArray[15])) {
man15.gotoAndStop("off");
}
if ((((headShotArray[15] == 1) || (bodyShotArray[15])) && ((headShotArray[14] == 1) || (bodyShotArray[14]))) && (!serverOpen)) {
serverOpen = true;
man2.play();
}
}
Mouse.hide();
var scopeWobble = 1;
var scopeWobbleBack = 1;
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
var scopeZoom = false;
var windowsBroken = false;
sniperScope.scope.blocked._visible = false;
_parent.brief.smallBrief.text = _root["onScreen" + _parent.mission];
resetShots();
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
if (!reload) {
_parent.shotsFired++;
_parent.gunShot.start(0, 1);
shotFired();
}
};
Mouse.addListener(mouseListener);
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_x:0, _y:0, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
var myListener = new Object();
myListener.onKeyDown = function () {
var _local3 = -_xmouse;
var _local2 = -_ymouse;
if ((Key.getCode() == 32) && (!scopeZoom)) {
_parent.levelart._xscale = 200;
_parent.levelart._yscale = 200;
scopeZoom = true;
_parent.levelart._x = _local3;
_parent.levelart._y = _local2;
_parent.zoomIn.start(0, 1);
} else if ((Key.getCode() == 32) && (scopeZoom)) {
resetZoom();
_parent.zoomOut.start(0, 1);
}
trace("scopeZoom=" + scopeZoom);
};
Key.addListener(myListener);
onEnterFrame = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
_parent.blob._x = point.x;
_parent.blob._y = point.y;
if (heartbeat) {
checkBeats();
}
if (explode) {
bombCheck();
}
if (checkVision) {
visionTest();
}
};
if (heartbeat) {
sniperScope.heartRate._visible = true;
} else {
sniperScope.heartRate._visible = true;
}
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:70});
targetToHit = 1;
menOnLevel = 15;
var lights = true;
var lightsNumber = 3;
var windows = true;
var windowsNumber = 45;
var serverHacked = false;
var cameraOff = false;
var guardKilled = false;
var cameraCanSee = false;
var serverOpen = false;
var i = 1;
while (i <= 3) {
this["transmit" + i]._visible = false;
i++;
}
initMission(menOnLevel);
var targetToHit = Array(0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 2736 MovieClip Frame 33
gotoAndPlay ("walk");
Symbol 2736 MovieClip Frame 76
stop();
Symbol 2736 MovieClip Frame 133
stop();
Symbol 2736 MovieClip Frame 136
stop();
Symbol 2736 MovieClip Frame 196
stop();
Symbol 2738 MovieClip Frame 1
stop();
this._visible = false;
Symbol 2738 MovieClip Frame 19
this._visible = true;
Symbol 2738 MovieClip Frame 33
man.gotoAndPlay("walk");
Symbol 2738 MovieClip Frame 74
man.gotoAndPlay("walktoRun");
Symbol 2738 MovieClip Frame 341
stop();
_parent.cleanLevel(false);
_parent._parent.failedReason = 3;
Symbol 2906 MovieClip Frame 81
gotoAndPlay ("idle");
Symbol 2906 MovieClip Frame 136
stop();
Symbol 2906 MovieClip Frame 191
stop();
Symbol 2906 MovieClip Frame 205
stop();
Symbol 3003 MovieClip Frame 81
gotoAndPlay ("idle");
Symbol 3003 MovieClip Frame 126
stop();
Symbol 3003 MovieClip Frame 136
stop();
Symbol 3003 MovieClip Frame 205
stop();
Symbol 3007 MovieClip Frame 1
function resetShots() {
i = 1;
while (i <= 20) {
headShotArray[i] = false;
bodyShotArray[i] = false;
i++;
}
}
function initMission(menOnLevel) {
var _local2 = 1;
while (_local2 <= menOnLevel) {
this["man" + _local2].alive = true;
trace((_local2 + ":live=") + this["man" + _local2].alive);
_local2++;
}
}
function newScopeMove(reloadFinished) {
if (reloadFinished) {
reload = false;
sniperScope.scope.blocked._visible = false;
}
breathCount++;
if ((breathCount % 2) == 0) {
_parent.breathIn.start(0, 1);
randomx = (Math.random() * scopeWobble) - (scopeWobble / 2);
randomy = (Math.random() * scopeWobble) - (scopeWobble / 2);
gs.TweenFilterLite.to(sniperScope.scope, 2, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
} else {
_parent.breathOut.start(0, 1);
randomx = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
randomy = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
gs.TweenFilterLite.to(sniperScope.scope, 4, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
}
}
function shotFired() {
sniperScope.scope.blocked._visible = true;
reload = true;
checkForHits();
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_y:sniperScope.scope._y - 60, ease:mx.transitions.easing.Strong.easeOut, onComplete:recoil});
}
function recoil() {
_parent.reloadGun.start(0, 1);
gs.TweenFilterLite.to(sniperScope.scope, 0.5, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (lights == true) {
var _local3 = 1;
while (_local3 <= lightsNumber) {
if (this["light" + _local3].collision.hitTest(point.x, point.y, 1)) {
this["light" + _local3].gotoAndStop("off");
_parent.lightsmash.start(0, 1);
_local4 = true;
break;
}
_local3++;
}
}
if (windows == true) {
var _local3 = 1;
while (_local3 <= windowsNumber) {
if (this["window" + _local3].hitTest(point.x, point.y, 1)) {
this["window" + _local3].gotoAndStop(2 + Math.round(Math.random() * 4));
if (thunder) {
_parent.windowsmash.setVolume(30);
} else {
_parent.windowsmash.setVolume(100);
}
_parent.windowsmash.start(0, 1);
windowsBroken = true;
_local4 = true;
break;
}
_local3++;
}
}
if (bombOnLevel == true) {
if (bomb.hitTest(point.x, point.y, 1)) {
_parent.headShots++;
bomb.play();
_local4 = true;
_local6 = true;
}
}
if (foreground.hitTest(point.x, point.y, 1) == false) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = true;
_local4 = true;
trace("bodyShot");
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = false;
headShotArray[_local3] = true;
_local4 = true;
}
if ((headShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.headShots++;
_local6 = true;
}
var _local5 = this["man" + _local3]._height;
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("headshot");
exploder(_local5);
sniperScope.swapDepths(this.getNextHighestDepth());
} else if ((bodyShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(sniperScope_.x, sniperScope_.y);
sniperScope.swapDepths(this.getNextHighestDepth());
}
if (foreground.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.y);
sniperScope.swapDepths(this.getNextHighestDepth());
_parent.misses++;
}
if (_local4) {
checkLevelOver();
}
}
function cleanLevel(success) {
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:40});
Key.removeListener(myListener);
Mouse.removeListener(mouseListener);
gs.TweenFilterLite.killTweensOf(this.sniperScope.scope, 1);
gs.TweenFilterLite.killTweensOf(this.sniperScope, 1);
resetShots();
if (success) {
successMission();
} else {
failedMission();
}
}
function failedMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionFailed});
}
function missionFailed() {
_parent.menuToPlay = "missionFailed";
_parent.fader.play();
}
function successMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionComplete});
}
function missionComplete() {
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
function resetZoom() {
_parent.levelart._xscale = 100;
_parent.levelart._yscale = 100;
scopeZoom = false;
_parent.levelart._x = 0;
_parent.levelart._y = 0;
}
function scopeHideEnd() {
scopeHiding = false;
}
function convCoords(object, Enemy) {
var _local1 = new Object();
_local1.x = object._x;
_local1.y = object._y;
Enemy.localToGlobal(_local1);
return(_local1);
}
function distanceFromMouse(object) {
var _local1 = object._y - sniperScope._y;
var _local2 = object._x - sniperScope._x;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
return(_local3);
}
function abortMission() {
trace("MISSION ABORT");
_parent.failedReason = 16;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.soundtrack1Holder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatIrregularHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.rainHolder, 4, {volume:0});
}
function createExploder(startX, startY, floor) {
nCount++;
var life = 20;
var _local5 = 4 - (Math.random() * 8);
var _local4 = 4 - (Math.random() * 8);
var _local3 = Math.round(Math.random() * 100);
var _local2 = "explodePart" + nCount;
this.attachMovie("brains", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:_local3, _yscale:_local3});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
this[_local2].life = Math.round(Math.random() * 25);
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.dy = this.dy + 0.5;
if (this.counter >= this.life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 30) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
var _local2 = "bloodPart" + bCount;
this.attachMovie("blood", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:scale, _yscale:scale});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
var _local3 = Math.round(Math.random() * 80);
this[_local2]._xscale = _local3;
this[_local2]._yscale = _local3;
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
if ((this._y + (this._height / 2)) > floor) {
this._y = floor - (this._height / 2);
this.dy = this.dy * this.elasticity;
}
this.dy = this.dy + 0.5;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function smoker(smokex, smokey) {
smokeCount++;
var life = 150;
var _local2 = "smokePart" + smokeCount;
if (scopeZoom == false) {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
} else {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:_xmouse, _y:_ymouse, _xscale:50, _yscale:50});
}
this[_local2].onEnterFrame = function () {
this.counter++;
if (this.counter >= life) {
this._alpha = this._alpha - 1;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function checkBeats() {
checkBeatsIrregular();
nearest = 100;
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (_local3 != manToKill) {
tempDistance = distanceFromMouse(this["man" + _local3]);
if (tempDistance < nearest) {
nearest = tempDistance;
}
}
_local3++;
}
heartVolume = 100 - (nearest * 2);
if (heartVolume < 0) {
heartVolume = 0;
}
_root.heartbeat.setVolume(heartVolume);
if (_root.heartbeat.getVolume() > _root.heartbeatIrregular.getVolume()) {
sniperScope.heartRate._yscale = 100 - _root.heartbeat.getVolume();
sniperScope.heartBeatMeter.regular = true;
} else {
sniperScope.heartRate._yscale = 100 - _root.heartbeatIrregular.getVolume();
sniperScope.heartBeatMeter.regular = false;
}
}
function checkBeatsIrregular() {
nearest = 100;
distance = distanceFromMouse(this["man" + manToKill]);
heartVolume = 100 - (distance * 2);
if (heartVolume < 0) {
heartVolume = 0;
}
_root.heartbeatIrregular.setVolume(heartVolume);
}
function levelEnd() {
_parent.failedReason = 2;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatIrregularHolder, 4, {volume:0});
}
function checkLevelOver() {
if ((headShotArray[manToKill] == true) || (bodyShotArray[manToKill] == true)) {
_parent.bonus = _parent.bonus + (_parent.countdown.seconds * 10);
_parent.countdown.finished = true;
cleanLevel(true);
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatIrregularHolder, 4, {volume:0});
} else {
_parent.failedReason = 7;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatIrregularHolder, 4, {volume:0});
}
}
Mouse.hide();
var scopeWobble = 1;
var scopeWobbleBack = 1;
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
var scopeZoom = false;
var windowsBroken = false;
sniperScope.scope.blocked._visible = false;
_parent.brief.smallBrief.text = _root["onScreen" + _parent.mission];
resetShots();
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
if (!reload) {
_parent.shotsFired++;
_parent.gunShot.start(0, 1);
shotFired();
}
};
Mouse.addListener(mouseListener);
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_x:0, _y:0, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
var myListener = new Object();
myListener.onKeyDown = function () {
var _local3 = -_xmouse;
var _local2 = -_ymouse;
if ((Key.getCode() == 32) && (!scopeZoom)) {
_parent.levelart._xscale = 200;
_parent.levelart._yscale = 200;
scopeZoom = true;
_parent.levelart._x = _local3;
_parent.levelart._y = _local2;
_parent.zoomIn.start(0, 1);
} else if ((Key.getCode() == 32) && (scopeZoom)) {
resetZoom();
_parent.zoomOut.start(0, 1);
}
trace("scopeZoom=" + scopeZoom);
};
Key.addListener(myListener);
onEnterFrame = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
_parent.blob._x = point.x;
_parent.blob._y = point.y;
if (heartbeat) {
checkBeats();
}
if (explode) {
bombCheck();
}
if (checkVision) {
visionTest();
}
};
if (heartbeat) {
sniperScope.heartRate._visible = true;
} else {
sniperScope.heartRate._visible = true;
}
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:20});
var menOnLevel = 10;
initMission(menOnLevel);
var heartbeat = true;
sniperScope.heartBeatMeter.regular = true;
var manToKill = 7;
_parent.countdown.seconds = 60;
var targetToHit = Array(0, 1, 1, 1, 1, 1, 1, 1, 1, 1);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
var nearest = 100;
Symbol 3017 MovieClip Frame 1
function resetShots() {
i = 1;
while (i <= 20) {
headShotArray[i] = false;
bodyShotArray[i] = false;
i++;
}
}
function initMission(menOnLevel) {
var _local2 = 1;
while (_local2 <= menOnLevel) {
this["man" + _local2].alive = true;
trace((_local2 + ":live=") + this["man" + _local2].alive);
_local2++;
}
}
function newScopeMove(reloadFinished) {
if (reloadFinished) {
reload = false;
sniperScope.scope.blocked._visible = false;
}
breathCount++;
if ((breathCount % 2) == 0) {
_parent.breathIn.start(0, 1);
randomx = (Math.random() * scopeWobble) - (scopeWobble / 2);
randomy = (Math.random() * scopeWobble) - (scopeWobble / 2);
gs.TweenFilterLite.to(sniperScope.scope, 2, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
} else {
_parent.breathOut.start(0, 1);
randomx = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
randomy = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
gs.TweenFilterLite.to(sniperScope.scope, 4, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
}
}
function shotFired() {
sniperScope.scope.blocked._visible = true;
reload = true;
checkForHits();
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_y:sniperScope.scope._y - 60, ease:mx.transitions.easing.Strong.easeOut, onComplete:recoil});
}
function recoil() {
_parent.reloadGun.start(0, 1);
gs.TweenFilterLite.to(sniperScope.scope, 0.5, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (lights == true) {
var _local3 = 1;
while (_local3 <= lightsNumber) {
if (this["light" + _local3].collision.hitTest(point.x, point.y, 1)) {
this["light" + _local3].gotoAndStop("off");
_parent.lightsmash.start(0, 1);
_local4 = true;
break;
}
_local3++;
}
}
if (windows == true) {
var _local3 = 1;
while (_local3 <= windowsNumber) {
if (this["window" + _local3].hitTest(point.x, point.y, 1)) {
this["window" + _local3].gotoAndStop(2 + Math.round(Math.random() * 4));
if (thunder) {
_parent.windowsmash.setVolume(30);
} else {
_parent.windowsmash.setVolume(100);
}
_parent.windowsmash.start(0, 1);
windowsBroken = true;
_local4 = true;
break;
}
_local3++;
}
}
if (bombOnLevel == true) {
if (bomb.hitTest(point.x, point.y, 1)) {
_parent.headShots++;
bomb.play();
_local4 = true;
_local6 = true;
}
}
if (foreground.hitTest(point.x, point.y, 1) == false) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = true;
_local4 = true;
trace("bodyShot");
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = false;
headShotArray[_local3] = true;
_local4 = true;
}
if ((headShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.headShots++;
_local6 = true;
}
var _local5 = this["man" + _local3]._height;
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("headshot");
exploder(_local5);
sniperScope.swapDepths(this.getNextHighestDepth());
} else if ((bodyShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(sniperScope_.x, sniperScope_.y);
sniperScope.swapDepths(this.getNextHighestDepth());
}
if (foreground.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.y);
sniperScope.swapDepths(this.getNextHighestDepth());
_parent.misses++;
}
if (_local4) {
checkLevelOver();
}
}
function cleanLevel(success) {
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:40});
Key.removeListener(myListener);
Mouse.removeListener(mouseListener);
gs.TweenFilterLite.killTweensOf(this.sniperScope.scope, 1);
gs.TweenFilterLite.killTweensOf(this.sniperScope, 1);
resetShots();
if (success) {
successMission();
} else {
failedMission();
}
}
function failedMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionFailed});
}
function missionFailed() {
_parent.menuToPlay = "missionFailed";
_parent.fader.play();
}
function successMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionComplete});
}
function missionComplete() {
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
function resetZoom() {
_parent.levelart._xscale = 100;
_parent.levelart._yscale = 100;
scopeZoom = false;
_parent.levelart._x = 0;
_parent.levelart._y = 0;
}
function scopeHideEnd() {
scopeHiding = false;
}
function convCoords(object, Enemy) {
var _local1 = new Object();
_local1.x = object._x;
_local1.y = object._y;
Enemy.localToGlobal(_local1);
return(_local1);
}
function distanceFromMouse(object) {
var _local1 = object._y - sniperScope._y;
var _local2 = object._x - sniperScope._x;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
return(_local3);
}
function abortMission() {
trace("MISSION ABORT");
_parent.failedReason = 16;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.soundtrack1Holder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatIrregularHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.rainHolder, 4, {volume:0});
}
function createExploder(startX, startY, floor) {
nCount++;
var life = 20;
var _local5 = 4 - (Math.random() * 8);
var _local4 = 4 - (Math.random() * 8);
var _local3 = Math.round(Math.random() * 100);
var _local2 = "explodePart" + nCount;
this.attachMovie("brains", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:_local3, _yscale:_local3});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
this[_local2].life = Math.round(Math.random() * 25);
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.dy = this.dy + 0.5;
if (this.counter >= this.life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 30) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
var _local2 = "bloodPart" + bCount;
this.attachMovie("blood", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:scale, _yscale:scale});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
var _local3 = Math.round(Math.random() * 80);
this[_local2]._xscale = _local3;
this[_local2]._yscale = _local3;
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
if ((this._y + (this._height / 2)) > floor) {
this._y = floor - (this._height / 2);
this.dy = this.dy * this.elasticity;
}
this.dy = this.dy + 0.5;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function smoker(smokex, smokey) {
smokeCount++;
var life = 150;
var _local2 = "smokePart" + smokeCount;
if (scopeZoom == false) {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
} else {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:_xmouse, _y:_ymouse, _xscale:50, _yscale:50});
}
this[_local2].onEnterFrame = function () {
this.counter++;
if (this.counter >= life) {
this._alpha = this._alpha - 1;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function checkLevelOver() {
if (((((((headShotArray[1] == true) || (bodyShotArray[1] == true)) && ((headShotArray[2] == true) || (bodyShotArray[2] == true))) && ((headShotArray[3] == true) || (bodyShotArray[3] == true))) && ((headShotArray[4] == true) || (bodyShotArray[4] == true))) && ((headShotArray[5] == true) || (bodyShotArray[5] == true))) && ((headShotArray[6] == true) || (bodyShotArray[6] == true))) {
_parent.bonus = _parent.bonus + (_parent.countdown.seconds * 10);
_parent.countdown.finished = true;
cleanLevel(true);
clearSound();
}
}
function clearSound() {
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
}
function levelEnd() {
_parent.failedReason = 2;
cleanLevel(false);
clearSound();
}
Mouse.hide();
var scopeWobble = 1;
var scopeWobbleBack = 1;
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
var scopeZoom = false;
var windowsBroken = false;
sniperScope.scope.blocked._visible = false;
_parent.brief.smallBrief.text = _root["onScreen" + _parent.mission];
resetShots();
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
if (!reload) {
_parent.shotsFired++;
_parent.gunShot.start(0, 1);
shotFired();
}
};
Mouse.addListener(mouseListener);
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_x:0, _y:0, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
var myListener = new Object();
myListener.onKeyDown = function () {
var _local3 = -_xmouse;
var _local2 = -_ymouse;
if ((Key.getCode() == 32) && (!scopeZoom)) {
_parent.levelart._xscale = 200;
_parent.levelart._yscale = 200;
scopeZoom = true;
_parent.levelart._x = _local3;
_parent.levelart._y = _local2;
_parent.zoomIn.start(0, 1);
} else if ((Key.getCode() == 32) && (scopeZoom)) {
resetZoom();
_parent.zoomOut.start(0, 1);
}
trace("scopeZoom=" + scopeZoom);
};
Key.addListener(myListener);
onEnterFrame = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
_parent.blob._x = point.x;
_parent.blob._y = point.y;
if (heartbeat) {
checkBeats();
}
if (explode) {
bombCheck();
}
if (checkVision) {
visionTest();
}
};
if (heartbeat) {
sniperScope.heartRate._visible = true;
} else {
sniperScope.heartRate._visible = true;
}
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:70});
menOnLevel = 6;
initMission(menOnLevel);
_parent.countdown.seconds = 60;
var targetToHit = Array(0, 1, 1, 1, 1, 1, 1);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 3022 MovieClip Frame 1
var frequency = 0;
onEnterFrame = function () {
frequency = Math.random() * 1000;
if (frequency >= 800) {
delete this.onEnterFrame;
play();
}
};
this._visible = false;
stop();
Symbol 3022 MovieClip Frame 2
this._visible = true;
Symbol 3022 MovieClip Frame 21
_parent.thunder = true;
Symbol 3022 MovieClip Frame 152
_parent.thunder = false;
Symbol 3153 MovieClip Frame 1
stop();
Symbol 3153 MovieClip Frame 127
gotoAndStop ("lean");
Symbol 3153 MovieClip Frame 173
stop();
Symbol 3153 MovieClip Frame 221
stop();
Symbol 3154 MovieClip Frame 1
gotoAndPlay(Math.round(Math.random() * 400));
Symbol 3154 MovieClip Frame 70
man.gotoAndPlay("lean");
Symbol 3154 MovieClip Frame 526
gotoAndPlay (2);
Symbol 3155 MovieClip Frame 70
man.gotoAndPlay("lean");
Symbol 3155 MovieClip Frame 412
man.gotoAndPlay("lean");
Symbol 3158 MovieClip Frame 1
function resetShots() {
i = 1;
while (i <= 20) {
headShotArray[i] = false;
bodyShotArray[i] = false;
i++;
}
}
function initMission(menOnLevel) {
var _local2 = 1;
while (_local2 <= menOnLevel) {
this["man" + _local2].alive = true;
trace((_local2 + ":live=") + this["man" + _local2].alive);
_local2++;
}
}
function newScopeMove(reloadFinished) {
if (reloadFinished) {
reload = false;
sniperScope.scope.blocked._visible = false;
}
breathCount++;
if ((breathCount % 2) == 0) {
_parent.breathIn.start(0, 1);
randomx = (Math.random() * scopeWobble) - (scopeWobble / 2);
randomy = (Math.random() * scopeWobble) - (scopeWobble / 2);
gs.TweenFilterLite.to(sniperScope.scope, 2, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
} else {
_parent.breathOut.start(0, 1);
randomx = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
randomy = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
gs.TweenFilterLite.to(sniperScope.scope, 4, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
}
}
function shotFired() {
sniperScope.scope.blocked._visible = true;
reload = true;
checkForHits();
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_y:sniperScope.scope._y - 60, ease:mx.transitions.easing.Strong.easeOut, onComplete:recoil});
}
function recoil() {
_parent.reloadGun.start(0, 1);
gs.TweenFilterLite.to(sniperScope.scope, 0.5, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (lights == true) {
var _local3 = 1;
while (_local3 <= lightsNumber) {
if (this["light" + _local3].collision.hitTest(point.x, point.y, 1)) {
this["light" + _local3].gotoAndStop("off");
_parent.lightsmash.start(0, 1);
_local4 = true;
break;
}
_local3++;
}
}
if (windows == true) {
var _local3 = 1;
while (_local3 <= windowsNumber) {
if (this["window" + _local3].hitTest(point.x, point.y, 1)) {
this["window" + _local3].gotoAndStop(2 + Math.round(Math.random() * 4));
if (thunder) {
_parent.windowsmash.setVolume(30);
} else {
_parent.windowsmash.setVolume(100);
}
_parent.windowsmash.start(0, 1);
windowsBroken = true;
_local4 = true;
break;
}
_local3++;
}
}
if (bombOnLevel == true) {
if (bomb.hitTest(point.x, point.y, 1)) {
_parent.headShots++;
bomb.play();
_local4 = true;
_local6 = true;
}
}
if (foreground.hitTest(point.x, point.y, 1) == false) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = true;
_local4 = true;
trace("bodyShot");
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = false;
headShotArray[_local3] = true;
_local4 = true;
}
if ((headShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.headShots++;
_local6 = true;
}
var _local5 = this["man" + _local3]._height;
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("headshot");
exploder(_local5);
sniperScope.swapDepths(this.getNextHighestDepth());
} else if ((bodyShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(sniperScope_.x, sniperScope_.y);
sniperScope.swapDepths(this.getNextHighestDepth());
}
if (foreground.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.y);
sniperScope.swapDepths(this.getNextHighestDepth());
_parent.misses++;
}
if (_local4) {
checkLevelOver();
}
}
function cleanLevel(success) {
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:40});
Key.removeListener(myListener);
Mouse.removeListener(mouseListener);
gs.TweenFilterLite.killTweensOf(this.sniperScope.scope, 1);
gs.TweenFilterLite.killTweensOf(this.sniperScope, 1);
resetShots();
if (success) {
successMission();
} else {
failedMission();
}
}
function failedMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionFailed});
}
function missionFailed() {
_parent.menuToPlay = "missionFailed";
_parent.fader.play();
}
function successMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionComplete});
}
function missionComplete() {
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
function resetZoom() {
_parent.levelart._xscale = 100;
_parent.levelart._yscale = 100;
scopeZoom = false;
_parent.levelart._x = 0;
_parent.levelart._y = 0;
}
function scopeHideEnd() {
scopeHiding = false;
}
function convCoords(object, Enemy) {
var _local1 = new Object();
_local1.x = object._x;
_local1.y = object._y;
Enemy.localToGlobal(_local1);
return(_local1);
}
function distanceFromMouse(object) {
var _local1 = object._y - sniperScope._y;
var _local2 = object._x - sniperScope._x;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
return(_local3);
}
function abortMission() {
trace("MISSION ABORT");
_parent.failedReason = 16;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.soundtrack1Holder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatIrregularHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.rainHolder, 4, {volume:0});
}
function createExploder(startX, startY, floor) {
nCount++;
var life = 20;
var _local5 = 4 - (Math.random() * 8);
var _local4 = 4 - (Math.random() * 8);
var _local3 = Math.round(Math.random() * 100);
var _local2 = "explodePart" + nCount;
this.attachMovie("brains", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:_local3, _yscale:_local3});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
this[_local2].life = Math.round(Math.random() * 25);
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.dy = this.dy + 0.5;
if (this.counter >= this.life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 30) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
var _local2 = "bloodPart" + bCount;
this.attachMovie("blood", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:scale, _yscale:scale});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
var _local3 = Math.round(Math.random() * 80);
this[_local2]._xscale = _local3;
this[_local2]._yscale = _local3;
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
if ((this._y + (this._height / 2)) > floor) {
this._y = floor - (this._height / 2);
this.dy = this.dy * this.elasticity;
}
this.dy = this.dy + 0.5;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function smoker(smokex, smokey) {
smokeCount++;
var life = 150;
var _local2 = "smokePart" + smokeCount;
if (scopeZoom == false) {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
} else {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:_xmouse, _y:_ymouse, _xscale:50, _yscale:50});
}
this[_local2].onEnterFrame = function () {
this.counter++;
if (this.counter >= life) {
this._alpha = this._alpha - 1;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function checkLevelOver() {
if ((((((headShotArray[1] == true) || (bodyShotArray[1] == true)) && ((headShotArray[2] == true) || (bodyShotArray[2] == true))) && ((headShotArray[3] == true) || (bodyShotArray[3] == true))) && ((headShotArray[4] == true) || (bodyShotArray[4] == true))) && ((headShotArray[5] == true) || (bodyShotArray[5] == true))) {
_parent.bonus = _parent.bonus + (_parent.countdown.seconds * 10);
_parent.countdown.finished = true;
cleanLevel(true);
gs.TweenFilterLite.to(_parent.rainHolder, 4, {volume:0});
}
if (thunder == false) {
_parent.alarm.setVolume(50);
_parent.alarm.start(0, 1);
cleanLevel(false);
_parent.failedReason = 8;
gs.TweenFilterLite.to(_parent.rainHolder, 4, {volume:0});
}
}
function fadeSound() {
gs.TweenFilterLite.to(_parent.rainHolder, 4, {volume:0});
}
function levelEnd() {
_parent.failedReason = 2;
cleanLevel(false);
fadeSound();
}
Mouse.hide();
var scopeWobble = 1;
var scopeWobbleBack = 1;
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
var scopeZoom = false;
var windowsBroken = false;
sniperScope.scope.blocked._visible = false;
_parent.brief.smallBrief.text = _root["onScreen" + _parent.mission];
resetShots();
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
if (!reload) {
_parent.shotsFired++;
_parent.gunShot.start(0, 1);
shotFired();
}
};
Mouse.addListener(mouseListener);
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_x:0, _y:0, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
var myListener = new Object();
myListener.onKeyDown = function () {
var _local3 = -_xmouse;
var _local2 = -_ymouse;
if ((Key.getCode() == 32) && (!scopeZoom)) {
_parent.levelart._xscale = 200;
_parent.levelart._yscale = 200;
scopeZoom = true;
_parent.levelart._x = _local3;
_parent.levelart._y = _local2;
_parent.zoomIn.start(0, 1);
} else if ((Key.getCode() == 32) && (scopeZoom)) {
resetZoom();
_parent.zoomOut.start(0, 1);
}
trace("scopeZoom=" + scopeZoom);
};
Key.addListener(myListener);
onEnterFrame = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
_parent.blob._x = point.x;
_parent.blob._y = point.y;
if (heartbeat) {
checkBeats();
}
if (explode) {
bombCheck();
}
if (checkVision) {
visionTest();
}
};
if (heartbeat) {
sniperScope.heartRate._visible = true;
} else {
sniperScope.heartRate._visible = true;
}
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
gs.TweenFilterLite.to(_parent.rainHolder, 4, {volume:40});
menOnLevel = 5;
initMission(menOnLevel);
var windows = true;
var windowsNumber = 80;
var thunder = false;
_parent.countdown.seconds = 95;
lightening.stop();
var targetToHit = Array(0, 1, 1, 1, 1, 1, 1);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 3170 MovieClip Frame 1
stop();
Symbol 3170 MovieClip Frame 30
stop();
Symbol 3176 MovieClip Frame 1
this._visible = false;
Symbol 3176 MovieClip Frame 2
this._visible = true;
gotoAndPlay(Math.round(Math.random() * 15));
Symbol 3176 MovieClip Frame 65
gotoAndPlay (2);
Symbol 3177 MovieClip Frame 1
function resetShots() {
i = 1;
while (i <= 20) {
headShotArray[i] = false;
bodyShotArray[i] = false;
i++;
}
}
function initMission(menOnLevel) {
var _local2 = 1;
while (_local2 <= menOnLevel) {
this["man" + _local2].alive = true;
trace((_local2 + ":live=") + this["man" + _local2].alive);
_local2++;
}
}
function newScopeMove(reloadFinished) {
if (reloadFinished) {
reload = false;
sniperScope.scope.blocked._visible = false;
}
breathCount++;
if ((breathCount % 2) == 0) {
_parent.breathIn.start(0, 1);
randomx = (Math.random() * scopeWobble) - (scopeWobble / 2);
randomy = (Math.random() * scopeWobble) - (scopeWobble / 2);
gs.TweenFilterLite.to(sniperScope.scope, 2, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
} else {
_parent.breathOut.start(0, 1);
randomx = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
randomy = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
gs.TweenFilterLite.to(sniperScope.scope, 4, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
}
}
function shotFired() {
sniperScope.scope.blocked._visible = true;
reload = true;
checkForHits();
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_y:sniperScope.scope._y - 60, ease:mx.transitions.easing.Strong.easeOut, onComplete:recoil});
}
function recoil() {
_parent.reloadGun.start(0, 1);
gs.TweenFilterLite.to(sniperScope.scope, 0.5, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (lights == true) {
var _local3 = 1;
while (_local3 <= lightsNumber) {
if (this["light" + _local3].collision.hitTest(point.x, point.y, 1)) {
this["light" + _local3].gotoAndStop("off");
_parent.lightsmash.start(0, 1);
_local4 = true;
break;
}
_local3++;
}
}
if (windows == true) {
var _local3 = 1;
while (_local3 <= windowsNumber) {
if (this["window" + _local3].hitTest(point.x, point.y, 1)) {
this["window" + _local3].gotoAndStop(2 + Math.round(Math.random() * 4));
if (thunder) {
_parent.windowsmash.setVolume(30);
} else {
_parent.windowsmash.setVolume(100);
}
_parent.windowsmash.start(0, 1);
windowsBroken = true;
_local4 = true;
break;
}
_local3++;
}
}
if (bombOnLevel == true) {
if (bomb.hitTest(point.x, point.y, 1)) {
_parent.headShots++;
bomb.play();
_local4 = true;
_local6 = true;
}
}
if (foreground.hitTest(point.x, point.y, 1) == false) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = true;
_local4 = true;
trace("bodyShot");
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = false;
headShotArray[_local3] = true;
_local4 = true;
}
if ((headShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.headShots++;
_local6 = true;
}
var _local5 = this["man" + _local3]._height;
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("headshot");
exploder(_local5);
sniperScope.swapDepths(this.getNextHighestDepth());
} else if ((bodyShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(sniperScope_.x, sniperScope_.y);
sniperScope.swapDepths(this.getNextHighestDepth());
}
if (foreground.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.y);
sniperScope.swapDepths(this.getNextHighestDepth());
_parent.misses++;
}
if (_local4) {
checkLevelOver();
}
}
function cleanLevel(success) {
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:40});
Key.removeListener(myListener);
Mouse.removeListener(mouseListener);
gs.TweenFilterLite.killTweensOf(this.sniperScope.scope, 1);
gs.TweenFilterLite.killTweensOf(this.sniperScope, 1);
resetShots();
if (success) {
successMission();
} else {
failedMission();
}
}
function failedMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionFailed});
}
function missionFailed() {
_parent.menuToPlay = "missionFailed";
_parent.fader.play();
}
function successMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionComplete});
}
function missionComplete() {
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
function resetZoom() {
_parent.levelart._xscale = 100;
_parent.levelart._yscale = 100;
scopeZoom = false;
_parent.levelart._x = 0;
_parent.levelart._y = 0;
}
function scopeHideEnd() {
scopeHiding = false;
}
function convCoords(object, Enemy) {
var _local1 = new Object();
_local1.x = object._x;
_local1.y = object._y;
Enemy.localToGlobal(_local1);
return(_local1);
}
function distanceFromMouse(object) {
var _local1 = object._y - sniperScope._y;
var _local2 = object._x - sniperScope._x;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
return(_local3);
}
function abortMission() {
trace("MISSION ABORT");
_parent.failedReason = 16;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.soundtrack1Holder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatIrregularHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.rainHolder, 4, {volume:0});
}
function createExploder(startX, startY, floor) {
nCount++;
var life = 20;
var _local5 = 4 - (Math.random() * 8);
var _local4 = 4 - (Math.random() * 8);
var _local3 = Math.round(Math.random() * 100);
var _local2 = "explodePart" + nCount;
this.attachMovie("brains", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:_local3, _yscale:_local3});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
this[_local2].life = Math.round(Math.random() * 25);
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.dy = this.dy + 0.5;
if (this.counter >= this.life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 30) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
var _local2 = "bloodPart" + bCount;
this.attachMovie("blood", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:scale, _yscale:scale});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
var _local3 = Math.round(Math.random() * 80);
this[_local2]._xscale = _local3;
this[_local2]._yscale = _local3;
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
if ((this._y + (this._height / 2)) > floor) {
this._y = floor - (this._height / 2);
this.dy = this.dy * this.elasticity;
}
this.dy = this.dy + 0.5;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function smoker(smokex, smokey) {
smokeCount++;
var life = 150;
var _local2 = "smokePart" + smokeCount;
if (scopeZoom == false) {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
} else {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:_xmouse, _y:_ymouse, _xscale:50, _yscale:50});
}
this[_local2].onEnterFrame = function () {
this.counter++;
if (this.counter >= life) {
this._alpha = this._alpha - 1;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function checkLevelOver() {
if (((((((headShotArray[2] == true) || (bodyShotArray[2] == true)) && ((headShotArray[3] == true) || (bodyShotArray[3] == true))) && ((headShotArray[4] == true) || (bodyShotArray[4] == true))) && ((headShotArray[5] == true) || (bodyShotArray[5] == true))) && ((headShotArray[6] == true) || (bodyShotArray[6] == true))) && (lightsOff)) {
_parent.bonus = _parent.bonus + (_parent.countdown.seconds * 10);
_parent.countdown.finished = true;
cleanLevel(true);
fadeSound();
}
if ((((((headShotArray[2] == true) || (bodyShotArray[2] == true)) || ((headShotArray[3] == true) || (bodyShotArray[3] == true))) || ((headShotArray[4] == true) || (bodyShotArray[4] == true))) || ((headShotArray[6] == true) || (bodyShotArray[6] == true))) && (lightsOff == false)) {
_parent.alarm.start(0, 1);
_parent.failedReason = 13;
cleanLevel(false);
fadeSound();
trace("lightsOff=" + lightsOff);
}
if ((headShotArray[1] == true) || (bodyShotArray[1] == true)) {
blackOut._visible = true;
lightsOff = true;
_parent.countdown.pausedTimer = false;
}
}
function fadeSound() {
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartBeatHolder, 4, {volume:0});
}
function checkBeats() {
nearest = 100;
var _local3 = 2;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].alive) {
tempDistance = distanceFromMouse(this["man" + _local3]);
if (tempDistance < nearest) {
nearest = tempDistance;
}
}
_local3++;
}
heartVolume = 100 - (nearest * 2);
if (heartVolume < 0) {
heartVolume = 0;
}
_root.heartbeat.setVolume(heartVolume);
sniperScope.heartRate._yscale = 100 - _root.heartbeat.getVolume();
}
function levelEnd() {
_parent.failedReason = 2;
cleanLevel(false);
fadeSound();
}
Mouse.hide();
var scopeWobble = 1;
var scopeWobbleBack = 1;
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
var scopeZoom = false;
var windowsBroken = false;
sniperScope.scope.blocked._visible = false;
_parent.brief.smallBrief.text = _root["onScreen" + _parent.mission];
resetShots();
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
if (!reload) {
_parent.shotsFired++;
_parent.gunShot.start(0, 1);
shotFired();
}
};
Mouse.addListener(mouseListener);
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_x:0, _y:0, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
var myListener = new Object();
myListener.onKeyDown = function () {
var _local3 = -_xmouse;
var _local2 = -_ymouse;
if ((Key.getCode() == 32) && (!scopeZoom)) {
_parent.levelart._xscale = 200;
_parent.levelart._yscale = 200;
scopeZoom = true;
_parent.levelart._x = _local3;
_parent.levelart._y = _local2;
_parent.zoomIn.start(0, 1);
} else if ((Key.getCode() == 32) && (scopeZoom)) {
resetZoom();
_parent.zoomOut.start(0, 1);
}
trace("scopeZoom=" + scopeZoom);
};
Key.addListener(myListener);
onEnterFrame = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
_parent.blob._x = point.x;
_parent.blob._y = point.y;
if (heartbeat) {
checkBeats();
}
if (explode) {
bombCheck();
}
if (checkVision) {
visionTest();
}
};
if (heartbeat) {
sniperScope.heartRate._visible = true;
} else {
sniperScope.heartRate._visible = true;
}
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:50});
menOnLevel = 6;
initMission(menOnLevel);
_parent.countdown.seconds = 60;
_parent.countdown.pausedTimer = true;
var windows = true;
var windowsNumber = 25;
var heartbeat = true;
var levelOver = false;
var lightsOff = false;
blackOut._visible = false;
var targetToHit = Array(0, 1, 1, 1, 1, 1, 1);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 3214 MovieClip Frame 1
gotoAndPlay(Math.round(Math.random() * 10));
Symbol 3214 MovieClip Frame 33
gotoAndPlay ("walk");
Symbol 3214 MovieClip Frame 115
gotoAndPlay ("run");
Symbol 3214 MovieClip Frame 149
stop();
Symbol 3214 MovieClip Frame 189
stop();
Symbol 3214 MovieClip Frame 227
stop();
Symbol 3215 MovieClip Frame 1
stop();
Symbol 3215 MovieClip Frame 2
man.gotoAndPlay("walktoRun");
Symbol 3215 MovieClip Frame 121
stop();
this._visible = false;
_parent.chopper.play();
Symbol 3217 MovieClip Frame 1
stop();
Symbol 3217 MovieClip Frame 16
stop();
Symbol 3217 MovieClip Frame 26
stop();
Symbol 3241 MovieClip Frame 2
var randExplode = (1 + random(2));
_root["explode" + randExplode].start(0, 1);
Symbol 3241 MovieClip Frame 41
stop();
Symbol 3242 MovieClip Frame 1
stop();
Symbol 3242 MovieClip Frame 29
stop();
if (_parent._parent.chopper.vunerable && (!_parent._parent.craneUp)) {
_parent._parent.chopper.stop();
_parent._parent.chopper.dead = true;
_parent._parent.chopper.man.gotoAndPlay("explode");
trace("chopperDead= " + _parent._parent.chopper.dead);
}
Symbol 3242 MovieClip Frame 105
stop();
if (_parent._parent.chopper.vunerable && (_parent._parent.craneUp == false)) {
_parent._parent.chopper.stop();
_parent._parent.chopper.dead = true;
_parent._parent.chopper.man.gotoAndPlay("explode");
trace("chopperDead= " + _parent._parent.chopper.dead);
}
Symbol 3246 MovieClip Frame 1
stop();
Symbol 3246 MovieClip Frame 46
stop();
Symbol 3272 MovieClip Frame 20
if (_parent.dead == false) {
gotoAndPlay ("bob");
} else {
gotoAndPlay ("explode");
}
Symbol 3272 MovieClip Frame 115
stop();
if (_parent.vunerable && (_parent.samsomOnBoard)) {
_parent._parent.cleanLevel(true);
} else {
_parent._parent.cleanLevel(false);
}
Symbol 3274 MovieClip Frame 1
dead = false;
vunerable = false;
samsonOnBoard = false;
Symbol 3274 MovieClip Frame 378
vunerable = true;
Symbol 3274 MovieClip Frame 494
_parent.samson.play();
stop();
Symbol 3274 MovieClip Frame 495
samsonOnBoard = true;
Symbol 3274 MovieClip Frame 628
vunerable = false;
Symbol 3274 MovieClip Frame 796
_parent.cleanLevel(false);
_parent._parent.failedReason = 15;
Symbol 3282 MovieClip Frame 1
function resetShots() {
i = 1;
while (i <= 20) {
headShotArray[i] = false;
bodyShotArray[i] = false;
i++;
}
}
function initMission(menOnLevel) {
var _local2 = 1;
while (_local2 <= menOnLevel) {
this["man" + _local2].alive = true;
trace((_local2 + ":live=") + this["man" + _local2].alive);
_local2++;
}
}
function newScopeMove(reloadFinished) {
if (reloadFinished) {
reload = false;
sniperScope.scope.blocked._visible = false;
}
breathCount++;
if ((breathCount % 2) == 0) {
_parent.breathIn.start(0, 1);
randomx = (Math.random() * scopeWobble) - (scopeWobble / 2);
randomy = (Math.random() * scopeWobble) - (scopeWobble / 2);
gs.TweenFilterLite.to(sniperScope.scope, 2, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
} else {
_parent.breathOut.start(0, 1);
randomx = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
randomy = (Math.random() * scopeWobbleBack) - (scopeWobbleBack / 2);
gs.TweenFilterLite.to(sniperScope.scope, 4, {_x:randomx, _y:randomy, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
}
}
function shotFired() {
sniperScope.scope.blocked._visible = true;
reload = true;
checkForHits();
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_y:sniperScope.scope._y - 60, ease:mx.transitions.easing.Strong.easeOut, onComplete:recoil});
}
function recoil() {
_parent.reloadGun.start(0, 1);
gs.TweenFilterLite.to(sniperScope.scope, 0.5, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (lights == true) {
var _local3 = 1;
while (_local3 <= lightsNumber) {
if (this["light" + _local3].collision.hitTest(point.x, point.y, 1)) {
this["light" + _local3].gotoAndStop("off");
_parent.lightsmash.start(0, 1);
_local4 = true;
break;
}
_local3++;
}
}
if (windows == true) {
var _local3 = 1;
while (_local3 <= windowsNumber) {
if (this["window" + _local3].hitTest(point.x, point.y, 1)) {
this["window" + _local3].gotoAndStop(2 + Math.round(Math.random() * 4));
if (thunder) {
_parent.windowsmash.setVolume(30);
} else {
_parent.windowsmash.setVolume(100);
}
_parent.windowsmash.start(0, 1);
windowsBroken = true;
_local4 = true;
break;
}
_local3++;
}
}
if (bombOnLevel == true) {
if (bomb.hitTest(point.x, point.y, 1)) {
_parent.headShots++;
bomb.play();
_local4 = true;
_local6 = true;
}
}
if (foreground.hitTest(point.x, point.y, 1) == false) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = true;
_local4 = true;
trace("bodyShot");
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
bodyShotArray[_local3] = false;
headShotArray[_local3] = true;
_local4 = true;
}
if ((headShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.headShots++;
_local6 = true;
}
var _local5 = this["man" + _local3]._height;
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("headshot");
exploder(_local5);
sniperScope.swapDepths(this.getNextHighestDepth());
} else if ((bodyShotArray[_local3] == true) && (this["man" + _local3].alive)) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(sniperScope_.x, sniperScope_.y);
sniperScope.swapDepths(this.getNextHighestDepth());
}
if (foreground.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.y);
sniperScope.swapDepths(this.getNextHighestDepth());
_parent.misses++;
}
if (_local4) {
checkLevelOver();
}
}
function cleanLevel(success) {
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:40});
Key.removeListener(myListener);
Mouse.removeListener(mouseListener);
gs.TweenFilterLite.killTweensOf(this.sniperScope.scope, 1);
gs.TweenFilterLite.killTweensOf(this.sniperScope, 1);
resetShots();
if (success) {
successMission();
} else {
failedMission();
}
}
function failedMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionFailed});
}
function missionFailed() {
_parent.menuToPlay = "missionFailed";
_parent.fader.play();
}
function successMission() {
gs.TweenFilterLite.to(sniperScope, 5, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:missionComplete});
}
function missionComplete() {
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
function resetZoom() {
_parent.levelart._xscale = 100;
_parent.levelart._yscale = 100;
scopeZoom = false;
_parent.levelart._x = 0;
_parent.levelart._y = 0;
}
function scopeHideEnd() {
scopeHiding = false;
}
function convCoords(object, Enemy) {
var _local1 = new Object();
_local1.x = object._x;
_local1.y = object._y;
Enemy.localToGlobal(_local1);
return(_local1);
}
function distanceFromMouse(object) {
var _local1 = object._y - sniperScope._y;
var _local2 = object._x - sniperScope._x;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
return(_local3);
}
function abortMission() {
trace("MISSION ABORT");
_parent.failedReason = 16;
cleanLevel(false);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.soundtrack1Holder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.heartbeatIrregularHolder, 4, {volume:0});
gs.TweenFilterLite.to(_parent.rainHolder, 4, {volume:0});
}
function createExploder(startX, startY, floor) {
nCount++;
var life = 20;
var _local5 = 4 - (Math.random() * 8);
var _local4 = 4 - (Math.random() * 8);
var _local3 = Math.round(Math.random() * 100);
var _local2 = "explodePart" + nCount;
this.attachMovie("brains", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:_local3, _yscale:_local3});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
this[_local2].life = Math.round(Math.random() * 25);
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.dy = this.dy + 0.5;
if (this.counter >= this.life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 30) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
var _local2 = "bloodPart" + bCount;
this.attachMovie("blood", _local2, this.getNextHighestDepth(), {_x:startX, _y:startY, _xscale:scale, _yscale:scale});
this[_local2].elasticity = elasticity;
this[_local2].dx = _local5;
this[_local2].dy = _local4;
this[_local2].counter = 1;
var _local3 = Math.round(Math.random() * 80);
this[_local2]._xscale = _local3;
this[_local2]._yscale = _local3;
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + rotation;
this.counter++;
this._x = this._x + this.dx;
this._y = this._y + this.dy;
if ((this._y + (this._height / 2)) > floor) {
this._y = floor - (this._height / 2);
this.dy = this.dy * this.elasticity;
}
this.dy = this.dy + 0.5;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function smoker(smokex, smokey) {
smokeCount++;
var life = 150;
var _local2 = "smokePart" + smokeCount;
if (scopeZoom == false) {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
} else {
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:_xmouse, _y:_ymouse, _xscale:50, _yscale:50});
}
this[_local2].onEnterFrame = function () {
this.counter++;
if (this.counter >= life) {
this._alpha = this._alpha - 1;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function checkLevelOver() {
trace("chopper" + chopper.vunerable);
if (((((headShotArray[1] == true) || (bodyShotArray[1] == true)) && (chopper.vunerable == true)) && (!craneUp)) && (chopper.samsonOnBoard == true)) {
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
cleanLevel(true);
}
if (((((headShotArray[1] == true) || (bodyShotArray[1] == true)) && (chopper.vunerable == true)) && (!craneUp)) && (chopper.samsonOnBoard == false)) {
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
_parent.failedReason = 14;
cleanLevel(false);
}
trace("craneUP" + craneUp);
if (((headShotArray[2] == true) || (bodyShotArray[2] == true)) && (craneUp == true)) {
trace("doing crane");
man1.play();
craneUp = false;
led._visible = false;
cog.stop();
}
trace("craneUP" + craneUp);
}
Mouse.hide();
var scopeWobble = 1;
var scopeWobbleBack = 1;
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
var scopeZoom = false;
var windowsBroken = false;
sniperScope.scope.blocked._visible = false;
_parent.brief.smallBrief.text = _root["onScreen" + _parent.mission];
resetShots();
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
if (!reload) {
_parent.shotsFired++;
_parent.gunShot.start(0, 1);
shotFired();
}
};
Mouse.addListener(mouseListener);
gs.TweenFilterLite.to(sniperScope.scope, 0.25, {_x:0, _y:0, overwrite:false, ease:mx.transitions.easing.Strong.easeInOut, onComplete:newScopeMove});
var myListener = new Object();
myListener.onKeyDown = function () {
var _local3 = -_xmouse;
var _local2 = -_ymouse;
if ((Key.getCode() == 32) && (!scopeZoom)) {
_parent.levelart._xscale = 200;
_parent.levelart._yscale = 200;
scopeZoom = true;
_parent.levelart._x = _local3;
_parent.levelart._y = _local2;
_parent.zoomIn.start(0, 1);
} else if ((Key.getCode() == 32) && (scopeZoom)) {
resetZoom();
_parent.zoomOut.start(0, 1);
}
trace("scopeZoom=" + scopeZoom);
};
Key.addListener(myListener);
onEnterFrame = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
_parent.blob._x = point.x;
_parent.blob._y = point.y;
if (heartbeat) {
checkBeats();
}
if (explode) {
bombCheck();
}
if (checkVision) {
visionTest();
}
};
if (heartbeat) {
sniperScope.heartRate._visible = true;
} else {
sniperScope.heartRate._visible = true;
}
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
menOnLevel = 2;
initMission(menOnLevel);
var craneUp = true;
var barrelExploded = true;
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:70});
var targetToHit = Array(0, 1, 1, 1, 1);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 3317 MovieClip Frame 1
stop();
Symbol 3317 MovieClip Frame 10
stop();
Symbol 3321 MovieClip Frame 1
stop();
Symbol 3321 MovieClip Frame 10
stop();
Symbol 3327 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 3335 MovieClip Frame 1
stop();
Symbol 3340 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 3345 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 3348 MovieClip Frame 1
function rhex(num) {
str = "";
j = 0;
while (j <= 3) {
str = str + (hex_chr.charAt(MathbitAND(num >> ((j * 8) + 4), 15)) + hex_chr.charAt(MathbitAND(num >> (j * 8), 15)));
j++;
}
return(str);
}
function str2blks_MD5(str) {
nblk = ((str.length + 8) >> 6) + 1;
blks = new Array(nblk * 16);
i = 0;
while (i < (nblk * 16)) {
blks[i] = 0;
i++;
}
i = 0;
while (i < str.length) {
blks[i >> 2] = blks[i >> 2] | (str.charCodeAt(i) << ((i % 4) * 8));
i++;
}
blks[i >> 2] = blks[i >> 2] | (128 << ((i % 4) * 8));
blks[(nblk * 16) - 2] = str.length * 8;
return(blks);
}
function addme(x, y) {
var _local1 = MathbitAND(x, 65535) + MathbitAND(y, 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | MathbitAND(_local1, 65535));
}
function rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
function cmn(q, a, b, x, s, t) {
return(addme(rol(addme(addme(a, q), addme(x, t)), s), b));
}
function ff(a, b, c, d, x, s, t) {
return(cmn(MathbitAND(b, c) | MathbitAND(~b, d), a, b, x, s, t));
}
function gg(a, b, c, d, x, s, t) {
return(cmn(MathbitAND(b, d) | MathbitAND(c, ~d), a, b, x, s, t));
}
function hh(a, b, c, d, x, s, t) {
return(cmn((b ^ c) ^ d, a, b, x, s, t));
}
function ii(a, b, c, d, x, s, t) {
return(cmn(c ^ (b | (~d)), a, b, x, s, t));
}
MathbitAND = function (a, b) {
if ((a < 0) && (b < 0)) {
var _local3 = (a & 1) & (b & 1);
var _local4 = (a >>> 1) & (b >>> 1);
return((_local4 << 1) | _local3);
}
return(a & b);
};
var hex_chr = "0123456789abcdef";
String.prototype.MD5 = function () {
var _local2 = this;
x = str2blks_MD5(_local2);
a = 1732584193 /* 0x67452301 */;
b = -271733879;
c = -1732584194;
d = 271733878 /* 0x10325476 */;
i = 0;
while (i < x.length) {
olda = a;
oldb = b;
oldc = c;
oldd = d;
a = ff(a, b, c, d, x[i + 0], 7, -680876936);
d = ff(d, a, b, c, x[i + 1], 12, -389564586);
c = ff(c, d, a, b, x[i + 2], 17, 606105819);
b = ff(b, c, d, a, x[i + 3], 22, -1044525330);
a = ff(a, b, c, d, x[i + 4], 7, -176418897);
d = ff(d, a, b, c, x[i + 5], 12, 1200080426);
c = ff(c, d, a, b, x[i + 6], 17, -1473231341);
b = ff(b, c, d, a, x[i + 7], 22, -45705983);
a = ff(a, b, c, d, x[i + 8], 7, 1770035416);
d = ff(d, a, b, c, x[i + 9], 12, -1958414417);
c = ff(c, d, a, b, x[i + 10], 17, -42063);
b = ff(b, c, d, a, x[i + 11], 22, -1990404162);
a = ff(a, b, c, d, x[i + 12], 7, 1804603682);
d = ff(d, a, b, c, x[i + 13], 12, -40341101);
c = ff(c, d, a, b, x[i + 14], 17, -1502002290);
b = ff(b, c, d, a, x[i + 15], 22, 1236535329);
a = gg(a, b, c, d, x[i + 1], 5, -165796510);
d = gg(d, a, b, c, x[i + 6], 9, -1069501632);
c = gg(c, d, a, b, x[i + 11], 14, 643717713);
b = gg(b, c, d, a, x[i + 0], 20, -373897302);
a = gg(a, b, c, d, x[i + 5], 5, -701558691);
d = gg(d, a, b, c, x[i + 10], 9, 38016083);
c = gg(c, d, a, b, x[i + 15], 14, -660478335);
b = gg(b, c, d, a, x[i + 4], 20, -405537848);
a = gg(a, b, c, d, x[i + 9], 5, 568446438);
d = gg(d, a, b, c, x[i + 14], 9, -1019803690);
c = gg(c, d, a, b, x[i + 3], 14, -187363961);
b = gg(b, c, d, a, x[i + 8], 20, 1163531501);
a = gg(a, b, c, d, x[i + 13], 5, -1444681467);
d = gg(d, a, b, c, x[i + 2], 9, -51403784);
c = gg(c, d, a, b, x[i + 7], 14, 1735328473);
b = gg(b, c, d, a, x[i + 12], 20, -1926607734);
a = hh(a, b, c, d, x[i + 5], 4, -378558);
d = hh(d, a, b, c, x[i + 8], 11, -2022574463);
c = hh(c, d, a, b, x[i + 11], 16, 1839030562);
b = hh(b, c, d, a, x[i + 14], 23, -35309556);
a = hh(a, b, c, d, x[i + 1], 4, -1530992060);
d = hh(d, a, b, c, x[i + 4], 11, 1272893353);
c = hh(c, d, a, b, x[i + 7], 16, -155497632);
b = hh(b, c, d, a, x[i + 10], 23, -1094730640);
a = hh(a, b, c, d, x[i + 13], 4, 681279174);
d = hh(d, a, b, c, x[i + 0], 11, -358537222);
c = hh(c, d, a, b, x[i + 3], 16, -722521979);
b = hh(b, c, d, a, x[i + 6], 23, 76029189);
a = hh(a, b, c, d, x[i + 9], 4, -640364487);
d = hh(d, a, b, c, x[i + 12], 11, -421815835);
c = hh(c, d, a, b, x[i + 15], 16, 530742520);
b = hh(b, c, d, a, x[i + 2], 23, -995338651);
a = ii(a, b, c, d, x[i + 0], 6, -198630844);
d = ii(d, a, b, c, x[i + 7], 10, 1126891415);
c = ii(c, d, a, b, x[i + 14], 15, -1416354905);
b = ii(b, c, d, a, x[i + 5], 21, -57434055);
a = ii(a, b, c, d, x[i + 12], 6, 1700485571);
d = ii(d, a, b, c, x[i + 3], 10, -1894986606);
c = ii(c, d, a, b, x[i + 10], 15, -1051523);
b = ii(b, c, d, a, x[i + 1], 21, -2054922799);
a = ii(a, b, c, d, x[i + 8], 6, 1873313359);
d = ii(d, a, b, c, x[i + 15], 10, -30611744);
c = ii(c, d, a, b, x[i + 6], 15, -1560198380);
b = ii(b, c, d, a, x[i + 13], 21, 1309151649);
a = ii(a, b, c, d, x[i + 4], 6, -145523070);
d = ii(d, a, b, c, x[i + 11], 10, -1120210379);
c = ii(c, d, a, b, x[i + 2], 15, 718787259);
b = ii(b, c, d, a, x[i + 9], 21, -343485551);
a = addme(a, olda);
b = addme(b, oldb);
c = addme(c, oldc);
d = addme(d, oldd);
i = i + 16;
}
return(((rhex(a) + rhex(b)) + rhex(c)) + rhex(d));
};
stop();
this.bubbleboxGameID = 1521;
_root.score = _root.totalScore;
scoreMc = this;
textBlock.useHandCursor = false;
textBlock.onRelease = function () {
_root.bubblebox_name = "";
textBlock._visible = false;
};
sendBubbleBoxScore = function (gameID) {
userData = new LoadVars();
var _local3 = (((bubbleboxGameID + "_") + _root.score) + "_") + _root.bubblebox_name;
var _local4 = (((((((((bubbleboxGameID + "_") + "4234232143214421") + "_") + _root.score) + "_") + "2537625476251") + "_") + _root.bubblebox_name) + "_") + "desleutelistessa";
var _local2 = _local4.MD5();
userData.datastring = _local3;
userData.hashstring = _local2;
var result_lv = new LoadVars();
result_lv.onLoad = function (success) {
if (success) {
result_scoreID = result_lv.id;
result_weeklyID = result_lv.weekly_id;
result_scorepos = result_lv.scorepos;
result_weeklyScorepos = result_lv.weeklyScorepos;
trace((((((("resIDDD " + result_scoreID) + "resIDDD WEEKLY ") + result_weeklyID) + " scorepos: ") + result_scorepos) + " ") + result_weeklyScorepos);
scoreMc.gotoAndStop("success");
} else {
scoreMc.gotoAndStop("tryagain");
}
};
userData.sendAndLoad("http://www.bubblebox.com/scripts/insertscore2009.php", result_lv, "POST");
};
this.send_btn.onRelease = function () {
if ((_root.bubblebox_name != "YOUR NAME") && (_root.bubblebox_name.length > 0)) {
sendBubbleBoxScore(this._parent.bubbleboxGameID);
this._parent.gotoAndStop("saving");
}
};
Selection.setFocus("instertname");
Symbol 3348 MovieClip Frame 2
stop();
Symbol 3348 MovieClip Frame 3
this.bubblebox_view_score.onRelease = function () {
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1521&subid=scores&action=viewscore", "_blank");
};
var vartext = "";
var validScore = true;
var validWeeklyScore = true;
if (isNaN(result_scorepos)) {
validScore = false;
}
if (isNaN(result_scorepos)) {
validWeeklyScore = false;
}
if ((validScore == true) && (result_scorepos <= 1000)) {
vartext = ("Congratulations, you ranked " + result_scorepos) + " in the alltime highscores!!";
} else if ((validWeeklyScore == true) && (result_weeklyScorepos <= 1000)) {
vartext = ("Congratulations, you ranked " + result_weeklyScorepos) + " in the weekly highscores.";
} else {
vartext = "Sorry, you did not make it into the weekly or alltime top 1000.";
}
this.postext.text = vartext;
Symbol 3348 MovieClip Frame 4
this.try_again.onRelease = function () {
this._parent.gotoAndStop(1);
};
Symbol 3357 MovieClip Frame 1
stop();
Symbol 3357 MovieClip Frame 10
stop();