Section 1
//Bullet (com.assault.bullet.Bullet)
package com.assault.bullet {
import com.assault.manager.*;
import flash.display.*;
import flash.events.*;
import com.assault.data.*;
public class Bullet extends MovieClip {
var enemyManager:EnemyManager;
var weaponManager:WeaponManager;
public function Bullet(){
enemyManager = EnemyManager.getInstance();
weaponManager = WeaponManager.getInstance();
addEventListener(Event.ADDED_TO_STAGE, onStage);
addEventListener(Event.REMOVED_FROM_STAGE, onRemoved);
}
public function init(_arg1:Number, _arg2:Number){
this.x = _arg1;
this.y = _arg2;
this.alpha = 0;
addEventListener(Event.ENTER_FRAME, onRender);
}
private function onStage(_arg1:Event){
}
private function onRender(_arg1:Event){
var _local2:*;
if (BulletManager.getInstance().activeBulletArray.indexOf(this) == -1){
return;
};
for (_local2 in enemyManager.activeEnemyArray) {
if (this.hitTestObject(enemyManager.activeEnemyArray[_local2].hit)){
switch (enemyManager.activeEnemyArray[_local2].enemyType){
case "rocketLauncher":
case "howitzer":
case "jeep":
case "tank":
case "helicopter":
enemyManager.activeEnemyArray[_local2].hitEnemy(WeaponData.WEAPON_DATA_ARRAY[(WeaponData.WEAPON_TYPE_ARRAY.indexOf(weaponManager.usedWeapon) + 1)][7]);
break;
default:
enemyManager.activeEnemyArray[_local2].hitEnemy(WeaponData.WEAPON_DATA_ARRAY[(WeaponData.WEAPON_TYPE_ARRAY.indexOf(weaponManager.usedWeapon) + 1)][0]);
break;
};
BulletManager.getInstance().destroyBullet(this);
break;
};
if (this.hitTestObject(enemyManager.activeEnemyArray[_local2].head)){
enemyManager.activeEnemyArray[_local2].hitHead();
BulletManager.getInstance().destroyBullet(this);
break;
};
};
if (BulletManager.getInstance().activeBulletArray.indexOf(this) == -1){
return;
};
BulletManager.getInstance().destroyBullet(this);
}
private function onRemoved(_arg1:Event){
removeEventListener(Event.ENTER_FRAME, onRender);
}
}
}//package com.assault.bullet
Section 2
//AbstractText (com.assault.console.AbstractText)
package com.assault.console {
import flash.display.*;
public class AbstractText extends MovieClip {
public function init(_arg1:String, _arg2:String="", _arg3:int=0){
}
}
}//package com.assault.console
Section 3
//StatusText (com.assault.console.StatusText)
package com.assault.console {
import com.assault.manager.*;
import flash.display.*;
import flash.events.*;
import com.gskinner.motion.*;
import flash.utils.*;
import com.gskinner.motion.easing.*;
import flash.text.*;
public class StatusText extends AbstractText {
public var gTween:GTween;
private var consoleManager:ConsoleManager;
public var textDisp:TextField;
public var weaponIcon:MovieClip;
public var textRedDisp:TextField;
public function StatusText(){
consoleManager = ConsoleManager.getInstance();
gTween = new GTween(this, 0.5, null, {ease:Circular.easeOut});
}
override public function init(_arg1:String, _arg2:String="", _arg3:int=0){
var _local4:String;
var _local5:int;
var _local6:Timer;
textDisp.text = _arg1;
textDisp.autoSize = TextFieldAutoSize.LEFT;
textRedDisp.autoSize = TextFieldAutoSize.LEFT;
textRedDisp.x = (textDisp.width + 25);
_local4 = "";
if (_arg2 != ""){
_local4 = (_arg2.charAt(0).toLocaleUpperCase() + _arg2.slice(1));
};
textRedDisp.text = _local4;
_local5 = 1;
while (_local5 <= 6) {
weaponIcon[("weapon" + _local5)].visible = false;
_local5++;
};
if (_arg3 != 0){
weaponIcon.x = textDisp.width;
weaponIcon[("weapon" + _arg3)].visible = true;
} else {
weaponIcon.visible = false;
};
_local6 = new Timer(1500, 1);
_local6.start();
_local6.addEventListener(TimerEvent.TIMER, onTimer);
}
private function onTimer(_arg1:Event){
var e = _arg1;
gTween.setValues({y:(this.y + 22), alpha:0});
gTween.onComplete = function (){
consoleManager.removeText((gTween.target as StatusText));
};
}
}
}//package com.assault.console
Section 4
//EnemyData (com.assault.data.EnemyData)
package com.assault.data {
public class EnemyData {
public static const ENEMY_DATA_ARRAY:Array = [["health", "speed", "damage", "cooldown", "reward"], [10, 1, 3, 30, 5], [10, 1.5, 1, 15, 6], [20, 1, 3, 30, 7], [10, 1, 5, 90, 7], [35, 1, 6, 90, 7], [55, 1, 6, 40, 8], [65, 1, 15, 100, 10], [45, 1, 7, 40, 10]];
public static const ENEMY_TYPE_ARRAY:Array = ["rifleman", "assault", "machineGunner", "rocketLauncher", "howitzer", "jeep", "tank", "helicopter"];
}
}//package com.assault.data
Section 5
//LevelData (com.assault.data.LevelData)
package com.assault.data {
public class LevelData {
public static const LEVEL_DATA_ARRAY:Array = [["rifleman", "assaulter", "machineGunner", "rocketLauncher", "howitzer", "jeep", "tank", "helicopter"], [8, 4, 0, 0, 0, 0, 0, 0], [8, 4, 1, 0, 1, 0, 0, 0], [10, 6, 1, 2, 1, 0, 0, 0], [8, 4, 2, 1, 1, 1, 0, 0], [10, 6, 2, 1, 1, 2, 1, 1], [12, 6, 4, 3, 1, 2, 1, 2], [18, 6, 4, 3, 1, 2, 1, 2], [19, 7, 7, 5, 2, 3, 2, 3], [20, 10, 4, 3, 3, 3, 3, 4], [20, 10, 5, 3, 3, 4, 3, 4], [20, 6, 6, 4, 3, 5, 4, 4], [28, 11, 9, 7, 6, 8, 7, 7], [28, 15, 11, 9, 9, 10, 9, 10], [30, 20, 11, 9, 9, 10, 10, 10], [35, 25, 16, 14, 14, 15, 15, 15], [40, 30, 26, 24, 24, 25, 25, 25]];
}
}//package com.assault.data
Section 6
//WeaponData (com.assault.data.WeaponData)
package com.assault.data {
public class WeaponData {
public static const WEAPON_DESCRIPTION_ARRAY:Array = ["", "", "", "", "", "", "", ""];
public static const WEAPON_DATA_ARRAY:Array = [["damage", "cooldown", "reloadtime", "bulletnumber", "notAutomatic", "price", "weaponLength", "vehicleDamage"], [3, 10, 25, 60, false, 11, 260, 1], [4.5, 10, 25, 40, true, 700, 260, 2], [11, 10, 25, 60, false, 1750, 260, 5], [10, 10, 50, 60, false, 2900, 260, 7], [11, 10, 50, 120, false, 4200, 200, 8], [100, 10, 125, 1, true, 5450, 230, 100]];
public static const WEAPON_TYPE_ARRAY:Array = ["wesson", "carbine", "grand", "krieg", "thunder", "supreme"];
}
}//package com.assault.data
Section 7
//EnemyAbstract (com.assault.enemy.EnemyAbstract)
package com.assault.enemy {
import com.assault.manager.*;
import com.chocorobokun.managers.*;
import flash.display.*;
import flash.events.*;
import com.assault.data.*;
import com.chocorobokun.effects.*;
public class EnemyAbstract extends MovieClip {
protected const ENEMY_STATE_WALK:String = "WALK";
protected const ENEMY_STATE_SHOOT:String = "SHOOT";
protected const ENEMY_STATE_DEAD:String = "DEAD";
protected var enemyHealth:Number;
protected var walkSpeed:Number;
protected var healthBar:MovieClip;
protected var enemyCooldown:int;
protected var shootRange:Number;
protected var shootDamage:int;
protected var deadAnim:MovieClip;
protected var walkAnim:MovieClip;
protected var enemyCurrentHealth:Number;
protected var shootAnim:MovieClip;
protected var enemyState:String;
public var enemyType:String;
public function EnemyAbstract(){
assignAnim();
walkSpeed = 1;
addEventListener(Event.REMOVED_FROM_STAGE, onRemove);
}
protected function resetAnim(){
deadAnim.visible = false;
walkAnim.visible = false;
shootAnim.visible = false;
}
public function destroy(){
}
public function init(_arg1:String){
resetAnim();
enemyState = ENEMY_STATE_WALK;
walkAnim.visible = true;
this.x = 0;
this.y = (200 + int((Math.random() * 200)));
healthBar.visible = true;
enemyType = _arg1;
enemyHealth = EnemyData.ENEMY_DATA_ARRAY[(EnemyData.ENEMY_TYPE_ARRAY.indexOf(enemyType) + 1)][0];
enemyCurrentHealth = EnemyData.ENEMY_DATA_ARRAY[(EnemyData.ENEMY_TYPE_ARRAY.indexOf(enemyType) + 1)][0];
walkSpeed = EnemyData.ENEMY_DATA_ARRAY[(EnemyData.ENEMY_TYPE_ARRAY.indexOf(enemyType) + 1)][1];
shootRange = (300 + int((Math.random() * 100)));
addEventListener(Event.ENTER_FRAME, onRender);
}
public function enemyDead(){
if (enemyState == ENEMY_STATE_DEAD){
return;
};
enemyState = ENEMY_STATE_DEAD;
resetAnim();
deadAnim.visible = true;
healthBar.visible = false;
deadAnim.gotoAndPlay(1);
ConsoleManager.getInstance().showText("Player ", enemyType, (WeaponData.WEAPON_TYPE_ARRAY.indexOf(WeaponManager.getInstance().usedWeapon) + 1));
switch (enemyType){
case "machineGunner":
case "jeep":
case "howitzer":
case "helicopter":
case "tank":
SoundManager.getInstance().playSound("explodeSound", MainClass(root).mainStage.soundVolume);
break;
};
}
public function hitHead(){
if (enemyState == ENEMY_STATE_DEAD){
return;
};
enemyCurrentHealth = 0;
WeaponManager.getInstance().shootHit++;
WeaponManager.getInstance().headshotCount++;
enemyDead();
}
public function getEnemyType():String{
return (enemyType);
}
protected function onRemove(_arg1:Event){
removeEventListener(Event.ENTER_FRAME, onRender);
}
protected function onClick(_arg1:Event){
}
public function pauseGame(){
}
protected function enemyShoot(){
if (enemyCooldown <= 0){
MainClass(root).mainStage.wallHealth = (MainClass(root).mainStage.wallHealth - EnemyData.ENEMY_DATA_ARRAY[(EnemyData.ENEMY_TYPE_ARRAY.indexOf(enemyType) + 1)][2]);
enemyCooldown = EnemyData.ENEMY_DATA_ARRAY[(EnemyData.ENEMY_TYPE_ARRAY.indexOf(enemyType) + 1)][3];
shootAnim.gotoAndPlay(1);
switch (enemyType){
case "assault":
SoundManager.getInstance().playSound("ak47Sound", MainClass(root).mainStage.soundVolume, 1300);
break;
case "rifleman":
SoundManager.getInstance().playSound("ak47Sound", MainClass(root).mainStage.soundVolume, 1300);
break;
case "machineGunner":
case "jeep":
SoundManager.getInstance().playSound("ak47Sound", MainClass(root).mainStage.soundVolume, 1300);
break;
case "howitzer":
TShaker.shakeObject(MainClass(root).mainStage, 5, 2);
SoundManager.getInstance().playSound("explodeSound", (MainClass(root).mainStage.soundVolume / 2));
break;
case "rocketLauncher":
TShaker.shakeObject(MainClass(root).mainStage, 5, 2);
SoundManager.getInstance().playSound("explodeSound", (MainClass(root).mainStage.soundVolume / 2));
break;
case "tank":
TShaker.shakeObject(MainClass(root).mainStage, 10, 2);
SoundManager.getInstance().playSound("explodeSound", (MainClass(root).mainStage.soundVolume / 2));
break;
};
} else {
enemyCooldown--;
};
}
protected function enemyStop(){
}
public function hitEnemy(_arg1:Number){
WeaponManager.getInstance().shootHit++;
enemyCurrentHealth = (enemyCurrentHealth - _arg1);
if (enemyCurrentHealth <= 0){
enemyDead();
};
}
protected function assignAnim():void{
}
protected function onRender(_arg1:Event){
switch (enemyState){
case ENEMY_STATE_WALK:
if (MainClass(root).mainStage.gameState == MainClass(root).mainStage.GAME_STATE_SCREEN){
walkAnim.stop();
return;
};
walkAnim.play();
this.x = (this.x + walkSpeed);
healthBar.gotoAndStop((healthBar.totalFrames - int(((enemyCurrentHealth * healthBar.totalFrames) / enemyHealth))));
if (this.x >= shootRange){
x = shootRange;
resetAnim();
shootAnim.visible = true;
shootAnim.gotoAndStop(1);
enemyState = ENEMY_STATE_SHOOT;
};
break;
case ENEMY_STATE_SHOOT:
if (MainClass(root).mainStage.gameState == MainClass(root).mainStage.GAME_STATE_SCREEN){
return;
};
enemyShoot();
healthBar.gotoAndStop((healthBar.totalFrames - int(((enemyCurrentHealth * healthBar.totalFrames) / enemyHealth))));
if (shootAnim.currentFrame == shootAnim.totalFrames){
shootAnim.gotoAndStop(1);
};
break;
case ENEMY_STATE_DEAD:
if (deadAnim.currentFrame == deadAnim.totalFrames){
deadAnim.stop();
EnemyManager.getInstance().destroyEnemy(this);
};
break;
};
}
}
}//package com.assault.enemy
Section 8
//EnemyAssaulter (com.assault.enemy.EnemyAssaulter)
package com.assault.enemy {
import flash.display.*;
public class EnemyAssaulter extends EnemyAbstract {
public var shoot:MovieClip;
public var dead:MovieClip;
public var healthBarMov:MovieClip;
public var hit:MovieClip;
public var walk:MovieClip;
public var head:MovieClip;
override protected function assignAnim():void{
deadAnim = dead;
walkAnim = walk;
shootAnim = shoot;
healthBar = healthBarMov;
}
}
}//package com.assault.enemy
Section 9
//EnemyHelicopter (com.assault.enemy.EnemyHelicopter)
package com.assault.enemy {
import flash.display.*;
import flash.events.*;
import com.assault.data.*;
public class EnemyHelicopter extends EnemyAbstract {
public var shoot:MovieClip;
public var dead:MovieClip;
public var healthBarMov:MovieClip;
public var hit:MovieClip;
public var walk:MovieClip;
public var head:MovieClip;
override public function init(_arg1:String){
resetAnim();
enemyState = ENEMY_STATE_WALK;
walkAnim.visible = true;
this.x = 0;
this.y = (50 + int((Math.random() * 100)));
healthBar.visible = true;
enemyType = _arg1;
enemyHealth = EnemyData.ENEMY_DATA_ARRAY[(EnemyData.ENEMY_TYPE_ARRAY.indexOf(enemyType) + 1)][0];
enemyCurrentHealth = EnemyData.ENEMY_DATA_ARRAY[(EnemyData.ENEMY_TYPE_ARRAY.indexOf(enemyType) + 1)][0];
walkSpeed = EnemyData.ENEMY_DATA_ARRAY[(EnemyData.ENEMY_TYPE_ARRAY.indexOf(enemyType) + 1)][1];
shootRange = (300 + int((Math.random() * 100)));
addEventListener(Event.ENTER_FRAME, onRender);
}
override protected function assignAnim():void{
deadAnim = dead;
walkAnim = walk;
shootAnim = shoot;
healthBar = healthBarMov;
}
}
}//package com.assault.enemy
Section 10
//EnemyHowitzer (com.assault.enemy.EnemyHowitzer)
package com.assault.enemy {
import flash.display.*;
public class EnemyHowitzer extends EnemyAbstract {
public var shoot:MovieClip;
public var dead:MovieClip;
public var healthBarMov:MovieClip;
public var hit:MovieClip;
public var walk:MovieClip;
public var head:MovieClip;
override protected function assignAnim():void{
deadAnim = dead;
walkAnim = walk;
shootAnim = shoot;
healthBar = healthBarMov;
}
}
}//package com.assault.enemy
Section 11
//EnemyJeep (com.assault.enemy.EnemyJeep)
package com.assault.enemy {
import flash.display.*;
public class EnemyJeep extends EnemyAbstract {
public var shoot:MovieClip;
public var dead:MovieClip;
public var healthBarMov:MovieClip;
public var hit:MovieClip;
public var walk:MovieClip;
public var head:MovieClip;
override protected function assignAnim():void{
deadAnim = dead;
walkAnim = walk;
shootAnim = shoot;
healthBar = healthBarMov;
}
}
}//package com.assault.enemy
Section 12
//EnemyMachineGunner (com.assault.enemy.EnemyMachineGunner)
package com.assault.enemy {
import flash.display.*;
public class EnemyMachineGunner extends EnemyAbstract {
public var shoot:MovieClip;
public var dead:MovieClip;
public var healthBarMov:MovieClip;
public var hit:MovieClip;
public var walk:MovieClip;
public var head:MovieClip;
override protected function assignAnim():void{
deadAnim = dead;
walkAnim = walk;
shootAnim = shoot;
healthBar = healthBarMov;
}
}
}//package com.assault.enemy
Section 13
//EnemyRifleman (com.assault.enemy.EnemyRifleman)
package com.assault.enemy {
import flash.display.*;
public class EnemyRifleman extends EnemyAbstract {
public var shoot:MovieClip;
public var dead:MovieClip;
public var healthBarMov:MovieClip;
public var hit:MovieClip;
public var walk:MovieClip;
public var head:MovieClip;
override protected function assignAnim():void{
deadAnim = dead;
walkAnim = walk;
shootAnim = shoot;
healthBar = healthBarMov;
}
}
}//package com.assault.enemy
Section 14
//EnemyRocketLauncher (com.assault.enemy.EnemyRocketLauncher)
package com.assault.enemy {
import flash.display.*;
public class EnemyRocketLauncher extends EnemyAbstract {
public var shoot:MovieClip;
public var dead:MovieClip;
public var healthBarMov:MovieClip;
public var hit:MovieClip;
public var walk:MovieClip;
public var head:MovieClip;
override protected function assignAnim():void{
deadAnim = dead;
walkAnim = walk;
shootAnim = shoot;
healthBar = healthBarMov;
}
}
}//package com.assault.enemy
Section 15
//EnemyTank (com.assault.enemy.EnemyTank)
package com.assault.enemy {
import flash.display.*;
public class EnemyTank extends EnemyAbstract {
public var shoot:MovieClip;
public var dead:MovieClip;
public var healthBarMov:MovieClip;
public var hit:MovieClip;
public var walk:MovieClip;
public var head:MovieClip;
override protected function assignAnim():void{
deadAnim = dead;
walkAnim = walk;
shootAnim = shoot;
healthBar = healthBarMov;
}
}
}//package com.assault.enemy
Section 16
//BulletManager (com.assault.manager.BulletManager)
package com.assault.manager {
import com.assault.bullet.*;
import de.polygonal.core.*;
public class BulletManager {
private var initiated:Boolean;// = false
public var activeBulletArray:Array;
private var main;
public var bulletPool:ObjectPool;
private static var allowInstantiation:Boolean;
private static var instance:BulletManager;
public function BulletManager(){
initiated = false;
super();
if (!allowInstantiation){
throw (new Error("Error: use EnemyManager.getInstance() instead of new"));
};
}
public function addBullet(_arg1:Number, _arg2:Number){
var _local3:Bullet;
_local3 = bulletPool.object;
main.addChild(_local3);
activeBulletArray.push(_local3);
_local3.init(_arg1, _arg2);
ParticleManager.getInstance().addParticle("dirt", _arg1, _arg2, 0.25);
}
private function setPool(){
bulletPool = new ObjectPool(true);
bulletPool.allocate(1, Bullet);
}
public function init(_arg1){
if (!initiated){
main = _arg1;
activeBulletArray = [];
setPool();
initiated = true;
};
}
public function destroyBullet(_arg1:Bullet){
main.removeChild(_arg1);
bulletPool.object = _arg1;
activeBulletArray.splice(activeBulletArray.indexOf(_arg1), 1);
if ((((WeaponManager.getInstance().getCurrentAmmo() <= 0)) && (!(WeaponManager.getInstance().isReloading)))){
WeaponManager.getInstance().reloadWeapon();
};
}
public static function getInstance():BulletManager{
if (!instance){
allowInstantiation = true;
instance = new (BulletManager);
allowInstantiation = false;
};
return (instance);
}
}
}//package com.assault.manager
Section 17
//ConsoleManager (com.assault.manager.ConsoleManager)
package com.assault.manager {
import flash.display.*;
import com.assault.console.*;
public class ConsoleManager {
private var main;
private var yStart:Number;
private var xStart:Number;
private var initiated:Boolean;// = false
public var textArray:Array;
private static var allowInstantiation:Boolean;
private static var instance:ConsoleManager;
public function ConsoleManager(){
initiated = false;
super();
if (!allowInstantiation){
throw (new Error("Error: use .getInstance() instead of new"));
};
}
public function init(_arg1){
if (!initiated){
main = _arg1;
textArray = [];
initiated = true;
};
}
public function showText(_arg1:String, _arg2:String="", _arg3:int=0){
var _local4:StatusText;
var _local5:*;
_local4 = new StatusText();
_local4.init(_arg1, _arg2, _arg3);
_local4.x = xStart;
_local4.y = (yStart - 22);
_local4.alpha = 0;
_local4.gTween.setValues({alpha:1});
main.HUD.addChild(_local4);
textArray.push(_local4);
if (textArray.length > 0){
for (_local5 in textArray) {
textArray[_local5].gTween.setValues({y:((yStart - 22) + ((textArray.length - _local5) * 22))});
};
};
}
public function setStartPos(_arg1:Number, _arg2:Number){
xStart = _arg1;
yStart = _arg2;
}
public function removeText(_arg1:MovieClip){
var _local2:MovieClip;
_local2 = _arg1;
textArray.splice(textArray.indexOf(_arg1), 1);
main.HUD.removeChild(_arg1);
_local2 = null;
}
public static function getInstance():ConsoleManager{
if (!instance){
allowInstantiation = true;
instance = new (ConsoleManager);
allowInstantiation = false;
};
return (instance);
}
}
}//package com.assault.manager
Section 18
//EnemyManager (com.assault.manager.EnemyManager)
package com.assault.manager {
import com.assault.enemy.*;
import de.polygonal.core.*;
public class EnemyManager {
private var assaultPool:ObjectPool;
private var howitzerPool:ObjectPool;
private var riflemanPool:ObjectPool;
private var rocketLauncherPool:ObjectPool;
private var helicopterPool:ObjectPool;
public var activeEnemyArray:Array;
private var jeepPool:ObjectPool;
private var tankPool:ObjectPool;
private var initiated:Boolean;// = false
private var main;
private var machineGunnerPool:ObjectPool;
private static var allowInstantiation:Boolean;
private static var instance:EnemyManager;
public function EnemyManager(){
initiated = false;
super();
if (!allowInstantiation){
throw (new Error("Error: use EnemyManager.getInstance() instead of new"));
};
}
private function getEnemy(_arg1:String){
return (this[(_arg1 + "Pool")].object);
}
private function order(_arg1:EnemyAbstract, _arg2:EnemyAbstract){
var _local3:int;
var _local4:int;
_local3 = _arg1.y;
_local4 = _arg2.y;
if (_local3 < _local4){
return (-1);
};
if (_local3 > _local4){
return (1);
};
return (0);
}
private function setPool(){
assaultPool = new ObjectPool(true);
assaultPool.allocate(1, EnemyAssaulter);
helicopterPool = new ObjectPool(true);
helicopterPool.allocate(1, EnemyHelicopter);
riflemanPool = new ObjectPool(true);
riflemanPool.allocate(1, EnemyRifleman);
rocketLauncherPool = new ObjectPool(true);
rocketLauncherPool.allocate(1, EnemyRocketLauncher);
howitzerPool = new ObjectPool(true);
howitzerPool.allocate(1, EnemyHowitzer);
machineGunnerPool = new ObjectPool(true);
machineGunnerPool.allocate(1, EnemyMachineGunner);
tankPool = new ObjectPool(true);
tankPool.allocate(1, EnemyTank);
jeepPool = new ObjectPool(true);
jeepPool.allocate(1, EnemyJeep);
}
private function manageDepth(){
var _local1:*;
activeEnemyArray.sort(order);
for (_local1 in activeEnemyArray) {
main.addChild(activeEnemyArray[_local1]);
};
main.addChild(main.HUD);
}
public function addEnemy(_arg1:String){
var _local2:EnemyAbstract;
if (!initiated){
throw (new Error("Error: initiate the manager first before use"));
};
_local2 = getEnemy(_arg1);
main.addChild(_local2);
activeEnemyArray.push(_local2);
_local2.init(_arg1);
manageDepth();
}
public function init(_arg1){
if (!initiated){
main = _arg1;
activeEnemyArray = [];
setPool();
initiated = true;
};
}
public function destroyEnemy(_arg1:EnemyAbstract){
main.removeChild(_arg1);
this[(_arg1.getEnemyType() + "Pool")].object = _arg1;
activeEnemyArray.splice(activeEnemyArray.indexOf(_arg1), 1);
if (activeEnemyArray.length <= 0){
main.levelComplete();
};
}
private function storeEnemy(){
}
public function clearEnemy(){
var _local1:*;
if (activeEnemyArray.length == 0){
return;
};
for (_local1 in activeEnemyArray) {
main.removeChild(activeEnemyArray[_local1]);
activeEnemyArray[_local1].destroy();
this[(activeEnemyArray[_local1].getEnemyType() + "Pool")].object = activeEnemyArray[_local1];
};
activeEnemyArray = [];
}
public static function getInstance():EnemyManager{
if (!instance){
allowInstantiation = true;
instance = new (EnemyManager);
allowInstantiation = false;
};
return (instance);
}
}
}//package com.assault.manager
Section 19
//HighScoreManager (com.assault.manager.HighScoreManager)
package com.assault.manager {
public class HighScoreManager {
private var highScoreArray:Array;
private var initiated:Boolean;// = false
private var main;
private static var allowInstantiation:Boolean;
private static var instance:HighScoreManager;
public function HighScoreManager(){
initiated = false;
super();
if (!allowInstantiation){
throw (new Error("Error: use EnemyManager.getInstance() instead of new"));
};
}
private function order(_arg1:Array, _arg2:Array){
var _local3:int;
var _local4:int;
_local3 = _arg1[1];
_local4 = _arg2[1];
if (_local3 > _local4){
return (-1);
};
if (_local3 < _local4){
return (1);
};
return (0);
}
public function init(_arg1, _arg2:Array){
if (!initiated){
main = _arg1;
initiated = true;
highScoreArray = _arg2;
_arg2.sort(order);
};
}
public function getHighScoreTable():Array{
return (highScoreArray.concat());
}
public function submitScore(_arg1:String, _arg2:Number){
highScoreArray.push([_arg1, _arg2]);
highScoreArray.sort(order);
}
public static function getInstance():HighScoreManager{
if (!instance){
allowInstantiation = true;
instance = new (HighScoreManager);
allowInstantiation = false;
};
return (instance);
}
}
}//package com.assault.manager
Section 20
//LevelPropertiesManager (com.assault.manager.LevelPropertiesManager)
package com.assault.manager {
import flash.events.*;
import com.assault.data.*;
import flash.utils.*;
public class LevelPropertiesManager {
private var main;
private var enemyTypesArray:Array;
private var initiated:Boolean;// = false
private var enemyCount:int;
private var levelPropArray:Array;
private var tick:Timer;
private static var allowInstantiation:Boolean;
private static var instance:LevelPropertiesManager;
public function LevelPropertiesManager(){
initiated = false;
super();
if (!allowInstantiation){
throw (new Error("Error: use EnemyManager.getInstance() instead of new"));
};
}
public function startLevel(_arg1:Array){
var _local2:*;
enemyTypesArray = [];
levelPropArray = _arg1;
enemyCount = 0;
for (_local2 in levelPropArray) {
enemyCount = (enemyCount + levelPropArray[_local2]);
if (levelPropArray[_local2] > 0){
enemyTypesArray.push(_local2);
};
};
tick = new Timer(1000);
tick.start();
tick.addEventListener(TimerEvent.TIMER, addWave);
}
private function addWave(_arg1:TimerEvent=null){
var _local2:Number;
if (main.wallHealth <= 0){
return;
};
if (enemyCount <= 0){
return;
};
if (main.isPaused){
return;
};
enemyCount--;
_local2 = int((Math.random() * enemyTypesArray.length));
if (levelPropArray[enemyTypesArray[_local2]] <= 0){
enemyTypesArray.splice(enemyTypesArray.indexOf(_local2), 1);
addWave();
return;
};
var _local3 = levelPropArray;
var _local4 = enemyTypesArray[_local2];
var _local5 = (_local3[_local4] - 1);
_local3[_local4] = _local5;
EnemyManager.getInstance().addEnemy(EnemyData.ENEMY_TYPE_ARRAY[enemyTypesArray[_local2]]);
}
public function init(_arg1){
if (!initiated){
main = _arg1;
enemyTypesArray = [];
initiated = true;
};
}
public function clearLevel(){
tick.stop();
tick = null;
EnemyManager.getInstance().clearEnemy();
}
public static function getInstance():LevelPropertiesManager{
if (!instance){
allowInstantiation = true;
instance = new (LevelPropertiesManager);
allowInstantiation = false;
};
return (instance);
}
}
}//package com.assault.manager
Section 21
//ParticleManager (com.assault.manager.ParticleManager)
package com.assault.manager {
import flash.display.*;
import de.polygonal.core.*;
import com.assault.particle.*;
public class ParticleManager {
private var particlePool:ObjectPool;
private var initiated:Boolean;// = false
public var activeParticleArray:Array;
private var explosionPool:ObjectPool;
private var main;
private static var allowInstantiation:Boolean;
private static var instance:ParticleManager;
public function ParticleManager(){
initiated = false;
super();
if (!allowInstantiation){
throw (new Error("Error: use EnemyManager.getInstance() instead of new"));
};
}
public function destroyParticle(_arg1:MovieClip){
if ((_arg1 is DirtParticle)){
particlePool.object = _arg1;
} else {
explosionPool.object = _arg1;
};
main.removeChild(_arg1);
activeParticleArray.splice(activeParticleArray.indexOf(_arg1), 1);
}
public function addParticle(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number){
var _local5:MovieClip;
if (!initiated){
throw (new Error("Error: initiate the manager first before use"));
};
switch (_arg1){
case "dirt":
_local5 = (particlePool.object as DirtParticle);
break;
case "explosion":
_local5 = (explosionPool.object as ExplosionParticle);
break;
};
main.addChild(_local5);
activeParticleArray.push(_local5);
_local5.init(_arg2, _arg3, _arg4);
}
public function init(_arg1){
if (!initiated){
main = _arg1;
activeParticleArray = [];
setPool();
initiated = true;
};
}
private function setPool(){
particlePool = new ObjectPool(true);
particlePool.allocate(1, DirtParticle);
explosionPool = new ObjectPool(true);
explosionPool.allocate(1, ExplosionParticle);
}
public static function getInstance():ParticleManager{
if (!instance){
allowInstantiation = true;
instance = new (ParticleManager);
allowInstantiation = false;
};
return (instance);
}
}
}//package com.assault.manager
Section 22
//WeaponManager (com.assault.manager.WeaponManager)
package com.assault.manager {
import com.chocorobokun.managers.*;
import flash.display.*;
import com.chocorobokun.util.*;
import com.assault.data.*;
import com.chocorobokun.effects.*;
public class WeaponManager {
private const OFFSET_SPEED:Number = 0.5;
public const WEAPON_STATE_SHOOT:String = "SHOOT";
public const WEAPON_STATE_IDLE:String = "IDLE";
public const WEAPON_STATE_RELOAD:String = "RELOAD";
var cooldown:int;// = 10
private var reloadTime:int;
var offset:Number;// = 20
public var weaponArray:Array;
public var isReloading:Boolean;
private var isZoom:Boolean;
private var weaponCooldown:int;
var automatic:Boolean;// = false
private var isShooting:Boolean;
public var shootAttempt:int;
private var weaponReloaded:String;
private var main;
private var reloadedWeapons:Array;
public var usedWeapon:String;
private var weaponOffset:Number;
public var headshotCount:int;
private var weaponState:String;
private var currentWeaponMov:MovieClip;
private var initiated:Boolean;// = false
private var weaponAmmoArray:Array;
public var playerAccuracy:Number;
public var shootHit:int;
private static var allowInstantiation:Boolean;
private static var instance:WeaponManager;
public function WeaponManager(){
initiated = false;
offset = 20;
automatic = false;
cooldown = 10;
super();
if (!allowInstantiation){
throw (new Error("Error: use .getInstance() instead of new"));
};
}
public function resetAnim(){
var _local1:*;
for (var _local4 in WeaponData.WEAPON_TYPE_ARRAY) {
_local1 = _local4;
_local4;
(main.gunMov[(WeaponData.WEAPON_TYPE_ARRAY[_local1] + "Normal")].visible = false);
(main.gunMov[(WeaponData.WEAPON_TYPE_ARRAY[_local1] + "Zoom")].visible = false);
};
}
private function checkIfWeaponIsReloaded():Boolean{
var _local1:*;
for (var _local4 in reloadedWeapons) {
_local1 = _local4;
_local4;
if (reloadedWeapons[_local1][0] == usedWeapon){
return (true);
};
};
return (false);
}
private function orderWeapon(_arg1:String, _arg2:String){
var _local3:int;
var _local4:int;
_local3 = WeaponData.WEAPON_TYPE_ARRAY.indexOf(_arg1);
_local4 = WeaponData.WEAPON_TYPE_ARRAY.indexOf(_arg2);
if (_local3 > _local4){
return (-1);
};
if (_local3 < _local4){
return (1);
};
return (0);
}
public function init(_arg1){
var _local2:*;
if (!initiated){
main = _arg1;
weaponOffset = 0;
weaponArray = ["wesson"];
usedWeapon = "wesson";
reloadedWeapons = [];
for (_local2 in WeaponData.WEAPON_TYPE_ARRAY) {
};
(initiated = true);
};
}
public function getAccuracy():Number{
(playerAccuracy = ((shootHit * 100) / shootAttempt));
(playerAccuracy = int((playerAccuracy * 100)));
if (playerAccuracy > 10000){
(playerAccuracy = 10000);
};
return ((playerAccuracy / 100));
}
public function reloadWeapon(){
if (checkIfWeaponIsReloaded()){
return;
};
reloadedWeapons.push([usedWeapon, WeaponData.WEAPON_DATA_ARRAY[(WeaponData.WEAPON_TYPE_ARRAY.indexOf(usedWeapon) + 1)][2]]);
stopShoot();
ConsoleManager.getInstance().showText((usedWeapon + " Reloading....."));
}
public function shootWeapon(){
var _local1:int;
if (checkIfWeaponIsReloaded()){
return;
};
if (weaponCooldown <= 0){
if (usedWeapon != "supreme"){
BulletManager.getInstance().addBullet((main.mouseX + (-(weaponOffset) + int((Math.random() * (weaponOffset * 2))))), (main.mouseY + (-(weaponOffset) + int((Math.random() * (weaponOffset * 2))))));
if (main.gameState != main.GAME_STATE_SCREEN){
SoundManager.getInstance().playSound("shotSound1", main.soundVolume);
};
} else {
if (main.gameState != main.GAME_STATE_SCREEN){
SoundManager.getInstance().playSound("rocketSound", main.soundVolume);
SoundManager.getInstance().playSound("explodeSound", main.soundVolume, -100);
};
_local1 = 1;
while (_local1 < 30) {
BulletManager.getInstance().addBullet((main.mouseX + (-20 + int((Math.random() * (20 * 2))))), (main.mouseY + (-20 + int((Math.random() * (20 * 2))))));
_local1++;
};
(shootAttempt = (shootAttempt + 10));
ParticleManager.getInstance().addParticle("explosion", main.mouseX, main.mouseY, 1.5);
TShaker.shakeObject(main, 10, 2);
};
(weaponCooldown = WeaponData.WEAPON_DATA_ARRAY[(WeaponData.WEAPON_TYPE_ARRAY.indexOf(usedWeapon) + 1)][1]);
var _local2 = weaponAmmoArray;
var _local3 = weaponArray.indexOf(usedWeapon);
var _local4 = (_local2[_local3] - 1);
_local2[_local3] = _local4;
_local2[_local3];
setCartridge();
shootAttempt++;
TShaker.shakeObject(main.gunMov, 5, 2, main.gunMov.x, main.gunMov.y);
} else {
weaponCooldown--;
};
setCartridge();
}
public function setBestWeapon(){
(main.HUD.weaponMov[("weapon" + (WeaponData.WEAPON_TYPE_ARRAY.indexOf(usedWeapon) + 1))].alpha = 0);
(usedWeapon = weaponArray[0]);
(main.HUD.weaponMov[("weapon" + (WeaponData.WEAPON_TYPE_ARRAY.indexOf(usedWeapon) + 1))].alpha = 1);
}
private function setWeaponNormal(){
(main.gunMov.x = 320);
if (main.mouseY >= WeaponData.WEAPON_DATA_ARRAY[(WeaponData.WEAPON_TYPE_ARRAY.indexOf(usedWeapon) + 1)][6]){
(main.gunMov.y = (main.mouseY + 400));
} else {
(main.gunMov.y = (WeaponData.WEAPON_DATA_ARRAY[(WeaponData.WEAPON_TYPE_ARRAY.indexOf(usedWeapon) + 1)][6] + 400));
};
(main.gunMov.rotation = (90 + ((CustomTrigon.getAngle(main.gunMov.x, main.gunMov.y, main.mouseX, main.mouseY) * 180) / Math.PI)));
}
public function nextWeapon(){
if (weaponReloaded == usedWeapon){
return;
};
if (weaponArray.indexOf(usedWeapon) == (weaponArray.length - 1)){
return;
};
if (isZoom){
return;
};
main[("weaponHUDTween" + (WeaponData.WEAPON_TYPE_ARRAY.indexOf(usedWeapon) + 1))].setValues({y:45, alpha:0});
(main[("weaponHUDTween" + (WeaponData.WEAPON_TYPE_ARRAY.indexOf(weaponArray[(weaponArray.indexOf(usedWeapon) + 1)]) + 1))].target.y = -45);
main[("weaponHUDTween" + (WeaponData.WEAPON_TYPE_ARRAY.indexOf(weaponArray[(weaponArray.indexOf(usedWeapon) + 1)]) + 1))].setValues({y:0, alpha:1});
(usedWeapon = weaponArray[(weaponArray.indexOf(usedWeapon) + 1)]);
setCartridge();
resetAnim();
(currentWeaponMov = main.gunMov[(usedWeapon + "Normal")]);
(currentWeaponMov.visible = true);
currentWeaponMov.gotoAndStop(currentWeaponMov.totalFrames);
}
public function prevWeapon(){
if (weaponReloaded == usedWeapon){
return;
};
if (weaponArray.indexOf(usedWeapon) == 0){
return;
};
if (isZoom){
return;
};
main[("weaponHUDTween" + (WeaponData.WEAPON_TYPE_ARRAY.indexOf(usedWeapon) + 1))].setValues({y:-45, alpha:0});
(main[("weaponHUDTween" + (WeaponData.WEAPON_TYPE_ARRAY.indexOf(weaponArray[(weaponArray.indexOf(usedWeapon) - 1)]) + 1))].target.y = 45);
main[("weaponHUDTween" + (WeaponData.WEAPON_TYPE_ARRAY.indexOf(weaponArray[(weaponArray.indexOf(usedWeapon) - 1)]) + 1))].setValues({y:0, alpha:1});
(usedWeapon = weaponArray[(weaponArray.indexOf(usedWeapon) - 1)]);
setCartridge();
resetAnim();
(currentWeaponMov = main.gunMov[(usedWeapon + "Normal")]);
(currentWeaponMov.visible = true);
}
public function getCurrentAmmo():int{
return (weaponAmmoArray[weaponArray.indexOf(usedWeapon)]);
}
public function stopShoot(){
(isShooting = false);
(weaponState = WEAPON_STATE_IDLE);
(weaponCooldown = 0);
setCartridge();
}
public function unZoomWeapon(){
resetAnim();
(currentWeaponMov = main.gunMov[(usedWeapon + "Normal")]);
(currentWeaponMov.visible = true);
(isZoom = false);
(main.gunMov.x = 320);
setWeaponNormal();
CursorManager.setCursor(main.crosshairMov);
}
private function setCartridge(){
var _local1:int;
_local1 = 1;
while (_local1 <= 100) {
if (_local1 > weaponAmmoArray[weaponArray.indexOf(usedWeapon)]){
(main.HUD.cartridgeMov.getChildByName(("bullet" + _local1)).visible = false);
} else {
(main.HUD.cartridgeMov.getChildByName(("bullet" + _local1)).visible = true);
};
_local1++;
};
}
public function resetWeapon(){
var _local1:int;
(weaponArray = ["wesson"]);
(usedWeapon = "wesson");
_local1 = 1;
while (_local1 <= 6) {
(main.HUD.weaponMov[("weapon" + _local1)].alpha = 0);
_local1++;
};
(main.HUD.weaponMov[("weapon" + 1)].alpha = 1);
}
public function initWeapon(){
var _local1:*;
resetAnim();
(weaponAmmoArray = []);
(reloadTime = 0);
(playerAccuracy = 0);
(shootAttempt = 0);
(shootHit = 0);
(headshotCount = 0);
(weaponState = WEAPON_STATE_IDLE);
(currentWeaponMov = main.gunMov[(usedWeapon + "Normal")]);
(currentWeaponMov.visible = true);
currentWeaponMov.gotoAndStop(currentWeaponMov.totalFrames);
weaponArray.sort(orderWeapon);
for (var _local4 in weaponArray) {
_local1 = _local4;
_local4;
weaponAmmoArray.push(WeaponData.WEAPON_DATA_ARRAY[(WeaponData.WEAPON_TYPE_ARRAY.indexOf(weaponArray[_local1]) + 1)][3]);
};
setCartridge();
}
public function startShoot(){
if (weaponReloaded == usedWeapon){
return;
};
if (checkIfWeaponIsReloaded()){
return;
};
(isShooting = true);
(weaponState = WEAPON_STATE_SHOOT);
setCartridge();
if (WeaponData.WEAPON_DATA_ARRAY[(WeaponData.WEAPON_TYPE_ARRAY.indexOf(usedWeapon) + 1)][4]){
shootWeapon();
stopShoot();
currentWeaponMov.gotoAndPlay(1);
};
}
public function zoomWeapon(){
if (isZoom){
return;
};
resetAnim();
(currentWeaponMov = main.gunMov[(usedWeapon + "Zoom")]);
(currentWeaponMov.visible = true);
currentWeaponMov.gotoAndStop(currentWeaponMov.totalFrames);
(isZoom = true);
CursorManager.setCursor(main.crosshairZoomMov);
}
public function onRender(){
var _local1:*;
main.crosshairMov.gotoAndStop(int(((weaponOffset * main.crosshairMov.totalFrames) / offset)));
if (((!(isShooting)) && ((weaponOffset > 0)))){
(weaponOffset = (weaponOffset - OFFSET_SPEED));
};
if (((isShooting) && ((weaponOffset < offset)))){
(weaponOffset = (weaponOffset + OFFSET_SPEED));
};
if (reloadedWeapons.length > 0){
for (var _local4 in reloadedWeapons) {
_local1 = _local4;
_local4;
_local4 = reloadedWeapons[_local1];
var _local5 = 1;
var _local6 = (_local4[_local5] - 1);
_local4[_local5] = _local6;
_local4[_local5];
if (reloadedWeapons[_local1][1] <= 0){
ConsoleManager.getInstance().showText((reloadedWeapons[_local1][0] + " Reloaded"));
(weaponAmmoArray[weaponArray.indexOf(reloadedWeapons[_local1][0])] = WeaponData.WEAPON_DATA_ARRAY[(WeaponData.WEAPON_TYPE_ARRAY.indexOf(reloadedWeapons[_local1][0]) + 1)][3]);
setCartridge();
reloadedWeapons.splice(_local1, 1);
};
};
};
switch (weaponState){
case WEAPON_STATE_SHOOT:
currentWeaponMov.play();
if (currentWeaponMov.currentFrame == currentWeaponMov.totalFrames){
currentWeaponMov.gotoAndPlay(1);
};
break;
case WEAPON_STATE_IDLE:
if (WeaponData.WEAPON_DATA_ARRAY[(WeaponData.WEAPON_TYPE_ARRAY.indexOf(usedWeapon) + 1)][4]){
if (currentWeaponMov.currentFrame == currentWeaponMov.totalFrames){
currentWeaponMov.stop();
};
} else {
currentWeaponMov.gotoAndStop(currentWeaponMov.totalFrames);
};
break;
};
if (isZoom){
(main.gunMov.x = main.mouseX);
if (main.mouseY >= 220){
(main.gunMov.y = main.mouseY);
} else {
(main.gunMov.y = 220);
};
(main.gunMov.rotation = 0);
} else {
setWeaponNormal();
};
main.addChild(main.gunMov);
if (!isShooting){
return;
};
shootWeapon();
}
public static function getInstance():WeaponManager{
if (!instance){
allowInstantiation = true;
instance = new (WeaponManager);
allowInstantiation = false;
};
return (instance);
}
}
}//package com.assault.manager
Section 23
//DirtParticle (com.assault.particle.DirtParticle)
package com.assault.particle {
import com.assault.manager.*;
import flash.display.*;
import flash.events.*;
public class DirtParticle extends MovieClip {
public function DirtParticle(){
addEventListener(Event.REMOVED_FROM_STAGE, onRemoved);
}
public function init(_arg1:Number, _arg2:Number, _arg3:Number){
this.x = _arg1;
this.y = _arg2;
this.scaleX = _arg3;
this.scaleY = _arg3;
gotoAndPlay(1);
addEventListener(Event.ENTER_FRAME, onRender);
}
private function onStage(_arg1:Event){
}
private function onRender(_arg1:Event){
if (this.currentFrame == this.totalFrames){
ParticleManager.getInstance().destroyParticle(this);
};
}
private function onRemoved(_arg1:Event){
removeEventListener(Event.ENTER_FRAME, onRender);
}
}
}//package com.assault.particle
Section 24
//ExplosionParticle (com.assault.particle.ExplosionParticle)
package com.assault.particle {
import com.assault.manager.*;
import flash.display.*;
import flash.events.*;
public class ExplosionParticle extends MovieClip {
public function ExplosionParticle(){
addEventListener(Event.REMOVED_FROM_STAGE, onRemoved);
}
public function init(_arg1:Number, _arg2:Number, _arg3:Number){
this.x = _arg1;
this.y = _arg2;
this.scaleX = _arg3;
this.scaleY = _arg3;
gotoAndPlay(1);
addEventListener(Event.ENTER_FRAME, onRender);
}
private function onRender(_arg1:Event){
if (this.currentFrame == this.totalFrames){
ParticleManager.getInstance().destroyParticle(this);
};
}
private function onRemoved(_arg1:Event){
removeEventListener(Event.ENTER_FRAME, onRender);
}
}
}//package com.assault.particle
Section 25
//AssaultPreloader (com.assault.preloader.AssaultPreloader)
package com.assault.preloader {
import flash.display.*;
import flash.events.*;
import com.chocorobokun.preloader.*;
import com.chocorobokun.util.*;
import flash.text.*;
public class AssaultPreloader extends MovieClip implements IPreloader {
public var loaderMov:MovieClip;
public var loadingDisp:TextField;
private var callback:Function;
public var logoMov:MovieClip;
public var gameLoaded:Boolean;
private var isReady:Boolean;
public var startBut:SimpleButton;
public function AssaultPreloader(_arg1:Function, _arg2:Boolean=false){
callback = _arg1;
buttonMode = (useHandCursor = true);
isReady = _arg2;
startBut.visible = false;
if (!isReady){
logoMov.gotoAndStop((logoMov.totalFrames - 1));
} else {
loaderMov.loadingBar.gotoAndStop(50);
loadingDisp.text = "100%";
};
startBut.addEventListener(MouseEvent.CLICK, onStart);
logoMov.addEventListener(MouseEvent.CLICK, onClick);
addEventListener(Event.ENTER_FRAME, onRender);
}
private function onRender(_arg1:Event){
if (logoMov.currentFrame == logoMov.totalFrames){
stop();
loaderMov.visible = false;
loadingDisp.visible = false;
startBut.visible = true;
gameLoaded = true;
};
}
private function onStart(_arg1:Event){
callback();
}
public function update(_arg1:int):void{
loadingDisp.text = (_arg1 + "%");
if (_arg1 >= 100){
this.visible = false;
};
loaderMov.loadingBar.gotoAndStop(int((_arg1 / 2)));
}
private function onClick(_arg1:Event){
OpenURL.callURL("http://www.flashgames247.com/?utm_source=brandedgames&utm_medium=armyassault");
}
}
}//package com.assault.preloader
Section 26
//CompleteScreen (com.assault.screen.CompleteScreen)
package com.assault.screen {
import com.chocorobokun.managers.*;
import flash.display.*;
import flash.events.*;
import com.chocorobokun.util.*;
public class CompleteScreen extends MovieClip {
public var moreBut:MovieClip;
public var playBut:SimpleButton;
public function CompleteScreen(){
playBut.addEventListener(MouseEvent.CLICK, onPlay);
moreBut.addEventListener(MouseEvent.CLICK, onMore);
}
public function onPlay(_arg1:Event){
SoundManager.getInstance().playSound("mainSound", MainClass(root).mainStage.soundVolume, 9999);
ScreenManager.getInstance().changeToScreen("submitScreen");
}
private function onMore(_arg1:Event){
OpenURL.callURL("http://www.flashgames247.com/?utm_source=brandedgames&utm_medium=armyassault");
}
}
}//package com.assault.screen
Section 27
//GameOverScreen (com.assault.screen.GameOverScreen)
package com.assault.screen {
import com.chocorobokun.managers.*;
import flash.display.*;
import flash.events.*;
import com.chocorobokun.util.*;
public class GameOverScreen extends MovieClip {
public var moreBut:MovieClip;
public var playBut:SimpleButton;
public function GameOverScreen(){
playBut.addEventListener(MouseEvent.CLICK, onPlay);
moreBut.addEventListener(MouseEvent.CLICK, onMore);
}
private function onPlay(_arg1:Event){
SoundManager.getInstance().playSound("mainSound", MainClass(root).mainStage.soundVolume, 0, 999);
ScreenManager.getInstance().changeToScreen("submitScreen");
}
private function onMore(_arg1:Event){
OpenURL.callURL("http://www.flashgames247.com/?utm_source=brandedgames&utm_medium=armyassault");
}
}
}//package com.assault.screen
Section 28
//HighScoreScreen (com.assault.screen.HighScoreScreen)
package com.assault.screen {
import com.assault.manager.*;
import com.chocorobokun.managers.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class HighScoreScreen extends MovieClip {
private var highScoreArray:Array;
public var scoreDisp:TextField;
public var menuBut:SimpleButton;
public var nameDisp:TextField;
public function HighScoreScreen(){
addEventListener(Event.ADDED_TO_STAGE, onStage);
menuBut.addEventListener(MouseEvent.CLICK, onMenu);
}
private function onStage(_arg1:Event){
var _local2:*;
nameDisp.text = "";
scoreDisp.text = "";
highScoreArray = HighScoreManager.getInstance().getHighScoreTable();
for (_local2 in highScoreArray) {
nameDisp.appendText((highScoreArray[_local2][0] + "\n"));
scoreDisp.appendText((highScoreArray[_local2][1] + "\n"));
};
}
private function onMenu(_arg1:Event){
ScreenManager.getInstance().changeToScreen("menuScreen");
}
}
}//package com.assault.screen
Section 29
//InstructionScreen (com.assault.screen.InstructionScreen)
package com.assault.screen {
import com.chocorobokun.managers.*;
import flash.display.*;
import flash.events.*;
public class InstructionScreen extends MovieClip {
public var playBut:SimpleButton;
public function InstructionScreen(){
addEventListener(Event.ADDED_TO_STAGE, onStage);
playBut.addEventListener(MouseEvent.CLICK, onPlay);
}
private function onStage(_arg1:Event){
MainClass(root).mainStage.gameInit();
}
private function onPlay(_arg1:Event){
MainClass(root).mainStage.levelInit();
ScreenManager.getInstance().removeScreen("instructionScreen");
}
}
}//package com.assault.screen
Section 30
//MenuScreen (com.assault.screen.MenuScreen)
package com.assault.screen {
import com.assault.manager.*;
import com.chocorobokun.managers.*;
import flash.display.*;
import flash.events.*;
import com.chocorobokun.util.*;
public class MenuScreen extends MovieClip {
public var menuMov:MovieClip;
public var cheatBut:SimpleButton;
public function MenuScreen(){
menuMov.startBut.addEventListener(MouseEvent.CLICK, onStart);
cheatBut.addEventListener(MouseEvent.CLICK, onCheat);
addEventListener(Event.ADDED_TO_STAGE, onStage);
menuMov.highscoreBut.addEventListener(MouseEvent.CLICK, onScore);
menuMov.moreBut.addEventListener(MouseEvent.CLICK, onMore);
}
private function onScore(_arg1:Event){
ScreenManager.getInstance().changeToScreen("highScoreScreen");
}
private function onCheat(_arg1:Event){
MainClass(root).mainStage.isCheat = true;
MainClass(root).mainStage.wallHealth = 9999999999999;
WeaponManager.getInstance().weaponArray = ["wesson", "carbine", "grand", "krieg", "thunder", "supreme"];
}
private function onStage(_arg1:Event){
menuMov.gotoAndPlay(1);
}
private function onStart(_arg1:Event){
ScreenManager.getInstance().changeToScreen("instructionScreen");
}
private function onMore(_arg1:Event){
OpenURL.callURL("http://www.flashgames247.com/?utm_source=brandedgames&utm_medium=armyassault");
}
}
}//package com.assault.screen
Section 31
//PauseScreen (com.assault.screen.PauseScreen)
package com.assault.screen {
import com.chocorobokun.managers.*;
import flash.display.*;
import flash.events.*;
public class PauseScreen extends MovieClip {
public function PauseScreen(){
addEventListener(MouseEvent.CLICK, onClick);
}
private function onStage(_arg1:Event){
}
private function onClick(_arg1:Event){
MainClass(root).mainStage.isPaused = false;
MainClass(root).mainStage.gameState = MainClass(root).mainStage.GAME_STATE_NORMAL;
ScreenManager.getInstance().removeScreen("pauseScreen");
}
}
}//package com.assault.screen
Section 32
//ShopScreen (com.assault.screen.ShopScreen)
package com.assault.screen {
import com.assault.manager.*;
import com.chocorobokun.managers.*;
import flash.display.*;
import flash.events.*;
import com.gskinner.motion.*;
import com.chocorobokun.util.*;
import com.assault.data.*;
import com.gskinner.motion.easing.*;
import com.assault.world.*;
public class ShopScreen extends MovieClip {
private var itemTween2:GTween;
private var itemTween3:GTween;
private var itemTween4:GTween;
private var itemTween6:GTween;
private var itemTween5:GTween;
private var itemTween1:GTween;
private var weaponSelectedIndex:int;
public var shopPanel:MovieClip;
public var main:MainStage;
private var weaponSelPosition:int;
public function ShopScreen(){
var _local1:int;
super();
addEventListener(Event.ADDED_TO_STAGE, onStage);
shopPanel.repairBut.addEventListener(MouseEvent.CLICK, onRepair);
shopPanel.continueBut.addEventListener(MouseEvent.CLICK, onContinue);
shopPanel.prevBut.addEventListener(MouseEvent.CLICK, onPrev);
shopPanel.nextBut.addEventListener(MouseEvent.CLICK, onNext);
shopPanel.buyBut.addEventListener(MouseEvent.CLICK, onBuy);
shopPanel.moreBut.addEventListener(MouseEvent.CLICK, onMore);
shopPanel.more2But.addEventListener(MouseEvent.CLICK, onMore);
itemTween1 = new GTween(shopPanel.weaponSelection.weaponBut1, 0.5, null, {ease:Circular.easeOut});
_local1 = 1;
while (_local1 <= 6) {
shopPanel.weaponSelection[("weaponBut" + _local1)].buttonMode = true;
shopPanel.weaponSelection[("weaponBut" + _local1)].useHandCursor = true;
shopPanel.weaponSelection[("weaponBut" + _local1)].addEventListener(MouseEvent.CLICK, onWeaponClick);
shopPanel.weaponSelection[("weaponBut" + _local1)].addEventListener(MouseEvent.ROLL_OVER, onWeaponHover);
shopPanel.weaponSelection[("weaponBut" + _local1)].addEventListener(MouseEvent.ROLL_OUT, onWeaponOut);
shopPanel.weaponSelection[("weaponBut" + _local1)].nameDisp.text = WeaponData.WEAPON_TYPE_ARRAY[(_local1 - 1)];
shopPanel.weaponSelection[("weaponBut" + _local1)].hoverMov.nameDisp.text = WeaponData.WEAPON_TYPE_ARRAY[(_local1 - 1)];
shopPanel.weaponSelection[("weaponBut" + _local1)].weaponMov.gotoAndStop(_local1);
this[("itemTween" + _local1)] = new GTween(shopPanel.weaponSelection[("weaponBut" + _local1)], 0.5, null, {ease:Circular.easeOut});
_local1++;
};
}
private function onBuy(_arg1:Event){
if (WeaponManager.getInstance().weaponArray.indexOf(WeaponData.WEAPON_TYPE_ARRAY[(weaponSelectedIndex - 1)]) != -1){
return;
};
if (MainClass(root).mainStage.playerMoney < WeaponData.WEAPON_DATA_ARRAY[weaponSelectedIndex][5]){
trace("MONEY NOT ENOUGH");
return;
};
WeaponManager.getInstance().weaponArray.push(WeaponData.WEAPON_TYPE_ARRAY[(weaponSelectedIndex - 1)]);
MainClass(root).mainStage.playerMoney = (MainClass(root).mainStage.playerMoney - WeaponData.WEAPON_DATA_ARRAY[weaponSelectedIndex][5]);
shopPanel.totalDisp.text = ("Total Money: $" + MainClass(root).mainStage.playerMoney);
shopPanel.weaponSelection[("weaponBut" + weaponSelectedIndex)].alpha = 0.5;
shopPanel.weaponSelection[("weaponBut" + weaponSelectedIndex)].enabled = false;
}
private function onWeaponHover(_arg1:Event){
var _local2:int;
_local2 = 1;
while (_local2 <= 6) {
shopPanel.weaponSelection[("weaponBut" + _local2)].hoverMov.alpha = ((shopPanel.weaponSelection[("weaponBut" + _local2)].alpha)==1) ? 0 : 1;
_local2++;
};
_arg1.currentTarget.hoverMov.alpha = 1;
weaponSelectedIndex = int(_arg1.currentTarget.name.charAt(9));
if (WeaponManager.getInstance().weaponArray.indexOf(WeaponData.WEAPON_TYPE_ARRAY[(weaponSelectedIndex - 1)]) == -1){
shopPanel.priceDisp.text = ("Price: $" + WeaponData.WEAPON_DATA_ARRAY[weaponSelectedIndex][5]);
} else {
shopPanel.priceDisp.text = "PURCHASED";
};
shopPanel.descDisp.text = (((((((((("The " + WeaponData.WEAPON_TYPE_ARRAY[(weaponSelectedIndex - 1)]) + " is an extremely accurate weapon. It's clip holds ") + WeaponData.WEAPON_DATA_ARRAY[weaponSelectedIndex][3]) + " caliber rounds. ") + (WeaponData.WEAPON_DATA_ARRAY[weaponSelectedIndex][0] * 10)) + " damage against infantry units, and ") + (WeaponData.WEAPON_DATA_ARRAY[weaponSelectedIndex][7] * 10)) + " damage against vehicles and Howitzers. Reload time: ") + (int(((WeaponData.WEAPON_DATA_ARRAY[weaponSelectedIndex][2] * 10) / 50)) / 10)) + " seconds.");
if (weaponSelectedIndex == 6){
shopPanel.descDisp.text = (((("The " + WeaponData.WEAPON_TYPE_ARRAY[(weaponSelectedIndex - 1)]) + " will destroy everything it hits. Reload time: ") + (int(((WeaponData.WEAPON_DATA_ARRAY[weaponSelectedIndex][2] * 10) / 50)) / 10)) + " seconds.");
};
}
private function onRepair(_arg1:Event){
if (main.wallHealth >= 1000){
return;
};
if (main.playerMoney < 100){
return;
};
if (main.wallHealth <= 950){
main.wallHealth = (main.wallHealth + 50);
} else {
main.wallHealth = (main.wallHealth + (1000 - main.wallHealth));
};
main.playerMoney = (main.playerMoney - 100);
shopPanel.healthDisp.text = (("Health " + main.wallHealth) + "/1000");
shopPanel.totalDisp.text = ("Total Money: $" + MainClass(root).mainStage.playerMoney);
}
private function onStage(_arg1:Event){
var _local2:int;
main = MainClass(root).mainStage;
weaponSelPosition = 1;
weaponSelectedIndex = 1;
shopPanel.earningDisp.text = ("Level Earnings: $" + MainClass(root).mainStage.levelEarning);
shopPanel.accBonusDisp.text = ("Accuracy Bonus: $" + MainClass(root).mainStage.accuracyBonus);
shopPanel.headshotDisp.text = ("Headshot Bonus: $" + MainClass(root).mainStage.headshotBonus);
shopPanel.totalDisp.text = ("Total Money: $" + MainClass(root).mainStage.playerMoney);
shopPanel.accuracyDisp.text = (("Accuracy: " + WeaponManager.getInstance().getAccuracy()) + "%");
shopPanel.healthDisp.text = (("Health " + MainClass(root).mainStage.wallHealth) + "/1000");
shopPanel.headshotNumDisp.text = ("Headshots: " + WeaponManager.getInstance().headshotCount);
shopPanel.levelDisp.text = ("STATS FOR LEVEL " + LevelManager.getInstance().getCurrentLevel());
_local2 = 1;
while (_local2 <= 6) {
shopPanel.weaponSelection[("weaponBut" + _local2)].x = ((_local2 - 1) * 137);
if (WeaponManager.getInstance().weaponArray.indexOf(WeaponData.WEAPON_TYPE_ARRAY[(_local2 - 1)]) == -1){
shopPanel.weaponSelection[("weaponBut" + _local2)].alpha = 1;
shopPanel.weaponSelection[("weaponBut" + _local2)].hoverMov.alpha = 0;
shopPanel.weaponSelection[("weaponBut" + _local2)].enabled = true;
} else {
shopPanel.weaponSelection[("weaponBut" + _local2)].alpha = 0.5;
shopPanel.weaponSelection[("weaponBut" + _local2)].hoverMov.alpha = 1;
shopPanel.weaponSelection[("weaponBut" + _local2)].enabled = false;
};
_local2++;
};
}
private function onWeaponClick(_arg1:Event){
}
private function onWeaponOut(_arg1:Event){
}
private function onNext(_arg1:Event){
var _local2:int;
if (weaponSelPosition == 5){
return;
};
weaponSelPosition = (weaponSelPosition + 1);
_local2 = 1;
while (_local2 <= 6) {
this[("itemTween" + _local2)].setValues({x:(((_local2 - 1) * 137) - ((weaponSelPosition - 1) * 137))});
_local2++;
};
}
private function onContinue(_arg1:Event){
main.levelInit();
ScreenManager.getInstance().removeScreen("shopScreen");
}
private function onPrev(_arg1:Event){
var _local2:int;
if (weaponSelPosition == 1){
return;
};
weaponSelPosition = (weaponSelPosition - 1);
_local2 = 1;
while (_local2 <= 6) {
this[("itemTween" + _local2)].setValues({x:(((_local2 - 1) * 137) - ((weaponSelPosition - 1) * 137))});
_local2++;
};
}
private function onMore(_arg1:Event){
OpenURL.callURL("http://www.flashgames247.com/?utm_source=brandedgames&utm_medium=armyassault");
}
}
}//package com.assault.screen
Section 33
//SubmitScreen (com.assault.screen.SubmitScreen)
package com.assault.screen {
import com.assault.manager.*;
import com.chocorobokun.managers.*;
import flash.display.*;
import flash.events.*;
import com.chocorobokun.util.*;
import flash.text.*;
public class SubmitScreen extends MovieClip {
public var moreBut:MovieClip;
public var submitBut:SimpleButton;
public var scoreDisp:TextField;
public var playBut:SimpleButton;
public var nameInput:TextField;
public function SubmitScreen(){
submitBut.addEventListener(MouseEvent.CLICK, onSubmit);
playBut.addEventListener(MouseEvent.CLICK, onPlay);
nameInput.addEventListener(MouseEvent.CLICK, onInput);
moreBut.addEventListener(MouseEvent.CLICK, onMore);
addEventListener(Event.ADDED_TO_STAGE, onStage);
}
private function onInput(_arg1:Event){
if (nameInput.text != "YOUR NAME"){
return;
};
nameInput.text = "";
}
private function onStage(_arg1:Event){
MainClass(root).mainStage.calculateMoney();
nameInput.text = "YOUR NAME";
scoreDisp.text = String(MainClass(root).mainStage.playerScore);
}
private function onPlay(_arg1:Event){
ScreenManager.getInstance().changeToScreen("menuScreen");
}
private function onMore(_arg1:Event){
OpenURL.callURL("http://www.flashgames247.com/?utm_source=brandedgames&utm_medium=armyassault");
}
private function onSubmit(_arg1:Event){
if ((((nameInput.text == "YOUR NAME")) || ((nameInput.text == "")))){
HighScoreManager.getInstance().submitScore("PLAYER", MainClass(root).mainStage.playerScore);
} else {
HighScoreManager.getInstance().submitScore(nameInput.text, MainClass(root).mainStage.playerScore);
};
ScreenManager.getInstance().changeToScreen("highScoreScreen");
}
}
}//package com.assault.screen
Section 34
//MainStage (com.assault.world.MainStage)
package com.assault.world {
import com.assault.manager.*;
import com.assault.enemy.*;
import com.chocorobokun.managers.*;
import flash.display.*;
import flash.events.*;
import com.gskinner.motion.*;
import com.chocorobokun.util.*;
import com.assault.data.*;
import flash.utils.*;
import com.gskinner.motion.easing.*;
import com.senocular.utils.*;
import flash.ui.*;
import com.assault.screen.*;
import flash.net.*;
public class MainStage extends MovieClip {
public const MAXIMUM_LEVEL:int = 16;
public const BRAND_URL:String = "http://www.flashgames247.com/?utm_source=brandedgames&utm_medium=armyassault";
public const MAX_ENEMY:int = 20;
public const GAME_STATE_SCREEN:String = "SCREEN";
public const GAME_STATE_ZOOM:String = "ZOOM";
public const GAME_STATE_INGAME:String = "INGAME";
public const GAME_STATE_NORMAL:String = "NORMAL";
public var isHoverButton:Boolean;
public var playerScore:int;
public var weaponHUDTween1:GTween;
public var weaponHUDTween3:GTween;
public var weaponHUDTween4:GTween;
public var weaponHUDTween5:GTween;
public var weaponHUDTween6:GTween;
public var keyLimiter:int;// = 0
public var key:KeyObject;
public var cMenu:ContextMenu;
public var isMute:Boolean;
public var playerMoney:int;
public var weaponHUDTween2:GTween;
public var accuracyBonus:int;
public var pauseBut:SimpleButton;
public var wallHealth:int;
public var saveData:SharedObject;
public var HUD:MovieClip;
public var levelEarning:int;
public var isPaused:Boolean;
public var soundVolume:Number;
public var headshotBonus:int;
public var levelManager:LevelManager;
public var crosshairMov:MovieClip;
public var muteBut:MovieClip;
public var enemyArray:Array;
public var gunMov:MovieClip;
public var isCheat:Boolean;
public var crosshairZoomMov:MovieClip;
public var gameState:String;
public var weaponManager:WeaponManager;
public function MainStage(){
var _local1:ContextMenuItem;
keyLimiter = 0;
cMenu = new ContextMenu();
super();
trace("ASSAULT GAME START");
this.contextMenu = cMenu;
cMenu.hideBuiltInItems();
_local1 = new ContextMenuItem("FlashGames247.com");
_local1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onCMenu);
cMenu.customItems.push(_local1);
addEventListener(Event.ADDED_TO_STAGE, onStage);
}
private function onButtonRoll(_arg1:Event){
isHoverButton = true;
}
public function cobaShake(_arg1:int=10, _arg2:int=10){
var timer:Timer;
var shakeRatio = _arg1;
var shakeDuration = _arg2;
timer = new Timer(10, shakeDuration);
timer.start();
timer.addEventListener(TimerEvent.TIMER, function (){
MainClass(root).mainStage.x = (MainClass(root).mainStage.y = 0);
MainClass(root).mainStage.x = (MainClass(root).mainStage.x + (int((Math.random() * (shakeRatio * 2))) - shakeRatio));
MainClass(root).mainStage.y = (MainClass(root).mainStage.y + (int((Math.random() * (shakeRatio * 2))) - shakeRatio));
});
timer.addEventListener(TimerEvent.TIMER_COMPLETE, function (){
MainClass(root).mainStage.x = (MainClass(root).mainStage.y = 0);
});
}
public function gameInit(){
WeaponManager.getInstance().resetWeapon();
levelManager.setLevel(1);
levelManager.setCurrentLevel(1);
wallHealth = 1000;
gameState = GAME_STATE_SCREEN;
stage.focus = this;
playerMoney = 0;
levelEarning = 0;
playerScore = 0;
if (isCheat){
wallHealth = 9999999999999;
WeaponManager.getInstance().weaponArray = ["wesson", "carbine", "supreme", "grand", "krieg", "thunder"];
};
}
public function onStage(_arg1:Event){
var _local2:MovieClip;
var _local3:int;
var _local4:int;
sharedObjectInit();
stage.stageFocusRect = false;
ScreenManager.getInstance().init(this, this);
ScreenManager.getInstance().addScreen(new MenuScreen(), "menuScreen");
ScreenManager.getInstance().addScreen(new InstructionScreen(), "instructionScreen");
ScreenManager.getInstance().addScreen(new ShopScreen(), "shopScreen");
ScreenManager.getInstance().addScreen(new GameOverScreen(), "gameOverScreen");
ScreenManager.getInstance().addScreen(new PauseScreen(), "pauseScreen");
ScreenManager.getInstance().addScreen(new HighScoreScreen(), "highScoreScreen");
ScreenManager.getInstance().addScreen(new SubmitScreen(), "submitScreen");
ScreenManager.getInstance().addScreen(new CompleteScreen(), "completeScreen");
ScreenManager.getInstance().changeToScreen("menuScreen", false);
EnemyManager.getInstance().init(this);
BulletManager.getInstance().init(this);
ParticleManager.getInstance().init(this);
WeaponManager.getInstance().init(this);
LevelPropertiesManager.getInstance().init(this);
ConsoleManager.getInstance().init(this);
HighScoreManager.getInstance().init(this, saveData.data.highScoreArray);
soundVolume = 0.25;
SoundManager.getInstance().addLibrarySound(AK47Sound, "ak47Sound");
SoundManager.getInstance().addLibrarySound(M60Sound, "m60Sound");
SoundManager.getInstance().addLibrarySound(ShotSound1, "shotSound1");
SoundManager.getInstance().addLibrarySound(RocketSound, "rocketSound");
SoundManager.getInstance().addLibrarySound(ExplodeSound, "explodeSound");
SoundManager.getInstance().addLibrarySound(MainSound, "mainSound");
SoundManager.getInstance().addLibrarySound(PlaySound, "playSound");
SoundManager.getInstance().playSound("mainSound", soundVolume, 0, 999);
ConsoleManager.getInstance().setStartPos(19, 39);
_local3 = 1;
while (_local3 <= 100) {
_local2 = new BulletReload();
_local2.name = ("bullet" + _local3);
HUD.cartridgeMov.addChild(_local2);
_local2.x = ((_local3 * 5) - 5);
_local3++;
};
_local4 = 1;
while (_local4 <= 6) {
this[("weaponHUDTween" + _local4)] = new GTween(HUD.weaponMov[("weapon" + _local4)], 1, null, {ease:Circular.easeOut});
HUD.weaponMov[("weapon" + _local4)].alpha = 0;
_local4++;
};
HUD.weaponMov[("weapon" + 1)].alpha = 1;
levelManager = LevelManager.getInstance();
key = new KeyObject(stage);
weaponManager = WeaponManager.getInstance();
pauseBut.addEventListener(MouseEvent.CLICK, onPause);
pauseBut.addEventListener(MouseEvent.ROLL_OVER, onButtonRoll);
pauseBut.addEventListener(MouseEvent.ROLL_OUT, onButtonUp);
muteBut.addEventListener(MouseEvent.CLICK, onMute);
muteBut.addEventListener(MouseEvent.ROLL_OVER, onButtonRoll);
muteBut.addEventListener(MouseEvent.ROLL_OUT, onButtonUp);
muteBut.gotoAndStop("mute");
}
private function onButtonUp(_arg1:Event){
isHoverButton = false;
}
private function onMute(_arg1:Event){
if (isMute){
soundVolume = 0.5;
SoundManager.getInstance().unmuteAllSounds();
muteBut.gotoAndStop("mute");
isMute = false;
} else {
soundVolume = 0;
SoundManager.getInstance().muteAllSounds();
muteBut.gotoAndStop("unmute");
isMute = true;
};
}
public function levelInit(){
var _local1:int;
CursorManager.init(stage);
CursorManager.setCursor(crosshairMov);
WeaponManager.getInstance().initWeapon();
WeaponManager.getInstance().setBestWeapon();
ConsoleManager.getInstance().showText((("LEVEL " + LevelManager.getInstance().getCurrentLevel()) + " STARTING"));
stage.focus = this;
gameState = GAME_STATE_NORMAL;
gunMov.gotoAndStop(5);
enemyArray = [];
_local1 = 1;
while (_local1 <= 6) {
HUD.weaponMov[("weapon" + _local1)].alpha = 0;
_local1++;
};
HUD.weaponMov[("weapon" + (WeaponData.WEAPON_TYPE_ARRAY.indexOf(weaponManager.usedWeapon) + 1))].alpha = 1;
HUD.weaponMov[("weapon" + (WeaponData.WEAPON_TYPE_ARRAY.indexOf(weaponManager.usedWeapon) + 1))].y = 0;
LevelPropertiesManager.getInstance().startLevel(LevelData.LEVEL_DATA_ARRAY[levelManager.getCurrentLevel()].concat());
trace(("LEVEL INIT PROP ARRAY :" + LevelData.LEVEL_DATA_ARRAY[levelManager.getCurrentLevel()]));
SoundManager.getInstance().stopSound("mainSound");
SoundManager.getInstance().playSound("playSound", (soundVolume / 2), 999);
stage.addEventListener(MouseEvent.CLICK, onClick);
stage.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
stage.addEventListener(MouseEvent.MOUSE_UP, onUp);
addEventListener(Event.ENTER_FRAME, mainLoop);
}
private function onUp(_arg1:Event){
if (isHoverButton){
return;
};
WeaponManager.getInstance().stopShoot();
}
public function levelComplete(){
SoundManager.getInstance().stopAllSounds();
if (levelManager.getCurrentLevel() >= MAXIMUM_LEVEL){
gameComplete();
return;
};
SoundManager.getInstance().playSound("mainSound", soundVolume, 0, 999);
calculateMoney();
ScreenManager.getInstance().changeToScreen("shopScreen", false);
gameState = GAME_STATE_SCREEN;
LevelPropertiesManager.getInstance().clearLevel();
levelManager.setLevel((levelManager.getCurrentLevel() + 1));
trace((("GET ACCURACY : " + weaponManager.getAccuracy()) + "%"));
}
private function onClick(_arg1:Event){
if (isHoverButton){
return;
};
if (isPaused){
return;
};
weaponManager.shootWeapon();
weaponManager.stopShoot();
}
public function calculateMoney(){
var _local1:Array;
var _local2:*;
_local1 = LevelData.LEVEL_DATA_ARRAY[levelManager.getCurrentLevel()];
for (_local2 in _local1) {
levelEarning = (levelEarning + (_local1[_local2] * EnemyData.ENEMY_DATA_ARRAY[(_local2 + 1)][4]));
};
accuracyBonus = int(((levelEarning * weaponManager.getAccuracy()) / 100));
headshotBonus = (weaponManager.headshotCount * 10);
playerMoney = (playerMoney + ((levelEarning + accuracyBonus) + headshotBonus));
playerScore = (playerScore + playerMoney);
trace(("LEVEL EARNING : " + levelEarning));
}
private function onDown(_arg1:Event){
if (isHoverButton){
return;
};
if (isPaused){
return;
};
WeaponManager.getInstance().startShoot();
}
public function sharedObjectInit(){
saveData = SharedObject.getLocal("TESTSO4");
if (!saveData.data.highScoreArray){
saveData.data.highScoreArray = [["player", 1000], ["player", 2000], ["player", 3000], ["player", 4000], ["player", 5000], ["player", 6000], ["player", 7000], ["player", 8000], ["player", 9000], ["player", 200000]];
trace("SO CREATED!!!!!!!!!!!");
} else {
trace("SO ALREADY CREATED!!!!!!!!!!!");
};
}
public function cobaShoot(){
}
public function cobaWave(){
var _local1:*;
EnemyManager.getInstance().addEnemy(EnemyData.ENEMY_TYPE_ARRAY[int((Math.random() * EnemyData.ENEMY_TYPE_ARRAY.length))]);
enemyArray.sort(order);
for (_local1 in enemyArray) {
addChild(enemyArray[_local1]);
};
}
private function order(_arg1:EnemyAbstract, _arg2:EnemyAbstract){
var _local3:int;
var _local4:int;
_local3 = _arg1.y;
_local4 = _arg2.y;
if (_local3 < _local4){
return (-1);
};
if (_local3 > _local4){
return (1);
};
return (0);
}
private function onPause(_arg1:Event){
if (gameState != GAME_STATE_SCREEN){
ScreenManager.getInstance().changeToScreen("pauseScreen");
gameState = GAME_STATE_SCREEN;
isPaused = true;
};
}
public function gameComplete(){
calculateMoney();
ScreenManager.getInstance().changeToScreen("completeScreen", false);
gameState = GAME_STATE_SCREEN;
LevelPropertiesManager.getInstance().clearLevel();
trace("GAME COMPLETE!!!");
}
public function cobaStart(){
CursorManager.init(stage);
CursorManager.setCursor(crosshairMov);
stage.focus = this;
gunMov.gotoAndStop(5);
enemyArray = [];
stage.addEventListener(MouseEvent.CLICK, onClick);
stage.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
stage.addEventListener(MouseEvent.MOUSE_UP, onUp);
addEventListener(Event.ENTER_FRAME, mainLoop);
}
private function onCMenu(_arg1:Event){
OpenURL.callURL(BRAND_URL);
}
public function gameOver(){
gameState = GAME_STATE_SCREEN;
LevelPropertiesManager.getInstance().clearLevel();
SoundManager.getInstance().stopAllSounds();
ScreenManager.getInstance().changeToScreen("gameOverScreen", false);
}
private function mainLoop(_arg1:Event){
if (isPaused){
return;
};
if (wallHealth <= 0){
gameOver();
trace("GAME IS OVER");
removeEventListener(Event.ENTER_FRAME, mainLoop);
CursorManager.removeCursor();
return;
};
if (gameState == GAME_STATE_SCREEN){
removeEventListener(Event.ENTER_FRAME, mainLoop);
CursorManager.removeCursor();
return;
};
weaponManager.onRender();
addChild(HUD);
HUD.wallDisp.text = String(wallHealth);
HUD.weaponMov.gotoAndStop((WeaponData.WEAPON_TYPE_ARRAY.indexOf(weaponManager.usedWeapon) + 1));
if (keyLimiter != 0){
keyLimiter--;
return;
};
if (key.isDown(80)){
if (gameState != GAME_STATE_SCREEN){
ScreenManager.getInstance().changeToScreen("pauseScreen");
gameState = GAME_STATE_SCREEN;
isPaused = true;
};
};
if (key.isDown(Keyboard.DOWN)){
weaponManager.nextWeapon();
keyLimiter = 10;
};
if (key.isDown(Keyboard.UP)){
weaponManager.prevWeapon();
keyLimiter = 10;
};
if (key.isDown(Keyboard.SPACE)){
weaponManager.zoomWeapon();
} else {
weaponManager.unZoomWeapon();
};
}
}
}//package com.assault.world
Section 35
//TShaker (com.chocorobokun.effects.TShaker)
package com.chocorobokun.effects {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class TShaker {
public static function shakeObject(_arg1:DisplayObject, _arg2:Number=10, _arg3:int=10, _arg4:Number=0, _arg5:Number=0){
var timer:Timer;
var target = _arg1;
var shakeRatio = _arg2;
var shakeDuration = _arg3;
var xStart = _arg4;
var yStart = _arg5;
timer = new Timer(10, shakeDuration);
timer.start();
timer.addEventListener(TimerEvent.TIMER, function (){
target.x = xStart;
target.y = yStart;
target.x = (target.x + (int((Math.random() * (shakeRatio * 2))) - shakeRatio));
target.y = (target.y + (int((Math.random() * (shakeRatio * 2))) - shakeRatio));
});
timer.addEventListener(TimerEvent.TIMER_COMPLETE, function (){
target.x = xStart;
target.y = yStart;
});
}
}
}//package com.chocorobokun.effects
Section 36
//CursorManager (com.chocorobokun.managers.CursorManager)
package com.chocorobokun.managers {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
public class CursorManager {
private static var _root:Stage;
private static var _xOffset:Number;
private static var _yOffset:Number;
private static var _cursor:DisplayObject;
public function CursorManager():void{
throw (new Error("no need to call constructor, use static methods CursorManager.init(), CursorManager.setCursor(),CursorManager.removeCursor(),CursorManager.destroy() "));
}
public static function destroy():void{
if (_cursor){
removeCursor();
};
}
public static function init(_arg1:Stage):void{
_root = _arg1;
}
public static function removeCursor():void{
if (!_cursor){
return;
};
_root.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
_root.removeChild(_cursor);
_cursor = null;
Mouse.show();
}
private static function onMouseMove(_arg1:MouseEvent):void{
_cursor.x = (_root.mouseX + _xOffset);
_cursor.y = (_root.mouseY + _yOffset);
_arg1.updateAfterEvent();
}
public static function bringToFront():void{
if (_cursor){
_root.addChild(_cursor);
};
}
public static function setCursor(_arg1:DisplayObject, _arg2:Number=0, _arg3:Number=0):void{
if (!_root){
throw (new Error("set root using init(pRoot)"));
};
if (_cursor){
removeCursor();
};
Mouse.hide();
_cursor = _arg1;
if ((_cursor is InteractiveObject)){
InteractiveObject(_cursor).mouseEnabled = false;
if ((_cursor is DisplayObjectContainer)){
DisplayObjectContainer(_cursor).mouseChildren = false;
};
};
_xOffset = _arg2;
_yOffset = _arg3;
_cursor.x = (_root.mouseX + _xOffset);
_cursor.y = (_root.mouseY + _yOffset);
_root.addChild(_cursor);
_root.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
}
}
}//package com.chocorobokun.managers
Section 37
//LevelManager (com.chocorobokun.managers.LevelManager)
package com.chocorobokun.managers {
import flash.display.*;
public class LevelManager {
private var bestLevel:int;// = 0
private var levelsData:Array;
private var currentLevel:int;// = 0
private var main:Sprite;
private var initiated:Boolean;// = false
private static var allowInstantiation:Boolean;
private static var instance:LevelManager;
public function LevelManager(){
initiated = false;
levelsData = [];
currentLevel = 0;
bestLevel = 0;
super();
if (!allowInstantiation){
throw (new Error("Error: use LevelManager.getInstance() instead of new"));
};
}
public function setLevel(_arg1:int){
currentLevel = _arg1;
bestLevel = _arg1;
}
public function getCurrentLevel():int{
return (currentLevel);
}
public function getLevelProp(_arg1:int){
return (levelsData[_arg1]);
}
public function setCurrentLevel(_arg1:int){
currentLevel = _arg1;
}
public function init(_arg1:Sprite, _arg2:Array){
if (!initiated){
main = _arg1;
levelsData = _arg2;
initiated = true;
};
}
public function getBestLevel():int{
return (bestLevel);
}
public function setBestLevel(_arg1:int){
bestLevel = _arg1;
}
public static function getInstance():LevelManager{
if (!instance){
allowInstantiation = true;
instance = new (LevelManager);
allowInstantiation = false;
};
return (instance);
}
}
}//package com.chocorobokun.managers
Section 38
//ScreenManager (com.chocorobokun.managers.ScreenManager)
package com.chocorobokun.managers {
import flash.display.*;
import flash.utils.*;
public class ScreenManager {
private var screenDict:Dictionary;
public var currentScreen:String;
private var screenArray:Array;
private var view:DisplayObjectContainer;
private var activeScreenArray:Array;
private var initiated:Boolean;// = false
private var main:Sprite;
private var prevScreen:String;
private static var allowInstantiation:Boolean;
private static var instance:ScreenManager;
public function ScreenManager(){
initiated = false;
activeScreenArray = [];
super();
screenDict = new Dictionary(true);
screenArray = [];
if (!allowInstantiation){
throw (new Error("Error: use ScreenManager.getInstance() instead of new"));
};
}
public function removeScreen(_arg1:String){
var _local2:Object;
var _local3:*;
_local2 = screenDict[_arg1];
view.removeChild(_local2.screen);
trace((_local2.name + " Removed!!"));
if (_arg1 == currentScreen){
for (_local3 in activeScreenArray) {
if (activeScreenArray[_local3] == currentScreen){
activeScreenArray.splice(_local3, 1);
break;
};
};
if (activeScreenArray[(activeScreenArray.length - 1)]){
currentScreen = activeScreenArray[(activeScreenArray.length - 1)];
} else {
currentScreen = null;
};
};
trace(("CURRENT SCREEN IS " + currentScreen));
}
public function init(_arg1:Sprite, _arg2:DisplayObjectContainer){
if (!initiated){
main = _arg1;
view = _arg2;
initiated = true;
};
}
public function changeToScreen(_arg1:String, _arg2:Boolean=true, _arg3:Number=0, _arg4:Number=0):void{
var _local5:Object;
var _local6:*;
if (((_arg2) && (currentScreen))){
trace("CURRENT SCREEN DETECTED");
_local5 = screenDict[currentScreen];
view.removeChild(_local5.screen);
for (_local6 in activeScreenArray) {
if (activeScreenArray[_local6] == currentScreen){
activeScreenArray.splice(_local6, 1);
break;
};
};
};
_local5 = screenDict[_arg1];
_local5.screen.x = _arg3;
_local5.screen.y = _arg4;
view.addChild(_local5.screen);
activeScreenArray.push(_arg1);
trace(("CURRENT SCREEN 1:" + currentScreen));
currentScreen = activeScreenArray[(activeScreenArray.length - 1)];
trace(("CURRENT SCREEN 2:" + currentScreen));
}
public function getScreen(_arg1:String){
return (screenDict[_arg1].screen);
}
public function addScreen(_arg1:MovieClip, _arg2:String):Boolean{
var _local3:*;
var _local4:Object;
var _local5:MovieClip;
for (_local3 in screenArray) {
if (screenArray[_local3].name == _arg2){
return (false);
};
};
_local4 = new Object();
_local5 = _arg1;
_local4.name = _arg2;
_local4.screen = _local5;
screenDict[_arg2] = _local4;
screenArray.push(_local4);
trace((_arg2 + " Stored!"));
return (true);
}
public function getCurrentScreenName():String{
return (currentScreen);
}
public static function getInstance():ScreenManager{
if (!instance){
allowInstantiation = true;
instance = new (ScreenManager);
allowInstantiation = false;
};
return (instance);
}
}
}//package com.chocorobokun.managers
Section 39
//SoundManager (com.chocorobokun.managers.SoundManager)
package com.chocorobokun.managers {
import flash.media.*;
import flash.utils.*;
import flash.net.*;
public class SoundManager {
private var _soundsDict:Dictionary;
private var _sounds:Array;
private static var _instance:SoundManager;
private static var _allowInstance:Boolean;
public function SoundManager(){
this._soundsDict = new Dictionary(true);
this._sounds = new Array();
if (!SoundManager._allowInstance){
throw (new Error("Error: Use SoundManager.getInstance() instead of the new keyword."));
};
}
public function fadeSound(_arg1:String, _arg2:Number=0, _arg3:Number=1):void{
}
public function get sounds():Array{
return (this._sounds);
}
public function getSoundDuration(_arg1:String):Number{
return (this._soundsDict[_arg1].sound.length);
}
public function setSoundVolume(_arg1:String, _arg2:Number):void{
var _local3:Object;
var _local4:SoundTransform;
_local3 = this._soundsDict[_arg1];
_local4 = _local3.channel.soundTransform;
_local4.volume = _arg2;
_local3.channel.soundTransform = _local4;
}
public function getSoundVolume(_arg1:String):Number{
return (this._soundsDict[_arg1].channel.soundTransform.volume);
}
public function addLibrarySound(_arg1, _arg2:String):Boolean{
var _local3:int;
var _local4:Object;
var _local5:Sound;
_local3 = 0;
while (_local3 < this._sounds.length) {
if (this._sounds[_local3].name == _arg2){
return (false);
};
_local3++;
};
_local4 = new Object();
_local5 = new (_arg1);
_local4.name = _arg2;
_local4.sound = _local5;
_local4.channel = new SoundChannel();
_local4.position = 0;
_local4.paused = true;
_local4.volume = 1;
_local4.startTime = 0;
_local4.loops = 0;
_local4.pausedByAll = false;
this._soundsDict[_arg2] = _local4;
this._sounds.push(_local4);
return (true);
}
public function toString():String{
return (getQualifiedClassName(this));
}
public function isSoundPaused(_arg1:String):Boolean{
return (this._soundsDict[_arg1].paused);
}
public function removeAllSounds():void{
var _local1:int;
_local1 = 0;
while (_local1 < this._sounds.length) {
this._sounds[_local1] = null;
_local1++;
};
this._sounds = new Array();
this._soundsDict = new Dictionary(true);
}
public function getSoundPosition(_arg1:String):Number{
return (this._soundsDict[_arg1].channel.position);
}
public function stopAllSounds(_arg1:Boolean=true):void{
var _local2:int;
var _local3:String;
_local2 = 0;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (!this._soundsDict[_local3].paused){
this._soundsDict[_local3].pausedByAll = true;
this.stopSound(_local3);
};
} else {
this.stopSound(_local3);
};
_local2++;
};
}
public function removeSound(_arg1:String):void{
var _local2:int;
_local2 = 0;
while (_local2 < this._sounds.length) {
if (this._sounds[_local2].name == _arg1){
this._sounds[_local2] = null;
this._sounds.splice(_local2, 1);
};
_local2++;
};
delete this._soundsDict[_arg1];
}
public function muteAllSounds():void{
var _local1:int;
var _local2:String;
_local1 = 0;
while (_local1 < this._sounds.length) {
_local2 = this._sounds[_local1].name;
this.setSoundVolume(_local2, 0);
_local1++;
};
}
public function stopSound(_arg1:String):void{
var _local2:Object;
_local2 = this._soundsDict[_arg1];
_local2.paused = true;
_local2.channel.stop();
_local2.position = _local2.channel.position;
}
public function pauseAllSounds(_arg1:Boolean=true):void{
var _local2:int;
var _local3:String;
_local2 = 0;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (!this._soundsDict[_local3].paused){
this._soundsDict[_local3].pausedByAll = true;
this.pauseSound(_local3);
};
} else {
this.pauseSound(_local3);
};
_local2++;
};
}
public function playAllSounds(_arg1:Boolean=false):void{
var _local2:int;
var _local3:String;
_local2 = 0;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (this._soundsDict[_local3].pausedByAll){
this._soundsDict[_local3].pausedByAll = false;
this.playSound(_local3);
};
} else {
this.playSound(_local3);
};
_local2++;
};
}
public function addExternalSound(_arg1:String, _arg2:String, _arg3:Number=1000, _arg4:Boolean=false):Boolean{
var _local5:int;
var _local6:Object;
var _local7:Sound;
_local5 = 0;
while (_local5 < this._sounds.length) {
if (this._sounds[_local5].name == _arg2){
return (false);
};
_local5++;
};
_local6 = new Object();
_local7 = new Sound(new URLRequest(_arg1), new SoundLoaderContext(_arg3, _arg4));
_local6.name = _arg2;
_local6.sound = _local7;
_local6.channel = new SoundChannel();
_local6.position = 0;
_local6.paused = true;
_local6.volume = 1;
_local6.startTime = 0;
_local6.loops = 0;
_local6.pausedByAll = false;
this._soundsDict[_arg2] = _local6;
this._sounds.push(_local6);
return (true);
}
public function unmuteAllSounds():void{
var _local1:int;
var _local2:String;
var _local3:Object;
var _local4:SoundTransform;
_local1 = 0;
while (_local1 < this._sounds.length) {
_local2 = this._sounds[_local1].name;
_local3 = this._soundsDict[_local2];
_local4 = _local3.channel.soundTransform;
_local4.volume = _local3.volume;
_local3.channel.soundTransform = _local4;
_local1++;
};
}
public function isSoundPausedByAll(_arg1:String):Boolean{
return (this._soundsDict[_arg1].pausedByAll);
}
public function getSoundObject(_arg1:String):Sound{
return (this._soundsDict[_arg1].sound);
}
public function pauseSound(_arg1:String):void{
var _local2:Object;
_local2 = this._soundsDict[_arg1];
_local2.paused = true;
_local2.position = _local2.channel.position;
_local2.channel.stop();
}
public function playSound(_arg1:String, _arg2:Number=1, _arg3:Number=0, _arg4:int=0):void{
var _local5:Object;
_local5 = this._soundsDict[_arg1];
_local5.volume = _arg2;
_local5.startTime = _arg3;
_local5.loops = _arg4;
if (_local5.paused){
_local5.channel = _local5.sound.play(_local5.position, _local5.loops, new SoundTransform(_local5.volume));
} else {
_local5.channel = _local5.sound.play(_arg3, _local5.loops, new SoundTransform(_local5.volume));
};
_local5.paused = false;
}
public static function getInstance():SoundManager{
if (SoundManager._instance == null){
SoundManager._allowInstance = true;
SoundManager._instance = new (SoundManager);
SoundManager._allowInstance = false;
};
return (SoundManager._instance);
}
}
}//package com.chocorobokun.managers
Section 40
//IPreloader (com.chocorobokun.preloader.IPreloader)
package com.chocorobokun.preloader {
public interface IPreloader {
function update(_arg1:int):void;
}
}//package com.chocorobokun.preloader
Section 41
//CustomTrigon (com.chocorobokun.util.CustomTrigon)
package com.chocorobokun.util {
public class CustomTrigon {
private static var cAngle:Number;
private static var distY:Number;
private static var allowInstantiation:Boolean;
private static var instance:CustomTrigon;
private static var distX:Number;
public static function getAngle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
distX = (_arg3 - _arg1);
distY = (_arg4 - _arg2);
cAngle = Math.atan2(distY, distX);
return (cAngle);
}
}
}//package com.chocorobokun.util
Section 42
//OpenURL (com.chocorobokun.util.OpenURL)
package com.chocorobokun.util {
import flash.net.*;
public class OpenURL {
public static function callURL(_arg1:String, _arg2:Function=null, _arg3:String="_blank"){
var _local4:URLRequest;
_local4 = new URLRequest(_arg1);
navigateToURL(_local4, _arg3);
if (_arg2 != null){
_arg2();
};
}
}
}//package com.chocorobokun.util
Section 43
//Circular (com.gskinner.motion.easing.Circular)
package com.gskinner.motion.easing {
public class Circular {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (Math.sqrt((1 - ((_arg1 - 1) * (_arg1 - 1)))));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (-((Math.sqrt((1 - (_arg1 * _arg1))) - 1)));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 * 2);
return (((_arg1)<1) ? (-0.5 * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) : _arg1 = (_arg1 - 2);
(0.5 * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)));
}
}
}//package com.gskinner.motion.easing
Section 44
//GTween (com.gskinner.motion.GTween)
package com.gskinner.motion {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class GTween extends EventDispatcher {
protected var _rangeValues:Object;
public var autoPlay:Boolean;// = true
protected var _delay:Number;// = 0
public var ratio:Number;
public var pluginData:Object;
public var useFrames:Boolean;
public var calculatedPosition:Number;
public var target:Object;
public var duration:Number;
protected var _position:Number;
public var calculatedPositionOld:Number;
public var ratioOld:Number;
public var onInit:Function;
public var data;
public var suppressEvents:Boolean;
public var dispatchEvents:Boolean;
public var repeatCount:int;// = 1
public var nextTween:GTween;
public var reflect:Boolean;
public var positionOld:Number;
protected var _values:Object;
protected var _inited:Boolean;
public var onComplete:Function;
protected var _paused:Boolean;// = true
public var ease:Function;
protected var _proxy:TargetProxy;
protected var _initValues:Object;
public var onChange:Function;
public var timeScale:Number;// = 1
public static var pauseAll:Boolean = false;
protected static var time:Number;
public static var defaultEase:Function = linearEase;
public static var defaultDispatchEvents:Boolean = false;
public static var version:Number = 2.01;
protected static var tickList:Dictionary = new Dictionary(true);
protected static var plugins:Object = {};
protected static var shape:Shape;
public static var timeScaleAll:Number = 1;
protected static var gcLockList:Dictionary = new Dictionary(false);
protected static var hasStarPlugins:Boolean = false;
public function GTween(_arg1:Object=null, _arg2:Number=1, _arg3:Object=null, _arg4:Object=null, _arg5:Object=null){
var _local6:Boolean;
_delay = 0;
_paused = true;
autoPlay = true;
repeatCount = 1;
timeScale = 1;
super();
ease = defaultEase;
dispatchEvents = defaultDispatchEvents;
this.target = _arg1;
this.duration = _arg2;
this.pluginData = copy(_arg5, {});
if (_arg4){
_local6 = _arg4.swapValues;
delete _arg4.swapValues;
};
copy(_arg4, this);
resetValues(_arg3);
if (_local6){
swapValues();
};
if ((((((this.duration == 0)) && ((delay == 0)))) && (autoPlay))){
position = 0;
};
}
public function get delay():Number{
return (_delay);
}
public function getValues():Object{
return (copy(_values, {}));
}
public function setValues(_arg1:Object):void{
copy(_arg1, _values, true);
invalidate();
}
public function get position():Number{
return (_position);
}
protected function dispatchEvt(_arg1:String):void{
if (hasEventListener(_arg1)){
dispatchEvent(new Event(_arg1));
};
}
public function getInitValue(_arg1:String):Number{
return (_initValues[_arg1]);
}
public function setValue(_arg1:String, _arg2:Number):void{
_values[_arg1] = _arg2;
invalidate();
}
public function init():void{
var _local1:String;
var _local2:Array;
var _local3:uint;
var _local4:Number;
var _local5:uint;
_inited = true;
_initValues = {};
_rangeValues = {};
for (_local1 in _values) {
if (plugins[_local1]){
_local2 = plugins[_local1];
_local3 = _local2.length;
_local4 = ((_local1 in target)) ? target[_local1] : NaN;
_local5 = 0;
while (_local5 < _local3) {
_local4 = _local2[_local5].init(this, _local1, _local4);
_local5++;
};
if (!isNaN(_local4)){
_rangeValues[_local1] = (_values[_local1] - (_initValues[_local1] = _local4));
};
} else {
_rangeValues[_local1] = (_values[_local1] - (_initValues[_local1] = target[_local1]));
};
};
if (hasStarPlugins){
_local2 = plugins["*"];
_local3 = _local2.length;
_local5 = 0;
while (_local5 < _local3) {
_local2[_local5].init(this, "*", NaN);
_local5++;
};
};
if (!suppressEvents){
if (dispatchEvents){
dispatchEvt("init");
};
if (onInit != null){
onInit(this);
};
};
}
public function get paused():Boolean{
return (_paused);
}
public function swapValues():void{
var _local1:Object;
var _local2:String;
var _local3:Number;
if (!_inited){
init();
};
_local1 = _values;
_values = _initValues;
_initValues = _local1;
for (_local2 in _rangeValues) {
_rangeValues[_local2] = (_rangeValues[_local2] * -1);
};
if (_position < 0){
_local3 = positionOld;
position = 0;
_position = positionOld;
positionOld = _local3;
} else {
position = _position;
};
}
public function getValue(_arg1:String):Number{
return (_values[_arg1]);
}
protected function invalidate():void{
_inited = false;
if (_position > 0){
_position = 0;
};
if (autoPlay){
paused = false;
};
}
protected function copy(_arg1:Object, _arg2:Object, _arg3:Boolean=false):Object{
var _local4:String;
for (_local4 in _arg1) {
if (((_arg3) && ((_arg1[_local4] == null)))){
delete _arg2[_local4];
} else {
_arg2[_local4] = _arg1[_local4];
};
};
return (_arg2);
}
public function set delay(_arg1:Number):void{
if (_position <= 0){
_position = -(_arg1);
};
_delay = _arg1;
}
public function set position(_arg1:Number):void{
var _local2:Number;
var _local3:Boolean;
var _local4:String;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
var _local9:uint;
var _local10:uint;
positionOld = _position;
ratioOld = ratio;
calculatedPositionOld = calculatedPosition;
_local2 = (repeatCount * duration);
_local3 = (((_arg1 >= _local2)) && ((repeatCount > 0)));
if (_local3){
if (calculatedPositionOld == _local2){
return;
};
_position = _local2;
calculatedPosition = (((reflect) && (!((repeatCount & 1))))) ? 0 : duration;
} else {
_position = _arg1;
calculatedPosition = ((_position < 0)) ? 0 : (_position % duration);
if (((reflect) && (((_position / duration) & 1)))){
calculatedPosition = (duration - calculatedPosition);
};
};
ratio = ((((duration == 0)) && ((_position >= 0)))) ? 1 : ease((calculatedPosition / duration), 0, 1, 1);
if (((((target) && ((((_position >= 0)) || ((positionOld >= 0)))))) && (!((calculatedPosition == calculatedPositionOld))))){
if (!_inited){
init();
};
for (_local4 in _values) {
_local5 = _initValues[_local4];
_local6 = _rangeValues[_local4];
_local7 = (_local5 + (_local6 * ratio));
_local8 = plugins[_local4];
if (_local8){
_local9 = _local8.length;
_local10 = 0;
while (_local10 < _local9) {
_local7 = _local8[_local10].tween(this, _local4, _local7, _local5, _local6, ratio, _local3);
_local10++;
};
if (!isNaN(_local7)){
target[_local4] = _local7;
};
} else {
target[_local4] = _local7;
};
};
};
if (hasStarPlugins){
_local8 = plugins["*"];
_local9 = _local8.length;
_local10 = 0;
while (_local10 < _local9) {
_local8[_local10].tween(this, "*", NaN, NaN, NaN, ratio, _local3);
_local10++;
};
};
if (!suppressEvents){
if (dispatchEvents){
dispatchEvt("change");
};
if (onChange != null){
onChange(this);
};
};
if (_local3){
paused = true;
if (nextTween){
nextTween.paused = false;
};
if (!suppressEvents){
if (dispatchEvents){
dispatchEvt("complete");
};
if (onComplete != null){
onComplete(this);
};
};
};
}
public function resetValues(_arg1:Object=null):void{
_values = {};
setValues(_arg1);
}
public function deleteValue(_arg1:String):Boolean{
delete _rangeValues[_arg1];
delete _initValues[_arg1];
return (delete _values[_arg1]);
}
public function beginning():void{
position = 0;
paused = true;
}
public function end():void{
position = ((repeatCount)>0) ? (repeatCount * duration) : duration;
}
public function get proxy():TargetProxy{
if (_proxy == null){
_proxy = new TargetProxy(this);
};
return (_proxy);
}
public function set paused(_arg1:Boolean):void{
if (_arg1 == _paused){
return;
};
_paused = _arg1;
if (_paused){
delete tickList[this];
if ((target is IEventDispatcher)){
target.removeEventListener("_", invalidate);
};
delete gcLockList[this];
} else {
if (((isNaN(_position)) || (((!((repeatCount == 0))) && ((_position >= (repeatCount * duration))))))){
_inited = false;
calculatedPosition = (calculatedPositionOld = (ratio = (ratioOld = (positionOld = 0))));
_position = -(delay);
};
tickList[this] = true;
if ((target is IEventDispatcher)){
target.addEventListener("_", invalidate);
} else {
gcLockList[this] = true;
};
};
}
protected static function staticTick(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Object;
var _local5:GTween;
_local2 = time;
time = (getTimer() / 1000);
if (pauseAll){
return;
};
_local3 = ((time - _local2) * timeScaleAll);
for (_local4 in tickList) {
_local5 = (_local4 as GTween);
(_local4 as GTween).position = (_local5._position + ((_local5.useFrames) ? timeScaleAll : _local3 * _local5.timeScale));
};
}
protected static function staticInit():void{
(shape = new Shape()).addEventListener(Event.ENTER_FRAME, staticTick);
time = (getTimer() / 1000);
}
public static function installPlugin(_arg1:Object, _arg2:Array, _arg3:Boolean=false):void{
var _local4:uint;
var _local5:String;
_local4 = 0;
while (_local4 < _arg2.length) {
_local5 = _arg2[_local4];
if (_local5 == "*"){
hasStarPlugins = true;
};
if (plugins[_local5] == null){
plugins[_local5] = [_arg1];
} else {
if (_arg3){
plugins[_local5].unshift(_arg1);
} else {
plugins[_local5].push(_arg1);
};
};
_local4++;
};
}
public static function linearEase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (_arg1);
}
staticInit();
}
}//package com.gskinner.motion
import flash.utils.*;
dynamic class TargetProxy extends Proxy {
private var tween:GTween;
private function TargetProxy(_arg1:GTween):void{
this.tween = _arg1;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
tween.deleteValue(_arg1);
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
var _local2:Number;
_local2 = tween.getValue(_arg1);
return ((isNaN(_local2)) ? tween.target[_arg1] : _local2);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function callProperty(_arg1, ... _args){
return (tween.target[_arg1].apply(null, _args));
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
if ((((((_arg2 is Boolean)) || ((_arg2 is String)))) || (isNaN(_arg2)))){
tween.target[_arg1] = _arg2;
} else {
tween.setValue(String(_arg1), Number(_arg2));
};
}
}
Section 45
//KeyObject (com.senocular.utils.KeyObject)
package com.senocular.utils {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.ui.*;
public dynamic class KeyObject extends Proxy {
private static var keysDown:Object;
private static var stage:Stage;
public function KeyObject(_arg1:Stage){
construct(_arg1);
}
private function keyPressed(_arg1:KeyboardEvent):void{
keysDown[_arg1.keyCode] = true;
}
public function construct(_arg1:Stage):void{
KeyObject.stage = _arg1;
keysDown = new Object();
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (((_arg1 in Keyboard)) ? Keyboard[_arg1] : -1);
}
public function isDown(_arg1:uint):Boolean{
return (Boolean((_arg1 in keysDown)));
}
private function keyReleased(_arg1:KeyboardEvent):void{
delete keysDown[_arg1.keyCode];
}
public function deconstruct():void{
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyReleased);
keysDown = new Object();
KeyObject.stage = null;
}
}
}//package com.senocular.utils
Section 46
//ObjectPool (de.polygonal.core.ObjectPool)
package de.polygonal.core {
public class ObjectPool {
private var _factory:ObjectPoolFactory;
private var _usageCount:int;
private var _initSize:int;
private var _allocNode:ObjNode;
private var _tail:ObjNode;
private var _currSize:int;
private var _emptyNode:ObjNode;
private var _grow:Boolean;// = true
private var _head:ObjNode;
public function ObjectPool(_arg1:Boolean=false){
_grow = true;
super();
_grow = _arg1;
}
public function set object(_arg1):void{
if (_usageCount > 0){
_usageCount--;
_emptyNode.data = _arg1;
_emptyNode = _emptyNode.next;
};
}
public function get object(){
var _local1:ObjNode;
var _local2:ObjNode;
var _local3:ObjNode;
var _local4:int;
var _local5:*;
if (_usageCount == _currSize){
if (_grow){
_currSize = (_currSize + _initSize);
_local1 = _tail;
_local2 = _tail;
_local4 = 0;
while (_local4 < _initSize) {
_local3 = new ObjNode();
_local3.data = _factory.create();
_local2.next = _local3;
_local2 = _local3;
_local4++;
};
_tail = _local2;
_tail.next = (_emptyNode = _head);
_allocNode = _local1.next;
return (object);
} else {
throw (new Error("object pool exhausted."));
};
} else {
_local5 = _allocNode.data;
_allocNode.data = null;
_allocNode = _allocNode.next;
_usageCount++;
};
return (_local5);
}
public function get size():int{
return (_currSize);
}
public function initialze(_arg1:String, _arg2:Array):void{
var _local3:ObjNode;
_local3 = _head;
while (_local3) {
_local3.data[_arg1].apply(_local3.data, _arg2);
if (_local3 == _tail){
break;
};
_local3 = _local3.next;
};
}
public function get wasteCount():int{
return ((_currSize - _usageCount));
}
public function setFactory(_arg1:ObjectPoolFactory):void{
_factory = _arg1;
}
public function get usageCount():int{
return (_usageCount);
}
public function deconstruct():void{
var _local1:ObjNode;
var _local2:ObjNode;
_local1 = _head;
while (_local1) {
_local2 = _local1.next;
_local1.next = null;
_local1.data = null;
_local1 = _local2;
};
_head = (_tail = (_emptyNode = (_allocNode = null)));
}
public function purge():void{
var _local1:int;
var _local2:ObjNode;
var _local3:Array;
var _local4:ObjNode;
var _local5:ObjNode;
var _local6:int;
if (_usageCount == 0){
if (_currSize == _initSize){
return;
};
if (_currSize > _initSize){
_local1 = 0;
_local2 = _head;
while (++_local1 < _initSize) {
_local2 = _local2.next;
};
_tail = _local2;
_allocNode = (_emptyNode = _head);
_currSize = _initSize;
return;
};
} else {
_local3 = [];
_local2 = _head;
while (_local2) {
if (!_local2.data){
var _temp1 = _local1;
_local1 = (_local1 + 1);
_local3[int(_temp1)] = _local2;
};
if (_local2 == _tail){
break;
};
_local2 = _local2.next;
};
_currSize = _local3.length;
_usageCount = _currSize;
_head = (_tail = _local3[0]);
_local1 = 1;
while (_local1 < _currSize) {
_local2 = _local3[_local1];
_local2.next = _head;
_head = _local2;
_local1++;
};
_emptyNode = (_allocNode = _head);
_tail.next = _head;
if (_usageCount < _initSize){
_currSize = _initSize;
_local4 = _tail;
_local5 = _tail;
_local6 = (_initSize - _usageCount);
_local1 = 0;
while (_local1 < _local6) {
_local2 = new ObjNode();
_local2.data = _factory.create();
_local5.next = _local2;
_local5 = _local2;
_local1++;
};
_tail = _local5;
_tail.next = (_emptyNode = _head);
_allocNode = _local4.next;
};
};
}
public function allocate(_arg1:uint, _arg2:Class=null):void{
var _local3:ObjNode;
var _local4:int;
deconstruct();
if (_arg2){
_factory = new SimpleFactory(_arg2);
} else {
if (!_factory){
throw (new Error("nothing to instantiate."));
};
};
_initSize = (_currSize = _arg1);
_head = (_tail = new ObjNode());
_head.data = _factory.create();
_local4 = 1;
while (_local4 < _initSize) {
_local3 = new ObjNode();
_local3.data = _factory.create();
_local3.next = _head;
_head = _local3;
_local4++;
};
_emptyNode = (_allocNode = _head);
_tail.next = _head;
}
}
}//package de.polygonal.core
class SimpleFactory implements ObjectPoolFactory {
private var _class:Class;
private function SimpleFactory(_arg1:Class){
_class = _arg1;
}
public function create(){
return (new _class());
}
}
class ObjNode {
public var next:ObjNode;
public var data;
private function ObjNode(){
}
}
Section 47
//ObjectPoolFactory (de.polygonal.core.ObjectPoolFactory)
package de.polygonal.core {
public interface ObjectPoolFactory {
function create();
}
}//package de.polygonal.core
Section 48
//_back_wheel_2w_62 (Main_fla._back_wheel_2w_62)
package Main_fla {
import flash.display.*;
public dynamic class _back_wheel_2w_62 extends MovieClip {
public var mc:MovieClip;
}
}//package Main_fla
Section 49
//_back_wheel2w_63 (Main_fla._back_wheel2w_63)
package Main_fla {
import flash.display.*;
public dynamic class _back_wheel2w_63 extends MovieClip {
public var mc_rim:MovieClip;
}
}//package Main_fla
Section 50
//_bike_body_71 (Main_fla._bike_body_71)
package Main_fla {
import flash.display.*;
public dynamic class _bike_body_71 extends MovieClip {
public var mc:MovieClip;
}
}//package Main_fla
Section 51
//_bike_bodyw_67 (Main_fla._bike_bodyw_67)
package Main_fla {
import flash.display.*;
public dynamic class _bike_bodyw_67 extends MovieClip {
public var mc_b_spring:MovieClip;
public var mc_f_spring:MovieClip;
public var mc_body_man:MovieClip;
}
}//package Main_fla
Section 52
//_bike_f_springw_68 (Main_fla._bike_f_springw_68)
package Main_fla {
import flash.display.*;
public dynamic class _bike_f_springw_68 extends MovieClip {
public var mc_spring:MovieClip;
}
}//package Main_fla
Section 53
//_forward_wheel_w_56 (Main_fla._forward_wheel_w_56)
package Main_fla {
import flash.display.*;
public dynamic class _forward_wheel_w_56 extends MovieClip {
public var mc:MovieClip;
}
}//package Main_fla
Section 54
//_forward_wheelw_57 (Main_fla._forward_wheelw_57)
package Main_fla {
import flash.display.*;
public dynamic class _forward_wheelw_57 extends MovieClip {
public var mc_rim:MovieClip;
}
}//package Main_fla
Section 55
//_man_allw_75 (Main_fla._man_allw_75)
package Main_fla {
import flash.display.*;
public dynamic class _man_allw_75 extends MovieClip {
public var b:MovieClip;
public var h:MovieClip;
public var l:MovieClip;
}
}//package Main_fla
Section 56
//AA_title_submit_86 (Main_fla.AA_title_submit_86)
package Main_fla {
import flash.display.*;
public dynamic class AA_title_submit_86 extends MovieClip {
public function AA_title_submit_86(){
addFrameScript(189, frame190);
}
function frame190(){
this.gotoAndPlay("go");
}
}
}//package Main_fla
Section 57
//AssetHolder_1 (Main_fla.AssetHolder_1)
package Main_fla {
import flash.display.*;
public dynamic class AssetHolder_1 extends MovieClip {
public function AssetHolder_1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Main_fla
Section 58
//bodyw_81 (Main_fla.bodyw_81)
package Main_fla {
import flash.display.*;
public dynamic class bodyw_81 extends MovieClip {
public var p:MovieClip;
}
}//package Main_fla
Section 59
//GunMov_3 (Main_fla.GunMov_3)
package Main_fla {
import flash.display.*;
public dynamic class GunMov_3 extends MovieClip {
public var kriegZoom:MovieClip;
public var kriegNormal:MovieClip;
public var thunderNormal:MovieClip;
public var grandNormal:MovieClip;
public var carbineZoom:MovieClip;
public var wessonNormal:MovieClip;
public var wessonZoom:MovieClip;
public var carbineNormal:MovieClip;
public var supremeNormal:MovieClip;
public var supremeZoom:MovieClip;
public var thunderZoom:MovieClip;
public var grandZoom:MovieClip;
}
}//package Main_fla
Section 60
//headw_79 (Main_fla.headw_79)
package Main_fla {
import flash.display.*;
public dynamic class headw_79 extends MovieClip {
public var p:MovieClip;
}
}//package Main_fla
Section 61
//HUD_17 (Main_fla.HUD_17)
package Main_fla {
import flash.display.*;
import flash.text.*;
public dynamic class HUD_17 extends MovieClip {
public var borderMov:MovieClip;
public var weaponMov:MovieClip;
public var cartridgeMov:MovieClip;
public var wallDisp:TextField;
}
}//package Main_fla
Section 62
//legw_82 (Main_fla.legw_82)
package Main_fla {
import flash.display.*;
public dynamic class legw_82 extends MovieClip {
public var p:MovieClip;
}
}//package Main_fla
Section 63
//Loader_46 (Main_fla.Loader_46)
package Main_fla {
import flash.display.*;
public dynamic class Loader_46 extends MovieClip {
public var loadingBar:MovieClip;
public var mcStripe:MovieClip;
public function Loader_46(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package Main_fla
Section 64
//logoaniinit_51 (Main_fla.logoaniinit_51)
package Main_fla {
import flash.display.*;
public dynamic class logoaniinit_51 extends MovieClip {
public function logoaniinit_51(){
addFrameScript(0, frame1, 193, frame194);
}
function frame1(){
}
function frame194(){
stop();
}
}
}//package Main_fla
Section 65
//SFL_116 (Main_fla.SFL_116)
package Main_fla {
import flash.display.*;
import flash.text.*;
public dynamic class SFL_116 extends MovieClip {
public var moreBut:MovieClip;
public var totalDisp:TextField;
public var headshotNumDisp:TextField;
public var healthDisp:TextField;
public var buyBut:SimpleButton;
public var accuracyDisp:TextField;
public var prevBut:SimpleButton;
public var continueBut:SimpleButton;
public var levelDisp:TextField;
public var nextBut:SimpleButton;
public var priceDisp:TextField;
public var repairBut:SimpleButton;
public var headshotDisp:TextField;
public var earningDisp:TextField;
public var weaponSelection:MovieClip;
public var more2But:SimpleButton;
public var descDisp:TextField;
public var accBonusDisp:TextField;
}
}//package Main_fla
Section 66
//ShopWeaponSelection_122 (Main_fla.ShopWeaponSelection_122)
package Main_fla {
import flash.display.*;
public dynamic class ShopWeaponSelection_122 extends MovieClip {
public var weaponBut2:MovieClip;
public var weaponBut3:MovieClip;
public var weaponBut5:MovieClip;
public var weaponBut1:MovieClip;
public var weaponBut4:MovieClip;
public var weaponBut6:MovieClip;
}
}//package Main_fla
Section 67
//title_106 (Main_fla.title_106)
package Main_fla {
import flash.display.*;
public dynamic class title_106 extends MovieClip {
public var moreBut:MovieClip;
public var highscoreBut:SimpleButton;
public var startBut:SimpleButton;
public function title_106(){
addFrameScript(116, frame117);
}
function frame117(){
this.gotoAndPlay("go");
}
}
}//package Main_fla
Section 68
//weaponBut_123 (Main_fla.weaponBut_123)
package Main_fla {
import flash.display.*;
import flash.text.*;
public dynamic class weaponBut_123 extends MovieClip {
public var hoverMov:MovieClip;
public var weaponMov:MovieClip;
public var nameDisp:TextField;
}
}//package Main_fla
Section 69
//WeaponHover_131 (Main_fla.WeaponHover_131)
package Main_fla {
import flash.display.*;
import flash.text.*;
public dynamic class WeaponHover_131 extends MovieClip {
public var nameDisp:TextField;
}
}//package Main_fla
Section 70
//WeaponMov_124 (Main_fla.WeaponMov_124)
package Main_fla {
import flash.display.*;
public dynamic class WeaponMov_124 extends MovieClip {
public var weapon1:MovieClip;
public var weapon3:MovieClip;
public var weapon4:MovieClip;
public var weapon5:MovieClip;
public var weapon6:MovieClip;
public var weapon2:MovieClip;
}
}//package Main_fla
Section 71
//WeaponMovcopy_21 (Main_fla.WeaponMovcopy_21)
package Main_fla {
import flash.display.*;
public dynamic class WeaponMovcopy_21 extends MovieClip {
public var weapon1:MovieClip;
public var weapon3:MovieClip;
public var weapon4:MovieClip;
public var weapon5:MovieClip;
public var weapon6:MovieClip;
public var weapon2:MovieClip;
}
}//package Main_fla
Section 72
//WeaponMovcopy2_34 (Main_fla.WeaponMovcopy2_34)
package Main_fla {
import flash.display.*;
public dynamic class WeaponMovcopy2_34 extends MovieClip {
public var weapon1:MovieClip;
public var weapon3:MovieClip;
public var weapon4:MovieClip;
public var weapon5:MovieClip;
public var weapon6:MovieClip;
public var weapon2:MovieClip;
}
}//package Main_fla
Section 73
//AK47Sound (AK47Sound)
package {
import flash.media.*;
public dynamic class AK47Sound extends Sound {
}
}//package
Section 74
//BulletReload (BulletReload)
package {
import flash.display.*;
public dynamic class BulletReload extends MovieClip {
}
}//package
Section 75
//ExplodeSound (ExplodeSound)
package {
import flash.media.*;
public dynamic class ExplodeSound extends Sound {
}
}//package
Section 76
//lib_bike_body (lib_bike_body)
package {
import flash.display.*;
public dynamic class lib_bike_body extends MovieClip {
public var mc:MovieClip;
}
}//package
Section 77
//M60Sound (M60Sound)
package {
import flash.media.*;
public dynamic class M60Sound extends Sound {
}
}//package
Section 78
//MainClass (MainClass)
package {
import flash.display.*;
import flash.events.*;
import com.chocorobokun.util.*;
import flash.ui.*;
import com.assault.world.*;
import com.assault.preloader.*;
public class MainClass extends MovieClip {
public const BRAND_URL:String = "http://www.flashgames247.com/?utm_source=brandedgames&utm_medium=armyassault";
public var cMenu:ContextMenu;
public var state:int;// = 0
public var isReady:Boolean;
public var siteStarted:Boolean;
public var loadingStarted:Boolean;
public var percentLoaded:int;
public var obamaPreloader:MovieClip;
public var mainStage:MainStage;
public static const STATE_SYSTEM_LOADING:int = 0;
public static const STATE_SYSTEM_LOADED:int = 1;
public function MainClass(){
var _local1:ContextMenuItem;
state = STATE_SYSTEM_LOADING;
cMenu = new ContextMenu();
super();
addFrameScript(0, frame1, 2, frame3);
this.contextMenu = cMenu;
cMenu.hideBuiltInItems();
_local1 = new ContextMenuItem("FlashGames247.com");
_local1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onCMenu);
cMenu.customItems.push(_local1);
addEventListener(Event.ENTER_FRAME, mainLoop);
}
public function finishPreload(){
trace("FINISH PRELOAD");
this.play();
state = STATE_SYSTEM_LOADED;
}
public function initGame(){
trace("INIT GAME");
mainStage = new MainStage();
addChild(mainStage);
siteStarted = true;
}
public function loaded(){
if (((!(siteStarted)) && ((currentFrame == 3)))){
gameReady();
siteStarted = true;
};
}
public function onLoading(){
trace("ONLOADING");
trace(((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100));
if (!loadingStarted){
if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){
finishPreload();
} else {
loaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoadingProgress);
loaderInfo.addEventListener(Event.COMPLETE, onLoadingComplete);
obamaPreloader = new AssaultPreloader(finishPreload);
addChild(obamaPreloader);
loadingStarted = true;
if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){
trace("LOADING COMPLETE");
obamaPreloader.update(100);
};
};
};
}
function frame3(){
stop();
}
function frame1(){
stop();
}
public function onLoadingProgress(_arg1:Event){
percentLoaded = ((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100);
obamaPreloader.update(percentLoaded);
}
public function onLoadingComplete(_arg1:Event){
this.loaderInfo.removeEventListener(Event.INIT, onLoadingComplete);
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, onLoadingProgress);
finishPreload();
}
private function onCMenu(_arg1:Event){
OpenURL.callURL(BRAND_URL);
}
public function gameReady(){
trace("GAME READY");
obamaPreloader = new AssaultPreloader(initGame, true);
addChild(obamaPreloader);
}
public function mainLoop(_arg1:Event){
switch (state){
case STATE_SYSTEM_LOADING:
onLoading();
break;
case STATE_SYSTEM_LOADED:
loaded();
break;
};
}
}
}//package
Section 79
//MainSound (MainSound)
package {
import flash.media.*;
public dynamic class MainSound extends Sound {
}
}//package
Section 80
//PlaySound (PlaySound)
package {
import flash.media.*;
public dynamic class PlaySound extends Sound {
}
}//package
Section 81
//RocketSound (RocketSound)
package {
import flash.media.*;
public dynamic class RocketSound extends Sound {
}
}//package
Section 82
//ShotSound1 (ShotSound1)
package {
import flash.media.*;
public dynamic class ShotSound1 extends Sound {
}
}//package