Frame 1
var CPMStarContentSpotID = "503Q1A705456";
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie("http://server.cpmstar.com/adviewas2.swf?contentspotid=" + CPMStarContentSpotID);
currentDomain = _root._url.split("/");
currentDomain = currentDomain[2];
currentDomain = "www.bubblebox.com";
cover._visible = false;
if (currentDomain == "www.bubblebox.com") {
onEnterFrame = function () {
loadprogress = (this.getBytesLoaded() / this.getBytesTotal()) * 100;
if (loadprogress >= 100) {
playBtn._visible = true;
gs.TweenFilterLite.to(playBtn, 5, {_alpha:100});
delete this.onEnterFrame;
loader._visible = false;
}
loader.loadBar._xscale = loadprogress;
};
} else {
cover._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
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);
}
this.createEmptyMovieClip("gunShotHolder", this.getNextHighestDepth());
gunShot = new Sound(gunShotHolder);
gunShot.attachSound("gunShot");
this.createEmptyMovieClip("musicHolder1", this.getNextHighestDepth());
music1 = new Sound(musicHolder1);
music1.attachSound("music1");
music1.start(0, 999);
music1.setVolume(50);
this.createEmptyMovieClip("heartbeatHolder", this.getNextHighestDepth());
heartbeat = new Sound(heartbeatHolder);
heartbeat.attachSound("heartbeat");
heartbeat.start(0, 999);
heartbeat.setVolume(0);
this.createEmptyMovieClip("reloadGunHolder", this.getNextHighestDepth());
reloadGun = new Sound(reloadGunHolder);
reloadGun.attachSound("reload");
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("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);
__com_mochibot__("a4b4e799", this, 10301, true);
Frame 24
var menuToPlay = "";
var mission = 0;
var shotsFired = 0;
var kills = 0;
var headShots = 0;
var bodyShots = 0;
var misses = 0;
var gamemode = "";
so = SharedObject.getLocal("scope5");
if (so.data.mission == undefined) {
so.data.mission = 0;
so.data.headShots = 0;
so.data.bodyShots = 0;
so.data.misses = 0;
so.data.gamemode = "";
}
trace(so.data.gamemode);
mission = so.data.mission;
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=1312&subid=moregames", "_blank");
};
titleScreen.hiscoresBtn.onRelease = function () {
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1312&subid=scores&action=viewscores", "_blank");
};
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.mission = 0;
so.data.headShots = 0;
so.data.bodyShots = 0;
so.data.misses = 0;
_root.headShots = 0;
_root.bodyShots = 0;
_root.misses = 0;
};
savedGame.missionNumber.text = (("YOUR SAVED MISSION : " + (mission + 1)) + " : ") + so.data.gamemode.toUpperCase();
savedGame.reflection.missionNumber.text = (("YOUR SAVED MISSION : " + (mission + 1)) + " : ") + so.data.gamemode.toUpperCase();
trace(so.data.gamemode);
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 () {
so.data.gamemode = "easy";
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");
};
instructions.hardBtn.onRelease = function () {
so.data.gamemode = "hard";
menuToPlay = "briefing";
fader.play();
};
Frame 69
function createExploder(startX, startY, floor) {
nCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
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].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 + 1;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 10) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local4 = 1 - (Math.random() * 2);
var _local3 = -(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 = _local4;
this[_local2].dy = _local3;
this[_local2].counter = 1;
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;
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
this[_local2].onEnterFrame = function () {
this.counter++;
if (this.counter >= life) {
this._alpha = this._alpha - 1;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
var fail1 = "The shot wasn't a kill, you only winged him.";
var fail2 = "You took out the wrong target, we cannot allow this to happen";
var fail3 = "Too slow, the target has moved off out of range, we are not happy.";
var fail4 = "The guard reported in to his seniors. This was a covert operation, no one should find out.";
var fail5 = "The guard called for backup, the target can't be eliminated.";
var fail6 = "The alarm was raised, our agent could not enter the compound, we are disappointed with your failure.";
var fail7 = "You have to take out the targets separately, if one sees you shooting you wont be able to get the other.";
var fail8 = "The enemy sniper succeeded in eliminating the senator, you have failed to protect him";
var fail9 = "you blew it, one of the bodyguards spotted the take down";
var fail10 = "We said no civilian casualties, are you listening soldier.";
var fail11 = "The bomb went off, you didn't take them out in time, we are disappointed in you.";
var fail12 = "Too slow the target is safe behind bullet proof screens";
var briefheader0 = "The Arches";
var briefing0 = "The leader of a terrorist cell is set to rendezvous with some associates at the arches, we need him eliminated. We don't know his identity but have hear he has bad habits.";
var debriefing0 = "Nice job but that was an easy assignment.";
var briefheader1 = "The Seafront";
var briefing1 = "You're still a rookie, lets make this another easy one. A small time drug dealer will be taking a walk down by the beach this morning.\n\n He's not expecting it, so it should be an easy kill, avoid casualties.";
var debriefing1 = "Well done, efficient and ruthless, we like that.";
var briefheader2 = "The Easy Diner";
var briefing2 = "An informant has told us two gang members are meeting up at the easy diner, all we know is one of them drives an audi, we cant afford innocent deaths so be careful.\n\n Dont let the gang members see you shoot them else they'll blow our cover.\n\n They will need to taken down separately.";
var debriefing2 = "Targets eliminated, although one of those individuals was apparently not a gang member, we have yet to find out who he was working for.";
var briefheader3 = "Arrivals";
var briefing3 = "A foreign diplomat is arriving at LA airport, he has known terrorist links. We have to take him down before he reaches his destination, the target will have a brief case. He's a nervous character so expect him to use civilians as a shield, we can't afford civilian casualties on this one.";
var debriefing3 = "Excellent work, not an easy assignment that one. We recovered vital information. Well done.";
var briefheader4 = "Hexagon Plaza";
var briefing4 = "Intelligence says that official data is being leaked from a corporation on Hexagon Plaza. The mole's accomplice is a guard in the building, take them both out. ";
var debriefing4 = "Nice, your work has been noticed by people higher up. You'll go places, we have some more juicy missions planned for you";
var briefheader5 = "Central Station";
var briefing5 = "An enemy spy is on a train heading through central station. He'll be carrying a case and wearing a hat. Its not his stop though, so its up to you to find a way to get him off that train, take whatever means necessary. It's vital he doesn't meet his target";
var debriefing5 = "The driver was shot, an innocent man. However sometimes sacrifices have to be made.";
var briefheader6 = "Carlotta";
var briefing6 = "We've found the location of one of the top underworld bosses.\n\n The only time he's not guarded is when he's asleep.\n\n You'll have to find a way to wake him up first though. \n\n watch out he has a strongroom on the far left of the building.";
var debriefing6 = "Good job, he never made it to his strong room, we found evidence linking this target to various deals, he's been involved in a large arms deal recently, but we never recovered the money. ";
var briefheader7 = "Costal Road";
var briefing7 = "The guy at Easy Diner was a body double, we've located him via cell phone coordinates driving along the coast.\n\n There's only a small window of opportunity for the kill.\n\n Take him down.";
var debriefing7 = "We found a large stash of money in the boot of that car. ";
var briefheader8 = "Hotel Siege";
var briefing8 = "A group of terrorists are holed up inside a hotel. They have issued a warning that they have placed explosives around the complex. You only have 45 seconds to eliminate all the terrorists.";
var debriefing8 = "All targets neutralised, the bomb was successfully disarmed. Well done soldier.";
var briefheader9 = "Security Compound";
var briefing9 = "Our agent needs access to an enemy military base, theres 3 guards on patrol, you'll have to be careful, take them all out without the alarm being raised.\n\nThe weak point is the guard in the tower can only see the guard when they are in front of the tower.";
var debriefing9 = "Agent X entered the compound undetected, well done, we captured vital enemy plans.";
var briefheader10 = "Axis Night Club";
var briefing10 = "A well known mobster will be arriving at the back entrance to the axis club, it's not secure.\n\n He's got 2 guards with him, they need to be eliminated separately, else the alarm will get raised.";
var debriefing10 = "All 3 targets wiped out with maximum efficiency, well done solider.";
var briefheader11 = "Operation Protection";
var briefing11 = "The senator has decided unwisely to take a jog through the city, we have details of an assassination plot. Make sure he survives.";
var debriefing11 = "Well done all 3 enemy snipers were eliminated and the senator survived.";
var briefheader12 = "Alpine Take Down";
var briefing12 = "A known enemy agent has secured plans to our new weapon, he's taking the swiss cable car back over the alps.\n\n It's a tough shot from distance but we reckon you are the agent for the job.";
var debriefing12 = "debriefing 2";
briefing.continueBtn.onRelease = function () {
menuToPlay = "lvl" + mission;
fader.play();
gs.TweenFilterLite.to(musicHolder1, 4, {volume:10});
gs.TweenFilterLite.to(heartbeatHolder, 6, {volume:80});
};
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() + " :: MISSION ") + (mission + 1)) + "/12";
briefing.brieftext.text = this["briefing" + mission];
briefing.reflection.missionNumber.text = ((this["briefheader" + mission].toUpperCase() + " :: MISSION ") + (mission + 1)) + "/12";
logoBtn.onRelease = function () {
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1312&subid=briefingScreen", "_blank");
};
Frame 156
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 totalKills = (headShots + (bodyShots / 2));
var rounder = ((totalKills / shotsFired) * 100);
var percentage = (Math.ceil(rounder * 100) / 100);
if (percentage == NaN) {
percentage = "0.0";
}
debrief.accuracy.text = ("ACCURACY ::" + percentage) + "%";
debrief.debrief.text = this["debriefing" + mission];
mission++;
debrief.headShots.text = headShots;
debrief.bodyShots.text = bodyShots;
debrief.misses.text = misses;
so.data.mission = mission;
so.data.headShots = headShots;
so.data.bodyShots = bodyShots;
so.data.misses = misses;
Frame 171
debriefFail.retryBtn.onRelease = function () {
menuToPlay = "briefing";
fader.play();
};
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=1312&subid=walkthrough&action=walkthrough_sniper", "_blank");
};
Mouse.show();
var totalKills = (headShots + (bodyShots / 0.5));
var rounder = ((totalKills / shotsFired) * 100);
var percentage = (Math.ceil(rounder * 100) / 100);
debriefFail.accuracy.text = ("ACCURACY ::" + percentage) + "%";
debriefFail.debrief.text = this["fail" + failedReason];
debriefFail.headShots.text = headShots;
debriefFail.bodyShots.text = bodyShots;
debriefFail.misses.text = misses;
Frame 183
var totalKills = (headShots + (bodyShots / 2));
var rounder = ((totalKills / shotsFired) * 100);
var percentage = (Math.ceil(rounder * 100) / 100);
yourAccuracy.text = percentage + "%";
if (so.data.gamemode == "hard") {
percentage = percentage * 125;
yourAccuracy.text = (percentage + 25) + "%";
} else {
percentage = percentage * 100;
}
yourScore.text = percentage;
score = percentage;
stop();
backMenu.onRelease = function () {
gotoAndStop ("menu");
};
so.data.mission = 0;
so.data.headShots = 0;
so.data.bodyShots = 0;
so.data.misses = 0;
headShots = 0;
bodyShots = 0;
misses = 0;
mission = 0;
Symbol 22 MovieClip Frame 1
stop();
Symbol 22 MovieClip Frame 10
stop();
Symbol 1970 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 1971 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 1972 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 75 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 10
stop();
Symbol 77 MovieClip Frame 1
this._parent.stop();
this.link.onRelease = function () {
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1312&subid=splash", "_blank");
};
Symbol 77 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 77 MovieClip Frame 161
stop();
this._parent.play();
Symbol 88 MovieClip Frame 1
stop();
Symbol 88 MovieClip Frame 10
stop();
Symbol 93 MovieClip Frame 1
stop();
Symbol 97 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");
};
Symbol 97 MovieClip Frame 191
stop();
Symbol 99 MovieClip Frame 1
stop();
this._visible = false;
Symbol 99 MovieClip Frame 2
this._visible = true;
Symbol 99 MovieClip Frame 20
_parent.gotoAndStop(_parent.menuToPlay);
Symbol 104 MovieClip Frame 1
stop();
Symbol 104 MovieClip Frame 10
stop();
Symbol 109 MovieClip Frame 1
stop();
Symbol 109 MovieClip Frame 10
stop();
Symbol 242 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 249 MovieClip Frame 1
stop();
Symbol 249 MovieClip Frame 10
stop();
Symbol 252 MovieClip Frame 1
stop();
Symbol 252 MovieClip Frame 10
stop();
Symbol 397 MovieClip Frame 197
gotoAndPlay ("idle");
Symbol 397 MovieClip Frame 230
stop();
Symbol 397 MovieClip Frame 268
stop();
Symbol 591 MovieClip Frame 124
gotoAndPlay ("idle");
Symbol 591 MovieClip Frame 170
stop();
Symbol 591 MovieClip Frame 216
stop();
Symbol 596 MovieClip Frame 1
stop();
Symbol 596 MovieClip Frame 20
stop();
Symbol 597 MovieClip Frame 777
var i = 1;
while (i <= 4) {
this["door" + i].gotoAndPlay("open");
i++;
}
Symbol 772 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 772 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 772 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 772 MovieClip Frame 336
stop();
Symbol 772 MovieClip Frame 393
stop();
Symbol 772 MovieClip Frame 439
stop();
Symbol 784 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("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, 2, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (!foreground.hitTest(point.x, point.y, 1)) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
trace("winged");
allShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.body.hitTest(point.x, point.y, 1)) {
trace("bodyShot");
allShotArray[_local3] = false;
bodyShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
trace("headShot");
allShotArray[_local3] = false;
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) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
} else if (((allShotArray[_local3] == true) && (bodyShotArray[_local3] == false)) && (headShotArray[_local3] == false)) {
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
_parent.smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.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:70});
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:70});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
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() {
trace("failed");
_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() {
trace("complete");
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
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 createExploder(startX, startY, floor) {
nCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
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].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 + 1;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 10) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local4 = 1 - (Math.random() * 2);
var _local3 = -(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 = _local4;
this[_local2].dy = _local3;
this[_local2].counter = 1;
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;
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
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.man.gotoAndPlay("crouch");
man3.man.gotoAndPlay("crouch");
cleanLevel(true);
gs.TweenFilterLite.to(_parent.thearchesHolder, 4, {volume:0});
}
if (allShotArray[1] == true) {
cleanLevel(false);
_parent.failedReason = 1;
gs.TweenFilterLite.to(_parent.thearchesHolder, 4, {volume:0});
}
if (((((((((headShotArray[2] == true) || (bodyShotArray[2] == true)) || (allShotArray[2] == true)) || (headShotArray[3] == true)) || (bodyShotArray[3] == true)) || (allShotArray[3] == true)) || (headShotArray[4] == true)) || (bodyShotArray[4] == true)) || (allShotArray[4] == true)) {
cleanLevel(false);
_parent.failedReason = 2;
gs.TweenFilterLite.to(_parent.thearchesHolder, 4, {volume:0});
}
}
Mouse.hide();
var scopeWobble = 20;
var scopeWobbleBack = 4;
if (_parent.so.data.gamemode == "easy") {
scopeWobble = 0;
}
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
sniperScope.scope.blocked._visible = false;
toggleArt._visible = false;
resetShots();
var mouseListener = new Object();
mouseListener.onMouseMove = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
};
mouseListener.onMouseDown = function () {
if ((!reload) && (scopeToggle)) {
_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});
sniperScope._x = this._xmouse;
sniperScope._y = this._ymouse;
var scopeHiding = false;
var scopeToggle = true;
var myListener = new Object();
myListener.onKeyDown = function () {
trace("toggle");
if ((Key.getCode() == 32) && (!scopeHiding)) {
scopeHiding = true;
if (scopeToggle) {
scopeToggle = false;
toggleArt._visible = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
} else {
toggleArt._visible = false;
scopeToggle = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:175, _yscale:175, _alpha:100, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
}
}
};
Key.addListener(myListener);
onEnterFrame = function () {
point = convCoords(sniperScope.scope, sniperScope);
toggleArt._x = point.x;
toggleArt._y = point.y;
};
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
gs.TweenFilterLite.to(_parent.thearchesHolder, 4, {volume:100});
menOnLevel = 4;
initMission(menOnLevel);
var targetToHit = Array(0, 1, 0, 0);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 906 MovieClip Frame 1
gotoAndPlay(Math.round(Math.random() * 10));
Symbol 906 MovieClip Frame 33
gotoAndPlay ("walk");
Symbol 906 MovieClip Frame 115
gotoAndPlay ("run");
Symbol 906 MovieClip Frame 149
stop();
Symbol 906 MovieClip Frame 189
stop();
Symbol 906 MovieClip Frame 227
stop();
Symbol 907 MovieClip Frame 559
stop();
_parent.cleanLevel(false);
_parent._parent.failedReason = 3;
Symbol 1036 MovieClip Frame 34
gotoAndPlay ("idle");
Symbol 1036 MovieClip Frame 36
gotoAndPlay ("run");
Symbol 1036 MovieClip Frame 66
stop();
Symbol 1036 MovieClip Frame 120
stop();
Symbol 1036 MovieClip Frame 166
stop();
Symbol 1220 MovieClip Frame 1
gotoAndPlay(Math.round(Math.random() * 100));
Symbol 1220 MovieClip Frame 175
gotoAndPlay (2);
Symbol 1220 MovieClip Frame 219
stop();
Symbol 1220 MovieClip Frame 263
stop();
Symbol 1222 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("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, 2, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (!foreground.hitTest(point.x, point.y, 1)) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
trace("winged");
allShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.body.hitTest(point.x, point.y, 1)) {
trace("bodyShot");
allShotArray[_local3] = false;
bodyShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
trace("headShot");
allShotArray[_local3] = false;
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) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
} else if (((allShotArray[_local3] == true) && (bodyShotArray[_local3] == false)) && (headShotArray[_local3] == false)) {
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
_parent.smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.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:70});
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:70});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
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() {
trace("failed");
_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() {
trace("complete");
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
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 createExploder(startX, startY, floor) {
nCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
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].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 + 1;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 10) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local4 = 1 - (Math.random() * 2);
var _local3 = -(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 = _local4;
this[_local2].dy = _local3;
this[_local2].counter = 1;
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;
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
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)) {
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
cleanLevel(true);
}
if (allShotArray[targetToHit] == true) {
cleanLevel(false);
_parent.failedReason = 1;
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
}
if ((((((headShotArray[2] == true) || (bodyShotArray[2] == true)) || (allShotArray[2] == true)) || (headShotArray[3] == true)) || (bodyShotArray[3] == true)) || (allShotArray[3] == true)) {
cleanLevel(false);
_parent.failedReason = 2;
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
}
}
Mouse.hide();
var scopeWobble = 20;
var scopeWobbleBack = 4;
if (_parent.so.data.gamemode == "easy") {
scopeWobble = 0;
}
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
sniperScope.scope.blocked._visible = false;
toggleArt._visible = false;
resetShots();
var mouseListener = new Object();
mouseListener.onMouseMove = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
};
mouseListener.onMouseDown = function () {
if ((!reload) && (scopeToggle)) {
_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});
sniperScope._x = this._xmouse;
sniperScope._y = this._ymouse;
var scopeHiding = false;
var scopeToggle = true;
var myListener = new Object();
myListener.onKeyDown = function () {
trace("toggle");
if ((Key.getCode() == 32) && (!scopeHiding)) {
scopeHiding = true;
if (scopeToggle) {
scopeToggle = false;
toggleArt._visible = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
} else {
toggleArt._visible = false;
scopeToggle = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:175, _yscale:175, _alpha:100, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
}
}
};
Key.addListener(myListener);
onEnterFrame = function () {
point = convCoords(sniperScope.scope, sniperScope);
toggleArt._x = point.x;
toggleArt._y = point.y;
};
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:70});
menOnLevel = 3;
initMission(menOnLevel);
var targetToHit = Array(0, 1, 0, 0);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 1228 MovieClip Frame 2
man.stop();
Symbol 1228 MovieClip Frame 152
man.play();
Symbol 1228 MovieClip Frame 285
man.gotoAndStop("idle");
Symbol 1228 MovieClip Frame 290
man.gotoAndPlay("walk");
Symbol 1228 MovieClip Frame 329
_parent.outside = true;
trace("out=" + _parent.outside);
Symbol 1228 MovieClip Frame 425
stop();
this._visible = false;
_parent.man7.play();
Symbol 1232 MovieClip Frame 1
stop();
man._visible = false;
Symbol 1232 MovieClip Frame 2
man._visible = true;
Symbol 1232 MovieClip Frame 27
_parent.cleanLevel(false);
_parent._parent.failedReason = 3;
_parent.stopSounds();
stop();
Symbol 1238 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("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, 2, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (!foreground.hitTest(point.x, point.y, 1)) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
trace("winged");
allShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.body.hitTest(point.x, point.y, 1)) {
trace("bodyShot");
allShotArray[_local3] = false;
bodyShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
trace("headShot");
allShotArray[_local3] = false;
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) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
} else if (((allShotArray[_local3] == true) && (bodyShotArray[_local3] == false)) && (headShotArray[_local3] == false)) {
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
_parent.smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.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:70});
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:70});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
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() {
trace("failed");
_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() {
trace("complete");
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
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 createExploder(startX, startY, floor) {
nCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
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].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 + 1;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 10) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local4 = 1 - (Math.random() * 2);
var _local3 = -(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 = _local4;
this[_local2].dy = _local3;
this[_local2].counter = 1;
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;
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
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[7] == true) || (bodyShotArray[7] == true))) && ((headShotArray[2] == true) || (bodyShotArray[2] == true))) && (outside == true)) {
cleanLevel(true);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
if ((allShotArray[1] == true) || (allShotArray[2] == true)) {
cleanLevel(false);
_parent.failedReason = 1;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
if (((headShotArray[1] == true) || (bodyShotArray[1] == true)) && (!outside)) {
man2.man.gotoAndPlay("crouch");
man2.man.stop();
cleanLevel(false);
_parent.failedReason = 7;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
if (((headShotArray[2] == true) || (bodyShotArray[2] == true)) && (!outside)) {
man1.man.gotoAndPlay("crouch");
man1.stop();
cleanLevel(false);
_parent.failedReason = 7;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
if (((headShotArray[3] == true) || (bodyShotArray[3] == true)) && (!outside)) {
cleanLevel(false);
_parent.failedReason = 7;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
if ((headShotArray[7] == true) || (bodyShotArray[7] == true)) {
man7.stop();
}
if (((((((((bodyShotArray[4] == true) || (bodyShotArray[5] == true)) || (bodyShotArray[6] == true)) || (headShotArray[4] == true)) || (headShotArray[5] == true)) || (headShotArray[6] == true)) || (allShotArray[4] == true)) || (allShotArray[5] == true)) || (allShotArray[6] == true)) {
cleanLevel(false);
_parent.failedReason = 2;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
}
function stopSrounds() {
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
Mouse.hide();
var scopeWobble = 20;
var scopeWobbleBack = 4;
if (_parent.so.data.gamemode == "easy") {
scopeWobble = 0;
}
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
sniperScope.scope.blocked._visible = false;
toggleArt._visible = false;
resetShots();
var mouseListener = new Object();
mouseListener.onMouseMove = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
};
mouseListener.onMouseDown = function () {
if ((!reload) && (scopeToggle)) {
_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});
sniperScope._x = this._xmouse;
sniperScope._y = this._ymouse;
var scopeHiding = false;
var scopeToggle = true;
var myListener = new Object();
myListener.onKeyDown = function () {
trace("toggle");
if ((Key.getCode() == 32) && (!scopeHiding)) {
scopeHiding = true;
if (scopeToggle) {
scopeToggle = false;
toggleArt._visible = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
} else {
toggleArt._visible = false;
scopeToggle = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:175, _yscale:175, _alpha:100, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
}
}
};
Key.addListener(myListener);
onEnterFrame = function () {
point = convCoords(sniperScope.scope, sniperScope);
toggleArt._x = point.x;
toggleArt._y = point.y;
};
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
menOnLevel = 7;
initMission(menOnLevel);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:70});
var targetToHit = Array(0, 1, 1, 0, 0, 0, 0, 1);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
var outside = false;
Symbol 1377 MovieClip Frame 32
gotoAndPlay ("walk");
Symbol 1377 MovieClip Frame 63
stop();
Symbol 1377 MovieClip Frame 93
stop();
Symbol 1377 MovieClip Frame 136
gotoAndPlay ("run");
Symbol 1378 MovieClip Frame 1
gotoAndPlay(Math.round(Math.random() * 300));
Symbol 1378 MovieClip Frame 813
gotoAndPlay (2);
Symbol 1383 MovieClip Frame 1
gotoAndPlay(Math.round(Math.random() * 300));
Symbol 1383 MovieClip Frame 751
gotoAndPlay (2);
Symbol 1413 MovieClip Frame 33
gotoAndPlay ("walk");
Symbol 1413 MovieClip Frame 115
gotoAndPlay ("run");
Symbol 1413 MovieClip Frame 159
stop();
Symbol 1413 MovieClip Frame 197
stop();
Symbol 1414 MovieClip Frame 448
man.gotoAndPlay("walk");
Symbol 1414 MovieClip Frame 827
_parent.cleanLevel(false);
_parent._parent.failedReason = 3;
stop();
Symbol 1417 MovieClip Frame 442
man.gotoAndPlay("walk");
Symbol 1417 MovieClip Frame 875
_parent.cleanLevel(false);
_parent._parent.failedReason = 3;
stop();
Symbol 1418 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("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, 2, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (!foreground.hitTest(point.x, point.y, 1)) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
trace("winged");
allShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.body.hitTest(point.x, point.y, 1)) {
trace("bodyShot");
allShotArray[_local3] = false;
bodyShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
trace("headShot");
allShotArray[_local3] = false;
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) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
} else if (((allShotArray[_local3] == true) && (bodyShotArray[_local3] == false)) && (headShotArray[_local3] == false)) {
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
_parent.smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.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:70});
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:70});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
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() {
trace("failed");
_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() {
trace("complete");
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
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 createExploder(startX, startY, floor) {
nCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
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].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 + 1;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 10) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local4 = 1 - (Math.random() * 2);
var _local3 = -(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 = _local4;
this[_local2].dy = _local3;
this[_local2].counter = 1;
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;
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
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)) {
cleanLevel(true);
man10.man.gotoAndPlay("crouch");
man11.man.gotoAndPlay("crouch");
man10.stop();
man11.stop();
gs.TweenFilterLite.to(_parent.airportHolder, 4, {volume:0});
}
if (allShotArray[1] == 1) {
cleanLevel(false);
_parent.failedReason = 2;
gs.TweenFilterLite.to(_parent.airportHolder, 4, {volume:0});
}
if (((((((((((bodyShotArray[2] == 1) || (bodyShotArray[3] == 1)) || (bodyShotArray[4] == 1)) || (bodyShotArray[5] == 1)) || (bodyShotArray[6] == 1)) || (bodyShotArray[7] == 1)) || (bodyShotArray[8] == 1)) || (bodyShotArray[9] == 1)) || (bodyShotArray[10] == 1)) || (bodyShotArray[11] == 1)) || (bodyShotArray[12])) {
cleanLevel(false);
_parent.failedReason = 10;
gs.TweenFilterLite.to(_parent.airportHolder, 4, {volume:0});
}
if (((((((((((headShotArray[2] == 1) || (headShotArray[3] == 1)) || (headShotArray[4] == 1)) || (headShotArray[5] == 1)) || (headShotArray[6] == 1)) || (headShotArray[7] == 1)) || (headShotArray[8] == 1)) || (headShotArray[9] == 1)) || (headShotArray[10] == 1)) || (headShotArray[11] == 1)) || (headShotArray[12] == 1)) {
cleanLevel(false);
_parent.failedReason = 10;
gs.TweenFilterLite.to(_parent.airportHolder, 4, {volume:0});
}
if (((((((((((allShotArray[2] == 1) || (allShotArray[3] == 1)) || (allShotArray[4] == 1)) || (allShotArray[5] == 1)) || (allShotArray[6] == 1)) || (allShotArray[7] == 1)) || (allShotArray[8] == 1)) || (allShotArray[9] == 1)) || (allShotArray[10] == 1)) || (allShotArray[11] == 1)) || (allShotArray[12] == 1)) {
cleanLevel(false);
_parent.failedReason = 10;
gs.TweenFilterLite.to(_parent.airportHolder, 4, {volume:0});
}
}
Mouse.hide();
var scopeWobble = 20;
var scopeWobbleBack = 4;
if (_parent.so.data.gamemode == "easy") {
scopeWobble = 0;
}
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
sniperScope.scope.blocked._visible = false;
toggleArt._visible = false;
resetShots();
var mouseListener = new Object();
mouseListener.onMouseMove = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
};
mouseListener.onMouseDown = function () {
if ((!reload) && (scopeToggle)) {
_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});
sniperScope._x = this._xmouse;
sniperScope._y = this._ymouse;
var scopeHiding = false;
var scopeToggle = true;
var myListener = new Object();
myListener.onKeyDown = function () {
trace("toggle");
if ((Key.getCode() == 32) && (!scopeHiding)) {
scopeHiding = true;
if (scopeToggle) {
scopeToggle = false;
toggleArt._visible = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
} else {
toggleArt._visible = false;
scopeToggle = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:175, _yscale:175, _alpha:100, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
}
}
};
Key.addListener(myListener);
onEnterFrame = function () {
point = convCoords(sniperScope.scope, sniperScope);
toggleArt._x = point.x;
toggleArt._y = point.y;
};
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
menOnLevel = 12;
initMission(menOnLevel);
gs.TweenFilterLite.to(_parent.airportHolder, 4, {volume:30});
var targetToHit = Array(0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 1431 MovieClip Frame 1
this._visible = false;
Symbol 1431 MovieClip Frame 278
this._visible = true;
Symbol 1463 MovieClip Frame 32
gotoAndPlay ("walk");
Symbol 1463 MovieClip Frame 41
gotoAndPlay ("idle");
Symbol 1463 MovieClip Frame 75
gotoAndPlay ("walk");
Symbol 1463 MovieClip Frame 125
gotoAndPlay ("run");
Symbol 1463 MovieClip Frame 169
stop();
Symbol 1463 MovieClip Frame 207
stop();
Symbol 1466 MovieClip Frame 1
stop();
Symbol 1466 MovieClip Frame 70
man.gotoAndPlay("run");
Symbol 1466 MovieClip Frame 131
man.gotoAndPlay("idle");
Symbol 1466 MovieClip Frame 278
man.gotoAndPlay("run");
Symbol 1466 MovieClip Frame 351
stop();
_parent.cleanLevel(false);
_parent._parent.failedReason = 4;
Symbol 1471 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("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, 2, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (!foreground.hitTest(point.x, point.y, 1)) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
trace("winged");
allShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.body.hitTest(point.x, point.y, 1)) {
trace("bodyShot");
allShotArray[_local3] = false;
bodyShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
trace("headShot");
allShotArray[_local3] = false;
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) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
} else if (((allShotArray[_local3] == true) && (bodyShotArray[_local3] == false)) && (headShotArray[_local3] == false)) {
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
_parent.smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.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:70});
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:70});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
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() {
trace("failed");
_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() {
trace("complete");
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
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 createExploder(startX, startY, floor) {
nCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
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].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 + 1;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 10) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local4 = 1 - (Math.random() * 2);
var _local3 = -(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 = _local4;
this[_local2].dy = _local3;
this[_local2].counter = 1;
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;
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
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 (!guardStarted) {
man1.play();
guardStarted = true;
}
if (((headShotArray[1] == 1) || (bodyShotArray[1] == 1)) && ((headShotArray[3] == 1) || (bodyShotArray[3] == 1))) {
_parent.kills = _parent.kills + 2;
cleanLevel(true);
gs.TweenFilterLite.to(_parent.cityHolder, 3, {volume:0});
}
if ((allShotArray[1] == 1) || (allShotArray[3] == 1)) {
cleanLevel(false);
_parent.failedReason = 1;
gs.TweenFilterLite.to(_parent.cityHolder, 3, {volume:0});
}
if (((((headShotArray[2] == 1) || (headShotArray[4] == 1)) || (headShotArray[5] == 1)) || (headShotArray[6] == 1)) || (headShotArray[7] == 1)) {
cleanLevel(false);
_parent.failedReason = 2;
gs.TweenFilterLite.to(_parent.cityHolder, 3, {volume:0});
}
if (((((bodyShotArray[2] == 1) || (bodyShotArray[4] == 1)) || (bodyShotArray[5] == 1)) || (bodyShotArray[6] == 1)) || (bodyShotArray[7] == 1)) {
cleanLevel(false);
_parent.failedReason = 2;
gs.TweenFilterLite.to(_parent.cityHolder, 3, {volume:0});
}
if (((((allShotArray[2] == 1) || (allShotArray[4] == 1)) || (allShotArray[5] == 1)) || (allShotArray[6] == 1)) || (allShotArray[7] == 1)) {
cleanLevel(false);
_parent.failedReason = 2;
gs.TweenFilterLite.to(_parent.cityHolder, 3, {volume:0});
}
}
Mouse.hide();
var scopeWobble = 20;
var scopeWobbleBack = 4;
if (_parent.so.data.gamemode == "easy") {
scopeWobble = 0;
}
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
sniperScope.scope.blocked._visible = false;
toggleArt._visible = false;
resetShots();
var mouseListener = new Object();
mouseListener.onMouseMove = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
};
mouseListener.onMouseDown = function () {
if ((!reload) && (scopeToggle)) {
_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});
sniperScope._x = this._xmouse;
sniperScope._y = this._ymouse;
var scopeHiding = false;
var scopeToggle = true;
var myListener = new Object();
myListener.onKeyDown = function () {
trace("toggle");
if ((Key.getCode() == 32) && (!scopeHiding)) {
scopeHiding = true;
if (scopeToggle) {
scopeToggle = false;
toggleArt._visible = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
} else {
toggleArt._visible = false;
scopeToggle = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:175, _yscale:175, _alpha:100, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
}
}
};
Key.addListener(myListener);
onEnterFrame = function () {
point = convCoords(sniperScope.scope, sniperScope);
toggleArt._x = point.x;
toggleArt._y = point.y;
};
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:70});
targetToHit = 1;
menOnLevel = 7;
initMission(menOnLevel);
var targetToHit = Array(0, 1, 0, 1, 0, 0, 0, 0, 0);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
var startedGuard = false;
Symbol 1477 MovieClip Frame 209
var i = 1;
while (i <= 4) {
this["door" + i].gotoAndPlay("open");
i++;
}
Symbol 1477 MovieClip Frame 292
var i = 1;
while (i <= 4) {
this["door" + i].gotoAndPlay("close");
i++;
}
Symbol 1477 MovieClip Frame 524
_parent.cleanLevel(false);
_parent._parent.failedReason = 3;
_parent.fadeSound();
stop();
Symbol 1478 MovieClip Frame 1
gotoAndPlay(Math.round(Math.random() * 300));
Symbol 1478 MovieClip Frame 813
gotoAndPlay (2);
Symbol 1507 MovieClip Frame 33
gotoAndPlay ("walk");
Symbol 1507 MovieClip Frame 115
gotoAndPlay ("run");
Symbol 1507 MovieClip Frame 159
stop();
Symbol 1507 MovieClip Frame 197
stop();
Symbol 1508 MovieClip Frame 1
stop();
this._visible = false;
Symbol 1508 MovieClip Frame 2
this._visible = true;
Symbol 1508 MovieClip Frame 346
_parent.cleanLevel(false);
_parent._parent.failedReason = 3;
stop();
Symbol 1509 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("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, 2, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (!foreground.hitTest(point.x, point.y, 1)) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
trace("winged");
allShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.body.hitTest(point.x, point.y, 1)) {
trace("bodyShot");
allShotArray[_local3] = false;
bodyShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
trace("headShot");
allShotArray[_local3] = false;
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) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
} else if (((allShotArray[_local3] == true) && (bodyShotArray[_local3] == false)) && (headShotArray[_local3] == false)) {
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
_parent.smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.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:70});
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:70});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
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() {
trace("failed");
_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() {
trace("complete");
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
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 createExploder(startX, startY, floor) {
nCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
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].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 + 1;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 10) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local4 = 1 - (Math.random() * 2);
var _local3 = -(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 = _local4;
this[_local2].dy = _local3;
this[_local2].counter = 1;
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;
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
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) {
man1.stop();
man3.play();
man5.man.gotoAndPlay("crouch");
}
if (bodyShotArray[1] == 1) {
man1.stop();
man3.play();
}
if ((headShotArray[3] == 1) || (bodyShotArray[3] == 1)) {
cleanLevel(true);
gs.TweenFilterLite.to(_parent.stationHolder, 4, {volume:0});
man3.stop();
man4.man.gotoAndPlay("crouch");
}
if (((((headShotArray[2] == 1) || (headShotArray[4] == 1)) || (headShotArray[5] == 1)) || (headShotArray[6] == 1)) || (headShotArray[7] == 1)) {
cleanLevel(false);
gs.TweenFilterLite.to(_parent.stationHolder, 4, {volume:0});
_parent.failedReason = 2;
}
if (((((bodyShotArray[2] == 1) || (bodyShotArray[4] == 1)) || (bodyShotArray[5] == 1)) || (bodyShotArray[6] == 1)) || (bodyShotArray[7] == 1)) {
cleanLevel(false);
gs.TweenFilterLite.to(_parent.stationHolder, 4, {volume:0});
_parent.failedReason = 2;
}
}
function fadeSound() {
gs.TweenFilterLite.to(_parent.stationHolder, 4, {volume:0});
}
Mouse.hide();
var scopeWobble = 20;
var scopeWobbleBack = 4;
if (_parent.so.data.gamemode == "easy") {
scopeWobble = 0;
}
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
sniperScope.scope.blocked._visible = false;
toggleArt._visible = false;
resetShots();
var mouseListener = new Object();
mouseListener.onMouseMove = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
};
mouseListener.onMouseDown = function () {
if ((!reload) && (scopeToggle)) {
_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});
sniperScope._x = this._xmouse;
sniperScope._y = this._ymouse;
var scopeHiding = false;
var scopeToggle = true;
var myListener = new Object();
myListener.onKeyDown = function () {
trace("toggle");
if ((Key.getCode() == 32) && (!scopeHiding)) {
scopeHiding = true;
if (scopeToggle) {
scopeToggle = false;
toggleArt._visible = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
} else {
toggleArt._visible = false;
scopeToggle = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:175, _yscale:175, _alpha:100, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
}
}
};
Key.addListener(myListener);
onEnterFrame = function () {
point = convCoords(sniperScope.scope, sniperScope);
toggleArt._x = point.x;
toggleArt._y = point.y;
};
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
var menOnLevel = 10;
initMission(menOnLevel);
gs.TweenFilterLite.to(_parent.stationHolder, 4, {volume:70});
var targetToHit = Array(0, 1, 0, 1, 0, 0, 0, 0, 0);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 1512 MovieClip Frame 1
stop();
this._visible = false;
Symbol 1512 MovieClip Frame 19
this._visible = true;
Symbol 1512 MovieClip Frame 33
man.gotoAndPlay("walk");
Symbol 1512 MovieClip Frame 74
man.gotoAndPlay("walktoRun");
Symbol 1512 MovieClip Frame 341
stop();
_parent.cleanLevel(false);
_parent._parent.failedReason = 3;
Symbol 1513 MovieClip Frame 1
this._visible = false;
Symbol 1513 MovieClip Frame 395
man.gotoAndPlay("walk");
this._visible = true;
Symbol 1513 MovieClip Frame 504
man.gotoAndStop("idle");
Symbol 1513 MovieClip Frame 531
man.gotoAndPlay("turn");
Symbol 1513 MovieClip Frame 670
this._visible = false;
Symbol 1515 MovieClip Frame 1
stop();
this._visible = false;
Symbol 1515 MovieClip Frame 5
this._visible = true;
Symbol 1520 MovieClip Frame 1
stop();
Symbol 1523 MovieClip Frame 1
stop();
Symbol 1523 MovieClip Frame 11
stop();
Symbol 1527 MovieClip Frame 1
stop();
Symbol 1527 MovieClip Frame 21
stop();
Symbol 1528 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("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, 2, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (!foreground.hitTest(point.x, point.y, 1)) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
trace("winged");
allShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.body.hitTest(point.x, point.y, 1)) {
trace("bodyShot");
allShotArray[_local3] = false;
bodyShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
trace("headShot");
allShotArray[_local3] = false;
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) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
} else if (((allShotArray[_local3] == true) && (bodyShotArray[_local3] == false)) && (headShotArray[_local3] == false)) {
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
_parent.smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.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:70});
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:70});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
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() {
trace("failed");
_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() {
trace("complete");
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
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 createExploder(startX, startY, floor) {
nCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
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].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 + 1;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 10) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local4 = 1 - (Math.random() * 2);
var _local3 = -(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 = _local4;
this[_local2].dy = _local3;
this[_local2].counter = 1;
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;
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
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)) {
cleanLevel(true);
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
}
if (headShotArray[3] == true) {
var _local3 = 1;
while (_local3 <= 4) {
this["curtain" + _local3].gotoAndStop("on");
this["lights" + _local3].gotoAndStop("on");
wire.play();
_parent.alarm.start(0, 1);
_local3++;
}
}
if ((headShotArray[3] == true) && ((headShotArray[2] == true) || (bodyShotArray[2] == true))) {
man1.play();
}
if ((headShotArray[3] == true) && ((headShotArray[2] == false) && (bodyShotArray[2] == false))) {
cleanLevel(false);
_parent.failedReason = 5;
_parent.alarm.start(0, 1);
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
}
}
Mouse.hide();
var scopeWobble = 20;
var scopeWobbleBack = 4;
if (_parent.so.data.gamemode == "easy") {
scopeWobble = 0;
}
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
sniperScope.scope.blocked._visible = false;
toggleArt._visible = false;
resetShots();
var mouseListener = new Object();
mouseListener.onMouseMove = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
};
mouseListener.onMouseDown = function () {
if ((!reload) && (scopeToggle)) {
_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});
sniperScope._x = this._xmouse;
sniperScope._y = this._ymouse;
var scopeHiding = false;
var scopeToggle = true;
var myListener = new Object();
myListener.onKeyDown = function () {
trace("toggle");
if ((Key.getCode() == 32) && (!scopeHiding)) {
scopeHiding = true;
if (scopeToggle) {
scopeToggle = false;
toggleArt._visible = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
} else {
toggleArt._visible = false;
scopeToggle = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:175, _yscale:175, _alpha:100, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
}
}
};
Key.addListener(myListener);
onEnterFrame = function () {
point = convCoords(sniperScope.scope, sniperScope);
toggleArt._x = point.x;
toggleArt._y = point.y;
};
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:50});
menOnLevel = 3;
initMission(menOnLevel);
var targetToHit = Array(0, 1, 1, 1);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 1533 MovieClip Frame 653
_parent.cleanLevel(false);
_parent._parent.failedReason = 3;
_parent.clearSound();
stop();
Symbol 1537 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("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, 2, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (!foreground.hitTest(point.x, point.y, 1)) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
trace("winged");
allShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.body.hitTest(point.x, point.y, 1)) {
trace("bodyShot");
allShotArray[_local3] = false;
bodyShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
trace("headShot");
allShotArray[_local3] = false;
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) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
} else if (((allShotArray[_local3] == true) && (bodyShotArray[_local3] == false)) && (headShotArray[_local3] == false)) {
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
_parent.smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.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:70});
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:70});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
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() {
trace("failed");
_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() {
trace("complete");
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
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 createExploder(startX, startY, floor) {
nCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
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].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 + 1;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 10) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local4 = 1 - (Math.random() * 2);
var _local3 = -(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 = _local4;
this[_local2].dy = _local3;
this[_local2].counter = 1;
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;
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
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)) {
cleanLevel(true);
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
}
}
function clearSound() {
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:0});
}
Mouse.hide();
var scopeWobble = 20;
var scopeWobbleBack = 4;
if (_parent.so.data.gamemode == "easy") {
scopeWobble = 0;
}
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
sniperScope.scope.blocked._visible = false;
toggleArt._visible = false;
resetShots();
var mouseListener = new Object();
mouseListener.onMouseMove = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
};
mouseListener.onMouseDown = function () {
if ((!reload) && (scopeToggle)) {
_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});
sniperScope._x = this._xmouse;
sniperScope._y = this._ymouse;
var scopeHiding = false;
var scopeToggle = true;
var myListener = new Object();
myListener.onKeyDown = function () {
trace("toggle");
if ((Key.getCode() == 32) && (!scopeHiding)) {
scopeHiding = true;
if (scopeToggle) {
scopeToggle = false;
toggleArt._visible = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
} else {
toggleArt._visible = false;
scopeToggle = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:175, _yscale:175, _alpha:100, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
}
}
};
Key.addListener(myListener);
onEnterFrame = function () {
point = convCoords(sniperScope.scope, sniperScope);
toggleArt._x = point.x;
toggleArt._y = point.y;
};
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
gs.TweenFilterLite.to(_parent.beachHolder, 4, {volume:70});
menOnLevel = 1;
initMission(menOnLevel);
var targetToHit = Array(0, 1);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 1636 MovieClip Frame 32
gotoAndPlay ("walk");
Symbol 1636 MovieClip Frame 79
stop();
Symbol 1636 MovieClip Frame 119
stop();
Symbol 1637 MovieClip Frame 1
gotoAndPlay(Math.round(Math.random() * 300));
Symbol 1637 MovieClip Frame 596
gotoAndPlay (2);
Symbol 1638 MovieClip Frame 1
gotoAndPlay(Math.round(Math.random() * 300));
Symbol 1638 MovieClip Frame 717
gotoAndPlay (2);
Symbol 1769 MovieClip Frame 1
stop();
Symbol 1769 MovieClip Frame 127
gotoAndStop ("lean");
Symbol 1769 MovieClip Frame 173
stop();
Symbol 1769 MovieClip Frame 221
stop();
Symbol 1770 MovieClip Frame 1
gotoAndPlay(Math.round(Math.random() * 400));
Symbol 1770 MovieClip Frame 70
man.gotoAndPlay("lean");
Symbol 1770 MovieClip Frame 526
gotoAndPlay (2);
Symbol 1771 MovieClip Frame 70
man.gotoAndPlay("lean");
Symbol 1771 MovieClip Frame 412
man.gotoAndPlay("lean");
Symbol 1778 MovieClip Frame 1
this._visible = false;
Symbol 1778 MovieClip Frame 1564
this._visible = true;
_parent.exploded = true;
Symbol 1778 MovieClip Frame 1576
stop();
_parent.cleanLevel(false);
_parent._parent.failedReason = 11;
_parent.fadeSound();
Symbol 1779 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("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, 2, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (!foreground.hitTest(point.x, point.y, 1)) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
trace("winged");
allShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.body.hitTest(point.x, point.y, 1)) {
trace("bodyShot");
allShotArray[_local3] = false;
bodyShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
trace("headShot");
allShotArray[_local3] = false;
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) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
} else if (((allShotArray[_local3] == true) && (bodyShotArray[_local3] == false)) && (headShotArray[_local3] == false)) {
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
_parent.smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.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:70});
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:70});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
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() {
trace("failed");
_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() {
trace("complete");
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
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 createExploder(startX, startY, floor) {
nCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
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].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 + 1;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 10) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local4 = 1 - (Math.random() * 2);
var _local3 = -(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 = _local4;
this[_local2].dy = _local3;
this[_local2].counter = 1;
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;
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
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 (!exploded) {
if ((((((((headShotArray[1] == true) && (headShotArray[2] == true)) && (headShotArray[3] == true)) && (headShotArray[4] == true)) && (headShotArray[5] == true)) && (headShotArray[6] == true)) && (headShotArray[7] == true)) && (headShotArray[8] == true)) {
explosion.stop();
cleanLevel(true);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
}
if ((((((((bodyShotArray[1] == true) || (bodyShotArray[2] == true)) || (bodyShotArray[3] == true)) || (bodyShotArray[4] == true)) || (bodyShotArray[5] == true)) || (bodyShotArray[6] == true)) || (bodyShotArray[7] == true)) || (bodyShotArray[8] == true)) {
cleanLevel(false);
_parent.failedReason = 1;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
if ((((((((allShotArray[1] == true) || (allShotArray[2] == true)) || (allShotArray[3] == true)) || (allShotArray[4] == true)) || (allShotArray[5] == true)) || (allShotArray[6] == true)) || (allShotArray[7] == true)) || (allShotArray[8] == true)) {
cleanLevel(false);
_parent.failedReason = 1;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
}
function fadeSound() {
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
Mouse.hide();
var scopeWobble = 20;
var scopeWobbleBack = 4;
if (_parent.so.data.gamemode == "easy") {
scopeWobble = 0;
}
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
sniperScope.scope.blocked._visible = false;
toggleArt._visible = false;
resetShots();
var mouseListener = new Object();
mouseListener.onMouseMove = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
};
mouseListener.onMouseDown = function () {
if ((!reload) && (scopeToggle)) {
_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});
sniperScope._x = this._xmouse;
sniperScope._y = this._ymouse;
var scopeHiding = false;
var scopeToggle = true;
var myListener = new Object();
myListener.onKeyDown = function () {
trace("toggle");
if ((Key.getCode() == 32) && (!scopeHiding)) {
scopeHiding = true;
if (scopeToggle) {
scopeToggle = false;
toggleArt._visible = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
} else {
toggleArt._visible = false;
scopeToggle = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:175, _yscale:175, _alpha:100, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
}
}
};
Key.addListener(myListener);
onEnterFrame = function () {
point = convCoords(sniperScope.scope, sniperScope);
toggleArt._x = point.x;
toggleArt._y = point.y;
};
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:70});
menOnLevel = 8;
initMission(menOnLevel);
var exploded = false;
var targetToHit = Array(0, 1, 1, 1, 1, 1, 1, 1, 1);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 1797 MovieClip Frame 1
stop();
Symbol 1797 MovieClip Frame 180
stop();
_parent.cleanLevel(true);
_parent.fadeSound();
Symbol 1800 MovieClip Frame 1
man.gotoAndPlay("turn");
Symbol 1805 MovieClip Frame 1
this.blindtower = true;
this.blindguard = true;
Symbol 1805 MovieClip Frame 381
man.gotoAndPlay("turn");
Symbol 1806 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("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, 2, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (!foreground.hitTest(point.x, point.y, 1)) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
trace("winged");
allShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.body.hitTest(point.x, point.y, 1)) {
trace("bodyShot");
allShotArray[_local3] = false;
bodyShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
trace("headShot");
allShotArray[_local3] = false;
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) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
} else if (((allShotArray[_local3] == true) && (bodyShotArray[_local3] == false)) && (headShotArray[_local3] == false)) {
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
_parent.smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.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:70});
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:70});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
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() {
trace("failed");
_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() {
trace("complete");
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
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 createExploder(startX, startY, floor) {
nCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
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].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 + 1;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 10) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local4 = 1 - (Math.random() * 2);
var _local3 = -(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 = _local4;
this[_local2].dy = _local3;
this[_local2].counter = 1;
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;
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
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 (!levelOver) {
if (((headShotArray[1] == true) && (headShotArray[2] == true)) && (headShotArray[3] == true)) {
agentx.play();
levelOver = true;
}
if (((bodyShotArray[1] == true) || (bodyShotArray[2] == true)) || (bodyShotArray[3] == true)) {
cleanLevel(false);
_parent.failedReason = 1;
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
}
if (headShotArray[1] == true) {
if (man2.vision.hitTest(man1._x, man1._y, 1) || (man3.vision.hitTest(man1._x, man1._y, 1))) {
cleanLevel(false);
_parent.failedReason = 6;
_parent.alarm.start(0, 1);
}
man1.vision._xscale = 0.1;
man1.vision._yscale = 0.1;
}
if (headShotArray[2] == true) {
if (man1.vision.hitTest(man2._x, man2._y, 1) || (man3.vision.hitTest(man2._x, man2._y, 1))) {
cleanLevel(false);
_parent.failedReason = 6;
_parent.alarm.start(0, 1);
}
man2.vision._xscale = 0.1;
man2.vision._yscale = 0.1;
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
}
if (headShotArray[3] == true) {
if (man1.vision.hitTest(man3._x, man3._y, 1) || (man2.vision.hitTest(man3._x, man3._y, 1))) {
cleanLevel(false);
_parent.failedReason = 6;
_parent.alarm.start(0, 1);
}
man3.vision._xscale = 0.1;
man3.vision._yscale = 0.1;
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
}
}
}
function fadeSound() {
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:0});
}
Mouse.hide();
var scopeWobble = 20;
var scopeWobbleBack = 4;
if (_parent.so.data.gamemode == "easy") {
scopeWobble = 0;
}
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
sniperScope.scope.blocked._visible = false;
toggleArt._visible = false;
resetShots();
var mouseListener = new Object();
mouseListener.onMouseMove = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
};
mouseListener.onMouseDown = function () {
if ((!reload) && (scopeToggle)) {
_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});
sniperScope._x = this._xmouse;
sniperScope._y = this._ymouse;
var scopeHiding = false;
var scopeToggle = true;
var myListener = new Object();
myListener.onKeyDown = function () {
trace("toggle");
if ((Key.getCode() == 32) && (!scopeHiding)) {
scopeHiding = true;
if (scopeToggle) {
scopeToggle = false;
toggleArt._visible = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
} else {
toggleArt._visible = false;
scopeToggle = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:175, _yscale:175, _alpha:100, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
}
}
};
Key.addListener(myListener);
onEnterFrame = function () {
point = convCoords(sniperScope.scope, sniperScope);
toggleArt._x = point.x;
toggleArt._y = point.y;
};
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
gs.TweenFilterLite.to(_parent.nightHolder, 4, {volume:50});
menOnLevel = 3;
initMission(menOnLevel);
var levelOver = false;
var targetToHit = Array(0, 1, 1, 1);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 1808 MovieClip Frame 1
stop();
this._visible = false;
Symbol 1808 MovieClip Frame 2
this._visible = true;
Symbol 1808 MovieClip Frame 293
_parent.man3pos = true;
Symbol 1808 MovieClip Frame 364
man.gotoAndPlay("turn");
Symbol 1808 MovieClip Frame 380
stop();
this._visible = false;
_parent.man4._visible = true;
Symbol 1814 MovieClip Frame 118
bigboss._visible = false;
guard1._visible = false;
_parent.man1.play();
_parent.man2.play();
Symbol 1814 MovieClip Frame 252
stop();
Symbol 1818 MovieClip Frame 1
stop();
this._visible = false;
Symbol 1818 MovieClip Frame 2
this._visible = true;
Symbol 1818 MovieClip Frame 509
_parent.man2pos = true;
Symbol 1818 MovieClip Frame 635
stop();
_parent.cleanLevel(false);
_parent._parent.failedReason = 12;
Symbol 1819 MovieClip Frame 1
this._visible = false;
Symbol 1820 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("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, 2, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (!foreground.hitTest(point.x, point.y, 1)) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
trace("winged");
allShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.body.hitTest(point.x, point.y, 1)) {
trace("bodyShot");
allShotArray[_local3] = false;
bodyShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
trace("headShot");
allShotArray[_local3] = false;
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) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
} else if (((allShotArray[_local3] == true) && (bodyShotArray[_local3] == false)) && (headShotArray[_local3] == false)) {
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
_parent.smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.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:70});
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:70});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
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() {
trace("failed");
_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() {
trace("complete");
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
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 createExploder(startX, startY, floor) {
nCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
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].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 + 1;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 10) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local4 = 1 - (Math.random() * 2);
var _local3 = -(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 = _local4;
this[_local2].dy = _local3;
this[_local2].counter = 1;
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;
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
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) || (headShotArray[1] == true)) && (man3pos == false)) {
cleanLevel(false);
_parent.failedReason = 9;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
if (((headShotArray[2] == true) || (headShotArray[2] == true)) && (man3pos == false)) {
cleanLevel(false);
_parent.failedReason = 9;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
if (((headShotArray[3] == true) || (headShotArray[3] == true)) && (man3pos == false)) {
cleanLevel(false);
_parent.failedReason = 9;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
if (((((headShotArray[3] == true) || (bodyShotArray[3] == true)) && ((headShotArray[2] == true) || (bodyShotArray[2] == true))) && ((headShotArray[4] == true) || (bodyShotArray[4] == true))) && (man3pos == true)) {
cleanLevel(true);
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:0});
}
}
Mouse.hide();
var scopeWobble = 20;
var scopeWobbleBack = 4;
if (_parent.so.data.gamemode == "easy") {
scopeWobble = 0;
}
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
sniperScope.scope.blocked._visible = false;
toggleArt._visible = false;
resetShots();
var mouseListener = new Object();
mouseListener.onMouseMove = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
};
mouseListener.onMouseDown = function () {
if ((!reload) && (scopeToggle)) {
_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});
sniperScope._x = this._xmouse;
sniperScope._y = this._ymouse;
var scopeHiding = false;
var scopeToggle = true;
var myListener = new Object();
myListener.onKeyDown = function () {
trace("toggle");
if ((Key.getCode() == 32) && (!scopeHiding)) {
scopeHiding = true;
if (scopeToggle) {
scopeToggle = false;
toggleArt._visible = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
} else {
toggleArt._visible = false;
scopeToggle = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:175, _yscale:175, _alpha:100, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
}
}
};
Key.addListener(myListener);
onEnterFrame = function () {
point = convCoords(sniperScope.scope, sniperScope);
toggleArt._x = point.x;
toggleArt._y = point.y;
};
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
menOnLevel = 4;
initMission(menOnLevel);
var man2pos = false;
var man3pos = false;
gs.TweenFilterLite.to(_parent.cityHolder, 4, {volume:70});
var targetToHit = Array(0, 1, 1, 1, 1);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 1823 MovieClip Frame 2
man.gotoAndPlay("run");
Symbol 1823 MovieClip Frame 659
stop();
_parent.cleanLevel(true);
Symbol 1892 MovieClip Frame 23
stop();
Symbol 1892 MovieClip Frame 46
stop();
Symbol 1892 MovieClip Frame 69
stop();
Symbol 1893 MovieClip Frame 2
man.stop();
Symbol 1893 MovieClip Frame 172
man.play();
Symbol 1893 MovieClip Frame 213
_parent.man1.stop();
_parent.man1.man.gotoAndPlay("headshot");
_parent.createExploder(man1.man.head._x, man1.man.head._x, 60);
_parent.cleanLevel(false);
_parent._parent.failedReason = 8;
_parent.clearSound();
Symbol 1893 MovieClip Frame 250
stop();
Symbol 1894 MovieClip Frame 2
man.stop();
Symbol 1894 MovieClip Frame 574
man.play();
Symbol 1894 MovieClip Frame 597
_parent.man1.stop();
_parent.man1.man.gotoAndPlay("headshot");
_parent.createExploder(man1.man.head._x, man1.man.head._x, 60);
_parent.cleanLevel(false);
_parent._parent.failedReason = 8;
_parent.clearSound();
Symbol 1894 MovieClip Frame 634
stop();
Symbol 1895 MovieClip Frame 2
man.stop();
Symbol 1895 MovieClip Frame 477
man.play();
Symbol 1895 MovieClip Frame 501
_parent.man1.stop();
_parent.man1.man.gotoAndPlay("headshot");
_parent.createExploder(man1.man.head._x, man1.man.head._x, 60);
_parent.cleanLevel(false);
_parent._parent.failedReason = 8;
_parent.clearSound();
Symbol 1895 MovieClip Frame 538
stop();
Symbol 1898 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("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, 2, {_y:sniperScope.scope._y + 60, onComplete:newScopeMove, onCompleteParams:[true]});
}
function checkForHits() {
var _local4 = false;
var _local6 = false;
point = convCoords(sniperScope.scope, sniperScope);
if (!foreground.hitTest(point.x, point.y, 1)) {
var _local3 = 1;
while (_local3 <= menOnLevel) {
if (this["man" + _local3].man.hitTest(point.x, point.y, 1)) {
trace("winged");
allShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.body.hitTest(point.x, point.y, 1)) {
trace("bodyShot");
allShotArray[_local3] = false;
bodyShotArray[_local3] = true;
_local4 = true;
}
if (this["man" + _local3].man.head.hitTest(point.x, point.y, 1)) {
trace("headShot");
allShotArray[_local3] = false;
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) {
if (this["man" + _local3].targetToHit) {
_parent.bodyShots++;
_local6 = true;
}
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
} else if (((allShotArray[_local3] == true) && (bodyShotArray[_local3] == false)) && (headShotArray[_local3] == false)) {
this["man" + _local3].alive = false;
this["man" + _local3].stop();
this["man" + _local3].man.gotoAndPlay("bodyShot");
}
_local3++;
}
if (!_local6) {
_parent.misses++;
}
} else {
_parent.smoker();
}
if (background.hitTest(point.x, point.y, 1)) {
smoker(point.x, point.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:70});
gs.TweenFilterLite.to(_parent.musicHolder1, 10, {volume:70});
gs.TweenFilterLite.to(_parent.heartbeatHolder, 4, {volume:0});
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() {
trace("failed");
_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() {
trace("complete");
_parent.menuToPlay = "missionComplete";
_parent.fader.play();
}
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 createExploder(startX, startY, floor) {
nCount++;
var life = 40;
var _local5 = 1 - (Math.random() * 2);
var _local4 = -(5 + (Math.random() * 2.5));
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].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 + 1;
if (this.counter >= life) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
}
function exploder(manSize) {
var _local1 = 1;
while (_local1 <= 10) {
createExploder(_xmouse, _ymouse, _ymouse + manSize);
_local1++;
}
}
function createBlood(startX, startY, floor) {
bCount++;
var life = 40;
var _local4 = 1 - (Math.random() * 2);
var _local3 = -(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 = _local4;
this[_local2].dy = _local3;
this[_local2].counter = 1;
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;
this.attachMovie("smoke", _local2, this.getNextHighestDepth(), {_x:smokex, _y:smokey});
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)) {
_parent.failedReason = 2;
}
if (((((bodyShotArray[5] == 1) || (bodyShotArray[6] == 1)) || (bodyShotArray[7] == 1)) || (bodyShotArray[8] == 1)) || (bodyShotArray[9] == 1)) {
cleanLevel(false);
_parent.failedReason = 2;
gs.TweenFilterLite.to(_parent.airportHolder, 4, {volume:0});
}
if (((((headShotArray[5] == 1) || (headShotArray[6] == 1)) || (headShotArray[7] == 1)) || (headShotArray[8] == 1)) || (headShotArray[9] == 1)) {
cleanLevel(false);
_parent.failedReason = 2;
gs.TweenFilterLite.to(_parent.airportHolder, 4, {volume:0});
}
if (((((allShotArray[5] == 1) || (allheadShotArray[6] == 1)) || (allShotArray[7] == 1)) || (allShotArray[8] == 1)) || (allShotArray[9] == 1)) {
cleanLevel(false);
_parent.failedReason = 2;
gs.TweenFilterLite.to(_parent.airportHolder, 4, {volume:0});
}
}
Mouse.hide();
var scopeWobble = 20;
var scopeWobbleBack = 4;
if (_parent.so.data.gamemode == "easy") {
scopeWobble = 0;
}
var reload = false;
var menOnLevel = 0;
var bodyShotArray = Array();
var headShotArray = Array();
var targetToHit = 0;
var breathCount = 0;
var failedReason = 0;
sniperScope.scope.blocked._visible = false;
toggleArt._visible = false;
resetShots();
var mouseListener = new Object();
mouseListener.onMouseMove = function () {
sniperScope._x = _xmouse;
sniperScope._y = _ymouse;
point = convCoords(sniperScope.scope, sniperScope);
};
mouseListener.onMouseDown = function () {
if ((!reload) && (scopeToggle)) {
_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});
sniperScope._x = this._xmouse;
sniperScope._y = this._ymouse;
var scopeHiding = false;
var scopeToggle = true;
var myListener = new Object();
myListener.onKeyDown = function () {
trace("toggle");
if ((Key.getCode() == 32) && (!scopeHiding)) {
scopeHiding = true;
if (scopeToggle) {
scopeToggle = false;
toggleArt._visible = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:250, _yscale:250, _alpha:0, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
} else {
toggleArt._visible = false;
scopeToggle = true;
gs.TweenFilterLite.to(sniperScope, 0.25, {_xscale:175, _yscale:175, _alpha:100, ease:mx.transitions.easing.Strong.easeInOut, onComplete:scopeHideEnd});
}
}
};
Key.addListener(myListener);
onEnterFrame = function () {
point = convCoords(sniperScope.scope, sniperScope);
toggleArt._x = point.x;
toggleArt._y = point.y;
};
var nCount = 0;
var bCount = 0;
var smokeCount = 0;
targetToHit = 1;
menOnLevel = 9;
initMission(menOnLevel);
var targetToHit = Array(0, 0, 1, 1, 1, 0, 0, 0, 0, 0);
i = 1;
while (i <= menOnLevel) {
this["man" + i].targetToHit = targetToHit[i];
i++;
}
Symbol 1927 MovieClip Frame 1
stop();
Symbol 1927 MovieClip Frame 10
stop();
Symbol 1935 MovieClip Frame 1
stop();
Symbol 1935 MovieClip Frame 10
stop();
Symbol 1946 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 1952 MovieClip Frame 1
stop();
Symbol 1956 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 1960 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 1963 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 = 1312;
scoreMc = this;
sendBubbleBoxScore = function (gameID) {
userData = new LoadVars();
var _local4 = (((bubbleboxGameID + "_") + _root.score) + "_") + _root.bubblebox_name;
var _local5 = (((((((((bubbleboxGameID + "_") + "4234232143214421") + "_") + _root.score) + "_") + "2537625476251") + "_") + _root.bubblebox_name) + "_") + "desleutelistessa";
var _local3 = _local5.MD5();
userData.datastring = _local4;
userData.hashstring = _local3;
var _local2 = new LoadVars();
_local2.onLoad = function (success) {
if (success) {
scoreMc.gotoAndStop("success");
} else {
scoreMc.gotoAndStop("tryagain");
}
};
userData.sendAndLoad("http://www.bubblebox.com/scripts/insertscore2008.php", _local2, "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 1963 MovieClip Frame 2
stop();
Symbol 1963 MovieClip Frame 3
this.bubblebox_view_score.onRelease = function () {
getURL (("http://www.bubblebox.com/highscores/" + this._parent.bubbleboxGameID) + ".htm", "_blank");
};
Symbol 1963 MovieClip Frame 4
this.try_again.onRelease = function () {
this._parent.gotoAndStop(1);
};