Section 1
//Bbuildingburgercrumble_32 (ArmageddonCS4_fla.Bbuildingburgercrumble_32)
package ArmageddonCS4_fla {
import flash.display.*;
public dynamic class Bbuildingburgercrumble_32 extends MovieClip {
public function Bbuildingburgercrumble_32(){
addFrameScript(43, frame44);
}
function frame44(){
stop();
}
}
}//package ArmageddonCS4_fla
Section 2
//buildingaveragecrumble_48 (ArmageddonCS4_fla.buildingaveragecrumble_48)
package ArmageddonCS4_fla {
import flash.display.*;
public dynamic class buildingaveragecrumble_48 extends MovieClip {
public var tower:MovieClip;
public function buildingaveragecrumble_48(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package ArmageddonCS4_fla
Section 3
//Buildingshortcrumble_52 (ArmageddonCS4_fla.Buildingshortcrumble_52)
package ArmageddonCS4_fla {
import flash.display.*;
public dynamic class Buildingshortcrumble_52 extends MovieClip {
public function Buildingshortcrumble_52(){
addFrameScript(33, frame34);
}
function frame34(){
stop();
}
}
}//package ArmageddonCS4_fla
Section 4
//Buildingtallcrumble1_35 (ArmageddonCS4_fla.Buildingtallcrumble1_35)
package ArmageddonCS4_fla {
import flash.display.*;
public dynamic class Buildingtallcrumble1_35 extends MovieClip {
public function Buildingtallcrumble1_35(){
addFrameScript(140, frame141);
}
function frame141(){
stop();
}
}
}//package ArmageddonCS4_fla
Section 5
//piecefly_46 (ArmageddonCS4_fla.piecefly_46)
package ArmageddonCS4_fla {
import flash.display.*;
public dynamic class piecefly_46 extends MovieClip {
public function piecefly_46(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package ArmageddonCS4_fla
Section 6
//saucerdomered_65 (ArmageddonCS4_fla.saucerdomered_65)
package ArmageddonCS4_fla {
import flash.display.*;
public dynamic class saucerdomered_65 extends MovieClip {
public function saucerdomered_65(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ArmageddonCS4_fla
Section 7
//GameOverScreen (game_over.GameOverScreen)
package game_over {
import flash.display.*;
import flash.events.*;
import level.*;
public class GameOverScreen extends MovieClip {
public var mask_mc:MovieClip;
public var stats:MovieClip;
public function GameOverScreen(){
addFrameScript(29, frame30);
stats.score_txt.text = Level.score;
stats.mask = mask_mc;
stats.restart.addEventListener(MouseEvent.CLICK, restartClick);
}
public function restartClick(_arg1:MouseEvent){
MovieClip(parent).mainRestart();
}
function frame30(){
stop();
}
}
}//package game_over
Section 8
//FlyingPoint (hud.FlyingPoint)
package hud {
import flash.display.*;
import flash.events.*;
import level.*;
public class FlyingPoint extends MovieClip {
var value;
var yspeed;
var xspeed;
public function FlyingPoint(_arg1, _arg2, _arg3){
value = _arg1;
if (value <= 10){
gotoAndStop(value);
};
if (value == 15){
gotoAndStop(11);
};
if (value == 20){
gotoAndStop(12);
};
if (value == 30){
gotoAndStop(13);
};
if (value == 40){
gotoAndStop(14);
};
if (value == 50){
gotoAndStop(15);
};
if (value == 60){
gotoAndStop(16);
};
if (value == 70){
gotoAndStop(17);
};
if (value == 80){
gotoAndStop(18);
};
if (value == 90){
gotoAndStop(19);
};
if (value == 100){
gotoAndStop(20);
};
x = ((_arg2 + (Math.random() * 10)) - 5);
y = ((_arg3 + (Math.random() * 10)) - 5);
xspeed = ((Math.random() * 40) - 20);
yspeed = ((Math.random() * 40) - 20);
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function enterFrame(_arg1:Event){
x = (x + ((100 - x) / 10));
y = (y + ((57 - y) / 10));
x = (x + xspeed);
y = (y + yspeed);
xspeed = (xspeed * 0.9);
yspeed = (yspeed * 0.9);
scaleX = (scaleY = (scaleY + 0.01));
if ((((Math.abs((100 - x)) < 20)) && ((Math.abs((57 - y)) < 20)))){
Level.score = (Level.score + value);
removeEventListener(Event.ENTER_FRAME, enterFrame);
parent.removeChild(this);
};
}
}
}//package hud
Section 9
//Hud (hud.Hud)
package hud {
import flash.display.*;
import flash.events.*;
import level.*;
import flash.text.*;
import level.hud.*;
public class Hud extends MovieClip {
public var score_txt:TextField;
public var alertDisp;
public var damage_mc:Damage;
public var pulseAlert:MovieClip;
public var energyBar:MovieClip;
public var alert_mask:MovieClip;
public var alert_mark:MovieClip;
public var healthDisp;
public var scoreDisp;
public var health:MovieClip;
public function Hud(){
pulseAlert.visible = false;
damage_mc.layer1.alpha = 0;
damage_mc.layer2.alpha = 0;
addChild(score_txt);
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function flashRed(_arg1){
damage_mc.layer1.alpha = _arg1;
}
private function enterFrame(_arg1:Event){
if (healthDisp < 0){
healthDisp = 0;
};
if (alertDisp > 100){
alertDisp = 100;
};
health.scaleX = (healthDisp / 100);
health.scaleX = (healthDisp / 100);
alert_mark.x = (((alertDisp / 100) * 120) + 50);
if (alertDisp >= 0){
alert_mask.scaleY = 0.25;
};
if (alertDisp >= 25){
alert_mask.scaleY = 0.5;
};
if (alertDisp >= 50){
alert_mask.scaleY = 0.75;
};
if (alertDisp >= 75){
alert_mask.scaleY = 1;
};
if (damage_mc.layer1.alpha > 0){
damage_mc.layer1.alpha = (damage_mc.layer1.alpha - 0.1);
};
score_txt.text = ("Score: " + scoreDisp);
energyBar.scaleY = (Level.energy / 100);
if (Level.energy == 100){
pulseAlert.visible = true;
} else {
pulseAlert.visible = false;
};
damage_mc.layer2.alpha = (1 - (Level.health / 100));
}
public function addPoint(_arg1, _arg2, _arg3){
this.addChild(new FlyingPoint(_arg1, _arg2, _arg3));
}
}
}//package hud
Section 10
//BldAverage (level.buildings.BldAverage)
package level.buildings {
import flash.display.*;
public class BldAverage extends Building {
public var hotel:MovieClip;
public var tower:MovieClip;
public var crumble:MovieClip;
public function BldAverage(){
bldWidth = 75;
setHealth(400);
}
}
}//package level.buildings
Section 11
//BldBurger (level.buildings.BldBurger)
package level.buildings {
public class BldBurger extends Building {
public function BldBurger(){
bldWidth = 100;
setHealth(100);
}
}
}//package level.buildings
Section 12
//BldShort (level.buildings.BldShort)
package level.buildings {
public class BldShort extends Building {
public function BldShort(){
bldWidth = 200;
setHealth(600);
}
}
}//package level.buildings
Section 13
//BldTall (level.buildings.BldTall)
package level.buildings {
public class BldTall extends Building {
public function BldTall(){
bldWidth = 75;
setHealth(600);
}
}
}//package level.buildings
Section 14
//Building (level.buildings.Building)
package level.buildings {
import flash.display.*;
import flash.events.*;
import level.*;
public class Building extends MovieClip {
var removed;// = false
var percent;
public var bldWidth;
var index;
var pointTime;// = 50
public var health;
public var origHealth;
public function Building(){
stop();
index = Level.buildings.length;
Level.buildings[index] = this;
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function remove(){
parent.removeChild(this);
}
public function enterFrame(_arg1:Event){
percent = (health / origHealth);
if ((((percent <= 0.75)) && ((percent > 0.5)))){
if (currentFrame != 2){
gotoAndStop(2);
};
};
if ((((percent <= 0.5)) && ((percent > 0.25)))){
if (currentFrame != 3){
gotoAndStop(3);
};
};
if ((((percent <= 0.25)) && ((percent > 0)))){
if (currentFrame != 4){
gotoAndStop(4);
};
};
if ((((percent <= 0)) && ((pointTime > 0)))){
pointTime--;
ArmageddonMain.HUD.addPoint(1, (x + parent.x), (y - 100));
};
if (pointTime <= 0){
this.removeEventListener(Event.ENTER_FRAME, enterFrame);
};
if (percent <= 0){
if (!removed){
Level.alert++;
removed = true;
removeReference();
if (currentFrame != 5){
gotoAndStop(5);
};
};
};
}
public function removeReference(){
Level.buildings[index] = null;
}
public function setHealth(_arg1){
health = _arg1;
origHealth = _arg1;
}
}
}//package level.buildings
Section 15
//Damage (level.hud.Damage)
package level.hud {
import flash.display.*;
public dynamic class Damage extends MovieClip {
public var layer1:MovieClip;
public var layer2:MovieClip;
}
}//package level.hud
Section 16
//BltAlien (level.humans.BltAlien)
package level.humans {
public class BltAlien extends Bullet {
public function BltAlien(){
speed = 20;
power = 1;
}
}
}//package level.humans
Section 17
//BltMega (level.humans.BltMega)
package level.humans {
public class BltMega extends Bullet {
public function BltMega(){
speed = 10;
power = 10;
}
}
}//package level.humans
Section 18
//BltStd (level.humans.BltStd)
package level.humans {
public class BltStd extends Bullet {
public function BltStd(){
speed = 5;
power = 0.5;
}
}
}//package level.humans
Section 19
//BltWMD (level.humans.BltWMD)
package level.humans {
public class BltWMD extends Bullet {
public function BltWMD(){
speed = 20;
power = 20;
}
}
}//package level.humans
Section 20
//Bullet (level.humans.Bullet)
package level.humans {
import flash.display.*;
import flash.events.*;
import level.*;
public class Bullet extends MovieClip {
public var power;
public var speed;
public var ySpeed;
public var xSpeed;
var index;
var t;// = 0
public function Bullet(){
index = Level.bullets.length;
Level.bullets[index] = this;
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function remove(){
Level.bullets[index] = null;
removeEventListener(Event.ENTER_FRAME, enterFrame);
parent.removeChild(this);
}
function enterFrame(_arg1:Event){
x = (x + xSpeed);
y = (y + ySpeed);
t++;
if ((((t > 120)) || ((y < 0)))){
remove();
};
}
}
}//package level.humans
Section 21
//Car (level.humans.Car)
package level.humans {
public class Car extends Vehicle {
public function Car(){
speed = (10 + (Math.random() * 2));
mass = 30;
ground = 6;
setHealth(100);
sub = "car";
hostile = false;
}
}
}//package level.humans
Section 22
//Civilian (level.humans.Civilian)
package level.humans {
public class Civilian extends Person {
public function Civilian(){
mass = 15;
speed = (Math.random() + 1.5);
health = 10;
sub = "civilian";
hostile = false;
}
}
}//package level.humans
Section 23
//Convoy (level.humans.Convoy)
package level.humans {
public class Convoy extends Vehicle {
public function Convoy(){
speed = (10 + (Math.random() * 2));
mass = 60;
ground = 11;
setHealth(150);
sub = "truck";
hostile = false;
dispatch = true;
disID = Soldier;
disHold = 4;
}
}
}//package level.humans
Section 24
//Cop (level.humans.Cop)
package level.humans {
import flash.display.*;
import flash.events.*;
import level.*;
public class Cop extends Person {
var x1;
var bullet;
var rot;
var y2;
var x2;
public var shoot_ani:MovieClip;
var y1;
public function Cop(){
mass = 15;
speed = (Math.random() + 1.5);
health = 10;
sub = "cop";
hostile = true;
Level.copTotal++;
addEventListener(Event.ENTER_FRAME, enterFrame2);
}
public function enterFrame2(_arg1:Event){
if (!removed){
if (currentFrame != 3){
shoot_ani.alpha = 0;
} else {
shoot_ani.alpha = 1;
if (shoot_ani.currentFrame == 20){
bullet = new BltStd();
parent.addChild(bullet);
if (scaleX > 0){
bullet.x = (x + 4);
};
if (scaleX < 0){
bullet.x = (x - 4);
};
bullet.y = (y - 5);
ArmageddonMain.gun.play();
x1 = x;
y1 = y;
x2 = (Level.saucer_x + (Level.saucer_xspeed * 20));
y2 = Level.saucer_y;
rot = Math.atan2((y2 - y1), (x2 - x1));
bullet.xSpeed = (Math.cos(rot) * bullet.speed);
bullet.ySpeed = (Math.sin(rot) * bullet.speed);
};
};
} else {
removeEventListener(Event.ENTER_FRAME, enterFrame2);
};
}
}
}//package level.humans
Section 25
//CopCar (level.humans.CopCar)
package level.humans {
public class CopCar extends Vehicle {
public function CopCar(){
speed = (10 + (Math.random() * 2));
mass = 30;
ground = 6;
setHealth(100);
sub = "car";
hostile = false;
dispatch = true;
disID = Cop;
disHold = 2;
}
}
}//package level.humans
Section 26
//GreenCar (level.humans.GreenCar)
package level.humans {
public class GreenCar extends Vehicle {
public function GreenCar(){
speed = (10 + (Math.random() * 2));
mass = 30;
ground = 6;
setHealth(100);
sub = "car";
hostile = false;
}
}
}//package level.humans
Section 27
//HazDel (level.humans.HazDel)
package level.humans {
public class HazDel extends Vehicle {
public function HazDel(){
speed = (10 + (Math.random() * 2));
mass = 60;
ground = 11;
setHealth(200);
sub = "truck";
hostile = false;
dispatch = true;
disID = Hazmat;
disHold = 6;
haz = true;
}
}
}//package level.humans
Section 28
//Hazmat (level.humans.Hazmat)
package level.humans {
import flash.display.*;
import flash.events.*;
import level.*;
public class Hazmat extends Person {
var x1;
var bullet;
var rot;
var y2;
var x2;
public var shoot_ani:MovieClip;
var y1;
public function Hazmat(){
mass = 15;
speed = (Math.random() + 1.5);
health = 10;
sub = "haz";
hostile = true;
Level.copTotal++;
addEventListener(Event.ENTER_FRAME, enterFrame2);
}
public function enterFrame2(_arg1:Event){
if (!removed){
if (currentFrame != 3){
shoot_ani.alpha = 0;
} else {
shoot_ani.alpha = 1;
if (shoot_ani.currentFrame == 10){
bullet = new BltAlien();
parent.addChild(bullet);
if (scaleX > 0){
bullet.x = (x + 4);
};
if (scaleX < 0){
bullet.x = (x - 4);
};
bullet.y = (y - 5);
x1 = x;
y1 = y;
x2 = Level.saucer_x;
y2 = Level.saucer_y;
rot = Math.atan2((y2 - y1), (x2 - x1));
bullet.xSpeed = (Math.cos(rot) * bullet.speed);
bullet.ySpeed = (Math.sin(rot) * bullet.speed);
bullet = new BltAlien();
parent.addChild(bullet);
if (scaleX > 0){
bullet.x = (x + 4);
};
if (scaleX < 0){
bullet.x = (x - 4);
};
bullet.y = (y - 5);
x1 = x;
y1 = y;
x2 = Level.saucer_x;
y2 = Level.saucer_y;
rot = Math.atan2((y2 - y1), (x2 - x1));
rot = (rot + (Math.PI / 32));
bullet.xSpeed = (Math.cos(rot) * bullet.speed);
bullet.ySpeed = (Math.sin(rot) * bullet.speed);
bullet = new BltAlien();
parent.addChild(bullet);
if (scaleX > 0){
bullet.x = (x + 4);
};
if (scaleX < 0){
bullet.x = (x - 4);
};
bullet.y = (y - 5);
ArmageddonMain.gunh.play();
x1 = x;
y1 = y;
x2 = Level.saucer_x;
y2 = Level.saucer_y;
rot = Math.atan2((y2 - y1), (x2 - x1));
rot = (rot - (Math.PI / 32));
bullet.xSpeed = (Math.cos(rot) * bullet.speed);
bullet.ySpeed = (Math.sin(rot) * bullet.speed);
};
};
} else {
removeEventListener(Event.ENTER_FRAME, enterFrame2);
};
}
}
}//package level.humans
Section 29
//HazTank (level.humans.HazTank)
package level.humans {
import flash.display.*;
import flash.events.*;
import level.*;
public class HazTank extends Vehicle {
var sx;
var sy;
var barY;
var bullet;
public var barrel:MovieClip;
var barX;
var rad;
var reload;
var rot2;
var deg;
public function HazTank(){
barrel.stop();
speed = 0;
mass = 300;
ground = 10;
setHealth(200);
sub = "tank";
hostile = true;
timeout = 100000;
barX = barrel.x;
barY = barrel.y;
addEventListener(Event.ENTER_FRAME, enterFrame2);
}
private function enterFrame2(_arg1:Event){
if (!removed){
sx = Level.saucer_x;
sy = Level.saucer_y;
rad = (Math.atan2((sy - y), (sx - x)) + (Math.PI / 2));
deg = (rad * (180 / Math.PI));
deg = findCloseCoterm(0, deg);
if (scaleX < 0){
deg = -(deg);
};
barrel.rotation = deg;
barrel.x = (barrel.x + ((barX - barrel.x) / 3));
barrel.y = (barrel.y + ((barY - barrel.y) / 3));
if (upright){
if (Math.abs(xDis) < 400){
reload++;
if (reload == 30){
reload = 0;
rad = (rad - (Math.PI / 2));
barrel.x = (barrel.x + ((Math.cos(rad) * -10) * scaleX));
barrel.y = (barrel.y + (Math.sin(rad) * -10));
ArmageddonMain.ex1.play();
bullet = new BltWMD();
parent.addChild(bullet);
if (scaleX > 0){
rot2 = (barrel.rotation - 90);
rot2 = (rot2 * (Math.PI / 180));
bullet.x = ((x + barX) + (Math.cos(rot2) * 50));
};
if (scaleX < 0){
rot2 = (barrel.rotation - 90);
rot2 = (rot2 * (Math.PI / 180));
bullet.x = ((x - barX) - (Math.cos(rot2) * 50));
};
bullet.y = ((y + barY) + (Math.sin(rot2) * 50));
if (scaleX > 0){
bullet.xSpeed = (Math.cos(rot2) * bullet.speed);
} else {
bullet.xSpeed = (-(Math.cos(rot2)) * bullet.speed);
};
bullet.ySpeed = (Math.sin(rot2) * bullet.speed);
};
} else {
reload = 0;
};
};
};
}
}
}//package level.humans
Section 30
//Person (level.humans.Person)
package level.humans {
import flash.display.*;
import flash.events.*;
import level.*;
import level.wreck.*;
public class Person extends MovieClip {
public var sub;
var blood;
public var mass;
public var power;
public var type;// = "person"
public var ySpeed;// = 0
var buffer;// = 0
var index;
public var speed;
public var health;
var ground;// = 10
var removed;// = false
public var abduct;// = false
var accuDistance;
public var xSpeed;// = 0
var distance;
public var hostile;
var direction;
public function Person(){
accuDistance = ((Math.random() * 100) + 100);
super();
index = Level.victims.length;
Level.victims[index] = this;
stop();
if (Math.random() < 0.5){
x = -10;
direction = (scaleX = 1);
} else {
x = (Level.rightBound + 20);
direction = (scaleX = -1);
};
y = 350;
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function remove(_arg1=false){
if (sub == "cop"){
Level.copTotal--;
};
if (sub == "sol"){
Level.solTotal--;
};
if (!removed){
if (_arg1){
ArmageddonMain.HUD.addPoint(1, (x + parent.x), y);
blood = new Blood((xSpeed / 1.5), (-(Math.abs(ySpeed)) / 1.5));
blood.x = x;
blood.y = (y + 10);
parent.addChild(blood);
};
removeEventListener(Event.ENTER_FRAME, enterFrame);
parent.removeChild(this);
Level.victims[index] = null;
removed = true;
};
}
private function enterFrame(_arg1:Event){
if (!abduct){
if ((y + ground) < Level.ground){
if (currentFrame != 2){
gotoAndStop(2);
};
rotation = (rotation + xSpeed);
ySpeed = (ySpeed + 0.5);
} else {
rotation = 0;
ySpeed = 0;
y = (Level.ground - ground);
xSpeed = (xSpeed * 0.9);
if (!hostile){
x = (x + (direction * speed));
if (currentFrame != 1){
gotoAndStop(1);
};
} else {
if (x > Level.saucer_x){
direction = -1;
scaleX = -1;
} else {
direction = 1;
scaleX = 1;
};
distance = (x - Level.saucer_x);
buffer--;
if (Math.abs(distance) < accuDistance){
buffer = 30;
if (currentFrame != 3){
gotoAndStop(3);
};
} else {
if (buffer <= 0){
if (currentFrame != 1){
gotoAndStop(1);
};
x = (x + (direction * speed));
};
};
};
};
x = (x + xSpeed);
y = (y + ySpeed);
if ((y + ground) > Level.ground){
y = (Level.ground - ground);
if (ySpeed > 12){
remove(true);
};
};
} else {
gotoAndStop(2);
};
if (health < 0){
remove(true);
};
if ((((x < -100)) || ((x > (Level.rightBound + 50))))){
remove();
};
}
}
}//package level.humans
Section 31
//Soldier (level.humans.Soldier)
package level.humans {
import flash.display.*;
import flash.events.*;
import level.*;
public class Soldier extends Person {
var x1;
var bullet;
var rot;
var y2;
var x2;
public var shoot_ani:MovieClip;
var y1;
public function Soldier(){
mass = 15;
speed = (Math.random() + 1.5);
health = 10;
sub = "sol";
hostile = true;
Level.solTotal++;
addEventListener(Event.ENTER_FRAME, enterFrame2);
}
public function enterFrame2(_arg1:Event){
if (!removed){
if (currentFrame != 3){
shoot_ani.alpha = 0;
} else {
shoot_ani.alpha = 1;
if ((((((shoot_ani.currentFrame == 10)) || ((shoot_ani.currentFrame == 14)))) || ((shoot_ani.currentFrame == 18)))){
bullet = new BltStd();
parent.addChild(bullet);
if (scaleX > 0){
bullet.x = (x + 4);
};
if (scaleX < 0){
bullet.x = (x - 4);
};
bullet.y = (y - 5);
ArmageddonMain.gun.play();
x1 = x;
y1 = y;
x2 = (Level.saucer_x + (Level.saucer_xspeed * 20));
y2 = Level.saucer_y;
rot = Math.atan2((y2 - y1), (x2 - x1));
bullet.xSpeed = (Math.cos(rot) * bullet.speed);
bullet.ySpeed = (Math.sin(rot) * bullet.speed);
};
};
} else {
removeEventListener(Event.ENTER_FRAME, enterFrame2);
};
}
}
}//package level.humans
Section 32
//Tank (level.humans.Tank)
package level.humans {
import flash.display.*;
import flash.events.*;
import level.*;
public class Tank extends Vehicle {
var sx;
var sy;
var barY;
var bullet;
public var barrel:MovieClip;
var barX;
var rad;
var reload;
var rot2;
var deg;
public function Tank(){
barrel.stop();
speed = 0;
mass = 300;
ground = 10;
setHealth(200);
sub = "tank";
hostile = true;
timeout = 100000;
barX = barrel.x;
barY = barrel.y;
addEventListener(Event.ENTER_FRAME, enterFrame2);
}
private function enterFrame2(_arg1:Event){
if (!removed){
sx = Level.saucer_x;
sy = Level.saucer_y;
rad = (Math.atan2((sy - y), (sx - x)) + (Math.PI / 2));
deg = (rad * (180 / Math.PI));
deg = findCloseCoterm(0, deg);
if (scaleX > 0){
if (deg < 40){
deg = 40;
};
};
if (scaleX < 0){
if (deg > -40){
deg = -40;
};
deg = -(deg);
};
barrel.rotation = deg;
barrel.x = (barrel.x + ((barX - barrel.x) / 3));
barrel.y = (barrel.y + ((barY - barrel.y) / 3));
if (upright){
if ((((Math.abs(xDis) > 100)) && ((Math.abs(xDis) < 400)))){
reload++;
if (reload == 30){
reload = 0;
rad = (rad - (Math.PI / 2));
barrel.x = (barrel.x + ((Math.cos(rad) * -10) * scaleX));
barrel.y = (barrel.y + (Math.sin(rad) * -10));
ArmageddonMain.ex1.play();
bullet = new BltMega();
parent.addChild(bullet);
if (scaleX > 0){
rot2 = (barrel.rotation - 90);
rot2 = (rot2 * (Math.PI / 180));
bullet.x = ((x + barX) + (Math.cos(rot2) * 50));
};
if (scaleX < 0){
rot2 = (barrel.rotation - 90);
rot2 = (rot2 * (Math.PI / 180));
bullet.x = ((x - barX) - (Math.cos(rot2) * 50));
};
bullet.y = ((y + barY) + (Math.sin(rot2) * 50));
if (scaleX > 0){
bullet.xSpeed = (Math.cos(rot2) * bullet.speed);
} else {
bullet.xSpeed = (-(Math.cos(rot2)) * bullet.speed);
};
bullet.ySpeed = (Math.sin(rot2) * bullet.speed);
};
} else {
reload = 0;
};
};
};
}
}
}//package level.humans
Section 33
//Taxi (level.humans.Taxi)
package level.humans {
public class Taxi extends Vehicle {
public function Taxi(){
speed = (10 + (Math.random() * 2));
mass = 30;
ground = 6;
setHealth(100);
sub = "car";
hostile = false;
}
}
}//package level.humans
Section 34
//Truck (level.humans.Truck)
package level.humans {
public class Truck extends Vehicle {
public function Truck(){
speed = (10 + (Math.random() * 2));
mass = 60;
ground = 11;
setHealth(150);
sub = "truck";
hostile = false;
}
}
}//package level.humans
Section 35
//Vehicle (level.humans.Vehicle)
package level.humans {
import flash.display.*;
import flash.events.*;
import level.*;
import level.wreck.*;
public class Vehicle extends MovieClip {
public var dispatch;
public var power;
var direction;
var ground;
public var hostile;
var dispatched;
var w1;
var w2;
var w4;
var disDis;
public var haz;
var w3;
public var disID;
var explosion;
public var xSpeed;// = 0
var tankPosition;// = false
var freakX;
var freakY;
var rotDis;
public var type;// = "vehicle"
var freakYArc;// = 0
public var sub;
var freakOut;// = false
public var ySpeed;// = 0
var dTime;// = 0
var index;
public var speed;
var rot;
public var health;
var freakXArc;// = 0
var removed;// = false
public var timeout;// = 900
public var abduct;// = false
var leftEdge;
var i;
var disMan;
var disHold;// = 1
public var upright;
public var mass;
var xDis;
var rightEdge;
public var origHealth;
var tankDistance;
public function Vehicle(){
disDis = ((Math.random() * 200) + 200);
super();
stop();
index = Level.victims.length;
Level.victims[index] = this;
if (Math.random() < 0.5){
x = -50;
direction = (scaleX = 1);
tankDistance = 250;
} else {
x = (Level.rightBound + 50);
direction = (scaleX = -1);
tankDistance = -200;
};
y = Level.ground;
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function remove(_arg1=false){
if (!removed){
if (_arg1){
if (sub == "car"){
ArmageddonMain.HUD.addPoint(3, (x + parent.x), y);
explosion = new Explosion(x, y, 1);
parent.addChild(new Wheel(x, y));
parent.addChild(new Wheel(x, y));
parent.addChild(new CarBroken(x, y));
};
if (sub == "truck"){
ArmageddonMain.HUD.addPoint(5, (x + parent.x), y);
explosion = new Explosion(x, y, 2);
parent.addChild(new Wheel(x, y));
parent.addChild(new Wheel(x, y));
parent.addChild(new Wheel(x, y));
parent.addChild(new TruckBroken1(x, y));
parent.addChild(new TruckBroken2(x, y));
if (haz){
i = 0;
while (i < 5) {
ArmageddonMain.HUD.addPoint(1, (x + parent.x), y);
i++;
};
};
};
if (sub == "tank"){
ArmageddonMain.HUD.addPoint(50, (x + parent.x), y);
explosion = new Explosion(x, y, 2);
parent.addChild(new Wheel(x, y));
parent.addChild(new Wheel(x, y));
parent.addChild(new Wheel(x, y));
parent.addChild(new Wheel(x, y));
parent.addChild(new Wheel(x, y));
parent.addChild(new Wheel(x, y));
parent.addChild(new TankChunk(x, (y - 10)));
};
parent.addChild(explosion);
};
removeEventListener(Event.ENTER_FRAME, enterFrame);
parent.removeChild(this);
Level.victims[index] = null;
removed = true;
};
}
function damage(_arg1){
health = (health - (_arg1 * 10));
}
public function setHealth(_arg1){
health = _arg1;
origHealth = _arg1;
}
public function enterFrame(_arg1:Event){
timeout--;
if (timeout < 0){
remove();
};
if (!abduct){
if ((y + ground) < Level.ground){
ySpeed = (ySpeed + 0.5);
} else {
ySpeed = 0;
y = (Level.ground - ground);
xSpeed = (xSpeed * 0.9);
rot = findCloseCoterm(0, rotation);
rotDis = (0 - rot);
if (Math.abs(rotDis) < 90){
upright = true;
rotation = (rotation + ((0 - rot) / 3));
if (!hostile){
x = (x + ((direction * speed) * ((90 - Math.abs(rotDis)) / 90)));
};
xDis = (Level.saucer_x - x);
if (dispatch){
if (!dispatched){
if (Math.abs(xDis) < disDis){
dispatched = true;
};
} else {
dTime++;
if (dTime < 30){
speed = (speed * 0.8);
};
if (dTime == 30){
i = 0;
while (i < disHold) {
disMan = new disID();
parent.addChild(disMan);
disMan.x = ((x + (Math.random() * 20)) - 10);
disMan.y = y;
i++;
};
};
if (dTime > 30){
speed = (speed + ((10 - speed) / 5));
};
};
};
if (hostile){
if (speed > 10){
speed = 10;
};
if (speed < -10){
speed = -10;
};
rightEdge = ((x + tankDistance) + 75);
leftEdge = ((x + tankDistance) - 75);
if (rightEdge < Level.saucer_x){
speed = (speed + 0.05);
tankPosition = false;
};
if ((((rightEdge > Level.saucer_x)) && ((leftEdge < Level.saucer_x)))){
speed = (speed * 0.9);
tankPosition = true;
};
if (leftEdge > Level.saucer_x){
speed = (speed - 0.05);
tankPosition = false;
};
x = (x + speed);
};
} else {
upright = false;
rot = findCloseCoterm(180, rotation);
rotation = (rotation + ((180 - rot) / 3));
};
};
rotation = (rotation + xSpeed);
x = (x + xSpeed);
y = (y + ySpeed);
if ((y + ground) > Level.ground){
y = (Level.ground - ground);
damage(ySpeed);
if (freakOut){
y = (y - 5);
freakX = ((Math.random() * 40) - 20);
freakY = (Math.random() * -10);
freakXArc = ((Math.random() * 6) - 3);
freakYArc = ((Math.random() * 2) - 1);
};
};
if (freakOut){
freakX = (freakX + freakXArc);
freakY = (freakY + freakYArc);
xSpeed = freakX;
ySpeed = freakY;
rotation = (rotation + xSpeed);
};
};
if (health < (origHealth / 2)){
if (currentFrame != 2){
gotoAndStop(2);
};
};
if (health <= 0){
remove(true);
};
if ((((x < -100)) || ((x > (Level.rightBound + 100))))){
remove();
};
}
function findCloseCoterm(_arg1, _arg2){
var _local3:*;
var _local4:*;
var _local5:* = [];
var _local6:* = 1000;
var _local7:* = 0;
var _local8:* = -2;
while (_local8 <= 2) {
_local3 = (_arg2 + (360 * _local8));
_local5.push(_local3);
_local8++;
};
_local8 = 0;
while (_local8 < _local5.length) {
_local4 = Math.abs((_local5[_local8] - _arg1));
if (_local4 < _local6){
_local6 = _local4;
_local7 = _local5[_local8];
};
_local8++;
};
return (_local7);
}
}
}//package level.humans
Section 36
//Laser (level.saucerparts.Laser)
package level.saucerparts {
import flash.display.*;
public dynamic class Laser extends MovieClip {
public var blast:MovieClip;
public var raymask:MovieClip;
}
}//package level.saucerparts
Section 37
//Ray (level.saucerparts.Ray)
package level.saucerparts {
import flash.display.*;
public dynamic class Ray extends MovieClip {
public var raymask:MovieClip;
}
}//package level.saucerparts
Section 38
//Saucer (level.saucerparts.Saucer)
package level.saucerparts {
import flash.display.*;
import flash.events.*;
import level.*;
import flash.ui.*;
public class Saucer extends MovieClip {
var power;
var shake;// = 0
var victim;
var yy1;
var yy2;
var target;
var weapon;// = 0
var mouse;// = false
var abductWidth;// = 20
var mx:Number;
var my:Number;
public var dome2:MovieClip;
public var doom:MovieClip;
var xx1;
var xx2;
public var xSpeed;
var x1;
var x2;
var releasePower;
var laserTime;// = 0
var ray;
var _width;
var laser;
var _height;
public var ySpeed;
var angle;
var y2;
var bld;
var spacePress;// = false
public var speed;
public var dome:MovieClip;
var y1;
var i;
var xForce;// = 0
var alternator;// = 0
var en;
var switchTimer;// = 0
var distance;
var yForce;// = 0
public function Saucer(){
_width = width;
_height = height;
super();
stop();
dome.stop();
doom.stop();
ray = new Ray();
ray.y = 10;
ray.stop();
this.addChild(ray);
laser = new Laser();
laser.y = 10;
laser.stop();
this.addChild(laser);
laser.blast.alpha = 0;
addEventListener(Event.ENTER_FRAME, enterFrame);
}
function enterFrame(_arg1:Event){
en = Level.energy;
mx = Sprite(parent).mouseX;
my = Sprite(parent).mouseY;
if (alternator == 0){
alternator = 1;
x1 = x;
y1 = y;
xSpeed = (x1 - x2);
ySpeed = (y1 - y2);
} else {
alternator = 0;
x2 = x;
y2 = y;
xSpeed = (x2 - x1);
ySpeed = (y2 - y1);
};
speed = Math.sqrt(((xSpeed * xSpeed) + (ySpeed * ySpeed)));
x = (x + ((mx - x) / 2));
y = (y + ((my - y) / 2));
if (((!((weapon == 0))) && ((y < 10)))){
y = 10;
};
if (shake != 0){
x = (x + (((Math.random() * shake) * 2) - shake));
y = (y + (((Math.random() * shake) * 2) - shake));
};
x = (x + xForce);
y = (y + yForce);
xForce = (xForce * 0.9);
yForce = (yForce * 0.9);
constrain();
laser.raymask.height = (380 - (y + 10));
ray.raymask.height = (380 - (y + 10));
laser.blast.y = (380 - (y + 10));
if (weapon == 0){
laser.alpha = 0;
ray.alpha = 1;
dome.alpha = 1;
doom.alpha = 0;
if (currentFrame != 1){
gotoAndStop(1);
};
if (dome.currentFrame == 1){
dome.gotoAndStop(1);
};
if (!mouse){
if (ray.currentFrame != 1){
ray.gotoAndStop(1);
};
shake = 0;
} else {
if (ray.currentFrame != 2){
ray.gotoAndStop(2);
};
shake = 2;
i = 0;
while (i < Level.victims.length) {
if (Level.victims[i] != null){
victim = Level.victims[i];
if ((((Math.abs((x - victim.x)) < abductWidth)) || (victim.abduct))){
if (victim.y > (y + 10)){
distance = Math.abs(((y + 10) - victim.y));
if (distance < 300){
victim.abduct = true;
power = (300 - distance);
victim.y = (victim.y - (power / victim.mass));
victim.x = (victim.x + ((x - victim.x) / 2));
victim.power = power;
};
if (distance > 300){
if (victim.abduct){
releaseVictim(victim);
};
};
} else {
if (victim.abduct){
if (victim.type == "person"){
ArmageddonMain.HUD.addPoint(2, (x + parent.x), y);
Level.health = (Level.health + 1);
victim.remove();
dome.gotoAndPlay(2);
} else {
ArmageddonMain.HUD.flashRed(1);
Level.health = (Level.health - 5);
yForce = -20;
releaseVictim(victim);
};
};
};
};
};
i++;
};
};
} else {
i = 0;
while (i < Level.victims.length) {
if (Level.victims[i] != null){
victim = Level.victims[i];
victim.abduct = false;
};
i++;
};
};
if ((((weapon == 1)) && ((Level.energy > 0)))){
laser.alpha = 1;
ray.alpha = 0;
dome.alpha = 0;
doom.alpha = 0;
if (currentFrame != 2){
gotoAndStop(2);
};
if (!mouse){
laser.blast.alpha = 0;
if (laser.currentFrame != 1){
};
laser.gotoAndStop(1);
shake = 0;
} else {
Level.energy = (Level.energy - 1);
if (Level.energy < 0){
mouse = false;
weapon = 0;
ArmageddonMain.stopLaser();
};
laser.blast.alpha = 1;
laser.blast.y = (380 - (y + 10));
if (laser.currentFrame != 2){
laser.gotoAndStop(2);
};
shake = 5;
laser.blast.scaleX = (laser.blast.scaleY = (((10 + y) / 190) + 0.3));
i = 0;
while (i < Level.victims.length) {
if (Level.victims[i] != null){
victim = Level.victims[i];
distance = Math.abs((x - victim.x));
if (distance < 20){
if (victim.y > y){
victim.health = (victim.health - 20);
};
};
};
i++;
};
};
};
if (weapon == 2){
if (currentFrame != 3){
gotoAndStop(3);
};
ray.alpha = 0;
laser.alpha = 0;
doom.alpha = 0;
dome.alpha = 0;
};
if (weapon == 3){
if (currentFrame != 4){
gotoAndStop(43);
};
ray.alpha = 0;
laser.alpha = 0;
doom.alpha = 1;
dome.alpha = 0;
if (doom.currentFrame == 32){
i = 0;
while (i < Level.victims.length) {
victim = Level.victims[i];
if (victim != null){
xx1 = victim.x;
yy1 = victim.y;
xx2 = x;
yy2 = y;
angle = (Math.atan2((yy2 - yy1), (xx2 - xx1)) * (180 / Math.PI));
if ((((angle > (-90 - 33))) && ((angle < (-90 + 33))))){
victim.remove(true);
};
};
i++;
};
i = 0;
while (i < Level.buildings.length) {
bld = Level.buildings[i];
if (bld != null){
xx1 = bld.x;
yy1 = bld.y;
xx2 = x;
yy2 = y;
angle = (Math.atan2((yy2 - yy1), (xx2 - xx1)) * (180 / Math.PI));
if ((((angle > (-90 - 33))) && ((angle < (-90 + 33))))){
bld.health = (bld.health - 200);
};
};
i++;
};
};
};
i = 0;
while (i < Level.bullets.length) {
target = Level.bullets[i];
if (target != null){
xx1 = target.x;
yy1 = target.y;
xx2 = x;
yy2 = y;
distance = Math.sqrt((((xx1 - xx2) * (xx1 - xx2)) + ((yy1 - yy2) * (yy1 - yy2))));
if (distance < 25){
ArmageddonMain.HUD.flashRed(1);
xForce = (xForce + (target.xSpeed / 2));
yForce = (yForce + (target.ySpeed / 2));
Level.health = (Level.health - target.power);
target.remove();
};
};
i++;
};
if (Key.isDown(49)){
weapon = 0;
};
if (Key.isDown(50)){
weapon = 1;
};
if (Key.isDown(51)){
weapon = 2;
};
if (Key.isDown(52)){
weapon = 3;
};
if (Key.isDown(Keyboard.SPACE)){
if (!spacePress){
if (weapon == 0){
if ((((en > 10)) && ((en < 100)))){
weapon = 1;
};
if (en >= 100){
weapon = 3;
};
} else {
weapon = 0;
};
};
spacePress = true;
} else {
spacePress = false;
};
if (doom.currentFrame == doom.totalFrames){
doom.gotoAndStop(1);
weapon = 0;
};
}
public function mouseDown(){
laserTime = 0;
laser.gotoAndStop(2);
laser.blast.alpha = 1;
mouse = true;
if (weapon == 0){
ArmageddonMain.playTractor();
};
if (weapon == 1){
ArmageddonMain.playLaser();
};
if (weapon == 2){
yForce = -10;
};
if (weapon == 3){
Level.energy = 0;
doom.play();
ArmageddonMain.weap3.play();
};
}
public function remove(){
parent.removeChild(this);
removeEventListener(Event.ENTER_FRAME, enterFrame);
}
public function mouseUp(){
laser.gotoAndStop(1);
laser.blast.alpha = 0;
mouse = false;
ArmageddonMain.stopTractor();
ArmageddonMain.stopLaser();
if (weapon == 0){
i = 0;
while (i < Level.victims.length) {
if (Level.victims[i] != null){
if (Level.victims[i].abduct){
releaseVictim(Level.victims[i]);
};
};
i++;
};
};
if (weapon == 1){
};
}
function bringFront(){
var _local1:* = (parent.numChildren - 1);
parent.setChildIndex(this, _local1);
}
function releaseVictim(_arg1){
_arg1.abduct = false;
releasePower = (_arg1.mass / 10);
releasePower = (releasePower + ((Math.random() * 2) - 1));
_arg1.xSpeed = (xSpeed / releasePower);
_arg1.ySpeed = ((ySpeed / releasePower) - (_arg1.power / 50));
}
function constrain(){
if (x < (Level.leftBound + (_width / 2))){
x = (Level.leftBound + (_width / 2));
};
if (x > (Level.rightBound - (_width / 2))){
x = (Level.rightBound - (_width / 2));
};
if (y > (Level.ground - 50)){
y = (Level.ground - 50);
};
}
}
}//package level.saucerparts
Section 39
//SaucerCrash (level.saucerparts.SaucerCrash)
package level.saucerparts {
import flash.display.*;
import flash.events.*;
import level.*;
public class SaucerCrash extends MovieClip {
var explosion;
var did;// = false
var ySpeed;
var xSpeed;
public function SaucerCrash(){
stop();
xSpeed = -5;
ySpeed = 0;
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function enterFrame(_arg1:Event){
if (y < (Level.ground - 10)){
ySpeed++;
rotation = (rotation + ((-45 - rotation) / 5));
} else {
xSpeed = 0;
if (currentFrame != 2){
gotoAndStop(2);
};
y = (Level.ground - 10);
ySpeed = 0;
rotation = 0;
if (!did){
did = true;
explosion = new Explosion(x, y, 5);
parent.addChild(explosion);
};
};
y = (y + ySpeed);
if (y > (Level.ground - 10)){
y = (Level.ground - 10);
};
x = (x + xSpeed);
}
}
}//package level.saucerparts
Section 40
//Blood (level.wreck.Blood)
package level.wreck {
import flash.display.*;
import flash.events.*;
public class Blood extends Sprite {
private var drop;
private var bloodList;
private var bloodValues;
private var time;// = 0
public function Blood(_arg1, _arg2){
var _local4:*;
var _local5:*;
bloodList = [];
bloodValues = [];
super();
var _local3:* = 0;
while (_local3 < 10) {
drop = new Sprite();
drop.graphics.beginFill(0xFF0000);
drop.graphics.drawCircle(-1, -1, 2);
drop.graphics.endFill();
drop.x = ((Math.random() * 10) - 5);
drop.y = ((Math.random() * 10) - 5);
drop.scaleX = (drop.scaleY = Math.random());
_local4 = ((_arg1 + (Math.random() * 10)) - 5);
_local5 = ((_arg2 + (Math.random() * 10)) - 5);
bloodValues.push([_local4, _local5]);
addChild(drop);
bloodList.push(drop);
_local3++;
};
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function enterFrame(_arg1:Event){
time++;
var _local2:* = 0;
while (_local2 < bloodList.length) {
drop = bloodList[_local2];
drop.x = (drop.x + bloodValues[_local2][0]);
drop.y = (drop.y + bloodValues[_local2][1]);
var _local3 = bloodValues[_local2];
var _local4 = 1;
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
_local2++;
};
if (time > 60){
removeEventListener(Event.ENTER_FRAME, enterFrame);
parent.removeChild(this);
};
}
}
}//package level.wreck
Section 41
//CarBroken (level.wreck.CarBroken)
package level.wreck {
public class CarBroken extends Scrap {
public function CarBroken(_arg1, _arg2){
long = true;
ground = 5;
x = _arg1;
y = _arg2;
}
}
}//package level.wreck
Section 42
//Scrap (level.wreck.Scrap)
package level.wreck {
import flash.display.*;
import flash.events.*;
import level.*;
public class Scrap extends MovieClip {
var timer;// = 90
var rotDis;
public var ground;
var xSpeed;
var rot;
public var long;
var ySpeed;
public function Scrap(){
xSpeed = ((Math.random() * 20) - 10);
ySpeed = (Math.random() * -20);
super();
gotoAndStop(Math.ceil((Math.random() * totalFrames)));
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function enterFrame(_arg1:Event){
timer--;
if (timer < 0){
alpha = (alpha - 0.1);
if (alpha <= 0){
remove();
};
};
if ((y + ground) < Level.ground){
ySpeed = (ySpeed + 0.5);
rotation = (rotation + xSpeed);
} else {
if (!long){
ySpeed = (ySpeed * -0.2);
} else {
ySpeed = 0;
};
y = (Level.ground - ground);
xSpeed = (xSpeed * 0.9);
if (long){
rot = findCloseCoterm(0, rotation);
rotDis = (0 - rot);
if (Math.abs(rotDis) < 90){
rotation = (rotation + ((0 - rot) / 3));
} else {
rot = findCloseCoterm(180, rotation);
rotation = (rotation + ((180 - rot) / 3));
};
};
};
x = (x + xSpeed);
y = (y + ySpeed);
if ((y + ground) > Level.ground){
y = (Level.ground - ground);
};
}
public function remove(){
removeEventListener(Event.ENTER_FRAME, enterFrame);
parent.removeChild(this);
}
function findCloseCoterm(_arg1, _arg2){
var _local3:*;
var _local4:*;
var _local5:* = [];
var _local6:* = 1000;
var _local7:* = 0;
var _local8:* = -2;
while (_local8 <= 2) {
_local3 = (_arg2 + (360 * _local8));
_local5.push(_local3);
_local8++;
};
_local8 = 0;
while (_local8 < _local5.length) {
_local4 = Math.abs((_local5[_local8] - _arg1));
if (_local4 < _local6){
_local6 = _local4;
_local7 = _local5[_local8];
};
_local8++;
};
return (_local7);
}
}
}//package level.wreck
Section 43
//TankChunk (level.wreck.TankChunk)
package level.wreck {
public class TankChunk extends Scrap {
public function TankChunk(_arg1, _arg2){
long = true;
ground = 5;
x = _arg1;
y = _arg2;
}
}
}//package level.wreck
Section 44
//TruckBroken1 (level.wreck.TruckBroken1)
package level.wreck {
public class TruckBroken1 extends Scrap {
public function TruckBroken1(_arg1, _arg2){
long = true;
ground = 5;
x = _arg1;
y = _arg2;
}
}
}//package level.wreck
Section 45
//TruckBroken2 (level.wreck.TruckBroken2)
package level.wreck {
public class TruckBroken2 extends Scrap {
public function TruckBroken2(_arg1, _arg2){
long = true;
ground = 5;
x = _arg1;
y = _arg2;
}
}
}//package level.wreck
Section 46
//Wheel (level.wreck.Wheel)
package level.wreck {
public class Wheel extends Scrap {
public function Wheel(_arg1, _arg2){
long = false;
ground = 3;
x = _arg1;
y = _arg2;
}
}
}//package level.wreck
Section 47
//Background2 (level.Background2)
package level {
import flash.display.*;
import flash.events.*;
public class Background2 extends MovieClip {
var centerX;
var levelX;
var distance;
public function Background2(){
centerX = (-0.5 * (Level.rightBound - 600));
super();
addEventListener(Event.ENTER_FRAME, enterFrame);
}
private function enterFrame(_arg1:Event){
levelX = parent.x;
distance = (centerX - levelX);
x = (distance / 1.5);
}
}
}//package level
Section 48
//Explosion (level.Explosion)
package level {
import flash.display.*;
import flash.events.*;
public class Explosion extends MovieClip {
var x1;
var power;
var victim;
var y1;
var y2;
var bld;
var ran;
var splash;
var i;
var boom;
var radians;
var distance;
var x2;
var t;// = 0
var range;// = 100
public function Explosion(_arg1, _arg2, _arg3){
ran = Math.ceil((Math.random() * 3));
if (ran == 1){
ArmageddonMain.ex1.play();
};
if (ran == 2){
ArmageddonMain.ex2.play();
};
if (ran == 3){
ArmageddonMain.ex3.play();
};
Level.alert = (Level.alert + 0.5);
x = _arg1;
y = _arg2;
boom = _arg3;
gotoAndStop(Math.ceil((Math.random() * totalFrames)));
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function remove(){
removeEventListener(Event.ENTER_FRAME, enterFrame);
parent.removeChild(this);
}
public function enterFrame(_arg1:Event){
scaleX = (scaleY = (scaleY + (0.3 * boom)));
alpha = (alpha - 0.1);
if (alpha < 0){
remove();
};
t++;
if (t == 1){
i = 0;
while (i < Level.victims.length) {
victim = Level.victims[i];
if (victim != null){
x1 = x;
y1 = y;
x2 = victim.x;
y2 = victim.y;
distance = Math.sqrt((((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2))));
radians = Math.atan2((y2 - y1), (x2 - x1));
if (distance < range){
power = (splash = (range - distance));
power = (power / (victim.mass / 10));
power = (power * boom);
victim.ySpeed = (victim.ySpeed + ((Math.sin(radians) * power) - Math.abs(((Math.cos(radians) * power) / 5))));
victim.xSpeed = (victim.xSpeed + (Math.cos(radians) * (power / 2)));
victim.health = (victim.health - splash);
if ((((victim.health <= 0)) && ((victim.type == "vehicle")))){
ArmageddonMain.HUD.addPoint(20, (x + parent.x), y);
};
victim.y = (victim.y - 1);
};
};
i++;
};
i = 0;
while (i < Level.buildings.length) {
bld = Level.buildings[i];
if (bld != null){
x1 = x;
x2 = bld.x;
distance = Math.abs((x1 - x2));
if (distance < (bld.bldWidth + 30)){
bld.health = (bld.health - (boom * 50));
};
};
i++;
};
x1 = x;
y1 = y;
x2 = Level.saucer_x;
y2 = Level.saucer_y;
distance = Math.sqrt((((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2))));
if (distance < range){
power = (range - distance);
power = (power / 5);
Level.health = (Level.health - power);
};
};
}
}
}//package level
Section 49
//Level (level.Level)
package level {
import flash.display.*;
import flash.events.*;
import level.wreck.*;
import hud.*;
import level.saucerparts.*;
import level.buildings.*;
import level.humans.*;
import flash.ui.*;
public class Level extends Sprite {
var q;// = 0
var tempHT;
var num1;
var num;
public var saucer_mc;
var conInt;
var tempCon;
var cCInt;
var truckInt;
var dead;// = false
var hazInt;
var tempCop;
var tempSol;
var tankInt;
var hTInt;
var easeX;// = 0
var tempHaz;
var background;
var tempCC;
var test_mc;
var solInt;
var background2;
var copInt;
var tempHD;
var tempCar;
var tempTank;
var i;// = 0
var carcass_mc;
var tempTruck;
var l;// = 0
var m;// = 0
var n;// = 0
var o;// = 0
var p;// = 0
var j;// = 0
var k;// = 0
var hDInt;
var r;// = 0
var s;// = 0
var carInt;
var civilInt;
var ranNumb;
var tempCivil;
public static var saucer_x;
public static var saucer_y;
public static var saucer_xspeed;
public static var ground = 380;
public static var rightBound = 3000;
public static var energy;
public static var score;
public static var solTotal;
public static var alert;
public static var copTotal;
public static var health;
public static var saucer_yspeed;
public static var victims;
public static var bullets;
public static var leftBound = 0;
public static var conTotal;
public static var buildings;
public function Level(){
alert = 0;
health = 100;
score = 0;
energy = 0;
victims = [];
buildings = [];
bullets = [];
copTotal = 0;
saucer_mc = new Saucer();
background = new LevelBackground(1);
background2 = new Background2();
addChild(background2);
addChild(background);
addChild(saucer_mc);
addBld(BldShort, 111);
addBld(BldBurger, 315);
addBld(BldTall, 440);
addBld(BldAverage, 585);
addBld(BldTall, 722);
addBld(BldAverage, 870);
addBld(BldTall, 1020);
addBld(BldShort, 1200);
addBld(BldTall, 1400);
addBld(BldAverage, 1530);
addBld(BldBurger, 1655);
addBld(BldTall, 1780);
addBld(BldAverage, 1900);
addBld(BldTall, 2060);
addBld(BldShort, 2230);
addBld(BldTall, 2400);
addBld(BldTall, 0x0A0A);
addBld(BldAverage, 2700);
addBld(BldShort, 2800);
addEventListener(Event.ENTER_FRAME, enterFrame);
}
private function enterFrame(_arg1:Event){
energy = (Math.round((energy * 10)) / 10);
if (Key.isDown(Keyboard.SPACE)){
};
if (!dead){
saucer_x = saucer_mc.x;
saucer_y = saucer_mc.y;
saucer_xspeed = saucer_mc.xSpeed;
saucer_yspeed = saucer_mc.ySpeed;
};
easeX = (-(saucer_mc.x) + 300);
x = (x + ((easeX - x) / 15));
if (x > 0){
x = 0;
};
if (x < -2400){
x = -2400;
};
if (energy < 100){
energy = (energy + 0.1);
} else {
energy = 100;
};
if (i < carInt){
i++;
} else {
i = 0;
ranNumb = Math.ceil((Math.random() * 3));
if (ranNumb == 1){
tempCar = new Car();
};
if (ranNumb == 2){
tempCar = new Taxi();
};
if (ranNumb == 3){
tempCar = new GreenCar();
};
addChild(tempCar);
};
if (j < truckInt){
j++;
} else {
j = 0;
tempTruck = new Truck();
addChild(tempTruck);
};
if (k < civilInt){
k++;
} else {
k = 0;
tempCivil = new Civilian();
addChild(tempCivil);
};
if (alert > 25){
if (l < copInt){
l++;
} else {
l = 0;
if (copTotal < 30){
tempCop = new Cop();
addChild(tempCop);
};
};
if (m < copInt){
m++;
} else {
m = 0;
tempCC = new CopCar();
addChild(tempCC);
};
};
if (alert > 50){
if (n < solInt){
n++;
} else {
n = 0;
if (solTotal < 30){
tempSol = new Soldier();
addChild(tempSol);
};
};
if (o < conInt){
o++;
} else {
o = 0;
tempCon = new Convoy();
addChild(tempCon);
};
if (p < tankInt){
p++;
} else {
p = 0;
tempTank = new Tank();
addChild(tempTank);
};
};
if (alert >= 75){
if (q < hazInt){
q++;
} else {
q = 0;
tempHaz = new Hazmat();
addChild(tempHaz);
};
if (r < hDInt){
r++;
} else {
r = 0;
tempHD = new HazDel();
addChild(tempHD);
};
};
if (alert >= 100){
if (s < hDInt){
s++;
} else {
s = 0;
tempHT = new HazTank();
addChild(tempHT);
};
};
if (alert < 25){
carInt = 20;
truckInt = 20;
civilInt = 10;
copInt = 0;
cCInt = 0;
};
if ((((alert >= 25)) && ((alert < 50)))){
carInt = 100;
truckInt = 100;
civilInt = 50;
copInt = 30;
cCInt = 30;
};
if ((((alert >= 50)) && ((alert < 75)))){
carInt = 200;
truckInt = 200;
civilInt = 100;
copInt = 100;
cCInt = 100;
solInt = 30;
conInt = 90;
tankInt = 400;
};
if (alert >= 75){
carInt = 200;
truckInt = 200;
civilInt = 100;
copInt = 100;
cCInt = 100;
solInt = 30;
conInt = 90;
tankInt = 400;
hazInt = 30;
hDInt = 100;
hTInt = 400;
};
if ((((Level.health <= 0)) && (!(dead)))){
carcass_mc = new SaucerCrash();
carcass_mc.x = saucer_mc.x;
carcass_mc.y = saucer_mc.y;
addChild(carcass_mc);
dead = true;
saucer_mc.remove();
};
num = (numChildren - 1);
if (!dead){
setChildIndex(saucer_mc, num);
};
MovieClip(parent).setHud(alert, health, score);
}
public function mouseDown(){
saucer_mc.mouseDown();
}
public function remove(){
i = 0;
while (i < victims.length) {
if (victims[i] != null){
victims[i].remove();
};
i++;
};
parent.removeChild(this);
removeEventListener(Event.ENTER_FRAME, enterFrame);
}
public function addBld(_arg1, _arg2){
var _local3:* = new (_arg1);
addChild(_local3);
_local3.x = _arg2;
_local3.y = ground;
}
public function mouseUp(){
saucer_mc.mouseUp();
}
}
}//package level
Section 50
//LevelBackground (level.LevelBackground)
package level {
import flash.display.*;
public class LevelBackground extends MovieClip {
public function LevelBackground(_arg1){
gotoAndStop(_arg1);
}
}
}//package level
Section 51
//MenuBackground (mainMenu.MenuBackground)
package mainMenu {
import flash.display.*;
public class MenuBackground extends MovieClip {
public var link_btn:SimpleButton;
public function remove(){
parent.removeChild(this);
}
}
}//package mainMenu
Section 52
//StartButton (mainMenu.StartButton)
package mainMenu {
import flash.display.*;
import flash.events.*;
public class StartButton extends MovieClip {
public function StartButton(){
stop();
buttonMode = true;
addEventListener(MouseEvent.MOUSE_OVER, goto2);
addEventListener(MouseEvent.MOUSE_OUT, goto1);
addEventListener(MouseEvent.MOUSE_DOWN, goto3);
addEventListener(MouseEvent.MOUSE_UP, goto2);
}
private function goto3(_arg1:MouseEvent){
gotoAndStop(3);
}
public function remove(){
parent.removeChild(this);
removeEventListener(MouseEvent.MOUSE_OVER, goto2);
removeEventListener(MouseEvent.MOUSE_OUT, goto1);
removeEventListener(MouseEvent.MOUSE_DOWN, goto3);
removeEventListener(MouseEvent.MOUSE_UP, goto2);
}
private function goto1(_arg1:MouseEvent){
gotoAndStop(1);
}
private function goto2(_arg1:MouseEvent){
gotoAndStop(2);
}
}
}//package mainMenu
Section 53
//MainPreloader (org.computus.utils.preloader.MainPreloader)
package org.computus.utils.preloader {
import flash.display.*;
import flash.events.*;
public class MainPreloader extends MovieClip {
public var preloader:MovieClip;
public var main;
public function MainPreloader():void{
addFrameScript(1, frame2);
super();
init();
}
protected function init():void{
stop();
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){
onMainLoaded();
} else {
if (!preloader){
preloader = new ProgressGraphic();
addChild(preloader);
};
centreProgressBar();
stage.addEventListener(Event.ACTIVATE, onStageResize);
stage.addEventListener(Event.RESIZE, onStageResize);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onMainLoadProgress);
};
}
protected function onMainLoaded():void{
destroy();
play();
}
function frame2(){
stop();
main = new ArmageddonMain(stage);
addChild(main);
}
protected function centreProgressBar():void{
preloader.x = (stage.stageWidth / 2);
preloader.y = (stage.stageHeight / 2);
}
protected function destroy():void{
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, onMainLoadProgress);
stage.removeEventListener(Event.ACTIVATE, onStageResize);
stage.removeEventListener(Event.RESIZE, onStageResize);
}
protected function onStageResize(_arg1:Event):void{
centreProgressBar();
}
protected function onMainLoadProgress(_arg1:ProgressEvent):void{
var _local2:Number = Math.round(((_arg1.bytesLoaded / _arg1.bytesTotal) * 100));
if (_arg1.bytesLoaded == _arg1.bytesTotal){
removeChild(preloader);
onMainLoaded();
};
preloader.gotoAndStop(_local2);
}
}
}//package org.computus.utils.preloader
Section 54
//ArmageddonMain (ArmageddonMain)
package {
import flash.display.*;
import flash.events.*;
import level.*;
import game_over.*;
import hud.*;
import mainMenu.*;
import flash.ui.*;
import flash.net.*;
public class ArmageddonMain extends MovieClip {
public var loader_mc;
var loadOutline;
public var background_mc;
var time;
var theStage;
public var game_over_mc;
public var hud_mc;
var music;
var musicChannel;
public var level_mc;
var loadingBar;
public var inGame;// = false
public var start_btn;
public static var lasers;
public static var gun;
public static var weap3;
public static var HUD;
public static var ex1;
public static var ex2;
public static var ex3;
public static var lChan;
public static var tChan;
public static var gunh;
public static var crunch;
public static var tb;
public static var tractor;
public static var ScoreHolder;
public function ArmageddonMain(_arg1){
music = new GameMusic();
ex1 = new ex1_snd();
ex2 = new ex2_snd();
ex3 = new ex3_snd();
tractor = new Tractor_snd();
lasers = new Laser_snd();
weap3 = new Weap3_snd();
gun = new Gun_snd();
gunh = new Gunh_snd();
crunch = new Crunch_snd();
theStage = _arg1;
playMusic();
theStage.quality = "medium";
Key.initialize(theStage);
addMainMenu();
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function startClick(_arg1:MouseEvent){
removeMainMenu();
addLevel();
}
public function removeGameOver(){
removeChild(game_over_mc);
}
function levelMouseDown(_arg1:MouseEvent){
level_mc.mouseDown();
}
public function mainRestart(){
removeGameOver();
addMainMenu();
}
private function enterFrame(_arg1:Event){
if (Level.health > 100){
Level.health = 100;
};
if (Level.health <= 0){
time++;
};
if ((((time == 60)) && (inGame))){
removeLevel();
addGameOver();
};
}
public function playMusic():void{
musicChannel = music.play();
musicChannel.addEventListener(Event.SOUND_COMPLETE, loopMusic);
}
public function removeMainMenu(){
background_mc.link_btn.removeEventListener(MouseEvent.CLICK, linkClick);
background_mc.remove();
start_btn.remove();
}
public function removeLevel(){
Mouse.show();
inGame = false;
level_mc.remove();
theStage.removeEventListener(MouseEvent.MOUSE_DOWN, levelMouseDown);
theStage.removeEventListener(MouseEvent.MOUSE_UP, levelMouseUp);
removeChild(hud_mc);
}
public function addLevel(){
time = 0;
Mouse.hide();
inGame = true;
level_mc = new Level();
addChild(level_mc);
theStage.addEventListener(MouseEvent.MOUSE_DOWN, levelMouseDown);
theStage.addEventListener(MouseEvent.MOUSE_UP, levelMouseUp);
hud_mc = new Hud();
HUD = hud_mc;
addChild(hud_mc);
}
public function addGameOver(){
game_over_mc = new GameOverScreen();
addChild(game_over_mc);
}
function levelMouseUp(_arg1:MouseEvent){
level_mc.mouseUp();
}
public function loopMusic(_arg1:Event):void{
if (musicChannel != null){
musicChannel.removeEventListener(Event.SOUND_COMPLETE, loopMusic);
playMusic();
};
}
public function addMainMenu(){
start_btn = new StartButton();
background_mc = new MenuBackground();
addChild(background_mc);
start_btn.x = 150;
start_btn.y = 350;
start_btn.addEventListener(MouseEvent.CLICK, startClick);
background_mc.link_btn.addEventListener(MouseEvent.CLICK, linkClick);
addChild(start_btn);
}
public function setHud(_arg1, _arg2, _arg3){
hud_mc.alertDisp = _arg1;
hud_mc.healthDisp = _arg2;
hud_mc.scoreDisp = _arg3;
}
public function linkClick(_arg1:MouseEvent){
var _local2:URLRequest = new URLRequest("http://www.gurflob.com/");
navigateToURL(_local2);
}
public static function playLaser(){
lChan = lasers.play();
}
public static function stopTractor(){
if (tChan != null){
tChan.stop();
};
}
public static function playTractor(){
tChan = tractor.play();
}
public static function stopLaser(){
if (lChan != null){
lChan.stop();
};
}
}
}//package
Section 55
//Crunch_snd (Crunch_snd)
package {
import flash.media.*;
public dynamic class Crunch_snd extends Sound {
}
}//package
Section 56
//ex1_snd (ex1_snd)
package {
import flash.media.*;
public dynamic class ex1_snd extends Sound {
}
}//package
Section 57
//ex2_snd (ex2_snd)
package {
import flash.media.*;
public dynamic class ex2_snd extends Sound {
}
}//package
Section 58
//ex3_snd (ex3_snd)
package {
import flash.media.*;
public dynamic class ex3_snd extends Sound {
}
}//package
Section 59
//GameMusic (GameMusic)
package {
import flash.media.*;
public dynamic class GameMusic extends Sound {
}
}//package
Section 60
//Gun_snd (Gun_snd)
package {
import flash.media.*;
public dynamic class Gun_snd extends Sound {
}
}//package
Section 61
//Gunh_snd (Gunh_snd)
package {
import flash.media.*;
public dynamic class Gunh_snd extends Sound {
}
}//package
Section 62
//Key (Key)
package {
import flash.display.*;
import flash.events.*;
public class Key {
private static var initialized:Boolean = false;
private static var keysDown:Object = new Object();
public static function initialize(_arg1:Stage){
if (!initialized){
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
_arg1.addEventListener(Event.DEACTIVATE, clearKeys);
initialized = true;
};
}
private static function clearKeys(_arg1:Event):void{
keysDown = new Object();
}
public static function isDown(_arg1:uint):Boolean{
if (!initialized){
throw (new Error("Key class has yet been initialized."));
};
return (Boolean((_arg1 in keysDown)));
}
private static function keyPressed(_arg1:KeyboardEvent):void{
keysDown[_arg1.keyCode] = true;
}
private static function keyReleased(_arg1:KeyboardEvent):void{
if ((_arg1.keyCode in keysDown)){
delete keysDown[_arg1.keyCode];
};
}
}
}//package
Section 63
//Laser_snd (Laser_snd)
package {
import flash.media.*;
public dynamic class Laser_snd extends Sound {
}
}//package
Section 64
//ProgressGraphic (ProgressGraphic)
package {
import flash.display.*;
public dynamic class ProgressGraphic extends MovieClip {
}
}//package
Section 65
//Tahoma (Tahoma)
package {
import flash.text.*;
public dynamic class Tahoma extends Font {
}
}//package
Section 66
//Tractor_snd (Tractor_snd)
package {
import flash.media.*;
public dynamic class Tractor_snd extends Sound {
}
}//package
Section 67
//Weap3_snd (Weap3_snd)
package {
import flash.media.*;
public dynamic class Weap3_snd extends Sound {
}
}//package