Section 1
//BackgroungLayer0_43 (defense2_fla.BackgroungLayer0_43)
package defense2_fla {
import flash.display.*;
public dynamic class BackgroungLayer0_43 extends MovieClip {
public var man:MovieClip;
}
}//package defense2_fla
Section 2
//HealthBar_7 (defense2_fla.HealthBar_7)
package defense2_fla {
import flash.display.*;
public dynamic class HealthBar_7 extends MovieClip {
public var filler:MovieClip;
}
}//package defense2_fla
Section 3
//HUDCommon_61 (defense2_fla.HUDCommon_61)
package defense2_fla {
import flash.events.*;
import game.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public dynamic class HUDCommon_61 extends MovieClip {
public var moneyCaption:TextField;
public var overheatText:MovieClip;
public var coolbuddy:SimpleButton;
public var minigunAmmo:MovieClip;
public var ammoType:MovieClip;
public var buy:SimpleButton;
public var score:TextField;
public var trapButtons:MovieClip;
public var overheatBar:MovieClip;
public var buttonMenu:SimpleButton;
public var weaponIcon:WeaponIcon;
public var monstersKilled:TextField;
public var weaponButtons:WeaponButtons;
public var ammo:TextField;
public var money:TextField;
public var wave:TextField;
public function HUDCommon_61(){
addFrameScript(0, frame1);
}
public function onCoolbuddy(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.coolbuddy.com/?cid=174"), "_blank");
}
function frame1(){
coolbuddy.addEventListener(MouseEvent.CLICK, onCoolbuddy);
}
}
}//package defense2_fla
Section 4
//HumanLegs_5 (defense2_fla.HumanLegs_5)
package defense2_fla {
import flash.display.*;
public dynamic class HumanLegs_5 extends MovieClip {
public function HumanLegs_5(){
addFrameScript(12, frame13, 25, frame26, 39, frame40, 52, frame53, 65, frame66, 78, frame79);
}
function frame79(){
gotoAndPlay("right-rev");
}
function frame13(){
gotoAndPlay("up-right");
}
function frame40(){
gotoAndPlay("up");
}
function frame26(){
gotoAndPlay("up-right-rev");
}
function frame53(){
gotoAndPlay("up-rev");
}
function frame66(){
gotoAndPlay("left");
}
}
}//package defense2_fla
Section 5
//IngameMenuButtons_101 (defense2_fla.IngameMenuButtons_101)
package defense2_fla {
import flash.display.*;
public dynamic class IngameMenuButtons_101 extends MovieClip {
public var pannel3:BNo;
public var pannel0:BMoreGames;
public var pannel2:BYes;
public var pannel1:QuitDialog;
}
}//package defense2_fla
Section 6
//Man_44 (defense2_fla.Man_44)
package defense2_fla {
import flash.display.*;
public dynamic class Man_44 extends MovieClip {
public function Man_44(){
addFrameScript(15, frame16, 31, frame32);
}
function frame16(){
stop();
}
function frame32(){
stop();
}
}
}//package defense2_fla
Section 7
//MapIcon_131 (defense2_fla.MapIcon_131)
package defense2_fla {
import flash.display.*;
public dynamic class MapIcon_131 extends MovieClip {
public function MapIcon_131(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package defense2_fla
Section 8
//MinigunAmmo_70 (defense2_fla.MinigunAmmo_70)
package defense2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class MinigunAmmo_70 extends MovieClip {
public var caption:TextField;
}
}//package defense2_fla
Section 9
//OverheatBar_74 (defense2_fla.OverheatBar_74)
package defense2_fla {
import flash.display.*;
public dynamic class OverheatBar_74 extends MovieClip {
public var maskClip:MovieClip;
}
}//package defense2_fla
Section 10
//PasswordDialog_134 (defense2_fla.PasswordDialog_134)
package defense2_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public dynamic class PasswordDialog_134 extends MovieClip {
public var ok:SimpleButton;
public var buttonGetPassword:SimpleButton;
public var password:TextField;
public var invalidCaption:TextField;
public var close:SimpleButton;
public function PasswordDialog_134(){
addFrameScript(0, frame1);
}
function frame1(){
invalidCaption.visible = false;
close.addEventListener(MouseEvent.CLICK, onCloseClick);
buttonGetPassword.addEventListener(MouseEvent.CLICK, onGetPasswordClick);
}
public function onCloseClick(_arg1:MouseEvent){
visible = false;
}
public function onGetPasswordClick(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.coolbuddy.com/games/game.asp?gid=830"), "_blank");
}
}
}//package defense2_fla
Section 11
//SearchBar_117 (defense2_fla.SearchBar_117)
package defense2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class SearchBar_117 extends MovieClip {
public var barMask:MovieClip;
public var caption:TextField;
}
}//package defense2_fla
Section 12
//SoundClip_16 (defense2_fla.SoundClip_16)
package defense2_fla {
import flash.display.*;
public dynamic class SoundClip_16 extends MovieClip {
public function SoundClip_16(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package defense2_fla
Section 13
//ToggleSound_45 (defense2_fla.ToggleSound_45)
package defense2_fla {
import flash.display.*;
public dynamic class ToggleSound_45 extends MovieClip {
public var soundOn:ToggleSoundOn;
public var soundOff:ToggleSoundOff;
}
}//package defense2_fla
Section 14
//TrapButtons_62 (defense2_fla.TrapButtons_62)
package defense2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class TrapButtons_62 extends MovieClip {
public var buttonTesla:SimpleButton;
public var buttonAirstrike:SimpleButton;
public var buttonFireTrap:SimpleButton;
public var grenades:TextField;
}
}//package defense2_fla
Section 15
//Airstrike (game.Airstrike)
package game {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
public class Airstrike {
private var bombTimer:Timer;// = null
var isActive:Boolean;// = false
private var isBombReady:Boolean;// = true
var isReady:Boolean;// = true
private var isSoundComplete:Boolean;// = false
private var totalBombs:uint;// = 15
private var jetSound:Sound;
var isEnabled:Boolean;// = false
private var reloadTimer:Timer;// = null
public function Airstrike(){
reloadTimer = null;
bombTimer = null;
jetSound = new SoundJet();
isBombReady = true;
isSoundComplete = false;
totalBombs = 15;
isEnabled = false;
isActive = false;
isReady = true;
super();
reloadTimer = new Timer(Config.instance.k_AirstrikeDelay);
reloadTimer.addEventListener(TimerEvent.TIMER, onReloadTimer);
bombTimer = new Timer(100);
bombTimer.addEventListener(TimerEvent.TIMER, onBombTimer);
}
public function update(_arg1:GameScreen){
if (((((((!(isEnabled)) || (!(isReady)))) || (!(isActive)))) || (!(isSoundComplete)))){
return;
};
if (isBombReady){
_arg1.spawnGrenade(((700 / 2) + Common.random(-125, 125)), ((525 / 2) + Common.random(-125, 125)));
isBombReady = false;
bombTimer.start();
totalBombs--;
};
if (totalBombs == 0){
isReady = false;
isActive = false;
reloadTimer.start();
};
}
private function onReloadTimer(_arg1:TimerEvent){
isReady = true;
totalBombs = 15;
reloadTimer.stop();
}
private function onJetSoundComplete(_arg1:Event){
isSoundComplete = true;
}
public function start(){
var _local1:SoundChannel;
_local1 = jetSound.play();
_local1.addEventListener(Event.SOUND_COMPLETE, onJetSoundComplete);
isActive = true;
isSoundComplete = false;
}
private function onBombTimer(_arg1:TimerEvent){
isBombReady = true;
bombTimer.stop();
}
}
}//package game
Section 16
//Assist (game.Assist)
package game {
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
public class Assist extends Human {
private var aimTimer:Timer;// = null
private var burst:int;// = 0
private var isAiming:Boolean;// = false
var target:Monster;// = null
var isEnabled:Boolean;// = false
public function Assist(){
target = null;
isEnabled = false;
isAiming = false;
burst = 0;
aimTimer = null;
super();
}
override public function hit(_arg1:Number){
var _local2:Sound;
health = (health - _arg1);
if (health <= 0){
Game.gameScreen.spawnEffect(Resources.sheet_BloodBlast, x, y);
dispatchEvent(new Event(KILLED));
visible = false;
isEnabled = false;
_local2 = new SoundHumanDie();
_local2.play();
};
}
override public function initialize(){
super.initialize();
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
aimTimer = new Timer(2000);
aimTimer.addEventListener(TimerEvent.TIMER, onAimTimerHandler);
}
private function onAimTimerHandler(_arg1:TimerEvent){
burst = Math.floor(Common.random(5, 12));
isAiming = false;
aimTimer.stop();
}
private function chooseTarget(){
var _local1:Number;
_local1 = Game.gameScreen.monsters.length;
target = Game.gameScreen.monsters[Math.floor((Math.random() * _local1))];
if (target != null){
target.attackers.push(this);
};
}
private function onEnterFrameHandler(_arg1:Event){
var _local2:Point;
visible = isEnabled;
if ((((((((weapon == null)) || ((rifle == null)))) || (!(isEnabled)))) || (!(gameScreen.isActive)))){
return;
};
if (Game.gameScreen.isPaused){
weapon.lastShotTime = 0;
return;
};
if (healthBar){
healthBar.filler.scaleX = (health / 100);
};
if (target == null){
chooseTarget();
};
weapon.isShooting = ((!((target == null))) && (!(isAiming)));
weapon.update();
legs.gotoAndStop("idle");
if (weapon.ammo != 0){
gunfire.visible = true;
gunfire.gotoAndStop(index);
index++;
if (index > 2){
index = 1;
};
} else {
gunfire.visible = false;
};
if ((((target == null)) || (isAiming))){
gunfire.visible = false;
};
if ((((burst <= 0)) && (!(isAiming)))){
isAiming = true;
aimTimer.delay = Common.random(1500, 4500);
aimTimer.start();
};
if (target){
aimTo((target.x + (target.width / 2)), (target.y + (target.height / 2)));
if (((!(isAiming)) && ((burst > 0)))){
_local2 = getBarrelEnd();
burst = (burst - weapon.fire(_local2.x, _local2.y, (target.x + (target.width / 2)), (target.y + (target.height / 2)), false));
};
};
}
}
}//package game
Section 17
//CollisionGrid (game.CollisionGrid)
package game {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
public class CollisionGrid {
var sectors:Array;
private var cellsPerRow:uint;// = 0
var debug_Bitmap:BitmapData;
static const k_CellSize:int = 100;
public function CollisionGrid(){
cellsPerRow = 0;
sectors = new Array();
debug_Bitmap = new BitmapData(700, 525, true, 0);
super();
}
public function getSector(_arg1:int):Array{
return (sectors[_arg1]);
}
public function renderBitmap(_arg1:BitmapData){
var _local2:TextField;
var _local3:Matrix;
var _local4:int;
var _local5:int;
var _local6:int;
_local2 = new TextField();
_local3 = new Matrix();
_local2.textColor = 4294967295;
_local4 = 0;
while (_local4 < Math.floor((700 / k_CellSize))) {
_arg1.fillRect(new Rectangle((_local4 * k_CellSize), 0, 1, 525), 4294967295);
_local4++;
};
_local4 = 0;
while (_local4 < Math.floor((525 / k_CellSize))) {
_arg1.fillRect(new Rectangle(0, (_local4 * k_CellSize), 700, 1), 4294967295);
_local4++;
};
_local5 = Math.floor((700 / k_CellSize));
_local4 = 0;
while (_local4 < Math.floor((700 / k_CellSize))) {
_local6 = 0;
while (_local6 < Math.floor((525 / k_CellSize))) {
_local3.identity();
_local3.translate((_local4 * k_CellSize), (_local6 * k_CellSize));
_local2.text = ("" + ((_local6 * _local5) + _local4));
_arg1.draw(_local2, _local3);
_local6++;
};
_local4++;
};
}
public function addSector(_arg1:int){
sectors[_arg1] = new List();
}
public function render(_arg1:BitmapData){
_arg1.draw(debug_Bitmap);
}
public function create(_arg1:int){
sectors.length = _arg1;
renderBitmap(debug_Bitmap);
cellsPerRow = Math.floor((Game.width / k_CellSize));
}
public function getSectorIndex(_arg1:Number, _arg2:Number):uint{
return (((Math.floor((_arg2 / k_CellSize)) * cellsPerRow) + Math.floor((_arg1 / k_CellSize))));
}
}
}//package game
Section 18
//Common (game.Common)
package game {
public class Common {
public static function clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return (Math.max(Math.min(_arg1, _arg3), _arg2));
}
static function deg2Rad(_arg1:Number):Number{
return (((_arg1 / 180) * Math.PI));
}
public static function random(_arg1:Number, _arg2:Number):Number{
return (((Math.random() * (_arg2 - _arg1)) + _arg1));
}
static function rad2Dad(_arg1:Number):Number{
return (((_arg1 * 180) / Math.PI));
}
public static function bit(_arg1:Number):Number{
return ((1 << _arg1));
}
}
}//package game
Section 19
//Config (game.Config)
package game {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class Config {
public var k_GrenadeRange:Number;// = 250
public var k_SUpgradeCost:Number;// = 300
public var k_SFlamethrowerCost:Number;// = 6000
public var k_Mob1Cost:Number;// = 75
public var k_StRadioCost:Number;// = 6
public var k_Mob3Cost:Number;// = 100
public var k_ScorpCost:Number;// = 25
public var k_Jackhammer_clipSize:Number;// = 8
public var k_AK74_deviation:Number;// = 200
public var k_ScorpSpeed:Number;// = 1.6
public var k_StFlameTrapCost:Number;// = 6
public var k_TeslaDelay:Number;// = 60000
public var k_GolemCost:Number;// = 50
public var k_SStartGrenades:Number;// = 5
public var k_SAirstrikeCost:Number;// = 3000
public var k_Laser_overheatRate:Number;// = 2
public var k_Minigun_overheatRate:Number;// = 1
public var k_StTeslaCost:Number;// = 8
public var k_Jackhammer_reloadTime:Number;// = 2000
public var k_SGrenadeCost:Number;// = 150
public var k_Rifle_damage:Number;// = 12
public var k_FireTrapFuel:Number;// = 75
public var k_Rifle_reloadTime:Number;// = 400
public var k_AK74_damage:Number;// = 12
public var k_AK74_clipSize:Number;// = 30
public var k_Minigun_deviation:Number;// = 500
public var k_Minigun_damage:Number;// = 20
public var k_SUpgradeAssistCost:Number;// = 2000
public var k_SStartMoney:Number;// = 2000
public var k_Mob1Health:Number;// = 185
public var k_StSearchCost:Number;// = 4
public var k_SRifleAmmoCost:Number;// = 5
public var k_SLaserAmmoCost:Number;// = 120
public var k_GrenadeDamage:Number;// = 225
public var k_ScorpHealth:Number;// = 185
public var k_SAK74AmmoCost:Number;// = 50
public var k_SAK74Cost:Number;// = 2000
public var k_Mob1Damage:Number;// = 10
public var k_SLaserCost:Number;// = 8000
public var k_Rifle_clipSize:Number;// = 5
public var k_STeslaTowerCost:Number;// = 4500
public var k_ScorpDamage:Number;// = 5
public var k_SWaveHPIncrease:Number;// = 50
public var k_AK74_rateOfFire:Number;// = 10
public var k_StStartGrenades:Number;// = 2
public var k_Jackhammer_damage:Number;// = 10
public var k_Minigun_rateOfFire:Number;// = 25
public var k_SStartAmmo:Number;// = 350
public var k_Jackhammer_deviation:Number;// = 300
public var k_SGunnerCost:Number;// = 3500
public var k_StRepairCost:Number;// = 2
public var k_Mob1Speed:Number;// = 1
public var k_STeslaAmmoCost:Number;// = 220
public var k_GolemHealth:Number;// = 450
public var k_SFlameTrapCost:Number;// = 3500
public var k_SAssistCost:Number;// = 3000
public var k_Flame_overheatRate:Number;// = 2
public var k_STeslaCost:Number;// = 10000
public var k_GolemDamage:Number;// = 30
public var k_FireTrapDelay:Number;// = 40000
public var k_SFlameAmmoCost:Number;// = 100
public var k_Jackhammer_rateOfFire:Number;// = 4
public var k_SBaseWaveHP:Number;// = 550
public var k_SRepairCost:Number;// = 250
public var k_Minigun_clipSize:Number;// = 500
public var k_Rifle_deviation:Number;// = 30
public var k_Mob3Speed:Number;// = 1.2
public var k_AirstrikeDelay:Number;// = 80000
public var k_Mob3Health:Number;// = 150
public var k_SMinigunAmmoCost:Number;// = 200
public var k_AK74_reloadTime:Number;// = 1500
public var k_SJackCost:Number;// = 2500
public var k_GolemSpeed:Number;// = 0.5
public var k_SJackAmmoCost:Number;// = 20
public var k_StUpgradeCost:Number;// = 4
public var k_Mob3Damage:Number;// = 15
public var k_Minigun_reloadTime:Number;// = 7000
public var k_StStartAmmo:Number;// = 350
public var k_SMinigunCost:Number;// = 6000
public var k_Rifle_rateOfFire:Number;// = 4
static var instance:Config = null;
public function Config(){
k_Minigun_clipSize = 500;
k_Jackhammer_deviation = 300;
k_Mob3Health = 150;
k_StRepairCost = 2;
k_AK74_reloadTime = 1500;
k_SRepairCost = 250;
k_GrenadeDamage = 225;
k_GolemSpeed = 0.5;
k_SJackCost = 2500;
k_ScorpCost = 25;
k_TeslaDelay = 60000;
k_AirstrikeDelay = 80000;
k_Jackhammer_rateOfFire = 4;
k_Mob3Cost = 100;
k_SMinigunCost = 6000;
k_StTeslaCost = 8;
k_StRadioCost = 6;
k_SLaserAmmoCost = 120;
k_SStartGrenades = 5;
k_Jackhammer_reloadTime = 2000;
k_Laser_overheatRate = 2;
k_Minigun_deviation = 500;
k_STeslaTowerCost = 4500;
k_Mob1Damage = 10;
k_AK74_clipSize = 30;
k_Minigun_damage = 20;
k_Rifle_clipSize = 5;
k_GolemCost = 50;
k_Minigun_overheatRate = 1;
k_Mob3Speed = 1.2;
k_AK74_rateOfFire = 10;
k_SWaveHPIncrease = 50;
k_Minigun_reloadTime = 7000;
k_Rifle_reloadTime = 400;
k_Mob1Cost = 75;
k_GolemDamage = 30;
k_SGunnerCost = 3500;
k_AK74_damage = 12;
k_SJackAmmoCost = 20;
k_SAirstrikeCost = 3000;
k_GolemHealth = 450;
k_Rifle_rateOfFire = 4;
k_ScorpHealth = 185;
k_SFlamethrowerCost = 6000;
k_STeslaAmmoCost = 220;
k_STeslaCost = 10000;
k_SUpgradeCost = 300;
k_Mob3Damage = 15;
k_StFlameTrapCost = 6;
k_FireTrapFuel = 75;
k_SGrenadeCost = 150;
k_SRifleAmmoCost = 5;
k_SFlameTrapCost = 3500;
k_SStartAmmo = 350;
k_Mob1Health = 185;
k_ScorpSpeed = 1.6;
k_StUpgradeCost = 4;
k_SFlameAmmoCost = 100;
k_Flame_overheatRate = 2;
k_StSearchCost = 4;
k_SMinigunAmmoCost = 200;
k_StStartGrenades = 2;
k_AK74_deviation = 200;
k_FireTrapDelay = 40000;
k_Jackhammer_clipSize = 8;
k_SAK74AmmoCost = 50;
k_Jackhammer_damage = 10;
k_GrenadeRange = 250;
k_StStartAmmo = 350;
k_Rifle_damage = 12;
k_ScorpDamage = 5;
k_SAK74Cost = 2000;
k_Minigun_rateOfFire = 25;
k_SBaseWaveHP = 550;
k_Rifle_deviation = 30;
k_SStartMoney = 2000;
k_SLaserCost = 8000;
k_SAssistCost = 3000;
k_SUpgradeAssistCost = 2000;
k_Mob1Speed = 1;
super();
instance = this;
}
public function writeConfig():String{
var _local1:String;
var _local2:XML;
var _local3:int;
var _local4:String;
_local1 = "";
_local2 = describeType(this);
_local3 = 0;
_local1 = (_local1 + "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
_local1 = (_local1 + "<config>\n");
while (_local2.variable[_local3] != undefined) {
_local4 = _local2.variable[_local3].@name;
_local1 = (_local1 + (((("\t<property name=\"" + _local4) + "\" value=\"") + this[_local4]) + "\" />\n"));
_local3++;
};
_local1 = (_local1 + "</config>\n");
return (_local1);
}
private function onConfigLoaded(_arg1:Event){
var _local2:URLLoader;
var _local3:XML;
var _local4:*;
_local2 = URLLoader(_arg1.target);
_local3 = new XML(_local2.data);
_local4 = 0;
while (_local3.property[_local4] != undefined) {
this[_local3.property[_local4].@name] = _local3.property[_local4].@value;
_local4++;
};
Game.instance.initialize();
}
private function onError(_arg1:IOErrorEvent){
Game.instance.initialize();
}
public function writeConfigCode():String{
var _local1:String;
var _local2:XML;
var _local3:int;
var _local4:String;
_local1 = "";
_local2 = describeType(this);
_local3 = 0;
while (_local2.variable[_local3] != undefined) {
_local4 = _local2.variable[_local3].@name;
_local1 = (_local1 + (((("\tpublic var " + _local4) + " : Number = ") + this[_local4]) + ";\n"));
_local3++;
};
return (_local1);
}
public function loadConfig(){
Game.instance.initialize();
}
}
}//package game
Section 20
//DecalLayer (game.DecalLayer)
package game {
import flash.display.*;
import flash.geom.*;
public class DecalLayer extends MovieClip {
var bitmap:Bitmap;// = null
var bitmapData:BitmapData;// = null
var tr:Matrix;
public function DecalLayer(){
bitmap = null;
bitmapData = null;
tr = new Matrix();
super();
}
public function create(_arg1:Number, _arg2:Number){
bitmapData = new BitmapData(_arg1, _arg2, true, 0);
bitmap = new Bitmap(bitmapData);
addChild(bitmap);
}
public function insertBitmap(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number=1, _arg5:Number=1, _arg6:Number=0){
var _local7:Matrix;
var _local8:Number;
var _local9:Number;
_local7 = new Matrix();
_local8 = ((_arg1.rect.width * 0.5) * _arg5);
_local9 = ((_arg1.rect.height * 0.5) * _arg5);
_local7.scale(_arg5, _arg5);
_local7.translate(-(_local8), -(_local9));
_local7.rotate(Common.deg2Rad(_arg6));
_local7.translate(_arg2, _arg3);
bitmapData.draw(_arg1, _local7, new ColorTransform(1, 1, 1, _arg4));
}
public function insert(_arg1:MovieClip){
tr.identity();
tr.rotate(_arg1.rotation);
tr.scale(_arg1.scaleX, _arg1.scaleY);
tr.translate(_arg1.x, _arg1.y);
bitmapData.draw(_arg1, tr, new ColorTransform(1, 1, 1, _arg1.alpha));
}
}
}//package game
Section 21
//Effect (game.Effect)
package game {
import flash.display.*;
public class Effect extends GameObject {
protected var _spawnDecal:Boolean;// = false
protected var light:ListNode;// = null
protected var _spriteSheet:SpriteSheet;// = null
public function Effect(){
_spriteSheet = null;
_spawnDecal = false;
light = null;
super();
}
override public function spawn(_arg1:Number, _arg2:Number){
super.spawn((_arg1 - (width * 0.5)), (_arg2 - height));
node = Game.gameScreen.effects.insert(this);
Game.gameScreen.effects = Game.gameScreen.effects.sort(GameObject.compare);
}
public function get spriteSheet():SpriteSheet{
return (_spriteSheet);
}
public function get spawnDecal():Boolean{
return (_spawnDecal);
}
public function set spriteSheet(_arg1:SpriteSheet){
_spriteSheet = _arg1;
animation = _spriteSheet;
width = _spriteSheet.frameWidth;
height = _spriteSheet.frameHeight;
}
override protected function onAnimationEnd(){
if (((!((light == null))) && (!((light.data == null))))){
light.list.remove(light);
light = null;
};
if (_spawnDecal){
_spriteSheet.render(Game.gameScreen.decalLayer.bitmapData, x, y, (frame - 1));
};
release();
}
override public function update(){
super.update();
if (((!((light == null))) && (!((light.data == null))))){
light.data.alpha = (light.data.alpha + Common.random(-0.2, 0.2));
};
}
public function setLight(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number){
light = Game.gameScreen.lights.insert({x:_arg2, y:_arg3, bitmap:_arg1, scale:_arg4, alpha:1});
}
public function set spawnDecal(_arg1:Boolean){
_spawnDecal = _arg1;
}
}
}//package game
Section 22
//Explosion (game.Explosion)
package game {
import flash.media.*;
public class Explosion extends Effect {
private var grid:CollisionGrid;// = null
public function Explosion(){
grid = null;
super();
spriteSheet = Resources.sheet_Explosion;
grid = Game.gameScreen.grid;
frameRate = 15;
width = 150;
height = 160;
}
override public function release(){
super.release();
}
private function hitObjects(){
var _local1:uint;
var _local2:Number;
var _local3:uint;
var _local4:Monster;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local1 = Game.gameScreen.monsters.length;
_local2 = Config.instance.k_GrenadeRange;
_local3 = 0;
while (_local3 < _local1) {
_local4 = Game.gameScreen.monsters[_local3];
if (_local4 == null){
} else {
_local5 = (_local4.x - (x + (_local4.width * 0.5)));
_local6 = (_local4.y - (y + (_local4.height * 0.5)));
_local7 = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
_local4.hit((Config.instance.k_GrenadeDamage * Common.clamp((1 - (_local7 / _local2)), 0, 1)), true);
};
_local3++;
};
}
override public function spawn(_arg1:Number, _arg2:Number){
var _local3:Sound;
super.spawn(_arg1, _arg2);
Game.gameScreen.decalLayer.insertBitmap(Resources.bitmap_ExplosionHit, _arg1, _arg2, 0.55);
light = Game.gameScreen.lights.insert({x:_arg1, y:_arg2, bitmap:Resources.bitmap_LightExplosion, scale:0.5, alpha:1});
_local3 = new SoundExplosion();
_local3.play();
}
override public function update(){
var _local1:Number;
if (frame == 0){
hitObjects();
};
if (light.data){
_local1 = ((frame / spriteSheet.frameCount) * 50);
light.data.scale = (0.5 + (1.5 * Common.clamp(_local1, 0, 1)));
if (_local1 >= 25){
light.data.alpha = (light.data.alpha - 0.25);
};
light.data.alpha = (light.data.alpha + Common.random(-0.2, 0.2));
};
super.update();
}
}
}//package game
Section 23
//FadeToBlack (game.FadeToBlack)
package game {
import flash.events.*;
import flash.display.*;
public class FadeToBlack extends MovieClip {
private var speed:Number;// = 0.1
public var filler:MovieClip;
static const FADED:String = "Faded";
public function FadeToBlack(){
speed = 0.1;
super();
filler.alpha = 0;
visible = false;
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
}
public function fade(_arg1:Number){
visible = true;
speed = _arg1;
}
private function onEnterFrameHandler(_arg1:Event){
if (!visible){
return;
};
filler.alpha = (filler.alpha + speed);
if (filler.alpha >= 1){
dispatchEvent(new Event(FADED));
visible = false;
filler.alpha = 0;
};
}
}
}//package game
Section 24
//FireTrap (game.FireTrap)
package game {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class FireTrap extends MovieClip {
private var reloadTimer:Timer;// = null
public var dot:MovieClip;
private var flamethrower:Flamethrower;
var isReloaded:Boolean;// = true
var isEnabled:Boolean;// = false
var fuel:Number;// = 0
var isActive:Boolean;// = false
public function FireTrap(){
flamethrower = new Flamethrower();
reloadTimer = null;
fuel = 0;
isEnabled = false;
isReloaded = true;
isActive = false;
super();
if (!Config.instance){
return;
};
flamethrower.deviation = 750;
flamethrower.isInfAmmo = true;
reloadTimer = new Timer(Config.instance.k_FireTrapDelay);
reloadTimer.addEventListener(TimerEvent.TIMER, onReloadTimer);
}
public function render(_arg1:BitmapData){
if (!isEnabled){
return;
};
flamethrower.render(_arg1);
}
public function update(){
var _local1:Point;
var _local2:Number;
var _local3:Number;
if (!isEnabled){
return;
};
_local1 = localToGlobal(new Point(dot.x, dot.y));
if (currentFrame == 1){
_local2 = (_local1.x + 1000);
_local3 = _local1.y;
} else {
if (currentFrame == 2){
_local2 = _local1.x;
_local3 = (_local1.y - 1000);
};
};
flamethrower.isShooting = (fuel > 0);
flamethrower.update();
if ((((fuel > 0)) && (isReloaded))){
isActive = true;
flamethrower.fire(_local1.x, _local1.y, _local2, _local3, true);
fuel--;
if (fuel <= 0){
isReloaded = false;
isActive = false;
reloadTimer.start();
};
};
}
private function onReloadTimer(_arg1:TimerEvent){
isReloaded = true;
reloadTimer.stop();
}
}
}//package game
Section 25
//Flamethrower (game.Flamethrower)
package game {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
public class Flamethrower extends Weapon {
private var sound:Sound;
private var soundCh:SoundChannel;// = null
private var light:ListNode;// = null
private var particles:List;
static var sheet_Particle:SpriteSheet = new SpriteSheet(new BitmapFireParticle(0, 0), 16, 4, 100, 100);
public function Flamethrower(){
particles = new List();
light = null;
sound = new SoundFlame();
soundCh = null;
super();
}
private function hit(_arg1:CollisionGrid, _arg2:Point){
var _local3:uint;
var _local4:ListNode;
var _local5:ListNode;
_local3 = _arg1.getSectorIndex(_arg2.x, _arg2.y);
if (_arg1.sectors[_local3]){
_local4 = _arg1.sectors[_local3].end;
_local5 = _arg1.sectors[_local3].begin;
while (_local5 != _local4) {
if ((((_local5.data == null)) || (_local5.data.isDead))){
} else {
Tracer.k_MonstersChecked++;
if (_local5.data.rect.containsPoint(_arg2)){
_local5.data.hit(((Math.random() * 0.5) + 0.5), false);
if (_local5.data.flame.animation == null){
_local5.data.flame.animation = Resources.sheet_FlameMonster2;
};
return;
};
};
_local5 = _local5.next;
};
};
}
override public function render(_arg1:BitmapData){
var _local2:ListNode;
var _local3:ListNode;
_local2 = particles.end;
_local3 = particles.begin;
while (_local3 != _local2) {
sheet_Particle.render(_arg1, (_local3.data.pos.x - 50), (_local3.data.pos.y - 100), _local3.data.frame);
_local3 = _local3.next;
};
}
private function spawnParticle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
var _local5:FireParticle;
_local5 = new FireParticle();
_local5.pos.x = _arg1;
_local5.pos.y = _arg2;
_local5.dx = (_arg3 * 12);
_local5.dy = (_arg4 * 12);
_local5.initialX = _arg1;
_local5.initialY = _arg2;
_local5.life = Common.random(0.5, 1);
particles.insert(_local5);
}
override public function fire(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean):uint{
var _local6:GameScreen;
var _local7:Vector;
var _local8:Number;
var _local9:Number;
var _local10:*;
var _local11:Sound;
_local6 = Game.gameScreen;
if ((((((_local6.getAmmo(Weapon.Flame) <= 0)) && (!(_isInfAmmo)))) || ((overheat >= 100)))){
return (0);
};
if (light == null){
light = Game.gameScreen.lights.insert({x:_arg1, y:_arg2, bitmap:Resources.bitmap_LightExplosion, scale:2, alpha:1});
};
_local7 = new Vector(_arg3, _arg4);
deviate(_arg3, _arg4, _local7, 1);
_local8 = (_local7.x - _arg1);
_local9 = (_local7.y - _arg2);
_local10 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local8 = (_local8 / _local10);
_local9 = (_local9 / _local10);
spawnParticle(_arg1, _arg2, _local8, _local9);
_overheat = (_overheat + _overheatRate);
if (!_isInfAmmo){
_local6.removeAmmo(Weapon.Flame, 1);
};
if (_overheat >= 100){
_overheat = (_overheat + 50);
_local11 = new SoundOverheat();
_local11.play();
};
return (0);
}
override public function update(){
var _local1:ListNode;
var _local2:CollisionGrid;
var _local3:ListNode;
var _local4:Effect;
super.update();
if (((!(_isShooting)) && (!((light == null))))){
light.list.remove(light);
light = null;
};
if (((!(_isShooting)) && (!((soundCh == null))))){
soundCh.stop();
soundCh = null;
} else {
if (((_isShooting) && ((soundCh == null)))){
soundCh = sound.play();
soundCh.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
};
};
if (light != null){
light.data.alpha = (light.data.alpha + Common.random(-0.2, 0.2));
light.data.alpha = Common.clamp(light.data.alpha, 0.01, 1);
};
_local1 = particles.end;
_local2 = Game.gameScreen.grid;
_local3 = particles.begin;
while (_local3 != _local1) {
_local3.data.update();
hit(_local2, _local3.data.pos);
if (_local3.data.life < 0){
if (Math.random() < 0.5){
_local4 = Game.gameScreen.spawnEffect(Resources.sheet_FlameFloor, (_local3.data.pos.x + 50), (_local3.data.pos.y + 50));
if (Math.random() < 0.2){
_local4.setLight(Resources.bitmap_LightExplosion, _local3.data.pos.x, _local3.data.pos.y, 1.5);
};
Game.gameScreen.spawnDecal(Resources.bitmap_FlameHit, (_local3.data.pos.x + 50), (_local3.data.pos.y + 50), 1, 0, 0.3);
_local4.frameRate = 15;
};
_local3 = particles.remove(_local3);
} else {
_local3 = _local3.next;
};
};
}
private function onSoundComplete(_arg1:Event){
soundCh = sound.play();
}
}
}//package game
import flash.geom.*;
class FireParticle {
private var pos:Point;
private var dy:Number;// = 0
private var frame:Number;// = 0
private var dx:Number;// = 0
private var initialY:Number;// = 0
private var initialX:Number;// = 0
private var life:Number;
private function FireParticle(){
initialX = 0;
initialY = 0;
pos = new Point();
life = ((Math.random() * 0.5) + 0.5);
dx = 0;
dy = 0;
frame = 0;
super();
}
public function update(){
pos.x = (pos.x + dx);
pos.y = (pos.y + dy);
life = (life - 0.05);
frame = (frame + 0.5);
if (frame >= 15){
frame = 15;
};
}
}
Section 26
//FPSCounter (game.FPSCounter)
package game {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class FPSCounter extends MovieClip {
private var lastTick:Number;
private var prevTime:Number;
private var minFrameTime:Number;// = 99999999999
private var FrameTime:TextField;
private var FPS:TextField;
private var numFrames:Number;
private var maxFrameTime:Number;// = -1
private var framesElapsed:int;// = 0
static var k_FrameTime:Number = 0;
public function FPSCounter(){
maxFrameTime = -1;
minFrameTime = 99999999999;
framesElapsed = 0;
super();
numFrames = 0;
prevTime = getTimer();
lastTick = getTimer();
FPS = new TextField();
FrameTime = new TextField();
FrameTime.y = 20;
FrameTime.width = 200;
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
}
public function onEnterFrameHandler(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
numFrames++;
framesElapsed++;
_local2 = getTimer();
_local3 = (_local2 - prevTime);
_local4 = (_local2 - lastTick);
prevTime = _local2;
if (_local4 >= 500){
lastTick = _local2;
FPS.text = ("FPS: " + (numFrames * 2));
numFrames = 0;
};
if (framesElapsed > 100){
if (_local3 > maxFrameTime){
maxFrameTime = _local3;
};
if (_local3 < minFrameTime){
minFrameTime = _local3;
};
};
k_FrameTime = (_local3 * 0.001);
FrameTime.text = (((("Frame time: " + _local3) + " ms / Avg: ") + ((minFrameTime + maxFrameTime) * 0.5)) + " ms");
}
}
}//package game
Section 27
//Game (game.Game)
package game {
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import flash.media.*;
import flash.net.*;
public dynamic class Game extends MovieClip {
var survivalGameScreen:SurvivalGameScreen;// = null
public var button0:SimpleButton;
public var button1:SimpleButton;
var config:Config;// = null
var state:GameState;// = null
var menuScreen:MenuScreen;// = null
var storyGameScreen:StoryGameScreen;// = null
static const width:uint = 700;
static const height:uint = 525;
static const frameRate:uint = 30;
static var stage:Stage = null;
static var isSoundEnabled:Boolean = true;
static var instance:Game = null;
static var gameScreen:GameScreen = null;
public function Game(){
menuScreen = null;
survivalGameScreen = null;
storyGameScreen = null;
state = null;
config = null;
super();
addFrameScript(0, frame1, 1, frame2, 7, frame8, 16, frame17);
stage = this.stage;
instance = this;
}
public function coolbuddy(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.coolbuddy.com/?cid=174"), "_blank");
}
private function lockURL(_arg1):Boolean{
var _local2:*;
var _local3:*;
_local2 = stage.loaderInfo.loaderURL.split("://");
_local3 = _local2[1].split("/");
if (_local3[0] != _arg1){
return (false);
};
return (true);
}
function frame1(){
MochiAd.showPreGameAd({id:"9e8a32c25071bda5", res:"700x525", clip:this, no_bg:true});
MochiServices.connect("9e8a32c25071bda5", this);
button0.addEventListener(MouseEvent.CLICK, coolbuddy);
button1.addEventListener(MouseEvent.CLICK, coolbuddy);
}
private function isLocal():Boolean{
var _local1:*;
_local1 = stage.loaderInfo.loaderURL.split("://");
return ((_local1[0] == "file"));
}
function frame17(){
stop();
startGame();
}
public function startGame(){
config = new Config();
config.loadConfig();
}
function frame2(){
gotoAndStop("Game");
}
public function initialize(){
Input.initialize(stage);
Resources.initialize();
Weapon.initialize();
menuScreen = new MenuScreen();
survivalGameScreen = new SurvivalGameScreen();
storyGameScreen = new StoryGameScreen();
menuScreen.initialize();
enterState(menuScreen);
}
function frame8(){
}
public function enterState(_arg1:GameState){
if (state != null){
state.leave();
};
state = _arg1;
state.enter(this);
}
public static function toggleSound(){
var _local1:SoundTransform;
_local1 = new SoundTransform();
if (isSoundEnabled){
_local1.volume = 0;
SoundMixer.soundTransform = _local1;
} else {
_local1.volume = 1;
SoundMixer.soundTransform = _local1;
};
isSoundEnabled = !(isSoundEnabled);
}
}
}//package game
Section 28
//GameEndScreen (game.GameEndScreen)
package game {
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
public class GameEndScreen extends MovieClip {
public var menu:SimpleButton;
public var submitScore:SimpleButton;
public function GameEndScreen(){
addFrameScript(523, frame524);
submitScore.addEventListener(MouseEvent.CLICK, onSubmitScore);
menu.addEventListener(MouseEvent.CLICK, onMenu);
}
private function onSubmitScore(_arg1:MouseEvent){
MochiScores.showLeaderboard({boardID:"f6a7ad7b22582097", res:"700x525", score:Game.gameScreen.score});
}
function frame524(){
stop();
}
private function onMenu(_arg1:MouseEvent){
parent.removeChild(this);
Game.instance.enterState(Game.instance.menuScreen);
}
}
}//package game
Section 29
//GameObject (game.GameObject)
package game {
public class GameObject extends Sprite {
protected var node:ListNode;// = null
public function GameObject(){
node = null;
super();
}
public function spawn(_arg1:Number, _arg2:Number){
x = _arg1;
y = _arg2;
}
public function release(){
node.list.remove(node);
}
public static function compare(_arg1:GameObject, _arg2:GameObject):Number{
if (_arg1.y > _arg2.y){
return (1);
};
if (_arg1.y < _arg2.y){
return (-1);
};
return (0);
}
}
}//package game
Section 30
//GameOverScreen (game.GameOverScreen)
package game {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import mochi.as3.*;
import flash.ui.*;
public class GameOverScreen extends MovieClip {
private var timer:Timer;// = null
public var buttonMenu:SimpleButton;
private var gameOver:Boolean;// = false
public var buttonSubmit:SimpleButton;
public function GameOverScreen(){
timer = null;
gameOver = false;
super();
timer = new Timer(1);
timer.addEventListener(TimerEvent.TIMER, onTimer);
addEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler);
buttonMenu.addEventListener(MouseEvent.CLICK, onMenuClicked);
buttonSubmit.addEventListener(MouseEvent.CLICK, onSubmitClicked);
}
public function get isGameOver():Boolean{
return (gameOver);
}
private function onSubmitClicked(_arg1:MouseEvent){
MochiScores.showLeaderboard({boardID:"f6a7ad7b22582097", res:"700x525", score:Game.gameScreen.score, onClose:onCloseHighscores});
buttonMenu.mouseEnabled = false;
buttonSubmit.mouseEnabled = false;
}
private function onMenuClicked(_arg1:MouseEvent){
visible = false;
Game.gameScreen.isPaused = false;
Game.instance.enterState(Game.instance.menuScreen);
gameOver = false;
}
private function onCloseHighscores(){
buttonMenu.mouseEnabled = true;
buttonSubmit.mouseEnabled = true;
}
private function onTimer(_arg1:Event){
visible = true;
Game.gameScreen.isPaused = true;
Game.gameScreen.showCursor(false);
Game.gameScreen.setBlurEnabled(true, false);
timer.stop();
}
public function show(_arg1:Number){
timer.delay = _arg1;
timer.start();
gameOver = true;
}
private function onMouseOverHandler(_arg1:MouseEvent){
Game.gameScreen.showCursor(false);
Mouse.show();
}
}
}//package game
Section 31
//GameScreen (game.GameScreen)
package game {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.filters.*;
import flash.ui.*;
public class GameScreen extends GameState {
var gameOverScreen:GameOverScreen;
protected var arrow:MovieClip;
private var upgradeIndex:uint;// = 0
var pauseScreen:MovieClip;
var lights:List;
private var nightLayer:DecalLayer;
protected var nightAlpha:Number;// = 0xFF
var night:MovieClip;
var tracers:List;
var _isPaused:Boolean;// = false
var wavesSurvived:int;// = 0
private var nightTheme:Sound;// = null
var score:uint;// = 0
var nightAlphaAdd:Number;// = 0
private var nightMaskAlpha:BitmapData;
protected var trap0:FireTrap;// = null
protected var trap1:FireTrap;// = null
protected var ammo:Array;
var base:MovieClip;
var angle:Number;// = 0
var hummer:MovieClip;// = null
var assist1:Assist;// = null
var assist0:Assist;// = null
private var currentWeapon:uint;// = 0
protected var hud:MovieClip;
var wave:Wave;
var effects:List;
protected var tesla:TeslaTower;// = null
var isMouseEnabled:Boolean;// = true
private var nightMask:BitmapData;
var human:Human;// = null
private var soundChannel:SoundChannel;// = null
var grenade:Grenade;
private var dayNightTheme:Sound;// = null
var cursor:MovieClip;
private var renderLayer:DecalLayer;
private var tracerBitmap:Bitmap;
var grid:CollisionGrid;
private var lastSoundPos:Number;// = -1
protected var airstrike:Airstrike;// = null
var snow:Snow;
var level:Level;
private var tracerLayer:MovieClip;
private var monsterLayer:DecalLayer;
var decalLayer:DecalLayer;
var isUserPaused:Boolean;// = false
protected var gameHUD:MovieClip;
private var dayTheme:Sound;// = null
var monsters:Array;
var walls:Walls;
var flashlightFlicker:Boolean;// = false
var blood:Array;
static var instance:GameScreen = null;
public function GameScreen(){
var _local1:int;
gameHUD = new GameHUD();
assist0 = null;
assist1 = null;
human = null;
hummer = null;
ammo = new Array();
nightAlpha = 0xFF;
nightAlphaAdd = 0;
walls = new Walls();
trap0 = null;
trap1 = null;
tesla = null;
airstrike = null;
hud = new HUD();
arrow = new ArrowBattle();
base = new MovieClip();
upgradeIndex = 0;
gameOverScreen = new GameOverScreen();
pauseScreen = new PauseScreen();
night = new Night();
snow = new Snow();
cursor = new Cursor();
grenade = new Grenade();
monsters = new Array();
blood = new Array();
tracers = new List();
effects = new List();
wave = new Wave();
lights = new List();
flashlightFlicker = false;
level = new Level();
wavesSurvived = 0;
_isPaused = false;
isUserPaused = false;
isMouseEnabled = true;
score = 0;
dayTheme = null;
nightTheme = null;
dayNightTheme = null;
soundChannel = null;
lastSoundPos = -1;
currentWeapon = 0;
grid = new CollisionGrid();
decalLayer = new DecalLayer();
tracerLayer = new MovieClip();
monsterLayer = new DecalLayer();
nightLayer = new DecalLayer();
renderLayer = new DecalLayer();
tracerBitmap = new Bitmap(new BitmapData(700, 525, true, 0));
nightMask = new BitmapData(700, 525, false, 4281545523);
nightMaskAlpha = new BitmapData(700, 525, true, 3439329279);
angle = 0;
super();
instance = this;
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
_local1 = 0;
while (_local1 < 8) {
ammo.push(0);
_local1++;
};
}
private function updateEffects(){
var _local1:ListNode;
var _local2:ListNode;
_local1 = effects.end;
_local2 = effects.begin;
while (((!((_local2 == _local1))) && (!((_local2 == null))))) {
if (_local2.data == null){
} else {
_local2.data.update();
if (_local2.data){
_local2.data.render(renderLayer.bitmapData);
};
};
_local2 = _local2.next;
};
}
override protected function onLeave(){
if (soundChannel != null){
soundChannel.stop();
soundChannel = null;
};
}
public function onWaveKilled(_arg1:Wave){
wavesSurvived++;
}
public function onCloseManage(){
human.x = 92;
human.y = 433.4;
arrow.visible = false;
}
public function hitWalls(){
var _local1:uint;
_local1 = 0;
while (_local1 < 5) {
walls[(("wall" + _local1) + "_")].hit(5);
_local1++;
};
}
override protected function onEnter(){
if (nightTheme == null){
nightTheme = new SoundNightTheme();
};
if (dayTheme == null){
dayTheme = new SoundDayTheme();
};
if (dayNightTheme == null){
dayNightTheme = new SoundDayNight();
};
if (isNight){
soundChannel = nightTheme.play();
} else {
soundChannel = dayTheme.play();
};
soundChannel.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
showCursor(true);
hud.toggleSound.gotoAndStop((Game.isSoundEnabled) ? 1 : 2);
}
private function drawLight(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Matrix;
var _local5:ColorTransform;
var _local6:Number;
var _local7:uint;
var _local8:ListNode;
var _local9:ListNode;
_local1 = (Input.mouseX - human.x);
_local2 = (Input.mouseY - human.y);
_local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
_local1 = (_local1 / _local3);
_local2 = (_local2 / _local3);
_local4 = new Matrix();
_local5 = new ColorTransform();
_local4.translate(0, (-(Resources.bitmap_Flashlight.height) * 0.5));
_local4.rotate(Common.deg2Rad((((-180 * Math.atan2(-(_local1), -(_local2))) / Math.PI) - 90)));
_local4.translate(human.x, human.y);
if (Math.random() < 0.1){
flashlightFlicker = !(flashlightFlicker);
};
if (flashlightFlicker){
_local5.alphaMultiplier = (0.9 + Common.random(-0.1, 0.1));
};
_local6 = Math.min((nightAlpha + nightAlphaAdd), 0xFF);
_local7 = (((4278190080 | (_local6 << 16)) | (_local6 << 8)) | _local6);
nightMask.fillRect(nightMask.rect, _local7);
if (isNight){
nightMask.draw(Resources.bitmap_Flashlight, _local4, _local5);
};
_local8 = lights.end;
_local9 = lights.begin;
while (_local9 != _local8) {
_local4.identity();
_local4.scale(_local9.data.scale, _local9.data.scale);
_local4.translate((_local9.data.x - ((_local9.data.bitmap.rect.width * 0.5) * _local9.data.scale)), (_local9.data.y - ((_local9.data.bitmap.rect.height * 0.5) * _local9.data.scale)));
_local5.alphaMultiplier = _local9.data.alpha;
nightMask.draw(_local9.data.bitmap, _local4, _local5);
if (_local9.data.alpha < 0){
_local9 = lights.remove(_local9);
} else {
_local9 = _local9.next;
};
};
}
public function repairWalls(){
var _local1:uint;
_local1 = 0;
while (_local1 < 5) {
walls[(("wall" + _local1) + "_")].health = (walls[(("wall" + _local1) + "_")].health + 15);
_local1++;
};
}
private function chooseNextWeapon(){
var _local1:uint;
var _local2:Boolean;
var _local3:*;
_local1 = (currentWeapon + 1);
_local2 = false;
_local3 = 0;
while (_local3 < human.hasWeapon.length) {
if (human.hasWeapon[_local3]){
_local2 = true;
break;
};
_local3++;
};
if (!_local2){
trace("ERROR!! GameScreen::chooseNextWeapon : no weapons found");
return;
};
while (1) {
if (_local1 >= human.hasWeapon.length){
_local1 = 0;
};
if (human.hasWeapon[_local1]){
human.chooseWeapon(_local1);
currentWeapon = _local1;
break;
};
_local1++;
};
}
public function isTeslaBuilt():Boolean{
return (tesla.isEnabled);
}
public function spawnBloodSplash(_arg1:Number, _arg2:Number){
var _local3:MovieClip;
_local3 = new BloodSplatter();
_local3.gotoAndStop((Math.round((Math.random() * _local3.totalFrames)) + 1));
_local3.scaleX = (_local3.scaleY = 0.5);
_local3.x = (_arg1 + ((Math.random() * 20) - 10));
_local3.y = (_arg2 + ((Math.random() * 20) - 10));
addChild(_local3);
blood.push(_local3);
}
public function parseLevel(_arg1:String){
var _local2:XML;
var _local3:uint;
_local2 = new XML(_arg1);
_local3 = 0;
while (_local2.property[_local3] != undefined) {
level[_local2.property[_local3].@name] = _local2.property[_local3].@value;
_local3++;
};
level.isLoaded = true;
if (level.background == 1){
level.enableSnow = ((Math.random())<0.5) ? true : false;
} else {
level.enableSnow = false;
};
level.enableNight = ((Math.random())<0.2) ? true : false;
level.enableNight = true;
if ((((this is StoryGameScreen)) && (level.enableNight))){
nightAlpha = 50;
} else {
nightAlpha = 0xFF;
};
}
public function addMoney(_arg1:int){
}
public function isFireTrapBuilt():Boolean{
return (trap0.isEnabled);
}
public function showCursor(_arg1:Boolean){
cursor.visible = _arg1;
if (!_arg1){
Mouse.show();
} else {
Mouse.hide();
};
if (_arg1){
cursor.startDrag(true);
} else {
cursor.stopDrag();
};
}
private function onHumanKilled(_arg1:Event){
gameOverScreen.show(2000);
}
public function getUpgradeIndex():uint{
return (upgradeIndex);
}
private function pauseSound(){
if (soundChannel != null){
lastSoundPos = soundChannel.position;
soundChannel.stop();
soundChannel = null;
};
}
public function load(){
}
private function resumeSound(){
if (nightTheme == null){
nightTheme = new SoundNightTheme();
};
if (dayTheme == null){
dayTheme = new SoundDayTheme();
};
if (((!((lastSoundPos == -1))) && ((soundChannel == null)))){
soundChannel = (isNight) ? nightTheme.play(((lastSoundPos)<nightTheme.length) ? lastSoundPos : 0) : dayTheme.play(((lastSoundPos)<dayTheme.length) ? lastSoundPos : 0);
soundChannel.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
lastSoundPos = -1;
};
}
public function isWallsRepaired():Boolean{
var _local1:*;
_local1 = 0;
while (_local1 < 5) {
if (((walls[(("wall" + _local1) + "_")].visible) && (!(walls[(("wall" + _local1) + "_")].isRepaired())))){
return (false);
};
_local1++;
};
return (true);
}
public function removeMonster(_arg1:Monster, _arg2:Boolean=true){
var _local3:*;
_local3 = 0;
while (_local3 < monsters.length) {
if (monsters[_local3] == _arg1){
monsters[_local3].removeFromGrid();
monsters[_local3] = null;
monsters.splice(_local3, 1);
break;
};
_local3++;
};
if (_arg2){
_arg1.render(decalLayer.bitmapData);
};
}
public function spawnEffect(_arg1:SpriteSheet, _arg2:Number, _arg3:Number, _arg4:Boolean=false):Effect{
var _local5:Effect;
_local5 = new Effect();
_local5.spriteSheet = _arg1;
_local5.spawn(_arg2, _arg3);
_local5.spawnDecal = _arg4;
return (_local5);
}
public function spawnDecal(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number=1, _arg5:Number=0, _arg6:Number=1){
decalLayer.insertBitmap(_arg1, _arg2, _arg3, _arg6, _arg4, _arg5);
}
protected function get isNight(){
return ((nightAlpha <= 200));
}
public function get isPaused():Boolean{
return (((_isPaused) || (isUserPaused)));
}
public function addAmmo(_arg1:int, _arg2:int){
if ((((_arg1 >= ammo.length)) || ((_arg1 < 0)))){
trace(("ERROR! GameScreen::addAmmo : invalid weapon index " + _arg1));
return (0);
};
ammo[_arg1] = (ammo[_arg1] + _arg2);
}
public function buildFireTrap(){
trap0.isEnabled = true;
trap1.isEnabled = true;
}
public function installRadio(){
airstrike.isEnabled = true;
}
public function setBlurEnabled(_arg1:Boolean, _arg2:Boolean){
var _local3:Array;
if (_arg1){
_local3 = new Array();
_local3.push(new BlurFilter(8, 8, 2));
base.filters = _local3;
base.cacheAsBitmap = true;
} else {
base.filters = null;
base.cacheAsBitmap = false;
};
hud.common.visible = _arg2;
hud.setBlurEnabled(_arg1);
}
public function enableFireTrap(){
if ((((trap0.fuel > 0)) || ((trap1.fuel > 0)))){
return;
};
trap0.fuel = Config.instance.k_FireTrapFuel;
trap1.fuel = Config.instance.k_FireTrapFuel;
}
public function testWallCollision(_arg1:BitmapData, _arg2:Number, _arg3:Number):Boolean{
return (walls.bd.hitTest(new Point(walls.x, walls.y), 1, _arg1, new Point(_arg2, _arg3)));
}
public function upgradeWalls(){
var _local1:uint;
_local1 = 0;
while (_local1 < 5) {
walls[(("wall" + _local1) + "_")].upgrade();
_local1++;
};
upgradeIndex++;
}
public function getAmmo(_arg1:int):int{
if ((((_arg1 >= ammo.length)) || ((_arg1 < 0)))){
trace(("ERROR! GameScreen::getAmmo : invalid weapon index " + _arg1));
return (0);
};
return (ammo[_arg1]);
}
public function startAirstrike(){
airstrike.start();
}
public function buildTesla(){
tesla.isEnabled = true;
}
public function spawnGrenade(_arg1:Number, _arg2:Number){
var _local3:Explosion;
spawnGameObject("game.Explosion", _arg1, _arg2);
}
public function isAirstrikeReady():Boolean{
return (((((!(airstrike.isActive)) && (airstrike.isEnabled))) && (airstrike.isReady)));
}
private function onError(_arg1:IOErrorEvent){
trace("ERROR! Failed to load level");
}
public function spawnTracer(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Tracer{
var _local8:Tracer;
_local8 = new Tracer();
_local8.pos.x = _arg2;
_local8.pos.y = _arg3;
_local8.spawn(_arg1, _arg4, _arg5, _arg6, _arg7);
_local8.node = tracers.insert(_local8);
return (_local8);
}
public function reset(){
var _local1:uint;
var _local2:MovieClip;
_local1 = 0;
_local1 = 0;
while (_local1 < 8) {
human.removeWeapon(_local1);
_local1++;
};
_local1 = 0;
while (_local1 < ammo.length) {
ammo[_local1] = 0;
_local1++;
};
human.giveWeapon(Weapon.Rifle, false);
human.chooseWeapon(Weapon.Rifle);
hud.common.monstersKilled.visible = false;
assist0.isEnabled = false;
assist0.health = 100;
assist0.gameScreen = this;
assist1.isEnabled = false;
assist1.health = 100;
assist1.gameScreen = this;
hummer.gunner.isEnabled = false;
hummer.gunner.gameScreen = this;
hummer.gotoAndStop((Math.round((Math.random() * hummer.totalFrames)) + 1));
human.visible = true;
human.health = 100;
human.gameScreen = this;
human.x = 92;
human.y = 433.4;
arrow.visible = false;
wavesSurvived = 0;
upgradeIndex = 0;
score = 0;
_local1 = 0;
while (_local1 < monsters.length) {
if (monsters[_local1] == null){
} else {
monsters[_local1].removeFromGrid();
monsters[_local1].removeAttackers();
};
_local1++;
};
wave._monstersLeft = 0;
monsters.splice(0, monsters.length);
decalLayer.bitmapData.fillRect(decalLayer.bitmapData.rect, 0);
_local2 = new Floor();
_local2.x = -33.7;
_local2.y = 227.1;
decalLayer.insert(_local2);
_local2 = null;
walls["wall0_"].reset();
walls["wall1_"].reset();
walls["wall2_"].reset();
walls["wall3_"].reset();
walls["wall4_"].reset();
trap0.isEnabled = false;
trap1.isEnabled = false;
airstrike.isEnabled = false;
tesla.isEnabled = false;
setBlurEnabled(false, true);
}
public function removeAmmo(_arg1:int, _arg2:int){
if ((((_arg1 >= ammo.length)) || ((_arg1 < 0)))){
trace(("ERROR! GameScreen::removeAmmo : invalid weapon index " + _arg1));
return (0);
};
ammo[_arg1] = (ammo[_arg1] - _arg2);
ammo[_arg1] = Math.max(0, ammo[_arg1]);
}
public function onMonsterDied(_arg1:Number, _arg2:Monster){
score = (score + (_arg2.maxCost * 10));
}
public function isRadioInstalled():Boolean{
return (airstrike.isEnabled);
}
public function initialize(){
var _local1:FPSCounter;
if (isInitialized){
return;
};
addChild(base);
addChild(gameOverScreen);
gameOverScreen.visible = false;
addChild(pauseScreen);
pauseScreen.visible = false;
arrow.y = Game.height;
assist0 = new Assist();
assist0.initialize();
assist1 = new Assist();
assist1.initialize();
trap0 = new FireTrap();
trap1 = new FireTrap();
airstrike = new Airstrike();
tesla = new TeslaTower();
human = new Human();
human.initialize();
hummer = new Hummer();
hummer.gunner.initialize();
human.addEventListener(Human.KILLED, onHumanKilled);
level.random();
base.addChild(new Ground());
base.addChild(decalLayer);
decalLayer.create(700, 525);
monsterLayer.create(700, 525);
nightLayer.create(700, 525);
renderLayer.create(700, 525);
base.addChild(monsterLayer);
base.addChild(walls);
walls.x = -33.7;
walls.y = 227.1;
base.addChild(hummer);
hummer.gotoAndStop((Math.round((Math.random() * hummer.totalFrames)) + 1));
base.addChild(human);
human.x = 92;
human.y = 433.4;
base.addChild(tracerLayer);
tracerLayer.addChild(tracerBitmap);
Tracer.initializeSheet();
_local1 = new FPSCounter();
addChild(_local1);
addChild(gameHUD);
base.addChild(assist0);
assist0.x = 38.4;
assist0.y = 381.4;
base.addChild(assist1);
assist1.x = 178;
assist1.y = 479.4;
addChild(cursor);
cursor.startDrag(true);
Mouse.hide();
grid.create((Math.floor((700 / 50)) * Math.floor((525 / 50))));
human.giveWeapon(Weapon.Rifle, false);
human.chooseWeapon(Weapon.Rifle);
assist0.giveWeapon(Weapon.Rifle, true);
assist0.chooseWeapon(Weapon.Rifle);
assist1.giveWeapon(Weapon.Rifle, true);
assist1.chooseWeapon(Weapon.Rifle);
hummer.gunner.giveWeapon(Weapon.AK74, true);
hummer.gunner.chooseWeapon(Weapon.AK74);
hummer.gunner.isWeaponVisible = false;
trap0.x = 0;
trap0.y = 220;
trap0.gotoAndStop(1);
trap1.x = 250;
trap1.y = 440.1;
trap1.gotoAndStop(2);
tesla.x = 202.9;
tesla.y = 0;
base.addChild(renderLayer);
snow.addFlakes(100);
base.addChild(snow);
_isInitialized = true;
}
public function isTeslaReady():Boolean{
return (((((!(tesla.isActive)) && (tesla.isEnabled))) && (tesla.isReloaded)));
}
private function onLevelLoaded(_arg1:Event){
var _local2:URLLoader;
_local2 = URLLoader(_arg1.target);
parseLevel(_local2.data);
trace("level");
trace(level.writeLevel());
}
public function spawnGameObject(_arg1:String, _arg2:Number, _arg3:Number):GameObject{
var _local4:Object;
var _local5:GameObject;
_local4 = getDefinitionByName(_arg1);
_local5 = new (_local4);
_local5.spawn(_arg2, _arg3);
return (_local5);
}
public function testHumanCollision(_arg1:BitmapData, _arg2:Number, _arg3:Number):Human{
var _local4:Number;
var _local5:Number;
_local4 = (human.width * 0.5);
_local5 = (human.height * 0.5);
if (((((assist0.visible) && (assist0.isEnabled))) && (assist0.testCollision(_arg1, _arg2, _arg3)))){
return (assist0);
};
if (((((assist1.visible) && (assist1.isEnabled))) && (assist1.testCollision(_arg1, _arg2, _arg3)))){
return (assist1);
};
if (((human.visible) && (human.testCollision(_arg1, _arg2, _arg3)))){
return (human);
};
return (null);
}
private function onSoundComplete(_arg1:Event){
if (isNight){
soundChannel = ((Math.random())<=0.5) ? dayNightTheme.play() : nightTheme.play();
} else {
soundChannel = ((Math.random())<=0.5) ? dayNightTheme.play() : dayTheme.play();
};
soundChannel.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
}
public function isFireTrapReady():Boolean{
return (((((!(trap0.isActive)) && (trap0.isEnabled))) && (trap0.isReloaded)));
}
public function set isPaused(_arg1:Boolean){
_isPaused = _arg1;
}
public function activateTesla(){
tesla.isActive = true;
}
private function onEnterFrameHandler(_arg1:Event){
var _local2:*;
var _local3:ListNode;
var _local4:ListNode;
var _local5:Scorpion;
var _local6:Golem;
var _local7:Mob1;
var _local8:Mob3;
var _local9:Spider;
var _local10:Number;
if (!isActive){
return;
};
if (Input.isKeyPressed(Input.P)){
isUserPaused = !(isUserPaused);
pauseScreen.visible = isUserPaused;
};
if (isPaused){
Game.instance.menuScreen.startSound();
pauseSound();
} else {
Game.instance.menuScreen.stopSound();
resumeSound();
};
if (((isPaused) || (!(level.isLoaded)))){
return;
};
if ((((wave.monstersLeft == 0)) && (!(arrow.visible)))){
wave.generate((Config.instance.k_SBaseWaveHP + (wavesSurvived * Config.instance.k_SWaveHPIncrease)));
};
if (((Input.isKeyPressed(Input.G)) && (!((ammo[Weapon.Grenade] == 0))))){
grenade.spawn(human.x, human.y, stage.mouseX, stage.mouseY);
var _local11 = ammo;
var _local12 = Weapon.Grenade;
var _local13 = (_local11[_local12] - 1);
_local11[_local12] = _local13;
};
if (Input.isKeyPressed(Input.R)){
human.weapon.reload();
};
if (Input.isKeyPressed(Keyboard.SPACE)){
chooseNextWeapon();
};
if (Input.isKeyPressed("1".charCodeAt(0))){
human.chooseWeapon(0);
};
if (Input.isKeyPressed("2".charCodeAt(0))){
human.chooseWeapon(1);
};
if (Input.isKeyPressed("3".charCodeAt(0))){
human.chooseWeapon(2);
};
if (Input.isKeyPressed("4".charCodeAt(0))){
human.chooseWeapon(3);
};
if (Input.isKeyPressed("5".charCodeAt(0))){
human.chooseWeapon(4);
};
if (Input.isKeyPressed("6".charCodeAt(0))){
human.chooseWeapon(5);
};
if (Input.isKeyPressed("7".charCodeAt(0))){
human.chooseWeapon(6);
};
if (!human.weapon){
human.setWeapon(Weapon.k_Beretta.clone());
};
if (!human.weapon.ammo){
cursor.reload.visible = true;
_local10 = (getTimer() - human.weapon.reloadStartTime);
cursor.reload.gotoAndStop((Math.floor(((cursor.reload.totalFrames * _local10) / human.weapon.reloadTime)) + 1));
} else {
cursor.reload.visible = false;
};
renderLayer.bitmapData.lock();
renderLayer.bitmapData.draw(Resources.bitmap_Background[level.background]);
renderLayer.bitmapData.copyPixels(decalLayer.bitmapData, decalLayer.bitmapData.rect, new Point(0, 0), decalLayer.bitmapData, null, true);
renderLayer.bitmapData.draw(hummer);
grenade.update();
grenade.render(renderLayer.bitmapData);
if (tesla.isEnabled){
renderLayer.insert(tesla);
};
_local2 = 0;
while (_local2 < monsters.length) {
monsters[_local2].update();
if (monsters[_local2] != null){
monsters[_local2].render(renderLayer.bitmapData);
monsters[_local2].flame.render(renderLayer.bitmapData);
};
_local2++;
};
renderLayer.insert(walls);
if (arrow.visible){
renderLayer.insert(arrow);
};
if (trap0.isEnabled){
renderLayer.insert(trap0);
};
if (trap1.isEnabled){
renderLayer.insert(trap1);
};
if (human.visible){
renderLayer.insert(human);
};
if (assist0.isEnabled){
renderLayer.insert(assist0);
};
if (assist1.isEnabled){
renderLayer.insert(assist1);
};
updateEffects();
_local2 = (blood.length - 1);
while (_local2 >= 0) {
blood[_local2].alpha = (blood[_local2].alpha - 0.1);
if (blood[_local2].alpha <= 0){
removeChild(blood[_local2]);
blood.splice(_local2, 1);
};
_local2--;
};
_local3 = tracers.end;
_local4 = tracers.begin;
while (_local4 != _local3) {
_local4.data.update();
if (((_local4.data) && (_local4.data.isVisible))){
Tracer.tracer_SpriteSheet.render(renderLayer.bitmapData, (_local4.data.pos.x - 71), _local4.data.pos.y, _local4.data.frame);
};
_local4 = _local4.next;
};
human.weapon.render(renderLayer.bitmapData);
trap0.update();
trap1.update();
airstrike.update(this);
trap0.render(renderLayer.bitmapData);
trap1.render(renderLayer.bitmapData);
tesla.render(renderLayer.bitmapData);
if (nightAlpha < 0xFF){
drawLight();
renderLayer.bitmapData.draw(nightMask, null, null, BlendMode.MULTIPLY);
};
renderLayer.bitmapData.unlock();
snow.visible = level.enableSnow;
gameHUD.stats.text = ((((((("Monsters: " + monsters.length) + " / Tracers: ") + tracers.size) + " / Checks: ") + Tracer.k_MonstersChecked) + " / Wave: ") + wave.monstersLeft);
if (((!((human == null))) && (!((human.weapon == null))))){
gameHUD.ammo.text = ((((human.weapon.name + " / ") + human.weapon.ammo) + " / ") + Math.floor(human.weapon.overheat));
};
Tracer.k_MonstersChecked = 0;
night.flashlight.x = human.x;
night.flashlight.y = human.y;
}
}
}//package game
Section 32
//GameState (game.GameState)
package game {
import flash.events.*;
import flash.display.*;
public class GameState extends MovieClip {
protected var _isActive:Boolean;// = false
protected var _isInitialized:Boolean;// = false
public function GameState(){
_isActive = false;
_isInitialized = false;
super();
}
public function enter(_arg1:MovieClip){
_arg1.addChild(this);
_isActive = true;
onEnter();
}
protected function onLeave(){
}
protected function onEnter(){
}
public function get isInitialized():Boolean{
return (_isInitialized);
}
public function onKeyDownHandler(_arg1:KeyboardEvent){
}
public function leave(){
if (parent){
parent.removeChild(this);
};
_isActive = false;
onLeave();
}
public function get isActive():Boolean{
return (_isActive);
}
}
}//package game
Section 33
//Golem (game.Golem)
package game {
import flash.display.*;
import flash.media.*;
public class Golem extends Monster {
static var attack_SpriteSheet:SpriteSheet = new SpriteSheet(new BitmapMob2Attack(0, 0), 24, 5, 100, 100);
static var walk_SpriteSheet:SpriteSheet = new SpriteSheet(new BitmapMob2Walk(0, 0), 25, 5, 100, 100);
static var bitmap_Collision:BitmapData = null;
static var die_SpriteSheet:SpriteSheet = new SpriteSheet(new BitmapMob2Die(0, 0), 30, 6, 100, 100);
public function Golem(){
animAttack = attack_SpriteSheet;
animWalk = walk_SpriteSheet;
animDie = die_SpriteSheet;
animation = animWalk;
health = (Config.instance.k_GolemHealth * Game.gameScreen.level.monsterStrength);
maxCost = Config.instance.k_GolemCost;
speed = Config.instance.k_GolemSpeed;
damage = (Config.instance.k_GolemDamage * Game.gameScreen.level.monsterStrength);
if (bitmap_Collision == null){
bitmap_Collision = new BitmapData(100, 100, true, 0);
animWalk.render(bitmap_Collision, 0, 0, 0);
};
collisionBitmap = bitmap_Collision;
}
override protected function die(){
var _local1:Sound;
var _local2:uint;
if ((state & k_Dead)){
return;
};
_local1 = null;
_local2 = Math.floor((Math.random() * 2));
switch (_local2){
case 0:
_local1 = new SoundGolemDie1();
break;
case 1:
_local1 = new SoundGolemDie2();
break;
};
_local1.play();
super.die();
}
override public function update(){
var _local1:Sound;
if ((state & k_Attacking)){
if (frame == int((animation.frameCount / 2))){
_local1 = new SoundGolemAttack1();
_local1.play();
};
};
super.update();
}
}
}//package game
Section 34
//Grenade (game.Grenade)
package game {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class Grenade {
private var timer:Timer;// = null
private var isVisible:Boolean;// = false
private var target:Vector;
private var x:Number;// = 0
private var y:Number;// = 0
private var vel:Vector;
public function Grenade(){
isVisible = false;
vel = new Vector();
target = new Vector();
x = 0;
y = 0;
timer = null;
super();
}
private function onTimer(_arg1:TimerEvent){
Game.gameScreen.spawnGrenade(x, y);
isVisible = false;
timer.stop();
}
public function update(){
var _local1:Vector;
if (((!(isVisible)) || ((((vel.x == 0)) && ((vel.y == 0)))))){
return;
};
x = (x + (vel.x * 30));
y = (y + (vel.y * 30));
_local1 = new Vector((target.x - x), (target.y - y));
_local1.normalize();
if (vel.dot(_local1) < 0){
Game.gameScreen.spawnGrenade(x, y);
isVisible = false;
};
}
public function render(_arg1:BitmapData){
if (!isVisible){
return;
};
_arg1.copyPixels(Resources.bitmap_Granade, Resources.bitmap_Granade.rect, new Point(x, y), Resources.bitmap_Granade, null, true);
}
public function spawn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
if (isVisible){
return;
};
x = _arg1;
y = _arg2;
vel.x = x;
vel.y = y;
vel.dirTo(_arg3, _arg4);
target.x = _arg3;
target.y = _arg4;
isVisible = true;
}
}
}//package game
Section 35
//Gunner (game.Gunner)
package game {
import flash.display.*;
import flash.geom.*;
public class Gunner extends Assist {
public var dot:MovieClip;
override public function initialize(){
super.initialize();
scaleX = (scaleY = 1);
}
override public function getBarrelEnd():Point{
return (localToGlobal(new Point(dot.x, dot.y)));
}
override protected function aimTo(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:int;
var _local6:Point;
dx = (_arg1 - x);
dy = (_arg2 - y);
_local3 = Math.sqrt(((dx * dx) + (dy * dy)));
dx = (dx / _local3);
dy = (dy / _local3);
_local4 = (((-180 * Math.atan2(-(dx), -(dy))) / Math.PI) - 90);
_local5 = Math.floor(((_local4 * totalFrames) / 90));
_local5 = Common.clamp(_local5, 0, (totalFrames - 1));
gotoAndStop((_local5 + 1));
rifle.gotoAndStop((Math.floor(((_local4 * rifle.totalFrames) / 90)) + 1));
gunfire.x = dot.x;
gunfire.y = dot.y;
gunfire.rotation = ((-180 * Math.atan2(-(dx), -(dy))) / Math.PI);
_local6 = getBarrelEnd();
if (overheat != null){
overheat.x = _local6.x;
overheat.y = _local6.y;
};
}
}
}//package game
Section 36
//HUD (game.HUD)
package game {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.filters.*;
public class HUD extends MovieClip {
public var common:MovieClip;
public var toggleSound:MovieClip;
public var quitButtons:MovieClip;
private var shells:Array;
private var lastWeaponIndex:int;// = -1
private var lastShotAmmo:int;// = 0
public function HUD(){
var _local1:*;
lastWeaponIndex = -1;
lastShotAmmo = 0;
shells = new Array();
super();
shells.length = 30;
_local1 = 0;
while (_local1 < 30) {
shells[_local1] = new Shell();
shells[_local1].visible = false;
common.addChild(shells[_local1]);
_local1++;
};
toggleSound.gotoAndStop(1);
addEventListener(MouseEvent.MOUSE_OVER, onManageMouseOver);
addEventListener(MouseEvent.MOUSE_OUT, onManageMouseOut);
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
common.trapButtons.buttonAirstrike.addEventListener(MouseEvent.CLICK, onAirstrikeClicked);
common.trapButtons.buttonFireTrap.addEventListener(MouseEvent.CLICK, onFireTrapClicked);
common.trapButtons.buttonTesla.addEventListener(MouseEvent.CLICK, onTeslaClicked);
common.buttonMenu.addEventListener(MouseEvent.CLICK, onMenuClicked);
initQuitButtons();
}
private function initQuitButtons(){
var _local1:*;
var _local2:MovieClip;
_local1 = 0;
while (_local1 < 4) {
_local2 = (quitButtons[("pannel" + _local1)] as MovieClip);
_local2.endY = _local2.y;
_local2.startY = ((_local2.y - 700) + (100 * _local1));
_local2.y = ((_local2.y - 700) + (100 * _local1));
_local2.setState(MenuButton.k_StateOpen);
_local2.gotoAndStop(1);
_local2.addEventListener(MouseEvent.CLICK, onMouseClickHandler);
_local1++;
};
quitButtons.pannel1.enableEvents = false;
quitButtons.endX = quitButtons.x;
quitButtons.startX = (quitButtons.x + 400);
quitButtons.enabled = false;
quitButtons.x = quitButtons.startX;
}
private function onAirstrikeClicked(_arg1:MouseEvent){
Game.gameScreen.startAirstrike();
_arg1.target.alpha = 0;
_arg1.target.mouseEnabled = false;
}
public function setBlurEnabled(_arg1:Boolean){
var _local2:Array;
if (_arg1){
_local2 = new Array();
_local2.push(new BlurFilter(8, 8, 2));
common.filters = _local2;
common.cacheAsBitmap = true;
} else {
common.filters = null;
common.cacheAsBitmap = false;
};
}
private function onFireTrapClicked(_arg1:MouseEvent){
Game.gameScreen.enableFireTrap();
_arg1.target.alpha = 0;
_arg1.target.mouseEnabled = false;
}
private function onMenuClicked(_arg1:MouseEvent){
var _local2:*;
var _local3:MovieClip;
quitButtons.enabled = true;
Game.gameScreen.isPaused = true;
Game.gameScreen.setBlurEnabled(true, true);
Game.gameScreen.showCursor(false);
_local2 = 0;
while (_local2 < 4) {
_local3 = quitButtons[("pannel" + _local2)];
_local3.setState(MenuButton.k_StateOpen);
_local2++;
};
}
private function reset(){
var _local1:*;
var _local2:MovieClip;
_local1 = 0;
while (_local1 < 4) {
_local2 = quitButtons[("pannel" + _local1)];
_local2.setState(MenuButton.k_StateClose);
_local1++;
};
}
private function onManageMouseOver(_arg1:MouseEvent){
Game.gameScreen.showCursor(false);
Game.gameScreen.isMouseEnabled = false;
}
private function updateShells(_arg1:int, _arg2:int, _arg3:int){
var _local4:int;
var _local5:*;
_local4 = (_arg1 * 2);
_local5 = 0;
while (_local5 < Math.min(30, _arg3)) {
shells[_local5].gotoAndStop(((_local5)<_arg2) ? (_local4 + 1) : (_local4 + 2));
_local5++;
};
}
private function onTeslaClicked(_arg1:MouseEvent){
Game.gameScreen.activateTesla();
_arg1.target.alpha = 0;
_arg1.target.mouseEnabled = false;
}
private function onManageMouseOut(_arg1:MouseEvent){
Game.gameScreen.showCursor(true);
Game.gameScreen.isMouseEnabled = true;
}
public function update(_arg1:GameScreen){
var _local2:Human;
var _local3:*;
_local2 = _arg1.human;
if (_local2.weapon.weaponIndex == Weapon.Minigun){
common.minigunAmmo.visible = true;
common.minigunAmmo.caption.text = ("" + Math.max(0, (_local2.weapon.ammo - 30)));
} else {
common.minigunAmmo.visible = false;
};
if (((!((_local2 == null))) && (!((_local2.weapon == null))))){
common.ammo.text = ("" + _arg1.getAmmo(_local2.weaponIndex));
common.weaponIcon.gotoAndStop((_local2.weaponIndex + 1));
common.overheatBar.maskClip.scaleX = (_local2.weapon.overheat / 100);
common.overheatText.visible = _local2.weapon.isOverheat;
common.trapButtons.grenades.text = ("" + _arg1.getAmmo(Weapon.Grenade));
arangeShells(_local2.weapon.clipSize, _local2.weapon.ammo, _local2.weapon.weaponIndex);
if (_local2.weapon.weaponIndex != lastWeaponIndex){
lastWeaponIndex = _local2.weapon.weaponIndex;
common.ammoType.gotoAndStop((_local2.weapon.weaponIndex + 1));
};
if (_local2.weapon.ammo != lastShotAmmo){
updateShells(_local2.weaponIndex, _local2.weapon.ammo, _local2.weapon.clipSize);
lastShotAmmo = _local2.weapon.ammo;
};
};
if ((_arg1 is SurvivalGameScreen)){
common.money.text = ("" + (_arg1 as SurvivalGameScreen).getMoney());
common.wave.text = ("Waves survived: " + _arg1.wavesSurvived);
};
common.score.text = ("" + _arg1.score);
common.weaponButtons.update(_local2);
common.trapButtons.buttonFireTrap.alpha = (_arg1.isFireTrapReady()) ? 1 : 0.5;
common.trapButtons.buttonFireTrap.mouseEnabled = _arg1.isFireTrapReady();
common.trapButtons.buttonAirstrike.alpha = (_arg1.isAirstrikeReady()) ? 1 : 0.5;
common.trapButtons.buttonAirstrike.mouseEnabled = _arg1.isAirstrikeReady();
common.trapButtons.buttonTesla.alpha = (_arg1.isTeslaReady()) ? 1 : 0.5;
common.trapButtons.buttonTesla.mouseEnabled = _arg1.isTeslaReady();
_local3 = 0;
while (_local3 < shells.length) {
if ((shells[_local3].currentFrame % 2) == 0){
shells[_local3].y = (shells[_local3].y + 10);
shells[_local3].rotation = (shells[_local3].rotation + 20);
};
_local3++;
};
}
private function onMouseClickHandler(_arg1:MouseEvent){
if (_arg1.target == quitButtons.pannel3){
reset();
quitButtons.enabled = false;
Game.gameScreen.isPaused = false;
Game.gameScreen.setBlurEnabled(false, true);
Game.gameScreen.showCursor(true);
} else {
if (_arg1.target == quitButtons.pannel2){
reset();
quitButtons.enabled = false;
Game.gameScreen.isPaused = false;
Game.gameScreen.setBlurEnabled(false, true);
Game.instance.enterState(Game.instance.menuScreen);
Game.instance.menuScreen.buttons.reset();
} else {
if (_arg1.target == quitButtons.pannel0){
navigateToURL(new URLRequest("http://www.coolbuddy.com/?cid=174"), "_blank");
};
};
};
}
private function arangeShells(_arg1:uint, _arg2:uint, _arg3:uint){
var _local4:Number;
var _local5:Number;
var _local6:*;
var _local7:MovieClip;
_arg1 = Math.min(_arg1, 30);
_local4 = (65 / _arg1);
_local5 = 205;
_local6 = 0;
while (_local6 < shells.length) {
shells[_local6].visible = false;
_local6++;
};
_local6 = 0;
while (_local6 < _arg1) {
_local7 = shells[_local6];
if ((_local7.currentFrame % 2) == 0){
_local7.visible = true;
} else {
_local7.x = (700 + (Math.cos(Common.deg2Rad(_local5)) * 135));
_local7.y = (525 + (Math.sin(Common.deg2Rad(_local5)) * 135));
_local7.rotation = (_local5 + 90);
_local7.gotoAndStop(((_arg3 * 2) + ((_local6)<_arg2) ? 1 : 2));
_local7.visible = true;
_local5 = (_local5 + _local4);
};
_local6++;
};
}
private function onEnterFrameHandler(_arg1:Event){
var _local2:Number;
if (quitButtons.enabled){
if (quitButtons.x > quitButtons.endX){
_local2 = (Math.min((quitButtons.x - quitButtons.endX), 150) / 150);
quitButtons.x = (quitButtons.x - (60 * _local2));
if (quitButtons.x < quitButtons.endX){
quitButtons.x = quitButtons.endX;
};
};
} else {
if (quitButtons.x < quitButtons.startX){
_local2 = (Math.min((quitButtons.startX - quitButtons.x), 150) / 150);
quitButtons.x = (quitButtons.x + (60 * _local2));
if (quitButtons.x > quitButtons.startX){
quitButtons.x = quitButtons.startX;
};
};
};
}
}
}//package game
Section 37
//Human (game.Human)
package game {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.ui.*;
public class Human extends MovieClip {
var collisionBitmap:BitmapData;// = null
var gameScreen:GameScreen;// = null
public var torso:MovieClip;
public var healthBar:MovieClip;
var weapon:Weapon;// = null
public var legs:MovieClip;
public var collision:MovieClip;
var smokeFrame:int;// = 1
var weaponIndex:int;// = 0
var hasWeapon:Array;
var health:Number;// = 100
var gunfire:MovieClip;
var animation:uint;// = 0
var dy:Number;// = 0
var collisionCircle:BitmapData;// = null
var dx:Number;// = 0
var rifle:MovieClip;// = null
var index;// = 1
var overheat:MovieClip;// = null
var weapons:Array;
static const k_Right:uint = 5;
static const k_Idle:uint = 0;
static const k_UpRight:uint = 1;
static const k_Up:uint = 3;
static const k_UpRev:uint = 4;
static const k_UpRightRev:uint = 2;
static const k_RightRev:uint = 6;
static const KILLED:String = "Killed";
public function Human(){
gameScreen = null;
rifle = null;
weapon = null;
gunfire = new Gunfire();
overheat = null;
dx = 0;
dy = 0;
smokeFrame = 1;
weapons = new Array();
hasWeapon = new Array();
weaponIndex = 0;
collisionBitmap = null;
collisionCircle = null;
health = 100;
animation = k_Idle;
index = 1;
super();
}
public function chooseWeapon(_arg1:uint){
if (_arg1 >= weapons.length){
trace(("ERROR! chooseWeapon : invalid weapon index " + _arg1));
return;
};
if (!hasWeapon[_arg1]){
return;
};
weapon = weapons[_arg1];
weaponIndex = _arg1;
setWeapon(weapons[_arg1]);
}
private function checkCollision(_arg1:Number, _arg2:Number):Boolean{
var _local3:Boolean;
_local3 = gameScreen.testWallCollision(collisionCircle, (_arg1 + collision.x), (_arg2 + collision.y));
if (!_local3){
_local3 = ((((_arg1 + collision.x) < 0)) || ((((_arg2 + collision.y) + collision.height) >= Game.height)));
};
return (_local3);
}
public function setWeapon(_arg1:Weapon){
if (rifle != null){
removeChild(rifle);
rifle = null;
};
weapon = _arg1;
rifle = weapon.clip;
rifle.gotoAndStop(4);
rifle.scaleX = 0.75;
rifle.scaleY = 0.75;
addChild(rifle);
}
public function set isWeaponVisible(_arg1:Boolean){
rifle.visible = _arg1;
}
private function updateBitmap(){
var _local1:Matrix;
_local1 = new Matrix();
_local1.translate((width * 0.5), (height * 0.5));
collisionBitmap = new BitmapData(width, height, true, 0);
collisionBitmap.draw(this, _local1);
if (((!((collision == null))) && (!((collision == undefined))))){
collisionCircle = new BitmapData(collision.width, collision.height, true, 0);
collisionCircle.draw(collision);
collision.visible = false;
};
}
public function hit(_arg1:Number){
var _local2:Sound;
health = (health - _arg1);
if (health <= 0){
Game.gameScreen.spawnEffect(Resources.sheet_BloodBlast, x, y);
dispatchEvent(new Event(KILLED));
visible = false;
_local2 = new SoundHumanDie();
_local2.play();
};
}
public function initialize(){
var _local1:*;
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
addChild(gunfire);
if (((!((torso == null))) && (!((torso == undefined))))){
torso.gotoAndStop(4);
};
_local1 = 0;
while (_local1 < 8) {
hasWeapon.push(false);
_local1++;
};
weapons.push(Weapon.k_Beretta.clone(Weapon.Rifle));
weapons.push(Weapon.k_AK74.clone(Weapon.AK74));
weapons.push(Weapon.k_Jackhammer.clone(Weapon.Jackhammer));
weapons.push(Weapon.k_Flamethrower.clone(Weapon.Flame));
weapons.push(Weapon.k_LaserGun.clone(Weapon.LaserGun));
weapons.push(Weapon.k_Minigun.clone(Weapon.Minigun));
weapons.push(Weapon.k_Tesla.clone(Weapon.TeslaGun));
updateBitmap();
}
public function getBarrelEnd():Point{
return (rifle.localToGlobal(new Point(rifle.dot.x, rifle.dot.y)));
}
protected function aimTo(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:int;
var _local6:Point;
dx = (_arg1 - x);
dy = (_arg2 - y);
_local3 = Math.sqrt(((dx * dx) + (dy * dy)));
dx = (dx / _local3);
dy = (dy / _local3);
_local4 = ((-180 * Math.atan2(-(dx), -(dy))) / Math.PI);
_local5 = Math.floor(((_local4 * totalFrames) / 90));
_local5 = Common.clamp(_local5, 0, (totalFrames - 1));
torso.gotoAndStop((_local5 + 1));
rifle.gotoAndStop((Math.floor(((_local4 * rifle.totalFrames) / 90)) + 1));
gunfire.x = rifle.dot.x;
gunfire.y = rifle.dot.y;
gunfire.rotation = ((-180 * Math.atan2(-(dx), -(dy))) / Math.PI);
if (overheat != null){
_local6 = getBarrelEnd();
overheat.x = _local6.x;
overheat.y = _local6.y;
};
}
public function giveWeapon(_arg1:uint, _arg2:Boolean){
if (_arg1 < weapons.length){
hasWeapon[_arg1] = true;
weapons[_arg1].isInfAmmo = _arg2;
};
}
public function get isWeaponVisible():Boolean{
return (rifle.visible);
}
private function processInput(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = 4;
_local2 = 0;
_local3 = 0;
if (((((Input.isKeyDown(Input.W)) || (Input.isKeyDown(Keyboard.UP)))) && (!(checkCollision(x, (y - 5)))))){
_local3 = -1;
} else {
if (((((Input.isKeyDown(Input.S)) || (Input.isKeyDown(Keyboard.DOWN)))) && (!(checkCollision(x, (y + 5)))))){
_local3 = 1;
};
};
if (((((Input.isKeyDown(Input.A)) || (Input.isKeyDown(Keyboard.LEFT)))) && (!(checkCollision((x - 5), y))))){
_local2 = -1;
} else {
if (((((Input.isKeyDown(Input.D)) || (Input.isKeyDown(Keyboard.RIGHT)))) && (!(checkCollision((x + 5), y))))){
_local2 = 1;
};
};
if ((((((_local2 == 1)) && ((_local3 == 0)))) || ((((_local2 == 1)) && ((_local3 == 1)))))){
if (animation != Human.k_Right){
legs.gotoAndPlay("right");
animation = Human.k_Right;
};
} else {
if ((((_local2 == -1)) && ((_local3 == 0)))){
if (animation != Human.k_RightRev){
legs.gotoAndPlay("right-rev");
animation = Human.k_RightRev;
};
} else {
if ((((_local2 == 0)) && ((_local3 == 1)))){
if (animation != Human.k_UpRev){
legs.gotoAndPlay("up-rev");
animation = Human.k_UpRev;
};
} else {
if ((((((_local2 == 0)) && ((_local3 == -1)))) || ((((_local2 == -1)) && ((_local3 == -1)))))){
if (animation != Human.k_Up){
legs.gotoAndPlay("up");
animation = Human.k_Up;
};
} else {
if ((((_local2 == 1)) && ((_local3 == -1)))){
if (animation != Human.k_UpRight){
legs.gotoAndPlay("up-right");
animation = Human.k_UpRight;
};
} else {
if ((((_local2 == -1)) && ((_local3 == 1)))){
if (animation != Human.k_UpRightRev){
legs.gotoAndPlay("up-right-rev");
animation = Human.k_UpRightRev;
};
};
};
};
};
};
};
if ((((_local2 == 0)) && ((_local3 == 0)))){
legs.gotoAndStop("idle");
animation = Human.k_Idle;
} else {
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
x = (x + ((_local2 / _local4) * _local1));
y = (y + ((_local3 / _local4) * _local1));
};
}
public function testCollision(_arg1:BitmapData, _arg2:Number, _arg3:Number){
return (collisionCircle.hitTest(new Point((x + collision.x), (y + collision.y)), 1, _arg1, new Point(_arg2, _arg3)));
}
public function removeWeapon(_arg1:uint){
hasWeapon[_arg1] = false;
}
private function onEnterFrameHandler(_arg1:Event){
var _local2:Point;
if ((((((((weapon == null)) || ((rifle == null)))) || ((this is Assist)))) || (!(gameScreen.isActive)))){
return;
};
processInput();
if (Game.gameScreen.isPaused){
weapon.lastShotTime = 0;
return;
};
if (((weapon.isOverheat) && ((overheat == null)))){
overheat = new OverheatSmoke();
parent.addChild(overheat);
};
if (((((overheat) && ((overheat.alpha == 0)))) && (!(weapon.isOverheat)))){
parent.removeChild(overheat);
overheat = null;
};
healthBar.filler.scaleX = (health / 100);
weapon.isShooting = ((Input.isMouseDown) && (Game.gameScreen.isMouseEnabled));
weapon.update();
if (weapon.ammo != 0){
gunfire.visible = ((Input.isMouseDown) && (Game.gameScreen.isMouseEnabled));
gunfire.gotoAndStop(index);
index++;
if (index > 2){
index = 1;
};
} else {
gunfire.visible = false;
};
if (weapon.hasGunFire == false){
gunfire.visible = false;
};
if (((Input.isMouseDown) && (Game.gameScreen.isMouseEnabled))){
_local2 = rifle.localToGlobal(new Point(rifle.dot.x, rifle.dot.y));
weapon.fire(_local2.x, _local2.y, Game.stage.mouseX, Game.stage.mouseY, true);
};
aimTo(Game.stage.mouseX, Game.stage.mouseY);
}
}
}//package game
Section 38
//Input (game.Input)
package game {
import flash.events.*;
import flash.display.*;
public class Input {
public static const A = 65;
public static const D = 68;
public static const E = 69;
public static const F = 70;
public static const G = 71;
public static const H = 72;
public static const I = 73;
public static const C = 67;
public static const K = 75;
public static const L = 76;
public static const M = 77;
public static const N = 78;
public static const O = 79;
public static const P = 80;
public static const J = 74;
public static const R = 82;
public static const S = 83;
public static const T = 84;
public static const U = 85;
public static const V = 86;
public static const W = 87;
public static const Q = 81;
public static const Y = 89;
public static const B = 66;
public static const X = 88;
public static const Z = 90;
private static var _isMouseDown:Boolean = false;
private static var keyDown:Array = new Array();
private static var keyPressed:Array = new Array();
private static var _mouseX:Number = 0;
private static var _mouseY:Number = 0;
private static function onKeyUpHandler(_arg1:KeyboardEvent){
keyDown[_arg1.keyCode] = false;
}
static function initialize(_arg1:Stage){
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDownHandler);
_arg1.addEventListener(KeyboardEvent.KEY_UP, onKeyUpHandler);
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownHandler);
_arg1.addEventListener(MouseEvent.MOUSE_UP, onMouseUpHandler);
_arg1.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMoveHandler);
}
static function isKeyDown(_arg1:Number):Boolean{
return (keyDown[_arg1]);
}
private static function onKeyDownHandler(_arg1:KeyboardEvent){
keyDown[_arg1.keyCode] = true;
}
static function isKeyPressed(_arg1:Number):Boolean{
if (keyDown[_arg1]){
if (!keyPressed[_arg1]){
keyPressed[_arg1] = true;
return (true);
};
} else {
keyPressed[_arg1] = false;
};
return (false);
}
public static function get mouseY():Number{
return (_mouseY);
}
public static function get isMouseDown():Boolean{
return (_isMouseDown);
}
public static function get mouseX():Number{
return (_mouseX);
}
private static function onMouseDownHandler(_arg1:MouseEvent){
_isMouseDown = true;
}
private static function onMouseUpHandler(_arg1:MouseEvent){
_isMouseDown = false;
}
private static function onMouseMoveHandler(_arg1:MouseEvent){
_mouseX = _arg1.stageX;
_mouseY = _arg1.stageY;
}
}
}//package game
Section 39
//Laser (game.Laser)
package game {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.filters.*;
public class Laser extends Weapon {
private var sound:Sound;
private var _dx:Number;// = 0
private var laser:MovieClip;
private var burn:Sprite;
private var soundCh:SoundChannel;// = null
private var isVisible:Boolean;// = false
private var x:Number;// = 0
private var y:Number;// = 0
private var _dy:Number;// = 0
private var rotation:Number;// = 0
private var lastLength:Number;// = 0
public function Laser(){
var _local1:Array;
laser = new MovieClip();
burn = new Sprite();
rotation = 0;
x = 0;
y = 0;
isVisible = false;
lastLength = 0;
_dx = 0;
_dy = 0;
sound = new SoundLaserHissing();
soundCh = null;
super();
_local1 = new Array();
_local1.push(new BlurFilter(1, 1, 3));
_local1.push(new GlowFilter(0xFF0000, 1, 4, 4, 2, 3));
laser.filters = _local1;
burn.animation = Resources.sheet_LaserBurn;
}
private function renderBeam(_arg1:Number){
laser.graphics.clear();
laser.graphics.lineStyle(2, 0xFF0000, 0.7);
laser.graphics.moveTo(0, 0);
laser.graphics.lineTo(0, -(_arg1));
}
private function hit(_arg1:Number, _arg2:Number){
var _local3:CollisionGrid;
var _local4:uint;
var _local5:Point;
var _local6:ListNode;
var _local7:ListNode;
_local3 = Game.gameScreen.grid;
_local4 = _local3.getSectorIndex(_arg1, _arg2);
_local5 = new Point(_arg1, _arg2);
if (_local3.sectors[_local4]){
_local6 = _local3.sectors[_local4].end;
_local7 = _local3.sectors[_local4].begin;
while (_local7 != _local6) {
if (_local7.data == null){
} else {
Tracer.k_MonstersChecked++;
if (_local7.data.rect.containsPoint(_local5)){
_local7.data.hit(20, true);
break;
};
};
_local7 = _local7.next;
};
};
}
override public function render(_arg1:BitmapData){
var _local2:GameScreen;
var _local3:Matrix;
_local2 = Game.gameScreen;
if (((((!(isVisible)) || ((((_local2.getAmmo(Weapon.LaserGun) <= 0)) && (!(_isInfAmmo)))))) || ((_overheat >= 100)))){
return;
};
_local3 = new Matrix();
_local3.rotate(Common.deg2Rad(rotation));
_local3.translate(x, y);
_arg1.draw(laser, _local3);
burn.render(_arg1);
}
override public function fire(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean):uint{
var _local6:GameScreen;
var _local7:Number;
var _local8:Number;
var _local9:*;
_local6 = Game.gameScreen;
if ((((((_local6.getAmmo(Weapon.LaserGun) <= 0)) && (!(_isInfAmmo)))) || ((_overheat >= 100)))){
return (0);
};
_local7 = (_arg3 - _arg1);
_local8 = (_arg4 - _arg2);
_local9 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
_local7 = (_local7 / _local9);
_local8 = (_local8 / _local9);
x = _arg1;
y = _arg2;
rotation = ((-180 * Math.atan2(-(_local7), -(_local8))) / Math.PI);
if (lastLength != _local9){
renderBeam(_local9);
lastLength = _local9;
};
Game.gameScreen.spawnDecal(Resources.bitmap_ExplosionHit, _arg3, _arg4, 0.2, 0, 0.5);
hit(_arg3, _arg4);
burn.x = (_arg3 - (burn.animation.frameWidth * 0.5));
burn.y = ((_arg4 - burn.animation.frameHeight) + 10);
_dx = _local7;
_dy = _local8;
_overheat = (_overheat + _overheatRate);
_local6.removeAmmo(Weapon.LaserGun, 1);
if (_overheat >= 100){
_overheat = (_overheat + 50);
};
return (0);
}
override public function update(){
super.update();
isVisible = Input.isMouseDown;
burn.update();
if (!isShooting){
laser.graphics.clear();
if (soundCh != null){
soundCh.stop();
soundCh = null;
};
} else {
if (soundCh == null){
soundCh = sound.play();
soundCh.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
};
};
}
private function onSoundComplete(_arg1:Event){
soundCh = sound.play();
soundCh.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
}
}
}//package game
Section 40
//Level (game.Level)
package game {
import flash.utils.*;
public class Level {
public var k_StTeslaAmmoMin:uint;// = 50
public var k_StMinigunAmmoMin:uint;// = 50
public var k_StRadioCost:uint;// = 2
public var k_StTeslaAmmoMax:uint;// = 150
public var tesla:uint;// = 0
public var k_StFlameTrapCost:uint;// = 2
public var k_StGrenadeAmmoProb:Number;// = 0.1
public var k_StSurvivalMin:uint;// = 0
public var k_StMinigunAmmoMax:uint;// = 150
public var acumulator:uint;// = 0
public var k_StSurvivalProb:Number;// = 0.3
public var golem:uint;// = 1
public var background:uint;// = 0
public var k_StAK74AmmoMin:uint;// = 50
public var k_StRifleAmmoMin:uint;// = 50
public var mob3:uint;// = 1
public var k_StTeslaCost:uint;// = 2
public var k_StSurvivalMax:uint;// = 2
public var k_StAK74AmmoMax:uint;// = 150
public var monsterStrength:Number;// = 1
public var k_StAK74AmmoProb:Number;// = 0.2
public var mob1:uint;// = 1
public var k_StRifleAmmoMax:uint;// = 150
public var k_StAK74Prob:Number;// = 0.25
public var enableNight:Boolean;// = false
public var k_StLaserAmmoProb:Number;// = 0.2
public var k_StRifleAmmoProb:Number;// = 0.5
public var jackhammer:uint;// = 0
public var k_StFlameAmmoMin:uint;// = 50
public var k_StMinigunProb:Number;// = 0.05
public var k_StLaserProb:Number;// = 0.01
public var k_StSearchCost:uint;// = 4
public var k_StMinigunAmmoProb:Number;// = 0.1
public var k_StFlameAmmoMax:uint;// = 150
public var flamethrower:uint;// = 0
public var minigun:uint;// = 0
public var scorp:uint;// = 1
public var k_StGrenadeAmmoMin:uint;// = 1
public var enableSnow:Boolean;// = false
public var k_StRepairCost:uint;// = 2
public var k_StJackAmmoMin:uint;// = 50
public var k_StTeslaAmmoProb:Number;// = 0.2
public var k_StTeslaProb:Number;// = 0.01
public var k_StGrenadeAmmoMax:uint;// = 5
public var k_StJackAmmoProb:Number;// = 0.2
public var k_StFlameAmmoProb:Number;// = 0.2
public var k_StJackAmmoMax:uint;// = 150
public var k_StJackProb:Number;// = 0.075
public var laser:uint;// = 0
public var k_StLaserAmmoMin:uint;// = 50
public var isLoaded:Boolean;// = false
public var k_StFlameProb:Number;// = 0.025
public var gasCylinder:uint;// = 0
public var k_StLaserAmmoMax:uint;// = 150
public var spider:uint;// = 0
public var k_StUpgradeCost:uint;// = 2
public var radio:uint;// = 0
static var level10:String = "<?xml version="1.0" encoding="UTF-8"?><level> <property name="spider" value="1" /> <property name="golem" value="0" /> <property name="gasCylinder" value="0" /> <property name="k_StFlameProb" value="0" /> <property name="k_StMinigunAmmoProb" value="0" /> <property name="k_StLaserProb" value="0" /> <property name="k_StMinigunAmmoMax" value="150" /> <property name="k_StRadioCost" value="2" /> <property name="isLoaded" value="true" /> <property name="k_StMinigunProb" value="0" /> <property name="acumulator" value="0" /> <property name="k_StTeslaCost" value="2" /> <property name="k_StJackAmmoMin" value="50" /> <property name="k_StRifleAmmoMin" value="50" /> <property name="k_StSurvivalMax" value="1" /> <property name="k_StLaserAmmoProb" value="0" /> <property name="k_StMinigunAmmoMin" value="50" /> <property name="k_StRifleAmmoMax" value="200" /> <property name="k_StFlameAmmoMax" value="150" /> <property name="k_StAK74AmmoMin" value="50" /> <property name="k_StGrenadeAmmoMin" value="1" /> <property name="k_StTeslaProb" value="0" /> <property name="k_StSurvivalProb" value="0" /> <property name="k_StJackAmmoMax" value="150" /> <property name="k_StTeslaAmmoMin" value="50" /> <property name="k_StJackAmmoProb" value="0.1" /> <property name="k_StFlameAmmoProb" value="0" /> <property name="k_StAK74Prob" value="0.1" /> <property name="k_StJackProb" value="0" /> <property name="tesla" value="0" /> <property name="k_StTeslaAmmoProb" value="0" /> <property name="jackhammer" value="1" /> <property name="mob3" value="0" /> <property name="k_StFlameTrapCost" value="2" /> <property name="k_StLaserAmmoMax" value="150" /> <property name="k_StSearchCost" value="4" /> <property name="k_StFlameAmmoMin" value="50" /> <property name="monsterStrength" value="0.7" /> <property name="k_StTeslaAmmoMax" value="150" /> <property name="k_StUpgradeCost" value="2" /> <property name="k_StSurvivalMin" value="0" /> <property name="k_StAK74AmmoProb" value="0.4" /> <property name="k_StLaserAmmoMin" value="50" /> <property name="k_StRifleAmmoProb" value="1" /> <property name="scorp" value="0" /> <property name="enableSnow" value="false" /> <property name="enableNight" value="true" /> <property name="radio" value="0" /> <property name="k_StRepairCost" value="2" /> <property name="background" value="0" /> <property name="k_StGrenadeAmmoMax" value="5" /> <property name="flamethrower" value="0" /> <property name="k_StAK74AmmoMax" value="150" /> <property name="mob1" value="0" /> <property name="minigun" value="0" /> <property name="k_StGrenadeAmmoProb" value="0.2" /> <property name="laser" value="0" /></level>";
static var level0:String = "<?xml version="1.0" encoding="UTF-8"?><level> <property name="golem" value="0" /> <property name="gasCylinder" value="0" /> <property name="k_StFlameProb" value="0" /> <property name="k_StMinigunAmmoProb" value="0" /> <property name="k_StLaserProb" value="0" /> <property name="k_StMinigunAmmoMax" value="150" /> <property name="k_StRadioCost" value="2" /> <property name="isLoaded" value="true" /> <property name="k_StMinigunProb" value="0" /> <property name="acumulator" value="0" /> <property name="k_StTeslaCost" value="2" /> <property name="k_StJackAmmoMin" value="50" /> <property name="k_StRifleAmmoMin" value="50" /> <property name="k_StSurvivalMax" value="1" /> <property name="k_StLaserAmmoProb" value="0" /> <property name="k_StMinigunAmmoMin" value="50" /> <property name="k_StRifleAmmoMax" value="200" /> <property name="k_StFlameAmmoMax" value="150" /> <property name="k_StAK74AmmoMin" value="50" /> <property name="k_StGrenadeAmmoMin" value="1" /> <property name="k_StTeslaProb" value="0" /> <property name="k_StSurvivalProb" value="0" /> <property name="k_StJackAmmoMax" value="150" /> <property name="k_StTeslaAmmoMin" value="50" /> <property name="k_StJackAmmoProb" value="0.1" /> <property name="k_StFlameAmmoProb" value="0" /> <property name="k_StAK74Prob" value="0.0" /> <property name="k_StJackProb" value="0.1" /> <property name="tesla" value="0" /> <property name="k_StTeslaAmmoProb" value="0" /> <property name="jackhammer" value="1" /> <property name="mob3" value="0" /> <property name="k_StFlameTrapCost" value="2" /> <property name="k_StLaserAmmoMax" value="150" /> <property name="k_StSearchCost" value="4" /> <property name="k_StFlameAmmoMin" value="50" /> <property name="monsterStrength" value="0.7" /> <property name="k_StTeslaAmmoMax" value="150" /> <property name="k_StUpgradeCost" value="2" /> <property name="k_StSurvivalMin" value="0" /> <property name="k_StAK74AmmoProb" value="0.4" /> <property name="k_StLaserAmmoMin" value="50" /> <property name="k_StRifleAmmoProb" value="1" /> <property name="scorp" value="1" /> <property name="enableSnow" value="false" /> <property name="enableNight" value="true" /> <property name="radio" value="0" /> <property name="k_StRepairCost" value="2" /> <property name="background" value="0" /> <property name="k_StGrenadeAmmoMax" value="5" /> <property name="flamethrower" value="0" /> <property name="k_StAK74AmmoMax" value="150" /> <property name="mob1" value="1" /> <property name="minigun" value="0" /> <property name="k_StGrenadeAmmoProb" value="0.2" /> <property name="laser" value="0" /></level>";
static var level1:String = "<?xml version="1.0" encoding="UTF-8"?><level> <property name="golem" value="1" /> <property name="gasCylinder" value="1" /> <property name="k_StFlameProb" value="0" /> <property name="k_StMinigunAmmoProb" value="0" /> <property name="k_StLaserProb" value="0" /> <property name="k_StMinigunAmmoMax" value="150" /> <property name="k_StRadioCost" value="2" /> <property name="isLoaded" value="true" /> <property name="k_StMinigunProb" value="0" /> <property name="acumulator" value="0" /> <property name="k_StTeslaCost" value="2" /> <property name="k_StJackAmmoMin" value="50" /> <property name="k_StRifleAmmoMin" value="50" /> <property name="k_StSurvivalMax" value="1" /> <property name="k_StLaserAmmoProb" value="0" /> <property name="k_StMinigunAmmoMin" value="50" /> <property name="k_StRifleAmmoMax" value="200" /> <property name="k_StFlameAmmoMax" value="150" /> <property name="k_StAK74AmmoMin" value="50" /> <property name="k_StGrenadeAmmoMin" value="1" /> <property name="k_StTeslaProb" value="0" /> <property name="k_StSurvivalProb" value="0" /> <property name="k_StJackAmmoMax" value="150" /> <property name="k_StTeslaAmmoMin" value="50" /> <property name="k_StJackAmmoProb" value="0.3" /> <property name="k_StFlameAmmoProb" value="0" /> <property name="k_StAK74Prob" value="0.0" /> <property name="k_StJackProb" value="0.1" /> <property name="tesla" value="0" /> <property name="k_StTeslaAmmoProb" value="0" /> <property name="jackhammer" value="1" /> <property name="mob3" value="0" /> <property name="k_StFlameTrapCost" value="2" /> <property name="k_StLaserAmmoMax" value="150" /> <property name="k_StSearchCost" value="4" /> <property name="k_StFlameAmmoMin" value="50" /> <property name="monsterStrength" value="0.7" /> <property name="k_StTeslaAmmoMax" value="150" /> <property name="k_StUpgradeCost" value="2" /> <property name="k_StSurvivalMin" value="0" /> <property name="k_StAK74AmmoProb" value="0.7" /> <property name="k_StLaserAmmoMin" value="50" /> <property name="k_StRifleAmmoProb" value="0.5" /> <property name="scorp" value="1" /> <property name="enableSnow" value="false" /> <property name="enableNight" value="false" /> <property name="radio" value="0" /> <property name="k_StRepairCost" value="2" /> <property name="background" value="2" /> <property name="k_StGrenadeAmmoMax" value="3" /> <property name="flamethrower" value="0" /> <property name="k_StAK74AmmoMax" value="150" /> <property name="mob1" value="1" /> <property name="minigun" value="0" /> <property name="k_StGrenadeAmmoProb" value="0.4" /> <property name="laser" value="0" /></level>";
static var level2:String = "<?xml version="1.0" encoding="UTF-8"?><level> <property name="golem" value="1" /> <property name="gasCylinder" value="1" /> <property name="k_StFlameProb" value="0" /> <property name="k_StMinigunAmmoProb" value="0" /> <property name="k_StLaserProb" value="0" /> <property name="k_StMinigunAmmoMax" value="150" /> <property name="k_StRadioCost" value="2" /> <property name="isLoaded" value="true" /> <property name="k_StMinigunProb" value="0" /> <property name="acumulator" value="0" /> <property name="k_StTeslaCost" value="2" /> <property name="k_StJackAmmoMin" value="50" /> <property name="k_StRifleAmmoMin" value="50" /> <property name="k_StSurvivalMax" value="1" /> <property name="k_StLaserAmmoProb" value="0" /> <property name="k_StMinigunAmmoMin" value="50" /> <property name="k_StRifleAmmoMax" value="200" /> <property name="k_StFlameAmmoMax" value="150" /> <property name="k_StAK74AmmoMin" value="50" /> <property name="k_StGrenadeAmmoMin" value="1" /> <property name="k_StTeslaProb" value="0" /> <property name="k_StSurvivalProb" value="0.3" /> <property name="k_StJackAmmoMax" value="150" /> <property name="k_StTeslaAmmoMin" value="50" /> <property name="k_StJackAmmoProb" value="0.6" /> <property name="k_StFlameAmmoProb" value="0" /> <property name="k_StAK74Prob" value="0.3" /> <property name="k_StJackProb" value="0.1" /> <property name="tesla" value="0" /> <property name="k_StTeslaAmmoProb" value="0" /> <property name="jackhammer" value="1" /> <property name="mob3" value="0" /> <property name="k_StFlameTrapCost" value="2" /> <property name="k_StLaserAmmoMax" value="150" /> <property name="k_StSearchCost" value="4" /> <property name="k_StFlameAmmoMin" value="50" /> <property name="monsterStrength" value="0.9" /> <property name="k_StTeslaAmmoMax" value="150" /> <property name="k_StUpgradeCost" value="2" /> <property name="k_StSurvivalMin" value="1" /> <property name="k_StAK74AmmoProb" value="0.6" /> <property name="k_StLaserAmmoMin" value="50" /> <property name="k_StRifleAmmoProb" value="0.6" /> <property name="scorp" value="0" /> <property name="enableSnow" value="false" /> <property name="enableNight" value="false" /> <property name="radio" value="0" /> <property name="k_StRepairCost" value="2" /> <property name="background" value="2" /> <property name="k_StGrenadeAmmoMax" value="3" /> <property name="flamethrower" value="1" /> <property name="k_StAK74AmmoMax" value="150" /> <property name="mob1" value="1" /> <property name="minigun" value="0" /> <property name="k_StGrenadeAmmoProb" value="0.3" /> <property name="laser" value="0" /></level>";
static var level3:String = "<?xml version="1.0" encoding="UTF-8"?><level> <property name="golem" value="1" /> <property name="gasCylinder" value="1" /> <property name="k_StFlameProb" value="0.2" /> <property name="k_StMinigunAmmoProb" value="0" /> <property name="k_StLaserProb" value="0" /> <property name="k_StMinigunAmmoMax" value="150" /> <property name="k_StRadioCost" value="2" /> <property name="isLoaded" value="true" /> <property name="k_StMinigunProb" value="0" /> <property name="acumulator" value="0" /> <property name="k_StTeslaCost" value="2" /> <property name="k_StJackAmmoMin" value="50" /> <property name="k_StRifleAmmoMin" value="50" /> <property name="k_StSurvivalMax" value="1" /> <property name="k_StLaserAmmoProb" value="0" /> <property name="k_StMinigunAmmoMin" value="50" /> <property name="k_StRifleAmmoMax" value="200" /> <property name="k_StFlameAmmoMax" value="150" /> <property name="k_StAK74AmmoMin" value="50" /> <property name="k_StGrenadeAmmoMin" value="1" /> <property name="k_StTeslaProb" value="0" /> <property name="k_StSurvivalProb" value="0" /> <property name="k_StJackAmmoMax" value="150" /> <property name="k_StTeslaAmmoMin" value="50" /> <property name="k_StJackAmmoProb" value="0.5" /> <property name="k_StFlameAmmoProb" value="0.5" /> <property name="k_StAK74Prob" value="1" /> <property name="k_StJackProb" value="0.5" /> <property name="tesla" value="0" /> <property name="k_StTeslaAmmoProb" value="0" /> <property name="jackhammer" value="1" /> <property name="mob3" value="0" /> <property name="k_StFlameTrapCost" value="2" /> <property name="k_StLaserAmmoMax" value="150" /> <property name="k_StSearchCost" value="4" /> <property name="k_StFlameAmmoMin" value="50" /> <property name="monsterStrength" value="1" /> <property name="k_StTeslaAmmoMax" value="150" /> <property name="k_StUpgradeCost" value="2" /> <property name="k_StSurvivalMin" value="0" /> <property name="k_StAK74AmmoProb" value="0.5" /> <property name="k_StLaserAmmoMin" value="50" /> <property name="k_StRifleAmmoProb" value="0.6" /> <property name="scorp" value="1" /> <property name="enableSnow" value="false" /> <property name="enableNight" value="false" /> <property name="radio" value="0" /> <property name="k_StRepairCost" value="2" /> <property name="background" value="2" /> <property name="k_StGrenadeAmmoMax" value="3" /> <property name="flamethrower" value="1" /> <property name="k_StAK74AmmoMax" value="150" /> <property name="mob1" value="1" /> <property name="minigun" value="0" /> <property name="k_StGrenadeAmmoProb" value="0.8" /> <property name="laser" value="0" /></level>";
static var level4:String = "<?xml version="1.0" encoding="UTF-8"?><level> <property name="golem" value="0" /> <property name="gasCylinder" value="1" /> <property name="k_StFlameProb" value="0.5" /> <property name="k_StMinigunAmmoProb" value="0" /> <property name="k_StLaserProb" value="0.3" /> <property name="k_StMinigunAmmoMax" value="150" /> <property name="k_StRadioCost" value="2" /> <property name="isLoaded" value="true" /> <property name="k_StMinigunProb" value="0" /> <property name="acumulator" value="0" /> <property name="k_StTeslaCost" value="2" /> <property name="k_StJackAmmoMin" value="50" /> <property name="k_StRifleAmmoMin" value="50" /> <property name="k_StSurvivalMax" value="2" /> <property name="k_StLaserAmmoProb" value="0.2" /> <property name="k_StMinigunAmmoMin" value="50" /> <property name="k_StRifleAmmoMax" value="200" /> <property name="k_StFlameAmmoMax" value="150" /> <property name="k_StAK74AmmoMin" value="50" /> <property name="k_StGrenadeAmmoMin" value="1" /> <property name="k_StTeslaProb" value="0" /> <property name="k_StSurvivalProb" value="0.3" /> <property name="k_StJackAmmoMax" value="150" /> <property name="k_StTeslaAmmoMin" value="50" /> <property name="k_StJackAmmoProb" value="0.5" /> <property name="k_StFlameAmmoProb" value="0.8" /> <property name="k_StAK74Prob" value="0.3" /> <property name="k_StJackProb" value="0.1" /> <property name="tesla" value="0" /> <property name="k_StTeslaAmmoProb" value="0" /> <property name="jackhammer" value="1" /> <property name="mob3" value="0" /> <property name="k_StFlameTrapCost" value="2" /> <property name="k_StLaserAmmoMax" value="150" /> <property name="k_StSearchCost" value="4" /> <property name="k_StFlameAmmoMin" value="50" /> <property name="monsterStrength" value="1.3" /> <property name="k_StTeslaAmmoMax" value="150" /> <property name="k_StUpgradeCost" value="2" /> <property name="k_StSurvivalMin" value="0" /> <property name="k_StAK74AmmoProb" value="0.2" /> <property name="k_StLaserAmmoMin" value="50" /> <property name="k_StRifleAmmoProb" value="0.2" /> <property name="scorp" value="1" /> <property name="enableSnow" value="false" /> <property name="enableNight" value="true" /> <property name="radio" value="1" /> <property name="k_StRepairCost" value="2" /> <property name="background" value="2" /> <property name="k_StGrenadeAmmoMax" value="3" /> <property name="flamethrower" value="1" /> <property name="k_StAK74AmmoMax" value="150" /> <property name="mob1" value="1" /> <property name="minigun" value="0" /> <property name="k_StGrenadeAmmoProb" value="0.3" /> <property name="laser" value="0" /></level>";
static var level5:String = "<?xml version="1.0" encoding="UTF-8"?><level> <property name="golem" value="1" /> <property name="gasCylinder" value="1" /> <property name="k_StFlameProb" value="0.2" /> <property name="k_StMinigunAmmoProb" value="0.6" /> <property name="k_StLaserProb" value="0.5" /> <property name="k_StMinigunAmmoMax" value="150" /> <property name="k_StRadioCost" value="2" /> <property name="isLoaded" value="true" /> <property name="k_StMinigunProb" value="0.4" /> <property name="acumulator" value="0" /> <property name="k_StTeslaCost" value="2" /> <property name="k_StJackAmmoMin" value="50" /> <property name="k_StRifleAmmoMin" value="50" /> <property name="k_StSurvivalMax" value="1" /> <property name="k_StLaserAmmoProb" value="0.8" /> <property name="k_StMinigunAmmoMin" value="50" /> <property name="k_StRifleAmmoMax" value="200" /> <property name="k_StFlameAmmoMax" value="150" /> <property name="k_StAK74AmmoMin" value="50" /> <property name="k_StGrenadeAmmoMin" value="1" /> <property name="k_StTeslaProb" value="0" /> <property name="k_StSurvivalProb" value="0.3" /> <property name="k_StJackAmmoMax" value="150" /> <property name="k_StTeslaAmmoMin" value="50" /> <property name="k_StJackAmmoProb" value="0.5" /> <property name="k_StFlameAmmoProb" value="0.5" /> <property name="k_StAK74Prob" value="0.1" /> <property name="k_StJackProb" value="0.1" /> <property name="tesla" value="0" /> <property name="k_StTeslaAmmoProb" value="0" /> <property name="jackhammer" value="1" /> <property name="mob3" value="0" /> <property name="k_StFlameTrapCost" value="2" /> <property name="k_StLaserAmmoMax" value="150" /> <property name="k_StSearchCost" value="4" /> <property name="k_StFlameAmmoMin" value="50" /> <property name="monsterStrength" value="1.5" /> <property name="k_StTeslaAmmoMax" value="150" /> <property name="k_StUpgradeCost" value="2" /> <property name="k_StSurvivalMin" value="1" /> <property name="k_StAK74AmmoProb" value="0.5" /> <property name="k_StLaserAmmoMin" value="50" /> <property name="k_StRifleAmmoProb" value="0.4" /> <property name="scorp" value="0" /> <property name="enableSnow" value="false" /> <property name="enableNight" value="false" /> <property name="radio" value="1" /> <property name="k_StRepairCost" value="2" /> <property name="background" value="3" /> <property name="k_StGrenadeAmmoMax" value="3" /> <property name="flamethrower" value="1" /> <property name="k_StAK74AmmoMax" value="150" /> <property name="mob1" value="0" /> <property name="minigun" value="1" /> <property name="k_StGrenadeAmmoProb" value="0.4" /> <property name="laser" value="1" /></level>";
static var level6:String = "<?xml version="1.0" encoding="UTF-8"?><level> <property name="golem" value="1" /> <property name="gasCylinder" value="1" /> <property name="k_StFlameProb" value="0.5" /> <property name="k_StMinigunAmmoProb" value="0.6" /> <property name="k_StLaserProb" value="0.4" /> <property name="k_StMinigunAmmoMax" value="150" /> <property name="k_StRadioCost" value="2" /> <property name="isLoaded" value="true" /> <property name="k_StMinigunProb" value="0.7" /> <property name="acumulator" value="1" /> <property name="k_StTeslaCost" value="2" /> <property name="k_StJackAmmoMin" value="50" /> <property name="k_StRifleAmmoMin" value="50" /> <property name="k_StSurvivalMax" value="1" /> <property name="k_StLaserAmmoProb" value="0.2" /> <property name="k_StMinigunAmmoMin" value="50" /> <property name="k_StRifleAmmoMax" value="200" /> <property name="k_StFlameAmmoMax" value="150" /> <property name="k_StAK74AmmoMin" value="50" /> <property name="k_StGrenadeAmmoMin" value="1" /> <property name="k_StTeslaProb" value="0.8" /> <property name="k_StSurvivalProb" value="0.3" /> <property name="k_StJackAmmoMax" value="150" /> <property name="k_StTeslaAmmoMin" value="50" /> <property name="k_StJackAmmoProb" value="0.5" /> <property name="k_StFlameAmmoProb" value="0.4" /> <property name="k_StAK74Prob" value="0.5" /> <property name="k_StJackProb" value="0.5" /> <property name="tesla" value="0" /> <property name="k_StTeslaAmmoProb" value="0.9" /> <property name="jackhammer" value="1" /> <property name="mob3" value="1" /> <property name="k_StFlameTrapCost" value="2" /> <property name="k_StLaserAmmoMax" value="150" /> <property name="k_StSearchCost" value="4" /> <property name="k_StFlameAmmoMin" value="50" /> <property name="monsterStrength" value="1.7" /> <property name="k_StTeslaAmmoMax" value="150" /> <property name="k_StUpgradeCost" value="2" /> <property name="k_StSurvivalMin" value="1" /> <property name="k_StAK74AmmoProb" value="0.4" /> <property name="k_StLaserAmmoMin" value="50" /> <property name="k_StRifleAmmoProb" value="0.3" /> <property name="scorp" value="0" /> <property name="enableSnow" value="false" /> <property name="enableNight" value="false" /> <property name="radio" value="1" /> <property name="k_StRepairCost" value="2" /> <property name="background" value="3" /> <property name="k_StGrenadeAmmoMax" value="3" /> <property name="flamethrower" value="1" /> <property name="k_StAK74AmmoMax" value="150" /> <property name="mob1" value="1" /> <property name="minigun" value="1" /> <property name="k_StGrenadeAmmoProb" value="0.8" /> <property name="laser" value="1" /></level>";
static var level7:String = "<?xml version="1.0" encoding="UTF-8"?><level> <property name="golem" value="0" /> <property name="gasCylinder" value="1" /> <property name="k_StFlameProb" value="0.3" /> <property name="k_StMinigunAmmoProb" value="0.4" /> <property name="k_StLaserProb" value="0.3" /> <property name="k_StMinigunAmmoMax" value="150" /> <property name="k_StRadioCost" value="2" /> <property name="isLoaded" value="true" /> <property name="k_StMinigunProb" value="0.3" /> <property name="acumulator" value="1" /> <property name="k_StTeslaCost" value="2" /> <property name="k_StJackAmmoMin" value="50" /> <property name="k_StRifleAmmoMin" value="50" /> <property name="k_StSurvivalMax" value="1" /> <property name="k_StLaserAmmoProb" value="0.2" /> <property name="k_StMinigunAmmoMin" value="50" /> <property name="k_StRifleAmmoMax" value="200" /> <property name="k_StFlameAmmoMax" value="150" /> <property name="k_StAK74AmmoMin" value="50" /> <property name="k_StGrenadeAmmoMin" value="1" /> <property name="k_StTeslaProb" value="0.6" /> <property name="k_StSurvivalProb" value="0.2" /> <property name="k_StJackAmmoMax" value="150" /> <property name="k_StTeslaAmmoMin" value="50" /> <property name="k_StJackAmmoProb" value="0.3" /> <property name="k_StFlameAmmoProb" value="0.4" /> <property name="k_StAK74Prob" value="0.3" /> <property name="k_StJackProb" value="0.3" /> <property name="tesla" value="1" /> <property name="k_StTeslaAmmoProb" value="0.5" /> <property name="jackhammer" value="1" /> <property name="mob3" value="1" /> <property name="k_StFlameTrapCost" value="2" /> <property name="k_StLaserAmmoMax" value="150" /> <property name="k_StSearchCost" value="4" /> <property name="k_StFlameAmmoMin" value="50" /> <property name="monsterStrength" value="1.8" /> <property name="k_StTeslaAmmoMax" value="150" /> <property name="k_StUpgradeCost" value="2" /> <property name="k_StSurvivalMin" value="1" /> <property name="k_StAK74AmmoProb" value="0.4" /> <property name="k_StLaserAmmoMin" value="50" /> <property name="k_StRifleAmmoProb" value="0.3" /> <property name="scorp" value="1" /> <property name="enableSnow" value="false" /> <property name="enableNight" value="false" /> <property name="radio" value="1" /> <property name="k_StRepairCost" value="2" /> <property name="background" value="1" /> <property name="k_StGrenadeAmmoMax" value="3" /> <property name="flamethrower" value="1" /> <property name="k_StAK74AmmoMax" value="150" /> <property name="mob1" value="0" /> <property name="minigun" value="1" /> <property name="k_StGrenadeAmmoProb" value="0.8" /> <property name="laser" value="1" /></level>";
static var level8:String = "<?xml version="1.0" encoding="UTF-8"?><level> <property name="golem" value="0" /> <property name="gasCylinder" value="1" /> <property name="k_StFlameProb" value="0.2" /> <property name="k_StMinigunAmmoProb" value="0.5" /> <property name="k_StLaserProb" value="0.2" /> <property name="k_StMinigunAmmoMax" value="150" /> <property name="k_StRadioCost" value="2" /> <property name="isLoaded" value="true" /> <property name="k_StMinigunProb" value="0.5" /> <property name="acumulator" value="1" /> <property name="k_StTeslaCost" value="2" /> <property name="k_StJackAmmoMin" value="50" /> <property name="k_StRifleAmmoMin" value="50" /> <property name="k_StSurvivalMax" value="1" /> <property name="k_StLaserAmmoProb" value="0.3" /> <property name="k_StMinigunAmmoMin" value="50" /> <property name="k_StRifleAmmoMax" value="200" /> <property name="k_StFlameAmmoMax" value="150" /> <property name="k_StAK74AmmoMin" value="50" /> <property name="k_StGrenadeAmmoMin" value="1" /> <property name="k_StTeslaProb" value="0.8" /> <property name="k_StSurvivalProb" value="0.2" /> <property name="k_StJackAmmoMax" value="150" /> <property name="k_StTeslaAmmoMin" value="50" /> <property name="k_StJackAmmoProb" value="0.3" /> <property name="k_StFlameAmmoProb" value="0.3" /> <property name="k_StAK74Prob" value="0" /> <property name="k_StJackProb" value="0.2" /> <property name="tesla" value="1" /> <property name="k_StTeslaAmmoProb" value="0.5" /> <property name="jackhammer" value="1" /> <property name="mob3" value="1" /> <property name="k_StFlameTrapCost" value="2" /> <property name="k_StLaserAmmoMax" value="150" /> <property name="k_StSearchCost" value="4" /> <property name="k_StFlameAmmoMin" value="50" /> <property name="monsterStrength" value="1.9" /> <property name="k_StTeslaAmmoMax" value="150" /> <property name="k_StUpgradeCost" value="2" /> <property name="k_StSurvivalMin" value="1" /> <property name="k_StAK74AmmoProb" value="0" /> <property name="k_StLaserAmmoMin" value="50" /> <property name="k_StRifleAmmoProb" value="0" /> <property name="scorp" value="1" /> <property name="enableSnow" value="true" /> <property name="enableNight" value="false" /> <property name="radio" value="1" /> <property name="k_StRepairCost" value="2" /> <property name="background" value="1" /> <property name="k_StGrenadeAmmoMax" value="3" /> <property name="flamethrower" value="1" /> <property name="k_StAK74AmmoMax" value="150" /> <property name="mob1" value="1" /> <property name="minigun" value="1" /> <property name="k_StGrenadeAmmoProb" value="0.3" /> <property name="laser" value="1" /></level>";
static var level9:String = "<?xml version="1.0" encoding="UTF-8"?><level> <property name="golem" value="1" /> <property name="gasCylinder" value="1" /> <property name="k_StFlameProb" value="0.2" /> <property name="k_StMinigunAmmoProb" value="0.5" /> <property name="k_StLaserProb" value="0.2" /> <property name="k_StMinigunAmmoMax" value="150" /> <property name="k_StRadioCost" value="2" /> <property name="isLoaded" value="true" /> <property name="k_StMinigunProb" value="0.5" /> <property name="acumulator" value="1" /> <property name="k_StTeslaCost" value="2" /> <property name="k_StJackAmmoMin" value="50" /> <property name="k_StRifleAmmoMin" value="50" /> <property name="k_StSurvivalMax" value="1" /> <property name="k_StLaserAmmoProb" value="0.3" /> <property name="k_StMinigunAmmoMin" value="50" /> <property name="k_StRifleAmmoMax" value="200" /> <property name="k_StFlameAmmoMax" value="150" /> <property name="k_StAK74AmmoMin" value="50" /> <property name="k_StGrenadeAmmoMin" value="1" /> <property name="k_StTeslaProb" value="0.8" /> <property name="k_StSurvivalProb" value="0.2" /> <property name="k_StJackAmmoMax" value="150" /> <property name="k_StTeslaAmmoMin" value="50" /> <property name="k_StJackAmmoProb" value="0.3" /> <property name="k_StFlameAmmoProb" value="0.3" /> <property name="k_StAK74Prob" value="0" /> <property name="k_StJackProb" value="0.2" /> <property name="tesla" value="1" /> <property name="k_StTeslaAmmoProb" value="0.5" /> <property name="jackhammer" value="1" /> <property name="mob3" value="1" /> <property name="k_StFlameTrapCost" value="2" /> <property name="k_StLaserAmmoMax" value="150" /> <property name="k_StSearchCost" value="4" /> <property name="k_StFlameAmmoMin" value="50" /> <property name="monsterStrength" value="2" /> <property name="k_StTeslaAmmoMax" value="150" /> <property name="k_StUpgradeCost" value="2" /> <property name="k_StSurvivalMin" value="1" /> <property name="k_StAK74AmmoProb" value="0" /> <property name="k_StLaserAmmoMin" value="50" /> <property name="k_StRifleAmmoProb" value="0" /> <property name="scorp" value="1" /> <property name="enableSnow" value="true" /> <property name="enableNight" value="false" /> <property name="radio" value="1" /> <property name="k_StRepairCost" value="2" /> <property name="background" value="1" /> <property name="k_StGrenadeAmmoMax" value="3" /> <property name="flamethrower" value="1" /> <property name="k_StAK74AmmoMax" value="150" /> <property name="mob1" value="1" /> <property name="minigun" value="1" /> <property name="k_StGrenadeAmmoProb" value="0.3" /> <property name="laser" value="1" /></level>";
static var levels:Array = new Array();
public function Level(){
background = 0;
enableNight = false;
enableSnow = false;
isLoaded = false;
monsterStrength = 1;
radio = 0;
gasCylinder = 0;
acumulator = 0;
jackhammer = 0;
flamethrower = 0;
laser = 0;
minigun = 0;
tesla = 0;
k_StSurvivalProb = 0.3;
k_StSurvivalMin = 0;
k_StSurvivalMax = 2;
k_StAK74Prob = 0.25;
k_StJackProb = 0.075;
k_StFlameProb = 0.025;
k_StLaserProb = 0.01;
k_StMinigunProb = 0.05;
k_StTeslaProb = 0.01;
k_StRifleAmmoProb = 0.5;
k_StRifleAmmoMin = 50;
k_StRifleAmmoMax = 150;
k_StAK74AmmoProb = 0.2;
k_StAK74AmmoMin = 50;
k_StAK74AmmoMax = 150;
k_StJackAmmoProb = 0.2;
k_StJackAmmoMin = 50;
k_StJackAmmoMax = 150;
k_StFlameAmmoProb = 0.2;
k_StFlameAmmoMin = 50;
k_StFlameAmmoMax = 150;
k_StLaserAmmoProb = 0.2;
k_StLaserAmmoMin = 50;
k_StLaserAmmoMax = 150;
k_StMinigunAmmoProb = 0.1;
k_StMinigunAmmoMin = 50;
k_StMinigunAmmoMax = 150;
k_StTeslaAmmoProb = 0.2;
k_StTeslaAmmoMin = 50;
k_StTeslaAmmoMax = 150;
k_StGrenadeAmmoProb = 0.1;
k_StGrenadeAmmoMin = 1;
k_StGrenadeAmmoMax = 5;
k_StSearchCost = 4;
k_StRepairCost = 2;
k_StUpgradeCost = 2;
k_StRadioCost = 2;
k_StFlameTrapCost = 2;
k_StTeslaCost = 2;
mob1 = 1;
mob3 = 1;
scorp = 1;
golem = 1;
spider = 0;
super();
if (levels.length == 0){
levels.push(level0);
levels.push(level1);
levels.push(level2);
levels.push(level3);
levels.push(level4);
levels.push(level5);
levels.push(level6);
levels.push(level7);
levels.push(level8);
levels.push(level9);
levels.push(level10);
};
}
public function random(){
background = Math.floor((Math.random() * 4));
enableNight = false;
enableSnow = (((Math.random() < 0.5)) && ((background == 1)));
}
public function writeLevel():String{
var _local1:String;
var _local2:XML;
var _local3:uint;
var _local4:String;
_local1 = "";
_local2 = describeType(this);
_local3 = 0;
_local1 = (_local1 + "<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
_local1 = (_local1 + "<level>");
while (_local2.variable[_local3] != undefined) {
_local4 = _local2.variable[_local3].@name;
_local1 = (_local1 + (((("\t<property name=\"" + _local4) + "\" value=\"") + this[_local4]) + "\" />"));
_local3++;
};
_local1 = (_local1 + "</level>\n");
return (_local1);
}
}
}//package game
Section 41
//List (game.List)
package game {
public class List {
private var _size:int;// = 0
private var _tail:ListNode;// = null
private var _head:ListNode;// = null
public function List(){
_head = null;
_tail = null;
_size = 0;
super();
_head = new ListNode(this);
_tail = new ListNode(this);
_head.next = _tail;
_tail.prev = _head;
}
public function traceListBack(){
var _local1:ListNode;
_local1 = _tail.prev;
trace("-- List values --");
while (_local1 != _head) {
trace(((((("Value: " + _local1.data) + " Prev. data: ") + ((_local1.prev)!=null) ? _local1.prev.data : "null") + " Next data: ") + ((_local1.next)!=null) ? _local1.next.data : "null"));
_local1 = _local1.prev;
};
trace("-----------------");
}
private function insertAfter(_arg1, _arg2:ListNode):ListNode{
var _local3:ListNode;
_local3 = new ListNode(this, _arg1);
_local3.prev = _arg2;
_local3.next = _arg2.next;
_arg2.next = _local3;
_local3.next.prev = _local3;
_size++;
return (_local3);
}
public function remove(_arg1:ListNode):ListNode{
var _local2:ListNode;
if (_arg1.list != this){
trace("ERROR! invalid node");
return (_tail);
};
_local2 = _arg1.next;
_arg1.prev.next = _arg1.next;
_arg1.next.prev = _arg1.prev;
_arg1.data = null;
_arg1.list = null;
_size--;
return (_local2);
}
public function get size():int{
return (_size);
}
public function get begin():ListNode{
return (_head.next);
}
public function forEach(_arg1:Function){
var _local2:ListNode;
_local2 = _head.next;
while (_local2 != _tail) {
_arg1(_local2);
_local2 = _local2.next;
};
}
private function mergeLists(_arg1:List, _arg2:List, _arg3:Function):List{
var _local4:List;
var _local5:int;
_local4 = new List();
if (_arg3 == null){
while ((((_arg1.size > 0)) && ((_arg2.size > 0)))) {
if (_arg1.begin.data <= _arg2.begin.data){
_local4.attach(_arg1.begin);
} else {
_local4.attach(_arg2.begin);
};
};
} else {
while ((((_arg1.size > 0)) && ((_arg2.size > 0)))) {
_local5 = _arg3(_arg1.begin.data, _arg2.begin.data);
if ((((_local5 == -1)) || ((_local5 == 0)))){
_local4.attach(_arg1.begin);
} else {
_local4.attach(_arg2.begin);
};
};
};
while (_arg1.size > 0) {
_local4.attach(_arg1.begin);
};
while (_arg2.size > 0) {
_local4.attach(_arg2.begin);
};
return (_local4);
}
public function sort(_arg1:Function=null):List{
var _local2:List;
_local2 = mergeSort(this, _arg1);
return (_local2);
}
public function traceNodes(_arg1:ListNode){
while (_arg1.data != null) {
trace(_arg1.data);
_arg1 = _arg1.next;
};
}
public function traceList(){
var _local1:ListNode;
_local1 = _head.next;
trace((("-- List values( " + size) + " total ) --"));
while (_local1 != _tail) {
trace(((((("Value: " + _local1.data) + " Prev. data: ") + ((_local1.prev)!=null) ? _local1.prev.data : "null") + " Next data: ") + ((_local1.next)!=null) ? _local1.next.data : "null"));
_local1 = _local1.next;
};
trace("-----------------");
}
public function attach(_arg1:ListNode, _arg2:ListNode=null){
if (_arg1.list != null){
_arg1.list.detach(_arg1);
};
if (_arg2 == null){
_arg2 = _tail.prev;
};
_arg1.list = this;
_arg1.prev = _arg2;
_arg1.next = _arg2.next;
_arg2.next = _arg1;
_arg1.next.prev = _arg1;
_size++;
}
public function insert(_arg1):ListNode{
return (insertAfter(_arg1, _tail.prev));
}
public function detach(_arg1:ListNode){
_arg1.prev.next = _arg1.next;
_arg1.next.prev = _arg1.prev;
_arg1.list = null;
_size--;
}
public function get end():ListNode{
return (_tail);
}
private function mergeSort(_arg1:List, _arg2:Function):List{
var _local3:List;
var _local4:List;
var _local5:List;
var _local6:ListNode;
var _local7:uint;
var _local8:uint;
var _local9:*;
if (_arg1.size <= 1){
return (_arg1);
};
_local3 = new List();
_local4 = new List();
_local5 = null;
_local6 = _arg1.begin;
_local7 = 0;
_local8 = (_arg1.size / 2);
while (_local7 < _local8) {
_local9 = _local6.next;
_local3.attach(_local6);
_local6 = _local9;
_local7++;
};
while (_local6 != _arg1._tail) {
_local9 = _local6.next;
_local4.attach(_local6);
_local6 = _local9;
};
_local3 = mergeSort(_local3, _arg2);
_local4 = mergeSort(_local4, _arg2);
_local5 = mergeLists(_local3, _local4, _arg2);
return (_local5);
}
}
}//package game
Section 42
//ListNode (game.ListNode)
package game {
import game.*;
class ListNode {
public var next:ListNode;// = null
public var data;// = null
public var prev:ListNode;// = null
public var list:List;// = null
function ListNode(_arg1:List, _arg2=null){
list = null;
prev = null;
next = null;
data = null;
super();
list = _arg1;
data = _arg2;
}
}
}//package game
Section 43
//ManageDialog (game.ManageDialog)
package game {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
public class ManageDialog extends MovieClip {
public var slot2:MovieClip;
public var survivor1:SurvivorIcon;
private var slots:Array;
public var gunner:MovieClip;
public var addGunner:SimpleButton;
private var isOpening:Boolean;// = false
public var survivals:SurvivorIcon;
private var gameScreen:StoryGameScreen;// = null
public var ammo0:AmmoIcon;
public var ammo1:AmmoIcon;
public var ammo3:AmmoIcon;
public var ammo4:AmmoIcon;
public var ammo7:AmmoIcon;
public var ammo2:AmmoIcon;
public var background:MovieClip;
public var ammo6:AmmoIcon;
public var ammo5:AmmoIcon;
public var weaponSlot2:MovieClip;
public var weaponSlot3:MovieClip;
public var weaponSlot4:MovieClip;
public var weaponSlot5:MovieClip;
public var weaponSlot6:MovieClip;
public var weaponSlot0:MovieClip;
public var weaponSlot1:MovieClip;
public var weaponSlot7:MovieClip;
public var rifleIcon:WeaponIcon;
private var lastWeaponsFound:Array;
public var slot0:MovieClip;
public var slot1:MovieClip;
public var slot3:MovieClip;
public var close:SimpleButton;
public var survivor0:SurvivorIcon;
public function ManageDialog(){
var _local1:int;
gameScreen = null;
slots = new Array();
lastWeaponsFound = new Array();
isOpening = false;
super();
gameScreen = (Game.gameScreen as StoryGameScreen);
if (!gameScreen){
return;
};
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
addEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler);
close.addEventListener(MouseEvent.CLICK, onCloseClicked);
addGunner.addEventListener(MouseEvent.CLICK, onAddGunnerClicked);
slot0.owner = gameScreen.human;
slot0.icon = null;
slots.push(slot0);
slot1.owner = gameScreen.human;
slot1.icon = null;
slots.push(slot1);
slot2.owner = gameScreen.assist0;
slot2.icon = null;
slots.push(slot2);
slot3.owner = gameScreen.assist1;
slot3.icon = null;
slots.push(slot3);
survivor0.caption.visible = false;
survivor1.caption.visible = false;
survivor0.visible = false;
survivor1.visible = false;
rifleIcon.gotoAndStop(1);
rifleIcon.caption.visible = false;
rifleIcon.mouseEnabled = false;
rifleIcon.alpha = 0.5;
_local1 = 0;
while (_local1 < 8) {
lastWeaponsFound.push(0);
_local1++;
};
_local1 = 0;
while (_local1 < 8) {
if (hasOwnProperty(("ammo" + _local1))){
this[("ammo" + _local1)].type.gotoAndStop((_local1 + 1));
};
_local1++;
};
}
private function attachToWeaponSlot(_arg1:MovieClip, _arg2:uint){
var _local3:MovieClip;
_local3 = this[("weaponSlot" + _arg2)];
if (_arg1.slot != undefined){
_arg1.slot.icon = null;
};
if (((!(isSlotEmpty(("weaponSlot" + _arg2)))) && (!((_local3.icon == _arg1))))){
var _local4 = gameScreen._weaponsFound;
var _local5 = (_arg1.type.currentFrame - 1);
var _local6 = (_local4[_local5] + 1);
_local4[_local5] = _local6;
_local3.icon.caption.text = ("x" + gameScreen._weaponsFound[(_arg1.type.currentFrame - 1)]);
releaseWeaponIcon(_arg1);
} else {
_local4 = gameScreen._weaponsFound;
_local5 = (_arg1.type.currentFrame - 1);
_local6 = (_local4[_local5] + 1);
_local4[_local5] = _local6;
attachIconToSlot(_arg1, _local3);
_arg1.caption.text = ("x" + gameScreen.getWeaponsFound((_arg1.type.currentFrame - 1)));
_arg1.owner = null;
};
}
private function releaseWeaponIcon(_arg1:MovieClip){
removeChild(_arg1);
_arg1.removeEventListener(MouseEvent.MOUSE_DOWN, onPressWeapon);
_arg1.removeEventListener(MouseEvent.MOUSE_UP, onReleaseWeapon);
}
private function onAddGunnerClicked(_arg1:Event){
if (addGunner.scaleX == 1){
if (gameScreen.survivors > 0){
gameScreen.survivors--;
gameScreen.hummer.gunner.isEnabled = true;
gameScreen.hummer.gunner.giveWeapon(Weapon.Minigun, true);
gameScreen.hummer.gunner.chooseWeapon(Weapon.Minigun);
gameScreen.hummer.gunner.isWeaponVisible = false;
addGunner.scaleX = (addGunner.scaleX * -1);
};
} else {
if (gameScreen.hummer.gunner.isEnabled){
gameScreen.survivors++;
gameScreen.hummer.gunner.isEnabled = false;
addGunner.scaleX = (addGunner.scaleX * -1);
};
};
update();
}
private function onCloseClicked(_arg1:Event){
var _local2:int;
visible = false;
gameScreen.isPaused = false;
gameScreen.showCursor(true);
gameScreen.onCloseManage();
_local2 = 0;
while (_local2 < gameScreen._weaponsFound.length) {
lastWeaponsFound[_local2] = gameScreen._weaponsFound[_local2];
_local2++;
};
}
private function update(){
var _local1:int;
var _local2:uint;
var _local3:MovieClip;
_local1 = 0;
_local1 = 0;
while (_local1 < 8) {
if (hasOwnProperty(("ammo" + _local1))){
this[("ammo" + _local1)].caption.text = ("x" + gameScreen.getAmmo(_local1));
};
_local1++;
};
_local1 = 0;
while (_local1 < 8) {
_local2 = gameScreen.getWeaponsFound(_local1);
if (((!((lastWeaponsFound[_local1] == _local2))) && (_local2))){
if (isSlotEmpty(("weaponSlot" + _local1))){
_local3 = createWeaponIcon(_local1);
_local3.caption.text = ("x" + _local2);
attachIconToSlot(_local3, this[("weaponSlot" + _local1)]);
} else {
this[("weaponSlot" + _local1)].icon.caption.text = ("x" + _local2);
};
lastWeaponsFound[_local1] = _local2;
};
_local1++;
};
survivals.caption.text = ("x" + gameScreen.survivors);
gunner.visible = gameScreen.hummer.gunner.isEnabled;
}
private function createWeaponIcon(_arg1:uint):MovieClip{
var _local2:MovieClip;
_local2 = new WeaponIcon2();
_local2.type.gotoAndStop((_arg1 + 1));
_local2.caption.text = "";
_local2.mouseChildren = false;
_local2.addEventListener(MouseEvent.MOUSE_DOWN, onPressWeapon);
_local2.addEventListener(MouseEvent.MOUSE_UP, onReleaseWeapon);
addChild(_local2);
return (_local2);
}
private function onPressWeapon(_arg1:MouseEvent){
var _local2:MovieClip;
if ((((((_arg1.target.owner == undefined)) || ((_arg1.target.owner == null)))) && ((gameScreen.getWeaponsFound((_arg1.target.type.currentFrame - 1)) > 1)))){
var _local3 = gameScreen._weaponsFound;
var _local4 = (_arg1.target.type.currentFrame - 1);
var _local5 = (_local3[_local4] - 1);
_local3[_local4] = _local5;
_arg1.target.caption.text = ("x" + gameScreen._weaponsFound[(_arg1.target.type.currentFrame - 1)]);
_local2 = createWeaponIcon((_arg1.target.type.currentFrame - 1));
_local2.x = _arg1.target.x;
_local2.y = _arg1.target.y;
_local2.releaseHint();
_local2.startDrag();
setChildIndex(_local2, (numChildren - 1));
} else {
if ((((_arg1.target.owner == undefined)) || ((_arg1.target.owner == null)))){
_local3 = gameScreen._weaponsFound;
_local4 = (_arg1.target.type.currentFrame - 1);
_local5 = (_local3[_local4] - 1);
_local3[_local4] = _local5;
};
_arg1.target.caption.text = "";
_arg1.target.startDrag();
_arg1.target.releaseHint();
setChildIndex((_arg1.target as MovieClip), (numChildren - 1));
};
}
public function show(){
visible = true;
gameScreen.isPaused = true;
gameScreen.showCursor(false);
background.gotoAndStop((Math.floor((Math.random() * background.totalFrames)) + 1));
update();
}
private function attachIconToSlot(_arg1:MovieClip, _arg2:MovieClip){
if (_arg1.slot != undefined){
_arg1.slot.icon = null;
};
_arg1.x = ((_arg2.x + (_arg2.width * 0.5)) - (_arg1.width * 0.5));
_arg1.y = ((_arg2.y + (_arg2.height * 0.5)) - (_arg1.height * 0.5));
_arg1.slot = _arg2;
_arg2.icon = _arg1;
if (_arg2 == slot0){
rifleIcon.visible = false;
};
}
private function onReleaseWeapon(_arg1:MouseEvent){
var _local2:MovieClip;
var _local3:MovieClip;
var _local4:MovieClip;
var _local5:int;
_arg1.target.releaseHint();
_local2 = (_arg1.target as MovieClip);
_local3 = null;
_local2.stopDrag();
if (((((_local2.hasOwnProperty("owner")) && (!((_local2.owner == null))))) && (!((_local2.owner == gameScreen.human))))){
_local2.owner.removeWeapon((_local2.type.currentFrame - 1));
_local2.owner.chooseWeapon(Weapon.Rifle);
};
if (_local2.dropTarget){
_local4 = (_local2.dropTarget.parent as MovieClip);
if (_local4 == rifleIcon){
_local4 = slot0;
};
_local5 = 0;
while (_local5 < slots.length) {
if (_local4 == slots[_local5]){
_local3 = slots[_local5];
if ((((((_local3 == slot0)) && (!((slot1.icon == null))))) && ((_local2.type.currentFrame == slot1.icon.type.currentFrame)))){
break;
};
if ((((((_local3 == slot1)) && (!((slot0.icon == null))))) && ((_local2.type.currentFrame == slot0.icon.type.currentFrame)))){
break;
};
if ((((((_local3 == slot2)) || ((_local3 == slot3)))) && ((((((_local2.type.currentFrame == (Weapon.Flame + 1))) || ((_local2.type.currentFrame == (Weapon.LaserGun + 1))))) || ((_local2.type.currentFrame == (Weapon.TeslaGun + 1))))))){
break;
};
attachIconToSlot(_local2, _local3);
_local2.caption.text = "";
_local2.owner = _local3.owner;
if ((_local3.owner is Assist)){
_local3.owner.giveWeapon((_local2.type.currentFrame - 1), true);
_local3.owner.chooseWeapon((_local2.type.currentFrame - 1));
};
return;
};
_local5++;
};
};
attachToWeaponSlot(_local2, (_local2.type.currentFrame - 1));
}
private function isSlotEmpty(_arg1:String):Boolean{
return ((((this[_arg1].icon == undefined)) || ((this[_arg1].icon == null))));
}
private function onEnterFrameHandler(_arg1:Event){
rifleIcon.visible = isSlotEmpty("slot0");
survivor0.visible = gameScreen.assist0.isEnabled;
slot2.visible = gameScreen.assist0.isEnabled;
survivor1.visible = gameScreen.assist1.isEnabled;
slot3.visible = gameScreen.assist1.isEnabled;
}
private function onMouseOverHandler(_arg1:MouseEvent){
Mouse.show();
Game.gameScreen.cursor.visible = false;
}
}
}//package game
Section 44
//MapDialog (game.MapDialog)
package game {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.filters.*;
public class MapDialog extends MovieClip {
public var icon1:MovieClip;
private var fadeScreen:FadeToBlack;
public var place0:MovieClip;
public var place2:MovieClip;
public var place4:MovieClip;
public var place5:MovieClip;
public var place7:MovieClip;
public var place6:MovieClip;
public var place1:MovieClip;
public var place8:MovieClip;
public var coolbuddy:SimpleButton;
public var place3:MovieClip;
public var icon5:MovieClip;
public var place9:MovieClip;
public var icon10:MovieClip;
public var place10:MovieClip;
private var nextLevel:uint;// = 0
public var icon11:MovieClip;
public var place11:MovieClip;
private var gameScreen:StoryGameScreen;// = null
public var passwordDialog:MovieClip;
public var icon0:MovieClip;
public var icon2:MovieClip;
public var icon3:MovieClip;
public var icon4:MovieClip;
public var icon6:MovieClip;
public var icon7:MovieClip;
public var icon9:MovieClip;
public var icon8:MovieClip;
public function MapDialog(){
gameScreen = null;
fadeScreen = new FadeToBlack();
nextLevel = 0;
super();
addFrameScript(0, frame1);
gameScreen = (Game.gameScreen as StoryGameScreen);
initialize(0);
addChild(fadeScreen);
fadeScreen.addEventListener(FadeToBlack.FADED, onFadedHandler);
passwordDialog.ok.addEventListener(MouseEvent.CLICK, onOKPasswordClicked);
}
private function travel(_arg1:uint){
new SoundCar().play();
fadeScreen.fade(0.025);
nextLevel = _arg1;
updateIcons(_arg1);
}
public function onCoolbuddy(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.coolbuddy.com/games/game.asp?gid=830"), "_blank");
}
private function onFadedHandler(_arg1:Event){
if (gameScreen == null){
return;
};
close();
if (nextLevel == 11){
gameScreen.isPaused = false;
gameScreen.showCursor(false);
gameScreen.addChild(new GameEndScreen());
} else {
gameScreen.nextLevel(nextLevel);
};
}
function frame1(){
coolbuddy.addEventListener(MouseEvent.CLICK, onCoolbuddy);
}
public function initialize(_arg1:uint){
var _local2:uint;
var _local3:MovieClip;
_local2 = 0;
while (hasOwnProperty(("place" + _local2))) {
_local3 = this[("place" + _local2)];
_local3.addEventListener(MouseEvent.CLICK, onMapPlaceClicked);
_local3.id = _local2;
_local3.isEnabled = false;
_local2++;
};
this[("place" + _arg1)].isEnabled = true;
this[("icon" + (_arg1 + 0))].gotoAndStop(4);
this[("icon" + (_arg1 + 1))].gotoAndStop(3);
switch (_arg1){
case 0:
place1.isEnabled = true;
break;
case 1:
place2.isEnabled = true;
break;
case 2:
place3.isEnabled = true;
place5.isEnabled = true;
break;
case 3:
place5.isEnabled = false;
place4.isEnabled = true;
break;
case 4:
place7.isEnabled = true;
break;
case 5:
place6.isEnabled = true;
place3.isEnabled = false;
break;
case 6:
place7.isEnabled = true;
break;
case 7:
place8.isEnabled = true;
break;
case 8:
place9.isEnabled = true;
break;
case 9:
place10.isEnabled = true;
break;
case 10:
place11.isEnabled = true;
break;
};
updateIcons(_arg1);
}
private function onOKPasswordClicked(_arg1:MouseEvent){
var _local2:String;
_local2 = passwordDialog.password.text;
if (_local2.substr(0, (_local2.length - 1)) == "memphys"){
passwordDialog.visible = false;
passwordDialog.invalidCaption.visible = false;
travel(10);
} else {
passwordDialog.invalidCaption.visible = true;
};
}
private function updateIcons(_arg1:uint){
var _local2:uint;
var _local3:Array;
var _local4:MovieClip;
_local2 = 0;
while (hasOwnProperty(("icon" + _local2))) {
this[("icon" + _local2)].gotoAndStop(1);
_local2++;
};
_local2 = 0;
while (hasOwnProperty(("place" + _local2))) {
_local4 = this[("place" + _local2)];
_local4.filters = new Array();
_local4.alpha = ((_local4.isEnabled)==false) ? 0.5 : 1;
_local2++;
};
this[("icon" + _arg1)].gotoAndStop(4);
_local3 = new Array();
_local3.push(new GlowFilter(0xFFFFFF, 1, 10, 10, 2, 3));
this[("place" + _arg1)].filters = _local3;
}
private function onMapPlaceClicked(_arg1:MouseEvent){
if (_arg1.target.isEnabled == false){
return;
};
switch (_arg1.target.id){
case 1:
place2.isEnabled = true;
break;
case 2:
place3.isEnabled = true;
place5.isEnabled = true;
break;
case 3:
place5.isEnabled = false;
place4.isEnabled = true;
break;
case 4:
place7.isEnabled = true;
break;
case 5:
place6.isEnabled = true;
place3.isEnabled = false;
break;
case 6:
place7.isEnabled = true;
break;
case 7:
place8.isEnabled = true;
break;
case 8:
place9.isEnabled = true;
break;
case 9:
place10.isEnabled = true;
break;
case 10:
place11.isEnabled = true;
break;
};
if (_arg1.target == place10){
passwordDialog.visible = true;
} else {
travel(_arg1.target.id);
_arg1.target.isEnabled = false;
};
}
public function show(){
visible = true;
gameScreen.isPaused = true;
gameScreen.showCursor(false);
passwordDialog.visible = false;
}
public function close(){
if (gameScreen == null){
return;
};
visible = false;
gameScreen.isPaused = false;
gameScreen.showCursor(true);
}
}
}//package game
Section 45
//MenuButton (game.MenuButton)
package game {
import flash.events.*;
import flash.display.*;
import flash.media.*;
public class MenuButton extends MovieClip {
public var icon1:MovieClip;
public var startY:Number;// = 0
public var enableEvents:Boolean;// = true
private var state:uint;// = 0
public var icon0:MovieClip;
public var icon2:MovieClip;
public var endY:Number;// = 0
static const k_StateClose:uint = 1;
static const k_StateOpen:uint = 0;
public function MenuButton(){
state = 0;
startY = 0;
endY = 0;
enableEvents = true;
super();
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
addEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOutHandler);
addEventListener(MouseEvent.CLICK, onMouseClickHandler);
}
private function onMouseOverHandler(_arg1:MouseEvent){
var _local2:Sound;
if (!enableEvents){
return;
};
_arg1.target.gotoAndStop(2);
_local2 = new SoundButtonFocus();
_local2.play();
}
public function setState(_arg1:uint){
state = _arg1;
}
private function onMouseOutHandler(_arg1:MouseEvent){
if (!enableEvents){
return;
};
_arg1.target.gotoAndStop(1);
}
private function onMouseClickHandler(_arg1:MouseEvent){
var _local2:Sound;
if (!enableEvents){
return;
};
_local2 = new SoundButtonClick();
_local2.play();
}
private function onEnterFrameHandler(_arg1:Event){
var _local2:Number;
if (state == k_StateOpen){
if (y < endY){
_local2 = (Math.min((endY - y), 150) / 150);
y = (y + (60 * _local2));
mouseEnabled = (Math.abs(_local2) <= 0.1);
if (y > endY){
y = endY;
};
};
} else {
if (state == k_StateClose){
if (y > startY){
y = (y - 60);
mouseEnabled = false;
if (y < startY){
y = startY;
};
};
};
};
}
}
}//package game
Section 46
//MenuButtons (game.MenuButtons)
package game {
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import flash.media.*;
import flash.net.*;
public class MenuButtons extends MovieClip {
public var button0:BMoreGames;
public var button1:BNewGame;
public var button5:BHighscores;
public var buttonBack:BCloseTrophies;
public var button3:BSurvival;
public var button2:BResumeGame;
public var button4:BTrophies;
public var trophies:Trophies;
public function MenuButtons(){
var _local1:*;
var _local2:MovieClip;
super();
_local1 = 0;
while (_local1 < 6) {
_local2 = (this[("button" + _local1)] as MovieClip);
_local2.endY = _local2.y;
_local2.startY = ((_local2.y - 1200) + (100 * _local1));
_local2.y = _local2.startY;
_local2.setState(MenuButton.k_StateOpen);
_local2.gotoAndStop(1);
_local2.addEventListener(MouseEvent.CLICK, onMouseClickHandler);
_local1++;
};
trophies.endY = trophies.y;
trophies.startY = (trophies.y - 1000);
trophies.y = trophies.startY;
trophies.setState(MenuButton.k_StateClose);
trophies.enableEvents = false;
buttonBack.endY = buttonBack.y;
buttonBack.startY = (buttonBack.y - 900);
buttonBack.y = buttonBack.startY;
buttonBack.setState(MenuButton.k_StateClose);
buttonBack.addEventListener(MouseEvent.CLICK, onCloseThrophies);
buttonBack.gotoAndStop(1);
initTrophies();
}
private function initTrophies(){
var _local1:SharedObject;
var _local2:Array;
_local1 = SharedObject.getLocal("save");
_local2 = _local1.data.weaponsFound;
if ((((_local2 == null)) || ((_local2 == undefined)))){
trophies.icon0.gotoAndStop(1);
trophies.icon1.gotoAndStop(1);
trophies.icon2.gotoAndStop(1);
} else {
trophies.icon0.gotoAndStop((_local2[Weapon.Flame]) ? 2 : 1);
trophies.icon1.gotoAndStop((_local2[Weapon.LaserGun]) ? 3 : 1);
trophies.icon2.gotoAndStop((_local2[Weapon.TeslaGun]) ? 4 : 1);
};
}
public function reset(){
var _local1:*;
var _local2:MovieClip;
_local1 = 0;
while (_local1 < 6) {
_local2 = this[("button" + _local1)];
_local2.y = _local2.startY;
_local1++;
};
}
private function onCloseThrophies(_arg1:MouseEvent){
var _local2:*;
var _local3:MovieClip;
trophies.setState(MenuButton.k_StateClose);
buttonBack.setState(MenuButton.k_StateClose);
_local2 = 0;
while (_local2 < 6) {
_local3 = this[("button" + _local2)];
_local3.setState(MenuButton.k_StateOpen);
_local2++;
};
}
private function onMouseClickHandler(_arg1:MouseEvent){
var _local2:Sound;
var _local3:*;
var _local4:MovieClip;
if (_arg1.target == button4){
trophies.setState(MenuButton.k_StateOpen);
buttonBack.setState(MenuButton.k_StateOpen);
initTrophies();
_local3 = 0;
while (_local3 < 6) {
_local4 = this[("button" + _local3)];
_local4.setState(MenuButton.k_StateClose);
_local3++;
};
} else {
reset();
};
if (_arg1.target == button5){
MochiScores.showLeaderboard({boardID:"f6a7ad7b22582097", res:"700x525"});
};
if (_arg1.target == button0){
navigateToURL(new URLRequest("http://www.coolbuddy.com/?cid=174"), "_blank");
};
_local2 = new SoundButtonClick();
_local2.play();
}
}
}//package game
Section 47
//MenuScreen (game.MenuScreen)
package game {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.net.*;
import flash.ui.*;
public class MenuScreen extends GameState {
public var layer1:MovieClip;
public var layer2:MovieClip;
public var layer4:MovieClip;
public var toggleSound:MovieClip;
private var sound:Sound;// = null
public var layer3:MovieClip;
private var parallaxOffset:Number;// = 0
private var isShowing:Boolean;// = false
private var isHiding:Boolean;// = false
private var soundChannel:SoundChannel;// = null
public var buttons:MenuButtons;
private var parallaxDx:Number;// = 0
private var parallaxEnd:Number;// = 0
public var layer0:MovieClip;
public function MenuScreen(){
parallaxOffset = 0;
parallaxEnd = 0;
parallaxDx = 0;
sound = null;
soundChannel = null;
isHiding = false;
isShowing = false;
super();
buttons.button1.addEventListener(MouseEvent.CLICK, onPlayClick);
buttons.button2.addEventListener(MouseEvent.CLICK, onResumeClick);
buttons.button3.addEventListener(MouseEvent.CLICK, onSurvivalClick);
addEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler);
addEventListener(MouseEvent.MOUSE_MOVE, onMouseMoveHandler);
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
}
private function onResumeClick(_arg1:MouseEvent){
if (SharedObject.getLocal("save").data.level == null){
return;
};
Game.gameScreen = Game.instance.storyGameScreen;
Game.instance.storyGameScreen.initialize();
Game.gameScreen.reset();
Game.gameScreen.load();
Game.instance.storyGameScreen.showTutorial(false);
Game.instance.enterState(Game.instance.storyGameScreen);
}
private function onMouseOverHandler(_arg1:MouseEvent){
Mouse.show();
}
override protected function onLeave(){
stopSound();
}
override protected function onEnter(){
startSound();
toggleSound.gotoAndStop((Game.isSoundEnabled) ? 1 : 2);
}
public function stopSound(){
if (sound != null){
soundChannel.stop();
sound = null;
};
}
private function onMouseMoveHandler(_arg1:MouseEvent){
var _local2:Number;
var _local3:Number;
_local2 = (Game.width * 0.5);
_local3 = ((_local2 - _arg1.stageX) * 0.425);
parallaxEnd = _local3;
}
private function onSurvivalClick(_arg1:MouseEvent){
Game.gameScreen = Game.instance.survivalGameScreen;
Game.instance.survivalGameScreen.initialize();
Game.gameScreen.reset();
Game.instance.enterState(Game.instance.survivalGameScreen);
}
private function onPlayClick(_arg1:MouseEvent){
Game.gameScreen = Game.instance.storyGameScreen;
Game.instance.storyGameScreen.initialize();
Game.gameScreen.reset();
Game.instance.storyGameScreen.showStory(true);
Game.instance.enterState(Game.instance.storyGameScreen);
}
public function initialize(){
}
private function onSoundComplete(_arg1:Event){
if (isActive){
soundChannel = sound.play();
soundChannel.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
};
}
public function startSound(){
if (sound == null){
sound = new SoundMenuTheme();
soundChannel = sound.play();
soundChannel.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
};
}
private function onEnterFrameHandler(_arg1:Event){
var _local2:Number;
_local2 = (Game.width * 0.5);
if (parallaxOffset < 0){
if (!isShowing){
layer0.man.gotoAndPlay("show");
isShowing = true;
isHiding = false;
};
} else {
if (!isHiding){
layer0.man.gotoAndPlay("hide");
isHiding = true;
isShowing = false;
};
};
layer0.x = ((_local2 - (layer0.width * 0.5)) + parallaxOffset);
layer1.x = ((_local2 - (layer1.width * 0.5)) + (parallaxOffset * 0.5));
layer2.x = ((_local2 - (layer2.width * 0.5)) + (parallaxOffset * 0.25));
layer3.x = ((_local2 - (layer3.width * 0.5)) + (parallaxOffset * 0.125));
layer4.x = ((_local2 - (layer4.width * 0.5)) + (parallaxOffset * 0.0625));
parallaxOffset = (parallaxOffset + (parallaxDx * 0.05));
parallaxDx = (parallaxEnd - parallaxOffset);
if (Math.abs(parallaxDx) < 1){
parallaxDx = 0;
};
}
}
}//package game
Section 48
//Mob1 (game.Mob1)
package game {
import flash.display.*;
import flash.media.*;
public class Mob1 extends Monster {
static var attack_SpriteSheet:SpriteSheet = new SpriteSheet(new BitmapMob1Attack(0, 0), 19, 5, 100, 100);
static var walk_SpriteSheet:SpriteSheet = new SpriteSheet(new BitmapMob1Walk(0, 0), 25, 5, 100, 100);
static var bitmap_Collision:BitmapData = null;
static var die_SpriteSheet:SpriteSheet = new SpriteSheet(new BitmapMob1Die(0, 0), 25, 5, 100, 100);
public function Mob1(){
animAttack = attack_SpriteSheet;
animWalk = walk_SpriteSheet;
animDie = die_SpriteSheet;
animation = animWalk;
health = (Config.instance.k_Mob1Health * Game.gameScreen.level.monsterStrength);
maxCost = Config.instance.k_Mob1Cost;
damage = (Config.instance.k_Mob1Damage * Game.gameScreen.level.monsterStrength);
speed = Config.instance.k_Mob1Speed;
if (bitmap_Collision == null){
bitmap_Collision = new BitmapData(100, 100, true, 0);
animWalk.render(bitmap_Collision, 0, 0, 0);
};
collisionBitmap = bitmap_Collision;
}
override protected function die(){
var _local1:Sound;
var _local2:uint;
if ((state & k_Dead)){
return;
};
_local1 = null;
_local2 = Math.floor((Math.random() * 2));
switch (_local2){
case 0:
_local1 = new SoundDogDie1();
break;
case 1:
_local1 = new SoundDogDie2();
break;
};
_local1.play();
super.die();
}
override public function update(){
var _local1:Sound;
if ((state & k_Attacking)){
if (frame == int((animation.frameCount / 2))){
_local1 = new SoundDogAttack1();
_local1.play();
};
};
super.update();
}
}
}//package game
Section 49
//Mob3 (game.Mob3)
package game {
import flash.display.*;
import flash.media.*;
public class Mob3 extends Monster {
static var attack_SpriteSheet:SpriteSheet = new SpriteSheet(new BitmapMob3Attack(0, 0), 20, 5, 100, 100);
static var walk_SpriteSheet:SpriteSheet = new SpriteSheet(new BitmapMob3Walk(0, 0), 16, 4, 100, 100);
static var bitmap_Collision:BitmapData = null;
static var die_SpriteSheet:SpriteSheet = new SpriteSheet(new BitmapMob3Die(0, 0), 16, 4, 100, 100);
public function Mob3(){
animAttack = attack_SpriteSheet;
animWalk = walk_SpriteSheet;
animDie = die_SpriteSheet;
animation = animWalk;
health = (Config.instance.k_Mob3Health * Game.gameScreen.level.monsterStrength);
maxCost = Config.instance.k_Mob3Cost;
damage = (Config.instance.k_Mob3Damage * Game.gameScreen.level.monsterStrength);
speed = Config.instance.k_Mob3Speed;
if (bitmap_Collision == null){
bitmap_Collision = new BitmapData(100, 100, true, 0);
animWalk.render(bitmap_Collision, 0, 0, 0);
};
collisionBitmap = bitmap_Collision;
}
override protected function die(){
var _local1:Sound;
var _local2:uint;
if ((state & k_Dead)){
return;
};
_local1 = null;
_local2 = Math.floor((Math.random() * 1));
switch (_local2){
case 0:
_local1 = new SoundLizardDie1();
break;
};
_local1.play();
super.die();
}
override public function update(){
var _local1:Sound;
if ((state & k_Attacking)){
if (frame == int((animation.frameCount / 2))){
_local1 = new SoundLizardAttack1();
_local1.play();
};
};
super.update();
}
}
}//package game
Section 50
//Monster (game.Monster)
package game {
import flash.events.*;
import flash.display.*;
public class Monster extends GameObject {
var wave:Wave;// = null
var collisionBitmap:BitmapData;// = null
var state:Number;// = 0
var dx:Number;// = -1
var dy:Number;// = 1
var attackers:Array;
var human:Human;// = null
var animDie:SpriteSheet;// = null
var nodes:Array;
var flame:Sprite;
var animAttack:SpriteSheet;// = null
var grid:CollisionGrid;// = null
var speed:Number;// = 1
var maxCost:Number;// = 0
var wall:Wall;// = null
var health:Number;// = 200
var damage:Number;// = 10
var animWalk:SpriteSheet;// = null
static const k_Attacking:int = Common.bit(0);
static const k_Dead:int = Common.bit(1);
static var k_MonsterID:int = 0;
public function Monster(){
state = 0;
dx = -1;
dy = 1;
health = 200;
damage = 10;
maxCost = 0;
speed = 1;
attackers = new Array();
nodes = new Array(4);
grid = null;
animWalk = null;
animAttack = null;
animDie = null;
flame = new Sprite();
wall = null;
human = null;
wave = null;
collisionBitmap = null;
super();
grid = Game.gameScreen.grid;
width = 100;
height = 100;
k_MonsterID++;
nodes[0] = new ListNode(null);
nodes[0].data = this;
nodes[1] = new ListNode(null);
nodes[1].data = this;
nodes[2] = new ListNode(null);
nodes[2].data = this;
nodes[3] = new ListNode(null);
nodes[3].data = this;
}
override public function spawn(_arg1:Number, _arg2:Number){
super.spawn(_arg1, _arg2);
frame = Math.floor((Math.random() * 25));
Game.gameScreen.monsters.push(this);
}
public function removeAttackers(){
var _local1:Assist;
for each (_local1 in attackers) {
_local1.target = null;
};
}
protected function die(){
if ((state & k_Dead)){
return;
};
animation = animDie;
frame = 0;
dx = (dy = 0);
state = (state | k_Dead);
}
public function hit(_arg1:Number, _arg2:Boolean){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:int;
health = (health - _arg1);
if (health <= 0){
die();
};
if (_arg2){
_local3 = (x + (width * 0.5));
_local4 = (y + (height * 0.5));
_local5 = (Math.random() * 360);
Game.gameScreen.spawnBloodSplash((x + 50), (y + 50));
Game.gameScreen.spawnDecal(Resources.bitmap_BloodDecals[Math.floor((Math.random() * 3))], _local3, _local4, 0.5, _local5, 0.6);
};
if ((((health <= -10)) && (_arg2))){
Game.gameScreen.spawnEffect(Resources.sheet_BloodBlast, _local3, _local4);
_local6 = 0;
while (_local6 < 5) {
Game.gameScreen.spawnDecal(Resources.bitmap_BloodDecals[Math.floor((Math.random() * 3))], (_local3 + Common.random(-45, 45)), (_local4 + Common.random(-45, 45)), 0.5, (Math.random() * 360), 0.6);
_local6++;
};
onDead(false);
};
}
public function get isDead():Boolean{
return ((state & k_Dead));
}
private function onHumanKilled(_arg1:Event){
human = null;
animation = animWalk;
state = 0;
}
public function removeFromGrid(){
var _local1:*;
_local1 = 0;
while (_local1 < 4) {
if ((((nodes[_local1] == null)) || ((nodes[_local1].list == null)))){
} else {
nodes[_local1].list.remove(nodes[_local1]);
nodes[_local1] = null;
};
_local1++;
};
}
override protected function onAnimationEnd(){
if (animation == animDie){
frame--;
onDead(true);
} else {
if (animation == animAttack){
if (wall){
wall.hit(damage);
};
if (human){
human.hit(damage);
};
};
};
}
protected function updateSectors(){
var _local1:Number;
var _local2:Number;
var _local3:String;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:uint;
_local4 = 0;
_local5 = 0;
while (_local5 <= 1) {
_local6 = 0;
while (_local6 <= 1) {
_local1 = (x + (width * _local5));
_local2 = (y + (height * _local6));
_local7 = grid.getSectorIndex(_local1, _local2);
if (nodes[_local4] == null){
} else {
if (!grid.sectors[_local7]){
grid.sectors[_local7] = new List();
};
grid.sectors[_local7].attach(nodes[_local4]);
_local4++;
};
_local6++;
};
_local5++;
};
}
override public function update(){
super.update();
if ((((wall == null)) && ((human == null)))){
x = (x + (dx * speed));
y = (y + (dy * speed));
};
if (((!((state & k_Attacking))) && (Game.gameScreen.testWallCollision(collisionBitmap, x, y)))){
wall = Game.gameScreen.walls.getWallCollision(collisionBitmap, x, y);
if (wall != null){
attack();
wall.addEventListener(Wall.DESTROYED, onWallDestroyed);
};
};
if (human){
human = Game.gameScreen.testHumanCollision(collisionBitmap, x, y);
if (!human){
animation = animWalk;
state = 0;
};
};
if (!(state & k_Attacking)){
human = Game.gameScreen.testHumanCollision(collisionBitmap, x, y);
if (human != null){
attack();
human.addEventListener(Human.KILLED, onHumanKilled);
};
};
if (!(state & k_Attacking)){
updateSectors();
};
flame.x = x;
flame.y = y;
flame.update();
if (flame.animation != null){
hit(1, false);
};
if (((((x + width) < 0)) || ((y > Game.height)))){
Game.gameScreen.removeMonster(this, false);
Game.gameScreen.gameOverScreen.show(2000);
wave.monstersLeft--;
};
}
private function attack(){
if ((state & k_Attacking)){
return;
};
animation = animAttack;
state = (state | k_Attacking);
frame = 0;
}
private function onWallDestroyed(_arg1:Event){
wall = null;
animation = animWalk;
state = 0;
}
protected function onDead(_arg1:Boolean){
removeAttackers();
Game.gameScreen.removeMonster(this, _arg1);
Game.gameScreen.onMonsterDied(Math.floor((((Math.random() * maxCost) * 0.5) + (maxCost * 0.5))), this);
wave.monstersLeft--;
}
}
}//package game
Section 51
//Night (game.Night)
package game {
import flash.events.*;
import flash.display.*;
public class Night extends MovieClip {
var flashlight:MovieClip;
var flashlightMask:MovieClip;
public var maskLayer:MovieClip;
public var base:MovieClip;
public function Night(){
var _local1:Bitmap;
var _local2:Bitmap;
flashlight = new FlashlightMask();
flashlightMask = new MovieClip();
super();
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
maskLayer.addChild(flashlight);
_local1 = new Bitmap(new BitmapFlashlight(0, 0));
flashlight.addChild(_local1);
_local2 = new Bitmap(new BitmapFlashlight(0, 0));
_local2.y = (_local2.y - (_local2.height * 0.5));
flashlightMask.addChild(_local2);
}
private function onEnterFrameHandler(_arg1:Event){
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = (Input.mouseX - flashlight.x);
_local3 = (Input.mouseY - flashlight.y);
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
_local2 = (_local2 / _local4);
_local3 = (_local3 / _local4);
flashlight.rotation = ((-180 * Math.atan2(-(_local2), -(_local3))) / Math.PI);
flashlightMask.rotation = (((-180 * Math.atan2(-(_local2), -(_local3))) / Math.PI) - 90);
flashlightMask.x = flashlight.x;
flashlightMask.y = flashlight.y;
}
}
}//package game
Section 52
//Resources (game.Resources)
package game {
import flash.display.*;
public class Resources {
static var bitmap_LightShot:BitmapData = new BitmapLightShot(0, 0);
static var sheet_Shell2:SpriteSheet = new SpriteSheet(new BitmapShell2(0, 0), 12, 4, 105, 105);
static var sheet_GroundSplash:SpriteSheet = new SpriteSheet(new BitmapGroundSplash(0, 0), 8, 4, 20, 30);
static var bitmap_LightExplosion:BitmapData = new BitmapLightExplosion(0, 0);
static var bitmap_FlameHit:BitmapData = new BitmapFlameHit(0, 0);
static var sheet_Explosion:SpriteSheet = new SpriteSheet(new BitmapGrenadeExplosion(0, 0), 16, 4, 150, 160);
static var bitmap_Flashlight:BitmapData = new BitmapFlashlight(0, 0);
static var bitmap_BloodDecals:Array = new Array();
static var sheet_FlameFloor:SpriteSheet = new SpriteSheet(new BitmapFlameFloor(0, 0), 16, 4, 150, 150);
static var bitmap_Granade:BitmapData = new BitmapGrenade(0, 0);
static var bitmap_BulletHoles:Array = new Array();
static var bitmap_Background:Array = new Array();
static var sheet_FlameMonster2:SpriteSheet = new SpriteSheet(new BitmapFlameMonster2(0, 0), 16, 4, 100, 100);
static var bitmap_LightFlame:BitmapData = new BitmapLightFlame(0, 0);
static var bitmap_ExplosionHit:BitmapData = new BitmapExplosionHit(0, 0);
static var sheet_Shell:SpriteSheet = new SpriteSheet(new BitmapShell(0, 0), 12, 4, 105, 105);
static var bitmap_Sand:BitmapData = new BitmapSand(0, 0);
static var sheet_BloodBlast:SpriteSheet = new SpriteSheet(new BitmapBloodBlast(0, 0), 16, 4, 200, 120);
static var sheet_GroundSplashX2:SpriteSheet = null;
static var sheet_LaserBurn:SpriteSheet = new SpriteSheet(new BitmapLaserBurn(0, 0), 8, 4, 21, 56);
static function initialize(){
bitmap_BulletHoles.push(new BitmapBulletHole1(0, 0));
bitmap_BulletHoles.push(new BitmapBulletHole2(0, 0));
bitmap_BulletHoles.push(new BitmapBulletHole3(0, 0));
bitmap_BloodDecals.push(new BitmapBloodSpot1(0, 0));
bitmap_BloodDecals.push(new BitmapBloodSpot2(0, 0));
bitmap_BloodDecals.push(new BitmapBloodSpot3(0, 0));
bitmap_BloodDecals.push(new BitmapBloodSpot4(0, 0));
bitmap_Background.push(new BitmapSand(0, 0));
bitmap_Background.push(new BitmapSnow(0, 0));
bitmap_Background.push(new BitmapRocky(0, 0));
bitmap_Background.push(new BitmapSwamp(0, 0));
sheet_GroundSplashX2 = sheet_GroundSplash.clone(2, false, 0.7);
}
}
}//package game
Section 53
//Scorpion (game.Scorpion)
package game {
import flash.display.*;
import flash.media.*;
public class Scorpion extends Monster {
static var attack_SpriteSheet:SpriteSheet = new SpriteSheet(new BitmapScorpAttack(0, 0), 24, 5, 100, 100);
static var walk_SpriteSheet:SpriteSheet = new SpriteSheet(new BitmapScorpWalk(0, 0), 25, 5, 100, 100);
static var bitmap_Collision:BitmapData = null;
static var die_SpriteSheet:SpriteSheet = new SpriteSheet(new BitmapScorpDie(0, 0), 15, 5, 90, 60);
public function Scorpion(){
animAttack = attack_SpriteSheet;
animWalk = walk_SpriteSheet;
animDie = die_SpriteSheet;
animation = animWalk;
health = (Config.instance.k_ScorpHealth * Game.gameScreen.level.monsterStrength);
maxCost = Config.instance.k_ScorpCost;
speed = Config.instance.k_ScorpSpeed;
damage = (Config.instance.k_ScorpDamage * Game.gameScreen.level.monsterStrength);
if (bitmap_Collision == null){
bitmap_Collision = new BitmapData(100, 100, true, 0);
animWalk.render(bitmap_Collision, 0, 0, 0);
};
collisionBitmap = bitmap_Collision;
}
override protected function die(){
var _local1:BitmapData;
var _local2:Sound;
var _local3:uint;
if ((state & k_Dead)){
return;
};
_local1 = new BitmapScorpGibs(0, 0);
super.die();
Game.gameScreen.spawnDecal(_local1, (x + (width * 0.5)), (y + (height * 0.5)));
_local1.dispose();
_local2 = null;
_local3 = Math.floor((Math.random() * 4));
switch (_local3){
case 0:
_local2 = new SoundScorpDie1();
break;
case 1:
_local2 = new SoundScorpDie2();
break;
case 2:
_local2 = new SoundScorpDie3();
break;
case 3:
_local2 = new SoundScorpDie4();
break;
};
_local2.play();
}
override public function hit(_arg1:Number, _arg2:Boolean){
health = (health - _arg1);
if (health <= 0){
die();
};
}
override public function update(){
var _local1:Sound;
if ((state & k_Attacking)){
if (frame == int((animation.frameCount / 2))){
_local1 = new SoundScorpAttack1();
_local1.play();
};
};
super.update();
}
}
}//package game
Section 54
//SearchDialog (game.SearchDialog)
package game {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.ui.*;
public class SearchDialog extends MovieClip {
private var ammoIcons:Array;
public var upgradeWall:SimpleButton;
private var gameScreen:StoryGameScreen;// = null
public var travel:SimpleButton;
public var bar:MovieClip;
private var survFound:uint;// = 0
private var isClosing:Boolean;// = false
public var background:MovieClip;
public var repairWall:SimpleButton;
private var weaponsFound:Array;
private var maxCans:uint;// = 3
public var buildRadio:SimpleButton;
private var progress:uint;// = 0
private var ammoFound:Array;
public var buildFlameTrap:SimpleButton;
public var buildTeslaTower:SimpleButton;
private var weaponIcons:Array;
public var item2:ItemIcon;
public var item0:ItemIcon;
private var cfg:Config;// = null
public var item3:ItemIcon;
public var searchBase:SimpleButton;
private var itemsFound:Array;
public var item1:ItemIcon;
public var fuel:TextField;
var hoursLeft:uint;// = 15
public var time:TextField;
private var survIcon:MovieClip;// = null
public var close:SimpleButton;
static const k_ItemRadio:uint = 2;
static const k_ItemGasCylinder:uint = 1;
static const k_ItemFuel:uint = 0;
static const k_ItemAcumulator:uint = 3;
public function SearchDialog(){
var _local1:uint;
var _local2:MovieClip;
var _local3:MovieClip;
hoursLeft = 15;
gameScreen = null;
progress = 0;
cfg = null;
maxCans = 3;
weaponsFound = new Array();
ammoFound = new Array();
survFound = 0;
itemsFound = new Array();
ammoIcons = new Array();
weaponIcons = new Array();
survIcon = null;
isClosing = false;
super();
gameScreen = (Game.gameScreen as StoryGameScreen);
cfg = Config.instance;
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
addEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler);
close.addEventListener(MouseEvent.CLICK, onCloseClicked);
searchBase.addEventListener(MouseEvent.CLICK, onSearchBaseClicked);
repairWall.addEventListener(MouseEvent.CLICK, onRepairWallClicked);
upgradeWall.addEventListener(MouseEvent.CLICK, onUpgradeWallClicked);
buildRadio.addEventListener(MouseEvent.CLICK, onBuildRadioClicked);
buildFlameTrap.addEventListener(MouseEvent.CLICK, onBuildFlameTrapClicked);
buildTeslaTower.addEventListener(MouseEvent.CLICK, onBuildTeslaTowerClicked);
travel.addEventListener(MouseEvent.CLICK, onTravelClicked);
_local1 = 0;
_local1 = 0;
while (_local1 < 8) {
_local2 = new AmmoIcon();
_local2.type.gotoAndStop((_local1 + 1));
_local2.visible = false;
addChild(_local2);
ammoIcons.push(_local2);
ammoFound.push(0);
_local1++;
};
_local1 = 0;
while (_local1 < 8) {
_local3 = new WeaponIconEx();
_local3.icon.gotoAndStop((_local1 + 1));
_local3.x = (_local3.width * _local1);
_local3.visible = false;
_local3.icon.caption.text = "";
addChild(_local3);
weaponIcons.push(_local3);
weaponsFound.push(0);
_local1++;
};
itemsFound.push(0);
itemsFound.push(0);
itemsFound.push(0);
itemsFound.push(0);
survIcon = new SurvivorIcon();
survIcon.visible = false;
addChild(survIcon);
item0.visible = false;
item1.visible = false;
item2.visible = false;
item3.visible = false;
}
private function onEnterFrameHandler(_arg1:Event){
if (gameScreen == null){
return;
};
time.text = (("Time until next wave: " + hoursLeft) + " hours");
bar.barMask.scaleX = (progress / 100);
bar.caption.text = (progress + "% searched");
searchBase.alpha = ((((hoursLeft >= cfg.k_StSearchCost)) && ((progress < 100)))) ? 1 : 0.5;
repairWall.alpha = ((((hoursLeft >= cfg.k_StRepairCost)) && (!(gameScreen.isWallsRepaired())))) ? 1 : 0.5;
upgradeWall.alpha = ((((hoursLeft >= cfg.k_StUpgradeCost)) && ((gameScreen.getUpgradeIndex() < 3)))) ? 1 : 0.5;
buildRadio.alpha = ((((((hoursLeft >= cfg.k_StRadioCost)) && (!(gameScreen.isRadioInstalled())))) && (itemsFound[k_ItemRadio]))) ? 1 : 0.5;
buildFlameTrap.alpha = ((((((hoursLeft >= cfg.k_StFlameTrapCost)) && (!(gameScreen.isFireTrapBuilt())))) && (itemsFound[k_ItemGasCylinder]))) ? 1 : 0.5;
buildTeslaTower.alpha = ((((((hoursLeft >= cfg.k_StTeslaCost)) && (!(gameScreen.isTeslaBuilt())))) && (itemsFound[k_ItemAcumulator]))) ? 1 : 0.5;
searchBase.mouseEnabled = ((((hoursLeft >= cfg.k_StSearchCost)) && ((progress < 100)))) ? true : false;
repairWall.mouseEnabled = ((((hoursLeft >= cfg.k_StRepairCost)) && (!(gameScreen.isWallsRepaired())))) ? true : false;
upgradeWall.mouseEnabled = ((hoursLeft)>=cfg.k_StUpgradeCost) ? true : false;
buildRadio.mouseEnabled = ((((((hoursLeft >= cfg.k_StRadioCost)) && (!(gameScreen.isRadioInstalled())))) && (itemsFound[k_ItemRadio]))) ? true : false;
buildFlameTrap.mouseEnabled = ((((((hoursLeft >= cfg.k_StFlameTrapCost)) && (!(gameScreen.isFireTrapBuilt())))) && (itemsFound[k_ItemGasCylinder]))) ? true : false;
buildTeslaTower.mouseEnabled = ((((((hoursLeft >= cfg.k_StTeslaCost)) && (!(gameScreen.isTeslaBuilt())))) && (itemsFound[k_ItemAcumulator]))) ? true : false;
travel.alpha = ((itemsFound[k_ItemFuel])>=maxCans) ? 1 : 0.5;
travel.mouseEnabled = ((itemsFound[k_ItemFuel])>=maxCans) ? true : false;
fuel.text = ((maxCans - Math.min(maxCans, itemsFound[k_ItemFuel])) + " fuel cans left");
}
private function onMouseOverHandler(_arg1:MouseEvent){
Mouse.show();
Game.gameScreen.cursor.visible = false;
}
private function onBuildFlameTrapClicked(_arg1:MouseEvent){
hoursLeft = (hoursLeft - cfg.k_StFlameTrapCost);
gameScreen.buildFireTrap();
itemsFound[k_ItemGasCylinder] = 0;
updateItemIcons();
}
private function commit(){
var _local1:uint;
_local1 = 0;
_local1 = 0;
while (_local1 < 8) {
gameScreen._weaponsFound[_local1] = (gameScreen._weaponsFound[_local1] + weaponsFound[_local1]);
weaponsFound[_local1] = 0;
gameScreen.survivors = (gameScreen.survivors + survFound);
survFound = 0;
gameScreen.addAmmo(_local1, ammoFound[_local1]);
ammoFound[_local1] = 0;
weaponIcons[_local1].visible = false;
ammoIcons[_local1].visible = false;
if (((!(gameScreen.human.hasWeapon[_local1])) && (gameScreen._weaponsFound[_local1]))){
gameScreen.human.giveWeapon(_local1, false);
};
_local1++;
};
if (!gameScreen.assist0.isEnabled){
(gameScreen as StoryGameScreen).attachAssist(0);
};
if (!gameScreen.assist1.isEnabled){
(gameScreen as StoryGameScreen).attachAssist(1);
};
survIcon.visible = false;
}
private function onBuildRadioClicked(_arg1:MouseEvent){
hoursLeft = (hoursLeft - cfg.k_StRadioCost);
gameScreen.installRadio();
itemsFound[k_ItemRadio] = 0;
updateItemIcons();
}
private function onRepairWallClicked(_arg1:MouseEvent){
hoursLeft = (hoursLeft - cfg.k_StRepairCost);
gameScreen.repairWalls();
}
private function onTravelClicked(_arg1:MouseEvent){
var _local2:*;
commit();
visible = false;
gameScreen.showMapDialog();
progress = 0;
_local2 = 0;
while (_local2 < itemsFound.length) {
itemsFound[_local2] = 0;
_local2++;
};
}
private function onSearchBaseClicked(_arg1:MouseEvent){
hoursLeft = (hoursLeft - cfg.k_StSearchCost);
generateSearchResults();
progress = (progress + Math.floor(Common.random(8, 15)));
progress = Math.min(100, progress);
if (progress == 100){
itemsFound[k_ItemFuel] = (itemsFound[k_ItemFuel] + (maxCans - Math.min(maxCans, itemsFound[k_ItemFuel])));
};
updateItemIcons();
}
private function onCloseClicked(_arg1:MouseEvent){
visible = false;
isClosing = true;
commit();
(gameScreen as StoryGameScreen).manageDialog.show();
}
private function updateItemIcons(){
var _local1:*;
var _local2:MovieClip;
_local1 = 0;
while (_local1 < 4) {
_local2 = this[("item" + _local1)];
_local2.visible = (itemsFound[_local1] > 0);
if (itemsFound[_local1] > 0){
_local2.gotoAndStop((_local1 + 1));
_local2.caption.text = ("x" + itemsFound[_local1]);
};
_local1++;
};
}
private function onUpgradeWallClicked(_arg1:MouseEvent){
hoursLeft = (hoursLeft - cfg.k_StUpgradeCost);
gameScreen.upgradeWalls();
}
private function onBuildTeslaTowerClicked(_arg1:MouseEvent){
hoursLeft = (hoursLeft - cfg.k_StTeslaCost);
gameScreen.buildTesla();
itemsFound[k_ItemAcumulator] = 0;
updateItemIcons();
}
private function generateSearchResults(){
var _local1:Level;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:uint;
var _local8:Number;
var _local9:Number;
var _local10:uint;
var _local11:MovieClip;
var _local12:MovieClip;
_local1 = gameScreen.level;
if (Math.random() <= 0.5){
itemsFound[k_ItemFuel] = (itemsFound[k_ItemFuel] + Math.floor(Common.random(1, 2)));
};
if ((((Math.random() <= 0.4)) && (_local1.acumulator))){
itemsFound[k_ItemAcumulator] = (itemsFound[k_ItemAcumulator] + Math.floor(Common.random(1, 2)));
};
if ((((Math.random() <= 0.4)) && (_local1.gasCylinder))){
itemsFound[k_ItemGasCylinder] = (itemsFound[k_ItemGasCylinder] + Math.floor(Common.random(1, 2)));
};
if ((((Math.random() <= 0.4)) && (_local1.radio))){
itemsFound[k_ItemRadio] = (itemsFound[k_ItemRadio] + Math.floor(Common.random(1, 2)));
};
if (Math.random() <= _local1.k_StSurvivalProb){
survFound = (survFound + Math.floor(Common.random(_local1.k_StSurvivalMin, _local1.k_StSurvivalMax)));
};
if (Math.random() <= _local1.k_StRifleAmmoProb){
ammoFound[Weapon.Rifle] = (ammoFound[Weapon.Rifle] + Common.random(_local1.k_StRifleAmmoMin, _local1.k_StRifleAmmoMax));
};
if (Math.random() <= _local1.k_StAK74AmmoProb){
ammoFound[Weapon.AK74] = (ammoFound[Weapon.AK74] + Common.random(_local1.k_StAK74AmmoMin, _local1.k_StAK74AmmoMax));
};
if (Math.random() <= _local1.k_StJackAmmoProb){
ammoFound[Weapon.Jackhammer] = (ammoFound[Weapon.Jackhammer] + Common.random(_local1.k_StJackAmmoMin, _local1.k_StJackAmmoMax));
};
if (Math.random() <= _local1.k_StFlameAmmoProb){
ammoFound[Weapon.Flame] = (ammoFound[Weapon.Flame] + Common.random(_local1.k_StFlameAmmoMin, _local1.k_StFlameAmmoMax));
};
if (Math.random() <= _local1.k_StLaserAmmoProb){
ammoFound[Weapon.LaserGun] = (ammoFound[Weapon.LaserGun] + Common.random(_local1.k_StLaserAmmoMin, _local1.k_StLaserAmmoMax));
};
if (Math.random() <= _local1.k_StMinigunAmmoProb){
ammoFound[Weapon.Minigun] = (ammoFound[Weapon.Minigun] + Common.random(_local1.k_StMinigunAmmoMin, _local1.k_StMinigunAmmoMax));
};
if (Math.random() <= _local1.k_StTeslaAmmoProb){
ammoFound[Weapon.TeslaGun] = (ammoFound[Weapon.TeslaGun] + Common.random(_local1.k_StTeslaAmmoMin, _local1.k_StTeslaAmmoMax));
};
if (Math.random() <= _local1.k_StGrenadeAmmoProb){
ammoFound[Weapon.Grenade] = (ammoFound[Weapon.Grenade] + Common.random(_local1.k_StGrenadeAmmoMin, _local1.k_StGrenadeAmmoMax));
};
if (Math.random() <= _local1.k_StAK74Prob){
var _local13 = weaponsFound;
var _local14 = Weapon.AK74;
var _local15 = (_local13[_local14] + 1);
_local13[_local14] = _local15;
};
if ((((Math.random() <= _local1.k_StJackProb)) && (_local1.jackhammer))){
_local13 = weaponsFound;
_local14 = Weapon.Jackhammer;
_local15 = (_local13[_local14] + 1);
_local13[_local14] = _local15;
};
if ((((Math.random() <= _local1.k_StFlameProb)) && (_local1.flamethrower))){
_local13 = weaponsFound;
_local14 = Weapon.Flame;
_local15 = (_local13[_local14] + 1);
_local13[_local14] = _local15;
};
if ((((Math.random() <= _local1.k_StLaserProb)) && (_local1.laser))){
_local13 = weaponsFound;
_local14 = Weapon.LaserGun;
_local15 = (_local13[_local14] + 1);
_local13[_local14] = _local15;
};
if ((((Math.random() <= _local1.k_StMinigunProb)) && (_local1.minigun))){
_local13 = weaponsFound;
_local14 = Weapon.Minigun;
_local15 = (_local13[_local14] + 1);
_local13[_local14] = _local15;
};
if ((((Math.random() <= _local1.k_StTeslaProb)) && (_local1.tesla))){
_local13 = weaponsFound;
_local14 = Weapon.TeslaGun;
_local15 = (_local13[_local14] + 1);
_local13[_local14] = _local15;
};
_local2 = 64.8;
_local3 = 314.1;
_local4 = 56;
_local5 = 54;
_local6 = 0;
_local7 = 0;
_local8 = _local2;
_local9 = _local3;
_local10 = 0;
_local10 = 0;
while (_local10 < 8) {
if (_local7 >= 4){
break;
};
_local11 = weaponIcons[_local10];
_local11.visible = !((weaponsFound[_local10] == 0));
if (weaponsFound[_local10] > 0){
if (_local8 > 214){
_local8 = _local2;
_local9 = (_local9 + (_local5 + 5));
};
_local11.icon.caption.text = ("x" + weaponsFound[_local10]);
_local11.x = _local8;
_local11.y = _local9;
_local8 = (_local8 + (_local11.width + 5));
_local7++;
};
_local10++;
};
_local2 = ((_local7)<=2) ? _local8 : 347.4;
_local3 = 314.1;
_local8 = _local2;
_local9 = _local3;
_local10 = 0;
while (_local10 < 8) {
ammoFound[_local10] = Math.floor(ammoFound[_local10]);
if (ammoFound[_local10] > 0){
_local12 = ammoIcons[_local10];
if (_local8 > 623){
_local8 = _local2;
_local9 = (_local9 + (_local12.height + 5));
};
_local12.visible = !((ammoFound[_local10] == 0));
_local12.caption.text = ("x" + ammoFound[_local10]);
_local12.x = _local8;
_local12.y = _local9;
_local8 = (_local8 + (_local4 + _local6));
};
_local10++;
};
if (survFound > 0){
if (_local8 > 623){
_local8 = _local2;
_local9 = (_local9 + (_local5 + 5));
};
survIcon.visible = true;
survIcon.x = _local8;
survIcon.y = _local9;
survIcon.caption.text = ("x" + survFound);
_local8 = (_local8 + (_local4 + _local6));
};
}
public function removeItems(_arg1:uint, _arg2:uint){
if (_arg1 >= itemsFound.length){
trace(("ERROR!! SearchDialog::removeItems : invalid item index " + _arg1));
return;
};
itemsFound[_arg1] = Math.max(0, (itemsFound[_arg1] - _arg2));
updateItemIcons();
}
public function show(){
visible = true;
isClosing = false;
gameScreen.isPaused = true;
gameScreen.showCursor(false);
background.gotoAndStop((Math.floor((Math.random() * background.totalFrames)) + 1));
x = 0;
}
}
}//package game
Section 55
//ShopDialog (game.ShopDialog)
package game {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
public class ShopDialog extends MovieClip {
public var buyWeapon0:BuyButton;
public var buyWeapon2:BuyButton;
public var buyTesla:BuyButton;
public var buyWeapon4:BuyButton;
public var buyWeapon5:BuyButton;
public var buyWeapon1:BuyButton;
public var buyWeapon3:BuyButton;
public var buyAmmo0:BuyButton;
public var buyAmmo2:BuyButton;
public var buyAmmo3:BuyButton;
public var buyAmmo7:BuyButton;
public var buyAmmo1:BuyButton;
public var buyAmmo6:BuyButton;
public var buyAmmo4:BuyButton;
public var buyAmmo5:BuyButton;
private var cfg:Config;// = null
public var buyAssist:BuyButton;
public var buyUpgrade:BuyButton;
public var money:TextField;
private var gameScreen:SurvivalGameScreen;// = null
public var closeShop:SimpleButton;
public var buyFlameTrap:BuyButton;
public var ammo0:TextField;
public var ammo1:TextField;
public var ammo3:TextField;
public var ammo4:TextField;
public var ammo7:TextField;
public var ammo2:TextField;
public var ammo5:TextField;
public var ammo6:TextField;
private var sound:Sound;
public var buyAirstrike:BuyButton;
public var buyRepair:BuyButton;
public function ShopDialog(){
var _local1:int;
var _local2:MovieClip;
cfg = null;
gameScreen = null;
sound = new SoundCoinsDropped();
super();
cfg = Config.instance;
gameScreen = (Game.gameScreen as SurvivalGameScreen);
if (!gameScreen){
return;
};
_local1 = 0;
_local1 = 0;
while (hasOwnProperty(("buyWeapon" + _local1))) {
_local2 = this[("buyWeapon" + _local1)];
_local2.gotoAndStop(1);
_local2.caption.text = ("$" + gameScreen.getWeaponCost((_local1 + 1)));
_local2.mouseChildren = false;
_local2.weaponIndex = (_local1 + 1);
_local2.addEventListener(MouseEvent.CLICK, onBuyWeaponClicked);
_local1++;
};
_local1 = 0;
while (_local1 < 8) {
if (!hasOwnProperty(("buyAmmo" + _local1))){
} else {
_local2 = this[("buyAmmo" + _local1)];
_local2.gotoAndStop(1);
_local2.caption.text = ("$" + gameScreen.getAmmoCost(_local1));
_local2.mouseChildren = false;
_local2.weaponIndex = _local1;
_local2.addEventListener(MouseEvent.CLICK, onBuyAmmoClicked);
};
_local1++;
};
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
addEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler);
buyRepair.gotoAndStop(1);
buyRepair.mouseChildren = false;
buyRepair.caption.text = ("$" + Config.instance.k_SRepairCost);
buyRepair.addEventListener(MouseEvent.CLICK, onRepairClicked);
buyUpgrade.gotoAndStop(1);
buyUpgrade.mouseChildren = false;
buyUpgrade.caption.text = ("$" + Config.instance.k_SUpgradeCost);
buyUpgrade.addEventListener(MouseEvent.CLICK, onUpgradeClicked);
buyAirstrike.gotoAndStop(1);
buyAirstrike.mouseChildren = false;
buyAirstrike.caption.text = ("$" + Config.instance.k_SAirstrikeCost);
buyAirstrike.addEventListener(MouseEvent.CLICK, onAirstrikeClicked);
buyFlameTrap.gotoAndStop(1);
buyFlameTrap.mouseChildren = false;
buyFlameTrap.caption.text = ("$" + Config.instance.k_SFlameTrapCost);
buyFlameTrap.addEventListener(MouseEvent.CLICK, onFlameTrapClicked);
buyTesla.gotoAndStop(1);
buyTesla.mouseChildren = false;
buyTesla.caption.text = ("$" + Config.instance.k_STeslaTowerCost);
buyTesla.addEventListener(MouseEvent.CLICK, onTeslaClicked);
buyAssist.gotoAndStop(1);
buyAssist.mouseChildren = false;
buyAssist.caption.text = ("$" + Config.instance.k_SAssistCost);
buyAssist.addEventListener(MouseEvent.CLICK, onAssistClicked);
closeShop.addEventListener(MouseEvent.CLICK, onCloseClicked);
}
private function onRepairClicked(_arg1:MouseEvent){
if ((((gameScreen.getMoney() < cfg.k_SRepairCost)) || ((_arg1.target.currentFrame == 2)))){
return;
};
gameScreen.repairWalls();
gameScreen.removeMoney(cfg.k_SRepairCost);
update();
sound.play();
}
private function onUpgradeClicked(_arg1:MouseEvent){
if (gameScreen.getMoney() < cfg.k_SUpgradeCost){
return;
};
gameScreen.upgradeWalls();
gameScreen.removeMoney(cfg.k_SUpgradeCost);
update();
if (gameScreen.getUpgradeIndex() >= 3){
_arg1.target.gotoAndStop(2);
_arg1.target.removeEventListener(MouseEvent.CLICK, onUpgradeClicked);
};
sound.play();
}
private function onCloseClicked(_arg1:MouseEvent){
visible = false;
(Game.instance.state as GameScreen).isPaused = false;
Game.gameScreen.showCursor(true);
}
private function onTeslaClicked(_arg1:MouseEvent){
if (gameScreen.getMoney() < cfg.k_STeslaTowerCost){
return;
};
gameScreen.buildTesla();
gameScreen.removeMoney(cfg.k_STeslaTowerCost);
update();
_arg1.target.gotoAndStop(2);
_arg1.target.removeEventListener(MouseEvent.CLICK, onTeslaClicked);
sound.play();
}
private function update(){
var _local1:int;
_local1 = 0;
while (_local1 < 8) {
if (hasOwnProperty(("ammo" + _local1))){
this[("ammo" + _local1)].text = ("" + gameScreen.getAmmo(_local1));
};
_local1++;
};
money.text = ("Money: $" + gameScreen.getMoney());
}
private function onBuyAmmoClicked(_arg1:MouseEvent){
if (gameScreen.buyAmmo(_arg1.target.weaponIndex)){
update();
sound.play();
};
}
public function show(){
visible = true;
(Game.instance.state as GameScreen).isPaused = true;
update();
Game.gameScreen.showCursor(false);
}
private function onFlameTrapClicked(_arg1:MouseEvent){
if (gameScreen.getMoney() < cfg.k_SFlameTrapCost){
return;
};
gameScreen.buildFireTrap();
gameScreen.removeMoney(cfg.k_SFlameTrapCost);
update();
_arg1.target.gotoAndStop(2);
_arg1.target.removeEventListener(MouseEvent.CLICK, onFlameTrapClicked);
sound.play();
}
private function onAirstrikeClicked(_arg1:MouseEvent){
if (gameScreen.getMoney() < cfg.k_SAirstrikeCost){
return;
};
gameScreen.installRadio();
gameScreen.removeMoney(cfg.k_SAirstrikeCost);
update();
_arg1.target.gotoAndStop(2);
_arg1.target.removeEventListener(MouseEvent.CLICK, onAirstrikeClicked);
sound.play();
}
private function onBuyWeaponClicked(_arg1:MouseEvent){
if (gameScreen.buyWeapon(_arg1.target.weaponIndex)){
_arg1.target.gotoAndStop(2);
_arg1.target.removeEventListener(MouseEvent.CLICK, onBuyWeaponClicked);
update();
sound.play();
};
}
private function onAssistClicked(_arg1:MouseEvent){
if (!gameScreen.assist0.isEnabled){
gameScreen.buyAssist(0);
} else {
if (!gameScreen.assist1.isEnabled){
gameScreen.buyAssist(1);
_arg1.target.caption.text = ("$" + cfg.k_SGunnerCost);
} else {
if (!gameScreen.hummer.gunner.isEnabled){
if (gameScreen.getMoney() < cfg.k_SGunnerCost){
return;
};
gameScreen.hummer.gunner.isEnabled = true;
gameScreen.hummer.gunner.setWeapon(Weapon.k_Minigun.clone());
gameScreen.hummer.gunner.isWeaponVisible = false;
gameScreen.removeMoney(cfg.k_SGunnerCost);
_arg1.target.caption.text = ("$" + cfg.k_SUpgradeAssistCost);
} else {
if (gameScreen.getMoney() < cfg.k_SUpgradeAssistCost){
return;
};
if (!gameScreen.upgradeAssist()){
_arg1.target.gotoAndStop(2);
_arg1.target.removeEventListener(MouseEvent.CLICK, onAssistClicked);
};
gameScreen.removeMoney(cfg.k_SUpgradeAssistCost);
};
};
};
update();
sound.play();
}
private function onMouseOverHandler(_arg1:MouseEvent){
gameScreen.showCursor(false);
}
private function onEnterFrameHandler(_arg1:Event){
buyRepair.gotoAndStop((gameScreen.isWallsRepaired()) ? 2 : 1);
if (buyAssist.currentFrame == 2){
if (((!(gameScreen.assist0.isEnabled)) || (!(gameScreen.assist1.isEnabled)))){
buyAssist.gotoAndStop(1);
buyAssist.addEventListener(MouseEvent.CLICK, onAssistClicked);
buyAssist.caption.text = ("$" + cfg.k_SAssistCost);
};
} else {
if ((((((gameScreen.getAssistUpgrade() == 2)) && (gameScreen.assist0.isEnabled))) && (gameScreen.assist1.isEnabled))){
buyAssist.gotoAndStop(2);
buyAssist.removeEventListener(MouseEvent.CLICK, onAssistClicked);
};
};
}
}
}//package game
Section 56
//Snow (game.Snow)
package game {
import flash.events.*;
import flash.display.*;
public class Snow extends MovieClip {
private var wind:Number;// = -2
private var flakes:Array;
private var speed:Number;// = 2
public function Snow(){
flakes = new Array();
speed = 2;
wind = -2;
super();
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
}
public function addFlakes(_arg1:int){
var _local2:*;
var _local3:MovieClip;
var _local4:Number;
_local2 = 0;
while (_local2 < _arg1) {
_local3 = new SnowFlake();
_local3.r = (1 + (Math.random() * speed));
_local3.k = (-(Math.PI) + (Math.random() * Math.PI));
_local3.rad = 0;
_local4 = ((Math.random() * 0.5) + 0.5);
_local3.scaleX = _local4;
_local3.scaleY = _local4;
_local3.alpha = ((Math.random() * 0.5) + 0.5);
_local3.x = (Math.random() * Game.width);
_local3.y = (Math.random() * Game.height);
addChild(_local3);
flakes.push(_local3);
_local2++;
};
}
private function onEnterFrameHandler(_arg1:Event){
var _local2:int;
var _local3:MovieClip;
if ((((Game.gameScreen == null)) || (Game.gameScreen.isPaused))){
return;
};
_local2 = 0;
while (_local2 < flakes.length) {
_local3 = flakes[_local2];
_local3.rad = (_local3.rad + ((_local3.k / 180) * Math.PI));
_local3.x = (_local3.x - (Math.cos(_local3.rad) + wind));
_local3.y = (_local3.y + speed);
if (_local3.y >= Game.height){
_local3.y = -5;
};
if (_local3.x >= Game.width){
_local3.x = 1;
};
if (_local3.x <= 0){
_local3.x = (Game.width - 1);
};
_local2++;
};
}
}
}//package game
Section 57
//Spider (game.Spider)
package game {
import flash.display.*;
import flash.media.*;
public class Spider extends Monster {
static var attack_SpriteSheet:SpriteSheet = new SpriteSheet(new BitmapSpiderAttack(0, 0), 16, 4, 100, 100);
static var walk_SpriteSheet:SpriteSheet = new SpriteSheet(new BitmapSpiderWalk(0, 0), 25, 5, 100, 100);
static var bitmap_Collision:BitmapData = null;
static var die_SpriteSheet:SpriteSheet = new SpriteSheet(new BitmapScorpDie(0, 0), 15, 5, 90, 60);
public function Spider(){
animAttack = attack_SpriteSheet;
animWalk = walk_SpriteSheet;
animDie = die_SpriteSheet;
animation = animWalk;
health = (Config.instance.k_ScorpHealth * Game.gameScreen.level.monsterStrength);
maxCost = Config.instance.k_ScorpCost;
speed = Config.instance.k_ScorpSpeed;
damage = (Config.instance.k_ScorpDamage * Game.gameScreen.level.monsterStrength);
if (bitmap_Collision == null){
bitmap_Collision = new BitmapData(100, 100, true, 0);
animWalk.render(bitmap_Collision, 0, 0, 0);
};
collisionBitmap = bitmap_Collision;
}
override protected function die(){
var _local1:BitmapData;
var _local2:Sound;
var _local3:uint;
if ((state & k_Dead)){
return;
};
_local1 = new BitmapSpiderGibs(0, 0);
super.die();
Game.gameScreen.spawnDecal(_local1, (x + (width * 0.5)), (y + (height * 0.5)));
_local1.dispose();
_local2 = null;
_local3 = Math.floor((Math.random() * 4));
switch (_local3){
case 0:
_local2 = new SoundScorpDie1();
break;
case 1:
_local2 = new SoundScorpDie2();
break;
case 2:
_local2 = new SoundScorpDie3();
break;
case 3:
_local2 = new SoundScorpDie4();
break;
};
_local2.play();
}
override public function hit(_arg1:Number, _arg2:Boolean){
health = (health - _arg1);
if (health <= 0){
die();
};
}
override public function update(){
var _local1:Sound;
if ((state & k_Attacking)){
if (frame == int((animation.frameCount / 2))){
_local1 = new SoundSpiderAttack();
_local1.play();
};
};
super.update();
}
}
}//package game
Section 58
//Sprite (game.Sprite)
package game {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class Sprite extends EventDispatcher {
var enableEvents:Boolean;// = false
var animation:SpriteSheet;// = null
var width:Number;// = 0
var rect:Rectangle;
var height:Number;// = 0
private var lastFrameTime:Number;// = 0
var frame:Number;// = 0
private var _frameRate:int;
var x:Number;// = 0
var y:Number;// = 0
var rotation:Number;// = 0
static const END:String = "end";
public function Sprite(){
x = 0;
y = 0;
rotation = 0;
width = 0;
height = 0;
frame = 0;
animation = null;
rect = new Rectangle();
enableEvents = false;
_frameRate = Game.frameRate;
lastFrameTime = 0;
super();
}
public function get frameRate():int{
return (_frameRate);
}
public function update(){
var _local1:Number;
if (animation == null){
return;
};
_local1 = getTimer();
if ((_local1 - lastFrameTime) >= ((1 / frameRate) * 1000)){
frame++;
lastFrameTime = _local1;
};
if (frame >= animation.frameCount){
onAnimationEnd();
frame = 0;
if (enableEvents){
dispatchEvent(new Event(Sprite.END));
};
};
rect.x = x;
rect.y = y;
rect.width = width;
rect.height = height;
}
public function render(_arg1:BitmapData){
if (animation == null){
return;
};
animation.render(_arg1, x, y, frame);
}
public function set frameRate(_arg1:int){
_frameRate = _arg1;
}
public function renderEx(_arg1:BitmapData){
if (animation == null){
return;
};
animation.renderEx(_arg1, x, y, frame, rotation);
}
protected function onAnimationEnd(){
}
}
}//package game
Section 59
//SpriteSheet (game.SpriteSheet)
package game {
import flash.display.*;
import flash.geom.*;
public class SpriteSheet {
private var spriteWidth:int;// = 0
private var totalFrames:int;// = 0
private var spriteHeight:int;// = 0
private var point:Point;
private var matrix:Matrix;
private var rectangles:Array;
private var cachedFrames:Array;// = null
private var spritesPerRow:int;// = 0
private var bitmap:BitmapData;// = null
public function SpriteSheet(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
var _local6:int;
bitmap = null;
rectangles = new Array();
totalFrames = 0;
point = new Point();
matrix = new Matrix();
spriteWidth = 0;
spriteHeight = 0;
spritesPerRow = 0;
cachedFrames = null;
super();
bitmap = _arg1;
totalFrames = _arg2;
spritesPerRow = _arg3;
spriteWidth = _arg4;
spriteHeight = _arg5;
_local6 = 0;
while (_local6 < _arg2) {
rectangles.push(new Rectangle((int((_local6 % _arg3)) * _arg4), (int((_local6 / _arg3)) * _arg5), _arg4, _arg5));
_local6++;
};
}
public function render(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:int){
var _local5:*;
if (_arg4 >= totalFrames){
trace(("ERROR! invalid frame index " + _arg4));
return;
};
point.x = _arg2;
point.y = _arg3;
_local5 = rectangles[_arg4];
_arg1.copyPixels(bitmap, _local5, point, bitmap, _local5.topLeft, true);
}
public function cacheFrames(_arg1:Boolean=false){
var _local2:*;
var _local3:BitmapData;
cachedFrames = new Array();
cachedFrames.length = totalFrames;
_local2 = 0;
while (_local2 < totalFrames) {
_local3 = new BitmapData(spriteWidth, spriteHeight, true, 0);
render(_local3, 0, 0, _local2);
cachedFrames[_local2] = _local3;
_local2++;
};
if (_arg1){
bitmap.dispose();
bitmap = null;
};
}
public function get frameCount():int{
return (totalFrames);
}
public function renderEx(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:int, _arg5:Number){
if (_arg4 >= totalFrames){
trace(("ERROR! invalid frame index " + _arg4));
return;
};
if (cachedFrames == null){
trace("ERROR! frames not cached");
return;
};
matrix.identity();
matrix.translate(0, (-(spriteHeight) * 0.5));
matrix.rotate(Common.deg2Rad(_arg5));
matrix.translate(_arg2, (_arg3 + (spriteHeight * 0.5)));
_arg1.draw(cachedFrames[_arg4], matrix);
}
public function clone(_arg1:Number=1, _arg2:Boolean=false, _arg3:Number=1):SpriteSheet{
var _local4:SpriteSheet;
var _local5:Matrix;
var _local6:Rectangle;
_local4 = new SpriteSheet(null, totalFrames, spritesPerRow, (rectangles[0].width * _arg1), (rectangles[0].height * _arg1));
_local4.bitmapData = new BitmapData((bitmap.rect.width * _arg1), (bitmap.rect.height * _arg1), true, 0);
_local5 = new Matrix();
_local6 = null;
_local5.scale(_arg1, _arg1);
_local4.bitmapData.draw(bitmap, _local5, new ColorTransform(1, 1, 1, _arg3), null, null, _arg2);
return (_local4);
}
public function get frameWidth():int{
return (spriteWidth);
}
public function set bitmapData(_arg1:BitmapData){
bitmap = _arg1;
}
public function get frameHeight():int{
return (spriteHeight);
}
public function get bitmapData():BitmapData{
return (bitmap);
}
public function get isCached():Boolean{
return (!((cachedFrames == null)));
}
}
}//package game
Section 60
//Story (game.Story)
package game {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.ui.*;
public class Story extends MovieClip {
private var fadeScreen:FadeToBlack;
private var fadeTimer:Timer;// = null
public var skip:SimpleButton;
private var skipStory:Boolean;// = false
public function Story(){
fadeScreen = new FadeToBlack();
fadeTimer = null;
skipStory = false;
super();
addChild(fadeScreen);
fadeScreen.addEventListener(FadeToBlack.FADED, onFadedHandler);
fadeTimer = new Timer(7000);
fadeTimer.addEventListener(TimerEvent.TIMER, onFadeTimer);
skip.addEventListener(MouseEvent.CLICK, onSkipClicked);
addEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOutHandler);
}
private function onFadeTimer(_arg1:TimerEvent){
fadeScreen.fade(0.025);
fadeTimer.stop();
}
private function onFadedHandler(_arg1:Event){
if ((((currentFrame == totalFrames)) || (skipStory))){
(Game.gameScreen as StoryGameScreen).showStory(false);
(Game.gameScreen as StoryGameScreen).showTutorial(true);
return;
};
gotoAndStop((currentFrame + 1));
fadeTimer.start();
}
private function onSkipClicked(_arg1:MouseEvent){
fadeScreen.fade(0.025);
skipStory = true;
}
private function onMouseOutHandler(_arg1:Event){
Mouse.hide();
}
public function show(_arg1:Boolean){
visible = _arg1;
skipStory = false;
gotoAndStop(1);
if (_arg1){
fadeTimer.start();
} else {
fadeTimer.stop();
};
}
private function onMouseOverHandler(_arg1:Event){
Mouse.show();
}
}
}//package game
Section 61
//StoryGameScreen (game.StoryGameScreen)
package game {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.ui.*;
public class StoryGameScreen extends GameScreen {
private var fadeScreen:FadeToBlack;
private var arrowLight:ListNode;// = null
private var _survivors:uint;// = 0
private var arrowAlphaInc:Number;// = 0
private var story:Story;
var manageDialog:ManageDialog;// = null
private var searchDialog:SearchDialog;// = null
private var tutorial:Tutorial;
private var waveIndex:uint;// = 0
var _weaponsFound:Array;
private var mapDialog:MapDialog;// = null
public function StoryGameScreen(){
var _local1:*;
_survivors = 0;
_weaponsFound = new Array();
manageDialog = null;
searchDialog = null;
mapDialog = null;
waveIndex = 0;
fadeScreen = new FadeToBlack();
tutorial = new Tutorial();
story = new Story();
arrowAlphaInc = 0;
arrowLight = null;
super();
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
_local1 = 0;
while (_local1 < 8) {
_weaponsFound.push(0);
_local1++;
};
}
override public function onWaveKilled(_arg1:Wave){
super.onWaveKilled(_arg1);
waveIndex++;
if ((((waveIndex == 3)) && (!(gameOverScreen.isGameOver)))){
waveIndex = 0;
arrow.visible = true;
arrow.alpha = 1;
hud.common.monstersKilled.visible = true;
};
}
public function get survivors():uint{
return (_survivors);
}
private function onFadedHandler(_arg1:Event){
waveIndex = 0;
searchDialog.hoursLeft = Math.floor(Common.random(5, 12));
searchDialog.show();
level.enableNight = ((Math.random())<0.5) ? true : false;
hud.common.monstersKilled.visible = false;
nightAlpha = (level.enableNight) ? 50 : 0xFF;
if (((arrowLight) && (arrowLight.list))){
arrowLight.list.remove(arrowLight);
arrowLight = null;
};
}
public function nextLevel(_arg1:uint){
var _local2:MovieClip;
save(_arg1);
trap0.isEnabled = false;
trap1.isEnabled = false;
airstrike.isEnabled = false;
tesla.isEnabled = false;
assist0.health = 100;
assist1.health = 100;
human.health = 100;
decalLayer.bitmapData.fillRect(decalLayer.bitmapData.rect, 0);
_local2 = new Floor();
_local2.x = -33.7;
_local2.y = 227.1;
decalLayer.insert(_local2);
_local2 = null;
searchDialog.removeItems(SearchDialog.k_ItemFuel, 5);
walls["wall0_"].reset();
walls["wall1_"].reset();
walls["wall2_"].reset();
walls["wall3_"].reset();
walls["wall4_"].reset();
parseLevel(Level.levels[_arg1]);
manageDialog.show();
}
public function getWeaponsFound(_arg1:int):uint{
if ((((_arg1 >= _weaponsFound.length)) || ((_arg1 < 0)))){
trace(("ERROR! StoryGameScreen::getWeaponsFound : invalid weapon index " + _arg1));
return (0);
};
return (_weaponsFound[_arg1]);
}
public function set survivors(_arg1:uint){
_survivors = _arg1;
}
override public function load(){
var _local1:SharedObject;
var _local2:*;
_local1 = SharedObject.getLocal("save");
if ((((_local1.data.level == null)) || ((_local1.data.level == undefined)))){
return;
};
parseLevel(Level.levels[_local1.data.level]);
_survivors = _local1.data.survivors;
wavesSurvived = _local1.data.wavesSurvived;
score = _local1.data.score;
_local2 = 0;
while (_local2 < _local1.data.weaponsFound.length) {
_weaponsFound[_local2] = _local1.data.weaponsFound[_local2];
_local2++;
};
_local2 = 0;
while (_local2 < _local1.data.ammo.length) {
ammo[_local2] = _local1.data.ammo[_local2];
_local2++;
};
_local1.close();
if (!assist0.isEnabled){
attachAssist(0);
};
if (!assist1.isEnabled){
attachAssist(1);
};
mapDialog.initialize(_local1.data.level);
manageDialog.show();
}
public function attachAssist(_arg1:uint){
if (_survivors == 0){
return;
};
this[("assist" + _arg1)].isEnabled = true;
this[("assist" + _arg1)].health = 100;
_survivors--;
}
public function showMapDialog(){
mapDialog.show();
}
private function onManageClicked(_arg1:Event){
}
override public function reset(){
super.reset();
parseLevel(Level.levels[0]);
addAmmo(Weapon.Rifle, Config.instance.k_StStartAmmo);
addAmmo(Weapon.Grenade, Config.instance.k_StStartGrenades);
addAmmo(Weapon.AK74, 60);
human.giveWeapon(Weapon.AK74, false);
addChild(hud);
hud.common.money.visible = false;
hud.common.moneyCaption.visible = false;
hud.common.wave.visible = false;
hud.common.buy.visible = false;
manageDialog = new ManageDialog();
manageDialog.visible = false;
addChild(manageDialog);
searchDialog = new SearchDialog();
searchDialog.visible = false;
addChild(searchDialog);
mapDialog = new MapDialog();
mapDialog.visible = false;
addChild(mapDialog);
}
public function save(_arg1:uint){
var _local2:SharedObject;
var _local3:*;
_local2 = SharedObject.getLocal("save");
_local2.data.level = _arg1;
_local2.data.score = score;
_local2.data.survivors = (((_survivors + (assist0.isEnabled) ? 1 : 0) + (assist1.isEnabled) ? 1 : 0) + (hummer.gunner.isEnabled) ? 1 : 0);
_local2.data.wavesSurvived = wavesSurvived;
_local2.data.weaponsFound = new Array();
_local2.data.ammo = new Array();
_local3 = 0;
while (_local3 < _weaponsFound.length) {
_local2.data.weaponsFound.push((_weaponsFound[_local3] + (((human.hasWeapon[_local3]) && (!((_local3 == 0))))) ? 1 : 0));
_local3++;
};
_local3 = 0;
while (_local3 < ammo.length) {
_local2.data.ammo.push(ammo[_local3]);
_local3++;
};
_local2.flush();
}
public function showTutorial(_arg1:Boolean){
tutorial.show(_arg1);
isPaused = _arg1;
hud.visible = !(_arg1);
if (_arg1){
Mouse.show();
} else {
Mouse.hide();
};
}
override public function initialize(){
if (isInitialized){
return;
};
super.initialize();
super.gameHUD.visible = false;
addChild(fadeScreen);
fadeScreen.addEventListener(FadeToBlack.FADED, onFadedHandler);
addChild(tutorial);
tutorial.visible = false;
addChild(story);
story.visible = false;
_isInitialized = true;
}
public function getSearchDialog():SearchDialog{
return (searchDialog);
}
private function onSearchClicked(_arg1:Event){
searchDialog.show();
}
public function showStory(_arg1:Boolean){
story.show(_arg1);
isPaused = _arg1;
hud.visible = !(_arg1);
if (_arg1){
Mouse.show();
} else {
Mouse.hide();
};
}
private function onEnterFrameHandler(_arg1:Event){
if (((!(isActive)) || (isPaused))){
return;
};
hud.update(this);
if (!assist0.isEnabled){
attachAssist(0);
};
if (!assist1.isEnabled){
attachAssist(1);
};
if (((arrow.visible) && ((arrowLight == null)))){
arrowLight = lights.insert({x:arrow.x, y:arrow.y, bitmap:Resources.bitmap_LightExplosion, scale:1.5, alpha:1});
};
if (arrow.visible){
arrow.alpha = (arrow.alpha + arrowAlphaInc);
if (arrow.alpha <= 0.25){
arrowAlphaInc = 0.035;
} else {
if (arrow.alpha >= 1){
arrowAlphaInc = -0.035;
};
};
if ((((human.x <= 50)) && ((human.y >= (Game.height - 50))))){
fadeScreen.fade(0.025);
isPaused = true;
};
};
}
}
}//package game
Section 62
//SurvivalGameScreen (game.SurvivalGameScreen)
package game {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class SurvivalGameScreen extends GameScreen {
private var nightTimer:Timer;
private var weaponCost:Array;
private var cfg:Config;// = null
private var nightInc:Number;// = -0.5
private var money:int;// = 100
private var monsterCost:List;
private var ammoBuyAmount:Array;
private var assistUpgrade:uint;// = 0
private var ammoCost:Array;
private var shopDialog:ShopDialog;// = null
static var instance:SurvivalGameScreen = null;
public function SurvivalGameScreen(){
money = 100;
cfg = null;
shopDialog = null;
nightInc = -0.5;
weaponCost = new Array();
ammoCost = new Array();
ammoBuyAmount = new Array();
nightTimer = new Timer(60000);
monsterCost = new List();
assistUpgrade = 0;
super();
instance = this;
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
hud.common.buy.addEventListener(MouseEvent.CLICK, onBuyClicked);
nightTimer.addEventListener(TimerEvent.TIMER, onNightTimer);
}
private function onBuyClicked(_arg1:Event){
shopDialog.show();
}
public function buyWeapon(_arg1:int):Boolean{
if ((((_arg1 >= weaponCost.length)) || ((_arg1 < 0)))){
trace(("ERROR! SurvivalGameScreen::buyWeapon : invalid weapon index " + _arg1));
return (false);
};
if (money < weaponCost[_arg1]){
return (false);
};
human.giveWeapon(_arg1, false);
ammo[_arg1] = (ammo[_arg1] + human.weapons[_arg1].clipSize);
money = (money - weaponCost[_arg1]);
return (true);
}
public function buyAmmo(_arg1:int):Boolean{
if ((((_arg1 >= ammoCost.length)) || ((_arg1 < 0)))){
trace(("ERROR! SurvivalGameScreen::buyAmmo : invalid weapon index " + _arg1));
return (false);
};
if (money < ammoCost[_arg1]){
return (false);
};
ammo[_arg1] = (ammo[_arg1] + ammoBuyAmount[_arg1]);
money = (money - ammoCost[_arg1]);
return (true);
}
public function buyAssist(_arg1:uint){
var _local2:Assist;
if (money < cfg.k_SAssistCost){
return;
};
money = (money - cfg.k_SAssistCost);
if (this[("assist" + _arg1)] != undefined){
_local2 = this[("assist" + _arg1)];
_local2.isEnabled = true;
switch (assistUpgrade){
case 1:
assist0.giveWeapon(Weapon.AK74, true);
assist0.chooseWeapon(Weapon.AK74);
assist1.giveWeapon(Weapon.AK74, true);
assist1.chooseWeapon(Weapon.AK74);
break;
case 2:
assist0.giveWeapon(Weapon.Jackhammer, true);
assist0.chooseWeapon(Weapon.Jackhammer);
assist1.giveWeapon(Weapon.Jackhammer, true);
assist1.chooseWeapon(Weapon.Jackhammer);
break;
};
};
}
override public function addMoney(_arg1:int){
money = (money + _arg1);
}
public function removeMoney(_arg1:uint){
money = (money - _arg1);
}
public function getMoney():int{
return (money);
}
public function getAmmoCost(_arg1:int):int{
if ((((_arg1 >= ammoCost.length)) || ((_arg1 < 0)))){
trace(("ERROR! SurvivalGameScreen::getAmmoCost : invalid weapon index " + _arg1));
return (0);
};
return (ammoCost[_arg1]);
}
private function onNightTimer(_arg1:TimerEvent){
if (nightAlpha == 0xFF){
nightInc = -0.15;
} else {
if (nightAlpha == 0){
nightInc = 0.15;
};
};
nightTimer.stop();
}
override public function reset(){
super.reset();
addAmmo(Weapon.Rifle, Config.instance.k_SStartAmmo);
addAmmo(Weapon.Grenade, Config.instance.k_SStartGrenades);
shopDialog = new ShopDialog();
shopDialog.x = ((Game.width * 0.5) - (shopDialog.width * 0.5));
shopDialog.y = ((Game.height * 0.5) - (shopDialog.height * 0.5));
shopDialog.visible = false;
addChild(shopDialog);
hud.common.money.visible = true;
hud.common.moneyCaption.visible = true;
money = cfg.k_SStartMoney;
assistUpgrade = 0;
level.golem = 1;
level.mob1 = 1;
level.mob3 = 1;
level.scorp = 1;
level.isLoaded = true;
level.random();
nightAlpha = 0xFF;
nightInc = 0;
nightTimer.start();
}
override public function onMonsterDied(_arg1:Number, _arg2:Monster){
var _local3:MovieClip;
addMoney(_arg1);
if (monsterCost.size < 20){
_local3 = new MonsterCost();
_local3.x = (_arg2.x + (_arg2.width * 0.5));
_local3.y = (_arg2.y + (_arg2.height * 0.5));
_local3.caption.text = ("$" + _arg1);
addChild(_local3);
monsterCost.insert(_local3);
};
}
override public function initialize(){
if (isInitialized){
return;
};
super.initialize();
super.gameHUD.visible = false;
addChild(hud);
hud.common.score.visible = false;
cfg = Config.instance;
weaponCost.push(0);
weaponCost.push(cfg.k_SAK74Cost);
weaponCost.push(cfg.k_SJackCost);
weaponCost.push(cfg.k_SFlamethrowerCost);
weaponCost.push(cfg.k_SLaserCost);
weaponCost.push(cfg.k_SMinigunCost);
weaponCost.push(cfg.k_STeslaCost);
ammoCost.push(cfg.k_SRifleAmmoCost);
ammoCost.push(cfg.k_SAK74AmmoCost);
ammoCost.push(cfg.k_SJackAmmoCost);
ammoCost.push(cfg.k_SFlameAmmoCost);
ammoCost.push(cfg.k_SLaserAmmoCost);
ammoCost.push(cfg.k_SMinigunAmmoCost);
ammoCost.push(cfg.k_STeslaAmmoCost);
ammoCost.push(cfg.k_SGrenadeCost);
ammoBuyAmount.push(5);
ammoBuyAmount.push(30);
ammoBuyAmount.push(10);
ammoBuyAmount.push(50);
ammoBuyAmount.push(50);
ammoBuyAmount.push(100);
ammoBuyAmount.push(5);
ammoBuyAmount.push(1);
reset();
_isInitialized = true;
}
public function upgradeAssist():Boolean{
if (assistUpgrade >= 2){
return (false);
};
assistUpgrade++;
switch (assistUpgrade){
case 1:
assist0.giveWeapon(Weapon.AK74, true);
assist0.chooseWeapon(Weapon.AK74);
assist1.giveWeapon(Weapon.AK74, true);
assist1.chooseWeapon(Weapon.AK74);
break;
case 2:
assist0.giveWeapon(Weapon.Jackhammer, true);
assist0.chooseWeapon(Weapon.Jackhammer);
assist1.giveWeapon(Weapon.Jackhammer, true);
assist1.chooseWeapon(Weapon.Jackhammer);
hummer.gunner.isWeaponVisible = false;
break;
};
return ((assistUpgrade < 2));
}
public function getAssistUpgrade():uint{
return (assistUpgrade);
}
private function onEnterFrameHandler(_arg1:Event){
var _local2:ListNode;
var _local3:ListNode;
if (((!(isActive)) || (isPaused))){
return;
};
hud.update(this);
_local2 = monsterCost.end;
_local3 = monsterCost.begin;
while (_local3 != _local2) {
_local3.data.y = (_local3.data.y - 2);
_local3.data.alpha = (_local3.data.alpha - 0.01);
if (_local3.data.alpha <= 0){
removeChild(_local3.data);
_local3 = monsterCost.remove(_local3);
} else {
_local3 = _local3.next;
};
};
nightAlpha = (nightAlpha + nightInc);
if (nightAlpha < 0){
nightAlpha = 0;
nightTimer.start();
nightInc = 0;
} else {
if (nightAlpha > 0xFF){
nightAlpha = 0xFF;
nightTimer.start();
nightInc = 0;
};
};
}
public function getWeaponCost(_arg1:int):int{
if ((((_arg1 >= weaponCost.length)) || ((_arg1 < 0)))){
trace(("ERROR! SurvivalGameScreen::getWeaponCost : invalid weapon index " + _arg1));
return (0);
};
return (weaponCost[_arg1]);
}
}
}//package game
Section 63
//Tesla (game.Tesla)
package game {
import flash.display.*;
import flash.geom.*;
import flash.media.*;
public class Tesla extends Weapon {
private var _soundEnabled:Boolean;// = true
private var _ty:Number;// = 0
private var _tx:Number;// = 0
private var _dx:Number;// = 0
private var _dy:Number;// = 0
private var soundChargingChannel:SoundChannel;// = null
private var bitmap:BitmapData;
private var alpha:Number;// = 1
private var x:Number;// = 0
private var y:Number;// = 0
private var rotation:Number;// = 0
private var energy:Number;// = 0
private var frames:Array;
private var isCharging:Boolean;// = false
private var isVisible:Boolean;// = false
private var scalar:Number;// = 1
public function Tesla(){
var _local1:*;
bitmap = new BitmapData(700, 525, true, 0);
rotation = 0;
x = 0;
y = 0;
isVisible = false;
_dx = 0;
_dy = 0;
_tx = 0;
_ty = 0;
_soundEnabled = true;
scalar = 1;
alpha = 1;
frames = new Array();
energy = 0;
isCharging = false;
soundChargingChannel = null;
super();
_local1 = 0;
while (_local1 < 20) {
frames.push(-1);
_local1++;
};
}
public function get soundEnabled():Boolean{
return (_soundEnabled);
}
override public function fire(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean):uint{
var _local6:GameScreen;
var _local7:Number;
var _local8:Number;
var _local9:*;
_local6 = Game.gameScreen;
if ((((_local6.getAmmo(Weapon.TeslaGun) <= 0)) && (!(_isInfAmmo)))){
return (0);
};
_local7 = (_arg3 - _arg1);
_local8 = (_arg4 - _arg2);
_local9 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
_local7 = (_local7 / _local9);
_local8 = (_local8 / _local9);
x = _arg1;
y = _arg2;
rotation = ((-180 * Math.atan2(-(_local7), -(_local8))) / Math.PI);
_dx = _local7;
_dy = _local8;
_tx = _arg3;
_ty = _arg4;
return (0);
}
public function set soundEnabled(_arg1:Boolean){
_soundEnabled = _arg1;
}
private function renderBitmap(){
var _local1:Matrix;
var _local2:MovieClip;
var _local3:Number;
var _local4:Vector;
var _local5:Vector;
var _local6:*;
var _local7:Vector;
var _local8:Vector;
if (alpha == 0){
return;
};
_local1 = new Matrix();
_local2 = new Lightings();
_local3 = ((-180 * Math.atan2(-(_dx), -(_dy))) / Math.PI);
_local4 = new Vector(_dx, _dy);
_local5 = new Vector(x, y);
_local1.rotate(Common.deg2Rad(rotation));
_local1.translate(x, y);
bitmap.fillRect(bitmap.rect, 0);
_local6 = 0;
while (_local6 < Math.floor((20 * scalar))) {
if (frames[_local6] == -1){
frames[_local6] = (Math.floor((Math.random() * _local2.totalFrames)) + 1);
};
_local2.gotoAndStop(frames[_local6]);
_local1.identity();
_local1.rotate(Common.deg2Rad((_local3 - 90)));
_local1.translate(_local5.x, _local5.y);
bitmap.draw(_local2, _local1, new ColorTransform(1, 1, 1, (alpha * 1.25)));
_local5.x = (_local5.x + (_local4.x * 30));
_local5.y = (_local5.y + (_local4.y * 30));
_local4.x = (_local4.x + Common.random(-3, 3));
_local4.y = (_local4.y + Common.random(-3, 3));
_local4.x = (_local4.x + ((_tx - x) * 0.01));
_local4.y = (_local4.y + ((_ty - y) * 0.01));
_local4.normalize();
_local3 = ((-180 * Math.atan2(-(_local4.x), -(_local4.y))) / Math.PI);
_local7 = new Vector((_tx - x), (_ty - y));
_local8 = new Vector((_tx - _local5.x), (_ty - _local5.y));
_local7.normalize();
_local8.normalize();
if (_local8.dot(_local7) < 0){
break;
};
_local6++;
};
}
public function setEnergy(_arg1:Number){
energy = _arg1;
isCharging = true;
}
override public function render(_arg1:BitmapData){
_arg1.copyPixels(bitmap, bitmap.rect, new Point(0, 0), bitmap, null, true);
}
private function hit(_arg1:Number, _arg2:Number, _arg3:Number){
var _local4:*;
var _local5:Monster;
_local4 = 0;
while (_local4 < Game.gameScreen.monsters.length) {
_local5 = Game.gameScreen.monsters[_local4];
if (bitmap.hitTest(new Point(0, 0), Math.floor((0xFF * 0.25)), _local5.collisionBitmap, new Point(_local5.x, _local5.y))){
_local5.hit(_arg3, true);
};
_local4++;
};
}
override public function update(){
var _local1:Sound;
var _local2:*;
super.update();
if ((((Game.gameScreen.getAmmo(Weapon.TeslaGun) <= 0)) && (!(_isInfAmmo)))){
energy = 0;
_overheat = 0;
Game.gameScreen.nightAlphaAdd = 0;
return;
};
if (isShooting){
if (((!(isCharging)) && (_soundEnabled))){
_local1 = new SoundTeslaPowerUp();
soundChargingChannel = _local1.play();
};
energy = (energy + 0.035);
isCharging = true;
};
_overheat = (energy * 100);
renderBitmap();
if (((((!(isShooting)) || ((energy >= 1)))) && (isCharging))){
if (soundChargingChannel){
soundChargingChannel.stop();
};
if (_soundEnabled){
new SoundTeslaShot1().play();
};
if (energy > 1){
Game.gameScreen.hitWalls();
};
alpha = (energy + 0.2);
energy = 0;
isCharging = false;
alpha = Math.min(1.2, alpha);
if (!_isInfAmmo){
Game.gameScreen.removeAmmo(Weapon.TeslaGun, 1);
};
};
alpha = (alpha - 0.1125);
alpha = Math.max(0, alpha);
Game.gameScreen.nightAlphaAdd = (alpha * 0xFF);
if (Game.gameScreen.nightAlphaAdd > 0){
Game.gameScreen.nightAlphaAdd = (Game.gameScreen.nightAlphaAdd + Common.random(-50, 50));
};
if (alpha > 0){
hit(_tx, _ty, ((500 * alpha) * alpha));
};
if (alpha <= 0){
_local2 = 0;
while (_local2 < frames.length) {
frames[_local2] = -1;
_local2++;
};
};
isVisible = isCharging;
}
}
}//package game
Section 64
//TeslaTower (game.TeslaTower)
package game {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
public class TeslaTower extends MovieClip {
private var tesla:Tesla;
private var soundChannel:SoundChannel;// = null
private var timer:Timer;// = null
var isReloaded:Boolean;// = true
public var glow:MovieClip;
var isEnabled:Boolean;// = false
var isActive:Boolean;// = false
public function TeslaTower(){
tesla = new Tesla();
timer = null;
soundChannel = null;
isEnabled = false;
isActive = false;
isReloaded = true;
super();
if (!Config.instance){
return;
};
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
timer = new Timer(Config.instance.k_TeslaDelay);
timer.addEventListener(TimerEvent.TIMER, onTimer);
glow.visible = false;
glow.gotoAndStop(1);
tesla.soundEnabled = false;
tesla.isInfAmmo = true;
}
public function render(_arg1:BitmapData){
if (isEnabled){
tesla.render(_arg1);
};
}
private function onTimer(_arg1:TimerEvent){
isReloaded = true;
timer.stop();
}
private function onEnterFrameHandler(_arg1:Event){
var _local2:Point;
if (!isEnabled){
return;
};
tesla.update();
if (((!(isActive)) || (!(isReloaded)))){
return;
};
if (!glow.visible){
glow.play();
glow.visible = true;
soundChannel = new SoundTeslaPowerUp().play();
};
if (glow.currentFrame == (glow.totalFrames - 1)){
_local2 = localToGlobal(new Point(glow.x, glow.y));
tesla.setEnergy(1);
tesla.fire(_local2.x, _local2.y, 350, 250, false);
if (soundChannel){
soundChannel.stop();
};
new SoundTeslaShot1().play();
isReloaded = false;
isActive = false;
timer.start();
glow.gotoAndStop(1);
glow.visible = false;
};
}
}
}//package game
Section 65
//ToggleSound (game.ToggleSound)
package game {
import flash.events.*;
import flash.display.*;
public class ToggleSound extends SimpleButton {
private var isSoundOn:Boolean;// = true
public function ToggleSound(){
isSoundOn = true;
super();
addEventListener(MouseEvent.CLICK, onMouseClickHandler);
}
private function onMouseClickHandler(_arg1:MouseEvent){
var _local2:MovieClip;
_local2 = (parent as MovieClip);
_local2.gotoAndStop(((_local2.currentFrame)==1) ? 2 : 1);
Game.toggleSound();
}
}
}//package game
Section 66
//Tracer (game.Tracer)
package game {
import flash.display.*;
import flash.geom.*;
public class Tracer {
var node:ListNode;// = null
private var ty:Number;// = 0
private var grid:CollisionGrid;// = null
private var tx:Number;// = 0
private var dx:Number;// = 0
private var dy:Number;// = 0
var pos:Point;
private var _isVisible:Boolean;// = true
var frame:int;// = 0
private var dmg:Number;// = 0
static var k_MaxListLength:int = 0;
static var tracer_SpriteSheet:SpriteSheet = new SpriteSheet(null, 25, 5, 71, 71);
static var k_MonstersChecked:int = 0;
public function Tracer(){
pos = new Point();
frame = 0;
node = null;
dx = 0;
dy = 0;
tx = 0;
ty = 0;
dmg = 0;
grid = null;
_isVisible = true;
super();
grid = Game.gameScreen.grid;
}
public function update(){
var _local1:uint;
var _local2:Vector;
var _local3:ListNode;
var _local4:ListNode;
pos.x = (pos.x + dx);
pos.y = (pos.y + dy);
if (dmg < 1){
node.list.remove(node);
return;
};
_local1 = grid.getSectorIndex(pos.x, pos.y);
if (grid.sectors[_local1]){
_local3 = grid.sectors[_local1].end;
if (grid.sectors[_local1].size > k_MaxListLength){
k_MaxListLength = grid.sectors[_local1].size;
};
_local4 = grid.sectors[_local1].begin;
while (_local4 != _local3) {
if ((((_local4.data == null)) || (_local4.data.isDead))){
} else {
k_MonstersChecked++;
if (_local4.data.rect.containsPoint(pos)){
_local4.data.hit((((Math.random() * dmg) * 0.5) + dmg), true);
if (((((_local4.data) && ((_local4.data.health > 0)))) || ((dmg < 1)))){
node.list.remove(node);
return;
};
dmg = (dmg * 0.6);
};
};
_local4 = _local4.next;
};
};
if ((((((((pos.x < 0)) || ((pos.x > Game.stage.width)))) || ((pos.y < 0)))) || ((pos.y > Game.stage.height)))){
node.list.remove(node);
return;
};
_local2 = new Vector(pos.x, pos.y);
_local2.dirTo(tx, ty);
if (_local2.dot(new Vector(dx, dy)) < 0){
node.list.remove(node);
Game.gameScreen.spawnDecal(Resources.bitmap_BulletHoles[Math.round((Math.random() * 2))], tx, ty);
Game.gameScreen.spawnEffect(Resources.sheet_GroundSplashX2, tx, ty);
};
}
public function set isVisible(_arg1:Boolean){
_isVisible = _arg1;
}
public function get isVisible():Boolean{
return (_isVisible);
}
private function testMonsterCollision(_arg1:Monster):Boolean{
return (_arg1.rect.containsPoint(pos));
}
public function spawn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
var _local6:Number;
dx = (_arg2 * 50);
dy = (_arg3 * 50);
tx = _arg4;
ty = _arg5;
dmg = _arg1;
_local6 = ((-180 * Math.atan2(-(_arg2), -(_arg3))) / Math.PI);
frame = Common.clamp(Math.floor(((_local6 * 25) / 90)), 0, 24);
}
static function initializeSheet(){
var _local1:BitmapData;
var _local2:Matrix;
var _local3:Number;
var _local4:Number;
var _local5:int;
tracer_SpriteSheet.bitmapData = new BitmapData((71 * 5), (71 * 5), true, 0);
_local1 = new BitmapTracerSmall(0, 0);
_local2 = new Matrix();
_local3 = 0;
_local4 = (90 / 25);
_local5 = 0;
while (_local5 < 25) {
_local2.identity();
_local2.rotate(Common.deg2Rad(_local3));
_local2.translate(((int((_local5 % 5)) * 71) + 60), (int((_local5 / 5)) * 71));
tracer_SpriteSheet.bitmapData.draw(_local1, _local2);
_local3 = (_local3 + _local4);
_local5++;
};
}
}
}//package game
Section 67
//Tutorial (game.Tutorial)
package game {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
public class Tutorial extends MovieClip {
var fadeScreen:FadeToBlack;
public var next:SimpleButton;
public var skip:SimpleButton;
public function Tutorial(){
fadeScreen = new FadeToBlack();
super();
skip.addEventListener(MouseEvent.CLICK, onSkipClicked);
next.addEventListener(MouseEvent.CLICK, onNextClicked);
fadeScreen.addEventListener(FadeToBlack.FADED, onFadedHandler);
addEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOutHandler);
addChild(fadeScreen);
gotoAndStop(1);
}
private function onFadedHandler(_arg1:Event){
(Game.gameScreen as StoryGameScreen).showTutorial(false);
}
private function onSkipClicked(_arg1:MouseEvent){
fadeScreen.fade(0.025);
skip.mouseEnabled = false;
next.mouseEnabled = false;
}
private function onNextClicked(_arg1:MouseEvent){
if (currentFrame == totalFrames){
fadeScreen.fade(0.025);
skip.mouseEnabled = false;
next.mouseEnabled = false;
return;
};
gotoAndStop((currentFrame + 1));
}
private function onMouseOutHandler(_arg1:Event){
Mouse.hide();
}
public function show(_arg1:Boolean){
skip.mouseEnabled = _arg1;
next.mouseEnabled = _arg1;
visible = _arg1;
}
private function onMouseOverHandler(_arg1:Event){
Mouse.show();
}
}
}//package game
Section 68
//Wall (game.Wall)
package game {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
public class Wall extends MovieClip {
public var attackers:Array;
private var lastFrame:int;// = 0
private var _health:Number;// = 100
private var bd:BitmapData;// = null
private var upgradeLevel:uint;// = 0
static const DESTROYED:String = "Destroyed";
public function Wall(){
_health = 100;
attackers = new Array();
bd = null;
upgradeLevel = 0;
lastFrame = 0;
super();
addFrameScript(0, frame1);
bd = new BitmapData(width, height, true, 0);
bd.draw(this);
}
public function upgrade(){
if (currentFrame == totalFrames){
return;
};
upgradeLevel++;
health = maxHealth();
}
public function isRepaired():Boolean{
return ((health == maxHealth()));
}
public function get health():Number{
return (_health);
}
function frame1(){
stop();
}
public function reset(){
health = 100;
visible = true;
}
public function hit(_arg1:Number){
var _local2:Sound;
health = (health - _arg1);
if (health <= 0){
(parent as Walls).updateBitmap();
dispatchEvent(new Event(DESTROYED));
};
if (currentFrame != lastFrame){
_local2 = new SoundDebris1();
_local2.play();
lastFrame = currentFrame;
};
}
public function get isBroken():Boolean{
return ((_health == 0));
}
public function set health(_arg1:Number){
_health = Math.min(maxHealth(), Math.max(0, _arg1));
gotoAndStop((Math.floor((_health / 20)) + 1));
}
private function maxHealth():Number{
return ((100 + (upgradeLevel * 20)));
}
public function testCollision(_arg1:BitmapData, _arg2:Number, _arg3:Number):Boolean{
var _local4:Point;
_local4 = parent.localToGlobal(new Point(x, y));
return (bd.hitTest(_local4, 1, _arg1, new Point(_arg2, _arg3)));
}
}
}//package game
Section 69
//Walls (game.Walls)
package game {
import flash.display.*;
public class Walls extends MovieClip {
public var wall4_:Wall;
var bd:BitmapData;// = null
public var wall0_:Wall;
public var wall1_:Wall;
public var wall2_:Wall;
public var wall3_:Wall;
public function Walls(){
bd = null;
super();
updateBitmap();
}
public function updateBitmap(){
bd = new BitmapData(width, height, true, 0);
bd.draw(this);
}
public function getWallCollision(_arg1:BitmapData, _arg2:Number, _arg3:Number):Wall{
if (((!(wall0_.isBroken)) && (wall0_.testCollision(_arg1, _arg2, _arg3)))){
return (wall0_);
};
if (((!(wall1_.isBroken)) && (wall1_.testCollision(_arg1, _arg2, _arg3)))){
return (wall1_);
};
if (((!(wall2_.isBroken)) && (wall2_.testCollision(_arg1, _arg2, _arg3)))){
return (wall2_);
};
if (((!(wall3_.isBroken)) && (wall3_.testCollision(_arg1, _arg2, _arg3)))){
return (wall3_);
};
if (((!(wall4_.isBroken)) && (wall4_.testCollision(_arg1, _arg2, _arg3)))){
return (wall4_);
};
return (null);
}
}
}//package game
Section 70
//Wave (game.Wave)
package game {
import flash.events.*;
import flash.utils.*;
public class Wave {
private var timer:Timer;// = null
private var spawned:uint;// = 0
private var def:Array;
private var maxMonsters:uint;// = 0
var _monstersLeft:uint;// = 0
static var k_MonsterHealth:Array = new Array();
static var k_MonsterTypes:Array = new Array();
public function Wave(){
timer = null;
spawned = 0;
maxMonsters = 0;
def = new Array();
_monstersLeft = 0;
super();
if (k_MonsterTypes.length == 0){
};
timer = new Timer(2000);
timer.addEventListener(TimerEvent.TIMER, onTimer);
}
public function get monstersLeft():uint{
return (_monstersLeft);
}
private function spawnMonsters(_arg1:String, _arg2:uint){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:Monster;
_local3 = -1;
_local4 = 1;
_local5 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
_local3 = (_local3 / _local5);
_local4 = (_local4 / _local5);
_local6 = 0;
while (_local6 < _arg2) {
_local7 = ((750 + ((Math.random() * 250) - 100)) + (_local3 * 300));
_local8 = ((-312 + ((Math.random() * 200) - 100)) + (_local4 * 300));
if ((_local8 + 100) > 0){
_local8 = -100;
};
_local9 = (Game.gameScreen.spawnGameObject(_arg1, _local7, _local8) as Monster);
_local9.wave = this;
_local6++;
};
}
private function onTimer(_arg1:TimerEvent){
var _local2:uint;
var _local3:uint;
if (Game.gameScreen.isPaused){
return;
};
if (spawned >= maxMonsters){
timer.stop();
return;
};
_local2 = 0;
_local3 = 0;
while (_local3 < maxMonsters) {
if ((((_local3 >= spawned)) && ((_local3 < (spawned + 5))))){
spawnMonsters(def[_local3].type, def[_local3].total);
_local2++;
};
_local3++;
};
spawned = (spawned + _local2);
}
public function update(){
}
private function isAvailable(_arg1:uint){
switch (_arg1){
case 0:
return (!((Game.gameScreen.level.scorp == 0)));
case 1:
return (!((Game.gameScreen.level.mob1 == 0)));
case 2:
return (!((Game.gameScreen.level.golem == 0)));
case 3:
return (!((Game.gameScreen.level.mob3 == 0)));
case 4:
return (!((Game.gameScreen.level.spider == 0)));
};
}
private function initMonsterInfo(){
k_MonsterTypes.push("game.Scorpion");
k_MonsterTypes.push("game.Mob1");
k_MonsterTypes.push("game.Golem");
k_MonsterTypes.push("game.Mob3");
k_MonsterTypes.push("game.Spider");
k_MonsterHealth.push(Config.instance.k_ScorpHealth);
k_MonsterHealth.push(Config.instance.k_Mob1Health);
k_MonsterHealth.push(Config.instance.k_GolemHealth);
k_MonsterHealth.push(Config.instance.k_Mob3Health);
k_MonsterHealth.push(Config.instance.k_ScorpHealth);
}
public function generate(_arg1:Number){
var _local2:Number;
var _local3:Number;
var _local4:int;
var _local5:*;
var _local6:*;
if (k_MonsterTypes.length == 0){
initMonsterInfo();
};
_local2 = getMinHealth();
_local3 = 0;
_local4 = k_MonsterTypes.length;
def.splice(0, def.length);
while ((((_local3 < _arg1)) && (((_arg1 - _local3) > _local2)))) {
_local5 = Math.floor((Math.random() * _local4));
_local6 = k_MonsterHealth[_local5];
if (((((_local3 + _local6) > _arg1)) || (!(isAvailable(_local5))))){
} else {
_local3 = (_local3 + _local6);
_monstersLeft++;
def.push({type:k_MonsterTypes[_local5], total:1});
};
};
maxMonsters = _monstersLeft;
spawned = 0;
timer.start();
}
public function set monstersLeft(_arg1:uint){
_monstersLeft = _arg1;
if (_monstersLeft == 0){
Game.gameScreen.onWaveKilled(this);
};
}
public function spawn(_arg1:Array){
var _local2:Object;
for each (_local2 in _arg1) {
spawnMonsters(_local2.type, _local2.total);
monstersLeft = (monstersLeft + _local2.total);
};
Game.gameScreen.monsters.sort(GameObject.compare);
}
private function getMinHealth():Number{
var _local1:Number;
var _local2:*;
_local1 = 99999999999999;
_local2 = 0;
while (_local2 < k_MonsterTypes.length) {
if ((((k_MonsterHealth[_local2] < _local1)) && (isAvailable(_local2)))){
_local1 = k_MonsterHealth[_local2];
};
_local2++;
};
return (_local1);
}
}
}//package game
Section 71
//Weapon (game.Weapon)
package game {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
public class Weapon {
protected var _deviation:Number;// = 150
protected var _damage:Number;// = 20
private var light:ListNode;// = null
public var lastShotTime:Number;// = 0
protected var isReloading:Boolean;// = false
protected var _overheat:Number;// = 0
protected var _reloadTime:Number;// = 2000
protected var _overheatRate:Number;// = 0
private var reloadTimer:Timer;// = null
protected var _ammo:int;// = 30
protected var _clip:MovieClip;// = null
public var reloadStartTime:Number;// = 0
private var deviationAmount:Number;// = 0
protected var _hasGunFire:Boolean;// = true
protected var _rateOfFire:Number;// = 10
protected var _clipSize:int;// = 30
private var reloadAmount:int;// = 0
protected var _isShooting:Boolean;// = false
protected var _isInfAmmo:Boolean;// = true
protected var _weaponIndex:int;// = 0
private var deviationStart:Number;// = 0
public var shotSounds:Array;
protected var _name:String;// = ""
protected var _bulletsPerShot:int;// = 1
static const Jackhammer:uint = 2;
static const AK74:uint = 1;
static const TeslaGun:uint = 6;
static const Flame:uint = 3;
static const LaserGun:uint = 4;
static const Rifle:uint = 0;
static const Minigun:uint = 5;
static const Grenade:uint = 7;
static var k_Jackhammer:Weapon = new (Weapon);
;
static var k_AK74:Weapon = new (Weapon);
;
static var k_Weapons:Array = new Array();
static var k_Minigun:Weapon = new (Weapon);
;
static var k_LaserGun:Laser = null;
static var k_Flamethrower:Flamethrower = null;
static var k_Beretta:Weapon = new (Weapon);
;
static var k_Tesla:Tesla = null;
public function Weapon(){
isReloading = false;
reloadTimer = null;
deviationAmount = 0;
deviationStart = 0;
reloadAmount = 0;
light = null;
lastShotTime = 0;
reloadStartTime = 0;
shotSounds = new Array();
_name = "";
_ammo = 30;
_clipSize = 30;
_reloadTime = 2000;
_rateOfFire = 10;
_bulletsPerShot = 1;
_deviation = 150;
_damage = 20;
_clip = null;
_hasGunFire = true;
_overheatRate = 0;
_overheat = 0;
_isShooting = false;
_isInfAmmo = true;
_weaponIndex = 0;
super();
reloadTimer = new Timer(_reloadTime);
reloadTimer.addEventListener(TimerEvent.TIMER, onReloadTimer);
shotSounds.push(getDefinitionByName("SoundShot1_a"));
shotSounds.push(getDefinitionByName("SoundShot1_b"));
shotSounds.push(getDefinitionByName("SoundShot1_a"));
}
public function set weaponIndex(_arg1:int){
_weaponIndex = _arg1;
}
public function get reloadTime():Number{
return (_reloadTime);
}
public function set overheatRate(_arg1:Number){
_overheatRate = _arg1;
}
public function set deviation(_arg1:Number){
_deviation = _arg1;
}
public function set isInfAmmo(_arg1:Boolean){
_isInfAmmo = _arg1;
}
public function get name():String{
return (_name);
}
public function get deviation():Number{
return (_deviation);
}
public function set reloadTime(_arg1:Number){
_reloadTime = _arg1;
}
public function get isOverheat():Boolean{
return ((_overheat >= 100));
}
public function reload(){
var _local1:Sound;
if (_ammo == _clipSize){
return;
};
if (((!(_isInfAmmo)) && ((Game.gameScreen.getAmmo(_weaponIndex) == 0)))){
return;
};
if (!_isInfAmmo){
Game.gameScreen.addAmmo(_weaponIndex, _ammo);
};
reloadTimer.delay = _reloadTime;
reloadTimer.start();
lastShotTime = 0;
deviationAmount = deviationStart;
isReloading = true;
_ammo = 0;
reloadStartTime = getTimer();
_local1 = new SoundReloadEnd();
_local1.play();
}
public function set bulletsPerShot(_arg1:int){
_bulletsPerShot = _arg1;
}
protected function deviate(_arg1:Number, _arg2:Number, _arg3:Vector, _arg4:Number){
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
_local5 = (Math.random() * 360);
_local6 = (Math.random() * (_deviation * _arg4));
_local7 = (Math.sin(Common.deg2Rad(_local5)) * _local6);
_local8 = (Math.cos(Common.deg2Rad(_local5)) * _local6);
_arg3.x = (_arg1 + _local7);
_arg3.y = (_arg2 + _local8);
}
private function onReloadTimer(_arg1:TimerEvent){
var _local2:GameScreen;
if (_isInfAmmo){
_ammo = _clipSize;
} else {
_local2 = (Game.instance.state as GameScreen);
_ammo = Math.min(_clipSize, _local2.getAmmo(_weaponIndex));
_local2.removeAmmo(_weaponIndex, _clipSize);
};
reloadTimer.stop();
isReloading = false;
}
public function get hasGunFire():Boolean{
return (_hasGunFire);
}
public function get rateOfFire():Number{
return (_rateOfFire);
}
public function render(_arg1:BitmapData){
}
public function fire(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean):uint{
var _local6:Number;
var _local7:int;
var _local8:*;
var _local9:Sound;
var _local10:Number;
var _local11:Point;
var _local12:*;
var _local13:Sound;
if ((((_ammo <= 0)) || ((_overheat >= 100)))){
if ((((_ammo <= 0)) && (!(isReloading)))){
reload();
};
return (0);
};
_local6 = getTimer();
_local7 = Math.min(Math.floor((((_local6 - lastShotTime) * _rateOfFire) * 0.001)), _ammo);
if (_local7 <= 0){
return (0);
};
lastShotTime = _local6;
_local8 = 0;
while (_local8 < _local7) {
_local12 = 0;
while (_local12 < _bulletsPerShot) {
shot(_arg1, _arg2, _arg3, _arg4, _arg5);
_local12++;
};
_local8++;
};
_ammo = Math.max((_ammo - _local7), 0);
if (_ammo <= 0){
reload();
};
_local9 = null;
_local10 = Math.floor(Common.random(0, shotSounds.length));
_local9 = new ((shotSounds[_local10] as Object));
_local9.play();
deviationAmount = Math.min((deviationAmount + 0.05), 1);
_overheat = (_overheat + _overheatRate);
if (_overheat >= 100){
_overheat = (_overheat + 50);
_local13 = new SoundOverheat();
_local13.play();
};
_local11 = _clip.localToGlobal(new Point(_clip.shell.x, _clip.shell.y));
Game.gameScreen.spawnEffect(((Math.floor((Math.random() * 2)))==0) ? Resources.sheet_Shell : Resources.sheet_Shell2, ((_local11.x - 20) + Common.random(-5, 5)), ((_local11.y + 60) + Common.random(-5, 5)), true);
if (light == null){
light = Game.gameScreen.lights.insert({x:_arg1, y:_arg2, bitmap:Resources.bitmap_LightExplosion, scale:1.5, alpha:0.5});
};
return (_local7);
}
public function set hasGunFire(_arg1:Boolean){
_hasGunFire = _arg1;
}
public function set name(_arg1:String){
return ((_name = _arg1));
}
public function get overheat():Number{
return (_overheat);
}
public function get isShooting():Boolean{
return (_isShooting);
}
public function update(){
if (((!(isShooting)) || ((_overheat > 100)))){
_overheat = Math.max((_overheat - (_overheatRate * 0.75)), 0);
};
if (((!(_isShooting)) && (!((light == null))))){
light.list.remove(light);
light = null;
};
if (light != null){
light.data.alpha = (light.data.alpha - 0.3);
if (light.data.alpha <= 0){
light.list.remove(light);
light = null;
};
};
if (_overheat > 100){
isShooting = false;
};
if (((((isShooting) && ((lastShotTime == 0)))) && (!((_ammo == 0))))){
lastShotTime = (getTimer() - (1000 / rateOfFire));
};
if (!isShooting){
if ((getTimer() - lastShotTime) > (1000 / rateOfFire)){
lastShotTime = 0;
};
deviationAmount = deviationStart;
};
}
public function get ammo():int{
return (_ammo);
}
public function get weaponIndex():int{
return (_weaponIndex);
}
public function get overheatRate():Number{
return (_overheatRate);
}
public function clone(_arg1:int=-1):Weapon{
var _local2:Object;
var _local3:Weapon;
var _local4:*;
_local2 = getDefinitionByName(getQualifiedClassName(this));
_local3 = new (_local2);
_local3.name = _name;
_local3.clipSize = _clipSize;
_local3.reloadTime = _reloadTime;
_local3.rateOfFire = _rateOfFire;
_local3.bulletsPerShot = _bulletsPerShot;
_local3.deviation = _deviation;
_local3.damage = _damage;
_local3.hasGunFire = _hasGunFire;
_local3.overheatRate = _overheatRate;
_local3.deviationStart = deviationStart;
_local3.deviationAmount = deviationStart;
_local3.weaponIndex = _arg1;
_local3.shotSounds.splice(0, _local3.shotSounds.length);
_local4 = 0;
while (_local4 < shotSounds.length) {
_local3.shotSounds.push(shotSounds[_local4]);
_local4++;
};
_local2 = getDefinitionByName(getQualifiedClassName(_clip));
_local3.clip = new (_local2);
return (_local3);
}
public function get clip():MovieClip{
return (_clip);
}
public function set clipSize(_arg1:int){
_clipSize = _arg1;
_ammo = _clipSize;
}
public function set clip(_arg1:MovieClip){
_clip = _arg1;
}
public function get isInfAmmo():Boolean{
return (_isInfAmmo);
}
public function get bulletsPerShot():int{
return (_bulletsPerShot);
}
public function set rateOfFire(_arg1:Number){
_rateOfFire = _arg1;
}
private function getDistance(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
var _local5:Number;
var _local6:Number;
_local5 = (_arg3 - _arg1);
_local6 = (_arg4 - _arg2);
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
public function set damage(_arg1:Number){
_damage = _arg1;
}
public function get damage():Number{
return (_damage);
}
public function get clipSize():int{
return (_clipSize);
}
private function shot(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean){
var _local6:Number;
var _local7:Vector;
var _local8:Number;
var _local9:Number;
var _local10:*;
var _local11:Tracer;
_local6 = Common.clamp((getDistance(_arg1, _arg2, _arg3, _arg4) / 800), 0, 1);
_local7 = new Vector();
deviate(_arg3, _arg4, _local7, (_local6 * deviationAmount));
_local8 = (_local7.x - _arg1);
_local9 = (_local7.y - _arg2);
_local10 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local8 = (_local8 / _local10);
_local9 = (_local9 / _local10);
_local11 = Game.gameScreen.spawnTracer(_damage, _arg1, _arg2, _local8, _local9, _local7.x, _local7.y);
_local11.isVisible = _arg5;
}
public function set isShooting(_arg1:Boolean){
_isShooting = _arg1;
}
public static function initialize(){
var _local1:Config;
_local1 = Config.instance;
k_Beretta.name = "Mosin rifle Extended";
k_Beretta.clip = new Rifle_Mosin();
k_Beretta.bulletsPerShot = 1;
k_Beretta.clipSize = _local1.k_Rifle_clipSize;
k_Beretta.reloadTime = _local1.k_Rifle_reloadTime;
k_Beretta.rateOfFire = _local1.k_Rifle_rateOfFire;
k_Beretta.deviation = _local1.k_Rifle_deviation;
k_Beretta.damage = _local1.k_Rifle_damage;
k_Beretta.shotSounds.splice(0, k_Beretta.shotSounds.length);
k_Beretta.shotSounds.push(getDefinitionByName("SoundMosinShot2"));
k_Weapons.push(k_Beretta);
k_AK74.name = "Assault rifle";
k_AK74.clip = new Rifle_m4a1();
k_AK74.bulletsPerShot = 1;
k_AK74.clipSize = _local1.k_AK74_clipSize;
k_AK74.reloadTime = _local1.k_AK74_reloadTime;
k_AK74.rateOfFire = _local1.k_AK74_rateOfFire;
k_AK74.deviation = _local1.k_AK74_deviation;
k_AK74.damage = _local1.k_AK74_damage;
k_AK74.shotSounds.splice(0, k_AK74.shotSounds.length);
k_AK74.shotSounds.push(getDefinitionByName("SoundAssaultShot1"));
k_Weapons.push(k_AK74);
k_Jackhammer.name = "Jackhammer";
k_Jackhammer.clip = new Rifle_Jackhammer();
k_Jackhammer.bulletsPerShot = 5;
k_Jackhammer.deviationStart = 1;
k_Jackhammer.reloadTime = _local1.k_Jackhammer_reloadTime;
k_Jackhammer.clipSize = _local1.k_Jackhammer_clipSize;
k_Jackhammer.damage = _local1.k_Jackhammer_damage;
k_Jackhammer.deviation = _local1.k_Jackhammer_deviation;
k_Jackhammer.rateOfFire = _local1.k_Jackhammer_rateOfFire;
k_Jackhammer.shotSounds.splice(0, k_Jackhammer.shotSounds.length);
k_Jackhammer.shotSounds.push(getDefinitionByName("SoundJackhammerShot1"));
k_Weapons.push(k_Jackhammer);
k_Flamethrower = new Flamethrower();
k_Flamethrower.name = "Flamethrower";
k_Flamethrower.clip = new Rifle_Flamethrower();
k_Flamethrower.hasGunFire = false;
k_Flamethrower.deviation = 50;
k_Flamethrower.overheatRate = _local1.k_Flame_overheatRate;
k_Flamethrower.reloadTime = 0;
k_Flamethrower.clipSize = 1;
k_Weapons.push(k_Flamethrower);
k_LaserGun = new Laser();
k_LaserGun.name = "Laser gun";
k_LaserGun.clip = new Rifle_Laser();
k_LaserGun.overheatRate = _local1.k_Laser_overheatRate;
k_LaserGun.hasGunFire = false;
k_Weapons.push(k_LaserGun);
k_Tesla = new Tesla();
k_Tesla.name = "Tesla";
k_Tesla.clipSize = 5;
k_Tesla.clip = new Rifle_Tesla();
k_Tesla.hasGunFire = false;
k_Weapons.push(k_Tesla);
k_Minigun.name = "Minigun";
k_Minigun.bulletsPerShot = 1;
k_Minigun.clip = new Rifle_Minigun();
k_Minigun.clipSize = _local1.k_Minigun_clipSize;
k_Minigun.reloadTime = _local1.k_Minigun_reloadTime;
k_Minigun.rateOfFire = _local1.k_Minigun_rateOfFire;
k_Minigun.overheatRate = _local1.k_Minigun_overheatRate;
k_Minigun.deviation = _local1.k_Minigun_deviation;
k_Minigun.damage = _local1.k_Minigun_damage;
k_Minigun.shotSounds.splice(0, k_Minigun.shotSounds.length);
k_Minigun.shotSounds.push(getDefinitionByName("SoundMinigunShot1"));
k_Weapons.push(k_Minigun);
}
}
}//package game
Section 72
//WeaponButtons (game.WeaponButtons)
package game {
import flash.events.*;
import flash.display.*;
public class WeaponButtons 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;
public var weapon0:MovieClip;
public function WeaponButtons(){
var _local1:*;
var _local2:MovieClip;
super();
_local1 = 0;
while (hasOwnProperty(("weapon" + _local1))) {
_local2 = this[("weapon" + _local1)];
_local2.id = _local1;
_local2.visible = false;
_local2.gotoAndStop(1);
_local2.addEventListener(MouseEvent.CLICK, onWeaponClicked);
_local1++;
};
}
public function update(_arg1:Human){
var _local2:Number;
var _local3:*;
var _local4:MovieClip;
_local2 = 0;
_local3 = 0;
while (hasOwnProperty(("weapon" + _local3))) {
_local4 = this[("weapon" + _local3)];
if (_arg1.hasWeapon[_local3]){
_local4.y = _local2;
_local4.visible = true;
_local4.gotoAndStop(((_arg1.weaponIndex)==_local3) ? 1 : 2);
_local2 = (_local2 + 30);
} else {
_local4.visible = false;
};
_local3++;
};
}
private function onWeaponClicked(_arg1:MouseEvent){
var _local2:MovieClip;
_local2 = _arg1.target.parent;
_local2.gotoAndStop(((_local2.currentFrame)==1) ? 2 : 1);
Game.gameScreen.human.chooseWeapon(_local2.id);
}
}
}//package game
Section 73
//Vector (game.Vector)
package game {
public class Vector {
var x:Number;
var y:Number;
public function Vector(_arg1:Number=0, _arg2:Number=0){
x = _arg1;
y = _arg2;
}
public function dirTo(_arg1:Number, _arg2:Number){
x = (_arg1 - x);
y = (_arg2 - y);
normalize();
}
public function dot(_arg1:Vector):Number{
return (((x * _arg1.x) + (y * _arg1.y)));
}
public function normalize():Number{
var _local1:*;
_local1 = Math.sqrt(((x * x) + (y * y)));
x = (x / _local1);
y = (y / _local1);
return (_local1);
}
}
}//package game
Section 74
//MochiAd (mochi.as3.MochiAd)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("3.0 as3");
}
public static function showClickAwayAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_timeout:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var sendHostProgress:Boolean;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
sendHostProgress = false;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType == "application"){
return (_local2);
};
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
} else {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{
trace("[MochiAds] Blocked URL");
});
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array;
var _local4:Number;
_local3 = _arg2.split(".");
_local4 = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = 10;
bar.y = (h - 20);
};
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
options.ad_progress(_local10);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7});
if (_local7 == 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local11 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package mochi.as3
Section 75
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function reencode():void{
var _local1:uint;
_local1 = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function toString():String{
var _local1:String;
_local1 = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function get value():Number{
return (Number(this.toString()));
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String;
_local3 = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 76
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
if (options.clip != null){
if ((options.clip is Sprite)){
MochiServices.setContainer(options.clip);
};
delete options.clip;
} else {
MochiServices.setContainer();
};
MochiServices.stayOnTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
_local2 = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (_arg1 != null){
if (_arg1.error != null){
if (_arg1.error == true){
if (onErrorHandler != null){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
};
};
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi.as3
Section 77
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _listenChannel:LocalConnection;
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _connecting:Boolean = false;
public static var onError:Object;
private static var _listenChannelName:String = "__ms_";
private static var _servicesURL:String = "http://www.mochiads.com/static/lib/services/services.swf";
public static var netup:Boolean = true;
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (_clip != null){
if (_clip._queue != null){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
};
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_sendChannel.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
onError("NotConnected");
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local3:Array;
var _local4:int;
var _local5:Array;
var _local6:Array;
var _local7:MovieClip;
var _local8:LocalConnection;
var _local9:String;
var _local10:ByteArray;
var _local11:ByteArray;
var _local12:uint;
var _local13:uint;
var _local14:Loader;
_local3 = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
_local5 = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
_local6 = [0, 64, 0, 0, 0];
_local7 = new MovieClip();
_local8 = new LocalConnection();
_local9 = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().getTime()));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
_local10 = new ByteArray();
_local11 = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
_local12 = ((_local3.length + _local11.length) + 4);
_local13 = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var vars:Object;
var avm1Click:DisplayObject;
var s:String;
var i:Number;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
vars = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
s = "?";
i = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
var _local2:Rectangle;
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
_local2 = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_listenChannel.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.0");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
if (_clip.parent != null){
Sprite(_clip.parent).removeChild(_clip);
};
}
private static function onStatus(_arg1:StatusEvent):void{
switch (_arg1.level){
case "error":
_connected = false;
_listenChannel.connect(_listenChannelName);
break;
};
}
public static function get id():String{
return (_id);
}
private static function urlOptions(_arg1:Object):Object{
var _local2:Object;
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
_local2 = {};
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function initComChannels():void{
if (!_connected){
_sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_listenChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_clip.onReceive = function (_arg1:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = this.client._callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete this.client._callbacks[cb];
};
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
trace("connected!");
_connecting = false;
_connected = true;
while (_clip._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function listen():void{
_listenChannel = new LocalConnection();
_listenChannel.client = _clip;
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
_listenChannel.allowDomain("*", "localhost");
_listenChannel.allowInsecureDomain("*", "localhost");
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var clipname:String;
var f:Function;
var req:URLRequest;
var vars:URLVariables;
var id = _arg1;
var clip = _arg2;
clipname = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(clip).servicesURL != undefined){
_servicesURL = urlOptions(clip).servicesURL;
};
MochiServices.allowDomains(_servicesURL);
_clip = createEmptyMovieClip(clip, clipname, 10336, false);
_loader = new Loader();
f = function (_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor((Math.random() * 99999))));
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
req = new URLRequest(_servicesURL);
vars = new URLVariables();
vars.listenLC = _listenChannelName;
vars.mochiad_options = clip.loaderInfo.parameters.mochiad_options;
if (widget){
vars.widget = true;
};
req.data = vars;
listen();
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function get clip():Object{
return (_container);
}
public static function bringToTop(_arg1:Event):void{
var e = _arg1;
if (MochiServices.clip != null){
if (MochiServices.childClip != null){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
};
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var mc:MovieClip;
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
mc = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 78
//AmmoIcon (AmmoIcon)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public dynamic class AmmoIcon extends MovieClip {
public var hintText:HintText;
public var type:MovieClip;
public var captions:Array;
public var caption:TextField;
public function AmmoIcon(){
addFrameScript(0, frame1);
}
public function onMouseMoveHandler(_arg1:MouseEvent){
if (hintText == null){
return;
};
hintText.x = _arg1.stageX;
hintText.y = ((_arg1.stageY - hintText.height) - 4);
hintText.hint.text = captions[(type.currentFrame - 1)];
}
function frame1(){
addEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOutHandler);
addEventListener(MouseEvent.MOUSE_MOVE, onMouseMoveHandler);
mouseChildren = false;
captions = new Array();
hintText = null;
captions.push("Rifle ammo");
captions.push("Assault rifle ammo");
captions.push("Jackhammer ammo");
captions.push("Flametrower fuel");
captions.push("Laser cells");
captions.push("Minigun ammo");
captions.push("Tesla cells");
captions.push("Grenades");
}
public function onMouseOutHandler(_arg1:MouseEvent){
stage.removeChild(hintText);
hintText = null;
}
public function onMouseOverHandler(_arg1:MouseEvent){
hintText = new HintText();
stage.addChild(hintText);
hintText.mouseEnabled = false;
}
}
}//package
Section 79
//ArrowBattle (ArrowBattle)
package {
import flash.display.*;
public dynamic class ArrowBattle extends MovieClip {
}
}//package
Section 80
//BCloseTrophies (BCloseTrophies)
package {
import game.*;
public dynamic class BCloseTrophies extends MenuButton {
}
}//package
Section 81
//BHighscores (BHighscores)
package {
import game.*;
public dynamic class BHighscores extends MenuButton {
}
}//package
Section 82
//BitmapBloodBlast (BitmapBloodBlast)
package {
import flash.display.*;
public dynamic class BitmapBloodBlast extends BitmapData {
public function BitmapBloodBlast(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 83
//BitmapBloodSpot1 (BitmapBloodSpot1)
package {
import flash.display.*;
public dynamic class BitmapBloodSpot1 extends BitmapData {
public function BitmapBloodSpot1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 84
//BitmapBloodSpot2 (BitmapBloodSpot2)
package {
import flash.display.*;
public dynamic class BitmapBloodSpot2 extends BitmapData {
public function BitmapBloodSpot2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 85
//BitmapBloodSpot3 (BitmapBloodSpot3)
package {
import flash.display.*;
public dynamic class BitmapBloodSpot3 extends BitmapData {
public function BitmapBloodSpot3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 86
//BitmapBloodSpot4 (BitmapBloodSpot4)
package {
import flash.display.*;
public dynamic class BitmapBloodSpot4 extends BitmapData {
public function BitmapBloodSpot4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 87
//BitmapBulletHole1 (BitmapBulletHole1)
package {
import flash.display.*;
public dynamic class BitmapBulletHole1 extends BitmapData {
public function BitmapBulletHole1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 88
//BitmapBulletHole2 (BitmapBulletHole2)
package {
import flash.display.*;
public dynamic class BitmapBulletHole2 extends BitmapData {
public function BitmapBulletHole2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 89
//BitmapBulletHole3 (BitmapBulletHole3)
package {
import flash.display.*;
public dynamic class BitmapBulletHole3 extends BitmapData {
public function BitmapBulletHole3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 90
//BitmapExplosionHit (BitmapExplosionHit)
package {
import flash.display.*;
public dynamic class BitmapExplosionHit extends BitmapData {
public function BitmapExplosionHit(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 91
//BitmapFireParticle (BitmapFireParticle)
package {
import flash.display.*;
public dynamic class BitmapFireParticle extends BitmapData {
public function BitmapFireParticle(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 92
//BitmapFlameFloor (BitmapFlameFloor)
package {
import flash.display.*;
public dynamic class BitmapFlameFloor extends BitmapData {
public function BitmapFlameFloor(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 93
//BitmapFlameHit (BitmapFlameHit)
package {
import flash.display.*;
public dynamic class BitmapFlameHit extends BitmapData {
public function BitmapFlameHit(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 94
//BitmapFlameMonster2 (BitmapFlameMonster2)
package {
import flash.display.*;
public dynamic class BitmapFlameMonster2 extends BitmapData {
public function BitmapFlameMonster2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 95
//BitmapFlashlight (BitmapFlashlight)
package {
import flash.display.*;
public dynamic class BitmapFlashlight extends BitmapData {
public function BitmapFlashlight(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 96
//BitmapGrenade (BitmapGrenade)
package {
import flash.display.*;
public dynamic class BitmapGrenade extends BitmapData {
public function BitmapGrenade(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 97
//BitmapGrenadeExplosion (BitmapGrenadeExplosion)
package {
import flash.display.*;
public dynamic class BitmapGrenadeExplosion extends BitmapData {
public function BitmapGrenadeExplosion(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 98
//BitmapGroundSplash (BitmapGroundSplash)
package {
import flash.display.*;
public dynamic class BitmapGroundSplash extends BitmapData {
public function BitmapGroundSplash(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 99
//BitmapHummer1 (BitmapHummer1)
package {
import flash.display.*;
public dynamic class BitmapHummer1 extends BitmapData {
public function BitmapHummer1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 100
//BitmapHummer2 (BitmapHummer2)
package {
import flash.display.*;
public dynamic class BitmapHummer2 extends BitmapData {
public function BitmapHummer2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 101
//BitmapHummer3 (BitmapHummer3)
package {
import flash.display.*;
public dynamic class BitmapHummer3 extends BitmapData {
public function BitmapHummer3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 102
//BitmapLaserBurn (BitmapLaserBurn)
package {
import flash.display.*;
public dynamic class BitmapLaserBurn extends BitmapData {
public function BitmapLaserBurn(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 103
//BitmapLightExplosion (BitmapLightExplosion)
package {
import flash.display.*;
public dynamic class BitmapLightExplosion extends BitmapData {
public function BitmapLightExplosion(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 104
//BitmapLightFlame (BitmapLightFlame)
package {
import flash.display.*;
public dynamic class BitmapLightFlame extends BitmapData {
public function BitmapLightFlame(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 105
//BitmapLightShot (BitmapLightShot)
package {
import flash.display.*;
public dynamic class BitmapLightShot extends BitmapData {
public function BitmapLightShot(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 106
//BitmapMob1Attack (BitmapMob1Attack)
package {
import flash.display.*;
public dynamic class BitmapMob1Attack extends BitmapData {
public function BitmapMob1Attack(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 107
//BitmapMob1Die (BitmapMob1Die)
package {
import flash.display.*;
public dynamic class BitmapMob1Die extends BitmapData {
public function BitmapMob1Die(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 108
//BitmapMob1Walk (BitmapMob1Walk)
package {
import flash.display.*;
public dynamic class BitmapMob1Walk extends BitmapData {
public function BitmapMob1Walk(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 109
//BitmapMob2Attack (BitmapMob2Attack)
package {
import flash.display.*;
public dynamic class BitmapMob2Attack extends BitmapData {
public function BitmapMob2Attack(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 110
//BitmapMob2Die (BitmapMob2Die)
package {
import flash.display.*;
public dynamic class BitmapMob2Die extends BitmapData {
public function BitmapMob2Die(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 111
//BitmapMob2Walk (BitmapMob2Walk)
package {
import flash.display.*;
public dynamic class BitmapMob2Walk extends BitmapData {
public function BitmapMob2Walk(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 112
//BitmapMob3Attack (BitmapMob3Attack)
package {
import flash.display.*;
public dynamic class BitmapMob3Attack extends BitmapData {
public function BitmapMob3Attack(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 113
//BitmapMob3Die (BitmapMob3Die)
package {
import flash.display.*;
public dynamic class BitmapMob3Die extends BitmapData {
public function BitmapMob3Die(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 114
//BitmapMob3Walk (BitmapMob3Walk)
package {
import flash.display.*;
public dynamic class BitmapMob3Walk extends BitmapData {
public function BitmapMob3Walk(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 115
//BitmapRocky (BitmapRocky)
package {
import flash.display.*;
public dynamic class BitmapRocky extends BitmapData {
public function BitmapRocky(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 116
//BitmapSand (BitmapSand)
package {
import flash.display.*;
public dynamic class BitmapSand extends BitmapData {
public function BitmapSand(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 117
//BitmapScorpAttack (BitmapScorpAttack)
package {
import flash.display.*;
public dynamic class BitmapScorpAttack extends BitmapData {
public function BitmapScorpAttack(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 118
//BitmapScorpDie (BitmapScorpDie)
package {
import flash.display.*;
public dynamic class BitmapScorpDie extends BitmapData {
public function BitmapScorpDie(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 119
//BitmapScorpGibs (BitmapScorpGibs)
package {
import flash.display.*;
public dynamic class BitmapScorpGibs extends BitmapData {
public function BitmapScorpGibs(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 120
//BitmapScorpWalk (BitmapScorpWalk)
package {
import flash.display.*;
public dynamic class BitmapScorpWalk extends BitmapData {
public function BitmapScorpWalk(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 121
//BitmapShell (BitmapShell)
package {
import flash.display.*;
public dynamic class BitmapShell extends BitmapData {
public function BitmapShell(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 122
//BitmapShell2 (BitmapShell2)
package {
import flash.display.*;
public dynamic class BitmapShell2 extends BitmapData {
public function BitmapShell2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 123
//BitmapSnow (BitmapSnow)
package {
import flash.display.*;
public dynamic class BitmapSnow extends BitmapData {
public function BitmapSnow(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 124
//BitmapSpiderAttack (BitmapSpiderAttack)
package {
import flash.display.*;
public dynamic class BitmapSpiderAttack extends BitmapData {
public function BitmapSpiderAttack(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 125
//BitmapSpiderGibs (BitmapSpiderGibs)
package {
import flash.display.*;
public dynamic class BitmapSpiderGibs extends BitmapData {
public function BitmapSpiderGibs(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 126
//BitmapSpiderWalk (BitmapSpiderWalk)
package {
import flash.display.*;
public dynamic class BitmapSpiderWalk extends BitmapData {
public function BitmapSpiderWalk(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 127
//BitmapSwamp (BitmapSwamp)
package {
import flash.display.*;
public dynamic class BitmapSwamp extends BitmapData {
public function BitmapSwamp(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 128
//BitmapTracerSmall (BitmapTracerSmall)
package {
import flash.display.*;
public dynamic class BitmapTracerSmall extends BitmapData {
public function BitmapTracerSmall(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 129
//BloodDecal (BloodDecal)
package {
import flash.display.*;
public dynamic class BloodDecal extends MovieClip {
}
}//package
Section 130
//BloodSplatter (BloodSplatter)
package {
import flash.display.*;
public dynamic class BloodSplatter extends MovieClip {
}
}//package
Section 131
//BMoreGames (BMoreGames)
package {
import game.*;
public dynamic class BMoreGames extends MenuButton {
}
}//package
Section 132
//BNewGame (BNewGame)
package {
import game.*;
public dynamic class BNewGame extends MenuButton {
}
}//package
Section 133
//BNo (BNo)
package {
import game.*;
public dynamic class BNo extends MenuButton {
}
}//package
Section 134
//BResumeGame (BResumeGame)
package {
import game.*;
public dynamic class BResumeGame extends MenuButton {
}
}//package
Section 135
//BSurvival (BSurvival)
package {
import game.*;
public dynamic class BSurvival extends MenuButton {
}
}//package
Section 136
//BTrophies (BTrophies)
package {
import game.*;
public dynamic class BTrophies extends MenuButton {
}
}//package
Section 137
//BuyButton (BuyButton)
package {
import flash.display.*;
import flash.text.*;
public dynamic class BuyButton extends MovieClip {
public var caption:TextField;
public function BuyButton(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
caption.visible = true;
}
function frame2(){
caption.visible = false;
}
}
}//package
Section 138
//BYes (BYes)
package {
import game.*;
public dynamic class BYes extends MenuButton {
}
}//package
Section 139
//Cursor (Cursor)
package {
import flash.display.*;
public dynamic class Cursor extends MovieClip {
public var reload:MovieClip;
}
}//package
Section 140
//FlashlightMask (FlashlightMask)
package {
import flash.display.*;
public dynamic class FlashlightMask extends MovieClip {
}
}//package
Section 141
//Floor (Floor)
package {
import flash.display.*;
public dynamic class Floor extends MovieClip {
}
}//package
Section 142
//GameHUD (GameHUD)
package {
import flash.display.*;
import flash.text.*;
public dynamic class GameHUD extends MovieClip {
public var stats:TextField;
public var ammo:TextField;
}
}//package
Section 143
//Ground (Ground)
package {
import flash.display.*;
public dynamic class Ground extends MovieClip {
}
}//package
Section 144
//GroundSplash (GroundSplash)
package {
import flash.display.*;
public dynamic class GroundSplash extends MovieClip {
public function GroundSplash(){
addFrameScript(0, frame1, 8, frame9);
}
function frame1(){
alpha = 0.45;
}
function frame9(){
alpha = 0;
stop();
}
}
}//package
Section 145
//Gunfire (Gunfire)
package {
import flash.display.*;
public dynamic class Gunfire extends MovieClip {
}
}//package
Section 146
//HintText (HintText)
package {
import flash.display.*;
import flash.text.*;
public dynamic class HintText extends MovieClip {
public var hint:TextField;
}
}//package
Section 147
//Hummer (Hummer)
package {
import game.*;
import flash.display.*;
public dynamic class Hummer extends MovieClip {
public var gunner:Gunner;
}
}//package
Section 148
//ItemIcon (ItemIcon)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public dynamic class ItemIcon extends MovieClip {
public var hintText:HintText;
public var captions:Array;
public var caption:TextField;
public function ItemIcon(){
addFrameScript(0, frame1);
}
public function onMouseMoveHandler(_arg1:MouseEvent){
if (hintText == null){
return;
};
hintText.x = _arg1.stageX;
hintText.y = ((_arg1.stageY - hintText.height) - 2);
hintText.hint.text = captions[(currentFrame - 1)];
}
function frame1(){
addEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOutHandler);
addEventListener(MouseEvent.MOUSE_MOVE, onMouseMoveHandler);
mouseChildren = false;
captions = new Array();
hintText = null;
captions.push("Fuel, used to travel the map");
captions.push("Gas cylinder, used to build a fire trap");
captions.push("Radio, used to call an airstrike");
captions.push("Power cell, used to build a tesla tower");
}
public function onMouseOutHandler(_arg1:MouseEvent){
stage.removeChild(hintText);
hintText = null;
}
public function onMouseOverHandler(_arg1:MouseEvent){
hintText = new HintText();
stage.addChild(hintText);
hintText.mouseEnabled = false;
}
}
}//package
Section 149
//Lightings (Lightings)
package {
import flash.display.*;
public dynamic class Lightings extends MovieClip {
}
}//package
Section 150
//LightSpot (LightSpot)
package {
import flash.display.*;
public dynamic class LightSpot extends MovieClip {
}
}//package
Section 151
//LightSpotSmall (LightSpotSmall)
package {
import flash.display.*;
public dynamic class LightSpotSmall extends MovieClip {
}
}//package
Section 152
//MonsterCost (MonsterCost)
package {
import flash.display.*;
import flash.text.*;
public dynamic class MonsterCost extends MovieClip {
public var caption:TextField;
}
}//package
Section 153
//OverheatSmoke (OverheatSmoke)
package {
import flash.display.*;
public dynamic class OverheatSmoke extends MovieClip {
public function OverheatSmoke(){
addFrameScript(20, frame21);
}
function frame21(){
alpha = 0;
}
}
}//package
Section 154
//PauseScreen (PauseScreen)
package {
import flash.display.*;
public dynamic class PauseScreen extends MovieClip {
}
}//package
Section 155
//QuitDialog (QuitDialog)
package {
import game.*;
public dynamic class QuitDialog extends MenuButton {
}
}//package
Section 156
//Rifle_Flamethrower (Rifle_Flamethrower)
package {
import flash.display.*;
public dynamic class Rifle_Flamethrower extends MovieClip {
public var dot:MovieClip;
}
}//package
Section 157
//Rifle_Jackhammer (Rifle_Jackhammer)
package {
import flash.display.*;
public dynamic class Rifle_Jackhammer extends MovieClip {
public var shell:MovieClip;
public var dot:MovieClip;
}
}//package
Section 158
//Rifle_Laser (Rifle_Laser)
package {
import flash.display.*;
public dynamic class Rifle_Laser extends MovieClip {
public var dot:MovieClip;
}
}//package
Section 159
//Rifle_m4a1 (Rifle_m4a1)
package {
import flash.display.*;
public dynamic class Rifle_m4a1 extends MovieClip {
public var shell:MovieClip;
public var dot:MovieClip;
}
}//package
Section 160
//Rifle_Minigun (Rifle_Minigun)
package {
import flash.display.*;
public dynamic class Rifle_Minigun extends MovieClip {
public var shell:MovieClip;
public var dot:MovieClip;
}
}//package
Section 161
//Rifle_Mosin (Rifle_Mosin)
package {
import flash.display.*;
public dynamic class Rifle_Mosin extends MovieClip {
public var shell:MovieClip;
public var dot:MovieClip;
}
}//package
Section 162
//Rifle_Tesla (Rifle_Tesla)
package {
import flash.display.*;
public dynamic class Rifle_Tesla extends MovieClip {
public var dot:MovieClip;
}
}//package
Section 163
//Shell (Shell)
package {
import flash.display.*;
public dynamic class Shell extends MovieClip {
}
}//package
Section 164
//snow_mc (snow_mc)
package {
import flash.display.*;
public dynamic class snow_mc extends MovieClip {
}
}//package
Section 165
//SnowFlake (SnowFlake)
package {
import flash.display.*;
public dynamic class SnowFlake extends MovieClip {
}
}//package
Section 166
//SoundAssaultShot1 (SoundAssaultShot1)
package {
import flash.media.*;
public dynamic class SoundAssaultShot1 extends Sound {
}
}//package
Section 167
//SoundButtonClick (SoundButtonClick)
package {
import flash.media.*;
public dynamic class SoundButtonClick extends Sound {
}
}//package
Section 168
//SoundButtonFocus (SoundButtonFocus)
package {
import flash.media.*;
public dynamic class SoundButtonFocus extends Sound {
}
}//package
Section 169
//SoundCar (SoundCar)
package {
import flash.media.*;
public dynamic class SoundCar extends Sound {
}
}//package
Section 170
//SoundCoinsDropped (SoundCoinsDropped)
package {
import flash.media.*;
public dynamic class SoundCoinsDropped extends Sound {
}
}//package
Section 171
//SoundDayNight (SoundDayNight)
package {
import flash.media.*;
public dynamic class SoundDayNight extends Sound {
}
}//package
Section 172
//SoundDayTheme (SoundDayTheme)
package {
import flash.media.*;
public dynamic class SoundDayTheme extends Sound {
}
}//package
Section 173
//SoundDebris1 (SoundDebris1)
package {
import flash.media.*;
public dynamic class SoundDebris1 extends Sound {
}
}//package
Section 174
//SoundDebris2 (SoundDebris2)
package {
import flash.media.*;
public dynamic class SoundDebris2 extends Sound {
}
}//package
Section 175
//SoundDogAttack1 (SoundDogAttack1)
package {
import flash.media.*;
public dynamic class SoundDogAttack1 extends Sound {
}
}//package
Section 176
//SoundDogDie1 (SoundDogDie1)
package {
import flash.media.*;
public dynamic class SoundDogDie1 extends Sound {
}
}//package
Section 177
//SoundDogDie2 (SoundDogDie2)
package {
import flash.media.*;
public dynamic class SoundDogDie2 extends Sound {
}
}//package
Section 178
//SoundEmptyClip (SoundEmptyClip)
package {
import flash.media.*;
public dynamic class SoundEmptyClip extends Sound {
}
}//package
Section 179
//SoundExplosion (SoundExplosion)
package {
import flash.media.*;
public dynamic class SoundExplosion extends Sound {
}
}//package
Section 180
//SoundFlame (SoundFlame)
package {
import flash.media.*;
public dynamic class SoundFlame extends Sound {
}
}//package
Section 181
//SoundGolemAttack1 (SoundGolemAttack1)
package {
import flash.media.*;
public dynamic class SoundGolemAttack1 extends Sound {
}
}//package
Section 182
//SoundGolemDie1 (SoundGolemDie1)
package {
import flash.media.*;
public dynamic class SoundGolemDie1 extends Sound {
}
}//package
Section 183
//SoundGolemDie2 (SoundGolemDie2)
package {
import flash.media.*;
public dynamic class SoundGolemDie2 extends Sound {
}
}//package
Section 184
//SoundHumanDie (SoundHumanDie)
package {
import flash.media.*;
public dynamic class SoundHumanDie extends Sound {
}
}//package
Section 185
//SoundJackhammerShot1 (SoundJackhammerShot1)
package {
import flash.media.*;
public dynamic class SoundJackhammerShot1 extends Sound {
}
}//package
Section 186
//SoundJet (SoundJet)
package {
import flash.media.*;
public dynamic class SoundJet extends Sound {
}
}//package
Section 187
//SoundLaserHissing (SoundLaserHissing)
package {
import flash.media.*;
public dynamic class SoundLaserHissing extends Sound {
}
}//package
Section 188
//SoundLizardAttack1 (SoundLizardAttack1)
package {
import flash.media.*;
public dynamic class SoundLizardAttack1 extends Sound {
}
}//package
Section 189
//SoundLizardDie1 (SoundLizardDie1)
package {
import flash.media.*;
public dynamic class SoundLizardDie1 extends Sound {
}
}//package
Section 190
//SoundMenuTheme (SoundMenuTheme)
package {
import flash.media.*;
public dynamic class SoundMenuTheme extends Sound {
}
}//package
Section 191
//SoundMinigunShot1 (SoundMinigunShot1)
package {
import flash.media.*;
public dynamic class SoundMinigunShot1 extends Sound {
}
}//package
Section 192
//SoundMosinShot2 (SoundMosinShot2)
package {
import flash.media.*;
public dynamic class SoundMosinShot2 extends Sound {
}
}//package
Section 193
//SoundNightTheme (SoundNightTheme)
package {
import flash.media.*;
public dynamic class SoundNightTheme extends Sound {
}
}//package
Section 194
//SoundOverheat (SoundOverheat)
package {
import flash.media.*;
public dynamic class SoundOverheat extends Sound {
}
}//package
Section 195
//SoundReloadEnd (SoundReloadEnd)
package {
import flash.media.*;
public dynamic class SoundReloadEnd extends Sound {
}
}//package
Section 196
//SoundScorpAttack1 (SoundScorpAttack1)
package {
import flash.media.*;
public dynamic class SoundScorpAttack1 extends Sound {
}
}//package
Section 197
//SoundScorpDie1 (SoundScorpDie1)
package {
import flash.media.*;
public dynamic class SoundScorpDie1 extends Sound {
}
}//package
Section 198
//SoundScorpDie2 (SoundScorpDie2)
package {
import flash.media.*;
public dynamic class SoundScorpDie2 extends Sound {
}
}//package
Section 199
//SoundScorpDie3 (SoundScorpDie3)
package {
import flash.media.*;
public dynamic class SoundScorpDie3 extends Sound {
}
}//package
Section 200
//SoundScorpDie4 (SoundScorpDie4)
package {
import flash.media.*;
public dynamic class SoundScorpDie4 extends Sound {
}
}//package
Section 201
//SoundShot1_a (SoundShot1_a)
package {
import flash.media.*;
public dynamic class SoundShot1_a extends Sound {
}
}//package
Section 202
//SoundShot1_b (SoundShot1_b)
package {
import flash.media.*;
public dynamic class SoundShot1_b extends Sound {
}
}//package
Section 203
//SoundShot2_a (SoundShot2_a)
package {
import flash.media.*;
public dynamic class SoundShot2_a extends Sound {
}
}//package
Section 204
//SoundShot2_b (SoundShot2_b)
package {
import flash.media.*;
public dynamic class SoundShot2_b extends Sound {
}
}//package
Section 205
//SoundShot3_a (SoundShot3_a)
package {
import flash.media.*;
public dynamic class SoundShot3_a extends Sound {
}
}//package
Section 206
//SoundShot3_b (SoundShot3_b)
package {
import flash.media.*;
public dynamic class SoundShot3_b extends Sound {
}
}//package
Section 207
//SoundShot4_a (SoundShot4_a)
package {
import flash.media.*;
public dynamic class SoundShot4_a extends Sound {
}
}//package
Section 208
//SoundShot4_b (SoundShot4_b)
package {
import flash.media.*;
public dynamic class SoundShot4_b extends Sound {
}
}//package
Section 209
//SoundShot4_c (SoundShot4_c)
package {
import flash.media.*;
public dynamic class SoundShot4_c extends Sound {
}
}//package
Section 210
//SoundSpiderAttack (SoundSpiderAttack)
package {
import flash.media.*;
public dynamic class SoundSpiderAttack extends Sound {
}
}//package
Section 211
//SoundTeslaPowerUp (SoundTeslaPowerUp)
package {
import flash.media.*;
public dynamic class SoundTeslaPowerUp extends Sound {
}
}//package
Section 212
//SoundTeslaShot1 (SoundTeslaShot1)
package {
import flash.media.*;
public dynamic class SoundTeslaShot1 extends Sound {
}
}//package
Section 213
//SurvivorIcon (SurvivorIcon)
package {
import flash.display.*;
import flash.text.*;
public dynamic class SurvivorIcon extends MovieClip {
public var caption:TextField;
}
}//package
Section 214
//ToggleSoundOff (ToggleSoundOff)
package {
import game.*;
public dynamic class ToggleSoundOff extends ToggleSound {
}
}//package
Section 215
//ToggleSoundOn (ToggleSoundOn)
package {
import game.*;
public dynamic class ToggleSoundOn extends ToggleSound {
}
}//package
Section 216
//Trophies (Trophies)
package {
import game.*;
public dynamic class Trophies extends MenuButton {
}
}//package
Section 217
//WeaponIcon (WeaponIcon)
package {
import flash.display.*;
import flash.text.*;
public dynamic class WeaponIcon extends MovieClip {
public var caption:TextField;
public function WeaponIcon(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package
Section 218
//WeaponIcon2 (WeaponIcon2)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public dynamic class WeaponIcon2 extends MovieClip {
public var hintText:HintText;
public var isHintVisible:Boolean;
public var type:MovieClip;
public var captions:Array;
public var caption:TextField;
public function WeaponIcon2(){
addFrameScript(0, frame1);
}
public function releaseHint(){
if (hintText){
stage.removeChild(hintText);
hintText = null;
};
}
public function onMouseMoveHandler(_arg1:MouseEvent){
if (hintText == null){
return;
};
hintText.x = _arg1.stageX;
hintText.y = ((_arg1.stageY - hintText.height) - 2);
hintText.hint.text = captions[(type.currentFrame - 1)];
}
function frame1(){
addEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOutHandler);
addEventListener(MouseEvent.MOUSE_MOVE, onMouseMoveHandler);
mouseChildren = false;
captions = new Array();
hintText = null;
isHintVisible = true;
captions.push("Rifle");
captions.push("Assault rifle");
captions.push("Jackhammer");
captions.push("Flametrower");
captions.push("Laser");
captions.push("Minigun");
captions.push("Tesla");
captions.push("Grenades");
}
public function onMouseOutHandler(_arg1:MouseEvent){
if (((((!(stage)) || (!(isHintVisible)))) || (!(hintText)))){
return;
};
stage.removeChild(hintText);
hintText = null;
}
public function onMouseOverHandler(_arg1:MouseEvent){
if (!isHintVisible){
return;
};
hintText = new HintText();
stage.addChild(hintText);
hintText.mouseEnabled = false;
}
}
}//package
Section 219
//WeaponIconEx (WeaponIconEx)
package {
import flash.display.*;
public dynamic class WeaponIconEx extends MovieClip {
public var icon:WeaponIcon;
}
}//package