Frame 1
stop();
var mouseListener = new Object();
Frame 4
function fireWeapon() {
if (reloadComplete == true) {
if (bullets > 0) {
bullets = bullets - 1;
var casing = _root.attachMovie("casing", "b" + i, _root.getNextHighestDepth());
casing._width = 3.6 + shell;
casing._height = 9.2 + shell;
casing._x = player._x;
casing._y = player._y;
casing._rotation = player._rotation;
casing.rot = random(20) - random(20);
casing.fax = 0;
casing.fax2 = 0;
casingspeeds = Math.random(4);
if (casingspeeds < 0.1) {
casingspeeds = random(3);
}
casingspeeds2 = Math.random(4);
if (casingspeeds2 < 0.1) {
casingspeeds2 = random(3) * -1;
}
casingangle = ((((player._rotation - 360) + random(55)) - random(55)) * Math.PI) / 180;
casing.xSpeed = Math.cos(casingangle) + casingspeeds;
casing.ySpeed = Math.sin(casingangle) + casingspeeds2;
casing.onEnterFrame = function () {
this.fax = this.fax + 1;
this.fax2 = this.fax2 + 1;
casing._rotation = casing._rotation + this.rot;
this._x = this._x + casing.xSpeed;
this._y = this._y + casing.ySpeed;
if (_root.environment.hitTest(this._x, this._y, true)) {
casing.xSpeed = (casing.xSpeed * -1) * 0.7;
casing.ySpeed = (casing.ySpeed * -1) * 0.7;
}
if (this.fax2 > (40 + random(30))) {
this.xSpeed = 0;
this.ySpeed = 0;
this.rot = 0;
}
if (this.fax > 100) {
this.removeMovieClip();
}
};
var i = 0;
while (i < bulletNumber) {
var bullet_mc = _root.attachMovie("bullet", "b" + z, _root.getNextHighestDepth());
z++;
if (z > 60) {
z = 0;
}
if (shotgun == 1) {
casing.gotoAndStop(2);
}
bullet_mc.thisbullethit = 0;
bullet_mc.bounce = 0;
bullet_mc._height = bcaliber;
bullet_mc._width = bcaliberw;
bullet_mc._x = player._x;
bullet_mc._y = player._y;
bullet_mc._rotation = player._rotation;
bullet_mc.bulletLifeTimer = 0;
bullet_mc.delay = 20;
bullet_mc.rander = Math.random(1.9);
bullet_mc.deathspeed4 = bulletSpeed;
randomNum = random(bulletOffset) - (bulletOffset / 2);
bulletAngle = (((player._rotation + randomNum) - 90) * Math.PI) / 180;
bullet_mc.xSpeed = Math.cos(bulletAngle) * bulletSpeed;
bullet_mc.ySpeed = Math.sin(bulletAngle) * bulletSpeed;
bullet_mc.onEnterFrame = function () {
if (this.thisbullethit == 0) {
this._x = this._x + this.xSpeed;
this._y = this._y + this.ySpeed;
this.deathspeed4 = bulletSpeed;
}
if (this.deathspeed4 < 2) {
this.deathspeed4 = 0;
}
if (_root.environment.hitTest(this._x, this._y, true)) {
this.delay = this.delay + 1;
if (this.delay > 1) {
this.delay = -1;
bomb2 = _root.attachMovie("bomb2", "bomb2", sb);
sb++;
if (sb > 20) {
sb = 1;
}
bomb2._y = this._y;
bomb2._x = this._x;
bomb2._rotation = this._rotation;
}
this.bounce = this.bounce + 1;
if (this.bounce > 1) {
this.bounce = -200;
randb = random(100);
if (bpercent > randb) {
newangle = (newbulletAngle + Math.random(1)) - Math.random(1);
newbulletAngle = ((bullet_mc._rotation - 90) * Math.PI) / 180;
bullet_mc.xSpeed = Math.cos(newangle) * bulletSpeed;
bullet_mc.ySpeed = Math.sin(newangle) * bulletSpeed;
bullet_mc._rotation = ((newangle * 180) / Math.PI) + 90;
this.bounce = -200;
}
}
this.thisbullethit = this.thisbullethit + penetration;
this.penetrate = (this.thisbullethit + 1) + this.rander;
this._x = this._x + (this.xSpeed / this.penetrate);
this._y = this._y + (this.ySpeed / this.penetrate);
this.deathspeed = this.xSpeed / this.penetrate;
this.deathspeed2 = this.ySpeed / this.penetrate;
this.deathspeed4 = this.deathspeed + this.deathspeed2;
if (this.penetrate > 10) {
this.deathspeed4 = 0;
this.xSpeed = 0;
this.ySpeed = 0;
}
} else {
billy = (this.penetrate = this.penetrate + penetrateadv);
this._x = this._x + (this.xSpeed / billy);
this._y = this._y + (this.ySpeed / billy);
if (billy > 9) {
this.deathspeed4 = 0;
this.xSpeed = 0;
this.ySpeed = 0;
}
}
if (this.bulletLifeTimer >= bulletLifeTimerTotal) {
this.removeMovieClip();
}
this.bulletLifeTimer++;
};
i++;
}
startReloading();
}
}
}
function startReloading() {
reloadComplete = false;
reloadTimer = setInterval(this, "gunReloaded", reloadSpeed);
}
function gunReloaded() {
clearInterval(reloadTimer);
reloadComplete = true;
}
function rotatePlayer() {
playerX = player._x;
playerY = player._y;
rotationDirection = Math.round(180 - ((Math.atan2(_root._xmouse - playerX, _root._ymouse - playerY) * 180) / Math.PI));
player._rotation = rotationDirection;
}
stop();
spawn = 10;
f = 1;
while (f <= spawn) {
_root.lol.duplicateMovieClip("lol" + f, f + 2000, bad);
f++;
}
z = 0;
semi = 1;
auto = 0;
derpswitch = 2;
walk_speed = 4.5;
_root.uiadjust = 285;
radius = 15;
_root.weapon = 1;
weapon = 1;
_root.shots = 0;
sb = 1;
mz = 0;
chance = 100;
blife = 90;
recoil = 1;
bspeed = 20;
rof = 300;
muzzlesize = 0;
sb = 3000;
delay = 1;
bs = 4000;
bcaliber = 23;
bcaliberw = 2.3;
bullets = 17;
mbullets = 17;
penetration = 1;
penetrateadv = 0.4;
bulletNumber = 1;
shotgun = 0;
bpercent = 50;
randb = 50;
gunname = "9mm Glock 17";
var bulletOffset = recoil;
var bulletLifeTimerTotal = blife;
var bulletSpeed = bspeed;
var reloadSpeed = rof;
var reloadTimer;
var reloadComplete = true;
var bulletAngle;
var randomNum;
var playerX;
var playerY;
var rotationDirection;
var bulletAngle2;
mouseListener = new Object();
var isMouseDown = false;
this.onMouseDown = function () {
isMouseDown = true;
if (auto == 0) {
fireWeapon();
}
};
this.onMouseUp = function () {
isMouseDown = false;
};
this.onEnterFrame = function () {
if (isMouseDown) {
if (auto == 1) {
fireWeapon();
}
}
};
mouseListener.onMouseMove = function () {
rotatePlayer();
};
Mouse.addListener(mouseListener);
player.onEnterFrame = function () {
if (Key.isDown(82)) {
bullets = mbullets;
}
if (weapon == 1) {
if (derpswitch == 2) {
derpswitch = 1;
auto = 0;
gunname = "9mm Glock 17";
bullets = 17;
bpercent = 10;
mbullets = 17;
shell = -2;
shotgun = 0;
bulletNumber = 1;
bulletOffset = 11;
bulletSpeed = 20;
reloadSpeed = 50;
penetration = 3;
bcaliber = 23.1;
bcaliberw = 2.3;
penetrateadv = 0.4;
}
}
if (weapon == 2) {
if (derpswitch == 2) {
derpswitch = 1;
auto = 0;
gunname = ".22 Ruger 10/22";
bpercent = 80;
bullets = 30;
mbullets = 30;
shell = -3;
shotgun = 0;
bulletNumber = 1;
bulletOffset = 10;
bulletSpeed = 15;
reloadSpeed = 50;
penetration = 15;
bcaliber = 12;
bcaliberw = 2;
penetrateadv = 0.6;
}
}
if (weapon == 3) {
if (derpswitch == 2) {
derpswitch = 1;
auto = 0;
gunname = "Barrett M82";
bpercent = 30;
bullets = 10;
mbullets = 10;
shell = 0.5;
shotgun = 0;
bulletNumber = 1;
bulletOffset = 4;
bulletSpeed = 40;
reloadSpeed = 100;
penetration = 0.2;
bcaliber = 50;
bcaliberw = 3;
penetrateadv = 0.2;
}
}
if (weapon == 4) {
if (derpswitch == 2) {
derpswitch = 1;
auto = 0;
gunname = "20mm Denel NTW-20";
bpercent = 5;
bullets = 3;
mbullets = 3;
shell = 2;
shotgun = 0;
bulletNumber = 1;
bulletOffset = 4;
bulletSpeed = 60;
reloadSpeed = 500;
penetration = 0.4;
bcaliber = 55;
bcaliberw = 4;
penetrateadv = 0.5;
}
}
if (weapon == 5) {
if (derpswitch == 2) {
derpswitch = 1;
auto = 1;
gunname = "MG42";
bpercent = 20;
shell = -2;
shotgun = 0;
bulletNumber = 1;
bullets = 50;
mbullets = 50;
bulletOffset = 9;
bulletSpeed = 40;
reloadSpeed = 40;
penetration = 0.5;
bcaliber = 20;
bcaliberw = 2;
penetrateadv = 0.5;
}
}
if (weapon == 6) {
if (derpswitch == 2) {
derpswitch = 1;
auto = 0;
gunname = "Mossberg 500 (Buckshot)";
shell = 1;
bpercent = 50;
bullets = 8;
mbullets = 8;
shotgun = 1;
bulletOffset = 10;
bulletSpeed = 40;
bulletNumber = 10;
reloadSpeed = 600;
penetration = 4;
bcaliber = 10;
bcaliberw = 3;
penetrateadv = 0.8;
}
}
if (weapon == 7) {
if (derpswitch == 2) {
derpswitch = 1;
auto = 0;
gunname = "Saiga 12 (12 gauge rifled slug)";
shell = 1;
bpercent = 30;
bullets = 12;
mbullets = 12;
shotgun = 1;
bulletOffset = 7;
bulletSpeed = 35;
bulletNumber = 1;
reloadSpeed = 60;
penetration = 0.8;
bcaliber = 30;
bcaliberw = 4;
penetrateadv = 0.5;
}
}
if (weapon == 8) {
if (derpswitch == 2) {
derpswitch = 1;
auto = 0;
gunname = "Moisin Nagant (7.62x54mmR)";
shell = -1;
bpercent = 80;
bullets = 1;
mbullets = 1;
shotgun = 0;
bulletOffset = 5;
bulletSpeed = 45;
bulletNumber = 1;
reloadSpeed = 400;
penetration = 1;
bcaliber = 45;
bcaliberw = 2.2;
penetrateadv = 0.5;
}
}
if (weapon == 9) {
if (derpswitch == 2) {
derpswitch = 1;
auto = 1;
gunname = "HK417 7.62x51mm NATO";
shell = -1;
bpercent = 30;
bullets = 20;
mbullets = 20;
shotgun = 0;
bulletOffset = 4;
bulletSpeed = 45;
bulletNumber = 1;
reloadSpeed = 185;
penetration = 1;
bcaliber = 37;
bcaliberw = 2;
penetrateadv = 0.4;
}
}
if (weapon == 10) {
if (derpswitch == 2) {
derpswitch = 1;
auto = 1;
gunname = "Mac-11/9";
bullets = 30;
bpercent = 50;
mbullets = 30;
shell = -2;
shotgun = 0;
bulletNumber = 1;
bulletOffset = 11;
bulletSpeed = 20;
reloadSpeed = 10;
penetration = 3;
bcaliber = 17;
bcaliberw = 2;
penetrateadv = 0.4;
}
}
if (Key.isDown(65)) {
this._x = this._x - walk_speed;
}
if (Key.isDown(68)) {
this._x = this._x + walk_speed;
}
if (Key.isDown(87)) {
this._y = this._y - walk_speed;
}
if (Key.isDown(83)) {
this._y = this._y + walk_speed;
}
if (Key.isDown(90)) {
_root.camra._width = _root.camra._width * 1.05;
_root.camra._height = _root.camra._height * 1.05;
_root.ui._width = _root.ui._width * 1.05;
_root.ui._height = _root.ui._height * 1.05;
_root.uiadjust = _root.uiadjust * 1.05;
}
if (Key.isDown(88)) {
_root.camra._width = _root.camra._width * 0.95;
_root.camra._height = _root.camra._height * 0.95;
_root.ui._width = _root.ui._width * 0.95;
_root.ui._height = _root.ui._height * 0.95;
_root.uiadjust = _root.uiadjust * 0.95;
}
mouseListener.onMouseWheel = function (delta) {
divideDelta = delta / 3;
weapon = weapon + divideDelta;
derpswitch = 2;
if (weapon > 20) {
weapon = 20;
}
if (weapon < 1) {
weapon = 1;
}
};
Mouse.addListener(mouseListener);
walk_speed = 4;
while (_root.environment.hitTest(this._x, this._y + radius, true)) {
this._y--;
}
while (_root.environment.hitTest(this._x, this._y - radius, true)) {
this._y++;
}
while (_root.environment.hitTest(this._x - radius, this._y, true)) {
this._x++;
}
while (_root.environment.hitTest(this._x + radius, this._y, true)) {
this._x--;
}
};
Instance of Symbol 36 MovieClip "player" in Frame 4
onClipEvent (load) {
phealth = 100;
}
onClipEvent (enterFrame) {
Math.floor(phealth);
if (phealth <= 0) {
phealth = 0;
}
i = 0;
while (i <= 60) {
if (this.hitTest(_root["b" + i]._x, _root["b" + i]._y, true)) {
phealth = phealth - (Math.abs(root["b" + i].deathspeed4) * 2);
}
i++;
}
}
Instance of Symbol 45 MovieClip "camra" in Frame 4
onClipEvent (enterFrame) {
_y = (_y + ((_root.player._y - _y) / 6));
_x = (_x + ((_root.player._x - _x) / 6));
_x = (_x + (_xmouse / 3.5));
_y = (_y + (_ymouse / 3.5));
}
Instance of Symbol 56 MovieClip "ui" in Frame 4
onClipEvent (enterFrame) {
this.lol.text = ((((_root.gunname + " ") + "Ammo: ") + _root.bullets) + " Health: ") + _root.player.phealth;
this._y = _root.camra._y - _root.uiadjust;
this._x = _root.camra._x;
}
Instance of Symbol 12 MovieClip [lol] "lol" in Frame 4
onClipEvent (load) {
this._x = (Math.random() * 1500) - this._width;
this._y = (Math.random() * 1500) - this._height;
this.b1._xscale = bhealth;
bhealth = 100;
}
onClipEvent (enterFrame) {
snap = snap + 1;
this.h1._xscale = bhealth;
if (bhealth <= 0) {
this.swapDepths(1048575);
this.removeMovieClip();
}
i = 0;
while (i <= 60) {
if (this.hitTest(_root["b" + i]._x, _root["b" + i]._y, true)) {
bhealth = bhealth - Math.abs(_root["b" + i].deathspeed4 * 1);
}
i++;
}
}
Instance of Symbol 59 MovieClip in Frame 4
onClipEvent (load) {
Mouse.hide();
}
onClipEvent (enterFrame) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
Symbol 5 MovieClip [muzzle] Frame 15
this.removeMovieClip();
Symbol 15 MovieClip [casing] Frame 1
stop();
Symbol 15 MovieClip [casing] Frame 2
stop();
Symbol 15 MovieClip [casing] Frame 3
stop();
Symbol 22 Button
on (release) {
_root.play();
}
Symbol 25 MovieClip Frame 101
stop();
Symbol 34 MovieClip Frame 83
stop();
_root.play();
Symbol 45 MovieClip Frame 1
function camControl() {
parentColor.setTransform(camColor.getTransform());
var _local4 = sX / this._width;
var _local3 = sY / this._height;
_parent._x = cX - (this._x * _local4);
_parent._y = cY - (this._y * _local3);
_parent._xscale = 100 * _local4;
_parent._yscale = 100 * _local3;
}
function resetStage() {
var _local2 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
parentColor.setTransform(_local2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
parentColor.setTransform(camColor.getTransform());
this._visible = false;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
camControl();
this.onUnload = resetStage;