Frame 1
function siteKongregate() {
siteURL = _root._url;
if (siteURL.indexOf("kongregate.com") != -1) {
return(true);
}
return(false);
}
function disableAds() {
if (siteKongregate()) {
return(true);
}
return(false);
}
function disableTracking() {
return(false);
}
_root.createEmptyMovieClip("DTADS", _root.getNextHighestDepth());
DTADS.DTADS_url = "http://www.deadtoast.com/dtads/mfp/";
DTADS.CPMStarSubPoolID = 101;
System.security.loadPolicyFile(DTADS.DTADS_url + "dtads_policy.xml");
loadVariables (DTADS.DTADS_url + "dtads.txt", DTADS);
if (siteKongregate()) {
_global.kongregate.services.connect();
}
function mySiteLink() {
getURL ("http://www.deadtoast.com", "_blank");
}
stop();
debug = true;
timer = 0;
var rightClick = new ContextMenu();
rightClick.hideBuiltInItems();
_root.menu = rightClick;
var mySiteLink = new ContextMenuItem("Visit DeadToast.com", mySiteLink);
rightClick.customItems.push(mySiteLink);
onEnterFrame = function () {
timer++;
if (timer >= 60) {
timer = 0;
_root.nextFrame();
}
};
Frame 3
onEnterFrame = undefined;
Instance of Symbol 89 MovieClip in Frame 3
on (release) {
hover = true;
getURL ("https://www.facebook.com/DeadtoastCom", "_blank");
}
on (press) {
buttonTop._yscale = 0;
hover = false;
}
on (rollOver) {
hover = true;
}
on (rollOut) {
hover = false;
}
onClipEvent (load) {
startY = _y;
hover = false;
}
onClipEvent (enterFrame) {
if (hover) {
buttonTop._yscale = buttonTop._yscale + ((100 - buttonTop._yscale) * 0.2);
} else {
buttonTop._yscale = buttonTop._yscale + ((-buttonTop._yscale) * 0.3);
}
_y = (startY + buttonTop._height);
}
Instance of Symbol 92 MovieClip in Frame 3
on (release) {
hover = true;
getURL ("http://www.deadtoast.com", "_blank");
}
on (press) {
buttonTop._yscale = 0;
hover = false;
}
on (rollOver) {
hover = true;
}
on (rollOut) {
hover = false;
}
onClipEvent (load) {
startY = _y;
hover = false;
}
onClipEvent (enterFrame) {
if (hover) {
buttonTop._yscale = buttonTop._yscale + ((100 - buttonTop._yscale) * 0.2);
} else {
buttonTop._yscale = buttonTop._yscale + ((-buttonTop._yscale) * 0.3);
}
_y = (startY + buttonTop._height);
}
Instance of Symbol 94 MovieClip in Frame 3
on (release) {
hover = true;
getURL ("https://twitter.com/deadtoast_com", "_blank");
}
on (press) {
buttonTop._yscale = 0;
hover = false;
}
on (rollOver) {
hover = true;
}
on (rollOut) {
hover = false;
}
onClipEvent (load) {
startY = _y;
hover = false;
}
onClipEvent (enterFrame) {
if (hover) {
buttonTop._yscale = buttonTop._yscale + ((100 - buttonTop._yscale) * 0.2);
} else {
buttonTop._yscale = buttonTop._yscale + ((-buttonTop._yscale) * 0.3);
}
_y = (startY + buttonTop._height);
}
Instance of Symbol 103 MovieClip in Frame 3
onClipEvent (load) {
useBigAds = true;
}
Frame 5
function saveState() {
if ((_root._currentframe > _root.savedData.data.lastSavedFrame) || (_root.savedData.data.lastSavedFrame == undefined)) {
_root.savedData.data.lastSavedFrame = _root._currentframe;
_root.savedData.data.health = _root.health;
_root.savedData.data.knifeKills = _root.knifeKills;
_root.savedData.data.nrOfHeadShots = _root.nrOfHeadShots;
_root.savedData.data.nrOfGibs = _root.nrOfGibs;
i = 1;
while (i <= 7) {
_root.savedData.data[("weapon" + i) + "Active"] = _root[("weapon" + i) + "Active"];
_root.savedData.data["ammo" + i] = _root["ammo" + i];
_root.savedData.data[("ammo" + i) + "Total"] = _root[("ammo" + i) + "Total"];
_root.savedData.data[("ammo" + i) + "Max"] = _root[("ammo" + i) + "Max"];
i++;
}
_root.savedData.data.weapon = _root.weapon;
_root.savedData.flush();
}
saveTempState();
}
function loadState() {
_root.health = _root.savedData.data.health;
_root.knifeKills = _root.savedData.data.knifeKills;
_root.nrOfHeadShots = _root.savedData.data.nrOfHeadShots;
_root.nrOfGibs = _root.savedData.data.nrOfGibs;
i = 1;
while (i <= 7) {
_root[("weapon" + i) + "Active"] = _root.savedData.data[("weapon" + i) + "Active"];
_root["ammo" + i] = _root.savedData.data["ammo" + i];
_root[("ammo" + i) + "Total"] = _root.savedData.data[("ammo" + i) + "Total"];
_root[("ammo" + i) + "Max"] = _root.savedData.data[("ammo" + i) + "Max"];
i++;
}
_root.weapon = _root.savedData.data.weapon;
}
function saveTempState() {
_root.tempHealth = _root.health;
i = 1;
while (i <= 7) {
_root[("tempWeapon" + i) + "Active"] = _root[("weapon" + i) + "Active"];
_root["tempAmmo" + i] = _root["ammo" + i];
_root[("tempAmmo" + i) + "Total"] = _root[("ammo" + i) + "Total"];
_root[("tempAmmo" + i) + "Max"] = _root[("ammo" + i) + "Max"];
i++;
}
_root.tempWeapon = _root.weapon;
}
function loadTempState() {
_root.health = _root.tempHealth;
i = 1;
while (i <= 7) {
_root[("weapon" + i) + "Active"] = _root[("tempWeapon" + i) + "Active"];
_root["ammo" + i] = _root["tempAmmo" + i];
_root[("ammo" + i) + "Total"] = _root[("tempAmmo" + i) + "Total"];
_root[("ammo" + i) + "Max"] = _root[("tempAmmo" + i) + "Max"];
i++;
}
_root.weapon = _root.tempWeapon;
}
function unlockAchievement(nr) {
if (!_root.savedData.data["achievement" + nr]) {
if (nr == 1) {
_root.HUD.achievementDisplay.infoText.text = "Guns don't kill people";
com.newgrounds.API.unlockMedal("Guns dont kill people");
_global.kongregate.stats.submit("Achievement 1", 1);
} else if (nr == 2) {
_root.HUD.achievementDisplay.infoText.text = "Wall jumping hot shot";
com.newgrounds.API.unlockMedal("Wall jumping hot shot");
_global.kongregate.stats.submit("Achievement 2", 1);
} else if (nr == 3) {
_root.HUD.achievementDisplay.infoText.text = "Splat-attack!";
com.newgrounds.API.unlockMedal("Splat-attack");
_global.kongregate.stats.submit("Achievement 3", 1);
} else if (nr == 4) {
_root.HUD.achievementDisplay.infoText.text = "Not a scratch";
com.newgrounds.API.unlockMedal("Not a scratch");
_global.kongregate.stats.submit("Achievement 4", 1);
} else if (nr == 5) {
_root.HUD.achievementDisplay.infoText.text = "Heads up!";
com.newgrounds.API.unlockMedal("Heads up");
_global.kongregate.stats.submit("Achievement 5", 1);
} else if (nr == 6) {
_root.HUD.achievementDisplay.infoText.text = "Death from above";
com.newgrounds.API.unlockMedal("Death from above");
_global.kongregate.stats.submit("Achievement 6", 1);
}
if (nr != 7) {
_root.HUD.achievementDisplay.icon.gotoAndStop(nr);
_root.HUD.achievementDisplay._visible = true;
_root.HUD.achievementDisplay.visibleTimer = 150;
}
_root.savedData.data["achievement" + nr] = true;
_root.savedData.flush();
}
}
savedData = SharedObject.getLocal("MyFriendPedroBloodBulletsBananas");
if (_root.siteKongregate()) {
i = 1;
while (i <= 7) {
if (_root.savedData.data["achievement" + i]) {
_global.kongregate.stats.submit("Achievement " + i, 1);
}
i++;
}
}
stopAllSounds();
_root._quality = "HIGH";
Mouse.show();
for (cObject in _root) {
if (_root[cObject]._name != "DTADS") {
_root[cObject].swapDepths(_root.getNextHighestDepth());
_root[cObject].removeMovieClip();
}
}
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 0;
var fps = 0;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var weapon = 2;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - _ymouse, playerL._x - _xmouse) * 180) / Math.PI);
var mDirR = ((Math.atan2(_ymouse - (playerL._y - 30), _xmouse - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
roofWindow.broken = false;
fadeToDark = false;
levelComplete = false;
_y = 0;
_x = 0;
_root.play();
Frame 6
function playSound(sName, xPos, yPos, ranNr) {
_root.soundFX["sound" + sName] = new Sound(soundFX);
if ((ranNr != undefined) && (ranNr != 0)) {
if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound((sName + (1 + random(ranNr))) + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName + (1 + random(ranNr)));
}
} else if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound(sName + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName);
}
var _local3 = ((xPos - ((-_root._x) + 300)) / 400) * 100;
if (_local3 > 100) {
_local3 = 100;
} else if (_local3 < -100) {
_local3 = -100;
}
_root.soundFX["sound" + sName].setPan(_local3);
_root.soundFX["sound" + sName].setVolume(SFXVolume * 100);
_root.soundFX["sound" + sName].start();
}
stop();
_y = 0;
_x = 0;
onEnterFrame = undefined;
levelSelectNr = undefined;
stopAllSounds();
if (musicVolume == undefined) {
musicVolume = 1;
}
_root.createEmptyMovieClip("musicMC", _root.getNextHighestDepth());
musicMC.bgMusic = new Sound(musicMC);
musicMC.bgMusic.attachSound("bossIntro");
musicMC.bgMusic.start();
musicMC.bgMusic.setVolume(musicVolume * 100);
musicMC.bgMusic.onSoundComplete = function () {
musicMC.bgMusic.start();
};
if (SFXVolume == undefined) {
SFXVolume = 1;
}
_root.createEmptyMovieClip("soundFX", _root.getNextHighestDepth());
Instance of Symbol 486 MovieClip in Frame 6
onClipEvent (load) {
startX = _x;
startY = _y;
}
onClipEvent (enterFrame) {
if (timer == undefined) {
timer = 100 + random(40);
}
timer--;
if ((timer <= 0) && (Math.round(timer) != -1)) {
gotoAndStop (2);
_xscale = (110 + random(20));
_yscale = (110 + random(30));
_x = ((startX + 10) - random(20));
_y = ((startY + 10) - random(20));
} else {
gotoAndStop (1);
}
if (timer < -5) {
timer = 100 + random(100);
_yscale = 100;
_xscale = 100;
_x = startX;
_y = startY;
}
}
Instance of Symbol 570 MovieClip "fade" in Frame 6
onClipEvent (load) {
_alpha = 0;
}
Frame 7
stopAllSounds();
Mouse.hide();
for (cObject in _root) {
if (_root[cObject]._name != "DTADS") {
_root[cObject].swapDepths(_root.getNextHighestDepth());
_root[cObject].removeMovieClip();
}
}
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - _ymouse, playerL._x - _xmouse) * 180) / Math.PI);
var mDirR = ((Math.atan2(_ymouse - (playerL._y - 30), _xmouse - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
roofWindow.broken = false;
fadeToDark = false;
levelComplete = false;
showHint = false;
if (health <= 0) {
health = 100;
}
_root.play();
Frame 8
function sAni(anim) {
if (anim.currentFrame == undefined) {
anim.currentFrame = anim._currentframe;
}
if (timescale <= 1) {
anim.currentFrame = anim.currentFrame + timescale;
} else {
anim.currentFrame = anim.currentFrame + 1;
}
anim.gotoAndStop(Math.round(anim.currentFrame));
if (anim.currentFrame >= anim._totalframes) {
anim.currentFrame = 1;
anim.gotoAndStop(1);
}
}
function sparks(obj) {
if (obj.xSpeed == undefined) {
if (lvl.hitTest(obj._x + 5, obj._y - 5, true)) {
obj._x = obj._x - 5;
obj.xSpeed = -random(5);
} else if (lvl.hitTest(obj._x - 5, obj._y - 5, true)) {
obj._x = obj._x + 5;
obj.xSpeed = random(5);
} else {
obj.xSpeed = -5 + random(10);
}
if (lvl.hitTest(obj._x, obj._y - 5, true)) {
obj._y = obj._y + 5;
obj.fallspeed = random(5);
} else if (lvl.hitTest(obj._x, obj._y + 5, true)) {
obj._y = obj._y - 5;
obj.fallspeed = -random(5);
} else {
obj.fallspeed = -5 + random(10);
}
}
if (lvl.hitTest(obj._x, obj._y, true)) {
if (obj.fallspeed > 0) {
obj.fallspeed = (-obj.fallspeed) * 0.9;
}
}
obj.fallspeed = obj.fallspeed + (0.3 * timescale);
obj.xSpeed = obj.xSpeed + (((-obj.xSpeed) * 0.01) * timescale);
obj._alpha = obj._alpha + (((-obj._alpha) * 0.1) * timescale);
obj._y = obj._y + (obj.fallspeed * timescale);
obj._x = obj._x + (obj.xSpeed * timescale);
if (obj._alpha <= 0) {
obj.removeMovieClip();
}
}
function addSparks(xPos, yPos, amount) {
var _local4 = 0;
while (_local4++ , _local4 < (amount * particleAmount)) {
var _local3 = "spark" + _root.getNextHighestDepth();
attachMovie("spark", _local3, _root.getNextHighestDepth());
_root[_local3].onEnterFrame = function () {
sparks(this);
};
_root[_local3]._x = xPos;
_root[_local3]._y = yPos;
}
}
function glowCode(obj) {
if (obj.sizeXY == undefined) {
obj.sizeXY = 30;
obj._width = (obj._height = obj.sizeXY);
}
obj._width = (obj._height = obj.sizeXY);
obj._alpha = obj.sizeXY;
obj.sizeXY = obj.sizeXY + (((-obj.sizeXY) * 0.15) * timescale);
if (obj._alpha <= 0) {
obj.removeMovieClip();
}
}
function bulletCode(obj, friendly, power) {
if ((obj.firstFrame == undefined) && (obj._name != undefined)) {
if (lvl.hitTest(obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * -14), obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * -14), true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 7);
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
obj.firstFrame = true;
}
obj._x = obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
obj._y = obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
if (getDist(playerL._x, obj._x, playerL._y, obj._y) > 670) {
obj.removeMovieClip();
}
if (friendly) {
if (obj.rangeCheck != true) {
var _local3 = 0;
while (_local3++ , _local3 <= enemies) {
if (getDist(_root["nmy" + _local3]._x, obj._x, _root["nmy" + _local3]._y, obj._y) < 500) {
if ((_root["nmy" + _local3].gunReady != true) && (_root["nmy" + _local3].health > 0)) {
_root["nmy" + _local3].xSpeed2 = 0;
if (_root["nmy" + _local3].weapon == 1) {
_root["nmy" + _local3].gotoAndStop(3);
} else if (_root["nmy" + _local3].weapon == 6) {
_root["nmy" + _local3].gotoAndStop(7);
} else if (_root["nmy" + _local3].weapon == 7) {
_root["nmy" + _local3].gotoAndStop(8);
} else if (_root["nmy" + _local3].weapon == 3) {
_root["nmy" + _local3].gotoAndStop(9);
}
_root["nmy" + _local3].timer = 42 + random(5);
}
}
}
obj.rangeCheck = true;
}
var _local3 = 0;
while (_local3++ , _local3 <= enemies) {
if (_root["nmy" + _local3].hitTest(obj._x, obj._y, true)) {
if ((obj._y < (_root["nmy" + _local3]._y - 22)) && (_root["nmy" + _local3].health > 0)) {
if ((obj._x < (_root["nmy" + _local3]._x + 19)) && (obj._x > (_root["nmy" + _local3]._x - 19))) {
if ((_root["nmy" + _local3].health - (power * 3)) > 0) {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - (power * 3);
} else {
_root["nmy" + _local3].health = 0;
}
_root.nrOfHeadShots++;
if (_root.nrOfHeadShots >= 20) {
_root.unlockAchievement(5);
}
} else {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - power;
}
} else {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - power;
}
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
if ((_root["nmy" + _local3].gunReady != true) && (_root["nmy" + _local3].health > 0)) {
_root["nmy" + _local3].xSpeed2 = 0;
if (_root["nmy" + _local3].weapon == 1) {
_root["nmy" + _local3].gotoAndStop(3);
} else if (_root["nmy" + _local3].weapon == 6) {
_root["nmy" + _local3].gotoAndStop(7);
} else if (_root["nmy" + _local3].weapon == 7) {
_root["nmy" + _local3].gotoAndStop(8);
} else if (_root["nmy" + _local3].weapon == 3) {
_root["nmy" + _local3].gotoAndStop(9);
}
_root["nmy" + _local3].timer = 21 + random(5);
}
obj.removeMovieClip();
}
}
} else if (playerL.hitTest(obj._x, obj._y, true) || (playerB.hitTest(obj._x, obj._y, true))) {
health = health - (power / 2);
HUD.damage._alpha = HUD.damage._alpha + (power * 4);
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
obj.removeMovieClip();
}
var _local3 = 0;
while (_local3++ , _local3 <= gasCans) {
if (_root["gasCan" + _local3].hitTest(obj._x, obj._y, true)) {
explName = "expl" + _root.getNextHighestDepth();
attachMovie("explosion", explName, _root.getNextHighestDepth());
_root[explName]._x = _root["gasCan" + _local3]._x;
_root[explName]._y = _root["gasCan" + _local3]._y;
_root[explName]._xscale = (_root[explName]._yscale = 50);
_root["gasCan" + _local3].swapDepths(_root.getNextHighestDepth());
_root["gasCan" + _local3].removeMovieClip();
_local3 = 0;
while (_local3++ , _local3 <= enemies) {
if ((getDist(_root["nmy" + _local3]._x, obj._x, _root["nmy" + _local3]._y, obj._y) < 130) && (_root["nmy" + _local3]._y < _root[explName]._y)) {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - 50;
}
}
obj.removeMovieClip();
}
}
if (obj._name != undefined) {
if (lvl.hitTest(obj._x, obj._y, true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 4 + random(4));
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
}
}
function addGlow(xPos, yPos, alpha, size) {
glowName = "glow" + _root.getNextHighestDepth();
attachMovie("glow", glowName, _root.getNextHighestDepth());
_root[glowName]._x = xPos;
_root[glowName]._y = yPos;
_root[glowName]._alpha = alpha;
_root[glowName]._width = (_root[glowName]._height = size);
_root[glowName].onEnterFrame = function () {
glowCode(this);
};
}
function getDist(x1, x2, y1, y2) {
return(Math.sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2))));
}
function onScreen(X, Y) {
if ((((X > (-_root._x)) && (X < ((-_root._x) + 600))) && (Y > (-_root._y))) && (Y < ((-_root._y) + 450))) {
return(true);
}
return(false);
}
function gangster(obj) {
if (obj.playerX == undefined) {
obj.timer = 30 + random(40);
obj.dead = false;
if (obj.health == undefined) {
obj.health = 20;
}
obj.gunTimer = 5;
obj.roundsFired = 0;
obj.recoil = 0;
obj.xscale = obj._xscale;
obj.xSpeed = (obj.xSpeed2 = 0);
obj.playerY = playerL._y;
if (!obj.dontRandomizeXScale) {
if (random(2) == 1) {
obj._xscale = -obj.xscale;
}
}
obj.playerX = playerL._x;
}
obj.timer = obj.timer - timescale;
obj.playerY = obj.playerY + (((playerL._y + playerL.legs.bodyPos._y) - obj.playerY) * (0.05 * timescale));
obj.playerX = obj.playerX + ((playerL._x - obj.playerX) * (0.05 * timescale));
obj.playerDir2 = (Math.atan2(obj.playerY - obj._y, obj.playerX - obj._x) * 180) / Math.PI;
if (obj.activated && (obj.health > 0)) {
if (obj.gunReady) {
obj.gunTimer = obj.gunTimer - timescale;
if ((obj.gunTimer <= 0) && (getDist(obj._x, playerL._x, obj._y, playerL._y) < 600)) {
var _local5 = 0;
obj.sightClear = true;
while (_local5 < getDist(obj._x, playerL._x, obj._y, playerL._y)) {
if (lvl.hitTest(obj._x + (Math.sin((obj.playerDir2 + 90) * (Math.PI/180)) * _local5), (obj._y - 30) - (Math.cos((obj.playerDir2 + 90) * (Math.PI/180)) * _local5), true)) {
obj.sightClear = false;
_local5 = 9999;
}
_local5 = _local5 + 10;
}
if (obj.sightClear) {
obj.mDir = (Math.atan2(obj._y - obj.playerY, obj._x - obj.playerX) * 180) / Math.PI;
obj.mDirR = (Math.atan2(obj.playerY - obj._y, obj.playerX - obj._x) * 180) / Math.PI;
var _local3 = "smoke" + _root.getNextHighestDepth();
attachMovie("smoke", _local3, _root.getNextHighestDepth());
_root[_local3].ySpeed = -1.3 - (0.01 * random(70));
_root[_local3]._xscale = (_root[_local3]._yscale = 70 + random(30));
_root[_local3].onEnterFrame = function () {
this._y = this._y + (this.ySpeed * timescale);
this.ySpeed = this.ySpeed + (((-this.ySpeed) * 0.02) * timescale);
this._xscale = (this._yscale = this._yscale - (this.ySpeed * timescale));
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
var _local8 = "mF" + _root.getNextHighestDepth();
attachMovie("muzzle", _local8, _root.getNextHighestDepth());
_root[_local8]._xscale = (_root[_local8]._yscale = 25);
var _local9 = "bu" + _root.getNextHighestDepth();
var _local4 = "sh" + _root.getNextHighestDepth();
attachMovie("shell", _local4, _root.getNextHighestDepth());
if (obj.weapon == 1) {
playSound("pistolShot", obj._x, obj._y);
attachMovie("bullet", _local9, _root.getNextHighestDepth());
_root[_local8]._x = (_root[_local3]._x = (_root[_local9]._x = (obj._x + (Math.sin((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * 15)) * (Math.PI/180)) * 20)) + (Math.sin((((-obj.mDir) - 90) + ((obj._xscale / Math.abs(obj._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local8]._y = (_root[_local3]._y = (_root[_local9]._y = (obj._y - (Math.cos((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * 15)) * (Math.PI/180)) * 20)) + (Math.cos((((-obj.mDir) - 90) + ((obj._xscale / Math.abs(obj._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (obj._x + (Math.sin((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * 15)) * (Math.PI/180)) * 20)) + (Math.sin((((-obj.mDir) - 90) + ((obj._xscale / Math.abs(obj._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (obj._y - (Math.cos((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * 15)) * (Math.PI/180)) * 20)) + (Math.cos((((-obj.mDir) - 90) + ((obj._xscale / Math.abs(obj._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4].gotoAndStop(1);
_root[_local9]._rotation = obj.mDirR;
addGlow(_root[_local9]._x, _root[_local9]._y, 30, 130);
_root[_local9].onEnterFrame = function () {
bulletCode(this, false, 7);
};
obj.recoil = obj.recoil + 10;
obj.gunTimer = 20 + random(20);
} else if (obj.weapon == 6) {
playSound("shotgunShot", obj._x, obj._y);
_local5 = 0;
while (_local5++ , _local5 < 10) {
_local9 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local9, _root.getNextHighestDepth());
_root[_local9]._x = (obj._x + (Math.sin((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local9]._y = (obj._y - (Math.cos((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local9]._rotation = (obj.mDirR - 7) + random(14);
_root[_local9].gotoAndStop(2);
_root[_local9].onEnterFrame = function () {
bulletCode(this, false, 3);
};
}
_root[_local8]._x = (_root[_local3]._x = (obj._x + (Math.sin((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local8]._y = (_root[_local3]._y = (obj._y - (Math.cos((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local4]._x = (obj._x + (Math.sin((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4]._y = (obj._y - (Math.cos((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4].gotoAndStop(2);
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
obj.gunTimer = 40 + random(10);
obj.recoil = obj.recoil + 18;
} else if (obj.weapon == 7) {
playSound("m16Shot", obj._x, obj._y);
_local9 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local9, _root.getNextHighestDepth());
_root[_local9]._rotation = obj.mDirR;
_root[_local9].gotoAndStop(1);
_root[_local9].onEnterFrame = function () {
bulletCode(this, false, 6);
};
_root[_local8]._x = (_root[_local3]._x = (_root[_local9]._x = obj._x + (Math.sin((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 57)));
_root[_local8]._y = (_root[_local3]._y = (_root[_local9]._y = (obj._y - 18) + (Math.cos((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 57)));
_root[_local4]._x = obj._x + (Math.sin((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4]._y = (obj._y - 27.3) + (Math.cos((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4].gotoAndStop(1);
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
obj.gunTimer = 2;
obj.recoil = obj.recoil + 0.8;
obj.roundsFired++;
var _local10 = 6 + random(5);
if (obj.roundsFired > _local10) {
obj.gunTimer = 30 + random(30);
obj.roundsFired = 0;
}
} else if (obj.weapon == 3) {
playSound("uziShot", obj._x, obj._y, 3);
_local9 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local9, _root.getNextHighestDepth());
_root[_local9]._rotation = obj.mDirR;
_root[_local9].gotoAndStop(1);
_root[_local9].onEnterFrame = function () {
bulletCode(this, false, 4);
};
_root[_local8]._x = (_root[_local3]._x = (_root[_local9]._x = (obj._x + (Math.sin((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * 15)) * (Math.PI/180)) * 20)) + (Math.sin((((-obj.mDir) - 90) + ((obj._xscale / Math.abs(obj._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local8]._y = (_root[_local3]._y = (_root[_local9]._y = (obj._y - (Math.cos((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * 15)) * (Math.PI/180)) * 20)) + (Math.cos((((-obj.mDir) - 90) + ((obj._xscale / Math.abs(obj._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = obj._x + (Math.sin((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4]._y = (obj._y - 27.3) + (Math.cos((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4].gotoAndStop(1);
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
obj.gunTimer = 3;
obj.recoil = obj.recoil + 0.8;
obj.roundsFired++;
var _local10 = 3 + random(2);
if (obj.roundsFired > _local10) {
obj.gunTimer = 23 + random(30);
obj.roundsFired = 0;
}
}
_root[_local8]._rotation = obj.mDirR;
_root[_local4].fallspeed = -3;
_root[_local4].xSpeed = -1.5 + (0.01 * random(300));
_root[_local4]._alpha = 300;
_root[_local4].rotSpeed = -10 + (0.01 * random(2000));
_root[_local4].onEnterFrame = function () {
this._y = this._y + (this.fallspeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this._x = this._x + (this.xSpeed * timescale);
this._rotation = this._rotation + (this.rotSpeed * timescale);
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = (-this.fallspeed) * 0.5;
this.xSpeed = this.xSpeed * 0.8;
this.rotSpeed = this.rotSpeed * 0.8;
this._y = this._y + (this.fallspeed * 2);
}
};
}
}
obj.recoil = obj.recoil + ((-obj.recoil) * (0.1 * timescale));
if (obj.timer <= 0) {
if (obj.playerX < obj._x) {
if ((obj.playerX + 260) < obj._x) {
obj.xSpeed2 = -2;
} else if ((obj.playerX + 200) > obj._x) {
obj.xSpeed2 = 2;
} else {
obj.xSpeed2 = 0;
}
} else if ((obj.playerX - 260) > obj._x) {
obj.xSpeed2 = 2;
} else if ((obj.playerX - 200) < obj._x) {
obj.xSpeed2 = -2;
} else {
obj.xSpeed2 = 0;
}
obj.timer = 30 + random(10);
}
if (obj.playerX < obj._x) {
if (obj.platform != 0) {
if (obj.xSpeed2 > 0) {
obj.legs.gotoAndStop(3);
} else if (obj.xSpeed2 < 0) {
obj.legs.gotoAndStop(2);
} else {
obj.legs.gotoAndStop(1);
}
} else {
obj.legs.gotoAndStop(1);
}
obj._xscale = -obj.xscale;
obj.playerDir = -((Math.atan2(obj._y - obj.playerY, obj._x - obj.playerX) * 180) / Math.PI);
obj.body._rotation = obj.playerDir * 0.3;
obj.body.arm._rotation = (obj.playerDir - obj.body._rotation) - obj.recoil;
obj.body.head._rotation = obj.playerDir - obj.body._rotation;
} else {
if (obj.platform != 0) {
if (obj.xSpeed2 < 0) {
obj.legs.gotoAndStop(3);
} else if (obj.xSpeed2 > 0) {
obj.legs.gotoAndStop(2);
} else {
obj.legs.gotoAndStop(1);
}
} else {
obj.legs.gotoAndStop(1);
}
obj._xscale = obj.xscale;
obj.playerDir = (Math.atan2(obj.playerY - obj._y, obj.playerX - obj._x) * 180) / Math.PI;
obj.body._rotation = obj.playerDir * 0.3;
obj.body.arm._rotation = (obj.playerDir - obj.body._rotation) - obj.recoil;
obj.body.head._rotation = obj.playerDir - obj.body._rotation;
}
} else {
if (obj.platform != 0) {
if (obj.timer <= 0) {
if (random(2) == 1) {
if (random(2) == 1) {
obj.xSpeed2 = -1;
obj.gotoAndStop(2);
obj._xscale = -obj.xscale;
} else {
obj.xSpeed2 = 1;
obj.gotoAndStop(2);
obj._xscale = obj.xscale;
}
} else {
obj.xSpeed2 = 0;
obj.gotoAndStop(1);
}
obj.timer = 60 + random(40);
}
}
if ((playerL._x > obj._x) && (obj._xscale > 0)) {
if (getDist(obj._x, playerL._x, obj._y, playerL._y) < 350) {
obj.xSpeed2 = 0;
if (obj.weapon == 1) {
obj.gotoAndStop(3);
} else if (obj.weapon == 6) {
obj.gotoAndStop(7);
} else if (obj.weapon == 7) {
obj.gotoAndStop(8);
} else if (obj.weapon == 3) {
obj.gotoAndStop(9);
}
obj.timer = 42 + random(5);
}
} else if ((playerL._x < obj._x) && (obj._xscale > 0)) {
if (getDist(obj._x, playerL._x, obj._y, playerL._y) < 150) {
obj.xSpeed2 = 0;
if (obj.weapon == 1) {
obj.gotoAndStop(3);
} else if (obj.weapon == 6) {
obj.gotoAndStop(7);
} else if (obj.weapon == 7) {
obj.gotoAndStop(8);
} else if (obj.weapon == 3) {
obj.gotoAndStop(9);
}
obj.timer = 42 + random(5);
}
} else if ((playerL._x < obj._x) && (obj._xscale < 0)) {
if (getDist(obj._x, playerL._x, obj._y, playerL._y) < 350) {
obj.xSpeed2 = 0;
if (obj.weapon == 1) {
obj.gotoAndStop(3);
} else if (obj.weapon == 6) {
obj.gotoAndStop(7);
} else if (obj.weapon == 7) {
obj.gotoAndStop(8);
} else if (obj.weapon == 3) {
obj.gotoAndStop(9);
}
obj.timer = 42 + random(5);
}
} else if ((playerL._x > obj._x) && (obj._xscale < 0)) {
if (getDist(obj._x, playerL._x, obj._y, playerL._y) < 150) {
obj.xSpeed2 = 0;
if (obj.weapon == 1) {
obj.gotoAndStop(3);
} else if (obj.weapon == 6) {
obj.gotoAndStop(7);
} else if (obj.weapon == 7) {
obj.gotoAndStop(8);
} else if (obj.weapon == 3) {
obj.gotoAndStop(9);
}
obj.timer = 42 + random(5);
}
}
}
if (obj.platform == 1) {
if (obj.xSpeed2 > 0) {
if (lvl.hitTest(obj._x + 40, (obj._y + (obj._height / 2)) + 20, true)) {
if (lvl.hitTest(obj._x + 40, obj._y + (obj._height / 3), true)) {
if (obj.gunReady) {
obj.xSpeed2 = 0;
} else {
obj.xSpeed2 = obj.xSpeed2 * -1;
obj._xscale = -obj.xscale;
obj.timer = 100;
}
}
} else if (obj.gunReady) {
obj.xSpeed2 = 0;
} else {
obj.xSpeed2 = obj.xSpeed2 * -1;
obj._xscale = -obj.xscale;
obj.timer = 100;
}
} else if (obj.xSpeed2 < 0) {
if (lvl.hitTest(obj._x - 40, (obj._y + (obj._height / 2)) + 20, true)) {
if (lvl.hitTest(obj._x - 40, obj._y + (obj._height / 3), true)) {
if (obj.gunReady) {
obj.xSpeed2 = 0;
} else {
obj.xSpeed2 = obj.xSpeed2 * -1;
obj._xscale = obj.xscale;
obj.timer = 50;
}
}
} else if (obj.gunReady) {
obj.xSpeed2 = 0;
} else {
obj.xSpeed2 = obj.xSpeed2 * -1;
obj._xscale = obj.xscale;
obj.timer = 50;
}
}
obj.xSpeed = obj.xSpeed + ((obj.xSpeed2 - obj.xSpeed) * (0.2 * timescale));
obj._x = obj._x + (obj.xSpeed * timescale);
}
} else if (obj.health > 0) {
if (obj.timer <= 0) {
if (onScreen(obj._x, obj._y)) {
obj.activated = true;
}
obj.timer = 5;
}
} else {
if ((obj.gunDrop != true) && (obj.dropGun != false)) {
actionAmount = actionAmount + 20;
if (actionAmount > 100) {
actionAmount = 100;
}
killCount++;
if (obj != undefined) {
if (weapon == 1) {
_root.knifeKills++;
if (_root.knifeKills >= 20) {
_root.unlockAchievement(1);
}
}
if (!playerL.aniOnGround) {
midAirKills++;
if (midAirKills >= 8) {
_root.unlockAchievement(6);
}
}
if (!playerL.onGroundAfterWJ) {
killsAfterWallJump++;
if (killsAfterWallJump >= 3) {
_root.unlockAchievement(2);
}
}
}
var _local6 = "gun" + _root.getNextHighestDepth();
attachMovie("droppedGun", _local6, _root.getNextHighestDepth());
if (obj.weapon == 1) {
_root[_local6].gotoAndStop(1);
_root[_local6].weaponAmmo = 2;
} else if (obj.weapon == 6) {
_root[_local6].gotoAndStop(3);
_root[_local6].weaponAmmo = 6;
} else if (obj.weapon == 7) {
_root[_local6].gotoAndStop(4);
_root[_local6].weaponAmmo = 7;
} else if (obj.weapon == 3) {
_root[_local6].gotoAndStop(2);
_root[_local6].weaponAmmo = 4;
}
_root[_local6]._x = obj._x;
_root[_local6]._y = obj._y;
_root[_local6].fallspeed = -4 - (0.01 * random(200));
_root[_local6].xSpeed = -3 + (0.01 * random(600));
_root[_local6].rotSpeed = -8 + random(16);
_root[_local6].onEnterFrame = function () {
if (this.playerNear || (getDist(this._x, playerL._x, this._y, playerL._y) < 70)) {
this.playerNear = true;
this._x = this._x + (((playerL._x - this._x) * 0.3) * timescale);
this._y = this._y + (((playerL._y - this._y) * 0.3) * timescale);
this._rotation = this._rotation + (13 * timescale);
this._alpha = this._alpha - (10 * timescale);
if (this._alpha <= 0) {
playSound("pistolCock", obj._x, obj._y);
if ((this.weaponAmmo == 2) || (this.weaponAmmo == 4)) {
if (_root[("weapon" + this.weaponAmmo) + "Active"] == true) {
_root[("weapon" + (this.weaponAmmo + 1)) + "Active"] = true;
}
}
_root[("weapon" + this.weaponAmmo) + "Active"] = true;
_root[("ammo" + this.weaponAmmo) + "Total"] = _root[("ammo" + this.weaponAmmo) + "Total"] + _root[("ammo" + this.weaponAmmo) + "Max"];
this.removeMovieClip();
}
this.hitGround = true;
}
if (this.hitGround != true) {
this._rotation = this._rotation + (this.rotSpeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this.xSpeed = this.xSpeed + (((-this.xSpeed) * 0.01) * timescale);
this._x = this._x + (this.xSpeed * timescale);
this._y = this._y + (this.fallspeed * timescale);
var _local3 = -1;
if (lvl.hitTest(this._x + 5, this._y, true)) {
this.xSpeed = this.xSpeed * -0.8;
this._x = this._x - 4;
} else if (lvl.hitTest(this._x - 5, this._y, true)) {
this.xSpeed = this.xSpeed * -0.8;
this._x = this._x + 4;
}
while (_local3++ , _local3 < 5) {
if (lvl.hitTest(this._x, (this._y + 5) - _local3, true)) {
this.fallspeed = 0;
this.xSpeed = 0;
this._y = this._y - _local3;
this.hitGround = true;
}
}
} else if (this._rotation > 0) {
this._rotation = this._rotation + ((180 - this._rotation) * 0.2);
} else {
this._rotation = this._rotation + ((-180 - this._rotation) * 0.2);
}
};
obj.gunDrop = true;
}
if ((obj._currentframe != 5) && (obj._currentframe != 6)) {
if (((obj._xscale == obj.xscale) && (obj.playerX > obj._x)) || ((obj._xscale == (-obj.xscale)) && (obj.playerX < obj._x))) {
obj.gotoAndStop(5);
} else {
obj.gotoAndStop(6);
}
}
if (obj.timer < -200) {
obj._alpha = obj._alpha - (2 * timescale);
if (obj._alpha <= 0) {
obj.swapDepths(_root.getNextHighestDepth());
obj.removeMovieClip();
var _local5 = 0;
var _local7 = 0;
while (_local5++ , _local5 <= enemies) {
if (_root["nmy" + _local5]._name != undefined) {
_local7++;
_root["nmy" + _local5]._name = "nmy" + _local7;
}
}
enemies = _local7;
}
}
if (obj.dead == false) {
if (obj.health <= -7) {
gibCharacter(obj, "g", (obj.playerDir2 = (Math.atan2(playerL._y - obj._y, playerL._x - obj._x) * 180) / Math.PI), obj.gfxNr);
addBlood(obj._x, obj._y, -90, 30);
playSound("bulletHit", obj._x, obj._y);
obj.swapDepths(_root.getNextHighestDepth());
obj.removeMovieClip();
var _local5 = 0;
var _local7 = 0;
while (_local5++ , _local5 <= enemies) {
if (_root["nmy" + _local5]._name != undefined) {
_local7++;
_root["nmy" + _local5]._name = "nmy" + _local7;
}
}
enemies = _local7;
}
}
}
}
function addBlood(xPos, yPos, dir, amount) {
if (bloodEnabled) {
var _local5 = 0;
while (_local5++ , _local5 <= (amount * particleAmount)) {
var _local3 = "blo" + _root.getNextHighestDepth();
attachMovie("blood", _local3, _root.getNextHighestDepth());
_root[_local3]._x = xPos;
_root[_local3]._y = yPos;
_root[_local3]._alpha = 200;
_root[_local3].xSpeed = Math.sin((((dir + 70) + random(40)) - 180) * (Math.PI/180)) * (2 + (0.001 * random(3000)));
_root[_local3].fallspeed = Math.cos((((dir + 70) + random(40)) - 180) * (Math.PI/180)) * (2 + (0.001 * random(5000)));
_root[_local3].onEnterFrame = function () {
this._x = this._x + (this.xSpeed * timescale);
this._y = this._y + (this.fallspeed * timescale);
this._xscale = (this._yscale = this._yscale + ((-this._yscale) * (0.01 * timescale)));
this.xSpeed = this.xSpeed + ((-this.xSpeed) * (0.01 * timescale));
this.fallspeed = this.fallspeed + (0.1 * timescale);
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (lvl.hitTest(this._x, this._y, true)) {
this.removeMovieClip();
}
};
}
}
}
function gibCharacter(obj, charTitle, dir, gfx) {
nrOfGibs++;
if (nrOfGibs >= 20) {
_root.unlockAchievement(3);
}
var _local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_arm1", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x + 5;
_root[_local6]._y = obj._y - 17;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_arm2", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x + 6;
_root[_local6]._y = obj._y + 2;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_hand", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x + 8;
_root[_local6]._y = obj._y + 13;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_arm1", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x - 10;
_root[_local6]._y = obj._y - 20;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_arm2", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x - 17;
_root[_local6]._y = obj._y - 5;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_hand", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x - 17;
_root[_local6]._y = obj._y + 12;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_body", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x;
_root[_local6]._y = obj._y + 10;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_leg1", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x - 6;
_root[_local6]._y = obj._y + 11;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_leg2", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x - 10;
_root[_local6]._y = obj._y + 25;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_foot", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x - 15;
_root[_local6]._y = obj._y + 43;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_leg1", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x + 2.5;
_root[_local6]._y = obj._y + 10.5;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_leg2", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x + 8;
_root[_local6]._y = obj._y + 24.4;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_foot", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x + 10.7;
_root[_local6]._y = obj._y + 42;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_head", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x + 2.5;
_root[_local6]._y = obj._y - 24.5;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
}
function bodyPart(obj, dir) {
if (obj.xSpeed == undefined) {
obj.timer = 5;
obj.rotSpeed = -10 + (0.001 * random(20000));
obj.xSpeed = Math.sin((((dir + 50) + random(40)) - 180) * (Math.PI/180)) * (4 + (0.001 * random(8000)));
obj.fallspeed = (-Math.cos((((dir + 50) + random(40)) - 180) * (Math.PI/180))) * (2 + (0.001 * random(8000)));
}
obj.timer--;
if (obj.timer <= 0) {
addBlood(obj._x, obj._y, -180 + random(360), 1);
obj.timer = 6 + random(3);
}
obj._rotation = obj._rotation + (obj.rotSpeed * timescale);
obj.xSpeed = obj.xSpeed + ((-obj.xSpeed) * (0.01 * timescale));
obj.fallspeed = obj.fallspeed + (0.3 * timescale);
obj._x = obj._x + (obj.xSpeed * timescale);
obj._y = obj._y + (obj.fallspeed * timescale);
if (lvl.hitTest(obj._x + 10, obj._y, true)) {
obj.lvlHit = true;
obj._x = obj._x - (Math.abs(xSpeed) * 5);
obj.xSpeed = obj.xSpeed * -0.8;
}
if (lvl.hitTest(obj._x - 10, obj._y, true)) {
obj.lvlHit = true;
obj._x = obj._x - (Math.abs(xSpeed) * 5);
obj.xSpeed = obj.xSpeed * -0.8;
}
if (lvl.hitTest(obj._x, obj._y + 10, true)) {
obj.lvlHit = true;
obj.xSpeed = obj.xSpeed * 0.7;
obj._y = obj._y - (Math.abs(fallspeed) * 5);
obj.fallspeed = obj.fallspeed * -0.6;
obj.rotSpeed = obj.rotSpeed * 0.8;
}
if (obj.lvlHit) {
obj._alpha = obj._alpha - 2;
if (obj._alpha <= 0) {
obj.swapDepths(_root.getNextHighestDepth());
obj.removeMovieClip();
}
}
}
function rullBordCode(obj) {
if (getDist(obj._x, playerL._x, obj._y, playerL._y) < 610) {
if (obj.xSpeed == undefined) {
obj.xSpeed = 0;
}
obj._x = obj._x + (obj.xSpeed * timescale);
obj.xSpeed = obj.xSpeed + ((-obj.xSpeed) * (0.005 * timescale));
if (lvl.hitTest(obj._x + obj._width, obj._y + 10, true)) {
obj._x = obj._x - Math.abs(obj.xSpeed);
obj.xSpeed = obj.xSpeed * (-(1 - (0.01 * obj.weight)));
}
if (lvl.hitTest(obj._x, (obj._y + obj._height) - 10, true)) {
obj._x = obj._x + Math.abs(obj.xSpeed);
obj.xSpeed = obj.xSpeed * (-(1 - (0.01 * obj.weight)));
}
if (((playerL._x > obj._x) && (playerL._x < (obj._x + obj._width))) && ((playerL._y + (playerL.sHeight / 2)) < (obj._y + 15))) {
if (((playerL._y + (playerL.sHeight / 2)) > obj._y) && (playerL.fallspeed >= 0)) {
if (((obj.playerOn != true) && (playerL.xSpeed2 != 0)) && (Math.abs(playerL._rotation) < 40)) {
obj.xSpeed = playerL.xSpeed2 * (1 - (0.005 * obj.weight));
playerL.xSpeed = 0;
obj.playerOn = true;
}
playerL._y = obj._y - (playerL.sHeight / 2);
playerL.fallspeed = 0;
playerL.onGround = (playerL.landedOnGround = (playerL.jumpReady = true));
playerL.bTG = false;
}
if ((((playerL._y + 7) + (playerL.sHeight / 2)) > obj._y) && (playerL.fallspeed >= 0)) {
playerL._x = playerL._x + (obj.xSpeed * timescale);
playerL.aniOnGround = true;
}
} else {
obj.playerOn = false;
}
}
}
function elevatorCode(obj) {
if (getDist(obj._x, playerL._x, obj._y, playerL._y) < 610) {
if (obj.ySpeed == undefined) {
obj.moving = false;
obj.startY = obj._y;
obj.yTarget = obj._y;
obj.ySpeed = 0;
}
obj._y = obj._y + (obj.ySpeed * timescale);
if (obj.moveAmount < 0) {
if (obj._y < (obj.startY + obj.moveAmount)) {
obj._y = obj.startY + obj.moveAmount;
} else if (obj._y > obj.startY) {
obj._y = obj.startY;
}
} else if (obj._y > (obj.startY + obj.moveAmount)) {
obj._y = obj.startY + obj.moveAmount;
} else if (obj._y < obj.startY) {
obj._y = obj.startY;
}
if ((obj._y - 3) > obj.yTarget) {
obj.ySpeed = -3;
} else if ((obj._y + 3) < obj.yTarget) {
obj.ySpeed = 3;
} else {
obj._y = obj.yTarget;
obj.ySpeed = 0;
}
if (Math.round(obj._y) != Math.round(obj.yTarget)) {
obj.door._alpha = obj.door._alpha + ((120 - obj.door._alpha) * (0.2 * timescale));
if ((playerL._x > (obj._x - 14)) && (playerL._x < (obj._x + (playerL.sWidth / 3)))) {
playerL._x = obj._x + (playerL.sWidth / 3);
}
} else {
obj.door._alpha = obj.door._alpha + ((-20 - obj.door._alpha) * (0.2 * timescale));
}
if (Math.round(obj._y) == Math.round(obj.startY + obj.moveAmount)) {
_root.lvl[obj._name + "Door2"]._xscale = (_root.lvl[obj._name + "Door2"]._yscale = 0);
_root.lvl[obj._name + "Door1"]._xscale = _root.lvl[obj._name + "Door1"].sXScale;
_root.lvl[obj._name + "Door1"]._yscale = _root.lvl[obj._name + "Door1"].sYScale;
} else if (obj._y == obj.startY) {
_root.lvl[obj._name + "Door1"]._xscale = (_root.lvl[obj._name + "Door1"]._yscale = 0);
_root.lvl[obj._name + "Door2"]._xscale = _root.lvl[obj._name + "Door2"].sXScale;
_root.lvl[obj._name + "Door2"]._yscale = _root.lvl[obj._name + "Door2"].sYScale;
} else {
_root.lvl[obj._name + "Door2"]._xscale = _root.lvl[obj._name + "Door2"].sXScale;
_root.lvl[obj._name + "Door2"]._yscale = _root.lvl[obj._name + "Door2"].sYScale;
_root.lvl[obj._name + "Door1"]._xscale = _root.lvl[obj._name + "Door1"].sXScale;
_root.lvl[obj._name + "Door1"]._yscale = _root.lvl[obj._name + "Door1"].sYScale;
}
if ((((playerL._x > obj._x) && (playerL._x < (obj._x + obj._width))) && ((playerL._y + (playerL.sHeight / 2)) < (obj._y + 30))) && (playerL._y > ((obj._y - obj._height) - 10))) {
if (playerL._y < (obj._y - 170)) {
playerL._y = obj._y - 170;
}
if (obj.playerOn == false) {
if (playerL._y > ((obj.startY + obj.moveAmount) + 10)) {
obj.yTarget = obj.startY + obj.moveAmount;
} else {
obj.yTarget = obj.startY;
}
obj.playerOn = true;
}
if ((playerL._y + (playerL.sHeight / 2)) > obj._y) {
playerL._y = obj._y - (playerL.sHeight / 2);
playerL.fallspeed = 0;
playerL.onGround = (playerL.landedOnGround = (playerL.jumpReady = true));
playerL.bTG = false;
}
if (((playerL._y + 7) + (playerL.sHeight / 2)) > obj._y) {
playerL._y = playerL._y + obj.ySpeed;
playerL.aniOnGround = true;
}
} else {
obj.playerOn = false;
}
}
}
function brokenLight(obj) {
if (obj.timer == undefined) {
obj.timer = 10 + random(5);
}
obj.timer = obj.timer - timescale;
if ((obj.timer <= 0) && (Math.round(obj.timer) != -1)) {
obj.gotoAndStop(2);
} else {
obj.gotoAndStop(1);
}
if (obj.timer < -2) {
obj.timer = 60 + random(100);
}
}
function addGlasPiece(xPos, yPos) {
glasPieceName = "glP" + _root.getNextHighestDepth();
_root.attachMovie("glasPiece", glasPieceName, _root.getNextHighestDepth());
_root[glasPieceName]._x = xPos;
_root[glasPieceName]._y = yPos;
_root[glasPieceName].fallspeed = 0.01 * random(300);
_root[glasPieceName].timer = 80 + random(30);
_root[glasPieceName]._xscale = (_root[glasPieceName]._yscale = 90 + random(50));
_root[glasPieceName]._alpha = 60 + random(40);
_root[glasPieceName].rotSpeed = -2 + (random(400) * 0.01);
_root[glasPieceName].onEnterFrame = function () {
this.timer = this.timer - timescale;
if (this.timer <= 0) {
this._alpha = this._alpha - (timescale * 4);
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
this._y = this._y + (this.fallspeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this._rotation = this._rotation + (this.rotSpeed * timescale);
if (lvl.hitTest(this._x, this._y, true)) {
this._y = this._y - this.fallspeed;
this.fallspeed = this.fallspeed * -0.4;
}
};
}
function jTPlatformCode(obj) {
if (getDist(obj._x, playerL._x, obj._y, playerL._y) < obj._width) {
if (((playerL._x > obj._x) && (playerL._x < (obj._x + obj._width))) && ((playerL._y + (playerL.sHeight / 2)) < (obj._y + 15))) {
if (((playerL._y + (playerL.sHeight / 2)) > obj._y) && (playerL.fallspeed >= 0)) {
playerL._y = obj._y - (playerL.sHeight / 2);
playerL.fallspeed = 0;
playerL.onGround = (playerL.landedOnGround = (playerL.jumpReady = true));
playerL.bTG = false;
}
if ((((playerL._y + 7) + (playerL.sHeight / 2)) > obj._y) && (playerL.fallspeed >= 0)) {
playerL.aniOnGround = true;
}
}
}
}
function playSound(sName, xPos, yPos, ranNr) {
_root.soundFX["sound" + sName] = new Sound(soundFX);
if ((ranNr != undefined) && (ranNr != 0)) {
if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound((sName + (1 + random(ranNr))) + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName + (1 + random(ranNr)));
}
} else if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound(sName + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName);
}
var _local3 = ((xPos - ((-_root._x) + 300)) / 400) * 100;
if (_local3 > 100) {
_local3 = 100;
} else if (_local3 < -100) {
_local3 = -100;
}
_root.soundFX["sound" + sName].setPan(_local3);
_root.soundFX["sound" + sName].setVolume(SFXVolume * 100);
_root.soundFX["sound" + sName].start();
}
function medipack(obj) {
if (health > 0) {
if (obj.playerNear || (getDist(obj._x, playerL._x, obj._y, playerL._y) < 70)) {
obj.playerNear = true;
obj._x = obj._x + (((playerL._x - obj._x) * 0.3) * timescale);
obj._y = obj._y + (((playerL._y - obj._y) * 0.3) * timescale);
obj._rotation = obj._rotation + (13 * timescale);
obj._alpha = obj._alpha - (10 * timescale);
if (obj._alpha <= 0) {
health = health + 20;
if (health > 100) {
health = 100;
}
obj.swapDepths(_root.getNextHighestDepth());
obj.removeMovieClip();
}
obj.hitGround = true;
}
}
}
function addSpeechBubble(xPos, yPos, inputText, allowSkip, xOffset, timeVisible, gibberishVoice) {
if (xOffset == undefined) {
xOffset = 0;
}
_root.speechBubble.swapDepths(_root.getNextHighestDepth());
_root.speechBubble.removeMovieClip();
_root.attachMovie("speechBubble", "speechBubble", _root.getNextHighestDepth());
_root.speechBubble.inputText = inputText;
_root.speechBubble.gibberishVoice = gibberishVoice;
_root.speechBubble._x = xPos + xOffset;
_root.speechBubble._y = yPos;
_root.speechBubble.xPos = xPos;
_root.speechBubble.yPos = yPos;
_root.speechBubble.allowSkip = allowSkip;
if (timeVisible != undefined) {
_root.speechBubble.timeVisible = timeVisible;
}
}
function removeSpeechBubble() {
_root.speechBubble.swapDepths(_root.getNextHighestDepth());
_root.speechBubble.removeMovieClip();
}
function getAngle(xPos1, yPos1, xPos2, yPos2) {
return((Math.atan2(yPos1 - yPos2, xPos1 - xPos2) / Math.PI) * 180);
}
function spawnBanana(xPos, yPos) {
removeBanana();
_root.attachMovie("banana", "banana", _root.getNextHighestDepth());
_root.banana._x = xPos;
_root.banana._y = yPos;
}
function removeBanana() {
if (_root.banana != undefined) {
_root.addGlow(_root.banana._x, _root.banana._y, 80, 200);
_root.addSparks(_root.banana._x, _root.banana._y, 10);
}
_root.banana.swapDepths(_root.getNextHighestDepth());
_root.banana.removeMovieClip();
}
killsAfterWallJump = 0;
midAirKills = 0;
if (knifeKills == undefined) {
knifeKills = 0;
}
if (nrOfHeadShots == undefined) {
nrOfHeadShots = 0;
}
if (nrOfGibs == undefined) {
nrOfGibs = 0;
}
if (levelSelectNr == undefined) {
gotoAndStop(_root.savedData.data.lastSavedFrame + 1);
} else {
gotoAndStop(levelSelectNr);
}
pausePlayer = false;
generalTimer = 0;
_root._x = (-_root.playerL._x) + 300;
_root._y = (-_root.playerL._y) + 200;
stop();
_root._quality = "MEDIUM";
hiddenMusicVolume = 1;
musicStarted = false;
showHint = false;
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
health = 100;
playerL.dead = false;
actionAmount = 100;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var timescale2 = 1;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - mouseYPos, playerL._x - mouseXPos) * 180) / Math.PI);
var mDirR = ((Math.atan2(mouseYPos - (playerL._y - 30), mouseXPos - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
killCount = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
jTPlatform = 0;
roofWindow.broken = false;
if (musicVolume == undefined) {
musicVolume = 1;
}
if (SFXVolume == undefined) {
SFXVolume = 1;
}
fadeToDark = false;
levelComplete = false;
showOptions = false;
particleAmount = 1;
bloodEnabled = true;
slowMotionSFXEnabled = true;
fisk = false;
Key70Pressed = false;
Key73Pressed = false;
Key83Pressed = false;
Key75Pressed = false;
Mouse.removeListener(mouseListener);
delete mouseListener;
var mouseListener = new Object();
mouseListener.onMouseWheel = function (scrollAmount) {
if ((!mousePress) && (!pausePlayer)) {
if (scrollAmount > 0) {
var _local3 = 1;
var _local2 = weapon;
while (_local2++ , _local2 <= 7) {
if (((_root[("weapon" + _local2) + "Active"] == true) && ((_root["ammo" + _local2] + _root[("ammo" + _local2) + "Total"]) > 0)) || (_local2 == 1)) {
_local3 = _local2;
_local2 = 8;
}
}
weapon = _local3;
} else if (scrollAmount < 0) {
var _local3 = 1;
var _local2 = 8;
while (_local2-- , _local2 >= 1) {
if (((_root[("weapon" + _local2) + "Active"] == true) && ((_root["ammo" + _local2] + _root[("ammo" + _local2) + "Total"]) > 0)) || (_local2 == 1)) {
_local3 = _local2;
_local2 = 0;
}
}
_local2 = weapon;
while (_local2-- , _local2 >= 1) {
if (((_root[("weapon" + _local2) + "Active"] == true) && ((_root["ammo" + _local2] + _root[("ammo" + _local2) + "Total"]) > 0)) || (_local2 == 1)) {
_local3 = _local2;
_local2 = 0;
}
}
weapon = _local3;
}
}
};
Mouse.addListener(mouseListener);
onEnterFrame = function () {
if ((generalTimer >= 5) && (!musicStarted)) {
if (musicMC.bgMusicIntro == undefined) {
musicMC.bgMusic.start();
} else {
musicMC.bgMusicIntro.start();
}
musicStarted = true;
}
if (Key.isDown(85)) {
if (fisk != true) {
if (Key.isDown(70)) {
Key70Pressed = true;
}
if (Key.isDown(73)) {
Key73Pressed = true;
}
if (Key.isDown(83)) {
Key83Pressed = true;
}
if (Key.isDown(75)) {
Key75Pressed = true;
}
if (((Key70Pressed && (Key73Pressed)) && (Key83Pressed)) && (Key75Pressed)) {
i = 0;
while (i <= 7) {
_root[("weapon" + i) + "Active"] = true;
_root[("ammo" + i) + "Total"] = 9999;
_root["ammo" + i] = _root[("ammo" + i) + "Max"];
i++;
}
fisk = true;
}
}
}
generalTimer++;
if (!pausePlayer) {
mouseXPos = _xmouse;
mouseYPos = _ymouse;
kUp = Key.isDown(87);
kDown = Key.isDown(83);
kLeft = Key.isDown(65);
kRight = Key.isDown(68);
if (Key.isDown(16) || (Key.isDown(32))) {
kShift = true;
} else {
kShift = false;
}
if (weapon1Active && (Key.isDown(49))) {
weapon = 1;
} else if (weapon2Active && (Key.isDown(50))) {
weapon = 2;
} else if (weapon3Active && (Key.isDown(51))) {
weapon = 3;
} else if (weapon4Active && (Key.isDown(52))) {
weapon = 4;
} else if (weapon5Active && (Key.isDown(53))) {
weapon = 5;
} else if (weapon6Active && (Key.isDown(54))) {
weapon = 6;
} else if (weapon7Active && (Key.isDown(55))) {
weapon = 7;
}
if (Key.isDown(82)) {
if ((_root["ammo" + weapon] < _root[("ammo" + weapon) + "Max"]) && (_root[("ammo" + weapon) + "Total"] > 0)) {
playerB.body.gotoAndStop(2);
}
}
} else {
kUp = false;
kDown = false;
kLeft = false;
kRight = false;
kShift = false;
}
if (health <= 0) {
HUD.damage._alpha = HUD.damage._alpha + 8;
if (HUD.damage._alpha > 3000) {
HUD.damage._alpha = 3000;
}
HUD.fade.fadeSpeed = 1;
if (HUD.fade._alpha >= 100) {
playerL.dead = true;
}
timescale = timescale - 0.01;
if (timescale < 0) {
timescale = 0;
}
fadeToDark = true;
health = 0;
} else {
if ((HUD.damage._alpha - (0.7 * timescale)) >= 0) {
HUD.damage._alpha = HUD.damage._alpha - (0.7 * timescale);
} else {
HUD.damage._alpha = 0;
}
if (health <= 30) {
HUD.damage.timer++;
if (HUD.damage.timer > (health * 2)) {
HUD.damage._alpha = HUD.damage._alpha + 20;
HUD.damage.timer = 0;
}
}
if (HUD.damage._alpha > 60) {
HUD.damage._alpha = 60;
}
}
var i = 0;
while ((++i) <= enemies) {
gangster(_root["nmy" + i]);
}
fps++;
ammo3Total = ammo2Total;
ammo5Total = ammo4Total;
if (((_root["ammo" + weapon] + _root[("ammo" + weapon) + "Total"]) <= 0) && (weapon != 1)) {
i = 7;
while (i >= 1) {
if ((_root[("weapon" + i) + "Active"] == true) && ((_root["ammo" + i] + _root[("ammo" + i) + "Total"]) > 0)) {
weapon = i;
i = 0;
} else if (i == 1) {
weapon = 1;
}
i--;
}
mousePress = false;
}
recoil = recoil + (((-recoil) * 0.3) * timescale);
if (!showOptions) {
mDir = (-recoil) + ((Math.atan2((playerB._y - 30) - mouseYPos, playerB._x - mouseXPos) * 180) / Math.PI);
mDirR = recoil + ((Math.atan2(mouseYPos - (playerB._y - 30), mouseXPos - playerB._x) * 180) / Math.PI);
}
if (pausePlayer) {
if (((weapon != 1) && (weapon != 6)) && (weapon != 7)) {
mDir = -100;
} else {
mDir = -170;
}
}
if (Key.isDown(27) || (Key.isDown(80) && (health > 0))) {
if (doOnce27 != true) {
if (showOptions == false) {
Mouse.show();
showOptions = true;
} else {
Mouse.hide();
showOptions = false;
}
doOnce27 = true;
}
} else {
doOnce27 = false;
}
HUD.HUD.ammoText.text = (_root["ammo" + weapon] + " / ") + _root[("ammo" + weapon) + "Total"];
playerL._y = playerL._y + (playerL.fallspeed * timescale);
playerL.fallspeed = playerL.fallspeed + (0.4 * timescale);
playerL._x = playerL._x + (playerL.xSpeed * timescale);
playerL.xSpeed = playerL.xSpeed + (((playerL.xSpeed2 - playerL.xSpeed) * 0.2) * timescale);
playerL.rotSpeed = playerL.rotSpeed + (((playerL.rotSpeed2 - playerL.rotSpeed) * 0.07) * timescale);
playerL._rotation = playerL._rotation + (playerL.rotSpeed * timescale);
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.bX = playerL._x + (Math.sin((playerL._rotation + 180) * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos((playerL._rotation + 180) * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
if (actionAmount > 0) {
if (kShift) {
if (slowMotionSFXEnabled) {
if (kShiftOnce1 != true) {
playSound("slowDown", (-_root._x) + 300, (-_root._y) + 200);
kShiftOnce1 = true;
}
kShiftOnce2 = false;
}
timescale2 = timescale2 + ((0.3 - timescale2) * 0.1);
if (actionAmount < 0) {
actionAmount = 0;
}
} else {
if (slowMotionSFXEnabled) {
if (kShiftOnce2 != true) {
playSound("speedUp", (-_root._x) + 300, (-_root._y) + 200);
kShiftOnce2 = true;
}
kShiftOnce1 = false;
}
timescale2 = timescale2 + ((1 - timescale2) * 0.1);
}
} else {
if (slowMotionSFXEnabled) {
if (kShiftOnce2 != true) {
playSound("speedUp", (-_root._x) + 300, (-_root._y) + 200);
kShiftOnce2 = true;
}
kShiftOnce1 = false;
}
timescale2 = timescale2 + ((1 - timescale2) * 0.1);
kShift = false;
}
musicMC.bgMusic.setVolume(((timescale2 * 100) * hiddenMusicVolume) * musicVolume);
if ((showOptions != true) && (health > 0)) {
if (generalTimer > 90) {
timescale = timescale2 + (1 - (showFPS / 32));
} else {
timescale = timescale2;
}
} else if (health > 0) {
timescale = 0;
}
if (lvl.hitTest(playerL._x, playerL._y - (playerL.sHeight / 2), true)) {
var i = 0;
while ((++i) < (playerL.sHeight / 3)) {
if (lvl.hitTest(playerL._x, (playerL._y - (playerL.sHeight / 2.3)) + i, true)) {
if (playerL.fallspeed < 0) {
playerL.fallspeed = 0;
}
playerL._y = playerL._y + i;
}
}
if (lvl.hitTest(playerL._x, playerL._y + (playerL.sHeight / 2), true)) {
kDown = true;
kUp = false;
}
} else if (((((playerL._currentframe == 4) && (playerL._rotation > (-Math.abs(playerL.rotSpeed / 1.5)))) && (playerL._rotation < Math.abs(playerL.rotSpeed / 1.5))) && (!kRight)) && (!kLeft)) {
playerL._rotation = (playerB._rotation = 0);
playerL.rotSpeed = 0;
playerL.xSpeed = (playerL.xSpeed2 = 0);
playerL.gotoAndStop(6);
playerL.legs.gotoAndStop(6);
playerL.legs.currentFrame = 6;
}
if ((playerL.aniOnGround && (kDown)) && (playerL._currentframe != 4)) {
playerL.yHittestOffset = 20;
} else {
playerL.yHittestOffset = 0;
}
if (lvl.hitTest((playerL._x + 10) + (playerL.sWidth / 2), playerL._y + playerL.yHittestOffset, true)) {
var i = 0;
while ((++i) < (playerL.sWidth / 2)) {
if (lvl.hitTest((playerL._x + (playerL.sWidth / 2)) - i, playerL._y, true)) {
playerL.xSpeed = 0;
if (!playerL.onGround) {
playerL.xSpeed2 = 0;
}
playerL._x = playerL._x - i;
}
}
if ((!playerL.aniOnGround) && (!kShift)) {
playerL._rotation = playerL._rotation + ((-70 - playerL._rotation) * (0.05 * timescale));
}
if (kDown && (kRight)) {
kRight = false;
}
if ((playerL._currentframe == 4) && (playerL.xSpeed2 >= 0)) {
playerL._rotation = 0;
playerL.rotSpeed = 0;
playerL.xSpeed = (playerL.xSpeed2 = 0);
playerL.gotoAndStop(6);
playerL.legs.gotoAndStop(6);
playerL.legs.currentFrame = 6;
}
}
if (lvl.hitTest((playerL._x - 10) - (playerL.sWidth / 2), playerL._y + playerL.yHittestOffset, true)) {
var i = 0;
while ((++i) < (playerL.sWidth / 2)) {
if (lvl.hitTest((playerL._x - (playerL.sWidth / 2)) + i, playerL._y, true)) {
playerL.xSpeed = 0;
if (!playerL.onGround) {
playerL.xSpeed2 = 0;
}
playerL._x = playerL._x + i;
}
}
if ((!playerL.aniOnGround) && (!kShift)) {
playerL._rotation = playerL._rotation + ((70 - playerL._rotation) * (0.05 * timescale));
}
if (kDown && (kLeft)) {
kLeft = false;
}
if ((playerL._currentframe == 4) && (playerL.xSpeed2 <= 0)) {
playerL._rotation = 0;
playerL.rotSpeed = 0;
playerL.xSpeed = (playerL.xSpeed2 = 0);
playerL.gotoAndStop(6);
playerL.legs.gotoAndStop(6);
playerL.legs.currentFrame = 6;
}
}
if (lvl.hitTest(playerL._x, playerL._y + (playerL.sHeight / 2), true)) {
playerL.onGround = true;
playerL.fallspeed = 0;
var i = 0;
while ((++i) < (playerL.sHeight / 3)) {
if (lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) - i, true)) {
playerL.fallspeed = 0;
playerL._y = playerL._y - i;
}
}
} else {
playerL.onGround = false;
}
var i = 0;
while ((++i) <= elevator) {
elevatorCode(_root["ele" + i]);
}
var i = 0;
while ((++i) <= jTPlatform) {
jTPlatformCode(_root["jTP" + i]);
}
if (kUp) {
if (playerL.jumpReady) {
playerL.fallspeed = playerL.fallspeed - playerL.jumpPower;
playerL.jumpPower = playerL.jumpPower * 0.45;
}
} else if (playerL.onGround == false) {
playerL.jumpReady = false;
}
if (playerL.onGround == true) {
midAirKills = 0;
if (Math.round(playerL.fallspeed) == 0) {
lastPlayerX = playerL._x;
lastPlayerY = playerL._y;
}
playerL.bTG = false;
if (((isNaN(playerL.xSpeed) || (isNaN(playerL.xSpeed2))) || (isNaN(playerL.rotSpeed))) || (isNaN(playerL.rotSpeed2))) {
playerL.xSpeed = (playerL.xSpeed2 = (playerL._xscale / Math.abs(playerL._xscale)) * 2.5);
playerL.rotSpeed = (playerL._xscale / Math.abs(playerL._xscale)) * 10;
}
if ((playerL._rotation > 40) || (playerL._rotation < -40)) {
if (Math.abs(playerL.xSpeed2) < 2.5) {
playerL.xSpeed2 = (playerL.xSpeed2 / Math.abs(playerL.xSpeed2)) * 2.5;
}
if (Math.abs(playerL.xSpeed2) > 5) {
playerL.xSpeed2 = (playerL.xSpeed2 / Math.abs(playerL.xSpeed2)) * 5;
}
if (playerL.aniOnGround) {
playerL.gotoAndStop(4);
}
playerL._x = playerL._x + ((playerL.xSpeed2 * 0.8) * timescale);
playerL.rotSpeed = playerL.rotSpeed + ((((playerL.xSpeed2 * 4) - playerL.rotSpeed) * 0.5) * timescale);
} else if (!kDown) {
playerL.rotSpeed = (playerL.rotSpeed2 = (-playerL._rotation) * 0.1);
playerL._rotation = playerL._rotation + ((-playerL._rotation) * (0.2 * timescale));
if ((playerL._currentframe != 4) && (playerL._currentframe != 6)) {
if (kRight) {
playerL.xSpeed2 = 6;
if (playerL.faceRight) {
playerL.gotoAndStop(2);
} else {
playerL.gotoAndStop(5);
}
} else if (kLeft) {
playerL.xSpeed2 = -6;
if (playerL.faceRight) {
playerL.gotoAndStop(5);
} else {
playerL.gotoAndStop(2);
}
} else {
playerL.xSpeed2 = 0;
playerL.gotoAndStop(1);
}
if ((playerL._currentframe == 4) && (playerL.legs.currentFrame > 11)) {
playerL.legs.currentFrame = 11;
}
} else if (playerL.legs.currentFrame < 12) {
playerL.legs.currentFrame = 12;
}
} else if (playerL.aniOnGround) {
if (((playerL.xSpeed2 == 0) && (playerL._rotation > -10)) && (playerL._rotation < 10)) {
playerL.gotoAndStop(6);
if (kRight) {
playerL._rotation = playerL._rotation + 20;
playerL.xSpeed2 = 5;
} else if (kLeft) {
playerL._rotation = playerL._rotation - 20;
playerL.xSpeed2 = -5;
}
} else {
playerL.gotoAndStop(4);
playerL.rotSpeed = playerL.rotSpeed + ((((playerL.xSpeed2 * 4) - playerL.rotSpeed) * 0.5) * timescale);
if (Math.abs(playerL.xSpeed2) < 8) {
if (playerL.xSpeed2 == 0) {
playerL.xSpeed2 = (playerL._xscale / Math.abs(playerL._xscale)) * 8;
} else {
playerL.xSpeed2 = (playerL.xSpeed2 / Math.abs(playerL.xSpeed2)) * 8;
}
}
}
}
playerL.landedOnGround = true;
} else {
playerL.landedOnGround = false;
if (kUp == false) {
jumpReady = false;
}
playerL.bTG = lvl.hitTest(playerL.bX, playerL.bY, true);
if (playerL._currentframe != 4) {
if (kShift) {
if (kRight) {
playerL.rotSpeed2 = 13;
if (playerL.xSpeed > 2.5) {
playerL.xSpeed2 = playerL.xSpeed2 + (0.04 * timescale);
} else if (Math.round(playerL.xSpeed) >= 0) {
playerL.xSpeed2 = playerL.xSpeed2 + (0.5 * timescale);
}
} else if (kLeft) {
playerL.rotSpeed2 = -13;
if (playerL.xSpeed < -2.5) {
playerL.xSpeed2 = playerL.xSpeed2 - (0.04 * timescale);
} else if (Math.round(playerL.xSpeed) <= 0) {
playerL.xSpeed2 = playerL.xSpeed2 - (0.5 * timescale);
}
} else if ((!kRight) && (!kLeft)) {
playerL.rotSpeed2 = 0;
}
} else if (playerL.onGroundAfterWJ == true) {
if (kRight) {
if (playerL._rotation > -5) {
playerL.rotSpeed2 = -1;
} else if ((playerL._rotation > -10) && (playerL._rotation < 10)) {
playerL.rotSpeed2 = 0;
}
playerL.xSpeed2 = playerL.xSpeed2 + ((5 - playerL.xSpeed2) * (0.2 * timescale));
} else if (kLeft) {
if (playerL._rotation < 5) {
playerL.rotSpeed2 = 1;
} else if ((playerL._rotation > -10) && (playerL._rotation < 10)) {
playerL.rotSpeed2 = 0;
}
playerL.xSpeed2 = playerL.xSpeed2 + ((-5 - playerL.xSpeed2) * (0.2 * timescale));
} else {
playerL.rotSpeed2 = 0;
playerL.xSpeed2 = playerL.xSpeed2 + ((-playerL.xSpeed2) * (0.2 * timescale));
}
}
}
}
if (!playerL.aniOnGround) {
if (((!kShift) && (playerL._rotation > -10)) && (playerL._rotation < 10)) {
playerL.rotSpeed = playerL.rotSpeed + ((-playerL.rotSpeed) * (0.2 * timescale));
}
if (((kUp && (playerL.wallJumped == false)) && (playerL.bTG)) && (playerL.jumpReady == false)) {
playerL.onGroundAfterWJ = false;
playerL.xSpeed = (playerL.xSpeed2 = Math.sin((playerL._rotation * 0.8) * (Math.PI/180)) * 8);
playerL.fallspeed = Math.cos((playerL._rotation * 0.8) * (Math.PI/180)) * -8;
playerL.legs.currentFrame = 2;
if (!kShift) {
if (playerL._rotation > 0) {
playerL.rotSpeed2 = 10;
} else {
playerL.rotSpeed2 = -10;
}
}
playerL.wallJumped = true;
} else {
playerL.wallJumped = false;
}
if (playerL._currentframe != 4) {
playerL.gotoAndStop(3);
} else if (playerL.legs.currentFrame < 12) {
playerL.legs.currentFrame = 12;
}
if (!kUp) {
playerL.jumpPower = 0;
}
} else {
playerL.onGroundAfterWJ = true;
killsAfterWallJump = 0;
if (kUp) {
if (kUpPressed == false) {
playerL.fallspeed = -4;
playerL._y = playerL._y - 7;
playerL.xSpeed2 = playerL.xSpeed;
}
kUpPressed = true;
} else {
kUpPressed = false;
if (playerL.fallspeed >= 0) {
playerL.jumpReady = true;
if (playerL.jumpPower < 5) {
playerL.jumpPower = 5;
}
}
}
}
if ((((playerL._rotation - mDir) + 90) > 0) && (((playerL._rotation - mDir) + 90) < 180)) {
playerB.bRot = playerB.bRot + ((((mDir * 0.5) - playerB.bRot) * 0.15) * timescale);
if (playerL._currentframe != 4) {
if (playerL.onGround == true) {
playerL._xscale = -playerL.xScale;
playerL.faceRight = false;
} else if (((!kShift) && (playerL._rotation > -13)) && (playerL._rotation < 13)) {
playerL._xscale = -playerL.xScale;
playerL.faceRight = false;
}
}
} else {
playerB.bRot = playerB.bRot + ((((mDirR * 0.5) - playerB.bRot) * 0.15) * timescale);
if (playerL._currentframe != 4) {
if (playerL.onGround == true) {
playerL._xscale = playerL.xScale;
playerL.faceRight = true;
} else if (((!kShift) && (playerL._rotation > -13)) && (playerL._rotation < 13)) {
playerL._xscale = playerL.xScale;
playerL.faceRight = true;
}
}
}
if (playerL.faceRight == true) {
if ((((weapon == 3) || (weapon == 5)) || (weapon == 6)) || (weapon == 7)) {
playerB.body.arm1._rotation = (playerB.body.arm2._rotation = mDir - playerB._rotation);
} else if (((weapon == 1) || (weapon == 2)) || (weapon == 4)) {
playerB.body.arm1._rotation = (-playerB.bRot) + 200;
playerB.body.arm2._rotation = mDir - playerB._rotation;
}
} else if ((((weapon == 3) || (weapon == 5)) || (weapon == 6)) || (weapon == 7)) {
playerB.body.arm1._rotation = (playerB.body.arm2._rotation = (-mDirR) + playerB._rotation);
} else if (((weapon == 1) || (weapon == 2)) || (weapon == 4)) {
playerB.body.arm1._rotation = playerB.bRot + 200;
playerB.body.arm2._rotation = (-mDirR) + playerB._rotation;
}
if (playerB.bRot > 30) {
playerB.bRot = 30;
} else if (playerB.bRot < -30) {
playerB.bRot = -30;
}
playerB._rotation = playerL._rotation + playerB.bRot;
playerB._x = playerL._x + ((playerL._xscale / Math.abs(playerL._xscale)) * playerL.legs.bodyPos._x);
playerB._y = playerL._y + playerL.legs.bodyPos._y;
playerB._xscale = playerL._xscale;
playerB.body.head._rotation = (playerL._xscale / Math.abs(playerL._xscale)) * (playerB._rotation - playerL._rotation);
playerB.gotoAndStop(weapon);
_x = (_x + ((((((-playerL._x) - ((mouseXPos - playerL._x) / 2)) + 300) - _x) * 0.1) * timescale));
_y = (_y + ((((((-playerL._y) - ((mouseYPos - playerL._y) / 2)) + 200) - _y) * 0.1) * timescale));
HUD._x = -_x;
HUD._y = -_y;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
if (((!showOptions) && (health > 0)) && (!pausePlayer)) {
crosshair._x = mouseXPos;
crosshair._y = mouseYPos;
crosshair._xscale = (crosshair._yscale = 100);
} else {
crosshair._xscale = (crosshair._yscale = 0);
}
if (gunTimer > 0) {
gunTimer = gunTimer - (1 * timescale);
}
if ((((mousePress && (gunTimer <= 0)) && (weapon == 1)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) {
var _local6 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local6, _root.getNextHighestDepth());
_root[_local6]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 30);
_root[_local6]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 30);
_root[_local6]._rotation = mDirR;
_root[_local6]._alpha = 0;
_root[_local6].timer = 0;
_root.playerB.body.arm2.currentFrame = 4;
_root.playerB.body.arm2.gotoAndStop(4);
_root[_local6].onEnterFrame = function () {
bulletCode(this, true, 20);
this.timer++;
if (this.timer >= 6) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
};
gunTimer = 8;
mousePress = false;
} else if ((weapon == 1) && (gunTimer <= 0)) {
_root.playerB.body.arm2.currentFrame = 1;
_root.playerB.body.arm2.gotoAndStop(1);
}
if ((((mousePress == true) && (weapon == 4)) || ((mousePress == true) && (weapon == 5))) || ((mousePress == true) && (weapon == 7))) {
if ((((gunTimer <= 0) && (_root["ammo" + weapon] > 0)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) {
_root["ammo" + weapon]--;
var _local4 = "smoke" + _root.getNextHighestDepth();
attachMovie("smoke", _local4, _root.getNextHighestDepth());
_root[_local4].ySpeed = -1.3 - (0.01 * random(70));
_root[_local4]._xscale = (_root[_local4]._yscale = 70 + random(30));
_root[_local4].onEnterFrame = function () {
this._y = this._y + (this.ySpeed * timescale);
this.ySpeed = this.ySpeed + (((-this.ySpeed) * 0.02) * timescale);
this._xscale = (this._yscale = this._yscale - (this.ySpeed * timescale));
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
var _local3 = "shell" + _root.getNextHighestDepth();
attachMovie("shell", _local3, _root.getNextHighestDepth());
_root[_local3].fallspeed = -3;
_root[_local3].xSpeed = -1.5 + (0.01 * random(300));
_root[_local3]._alpha = 300;
_root[_local3].rotSpeed = -10 + (0.01 * random(2000));
_root[_local3].onEnterFrame = function () {
this._y = this._y + (this.fallspeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this._x = this._x + (this.xSpeed * timescale);
this._rotation = this._rotation + (this.rotSpeed * timescale);
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = (-this.fallspeed) * 0.5;
this.xSpeed = this.xSpeed * 0.8;
this.rotSpeed = this.rotSpeed * 0.8;
this._y = this._y + (this.fallspeed * 2);
}
};
var _local5 = "mF" + _root.getNextHighestDepth();
attachMovie("muzzle", _local5, _root.getNextHighestDepth());
_root[_local5]._xscale = (_root[_local5]._yscale = 25);
if (weapon == 4) {
playSound("uziShot", playerL._x, playerL._y, 3);
var _local6 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local6, _root.getNextHighestDepth());
_root[_local5]._x = (_root[_local4]._x = (_root[_local6]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 50)));
_root[_local5]._y = (_root[_local4]._y = (_root[_local6]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 50)));
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 39);
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 39);
_root[_local3].gotoAndStop(1);
_root[_local6]._rotation = (mDirR - recoil) - ((recoil / 2) + (random(100 * recoil) / 100));
addGlow(_root[_local6]._x, _root[_local6]._y, 30, 130);
_root[_local6].onEnterFrame = function () {
bulletCode(this, true, 5);
};
gunTimer = 4;
recoil = recoil + 10;
} else if (weapon == 5) {
playSound("uziShot", playerL._x, playerL._y, 3);
var _local6 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local6, _root.getNextHighestDepth());
if (fireRightGun) {
_root[_local5]._x = (_root[_local4]._x = (_root[_local6]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 50)));
_root[_local5]._y = (_root[_local4]._y = (_root[_local6]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 50)));
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 39);
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 39);
_root[_local3].gotoAndStop(1);
_root[_local6]._rotation = (mDirR - recoil) - ((recoil / 2) + (random(100 * recoil) / 100));
addGlow(_root[_local6]._x, _root[_local6]._y, 30, 130);
fireRightGun = false;
_root[_local6].onEnterFrame = function () {
bulletCode(this, true, 5);
};
} else {
_root[_local5]._x = (_root[_local4]._x = (_root[_local6]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 6)) * (Math.PI/180)) * 45)));
_root[_local5]._y = (_root[_local4]._y = (_root[_local6]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 6)) * (Math.PI/180)) * 45)));
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 39);
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 39);
_root[_local3].gotoAndStop(1);
_root[_local6]._rotation = mDirR - recoil;
addGlow(_root[_local6]._x, _root[_local6]._y, 30, 130);
fireRightGun = true;
_root[_local6].onEnterFrame = function () {
bulletCode(this, true, 5);
};
}
gunTimer = 2;
recoil = recoil + 5;
} else if (weapon == 7) {
playSound("m16Shot", playerL._x, playerL._y);
var _local6 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local6, _root.getNextHighestDepth());
_root[_local5]._x = (_root[_local4]._x = (_root[_local6]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(10)))));
_root[_local5]._y = (_root[_local4]._y = (_root[_local6]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(10)))));
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 20)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 25);
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 20)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 25);
_root[_local3].gotoAndStop(1);
_root[_local6]._rotation = (mDirR - recoil) - ((recoil / 10) + (random(10 * recoil) / 10));
addGlow(_root[_local6]._x, _root[_local6]._y, 30, 130);
_root[_local6].onEnterFrame = function () {
bulletCode(this, true, 7);
};
gunTimer = 2;
recoil = recoil + 2;
}
_root[_local5]._rotation = mDirR;
}
}
if (((((mousePress && (gunTimer <= 0)) && (_root["ammo" + weapon] <= 0)) && (_root[("ammo" + weapon) + "Total"] > 0)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) {
playerB.body.gotoAndStop(2);
}
backCity._x = -_x;
backCity._y = -_y;
topLayer.swapDepths(_root.getNextHighestDepth());
if (startGameBlackFade != undefined) {
startGameBlackFade.swapDepths(_root.getNextHighestDepth());
}
if (banana != undefined) {
banana.swapDepths(_root.getNextHighestDepth());
}
if (speechBubble != undefined) {
speechBubble.swapDepths(_root.getNextHighestDepth());
}
HUD.swapDepths(_root.getNextHighestDepth());
crosshair.swapDepths(_root.getNextHighestDepth());
};
crosshair.onPress = function () {
mousePress = true;
if (((((((gunTimer <= 0) && (_root["ammo" + weapon] > 0)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) && (weapon != 4)) && (weapon != 5)) && (weapon != 7)) {
_root["ammo" + weapon]--;
if ((_root["ammo" + weapon] <= 0) && (_root[("ammo" + weapon) + "Total"] > 0)) {
playerB.body.gotoAndStop(2);
}
var _local5 = "smoke" + _root.getNextHighestDepth();
attachMovie("smoke", _local5, _root.getNextHighestDepth());
_root[_local5].ySpeed = -1.3 - (0.01 * random(70));
_root[_local5]._xscale = (_root[_local5]._yscale = 70 + random(30));
_root[_local5].onEnterFrame = function () {
this._y = this._y + (this.ySpeed * timescale);
this.ySpeed = this.ySpeed + (((-this.ySpeed) * 0.02) * timescale);
this._xscale = (this._yscale = this._yscale - (this.ySpeed * timescale));
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
var _local4 = "shell" + _root.getNextHighestDepth();
attachMovie("shell", _local4, _root.getNextHighestDepth());
_root[_local4].fallspeed = -3;
_root[_local4].xSpeed = -1.5 + (0.01 * random(300));
_root[_local4]._alpha = 300;
_root[_local4].rotSpeed = -10 + (0.01 * random(2000));
_root[_local4].onEnterFrame = function () {
this._y = this._y + (this.fallspeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this._x = this._x + (this.xSpeed * timescale);
this._rotation = this._rotation + (this.rotSpeed * timescale);
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = (-this.fallspeed) * 0.5;
this.xSpeed = this.xSpeed * 0.8;
this.rotSpeed = this.rotSpeed * 0.8;
this._y = this._y + (this.fallspeed * 2);
}
};
var _local6 = "mF" + _root.getNextHighestDepth();
attachMovie("muzzle", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = (_root[_local6]._yscale = 25);
if (weapon == 2) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
gunTimer = 8;
recoil = recoil + 10;
} else if (weapon == 3) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
if (fireRightGun) {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
fireRightGun = false;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
} else {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
fireRightGun = true;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
}
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
gunTimer = 4;
recoil = recoil + 10;
} else if (weapon == 6) {
playSound("shotgunShot", playerL._x, playerL._y);
var _local7 = 0;
while (_local7++ , _local7 < 10) {
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local3]._rotation = (mDirR - 7) + random(14);
_root[_local3].gotoAndStop(2);
if (_local7 < 6) {
_root[_local3].soundOn = false;
}
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 3);
};
}
_root[_local6]._x = (_root[_local5]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local6]._y = (_root[_local5]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4].gotoAndStop(2);
addGlow(_root[_local5]._x, _root[_local5]._y, 30, 130);
gunTimer = 20;
recoil = recoil + 18;
}
_root[_local6]._rotation = mDirR;
}
};
crosshair.onRelease = function () {
mousePress = false;
};
crosshair.onReleaseOutside = function () {
mousePress = false;
};
_root.createEmptyMovieClip("soundFX", _root.getNextHighestDepth());
clearInterval(fpsTimer);
fpsTimer = setInterval(function () {
showFPS = fps;
fps = 0;
}, 1000);
Frame 9
stopAllSounds();
Mouse.hide();
for (cObject in _root) {
if (_root[cObject]._name != "DTADS") {
_root[cObject].swapDepths(_root.getNextHighestDepth());
_root[cObject].removeMovieClip();
}
}
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - _ymouse, playerL._x - _xmouse) * 180) / Math.PI);
var mDirR = ((Math.atan2(_ymouse - (playerL._y - 30), _xmouse - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
roofWindow.broken = false;
fadeToDark = false;
levelComplete = false;
showHint = false;
if (health <= 0) {
health = 100;
}
_root.play();
Frame 10
function sAni(anim) {
if (anim.currentFrame == undefined) {
anim.currentFrame = anim._currentframe;
}
if (timescale <= 1) {
anim.currentFrame = anim.currentFrame + timescale;
} else {
anim.currentFrame = anim.currentFrame + 1;
}
anim.gotoAndStop(Math.round(anim.currentFrame));
if (anim.currentFrame >= anim._totalframes) {
anim.currentFrame = 1;
anim.gotoAndStop(1);
}
}
function sparks(obj) {
if (obj.xSpeed == undefined) {
if (lvl.hitTest(obj._x + 5, obj._y - 5, true)) {
obj._x = obj._x - 5;
obj.xSpeed = -random(5);
} else if (lvl.hitTest(obj._x - 5, obj._y - 5, true)) {
obj._x = obj._x + 5;
obj.xSpeed = random(5);
} else {
obj.xSpeed = -5 + random(10);
}
if (lvl.hitTest(obj._x, obj._y - 5, true)) {
obj._y = obj._y + 5;
obj.fallspeed = random(5);
} else if (lvl.hitTest(obj._x, obj._y + 5, true)) {
obj._y = obj._y - 5;
obj.fallspeed = -random(5);
} else {
obj.fallspeed = -5 + random(10);
}
}
if (lvl.hitTest(obj._x, obj._y, true)) {
if (obj.fallspeed > 0) {
obj.fallspeed = (-obj.fallspeed) * 0.9;
}
}
obj.fallspeed = obj.fallspeed + (0.3 * timescale);
obj.xSpeed = obj.xSpeed + (((-obj.xSpeed) * 0.01) * timescale);
obj._alpha = obj._alpha + (((-obj._alpha) * 0.1) * timescale);
obj._y = obj._y + (obj.fallspeed * timescale);
obj._x = obj._x + (obj.xSpeed * timescale);
if (obj._alpha <= 0) {
obj.removeMovieClip();
}
}
function addSparks(xPos, yPos, amount) {
var _local4 = 0;
while (_local4++ , _local4 < (amount * particleAmount)) {
var _local3 = "spark" + _root.getNextHighestDepth();
attachMovie("spark", _local3, _root.getNextHighestDepth());
_root[_local3].onEnterFrame = function () {
sparks(this);
};
_root[_local3]._x = xPos;
_root[_local3]._y = yPos;
}
}
function glowCode(obj) {
if (obj.sizeXY == undefined) {
obj.sizeXY = 30;
obj._width = (obj._height = obj.sizeXY);
}
obj._width = (obj._height = obj.sizeXY);
obj._alpha = obj.sizeXY;
obj.sizeXY = obj.sizeXY + (((-obj.sizeXY) * 0.15) * timescale);
if (obj._alpha <= 0) {
obj.removeMovieClip();
}
}
function bulletCode(obj, friendly, power) {
if ((obj.firstFrame == undefined) && (obj._name != undefined)) {
if (lvl.hitTest(obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * -14), obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * -14), true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 7);
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
obj.firstFrame = true;
}
obj._x = obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
obj._y = obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
if (getDist(playerL._x, obj._x, playerL._y, obj._y) > 670) {
obj.removeMovieClip();
}
if (friendly) {
if (obj.rangeCheck != true) {
var _local3 = 0;
while (_local3++ , _local3 <= enemies) {
if (getDist(_root["nmy" + _local3]._x, obj._x, _root["nmy" + _local3]._y, obj._y) < 500) {
if ((_root["nmy" + _local3].gunReady != true) && (_root["nmy" + _local3].health > 0)) {
_root["nmy" + _local3].xSpeed2 = 0;
if (_root["nmy" + _local3].weapon == 1) {
_root["nmy" + _local3].gotoAndStop(3);
} else if (_root["nmy" + _local3].weapon == 6) {
_root["nmy" + _local3].gotoAndStop(7);
} else if (_root["nmy" + _local3].weapon == 7) {
_root["nmy" + _local3].gotoAndStop(8);
} else if (_root["nmy" + _local3].weapon == 3) {
_root["nmy" + _local3].gotoAndStop(9);
}
_root["nmy" + _local3].timer = 42 + random(5);
}
}
}
obj.rangeCheck = true;
}
var _local3 = 0;
while (_local3++ , _local3 <= enemies) {
if (_root["nmy" + _local3].hitTest(obj._x, obj._y, true)) {
if ((obj._y < (_root["nmy" + _local3]._y - 22)) && (_root["nmy" + _local3].health > 0)) {
if ((obj._x < (_root["nmy" + _local3]._x + 19)) && (obj._x > (_root["nmy" + _local3]._x - 19))) {
if ((_root["nmy" + _local3].health - (power * 3)) > 0) {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - (power * 3);
} else {
_root["nmy" + _local3].health = 0;
}
_root.nrOfHeadShots++;
if (_root.nrOfHeadShots >= 20) {
_root.unlockAchievement(5);
}
} else {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - power;
}
} else {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - power;
}
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
if ((_root["nmy" + _local3].gunReady != true) && (_root["nmy" + _local3].health > 0)) {
_root["nmy" + _local3].xSpeed2 = 0;
if (_root["nmy" + _local3].weapon == 1) {
_root["nmy" + _local3].gotoAndStop(3);
} else if (_root["nmy" + _local3].weapon == 6) {
_root["nmy" + _local3].gotoAndStop(7);
} else if (_root["nmy" + _local3].weapon == 7) {
_root["nmy" + _local3].gotoAndStop(8);
} else if (_root["nmy" + _local3].weapon == 3) {
_root["nmy" + _local3].gotoAndStop(9);
}
_root["nmy" + _local3].timer = 21 + random(5);
}
obj.removeMovieClip();
}
}
} else if (playerL.hitTest(obj._x, obj._y, true) || (playerB.hitTest(obj._x, obj._y, true))) {
health = health - (power / 2);
HUD.damage._alpha = HUD.damage._alpha + (power * 4);
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
obj.removeMovieClip();
}
var _local3 = 0;
while (_local3++ , _local3 <= gasCans) {
if (_root["gasCan" + _local3].hitTest(obj._x, obj._y, true)) {
explName = "expl" + _root.getNextHighestDepth();
attachMovie("explosion", explName, _root.getNextHighestDepth());
_root[explName]._x = _root["gasCan" + _local3]._x;
_root[explName]._y = _root["gasCan" + _local3]._y;
_root[explName]._xscale = (_root[explName]._yscale = 50);
_root["gasCan" + _local3].swapDepths(_root.getNextHighestDepth());
_root["gasCan" + _local3].removeMovieClip();
_local3 = 0;
while (_local3++ , _local3 <= enemies) {
if ((getDist(_root["nmy" + _local3]._x, obj._x, _root["nmy" + _local3]._y, obj._y) < 130) && (_root["nmy" + _local3]._y < _root[explName]._y)) {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - 50;
}
}
obj.removeMovieClip();
}
}
if (obj._name != undefined) {
if (lvl.hitTest(obj._x, obj._y, true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 4 + random(4));
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
}
}
function addGlow(xPos, yPos, alpha, size) {
glowName = "glow" + _root.getNextHighestDepth();
attachMovie("glow", glowName, _root.getNextHighestDepth());
_root[glowName]._x = xPos;
_root[glowName]._y = yPos;
_root[glowName]._alpha = alpha;
_root[glowName]._width = (_root[glowName]._height = size);
_root[glowName].onEnterFrame = function () {
glowCode(this);
};
}
function getDist(x1, x2, y1, y2) {
return(Math.sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2))));
}
function onScreen(X, Y) {
if ((((X > (-_root._x)) && (X < ((-_root._x) + 600))) && (Y > (-_root._y))) && (Y < ((-_root._y) + 450))) {
return(true);
}
return(false);
}
function gangster(obj) {
if (obj.playerX == undefined) {
obj.timer = 30 + random(40);
obj.dead = false;
if (obj.health == undefined) {
obj.health = 20;
}
obj.gunTimer = 5;
obj.roundsFired = 0;
obj.recoil = 0;
obj.xscale = obj._xscale;
obj.xSpeed = (obj.xSpeed2 = 0);
obj.playerY = playerL._y;
if (!obj.dontRandomizeXScale) {
if (random(2) == 1) {
obj._xscale = -obj.xscale;
}
}
obj.playerX = playerL._x;
}
obj.timer = obj.timer - timescale;
obj.playerY = obj.playerY + (((playerL._y + playerL.legs.bodyPos._y) - obj.playerY) * (0.05 * timescale));
obj.playerX = obj.playerX + ((playerL._x - obj.playerX) * (0.05 * timescale));
obj.playerDir2 = (Math.atan2(obj.playerY - obj._y, obj.playerX - obj._x) * 180) / Math.PI;
if (obj.activated && (obj.health > 0)) {
if (obj.gunReady) {
obj.gunTimer = obj.gunTimer - timescale;
if ((obj.gunTimer <= 0) && (getDist(obj._x, playerL._x, obj._y, playerL._y) < 600)) {
var _local5 = 0;
obj.sightClear = true;
while (_local5 < getDist(obj._x, playerL._x, obj._y, playerL._y)) {
if (lvl.hitTest(obj._x + (Math.sin((obj.playerDir2 + 90) * (Math.PI/180)) * _local5), (obj._y - 30) - (Math.cos((obj.playerDir2 + 90) * (Math.PI/180)) * _local5), true)) {
obj.sightClear = false;
_local5 = 9999;
}
_local5 = _local5 + 10;
}
if (obj.sightClear) {
obj.mDir = (Math.atan2(obj._y - obj.playerY, obj._x - obj.playerX) * 180) / Math.PI;
obj.mDirR = (Math.atan2(obj.playerY - obj._y, obj.playerX - obj._x) * 180) / Math.PI;
var _local3 = "smoke" + _root.getNextHighestDepth();
attachMovie("smoke", _local3, _root.getNextHighestDepth());
_root[_local3].ySpeed = -1.3 - (0.01 * random(70));
_root[_local3]._xscale = (_root[_local3]._yscale = 70 + random(30));
_root[_local3].onEnterFrame = function () {
this._y = this._y + (this.ySpeed * timescale);
this.ySpeed = this.ySpeed + (((-this.ySpeed) * 0.02) * timescale);
this._xscale = (this._yscale = this._yscale - (this.ySpeed * timescale));
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
var _local8 = "mF" + _root.getNextHighestDepth();
attachMovie("muzzle", _local8, _root.getNextHighestDepth());
_root[_local8]._xscale = (_root[_local8]._yscale = 25);
var _local9 = "bu" + _root.getNextHighestDepth();
var _local4 = "sh" + _root.getNextHighestDepth();
attachMovie("shell", _local4, _root.getNextHighestDepth());
if (obj.weapon == 1) {
playSound("pistolShot", obj._x, obj._y);
attachMovie("bullet", _local9, _root.getNextHighestDepth());
_root[_local8]._x = (_root[_local3]._x = (_root[_local9]._x = (obj._x + (Math.sin((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * 15)) * (Math.PI/180)) * 20)) + (Math.sin((((-obj.mDir) - 90) + ((obj._xscale / Math.abs(obj._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local8]._y = (_root[_local3]._y = (_root[_local9]._y = (obj._y - (Math.cos((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * 15)) * (Math.PI/180)) * 20)) + (Math.cos((((-obj.mDir) - 90) + ((obj._xscale / Math.abs(obj._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (obj._x + (Math.sin((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * 15)) * (Math.PI/180)) * 20)) + (Math.sin((((-obj.mDir) - 90) + ((obj._xscale / Math.abs(obj._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (obj._y - (Math.cos((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * 15)) * (Math.PI/180)) * 20)) + (Math.cos((((-obj.mDir) - 90) + ((obj._xscale / Math.abs(obj._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4].gotoAndStop(1);
_root[_local9]._rotation = obj.mDirR;
addGlow(_root[_local9]._x, _root[_local9]._y, 30, 130);
_root[_local9].onEnterFrame = function () {
bulletCode(this, false, 7);
};
obj.recoil = obj.recoil + 10;
obj.gunTimer = 20 + random(20);
} else if (obj.weapon == 6) {
playSound("shotgunShot", obj._x, obj._y);
_local5 = 0;
while (_local5++ , _local5 < 10) {
_local9 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local9, _root.getNextHighestDepth());
_root[_local9]._x = (obj._x + (Math.sin((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local9]._y = (obj._y - (Math.cos((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local9]._rotation = (obj.mDirR - 7) + random(14);
_root[_local9].gotoAndStop(2);
_root[_local9].onEnterFrame = function () {
bulletCode(this, false, 3);
};
}
_root[_local8]._x = (_root[_local3]._x = (obj._x + (Math.sin((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local8]._y = (_root[_local3]._y = (obj._y - (Math.cos((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local4]._x = (obj._x + (Math.sin((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4]._y = (obj._y - (Math.cos((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4].gotoAndStop(2);
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
obj.gunTimer = 40 + random(10);
obj.recoil = obj.recoil + 18;
} else if (obj.weapon == 7) {
playSound("m16Shot", obj._x, obj._y);
_local9 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local9, _root.getNextHighestDepth());
_root[_local9]._rotation = obj.mDirR;
_root[_local9].gotoAndStop(1);
_root[_local9].onEnterFrame = function () {
bulletCode(this, false, 6);
};
_root[_local8]._x = (_root[_local3]._x = (_root[_local9]._x = obj._x + (Math.sin((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 57)));
_root[_local8]._y = (_root[_local3]._y = (_root[_local9]._y = (obj._y - 18) + (Math.cos((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 57)));
_root[_local4]._x = obj._x + (Math.sin((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4]._y = (obj._y - 27.3) + (Math.cos((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4].gotoAndStop(1);
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
obj.gunTimer = 2;
obj.recoil = obj.recoil + 0.8;
obj.roundsFired++;
var _local10 = 6 + random(5);
if (obj.roundsFired > _local10) {
obj.gunTimer = 30 + random(30);
obj.roundsFired = 0;
}
} else if (obj.weapon == 3) {
playSound("uziShot", obj._x, obj._y, 3);
_local9 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local9, _root.getNextHighestDepth());
_root[_local9]._rotation = obj.mDirR;
_root[_local9].gotoAndStop(1);
_root[_local9].onEnterFrame = function () {
bulletCode(this, false, 4);
};
_root[_local8]._x = (_root[_local3]._x = (_root[_local9]._x = (obj._x + (Math.sin((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * 15)) * (Math.PI/180)) * 20)) + (Math.sin((((-obj.mDir) - 90) + ((obj._xscale / Math.abs(obj._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local8]._y = (_root[_local3]._y = (_root[_local9]._y = (obj._y - (Math.cos((obj._rotation + ((obj._xscale / Math.abs(obj._xscale)) * 15)) * (Math.PI/180)) * 20)) + (Math.cos((((-obj.mDir) - 90) + ((obj._xscale / Math.abs(obj._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = obj._x + (Math.sin((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4]._y = (obj._y - 27.3) + (Math.cos((((-obj.mDir) + 90) + ((obj._xscale / Math.abs(obj._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4].gotoAndStop(1);
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
obj.gunTimer = 3;
obj.recoil = obj.recoil + 0.8;
obj.roundsFired++;
var _local10 = 3 + random(2);
if (obj.roundsFired > _local10) {
obj.gunTimer = 23 + random(30);
obj.roundsFired = 0;
}
}
_root[_local8]._rotation = obj.mDirR;
_root[_local4].fallspeed = -3;
_root[_local4].xSpeed = -1.5 + (0.01 * random(300));
_root[_local4]._alpha = 300;
_root[_local4].rotSpeed = -10 + (0.01 * random(2000));
_root[_local4].onEnterFrame = function () {
this._y = this._y + (this.fallspeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this._x = this._x + (this.xSpeed * timescale);
this._rotation = this._rotation + (this.rotSpeed * timescale);
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = (-this.fallspeed) * 0.5;
this.xSpeed = this.xSpeed * 0.8;
this.rotSpeed = this.rotSpeed * 0.8;
this._y = this._y + (this.fallspeed * 2);
}
};
}
}
obj.recoil = obj.recoil + ((-obj.recoil) * (0.1 * timescale));
if (obj.timer <= 0) {
if (obj.playerX < obj._x) {
if ((obj.playerX + 260) < obj._x) {
obj.xSpeed2 = -2;
} else if ((obj.playerX + 200) > obj._x) {
obj.xSpeed2 = 2;
} else {
obj.xSpeed2 = 0;
}
} else if ((obj.playerX - 260) > obj._x) {
obj.xSpeed2 = 2;
} else if ((obj.playerX - 200) < obj._x) {
obj.xSpeed2 = -2;
} else {
obj.xSpeed2 = 0;
}
obj.timer = 30 + random(10);
}
if (obj.playerX < obj._x) {
if (obj.platform != 0) {
if (obj.xSpeed2 > 0) {
obj.legs.gotoAndStop(3);
} else if (obj.xSpeed2 < 0) {
obj.legs.gotoAndStop(2);
} else {
obj.legs.gotoAndStop(1);
}
} else {
obj.legs.gotoAndStop(1);
}
obj._xscale = -obj.xscale;
obj.playerDir = -((Math.atan2(obj._y - obj.playerY, obj._x - obj.playerX) * 180) / Math.PI);
obj.body._rotation = obj.playerDir * 0.3;
obj.body.arm._rotation = (obj.playerDir - obj.body._rotation) - obj.recoil;
obj.body.head._rotation = obj.playerDir - obj.body._rotation;
} else {
if (obj.platform != 0) {
if (obj.xSpeed2 < 0) {
obj.legs.gotoAndStop(3);
} else if (obj.xSpeed2 > 0) {
obj.legs.gotoAndStop(2);
} else {
obj.legs.gotoAndStop(1);
}
} else {
obj.legs.gotoAndStop(1);
}
obj._xscale = obj.xscale;
obj.playerDir = (Math.atan2(obj.playerY - obj._y, obj.playerX - obj._x) * 180) / Math.PI;
obj.body._rotation = obj.playerDir * 0.3;
obj.body.arm._rotation = (obj.playerDir - obj.body._rotation) - obj.recoil;
obj.body.head._rotation = obj.playerDir - obj.body._rotation;
}
} else {
if (obj.platform != 0) {
if (obj.timer <= 0) {
if (random(2) == 1) {
if (random(2) == 1) {
obj.xSpeed2 = -1;
obj.gotoAndStop(2);
obj._xscale = -obj.xscale;
} else {
obj.xSpeed2 = 1;
obj.gotoAndStop(2);
obj._xscale = obj.xscale;
}
} else {
obj.xSpeed2 = 0;
obj.gotoAndStop(1);
}
obj.timer = 60 + random(40);
}
}
if ((playerL._x > obj._x) && (obj._xscale > 0)) {
if (getDist(obj._x, playerL._x, obj._y, playerL._y) < 350) {
obj.xSpeed2 = 0;
if (obj.weapon == 1) {
obj.gotoAndStop(3);
} else if (obj.weapon == 6) {
obj.gotoAndStop(7);
} else if (obj.weapon == 7) {
obj.gotoAndStop(8);
} else if (obj.weapon == 3) {
obj.gotoAndStop(9);
}
obj.timer = 42 + random(5);
}
} else if ((playerL._x < obj._x) && (obj._xscale > 0)) {
if (getDist(obj._x, playerL._x, obj._y, playerL._y) < 150) {
obj.xSpeed2 = 0;
if (obj.weapon == 1) {
obj.gotoAndStop(3);
} else if (obj.weapon == 6) {
obj.gotoAndStop(7);
} else if (obj.weapon == 7) {
obj.gotoAndStop(8);
} else if (obj.weapon == 3) {
obj.gotoAndStop(9);
}
obj.timer = 42 + random(5);
}
} else if ((playerL._x < obj._x) && (obj._xscale < 0)) {
if (getDist(obj._x, playerL._x, obj._y, playerL._y) < 350) {
obj.xSpeed2 = 0;
if (obj.weapon == 1) {
obj.gotoAndStop(3);
} else if (obj.weapon == 6) {
obj.gotoAndStop(7);
} else if (obj.weapon == 7) {
obj.gotoAndStop(8);
} else if (obj.weapon == 3) {
obj.gotoAndStop(9);
}
obj.timer = 42 + random(5);
}
} else if ((playerL._x > obj._x) && (obj._xscale < 0)) {
if (getDist(obj._x, playerL._x, obj._y, playerL._y) < 150) {
obj.xSpeed2 = 0;
if (obj.weapon == 1) {
obj.gotoAndStop(3);
} else if (obj.weapon == 6) {
obj.gotoAndStop(7);
} else if (obj.weapon == 7) {
obj.gotoAndStop(8);
} else if (obj.weapon == 3) {
obj.gotoAndStop(9);
}
obj.timer = 42 + random(5);
}
}
}
if (obj.platform == 1) {
if (obj.xSpeed2 > 0) {
if (lvl.hitTest(obj._x + 40, (obj._y + (obj._height / 2)) + 20, true)) {
if (lvl.hitTest(obj._x + 40, obj._y + (obj._height / 3), true)) {
if (obj.gunReady) {
obj.xSpeed2 = 0;
} else {
obj.xSpeed2 = obj.xSpeed2 * -1;
obj._xscale = -obj.xscale;
obj.timer = 100;
}
}
} else if (obj.gunReady) {
obj.xSpeed2 = 0;
} else {
obj.xSpeed2 = obj.xSpeed2 * -1;
obj._xscale = -obj.xscale;
obj.timer = 100;
}
} else if (obj.xSpeed2 < 0) {
if (lvl.hitTest(obj._x - 40, (obj._y + (obj._height / 2)) + 20, true)) {
if (lvl.hitTest(obj._x - 40, obj._y + (obj._height / 3), true)) {
if (obj.gunReady) {
obj.xSpeed2 = 0;
} else {
obj.xSpeed2 = obj.xSpeed2 * -1;
obj._xscale = obj.xscale;
obj.timer = 50;
}
}
} else if (obj.gunReady) {
obj.xSpeed2 = 0;
} else {
obj.xSpeed2 = obj.xSpeed2 * -1;
obj._xscale = obj.xscale;
obj.timer = 50;
}
}
obj.xSpeed = obj.xSpeed + ((obj.xSpeed2 - obj.xSpeed) * (0.2 * timescale));
obj._x = obj._x + (obj.xSpeed * timescale);
}
} else if (obj.health > 0) {
if (obj.timer <= 0) {
if (onScreen(obj._x, obj._y)) {
obj.activated = true;
}
obj.timer = 5;
}
} else {
if ((obj.gunDrop != true) && (obj.dropGun != false)) {
actionAmount = actionAmount + 20;
if (actionAmount > 100) {
actionAmount = 100;
}
killCount++;
if (obj != undefined) {
if (weapon == 1) {
_root.knifeKills++;
if (_root.knifeKills >= 20) {
_root.unlockAchievement(1);
}
}
if (!playerL.aniOnGround) {
midAirKills++;
if (midAirKills >= 8) {
_root.unlockAchievement(6);
}
}
if (!playerL.onGroundAfterWJ) {
killsAfterWallJump++;
if (killsAfterWallJump >= 3) {
_root.unlockAchievement(2);
}
}
}
var _local6 = "gun" + _root.getNextHighestDepth();
attachMovie("droppedGun", _local6, _root.getNextHighestDepth());
if (obj.weapon == 1) {
_root[_local6].gotoAndStop(1);
_root[_local6].weaponAmmo = 2;
} else if (obj.weapon == 6) {
_root[_local6].gotoAndStop(3);
_root[_local6].weaponAmmo = 6;
} else if (obj.weapon == 7) {
_root[_local6].gotoAndStop(4);
_root[_local6].weaponAmmo = 7;
} else if (obj.weapon == 3) {
_root[_local6].gotoAndStop(2);
_root[_local6].weaponAmmo = 4;
}
_root[_local6]._x = obj._x;
_root[_local6]._y = obj._y;
_root[_local6].fallspeed = -4 - (0.01 * random(200));
_root[_local6].xSpeed = -3 + (0.01 * random(600));
_root[_local6].rotSpeed = -8 + random(16);
_root[_local6].onEnterFrame = function () {
if (this.playerNear || (getDist(this._x, playerL._x, this._y, playerL._y) < 70)) {
this.playerNear = true;
this._x = this._x + (((playerL._x - this._x) * 0.3) * timescale);
this._y = this._y + (((playerL._y - this._y) * 0.3) * timescale);
this._rotation = this._rotation + (13 * timescale);
this._alpha = this._alpha - (10 * timescale);
if (this._alpha <= 0) {
playSound("pistolCock", obj._x, obj._y);
if ((this.weaponAmmo == 2) || (this.weaponAmmo == 4)) {
if (_root[("weapon" + this.weaponAmmo) + "Active"] == true) {
_root[("weapon" + (this.weaponAmmo + 1)) + "Active"] = true;
}
}
_root[("weapon" + this.weaponAmmo) + "Active"] = true;
_root[("ammo" + this.weaponAmmo) + "Total"] = _root[("ammo" + this.weaponAmmo) + "Total"] + _root[("ammo" + this.weaponAmmo) + "Max"];
this.removeMovieClip();
}
this.hitGround = true;
}
if (this.hitGround != true) {
this._rotation = this._rotation + (this.rotSpeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this.xSpeed = this.xSpeed + (((-this.xSpeed) * 0.01) * timescale);
this._x = this._x + (this.xSpeed * timescale);
this._y = this._y + (this.fallspeed * timescale);
var _local3 = -1;
if (lvl.hitTest(this._x + 5, this._y, true)) {
this.xSpeed = this.xSpeed * -0.8;
this._x = this._x - 4;
} else if (lvl.hitTest(this._x - 5, this._y, true)) {
this.xSpeed = this.xSpeed * -0.8;
this._x = this._x + 4;
}
while (_local3++ , _local3 < 5) {
if (lvl.hitTest(this._x, (this._y + 5) - _local3, true)) {
this.fallspeed = 0;
this.xSpeed = 0;
this._y = this._y - _local3;
this.hitGround = true;
}
}
} else if (this._rotation > 0) {
this._rotation = this._rotation + ((180 - this._rotation) * 0.2);
} else {
this._rotation = this._rotation + ((-180 - this._rotation) * 0.2);
}
};
obj.gunDrop = true;
}
if ((obj._currentframe != 5) && (obj._currentframe != 6)) {
if (((obj._xscale == obj.xscale) && (obj.playerX > obj._x)) || ((obj._xscale == (-obj.xscale)) && (obj.playerX < obj._x))) {
obj.gotoAndStop(5);
} else {
obj.gotoAndStop(6);
}
}
if (obj.timer < -200) {
obj._alpha = obj._alpha - (2 * timescale);
if (obj._alpha <= 0) {
obj.swapDepths(_root.getNextHighestDepth());
obj.removeMovieClip();
var _local5 = 0;
var _local7 = 0;
while (_local5++ , _local5 <= enemies) {
if (_root["nmy" + _local5]._name != undefined) {
_local7++;
_root["nmy" + _local5]._name = "nmy" + _local7;
}
}
enemies = _local7;
}
}
if (obj.dead == false) {
if (obj.health <= -7) {
gibCharacter(obj, "g", (obj.playerDir2 = (Math.atan2(playerL._y - obj._y, playerL._x - obj._x) * 180) / Math.PI), obj.gfxNr);
addBlood(obj._x, obj._y, -90, 30);
playSound("bulletHit", obj._x, obj._y);
obj.swapDepths(_root.getNextHighestDepth());
obj.removeMovieClip();
var _local5 = 0;
var _local7 = 0;
while (_local5++ , _local5 <= enemies) {
if (_root["nmy" + _local5]._name != undefined) {
_local7++;
_root["nmy" + _local5]._name = "nmy" + _local7;
}
}
enemies = _local7;
}
}
}
}
function addBlood(xPos, yPos, dir, amount) {
if (bloodEnabled) {
var _local5 = 0;
while (_local5++ , _local5 <= (amount * particleAmount)) {
var _local3 = "blo" + _root.getNextHighestDepth();
attachMovie("blood", _local3, _root.getNextHighestDepth());
_root[_local3]._x = xPos;
_root[_local3]._y = yPos;
_root[_local3]._alpha = 200;
_root[_local3].xSpeed = Math.sin((((dir + 70) + random(40)) - 180) * (Math.PI/180)) * (2 + (0.001 * random(3000)));
_root[_local3].fallspeed = Math.cos((((dir + 70) + random(40)) - 180) * (Math.PI/180)) * (2 + (0.001 * random(5000)));
_root[_local3].onEnterFrame = function () {
this._x = this._x + (this.xSpeed * timescale);
this._y = this._y + (this.fallspeed * timescale);
this._xscale = (this._yscale = this._yscale + ((-this._yscale) * (0.01 * timescale)));
this.xSpeed = this.xSpeed + ((-this.xSpeed) * (0.01 * timescale));
this.fallspeed = this.fallspeed + (0.1 * timescale);
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (lvl.hitTest(this._x, this._y, true)) {
this.removeMovieClip();
}
};
}
}
}
function gibCharacter(obj, charTitle, dir, gfx) {
nrOfGibs++;
if (nrOfGibs >= 20) {
_root.unlockAchievement(3);
}
var _local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_arm1", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x + 5;
_root[_local6]._y = obj._y - 17;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_arm2", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x + 6;
_root[_local6]._y = obj._y + 2;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_hand", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x + 8;
_root[_local6]._y = obj._y + 13;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_arm1", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x - 10;
_root[_local6]._y = obj._y - 20;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_arm2", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x - 17;
_root[_local6]._y = obj._y - 5;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_hand", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x - 17;
_root[_local6]._y = obj._y + 12;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_body", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x;
_root[_local6]._y = obj._y + 10;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_leg1", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x - 6;
_root[_local6]._y = obj._y + 11;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_leg2", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x - 10;
_root[_local6]._y = obj._y + 25;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_foot", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x - 15;
_root[_local6]._y = obj._y + 43;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_leg1", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x + 2.5;
_root[_local6]._y = obj._y + 10.5;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_leg2", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x + 8;
_root[_local6]._y = obj._y + 24.4;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_foot", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x + 10.7;
_root[_local6]._y = obj._y + 42;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
_local6 = "gib" + _root.getNextHighestDepth();
attachMovie(charTitle + "_head", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = obj._xscale;
_root[_local6]._yscale = obj._yscale;
_root[_local6]._x = obj._x + 2.5;
_root[_local6]._y = obj._y - 24.5;
_root[_local6].gfxNr = gfx;
_root[_local6].onEnterFrame = function () {
bodyPart(this, dir);
};
}
function bodyPart(obj, dir) {
if (obj.xSpeed == undefined) {
obj.timer = 5;
obj.rotSpeed = -10 + (0.001 * random(20000));
obj.xSpeed = Math.sin((((dir + 50) + random(40)) - 180) * (Math.PI/180)) * (4 + (0.001 * random(8000)));
obj.fallspeed = (-Math.cos((((dir + 50) + random(40)) - 180) * (Math.PI/180))) * (2 + (0.001 * random(8000)));
}
obj.timer--;
if (obj.timer <= 0) {
addBlood(obj._x, obj._y, -180 + random(360), 1);
obj.timer = 6 + random(3);
}
obj._rotation = obj._rotation + (obj.rotSpeed * timescale);
obj.xSpeed = obj.xSpeed + ((-obj.xSpeed) * (0.01 * timescale));
obj.fallspeed = obj.fallspeed + (0.3 * timescale);
obj._x = obj._x + (obj.xSpeed * timescale);
obj._y = obj._y + (obj.fallspeed * timescale);
if (lvl.hitTest(obj._x + 10, obj._y, true)) {
obj.lvlHit = true;
obj._x = obj._x - (Math.abs(xSpeed) * 5);
obj.xSpeed = obj.xSpeed * -0.8;
}
if (lvl.hitTest(obj._x - 10, obj._y, true)) {
obj.lvlHit = true;
obj._x = obj._x - (Math.abs(xSpeed) * 5);
obj.xSpeed = obj.xSpeed * -0.8;
}
if (lvl.hitTest(obj._x, obj._y + 10, true)) {
obj.lvlHit = true;
obj.xSpeed = obj.xSpeed * 0.7;
obj._y = obj._y - (Math.abs(fallspeed) * 5);
obj.fallspeed = obj.fallspeed * -0.6;
obj.rotSpeed = obj.rotSpeed * 0.8;
}
if (obj.lvlHit) {
obj._alpha = obj._alpha - 2;
if (obj._alpha <= 0) {
obj.swapDepths(_root.getNextHighestDepth());
obj.removeMovieClip();
}
}
}
function rullBordCode(obj) {
if (getDist(obj._x, playerL._x, obj._y, playerL._y) < 610) {
if (obj.xSpeed == undefined) {
obj.xSpeed = 0;
}
obj._x = obj._x + (obj.xSpeed * timescale);
obj.xSpeed = obj.xSpeed + ((-obj.xSpeed) * (0.005 * timescale));
if (lvl.hitTest(obj._x + obj._width, obj._y + 10, true)) {
obj._x = obj._x - Math.abs(obj.xSpeed);
obj.xSpeed = obj.xSpeed * (-(1 - (0.01 * obj.weight)));
}
if (lvl.hitTest(obj._x, (obj._y + obj._height) - 10, true)) {
obj._x = obj._x + Math.abs(obj.xSpeed);
obj.xSpeed = obj.xSpeed * (-(1 - (0.01 * obj.weight)));
}
if (((playerL._x > obj._x) && (playerL._x < (obj._x + obj._width))) && ((playerL._y + (playerL.sHeight / 2)) < (obj._y + 15))) {
if (((playerL._y + (playerL.sHeight / 2)) > obj._y) && (playerL.fallspeed >= 0)) {
if (((obj.playerOn != true) && (playerL.xSpeed2 != 0)) && (Math.abs(playerL._rotation) < 40)) {
obj.xSpeed = playerL.xSpeed2 * (1 - (0.005 * obj.weight));
playerL.xSpeed = 0;
obj.playerOn = true;
}
playerL._y = obj._y - (playerL.sHeight / 2);
playerL.fallspeed = 0;
playerL.onGround = (playerL.landedOnGround = (playerL.jumpReady = true));
playerL.bTG = false;
}
if ((((playerL._y + 7) + (playerL.sHeight / 2)) > obj._y) && (playerL.fallspeed >= 0)) {
playerL._x = playerL._x + (obj.xSpeed * timescale);
playerL.aniOnGround = true;
}
} else {
obj.playerOn = false;
}
}
}
function elevatorCode(obj) {
if (getDist(obj._x, playerL._x, obj._y, playerL._y) < 610) {
if (obj.ySpeed == undefined) {
obj.moving = false;
obj.startY = obj._y;
obj.yTarget = obj._y;
obj.ySpeed = 0;
}
obj._y = obj._y + (obj.ySpeed * timescale);
if (obj.moveAmount < 0) {
if (obj._y < (obj.startY + obj.moveAmount)) {
obj._y = obj.startY + obj.moveAmount;
} else if (obj._y > obj.startY) {
obj._y = obj.startY;
}
} else if (obj._y > (obj.startY + obj.moveAmount)) {
obj._y = obj.startY + obj.moveAmount;
} else if (obj._y < obj.startY) {
obj._y = obj.startY;
}
if ((obj._y - 3) > obj.yTarget) {
obj.ySpeed = -3;
} else if ((obj._y + 3) < obj.yTarget) {
obj.ySpeed = 3;
} else {
obj._y = obj.yTarget;
obj.ySpeed = 0;
}
if (Math.round(obj._y) != Math.round(obj.yTarget)) {
obj.door._alpha = obj.door._alpha + ((120 - obj.door._alpha) * (0.2 * timescale));
if ((playerL._x > (obj._x - 14)) && (playerL._x < (obj._x + (playerL.sWidth / 3)))) {
playerL._x = obj._x + (playerL.sWidth / 3);
}
} else {
obj.door._alpha = obj.door._alpha + ((-20 - obj.door._alpha) * (0.2 * timescale));
}
if (Math.round(obj._y) == Math.round(obj.startY + obj.moveAmount)) {
_root.lvl[obj._name + "Door2"]._xscale = (_root.lvl[obj._name + "Door2"]._yscale = 0);
_root.lvl[obj._name + "Door1"]._xscale = _root.lvl[obj._name + "Door1"].sXScale;
_root.lvl[obj._name + "Door1"]._yscale = _root.lvl[obj._name + "Door1"].sYScale;
} else if (obj._y == obj.startY) {
_root.lvl[obj._name + "Door1"]._xscale = (_root.lvl[obj._name + "Door1"]._yscale = 0);
_root.lvl[obj._name + "Door2"]._xscale = _root.lvl[obj._name + "Door2"].sXScale;
_root.lvl[obj._name + "Door2"]._yscale = _root.lvl[obj._name + "Door2"].sYScale;
} else {
_root.lvl[obj._name + "Door2"]._xscale = _root.lvl[obj._name + "Door2"].sXScale;
_root.lvl[obj._name + "Door2"]._yscale = _root.lvl[obj._name + "Door2"].sYScale;
_root.lvl[obj._name + "Door1"]._xscale = _root.lvl[obj._name + "Door1"].sXScale;
_root.lvl[obj._name + "Door1"]._yscale = _root.lvl[obj._name + "Door1"].sYScale;
}
if ((((playerL._x > obj._x) && (playerL._x < (obj._x + obj._width))) && ((playerL._y + (playerL.sHeight / 2)) < (obj._y + 30))) && (playerL._y > ((obj._y - obj._height) - 10))) {
if (playerL._y < (obj._y - 170)) {
playerL._y = obj._y - 170;
}
if (obj.playerOn == false) {
if (playerL._y > ((obj.startY + obj.moveAmount) + 10)) {
obj.yTarget = obj.startY + obj.moveAmount;
} else {
obj.yTarget = obj.startY;
}
obj.playerOn = true;
}
if ((playerL._y + (playerL.sHeight / 2)) > obj._y) {
playerL._y = obj._y - (playerL.sHeight / 2);
playerL.fallspeed = 0;
playerL.onGround = (playerL.landedOnGround = (playerL.jumpReady = true));
playerL.bTG = false;
}
if (((playerL._y + 7) + (playerL.sHeight / 2)) > obj._y) {
playerL._y = playerL._y + obj.ySpeed;
playerL.aniOnGround = true;
}
} else {
obj.playerOn = false;
}
}
}
function brokenLight(obj) {
if (obj.timer == undefined) {
obj.timer = 10 + random(5);
}
obj.timer = obj.timer - timescale;
if ((obj.timer <= 0) && (Math.round(obj.timer) != -1)) {
obj.gotoAndStop(2);
} else {
obj.gotoAndStop(1);
}
if (obj.timer < -2) {
obj.timer = 60 + random(100);
}
}
function addGlasPiece(xPos, yPos) {
glasPieceName = "glP" + _root.getNextHighestDepth();
_root.attachMovie("glasPiece", glasPieceName, _root.getNextHighestDepth());
_root[glasPieceName]._x = xPos;
_root[glasPieceName]._y = yPos;
_root[glasPieceName].fallspeed = 0.01 * random(300);
_root[glasPieceName].timer = 80 + random(30);
_root[glasPieceName]._xscale = (_root[glasPieceName]._yscale = 90 + random(50));
_root[glasPieceName]._alpha = 60 + random(40);
_root[glasPieceName].rotSpeed = -2 + (random(400) * 0.01);
_root[glasPieceName].onEnterFrame = function () {
this.timer = this.timer - timescale;
if (this.timer <= 0) {
this._alpha = this._alpha - (timescale * 4);
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
this._y = this._y + (this.fallspeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this._rotation = this._rotation + (this.rotSpeed * timescale);
if (lvl.hitTest(this._x, this._y, true)) {
this._y = this._y - this.fallspeed;
this.fallspeed = this.fallspeed * -0.4;
}
};
}
function jTPlatformCode(obj) {
if (getDist(obj._x, playerL._x, obj._y, playerL._y) < obj._width) {
if (((playerL._x > obj._x) && (playerL._x < (obj._x + obj._width))) && ((playerL._y + (playerL.sHeight / 2)) < (obj._y + 15))) {
if (((playerL._y + (playerL.sHeight / 2)) > obj._y) && (playerL.fallspeed >= 0)) {
playerL._y = obj._y - (playerL.sHeight / 2);
playerL.fallspeed = 0;
playerL.onGround = (playerL.landedOnGround = (playerL.jumpReady = true));
playerL.bTG = false;
}
if ((((playerL._y + 7) + (playerL.sHeight / 2)) > obj._y) && (playerL.fallspeed >= 0)) {
playerL.aniOnGround = true;
}
}
}
}
function playSound(sName, xPos, yPos, ranNr) {
_root.soundFX["sound" + sName] = new Sound(soundFX);
if ((ranNr != undefined) && (ranNr != 0)) {
if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound((sName + (1 + random(ranNr))) + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName + (1 + random(ranNr)));
}
} else if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound(sName + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName);
}
var _local3 = ((xPos - ((-_root._x) + 300)) / 400) * 100;
if (_local3 > 100) {
_local3 = 100;
} else if (_local3 < -100) {
_local3 = -100;
}
_root.soundFX["sound" + sName].setPan(_local3);
_root.soundFX["sound" + sName].setVolume(SFXVolume * 100);
_root.soundFX["sound" + sName].start();
}
function medipack(obj) {
if (health > 0) {
if (obj.playerNear || (getDist(obj._x, playerL._x, obj._y, playerL._y) < 70)) {
obj.playerNear = true;
obj._x = obj._x + (((playerL._x - obj._x) * 0.3) * timescale);
obj._y = obj._y + (((playerL._y - obj._y) * 0.3) * timescale);
obj._rotation = obj._rotation + (13 * timescale);
obj._alpha = obj._alpha - (10 * timescale);
if (obj._alpha <= 0) {
playSound("medipack_collect", obj._x, obj._y);
health = health + 20;
if (health > 100) {
health = 100;
}
obj.swapDepths(_root.getNextHighestDepth());
obj.removeMovieClip();
}
obj.hitGround = true;
}
}
}
function addSpeechBubble(xPos, yPos, inputText, allowSkip, xOffset, timeVisible, gibberishVoice) {
if (xOffset == undefined) {
xOffset = 0;
}
_root.speechBubble.swapDepths(_root.getNextHighestDepth());
_root.speechBubble.removeMovieClip();
_root.attachMovie("speechBubble", "speechBubble", _root.getNextHighestDepth());
_root.speechBubble.inputText = inputText;
_root.speechBubble.gibberishVoice = gibberishVoice;
_root.speechBubble._x = xPos + xOffset;
_root.speechBubble._y = yPos;
_root.speechBubble.xPos = xPos;
_root.speechBubble.yPos = yPos;
_root.speechBubble.allowSkip = allowSkip;
if (timeVisible != undefined) {
_root.speechBubble.timeVisible = timeVisible;
}
}
function removeSpeechBubble() {
_root.speechBubble.swapDepths(_root.getNextHighestDepth());
_root.speechBubble.removeMovieClip();
}
function getAngle(xPos1, yPos1, xPos2, yPos2) {
return((Math.atan2(yPos1 - yPos2, xPos1 - xPos2) / Math.PI) * 180);
}
function spawnBanana(xPos, yPos) {
removeBanana();
_root.attachMovie("banana", "banana", _root.getNextHighestDepth());
_root.banana._x = xPos;
_root.banana._y = yPos;
}
function removeBanana() {
if (_root.banana != undefined) {
_root.addGlow(_root.banana._x, _root.banana._y, 80, 200);
_root.addSparks(_root.banana._x, _root.banana._y, 10);
}
_root.banana.swapDepths(_root.getNextHighestDepth());
_root.banana.removeMovieClip();
}
com.newgrounds.API.logCustomEvent("Level_1");
killsAfterWallJump = 0;
midAirKills = 0;
if (knifeKills == undefined) {
knifeKills = 0;
}
if (nrOfHeadShots == undefined) {
nrOfHeadShots = 0;
}
if (nrOfGibs == undefined) {
nrOfGibs = 0;
}
pausePlayer = true;
mouseXPos = playerL._x + 300;
mouseYPos = playerL._y - 100;
Mouse.show();
generalTimer = 0;
_root._x = (-_root.playerL._x) + 300;
_root._y = (-_root.playerL._y) + 200;
_root.createEmptyMovieClip("musicMC", _root.getNextHighestDepth());
musicStarted = false;
musicMC.bgMusic = new Sound(musicMC);
musicMC.bgMusic.attachSound("tutorial_music_1");
musicMC.bgMusic.onSoundComplete = function () {
musicMC.bgMusic.start();
};
hiddenMusicVolume = 1;
stop();
_root._quality = "MEDIUM";
showHint = false;
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
health = 100;
playerL.dead = false;
actionAmount = 100;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var timescale2 = 1;
var weapon = 2;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - mouseYPos, playerL._x - mouseXPos) * 180) / Math.PI);
var mDirR = ((Math.atan2(mouseYPos - (playerL._y - 30), mouseXPos - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
var weapon1Active = true;
var ammo1 = 0;
var ammo1Total = 0;
var ammo1Max = 0;
var weapon2Active = true;
var ammo2 = 18;
var ammo2Total = 36;
var ammo2Max = 18;
var weapon3Active = false;
var ammo3 = 36;
var ammo3Total = ammo2Total;
var ammo3Max = 36;
var weapon4Active = false;
var ammo4 = 32;
var ammo4Total = 0;
var ammo4Max = 32;
var weapon5Active = false;
var ammo5 = 64;
var ammo5Total = ammo4Total;
var ammo5Max = 64;
var weapon6Active = false;
var ammo6 = 8;
var ammo6Total = 0;
var ammo6Max = 8;
var weapon7Active = false;
var ammo7 = 30;
var ammo7Total = 0;
var ammo7Max = 30;
enemies = 0;
killCount = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
jTPlatform = 0;
roofWindow.broken = false;
if (musicVolume == undefined) {
musicVolume = 1;
}
if (SFXVolume == undefined) {
SFXVolume = 1;
}
fadeToDark = false;
levelComplete = false;
showOptions = false;
particleAmount = 1;
bloodEnabled = true;
slowMotionSFXEnabled = true;
fisk = false;
Key70Pressed = false;
Key73Pressed = false;
Key83Pressed = false;
Key75Pressed = false;
Mouse.removeListener(mouseListener);
delete mouseListener;
var mouseListener = new Object();
mouseListener.onMouseWheel = function (scrollAmount) {
if ((!mousePress) && (!pausePlayer)) {
if (scrollAmount > 0) {
var _local3 = 1;
var _local2 = weapon;
while (_local2++ , _local2 <= 7) {
if (((_root[("weapon" + _local2) + "Active"] == true) && ((_root["ammo" + _local2] + _root[("ammo" + _local2) + "Total"]) > 0)) || (_local2 == 1)) {
_local3 = _local2;
_local2 = 8;
}
}
weapon = _local3;
} else if (scrollAmount < 0) {
var _local3 = 1;
var _local2 = 8;
while (_local2-- , _local2 >= 1) {
if (((_root[("weapon" + _local2) + "Active"] == true) && ((_root["ammo" + _local2] + _root[("ammo" + _local2) + "Total"]) > 0)) || (_local2 == 1)) {
_local3 = _local2;
_local2 = 0;
}
}
_local2 = weapon;
while (_local2-- , _local2 >= 1) {
if (((_root[("weapon" + _local2) + "Active"] == true) && ((_root["ammo" + _local2] + _root[("ammo" + _local2) + "Total"]) > 0)) || (_local2 == 1)) {
_local3 = _local2;
_local2 = 0;
}
}
weapon = _local3;
}
}
};
Mouse.addListener(mouseListener);
onEnterFrame = function () {
if ((generalTimer >= 5) && (!musicStarted)) {
if (musicMC.bgMusicIntro == undefined) {
musicMC.bgMusic.start();
} else {
musicMC.bgMusicIntro.start();
}
musicStarted = true;
}
if (Key.isDown(85)) {
if (fisk != true) {
if (Key.isDown(70)) {
Key70Pressed = true;
}
if (Key.isDown(73)) {
Key73Pressed = true;
}
if (Key.isDown(83)) {
Key83Pressed = true;
}
if (Key.isDown(75)) {
Key75Pressed = true;
}
if (((Key70Pressed && (Key73Pressed)) && (Key83Pressed)) && (Key75Pressed)) {
i = 0;
while (i <= 7) {
_root[("weapon" + i) + "Active"] = true;
_root[("ammo" + i) + "Total"] = 9999;
_root["ammo" + i] = _root[("ammo" + i) + "Max"];
i++;
}
fisk = true;
}
}
}
generalTimer++;
if (!pausePlayer) {
mouseXPos = _xmouse;
mouseYPos = _ymouse;
kUp = Key.isDown(87);
kDown = Key.isDown(83);
kLeft = Key.isDown(65);
kRight = Key.isDown(68);
if (Key.isDown(16) || (Key.isDown(32))) {
kShift = true;
} else {
kShift = false;
}
if (weapon1Active && (Key.isDown(49))) {
weapon = 1;
} else if (weapon2Active && (Key.isDown(50))) {
weapon = 2;
} else if (weapon3Active && (Key.isDown(51))) {
weapon = 3;
} else if (weapon4Active && (Key.isDown(52))) {
weapon = 4;
} else if (weapon5Active && (Key.isDown(53))) {
weapon = 5;
} else if (weapon6Active && (Key.isDown(54))) {
weapon = 6;
} else if (weapon7Active && (Key.isDown(55))) {
weapon = 7;
}
if (Key.isDown(82)) {
if ((_root["ammo" + weapon] < _root[("ammo" + weapon) + "Max"]) && (_root[("ammo" + weapon) + "Total"] > 0)) {
playerB.body.gotoAndStop(2);
}
}
} else {
kUp = false;
kDown = false;
kLeft = false;
kRight = false;
kShift = false;
}
if (health <= 0) {
HUD.damage._alpha = HUD.damage._alpha + 8;
if (HUD.damage._alpha > 3000) {
HUD.damage._alpha = 3000;
}
HUD.fade.fadeSpeed = 1;
if (HUD.fade._alpha >= 100) {
playerL.dead = true;
}
timescale = timescale - 0.01;
if (timescale < 0) {
timescale = 0;
}
fadeToDark = true;
health = 0;
} else {
if ((HUD.damage._alpha - (0.7 * timescale)) >= 0) {
HUD.damage._alpha = HUD.damage._alpha - (0.7 * timescale);
} else {
HUD.damage._alpha = 0;
}
if (health <= 30) {
HUD.damage.timer++;
if (HUD.damage.timer > (health * 2)) {
HUD.damage._alpha = HUD.damage._alpha + 20;
HUD.damage.timer = 0;
}
}
if (HUD.damage._alpha > 60) {
HUD.damage._alpha = 60;
}
}
var i = 0;
while ((++i) <= enemies) {
gangster(_root["nmy" + i]);
}
fps++;
ammo3Total = ammo2Total;
ammo5Total = ammo4Total;
if (((_root["ammo" + weapon] + _root[("ammo" + weapon) + "Total"]) <= 0) && (weapon != 1)) {
i = 7;
while (i >= 1) {
if ((_root[("weapon" + i) + "Active"] == true) && ((_root["ammo" + i] + _root[("ammo" + i) + "Total"]) > 0)) {
weapon = i;
i = 0;
} else if (i == 1) {
weapon = 1;
}
i--;
}
mousePress = false;
}
recoil = recoil + (((-recoil) * 0.3) * timescale);
if (!showOptions) {
mDir = (-recoil) + ((Math.atan2((playerB._y - 30) - mouseYPos, playerB._x - mouseXPos) * 180) / Math.PI);
mDirR = recoil + ((Math.atan2(mouseYPos - (playerB._y - 30), mouseXPos - playerB._x) * 180) / Math.PI);
}
if (pausePlayer) {
if (((weapon != 1) && (weapon != 6)) && (weapon != 7)) {
mDir = -100;
} else {
mDir = -170;
}
}
if (Key.isDown(27) || (Key.isDown(80) && (health > 0))) {
if (doOnce27 != true) {
if (showOptions == false) {
Mouse.show();
showOptions = true;
} else {
Mouse.hide();
showOptions = false;
}
doOnce27 = true;
}
} else {
doOnce27 = false;
}
HUD.HUD.ammoText.text = (_root["ammo" + weapon] + " / ") + _root[("ammo" + weapon) + "Total"];
playerL._y = playerL._y + (playerL.fallspeed * timescale);
playerL.fallspeed = playerL.fallspeed + (0.4 * timescale);
playerL._x = playerL._x + (playerL.xSpeed * timescale);
playerL.xSpeed = playerL.xSpeed + (((playerL.xSpeed2 - playerL.xSpeed) * 0.2) * timescale);
playerL.rotSpeed = playerL.rotSpeed + (((playerL.rotSpeed2 - playerL.rotSpeed) * 0.07) * timescale);
playerL._rotation = playerL._rotation + (playerL.rotSpeed * timescale);
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.bX = playerL._x + (Math.sin((playerL._rotation + 180) * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos((playerL._rotation + 180) * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
if (actionAmount > 0) {
if (kShift) {
if (slowMotionSFXEnabled) {
if (kShiftOnce1 != true) {
playSound("slowDown", (-_root._x) + 300, (-_root._y) + 200);
kShiftOnce1 = true;
}
kShiftOnce2 = false;
}
timescale2 = timescale2 + ((0.3 - timescale2) * 0.1);
if (actionAmount < 0) {
actionAmount = 0;
}
} else {
if (slowMotionSFXEnabled) {
if (kShiftOnce2 != true) {
playSound("speedUp", (-_root._x) + 300, (-_root._y) + 200);
kShiftOnce2 = true;
}
kShiftOnce1 = false;
}
timescale2 = timescale2 + ((1 - timescale2) * 0.1);
}
} else {
if (slowMotionSFXEnabled) {
if (kShiftOnce2 != true) {
playSound("speedUp", (-_root._x) + 300, (-_root._y) + 200);
kShiftOnce2 = true;
}
kShiftOnce1 = false;
}
timescale2 = timescale2 + ((1 - timescale2) * 0.1);
kShift = false;
}
musicMC.bgMusic.setVolume(((timescale2 * 100) * hiddenMusicVolume) * musicVolume);
if ((showOptions != true) && (health > 0)) {
if (generalTimer > 90) {
timescale = timescale2 + (1 - (showFPS / 32));
} else {
timescale = timescale2;
}
} else if (health > 0) {
timescale = 0;
}
if (lvl.hitTest(playerL._x, playerL._y - (playerL.sHeight / 2), true)) {
var i = 0;
while ((++i) < (playerL.sHeight / 3)) {
if (lvl.hitTest(playerL._x, (playerL._y - (playerL.sHeight / 2.3)) + i, true)) {
if (playerL.fallspeed < 0) {
playerL.fallspeed = 0;
}
playerL._y = playerL._y + i;
}
}
if (lvl.hitTest(playerL._x, playerL._y + (playerL.sHeight / 2), true)) {
kDown = true;
kUp = false;
}
} else if (((((playerL._currentframe == 4) && (playerL._rotation > (-Math.abs(playerL.rotSpeed / 1.5)))) && (playerL._rotation < Math.abs(playerL.rotSpeed / 1.5))) && (!kRight)) && (!kLeft)) {
playerL._rotation = (playerB._rotation = 0);
playerL.rotSpeed = 0;
playerL.xSpeed = (playerL.xSpeed2 = 0);
playerL.gotoAndStop(6);
playerL.legs.gotoAndStop(6);
playerL.legs.currentFrame = 6;
}
if ((playerL.aniOnGround && (kDown)) && (playerL._currentframe != 4)) {
playerL.yHittestOffset = 20;
} else {
playerL.yHittestOffset = 0;
}
if (lvl.hitTest((playerL._x + 10) + (playerL.sWidth / 2), playerL._y + playerL.yHittestOffset, true)) {
var i = 0;
while ((++i) < (playerL.sWidth / 2)) {
if (lvl.hitTest((playerL._x + (playerL.sWidth / 2)) - i, playerL._y, true)) {
playerL.xSpeed = 0;
if (!playerL.onGround) {
playerL.xSpeed2 = 0;
}
playerL._x = playerL._x - i;
}
}
if ((!playerL.aniOnGround) && (!kShift)) {
playerL._rotation = playerL._rotation + ((-70 - playerL._rotation) * (0.05 * timescale));
}
if (kDown && (kRight)) {
kRight = false;
}
if ((playerL._currentframe == 4) && (playerL.xSpeed2 >= 0)) {
playerL._rotation = 0;
playerL.rotSpeed = 0;
playerL.xSpeed = (playerL.xSpeed2 = 0);
playerL.gotoAndStop(6);
playerL.legs.gotoAndStop(6);
playerL.legs.currentFrame = 6;
}
}
if (lvl.hitTest((playerL._x - 10) - (playerL.sWidth / 2), playerL._y + playerL.yHittestOffset, true)) {
var i = 0;
while ((++i) < (playerL.sWidth / 2)) {
if (lvl.hitTest((playerL._x - (playerL.sWidth / 2)) + i, playerL._y, true)) {
playerL.xSpeed = 0;
if (!playerL.onGround) {
playerL.xSpeed2 = 0;
}
playerL._x = playerL._x + i;
}
}
if ((!playerL.aniOnGround) && (!kShift)) {
playerL._rotation = playerL._rotation + ((70 - playerL._rotation) * (0.05 * timescale));
}
if (kDown && (kLeft)) {
kLeft = false;
}
if ((playerL._currentframe == 4) && (playerL.xSpeed2 <= 0)) {
playerL._rotation = 0;
playerL.rotSpeed = 0;
playerL.xSpeed = (playerL.xSpeed2 = 0);
playerL.gotoAndStop(6);
playerL.legs.gotoAndStop(6);
playerL.legs.currentFrame = 6;
}
}
if (lvl.hitTest(playerL._x, playerL._y + (playerL.sHeight / 2), true)) {
playerL.onGround = true;
playerL.fallspeed = 0;
var i = 0;
while ((++i) < (playerL.sHeight / 3)) {
if (lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) - i, true)) {
playerL.fallspeed = 0;
playerL._y = playerL._y - i;
}
}
} else {
playerL.onGround = false;
}
var i = 0;
while ((++i) <= elevator) {
elevatorCode(_root["ele" + i]);
}
var i = 0;
while ((++i) <= jTPlatform) {
jTPlatformCode(_root["jTP" + i]);
}
if (kUp) {
if (playerL.jumpReady) {
playerL.fallspeed = playerL.fallspeed - playerL.jumpPower;
playerL.jumpPower = playerL.jumpPower * 0.45;
}
} else if (playerL.onGround == false) {
playerL.jumpReady = false;
}
if (playerL.onGround == true) {
midAirKills = 0;
if (Math.round(playerL.fallspeed) == 0) {
lastPlayerX = playerL._x;
lastPlayerY = playerL._y;
}
playerL.bTG = false;
if (((isNaN(playerL.xSpeed) || (isNaN(playerL.xSpeed2))) || (isNaN(playerL.rotSpeed))) || (isNaN(playerL.rotSpeed2))) {
playerL.xSpeed = (playerL.xSpeed2 = (playerL._xscale / Math.abs(playerL._xscale)) * 2.5);
playerL.rotSpeed = (playerL._xscale / Math.abs(playerL._xscale)) * 10;
}
if ((playerL._rotation > 40) || (playerL._rotation < -40)) {
if (Math.abs(playerL.xSpeed2) < 2.5) {
playerL.xSpeed2 = (playerL.xSpeed2 / Math.abs(playerL.xSpeed2)) * 2.5;
}
if (Math.abs(playerL.xSpeed2) > 5) {
playerL.xSpeed2 = (playerL.xSpeed2 / Math.abs(playerL.xSpeed2)) * 5;
}
if (playerL.aniOnGround) {
playerL.gotoAndStop(4);
}
playerL._x = playerL._x + ((playerL.xSpeed2 * 0.8) * timescale);
playerL.rotSpeed = playerL.rotSpeed + ((((playerL.xSpeed2 * 4) - playerL.rotSpeed) * 0.5) * timescale);
} else if (!kDown) {
playerL.rotSpeed = (playerL.rotSpeed2 = (-playerL._rotation) * 0.1);
playerL._rotation = playerL._rotation + ((-playerL._rotation) * (0.2 * timescale));
if ((playerL._currentframe != 4) && (playerL._currentframe != 6)) {
if (kRight) {
playerL.xSpeed2 = 6;
if (playerL.faceRight) {
playerL.gotoAndStop(2);
} else {
playerL.gotoAndStop(5);
}
} else if (kLeft) {
playerL.xSpeed2 = -6;
if (playerL.faceRight) {
playerL.gotoAndStop(5);
} else {
playerL.gotoAndStop(2);
}
} else {
playerL.xSpeed2 = 0;
playerL.gotoAndStop(1);
}
if ((playerL._currentframe == 4) && (playerL.legs.currentFrame > 11)) {
playerL.legs.currentFrame = 11;
}
} else if (playerL.legs.currentFrame < 12) {
playerL.legs.currentFrame = 12;
}
} else if (playerL.aniOnGround) {
if (((playerL.xSpeed2 == 0) && (playerL._rotation > -10)) && (playerL._rotation < 10)) {
playerL.gotoAndStop(6);
if (kRight) {
playerL._rotation = playerL._rotation + 20;
playerL.xSpeed2 = 5;
} else if (kLeft) {
playerL._rotation = playerL._rotation - 20;
playerL.xSpeed2 = -5;
}
} else {
playerL.gotoAndStop(4);
playerL.rotSpeed = playerL.rotSpeed + ((((playerL.xSpeed2 * 4) - playerL.rotSpeed) * 0.5) * timescale);
if (Math.abs(playerL.xSpeed2) < 8) {
if (playerL.xSpeed2 == 0) {
playerL.xSpeed2 = (playerL._xscale / Math.abs(playerL._xscale)) * 8;
} else {
playerL.xSpeed2 = (playerL.xSpeed2 / Math.abs(playerL.xSpeed2)) * 8;
}
}
}
}
playerL.landedOnGround = true;
} else {
playerL.landedOnGround = false;
if (kUp == false) {
jumpReady = false;
}
playerL.bTG = lvl.hitTest(playerL.bX, playerL.bY, true);
if (playerL._currentframe != 4) {
if (kShift) {
if (kRight) {
playerL.rotSpeed2 = 13;
if (playerL.xSpeed > 2.5) {
playerL.xSpeed2 = playerL.xSpeed2 + (0.04 * timescale);
} else if (Math.round(playerL.xSpeed) >= 0) {
playerL.xSpeed2 = playerL.xSpeed2 + (0.5 * timescale);
}
} else if (kLeft) {
playerL.rotSpeed2 = -13;
if (playerL.xSpeed < -2.5) {
playerL.xSpeed2 = playerL.xSpeed2 - (0.04 * timescale);
} else if (Math.round(playerL.xSpeed) <= 0) {
playerL.xSpeed2 = playerL.xSpeed2 - (0.5 * timescale);
}
} else if ((!kRight) && (!kLeft)) {
playerL.rotSpeed2 = 0;
}
} else if (playerL.onGroundAfterWJ == true) {
if (kRight) {
if (playerL._rotation > -5) {
playerL.rotSpeed2 = -1;
} else if ((playerL._rotation > -10) && (playerL._rotation < 10)) {
playerL.rotSpeed2 = 0;
}
playerL.xSpeed2 = playerL.xSpeed2 + ((5 - playerL.xSpeed2) * (0.2 * timescale));
} else if (kLeft) {
if (playerL._rotation < 5) {
playerL.rotSpeed2 = 1;
} else if ((playerL._rotation > -10) && (playerL._rotation < 10)) {
playerL.rotSpeed2 = 0;
}
playerL.xSpeed2 = playerL.xSpeed2 + ((-5 - playerL.xSpeed2) * (0.2 * timescale));
} else {
playerL.rotSpeed2 = 0;
playerL.xSpeed2 = playerL.xSpeed2 + ((-playerL.xSpeed2) * (0.2 * timescale));
}
}
}
}
if (!playerL.aniOnGround) {
if (((!kShift) && (playerL._rotation > -10)) && (playerL._rotation < 10)) {
playerL.rotSpeed = playerL.rotSpeed + ((-playerL.rotSpeed) * (0.2 * timescale));
}
if (((kUp && (playerL.wallJumped == false)) && (playerL.bTG)) && (playerL.jumpReady == false)) {
playerL.onGroundAfterWJ = false;
playerL.xSpeed = (playerL.xSpeed2 = Math.sin((playerL._rotation * 0.8) * (Math.PI/180)) * 8);
playerL.fallspeed = Math.cos((playerL._rotation * 0.8) * (Math.PI/180)) * -8;
playerL.legs.currentFrame = 2;
if (!kShift) {
if (playerL._rotation > 0) {
playerL.rotSpeed2 = 10;
} else {
playerL.rotSpeed2 = -10;
}
}
playerL.wallJumped = true;
} else {
playerL.wallJumped = false;
}
if (playerL._currentframe != 4) {
playerL.gotoAndStop(3);
} else if (playerL.legs.currentFrame < 12) {
playerL.legs.currentFrame = 12;
}
if (!kUp) {
playerL.jumpPower = 0;
}
} else {
playerL.onGroundAfterWJ = true;
killsAfterWallJump = 0;
if (kUp) {
if (kUpPressed == false) {
playerL.fallspeed = -4;
playerL._y = playerL._y - 7;
playerL.xSpeed2 = playerL.xSpeed;
}
kUpPressed = true;
} else {
kUpPressed = false;
if (playerL.fallspeed >= 0) {
playerL.jumpReady = true;
if (playerL.jumpPower < 5) {
playerL.jumpPower = 5;
}
}
}
}
if ((((playerL._rotation - mDir) + 90) > 0) && (((playerL._rotation - mDir) + 90) < 180)) {
playerB.bRot = playerB.bRot + ((((mDir * 0.5) - playerB.bRot) * 0.15) * timescale);
if (playerL._currentframe != 4) {
if (playerL.onGround == true) {
playerL._xscale = -playerL.xScale;
playerL.faceRight = false;
} else if (((!kShift) && (playerL._rotation > -13)) && (playerL._rotation < 13)) {
playerL._xscale = -playerL.xScale;
playerL.faceRight = false;
}
}
} else {
playerB.bRot = playerB.bRot + ((((mDirR * 0.5) - playerB.bRot) * 0.15) * timescale);
if (playerL._currentframe != 4) {
if (playerL.onGround == true) {
playerL._xscale = playerL.xScale;
playerL.faceRight = true;
} else if (((!kShift) && (playerL._rotation > -13)) && (playerL._rotation < 13)) {
playerL._xscale = playerL.xScale;
playerL.faceRight = true;
}
}
}
if (playerL.faceRight == true) {
if ((((weapon == 3) || (weapon == 5)) || (weapon == 6)) || (weapon == 7)) {
playerB.body.arm1._rotation = (playerB.body.arm2._rotation = mDir - playerB._rotation);
} else if (((weapon == 1) || (weapon == 2)) || (weapon == 4)) {
playerB.body.arm1._rotation = (-playerB.bRot) + 200;
playerB.body.arm2._rotation = mDir - playerB._rotation;
}
} else if ((((weapon == 3) || (weapon == 5)) || (weapon == 6)) || (weapon == 7)) {
playerB.body.arm1._rotation = (playerB.body.arm2._rotation = (-mDirR) + playerB._rotation);
} else if (((weapon == 1) || (weapon == 2)) || (weapon == 4)) {
playerB.body.arm1._rotation = playerB.bRot + 200;
playerB.body.arm2._rotation = (-mDirR) + playerB._rotation;
}
if (playerB.bRot > 30) {
playerB.bRot = 30;
} else if (playerB.bRot < -30) {
playerB.bRot = -30;
}
playerB._rotation = playerL._rotation + playerB.bRot;
playerB._x = playerL._x + ((playerL._xscale / Math.abs(playerL._xscale)) * playerL.legs.bodyPos._x);
playerB._y = playerL._y + playerL.legs.bodyPos._y;
playerB._xscale = playerL._xscale;
playerB.body.head._rotation = (playerL._xscale / Math.abs(playerL._xscale)) * (playerB._rotation - playerL._rotation);
playerB.gotoAndStop(weapon);
_x = (_x + ((((((-playerL._x) - ((mouseXPos - playerL._x) / 2)) + 300) - _x) * 0.1) * timescale));
_y = (_y + ((((((-playerL._y) - ((mouseYPos - playerL._y) / 2)) + 200) - _y) * 0.1) * timescale));
HUD._x = -_x;
HUD._y = -_y;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
if (((!showOptions) && (health > 0)) && (!pausePlayer)) {
crosshair._x = mouseXPos;
crosshair._y = mouseYPos;
crosshair._xscale = (crosshair._yscale = 100);
} else {
crosshair._xscale = (crosshair._yscale = 0);
}
if (gunTimer > 0) {
gunTimer = gunTimer - (1 * timescale);
}
if ((((mousePress && (gunTimer <= 0)) && (weapon == 1)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) {
var _local6 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local6, _root.getNextHighestDepth());
_root[_local6]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 30);
_root[_local6]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 30);
_root[_local6]._rotation = mDirR;
_root[_local6]._alpha = 0;
_root[_local6].timer = 0;
_root.playerB.body.arm2.currentFrame = 4;
_root.playerB.body.arm2.gotoAndStop(4);
_root[_local6].onEnterFrame = function () {
bulletCode(this, true, 20);
this.timer++;
if (this.timer >= 6) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
};
gunTimer = 8;
mousePress = false;
} else if ((weapon == 1) && (gunTimer <= 0)) {
_root.playerB.body.arm2.currentFrame = 1;
_root.playerB.body.arm2.gotoAndStop(1);
}
if ((((mousePress == true) && (weapon == 4)) || ((mousePress == true) && (weapon == 5))) || ((mousePress == true) && (weapon == 7))) {
if ((((gunTimer <= 0) && (_root["ammo" + weapon] > 0)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) {
_root["ammo" + weapon]--;
var _local4 = "smoke" + _root.getNextHighestDepth();
attachMovie("smoke", _local4, _root.getNextHighestDepth());
_root[_local4].ySpeed = -1.3 - (0.01 * random(70));
_root[_local4]._xscale = (_root[_local4]._yscale = 70 + random(30));
_root[_local4].onEnterFrame = function () {
this._y = this._y + (this.ySpeed * timescale);
this.ySpeed = this.ySpeed + (((-this.ySpeed) * 0.02) * timescale);
this._xscale = (this._yscale = this._yscale - (this.ySpeed * timescale));
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
var _local3 = "shell" + _root.getNextHighestDepth();
attachMovie("shell", _local3, _root.getNextHighestDepth());
_root[_local3].fallspeed = -3;
_root[_local3].xSpeed = -1.5 + (0.01 * random(300));
_root[_local3]._alpha = 300;
_root[_local3].rotSpeed = -10 + (0.01 * random(2000));
_root[_local3].onEnterFrame = function () {
this._y = this._y + (this.fallspeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this._x = this._x + (this.xSpeed * timescale);
this._rotation = this._rotation + (this.rotSpeed * timescale);
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = (-this.fallspeed) * 0.5;
this.xSpeed = this.xSpeed * 0.8;
this.rotSpeed = this.rotSpeed * 0.8;
this._y = this._y + (this.fallspeed * 2);
}
};
var _local5 = "mF" + _root.getNextHighestDepth();
attachMovie("muzzle", _local5, _root.getNextHighestDepth());
_root[_local5]._xscale = (_root[_local5]._yscale = 25);
if (weapon == 4) {
playSound("uziShot", playerL._x, playerL._y, 3);
var _local6 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local6, _root.getNextHighestDepth());
_root[_local5]._x = (_root[_local4]._x = (_root[_local6]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 50)));
_root[_local5]._y = (_root[_local4]._y = (_root[_local6]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 50)));
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 39);
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 39);
_root[_local3].gotoAndStop(1);
_root[_local6]._rotation = (mDirR - recoil) - ((recoil / 2) + (random(100 * recoil) / 100));
addGlow(_root[_local6]._x, _root[_local6]._y, 30, 130);
_root[_local6].onEnterFrame = function () {
bulletCode(this, true, 5);
};
gunTimer = 4;
recoil = recoil + 10;
} else if (weapon == 5) {
playSound("uziShot", playerL._x, playerL._y, 3);
var _local6 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local6, _root.getNextHighestDepth());
if (fireRightGun) {
_root[_local5]._x = (_root[_local4]._x = (_root[_local6]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 50)));
_root[_local5]._y = (_root[_local4]._y = (_root[_local6]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 50)));
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 39);
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 39);
_root[_local3].gotoAndStop(1);
_root[_local6]._rotation = (mDirR - recoil) - ((recoil / 2) + (random(100 * recoil) / 100));
addGlow(_root[_local6]._x, _root[_local6]._y, 30, 130);
fireRightGun = false;
_root[_local6].onEnterFrame = function () {
bulletCode(this, true, 5);
};
} else {
_root[_local5]._x = (_root[_local4]._x = (_root[_local6]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 6)) * (Math.PI/180)) * 45)));
_root[_local5]._y = (_root[_local4]._y = (_root[_local6]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 6)) * (Math.PI/180)) * 45)));
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 39);
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 39);
_root[_local3].gotoAndStop(1);
_root[_local6]._rotation = mDirR - recoil;
addGlow(_root[_local6]._x, _root[_local6]._y, 30, 130);
fireRightGun = true;
_root[_local6].onEnterFrame = function () {
bulletCode(this, true, 5);
};
}
gunTimer = 2;
recoil = recoil + 5;
} else if (weapon == 7) {
playSound("m16Shot", playerL._x, playerL._y);
var _local6 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local6, _root.getNextHighestDepth());
_root[_local5]._x = (_root[_local4]._x = (_root[_local6]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(10)))));
_root[_local5]._y = (_root[_local4]._y = (_root[_local6]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(10)))));
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 20)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 25);
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 20)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 25);
_root[_local3].gotoAndStop(1);
_root[_local6]._rotation = (mDirR - recoil) - ((recoil / 10) + (random(10 * recoil) / 10));
addGlow(_root[_local6]._x, _root[_local6]._y, 30, 130);
_root[_local6].onEnterFrame = function () {
bulletCode(this, true, 7);
};
gunTimer = 2;
recoil = recoil + 2;
}
_root[_local5]._rotation = mDirR;
}
}
if (((((mousePress && (gunTimer <= 0)) && (_root["ammo" + weapon] <= 0)) && (_root[("ammo" + weapon) + "Total"] > 0)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) {
playerB.body.gotoAndStop(2);
}
backCity._x = -_x;
backCity._y = -_y;
topLayer.swapDepths(_root.getNextHighestDepth());
if (startGameBlackFade != undefined) {
startGameBlackFade.swapDepths(_root.getNextHighestDepth());
}
if (banana != undefined) {
banana.swapDepths(_root.getNextHighestDepth());
}
if (speechBubble != undefined) {
speechBubble.swapDepths(_root.getNextHighestDepth());
}
if (controlHint != undefined) {
controlHint.swapDepths(_root.getNextHighestDepth());
}
HUD.swapDepths(_root.getNextHighestDepth());
crosshair.swapDepths(_root.getNextHighestDepth());
};
crosshair.onPress = function () {
mousePress = true;
if (((((((gunTimer <= 0) && (_root["ammo" + weapon] > 0)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) && (weapon != 4)) && (weapon != 5)) && (weapon != 7)) {
_root["ammo" + weapon]--;
if ((_root["ammo" + weapon] <= 0) && (_root[("ammo" + weapon) + "Total"] > 0)) {
playerB.body.gotoAndStop(2);
}
var _local5 = "smoke" + _root.getNextHighestDepth();
attachMovie("smoke", _local5, _root.getNextHighestDepth());
_root[_local5].ySpeed = -1.3 - (0.01 * random(70));
_root[_local5]._xscale = (_root[_local5]._yscale = 70 + random(30));
_root[_local5].onEnterFrame = function () {
this._y = this._y + (this.ySpeed * timescale);
this.ySpeed = this.ySpeed + (((-this.ySpeed) * 0.02) * timescale);
this._xscale = (this._yscale = this._yscale - (this.ySpeed * timescale));
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
var _local4 = "shell" + _root.getNextHighestDepth();
attachMovie("shell", _local4, _root.getNextHighestDepth());
_root[_local4].fallspeed = -3;
_root[_local4].xSpeed = -1.5 + (0.01 * random(300));
_root[_local4]._alpha = 300;
_root[_local4].rotSpeed = -10 + (0.01 * random(2000));
_root[_local4].onEnterFrame = function () {
this._y = this._y + (this.fallspeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this._x = this._x + (this.xSpeed * timescale);
this._rotation = this._rotation + (this.rotSpeed * timescale);
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = (-this.fallspeed) * 0.5;
this.xSpeed = this.xSpeed * 0.8;
this.rotSpeed = this.rotSpeed * 0.8;
this._y = this._y + (this.fallspeed * 2);
}
};
var _local6 = "mF" + _root.getNextHighestDepth();
attachMovie("muzzle", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = (_root[_local6]._yscale = 25);
if (weapon == 2) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
gunTimer = 8;
recoil = recoil + 10;
} else if (weapon == 3) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
if (fireRightGun) {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
fireRightGun = false;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
} else {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
fireRightGun = true;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
}
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
gunTimer = 4;
recoil = recoil + 10;
} else if (weapon == 6) {
playSound("shotgunShot", playerL._x, playerL._y);
var _local7 = 0;
while (_local7++ , _local7 < 10) {
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local3]._rotation = (mDirR - 7) + random(14);
_root[_local3].gotoAndStop(2);
if (_local7 < 6) {
_root[_local3].soundOn = false;
}
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 3);
};
}
_root[_local6]._x = (_root[_local5]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local6]._y = (_root[_local5]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4].gotoAndStop(2);
addGlow(_root[_local5]._x, _root[_local5]._y, 30, 130);
gunTimer = 20;
recoil = recoil + 18;
}
_root[_local6]._rotation = mDirR;
}
};
crosshair.onRelease = function () {
mousePress = false;
};
crosshair.onReleaseOutside = function () {
mousePress = false;
};
_root.createEmptyMovieClip("soundFX", _root.getNextHighestDepth());
clearInterval(fpsTimer);
fpsTimer = setInterval(function () {
showFPS = fps;
fps = 0;
}, 1000);
Instance of Symbol 570 MovieClip "startGameBlackFade" in Frame 10
onClipEvent (load) {
_x = ((-_root.playerL._x) - 1500);
_y = ((-_root.playerL._y) - 1500);
_height = 3000;
_width = 3000;
}
Instance of Symbol 629 MovieClip "tutorialDoor1" in Frame 10
onClipEvent (load) {
spawn = 1;
dontRandomizeXScale = true;
platform = 0;
tutorialGangster = true;
}
Instance of Symbol 295 MovieClip [banana] "banana" in Frame 10
onClipEvent (load) {
disableSpawnEffect = true;
_root.addSpeechBubble(_x, _y, "Hello.|It's me. Pedro.|... Your friend.|Don't worry. I'm wearing my invisibility undies.|You're the only one who can see me.|We're going on an adventure, you and me.|Let's start by learning some basics...", true);
}
onClipEvent (enterFrame) {
if (_root.speechBubble.speechText.speechText.text == "... Your friend.") {
_root.startGameBlackFade.onEnterFrame = function () {
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
};
}
if ((_root.speechBubble == undefined) && (!stage1)) {
_root.addSpeechBubble(_x, _y, "Try moving over here.", false, undefined, 90);
stage1 = true;
} else if (((_root.speechBubble == undefined) && (stage1)) && (!stage2)) {
_root.attachMovie("controlHint", "controlHint", _root.getNextHighestDepth());
_root.attachMovie("controlHint", "controlHint2", _root.getNextHighestDepth());
_root.controlHint2.gotoAndStop(2);
stage2 = true;
}
}
Instance of Symbol 674 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true) && (!triggered)) {
_root.addSpeechBubble(_root.banana._x, _root.banana._y, "Jolly good!", false, undefined, 45);
_root.controlHint.scaleTarget = (_root.controlHint2.scaleTarget = 0);
triggered = true;
}
if (triggered) {
if (_root.speechBubble == undefined) {
_root.removeBanana();
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
}
Instance of Symbol 674 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true) && (!triggered)) {
_root.spawnBanana(_x + (_width / 2), _y);
_root.addSpeechBubble(_root.banana._x, _root.banana._y, "Would you look at this...|Somebody placed these boxes RIGHT in our way!|People have no respect these days.|You're going to have to jump over them.", true);
Mouse.show();
_root.pausePlayer = true;
_root.mouseXPos = _x + 200;
_root.mouseYPos = _y - 90;
triggered = true;
}
if (triggered) {
if (_root.speechBubble == undefined) {
_root.removeBanana();
_root.pausePlayer = false;
_root.attachMovie("controlHint", "controlHint", _root.getNextHighestDepth());
_root.controlHint.gotoAndStop(3);
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
}
Instance of Symbol 674 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true) && (!triggered)) {
_root.controlHint.scaleTarget = 0;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true) && (!triggered)) {
_root.tutorialDoor1.activated = true;
_root.spawnBanana(_x + (_width / 2), _y);
_root.addSpeechBubble(_root.banana._x, _root.banana._y, "Look!|I bet he's the one who put the boxes in our way.|Let's teach him a lesson!|Shoot him in the head.|Don't worry, he is totally asking for it!", true);
Mouse.show();
_root.pausePlayer = true;
_root.mouseXPos = _x + 200;
_root.mouseYPos = _y - 90;
triggered = true;
}
if (triggered) {
if (_root.speechBubble == undefined) {
_root.lvl.tutorialBlocker.swapDepths(_root.lvl.getNextHighestDepth());
_root.lvl.tutorialBlocker.removeMovieClip();
_root.removeBanana();
_root.pausePlayer = false;
_root.attachMovie("controlHint", "controlHint", _root.getNextHighestDepth());
_root.controlHint.gotoAndStop(4);
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
}
Instance of Symbol 674 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true) && (!triggered)) {
_root.tutorialDoor1.activated = true;
_root.spawnBanana(_x + (_width / 2), _y);
_root.addSpeechBubble(_root.banana._x, _root.banana._y, "Nice shooting back there!|You're doing great!|Now, look here.|You need to do a wall jump off of that wall.|Remember, timing is important!", true);
Mouse.show();
_root.pausePlayer = true;
_root.mouseXPos = _x + 170;
_root.mouseYPos = _y - 90;
triggered = true;
}
if (triggered) {
if (_root.speechBubble == undefined) {
_root.removeBanana();
_root.pausePlayer = false;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
}
Instance of Symbol 674 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true) && (!triggered)) {
_root.tutorialDoor1.activated = true;
_root.spawnBanana(_x + (_width / 2), _y);
_root.addSpeechBubble(_root.banana._x, _root.banana._y, "Excellent! You're a natural at this.|See that narrow opening under this machine?|Let's try rolling into it!", true);
Mouse.show();
_root.pausePlayer = true;
_root.mouseXPos = _x + 170;
_root.mouseYPos = _y - 90;
triggered = true;
}
if (triggered) {
if (_root.speechBubble == undefined) {
_root.removeBanana();
_root.pausePlayer = false;
_root.attachMovie("controlHint", "controlHint", _root.getNextHighestDepth());
_root.controlHint.gotoAndStop(5);
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
}
Instance of Symbol 674 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true) && (!triggered)) {
_root.controlHint.scaleTarget = 0;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true) && (!triggered)) {
_root.tutorialDoor1.activated = true;
_root.spawnBanana(_x + (_width / 2), _y);
_root.addSpeechBubble(_root.banana._x, _root.banana._y, "Wonderful!|There's only one more trick I have to teach you now.|Remember all those pills you were forced to take..?|Well, they seem to have had a nice side effect...|You can slow down your perception of time!|Isn't that cool?!|While slowing down time you can perform stunts in the air.|You'll look like a total bad-ass!", true);
Mouse.show();
_root.pausePlayer = true;
_root.mouseXPos = _x + 170;
_root.mouseYPos = _y - 90;
triggered = true;
}
if (triggered) {
if (_root.speechBubble == undefined) {
_root.removeBanana();
_root.pausePlayer = false;
_root.attachMovie("controlHint", "controlHint", _root.getNextHighestDepth());
_root.controlHint.gotoAndStop(6);
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
}
Instance of Symbol 674 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true) && (!triggered)) {
_root.controlHint.scaleTarget = 0;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.levelComplete = true;
_root.fadeToDark = true;
}
}
Instance of Symbol 674 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true) && (!triggered)) {
_root.controlHint.scaleTarget = 0;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 570 MovieClip in Frame 10
onClipEvent (enterFrame) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
Frame 11
stopAllSounds();
Mouse.hide();
for (cObject in _root) {
if (typeof(_root[cObject]) == "movieclip") {
if (_root[cObject]._name != "DTADS") {
_root[cObject].swapDepths(_root.getNextHighestDepth());
_root[cObject].removeMovieClip();
}
}
}
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - _ymouse, playerL._x - _xmouse) * 180) / Math.PI);
var mDirR = ((Math.atan2(_ymouse - (playerL._y - 30), _xmouse - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
roofWindow.broken = false;
fadeToDark = false;
levelComplete = false;
showHint = false;
if (health <= 0) {
health = 100;
}
_root.play();
Frame 12
function bulletCode(obj, friendly, power) {
if (roofWindow.broken != true) {
if (roofWindow.hitTest(obj._x, obj._y, true)) {
playSound("breakingGlass", obj._x, obj._y);
i = 0;
while (i < 30) {
addGlasPiece((roofWindow._x - 95) + random(190), (roofWindow._y - 15) + random(30));
i++;
}
topLayer.roofWindow.gotoAndStop(2);
obj.swapDepths(_root.getNextHighestDepth());
obj.removeMovieClip();
lvl.roofWindow.swapDepths(_root.getNextHighestDepth());
lvl.roofWindow.removeMovieClip();
roofWindow.broken = true;
}
}
if ((obj.firstFrame == undefined) && (obj._name != undefined)) {
if (lvl.hitTest(obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * -14), obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * -14), true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 7);
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
obj.firstFrame = true;
}
obj._x = obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
obj._y = obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
if (getDist(playerL._x, obj._x, playerL._y, obj._y) > 670) {
obj.removeMovieClip();
}
if (friendly) {
if (obj.rangeCheck != true) {
var i = 0;
while ((++i) <= enemies) {
if (getDist(_root["nmy" + i]._x, obj._x, _root["nmy" + i]._y, obj._y) < 500) {
if ((_root["nmy" + i].gunReady != true) && (_root["nmy" + i].health > 0)) {
_root["nmy" + i].xSpeed2 = 0;
if (_root["nmy" + i].weapon == 1) {
_root["nmy" + i].gotoAndStop(3);
} else if (_root["nmy" + i].weapon == 6) {
_root["nmy" + i].gotoAndStop(7);
} else if (_root["nmy" + i].weapon == 7) {
_root["nmy" + i].gotoAndStop(8);
} else if (_root["nmy" + i].weapon == 3) {
_root["nmy" + i].gotoAndStop(9);
}
_root["nmy" + i].timer = 42 + random(5);
}
}
}
obj.rangeCheck = true;
}
var i = 0;
while ((++i) <= enemies) {
if (_root["nmy" + i].hitTest(obj._x, obj._y, true)) {
if ((obj._y < (_root["nmy" + i]._y - 22)) && (_root["nmy" + i].health > 0)) {
if ((obj._x < (_root["nmy" + i]._x + 19)) && (obj._x > (_root["nmy" + i]._x - 19))) {
if ((_root["nmy" + i].health - (power * 3)) > 0) {
_root["nmy" + i].health = _root["nmy" + i].health - (power * 3);
} else {
_root["nmy" + i].health = 0;
}
_root.nrOfHeadShots++;
if (_root.nrOfHeadShots >= 20) {
_root.unlockAchievement(5);
}
} else {
_root["nmy" + i].health = _root["nmy" + i].health - power;
}
} else {
_root["nmy" + i].health = _root["nmy" + i].health - power;
}
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
if ((_root["nmy" + i].gunReady != true) && (_root["nmy" + i].health > 0)) {
_root["nmy" + i].xSpeed2 = 0;
if (_root["nmy" + i].weapon == 1) {
_root["nmy" + i].gotoAndStop(3);
} else if (_root["nmy" + i].weapon == 6) {
_root["nmy" + i].gotoAndStop(7);
} else if (_root["nmy" + i].weapon == 7) {
_root["nmy" + i].gotoAndStop(8);
} else if (_root["nmy" + i].weapon == 3) {
_root["nmy" + i].gotoAndStop(9);
}
_root["nmy" + i].timer = 21 + random(5);
}
obj.removeMovieClip();
}
}
} else if (playerL.hitTest(obj._x, obj._y, true) || (playerB.hitTest(obj._x, obj._y, true))) {
health = health - (power / 2);
HUD.damage._alpha = HUD.damage._alpha + (power * 4);
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
obj.removeMovieClip();
}
var i = 0;
while ((++i) <= gasCans) {
if (_root["gasCan" + i].hitTest(obj._x, obj._y, true)) {
explName = "expl" + _root.getNextHighestDepth();
attachMovie("explosion", explName, _root.getNextHighestDepth());
_root[explName]._x = _root["gasCan" + i]._x;
_root[explName]._y = _root["gasCan" + i]._y;
_root[explName]._xscale = (_root[explName]._yscale = 50);
_root["gasCan" + i].swapDepths(_root.getNextHighestDepth());
_root["gasCan" + i].removeMovieClip();
var i = 0;
while ((++i) <= enemies) {
if ((getDist(_root["nmy" + i]._x, obj._x, _root["nmy" + i]._y, obj._y) < 130) && (_root["nmy" + i]._y < _root[explName]._y)) {
_root["nmy" + i].health = _root["nmy" + i].health - 50;
}
}
obj.removeMovieClip();
}
}
if (obj._name != undefined) {
if (lvl.hitTest(obj._x, obj._y, true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 4 + random(4));
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
}
}
function playSound(sName, xPos, yPos, ranNr) {
_root.soundFX["sound" + sName] = new Sound(soundFX);
if ((ranNr != undefined) && (ranNr != 0)) {
if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound((sName + (1 + random(ranNr))) + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName + (1 + random(ranNr)));
}
} else if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound(sName + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName);
}
var _local3 = ((xPos - ((-_root._x) + 300)) / 400) * 100;
if (_local3 > 100) {
_local3 = 100;
} else if (_local3 < -100) {
_local3 = -100;
}
_root.soundFX["sound" + sName].setPan(_local3);
_root.soundFX["sound" + sName].setVolume(SFXVolume * 100);
_root.soundFX["sound" + sName].start();
}
com.newgrounds.API.logCustomEvent("Level_2");
stop();
pausePlayer = false;
generalTimer = 0;
_root._x = (-_root.playerL._x) + 300;
_root._y = (-_root.playerL._y) + 200;
_root.createEmptyMovieClip("musicMC", _root.getNextHighestDepth());
musicStarted = false;
musicMC.bgMusic = new Sound(musicMC);
musicMC.bgMusicIntro = new Sound(musicMC);
musicMC.bgMusic.attachSound("music1");
musicMC.bgMusicIntro.attachSound("music1Intro");
musicMC.bgMusicIntro.onSoundComplete = function () {
if (roofWindow.broken) {
musicMC.bgMusic.start();
} else {
musicMC.bgMusicIntro.start();
}
};
musicMC.bgMusic.onSoundComplete = function () {
musicMC.bgMusic.start();
};
Mouse.hide();
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - _ymouse, playerL._x - _xmouse) * 180) / Math.PI);
var mDirR = ((Math.atan2(_ymouse - (playerL._y - 30), _xmouse - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
killCount = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
roofWindow.broken = false;
fadeToDark = false;
levelComplete = false;
showHint = false;
crosshair.onPress = function () {
mousePress = true;
if (((((((gunTimer <= 0) && (_root["ammo" + weapon] > 0)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) && (weapon != 4)) && (weapon != 5)) && (weapon != 7)) {
_root["ammo" + weapon]--;
if ((_root["ammo" + weapon] <= 0) && (_root[("ammo" + weapon) + "Total"] > 0)) {
playerB.body.gotoAndStop(2);
}
var _local5 = "smoke" + _root.getNextHighestDepth();
attachMovie("smoke", _local5, _root.getNextHighestDepth());
_root[_local5].ySpeed = -1.3 - (0.01 * random(70));
_root[_local5]._xscale = (_root[_local5]._yscale = 70 + random(30));
_root[_local5].onEnterFrame = function () {
this._y = this._y + (this.ySpeed * timescale);
this.ySpeed = this.ySpeed + (((-this.ySpeed) * 0.02) * timescale);
this._xscale = (this._yscale = this._yscale - (this.ySpeed * timescale));
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
var _local4 = "shell" + _root.getNextHighestDepth();
attachMovie("shell", _local4, _root.getNextHighestDepth());
_root[_local4].fallspeed = -3;
_root[_local4].xSpeed = -1.5 + (0.01 * random(300));
_root[_local4]._alpha = 300;
_root[_local4].rotSpeed = -10 + (0.01 * random(2000));
_root[_local4].onEnterFrame = function () {
this._y = this._y + (this.fallspeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this._x = this._x + (this.xSpeed * timescale);
this._rotation = this._rotation + (this.rotSpeed * timescale);
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = (-this.fallspeed) * 0.5;
this.xSpeed = this.xSpeed * 0.8;
this.rotSpeed = this.rotSpeed * 0.8;
this._y = this._y + (this.fallspeed * 2);
}
};
var _local6 = "mF" + _root.getNextHighestDepth();
attachMovie("muzzle", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = (_root[_local6]._yscale = 25);
if (weapon == 2) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
gunTimer = 8;
recoil = recoil + 10;
} else if (weapon == 3) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
if (fireRightGun) {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
fireRightGun = false;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
} else {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
fireRightGun = true;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
}
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
gunTimer = 4;
recoil = recoil + 10;
} else if (weapon == 6) {
playSound("shotgunShot", playerL._x, playerL._y);
var _local7 = 0;
while (_local7++ , _local7 < 10) {
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local3]._rotation = (mDirR - 7) + random(14);
_root[_local3].gotoAndStop(2);
if (_local7 < 6) {
_root[_local3].soundOn = false;
}
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 3);
};
}
_root[_local6]._x = (_root[_local5]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local6]._y = (_root[_local5]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4].gotoAndStop(2);
addGlow(_root[_local5]._x, _root[_local5]._y, 30, 130);
gunTimer = 20;
recoil = recoil + 18;
}
_root[_local6]._rotation = mDirR;
}
};
crosshair.onRelease = function () {
mousePress = false;
};
crosshair.onReleaseOutside = function () {
mousePress = false;
};
_root.createEmptyMovieClip("soundFX", _root.getNextHighestDepth());
Instance of Symbol 258 MovieClip [gangster] in Frame 12
onClipEvent (load) {
gfxNr = 2;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 12
onClipEvent (load) {
gfxNr = 1;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 12
onClipEvent (load) {
gfxNr = 3;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 12
onClipEvent (load) {
gfxNr = 5;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 12
onClipEvent (load) {
gfxNr = 2;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 12
onClipEvent (load) {
gfxNr = 3;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 12
onClipEvent (load) {
gfxNr = 3;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 12
onClipEvent (load) {
gfxNr = 4;
weapon = 1;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 12
onClipEvent (load) {
gfxNr = 1;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 12
onClipEvent (load) {
gfxNr = 5;
weapon = 6;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
dropGun = false;
this.gotoAndStop(7);
}
Instance of Symbol 674 MovieClip in Frame 12
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.levelComplete = true;
_root.fadeToDark = true;
}
}
Instance of Symbol 786 MovieClip in Frame 12
onClipEvent (enterFrame) {
_root.medipack(this);
}
Instance of Symbol 786 MovieClip in Frame 12
onClipEvent (enterFrame) {
_root.medipack(this);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 12
onClipEvent (load) {
gfxNr = 1;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 674 MovieClip in Frame 12
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true) && (!triggered)) {
_root.tutorialDoor1.activated = true;
_root.spawnBanana(_x + (_width / 2), _y);
_root.addSpeechBubble(_root.banana._x, _root.banana._y, "Alright! Are you ready to have some fun?|There are more inconsiderate gangsters below this glass roof.|Let's take them by surprise!|Stand on top of the glass roof and shoot it.|Slow down time for an extra magnicifent entrance!", true);
Mouse.show();
_root.pausePlayer = true;
_root.mouseXPos = _x + 170;
_root.mouseYPos = _y - 90;
triggered = true;
}
if (triggered) {
if (_root.speechBubble == undefined) {
_root.removeBanana();
_root.pausePlayer = false;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
}
Instance of Symbol 813 MovieClip in Frame 12
onClipEvent (enterFrame) {
_alpha = (_alpha + (((40 + random(40)) - _alpha) * 0.5));
}
Instance of Symbol 817 MovieClip in Frame 12
onClipEvent (enterFrame) {
this.gotoAndStop(Math.round(_root.door2.openAmount * 100));
}
Instance of Symbol 570 MovieClip in Frame 12
onClipEvent (enterFrame) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
Frame 13
stopAllSounds();
Mouse.hide();
for (cObject in _root) {
if (typeof(_root[cObject]) == "movieclip") {
if (_root[cObject]._name != "DTADS") {
_root[cObject].swapDepths(_root.getNextHighestDepth());
_root[cObject].removeMovieClip();
}
}
}
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - _ymouse, playerL._x - _xmouse) * 180) / Math.PI);
var mDirR = ((Math.atan2(_ymouse - (playerL._y - 30), _xmouse - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
roofWindow.broken = false;
fadeToDark = false;
levelComplete = false;
showHint = false;
if (health <= 0) {
health = 100;
}
_root.play();
Frame 14
function bulletCode(obj, friendly, power) {
if ((obj.firstFrame == undefined) && (obj._name != undefined)) {
if (lvl.hitTest(obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * -14), obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * -14), true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 7);
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
obj.firstFrame = true;
}
obj._x = obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
obj._y = obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
if (getDist(playerL._x, obj._x, playerL._y, obj._y) > 670) {
obj.removeMovieClip();
}
if (friendly) {
if (obj.rangeCheck != true) {
var _local3 = 0;
while (_local3++ , _local3 <= enemies) {
if (getDist(_root["nmy" + _local3]._x, obj._x, _root["nmy" + _local3]._y, obj._y) < 500) {
if ((_root["nmy" + _local3].gunReady != true) && (_root["nmy" + _local3].health > 0)) {
_root["nmy" + _local3].xSpeed2 = 0;
if (_root["nmy" + _local3].weapon == 1) {
_root["nmy" + _local3].gotoAndStop(3);
} else if (_root["nmy" + _local3].weapon == 6) {
_root["nmy" + _local3].gotoAndStop(7);
} else if (_root["nmy" + _local3].weapon == 7) {
_root["nmy" + _local3].gotoAndStop(8);
} else if (_root["nmy" + _local3].weapon == 3) {
_root["nmy" + _local3].gotoAndStop(9);
}
_root["nmy" + _local3].timer = 42 + random(5);
}
}
}
obj.rangeCheck = true;
}
var _local3 = 0;
while (_local3++ , _local3 <= enemies) {
if (_root["nmy" + _local3].hitTest(obj._x, obj._y, true)) {
if ((obj._y < (_root["nmy" + _local3]._y - 22)) && (_root["nmy" + _local3].health > 0)) {
if ((obj._x < (_root["nmy" + _local3]._x + 19)) && (obj._x > (_root["nmy" + _local3]._x - 19))) {
if ((_root["nmy" + _local3].health - (power * 3)) > 0) {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - (power * 3);
} else {
_root["nmy" + _local3].health = 0;
}
_root.nrOfHeadShots++;
if (_root.nrOfHeadShots >= 20) {
_root.unlockAchievement(5);
}
} else {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - power;
}
} else {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - power;
}
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
if ((_root["nmy" + _local3].gunReady != true) && (_root["nmy" + _local3].health > 0)) {
_root["nmy" + _local3].xSpeed2 = 0;
if (_root["nmy" + _local3].weapon == 1) {
_root["nmy" + _local3].gotoAndStop(3);
} else if (_root["nmy" + _local3].weapon == 6) {
_root["nmy" + _local3].gotoAndStop(7);
} else if (_root["nmy" + _local3].weapon == 7) {
_root["nmy" + _local3].gotoAndStop(8);
} else if (_root["nmy" + _local3].weapon == 3) {
_root["nmy" + _local3].gotoAndStop(9);
}
_root["nmy" + _local3].timer = 21 + random(5);
}
obj.removeMovieClip();
}
}
} else if (playerL.hitTest(obj._x, obj._y, true) || (playerB.hitTest(obj._x, obj._y, true))) {
health = health - (power / 2);
HUD.damage._alpha = HUD.damage._alpha + (power * 4);
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
obj.removeMovieClip();
}
var _local3 = 0;
while (_local3++ , _local3 <= gasCans) {
if (_root["gasCan" + _local3].hitTest(obj._x, obj._y, true)) {
explName = "expl" + _root.getNextHighestDepth();
attachMovie("explosion", explName, _root.getNextHighestDepth());
_root[explName]._x = _root["gasCan" + _local3]._x;
_root[explName]._y = _root["gasCan" + _local3]._y;
_root[explName]._xscale = (_root[explName]._yscale = 50);
_root["gasCan" + _local3].swapDepths(_root.getNextHighestDepth());
_root["gasCan" + _local3].removeMovieClip();
_local3 = 0;
while (_local3++ , _local3 <= enemies) {
if ((getDist(_root["nmy" + _local3]._x, obj._x, _root["nmy" + _local3]._y, obj._y) < 130) && (_root["nmy" + _local3]._y < _root[explName]._y)) {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - 50;
}
}
obj.removeMovieClip();
}
}
if (obj._name != undefined) {
if (lvl.hitTest(obj._x, obj._y, true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 4 + random(4));
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
}
}
function playSound(sName, xPos, yPos, ranNr) {
_root.soundFX["sound" + sName] = new Sound(soundFX);
if ((ranNr != undefined) && (ranNr != 0)) {
if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound((sName + (1 + random(ranNr))) + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName + (1 + random(ranNr)));
}
} else if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound(sName + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName);
}
var _local3 = ((xPos - ((-_root._x) + 300)) / 400) * 100;
if (_local3 > 100) {
_local3 = 100;
} else if (_local3 < -100) {
_local3 = -100;
}
_root.soundFX["sound" + sName].setPan(_local3);
_root.soundFX["sound" + sName].setVolume(SFXVolume * 100);
_root.soundFX["sound" + sName].start();
}
com.newgrounds.API.logCustomEvent("Level_3");
stop();
generalTimer = 0;
_root._x = (-_root.playerL._x) + 300;
_root._y = (-_root.playerL._y) + 200;
_root.createEmptyMovieClip("musicMC", _root.getNextHighestDepth());
musicStarted = false;
musicMC.bgMusic = new Sound(musicMC);
musicMC.bgMusic.attachSound("music2");
musicMC.bgMusic.onSoundComplete = function () {
musicMC.bgMusic.start();
};
Mouse.hide();
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - _ymouse, playerL._x - _xmouse) * 180) / Math.PI);
var mDirR = ((Math.atan2(_ymouse - (playerL._y - 30), _xmouse - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
killCount = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
roofWindow.broken = false;
fadeToDark = false;
levelComplete = false;
showHint = false;
crosshair.onPress = function () {
mousePress = true;
if (((((((gunTimer <= 0) && (_root["ammo" + weapon] > 0)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) && (weapon != 4)) && (weapon != 5)) && (weapon != 7)) {
_root["ammo" + weapon]--;
if ((_root["ammo" + weapon] <= 0) && (_root[("ammo" + weapon) + "Total"] > 0)) {
playerB.body.gotoAndStop(2);
}
var _local5 = "smoke" + _root.getNextHighestDepth();
attachMovie("smoke", _local5, _root.getNextHighestDepth());
_root[_local5].ySpeed = -1.3 - (0.01 * random(70));
_root[_local5]._xscale = (_root[_local5]._yscale = 70 + random(30));
_root[_local5].onEnterFrame = function () {
this._y = this._y + (this.ySpeed * timescale);
this.ySpeed = this.ySpeed + (((-this.ySpeed) * 0.02) * timescale);
this._xscale = (this._yscale = this._yscale - (this.ySpeed * timescale));
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
var _local4 = "shell" + _root.getNextHighestDepth();
attachMovie("shell", _local4, _root.getNextHighestDepth());
_root[_local4].fallspeed = -3;
_root[_local4].xSpeed = -1.5 + (0.01 * random(300));
_root[_local4]._alpha = 300;
_root[_local4].rotSpeed = -10 + (0.01 * random(2000));
_root[_local4].onEnterFrame = function () {
this._y = this._y + (this.fallspeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this._x = this._x + (this.xSpeed * timescale);
this._rotation = this._rotation + (this.rotSpeed * timescale);
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = (-this.fallspeed) * 0.5;
this.xSpeed = this.xSpeed * 0.8;
this.rotSpeed = this.rotSpeed * 0.8;
this._y = this._y + (this.fallspeed * 2);
}
};
var _local6 = "mF" + _root.getNextHighestDepth();
attachMovie("muzzle", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = (_root[_local6]._yscale = 25);
if (weapon == 2) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
gunTimer = 8;
recoil = recoil + 10;
} else if (weapon == 3) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
if (fireRightGun) {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
fireRightGun = false;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
} else {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
fireRightGun = true;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
}
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
gunTimer = 4;
recoil = recoil + 10;
} else if (weapon == 6) {
playSound("shotgunShot", playerL._x, playerL._y);
var _local7 = 0;
while (_local7++ , _local7 < 10) {
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local3]._rotation = (mDirR - 7) + random(14);
_root[_local3].gotoAndStop(2);
if (_local7 < 6) {
_root[_local3].soundOn = false;
}
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 3);
};
}
_root[_local6]._x = (_root[_local5]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local6]._y = (_root[_local5]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4].gotoAndStop(2);
addGlow(_root[_local5]._x, _root[_local5]._y, 30, 130);
gunTimer = 20;
recoil = recoil + 18;
}
_root[_local6]._rotation = mDirR;
}
};
crosshair.onRelease = function () {
mousePress = false;
};
crosshair.onReleaseOutside = function () {
mousePress = false;
};
_root.createEmptyMovieClip("soundFX", _root.getNextHighestDepth());
Instance of Symbol 881 MovieClip "ele1" in Frame 14
onClipEvent (load) {
moveAmount = 338.1;
this.onEnterFrame = function () {
if (_root.killCount == 7) {
yTarget = startY + moveAmount;
delete this.onEnterFrame;
}
};
}
Instance of Symbol 881 MovieClip in Frame 14
onClipEvent (load) {
moveAmount = -800;
}
Instance of Symbol 629 MovieClip "timerDoor2" in Frame 14
onClipEvent (load) {
spawn = 2;
}
Instance of Symbol 629 MovieClip "timerDoor1" in Frame 14
onClipEvent (load) {
spawn = 2;
}
Instance of Symbol 882 MovieClip in Frame 14
onClipEvent (load) {
spawnOnKillCount1 = 4;
spawnOnKillCount2 = 5;
}
Instance of Symbol 882 MovieClip in Frame 14
onClipEvent (load) {
spawnOnKillCount1 = 3;
spawnOnKillCount2 = 5;
}
Instance of Symbol 884 MovieClip in Frame 14
onClipEvent (enterFrame) {
_yscale = _root.lvl.stair4._xscale;
_xscale = _root.lvl.stair4._xscale;
}
Instance of Symbol 674 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.lvl.stair1._xscale = (_root.lvl.stair1._yscale = 100);
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.lvl.stair2._xscale = (_root.lvl.stair2._yscale = 100);
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 258 MovieClip [gangster] in Frame 14
onClipEvent (load) {
gfxNr = 1;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 14
onClipEvent (load) {
gfxNr = 2;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 14
onClipEvent (load) {
gfxNr = 3;
weapon = 3;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 14
onClipEvent (load) {
gfxNr = 4;
weapon = 1;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 14
onClipEvent (load) {
gfxNr = 5;
weapon = 1;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 14
onClipEvent (load) {
gfxNr = 2;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 14
onClipEvent (load) {
gfxNr = 1;
weapon = 3;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 674 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor1.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor2.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor4.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor3.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor5.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 258 MovieClip [gangster] in Frame 14
onClipEvent (load) {
health = 20;
gfxNr = 3;
weapon = 3;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
onClipEvent (enterFrame) {
if (health <= 0) {
_root.door1.tOpenAmount = 1;
}
}
Instance of Symbol 674 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.lvl.stair3._xscale = _root.lvl.stair3.sXScale;
_root.lvl.stair3._yscale = _root.lvl.stair3.sYScale;
_root.lvl.stair4._xscale = (_root.lvl.stair4._yscale = 0);
}
}
Instance of Symbol 674 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.lvl.stair3._xscale = (_root.lvl.stair3._yscale = 0);
}
}
Instance of Symbol 674 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.lvl.stair4._xscale = _root.lvl.stair4.sXScale;
_root.lvl.stair4._yscale = _root.lvl.stair4.sYScale;
}
}
Instance of Symbol 258 MovieClip [gangster] in Frame 14
onClipEvent (load) {
gfxNr = 1;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 14
onClipEvent (load) {
gfxNr = 3;
weapon = 3;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 674 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor6.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 258 MovieClip [gangster] in Frame 14
onClipEvent (load) {
gfxNr = 1;
weapon = 3;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 674 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.timerDoor1.activated = true;
_root.timerDoor2.activated = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 258 MovieClip [gangster] in Frame 14
onClipEvent (load) {
gfxNr = 4;
weapon = 6;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
dropGun = false;
this.gotoAndStop(7);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 14
onClipEvent (load) {
gfxNr = 3;
weapon = 3;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 14
onClipEvent (load) {
gfxNr = 2;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 14
onClipEvent (load) {
sHeight = _height;
gfxNr = 5;
weapon = 1;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
dropGun = false;
}
onClipEvent (enterFrame) {
_y = (_root.ele1._y - (sHeight / 2));
}
Instance of Symbol 902 MovieClip in Frame 14
onClipEvent (enterFrame) {
_yscale = _root.lvl.stair3._xscale;
_xscale = _root.lvl.stair3._xscale;
}
Instance of Symbol 786 MovieClip in Frame 14
onClipEvent (enterFrame) {
_root.medipack(this);
}
Instance of Symbol 786 MovieClip in Frame 14
onClipEvent (enterFrame) {
_root.medipack(this);
}
Instance of Symbol 786 MovieClip in Frame 14
onClipEvent (enterFrame) {
_root.medipack(this);
}
Instance of Symbol 674 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.levelComplete = true;
_root.fadeToDark = true;
}
}
Instance of Symbol 674 MovieClip in Frame 14
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.lvl.stair10._xscale = _root.lvl.stair10.sXScale;
_root.lvl.stair10._yscale = _root.lvl.stair10.sYScale;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 786 MovieClip in Frame 14
onClipEvent (enterFrame) {
_root.medipack(this);
}
Instance of Symbol 786 MovieClip in Frame 14
onClipEvent (enterFrame) {
_root.medipack(this);
}
Instance of Symbol 570 MovieClip in Frame 14
onClipEvent (enterFrame) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
Frame 15
stopAllSounds();
Mouse.hide();
for (cObject in _root) {
if (typeof(_root[cObject]) == "movieclip") {
if (_root[cObject]._name != "DTADS") {
_root[cObject].swapDepths(_root.getNextHighestDepth());
_root[cObject].removeMovieClip();
}
}
}
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - _ymouse, playerL._x - _xmouse) * 180) / Math.PI);
var mDirR = ((Math.atan2(_ymouse - (playerL._y - 30), _xmouse - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
roofWindow.broken = false;
fadeToDark = false;
levelComplete = false;
showHint = false;
if (health <= 0) {
health = 100;
}
_root.play();
Frame 16
function bulletCode(obj, friendly, power) {
if ((obj.firstFrame == undefined) && (obj._name != undefined)) {
if (lvl.hitTest(obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * -14), obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * -14), true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 7);
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
obj.firstFrame = true;
}
obj._x = obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
obj._y = obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
if (getDist(playerL._x, obj._x, playerL._y, obj._y) > 670) {
obj.removeMovieClip();
}
if (friendly) {
if (obj.rangeCheck != true) {
var _local3 = 0;
while (_local3++ , _local3 <= enemies) {
if (getDist(_root["nmy" + _local3]._x, obj._x, _root["nmy" + _local3]._y, obj._y) < 500) {
if ((_root["nmy" + _local3].gunReady != true) && (_root["nmy" + _local3].health > 0)) {
_root["nmy" + _local3].xSpeed2 = 0;
if (_root["nmy" + _local3].weapon == 1) {
_root["nmy" + _local3].gotoAndStop(3);
} else if (_root["nmy" + _local3].weapon == 6) {
_root["nmy" + _local3].gotoAndStop(7);
} else if (_root["nmy" + _local3].weapon == 7) {
_root["nmy" + _local3].gotoAndStop(8);
} else if (_root["nmy" + _local3].weapon == 3) {
_root["nmy" + _local3].gotoAndStop(9);
}
_root["nmy" + _local3].timer = 42 + random(5);
}
}
}
obj.rangeCheck = true;
}
var _local3 = 0;
while (_local3++ , _local3 <= enemies) {
if (_root["nmy" + _local3].hitTest(obj._x, obj._y, true)) {
if ((obj._y < (_root["nmy" + _local3]._y - 22)) && (_root["nmy" + _local3].health > 0)) {
if ((obj._x < (_root["nmy" + _local3]._x + 19)) && (obj._x > (_root["nmy" + _local3]._x - 19))) {
if ((_root["nmy" + _local3].health - (power * 3)) > 0) {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - (power * 3);
} else {
_root["nmy" + _local3].health = 0;
}
_root.nrOfHeadShots++;
if (_root.nrOfHeadShots >= 20) {
_root.unlockAchievement(5);
}
} else {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - power;
}
} else {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - power;
}
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
if ((_root["nmy" + _local3].gunReady != true) && (_root["nmy" + _local3].health > 0)) {
_root["nmy" + _local3].xSpeed2 = 0;
if (_root["nmy" + _local3].weapon == 1) {
_root["nmy" + _local3].gotoAndStop(3);
} else if (_root["nmy" + _local3].weapon == 6) {
_root["nmy" + _local3].gotoAndStop(7);
} else if (_root["nmy" + _local3].weapon == 7) {
_root["nmy" + _local3].gotoAndStop(8);
} else if (_root["nmy" + _local3].weapon == 3) {
_root["nmy" + _local3].gotoAndStop(9);
}
_root["nmy" + _local3].timer = 21 + random(5);
}
obj.removeMovieClip();
}
}
} else if (playerL.hitTest(obj._x, obj._y, true) || (playerB.hitTest(obj._x, obj._y, true))) {
health = health - (power / 2);
HUD.damage._alpha = HUD.damage._alpha + (power * 4);
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
obj.removeMovieClip();
}
var _local3 = 0;
while (_local3++ , _local3 <= gasCans) {
if (_root["gasCan" + _local3].hitTest(obj._x, obj._y, true)) {
explName = "expl" + _root.getNextHighestDepth();
attachMovie("explosion", explName, _root.getNextHighestDepth());
_root[explName]._x = _root["gasCan" + _local3]._x;
_root[explName]._y = _root["gasCan" + _local3]._y;
_root[explName]._xscale = (_root[explName]._yscale = 50);
_root["gasCan" + _local3].swapDepths(_root.getNextHighestDepth());
_root["gasCan" + _local3].removeMovieClip();
_local3 = 0;
while (_local3++ , _local3 <= enemies) {
if ((getDist(_root["nmy" + _local3]._x, obj._x, _root["nmy" + _local3]._y, obj._y) < 130) && (_root["nmy" + _local3]._y < _root[explName]._y)) {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - 50;
}
}
obj.removeMovieClip();
}
}
if (obj._name != undefined) {
if (lvl.hitTest(obj._x, obj._y, true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 4 + random(4));
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
}
}
function playSound(sName, xPos, yPos, ranNr) {
_root.soundFX["sound" + sName] = new Sound(soundFX);
if ((ranNr != undefined) && (ranNr != 0)) {
if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound((sName + (1 + random(ranNr))) + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName + (1 + random(ranNr)));
}
} else if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound(sName + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName);
}
var _local3 = ((xPos - ((-_root._x) + 300)) / 400) * 100;
if (_local3 > 100) {
_local3 = 100;
} else if (_local3 < -100) {
_local3 = -100;
}
_root.soundFX["sound" + sName].setPan(_local3);
_root.soundFX["sound" + sName].setVolume(SFXVolume * 100);
_root.soundFX["sound" + sName].start();
}
com.newgrounds.API.logCustomEvent("Level_4");
stop();
generalTimer = 0;
_root._x = (-_root.playerL._x) + 300;
_root._y = (-_root.playerL._y) + 200;
_root.createEmptyMovieClip("musicMC", _root.getNextHighestDepth());
stopLoopingIntro = false;
musicStarted = false;
musicMC.bgMusic = new Sound(musicMC);
musicMC.bgMusicIntro = new Sound(musicMC);
musicMC.bgMusic.attachSound("music3");
musicMC.bgMusicIntro.attachSound("music3Intro");
musicMC.bgMusicIntro.onSoundComplete = function () {
if (stopLoopingIntro) {
musicMC.bgMusic.start();
} else {
musicMC.bgMusicIntro.start();
}
};
musicMC.bgMusic.onSoundComplete = function () {
musicMC.bgMusic.start();
};
Mouse.hide();
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - _ymouse, playerL._x - _xmouse) * 180) / Math.PI);
var mDirR = ((Math.atan2(_ymouse - (playerL._y - 30), _xmouse - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
killCount = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
roofWindow.broken = false;
fadeToDark = false;
levelComplete = false;
showHint = false;
crosshair.onPress = function () {
mousePress = true;
if (((((((gunTimer <= 0) && (_root["ammo" + weapon] > 0)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) && (weapon != 4)) && (weapon != 5)) && (weapon != 7)) {
_root["ammo" + weapon]--;
if ((_root["ammo" + weapon] <= 0) && (_root[("ammo" + weapon) + "Total"] > 0)) {
playerB.body.gotoAndStop(2);
}
var _local5 = "smoke" + _root.getNextHighestDepth();
attachMovie("smoke", _local5, _root.getNextHighestDepth());
_root[_local5].ySpeed = -1.3 - (0.01 * random(70));
_root[_local5]._xscale = (_root[_local5]._yscale = 70 + random(30));
_root[_local5].onEnterFrame = function () {
this._y = this._y + (this.ySpeed * timescale);
this.ySpeed = this.ySpeed + (((-this.ySpeed) * 0.02) * timescale);
this._xscale = (this._yscale = this._yscale - (this.ySpeed * timescale));
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
var _local4 = "shell" + _root.getNextHighestDepth();
attachMovie("shell", _local4, _root.getNextHighestDepth());
_root[_local4].fallspeed = -3;
_root[_local4].xSpeed = -1.5 + (0.01 * random(300));
_root[_local4]._alpha = 300;
_root[_local4].rotSpeed = -10 + (0.01 * random(2000));
_root[_local4].onEnterFrame = function () {
this._y = this._y + (this.fallspeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this._x = this._x + (this.xSpeed * timescale);
this._rotation = this._rotation + (this.rotSpeed * timescale);
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = (-this.fallspeed) * 0.5;
this.xSpeed = this.xSpeed * 0.8;
this.rotSpeed = this.rotSpeed * 0.8;
this._y = this._y + (this.fallspeed * 2);
}
};
var _local6 = "mF" + _root.getNextHighestDepth();
attachMovie("muzzle", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = (_root[_local6]._yscale = 25);
if (weapon == 2) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
gunTimer = 8;
recoil = recoil + 10;
} else if (weapon == 3) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
if (fireRightGun) {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
fireRightGun = false;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
} else {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
fireRightGun = true;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
}
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
gunTimer = 4;
recoil = recoil + 10;
} else if (weapon == 6) {
playSound("shotgunShot", playerL._x, playerL._y);
var _local7 = 0;
while (_local7++ , _local7 < 10) {
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local3]._rotation = (mDirR - 7) + random(14);
_root[_local3].gotoAndStop(2);
if (_local7 < 6) {
_root[_local3].soundOn = false;
}
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 3);
};
}
_root[_local6]._x = (_root[_local5]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local6]._y = (_root[_local5]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4].gotoAndStop(2);
addGlow(_root[_local5]._x, _root[_local5]._y, 30, 130);
gunTimer = 20;
recoil = recoil + 18;
}
_root[_local6]._rotation = mDirR;
}
};
crosshair.onRelease = function () {
mousePress = false;
};
crosshair.onReleaseOutside = function () {
mousePress = false;
};
_root.createEmptyMovieClip("soundFX", _root.getNextHighestDepth());
Instance of Symbol 882 MovieClip "spawnDoor7" in Frame 16
onClipEvent (load) {
enemyWeapon = 3;
}
Instance of Symbol 882 MovieClip "spawnDoor10" in Frame 16
onClipEvent (load) {
enemyWeapon = 3;
}
Instance of Symbol 882 MovieClip "spawnDoor4" in Frame 16
onClipEvent (load) {
enemyWeapon = 6;
}
Instance of Symbol 882 MovieClip "spawnDoor1" in Frame 16
onClipEvent (load) {
enemyWeapon = 3;
}
Instance of Symbol 258 MovieClip [gangster] in Frame 16
onClipEvent (load) {
gfxNr = 2;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 674 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor1.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor2.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor4.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor3.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor5.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 786 MovieClip in Frame 16
onClipEvent (enterFrame) {
_root.medipack(this);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 16
onClipEvent (load) {
gfxNr = 1;
weapon = 6;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 16
onClipEvent (load) {
gfxNr = 2;
weapon = 3;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 16
onClipEvent (load) {
gfxNr = 3;
weapon = 3;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 674 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor6.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor6.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 258 MovieClip [gangster] in Frame 16
onClipEvent (load) {
gfxNr = 4;
weapon = 3;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 16
onClipEvent (load) {
gfxNr = 1;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 16
onClipEvent (load) {
gfxNr = 5;
weapon = 3;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 16
onClipEvent (load) {
gfxNr = 2;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 674 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor7.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 258 MovieClip [gangster] in Frame 16
onClipEvent (load) {
gfxNr = 3;
weapon = 6;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 16
onClipEvent (load) {
gfxNr = 4;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 16
onClipEvent (load) {
gfxNr = 4;
weapon = 7;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 674 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor8.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor8.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor9.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 258 MovieClip [gangster] in Frame 16
onClipEvent (load) {
gfxNr = 2;
weapon = 6;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 16
onClipEvent (load) {
gfxNr = 5;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 16
onClipEvent (load) {
gfxNr = 1;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 674 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor10.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor11.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor11.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.levelComplete = true;
_root.fadeToDark = true;
}
}
Instance of Symbol 786 MovieClip in Frame 16
onClipEvent (enterFrame) {
_root.medipack(this);
}
Instance of Symbol 786 MovieClip in Frame 16
onClipEvent (enterFrame) {
_root.medipack(this);
}
Instance of Symbol 674 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.stopLoopingIntro = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 16
onClipEvent (enterFrame) {
if ((_root.health > 0) && (this.hitTest(_root.playerL._x, _root.playerL._y, true))) {
_root.health = 0;
}
}
Instance of Symbol 570 MovieClip in Frame 16
onClipEvent (enterFrame) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
Frame 17
stopAllSounds();
generalTimer = 0;
Mouse.hide();
for (cObject in _root) {
if (typeof(_root[cObject]) == "movieclip") {
if (_root[cObject]._name != "DTADS") {
_root[cObject].swapDepths(_root.getNextHighestDepth());
_root[cObject].removeMovieClip();
}
}
}
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - _ymouse, playerL._x - _xmouse) * 180) / Math.PI);
var mDirR = ((Math.atan2(_ymouse - (playerL._y - 30), _xmouse - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
roofWindow.broken = false;
fadeToDark = false;
levelComplete = false;
showHint = false;
if (health <= 0) {
health = 100;
}
_root.play();
Frame 18
function bulletCode(obj, friendly, power) {
if ((obj.firstFrame == undefined) && (obj._name != undefined)) {
if (lvl.hitTest(obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * -14), obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * -14), true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 7);
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
obj.firstFrame = true;
}
obj._x = obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
obj._y = obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
if (getDist(playerL._x, obj._x, playerL._y, obj._y) > 670) {
obj.removeMovieClip();
}
if (friendly) {
if (obj.rangeCheck != true) {
var _local3 = 0;
while (_local3++ , _local3 <= enemies) {
if (getDist(_root["nmy" + _local3]._x, obj._x, _root["nmy" + _local3]._y, obj._y) < 500) {
if ((_root["nmy" + _local3].gunReady != true) && (_root["nmy" + _local3].health > 0)) {
_root["nmy" + _local3].xSpeed2 = 0;
if (_root["nmy" + _local3].weapon == 1) {
_root["nmy" + _local3].gotoAndStop(3);
} else if (_root["nmy" + _local3].weapon == 6) {
_root["nmy" + _local3].gotoAndStop(7);
} else if (_root["nmy" + _local3].weapon == 7) {
_root["nmy" + _local3].gotoAndStop(8);
} else if (_root["nmy" + _local3].weapon == 3) {
_root["nmy" + _local3].gotoAndStop(9);
}
_root["nmy" + _local3].timer = 42 + random(5);
}
}
}
obj.rangeCheck = true;
}
var _local3 = 0;
while (_local3++ , _local3 <= enemies) {
if (_root["nmy" + _local3].hitTest(obj._x, obj._y, true)) {
if ((obj._y < (_root["nmy" + _local3]._y - 22)) && (_root["nmy" + _local3].health > 0)) {
if ((obj._x < (_root["nmy" + _local3]._x + 19)) && (obj._x > (_root["nmy" + _local3]._x - 19))) {
if ((_root["nmy" + _local3].health - (power * 3)) > 0) {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - (power * 3);
} else {
_root["nmy" + _local3].health = 0;
}
_root.nrOfHeadShots++;
if (_root.nrOfHeadShots >= 20) {
_root.unlockAchievement(5);
}
} else {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - power;
}
} else {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - power;
}
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
if ((_root["nmy" + _local3].gunReady != true) && (_root["nmy" + _local3].health > 0)) {
_root["nmy" + _local3].xSpeed2 = 0;
if (_root["nmy" + _local3].weapon == 1) {
_root["nmy" + _local3].gotoAndStop(3);
} else if (_root["nmy" + _local3].weapon == 6) {
_root["nmy" + _local3].gotoAndStop(7);
} else if (_root["nmy" + _local3].weapon == 7) {
_root["nmy" + _local3].gotoAndStop(8);
} else if (_root["nmy" + _local3].weapon == 3) {
_root["nmy" + _local3].gotoAndStop(9);
}
_root["nmy" + _local3].timer = 21 + random(5);
}
obj.removeMovieClip();
}
}
} else if (playerL.hitTest(obj._x, obj._y, true) || (playerB.hitTest(obj._x, obj._y, true))) {
health = health - (power / 2);
HUD.damage._alpha = HUD.damage._alpha + (power * 4);
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
obj.removeMovieClip();
}
var _local3 = 0;
while (_local3++ , _local3 <= gasCans) {
if (_root["gasCan" + _local3].hitTest(obj._x, obj._y, true)) {
explName = "expl" + _root.getNextHighestDepth();
attachMovie("explosion", explName, _root.getNextHighestDepth());
_root[explName]._x = _root["gasCan" + _local3]._x;
_root[explName]._y = _root["gasCan" + _local3]._y;
_root[explName]._xscale = (_root[explName]._yscale = 50);
_root["gasCan" + _local3].swapDepths(_root.getNextHighestDepth());
_root["gasCan" + _local3].removeMovieClip();
_local3 = 0;
while (_local3++ , _local3 <= enemies) {
if ((getDist(_root["nmy" + _local3]._x, obj._x, _root["nmy" + _local3]._y, obj._y) < 130) && (_root["nmy" + _local3]._y < _root[explName]._y)) {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - 50;
}
}
obj.removeMovieClip();
}
}
if (obj._name != undefined) {
if (lvl.hitTest(obj._x, obj._y, true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 4 + random(4));
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
}
}
function playSound(sName, xPos, yPos, ranNr) {
_root.soundFX["sound" + sName] = new Sound(soundFX);
if ((ranNr != undefined) && (ranNr != 0)) {
if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound((sName + (1 + random(ranNr))) + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName + (1 + random(ranNr)));
}
} else if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound(sName + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName);
}
var _local3 = ((xPos - ((-_root._x) + 300)) / 400) * 100;
if (_local3 > 100) {
_local3 = 100;
} else if (_local3 < -100) {
_local3 = -100;
}
_root.soundFX["sound" + sName].setPan(_local3);
_root.soundFX["sound" + sName].setVolume(SFXVolume * 100);
_root.soundFX["sound" + sName].start();
}
com.newgrounds.API.logCustomEvent("Level_5");
stop();
generalTimer = 0;
_root._x = (-_root.playerL._x) + 300;
_root._y = (-_root.playerL._y) + 200;
_root.createEmptyMovieClip("musicMC", _root.getNextHighestDepth());
musicStarted = false;
musicMC.bgMusic = new Sound(musicMC);
musicMC.bgMusic.attachSound("music4");
musicMC.bgMusic.onSoundComplete = function () {
musicMC.bgMusic.start();
};
Mouse.hide();
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - _ymouse, playerL._x - _xmouse) * 180) / Math.PI);
var mDirR = ((Math.atan2(_ymouse - (playerL._y - 30), _xmouse - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
killCount = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
roofWindow.broken = false;
fadeToDark = false;
levelComplete = false;
showHint = false;
crosshair.onPress = function () {
mousePress = true;
if (((((((gunTimer <= 0) && (_root["ammo" + weapon] > 0)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) && (weapon != 4)) && (weapon != 5)) && (weapon != 7)) {
_root["ammo" + weapon]--;
if ((_root["ammo" + weapon] <= 0) && (_root[("ammo" + weapon) + "Total"] > 0)) {
playerB.body.gotoAndStop(2);
}
var _local5 = "smoke" + _root.getNextHighestDepth();
attachMovie("smoke", _local5, _root.getNextHighestDepth());
_root[_local5].ySpeed = -1.3 - (0.01 * random(70));
_root[_local5]._xscale = (_root[_local5]._yscale = 70 + random(30));
_root[_local5].onEnterFrame = function () {
this._y = this._y + (this.ySpeed * timescale);
this.ySpeed = this.ySpeed + (((-this.ySpeed) * 0.02) * timescale);
this._xscale = (this._yscale = this._yscale - (this.ySpeed * timescale));
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
var _local4 = "shell" + _root.getNextHighestDepth();
attachMovie("shell", _local4, _root.getNextHighestDepth());
_root[_local4].fallspeed = -3;
_root[_local4].xSpeed = -1.5 + (0.01 * random(300));
_root[_local4]._alpha = 300;
_root[_local4].rotSpeed = -10 + (0.01 * random(2000));
_root[_local4].onEnterFrame = function () {
this._y = this._y + (this.fallspeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this._x = this._x + (this.xSpeed * timescale);
this._rotation = this._rotation + (this.rotSpeed * timescale);
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = (-this.fallspeed) * 0.5;
this.xSpeed = this.xSpeed * 0.8;
this.rotSpeed = this.rotSpeed * 0.8;
this._y = this._y + (this.fallspeed * 2);
}
};
var _local6 = "mF" + _root.getNextHighestDepth();
attachMovie("muzzle", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = (_root[_local6]._yscale = 25);
if (weapon == 2) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
gunTimer = 8;
recoil = recoil + 10;
} else if (weapon == 3) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
if (fireRightGun) {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
fireRightGun = false;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
} else {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
fireRightGun = true;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
}
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
gunTimer = 4;
recoil = recoil + 10;
} else if (weapon == 6) {
playSound("shotgunShot", playerL._x, playerL._y);
var _local7 = 0;
while (_local7++ , _local7 < 10) {
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local3]._rotation = (mDirR - 7) + random(14);
_root[_local3].gotoAndStop(2);
if (_local7 < 6) {
_root[_local3].soundOn = false;
}
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 3);
};
}
_root[_local6]._x = (_root[_local5]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local6]._y = (_root[_local5]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4].gotoAndStop(2);
addGlow(_root[_local5]._x, _root[_local5]._y, 30, 130);
gunTimer = 20;
recoil = recoil + 18;
}
_root[_local6]._rotation = mDirR;
}
};
crosshair.onRelease = function () {
mousePress = false;
};
crosshair.onReleaseOutside = function () {
mousePress = false;
};
_root.createEmptyMovieClip("soundFX", _root.getNextHighestDepth());
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 3;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 2;
weapon = 3;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 1;
weapon = 7;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 4;
weapon = 1;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 2;
weapon = 1;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 5;
weapon = 1;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 1;
weapon = 3;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 2;
weapon = 7;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 3;
weapon = 6;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 4;
weapon = 6;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 786 MovieClip in Frame 18
onClipEvent (enterFrame) {
_root.medipack(this);
}
Instance of Symbol 674 MovieClip in Frame 18
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor2.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 18
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor1.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 2;
weapon = 7;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 5;
weapon = 3;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 1;
weapon = 1;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 2;
weapon = 7;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 3;
weapon = 3;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 4;
weapon = 3;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 2;
weapon = 1;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 1;
weapon = 1;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 3;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 674 MovieClip in Frame 18
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.lvl.stair1._xscale = (_root.lvl.stair1._yscale = 100);
}
}
Instance of Symbol 258 MovieClip [gangster] in Frame 18
onClipEvent (load) {
gfxNr = 5;
weapon = 7;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 674 MovieClip in Frame 18
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor3.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 674 MovieClip in Frame 18
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.lvl.stair3._xscale = (_root.lvl.stair1._yscale = 0);
}
}
Instance of Symbol 674 MovieClip in Frame 18
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.levelComplete = true;
_root.fadeToDark = true;
}
}
Instance of Symbol 786 MovieClip in Frame 18
onClipEvent (enterFrame) {
_root.medipack(this);
}
Instance of Symbol 786 MovieClip in Frame 18
onClipEvent (enterFrame) {
_root.medipack(this);
}
Instance of Symbol 936 MovieClip in Frame 18
onClipEvent (enterFrame) {
_root.brokenLight(this);
}
Instance of Symbol 570 MovieClip in Frame 18
onClipEvent (enterFrame) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
Frame 19
stopAllSounds();
generalTimer = 0;
Mouse.hide();
for (cObject in _root) {
if (typeof(_root[cObject]) == "movieclip") {
if (_root[cObject]._name != "DTADS") {
_root[cObject].swapDepths(_root.getNextHighestDepth());
_root[cObject].removeMovieClip();
}
}
}
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - _ymouse, playerL._x - _xmouse) * 180) / Math.PI);
var mDirR = ((Math.atan2(_ymouse - (playerL._y - 30), _xmouse - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
roofWindow.broken = false;
fadeToDark = false;
levelComplete = false;
showHint = false;
if (health <= 0) {
health = 100;
}
_root.play();
Frame 20
function bulletCode(obj, friendly, power) {
if ((obj.firstFrame == undefined) && (obj._name != undefined)) {
if (lvl.hitTest(obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * -14), obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * -14), true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 7);
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
obj.firstFrame = true;
}
obj._x = obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
obj._y = obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
if (getDist(playerL._x, obj._x, playerL._y, obj._y) > 670) {
obj.removeMovieClip();
}
if (friendly) {
if (obj.rangeCheck != true) {
var _local3 = 0;
while (_local3++ , _local3 <= enemies) {
if (getDist(_root["nmy" + _local3]._x, obj._x, _root["nmy" + _local3]._y, obj._y) < 500) {
if ((_root["nmy" + _local3].gunReady != true) && (_root["nmy" + _local3].health > 0)) {
_root["nmy" + _local3].xSpeed2 = 0;
if (_root["nmy" + _local3].weapon == 1) {
_root["nmy" + _local3].gotoAndStop(3);
} else if (_root["nmy" + _local3].weapon == 6) {
_root["nmy" + _local3].gotoAndStop(7);
} else if (_root["nmy" + _local3].weapon == 7) {
_root["nmy" + _local3].gotoAndStop(8);
} else if (_root["nmy" + _local3].weapon == 3) {
_root["nmy" + _local3].gotoAndStop(9);
}
_root["nmy" + _local3].timer = 42 + random(5);
}
}
}
obj.rangeCheck = true;
}
var _local3 = 0;
while (_local3++ , _local3 <= enemies) {
if (_root["nmy" + _local3].hitTest(obj._x, obj._y, true)) {
if ((obj._y < (_root["nmy" + _local3]._y - 22)) && (_root["nmy" + _local3].health > 0)) {
if ((obj._x < (_root["nmy" + _local3]._x + 19)) && (obj._x > (_root["nmy" + _local3]._x - 19))) {
if ((_root["nmy" + _local3].health - (power * 3)) > 0) {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - (power * 3);
} else {
_root["nmy" + _local3].health = 0;
}
_root.nrOfHeadShots++;
if (_root.nrOfHeadShots >= 20) {
_root.unlockAchievement(5);
}
} else {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - power;
}
} else {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - power;
}
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
if ((_root["nmy" + _local3].gunReady != true) && (_root["nmy" + _local3].health > 0)) {
_root["nmy" + _local3].xSpeed2 = 0;
if (_root["nmy" + _local3].weapon == 1) {
_root["nmy" + _local3].gotoAndStop(3);
} else if (_root["nmy" + _local3].weapon == 6) {
_root["nmy" + _local3].gotoAndStop(7);
} else if (_root["nmy" + _local3].weapon == 7) {
_root["nmy" + _local3].gotoAndStop(8);
} else if (_root["nmy" + _local3].weapon == 3) {
_root["nmy" + _local3].gotoAndStop(9);
}
_root["nmy" + _local3].timer = 21 + random(5);
}
obj.removeMovieClip();
}
}
} else if (playerL.hitTest(obj._x, obj._y, true) || (playerB.hitTest(obj._x, obj._y, true))) {
health = health - (power / 2);
HUD.damage._alpha = HUD.damage._alpha + (power * 4);
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
obj.removeMovieClip();
}
var _local3 = 0;
while (_local3++ , _local3 <= gasCans) {
if (_root["gasCan" + _local3].hitTest(obj._x, obj._y, true)) {
explName = "expl" + _root.getNextHighestDepth();
attachMovie("explosion", explName, _root.getNextHighestDepth());
_root[explName]._x = _root["gasCan" + _local3]._x;
_root[explName]._y = _root["gasCan" + _local3]._y;
_root[explName]._xscale = (_root[explName]._yscale = 50);
_root["gasCan" + _local3].swapDepths(_root.getNextHighestDepth());
_root["gasCan" + _local3].removeMovieClip();
_local3 = 0;
while (_local3++ , _local3 <= enemies) {
if ((getDist(_root["nmy" + _local3]._x, obj._x, _root["nmy" + _local3]._y, obj._y) < 130) && (_root["nmy" + _local3]._y < _root[explName]._y)) {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - 50;
}
}
obj.removeMovieClip();
}
}
if (obj._name != undefined) {
if (lvl.hitTest(obj._x, obj._y, true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 4 + random(4));
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
}
}
function playSound(sName, xPos, yPos, ranNr) {
_root.soundFX["sound" + sName] = new Sound(soundFX);
if ((ranNr != undefined) && (ranNr != 0)) {
if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound((sName + (1 + random(ranNr))) + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName + (1 + random(ranNr)));
}
} else if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound(sName + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName);
}
var _local3 = ((xPos - ((-_root._x) + 300)) / 400) * 100;
if (_local3 > 100) {
_local3 = 100;
} else if (_local3 < -100) {
_local3 = -100;
}
_root.soundFX["sound" + sName].setPan(_local3);
_root.soundFX["sound" + sName].setVolume(SFXVolume * 100);
_root.soundFX["sound" + sName].start();
}
com.newgrounds.API.logCustomEvent("Level_6");
pausePlayer = false;
stop();
generalTimer = 0;
_root._x = (-_root.playerL._x) + 300;
_root._y = (-_root.playerL._y) + 200;
_root.createEmptyMovieClip("musicMC", _root.getNextHighestDepth());
musicStarted = false;
musicMC.bgMusic = new Sound(musicMC);
musicMC.bgMusic.attachSound("music5");
musicMC.bgMusic.onSoundComplete = function () {
musicMC.bgMusic.start();
};
Mouse.hide();
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - _ymouse, playerL._x - _xmouse) * 180) / Math.PI);
var mDirR = ((Math.atan2(_ymouse - (playerL._y - 30), _xmouse - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
killCount = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
roofWindow.broken = false;
fadeToDark = false;
levelComplete = false;
showHint = false;
crosshair.onPress = function () {
mousePress = true;
if (((((((gunTimer <= 0) && (_root["ammo" + weapon] > 0)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) && (weapon != 4)) && (weapon != 5)) && (weapon != 7)) {
_root["ammo" + weapon]--;
if ((_root["ammo" + weapon] <= 0) && (_root[("ammo" + weapon) + "Total"] > 0)) {
playerB.body.gotoAndStop(2);
}
var _local5 = "smoke" + _root.getNextHighestDepth();
attachMovie("smoke", _local5, _root.getNextHighestDepth());
_root[_local5].ySpeed = -1.3 - (0.01 * random(70));
_root[_local5]._xscale = (_root[_local5]._yscale = 70 + random(30));
_root[_local5].onEnterFrame = function () {
this._y = this._y + (this.ySpeed * timescale);
this.ySpeed = this.ySpeed + (((-this.ySpeed) * 0.02) * timescale);
this._xscale = (this._yscale = this._yscale - (this.ySpeed * timescale));
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
var _local4 = "shell" + _root.getNextHighestDepth();
attachMovie("shell", _local4, _root.getNextHighestDepth());
_root[_local4].fallspeed = -3;
_root[_local4].xSpeed = -1.5 + (0.01 * random(300));
_root[_local4]._alpha = 300;
_root[_local4].rotSpeed = -10 + (0.01 * random(2000));
_root[_local4].onEnterFrame = function () {
this._y = this._y + (this.fallspeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this._x = this._x + (this.xSpeed * timescale);
this._rotation = this._rotation + (this.rotSpeed * timescale);
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = (-this.fallspeed) * 0.5;
this.xSpeed = this.xSpeed * 0.8;
this.rotSpeed = this.rotSpeed * 0.8;
this._y = this._y + (this.fallspeed * 2);
}
};
var _local6 = "mF" + _root.getNextHighestDepth();
attachMovie("muzzle", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = (_root[_local6]._yscale = 25);
if (weapon == 2) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
gunTimer = 8;
recoil = recoil + 10;
} else if (weapon == 3) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
if (fireRightGun) {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
fireRightGun = false;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
} else {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
fireRightGun = true;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
}
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
gunTimer = 4;
recoil = recoil + 10;
} else if (weapon == 6) {
playSound("shotgunShot", playerL._x, playerL._y);
var _local7 = 0;
while (_local7++ , _local7 < 10) {
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local3]._rotation = (mDirR - 7) + random(14);
_root[_local3].gotoAndStop(2);
if (_local7 < 6) {
_root[_local3].soundOn = false;
}
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 3);
};
}
_root[_local6]._x = (_root[_local5]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local6]._y = (_root[_local5]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4].gotoAndStop(2);
addGlow(_root[_local5]._x, _root[_local5]._y, 30, 130);
gunTimer = 20;
recoil = recoil + 18;
}
_root[_local6]._rotation = mDirR;
}
};
crosshair.onRelease = function () {
mousePress = false;
};
crosshair.onReleaseOutside = function () {
mousePress = false;
};
_root.createEmptyMovieClip("soundFX", _root.getNextHighestDepth());
Instance of Symbol 258 MovieClip [gangster] in Frame 20
onClipEvent (load) {
gfxNr = 2;
weapon = 7;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 674 MovieClip in Frame 20
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.spawnDoor1.spawnEnemy = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 258 MovieClip [gangster] in Frame 20
onClipEvent (load) {
gfxNr = 1;
weapon = 7;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 20
onClipEvent (load) {
gfxNr = 5;
weapon = 3;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 20
onClipEvent (load) {
gfxNr = 3;
weapon = 6;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 20
onClipEvent (load) {
gfxNr = 1;
weapon = 6;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 20
onClipEvent (load) {
gfxNr = 1;
weapon = 7;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 20
onClipEvent (load) {
gfxNr = 3;
weapon = 1;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 20
onClipEvent (load) {
gfxNr = 4;
weapon = 1;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 20
onClipEvent (load) {
gfxNr = 2;
weapon = 1;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 20
onClipEvent (load) {
gfxNr = 5;
weapon = 3;
platform = 1;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 20
onClipEvent (load) {
gfxNr = 2;
weapon = 1;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 20
onClipEvent (load) {
gfxNr = 4;
weapon = 7;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 20
onClipEvent (load) {
gfxNr = 2;
weapon = 6;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 20
onClipEvent (load) {
gfxNr = 2;
weapon = 3;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 20
onClipEvent (load) {
gfxNr = 4;
weapon = 3;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 258 MovieClip [gangster] in Frame 20
onClipEvent (load) {
gfxNr = 5;
weapon = 7;
platform = 0;
_root.enemies++;
number = _root.enemies;
_name = ("nmy" + _root.enemies);
}
Instance of Symbol 674 MovieClip in Frame 20
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.levelComplete = true;
_root.fadeToDark = true;
}
}
Instance of Symbol 786 MovieClip in Frame 20
onClipEvent (enterFrame) {
_root.medipack(this);
}
Instance of Symbol 786 MovieClip in Frame 20
onClipEvent (enterFrame) {
_root.medipack(this);
}
Instance of Symbol 570 MovieClip in Frame 20
onClipEvent (enterFrame) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
Frame 21
stopAllSounds();
Mouse.hide();
for (cObject in _root) {
if (typeof(_root[cObject]) == "movieclip") {
if (_root[cObject]._name != "DTADS") {
_root[cObject].swapDepths(_root.getNextHighestDepth());
_root[cObject].removeMovieClip();
}
}
}
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - _ymouse, playerL._x - _xmouse) * 180) / Math.PI);
var mDirR = ((Math.atan2(_ymouse - (playerL._y - 30), _xmouse - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
roofWindow.broken = false;
fadeToDark = false;
levelComplete = false;
showHint = false;
if (health <= 0) {
health = 100;
}
_root.play();
Frame 22
function bulletCode(obj, friendly, power) {
if ((obj.firstFrame == undefined) && (obj._name != undefined)) {
if (lvl.hitTest(obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * -14), obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * -14), true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 7);
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
obj.firstFrame = true;
}
obj._x = obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
obj._y = obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
if (getDist(playerL._x, obj._x, playerL._y, obj._y) > 670) {
obj.removeMovieClip();
}
if (friendly) {
if (obj.rangeCheck != true) {
var _local3 = 0;
while (_local3++ , _local3 <= enemies) {
if (getDist(_root["nmy" + _local3]._x, obj._x, _root["nmy" + _local3]._y, obj._y) < 500) {
if ((_root["nmy" + _local3].gunReady != true) && (_root["nmy" + _local3].health > 0)) {
_root["nmy" + _local3].xSpeed2 = 0;
if (_root["nmy" + _local3].weapon == 1) {
_root["nmy" + _local3].gotoAndStop(3);
} else if (_root["nmy" + _local3].weapon == 6) {
_root["nmy" + _local3].gotoAndStop(7);
} else if (_root["nmy" + _local3].weapon == 7) {
_root["nmy" + _local3].gotoAndStop(8);
} else if (_root["nmy" + _local3].weapon == 3) {
_root["nmy" + _local3].gotoAndStop(9);
}
_root["nmy" + _local3].timer = 42 + random(5);
}
}
}
obj.rangeCheck = true;
}
var _local3 = 0;
while (_local3++ , _local3 <= enemies) {
if (_root["nmy" + _local3].hitTest(obj._x, obj._y, true)) {
if ((obj._y < (_root["nmy" + _local3]._y - 22)) && (_root["nmy" + _local3].health > 0)) {
if ((obj._x < (_root["nmy" + _local3]._x + 19)) && (obj._x > (_root["nmy" + _local3]._x - 19))) {
if ((_root["nmy" + _local3].health - (power * 3)) > 0) {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - (power * 3);
} else {
_root["nmy" + _local3].health = 0;
}
_root.nrOfHeadShots++;
if (_root.nrOfHeadShots >= 20) {
_root.unlockAchievement(5);
}
} else {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - power;
}
} else {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - power;
}
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
if ((_root["nmy" + _local3].gunReady != true) && (_root["nmy" + _local3].health > 0)) {
_root["nmy" + _local3].xSpeed2 = 0;
if (_root["nmy" + _local3].weapon == 1) {
_root["nmy" + _local3].gotoAndStop(3);
} else if (_root["nmy" + _local3].weapon == 6) {
_root["nmy" + _local3].gotoAndStop(7);
} else if (_root["nmy" + _local3].weapon == 7) {
_root["nmy" + _local3].gotoAndStop(8);
} else if (_root["nmy" + _local3].weapon == 3) {
_root["nmy" + _local3].gotoAndStop(9);
}
_root["nmy" + _local3].timer = 21 + random(5);
}
obj.removeMovieClip();
}
}
} else if (playerL.hitTest(obj._x, obj._y, true) || (playerB.hitTest(obj._x, obj._y, true))) {
health = health - (power / 2);
HUD.damage._alpha = HUD.damage._alpha + (power * 4);
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
obj.removeMovieClip();
}
var _local3 = 0;
while (_local3++ , _local3 <= gasCans) {
if (_root["gasCan" + _local3].hitTest(obj._x, obj._y, true)) {
explName = "expl" + _root.getNextHighestDepth();
attachMovie("explosion", explName, _root.getNextHighestDepth());
_root[explName]._x = _root["gasCan" + _local3]._x;
_root[explName]._y = _root["gasCan" + _local3]._y;
_root[explName]._xscale = (_root[explName]._yscale = 50);
_root["gasCan" + _local3].swapDepths(_root.getNextHighestDepth());
_root["gasCan" + _local3].removeMovieClip();
_local3 = 0;
while (_local3++ , _local3 <= enemies) {
if ((getDist(_root["nmy" + _local3]._x, obj._x, _root["nmy" + _local3]._y, obj._y) < 130) && (_root["nmy" + _local3]._y < _root[explName]._y)) {
_root["nmy" + _local3].health = _root["nmy" + _local3].health - 50;
}
}
obj.removeMovieClip();
}
}
if (obj._name != undefined) {
if (lvl.hitTest(obj._x, obj._y, true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 4 + random(4));
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
}
}
function playSound(sName, xPos, yPos, ranNr) {
_root.soundFX["sound" + sName] = new Sound(soundFX);
if ((ranNr != undefined) && (ranNr != 0)) {
if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound((sName + (1 + random(ranNr))) + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName + (1 + random(ranNr)));
}
} else if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound(sName + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName);
}
var _local3 = ((xPos - ((-_root._x) + 300)) / 400) * 100;
if (_local3 > 100) {
_local3 = 100;
} else if (_local3 < -100) {
_local3 = -100;
}
_root.soundFX["sound" + sName].setPan(_local3);
_root.soundFX["sound" + sName].setVolume(SFXVolume * 100);
_root.soundFX["sound" + sName].start();
}
com.newgrounds.API.logCustomEvent("Level_7");
stop();
generalTimer = 0;
_root._x = (-_root.playerL._x) + 300;
_root._y = (-_root.playerL._y) + 200;
_root.createEmptyMovieClip("musicMC", _root.getNextHighestDepth());
musicStarted = false;
musicMC.bgMusic = new Sound(musicMC);
musicMC.bgMusic.attachSound("bossIntro");
musicMC.bgMusic.onSoundComplete = function () {
musicMC.bgMusic.start();
};
hiddenMusicVolume = 0.4;
Mouse.hide();
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - _ymouse, playerL._x - _xmouse) * 180) / Math.PI);
var mDirR = ((Math.atan2(_ymouse - (playerL._y - 30), _xmouse - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
killCount = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
roofWindow.broken = false;
fadeToDark = false;
levelComplete = false;
showHint = false;
crosshair.onPress = function () {
mousePress = true;
if (((((((gunTimer <= 0) && (_root["ammo" + weapon] > 0)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) && (weapon != 4)) && (weapon != 5)) && (weapon != 7)) {
_root["ammo" + weapon]--;
if ((_root["ammo" + weapon] <= 0) && (_root[("ammo" + weapon) + "Total"] > 0)) {
playerB.body.gotoAndStop(2);
}
var _local5 = "smoke" + _root.getNextHighestDepth();
attachMovie("smoke", _local5, _root.getNextHighestDepth());
_root[_local5].ySpeed = -1.3 - (0.01 * random(70));
_root[_local5]._xscale = (_root[_local5]._yscale = 70 + random(30));
_root[_local5].onEnterFrame = function () {
this._y = this._y + (this.ySpeed * timescale);
this.ySpeed = this.ySpeed + (((-this.ySpeed) * 0.02) * timescale);
this._xscale = (this._yscale = this._yscale - (this.ySpeed * timescale));
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
var _local4 = "shell" + _root.getNextHighestDepth();
attachMovie("shell", _local4, _root.getNextHighestDepth());
_root[_local4].fallspeed = -3;
_root[_local4].xSpeed = -1.5 + (0.01 * random(300));
_root[_local4]._alpha = 300;
_root[_local4].rotSpeed = -10 + (0.01 * random(2000));
_root[_local4].onEnterFrame = function () {
this._y = this._y + (this.fallspeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this._x = this._x + (this.xSpeed * timescale);
this._rotation = this._rotation + (this.rotSpeed * timescale);
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = (-this.fallspeed) * 0.5;
this.xSpeed = this.xSpeed * 0.8;
this.rotSpeed = this.rotSpeed * 0.8;
this._y = this._y + (this.fallspeed * 2);
}
};
var _local6 = "mF" + _root.getNextHighestDepth();
attachMovie("muzzle", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = (_root[_local6]._yscale = 25);
if (weapon == 2) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
gunTimer = 8;
recoil = recoil + 10;
} else if (weapon == 3) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
if (fireRightGun) {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -9)) * (Math.PI/180)) * 26)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
fireRightGun = false;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
} else {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 52)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 15)) * (Math.PI/180)) * 30)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 40);
fireRightGun = true;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
}
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
gunTimer = 4;
recoil = recoil + 10;
} else if (weapon == 6) {
playSound("shotgunShot", playerL._x, playerL._y);
var _local7 = 0;
while (_local7++ , _local7 < 10) {
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (54 + random(20)));
_root[_local3]._rotation = (mDirR - 7) + random(14);
_root[_local3].gotoAndStop(2);
if (_local7 < 6) {
_root[_local3].soundOn = false;
}
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 3);
};
}
_root[_local6]._x = (_root[_local5]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local6]._y = (_root[_local5]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 57));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 35);
_root[_local4].gotoAndStop(2);
addGlow(_root[_local5]._x, _root[_local5]._y, 30, 130);
gunTimer = 20;
recoil = recoil + 18;
}
_root[_local6]._rotation = mDirR;
}
};
crosshair.onRelease = function () {
mousePress = false;
};
crosshair.onReleaseOutside = function () {
mousePress = false;
};
_root.createEmptyMovieClip("soundFX", _root.getNextHighestDepth());
Instance of Symbol 674 MovieClip in Frame 22
onClipEvent (enterFrame) {
if (this.hitTest(_root.playerL._x, _root.playerL._y, true) && (!triggered)) {
_root.spawnBanana(_x + (_width / 2), _y);
_root.addSpeechBubble(_root.banana._x, _root.banana._y, "Stop!|This is it.|The time has come.|Eat me.|There's no time to explain. Just do it!", true);
Mouse.show();
_root.pausePlayer = true;
_root.mouseXPos = _x + 170;
_root.mouseYPos = _y - 90;
triggered = true;
}
if (triggered) {
if (_root.speechBubble == undefined) {
_root.removeBanana();
_root.playerL._visible = false;
_root.playerB._visible = false;
_root.attachMovie("endGameAnim", "endGameAnim", _root.getNextHighestDepth());
_root.endGameAnim._x = _root.playerL._x;
_root.endGameAnim._y = _root.playerL._y;
Mouse.show();
_root.pausePlayer = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
}
Instance of Symbol 570 MovieClip in Frame 22
onClipEvent (enterFrame) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
Frame 23
stopAllSounds();
Mouse.hide();
for (cObject in _root) {
if (typeof(_root[cObject]) == "movieclip") {
if (_root[cObject]._name != "DTADS") {
_root[cObject].swapDepths(_root.getNextHighestDepth());
_root[cObject].removeMovieClip();
}
}
}
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - _ymouse, playerL._x - _xmouse) * 180) / Math.PI);
var mDirR = ((Math.atan2(_ymouse - (playerL._y - 30), _xmouse - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
roofWindow.broken = false;
fadeToDark = false;
levelComplete = false;
showHint = false;
if (health <= 0) {
health = 100;
}
_root.play();
Frame 24
function bulletCode(obj, friendly, power) {
if (friendly) {
if (_root.finalBoss.head.hitbox.hitTest(obj._x, obj._y, true)) {
if (_root.HUD.bossHealth._visible) {
_root.finalBoss.hit = true;
_root.finalBoss.health = _root.finalBoss.health - ((power / 3) * 2);
}
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 7);
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
i = 1;
while (i <= 3) {
if (_root["fBH" + i].hitbox.hitTest(obj._x, obj._y, true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 7);
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
if (_root["fBH" + i].stopStartScale) {
_root["fBH" + i]._xscale = (_root["fBH" + i]._yscale = _root["fBH" + i]._yscale - (power * 1.3));
}
addBlood(_root["fBH" + i]._x, _root["fBH" + i]._y, _root["fBH" + i]._rotation, 17);
if (_root["fBH" + i]._xscale <= 10) {
gunName = "gun" + _root.getNextHighestDepth();
attachMovie("droppedGun", gunName, _root.getNextHighestDepth());
weaponNr = 2 + random(3);
if (weaponNr == 1) {
_root[gunName].gotoAndStop(1);
_root[gunName].weaponAmmo = 2;
} else if (weaponNr == 3) {
_root[gunName].gotoAndStop(3);
_root[gunName].weaponAmmo = 6;
} else if (weaponNr == 4) {
_root[gunName].gotoAndStop(4);
_root[gunName].weaponAmmo = 7;
} else if (weaponNr == 2) {
_root[gunName].gotoAndStop(2);
_root[gunName].weaponAmmo = 4;
}
_root[gunName]._x = _root["fBH" + i]._x;
_root[gunName]._y = _root["fBH" + i]._y;
_root[gunName]._xscale = (_root[gunName]._yscale = 60);
_root[gunName].rotSpeed = -2 + random(4);
_root[gunName].glow._width = (_root[gunName].glow._height = 100);
_root[gunName].onEnterFrame = function () {
this.glow._visible = true;
if (this.playerNear || (getDist(this._x, playerL._x, this._y, playerL._y) < 70)) {
this.playerNear = true;
this._x = this._x + (((playerL._x - this._x) * 0.3) * timescale);
this._y = this._y + (((playerL._y - this._y) * 0.3) * timescale);
this._rotation = this._rotation + (13 * timescale);
this._alpha = this._alpha - (10 * timescale);
if (this._alpha <= 0) {
playSound("pistolCock", obj._x, obj._y);
if ((this.weaponAmmo == 2) || (this.weaponAmmo == 4)) {
if (_root[("weapon" + this.weaponAmmo) + "Active"] == true) {
_root[("weapon" + (this.weaponAmmo + 1)) + "Active"] = true;
}
}
_root[("weapon" + this.weaponAmmo) + "Active"] = true;
_root[("ammo" + this.weaponAmmo) + "Total"] = _root[("ammo" + this.weaponAmmo) + "Total"] + _root[("ammo" + this.weaponAmmo) + "Max"];
this.removeMovieClip();
}
} else {
this._x = this._x - (3 * timescale);
if (this._x > ((_root.playerBounds._x + _root.playerBounds._width) - 50)) {
this._x = this._x - (5 * timescale);
}
this._rotation = this._rotation + (this.rotSpeed * timescale);
}
};
_root["fBH" + i].swapDepths(_root.getNextHighestDepth());
_root["fBH" + i].removeMovieClip();
}
obj.removeMovieClip();
}
i++;
}
}
if ((obj.firstFrame == undefined) && (obj._name != undefined)) {
if (lvl.hitTest(obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * -14), obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * -14), true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 7);
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
obj.firstFrame = true;
}
obj._x = obj._x + (Math.sin(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
obj._y = obj._y - (Math.cos(((obj._rotation + 90) * Math.PI) / 180) * (14 * timescale));
if (getDist(playerL._x, obj._x, playerL._y, obj._y) > 670) {
obj.removeMovieClip();
}
if (friendly) {
if (obj.rangeCheck != true) {
var i = 0;
while ((++i) <= enemies) {
if (getDist(_root["nmy" + i]._x, obj._x, _root["nmy" + i]._y, obj._y) < 500) {
if ((_root["nmy" + i].gunReady != true) && (_root["nmy" + i].health > 0)) {
_root["nmy" + i].xSpeed2 = 0;
if (_root["nmy" + i].weapon == 1) {
_root["nmy" + i].gotoAndStop(3);
} else if (_root["nmy" + i].weapon == 6) {
_root["nmy" + i].gotoAndStop(7);
} else if (_root["nmy" + i].weapon == 7) {
_root["nmy" + i].gotoAndStop(8);
} else if (_root["nmy" + i].weapon == 3) {
_root["nmy" + i].gotoAndStop(9);
}
_root["nmy" + i].timer = 42 + random(5);
}
}
}
obj.rangeCheck = true;
}
var i = 0;
while ((++i) <= enemies) {
if (_root["nmy" + i].hitTest(obj._x, obj._y, true)) {
if ((obj._y < (_root["nmy" + i]._y - 22)) && (_root["nmy" + i].health > 0)) {
if ((obj._x < (_root["nmy" + i]._x + 19)) && (obj._x > (_root["nmy" + i]._x - 19))) {
if ((_root["nmy" + i].health - (power * 3)) > 0) {
_root["nmy" + i].health = _root["nmy" + i].health - (power * 3);
} else {
_root["nmy" + i].health = 0;
}
_root.nrOfHeadShots++;
if (_root.nrOfHeadShots >= 20) {
_root.unlockAchievement(5);
}
} else {
_root["nmy" + i].health = _root["nmy" + i].health - power;
}
} else {
_root["nmy" + i].health = _root["nmy" + i].health - power;
}
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
if ((_root["nmy" + i].gunReady != true) && (_root["nmy" + i].health > 0)) {
_root["nmy" + i].xSpeed2 = 0;
if (_root["nmy" + i].weapon == 1) {
_root["nmy" + i].gotoAndStop(3);
} else if (_root["nmy" + i].weapon == 6) {
_root["nmy" + i].gotoAndStop(7);
} else if (_root["nmy" + i].weapon == 7) {
_root["nmy" + i].gotoAndStop(8);
} else if (_root["nmy" + i].weapon == 3) {
_root["nmy" + i].gotoAndStop(9);
}
_root["nmy" + i].timer = 21 + random(5);
}
obj.removeMovieClip();
}
}
} else if (playerL.hitTest(obj._x, obj._y, true) || (playerB.hitTest(obj._x, obj._y, true))) {
health = health - (power / 2);
HUD.damage._alpha = HUD.damage._alpha + (power * 4);
addBlood(obj._x, obj._y, obj._rotation, 17);
playSound("bulletHit", obj._x, obj._y);
obj.removeMovieClip();
}
var i = 0;
while ((++i) <= gasCans) {
if (_root["gasCan" + i].hitTest(obj._x, obj._y, true)) {
explName = "expl" + _root.getNextHighestDepth();
attachMovie("explosion", explName, _root.getNextHighestDepth());
_root[explName]._x = _root["gasCan" + i]._x;
_root[explName]._y = _root["gasCan" + i]._y;
_root[explName]._xscale = (_root[explName]._yscale = 50);
_root["gasCan" + i].swapDepths(_root.getNextHighestDepth());
_root["gasCan" + i].removeMovieClip();
var i = 0;
while ((++i) <= enemies) {
if ((getDist(_root["nmy" + i]._x, obj._x, _root["nmy" + i]._y, obj._y) < 130) && (_root["nmy" + i]._y < _root[explName]._y)) {
_root["nmy" + i].health = _root["nmy" + i].health - 50;
}
}
obj.removeMovieClip();
}
}
if (obj._name != undefined) {
if (lvl.hitTest(obj._x, obj._y, true)) {
addGlow(obj._x, obj._y, 40, 50);
addSparks(obj._x, obj._y, 4 + random(4));
if (obj.soundOn != false) {
playSound("ricochet", obj._x, obj._y, 3);
}
obj.removeMovieClip();
}
}
}
function playSound(sName, xPos, yPos, ranNr) {
_root.soundFX["sound" + sName] = new Sound(soundFX);
if ((ranNr != undefined) && (ranNr != 0)) {
if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound((sName + (1 + random(ranNr))) + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName + (1 + random(ranNr)));
}
} else if (timescale2 < 0.75) {
soundFX.setVolume(200);
_root.soundFX["sound" + sName].attachSound(sName + "_slow");
} else {
soundFX.setVolume(100);
_root.soundFX["sound" + sName].attachSound(sName);
}
var _local3 = ((xPos - ((-_root._x) + 300)) / 400) * 100;
if (_local3 > 100) {
_local3 = 100;
} else if (_local3 < -100) {
_local3 = -100;
}
_root.soundFX["sound" + sName].setPan(_local3);
_root.soundFX["sound" + sName].setVolume(SFXVolume * 100);
_root.soundFX["sound" + sName].start();
}
com.newgrounds.API.logCustomEvent("Level_8");
stop();
_root.pausePlayer = true;
_root.mouseXPos = playerL._x + 170;
_root.mouseYPos = playerL._y - 90;
Mouse.show();
generalTimer = 0;
_root._x = (-_root.playerL._x) + 300;
_root._y = (-_root.playerL._y) + 200;
_root.createEmptyMovieClip("musicMC", _root.getNextHighestDepth());
musicStarted = false;
musicMC.bgMusic = new Sound(musicMC);
musicMC.bgMusic.attachSound("bossLoop");
musicMC.bgMusic.onSoundComplete = function () {
musicMC.bgMusic.start();
};
hiddenMusicVolume = 1;
playerL.xScale = playerL._xscale;
playerL.fallspeed = (playerL.xSpeed = (playerL.xSpeed2 = 0));
playerL.ySpeed = (playerL.ySpeed2 = 0);
playerL.rotSpeed = (playerL.rotSpeed2 = 0);
playerL.onGround = false;
playerL.landedOnGround = false;
playerL.jumpReady = false;
playerL.jumpPower = 0;
playerL.wallJumped = false;
playerL.faceRight = false;
playerL.sRot = playerL._rotation;
playerL._rotation = 0;
playerL.sHeight = 80;
playerL.sWidth = 40;
playerL._rotation = playerL.sRot;
playerL.bTG = false;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
var lastPlayerX = playerL._x;
var lastPlayerY = playerL._y;
playerB.bRot = 0;
playerL.aniOnGround = lvl.hitTest(playerL._x, (playerL._y + (playerL.sHeight / 2)) + 10, true);
playerL.onGroundAfterWJ = true;
var kUpPressed = false;
var showFPS = 32;
var fps = 32;
var kUp = ((kDown = (kLeft = (kRight = false))));
var timescale = 1;
var gunTimer = 0;
var fireRightGun = true;
var mDir = ((Math.atan2((playerL._y - 30) - _ymouse, playerL._x - _xmouse) * 180) / Math.PI);
var mDirR = ((Math.atan2(_ymouse - (playerL._y - 30), _xmouse - playerL._x) * 180) / Math.PI);
var mousePress = false;
var recoil = 0;
enemies = 0;
killCount = 0;
gasCans = 0;
rullBord = 0;
elevator = 0;
roofWindow.broken = false;
fadeToDark = false;
levelComplete = false;
showHint = false;
shakeTimer = 0;
onEnterFrame = function () {
if ((generalTimer >= 5) && (!musicStarted)) {
if (musicMC.bgMusicIntro == undefined) {
musicMC.bgMusic.start();
} else {
musicMC.bgMusicIntro.start();
}
musicStarted = true;
}
if (Key.isDown(85)) {
if (fisk != true) {
if (Key.isDown(70)) {
Key70Pressed = true;
}
if (Key.isDown(73)) {
Key73Pressed = true;
}
if (Key.isDown(83)) {
Key83Pressed = true;
}
if (Key.isDown(75)) {
Key75Pressed = true;
}
if (((Key70Pressed && (Key73Pressed)) && (Key83Pressed)) && (Key75Pressed)) {
i = 0;
while (i <= 7) {
_root[("weapon" + i) + "Active"] = true;
_root[("ammo" + i) + "Total"] = 9999;
_root["ammo" + i] = _root[("ammo" + i) + "Max"];
i++;
}
fisk = true;
}
}
}
if (timescale > 0) {
generalTimer++;
}
if (generalTimer == 410) {
pausePlayer = false;
Mouse.hide();
}
if (!pausePlayer) {
mouseXPos = _xmouse;
mouseYPos = _ymouse;
kUp = Key.isDown(87);
kDown = Key.isDown(83);
kLeft = Key.isDown(65);
kRight = Key.isDown(68);
if (Key.isDown(16) || (Key.isDown(32))) {
kShift = true;
} else {
kShift = false;
}
if (weapon1Active && (Key.isDown(49))) {
weapon = 1;
} else if (weapon2Active && (Key.isDown(50))) {
weapon = 2;
} else if (weapon3Active && (Key.isDown(51))) {
weapon = 3;
} else if (weapon4Active && (Key.isDown(52))) {
weapon = 4;
} else if (weapon5Active && (Key.isDown(53))) {
weapon = 5;
} else if (weapon6Active && (Key.isDown(54))) {
weapon = 6;
} else if (weapon7Active && (Key.isDown(55))) {
weapon = 7;
}
if (Key.isDown(82)) {
if ((_root["ammo" + weapon] < _root[("ammo" + weapon) + "Max"]) && (_root[("ammo" + weapon) + "Total"] > 0)) {
playerB.body.gotoAndStop(2);
}
}
} else {
kUp = false;
kDown = false;
kLeft = false;
kRight = false;
kShift = false;
}
if (health <= 0) {
HUD.damage._alpha = HUD.damage._alpha + 8;
if (HUD.damage._alpha > 3000) {
HUD.damage._alpha = 3000;
}
HUD.fade.fadeSpeed = 1;
if (HUD.fade._alpha >= 100) {
playerL.dead = true;
}
timescale = timescale - 0.01;
if (timescale < 0) {
timescale = 0;
}
fadeToDark = true;
health = 0;
} else {
if ((HUD.damage._alpha - (0.7 * timescale)) >= 0) {
HUD.damage._alpha = HUD.damage._alpha - (0.7 * timescale);
} else {
HUD.damage._alpha = 0;
}
if (health <= 30) {
HUD.damage.timer++;
if (HUD.damage.timer > (health * 2)) {
HUD.damage._alpha = HUD.damage._alpha + 20;
HUD.damage.timer = 0;
}
}
if (HUD.damage._alpha > 60) {
HUD.damage._alpha = 60;
}
}
fps++;
ammo3Total = ammo2Total;
ammo5Total = ammo4Total;
if (((_root["ammo" + weapon] + _root[("ammo" + weapon) + "Total"]) <= 0) && (weapon != 1)) {
i = 7;
while (i >= 1) {
if ((_root[("weapon" + i) + "Active"] == true) && ((_root["ammo" + i] + _root[("ammo" + i) + "Total"]) > 0)) {
weapon = i;
i = 0;
} else if (i == 1) {
weapon = 1;
}
i--;
}
mousePress = false;
}
recoil = recoil + (((-recoil) * 0.3) * timescale);
if (!showOptions) {
mDir = (-recoil) + ((Math.atan2((playerB._y - 30) - mouseYPos, playerB._x - mouseXPos) * 180) / Math.PI);
mDirR = recoil + ((Math.atan2(mouseYPos - (playerB._y - 30), mouseXPos - playerB._x) * 180) / Math.PI);
}
if (pausePlayer) {
if (((weapon != 1) && (weapon != 6)) && (weapon != 7)) {
mDir = -100;
} else {
mDir = -170;
}
}
if (Key.isDown(27) || (Key.isDown(80) && (health > 0))) {
if (doOnce27 != true) {
if (showOptions == false) {
Mouse.show();
showOptions = true;
} else {
Mouse.hide();
showOptions = false;
}
doOnce27 = true;
}
} else {
doOnce27 = false;
}
HUD.HUD.ammoText.text = (_root["ammo" + weapon] + " / ") + _root[("ammo" + weapon) + "Total"];
if (actionAmount > 0) {
if (kShift) {
if (slowMotionSFXEnabled) {
if (kShiftOnce1 != true) {
playSound("slowDown", (-_root._x) + 300, (-_root._y) + 200);
kShiftOnce1 = true;
}
kShiftOnce2 = false;
}
timescale2 = timescale2 + ((0.3 - timescale2) * 0.1);
if (actionAmount < 0) {
actionAmount = 0;
}
} else {
if (slowMotionSFXEnabled) {
if (kShiftOnce2 != true) {
playSound("speedUp", (-_root._x) + 300, (-_root._y) + 200);
kShiftOnce2 = true;
}
kShiftOnce1 = false;
}
timescale2 = timescale2 + ((1 - timescale2) * 0.1);
}
} else {
if (slowMotionSFXEnabled) {
if (kShiftOnce2 != true) {
playSound("speedUp", (-_root._x) + 300, (-_root._y) + 200);
kShiftOnce2 = true;
}
kShiftOnce1 = false;
}
timescale2 = timescale2 + ((1 - timescale2) * 0.1);
kShift = false;
}
musicMC.bgMusic.setVolume(((timescale2 * 100) * hiddenMusicVolume) * musicVolume);
if ((showOptions != true) && (health > 0)) {
if (generalTimer > 90) {
timescale = timescale2 + (1 - (showFPS / 32));
} else {
timescale = timescale2;
}
} else {
timescale = 0;
}
if (kRight) {
playerL.xSpeed = 5;
} else if (kLeft) {
playerL.xSpeed = -5;
} else {
playerL.xSpeed = 0;
}
if (kUp) {
playerL.ySpeed = -5;
} else if (kDown) {
playerL.ySpeed = 5;
} else {
playerL.ySpeed = 0;
}
playerL.xSpeed2 = playerL.xSpeed2 + (((playerL.xSpeed - playerL.xSpeed2) * 0.2) * timescale);
playerL.ySpeed2 = playerL.ySpeed2 + (((playerL.ySpeed - playerL.ySpeed2) * 0.2) * timescale);
playerL._x = playerL._x + (playerL.xSpeed2 * timescale);
playerL._y = playerL._y + (playerL.ySpeed2 * timescale);
playerL._rotation = playerL.xSpeed2 * 6;
if (playerL._x < playerBounds._x) {
playerL._x = playerBounds._x;
} else if (playerL._x > (playerBounds._x + playerBounds._width)) {
playerL._x = playerBounds._x + playerBounds._width;
}
if (playerL._y < playerBounds._y) {
playerL._y = playerBounds._y;
} else if (playerL._y > (playerBounds._y + playerBounds._height)) {
playerL._y = playerBounds._y + playerBounds._height;
}
if ((((playerL._rotation - mDir) + 90) > 0) && (((playerL._rotation - mDir) + 90) < 180)) {
playerB.bRot = playerB.bRot + ((((mDir * 0.5) - playerB.bRot) * 0.15) * timescale);
if (playerL._currentframe != 4) {
if (playerL.onGround == true) {
playerL._xscale = -playerL.xScale;
playerL.faceRight = false;
} else if (((!kShift) && (playerL._rotation > -13)) && (playerL._rotation < 13)) {
playerL._xscale = -playerL.xScale;
playerL.faceRight = false;
}
}
} else {
playerB.bRot = playerB.bRot + ((((mDirR * 0.5) - playerB.bRot) * 0.15) * timescale);
playerL._xscale = playerL.xScale;
playerL.faceRight = true;
}
if (playerL.faceRight == true) {
if ((((weapon == 3) || (weapon == 5)) || (weapon == 6)) || (weapon == 7)) {
playerB.body.arm1._rotation = (playerB.body.arm2._rotation = mDir - playerB._rotation);
} else if (((weapon == 1) || (weapon == 2)) || (weapon == 4)) {
playerB.body.arm1._rotation = (-playerB.bRot) + 200;
playerB.body.arm2._rotation = mDir - playerB._rotation;
}
} else if ((((weapon == 3) || (weapon == 5)) || (weapon == 6)) || (weapon == 7)) {
playerB.body.arm1._rotation = (playerB.body.arm2._rotation = (-mDirR) + playerB._rotation);
} else if (((weapon == 1) || (weapon == 2)) || (weapon == 4)) {
playerB.body.arm1._rotation = playerB.bRot + 200;
playerB.body.arm2._rotation = (-mDirR) + playerB._rotation;
}
if (playerB.bRot > 30) {
playerB.bRot = 30;
} else if (playerB.bRot < -30) {
playerB.bRot = -30;
}
playerB._rotation = playerB.bRot;
playerB._x = playerL._x;
playerB._y = playerL._y;
playerB._xscale = playerL._xscale;
playerB.body.head._rotation = (playerL._xscale / Math.abs(playerL._xscale)) * (playerB._rotation - playerL._rotation);
playerB.gotoAndStop(weapon);
shakeTimer = shakeTimer - timescale;
if (shakeTimer <= 0) {
shakeTimer = 0;
}
_x = (_x + ((((((-playerL._x) - ((mouseXPos - playerL._x) / 2)) + 300) - _x) * 0.1) * timescale));
_y = (_y + ((((((-playerL._y) - ((mouseYPos - playerL._y) / 2)) + 200) - _y) * 0.1) * timescale));
_x = (_x + ((-shakeTimer) + random(shakeTimer * 2)));
_y = (_y + ((-shakeTimer) + random(shakeTimer * 2)));
if ((-_x) < levelBounds._x) {
_x = (-levelBounds._x);
} else if ((-_x) > ((levelBounds._x + levelBounds._width) - 600)) {
_x = (-((levelBounds._x + levelBounds._width) - 600));
}
if ((-_y) < levelBounds._y) {
_y = (-levelBounds._y);
} else if ((-_y) > ((levelBounds._y + levelBounds._height) - 400)) {
_y = (-((levelBounds._y + levelBounds._height) - 400));
}
HUD._x = -_x;
HUD._y = -_y;
playerL.bX = playerL._x + (Math.sin(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
playerL.bY = playerL._y - (Math.cos(playerL._rotation * (Math.PI/180)) * ((playerL.sHeight / 2) + 10));
if (((!showOptions) && (health > 0)) && (!pausePlayer)) {
crosshair._x = mouseXPos;
crosshair._y = mouseYPos;
crosshair._xscale = (crosshair._yscale = 100);
} else {
crosshair._xscale = (crosshair._yscale = 0);
}
if (gunTimer > 0) {
gunTimer = gunTimer - (1 * timescale);
}
if ((((mousePress && (gunTimer <= 0)) && (weapon == 1)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) {
var _local6 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local6, _root.getNextHighestDepth());
_root[_local6]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 30);
_root[_local6]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4)) * (Math.PI/180)) * 27.3)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 30);
_root[_local6]._rotation = mDirR;
_root[_local6]._alpha = 0;
_root[_local6].timer = 0;
_root.playerB.body.arm2.currentFrame = 4;
_root.playerB.body.arm2.gotoAndStop(4);
_root[_local6].onEnterFrame = function () {
bulletCode(this, true, 20);
this.timer++;
if (this.timer >= 6) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
};
gunTimer = 8;
mousePress = false;
} else if ((weapon == 1) && (gunTimer <= 0)) {
_root.playerB.body.arm2.currentFrame = 1;
_root.playerB.body.arm2.gotoAndStop(1);
}
if ((((mousePress == true) && (weapon == 4)) || ((mousePress == true) && (weapon == 5))) || ((mousePress == true) && (weapon == 7))) {
if ((((gunTimer <= 0) && (_root["ammo" + weapon] > 0)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) {
_root["ammo" + weapon]--;
var _local4 = "smoke" + _root.getNextHighestDepth();
attachMovie("smoke", _local4, _root.getNextHighestDepth());
_root[_local4].ySpeed = -1.3 - (0.01 * random(70));
_root[_local4]._xscale = (_root[_local4]._yscale = 70 + random(30));
_root[_local4].onEnterFrame = function () {
this._y = this._y + (this.ySpeed * timescale);
this.ySpeed = this.ySpeed + (((-this.ySpeed) * 0.02) * timescale);
this._xscale = (this._yscale = this._yscale - (this.ySpeed * timescale));
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
var _local3 = "shell" + _root.getNextHighestDepth();
attachMovie("shell", _local3, _root.getNextHighestDepth());
_root[_local3].fallspeed = -3;
_root[_local3].xSpeed = -1.5 + (0.01 * random(300));
_root[_local3]._alpha = 300;
_root[_local3].rotSpeed = -10 + (0.01 * random(2000));
_root[_local3].onEnterFrame = function () {
this._y = this._y + (this.fallspeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this._x = this._x + (this.xSpeed * timescale);
this._rotation = this._rotation + (this.rotSpeed * timescale);
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = (-this.fallspeed) * 0.5;
this.xSpeed = this.xSpeed * 0.8;
this.rotSpeed = this.rotSpeed * 0.8;
this._y = this._y + (this.fallspeed * 2);
}
};
var _local5 = "mF" + _root.getNextHighestDepth();
attachMovie("muzzle", _local5, _root.getNextHighestDepth());
_root[_local5]._xscale = (_root[_local5]._yscale = 25);
if (weapon == 4) {
playSound("uziShot", playerL._x, playerL._y, 3);
var _local6 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local6, _root.getNextHighestDepth());
_root[_local5]._x = (_root[_local4]._x = (_root[_local6]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 25)));
_root[_local5]._y = (_root[_local4]._y = (_root[_local6]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 25)));
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 19.5);
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 19.5);
_root[_local3].gotoAndStop(1);
_root[_local6]._rotation = (mDirR - recoil) - ((recoil / 2) + (random(100 * recoil) / 100));
addGlow(_root[_local6]._x, _root[_local6]._y, 30, 130);
_root[_local6].onEnterFrame = function () {
bulletCode(this, true, 5);
};
gunTimer = 4;
recoil = recoil + 10;
} else if (weapon == 5) {
playSound("uziShot", playerL._x, playerL._y, 3);
var _local6 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local6, _root.getNextHighestDepth());
if (fireRightGun) {
_root[_local5]._x = (_root[_local4]._x = (_root[_local6]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 25)));
_root[_local5]._y = (_root[_local4]._y = (_root[_local6]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 25)));
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 19.5);
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 19.5);
_root[_local3].gotoAndStop(1);
_root[_local6]._rotation = (mDirR - recoil) - ((recoil / 2) + (random(100 * recoil) / 100));
addGlow(_root[_local6]._x, _root[_local6]._y, 30, 130);
fireRightGun = false;
_root[_local6].onEnterFrame = function () {
bulletCode(this, true, 5);
};
} else {
_root[_local5]._x = (_root[_local4]._x = (_root[_local6]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 3)) * (Math.PI/180)) * 22.5)));
_root[_local5]._y = (_root[_local4]._y = (_root[_local6]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 3)) * (Math.PI/180)) * 22.5)));
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 19.5);
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 19.5);
_root[_local3].gotoAndStop(1);
_root[_local6]._rotation = mDirR - recoil;
addGlow(_root[_local6]._x, _root[_local6]._y, 30, 130);
fireRightGun = true;
_root[_local6].onEnterFrame = function () {
bulletCode(this, true, 5);
};
}
gunTimer = 2;
recoil = recoil + 5;
} else if (weapon == 7) {
playSound("m16Shot", playerL._x, playerL._y);
var _local6 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local6, _root.getNextHighestDepth());
_root[_local5]._x = (_root[_local4]._x = (_root[_local6]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -2)) * (Math.PI/180)) * 13.65)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (27 + random(5)))));
_root[_local5]._y = (_root[_local4]._y = (_root[_local6]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -2)) * (Math.PI/180)) * 13.65)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (27 + random(5)))));
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 10)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 12.5);
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 10)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 5)) * (Math.PI/180)) * 12.5);
_root[_local3].gotoAndStop(1);
_root[_local6]._rotation = (mDirR - recoil) - ((recoil / 10) + (random(10 * recoil) / 10));
addGlow(_root[_local6]._x, _root[_local6]._y, 30, 130);
_root[_local6].onEnterFrame = function () {
bulletCode(this, true, 7);
};
gunTimer = 2;
recoil = recoil + 2;
}
_root[_local5]._rotation = mDirR;
}
}
if (((((mousePress && (gunTimer <= 0)) && (_root["ammo" + weapon] <= 0)) && (_root[("ammo" + weapon) + "Total"] > 0)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) {
playerB.body.gotoAndStop(2);
}
backCity._x = -_x;
backCity._y = -_y;
topLayer.swapDepths(_root.getNextHighestDepth());
if (startGameBlackFade != undefined) {
startGameBlackFade.swapDepths(_root.getNextHighestDepth());
}
if (banana != undefined) {
banana.swapDepths(_root.getNextHighestDepth());
}
if (speechBubble != undefined) {
speechBubble.swapDepths(_root.getNextHighestDepth());
}
HUD.swapDepths(_root.getNextHighestDepth());
crosshair.swapDepths(_root.getNextHighestDepth());
};
crosshair.onPress = function () {
mousePress = true;
if (((((((gunTimer <= 0) && (_root["ammo" + weapon] > 0)) && (playerL._currentframe != 4)) && (playerB.body._currentframe == 1)) && (weapon != 4)) && (weapon != 5)) && (weapon != 7)) {
_root["ammo" + weapon]--;
if ((_root["ammo" + weapon] <= 0) && (_root[("ammo" + weapon) + "Total"] > 0)) {
playerB.body.gotoAndStop(2);
}
var _local5 = "smoke" + _root.getNextHighestDepth();
attachMovie("smoke", _local5, _root.getNextHighestDepth());
_root[_local5].ySpeed = -1.3 - (0.01 * random(70));
_root[_local5]._xscale = (_root[_local5]._yscale = 70 + random(30));
_root[_local5].onEnterFrame = function () {
this._y = this._y + (this.ySpeed * timescale);
this.ySpeed = this.ySpeed + (((-this.ySpeed) * 0.02) * timescale);
this._xscale = (this._yscale = this._yscale - (this.ySpeed * timescale));
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
var _local4 = "shell" + _root.getNextHighestDepth();
attachMovie("shell", _local4, _root.getNextHighestDepth());
_root[_local4].fallspeed = -3;
_root[_local4].xSpeed = -1.5 + (0.01 * random(300));
_root[_local4]._alpha = 300;
_root[_local4].rotSpeed = -10 + (0.01 * random(2000));
_root[_local4].onEnterFrame = function () {
this._y = this._y + (this.fallspeed * timescale);
this.fallspeed = this.fallspeed + (0.3 * timescale);
this._x = this._x + (this.xSpeed * timescale);
this._rotation = this._rotation + (this.rotSpeed * timescale);
this._alpha = this._alpha - (2 * timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = (-this.fallspeed) * 0.5;
this.xSpeed = this.xSpeed * 0.8;
this.rotSpeed = this.rotSpeed * 0.8;
this._y = this._y + (this.fallspeed * 2);
}
};
var _local6 = "mF" + _root.getNextHighestDepth();
attachMovie("muzzle", _local6, _root.getNextHighestDepth());
_root[_local6]._xscale = (_root[_local6]._yscale = 25);
if (weapon == 2) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 26)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 26)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 20);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 20);
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
gunTimer = 8;
recoil = recoil + 10;
} else if (weapon == 3) {
playSound("pistolShot", playerL._x, playerL._y);
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
if (fireRightGun) {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4.5)) * (Math.PI/180)) * 13)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 26)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4.5)) * (Math.PI/180)) * 13)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 26)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4.5)) * (Math.PI/180)) * 13)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 20);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -4.5)) * (Math.PI/180)) * 13)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 20);
fireRightGun = false;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
} else {
_root[_local6]._x = (_root[_local5]._x = (_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 26)));
_root[_local6]._y = (_root[_local5]._y = (_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 26)));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.sin((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 20);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * 7.5)) * (Math.PI/180)) * 15)) + (Math.cos((((-mDir) - 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 2.5)) * (Math.PI/180)) * 20);
fireRightGun = true;
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 7);
};
}
_root[_local4].gotoAndStop(1);
_root[_local3]._rotation = mDirR;
addGlow(_root[_local3]._x, _root[_local3]._y, 30, 130);
gunTimer = 4;
recoil = recoil + 10;
} else if (weapon == 6) {
playSound("shotgunShot", playerL._x, playerL._y);
var _local7 = 0;
while (_local7++ , _local7 < 10) {
var _local3 = "bu" + _root.getNextHighestDepth();
attachMovie("bullet", _local3, _root.getNextHighestDepth());
_root[_local3]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -2)) * (Math.PI/180)) * 13.65)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (27 + random(10)));
_root[_local3]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -2)) * (Math.PI/180)) * 13.65)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * (27 + random(10)));
_root[_local3]._rotation = (mDirR - 7) + random(14);
_root[_local3].gotoAndStop(2);
if (_local7 < 6) {
_root[_local3].soundOn = false;
}
_root[_local3].onEnterFrame = function () {
bulletCode(this, true, 3);
};
}
_root[_local6]._x = (_root[_local5]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -2)) * (Math.PI/180)) * 13.65)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 28.5));
_root[_local6]._y = (_root[_local5]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -2)) * (Math.PI/180)) * 13.65)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 28.5));
_root[_local4]._x = (playerB._x + (Math.sin((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -2)) * (Math.PI/180)) * 13.65)) + (Math.sin((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 28.5);
_root[_local4]._y = (playerB._y - (Math.cos((playerB._rotation + ((playerL._xscale / Math.abs(playerL._xscale)) * -2)) * (Math.PI/180)) * 13.65)) + (Math.cos((((-mDir) + 90) + ((playerL._xscale / Math.abs(playerL._xscale)) * 168.3)) * (Math.PI/180)) * 28.5);
_root[_local4].gotoAndStop(2);
addGlow(_root[_local5]._x, _root[_local5]._y, 30, 130);
gunTimer = 20;
recoil = recoil + 18;
}
_root[_local6]._rotation = mDirR;
}
};
crosshair.onRelease = function () {
mousePress = false;
};
crosshair.onReleaseOutside = function () {
mousePress = false;
};
_root.createEmptyMovieClip("soundFX", _root.getNextHighestDepth());
Instance of Symbol 577 MovieClip "backCity" in Frame 24
onClipEvent (load) {
gotoAndStop (2);
}
Instance of Symbol 963 MovieClip "swatter" in Frame 24
onClipEvent (load) {
rotSpeed = 0;
rotTarget = _rotation;
startRot = _rotation;
xSpeed = 0;
xTarget = _x;
ySpeed = 0;
yTarget = _y;
startX = _x;
startY = _y;
activated = false;
timer = 0;
hasHit = false;
}
onClipEvent (enterFrame) {
if (activated) {
timer = timer + _root.timescale;
if (timer > 130) {
_rotation = startRot;
rotTarget = startRot;
_x = startX;
xTarget = startX;
_y = startY;
yTarget = startY;
rotSpeed = (xSpeed = (ySpeed = 0));
hasHit = false;
activated = false;
timer = 0;
} else if (timer > 90) {
if ((!hasHit) && (hitbox.hitTest(_root.playerL._x, _root.playerL._y, true))) {
_root.health = _root.health - 15;
_root.HUD.damage._alpha = _root.HUD.damage._alpha + 40;
_root.addBlood(_root.playerL._x, _root.playerL._y, _root.playerL._rotation, 17);
_root.playSound("bulletHit", _root.playerL._x, _root.playerL._y);
_root.playerL.xSpeed2 = _root.playerL.xSpeed2 - 30;
hasHit = true;
}
rotTarget = -110;
xTarget = _root.finalBoss._x - 80;
} else if (timer > 30) {
rotTarget = 45;
xTarget = _root.finalBoss._x;
yTarget = _root.finalBoss._y;
}
}
rotSpeed = rotSpeed + ((rotTarget - _rotation) * 0.1);
rotSpeed = rotSpeed * 0.7;
_rotation = (_rotation + (rotSpeed * _root.timescale));
xSpeed = xSpeed + ((xTarget - _x) * 0.05);
xSpeed = xSpeed * 0.6;
_x = (_x + (xSpeed * _root.timescale));
ySpeed = ySpeed + ((yTarget - _y) * 0.025);
ySpeed = ySpeed * 0.7;
_y = (_y + (ySpeed * _root.timescale));
}
Instance of Symbol 570 MovieClip in Frame 24
onClipEvent (enterFrame) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
Symbol 9 MovieClip Frame 1
stop();
Symbol 19 MovieClip Frame 1
stop();
Symbol 20 MovieClip [Preloader] Frame 1
function enterFrameHandler() {
var _local2 = 0;
_local2 = _root.getBytesLoaded() / _root.getBytesTotal();
if (loadingBar) {
loadingBar.gotoAndStop(int(_local2 * (loadingBar._totalframes - 1)) + 1);
}
if ((_local2 >= 1) && (haltComplete != true)) {
onEnterFrame = null;
gotoAndStop ("loaded");
}
}
stop();
var autoPlay;
var className;
var haltComplete;
onEnterFrame = enterFrameHandler;
Symbol 20 MovieClip [Preloader] Frame 10
function _onPlayClick() {
_root.nextFrame();
_root.play();
_parent._onLoaded();
}
if (playButton) {
playButton.onRelease = _onPlayClick;
playButton.stop();
}
if (autoPlay) {
_onPlayClick(null);
}
Symbol 22 MovieClip [Newgrounds API Classes] Frame 1
#initclip 26
Object.registerClass("Newgrounds API Classes", com.newgrounds.shims.APIShim);
#endinitclip
Symbol 77 MovieClip [FlashAd] Frame 1
#initclip 27
Object.registerClass("FlashAd", com.newgrounds.components.FlashAdBase);
#endinitclip
function initPlayButton() {
if (this.playButton) {
this.playButton.onRelease = onPlayClick;
if (!this.showPlayButton) {
this.playButton._visible = false;
}
}
}
function onPlayClick() {
removeAd();
_visible = false;
}
stop();
Symbol 77 MovieClip [FlashAd] Frame 2
initPlayButton();
Symbol 77 MovieClip [FlashAd] Frame 10
initPlayButton();
Symbol 77 MovieClip [FlashAd] Frame 20
initPlayButton();
Symbol 78 MovieClip [APIConnector] Frame 1
function _onLoaded() {
gotoAndStop ("invisible");
if (_redirect) {
com.newgrounds.API.loadOfficialVersion();
return(undefined);
}
}
function _apiConnect() {
var _local2 = com.newgrounds.API;
if (_local2 && (!_local2.connected)) {
if (!apiId) {
com.newgrounds.Logger.logError("No API ID entered in the API Connector component.", "You can create an API ID for this submission at http://newgrounds.com/account/flashapi", "Enter your API ID into the API Connector using the Component Inspector (Window -> Component Inspector).");
return(undefined);
}
switch (debugMode) {
case "Off" :
default :
_local2.debugMode = _local2.RELEASE_MODE;
break;
case "Simulate Logged-in User" :
_local2.debugMode = _local2.DEBUG_MODE_LOGGED_IN;
break;
case "Simulate Logged-out User" :
_local2.debugMode = _local2.DEBUG_MODE_LOGGED_OUT;
break;
case "Simulate New Version" :
_local2.debugMode = _local2.DEBUG_MODE_NEW_VERSION;
break;
case "Simulate Host Blocked" :
_local2.debugMode = _local2.DEBUG_MODE_HOST_BLOCKED;
}
if (loader) {
loader.haltComplete = true;
}
_local2.addEventListener(com.newgrounds.APIEvent.API_CONNECTED, _onConnected);
_local2.connect(_root, apiId, encryptionKey, movieVersion);
}
}
function _onConnected(event) {
if (loader) {
loader.haltComplete = false;
}
if ((redirectOnNewVersion && (event.__get__success())) && (event.__get__data().newVersion)) {
_redirect = true;
}
if ((redirectOnHostBlocked && (!event.__get__success())) && (event.__get__error() == com.newgrounds.APIEvent.ERROR_HOST_BLOCKED)) {
_redirect = true;
}
if (_redirect) {
gotoAndStop ("adPreloader");
forceAlwaysOnTop();
}
}
function forceAlwaysOnTop() {
var _local2 = getNextHighestDepth();
swapDepths(_local2);
if (Stage) {
_x = ((Stage.width - _width) / 2);
_y = ((Stage.height - _height) / 2);
_visible = true;
}
if (_root && (_root instanceof MovieClip)) {
MovieClip(_root).stop();
}
}
stop();
if (_root && (_root instanceof MovieClip)) {
MovieClip(_root).stop();
}
var apiId;
var encryptionKey;
var movieVersion;
var debugMode;
var connectorType;
var redirectOnHostBlocked;
var redirectOnNewVersion;
var adType;
var className;
var _redirect;
_x = int(_x);
_y = int(_y);
if (!debugMode) {
debugMode = "Simulate Logged-in User";
}
if (!connectorType) {
connectorType = "Flash Ad + Preloader";
}
if (!adType) {
adType = "Video";
}
if (ad) {
ad.adType = adType;
}
switch (connectorType) {
case "Flash Ad + Preloader" :
gotoAndStop ("adPreloader");
break;
case "Flash Ad Only" :
gotoAndStop ("ad");
break;
case "Invisible" :
gotoAndStop ("invisible");
}
_apiConnect();
Instance of Symbol 77 MovieClip [FlashAd] "ad" in Symbol 78 MovieClip [APIConnector] Frame 1
//component parameters
onClipEvent (construct) {
apiId = "";
showBorder = true;
adType = "Video";
}
Instance of Symbol 20 MovieClip [Preloader] "loader" in Symbol 78 MovieClip [APIConnector] Frame 1
//component parameters
onClipEvent (construct) {
autoPlay = false;
mainClass = "";
}
Symbol 24 MovieClip [__Packages.com.newgrounds.EventDispatcher] Frame 0
class com.newgrounds.EventDispatcher
{
var _listeners;
function EventDispatcher () {
_listeners = {};
}
function addEventListener(type, listener) {
if (!_listeners[type]) {
_listeners[type] = [];
}
if (typeof(listener) == "function") {
_listeners[type].push({target:null, func:listener});
} else {
_listeners[type].push(listener);
}
}
function removeEventListener(type, listener) {
var _local3 = _listeners[type];
if (_local3) {
var _local5 = _local3.length;
var _local2 = 0;
while (_local2 < _local5) {
if ((_local3[_local2].func == listener) || (_local3[_local2] == listener)) {
_local3.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
}
function dispatchEvent(event) {
var _local4 = _listeners[event.__get__type()];
if (_local4) {
var _local5 = _local4.length;
var _local2 = 0;
while (_local2 < _local5) {
var _local3 = _local4[_local2];
_local3.func.call(_local3.target, event);
_local2++;
}
}
return(true);
}
}
Symbol 23 MovieClip [__Packages.com.newgrounds.Event] Frame 0
class com.newgrounds.Event
{
var _type;
function Event (type) {
_type = type;
}
function get type() {
return(_type);
}
}
Symbol 30 MovieClip [__Packages.com.newgrounds.Bridge] Frame 0
class com.newgrounds.Bridge extends com.newgrounds.EventDispatcher
{
var _widgetId, _inConnection, _outConnection, dispatchEvent;
function Bridge (id) {
super();
_widgetId = id;
_inConnection = new LocalConnection();
_outConnection = new LocalConnection();
var me = this;
_inConnection.receiveEvent = function () {
me.receiveEvent.apply(me, arguments);
};
_inConnection.allowDomain = (_inConnection.allowInsecureDomain = function (d) {
return(((d == "www.newgrounds.com") || (d == "newgrounds.com")) || (d == "uploads.ungrounded.net"));
});
_inConnection.connect("_rec_" + _widgetId);
com.newgrounds.Logger.addEventListener(com.newgrounds.APIEvent.LOG, {target:this, func:onLogMessage});
}
function get widgetId() {
return(_widgetId);
}
function onLogMessage(event) {
try {
_outConnection.send(_widgetId, "sendEvent", "trace", String(event.__get__data()));
} catch(error) {
}
}
function sendEvent(command, parameters) {
if (_outConnection) {
parameters = {data:parameters};
try {
_outConnection.send(_widgetId, "sendEvent", command, parameters);
} catch(error) {
}
}
}
function receiveEvent(responseData) {
var _local2;
try {
_local2 = com.newgrounds.encoders.json.JSON.decode(responseData);
} catch(error) {
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.BRIDGE_EVENT_RECEIVED, _local2, ((_local2 == null) ? (com.newgrounds.APIEvent.ERROR_UNKNOWN) : null)));
}
function onStatus(event) {
}
}
Symbol 26 MovieClip [__Packages.com.newgrounds.APIEvent] Frame 0
class com.newgrounds.APIEvent extends com.newgrounds.Event
{
var _error, _success, _data, __get__type;
function APIEvent (type, data, error) {
super(type);
if (data == undefined) {
data = null;
}
if (error == undefined) {
error = null;
}
if (((!error) || (error == "")) || (error == ERROR_NONE)) {
_error = ERROR_NONE;
_success = true;
} else {
_error = error;
_success = false;
}
if (data) {
_data = data;
} else {
_data = {};
}
}
function clone() {
return(new com.newgrounds.APIEvent(__get__type(), _data, _error));
}
function get success() {
return(_success);
}
function get data() {
return(_data);
}
function get error() {
return(_error);
}
static var COMMAND_COMPLETE = "commandComplete";
static var MEDAL_UNLOCK_CONFIRMED = "medalUnlockConfirmed";
static var ICON_LOADED = "iconLoaded";
static var BRIDGE_EVENT_RECEIVED = "brdigeEventReceived";
static var API_CONNECTED = "movieConnected";
static var LOG = "log";
static var MEDAL_UNLOCKED = "medalUnlocked";
static var SCORES_LOADED = "scoresLoaded";
static var SCORE_POSTED = "scorePosted";
static var QUERY_COMPLETE = "queryComplete";
static var FILE_LOADED = "fileLoaded";
static var FILE_SAVED = "fileSaved";
static var FILE_DELETED = "fileDeleted";
static var FILE_REQUESTED = "fileRequested";
static var VOTE_COMPLETE = "voteComplete";
static var USER_SIGNED_IN = "userSignedIn";
static var ERROR_NONE = "noError";
static var ERROR_UNKNOWN = "unknownError";
static var ERROR_COMMAND_FAILED = "commandFailed";
static var ERROR_NOT_CONNECTED = "notConnected";
static var ERROR_INVALID_ARGUMENT = "invalidArgument";
static var ERROR_TIMED_OUT = "timedOut";
static var ERROR_BAD_FILE = "badFile";
static var ERROR_BAD_RESPONSE = "badResponse";
static var ERROR_SENDING_COMMAND = "errorSendingCommand";
static var ERROR_HOST_BLOCKED = "hostBlocked";
static var ERROR_ALREADY_VOTED = "alreadyVoted";
static var ERROR_NOT_LOGGED_IN = "notLoggedIn";
static var ERROR_WRONG_ENCRYPTION_KEY = "wrongEncryptionKey";
static var ERROR_SIGN_IN_FAILED = "signInFailed";
}
Symbol 31 MovieClip [__Packages.com.newgrounds.APIConnection] Frame 0
class com.newgrounds.APIConnection
{
var _hostURL, hostDomain, sessionId, publisherId, encryptionKey, userEmail, username, userId, userpageFormat, initialized;
function APIConnection () {
reset();
}
function get hostURL() {
return(_hostURL);
}
function set hostURL(value) {
_hostURL = value;
hostDomain = null;
if (_hostURL) {
var _local2 = _hostURL.split("/");
if ((_local2[0] != "file:") && (_hostURL != "localhost")) {
hostDomain = _local2.splice(0, 3).join("/");
}
}
if (!hostDomain) {
hostDomain = "localhost";
}
//return(hostURL);
}
function get sandboxType() {
return(System.security.sandboxType);
}
function get isNetworkHost() {
switch (sandboxType) {
case "localWithFile" :
case "localWithNetwork" :
case "localTrusted" :
case "application" :
return(false);
case "remote" :
}
return(true);
}
function get hasUserSession() {
return(((sessionId != null) && (sessionId != "")) && (publisherId != 0));
}
function get connected() {
return(connectionState == CONNECTED);
}
function reset() {
connectionState = NOT_CONNECTED;
encryptionKey = null;
sessionId = null;
userEmail = null;
username = null;
userId = 0;
userpageFormat = 0;
}
function assertInitialized() {
if (!initialized) {
com.newgrounds.Logger.logError("You must initialized the API using API.connect() before using this command.");
return(false);
}
return(true);
}
function assertConnected() {
if ((!connectionState) == CONNECTED) {
com.newgrounds.Logger.logError("You must establish a connection using API.connect() before using this command.");
return(false);
}
return(true);
}
function sendSimpleCommand(command, completeHandler, parameters, secureParameters) {
if (parameters == undefined) {
parameters = null;
}
if (secureParameters == undefined) {
secureParameters = null;
}
var _local2 = new com.newgrounds.APICommand(command);
_local2.__set__parameters(parameters);
_local2.__set__secureParameters(secureParameters);
if (completeHandler != null) {
_local2.addEventListener(com.newgrounds.APIEvent.COMMAND_COMPLETE, completeHandler);
}
_local2.send(this);
}
function sendCommand(command) {
command.send(this);
}
function loadInBrowser(command, newWindow, parameters) {
if (newWindow == undefined) {
newWindow = true;
}
if (parameters == undefined) {
parameters = null;
}
var _local2 = new com.newgrounds.APICommand(command);
_local2.__set__parameters(parameters);
_local2.loadInBrowser(this, newWindow);
}
static var NOT_CONNECTED = "notConnected";
static var CONNECTING = "connecting";
static var CONNECTED = "connected";
var connectionState = NOT_CONNECTED;
var apiURL = "http://www.ngads.com/gateway_v2.php";
}
Symbol 25 MovieClip [__Packages.com.newgrounds.APIEventDispatcher] Frame 0
class com.newgrounds.APIEventDispatcher extends com.newgrounds.EventDispatcher
{
static var _globalDispatcher;
function APIEventDispatcher () {
super();
}
static function get globalDispatcher() {
return(_globalDispatcher);
}
static function set globalDispatcher(value) {
_globalDispatcher = value;
//return(globalDispatcher);
}
static function initEventQueue() {
setInterval(runEventQueue, 50);
return([]);
}
function dispatchEvent(event) {
_eventQueue.push({dispatcher:this, event:event});
return(true);
}
function actualDispatchEvent(event) {
var _local3 = super.dispatchEvent(event);
if (_globalDispatcher && (this != _globalDispatcher)) {
_globalDispatcher.dispatchEvent(event);
}
}
static function runEventQueue(event) {
var _local3 = _eventQueue.length;
if (_local3) {
var _local4 = _eventQueue;
_eventQueue = [];
var _local1 = 0;
while (_local1 < _local3) {
var _local2 = _local4[_local1];
_local2.dispatcher.actualDispatchEvent(_local2.event);
_local1++;
}
}
}
static var _eventQueue = initEventQueue();
}
Symbol 28 MovieClip [__Packages.com.newgrounds.encoders.BaseN] Frame 0
class com.newgrounds.encoders.BaseN
{
var _hash, _base, _reverseHash;
function BaseN (hash) {
if (hash) {
_hash = hash;
} else {
_hash = DEFAULT_HASH;
}
_base = _hash.length;
_reverseHash = new Object();
var _local2 = 0;
while (_local2 < _hash.length) {
_reverseHash[_hash.charAt(_local2)] = _local2;
_local2++;
}
}
function encodeUint(number, minimumChars) {
if (minimumChars == undefined) {
minimumChars = 1;
}
var _local2 = "";
var _local3 = number;
while (_local3 != 0) {
_local2 = _hash.charAt(_local3 % _base) + _local2;
_local3 = _local3 / _base;
_local3 = int(_local3);
}
while (_local2.length < minimumChars) {
_local2 = _hash.charAt(0) + _local2;
}
return(_local2);
}
function decodeUint(encodedNumber) {
var _local3 = 0;
var _local2 = 0;
while (_local2 < encodedNumber.length) {
_local3 = _local3 * _base;
_local3 = _local3 + _reverseHash[encodedNumber.charAt(_local2)];
_local2++;
}
return(_local3);
}
static var DEFAULT_HASH = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/";
}
Symbol 34 MovieClip [__Packages.com.newgrounds.APICommand] Frame 0
class com.newgrounds.APICommand extends com.newgrounds.APIEventDispatcher
{
static var _throttleTimestamp, bridge;
var _command, _parameters, _secureParameters, _hasTimeout, _preventCache, _files, _loader, _timeoutTimer, dispatchEvent;
function APICommand (command) {
super();
_command = command;
_parameters = new Object();
_secureParameters = new Object();
_hasTimeout = true;
}
static function stopPendingCommands() {
for (var _local2 in _pendingCommands) {
var _local1 = _pendingCommands[_local2];
_local1.close();
}
_pendingCommands = [];
}
static function onThrottleTimer(event) {
if ((getTimer() - _throttleTimestamp) >= THROTTLE_INTERVAL) {
_throttleCount = 0;
_throttleCount = 0;
while (_commandQueue.length && (_throttleCount < THROTTLE_THRESHOLD)) {
var _local1 = _commandQueue.shift();
_local1.command.send(_local1.connection);
_throttleCount++;
}
}
}
static function encryptHex(hexValue) {
var _local4 = hexValue.length % 6;
var _local3 = "";
var _local1 = 0;
while (_local1 < hexValue.length) {
_local3 = _local3 + _encryptor.encodeUint(int("0x" + hexValue.substr(_local1, 6)), 4);
_local1 = _local1 + 6;
}
return(_local4.toString() + _local3);
}
function get command() {
return(_command);
}
function set command(value) {
_command = value;
//return(command);
}
function get hasTimeout() {
return(_hasTimeout);
}
function set hasTimeout(val) {
_hasTimeout = val;
//return(hasTimeout);
}
function get parameters() {
return(_parameters);
}
function set parameters(object) {
_parameters = new Object();
if (object) {
for (var _local3 in object) {
_parameters[_local3] = object[_local3];
}
}
//return(parameters);
}
function get preventCache() {
return(_preventCache);
}
function set preventCache(value) {
_preventCache = value;
//return(preventCache);
}
function get secureParameters() {
return(_secureParameters);
}
function set secureParameters(object) {
_secureParameters = new Object();
if (object) {
for (var _local3 in object) {
_secureParameters[_local3] = object[_local3];
}
}
//return(secureParameters);
}
function get hasSecureParameters() {
for (var _local2 in _secureParameters) {
return(true);
}
return(false);
}
function addFile(filename, data, dataField, contentType) {
if (contentType == undefined) {
contentType = "application/octet-stream";
}
if (!_files) {
_files = new Object();
}
var _local3 = {filename:filename, data:data, dataField:dataField, contentType:contentType};
_files[filename] = _local3;
}
function removeFile(filename) {
if (_files) {
delete _files[filename];
}
}
function clearFiles() {
_files = null;
}
function close() {
if (_loader) {
clearInterval(_timeoutTimer);
var _local2 = 0;
while (_local2 < _pendingCommands.length) {
if (_pendingCommands[_local2] == this) {
_pendingCommands.splice(_local2, 1);
break;
}
_local2++;
}
_loader = null;
}
}
function loadInBrowser(connection, newWindow) {
_parameters.command_id = _command;
_parameters.tracker_id = (connection.apiId ? (connection.apiId) : 1);
if (connection.debug) {
_parameters.debug = 1;
}
var _local3 = (connection.apiURL + "?host=") + escape(connection.hostDomain);
for (var _local4 in _parameters) {
_local3 = _local3 + ((("&" + escape(_local4)) + "=") + escape(_parameters[_local4]));
}
var _local6;
if (newWindow) {
_local6 = "_blank";
} else {
_local6 = "_top";
}
_root.getURL(_local3, _local6);
}
function send(connection) {
if (_throttleCount >= THROTTLE_THRESHOLD) {
_commandQueue.push({connection:connection, command:this});
} else {
sendInternal(connection);
}
}
function sendInternal(connection) {
var _local4;
_local4 = new LoadVars();
_local4.command_id = _command;
_local4.tracker_id = connection.apiId;
if (connection.debug) {
_local4.debug = 1;
}
if (_preventCache) {
_local4.seed = Math.random();
}
var _local2;
var _local3;
var _local7;
for (_local2 in _parameters) {
_local3 = _parameters[_local2];
if (_local3 != null) {
if (typeof(_local3) == "boolean") {
_local4[_local2] = int(_local3);
} else {
_local4[_local2] = _local3;
}
}
}
if (hasSecureParameters) {
var _local6 = new Object();
for (_local2 in _secureParameters) {
_local3 = _secureParameters[_local2];
if (_local3 != null) {
if (typeof(_local3) == "boolean") {
_local6[_local2] = int(_local3);
} else {
_local6[_local2] = _local3;
}
}
}
var _local8 = "";
_local7 = 0;
while (_local7 < 16) {
_local8 = _local8 + ENCRYPTOR_RADIX.charAt(int(Math.random() * ENCRYPTOR_RADIX.length));
_local7++;
}
_local4.command_id = "securePacket";
_local6.command_id = _command;
_local6.as_version = 3;
_local6.session_id = connection.sessionId;
_local6.user_email = connection.userEmail;
_local6.publisher_id = connection.publisherId;
_local6.seed = _local8;
var _local13 = com.newgrounds.crypto.MD5.hash(_local8);
var _local11 = com.newgrounds.crypto.RC4.encrypt(com.newgrounds.encoders.json.JSON.encode(_local6), connection.encryptionKey);
_local4.secure = encryptHex(_local13 + _local11);
}
com.newgrounds.Logger.logInternal("Sending packet:", _local4);
var _local12;
_local12 = "application/x-www-form-urlencoded";
for (_local2 in _local4) {
if (typeof(_local4[_local2]) == "object") {
_local4[_local2] = com.newgrounds.encoders.json.JSON.encode(_local4[_local2]);
}
}
if (_files) {
for (var _local10 in _files) {
var _local5 = _files[_local10];
if (typeof(_local5.data) == "string") {
_local4[_local10] = _local5.data;
} else {
_local4[_local10] = com.newgrounds.encoders.json.JSON.encode(_local5.data);
}
}
}
_pendingCommands.push(this);
_throttleCount++;
_throttleTimestamp = getTimer();
startLoader(connection.apiURL, _local4, _local12);
}
function startLoader(url, data, contentType) {
_loader = LoadVars(data);
_loader.onData = as2CompleteHandler;
_loader.contentType = contentType;
_loader.sendAndLoad(url, _loader, "POST");
if (_hasTimeout) {
setInterval(this, onTimeout, TIMEOUT_INTERVAL);
}
}
function as2CompleteHandler(data) {
var _local3;
var _local2 = 0;
while (_local2 < _pendingCommands.length) {
if (_pendingCommands[_local2]._loader == this) {
_local3 = _pendingCommands[_local2];
break;
}
_local2++;
}
_local3.onComplete(data);
}
function onTimeout(event) {
close();
com.newgrounds.Logger.logError("Command timed out.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_TIMED_OUT));
}
function onError(error) {
com.newgrounds.Logger.logError("Error when sending command:", error);
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_UNKNOWN));
close();
}
function onComplete(data) {
com.newgrounds.Logger.logInternal("Received packet:", data);
try {
if ((!data) || (data == "")) {
throw new Error();
}
var _local2 = com.newgrounds.encoders.json.JSON.decode(data);
if (!_local2) {
throw new Error();
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, _local2, ((_local2 && (_local2.success)) ? (com.newgrounds.APIEvent.ERROR_NONE) : (com.newgrounds.APIEvent.ERROR_COMMAND_FAILED))));
if (bridge) {
bridge.sendEvent(_local2.command_id, _local2);
}
} catch(e) {
com.newgrounds.Logger.logError("Invalid response returned from server: " + data);
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_BAD_RESPONSE));
}
close();
}
static var TIMEOUT_INTERVAL = 10000;
static var THROTTLE_INTERVAL = 10050;
static var THROTTLE_TICK_INTERVAL = 1000;
static var THROTTLE_THRESHOLD = 24;
static var _throttleCount = 0;
static var _commandQueue = [];
static var _throttleTimer = setInterval(onThrottleTimer, THROTTLE_TICK_INTERVAL);
static var ENCRYPTOR_RADIX = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X";
static var _encryptor = new com.newgrounds.encoders.BaseN(ENCRYPTOR_RADIX);
static var _pendingCommands = [];
static var CRLF = "\r\n";
}
Symbol 42 MovieClip [__Packages.com.newgrounds.encoders.ImageScanner] Frame 0
class com.newgrounds.encoders.ImageScanner
{
var _baseN, _encodeAlpha, _maxPerChannel;
function ImageScanner (hashLength, charsPerPixel) {
if (hashLength) {
_hash = DEFAULT_HASH.substr(0, hashLength);
}
_baseN = new com.newgrounds.encoders.BaseN(_hash);
if (charsPerPixel) {
_charsPerPixel = charsPerPixel;
}
encodeAlpha = (false);
}
function get encodeAlpha() {
return(_encodeAlpha);
}
function set encodeAlpha(v) {
_encodeAlpha = v;
_maxPerChannel = int(Math.pow(_hash.length, _charsPerPixel / (_encodeAlpha ? 4 : 3)));
if (_maxPerChannel > 256) {
_maxPerChannel = 256;
}
//return(encodeAlpha);
}
function encode(source, callbackFunction, callbackObject) {
var _local4 = {callbackFunction:callbackFunction, callbackObject:callbackObject, source:source, x:0, y:0, output:null};
var _local2 = source.width.toString();
var _local3 = source.height.toString();
while (_local2.length < 3) {
_local2 = "0" + _local2;
}
while (_local3.length < 3) {
_local3 = "0" + _local3;
}
_local4.output = _local2 + _local3;
var _local6 = setInterval(this, "doEncode", WORK_INTERVAL, _local4);
_local4.interval = _local6;
}
function decode(source, callbackFunction, callbackObject) {
var _local4 = {callbackFunction:callbackFunction, callbackObject:callbackObject, source:source, i:6, x:0, y:0, output:null};
var _local3 = source.substr(0, 3);
var _local2 = source.substr(3, 3);
while (_local3.charAt(0) == "0") {
_local3 = _local3.substr(1);
}
while (_local2.charAt(0) == "0") {
_local2 = _local2.substr(1);
}
var _local7 = int(_local3);
var _local8 = int(_local2);
_local4.output = new flash.display.BitmapData(_local7, _local8, _encodeAlpha);
var _local6 = setInterval(this, "doDecode", WORK_INTERVAL, _local4);
_local4.interval = _local6;
}
function doEncode(state) {
var _local3 = getTimer();
while ((state.y < state.source.height) && ((getTimer() - _local3) < WORK_INTERVAL)) {
state.output = state.output + encodePixel(state.source.getPixel32(state.x, state.y));
state.x++;
if (state.x == state.source.width) {
state.x = 0;
state.y++;
}
}
if (state.y == state.source.height) {
clearInterval(state.interval);
state.callbackFunction.call(state.callbackObject, state.output);
}
}
function doDecode(state) {
var _local4 = getTimer();
while ((state.y < state.output.height) && ((getTimer() - _local4) < WORK_INTERVAL)) {
var _local3 = decodePixel(state.source.substr(state.i, _charsPerPixel));
state.output.setPixel32(state.x, state.y, _local3);
state.i = state.i + _charsPerPixel;
state.x++;
if (state.x == state.output.width) {
state.x = 0;
state.y++;
}
}
if (state.y == state.output.height) {
clearInterval(state.interval);
state.callbackFunction.call(state.callbackObject, state.output);
}
}
function encodePixel(pixel) {
var _local3 = (pixel >> 24) & 255;
var _local4 = (pixel >> 16) & 255;
var _local5 = (pixel >> 8) & 255;
var _local2 = pixel & 255;
_local3 = int((_local3 / 256) * _maxPerChannel);
_local4 = int((_local4 / 256) * _maxPerChannel);
_local5 = int((_local5 / 256) * _maxPerChannel);
_local2 = int((_local2 / 256) * _maxPerChannel);
var _local7 = (((_local4 * _maxPerChannel) * _maxPerChannel) + (_local5 * _maxPerChannel)) + _local2;
if (_encodeAlpha) {
_local7 = _local7 + (((_local3 * _maxPerChannel) * _maxPerChannel) * _maxPerChannel);
}
return(_baseN.encodeUint(_local7, _charsPerPixel));
}
function decodePixel(encodedPixel) {
var _local3 = 255;
var _local5;
var _local6;
var _local4;
var _local7 = 0;
var _local2 = _baseN.decodeUint(encodedPixel);
_local4 = _local2 % _maxPerChannel;
_local2 = _local2 / int(_maxPerChannel);
_local6 = _local2 % _maxPerChannel;
_local2 = _local2 / int(_maxPerChannel);
_local5 = _local2 % _maxPerChannel;
_local2 = _local2 / int(_maxPerChannel);
if (_encodeAlpha) {
_local3 = _local2 % _maxPerChannel;
_local2 = _local2 / int(_maxPerChannel);
}
return((((_local3 << 24) | (_local5 << 16)) | (_local6 << 8)) | _local4);
}
static var DEFAULT_HASH = "0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ<>?:;-_=+()!&";
var _hash = DEFAULT_HASH;
var _charsPerPixel = 2;
static var WORK_INTERVAL = 33.3333333333333;
}
Symbol 43 MovieClip [__Packages.com.newgrounds.SaveFile] Frame 0
class com.newgrounds.SaveFile extends com.newgrounds.APIEventDispatcher
{
static var _currentFile;
var _iconLoader, _group, _keys, _ratings, _numVotes, _name, _description, _id, _data, _dataLoader, _fileSize, _readOnly, _draft, _authorId, _authorName, _views, _createdDate, _modifiedDate, dispatchEvent, _encodedIcon, _encodedData, _encoderQueue, _encoding, _dataLoaded, _encodingParent, _encodingProperty, _dataURL;
function SaveFile (group) {
super();
_iconLoader = new com.newgrounds.BitmapLoader(DEFAULT_ICON, null);
_group = group;
_keys = {};
_ratings = {};
_numVotes = {};
}
static function get currentFile() {
return(_currentFile);
}
static function fromObject(group, fileData) {
var _local3 = new com.newgrounds.SaveFile(group);
_local3._name = fileData.filename;
_local3._description = fileData.description;
_local3._id = fileData.save_id;
_local3._authorId = fileData.user_id;
_local3._authorName = fileData.user_name;
_local3._createdDate = fileData.created;
_local3._modifiedDate = fileData.last_update;
_local3._views = fileData.views;
if (fileData.thumb && (fileData.thumb != "")) {
_local3._iconLoader.__set__url(_imageFilePath + fileData.thumb);
}
_local3._dataURL = _saveFilePath + fileData.file;
_local3._fileSize = fileData.file_size;
_local3._approved = fileData.status != STATUS_UNAPPROVED;
_local3._readOnly = false;
_local3._public = (fileData.status != STATUS_PRIVATE) && (fileData.status != STATUS_UNAPPROVED);
for (var _local8 in fileData.keys) {
var _local6 = fileData.keys[_local8];
var _local4 = group.getKeyById(_local6.id);
if (_local4) {
_local3._keys[_local4.__get__name()] = _local4.validateValue(_local6.value);
}
}
for (var _local9 in fileData.ratings) {
var _local5 = fileData.ratings[_local9];
var _local2 = group.getRatingById(_local5.id);
if (_local2) {
_local3._ratings[_local2.__get__name()] = _local2.validateValue(_local5.score);
_local3._numVotes[_local2.__get__name()] = int(_local5.votes);
}
}
return(_local3);
}
function get group() {
return(_group);
}
function get name() {
return(_name);
}
function set name(val) {
_name = val;
//return(name);
}
function get description() {
return(_description);
}
function set description(val) {
_description = val;
//return(description);
}
function get id() {
return(_id);
}
function get data() {
return(_data);
}
function set data(val) {
_data = val;
//return(data);
}
function get bytesLoaded() {
if (_data) {
return(bytesTotal);
}
if (!_dataLoader) {
return(0);
}
return(_dataLoader.getBytesLoaded());
}
function get bytesTotal() {
return(_fileSize);
}
function get readOnly() {
return(_readOnly);
}
function get draft() {
return(_draft);
}
function set draft(v) {
_draft = v;
//return(draft);
}
function get authorId() {
return(_authorId);
}
function get authorName() {
return(_authorName);
}
function get keys() {
return(_keys);
}
function get ratings() {
return(_ratings);
}
function get numVotes() {
return(_numVotes);
}
function get views() {
return(_views);
}
function get createdDate() {
return(_createdDate);
}
function get updatedDate() {
return(_modifiedDate);
}
function toString() {
return("Save File: " + _name);
}
function get icon() {
return(_iconLoader.__get__bitmapData());
}
function set icon(v) {
createIcon(v);
//return(icon);
}
function get iconLoaded() {
return(_iconLoader.__get__loaded());
}
function createIcon(source) {
var _local9 = new flash.display.BitmapData(ICON_WIDTH, ICON_HEIGHT, false, 0);
var _local7;
var _local6;
var _local10 = 0;
var _local8 = 0;
if (source instanceof flash.display.BitmapData) {
_local7 = source.width;
_local6 = source.height;
} else if (source instanceof MovieClip) {
var _local2 = MovieClip(source).getBounds(source);
_local7 = _local2.xMax - _local2.xMin;
_local6 = _local2.yMax - _local2.yMin;
_local10 = _local2.xMin;
_local8 = _local2.yMin;
}
var _local4 = new flash.geom.Matrix();
var _local5;
_local5 = Math.min(ICON_WIDTH / _local7, ICON_HEIGHT / _local6);
_local4.translate(-_local10, -_local8);
_local4.scale(_local5, _local5);
_local4.translate((ICON_WIDTH - (_local7 * _local5)) / 2, (ICON_HEIGHT - (_local6 * _local5)) / 2);
_local9.draw(source, _local4);
_iconLoader.__set__bitmapData(_local9);
}
function attachIcon(parent) {
if (_iconLoader) {
return(_iconLoader.attachBitmap(parent));
}
com.newgrounds.Logger.logError("No icon available for this sumbission.");
return(null);
}
function deleteFile() {
if (!_group.__get__connection().__get__hasUserSession()) {
com.newgrounds.Logger.logError("The user must be logged-in to delete a file.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_DELETED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN));
return(undefined);
}
if (!_id) {
com.newgrounds.Logger.logError("The file does not exist.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_DELETED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN));
return(undefined);
}
var _local2 = new com.newgrounds.APICommand("deleteSaveFile");
_local2.__get__secureParameters().save_id = _id;
_local2.addEventListener(com.newgrounds.APIEvent.COMMAND_COMPLETE, {target:this, func:onFileDeleted});
_group.__get__connection().sendCommand(_local2);
}
function save() {
if (!_group.__get__connection().__get__hasUserSession()) {
com.newgrounds.Logger.logError("The user must be logged-in to save a file.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN));
return(undefined);
}
com.newgrounds.BitmapLoader._cacheSeed++;
_currentFile = this;
if (iconLoaded) {
ICON_IMAGE_SCANNER.encode(icon, onIconEncoded, this);
} else {
encodeData(true);
}
}
function onIconEncoded(encodedIcon) {
_encodedIcon = encodedIcon;
encodeData(true);
}
function doSave() {
var _local4 = new com.newgrounds.APICommand("saveFile");
_local4.__get__secureParameters().group = _group.id;
_local4.__get__secureParameters().user_name = _group.__get__connection().username;
_local4.__get__secureParameters().filename = _name;
_local4.__get__secureParameters().description = _description;
if (_draft) {
_local4.__get__secureParameters().draft = true;
}
if (_id && (!_readOnly)) {
_local4.__get__secureParameters().overwrite = 1;
_local4.__get__secureParameters().save_id = _id;
}
var _local8 = [];
for (var _local9 in _keys) {
var _local2 = _group.getKey(_local9);
if (_local2) {
_local8.push({id:_local2.__get__id(), value:_local2.validateValue(_keys[_local9])});
} else {
com.newgrounds.Logger.logError(((("No key named \"" + _local9) + "\" in save group \"") + _group.__get__name()) + "\".");
}
}
_local4.__get__secureParameters().keys = _local8;
var _local7 = [];
for (var _local10 in _ratings) {
var _local3 = _group.getRating(_local10);
if (_local3) {
_local7.push({id:_local3.__get__id(), value:_local3.validateValue(_ratings[_local10])});
} else {
com.newgrounds.Logger.logError(((("No rating named \"" + _local10) + "\" in save group \"") + _group.__get__name()) + "\".");
}
}
_local4.__get__secureParameters().ratings = _local7;
if (typeof(_encodedData) == "string") {
_local4.addFile("file", _encodedData, "file");
} else {
_local4.addFile("file", com.newgrounds.encoders.json.JSON.encode(_encodedData), "file");
}
if (iconLoaded) {
_local4.addFile("thumbnail", _encodedIcon, "thumbnail");
}
_local4.addEventListener(com.newgrounds.APIEvent.COMMAND_COMPLETE, {target:this, func:onSaveComplete});
_group.__get__connection().sendCommand(_local4);
}
function encodeData(encode) {
_encoderQueue = [];
_encoding = encode;
if (encode) {
_encodedData = _data;
preEncodeObject(this, "_encodedData");
} else {
preEncodeObject(this, "_data");
}
encodeObject();
}
function preEncodeObject(parent, property) {
var _local3 = parent[property];
var _local5;
try {
if (_encoding) {
_local5 = _local3 instanceof flash.display.BitmapData;
} else {
_local5 = _local3.type == "__bitmap";
}
} catch(error) {
}
var _local2 = _local3;
var _local8;
if (_local5) {
_encoderQueue.push({parent:parent, property:property});
} else if ((typeof(_local3) == "object") && (!_local8)) {
if (_encoding) {
if (_local3 instanceof Array) {
_local2 = [];
} else {
_local2 = {};
}
for (var _local4 in _local3) {
_local2[_local4] = _local3[_local4];
}
parent[property] = _local2;
}
for (var _local4 in _local2) {
preEncodeObject(_local2, _local4);
}
}
}
function encodeObject() {
if (!_encoderQueue.length) {
if (_encoding) {
doSave();
} else {
_dataLoaded = true;
checkLoadComplete();
}
return(undefined);
}
var _local6 = _encoderQueue.pop();
var _local4 = _local6.parent;
var _local3 = _local6.property;
var _local2 = _local4[_local3];
var _local5;
if (_encoding) {
_local5 = {type:"__bitmap", width:_local2.width, height:_local2.height, transparent:_local2.transparent};
_local4[_local3] = _local5;
_encodingParent = _local5;
_encodingProperty = "data";
DATA_IMAGE_SCANNER.__set__encodeAlpha(_local2.transparent);
DATA_IMAGE_SCANNER.encode(flash.display.BitmapData(_local2), encodeBitmapComplete, this);
} else {
_encodingParent = _local4;
_encodingProperty = _local3;
DATA_IMAGE_SCANNER.__set__encodeAlpha(_local2.transparent);
DATA_IMAGE_SCANNER.decode(String(_local2.data), encodeBitmapComplete, this);
}
}
function encodeBitmapComplete(data) {
_encodingParent[_encodingProperty] = data;
encodeObject();
}
function load() {
_currentFile = this;
_dataLoaded = false;
_data = null;
if (!iconLoaded) {
_iconLoader.addEventListener(com.newgrounds.APIEvent.ICON_LOADED, {target:this, func:onIconLoaded});
_iconLoader.load();
}
_dataLoader = new LoadVars();
var file = this;
_dataLoader.onData = function (data) {
file.onDataLoaded(data);
};
_dataLoader.load((_dataURL + "&random=") + Math.random());
}
function onIconLoaded(event) {
if ((!event.__get__success()) && (_iconLoader.__get__url())) {
com.newgrounds.Logger.logWarning("Unable to load the icon for this save file.");
}
_iconLoader.removeEventListener(com.newgrounds.APIEvent.ICON_LOADED, onIconLoaded);
checkLoadComplete();
}
function checkLoadComplete() {
if (_dataLoaded && (iconLoaded)) {
com.newgrounds.Logger.logMessage("Data loaded.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this));
}
}
function onDataLoaded(data) {
try {
if (data) {
if (data.charAt(0) == "{") {
_data = com.newgrounds.encoders.json.JSON.decode(String(data));
} else {
_data = String(data);
}
encodeData(false);
}
} catch(error:Error) {
com.newgrounds.Logger.logError("Error while loading data:", error);
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this, com.newgrounds.APIEvent.ERROR_BAD_FILE));
}
}
function onDataError(error) {
com.newgrounds.Logger.logError("Unable to load data:", error);
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this, com.newgrounds.APIEvent.ERROR_BAD_FILE));
}
function onSaveComplete(event) {
if (event.__get__success()) {
com.newgrounds.Logger.logMessage(("File \"" + _name) + "\" saved!");
if (event.__get__data()) {
_id = event.__get__data().save_id;
_dataURL = unescape(event.__get__data().file_url);
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, this));
} else {
com.newgrounds.Logger.logError(("Error saving file \"" + _name) + "\":", event.__get__error());
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, this, event.__get__error()));
}
}
function sendVote(ratingName, vote) {
var _local2 = _group.getRating(ratingName);
if (!_local2) {
com.newgrounds.Logger.logError(("No save rating named \"" + ratingName) + "\" exists for this save group.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.VOTE_COMPLETE, {}, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT));
return(undefined);
}
vote = _local2.validateValue(vote);
if (isNaN(vote)) {
com.newgrounds.Logger.logError(((((((("Invalid vote (" + vote) + "). ") + ratingName) + " allows a range of ") + _local2.__get__minimum()) + "-") + _local2.__get__maximum()) + ".");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.VOTE_COMPLETE, {}, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT));
return(undefined);
}
com.newgrounds.Logger.logMessage(((((("Voting " + vote) + " for ") + ratingName) + " on ") + _name) + "...");
_group.__get__connection().sendSimpleCommand("rateSaveFile", {target:this, func:onVoteComplete}, null, {group:_group.__get__id(), save_id:_id, rating_id:_local2.__get__id(), vote:vote});
}
function onVoteComplete(event) {
var _local2 = event.__get__error();
if (event.__get__data().already_voted) {
com.newgrounds.Logger.logError("Vote failed. You've already voted on this rating today.");
_local2 = com.newgrounds.APIEvent.ERROR_ALREADY_VOTED;
}
if (_local2 == com.newgrounds.APIEvent.ERROR_NONE) {
var _local3 = _group.getRatingById(event.__get__data().rating_id);
if (_local3) {
_ratings[_local3.__get__name()] = _local3.validateValue(event.__get__data().score);
}
com.newgrounds.Logger.logMessage("Vote complete!");
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.VOTE_COMPLETE, this, _local2));
}
function onFileDeleted(event) {
if (event.__get__success()) {
_id = 0;
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_DELETED, this, event.__get__error()));
}
function clone() {
var _local3 = new com.newgrounds.SaveFile(_group);
_local3._data = _data;
_local3._description = _description;
_local3._draft = _draft;
_local3._fileSize = _fileSize;
_local3._iconLoader.__set__bitmapData(_iconLoader.bitmapData);
var _local2;
for (_local2 in _keys) {
_local3._keys[_local2] = _keys[_local2];
}
for (_local2 in _ratings) {
_local3._ratings[_local2] = _ratings[_local2];
}
for (_local2 in _numVotes) {
_local3._numVotes[_local2] = _numVotes[_local2];
}
_local3._name = _name;
return(_local3);
}
static var ICON_WIDTH = 90;
static var ICON_HEIGHT = 90;
static var DEFAULT_ICON = new flash.display.BitmapData(ICON_WIDTH, ICON_HEIGHT, false, 0);
static var STATUS_PRIVATE = 0;
static var STATUS_SHARED = 1;
static var STATUS_UNAPPROVED = 2;
static var STATUS_APPROVED = 3;
static var _imageFilePath = "";
static var _saveFilePath = "";
static var ICON_IMAGE_SCANNER = new com.newgrounds.encoders.ImageScanner();
static var DATA_IMAGE_SCANNER = new com.newgrounds.encoders.ImageScanner(64, 6);
}
Symbol 41 MovieClip [__Packages.com.newgrounds.SaveGroup] Frame 0
class com.newgrounds.SaveGroup
{
var _connection, _id, _name, _type, _keysArray, _ratingsArray, _keys, _ratings;
function SaveGroup (connection, name, id, type, keys, ratings) {
_connection = connection;
_id = id;
_name = name;
_type = type;
_keysArray = keys;
_ratingsArray = ratings;
_keys = new Object();
_ratings = new Object();
var _local11;
for (var _local7 in keys) {
var _local2 = keys[_local7];
_keys[_local2.__get__name()] = _local2;
}
for (var _local6 in ratings) {
var _local3 = ratings[_local6];
_ratings[_local3.__get__name()] = _local3;
}
}
function get connection() {
return(_connection);
}
function get name() {
return(_name);
}
function get type() {
return(_type);
}
function get id() {
return(_id);
}
function get keys() {
return(_keysArray);
}
function get ratings() {
return(_ratingsArray);
}
function getKey(name) {
return(_keys[name]);
}
function getRating(name) {
return(_ratings[name]);
}
function getKeyById(id) {
for (var _local4 in _keys) {
var _local2 = _keys[_local4];
if (_local2.__get__id() == id) {
return(_local2);
}
}
return(null);
}
function getRatingById(id) {
for (var _local4 in _ratings) {
var _local2 = _ratings[_local4];
if (_local2.__get__id() == id) {
return(_local2);
}
}
return(null);
}
function toString() {
return((((("SaveGroup: " + name) + " Keys: ") + _keysArray) + " Ratings: ") + _ratingsArray);
}
static var TYPE_SYSTEM = 0;
static var TYPE_PRIVATE = 1;
static var TYPE_PUBLIC = 2;
static var TYPE_MODERATED = 3;
}
Symbol 39 MovieClip [__Packages.com.newgrounds.SaveKey] Frame 0
class com.newgrounds.SaveKey
{
var _name, _id, _type;
function SaveKey (name, id, type) {
_name = name;
_id = id;
_type = type;
}
function get name() {
return(_name);
}
function get id() {
return(_id);
}
function get type() {
return(_type);
}
function validateValue(value) {
switch (_type) {
case TYPE_INTEGER :
value = Number(value);
if (!isNaN(value)) {
var _local3 = int(value);
if (_local3 != value) {
com.newgrounds.Logger.logWarning(((((("Float value " + value) + " given for integer key \"") + _name) + "\". Clamping to ") + _local3) + ".");
}
return(_local3);
}
break;
case TYPE_FLOAT :
value = Number(value);
if (!isNaN(value)) {
return(isNaN(Number(value)));
}
break;
case TYPE_BOOLEAN :
return(Boolean(value) && (int(value) != 0));
case TYPE_STRING :
return((value ? (value.toString()) : ""));
}
return(null);
}
function toString() {
return(_name);
}
static var TYPE_FLOAT = 1;
static var TYPE_INTEGER = 2;
static var TYPE_STRING = 3;
static var TYPE_BOOLEAN = 4;
}
Symbol 40 MovieClip [__Packages.com.newgrounds.SaveRating] Frame 0
class com.newgrounds.SaveRating
{
var _name, _id, _isFloat, _minimum, _maximum;
function SaveRating (name, id, isFloat, minimum, maximum) {
_name = name;
_id = id;
_isFloat = isFloat;
_minimum = minimum;
_maximum = maximum;
}
function get name() {
return(_name);
}
function get id() {
return(_id);
}
function get isFloat() {
return(_isFloat);
}
function get minimum() {
return(_minimum);
}
function get maximum() {
return(_maximum);
}
function validateValue(value) {
var _local2 = Number(value);
if (isNaN(_local2)) {
com.newgrounds.Logger.logError(("Invalid value for rating \"" + _name) + "\".");
return(NaN);
}
if (_local2 < _minimum) {
com.newgrounds.Logger.logWarning(((((_local2 + " is out of acceptable range for rating \"") + _name) + "\". Clamping to ") + _minimum) + ".");
return(_minimum);
}
if (_local2 > _maximum) {
com.newgrounds.Logger.logWarning(((((_local2 + " is out of acceptable range for rating \"") + _name) + "\". Clamping to ") + _maximum) + ".");
return(_maximum);
}
if (!isFloat) {
var _local3 = int(_local2);
if (_local3 != _local2) {
com.newgrounds.Logger.logWarning(((((("Float value " + _local2) + " given for integer rating \"") + _name) + "\". Clamping to ") + _local3) + ".");
}
return(_local3);
}
return(_local2);
}
function toString() {
return(_name);
}
}
Symbol 35 MovieClip [__Packages.com.newgrounds.BitmapLoader] Frame 0
class com.newgrounds.BitmapLoader extends com.newgrounds.APIEventDispatcher
{
var _bitmapData, _url, _loader, _loaderClip, dispatchEvent;
function BitmapLoader (defaultBitmap, url) {
super();
_bitmapData = defaultBitmap;
_url = url;
}
function get url() {
return(_url);
}
function set url(v) {
_loaded = false;
_url = v;
//return(url);
}
function get bitmapData() {
return(_bitmapData);
}
function set bitmapData(v) {
_bitmapData = v;
_loaded = true;
//return(bitmapData);
}
function get loaded() {
return(_loaded);
}
function disposeLoader() {
if (_loader) {
if (_loaderClip._parent == _root) {
_loader.unloadClip(_loaderClip.bitmap);
_loaderClip.removeMovieClip();
}
_loader = null;
_loaderClip = null;
}
}
function load() {
if ((!_url) || (_url == "")) {
onLoadComplete();
return(undefined);
}
_loaded = false;
if (_bitmapData) {
_bitmapData.dispose();
_bitmapData = null;
}
disposeLoader();
attachBitmap(null);
}
function attachBitmap(parent) {
if (!parent) {
parent = _root;
}
var _local5 = parent.getNextHighestDepth();
var _local3 = parent.createEmptyMovieClip("__bitmap" + _local5, _local5);
if (((!_loaded) && (_url)) && (_url != "")) {
_local3.createEmptyMovieClip("bitmap", 0);
_loader = new MovieClipLoader();
_loaderClip = _local3;
if (parent == _root) {
_loaderClip._visible = false;
}
var thisObj = this;
_loaderClip.onEnterFrame = function () {
thisObj.pollLoad();
};
_loader.addListener({onLoadError:function () {
thisObj.onLoadComplete();
}});
_loader.loadClip(_url, _local3.bitmap);
} else {
_local3.attachBitmap(_bitmapData, 0);
}
return(_local3);
}
function pollLoad() {
if (_loaderClip._width) {
onLoadComplete();
}
}
function onLoadComplete() {
var _local2;
if ((_loader && (_loaderClip)) && (_loaderClip._width)) {
try {
_loaderClip.onEnterFrame = null;
_local2 = new flash.display.BitmapData(_loaderClip._width, _loaderClip._height, true, 0);
_local2.draw(_loaderClip);
_bitmapData = _local2;
_loaded = true;
} catch(error) {
if (_local2) {
_local2.dispose();
}
}
}
disposeLoader();
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.ICON_LOADED, this, (_loaded ? null : (com.newgrounds.APIEvent.ERROR_BAD_FILE))));
}
static var _cacheSeed = 0;
var _loaded = true;
}
Symbol 44 MovieClip [__Packages.com.newgrounds.SaveQuery] Frame 0
class com.newgrounds.SaveQuery extends com.newgrounds.APIEventDispatcher
{
var _group, _connection, _files, _lookupKeys, _lookupRatings, _fileConditions, _keyConditions, _ratingConditions, _sortFields, dispatchEvent;
function SaveQuery (group) {
super();
_group = group;
_connection = group.connection;
reset();
}
function get group() {
return(_group);
}
function get resultsPerPage() {
return(_resultsPerPage);
}
function set resultsPerPage(val) {
_resultsPerPage = Math.min(Math.max(val, 1), 100);
//return(resultsPerPage);
}
function get page() {
return(_page);
}
function set page(val) {
_page = Math.max(val, 1);
//return(page);
}
function prevPage() {
page = ((page-1));
}
function nextPage() {
page = ((page+1));
}
function get isRandomized() {
return(_isRandomized);
}
function set isRandomized(val) {
_isRandomized = val;
//return(isRandomized);
}
function get files() {
return(_files);
}
function reset() {
_page = 1;
_resultsPerPage = 10;
_isRandomized = false;
_lookupKeys = [];
_lookupRatings = [];
_fileConditions = [];
_keyConditions = [];
_ratingConditions = [];
_sortFields = [];
_files = [];
includeAllFields();
}
function clone() {
var _local2 = new com.newgrounds.SaveQuery(_group);
_local2._page = _page;
_local2._resultsPerPage = _resultsPerPage;
_local2._isRandomized = _isRandomized;
_local2._lookupKeys = _lookupKeys.concat();
_local2._lookupRatings = _lookupRatings.concat();
_local2._fileConditions = _fileConditions.concat();
_local2._keyConditions = _keyConditions.concat();
_local2._ratingConditions = _ratingConditions.concat();
return(_local2);
}
function includeAllFields() {
for (var _local5 in _group.__get__keys()) {
var _local2 = _group.__get__keys()[_local5];
_lookupKeys.push(_local2.__get__id());
}
for (var _local4 in _group.__get__ratings()) {
var _local3 = _group.__get__ratings()[_local4];
_lookupRatings.push(_local3.__get__id());
}
}
function addCondition(field, operator, value) {
var _local2;
_local2 = 0;
while (_local2 < FILE_FIELDS.length) {
if (FILE_FIELDS[_local2] == field) {
break;
}
_local2++;
}
if (_local2 == FILE_FIELDS.length) {
_local2 = -1;
}
if (_local2 >= 0) {
_fileConditions.push({field:_local2, operator:operator, value:value});
} else {
var _local4 = _group.getKey(field);
if (_local4) {
value = _local4.validateValue(value);
_keyConditions.push({key_id:_local4.__get__id(), operator:operator, value:value});
return(undefined);
}
var _local3 = field.split(".");
var _local6 = _group.getRating(_local3[0]);
if (_local6) {
if (_local3[1] != "votes") {
value = _local6.validateValue(value);
}
_ratingConditions.push({rating_id:_local6.__get__id(), operator:operator, value:value, column:(_local3[1] ? (_local3[1]) : "score")});
return(undefined);
}
com.newgrounds.Logger.logError(((("The save group \"" + _group.__get__name()) + "\" does not have a field named \"") + field) + "\".");
}
}
function sortOn(field, sortDescending) {
if (sortDescending == undefined) {
sortDescending = false;
}
var _local2;
_local2 = 0;
while (_local2 < FILE_FIELDS.length) {
if (FILE_FIELDS[_local2] == field) {
break;
}
_local2++;
}
if (_local2 == FILE_FIELDS.length) {
_local2 = -1;
}
if (_local2 >= 0) {
_sortFields.push({table:TABLE_FILES, field:_local2, desc:sortDescending});
} else {
var _local5 = _group.getKey(field);
if (_local5) {
_sortFields.push({table:TABLE_KEYS, field:_local5.__get__id(), desc:sortDescending});
return(undefined);
}
var _local3 = field.split(".");
var _local6 = _group.getRating(_local3[0]);
if (_local6) {
_sortFields.push({table:TABLE_RATINGS, field:_local6.__get__id(), desc:sortDescending, extra:(_local3[1] ? (_local3[1]) : "score")});
return(undefined);
}
com.newgrounds.Logger.logError(((("The save group \"" + _group.__get__name()) + "\" does not have a field named \"") + field) + "\".");
}
}
function execute() {
var _local5 = {};
_local5.page = _page;
_local5.num_results = _resultsPerPage;
if (_isRandomized) {
_local5.randomize = 1;
}
if (_lookupKeys && (_lookupKeys.length)) {
_local5.lookup_keys = _lookupKeys;
}
if (_lookupRatings && (_lookupRatings.length)) {
_local5.lookup_ratings = _lookupRatings;
}
if (_fileConditions && (_fileConditions.length)) {
_local5.file_conditions = _fileConditions;
}
if (_keyConditions && (_keyConditions.length)) {
_local5.key_conditions = _keyConditions;
}
if (_ratingConditions && (_ratingConditions.length)) {
_local5.rating_conditions = _ratingConditions;
}
if (_sortFields && (_sortFields.length)) {
_local5.sort_conditions = _sortFields;
}
_connection.sendSimpleCommand("lookupSaveFiles", {target:this, func:onQueryComplete}, {publisher_id:_connection.publisherId, group_id:_group.__get__id(), query:_local5});
}
function onQueryComplete(event) {
if (event.__get__success()) {
var _local4 = event.__get__data();
_files = [];
if (_local4.files) {
var _local2 = 0;
while (_local2 < _local4.files.length) {
var _local3 = com.newgrounds.SaveFile.fromObject(_group, _local4.files[_local2]);
if (_local3) {
_files.push(_local3);
}
_local2++;
}
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.QUERY_COMPLETE, this));
} else {
com.newgrounds.Logger.logError("Query failed: " + event.__get__error());
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.QUERY_COMPLETE, this, event.__get__error()));
}
}
static var FILE_ID = "fileId";
static var AUTHOR_ID = "authorId";
static var AUTHOR_NAME = "authorName";
static var FILE_NAME = "fileName";
static var CREATED_ON = "createdOn";
static var UPDATED_ON = "updatedOn";
static var FILE_VIEWS = "fileViews";
static var FILE_STATUS = "fileStatus";
static var FILE_FIELDS = [FILE_ID, AUTHOR_ID, AUTHOR_NAME, FILE_NAME, CREATED_ON, UPDATED_ON, FILE_VIEWS, FILE_STATUS];
static var OPERATOR_EQUAL = "=";
static var OPERATOR_LESS_THAN = "<";
static var OPERATOR_GREATER_THAN = ">";
static var OPERATOR_NOT_EQUAL = "!=";
static var OPERATOR_LESS_OR_EQUAL = "<=";
static var OPERATOR_GREATER_OR_EQUAL = ">=";
static var OPERATOR_CONTAINS = "*";
static var OPERATOR_NOT_CONTAINS = "!*";
static var OPERATOR_NOT_BEGINS_WITH = "!*=";
static var OPERATOR_NOT_ENDS_WITH = "!=*";
static var OPERATOR_BEGINS_WITH = "*=";
static var OPERATOR_ENDS_WITH = "=*";
static var TABLE_FILES = 1;
static var TABLE_KEYS = 2;
static var TABLE_RATINGS = 3;
var _page = 1;
var _resultsPerPage = 10;
var _isRandomized = false;
}
Symbol 36 MovieClip [__Packages.com.newgrounds.Medal] Frame 0
class com.newgrounds.Medal extends com.newgrounds.APIEventDispatcher
{
var _connection, _id, _name, _description, _secret, _unlocked, _value, _difficulty, _iconLoader, dispatchEvent;
function Medal (connection, id, name, description, secret, unlocked, value, difficultyId, iconURL) {
super();
_connection = connection;
_id = id;
_name = name;
_description = description;
_secret = secret;
_unlocked = unlocked;
_value = value;
_difficulty = DIFFICULTIES[difficultyId];
_iconLoader = new com.newgrounds.BitmapLoader(DEFAULT_ICON, iconURL);
_iconLoader.load();
}
function get difficulty() {
return(_difficulty);
}
function get icon() {
return(_iconLoader.__get__bitmapData());
}
function get id() {
return(_id);
}
function get name() {
return(_name);
}
function get description() {
return(_description);
}
function get secret() {
return(_secret);
}
function get unlocked() {
return(_unlocked);
}
function get value() {
return(_value);
}
function toString() {
return((((((("Medal: " + _name) + "\t\t(") + (_unlocked ? "unlocked, " : "locked, ")) + _value) + "pts, ") + _difficulty) + ")");
}
function attachIcon(parent) {
return(_iconLoader.attachBitmap(parent));
}
function unlock() {
if (_unlocked) {
com.newgrounds.Logger.logWarning(("Medal \"" + _name) + "\" is already unlocked.");
return(undefined);
}
com.newgrounds.Logger.logMessage(("Unlocking medal \"" + name) + "\"...");
_unlocked = true;
if (_connection.__get__hasUserSession()) {
_connection.sendSimpleCommand("unlockMedal", {target:this, func:onUnlockConfirmed}, null, {medal_id:id});
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.MEDAL_UNLOCKED, this));
}
function setUnlocked(unlocked) {
_unlocked = unlocked;
}
function onUnlockConfirmed(event) {
if (event.__get__success()) {
com.newgrounds.Logger.logMessage(("Medal \"" + name) + "\" unlocked.");
} else {
com.newgrounds.Logger.logError(("Failed to unlock \"" + name) + "\"!");
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, this, event.__get__error()));
}
static var ICON_WIDTH = 50;
static var ICON_HEIGHT = 50;
static var DEFAULT_ICON = flash.display.BitmapData.loadBitmap("DefaultMedalIcon");
static var DIFFICULTY_EASY = "Easy";
static var DIFFICULTY_MODERATE = "Moderate";
static var DIFFICULTY_CHALLENGING = "Challenging";
static var DIFFICULTY_DIFFICULT = "Difficult";
static var DIFFICULTY_BRUTAL = "Brutal";
static var DIFFICULTIES = ["Unknown", DIFFICULTY_EASY, DIFFICULTY_MODERATE, DIFFICULTY_CHALLENGING, DIFFICULTY_DIFFICULT, DIFFICULTY_BRUTAL];
}
Symbol 38 MovieClip [__Packages.com.newgrounds.ScoreBoard] Frame 0
class com.newgrounds.ScoreBoard extends com.newgrounds.APIEventDispatcher
{
var _connection, _name, _id, _scores, _tag, dispatchEvent;
function ScoreBoard (connection, name, id) {
super();
_connection = connection;
_name = name;
_id = id;
}
function get name() {
return(_name);
}
function get scores() {
return(_scores);
}
function get period() {
return(_period);
}
function set period(val) {
_period = val;
//return(period);
}
function get firstResult() {
return(_firstResult);
}
function set firstResult(val) {
_firstResult = Math.max(1, val);
//return(firstResult);
}
function get numResults() {
return(_numResults);
}
function set numResults(val) {
_numResults = val;
//return(numResults);
}
function get tag() {
return(_tag);
}
function set tag(val) {
_tag = val;
//return(tag);
}
function get page() {
return(Math.ceil((_firstResult - 1) / _numResults) + 1);
}
function prevPage() {
if (firstResult > _numResults) {
firstResult = firstResult - _numResults;
}
}
function nextPage() {
firstResult = firstResult + _numResults;
}
function loadScores() {
_connection.sendSimpleCommand("loadScores", {target:this, func:onScoresLoaded}, {publisher_id:_connection.publisherId, board:_id, page:((_firstResult - 1) / _numResults) + 1, num_results:_numResults, period:_period, tag:_tag});
}
function postScore(numericScore, tag) {
if (tag == undefined) {
tag = null;
}
if (isNaN(numericScore)) {
com.newgrounds.Logger.logError("Cannot post invalid score: " + numericScore);
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.SCORE_POSTED, null, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT));
return(undefined);
}
com.newgrounds.Logger.logMessage(((((("Posting a score of " + numericScore) + " by ") + _connection.username) + " to scoreboard \"") + _name) + "\"...");
_connection.sendSimpleCommand("postScore", {target:this, func:onScorePosted}, null, {user_name:_connection.username, board:_id, value:numericScore, tag:tag});
}
function onScoresLoaded(event) {
var _local4 = event.__get__data();
_scores = [];
var _local5;
if (_local4.first_result) {
_local5 = _local4.first_result;
} else {
_local5 = _firstResult;
}
if (_local4.scores) {
var _local3 = 0;
while (_local3 < _local4.scores.length) {
var _local2 = _local4.scores[_local3];
if (_local2) {
_scores[_local3] = new com.newgrounds.Score(_local5, _local2.username, _local2.value, _local2.numeric_value, _local2.tag);
}
_local3++;
_local5++;
}
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.SCORES_LOADED, this));
}
function onScorePosted(event) {
if (event.__get__success()) {
com.newgrounds.Logger.logMessage("Score posted!");
var _local4 = event.__get__data();
var _local2 = {};
_local2.score = _local4.value;
_local2.scoreBoard = this;
} else {
com.newgrounds.Logger.logError("Error posting score: " + event.__get__error());
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.SCORE_POSTED, _local2, event.__get__error()));
}
function toString() {
return("Scoreboard: " + _name);
}
static var TODAY = "Today";
static var THIS_WEEK = "This Week";
static var THIS_MONTH = "This Month";
static var THIS_YEAR = "This Year";
static var ALL_TIME = "All-Time";
var _period = ALL_TIME;
var _firstResult = 1;
var _numResults = 10;
}
Symbol 27 MovieClip [__Packages.com.newgrounds.Logger] Frame 0
class com.newgrounds.Logger
{
function Logger () {
}
static function logInternal() {
var _local2 = arguments;
log(PRIORITY_INTERNAL, _local2);
}
static function logMessage() {
var _local2 = arguments;
log(PRIORITY_MESSAGE, _local2);
}
static function logWarning() {
var _local2 = arguments;
log(PRIORITY_WARNING, _local2);
}
static function logError() {
var _local2 = arguments;
log(PRIORITY_ERROR, _local2);
}
static function log(priority, messages) {
if (priority == undefined) {
priority = PRIORITY_MESSAGE;
}
if (messages == undefined) {
messages = null;
}
if (priority >= _messageLevel) {
var _local1 = 0;
while (_local1 < messages.length) {
trace(HEADER + messages[_local1]);
_eventDispatcher.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.LOG, messages[_local1]));
_local1++;
}
}
if (priority >= _throwLevel) {
throw new Error(messages.join(newline));
}
}
static function addEventListener(event, listener) {
_eventDispatcher.addEventListener(event, listener, false, 0, false);
}
static var PRIORITY_INTERNAL = 0;
static var PRIORITY_MESSAGE = 1;
static var PRIORITY_WARNING = 2;
static var PRIORITY_ERROR = 3;
static var PRIORITY_MAX = 4;
static var HEADER = "[Newgrounds API] :: ";
static var _eventDispatcher = new com.newgrounds.EventDispatcher();
static var _messageLevel = PRIORITY_MESSAGE;
static var _throwLevel = PRIORITY_MAX;
}
Symbol 46 MovieClip [__Packages.com.newgrounds.components.FlashAdBase] Frame 0
class com.newgrounds.components.FlashAdBase extends MovieClip
{
var gotoAndStop, _x, _y, stop, onUnload, _adListener, adContainer, newgroundsButton, _fullScreen, clear, _ad, _adFeedLoader, _width, _height, beginFill, moveTo, lineTo, endFill;
function FlashAdBase () {
super();
try {
System.security.allowDomain("server.cpmstar.com");
System.security.allowInsecureDomain("server.cpmstar.com");
} catch(error) {
}
gotoAndStop("idle");
_x = int(_x);
_y = int(_y);
stop();
if (_newgroundsButton) {
_newgroundsButton.onRelease = onNGClick;
}
onUnload = removeAd;
var _local4 = this;
_adListener = {onLoadError:function (target, error, httpStatus) {
target._parent.onAdError(target, error, httpStatus);
}};
if (fullScreen) {
drawFullScreenRect();
}
if (com.newgrounds.API.__get__adFeedURL()) {
loadAdFeed();
} else {
com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.API_CONNECTED, {target:this, func:loadAdFeed});
}
}
function get _adContainer() {
return(adContainer);
}
function get _newgroundsButton() {
return(newgroundsButton);
}
function get fullScreen() {
return(_fullScreen);
}
function set fullScreen(v) {
_fullScreen = v;
if (v) {
drawFullScreenRect();
} else {
clear();
}
//return(fullScreen);
}
function get showBorder() {
return(_showBorder);
}
function set showBorder(value) {
_showBorder = value;
if (_showBorder) {
if (_ad) {
var _local2 = _ad.getProgress(_adContainer);
if (_local2.bytesLoaded >= _local2.bytesTotal) {
gotoAndStop("loaded");
} else {
gotoAndStop("loading");
}
} else {
gotoAndStop("idle");
}
} else {
gotoAndStop("noBorder");
}
//return(showBorder);
}
function loadAdFeed(event) {
if (event == undefined) {
event = null;
}
_adFeedLoader = new LoadVars();
var target = this;
_adFeedLoader.onData = function (data) {
target.onAdFeedLoaded(data);
};
_adFeedLoader.load(com.newgrounds.API.__get__adFeedURL(), _adFeedLoader);
}
function onAdFeedLoaded(data) {
if (data && (data != "")) {
loadAd(data);
} else {
onAdError();
}
}
function loadAd(adURL) {
if (adType != VIDEO_ADS) {
if (adURL.indexOf("?") >= 0) {
adURL = adURL + "&";
} else {
adURL = adURL + "?";
}
adURL = adURL + "blockoverlays=1";
}
_ad = new MovieClipLoader();
_ad.addListener(_adListener);
_adContainer._lockroot = true;
_ad.loadClip(adURL, _adContainer);
}
function removeAd() {
_adFeedLoader.onData = null;
_adFeedLoader = null;
_ad.removeListener(_adListener);
if (_adContainer) {
_ad.unloadClip(_adContainer);
}
_ad = null;
}
function onAdError(target, error, httpStatus) {
com.newgrounds.Logger.logError("Unable to load ad.");
removeAd();
}
function onNGClick() {
com.newgrounds.API.loadNewgrounds();
}
function drawFullScreenRect() {
_x = (Stage.width - _width) / 2;
_y = (Stage.height - _height) / 2;
beginFill(0);
moveTo(-Stage.width, -Stage.height);
lineTo(Stage.width, -Stage.height);
lineTo(Stage.width, Stage.height);
lineTo(-Stage.width, Stage.height);
lineTo(-Stage.width, -Stage.height);
endFill();
}
var _showBorder = true;
var adType = com.newgrounds.components.FlashAdBase.prototype.VIDEO_ADS;
var VIDEO_ADS = "Video";
var SIMPLE_ADS = "Simple";
}
Symbol 21 MovieClip [__Packages.com.newgrounds.shims.APIShim] Frame 0
class com.newgrounds.shims.APIShim extends MovieClip
{
function APIShim () {
super();
}
}
Symbol 29 MovieClip [__Packages.com.newgrounds.encoders.json.JSON] Frame 0
class com.newgrounds.encoders.json.JSON
{
static var start, cache, interval;
function JSON () {
}
static function encode(arg, noquotes) {
var _local3;
var _local2;
var _local6;
var _local1 = "";
var _local4;
if (arg.isSServerVar()) {
var _local8 = "sservervariable";
} else {
var _local8 = typeof(arg);
}
switch (_local8) {
case "sservervariable" :
return("?" + arg.getEncodedValue());
case "object" :
if (arg) {
if (arg instanceof Array) {
_local2 = 0;
while (_local2 < arg.length) {
_local4 = encode(arg[_local2]);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + _local4;
_local2++;
}
return(("[" + _local1) + "]");
}
if (typeof(arg.toString) != "undefined") {
for (_local2 in arg) {
_local4 = arg[_local2];
if ((typeof(_local4) != "undefined") && (typeof(_local4) != "function")) {
_local4 = encode(_local4);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + ((encode(_local2) + ":") + _local4);
}
}
return(("{" + _local1) + "}");
}
}
return("null");
case "number" :
return((isFinite(arg) ? (String(arg)) : "null"));
case "string" :
_local6 = arg.length;
if (noquotes) {
var _local7 = "";
} else {
var _local7 = "\"";
}
_local1 = _local7;
_local2 = 0;
while (_local2 < _local6) {
_local3 = arg.charAt(_local2);
if (_local3 >= " ") {
if ((_local3 == "\\") || (_local3 == "\"")) {
_local1 = _local1 + "\\";
}
_local1 = _local1 + _local3;
} else {
switch (_local3) {
case "\b" :
_local1 = _local1 + "\\b";
break;
case "\f" :
_local1 = _local1 + "\\f";
break;
case newline :
_local1 = _local1 + "\\n";
break;
case "\r" :
_local1 = _local1 + "\\r";
break;
case "\t" :
_local1 = _local1 + "\\t";
break;
default :
_local3 = _local3.charCodeAt();
_local1 = _local1 + (("\\u00" + Math.floor(_local3 / 16).toString(16)) + (_local3 % 16).toString(16));
}
}
_local2 = _local2 + 1;
}
return(_local1 + _local7);
case "boolean" :
return(String(arg));
}
return("null");
}
static function background_encode(arg, callback) {
if (busy) {
trace("[Newgrounds Encoder] :: Cannot encode a new file until the previous file is completed");
return(false);
}
if (!callback) {
trace("[Newgrounds Encoder] :: Missing a callback function, skipping encode");
return(false);
}
busy = true;
var _local2 = new Date();
start = _local2.getTime();
cache = {busy:false, complete:false, arg:arg, target:arg, parents:[], encoded:"", callback:callback, encode_chunk:function () {
com.newgrounds.encoders.json.JSON.encode_chunk();
}};
if (getType(arg) == "object") {
cache.encoded = "{";
} else if (getType(arg) == "array") {
cache.encoded = "[";
}
interval = setInterval(cache, "encode_chunk", 25);
return(true);
}
static function background_decode(arg, callback) {
if (busy) {
trace("[Newgrounds Encoder] :: Cannot decode a new file until the previous file is completed");
return(false);
}
if (!callback) {
trace("[Newgrounds Encoder] :: Missing a callback function, skipping decode");
return(false);
}
busy = true;
var _local1 = new Date();
start = _local1.getTime();
cache = {busy:false, callback:callback, complete:false, arg:arg, pos:0, parents:["root"], target:null, scratch:"", decode_chunk:function () {
com.newgrounds.encoders.json.JSON.decode_chunk();
}};
interval = setInterval(cache, "decode_chunk", 25);
return(true);
}
static function decode(text) {
var at = 0;
var ch = " ";
var _value;
var _error = function (m) {
throw {name:"JSONError", message:m, at:at - 1, text:text};
};
var _next = function () {
ch = text.charAt(at);
at = at + 1;
return(ch);
};
var _white = function () {
while (ch) {
if (ch <= " ") {
_next();
} else if (ch == "/") {
switch (_next()) {
case "/" :
while ((_next() && (ch != newline)) && (ch != "\r")) {
}
break;
case "*" :
_next();
for(;;){
if (ch) {
if (ch == "*") {
if (_next() == "/") {
_next();
// unexpected jump
}
} else {
_next();
}
} else {
_error("Unterminated comment");
}
};
break;
default :
_error("Syntax error");
}
} else {
return;
}
}
};
var _string = function () {
var _local4;
var _local1 = "";
var _local3;
var _local2;
var _local5 = false;
if (ch == "\"") {
while (_next()) {
if (ch == "\"") {
_next();
return(_local1);
}
if (ch == "\\") {
switch (_next()) {
case "b" :
_local1 = _local1 + "\b";
break;
case "f" :
_local1 = _local1 + "\f";
break;
case "n" :
_local1 = _local1 + newline;
break;
case "r" :
_local1 = _local1 + "\r";
break;
case "t" :
_local1 = _local1 + "\t";
break;
case "u" :
_local2 = 0;
_local4 = 0;
while (_local4 < 4) {
_local3 = parseInt(_next(), 16);
if (!isFinite(_local3)) {
_local5 = true;
break;
}
_local2 = (_local2 * 16) + _local3;
_local4 = _local4 + 1;
}
if (_local5) {
_local5 = false;
break;
}
_local1 = _local1 + String.fromCharCode(_local2);
break;
default :
_local1 = _local1 + ch;
}
} else {
_local1 = _local1 + ch;
}
}
}
_error("Bad string");
};
var _array = function () {
var _local1 = [];
if (ch == "[") {
_next();
_white();
if (ch == "]") {
_next();
return(_local1);
}
while (ch) {
_local1.push(_value());
_white();
if (ch == "]") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad array");
};
var _object = function () {
var _local2;
var _local1 = {};
if (ch == "{") {
_next();
_white();
if (ch == "}") {
_next();
return(_local1);
}
while (ch) {
_local2 = _string();
_white();
if (ch != ":") {
break;
}
_next();
_local1[_local2] = _value();
_white();
if (ch == "}") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad object");
};
var _number = function () {
var _local1 = "";
var _local2;
if (ch == "-") {
_local1 = "-";
_next();
}
while ((ch >= "0") && (ch <= "9")) {
_local1 = _local1 + ch;
_next();
}
if (ch == ".") {
_local1 = _local1 + ".";
while ((_next() && (ch >= "0")) && (ch <= "9")) {
_local1 = _local1 + ch;
}
}
_local2 = 1 * _local1;
if (!isFinite(_local2)) {
_error("Bad number");
} else {
return(_local2);
}
};
var _word = function () {
switch (ch) {
case "t" :
if (((_next() == "r") && (_next() == "u")) && (_next() == "e")) {
_next();
return(true);
}
break;
case "f" :
if ((((_next() == "a") && (_next() == "l")) && (_next() == "s")) && (_next() == "e")) {
_next();
return(false);
}
break;
case "n" :
if (!(((_next() == "u") && (_next() == "l")) && (_next() == "l"))) {
break;
}
_next();
return(null);
}
_error("Syntax error");
};
_value = function () {
_white();
switch (ch) {
case "{" :
return(_object());
case "[" :
return(_array());
case "\"" :
return(_string());
case "-" :
return(_number());
}
return((((ch >= "0") && (ch <= "9")) ? (_number()) : (_word())));
};
return(_value());
}
static function getType(v) {
if (v instanceof Array) {
return("array");
}
return(typeof(v));
}
static function decode_chunk() {
if ((!cache.busy) && (!cache.complete)) {
cache.busy = true;
var _local1 = 0;
while (_local1 < decode_chunks) {
chunk_decoder();
if (cache.complete) {
break;
}
_local1++;
}
trace(Math.round((cache.pos / cache.arg.length) * 100) + "% decoded");
cache.busy = false;
}
if (cache.complete) {
var _local2 = new Date();
busy = false;
clearInterval(interval);
cache.callback(cache.root, _local2.getTime() - start);
cache.arg = "";
}
}
static function encode_chunk() {
if ((!cache.busy) && (!cache.complete)) {
cache.busy = true;
var _local1 = 0;
while (_local1 < encode_chunks) {
chunk_encoder();
if (cache.complete) {
break;
}
_local1++;
}
cache.busy = false;
}
if (cache.complete) {
var _local3 = new Date();
var _local2 = _local3.getTime();
busy = false;
clearInterval(interval);
cache.callback(cache.encoded, _local2 - start);
cache.encoded = "";
}
}
static function chunk_decoder() {
function _object() {
var _local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (!com.newgrounds.encoders.json.JSON.cache.mode) {
com.newgrounds.encoders.json.JSON.cache.mode = "object";
com.newgrounds.encoders.json.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (_local1 != "\"") {
throw "Malformed object key in encoded string. Keys must be wrapped in quotes (\"\")";
}
com.newgrounds.encoders.json.JSON.cache.scratch = "";
_setTargetValue({});
} else if (_local1 == ",") {
com.newgrounds.encoders.json.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (_local1 != "\"") {
throw "Malformed object key in encoded string. Keys must be wrapped in quotes (\"\")";
}
com.newgrounds.encoders.json.JSON.cache.scratch = "";
} else if (_local1 == "}") {
_useParent();
} else if (_local1 == "\"") {
com.newgrounds.encoders.json.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (_local1 != ":") {
throw "Malformed object notation. Object keys and values must be separated by colons(:)";
}
_addParent(com.newgrounds.encoders.json.JSON.cache.scratch);
com.newgrounds.encoders.json.JSON.cache.mode = null;
} else {
if (_local1 == "\\") {
com.newgrounds.encoders.json.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
}
com.newgrounds.encoders.json.JSON.cache.scratch = com.newgrounds.encoders.json.JSON.cache.scratch + _local1;
}
com.newgrounds.encoders.json.JSON.cache.pos++;
}
function _array() {
var _local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (!com.newgrounds.encoders.json.JSON.cache.mode) {
com.newgrounds.encoders.json.JSON.cache.mode = "array";
com.newgrounds.encoders.json.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
_setTargetValue([]);
if (_local1 != "]") {
_addArrayKey();
} else {
_useParent();
}
return(undefined);
}
if (_local1 == ",") {
_addArrayKey();
} else if (_local1 == "]") {
_useParent();
}
com.newgrounds.encoders.json.JSON.cache.pos++;
}
function _boolean() {
var _local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (_local1 == "t") {
_setTargetValue(true);
com.newgrounds.encoders.json.JSON.cache.pos = com.newgrounds.encoders.json.JSON.cache.pos + 3;
} else if (_local1 == "f") {
_setTargetValue(false);
com.newgrounds.encoders.json.JSON.cache.pos = com.newgrounds.encoders.json.JSON.cache.pos + 4;
} else {
throw "Bool values must be true or false";
}
_useParent();
}
function _null() {
var _local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (_local1 == "n") {
_setTargetValue(null);
com.newgrounds.encoders.json.JSON.cache.pos = com.newgrounds.encoders.json.JSON.cache.pos + 2;
} else {
throw "Null values must be null";
}
_useParent();
}
function _string() {
var _local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (!com.newgrounds.encoders.json.JSON.cache.mode) {
if (_local1 != "\"") {
throw "Strings must be wrapped in quotes (\"\")";
}
com.newgrounds.encoders.json.JSON.cache.scratch = "";
com.newgrounds.encoders.json.JSON.cache.mode = "string";
} else if (_local1 == "\"") {
_setTargetValue(com.newgrounds.encoders.json.JSON.cache.scratch);
_useParent();
} else {
if (_local1 == "\\") {
com.newgrounds.encoders.json.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
switch (_local1) {
case "n" :
_local1 = newline;
break;
case "r" :
_local1 = newline;
break;
case "t" :
_local1 = "\t";
break;
case "u" :
_local1 = "\\" + _local1;
}
}
com.newgrounds.encoders.json.JSON.cache.scratch = com.newgrounds.encoders.json.JSON.cache.scratch + _local1;
}
com.newgrounds.encoders.json.JSON.cache.pos++;
}
function _number() {
var _local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
var _local2 = "01234567890.-";
if (!com.newgrounds.encoders.json.JSON.cache.mode) {
com.newgrounds.encoders.json.JSON.cache.mode = "number";
com.newgrounds.encoders.json.JSON.cache.scratch = "";
}
if (_local2.indexOf(_local1) < 0) {
_setTargetValue(Number(com.newgrounds.encoders.json.JSON.cache.scratch));
_useParent();
} else {
com.newgrounds.encoders.json.JSON.cache.scratch = com.newgrounds.encoders.json.JSON.cache.scratch + _local1;
com.newgrounds.encoders.json.JSON.cache.pos++;
}
}
function _setTargetValue(newval) {
var _local2 = _getParent().obj;
var _local1 = com.newgrounds.encoders.json.JSON.cache.parents[com.newgrounds.encoders.json.JSON.cache.parents.length - 1];
_local2[_local1] = newval;
}
function _useParent() {
com.newgrounds.encoders.json.JSON.cache.mode = com.newgrounds.encoders.json.JSON.getType(_getParent().obj);
com.newgrounds.encoders.json.JSON.cache.parents.pop();
}
function _getParent() {
var _local2 = com.newgrounds.encoders.json.JSON.cache;
var _local1 = 0;
while (_local1 < (com.newgrounds.encoders.json.JSON.cache.parents.length - 1)) {
_local2 = _local2[com.newgrounds.encoders.json.JSON.cache.parents[_local1]];
_local1++;
}
return({obj:_local2, name:com.newgrounds.encoders.json.JSON.cache.parents[_local1]});
}
function _getCurrent() {
var _local2 = com.newgrounds.encoders.json.JSON.cache;
var _local1 = 0;
while (_local1 < com.newgrounds.encoders.json.JSON.cache.parents.length) {
_local2 = _local2[com.newgrounds.encoders.json.JSON.cache.parents[_local1]];
_local1++;
}
return({obj:_local2, name:com.newgrounds.encoders.json.JSON.cache.parents[_local1]});
}
function _addParent(child) {
com.newgrounds.encoders.json.JSON.cache.parents.push(child);
}
function _addArrayKey() {
var _local1 = _getCurrent().obj.length;
com.newgrounds.encoders.json.JSON.cache.parents.push(_local1);
com.newgrounds.encoders.json.JSON.cache.mode = null;
}
if (cache.pos >= cache.arg.length) {
cache.complete = true;
return(undefined);
}
if (cache.mode) {
eval ("_" + cache.mode)();
} else {
var char = cache.arg.charAt(cache.pos);
switch (char) {
case "{" :
_object();
return;
case "[" :
_array();
return;
case "\"" :
_string();
return;
case "n" :
_null();
return;
case "t" :
_boolean();
return;
case "f" :
_boolean();
return;
default :
_number();
}
}
}
static function chunk_encoder() {
if (cache.complete) {
return(undefined);
}
var _local2 = getType(cache.target);
switch (_local2) {
case "number" :
cache.encoded = cache.encoded + cache.target;
getParent();
break;
case "string" :
cache.encoded = cache.encoded + (("\"" + cache.target.split("\"").join("\\\"")) + "\"");
getParent();
break;
case "boolean" :
cache.encoded = cache.encoded + ((cache.target == true) ? "true" : "false");
getParent();
break;
case "null" :
cache.encoded = cache.encoded + "null";
getParent();
break;
case "array" :
if (cache.target.length < 1) {
cache.encoded = cache.encoded + "]";
getParent();
} else {
cache.parents.push(cache.target);
cache.target = cache.target[0];
if (getType(cache.target) == "array") {
cache.encoded = cache.encoded + "[";
} else if (getType(cache.target) == "object") {
cache.encoded = cache.encoded + "{";
}
}
break;
case "object" :
for (var _local1 in cache.target) {
break;
}
if (_local1 === undefined) {
cache.encoded = cache.encoded + "}";
getParent();
} else {
cache.parents.push(cache.target);
cache.target = cache.target[_local1];
cache.encoded = cache.encoded + (("\"" + _local1.split("\"").join("\\\"")) + "\":");
if (getType(cache.target) == "array") {
cache.encoded = cache.encoded + "[";
} else if (getType(cache.target) == "object") {
cache.encoded = cache.encoded + "{";
}
}
break;
default :
cache.encoded = cache.encoded + "null";
getParent();
}
}
static function getParent() {
if (cache.parents.length > 0) {
var _local1 = cache.parents.pop();
if (getType(_local1) == "array") {
_local1.shift();
} else {
for (var _local3 in _local1) {
delete _local1[_local3];
break;
}
}
if ((getType(_local1) == "object") or (getType(_local1) == "array")) {
for (var _local2 in _local1) {
break;
}
if (!(_local2 === undefined)) {
cache.encoded = cache.encoded + ",";
}
}
cache.target = _local1;
} else {
cache.complete = true;
}
}
static var encode_chunks = 20000;
static var decode_chunks = 20000;
static var busy = false;
}
Symbol 32 MovieClip [__Packages.com.newgrounds.crypto.MD5] Frame 0
class com.newgrounds.crypto.MD5
{
function MD5 () {
}
static function hash(src) {
return(hex_md5(src));
}
static function hex_md5(src) {
return(binl2hex(core_md5(str2binl(src), src.length * 8)));
}
static function core_md5(x, len) {
x[len >> 5] = x[len >> 5] | (128 << (len % 32));
x[(((len + 64) >>> 9) << 4) + 14] = len;
var _local4 = 1732584193 /* 0x67452301 */;
var _local3 = -271733879;
var _local2 = -1732584194;
var _local1 = 271733878 /* 0x10325476 */;
var _local5 = 0;
while (_local5 < x.length) {
var _local10 = _local4;
var _local9 = _local3;
var _local8 = _local2;
var _local7 = _local1;
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 0], 7, -680876936);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 1], 12, -389564586);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 2], 17, 606105819);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 3], 22, -1044525330);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 4], 7, -176418897);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 5], 12, 1200080426);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 6], 17, -1473231341);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 7], 22, -45705983);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 8], 7, 1770035416);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 9], 12, -1958414417);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 10], 17, -42063);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 11], 22, -1990404162);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 12], 7, 1804603682);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 13], 12, -40341101);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 14], 17, -1502002290);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 15], 22, 1236535329);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 1], 5, -165796510);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 6], 9, -1069501632);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 11], 14, 643717713);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 0], 20, -373897302);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 5], 5, -701558691);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 10], 9, 38016083);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 15], 14, -660478335);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 4], 20, -405537848);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 9], 5, 568446438);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 14], 9, -1019803690);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 3], 14, -187363961);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 8], 20, 1163531501);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 13], 5, -1444681467);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 2], 9, -51403784);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 7], 14, 1735328473);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 12], 20, -1926607734);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 5], 4, -378558);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 8], 11, -2022574463);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 11], 16, 1839030562);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 14], 23, -35309556);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 1], 4, -1530992060);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 4], 11, 1272893353);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 7], 16, -155497632);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 10], 23, -1094730640);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 13], 4, 681279174);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 0], 11, -358537222);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 3], 16, -722521979);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 6], 23, 76029189);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 9], 4, -640364487);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 12], 11, -421815835);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 15], 16, 530742520);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 2], 23, -995338651);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 0], 6, -198630844);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 7], 10, 1126891415);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 14], 15, -1416354905);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 5], 21, -57434055);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 12], 6, 1700485571);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 3], 10, -1894986606);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 10], 15, -1051523);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 1], 21, -2054922799);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 8], 6, 1873313359);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 15], 10, -30611744);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 6], 15, -1560198380);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 13], 21, 1309151649);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 4], 6, -145523070);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 11], 10, -1120210379);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 2], 15, 718787259);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 9], 21, -343485551);
_local4 = safe_add(_local4, _local10);
_local3 = safe_add(_local3, _local9);
_local2 = safe_add(_local2, _local8);
_local1 = safe_add(_local1, _local7);
_local5 = _local5 + 16;
}
return(new Array(_local4, _local3, _local2, _local1));
}
static function md5_cmn(q, a, b, x, s, t) {
return(safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b));
}
static function md5_ff(a, b, c, d, x, s, t) {
return(md5_cmn((b & c) | ((~b) & d), a, b, x, s, t));
}
static function md5_gg(a, b, c, d, x, s, t) {
return(md5_cmn((b & d) | (c & (~d)), a, b, x, s, t));
}
static function md5_hh(a, b, c, d, x, s, t) {
return(md5_cmn((b ^ c) ^ d, a, b, x, s, t));
}
static function md5_ii(a, b, c, d, x, s, t) {
return(md5_cmn(c ^ (b | (~d)), a, b, x, s, t));
}
static function bit_rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
static function safe_add(x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 65535));
}
static function str2binl(str) {
var _local3 = new Array();
var _local4 = 255;
var _local1 = 0;
while (_local1 < (str.length * 8)) {
_local3[_local1 >> 5] = _local3[_local1 >> 5] | ((str.charCodeAt(_local1 / 8) & _local4) << (_local1 % 32));
_local1 = _local1 + 8;
}
return(_local3);
}
static function binl2hex(binarray) {
var _local4 = new String("");
var _local3 = new String("0123456789abcdef");
var _local1 = 0;
while (_local1 < (binarray.length * 4)) {
_local4 = _local4 + (_local3.charAt((binarray[_local1 >> 2] >> (((_local1 % 4) * 8) + 4)) & 15) + _local3.charAt((binarray[_local1 >> 2] >> ((_local1 % 4) * 8)) & 15));
_local1++;
}
return(_local4);
}
}
Symbol 33 MovieClip [__Packages.com.newgrounds.crypto.RC4] Frame 0
class com.newgrounds.crypto.RC4
{
function RC4 () {
}
static function encrypt(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToHex(_local2));
}
static function encryptbin(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(_local2);
}
static function decrypt(src, key) {
var _local3 = hexToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToStr(_local2));
}
static function initialize(pwd) {
var _local2 = 0;
var _local3;
var _local4 = pwd.length;
var _local1 = 0;
while (_local1 <= 255) {
mykey[_local1] = pwd[_local1 % _local4];
sbox[_local1] = _local1;
_local1++;
}
_local1 = 0;
while (_local1 <= 255) {
_local2 = ((_local2 + sbox[_local1]) + mykey[_local1]) % 256;
_local3 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local3;
_local1++;
}
}
static function calculate(plaintxt, psw) {
initialize(psw);
var _local1 = 0;
var _local2 = 0;
var _local9 = new Array();
var _local7;
var _local5;
var _local6;
var _local3 = 0;
while (_local3 < plaintxt.length) {
_local1 = (_local1 + 1) % 256;
_local2 = (_local2 + sbox[_local1]) % 256;
_local5 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local5;
var _local4 = (sbox[_local1] + sbox[_local2]) % 256;
_local7 = sbox[_local4];
_local6 = plaintxt[_local3] ^ _local7;
_local9.push(_local6);
_local3++;
}
return(_local9);
}
static function charsToHex(chars) {
var _local4 = new String("");
var _local3 = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var _local1 = 0;
while (_local1 < chars.length) {
_local4 = _local4 + (_local3[chars[_local1] >> 4] + _local3[chars[_local1] & 15]);
_local1++;
}
return(_local4);
}
static function hexToChars(hex) {
var _local3 = new Array();
var _local1 = ((hex.substr(0, 2) == "0x") ? 2 : 0);
while (_local1 < hex.length) {
_local3.push(parseInt(hex.substr(_local1, 2), 16));
_local1 = _local1 + 2;
}
return(_local3);
}
static function charsToStr(chars) {
var _local3 = new String("");
var _local1 = 0;
while (_local1 < chars.length) {
_local3 = _local3 + String.fromCharCode(chars[_local1]);
_local1++;
}
return(_local3);
}
static function strToChars(str) {
var _local3 = new Array();
var _local1 = 0;
while (_local1 < str.length) {
_local3.push(str.charCodeAt(_local1));
_local1++;
}
return(_local3);
}
static var sbox = new Array(255);
static var mykey = new Array(255);
}
Symbol 37 MovieClip [__Packages.com.newgrounds.Score] Frame 0
class com.newgrounds.Score
{
var _rank, _username, _score, _numericValue, _tag;
function Score (rank, username, score, numericValue, tag) {
(_rank = rank);
(_username = username);
_score = score;
_numericValue = numericValue;
_tag = tag;
}
function get numericValue() {
return(_numericValue);
}
function get rank() {
return(_rank);
}
function get score() {
return(_score);
}
function get tag() {
return(_tag);
}
function get username() {
return(_username);
}
function toString() {
return((((_rank + ".\t") + _username) + "\t") + _score);
}
}
Symbol 45 MovieClip [__Packages.com.newgrounds.API] Frame 0
class com.newgrounds.API
{
static var _serverTime, _adFeedURL, _movieVersion, _bridge, _requestedSaveGroupId, _requestedSaveFileId, _movieName, _newVersion, _saveFilePath, _imageFilePath;
function API () {
}
static function get connected() {
return(_connection.__get__connected());
}
static function get isNetworkHost() {
return(_connection.__get__isNetworkHost());
}
static function get apiId() {
_connection.assertInitialized();
return(_connection.apiId);
}
static function get debugMode() {
return(_debugMode);
}
static function set debugMode(val) {
_debugMode = val;
//return(debugMode);
}
static function get publisherId() {
_connection.assertInitialized();
return(_connection.publisherId);
}
static function get sessionId() {
_connection.assertInitialized();
return(_connection.sessionId);
}
static function get hostDomain() {
_connection.assertInitialized();
return(_connection.hostDomain);
}
static function get hostURL() {
_connection.assertInitialized();
return(_connection.__get__hostURL());
}
static function get isNewgrounds() {
return(_connection.publisherId == 1);
}
static function get hasUserSession() {
_connection.assertInitialized();
return(_connection.__get__hasUserSession());
}
static function get username() {
_connection.assertInitialized();
return(_connection.username);
}
static function get userId() {
_connection.assertInitialized();
return(_connection.userId);
}
static function assertConnected(eventType) {
if (eventType == undefined) {
eventType = null;
}
if (_connection.assertConnected()) {
return(true);
}
if (eventType) {
dispatchEvent(eventType, null, com.newgrounds.APIEvent.ERROR_NOT_CONNECTED);
}
return(false);
}
static function get serverTime() {
return(_serverTime);
}
static function get adsApproved() {
return(_adsApproved);
}
static function get adFeedURL() {
return(_adFeedURL);
}
static function get medals() {
return(_medalsArray);
}
static function get scoreBoards() {
return(_scoreBoardsArray);
}
static function get saveGroups() {
return(_saveGroupsArray);
}
static function connect(_root, apiId, encryptionKey, movieVersion) {
if (encryptionKey == undefined) {
encryptionKey = null;
}
if (movieVersion == undefined) {
movieVersion = "";
}
com.newgrounds.APIEventDispatcher.__set__globalDispatcher(_dispatcher);
System.security.loadPolicyFile("http://apifiles.ngfiles.com/crossdomain.xml");
if (_connection.initialized) {
com.newgrounds.Logger.logError("Connection already in progress. Please call API.disconnect() before attempting another connection.");
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_NOT_CONNECTED);
return(undefined);
}
apiId = trimWhitespace(apiId);
if (encryptionKey) {
encryptionKey = trimWhitespace(encryptionKey);
}
if ((!apiId) || (apiId == "")) {
com.newgrounds.Logger.logError("No apiId given. Please use the API ID from your API settings page.");
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT);
return(undefined);
}
com.newgrounds.Logger.logMessage(("====== Newgrounds API v" + VERSION) + " ======");
_connection.connectionState = com.newgrounds.APIConnection.CONNECTING;
_root=_root;//parameter overwritten
_movieVersion = movieVersion;
_connection.apiId = apiId;
var _local4;
_local4 = apiId.indexOf(":");
if (_local4 != -1) {
_connection.trackerId = int(apiId.substring(0, _local4));
} else {
_connection.trackerId = int(apiId);
}
if (!_connection.trackerId) {
com.newgrounds.Logger.logError("Invalid API ID: " + apiId);
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT);
return(undefined);
}
_connection.encryptionKey = encryptionKey;
_connection.initialized = true;
_connection.__set__hostURL(_root._url);
doConnect(_root);
}
static function doConnect(flashVars) {
if (isNetworkHost && (_debugMode != RELEASE_MODE)) {
com.newgrounds.Logger.logMessage("Live file detected, turning off debug mode.");
_debugMode = RELEASE_MODE;
}
if (flashVars && (flashVars.NewgroundsAPI_SandboxID)) {
_bridge = new com.newgrounds.Bridge(flashVars.NewgroundsAPI_SandboxID);
com.newgrounds.APICommand.bridge = _bridge;
} else {
_bridge = new com.newgrounds.Bridge(com.newgrounds.crypto.MD5.hash(String(Math.random())));
com.newgrounds.APICommand.bridge = _bridge;
}
if (_debugMode == RELEASE_MODE) {
if (flashVars) {
if (flashVars.NewgroundsAPI_UserName) {
_connection.username = flashVars.NewgroundsAPI_UserName;
}
if (flashVars.NewgroundsAPI_UserID) {
_connection.userId = flashVars.NewgroundsAPI_UserID;
}
if (flashVars.NewgroundsAPI_PublisherID) {
_connection.publisherId = flashVars.NewgroundsAPI_PublisherID;
}
if (flashVars.NewgroundsAPI_UserpageFormat) {
_connection.userpageFormat = flashVars.NewgroundsAPI_UserpageFormat;
}
if (flashVars.NewgroundsAPI_SessionID) {
_connection.sessionId = flashVars.NewgroundsAPI_SessionID;
}
if (flashVars.NewgroundsAPI_SaveGroupID) {
_requestedSaveGroupId = flashVars.NewgroundsAPI_SaveGroupID;
}
if (flashVars.NewgroundsAPI_SaveFileID) {
_requestedSaveFileId = flashVars.NewgroundsAPI_SaveFileID;
}
}
} else {
_connection.debug = true;
if ((_debugMode == DEBUG_MODE_LOGGED_IN) || (_debugMode == DEBUG_MODE_LOGGED_OUT)) {
_connection.publisherId = 1;
}
if (_debugMode == DEBUG_MODE_LOGGED_IN) {
_connection.sessionId = "D3bu64p1U53R";
_connection.userId = 10;
_connection.username = "API-Debugger";
}
}
_connection.sendSimpleCommand("connectMovie", onConnect, {host:_connection.hostDomain, movie_version:_movieVersion, publisher_id:_connection.publisherId});
}
static function onConnect(event) {
var _local1 = event.__get__data();
if (!event.__get__success()) {
com.newgrounds.Logger.logError("Unable to connect to the API.");
_connection.reset();
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, event.__get__data(), event.__get__error());
return(undefined);
}
if (debugMode != RELEASE_MODE) {
_adFeedURL = TEST_AD_FEED_URL;
} else if (_local1.ad_url) {
_adFeedURL = unescape(_local1.ad_url);
}
switch (_local1.ad_status) {
case -1 :
com.newgrounds.Logger.logWarning("Your movie is not approved to run Flash Ads.");
break;
case 0 :
com.newgrounds.Logger.logWarning("Your movie is still awaiting approval to run Flash Ads.");
break;
case 1 :
com.newgrounds.Logger.logMessage("Your movie is approved to run Flash Ads!");
}
_adsApproved = _local1.ad_status == 1;
if ((_debugMode == DEBUG_MODE_HOST_BLOCKED) || (_local1.deny_host)) {
com.newgrounds.Logger.logWarning(_connection.hostDomain + " does not have permission to host this movie!", "Update your API configuration to allow this host.");
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, {officialURL:unescape(_local1.movie_url)}, com.newgrounds.APIEvent.ERROR_HOST_BLOCKED);
_connection.reset();
return(undefined);
}
_movieName = (_local1.movieName ? (_local1.movieName) : "");
com.newgrounds.Logger.logMessage("Connecting to the Newgrounds API Gateway...", ("----- " + _local1.movie_name) + " -----");
if (_debugMode == DEBUG_MODE_NEW_VERSION) {
_local1.movie_version = "Debug Mode";
}
if (_local1.movie_version) {
com.newgrounds.Logger.logMessage("A new version of this movie is available.", "Current version:\t" + _movieVersion, "Newest version:\t" + _local1.movie_version, "Use API.loadOfficialVersion() to link to the latest version.");
_newVersion = true;
} else {
_newVersion = false;
}
_serverTime = new Date(int(_local1.time) * 1000);
if (_local1.request_portal_url) {
_connection.sendSimpleCommand("setPortalID", null, {portal_url:_connection.__get__hostURL()});
}
_connection.sendSimpleCommand("preloadSettings", onMetadataLoaded, {publisher_id:_connection.publisherId, user_id:_connection.userId});
}
static function onMetadataLoaded(event) {
var _local11 = event.__get__data();
var _local4;
var _local1;
if (!event.__get__success()) {
com.newgrounds.Logger.logWarning("Unable to load movie metadata.");
disconnect();
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, null, event.__get__error());
return(undefined);
}
var _local10 = 0;
if (_local11.medals) {
_local10 = _local11.medals.length;
var _local18;
if (hasUserSession) {
_local18 = loadLocal("medals_unlocked_" + username);
} else {
_local18 = loadLocal("medals_unlocked");
}
_local4 = 0;
while (_local4 < _local10) {
var _local5 = _local11.medals[_local4];
var _local15 = _local5.medal_unlocked;
var _local17 = _local18 && (_local18[_local5.medal_id]);
var _local14 = (hasUserSession ? (_local15) : (_local17));
if (debugMode != RELEASE_MODE) {
_local14 = false;
}
var _local6 = new com.newgrounds.Medal(_connection, _local5.medal_id, _local5.medal_name, _local5.medal_description, Boolean(int(_local5.secret)), _local14, _local5.medal_value, _local5.medal_difficulty, _local5.medal_icon);
_local6.addEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCKED, onMedalUnlocked, false, 0, true);
_local6.addEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, onMedalUnlockConfirmed, false, 0, true);
_medals[_local6.__get__name()] = _local6;
_medalsArray.push(_local6);
com.newgrounds.Logger.logMessage(_local6);
if ((hasUserSession && (_local17)) && (!_local15)) {
com.newgrounds.Logger.logMessage(("Server missed the \"" + _local6.__get__name()) + "\" unlock. Resending...");
_local6.unlock();
}
_local4++;
}
}
com.newgrounds.Logger.logMessage(((_local10 + " medal") + ((_local10 != 1) ? "s" : "")) + " initialized.");
_local10 = 0;
if (_local11.score_boards) {
_local10 = _local11.score_boards.length;
_local4 = 0;
while (_local4 < _local10) {
var _local16 = _local11.score_boards[_local4];
var _local9 = new com.newgrounds.ScoreBoard(_connection, _local16.name, _local16.id);
_scoreBoards[_local9.__get__name()] = _local9;
_scoreBoardsArray.push(_local9);
com.newgrounds.Logger.logMessage(_local9);
_local4++;
}
}
com.newgrounds.Logger.logMessage(((_local10 + " scoreboard") + ((_local10 != 1) ? "s" : "")) + " initialized.");
_local10 = 0;
if (_local11.save_groups) {
_local10 = _local11.save_groups.length;
_local4 = 0;
while (_local4 < _local10) {
var _local2 = _local11.save_groups[_local4];
var _local13 = [];
if (_local2.keys) {
_local1 = 0;
while (_local1 < _local2.keys.length) {
var _local7 = _local2.keys[_local1];
_local13.push(new com.newgrounds.SaveKey(_local7.name, _local7.id, _local7.type));
_local1++;
}
}
var _local12 = [];
if (_local2.ratings) {
_local1 = 0;
while (_local1 < _local2.ratings.length) {
var _local3 = _local2.ratings[_local1];
_local12.push(new com.newgrounds.SaveRating(_local3.name, _local3.id, _local3.float, _local3.min, _local3.max));
_local1++;
}
}
var _local8 = new com.newgrounds.SaveGroup(_connection, _local2.group_name, _local2.group_id, _local2.group_type, _local13, _local12);
_saveGroups[_local8.__get__name()] = _local8;
_saveGroupsArray.push(_local8);
com.newgrounds.Logger.logMessage(_local8);
_local4++;
}
}
com.newgrounds.Logger.logMessage(((_local10 + " save group") + ((_local10 != 1) ? "s" : "")) + " initialized.");
if (_local11.save_file_path) {
_saveFilePath = _local11.save_file_path + "/";
com.newgrounds.SaveFile._saveFilePath = _saveFilePath;
com.newgrounds.Logger.logInternal("Save file path: " + _saveFilePath);
}
if (_local11.image_file_path) {
_imageFilePath = _local11.image_file_path + "/";
com.newgrounds.SaveFile._imageFilePath = _imageFilePath;
com.newgrounds.Logger.logInternal("Image file path: " + _imageFilePath);
}
com.newgrounds.Logger.logMessage("Connection complete!");
_connection.connectionState = com.newgrounds.APIConnection.CONNECTED;
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, {movieName:_movieName, newVersion:_newVersion});
if (_requestedSaveFileId && (_requestedSaveGroupId)) {
addEventListener(com.newgrounds.APIEvent.FILE_LOADED, onRequestedFileLoaded);
loadSaveFile(_requestedSaveFileId, false);
}
}
static function disconnect() {
if (!_connection.__get__connected()) {
com.newgrounds.Logger.logWarning("The Newgrounds API is already disconnected.");
return(undefined);
}
_connection.reset();
for (var _local2 in _medals) {
var _local1 = _medals[_local2];
_local1.removeEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCKED, onMedalUnlocked);
_local1.removeEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, onMedalUnlockConfirmed);
}
_newVersion = false;
_medals = new Object();
_medalsArray = [];
_scoreBoards = new Object();
_scoreBoardsArray = [];
_saveGroups = new Object();
_saveGroupsArray = [];
_sharedObjects = new Object();
_imageFilePath = null;
_saveFilePath = null;
com.newgrounds.Logger.logMessage("Disconnected from the Newgrounds API.");
}
static function loadNewgrounds() {
_connection.loadInBrowser("loadNewgrounds");
}
static function loadOfficialVersion() {
if (_connection.assertInitialized()) {
_connection.loadInBrowser("loadOfficialVersion", false);
}
}
static function promptSignIn() {
if (_connection.assertInitialized()) {
getURL (PASSPORT_URL + _bridge.__get__widgetId(), "_blank");
_bridge.addEventListener(com.newgrounds.APIEvent.BRIDGE_EVENT_RECEIVED, onUserSignedIn, false, 0, true);
}
}
static function onUserSignedIn(e) {
_bridge.removeEventListener(com.newgrounds.APIEvent.BRIDGE_EVENT_RECEIVED, onUserSignedIn);
var _local1 = e.__get__data();
if (e.__get__success()) {
try {
if (_local1.NewgroundsAPI_UserName) {
_connection.username = _local1.NewgroundsAPI_UserName;
}
if (_local1.NewgroundsAPI_UserID) {
_connection.userId = _local1.NewgroundsAPI_UserID;
}
if (_local1.NewgroundsAPI_PublisherID) {
_connection.publisherId = _local1.NewgroundsAPI_PublisherID;
}
if (_local1.NewgroundsAPI_SessionID) {
_connection.sessionId = _local1.NewgroundsAPI_SessionID;
}
_connection.sendSimpleCommand("preloadSettings", onMetadataLoaded, {publisher_id:_connection.publisherId, user_id:_connection.userId});
} catch(error) {
}
com.newgrounds.Logger.logMessage(("User " + _connection.username) + " signed in.");
}
dispatchEvent(com.newgrounds.APIEvent.USER_SIGNED_IN, null, (e.__get__success() ? null : (com.newgrounds.APIEvent.ERROR_SIGN_IN_FAILED)));
}
static function loadMySite() {
if (_connection.assertInitialized()) {
_connection.loadInBrowser("loadMySite");
}
}
static function loadCustomLink(linkName) {
if (_connection.assertInitialized()) {
_connection.loadInBrowser("loadCustomLink", true, {link:linkName});
}
}
static function getMedal(medalName) {
return(_medals[medalName]);
}
static function unlockMedal(medalName) {
if (!assertConnected()) {
return(undefined);
}
var _local1 = _medals[medalName];
if (!_local1) {
com.newgrounds.Logger.logError(("No medal named \"" + medalName) + "\" w.");
return(undefined);
}
_local1.unlock();
}
static function onMedalUnlocked(event) {
if (event.__get__success()) {
var _local2 = com.newgrounds.Medal(event.__get__data());
var _local1;
if (hasUserSession) {
_local1 = loadLocal("medals_unlocked_" + username);
if (!_local1) {
_local1 = new Object();
}
_local1[_local2.__get__id()] = true;
saveLocal("medals_unlocked_" + username, _local1);
} else {
_local1 = loadLocal("medals_unlocked");
if (!_local1) {
_local1 = new Object();
}
_local1[com.newgrounds.Medal(event.__get__data()).__get__id()] = true;
saveLocal("medals_unlocked", _local1);
com.newgrounds.Logger.logMessage(("User instanceof not logged in. Medal \"" + _local2.__get__name()) + "\" unlocked locally.");
}
}
}
static function onMedalUnlockConfirmed(event) {
if (hasUserSession) {
var _local1 = loadLocal("medals_unlocked_" + username);
if (!_local1) {
_local1 = new Object();
} else {
delete _local1[com.newgrounds.Medal(event.__get__data()).__get__id()];
}
saveLocal("medals_unlocked_" + username, _local1);
}
}
static function clearLocalMedals() {
for (var _local2 in _medals) {
var _local1 = _medals[_local2];
_local1.setUnlocked(false);
}
if (!hasUserSession) {
saveLocal("medals_unlocked", new Object());
}
}
static function getScoreBoard(scoreBoardName) {
if (!assertConnected()) {
return(null);
}
return(_scoreBoards[scoreBoardName]);
}
static function loadScores(scoreBoardName, period, firstResult, numResults, tag) {
if (period == undefined) {
period = "All-Time";
}
if (firstResult == undefined) {
firstResult = 1;
}
if (numResults == undefined) {
numResults = 10;
}
if (tag == undefined) {
tag = null;
}
if (!assertConnected()) {
return(null);
}
var _local1 = _scoreBoards[scoreBoardName];
if (!_local1) {
com.newgrounds.Logger.logError(("No scoreboard named \"" + scoreBoardName) + "\" w.");
dispatchEvent(com.newgrounds.APIEvent.SCORES_LOADED, null, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT);
return(null);
}
_local1.__set__period(period);
_local1.__set__firstResult(firstResult);
_local1.__set__numResults(numResults);
_local1.__set__tag(tag);
_local1.loadScores();
return(_local1);
}
static function postScore(scoreBoardName, numericScore, tag) {
if (tag == undefined) {
tag = null;
}
if (!assertConnected()) {
return(undefined);
}
if (!hasUserSession) {
com.newgrounds.Logger.logError("The user must be logged-in to post a score.");
dispatchEvent(com.newgrounds.APIEvent.SCORE_POSTED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN);
return(undefined);
}
var _local1 = _scoreBoards[scoreBoardName];
if (!_local1) {
com.newgrounds.Logger.logError(("No scoreboard named \"" + scoreBoardName) + "\" w.");
dispatchEvent(com.newgrounds.APIEvent.SCORE_POSTED, null, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT);
return(undefined);
}
_local1.postScore(numericScore, tag);
}
static function getSaveGroup(groupName) {
if (!assertConnected()) {
return(null);
}
return(_saveGroups[groupName]);
}
static function getSaveGroupById(id) {
for (var _local3 in _saveGroups) {
var _local1 = _saveGroups[_local3];
if (_local1.__get__id() == id) {
return(_local1);
}
}
return(null);
}
static function createSaveFile(groupName) {
if (!assertConnected()) {
return(null);
}
var _local1 = getSaveGroup(groupName);
if (!_local1) {
com.newgrounds.Logger.logError(("The save group \"" + groupName) + "\" w found.");
return(null);
}
return(new com.newgrounds.SaveFile(_local1));
}
static function loadSaveFile(saveId, loadContents) {
if (loadContents == undefined) {
loadContents = true;
}
_connection.sendSimpleCommand("loadSaveFile", onFileLoaded, {save_id:saveId, get_contents:loadContents});
}
static function onFileLoaded(event) {
var _local2;
if (event.__get__success()) {
_local2 = com.newgrounds.SaveFile.fromObject(getSaveGroupById(event.__get__data().group_id), event.__get__data().file);
if (event.__get__data().get_contents) {
_local2.load();
} else {
dispatchEvent(com.newgrounds.APIEvent.FILE_LOADED, _local2);
}
} else {
com.newgrounds.Logger.logError("Unable to load file:", event.__get__error());
dispatchEvent(com.newgrounds.APIEvent.FILE_LOADED, null, event.__get__error());
}
}
static function createSaveQuery(groupName) {
if (!assertConnected()) {
return(null);
}
var _local1 = getSaveGroup(groupName);
if (!_local1) {
com.newgrounds.Logger.logError(("The save group \"" + groupName) + "\" w found.");
return(null);
}
var _local2 = new com.newgrounds.SaveQuery(_local1);
return(_local2);
}
static function createSaveQueryByDate(groupName, sortDescending) {
if (sortDescending == undefined) {
sortDescending = true;
}
var _local1 = createSaveQuery(groupName);
if (!_local1) {
return(null);
}
_local1.sortOn(com.newgrounds.SaveQuery.CREATED_ON, sortDescending);
return(_local1);
}
static function createSaveQueryByName(groupName, filename, exactMatch, sortDescending) {
if (exactMatch == undefined) {
exactMatch = false;
}
if (sortDescending == undefined) {
sortDescending = false;
}
var _local1 = createSaveQuery(groupName);
_local1.addCondition(com.newgrounds.SaveQuery.FILE_NAME, (exactMatch ? (com.newgrounds.SaveQuery.OPERATOR_EQUAL) : (com.newgrounds.SaveQuery.OPERATOR_CONTAINS)), filename);
return(_local1);
}
static function createSaveQueryByRating(groupName, ratingName, sortDescending) {
if (sortDescending == undefined) {
sortDescending = true;
}
var _local1 = createSaveQuery(groupName);
_local1.sortOn(ratingName, sortDescending);
return(_local1);
}
static function onRequestedFileLoaded(event) {
removeEventListener(com.newgrounds.APIEvent.FILE_LOADED, onRequestedFileLoaded);
if (event.__get__success()) {
var _local1 = event.__get__data();
if (_local1) {
dispatchEvent(com.newgrounds.APIEvent.FILE_REQUESTED, _local1);
}
}
}
static function addEventListener(eventType, listener, priority, useWeakReference) {
if (priority == undefined) {
priority = 0;
}
if (useWeakReference == undefined) {
useWeakReference = true;
}
_dispatcher.addEventListener(eventType, listener, false, priority, useWeakReference);
}
static function removeEventListener(eventType, listener) {
_dispatcher.removeEventListener(eventType, listener);
}
static function dispatchEvent(event, data, error) {
if (data == undefined) {
data = null;
}
if (error == undefined) {
error = null;
}
_dispatcher.dispatchEvent(new com.newgrounds.APIEvent(event, data, error));
}
static function saveLocal(saveId, saveData) {
try {
var _local3;
var _local2 = (("ng_ap_secure_" + _connection.trackerId) + "_") + com.newgrounds.crypto.RC4.encrypt(saveId, _connection.encryptionKey);
if (!_sharedObjects[saveId]) {
_sharedObjects[saveId] = SharedObject.getLocal(_local2);
}
_local3 = _sharedObjects[saveId];
_local3.data.data = encodeData(saveData);
} catch(_local) {
if (Error( /* Error999 */
) != null) {
var error = Error( /* Error999 */
);
com.newgrounds.Logger.logError("Unable to save local data.", error);
return(false);
}
Error( /* Error999 */
);
throw /* Error999 */
;
}
return(true);
}
static function loadLocal(saveId) {
try {
var _local1;
var _local3 = (("ng_ap_secure_" + _connection.trackerId) + "_") + com.newgrounds.crypto.RC4.encrypt(saveId, _connection.encryptionKey);
if (!_sharedObjects[saveId]) {
_sharedObjects[saveId] = SharedObject.getLocal(_local3);
}
_local1 = _sharedObjects[saveId];
if ((_local1 && (_local1.data)) && (_local1.data.data)) {
return(decodeData(_local1.data.data));
}
return(null);
} catch(error:Error) {
com.newgrounds.Logger.logError("Unable to load local data.", error);
}
return(null);
}
static function logCustomEvent(eventName) {
if (assertConnected()) {
com.newgrounds.Logger.logMessage("Logged event: " + eventName);
_connection.sendSimpleCommand("logCustomEvent", null, {event:eventName});
}
}
static function encodeData(data) {
if (!_connection.assertInitialized()) {
return(null);
}
return(com.newgrounds.crypto.RC4.encrypt(com.newgrounds.encoders.json.JSON.encode(data), _connection.encryptionKey));
}
static function decodeData(data) {
if (!_connection.assertInitialized()) {
return(null);
}
try {
return(com.newgrounds.encoders.json.JSON.decode(com.newgrounds.crypto.RC4.decrypt(data, _connection.encryptionKey)));
} catch(error:Error) {
}
return(null);
}
static function stopPendingCommands() {
com.newgrounds.APICommand.stopPendingCommands();
com.newgrounds.Logger.logMessage("Pending commands stopped.");
}
static function trimWhitespace(string) {
if (!string) {
return(null);
}
var _local3 = 0;
while (string.charAt(_local3) == " ") {
_local3++;
}
var _local1 = string.length - 1;
while ((string.charAt(_local1) == " ") && (_local1 >= 0)) {
_local1--;
}
return(string.slice(_local3, _local1 + 1));
}
static var VERSION = "3.2 AS2";
static var RELEASE_MODE = "releaseMode";
static var DEBUG_MODE_LOGGED_IN = "debugModeLoggedIn";
static var DEBUG_MODE_LOGGED_OUT = "debugModeLoggedOut";
static var DEBUG_MODE_NEW_VERSION = "debugModeNewVersion";
static var DEBUG_MODE_HOST_BLOCKED = "debugModeHostBlocked";
static var TEST_AD_FEED_URL = "http://www.ngads.com/adtest.php";
static var PASSPORT_URL = "https://www.newgrounds.com/login/remote/";
static var _dispatcher = new com.newgrounds.APIEventDispatcher();
static var _connection = new com.newgrounds.APIConnection();
static var _debugMode = DEBUG_MODE_LOGGED_IN;
static var _adsApproved = false;
static var _medals = new Object();
static var _medalsArray = [];
static var _scoreBoards = new Object();
static var _scoreBoardsArray = [];
static var _saveGroups = new Object();
static var _saveGroupsArray = [];
static var _sharedObjects = new Object();
}
Instance of Symbol 87 MovieClip "buttonTop" in Symbol 89 MovieClip Frame 1
onClipEvent (load) {
_height = 0;
}
Instance of Symbol 87 MovieClip "buttonTop" in Symbol 92 MovieClip Frame 1
onClipEvent (load) {
_height = 0;
}
Instance of Symbol 87 MovieClip "buttonTop" in Symbol 94 MovieClip Frame 1
onClipEvent (load) {
_height = 0;
}
Instance of Symbol 99 MovieClip in Symbol 101 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation + 10);
}
Symbol 103 MovieClip Frame 1
if (_root.disableAds()) {
this.swapDepths(_parent.getNextHighestDepth());
this.removeMovieClip();
}
if (_root.DTADS.DTADS_active == "true") {
DTADS_ranNr = 1 + random(parseInt(_root.DTADS.DTADS_nrOfAds));
if (_root.DTADS["DTADS_adXOffset" + DTADS_ranNr] != undefined) {
adBox._x = adBox._x + parseInt(_root.DTADS["DTADS_adXOffset" + DTADS_ranNr]);
}
if (_root.DTADS["DTADS_adYOffset" + DTADS_ranNr] != undefined) {
adBox._y = adBox._y + parseInt(_root.DTADS["DTADS_adYOffset" + DTADS_ranNr]);
}
loadMovie (_root.DTADS.DTADS_url + _root.DTADS["DTADS_adPic" + DTADS_ranNr], adBox);
this.onRelease = function () {
com.newgrounds.API.logCustomEvent("DTAD_click_" + DTADS_ranNr);
getURL (_root.DTADS["DTADS_adURL" + DTADS_ranNr], "_blank");
};
stop();
} else {
nextFrame();
}
Instance of Symbol 101 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.adBox._width != 0) {
this.swapDepths(_parent.getNextHighestDepth());
this.removeMovieClip();
}
}
Symbol 103 MovieClip Frame 2
if (useBigAds) {
trace("Using big ads");
var CPMStarPoolID = 58612;
} else {
var CPMStarPoolID = 56408;
}
var CPMStarSubPoolID = _root.DTADS.CPMStarSubPoolID;
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie((("http://server.cpmstar.com/adviewas2.swf?poolid=" + CPMStarPoolID) + "&subpoolid=") + CPMStarSubPoolID);
stop();
Symbol 111 MovieClip Frame 1
stop();
Instance of Symbol 106 MovieClip in Symbol 111 MovieClip Frame 1
onClipEvent (load) {
extraTimer = 0;
}
onClipEvent (enterFrame) {
extraTimer++;
if (extraTimer > 180) {
extraTimer = 180;
}
_xscale = (((_root.getBytesLoaded() / _root.getBytesTotal()) * 70) + ((extraTimer / 180) * 30));
if (_xscale >= 100) {
_parent.nextFrame();
}
}
Symbol 111 MovieClip Frame 2
stop();
_alpha = 70;
this.onRollOver = function () {
_alpha = 100;
};
this.onRollOut = function () {
_alpha = 70;
};
this.onRelease = function () {
_root.gotoAndStop(5);
};
Symbol 113 MovieClip Frame 1
stop();
if (!_root.disableTracking()) {
nextFrame();
}
Instance of Symbol 78 MovieClip [APIConnector] in Symbol 113 MovieClip Frame 2
//component parameters
onClipEvent (construct) {
apiId = "37420:4dhofVi1";
encryptionKey = "jHCsthWgcYD4Oa3mLSPzHYxZ2ZwgJzhi";
debugMode = "Off";
movieVersion = "1";
connectorType = "Invisible";
redirectOnNewVersion = false;
redirectOnHostBlocked = false;
adType = "Simple";
}
Symbol 118 MovieClip [bullet] Frame 1
stop();
Instance of Symbol 120 MovieClip [glow] "glow" in Symbol 133 MovieClip [droppedGun] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 163 MovieClip [explosion] Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
_root.playSound("explosionSound", _root.HUD._x + 300, _root.HUD._y + 200);
Symbol 163 MovieClip [explosion] Frame 33
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
Symbol 163 MovieClip [explosion] Frame 34
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
Symbol 163 MovieClip [explosion] Frame 35
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
Symbol 163 MovieClip [explosion] Frame 36
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
Symbol 163 MovieClip [explosion] Frame 37
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
Symbol 163 MovieClip [explosion] Frame 38
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
Symbol 163 MovieClip [explosion] Frame 39
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
Symbol 163 MovieClip [explosion] Frame 40
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
Symbol 174 MovieClip [g_arm1] Frame 1
if (_parent._parent.gfxNr != undefined) {
this.gotoAndStop(_parent._parent.gfxNr);
} else if (_parent._parent._parent.gfxNr != undefined) {
this.gotoAndStop(_parent._parent._parent.gfxNr);
} else if (gfxNr != undefined) {
this.gotoAndStop(gfxNr);
}
Symbol 185 MovieClip [g_arm2] Frame 1
if (_parent._parent.gfxNr != undefined) {
this.gotoAndStop(_parent._parent.gfxNr);
} else if (_parent._parent._parent.gfxNr != undefined) {
this.gotoAndStop(_parent._parent._parent.gfxNr);
} else if (gfxNr != undefined) {
this.gotoAndStop(gfxNr);
}
Symbol 196 MovieClip [g_body] Frame 1
if (_parent._parent.gfxNr != undefined) {
this.gotoAndStop(_parent._parent.gfxNr);
} else if (_parent._parent._parent.gfxNr != undefined) {
this.gotoAndStop(_parent._parent._parent.gfxNr);
} else if (gfxNr != undefined) {
this.gotoAndStop(gfxNr);
}
Symbol 205 MovieClip [g_foot] Frame 1
if (_parent._parent.gfxNr != undefined) {
this.gotoAndStop(_parent._parent.gfxNr);
} else if (_parent._parent._parent.gfxNr != undefined) {
this.gotoAndStop(_parent._parent._parent.gfxNr);
} else if (gfxNr != undefined) {
this.gotoAndStop(gfxNr);
}
Symbol 214 MovieClip [g_hand] Frame 1
if (_parent._parent.gfxNr != undefined) {
this.gotoAndStop(_parent._parent.gfxNr);
} else if (_parent._parent._parent.gfxNr != undefined) {
this.gotoAndStop(_parent._parent._parent.gfxNr);
} else if (gfxNr != undefined) {
this.gotoAndStop(gfxNr);
}
Symbol 225 MovieClip [g_head] Frame 1
if (_parent._parent.gfxNr != undefined) {
this.gotoAndStop(_parent._parent.gfxNr);
} else if (_parent._parent._parent.gfxNr != undefined) {
this.gotoAndStop(_parent._parent._parent.gfxNr);
} else if (gfxNr != undefined) {
this.gotoAndStop(gfxNr);
}
Symbol 232 MovieClip [g_leg1] Frame 1
if (_parent._parent.gfxNr != undefined) {
this.gotoAndStop(_parent._parent.gfxNr);
} else if (_parent._parent._parent.gfxNr != undefined) {
this.gotoAndStop(_parent._parent._parent.gfxNr);
} else if (gfxNr != undefined) {
this.gotoAndStop(gfxNr);
}
Symbol 239 MovieClip [g_leg2] Frame 1
if (_parent._parent.gfxNr != undefined) {
this.gotoAndStop(_parent._parent.gfxNr);
} else if (_parent._parent._parent.gfxNr != undefined) {
this.gotoAndStop(_parent._parent._parent.gfxNr);
} else if (gfxNr != undefined) {
this.gotoAndStop(gfxNr);
}
Symbol 240 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 241 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 241 MovieClip Frame 57
gotoAndPlay (8);
currentFrame = 8;
Symbol 242 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 242 MovieClip Frame 20
_parent.gunReady = true;
_parent.nextFrame();
Symbol 244 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 244 MovieClip Frame 40
gotoAndPlay (5);
currentFrame = 5;
Symbol 245 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 245 MovieClip Frame 40
gotoAndPlay (6);
currentFrame = 6;
Symbol 246 MovieClip Frame 1
stop();
Symbol 252 MovieClip Frame 1
this.gotoAndStop(_parent.weapon);
stop();
Instance of Symbol 250 MovieClip "arm2" in Symbol 252 MovieClip Frame 6
onClipEvent (enterFrame) {
_rotation = _parent.arm._rotation;
}
Symbol 253 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 253 MovieClip Frame 3
_parent.dead = true;
Symbol 253 MovieClip Frame 21
stop();
Symbol 253 MovieClip Frame 22
stop();
currentFrame = 21;
Symbol 253 MovieClip Frame 23
stop();
currentFrame = 21;
Symbol 253 MovieClip Frame 24
stop();
currentFrame = 21;
Symbol 254 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 254 MovieClip Frame 3
_parent.dead = true;
Symbol 254 MovieClip Frame 23
stop();
currentFrame = 23;
Symbol 254 MovieClip Frame 24
stop();
currentFrame = 23;
Symbol 254 MovieClip Frame 25
stop();
currentFrame = 23;
Symbol 254 MovieClip Frame 26
stop();
currentFrame = 23;
Symbol 254 MovieClip Frame 27
stop();
currentFrame = 23;
Symbol 254 MovieClip Frame 28
stop();
currentFrame = 23;
Symbol 255 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 255 MovieClip Frame 42
_parent.gunReady = true;
_parent.gotoAndStop(4);
Symbol 256 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 256 MovieClip Frame 42
_parent.gunReady = true;
_parent.gotoAndStop(4);
Symbol 257 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 257 MovieClip Frame 20
_parent.gunReady = true;
_parent.gotoAndStop(4);
Symbol 258 MovieClip [gangster] Frame 1
stop();
Symbol 262 MovieClip [glasPiece] Frame 1
gotoAndStop(random(5));
Symbol 281 MovieClip [muzzle] Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
_alpha = (50 + random(20));
Symbol 281 MovieClip [muzzle] Frame 10
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
Symbol 284 MovieClip [shell] Frame 1
stop();
Symbol 292 MovieClip Frame 1
startRotation = _rotation;
frameTimer = 0;
onEnterFrame = function () {
frameTimer = frameTimer + _root.timescale;
if (frameTimer >= 1) {
_rotation = ((startRotation - 10) + random(20));
frameTimer = 0;
}
};
Symbol 295 MovieClip [banana] Frame 1
ySpeed = 0;
startY = _y - 9;
if (!disableSpawnEffect) {
_root.addGlow(_x, _y, 100, 300);
_root.addSparks(_x, _y, 20);
_yscale = 1;
_xscale = 1;
}
onEnterFrame = function () {
ySpeed = ySpeed + (((startY - _y) * 0.01) * _root.timescale);
_y = (_y + (ySpeed * _root.timescale));
if (!disableSpawnEffect) {
_yscale = (_yscale + ((100 - _xscale) * 0.3));
_xscale = (_yscale + ((100 - _xscale) * 0.3));
}
_root.speechBubble.xPos = _x;
_root.speechBubble.yPos = _y;
};
Instance of Symbol 294 MovieClip "banana" in Symbol 295 MovieClip [banana] Frame 1
onClipEvent (load) {
ySpeed = 0;
yPos = 13;
}
onClipEvent (enterFrame) {
ySpeed = ySpeed + (((-yPos) * 0.002) * _root.timescale);
yPos = yPos + (ySpeed * _root.timescale);
_rotation = (_rotation + (ySpeed * _root.timescale));
}
Symbol 324 MovieClip Frame 1
stop();
Symbol 325 MovieClip [controlHint] Frame 1
_yscale = 0;
_xscale = 0;
scaleSpeed = 0;
xOffset = (xOffset2 = 0);
scaleTarget = 100;
stop();
followObj = "playerL";
yOffset = 60;
onEnterFrame = function () {
_x = (_root[followObj]._x + xOffset2);
_y = (_root[followObj]._y - yOffset);
if (_y < (((-_root._y) + 80) + yOffset)) {
_y = (((-_root._y) + 80) + yOffset);
if (_root.mouseXPos < ((-_root._x) + 300)) {
xOffset = 100;
} else {
xOffset = -100;
}
} else {
xOffset = 0;
}
if (_x < ((-_root._x) + 60)) {
_x = ((-_root._x) + 60);
} else if (_x > ((-_root._x) + 540)) {
_x = ((-_root._x) + 540);
}
xOffset2 = xOffset2 + ((xOffset - xOffset2) * 0.2);
pointer._rotation = _root.getAngle(_x, _y - 90, _root[followObj]._x, _root[followObj]._y - 10) + 90;
scaleSpeed = scaleSpeed + ((scaleTarget - _yscale) * 0.25);
scaleSpeed = scaleSpeed * 0.6;
_yscale = (_yscale + scaleSpeed);
_xscale = (_yscale + scaleSpeed);
if ((_yscale <= 0) && (scaleTarget == 0)) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
};
Symbol 325 MovieClip [controlHint] Frame 2
followObj = "crosshair";
yOffset = 20;
_yscale = 0;
_xscale = 0;
scaleSpeed = 0;
xOffset = (xOffset2 = 0);
scaleTarget = 100;
stop();
onEnterFrame = function () {
_x = (_root[followObj]._x + xOffset2);
_y = (_root[followObj]._y - yOffset);
if (_y < (((-_root._y) + 80) + yOffset)) {
_y = (((-_root._y) + 80) + yOffset);
if (_root.mouseXPos < ((-_root._x) + 300)) {
xOffset = 100;
} else {
xOffset = -100;
}
} else {
xOffset = 0;
}
if (_x < ((-_root._x) + 60)) {
_x = ((-_root._x) + 60);
} else if (_x > ((-_root._x) + 540)) {
_x = ((-_root._x) + 540);
}
xOffset2 = xOffset2 + ((xOffset - xOffset2) * 0.2);
pointer._rotation = _root.getAngle(_x, _y - 90, _root[followObj]._x, _root[followObj]._y - 10) + 90;
scaleSpeed = scaleSpeed + ((scaleTarget - _yscale) * 0.25);
scaleSpeed = scaleSpeed * 0.6;
_yscale = (_yscale + scaleSpeed);
_xscale = (_yscale + scaleSpeed);
if ((_yscale <= 0) && (scaleTarget == 0)) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
};
Symbol 325 MovieClip [controlHint] Frame 3
_yscale = 0;
_xscale = 0;
scaleSpeed = 0;
xOffset = (xOffset2 = 0);
scaleTarget = 100;
stop();
followObj = "playerL";
yOffset = 60;
onEnterFrame = function () {
_x = (_root[followObj]._x + xOffset2);
_y = (_root[followObj]._y - yOffset);
if (_y < (((-_root._y) + 80) + yOffset)) {
_y = (((-_root._y) + 80) + yOffset);
if (_root.mouseXPos < ((-_root._x) + 300)) {
xOffset = 100;
} else {
xOffset = -100;
}
} else {
xOffset = 0;
}
if (_x < ((-_root._x) + 60)) {
_x = ((-_root._x) + 60);
} else if (_x > ((-_root._x) + 540)) {
_x = ((-_root._x) + 540);
}
xOffset2 = xOffset2 + ((xOffset - xOffset2) * 0.2);
pointer._rotation = _root.getAngle(_x, _y - 90, _root[followObj]._x, _root[followObj]._y - 10) + 90;
scaleSpeed = scaleSpeed + ((scaleTarget - _yscale) * 0.25);
scaleSpeed = scaleSpeed * 0.6;
_yscale = (_yscale + scaleSpeed);
_xscale = (_yscale + scaleSpeed);
if ((_yscale <= 0) && (scaleTarget == 0)) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
};
Symbol 325 MovieClip [controlHint] Frame 4
followObj = "crosshair";
yOffset = 20;
_yscale = 0;
_xscale = 0;
scaleSpeed = 0;
xOffset = (xOffset2 = 0);
scaleTarget = 100;
stop();
timer = 0;
onEnterFrame = function () {
timer++;
if (timer > 30) {
if (_root.mousePress) {
scaleTarget = 0;
}
}
_x = (_root[followObj]._x + xOffset2);
_y = (_root[followObj]._y - yOffset);
if (_y < (((-_root._y) + 80) + yOffset)) {
_y = (((-_root._y) + 80) + yOffset);
if (_root.mouseXPos < ((-_root._x) + 300)) {
xOffset = 100;
} else {
xOffset = -100;
}
} else {
xOffset = 0;
}
if (_x < ((-_root._x) + 60)) {
_x = ((-_root._x) + 60);
} else if (_x > ((-_root._x) + 540)) {
_x = ((-_root._x) + 540);
}
xOffset2 = xOffset2 + ((xOffset - xOffset2) * 0.2);
pointer._rotation = _root.getAngle(_x, _y - 90, _root[followObj]._x, _root[followObj]._y - 10) + 90;
scaleSpeed = scaleSpeed + ((scaleTarget - _yscale) * 0.25);
scaleSpeed = scaleSpeed * 0.6;
_yscale = (_yscale + scaleSpeed);
_xscale = (_yscale + scaleSpeed);
if ((_yscale <= 0) && (scaleTarget == 0)) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
};
Symbol 325 MovieClip [controlHint] Frame 5
_yscale = 0;
_xscale = 0;
scaleSpeed = 0;
xOffset = (xOffset2 = 0);
scaleTarget = 100;
stop();
followObj = "playerL";
yOffset = 60;
onEnterFrame = function () {
_x = (_root[followObj]._x + xOffset2);
_y = (_root[followObj]._y - yOffset);
if (_y < (((-_root._y) + 80) + yOffset)) {
_y = (((-_root._y) + 80) + yOffset);
if (_root.mouseXPos < ((-_root._x) + 300)) {
xOffset = 100;
} else {
xOffset = -100;
}
} else {
xOffset = 0;
}
if (_x < ((-_root._x) + 60)) {
_x = ((-_root._x) + 60);
} else if (_x > ((-_root._x) + 540)) {
_x = ((-_root._x) + 540);
}
xOffset2 = xOffset2 + ((xOffset - xOffset2) * 0.2);
pointer._rotation = _root.getAngle(_x, _y - 90, _root[followObj]._x, _root[followObj]._y - 10) + 90;
scaleSpeed = scaleSpeed + ((scaleTarget - _yscale) * 0.25);
scaleSpeed = scaleSpeed * 0.6;
_yscale = (_yscale + scaleSpeed);
_xscale = (_yscale + scaleSpeed);
if ((_yscale <= 0) && (scaleTarget == 0)) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
};
Symbol 325 MovieClip [controlHint] Frame 6
_yscale = 0;
_xscale = 0;
scaleSpeed = 0;
xOffset = (xOffset2 = 0);
scaleTarget = 100;
stop();
followObj = "playerL";
yOffset = 60;
onEnterFrame = function () {
if (_root.kShift) {
slowDownHint.gotoAndStop(2);
if (!_root.playerL.aniOnGround) {
slowDownHint.gotoAndStop(3);
}
} else {
slowDownHint.gotoAndStop(1);
}
_x = (_root[followObj]._x + xOffset2);
_y = (_root[followObj]._y - yOffset);
if (_y < (((-_root._y) + 80) + yOffset)) {
_y = (((-_root._y) + 80) + yOffset);
if (_root.mouseXPos < ((-_root._x) + 300)) {
xOffset = 100;
} else {
xOffset = -100;
}
} else {
xOffset = 0;
}
if (_x < ((-_root._x) + 60)) {
_x = ((-_root._x) + 60);
} else if (_x > ((-_root._x) + 540)) {
_x = ((-_root._x) + 540);
}
xOffset2 = xOffset2 + ((xOffset - xOffset2) * 0.2);
pointer._rotation = _root.getAngle(_x, _y - 90, _root[followObj]._x, _root[followObj]._y - 10) + 90;
scaleSpeed = scaleSpeed + ((scaleTarget - _yscale) * 0.25);
scaleSpeed = scaleSpeed * 0.6;
_yscale = (_yscale + scaleSpeed);
_xscale = (_yscale + scaleSpeed);
if ((_yscale <= 0) && (scaleTarget == 0)) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
};
Symbol 343 MovieClip Frame 1
stop();
Symbol 354 MovieClip Frame 1
stop();
onEnterFrame = (onLoad = function () {
this.gotoAndStop(_root.player.headP);
});
Symbol 357 MovieClip Frame 85
_root.playSound("static_1", (-_root._x) + 300, (-_root._y) + 200);
Symbol 357 MovieClip Frame 115
_root.playSound("static_3", (-_root._x) + 300, (-_root._y) + 200);
Symbol 357 MovieClip Frame 118
_root.playSound("static_1", (-_root._x) + 300, (-_root._y) + 200);
Symbol 357 MovieClip Frame 151
_root.playSound("static_1", (-_root._x) + 300, (-_root._y) + 200);
Symbol 357 MovieClip Frame 167
_root.playSound("static_3", (-_root._x) + 300, (-_root._y) + 200);
Symbol 357 MovieClip Frame 182
_root.playSound("static_2", (-_root._x) + 300, (-_root._y) + 200);
Symbol 357 MovieClip Frame 196
_root.playSound("static_1", (-_root._x) + 300, (-_root._y) + 200);
Symbol 357 MovieClip Frame 201
_root.playSound("static_3", (-_root._x) + 300, (-_root._y) + 200);
Symbol 357 MovieClip Frame 206
_root.playSound("beep", (-_root._x) + 300, (-_root._y) + 200);
Symbol 357 MovieClip Frame 260
_parent.gotoAndStop(2);
Symbol 361 MovieClip Frame 405
_root.levelComplete = true;
_root.fadeToDark = true;
Symbol 362 MovieClip [endGameAnim] Frame 1
stop();
_root.addGlow(_x + 40, _y - 10, 300, 90);
_root.hiddenMusicVolume = 0.2;
Symbol 380 MovieClip Frame 1
onEnterFrame = function () {
if (_root.playerL.dead == true) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};
Symbol 381 MovieClip [endGameCredits] Frame 1
_alpha = 0;
timer = 30;
ySpeed = 0.1;
Mouse.show();
onEnterFrame = function () {
if (_alpha > 100) {
_alpha = 100;
} else {
_alpha = (_alpha + 3);
}
timer++;
if (timer == 60) {
YOU._visible = true;
} else if (timer == 80) {
WIN._visible = true;
} else if (timer > 170) {
ySpeed = ySpeed * 1.1;
if (ySpeed > 2) {
ySpeed = 2;
}
_y = (_y - ySpeed);
if (_y < (((-_root._y) - _height) + 400)) {
advert.gotoAndStop(2);
advert.onEnterFrame = undefined;
_y = (((-_root._y) - _height) + 400);
Mouse.show();
this.onEnterFrame = undefined;
}
}
};
Instance of Symbol 368 MovieClip "YOU" in Symbol 381 MovieClip [endGameCredits] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 370 MovieClip "WIN" in Symbol 381 MovieClip [endGameCredits] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 373 MovieClip in Symbol 381 MovieClip [endGameCredits] Frame 1
on (release) {
_root.gotoAndPlay(5);
}
Instance of Symbol 375 MovieClip in Symbol 381 MovieClip [endGameCredits] Frame 1
on (release) {
_root.getURL("http://games.adultswim.com", "_blank");
}
Instance of Symbol 377 MovieClip in Symbol 381 MovieClip [endGameCredits] Frame 1
on (release) {
_root.getURL("http://www.deadtoast.com", "_blank");
}
Symbol 398 MovieClip Frame 1
_visible = false;
Symbol 408 MovieClip Frame 1
stop();
Symbol 410 MovieClip [newWeapon] Frame 1
timer = 0;
onEnterFrame = function () {
timer++;
if (timer >= 120) {
this.swapDepths(_parent.getNextHighestDepth());
this.removeMovieClip();
}
};
Symbol 419 MovieClip Frame 1
stop();
Symbol 422 MovieClip [speechBubble] Frame 1
var sepText = new Array();
lastSep = 0;
curText = 0;
c = 0;
while (c <= inputText.length) {
if ((inputText.charAt(c) == "|") || (c == inputText.length)) {
sepText.push(inputText.slice(lastSep, c));
lastSep = c + 1;
}
c++;
}
skipTimer = 10 + (sepText[curText].length * 0.3);
speechText.speechText.autoSize = true;
speechText.speechText.text = sepText[curText];
if (speechText._width > 500) {
speechText._width = 500;
speechText._yscale = speechText._xscale;
}
speechText._x = (-speechText._width) / 2;
middle._width = speechText._width;
left._x = middle._x - (middle._width / 2);
right._x = middle._x + (middle._width / 2);
_yscale = _root.gameCamera._xscale;
_xscale = _root.gameCamera._xscale;
if (xPos > _x) {
_x = (xPos - ((middle._width / 2) * (_xscale / 100)));
} else {
_x = (xPos + ((middle._width / 2) * (_xscale / 100)));
}
_y = (yPos - (100 * (_xscale / 100)));
if ((_x - (middle._width / 2)) < ((-_root._x) + 40)) {
_x = (((middle._width / 2) - _root._x) + 40);
} else if ((_x + (middle._width / 2)) > ((-_root._x) + 560)) {
_x = (((-_root._x) + 560) - (middle._width / 2));
}
if (_y < (-_root._y)) {
_y = (-_root._y);
} else if (_y > ((-_root._y) + 400)) {
_y = ((-_root._y) + 400);
}
pointer.pointerIn._height = (_root.getDist(_x, xPos, _y, yPos) - 40) * (100 / _xscale);
pointer._rotation = _root.getAngle(_x, _y, xPos, yPos) + 90;
buttonPrompt._x = right._x + 25;
skipTextButtonDown = true;
offScreenTimer = 60;
if (!allowSkip) {
buttonPrompt._visible = false;
}
_root.hiddenMusicVolume = 0.3;
gibberishNr = 1 + random(4);
i = 1;
while (i <= 4) {
_root.soundFX["soundgibberish_1_" + i].stop();
i++;
}
_root.playSound("gibberish_1_" + gibberishNr, _x, _y);
gibberishNr++;
if (gibberishNr > 4) {
gibberishNr = 1;
}
onEnterFrame = function () {
if (!_root.showOptions) {
if (timeVisible != undefined) {
timeVisible--;
if (timeVisible <= 0) {
_root.hiddenMusicVolume = 1;
_root.removeSpeechBubble();
}
}
skipTimer--;
if (allowSkip && (skipTimer <= 0)) {
buttonPrompt.gotoAndStop(2);
if (skipTextButton) {
curText++;
if (curText >= sepText.length) {
_root.pausePlayer = false;
Mouse.hide();
_root.hiddenMusicVolume = 1;
_root.gunTimer = 20;
i = 1;
while (i <= 4) {
_root.soundFX["soundgibberish_1_" + i].stop();
i++;
}
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
i = 1;
while (i <= 4) {
_root.soundFX["soundgibberish_1_" + i].stop();
i++;
}
_root.playSound("gibberish_1_" + gibberishNr, _x, _y);
gibberishNr++;
if (gibberishNr > 4) {
gibberishNr = 1;
}
speechText.speechText.text = sepText[curText];
speechText._xscale = (speechText._yscale = 100);
if (speechText._width > 500) {
speechText._width = 500;
speechText._yscale = speechText._xscale;
}
speechText._x = (-speechText._width) / 2;
middle._width = speechText._width;
left._x = middle._x - (middle._width / 2);
right._x = middle._x + (middle._width / 2);
if (xPos > _x) {
_x = (xPos - ((middle._width / 2) * (_xscale / 100)));
} else {
_x = (xPos + ((middle._width / 2) * (_xscale / 100)));
}
skipTimer = 10 + (sepText[curText].length * 0.3);
buttonPrompt.gotoAndStop(1);
skipTextButton = false;
}
}
if (xPos > _x) {
_x = (_x + (((xPos - ((middle._width / 2) * (_xscale / 100))) - _x) * 0.2));
} else {
_x = (_x + (((xPos + ((middle._width / 2) * (_xscale / 100))) - _x) * 0.2));
}
_y = (_y + (((yPos - (100 * (_xscale / 100))) - _y) * 0.2));
if ((_x - (middle._width / 2)) < ((-_root._x) + 40)) {
_x = (((middle._width / 2) - _root._x) + 40);
} else if ((_x + (middle._width / 2)) > ((-_root._x) + 560)) {
_x = (((-_root._x) + 560) - (middle._width / 2));
}
if (_y < (-_root._y)) {
_y = (-_root._y);
} else if (_y > ((-_root._y) + 400)) {
_y = ((-_root._y) + 400);
}
buttonPrompt._x = right._x + 25;
pointer.pointerIn._height = (_root.getDist(_x, xPos, _y, yPos) - 40) * (100 / _xscale);
pointer._rotation = _root.getAngle(_x, _y, xPos, yPos) + 90;
}
};
Instance of Symbol 419 MovieClip "buttonPrompt" in Symbol 422 MovieClip [speechBubble] Frame 1
on (release) {
_parent.skipTextButton = true;
}
Symbol 486 MovieClip Frame 1
stop();
Symbol 507 MovieClip Frame 1
stop();
Instance of Symbol 84 MovieClip in Symbol 523 MovieClip Frame 1
on (release) {
com.newgrounds.API.logCustomEvent("Credits_DT_logo");
getURL ("http://www.deadtoast.com", "_blank");
}
Instance of Symbol 89 MovieClip in Symbol 523 MovieClip Frame 1
on (release) {
hover = true;
com.newgrounds.API.logCustomEvent("Credits_Facebook");
getURL ("https://www.facebook.com/DeadtoastCom", "_blank");
}
on (press) {
buttonTop._yscale = 0;
hover = false;
}
on (rollOver) {
hover = true;
}
on (rollOut) {
hover = false;
}
onClipEvent (load) {
startY = _y;
hover = false;
}
onClipEvent (enterFrame) {
if (hover) {
buttonTop._yscale = buttonTop._yscale + ((100 - buttonTop._yscale) * 0.2);
} else {
buttonTop._yscale = buttonTop._yscale + ((-buttonTop._yscale) * 0.3);
}
_y = (startY + buttonTop._height);
}
Instance of Symbol 92 MovieClip in Symbol 523 MovieClip Frame 1
on (release) {
hover = true;
com.newgrounds.API.logCustomEvent("Credits_Weblink");
getURL ("http://www.deadtoast.com", "_blank");
}
on (press) {
buttonTop._yscale = 0;
hover = false;
}
on (rollOver) {
hover = true;
}
on (rollOut) {
hover = false;
}
onClipEvent (load) {
startY = _y;
hover = false;
}
onClipEvent (enterFrame) {
if (hover) {
buttonTop._yscale = buttonTop._yscale + ((100 - buttonTop._yscale) * 0.2);
} else {
buttonTop._yscale = buttonTop._yscale + ((-buttonTop._yscale) * 0.3);
}
_y = (startY + buttonTop._height);
}
Instance of Symbol 94 MovieClip in Symbol 523 MovieClip Frame 1
on (release) {
hover = true;
com.newgrounds.API.logCustomEvent("Credits_Twitter");
getURL ("https://twitter.com/deadtoast_com", "_blank");
}
on (press) {
buttonTop._yscale = 0;
hover = false;
}
on (rollOver) {
hover = true;
}
on (rollOut) {
hover = false;
}
onClipEvent (load) {
startY = _y;
hover = false;
}
onClipEvent (enterFrame) {
if (hover) {
buttonTop._yscale = buttonTop._yscale + ((100 - buttonTop._yscale) * 0.2);
} else {
buttonTop._yscale = buttonTop._yscale + ((-buttonTop._yscale) * 0.3);
}
_y = (startY + buttonTop._height);
}
Instance of Symbol 522 MovieClip in Symbol 523 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = (_alpha + ((100 - _alpha) * 0.2));
} else {
_alpha = (_alpha + ((60 - _alpha) * 0.2));
}
}
on (release) {
_parent._parent.gotoAndStop(1);
}
Instance of Symbol 398 MovieClip in Symbol 523 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = true;
_alpha = 0;
this.onEnterFrame = function () {
};
}
on (release) {
getURL ("http://www.thelivingtombstone.com", "_blank");
}
Instance of Symbol 80 MovieClip in Symbol 523 MovieClip Frame 1
on (release) {
getURL ("http://games.adultswim.com", "_blank");
}
Symbol 533 MovieClip Frame 1
if (nr != undefined) {
if (_root.savedData.data["achievement" + nr]) {
_alpha = 100;
} else {
_alpha = 20;
}
this.gotoAndStop(nr);
} else {
_alpha = 100;
}
Symbol 567 MovieClip Frame 1
stop();
Symbol 568 MovieClip Frame 1
stop();
Instance of Symbol 490 MovieClip in Symbol 568 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = (_alpha + ((100 - _alpha) * 0.2));
} else {
_alpha = (_alpha + ((60 - _alpha) * 0.2));
}
}
on (release) {
com.newgrounds.API.logCustomEvent("Main_New_Game");
_root.fade.onEnterFrame = function () {
if (this._alpha > 100) {
_root.gotoAndPlay(_root._currentframe + 3);
}
this._alpha = this._alpha + 4;
};
}
Instance of Symbol 492 MovieClip "continueButton" in Symbol 568 MovieClip Frame 1
onClipEvent (load) {
if (_root.savedData.data.lastSavedFrame == undefined) {
_alpha = 10;
} else {
this.onEnterFrame = function () {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = (_alpha + ((100 - _alpha) * 0.2));
} else {
_alpha = (_alpha + ((60 - _alpha) * 0.2));
}
};
this.onRelease = function () {
com.newgrounds.API.logCustomEvent("Main_Continue");
_root.fade.onEnterFrame = function () {
if (this._alpha > 100) {
_root.loadState();
_root.saveTempState();
_root.play();
}
this._alpha = this._alpha + 4;
};
};
}
}
Instance of Symbol 494 MovieClip in Symbol 568 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = (_alpha + ((100 - _alpha) * 0.2));
} else {
_alpha = (_alpha + ((60 - _alpha) * 0.2));
}
}
on (release) {
getURL ("http://games.adultswim.com", "_blank");
}
Instance of Symbol 498 MovieClip in Symbol 568 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = (_alpha + ((100 - _alpha) * 0.2));
} else {
_alpha = (_alpha + ((60 - _alpha) * 0.2));
}
}
on (release) {
com.newgrounds.API.logCustomEvent("Main_Credits");
_parent.gotoAndStop(2);
}
Instance of Symbol 500 MovieClip in Symbol 568 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = (_alpha + ((100 - _alpha) * 0.2));
} else {
_alpha = (_alpha + ((60 - _alpha) * 0.2));
}
}
on (release) {
getURL ("http://games.adultswim.com", "_blank");
}
Instance of Symbol 502 MovieClip in Symbol 568 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = (_alpha + ((100 - _alpha) * 0.2));
} else {
_alpha = (_alpha + ((60 - _alpha) * 0.2));
}
}
on (release) {
if (!Key.isDown(85)) {
_root.savedData.clear();
_root.killsAfterWallJump = 0;
_root.midAirKills = 0;
_root.knifeKills = 0;
_root.nrOfHeadShots = 0;
_root.nrOfGibs = 0;
_parent.continueButton.onEnterFrame = undefined;
_parent.continueButton.onRelease = undefined;
_parent.continueButton._alpha = 10;
_root.cheatUnlockAllLevels = false;
} else {
_root.cheatUnlockAllLevels = true;
}
}
Instance of Symbol 504 MovieClip in Symbol 568 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = (_alpha + ((100 - _alpha) * 0.2));
} else {
_alpha = (_alpha + ((60 - _alpha) * 0.2));
}
}
on (release) {
com.newgrounds.API.logCustomEvent("Main_Achievements");
_parent.gotoAndStop(3);
}
Instance of Symbol 507 MovieClip in Symbol 568 MovieClip Frame 1
onClipEvent (load) {
if (_root.musicVolume == undefined) {
prevMusicVolume = 100;
} else {
prevMusicVolume = _root.musicVolume;
}
if (_root.SFXVolume == undefined) {
prevSFXVolume = 100;
} else {
prevSFXVolume = _root.SFXVolume;
}
if (_root.musicVolume == 0) {
this.gotoAndStop(2);
}
}
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = (_alpha + ((100 - _alpha) * 0.2));
} else {
_alpha = (_alpha + ((60 - _alpha) * 0.2));
}
}
on (release) {
if (this._currentframe == 1) {
_root.musicVolume = 0;
_root.SFXVolume = 0;
_root.musicMC.bgMusic.setVolume(0);
this.gotoAndStop(2);
} else {
_root.musicVolume = prevMusicVolume;
_root.SFXVolume = prevSFXVolume;
if (prevMusicVolume > 0) {
_root.musicMC.bgMusic.setVolume(prevMusicVolume * 100);
} else {
_root.musicMC.bgMusic.setVolume(50);
}
this.gotoAndStop(1);
}
}
Instance of Symbol 509 MovieClip in Symbol 568 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = (_alpha + ((100 - _alpha) * 0.2));
} else {
_alpha = (_alpha + ((60 - _alpha) * 0.2));
}
}
on (release) {
com.newgrounds.API.logCustomEvent("Main_Level_Select");
_parent.gotoAndStop(4);
}
Instance of Symbol 513 MovieClip in Symbol 568 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = (_alpha + ((100 - _alpha) * 0.2));
} else {
_alpha = (_alpha + ((60 - _alpha) * 0.2));
}
}
on (release) {
getURL ("http://www.deadtoast.com", "_blank");
com.newgrounds.API.logCustomEvent("Main_DT_logo_link");
}
Instance of Symbol 89 MovieClip in Symbol 568 MovieClip Frame 1
on (release) {
hover = true;
getURL ("https://www.facebook.com/DeadtoastCom", "_blank");
com.newgrounds.API.logCustomEvent("Main_Facebook");
}
on (press) {
buttonTop._yscale = 0;
hover = false;
}
on (rollOver) {
hover = true;
}
on (rollOut) {
hover = false;
}
onClipEvent (load) {
startY = _y;
hover = false;
}
onClipEvent (enterFrame) {
if (hover) {
buttonTop._yscale = buttonTop._yscale + ((100 - buttonTop._yscale) * 0.2);
} else {
buttonTop._yscale = buttonTop._yscale + ((-buttonTop._yscale) * 0.3);
}
_y = (startY + buttonTop._height);
}
Instance of Symbol 92 MovieClip in Symbol 568 MovieClip Frame 1
on (release) {
hover = true;
getURL ("http://www.deadtoast.com", "_blank");
com.newgrounds.API.logCustomEvent("Main_Weblink");
}
on (press) {
buttonTop._yscale = 0;
hover = false;
}
on (rollOver) {
hover = true;
}
on (rollOut) {
hover = false;
}
onClipEvent (load) {
startY = _y;
hover = false;
}
onClipEvent (enterFrame) {
if (hover) {
buttonTop._yscale = buttonTop._yscale + ((100 - buttonTop._yscale) * 0.2);
} else {
buttonTop._yscale = buttonTop._yscale + ((-buttonTop._yscale) * 0.3);
}
_y = (startY + buttonTop._height);
}
Instance of Symbol 94 MovieClip in Symbol 568 MovieClip Frame 1
on (release) {
hover = true;
getURL ("https://twitter.com/deadtoast_com", "_blank");
com.newgrounds.API.logCustomEvent("Main_Twitter");
}
on (press) {
buttonTop._yscale = 0;
hover = false;
}
on (rollOver) {
hover = true;
}
on (rollOut) {
hover = false;
}
onClipEvent (load) {
startY = _y;
hover = false;
}
onClipEvent (enterFrame) {
if (hover) {
buttonTop._yscale = buttonTop._yscale + ((100 - buttonTop._yscale) * 0.2);
} else {
buttonTop._yscale = buttonTop._yscale + ((-buttonTop._yscale) * 0.3);
}
_y = (startY + buttonTop._height);
}
Instance of Symbol 522 MovieClip in Symbol 568 MovieClip Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = (_alpha + ((100 - _alpha) * 0.2));
} else {
_alpha = (_alpha + ((60 - _alpha) * 0.2));
}
}
on (release) {
_parent.gotoAndStop(1);
}
Instance of Symbol 533 MovieClip in Symbol 568 MovieClip Frame 3
onClipEvent (load) {
nr = 1;
}
Instance of Symbol 533 MovieClip in Symbol 568 MovieClip Frame 3
onClipEvent (load) {
nr = 2;
}
Instance of Symbol 533 MovieClip in Symbol 568 MovieClip Frame 3
onClipEvent (load) {
nr = 3;
}
Instance of Symbol 533 MovieClip in Symbol 568 MovieClip Frame 3
onClipEvent (load) {
nr = 4;
}
Instance of Symbol 533 MovieClip in Symbol 568 MovieClip Frame 3
onClipEvent (load) {
nr = 5;
}
Instance of Symbol 533 MovieClip in Symbol 568 MovieClip Frame 3
onClipEvent (load) {
nr = 6;
}
Instance of Symbol 567 MovieClip in Symbol 568 MovieClip Frame 4
onClipEvent (load) {
if (_root.cheatUnlockAllLevels || ((_root.savedData.data.lastSavedFrame >= 14) && (_root.savedData.data.lastSavedFrame != undefined))) {
alphaTarget = 30;
this.onEnterFrame = function () {
_alpha = (_alpha + ((alphaTarget - _alpha) * 0.3));
};
this.onRollOver = function () {
alphaTarget = 0;
};
this.onRollOut = function () {
alphaTarget = 30;
};
_alpha = 30;
this.gotoAndStop(2);
this.onRelease = function () {
_root.fade.onEnterFrame = function () {
if (this._alpha > 100) {
_root.levelSelectNr = 13;
_root.loadState();
_root.weapon = 3;
_root.weapon1Active = true;
_root.ammo1 = 0;
_root.ammo1Total = 0;
_root.ammo1Max = 0;
_root.weapon2Active = true;
_root.ammo2 = 18;
_root.ammo2Total = 324;
_root.ammo2Max = 18;
_root.weapon3Active = true;
_root.ammo3 = 36;
_root.ammo3Total = ammo2Total;
_root.ammo3Max = 36;
_root.weapon4Active = false;
_root.ammo4 = 32;
_root.ammo4Total = 0;
_root.ammo4Max = 32;
_root.weapon5Active = false;
_root.ammo5 = 64;
_root.ammo5Total = ammo4Total;
_root.ammo5Max = 64;
_root.weapon6Active = false;
_root.ammo6 = 8;
_root.ammo6Total = 0;
_root.ammo6Max = 8;
_root.weapon7Active = false;
_root.ammo7 = 30;
_root.ammo7Total = 0;
_root.ammo7Max = 30;
_root.saveTempState();
_root.play();
}
this._alpha = this._alpha + 4;
};
};
}
}
Instance of Symbol 567 MovieClip in Symbol 568 MovieClip Frame 4
onClipEvent (load) {
if (_root.cheatUnlockAllLevels || ((_root.savedData.data.lastSavedFrame >= 12) && (_root.savedData.data.lastSavedFrame != undefined))) {
alphaTarget = 30;
this.onEnterFrame = function () {
_alpha = (_alpha + ((alphaTarget - _alpha) * 0.3));
};
this.onRollOver = function () {
alphaTarget = 0;
};
this.onRollOut = function () {
alphaTarget = 30;
};
_alpha = 30;
this.gotoAndStop(2);
this.onRelease = function () {
_root.fade.onEnterFrame = function () {
if (this._alpha > 100) {
_root.levelSelectNr = 11;
_root.loadState();
_root.weapon = 3;
_root.weapon1Active = true;
_root.ammo1 = 0;
_root.ammo1Total = 0;
_root.ammo1Max = 0;
_root.weapon2Active = true;
_root.ammo2 = 18;
_root.ammo2Total = 36;
_root.ammo2Max = 18;
_root.weapon3Active = true;
_root.ammo3 = 36;
_root.ammo3Total = ammo2Total;
_root.ammo3Max = 36;
_root.weapon4Active = false;
_root.ammo4 = 32;
_root.ammo4Total = 0;
_root.ammo4Max = 32;
_root.weapon5Active = false;
_root.ammo5 = 64;
_root.ammo5Total = ammo4Total;
_root.ammo5Max = 64;
_root.weapon6Active = false;
_root.ammo6 = 8;
_root.ammo6Total = 0;
_root.ammo6Max = 8;
_root.weapon7Active = false;
_root.ammo7 = 30;
_root.ammo7Total = 0;
_root.ammo7Max = 30;
_root.saveTempState();
_root.play();
}
this._alpha = this._alpha + 4;
};
};
}
}
Instance of Symbol 567 MovieClip in Symbol 568 MovieClip Frame 4
onClipEvent (load) {
if (_root.cheatUnlockAllLevels || ((_root.savedData.data.lastSavedFrame >= 16) && (_root.savedData.data.lastSavedFrame != undefined))) {
alphaTarget = 30;
this.onEnterFrame = function () {
_alpha = (_alpha + ((alphaTarget - _alpha) * 0.3));
};
this.onRollOver = function () {
alphaTarget = 0;
};
this.onRollOut = function () {
alphaTarget = 30;
};
_alpha = 30;
this.gotoAndStop(2);
this.onRelease = function () {
_root.fade.onEnterFrame = function () {
if (this._alpha > 100) {
_root.levelSelectNr = 15;
_root.loadState();
_root.weapon = 5;
_root.weapon1Active = true;
_root.ammo1 = 0;
_root.ammo1Total = 0;
_root.ammo1Max = 0;
_root.weapon2Active = true;
_root.ammo2 = 18;
_root.ammo2Total = 324;
_root.ammo2Max = 18;
_root.weapon3Active = true;
_root.ammo3 = 36;
_root.ammo3Total = ammo2Total;
_root.ammo3Max = 36;
_root.weapon4Active = true;
_root.ammo4 = 32;
_root.ammo4Total = 160;
_root.ammo4Max = 32;
_root.weapon5Active = true;
_root.ammo5 = 64;
_root.ammo5Total = ammo4Total;
_root.ammo5Max = 64;
_root.weapon6Active = false;
_root.ammo6 = 8;
_root.ammo6Total = 0;
_root.ammo6Max = 8;
_root.weapon7Active = false;
_root.ammo7 = 30;
_root.ammo7Total = 0;
_root.ammo7Max = 30;
_root.saveTempState();
_root.play();
}
this._alpha = this._alpha + 4;
};
};
}
}
Instance of Symbol 567 MovieClip in Symbol 568 MovieClip Frame 4
onClipEvent (load) {
if (_root.cheatUnlockAllLevels || ((_root.savedData.data.lastSavedFrame >= 18) && (_root.savedData.data.lastSavedFrame != undefined))) {
alphaTarget = 30;
this.onEnterFrame = function () {
_alpha = (_alpha + ((alphaTarget - _alpha) * 0.3));
};
this.onRollOver = function () {
alphaTarget = 0;
};
this.onRollOut = function () {
alphaTarget = 30;
};
_alpha = 30;
this.gotoAndStop(2);
this.onRelease = function () {
_root.fade.onEnterFrame = function () {
if (this._alpha > 100) {
_root.levelSelectNr = 17;
_root.loadState();
_root.weapon = 6;
_root.weapon1Active = true;
_root.ammo1 = 0;
_root.ammo1Total = 0;
_root.ammo1Max = 0;
_root.weapon2Active = true;
_root.ammo2 = 18;
_root.ammo2Total = 324;
_root.ammo2Max = 18;
_root.weapon3Active = true;
_root.ammo3 = 36;
_root.ammo3Total = ammo2Total;
_root.ammo3Max = 36;
_root.weapon4Active = true;
_root.ammo4 = 32;
_root.ammo4Total = 160;
_root.ammo4Max = 32;
_root.weapon5Active = true;
_root.ammo5 = 64;
_root.ammo5Total = ammo4Total;
_root.ammo5Max = 64;
_root.weapon6Active = true;
_root.ammo6 = 8;
_root.ammo6Total = 32;
_root.ammo6Max = 8;
_root.weapon7Active = false;
_root.ammo7 = 30;
_root.ammo7Total = 0;
_root.ammo7Max = 30;
_root.saveTempState();
_root.play();
}
this._alpha = this._alpha + 4;
};
};
}
}
Instance of Symbol 567 MovieClip in Symbol 568 MovieClip Frame 4
onClipEvent (load) {
if (_root.cheatUnlockAllLevels || ((_root.savedData.data.lastSavedFrame >= 20) && (_root.savedData.data.lastSavedFrame != undefined))) {
alphaTarget = 30;
this.onEnterFrame = function () {
_alpha = (_alpha + ((alphaTarget - _alpha) * 0.3));
};
this.onRollOver = function () {
alphaTarget = 0;
};
this.onRollOut = function () {
alphaTarget = 30;
};
_alpha = 30;
this.gotoAndStop(2);
this.onRelease = function () {
_root.fade.onEnterFrame = function () {
if (this._alpha > 100) {
_root.levelSelectNr = 19;
_root.loadState();
_root.weapon = 7;
_root.weapon1Active = true;
_root.ammo1 = 0;
_root.ammo1Total = 0;
_root.ammo1Max = 0;
_root.weapon2Active = true;
_root.ammo2 = 18;
_root.ammo2Total = 324;
_root.ammo2Max = 18;
_root.weapon3Active = true;
_root.ammo3 = 36;
_root.ammo3Total = ammo2Total;
_root.ammo3Max = 36;
_root.weapon4Active = true;
_root.ammo4 = 32;
_root.ammo4Total = 160;
_root.ammo4Max = 32;
_root.weapon5Active = true;
_root.ammo5 = 64;
_root.ammo5Total = ammo4Total;
_root.ammo5Max = 64;
_root.weapon6Active = true;
_root.ammo6 = 8;
_root.ammo6Total = 32;
_root.ammo6Max = 8;
_root.weapon7Active = true;
_root.ammo7 = 30;
_root.ammo7Total = 60;
_root.ammo7Max = 30;
_root.saveTempState();
_root.play();
}
this._alpha = this._alpha + 4;
};
};
}
}
Instance of Symbol 567 MovieClip in Symbol 568 MovieClip Frame 4
onClipEvent (load) {
if (_root.cheatUnlockAllLevels || ((_root.savedData.data.lastSavedFrame >= 21) && (_root.savedData.data.lastSavedFrame != undefined))) {
alphaTarget = 30;
this.onEnterFrame = function () {
_alpha = (_alpha + ((alphaTarget - _alpha) * 0.3));
};
this.onRollOver = function () {
alphaTarget = 0;
};
this.onRollOut = function () {
alphaTarget = 30;
};
_alpha = 30;
this.gotoAndStop(2);
this.onRelease = function () {
_root.fade.onEnterFrame = function () {
if (this._alpha > 100) {
_root.levelSelectNr = 23;
_root.loadState();
_root.weapon = 7;
_root.weapon1Active = true;
_root.ammo1 = 0;
_root.ammo1Total = 0;
_root.ammo1Max = 0;
_root.weapon2Active = true;
_root.ammo2 = 18;
_root.ammo2Total = 324;
_root.ammo2Max = 18;
_root.weapon3Active = true;
_root.ammo3 = 36;
_root.ammo3Total = ammo2Total;
_root.ammo3Max = 36;
_root.weapon4Active = true;
_root.ammo4 = 32;
_root.ammo4Total = 160;
_root.ammo4Max = 32;
_root.weapon5Active = true;
_root.ammo5 = 64;
_root.ammo5Total = ammo4Total;
_root.ammo5Max = 64;
_root.weapon6Active = true;
_root.ammo6 = 8;
_root.ammo6Total = 40;
_root.ammo6Max = 8;
_root.weapon7Active = true;
_root.ammo7 = 30;
_root.ammo7Total = 120;
_root.ammo7Max = 30;
_root.saveTempState();
_root.play();
}
this._alpha = this._alpha + 4;
};
};
}
}
Instance of Symbol 567 MovieClip in Symbol 568 MovieClip Frame 4
onClipEvent (load) {
if (_root.cheatUnlockAllLevels || ((_root.savedData.data.lastSavedFrame >= 10) && (_root.savedData.data.lastSavedFrame != undefined))) {
alphaTarget = 30;
this.onEnterFrame = function () {
_alpha = (_alpha + ((alphaTarget - _alpha) * 0.3));
};
this.onRollOver = function () {
alphaTarget = 0;
};
this.onRollOut = function () {
alphaTarget = 30;
};
_alpha = 30;
this.gotoAndStop(2);
this.onRelease = function () {
_root.fade.onEnterFrame = function () {
if (this._alpha > 100) {
_root.levelSelectNr = 9;
_root.loadState();
_root.weapon = 2;
_root.weapon1Active = true;
_root.ammo1 = 0;
_root.ammo1Total = 0;
_root.ammo1Max = 0;
_root.weapon2Active = true;
_root.ammo2 = 18;
_root.ammo2Total = 36;
_root.ammo2Max = 18;
_root.weapon3Active = false;
_root.ammo3 = 36;
_root.ammo3Total = ammo2Total;
_root.ammo3Max = 36;
_root.weapon4Active = false;
_root.ammo4 = 32;
_root.ammo4Total = 0;
_root.ammo4Max = 32;
_root.weapon5Active = false;
_root.ammo5 = 64;
_root.ammo5Total = ammo4Total;
_root.ammo5Max = 64;
_root.weapon6Active = false;
_root.ammo6 = 8;
_root.ammo6Total = 0;
_root.ammo6Max = 8;
_root.weapon7Active = false;
_root.ammo7 = 30;
_root.ammo7Total = 0;
_root.ammo7Max = 30;
_root.saveTempState();
_root.play();
}
this._alpha = this._alpha + 4;
};
};
}
}
Instance of Symbol 575 MovieClip in Symbol 576 MovieClip Frame 1
onClipEvent (load) {
startX = _x;
startY = _y;
}
onClipEvent (enterFrame) {
_x = (startX + (_root._x * 0.05));
_y = (startY + (_root._y * 0.05));
}
Symbol 577 MovieClip Frame 1
stop();
Instance of Symbol 576 MovieClip in Symbol 577 MovieClip Frame 2
onClipEvent (load) {
ySpeed = 0;
}
onClipEvent (enterFrame) {
if (_root.timescale > 0) {
ySpeed = (-_y) * 0.05;
if (ySpeed > 3) {
ySpeed = 3;
}
_y = (_y + ySpeed);
}
}
Symbol 628 MovieClip Frame 1
openAmount = 0;
tOpenAmount = 0;
door._xscale = openAmount * 100;
side._x = door._width;
side._xscale = (1 - openAmount) * 100;
knob2._x = (door._width - 2) + ((1 - openAmount) * 7);
knob._x = door._width - 6;
onEnterFrame = function () {
openAmount = openAmount + ((tOpenAmount - openAmount) * 0.2);
if (openAmount > 0.5) {
_root.lvl[_name]._xscale = (_root.lvl[_name]._yscale = 0);
}
door._xscale = openAmount * 100;
side._x = door._width;
side._xscale = (1 - openAmount) * 100;
knob2._x = (door._width - 2) + ((1 - openAmount) * 7);
knob._x = door._width - 6;
};
Symbol 629 MovieClip Frame 1
activated = false;
openAmount = 1;
spawnEnemy = false;
doOnce = false;
nrOfSpawns = 0;
timer = 10 + random(5);
lastSpawnEnemyDead = true;
onEnterFrame = function () {
if (activated && (lastSpawnEnemyDead)) {
timer = timer - _root.timescale;
if (nrOfSpawns == spawn) {
activated = false;
}
}
if ((timer <= 0) && (nrOfSpawns <= spawn)) {
spawnEnemy = true;
lastSpawnEnemyDead = false;
nrOfSpawns++;
timer = 20 + random(40);
}
if (spawnEnemy) {
openAmount = openAmount + ((-openAmount) * (0.1 * _root.timescale));
if (doOnce == false) {
gName = "gang" + _root.getNextHighestDepth();
_root.attachMovie("gangster", gName, this.getDepth() - 1);
_root[gName]._xscale = (_root[gName]._yscale = 50);
_root[gName]._x = _x + 30;
_root[gName]._y = _y + 6;
if (dontRandomizeXScale) {
_root[gName].dontRandomizeXScale = true;
}
if (platform == 0) {
_root[gName].platform = 0;
}
_root[gName].onEnterFrame = function () {
if (openAmount < 0.08) {
this.swapDepths(_root.getNextHighestDepth());
this.health = 20;
spawnEnemy = false;
this.onEnterFrame = function () {
if (this.health <= 0) {
if (tutorialGangster) {
_root.tutorialDoor2.tOpenAmount = 1;
}
lastSpawnEnemyDead = true;
delete this.onEnterFrame;
}
};
}
};
_root[gName].gfxNr = 1 + random(5);
_root[gName].health = 999;
_root[gName].weapon = 1;
if (!dontRandomizeXScale) {
_root[gName].platform = 1;
}
_root[gName].activated = true;
_root.enemies++;
_root[gName].number = _root.enemies;
_root[gName]._name = (gName = "nmy" + _root.enemies);
doOnce = true;
}
} else {
openAmount = openAmount + ((1 - openAmount) * (0.1 * _root.timescale));
doOnce = false;
}
door._xscale = openAmount * 100;
side._x = door._width;
side._xscale = (1 - openAmount) * 100;
knob2._x = (door._width - 2) + ((1 - openAmount) * 7);
knob._x = door._width - 6;
};
Symbol 630 MovieClip Frame 1
firstFrame = true;
openAmount = 0;
if (_root.getDist(_x, _root.playerL._x, _y, _root.playerL._y) < 60) {
openAmount = openAmount + (((1 - openAmount) * 0.2) * _root.timescale);
} else {
openAmount = openAmount + (((-openAmount) * 0.2) * _root.timescale);
}
door._xscale = openAmount * 100;
side._x = door._width;
side._xscale = (1 - openAmount) * 100;
knob2._x = (door._width - 2) + ((1 - openAmount) * 7);
knob._x = door._width - 6;
doOnce1 = (doOnce2 = false);
onEnterFrame = function () {
if (_root.getDist(_x, _root.playerL._x, _y, _root.playerL._y) < 60) {
openAmount = openAmount + (((1 - openAmount) * 0.2) * _root.timescale);
_root.lvl[_name].gotoAndStop(2);
if (doOnce1 != true) {
if (firstFrame == false) {
_root.playSound("doorOpen", _x, _y);
}
doOnce1 = true;
}
doOnce2 = false;
} else {
doOnce1 = false;
if (doOnce2 != true) {
if (firstFrame == false) {
_root.playSound("doorClose", _x, _y);
}
doOnce2 = true;
}
openAmount = openAmount + (((-openAmount) * 0.2) * _root.timescale);
_root.lvl[_name].gotoAndStop(1);
}
door._xscale = openAmount * 100;
side._x = door._width;
side._xscale = (1 - openAmount) * 100;
knob2._x = (door._width - 2) + ((1 - openAmount) * 7);
knob._x = door._width - 6;
firstFrame = false;
};
Symbol 632 MovieClip Frame 1
_visible = false;
Symbol 633 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 634 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 634 MovieClip Frame 31
this.gotoAndPlay(6);
currentFrame = 6;
Symbol 635 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 635 MovieClip Frame 120
currentFrame = 13;
this.gotoAndStop(13);
Symbol 638 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 638 MovieClip Frame 11
stop();
currentFrame = 9;
Symbol 638 MovieClip Frame 15
_root.playerL.sHeight = 80;
Symbol 638 MovieClip Frame 19
_parent.gotoAndStop(1);
Symbol 639 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 639 MovieClip Frame 30
currentFrame = 7;
gotoAndPlay (7);
Symbol 640 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 640 MovieClip Frame 11
this.gotoAndPlay(6);
currentFrame = 6;
Symbol 640 MovieClip Frame 15
_parent.gotoAndStop(1);
Symbol 641 MovieClip Frame 1
stop();
_root.playerB._visible = true;
_root.playerL.sHeight = 80;
Symbol 641 MovieClip Frame 2
_root.playerB._visible = true;
_root.playerL.sHeight = 80;
Symbol 641 MovieClip Frame 3
_root.playerB._visible = true;
_root.playerL.sHeight = 80;
Symbol 641 MovieClip Frame 4
_root.playerB._visible = false;
_root.playerL.sHeight = 40;
_root.playerL._y = _root.playerL._y + 15;
Symbol 641 MovieClip Frame 5
_root.playerB._visible = true;
_root.playerL.sHeight = 80;
Symbol 641 MovieClip Frame 6
_root.playerB._visible = true;
_root.playerL.sHeight = 80;
Instance of Symbol 343 MovieClip in Symbol 642 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop("shotgun");
}
Symbol 646 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 646 MovieClip Frame 2
Symbol 646 MovieClip Frame 7
Symbol 647 MovieClip Frame 1
arm1._rotation = (arm2._rotation = 180);
Instance of Symbol 343 MovieClip in Symbol 649 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop("open");
}
Symbol 650 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Instance of Symbol 343 MovieClip in Symbol 650 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop("open");
}
Symbol 650 MovieClip Frame 7
_root.playSound("clipDrop", _root.playerL._x, _root.playerL._y);
var magName = ("mag" + _root.getNextHighestDepth());
_root.attachMovie("Magasin", magName, _root.getNextHighestDepth());
_root[magName]._x = _root.playerB._x + (Math.sin((_root.playerB._rotation + ((_root.playerL._xscale / Math.abs(_root.playerL._xscale)) * 60)) * (Math.PI/180)) * 50);
_root[magName]._y = _root.playerB._y - (Math.cos((_root.playerB._rotation + ((_root.playerL._xscale / Math.abs(_root.playerL._xscale)) * 60)) * (Math.PI/180)) * 50);
_root[magName].fallspeed = 0;
_root[magName].rotSpeed = -20 + random(40);
_root[magName]._alpha = 800;
_root[magName].onEnterFrame = function () {
this.fallspeed = this.fallspeed + (0.3 * _root.timescale);
this._rotation = this._rotation + (this.rotSpeed * _root.timescale);
this._y = this._y + (this.fallspeed * _root.timescale);
this._alpha = this._alpha - (4 * _root.timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (_root.lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = this.fallspeed * -0.8;
this.rotSpeed = this.rotSpeed / 2;
this._y = this._y + this.fallspeed;
}
};
Symbol 650 MovieClip Frame 20
if ((_root[("ammo" + _root.weapon) + "Total"] - (_root[("ammo" + _root.weapon) + "Max"] - _root["ammo" + _root.weapon])) > 0) {
_root[("ammo" + _root.weapon) + "Total"] = _root[("ammo" + _root.weapon) + "Total"] - (_root[("ammo" + _root.weapon) + "Max"] - _root["ammo" + _root.weapon]);
_root["ammo" + _root.weapon] = _root["ammo" + _root.weapon] + (_root[("ammo" + _root.weapon) + "Max"] - _root["ammo" + _root.weapon]);
} else {
_root["ammo" + _root.weapon] = _root["ammo" + _root.weapon] + _root[("ammo" + _root.weapon) + "Total"];
_root[("ammo" + _root.weapon) + "Total"] = 0;
}
Symbol 650 MovieClip Frame 26
_root.playSound("pistolCock", _root.playerL._x, _root.playerL._y);
Symbol 650 MovieClip Frame 43
_parent.gotoAndStop(1);
Symbol 651 MovieClip Frame 1
stop();
Symbol 652 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 652 MovieClip Frame 10
_root.playSound("clipDrop", _root.playerL._x, _root.playerL._y);
var magName = ("mag" + _root.getNextHighestDepth());
_root.attachMovie("Magasin", magName, _root.getNextHighestDepth());
_root[magName]._x = _root.playerB._x + (Math.sin((_root.playerB._rotation + ((_root.playerL._xscale / Math.abs(_root.playerL._xscale)) * 60)) * (Math.PI/180)) * 50);
_root[magName]._y = _root.playerB._y - (Math.cos((_root.playerB._rotation + ((_root.playerL._xscale / Math.abs(_root.playerL._xscale)) * 60)) * (Math.PI/180)) * 50);
_root[magName].fallspeed = 0;
_root[magName].rotSpeed = -20 + random(40);
_root[magName]._alpha = 800;
_root[magName].onEnterFrame = function () {
this.fallspeed = this.fallspeed + (0.3 * _root.timescale);
this._rotation = this._rotation + (this.rotSpeed * _root.timescale);
this._y = this._y + (this.fallspeed * _root.timescale);
this._alpha = this._alpha - (4 * _root.timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (_root.lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = this.fallspeed * -0.8;
this.rotSpeed = this.rotSpeed / 2;
this._y = this._y + this.fallspeed;
}
};
var magName = ("mag" + _root.getNextHighestDepth());
_root.attachMovie("Magasin", magName, _root.getNextHighestDepth());
_root[magName]._x = _root.playerB._x + (Math.sin((_root.playerB._rotation + ((_root.playerL._xscale / Math.abs(_root.playerL._xscale)) * 60)) * (Math.PI/180)) * 40);
_root[magName]._y = _root.playerB._y - (Math.cos((_root.playerB._rotation + ((_root.playerL._xscale / Math.abs(_root.playerL._xscale)) * 60)) * (Math.PI/180)) * 40);
_root[magName].fallspeed = 0;
_root[magName].rotSpeed = -20 + random(40);
_root[magName]._alpha = 800;
_root[magName].onEnterFrame = function () {
this.fallspeed = this.fallspeed + (0.3 * _root.timescale);
this._rotation = this._rotation + (this.rotSpeed * _root.timescale);
this._y = this._y + (this.fallspeed * _root.timescale);
this._alpha = this._alpha - (4 * _root.timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (_root.lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = this.fallspeed * -0.8;
this.rotSpeed = this.rotSpeed / 2;
this._y = this._y + this.fallspeed;
}
};
Symbol 652 MovieClip Frame 28
_root.playSound("pistolCock", _root.playerL._x, _root.playerL._y);
Symbol 652 MovieClip Frame 53
_root.playSound("pistolCock", _root.playerL._x, _root.playerL._y);
if ((_root.ammo2Total - (_root[("ammo" + _root.weapon) + "Max"] - _root["ammo" + _root.weapon])) > 0) {
_root.ammo2Total = _root.ammo2Total - (_root[("ammo" + _root.weapon) + "Max"] - _root["ammo" + _root.weapon]);
_root["ammo" + _root.weapon] = _root["ammo" + _root.weapon] + (_root[("ammo" + _root.weapon) + "Max"] - _root["ammo" + _root.weapon]);
} else {
_root["ammo" + _root.weapon] = _root["ammo" + _root.weapon] + _root.ammo2Total;
_root.ammo2Total = 0;
}
Symbol 652 MovieClip Frame 64
_parent.gotoAndStop(1);
Symbol 653 MovieClip Frame 1
stop();
Symbol 655 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Instance of Symbol 343 MovieClip in Symbol 655 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop("open");
}
Symbol 655 MovieClip Frame 10
_root.playSound("clipDrop", _root.playerL._x, _root.playerL._y);
var magName = ("mag" + _root.getNextHighestDepth());
_root.attachMovie("Magasin", magName, _root.getNextHighestDepth());
_root[magName]._x = _root.playerB._x + (Math.sin((_root.playerB._rotation + ((_root.playerL._xscale / Math.abs(_root.playerL._xscale)) * 80)) * (Math.PI/180)) * 30);
_root[magName]._y = _root.playerB._y - (Math.cos((_root.playerB._rotation + ((_root.playerL._xscale / Math.abs(_root.playerL._xscale)) * 80)) * (Math.PI/180)) * 30);
_root[magName].fallspeed = 0;
_root[magName].rotSpeed = -20 + random(40);
_root[magName]._alpha = 800;
_root[magName].onEnterFrame = function () {
this.fallspeed = this.fallspeed + (0.3 * _root.timescale);
this._rotation = this._rotation + (this.rotSpeed * _root.timescale);
this._y = this._y + (this.fallspeed * _root.timescale);
this._alpha = this._alpha - (4 * _root.timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (_root.lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = this.fallspeed * -0.8;
this.rotSpeed = this.rotSpeed / 2;
this._y = this._y + this.fallspeed;
}
};
Symbol 655 MovieClip Frame 18
_root.playSound("clipDrop", _root.playerL._x, _root.playerL._y);
Symbol 655 MovieClip Frame 34
if ((_root[("ammo" + _root.weapon) + "Total"] - (_root[("ammo" + _root.weapon) + "Max"] - _root["ammo" + _root.weapon])) > 0) {
_root[("ammo" + _root.weapon) + "Total"] = _root[("ammo" + _root.weapon) + "Total"] - (_root[("ammo" + _root.weapon) + "Max"] - _root["ammo" + _root.weapon]);
_root["ammo" + _root.weapon] = _root["ammo" + _root.weapon] + (_root[("ammo" + _root.weapon) + "Max"] - _root["ammo" + _root.weapon]);
} else {
_root["ammo" + _root.weapon] = _root["ammo" + _root.weapon] + _root[("ammo" + _root.weapon) + "Total"];
_root[("ammo" + _root.weapon) + "Total"] = 0;
}
Symbol 655 MovieClip Frame 39
_parent.gotoAndStop(1);
Symbol 656 MovieClip Frame 1
stop();
Symbol 657 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Symbol 657 MovieClip Frame 16
_root.playSound("clipDrop", _root.playerL._x, _root.playerL._y);
var magName = ("mag" + _root.getNextHighestDepth());
_root.attachMovie("Magasin", magName, _root.getNextHighestDepth());
_root[magName]._x = _root.playerB._x + (Math.sin((_root.playerB._rotation + ((_root.playerL._xscale / Math.abs(_root.playerL._xscale)) * 65)) * (Math.PI/180)) * 32);
_root[magName]._y = _root.playerB._y - (Math.cos((_root.playerB._rotation + ((_root.playerL._xscale / Math.abs(_root.playerL._xscale)) * 65)) * (Math.PI/180)) * 32);
_root[magName].fallspeed = 0;
_root[magName].rotSpeed = -20 + random(40);
_root[magName]._alpha = 800;
_root[magName].onEnterFrame = function () {
this.fallspeed = this.fallspeed + (0.3 * _root.timescale);
this._rotation = this._rotation + (this.rotSpeed * _root.timescale);
this._y = this._y + (this.fallspeed * _root.timescale);
this._alpha = this._alpha - (4 * _root.timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (_root.lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = this.fallspeed * -0.8;
this.rotSpeed = this.rotSpeed / 2;
this._y = this._y + this.fallspeed;
}
};
var magName = ("mag" + _root.getNextHighestDepth());
_root.attachMovie("Magasin", magName, _root.getNextHighestDepth());
_root[magName]._x = _root.playerB._x + (Math.sin((_root.playerB._rotation + ((_root.playerL._xscale / Math.abs(_root.playerL._xscale)) * 62)) * (Math.PI/180)) * 45);
_root[magName]._y = _root.playerB._y - (Math.cos((_root.playerB._rotation + ((_root.playerL._xscale / Math.abs(_root.playerL._xscale)) * 62)) * (Math.PI/180)) * 45);
_root[magName].fallspeed = 0;
_root[magName].rotSpeed = -20 + random(40);
_root[magName]._alpha = 800;
_root[magName].onEnterFrame = function () {
this.fallspeed = this.fallspeed + (0.3 * _root.timescale);
this._rotation = this._rotation + (this.rotSpeed * _root.timescale);
this._y = this._y + (this.fallspeed * _root.timescale);
this._alpha = this._alpha - (4 * _root.timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (_root.lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = this.fallspeed * -0.8;
this.rotSpeed = this.rotSpeed / 2;
this._y = this._y + this.fallspeed;
}
};
Symbol 657 MovieClip Frame 36
_root.playSound("clipDrop", _root.playerL._x, _root.playerL._y);
Symbol 657 MovieClip Frame 53
_root.playSound("clipDrop", _root.playerL._x, _root.playerL._y);
Symbol 657 MovieClip Frame 59
if ((_root.ammo4Total - (_root[("ammo" + _root.weapon) + "Max"] - _root["ammo" + _root.weapon])) > 0) {
_root.ammo4Total = _root.ammo4Total - (_root[("ammo" + _root.weapon) + "Max"] - _root["ammo" + _root.weapon]);
_root["ammo" + _root.weapon] = _root["ammo" + _root.weapon] + (_root[("ammo" + _root.weapon) + "Max"] - _root["ammo" + _root.weapon]);
} else {
_root["ammo" + _root.weapon] = _root["ammo" + _root.weapon] + _root.ammo4Total;
_root.ammo4Total = 0;
}
Symbol 657 MovieClip Frame 76
_parent.gotoAndStop(1);
Symbol 658 MovieClip Frame 1
stop();
Instance of Symbol 343 MovieClip in Symbol 659 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop("shotgun");
}
Symbol 661 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
if (_root.ammo6Total <= 0) {
_parent.gotoAndStop(1);
}
Instance of Symbol 343 MovieClip in Symbol 661 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop("shotgun");
}
Symbol 661 MovieClip Frame 29
if (_root.ammo6Total > 0) {
_root.ammo6++;
_root.ammo6Total--;
}
_root.playSound("shotgunShellIn", _root.playerL._x, _root.playerL._y);
Symbol 661 MovieClip Frame 33
if (((_root.ammo6 < _root.ammo6Max) && (!_root.mousePress)) && (_root.ammo6Total > 0)) {
currentFrame = 25;
this.gotoAndPlay(25);
}
Symbol 661 MovieClip Frame 44
_root.playSound("shotgunCock", _root.playerL._x, _root.playerL._y);
Symbol 661 MovieClip Frame 62
_parent.gotoAndStop(1);
Symbol 662 MovieClip Frame 1
stop();
Instance of Symbol 343 MovieClip in Symbol 663 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop("shotgun");
}
Symbol 665 MovieClip Frame 1
this.onEnterFrame = function () {
_root.sAni(this);
};
Instance of Symbol 343 MovieClip in Symbol 665 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop("shotgun");
}
Symbol 665 MovieClip Frame 12
_root.playSound("clipDrop", _root.playerL._x, _root.playerL._y);
var magName = ("mag" + _root.getNextHighestDepth());
_root.attachMovie("Magasin", magName, _root.getNextHighestDepth());
_root[magName]._x = _root.playerB._x + (Math.sin((_root.playerB._rotation + ((_root.playerL._xscale / Math.abs(_root.playerL._xscale)) * 40)) * (Math.PI/180)) * 30);
_root[magName]._y = _root.playerB._y - (Math.cos((_root.playerB._rotation + ((_root.playerL._xscale / Math.abs(_root.playerL._xscale)) * 40)) * (Math.PI/180)) * 30);
_root[magName].fallspeed = 0;
_root[magName].rotSpeed = -20 + random(40);
_root[magName]._alpha = 800;
_root[magName].onEnterFrame = function () {
this.fallspeed = this.fallspeed + (0.3 * _root.timescale);
this._rotation = this._rotation + (this.rotSpeed * _root.timescale);
this._y = this._y + (this.fallspeed * _root.timescale);
this._alpha = this._alpha - (4 * _root.timescale);
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (_root.lvl.hitTest(this._x, this._y, true)) {
this.fallspeed = this.fallspeed * -0.8;
this.rotSpeed = this.rotSpeed / 2;
this._y = this._y + this.fallspeed;
}
};
Symbol 665 MovieClip Frame 37
_root.playSound("pistolCock", _root.playerL._x, _root.playerL._y);
Symbol 665 MovieClip Frame 43
if ((_root[("ammo" + _root.weapon) + "Total"] - (_root[("ammo" + _root.weapon) + "Max"] - _root["ammo" + _root.weapon])) > 0) {
_root[("ammo" + _root.weapon) + "Total"] = _root[("ammo" + _root.weapon) + "Total"] - (_root[("ammo" + _root.weapon) + "Max"] - _root["ammo" + _root.weapon]);
_root["ammo" + _root.weapon] = _root["ammo" + _root.weapon] + (_root[("ammo" + _root.weapon) + "Max"] - _root["ammo" + _root.weapon]);
} else {
_root["ammo" + _root.weapon] = _root["ammo" + _root.weapon] + _root[("ammo" + _root.weapon) + "Total"];
_root[("ammo" + _root.weapon) + "Total"] = 0;
}
Symbol 665 MovieClip Frame 55
_parent.gotoAndStop(1);
Symbol 666 MovieClip Frame 1
stop();
Symbol 670 MovieClip Frame 1
stop();
_alpha = 0;
Symbol 674 MovieClip Frame 1
_alpha = 0;
Symbol 707 MovieClip Frame 1
stop();
Instance of Symbol 707 MovieClip "nrText" in Symbol 708 MovieClip Frame 1
onClipEvent (enterFrame) {
_yscale = (100 - (_parent._xscale - 100));
_xscale = (100 - (_parent._xscale - 100));
}
Instance of Symbol 711 MovieClip in Symbol 714 MovieClip Frame 1
onClipEvent (enterFrame) {
_yscale = _root.health;
}
Symbol 718 MovieClip Frame 1
stop();
_visible = false;
Instance of Symbol 717 MovieClip in Symbol 718 MovieClip Frame 1
onClipEvent (load) {
startWidth = _width;
}
onClipEvent (enterFrame) {
_width = ((_root.finalBoss.health / 1000) * startWidth);
}
Instance of Symbol 733 MovieClip in Symbol 734 MovieClip Frame 1
onClipEvent (load) {
_x = (_root[_parent.varToUse] * 100);
}
on (press) {
this.onEnterFrame = function () {
_x = _parent._xmouse;
if (_x > 100) {
_x = 100;
} else if (_x < 0) {
_x = 0;
}
_root[_parent.varToUse] = _x / 100;
};
}
on (release) {
delete this.onEnterFrame;
}
on (releaseOutside) {
delete this.onEnterFrame;
}
Symbol 743 MovieClip Frame 1
if (_root._quality == "HIGH") {
gotoAndStop (3);
} else if (_root._quality == "MEDIUM") {
gotoAndStop (2);
} else if (_root._quality == "LOW") {
gotoAndStop (1);
} else {
stop();
}
Instance of Symbol 734 MovieClip in Symbol 744 MovieClip Frame 1
onClipEvent (load) {
varToUse = "musicVolume";
}
Instance of Symbol 734 MovieClip in Symbol 744 MovieClip Frame 1
onClipEvent (load) {
varToUse = "SFXVolume";
}
Instance of Symbol 736 MovieClip in Symbol 744 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
on (release) {
_root.showOptions = false;
Mouse.hide();
}
Instance of Symbol 398 MovieClip in Symbol 744 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = true;
_alpha = 0;
this.onEnterFrame = function () {
};
}
on (release) {
_root.loadState();
if (_root.levelSelectNr < (_root._currentframe + 1)) {
_root.loadTempState();
}
_root.gotoAndStop(_root._currentframe - 1);
_root.showOptions = false;
Mouse.hide();
}
Instance of Symbol 398 MovieClip in Symbol 744 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = true;
_alpha = 0;
this.onEnterFrame = function () {
};
}
on (release) {
_root.gotoAndStop(5);
_root.showOptions = false;
Mouse.hide();
}
Instance of Symbol 398 MovieClip in Symbol 744 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = true;
_alpha = 0;
this.onEnterFrame = function () {
};
}
on (release) {
_root._quality = "LOW";
_parent.qualityIndicator.gotoAndStop(1);
}
Instance of Symbol 398 MovieClip in Symbol 744 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = true;
_alpha = 0;
this.onEnterFrame = function () {
};
}
on (release) {
_root._quality = "MEDIUM";
_parent.qualityIndicator.gotoAndStop(2);
}
Instance of Symbol 398 MovieClip in Symbol 744 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = true;
_alpha = 0;
this.onEnterFrame = function () {
};
}
on (release) {
_root._quality = "HIGH";
_parent.qualityIndicator.gotoAndStop(3);
}
Symbol 748 MovieClip Frame 1
_visible = false;
visibleTimer = 0;
onEnterFrame = function () {
visibleTimer--;
if (visibleTimer <= 0) {
_visible = false;
visibleTimer = 0;
}
};
Instance of Symbol 398 MovieClip in Symbol 753 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = true;
_alpha = 0;
this.onEnterFrame = function () {
};
}
on (release) {
_root.loadTempState();
_root.health = 100;
_root.gotoAndStop(_root._currentframe - 1);
}
Instance of Symbol 398 MovieClip in Symbol 753 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = true;
_alpha = 0;
this.onEnterFrame = function () {
};
}
on (release) {
getURL ("http://www.deadtoast.com", "_blank");
}
Instance of Symbol 398 MovieClip in Symbol 753 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = true;
_alpha = 0;
this.onEnterFrame = function () {
};
}
on (release) {
_root.gotoAndStop(5);
}
Instance of Symbol 398 MovieClip in Symbol 753 MovieClip Frame 1
onClipEvent (enterFrame) {
_visible = true;
_alpha = 0;
this.onEnterFrame = function () {
};
}
on (release) {
getURL ("http://www.deadtoast.com", "_blank");
}
Symbol 754 MovieClip Frame 1
function weaponMenu(obj, tObj, nr) {
if (obj.doOnce == undefined) {
obj.nrText.gotoAndStop(nr + 1);
obj.GFXIcon.gotoAndStop(nr);
obj.onScreen = false;
obj.doOnce = true;
}
obj._x = (tObj._x + tObj._width) + 2;
if (_root[("weapon" + nr) + "Active"] == true) {
if (obj.onScreen == false) {
if (_root.generalTimer > 10) {
this.attachMovie("newWeapon", "newWeapon" + nr, this.getNextHighestDepth());
this["newWeapon" + nr]._x = 300;
this["newWeapon" + nr]._y = 120;
this["newWeapon" + nr].gunIcon.gotoAndStop(nr);
_root.weapon = nr;
obj._xscale = (obj._yscale = 800);
}
obj.onScreen = true;
}
if (nr != 1) {
if ((_root[("ammo" + nr) + "Total"] <= 0) && (_root["ammo" + nr] <= 0)) {
obj._alpha = 50;
} else {
obj._alpha = 100;
}
}
if (_root.weapon == nr) {
obj._yscale = (obj._xscale = obj._xscale + ((70 - obj._xscale) * 0.2));
} else {
obj._yscale = (obj._xscale = obj._xscale + ((50 - obj._xscale) * 0.2));
}
}
}
var i = 0;
while ((++i) <= 7) {
_root.HUD["p" + i]._xscale = (_root.HUD["p" + i]._yscale = 0);
}
onEnterFrame = function () {
var _local2 = 0;
while (_local2++ , _local2 <= 7) {
weaponMenu(_root.HUD["p" + _local2], _root.HUD["p" + (_local2 - 1)], _local2);
}
HUD._visible = !_root.pausePlayer;
blackBars._visible = _root.pausePlayer;
};
Instance of Symbol 695 MovieClip "damage" in Symbol 754 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
timer = 0;
}
Instance of Symbol 708 MovieClip "p0" in Symbol 754 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 744 MovieClip in Symbol 754 MovieClip Frame 1
onClipEvent (load) {
startY = _y;
_y = (_y - 600);
}
onClipEvent (enterFrame) {
if (_root.showOptions == true) {
_y = (_y + ((startY - _y) * 0.2));
} else {
_y = (_y + (((startY - 600) - _y) * 0.2));
}
}
Instance of Symbol 570 MovieClip "fade" in Symbol 754 MovieClip Frame 1
onClipEvent (load) {
fadeSpeed = 4;
}
onClipEvent (enterFrame) {
if (_root.fadeToDark) {
if ((_alpha + fadeSpeed) <= 100) {
_alpha = (_alpha + fadeSpeed);
} else {
_alpha = 100;
if (_root.levelComplete && (_root.health > 0)) {
_root.saveState();
_root.fadeToDark = false;
_root.levelComplete = false;
_root.play();
}
}
} else if ((_alpha - fadeSpeed) >= 0) {
_alpha = (_alpha - fadeSpeed);
} else {
_alpha = 0;
}
}
Instance of Symbol 753 MovieClip in Symbol 754 MovieClip Frame 1
onClipEvent (load) {
startY = _y;
_y = (_y - 600);
}
onClipEvent (enterFrame) {
if (_root.playerL.dead == true) {
if (!deadDoOnce) {
com.newgrounds.API.logCustomEvent("Died");
deadDoOnce = true;
}
Mouse.show();
_y = (_y + ((startY - _y) * 0.2));
} else {
deadDoOnce = false;
_y = (_y + (((startY - 600) - _y) * 0.2));
}
}
Symbol 782 MovieClip Frame 1
_root.gasCans++;
_name = ("gasCan" + _root.gasCans);
stop();
Symbol 788 MovieClip Frame 1
_alpha = 0;
Symbol 789 MovieClip Frame 1
stop();
_alpha = 0;
Symbol 817 MovieClip Frame 1
stop();
Symbol 824 MovieClip Frame 1
stop();
Symbol 828 MovieClip Frame 1
_alpha = 0;
Symbol 881 MovieClip Frame 1
_root.elevator++;
_name = ("ele" + _root.elevator);
Symbol 882 MovieClip Frame 1
openAmount = 1;
spawnEnemy = false;
doOnce = false;
nrOfSpawns = 0;
if (enemyWeapon == undefined) {
enemyWeapon = 1;
}
onEnterFrame = function () {
if (spawnOnKillCount1 != undefined) {
if ((_root.killCount == spawnOnKillCount1) && (nrOfSpawns == 0)) {
spawnEnemy = true;
nrOfSpawns++;
}
if ((_root.killCount == spawnOnKillCount2) && (nrOfSpawns == 1)) {
spawnEnemy = true;
nrOfSpawns++;
}
}
if (spawnEnemy) {
openAmount = openAmount + ((-openAmount) * (0.1 * _root.timescale));
if (doOnce == false) {
gName = "gang" + _root.getNextHighestDepth();
_root.attachMovie("gangster", gName, this.getDepth() - 1);
_root[gName]._xscale = (_root[gName]._yscale = 50);
_root[gName]._x = _x + 30;
_root[gName]._y = _y + 6;
_root[gName].onEnterFrame = function () {
if (openAmount < 0.08) {
this.swapDepths(_root.getNextHighestDepth());
this.health = 20;
spawnEnemy = false;
delete this.onEnterFrame;
}
};
_root[gName].gfxNr = 1 + random(5);
_root[gName].health = 999;
_root[gName].weapon = enemyWeapon;
_root[gName].platform = 1;
_root[gName].activated = true;
_root.enemies++;
_root[gName].number = _root.enemies;
_root[gName]._name = (gName = "nmy" + _root.enemies);
doOnce = true;
}
} else {
openAmount = openAmount + ((1 - openAmount) * (0.1 * _root.timescale));
doOnce = false;
}
door._xscale = openAmount * 100;
side._x = door._width;
side._xscale = (1 - openAmount) * 100;
knob2._x = (door._width - 2) + ((1 - openAmount) * 7);
knob._x = door._width - 6;
};
Symbol 887 MovieClip Frame 1
stop();
sXScale = _xscale;
sYScale = _yscale;
_yscale = 0;
_xscale = 0;
Symbol 889 MovieClip Frame 1
stop();
sXScale = _xscale;
sYScale = _yscale;
_yscale = 0;
_xscale = 0;
Symbol 893 MovieClip Frame 1
stop();
sXScale = _xscale;
sYScale = _yscale;
Symbol 913 MovieClip Frame 1
stop();
this._visible = false;
_root.jTPlatform++;
_name = ("jTP" + _root.jTPlatform);
Symbol 936 MovieClip Frame 1
stop();
Symbol 955 MovieClip Frame 1
bossRotation = (bossRotationSpeed = 0);
headRotation = (headRotationSpeed = 0);
eyeBrowsRotTarget = 0;
topHeadRotation = (topHeadRotation = 0);
head.topHead.startY = head.topHead._y;
timer = 0;
topHeadOpen = false;
angle1 = _root.getAngle(0, 0, head._x, head._y);
dist1 = _root.getDist(0, head._x, 0, head._y);
angle2 = _root.getAngle(0, 0, head.targ._x, head.targ._y);
dist2 = _root.getDist(0, head.targ._x, 0, head.targ._y);
attackTimer = 0;
attackTimer2 = 0;
attackPattern = 2;
xSpeed = (ySpeed = 0);
startX = _x;
startY = _x;
_x = (_x + 400);
stepTimer = -210;
health = 1000;
playerStartY = _root.playerL._y;
playerStartX = _root.playerL._x;
onEnterFrame = function () {
stepTimer = stepTimer + _root.timescale;
if (stepTimer >= 45) {
allowShake = true;
xSpeed = -4;
ySpeed = -12;
stepTimer = 0;
}
ySpeed = ySpeed + (1.3 * _root.timescale);
_x = (_x + (xSpeed * _root.timescale));
_y = (_y + (ySpeed * _root.timescale));
if (_y > startY) {
if (allowShake) {
_root.playSound("boss_footstep", _x - 200, _y - 400);
_root.shakeTimer = 20;
allowShake = false;
}
_y = startY;
xSpeed = 0;
ySpeed = 0;
}
if (_x <= startX) {
_x = startX;
xSpeed = 0;
hit = false;
_root.HUD.bossHealth._visible = true;
if (_y == startY) {
onEnterFrame = function () {
if (health <= 0) {
_root.unlockAchievement(7);
if (_root.health >= 100) {
_root.unlockAchievement(4);
}
_root.HUD.bossHealth._visible = false;
_root.pausePlayer = true;
_root.mouseXPos = _x + 300;
_root.mouseYPos = _y - 100;
timer = 0;
timer2 = 0;
startX = _x;
ySpeed = -60;
_root.swatter.activated = false;
this.onEnterFrame = function () {
_root.playerL._x = _root.playerL._x + ((playerStartX - _root.playerL._x) * 0.3);
_root.playerL._y = _root.playerL._y + ((playerStartY - _root.playerL._y) * 0.3);
if (ySpeed < 2) {
ySpeed = ySpeed + 0.5;
}
if (ySpeed > 0) {
_root.swatter.yTarget = _root.swatter.yTarget + ySpeed;
_y = (_y + ySpeed);
}
_x = ((startX - 10) + random(20));
timer++;
timer2++;
if ((timer >= 15) && (timer2 < 250)) {
_root.shakeTimer = 10;
exploName = "expl" + _root.getNextHighestDepth();
_root.attachMovie("explosion", exploName, _root.getNextHighestDepth());
_root[exploName]._x = (_x - 50) + random(100);
_root[exploName]._y = ((_root.levelBounds._y + _root.levelBounds._height) - 20) + random(50);
_root[exploName]._xscale = (_root[exploName]._yscale = 30 + random(40));
timer = -random(10);
}
if (timer2 == 400) {
exploName = "expl" + _root.getNextHighestDepth();
_root.attachMovie("explosion", exploName, _root.getNextHighestDepth());
_root[exploName]._x = _root.playerL._x;
_root[exploName]._y = _root.playerL._y + 40;
_root[exploName]._xscale = (_root[exploName]._yscale = 30);
_root.playerL._visible = (_root.playerB._visible = false);
}
if (timer2 == 460) {
_root.attachMovie("endGameCredits", "endGameCredits", _root.getNextHighestDepth());
_root.endGameCredits._x = -_root._x;
_root.endGameCredits._y = -_root._y;
}
};
}
timer = timer + _root.timescale;
if (timer > 150) {
topHeadOpen = !topHeadOpen;
if (!topHeadOpen) {
attackPattern++;
if (attackPattern > 2) {
attackPattern = 1;
}
_root.swatter.activated = true;
timer = -90;
} else {
timer = 0;
}
}
if (hit) {
headRotationSpeed = headRotationSpeed + 3;
bossRotation = bossRotation + 1.5;
head.topHead.rEyebrow._rotation = 30;
head.topHead.lEyebrow._rotation = -20;
hit = false;
}
headRotation = _root.getAngle(_x, _y - 300, _root.playerL._x, _root.playerL._y) * 0.4;
bossRotation = headRotation * 0.5;
headRotationSpeed = headRotationSpeed + ((headRotation - head._rotation) / 10);
headRotationSpeed = headRotationSpeed / 1.1;
head._rotation = head._rotation + (headRotationSpeed * _root.timescale);
head.topHead._rotation = head._rotation * 0.3;
bossRotationSpeed = bossRotationSpeed + ((bossRotation - _rotation) / 10);
bossRotationSpeed = bossRotationSpeed / 1.1;
_rotation = (_rotation + (bossRotationSpeed * _root.timescale));
if (topHeadOpen) {
head.topHead._y = head.topHead._y + (((-100 - head.topHead._y) * 0.05) * _root.timescale);
if (head.topHead._y < -80) {
if (attackPattern == 1) {
attackTimer = attackTimer + _root.timescale;
if (Math.round(attackTimer) == 20) {
fBHName = "fBH1";
} else if (Math.round(attackTimer) == 50) {
fBHName = "fBH2";
} else if (Math.round(attackTimer) == 80) {
fBHName = "fBH3";
timer = 130;
}
if ((((Math.round(attackTimer) == 20) && (allowFaceSpawn)) || ((Math.round(attackTimer) == 50) && (allowFaceSpawn))) || ((Math.round(attackTimer) == 80) && (allowFaceSpawn))) {
allowFaceSpawn = false;
_root[fBHName].removeMovieClip();
_root.attachMovie("finalBossHead", fBHName, _root.getNextHighestDepth());
_root[fBHName]._xscale = (_root[fBHName]._yscale = 10);
_root[fBHName]._alpha = 0;
_root[fBHName].hitbox._width = _root[fBHName].hitbox._width + 80;
_root[fBHName]._x = _x;
_root[fBHName]._y = _y;
_root[fBHName]._x = _root[fBHName]._x + (Math.sin((((_rotation - 90) + angle1) * Math.PI) / 180) * dist1);
_root[fBHName]._y = _root[fBHName]._y - (Math.cos((((_rotation - 90) + angle1) * Math.PI) / 180) * dist1);
_root[fBHName]._x = _root[fBHName]._x + (Math.sin((((head._rotation - 90) + angle2) * Math.PI) / 180) * dist2);
_root[fBHName]._y = _root[fBHName]._y - (Math.cos((((head._rotation - 90) + angle2) * Math.PI) / 180) * dist2);
_root[fBHName]._rotation = _root.getAngle(_root[fBHName]._x, _root[fBHName]._y, _root.playerL._x, _root.playerL._y);
_root[fBHName].onEnterFrame = function () {
this.playerAngle = _root.getAngle(this._x, this._y, _root.playerL._x, _root.playerL._y);
if (this.playerAngle < this._rotation) {
this._rotation = this._rotation - (1.5 * _root.timescale);
} else {
this._rotation = this._rotation + (1.5 * _root.timescale);
}
this._alpha = this._alpha + (((100 - this._alpha) * 0.3) * _root.timescale);
if (this._xscale > 24) {
this.stopStartScale = true;
}
if (!this.stopStartScale) {
this._xscale = (this._yscale = this._yscale + (((30 - this._xscale) * 0.1) * _root.timescale));
}
this.topHead._y = -random(100);
this.topHead._rotation = random(30);
this.bottomHead._y = -50 + random(20);
this.bottomHead._rotation = random(10);
this._x = this._x + (Math.sin(((this._rotation - 90) * Math.PI) / 180) * (7 * _root.timescale));
this._y = this._y - (Math.cos(((this._rotation - 90) * Math.PI) / 180) * (7 * _root.timescale));
if ((!this.hasHit) && this.hitbox.hitTest(_root.playerL._x, _root.playerL._y, true)) {
_root.health = _root.health - 15;
_root.HUD.damage._alpha = _root.HUD.damage._alpha + 40;
_root.addBlood(_root.playerL._x, _root.playerL._y, _root.playerL._rotation, 17);
_root.playSound("bulletHit", _root.playerL._x, _root.playerL._y);
_root.playerL.xSpeed2 = _root.playerL.xSpeed2 - 30;
this.hasHit = true;
}
};
} else {
allowFaceSpawn = true;
}
} else if (attackPattern == 2) {
attackTimer = attackTimer + _root.timescale;
attackTimer2 = attackTimer2 + _root.timescale;
if (attackTimer2 >= 60) {
attackTimer2 = 0;
}
if ((attackTimer >= 4) && (attackTimer2 < 30)) {
_root.playSound("uziShot", _x, _y, 3);
bulName = "bu" + _root.getNextHighestDepth();
_root.attachMovie("bullet", bulName, _root.getNextHighestDepth());
_root[bulName]._x = _x;
_root[bulName]._y = _y;
_root[bulName]._x = _root[bulName]._x + (Math.sin((((_rotation - 90) + angle1) * Math.PI) / 180) * dist1);
_root[bulName]._y = _root[bulName]._y - (Math.cos((((_rotation - 90) + angle1) * Math.PI) / 180) * dist1);
_root[bulName]._x = _root[bulName]._x + (Math.sin((((head._rotation - 90) + angle2) * Math.PI) / 180) * dist2);
_root[bulName]._y = _root[bulName]._y - (Math.cos((((head._rotation - 90) + angle2) * Math.PI) / 180) * dist2);
mFName = "mF" + _root.getNextHighestDepth();
_root.attachMovie("muzzle", mFName, _root.getNextHighestDepth());
_root[mFName]._xscale = (_root[mFName]._yscale = 30);
_root[mFName]._x = _root[bulName]._x;
_root[mFName]._y = _root[bulName]._y;
_root[bulName]._rotation = (_root[mFName]._rotation = _root.getAngle(_root[bulName]._x, _root[bulName]._y, _root.playerL._x, _root.playerL._y) - 180);
_root.addGlow(_root[bulName]._x, _root[bulName]._y, 30, 130);
_root[bulName].onEnterFrame = function () {
_root.bulletCode(this, false, 5);
};
attackTimer = 0;
}
}
}
} else {
attackTimer = (attackTimer2 = 0);
head.topHead._y = head.topHead._y + (((head.topHead.startY - head.topHead._y) * 0.6) * _root.timescale);
}
head.topHead.rEyebrow._rotation = head.topHead.rEyebrow._rotation + (((eyeBrowsRotTarget - head.topHead.rEyebrow._rotation) * 0.1) * _root.timescale);
head.topHead.lEyebrow._rotation = -head.topHead.rEyebrow._rotation;
head.hitbox._height = head._height - 20;
};
}
}
};
Symbol 960 MovieClip Frame 1
_visible = false;