Section 1
//AIManager (Game5.AIManager)
package Game5 {
public class AIManager {
public var aiArray:Array;
public var corpseArray:Array;
public static var instance:AIManager;
private static var allowInstance:Boolean;
public function AIManager(){
this.aiArray = new Array();
this.corpseArray = new Array();
if (!AIManager.allowInstance){
throw (new Error("Only one instance of AIManager available"));
};
}
public function updateManager():void{
var _local1:*;
for (_local1 in aiArray) {
aiArray[_local1].type.update(aiArray[_local1]);
};
if (corpseArray.length > 250){
corpseArray[0].removeMe();
corpseArray.splice(0, 1);
};
}
public function removeUnit(_arg1):void{
var _local2:int;
_local2 = (aiArray.length - 1);
while (_local2 > -1) {
if (aiArray[_local2] == _arg1){
aiArray.splice(_local2, 1);
corpseArray.push(_arg1);
};
_local2--;
};
}
public function TriggerA():void{
var _local1:*;
for (_local1 in aiArray) {
aiArray[_local1].dispatchEvent(new CustomEvent(CustomEvent.TRIGGER_A));
};
}
public function removeAllUnits():void{
var _local1:int;
_local1 = (aiArray.length - 1);
while (_local1 > -1) {
aiArray[_local1].removeMe();
aiArray.splice(_local1, 1);
_local1--;
};
}
public function traceArray():void{
var _local1:int;
_local1 = (aiArray.length - 1);
while (_local1 > -1) {
_local1--;
};
}
public function removeAllCorpse():void{
var _local1:int;
_local1 = (corpseArray.length - 1);
while (_local1 > -1) {
corpseArray[_local1].removeMe();
corpseArray.splice(_local1, 1);
_local1--;
};
}
public static function getInstance():AIManager{
if (AIManager.instance == null){
AIManager.allowInstance = true;
AIManager.instance = new (AIManager);
AIManager.allowInstance = false;
};
return (AIManager.instance);
}
}
}//package Game5
Section 2
//Blood (Game5.Blood)
package Game5 {
import flash.display.*;
public class Blood extends MovieClip {
private var count:int;// = 0
public function Blood(_arg1:int, _arg2:int){
count = 0;
super();
addFrameScript(6, frame7);
this.x = _arg1;
this.y = _arg2;
this.alpha = 1;
}
public function removeMe():void{
parent.removeChild(this);
}
function frame7(){
stop();
}
public function update():void{
count++;
if (count > 2){
this.alpha = (this.alpha - 0.1);
count = 0;
};
}
}
}//package Game5
Section 3
//Bullet (Game5.Bullet)
package Game5 {
import flash.display.*;
public class Bullet extends MovieClip {
public var dmg:int;
private var dy:Number;
private var dx:Number;
public function Bullet(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:int, _arg5:int){
addFrameScript(7, frame8);
dmg = _arg4;
this.x = _arg1;
this.y = _arg2;
dx = (_arg5 * Math.cos((_arg3 * (Math.PI / 180))));
dy = (_arg5 * Math.sin((_arg3 * (Math.PI / 180))));
this.rotation = _arg3;
}
public function removeMe(){
parent.removeChild(this);
}
function frame8(){
stop();
}
public function update(){
this.x = (this.x + dx);
this.y = (this.y + dy);
}
}
}//package Game5
Section 4
//Carbine (Game5.Carbine)
package Game5 {
public class Carbine extends Gun {
public function Carbine(){
ACCURACY = 7;
CAP_ACCURACY = 10;
FIRE_POWER = 3;
CAP_FIRE_POWER = 6;
RELOAD_SPEED = 10;
CAP_RELOAD_SPEED = 14;
RATE_OF_FIRE = 9;
CAP_RATE_OF_FIRE = 13;
CLIP_SIZE = 20;
CAP_CLIP_SIZE = 30;
NUM_IN_CLIP = CLIP_SIZE;
SHOTS_FIRED = 1;
NAME = "Carbine";
UPGRADE_COST = 5;
fireAnim = "2h";
}
override public function playSound(){
sndMgr.playSound("Assault");
}
}
}//package Game5
Section 5
//CollisionManager (Game5.CollisionManager)
package Game5 {
public class CollisionManager {
public var player:Player;
public var runOnce:Boolean;// = true
public var wallBroken:Boolean;// = false
public function CollisionManager(){
wallBroken = false;
runOnce = true;
super();
}
public function UpdateManager():void{
var _local1:Array;
var _local2:Array;
var _local3:int;
var _local4:Bullet;
var _local5:int;
var _local6:Wolf;
var _local7:Blood;
var _local8:int;
_local1 = ProjectileManager.instance.projectileArray;
_local2 = AIManager.instance.aiArray;
_local3 = (_local1.length - 1);
while (_local3 > -1) {
_local4 = _local1[_local3];
_local5 = (_local2.length - 1);
while (_local5 > -1) {
if (_local2[_local5].type == Player){
if (player == null){
};
break;
};
_local6 = _local2[_local5];
if (_local6.HIDE.head != null){
if (_local6.HIDE.head.hitTestPoint(_local4.x, _local4.y, true)){
_local6.dispatchEvent(new CustomEvent(CustomEvent.ON_HIT, {dmg:_local4.dmg, hs:true}));
_local1[_local3].removeMe();
_local1.splice(_local3, 1);
break;
};
};
if (_local6.hitTestPoint(_local4.x, _local4.y, true)){
_local6.dispatchEvent(new CustomEvent(CustomEvent.ON_HIT, {dmg:_local4.dmg}));
_local7 = new Blood(_local4.x, _local4.y);
_local6.parent.addChild(_local7);
ParticleManager.instance.particleArray.push(_local7);
_local1[_local3].removeMe();
_local1.splice(_local3, 1);
break;
};
_local5--;
};
_local3--;
};
if (wallBroken){
_local8 = (_local2.length - 1);
while (_local8 > -1) {
if (player.hitTestObject(_local2[_local8])){
if ((_local2[_local8] is Player)){
break;
};
player.Alive = false;
};
_local8--;
};
};
}
}
}//package Game5
Section 6
//Crossbow (Game5.Crossbow)
package Game5 {
public class Crossbow extends Gun {
public function Crossbow(){
ACCURACY = 12;
CAP_ACCURACY = 15;
FIRE_POWER = 3;
CAP_FIRE_POWER = 6;
RELOAD_SPEED = 10;
CAP_RELOAD_SPEED = 14;
RATE_OF_FIRE = 5;
CAP_RATE_OF_FIRE = 10;
CLIP_SIZE = 8;
CAP_CLIP_SIZE = 15;
NUM_IN_CLIP = CLIP_SIZE;
SHOTS_FIRED = 1;
NAME = "Crossbow";
UPGRADE_COST = 4;
fireAnim = "2h";
}
override public function playSound(){
sndMgr.playSound("Arrow");
}
}
}//package Game5
Section 7
//CustomEvent (Game5.CustomEvent)
package Game5 {
import flash.events.*;
public class CustomEvent extends Event {
public var params:Object;
public static const GAME_OVER:String = "Game Over";
public static const KILL_UNIT:String = "Kill Unit";
public static const ATTACK:String = "Attacking";
public static const UPDATE:String = "Update";
public static const ON_HIT:String = "On Hit";
public static const WINDOW_CLOSE:String = "Window Closed";
public static const TRIGGER_A:String = "Trigger A";
public static const TRIGGER_B:String = "Trigger B";
public function CustomEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.params = _arg2;
}
override public function toString():String{
return (formatToString("CustomEvent", "type", "bubbles", "cancelable", "eventPhase"));
}
override public function clone():Event{
return (new CustomEvent(type, bubbles, cancelable));
}
}
}//package Game5
Section 8
//Dog (Game5.Dog)
package Game5 {
import flash.display.*;
public class Dog extends Wolf {
public function Dog(_arg1:int, _arg2:int, _arg3:int){
STRENGTH = 1;
SPEED = 10;
HEALTH = (5 + _arg3);
HIDE = new Canine();
this.addChild(HIDE);
this.x = _arg1;
this.y = _arg2;
setAttackPoint(0, _arg2);
HIDE.addEventListener(CustomEvent.ATTACK, dealDamage);
}
private function dealDamage(_arg1:CustomEvent):void{
MovieClip(root).BarricadeHealth = (MovieClip(root).BarricadeHealth - STRENGTH);
MovieClip(root).dispatchEvent(new CustomEvent(CustomEvent.UPDATE));
}
}
}//package Game5
Section 9
//G3 (Game5.G3)
package Game5 {
public class G3 extends Gun {
public function G3(){
ACCURACY = 10;
CAP_ACCURACY = 15;
FIRE_POWER = 3;
CAP_FIRE_POWER = 6;
RELOAD_SPEED = 5;
CAP_RELOAD_SPEED = 12;
RATE_OF_FIRE = 4;
CAP_RATE_OF_FIRE = 8;
CLIP_SIZE = 20;
CAP_CLIP_SIZE = 30;
NUM_IN_CLIP = CLIP_SIZE;
SHOTS_FIRED = 1;
NAME = "G3";
UPGRADE_COST = 5;
fireAnim = "2h";
}
override public function playSound(){
sndMgr.playSound("Assault");
}
}
}//package Game5
Section 10
//Gun (Game5.Gun)
package Game5 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Gun extends Sprite {
protected var RELOAD_SPEED:int;
protected var canFire:Boolean;// = true
public var UPGRADE_COST:int;
protected var RATE_OF_FIRE:int;
public var CAP_CLIP_SIZE:int;
public var CAP_FIRE_POWER:int;
public var NUM_IN_CLIP:int;
protected var PROP:DisplayObject;
public var CAP_RELOAD_SPEED:int;
public var fireAnim:String;
protected var roundsOff:int;// = 0
protected var CLIP_SIZE:int;
protected var ignoreROF:Boolean;// = false
public var NAME:String;
public var SHOTS_FIRED:int;
public var CAP_RATE_OF_FIRE:int;
protected var reloading:Boolean;// = false
protected var myRoot;
protected var FIRE_POWER:int;
public var CAP_ACCURACY:int;
protected var sndMgr:SoundManager;
protected var ACCURACY:int;
protected static var MAX_CLIP_SIZE:int = 80;
protected static var MAX_FIRE_POWER:int = 100;
protected static var MAX_RATE_OF_FIRE:int = 20;
protected static var MAX_ACCURACY:int = 15;
protected static var MAX_RELOAD_SPEED:int = 16;
public function Gun(){
canFire = true;
reloading = false;
ignoreROF = false;
roundsOff = 0;
sndMgr = SoundManager.getInstance();
super();
}
public function get maxClipSize():int{
return (MAX_CLIP_SIZE);
}
private function RandomRange(_arg1:Number, _arg2:Number){
var _local3:Number;
_local3 = ((Math.random() * (_arg2 - _arg1)) + _arg1);
return (_local3);
}
protected function reloadWeapon(_arg1:TimerEvent):void{
NUM_IN_CLIP = CLIP_SIZE;
reloading = false;
sndMgr.playSound("Reload");
dispatchEvent(new CustomEvent(CustomEvent.UPDATE));
}
public function fireWeapon(_arg1:Number, _arg2:Number, _arg3:Number):Bullet{
var ableToFire:Function;
var accuracyCheck:Number;
var b:Bullet;
var t:Timer;
var rt:Timer;
var startX = _arg1;
var startY = _arg2;
var rotation = _arg3;
ableToFire = function (_arg1:TimerEvent):void{
canFire = true;
};
if (ACCURACY > MAX_ACCURACY){
ACCURACY = MAX_ACCURACY;
};
if (FIRE_POWER > MAX_FIRE_POWER){
FIRE_POWER = MAX_FIRE_POWER;
};
if (RELOAD_SPEED >= MAX_RELOAD_SPEED){
RELOAD_SPEED = (MAX_RELOAD_SPEED - 1);
};
if (CLIP_SIZE > MAX_CLIP_SIZE){
CLIP_SIZE = MAX_CLIP_SIZE;
};
if (NUM_IN_CLIP > CLIP_SIZE){
NUM_IN_CLIP = CLIP_SIZE;
};
if (RATE_OF_FIRE >= MAX_RATE_OF_FIRE){
RATE_OF_FIRE = (MAX_RATE_OF_FIRE - 1);
};
if (((canFire) && (!(reloading)))){
accuracyCheck = (MAX_ACCURACY - ACCURACY);
b = new Bullet(startX, startY, (rotation + RandomRange(-(accuracyCheck), accuracyCheck)), FIRE_POWER, 50);
if (!ignoreROF){
canFire = false;
t = new Timer(25, (MAX_RATE_OF_FIRE - RATE_OF_FIRE));
t.addEventListener(TimerEvent.TIMER_COMPLETE, ableToFire);
t.start();
} else {
roundsOff++;
if (roundsOff > 3){
t = new Timer(25, (MAX_RATE_OF_FIRE - RATE_OF_FIRE));
t.addEventListener(TimerEvent.TIMER_COMPLETE, ableToFire);
t.start();
roundsOff = 0;
canFire = false;
return (null);
};
};
NUM_IN_CLIP--;
if (NUM_IN_CLIP <= 0){
reloading = true;
rt = new Timer(250, (MAX_RELOAD_SPEED - RELOAD_SPEED));
rt.addEventListener(TimerEvent.TIMER_COMPLETE, reloadWeapon);
rt.start();
};
return (b);
//unresolved jump
};
return (null);
}
public function get maxReloadSpeed():int{
return (MAX_RELOAD_SPEED);
}
public function get weaponAccuracy():int{
return (ACCURACY);
}
public function playSound(){
}
public function increaseAccuracy(_arg1:int):void{
if ((ACCURACY + _arg1) <= CAP_ACCURACY){
ACCURACY = (ACCURACY + _arg1);
};
}
public function forceReload():void{
var _local1:Timer;
if (!reloading){
reloading = true;
_local1 = new Timer(250, (MAX_RELOAD_SPEED - RELOAD_SPEED));
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, reloadWeapon);
_local1.start();
};
}
public function increaseFirePower(_arg1:int):void{
if ((FIRE_POWER + _arg1) <= CAP_FIRE_POWER){
FIRE_POWER = (FIRE_POWER + _arg1);
};
}
public function get maxRateOfFire():int{
return (MAX_RATE_OF_FIRE);
}
public function get capClipSize():int{
return (CAP_CLIP_SIZE);
}
public function get maxFirePower():int{
return (MAX_FIRE_POWER);
}
public function get maxAccuracy():int{
return (MAX_ACCURACY);
}
public function get weaponReloadSpeed():int{
return (RELOAD_SPEED);
}
public function increaseReloadSpeed(_arg1:int):void{
if ((RELOAD_SPEED + _arg1) <= CAP_RELOAD_SPEED){
RELOAD_SPEED = (RELOAD_SPEED + _arg1);
};
}
public function increaseRateOfFire(_arg1:int):void{
if ((RATE_OF_FIRE + _arg1) <= CAP_RATE_OF_FIRE){
RATE_OF_FIRE = (RATE_OF_FIRE + _arg1);
};
}
public function get weaponClipSize():int{
return (CLIP_SIZE);
}
public function get weaponFirePower():int{
return (FIRE_POWER);
}
public function increaseClipSize(_arg1:int):void{
if ((CLIP_SIZE + _arg1) <= CAP_CLIP_SIZE){
CLIP_SIZE = (CLIP_SIZE + _arg1);
} else {
CLIP_SIZE = CAP_CLIP_SIZE;
};
}
public function get weaponRateOfFire():int{
return (RATE_OF_FIRE);
}
}
}//package Game5
Section 11
//KeyObject (Game5.KeyObject)
package Game5 {
public class KeyObject {
public static const KEY_LEFT:uint = 37;
public static const KEY_ESC:uint = 27;
public static const KEY_Space:uint = 32;
public static const KEY_UP:uint = 38;
public static const KEY_1:uint = 49;
public static const KEY_2:uint = 50;
public static const KEY_3:uint = 51;
public static const KEY_4:uint = 52;
public static const KEY_5:uint = 53;
public static const KEY_DOWN:uint = 40;
public static const KEY_A:uint = 65;
public static const KEY_D:uint = 68;
public static const KEY_J:uint = 74;
public static const KEY_K:uint = 75;
public static const KEY_L:uint = 76;
public static const KEY_Q:uint = 81;
public static const KEY_R:uint = 82;
public static const KEY_S:uint = 83;
public static const KEY_Z:uint = 90;
public static const KEY_SHIFT:uint = 16;
public static const KEY_W:uint = 87;
public static const KEY_RIGHT:uint = 39;
public static var DOWN_W:Boolean;
public static var DOWN_Shift:Boolean;
public static var DOWN_Space:Boolean;
public static var DOWN_Right:Boolean;
public static var DOWN_Left:Boolean;
public static var DOWN_Mouse:Boolean;
public static var DOWN_ESC:Boolean;
public static var DOWN_Down:Boolean;
public static var DOWN_1:Boolean;
public static var DOWN_2:Boolean;
public static var DOWN_3:Boolean;
public static var DOWN_4:Boolean;
public static var DOWN_5:Boolean;
public static var DOWN_A:Boolean;
public static var DOWN_D:Boolean;
public static var DOWN_J:Boolean;
public static var DOWN_K:Boolean;
public static var DOWN_L:Boolean;
public static var DOWN_Q:Boolean;
public static var DOWN_R:Boolean;
public static var DOWN_S:Boolean;
public static var DOWN_Up:Boolean;
public static var DOWN_Z:Boolean;
public static function initAll(){
DOWN_1 = false;
DOWN_2 = false;
DOWN_3 = false;
DOWN_4 = false;
DOWN_5 = false;
DOWN_A = false;
DOWN_D = false;
DOWN_J = false;
DOWN_K = false;
DOWN_L = false;
DOWN_Q = false;
DOWN_R = false;
DOWN_S = false;
DOWN_W = false;
DOWN_Z = false;
DOWN_Space = false;
DOWN_ESC = false;
DOWN_Mouse = false;
DOWN_Up = false;
DOWN_Right = false;
DOWN_Left = false;
DOWN_Down = false;
DOWN_Shift = false;
}
}
}//package Game5
Section 12
//M16 (Game5.M16)
package Game5 {
public class M16 extends Gun {
public function M16(){
ACCURACY = 10;
CAP_ACCURACY = 13;
FIRE_POWER = 2;
CAP_FIRE_POWER = 4;
RELOAD_SPEED = 8;
CAP_RELOAD_SPEED = 12;
RATE_OF_FIRE = 9;
CAP_RATE_OF_FIRE = 13;
CLIP_SIZE = 20;
CAP_CLIP_SIZE = 30;
NUM_IN_CLIP = CLIP_SIZE;
SHOTS_FIRED = 1;
NAME = "M16";
UPGRADE_COST = 5;
fireAnim = "2h";
}
override public function playSound(){
sndMgr.playSound("Assault");
}
}
}//package Game5
Section 13
//Main (Game5.Main)
package Game5 {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import flash.geom.*;
import flash.ui.*;
public class Main extends MovieClip {
public var BarricadeHealthBox:TextField;
public var carbine:Carbine;
public var scrap_indi:TextField;
public var main_more:SimpleButton;
public var newDD:Weapon_DropDownMenu;
public var ammo_clip:MovieClip;
public var main_credits:SimpleButton;
private var s1:Boolean;// = false
private var s2:Boolean;// = false
public var sawedoff:SawedOff;
public var weaponID;
private var s3:Boolean;// = false
public var bar_health_indi:TextField;
public var skpbtn:SimpleButton;
public var fire:Boolean;// = false
public var loading_text:MovieClip;
public var main_start:SimpleButton;
public var Remington_wep:MovieClip;
public var uzi:Uzi;
public var ch:Crosshairs;
public var resultsMenu:Results_Window;
public var colMgr:CollisionManager;
public var SpawnCount:int;// = 20
public var Primary_sel:MovieClip;
public var mp5_wep:MovieClip;
public var g3:G3;
private var s4:Boolean;// = false
public var Pistol_wep:MovieClip;
public var gui_Mute:MovieClip;
public var nightNum:int;// = 1
public var bar_total_health_indi:TextField;
public var skipm:SimpleButton;
public var aiMgr:AIManager;
public var gamelevel:MovieClip;
public var ignoreClick:Boolean;// = false
public var player:Player;
public var ActiveWeapon:Gun;
public var NightCounter:int;// = 1800
public var Secondary_sel:MovieClip;
public var m16_wep:MovieClip;
public var gui_Upgrade:SimpleButton;
public var mp5:MP5;
public var revolver_wep:MovieClip;
public var TotalScraps:int;// = 0
public var uzi_wep:MovieClip;
public var sponsor:MovieClip;
public var count:int;
public var partMgr:ParticleManager;
public var ctnbtn:SimpleButton;
public var contents:MovieClip;
public var day_indi:TextField;
public var searchMenu:Search_Window;
public var Moon:SimpleButton;
public var percText:TextField;
private var playerAdjustment:int;
public var addy1:URLRequest;
public var crossbow_wep:MovieClip;
public var TotalRations:int;// = 0
public var g3_wep:MovieClip;
public var remington:Remington;
public var Secondary:Gun;
public var sawedoff_wep:MovieClip;
public var BarricadeTotalHealth;// = 100
public var main_htp:SimpleButton;
public var loadbar:MovieClip;
public var projectileMgr:ProjectileManager;
public var pistol:Pistol;
public var SpawnInterval:int;
public var m16:M16;
public var BarricadeHealth:int;// = 100
public var crossbow:Crossbow;
public var dragon_games:MovieClip;
public var day:TextField;
public var weaponArray:Array;
public var GameState:String;// = "Play"
public var upgradeMenu:Upgrade_Window;
public var ctn_gameover:SimpleButton;
public var carbine_wep:MovieClip;
public var gui_Pause:MovieClip;
public var goTime:SimpleButton;
public var MutedGame:String;// = "Unmute"
public var Primary:Gun;
public var revolver:Revolver;
public var sndMgr:SoundManager;
public var ctnu:SimpleButton;
public var addy:URLRequest;
public function Main(){
var _local1:ContextMenu;
var _local2:ContextMenuItem;
pistol = new Pistol();
remington = new Remington();
mp5 = new MP5();
revolver = new Revolver();
sawedoff = new SawedOff();
m16 = new M16();
crossbow = new Crossbow();
carbine = new Carbine();
g3 = new G3();
uzi = new Uzi();
GameState = "Play";
MutedGame = "Unmute";
ignoreClick = false;
TotalScraps = 0;
TotalRations = 0;
BarricadeHealth = 100;
BarricadeTotalHealth = 100;
fire = false;
nightNum = 1;
NightCounter = 1800;
SpawnCount = 20;
s1 = false;
s2 = false;
s3 = false;
s4 = false;
super();
addFrameScript(0, frame1, 1, frame2, 100, frame101, 101, frame102, 210, frame211, 0xFF, frame256, 285, frame286, 305, frame306, 1208, frame1209, 1210, frame1211, 1211, frame1212, 1212, frame1213, 1213, frame1214, 1214, frame1215, 2514, frame2515);
_local1 = new ContextMenu();
_local2 = new ContextMenuItem("Copyright © hardcircle.com");
_local1.hideBuiltInItems();
_local1.customItems.push(_local2);
this.contextMenu = _local1;
projectileMgr = ProjectileManager.getInstance();
aiMgr = AIManager.getInstance();
partMgr = ParticleManager.getInstance();
colMgr = new CollisionManager();
sndMgr = SoundManager.getInstance();
sndMgr.addLibrarySound(sfx_pistol, "Pistol");
sndMgr.addLibrarySound(sfx_AssualtGood, "Assault");
sndMgr.addLibrarySound(sfx_arrow, "Arrow");
sndMgr.addLibrarySound(sfx_shotgun, "Shotgun");
sndMgr.addLibrarySound(sfxreload_rifle, "Reload");
sndMgr.addLibrarySound(sfx_barricade_collapse, "Barricade");
sndMgr.addLibrarySound(sfx_wolf_death1, "Death_1");
sndMgr.addLibrarySound(sfx_wolf_death2, "Death_2");
sndMgr.addLibrarySound(sfx_wolf_death3, "Death_3");
sndMgr.addLibrarySound(sfx_wolf_death4, "Death_4");
sndMgr.addLibrarySound(Wolf1, "attack_1");
sndMgr.addLibrarySound(Wolf2, "attack_2");
sndMgr.addLibrarySound(Wolf3, "attack_3");
sndMgr.addLibrarySound(Wolf1, "attack_4");
sndMgr.addLibrarySound(Moonlight_Sonata_Theme, "Theme");
sndMgr.addLibrarySound(ambiant_backdrop, "Ambiant");
sndMgr.addLibrarySound(btn_click, "Click1");
sndMgr.addLibrarySound(btn_click2, "Click2");
sndMgr.addLibrarySound(sfx_wolfhowl_btn, "Howl");
KeyObject.initAll();
checkWeaponsAvailable();
}
private function MouseClick(_arg1:MouseEvent):void{
fire = true;
}
private function keyPressedDown(_arg1:KeyboardEvent):void{
if ((((((_arg1.keyCode == KeyObject.KEY_W)) || ((_arg1.keyCode == KeyObject.KEY_Z)))) || ((_arg1.keyCode == KeyObject.KEY_UP)))){
KeyObject.DOWN_W = true;
} else {
if ((((_arg1.keyCode == KeyObject.KEY_S)) || ((_arg1.keyCode == KeyObject.KEY_DOWN)))){
KeyObject.DOWN_S = true;
};
};
if ((((((_arg1.keyCode == KeyObject.KEY_A)) || ((_arg1.keyCode == KeyObject.KEY_Q)))) || ((_arg1.keyCode == KeyObject.KEY_LEFT)))){
KeyObject.DOWN_A = true;
} else {
if ((((_arg1.keyCode == KeyObject.KEY_D)) || ((_arg1.keyCode == KeyObject.KEY_RIGHT)))){
KeyObject.DOWN_D = true;
};
};
if (_arg1.keyCode == KeyObject.KEY_1){
if (Primary == null){
return;
};
ActiveWeapon = Primary;
player.r_arm.gotoAndStop(ActiveWeapon.fireAnim);
player.l_arm.gotoAndStop(ActiveWeapon.fireAnim);
player.r_arm.player_weapon.gotoAndStop(ActiveWeapon.NAME);
this.dispatchEvent(new CustomEvent(CustomEvent.UPDATE));
} else {
if (_arg1.keyCode == KeyObject.KEY_2){
if (Secondary == null){
return;
};
ActiveWeapon = Secondary;
player.r_arm.gotoAndStop(ActiveWeapon.fireAnim);
player.l_arm.gotoAndStop(ActiveWeapon.fireAnim);
player.r_arm.player_weapon.gotoAndStop(ActiveWeapon.NAME);
this.dispatchEvent(new CustomEvent(CustomEvent.UPDATE));
} else {
if (_arg1.keyCode == KeyObject.KEY_Space){
if ((((ActiveWeapon == Primary)) && (!((Secondary == null))))){
ActiveWeapon = Secondary;
player.r_arm.gotoAndStop(ActiveWeapon.fireAnim);
player.l_arm.gotoAndStop(ActiveWeapon.fireAnim);
player.r_arm.player_weapon.gotoAndStop(ActiveWeapon.NAME);
} else {
if ((((ActiveWeapon == Secondary)) && (!((Primary == null))))){
ActiveWeapon = Primary;
player.r_arm.gotoAndStop(ActiveWeapon.fireAnim);
player.l_arm.gotoAndStop(ActiveWeapon.fireAnim);
player.r_arm.player_weapon.gotoAndStop(ActiveWeapon.NAME);
};
};
this.dispatchEvent(new CustomEvent(CustomEvent.UPDATE));
};
};
};
if ((((_arg1.keyCode == KeyObject.KEY_R)) || ((_arg1.keyCode == KeyObject.KEY_SHIFT)))){
ActiveWeapon.forceReload();
};
if (_arg1.keyCode == KeyObject.KEY_J){
} else {
if (_arg1.keyCode == KeyObject.KEY_K){
aiMgr.traceArray();
};
};
}
private function RandomRange(_arg1:Number, _arg2:Number){
var _local3:Number;
_local3 = ((Math.random() * (_arg2 - _arg1)) + _arg1);
return (_local3);
}
function frame256(){
MochiBot.track(this, "a2362aac");
MovieClip(root).sndMgr.playSound("Theme", 1, 0, 99);
Mouse.hide();
ch = new Crosshairs();
addChild(ch);
stage.addEventListener(MouseEvent.MOUSE_MOVE, moveCursor);
}
function frame286(){
stop();
main_credits.addEventListener(MouseEvent.CLICK, createCreditsMenu);
main_htp.addEventListener(MouseEvent.CLICK, createHTPMenu);
main_start.addEventListener(MouseEvent.CLICK, startGame);
main_more.addEventListener(MouseEvent.MOUSE_DOWN, mainNavToSponsor);
Moon.addEventListener(MouseEvent.MOUSE_DOWN, mainNavToSponsor);
}
public function navToSponsor(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.dragongamez.com/");
navigateToURL(_local2, "_blank");
}
private function keyPressRelease(_arg1:KeyboardEvent):void{
if ((((((_arg1.keyCode == KeyObject.KEY_W)) || ((_arg1.keyCode == KeyObject.KEY_Z)))) || ((_arg1.keyCode == KeyObject.KEY_UP)))){
KeyObject.DOWN_W = false;
} else {
if ((((_arg1.keyCode == KeyObject.KEY_S)) || ((_arg1.keyCode == KeyObject.KEY_DOWN)))){
KeyObject.DOWN_S = false;
};
};
if ((((((_arg1.keyCode == KeyObject.KEY_A)) || ((_arg1.keyCode == KeyObject.KEY_Q)))) || ((_arg1.keyCode == KeyObject.KEY_LEFT)))){
KeyObject.DOWN_A = false;
} else {
if ((((_arg1.keyCode == KeyObject.KEY_D)) || ((_arg1.keyCode == KeyObject.KEY_RIGHT)))){
KeyObject.DOWN_D = false;
};
};
}
public function UpdateGunWindow(){
if (!SaveController.Load("Revolver")){
revolver_wep.alpha = 0;
} else {
revolver_wep.addEventListener(MouseEvent.CLICK, DropDownMenu);
};
if (!SaveController.Load("SawedOff")){
sawedoff_wep.alpha = 0;
} else {
sawedoff_wep.addEventListener(MouseEvent.CLICK, DropDownMenu);
};
if (!SaveController.Load("MP5")){
mp5_wep.alpha = 0;
} else {
mp5_wep.addEventListener(MouseEvent.CLICK, DropDownMenu);
};
if (!SaveController.Load("G3")){
g3_wep.alpha = 0;
} else {
g3_wep.addEventListener(MouseEvent.CLICK, DropDownMenu);
};
if (!SaveController.Load("Uzi")){
uzi_wep.alpha = 0;
} else {
uzi_wep.addEventListener(MouseEvent.CLICK, DropDownMenu);
};
if (!SaveController.Load("Crossbow")){
crossbow_wep.alpha = 0;
} else {
crossbow_wep.addEventListener(MouseEvent.CLICK, DropDownMenu);
};
if (!SaveController.Load("Carbine")){
carbine_wep.alpha = 0;
} else {
carbine_wep.addEventListener(MouseEvent.CLICK, DropDownMenu);
};
if (!SaveController.Load("M16")){
m16_wep.alpha = 0;
} else {
m16_wep.addEventListener(MouseEvent.CLICK, DropDownMenu);
};
if (!SaveController.Load("Remington")){
Remington_wep.alpha = 0;
} else {
Remington_wep.addEventListener(MouseEvent.CLICK, DropDownMenu);
};
scrap_indi.text = String(MovieClip(root).TotalScraps);
bar_health_indi.text = String(MovieClip(root).BarricadeHealth);
scrap_indi.text = String(MovieClip(root).TotalScraps);
bar_health_indi.text = String(MovieClip(root).BarricadeHealth);
bar_total_health_indi.text = String(MovieClip(root).BarricadeTotalHealth);
day_indi.text = String(MovieClip(root).nightNum);
Pistol_wep.addEventListener(MouseEvent.CLICK, DropDownMenu);
gui_Upgrade.addEventListener(MouseEvent.CLICK, upgradeWindow);
goTime.addEventListener(MouseEvent.CLICK, gotoGame);
}
private function setupAndStart():void{
KeyObject.initAll();
player = gamelevel.player;
playerAdjustment = (3 * (player.height / 4));
if (Primary != null){
ActiveWeapon = Primary;
} else {
ActiveWeapon = Secondary;
};
projectileMgr.removeAll();
aiMgr.removeAllCorpse();
aiMgr.removeAllUnits();
aiMgr.aiArray.push(gamelevel.player);
colMgr.player = gamelevel.player;
SpawnCount = (10 + (nightNum * 2));
NightCounter = (2100 + (nightNum * 85));
SpawnInterval = (NightCounter / SpawnCount);
count = 3000;
Primary.NUM_IN_CLIP = Primary.weaponClipSize;
if (Secondary != null){
Secondary.NUM_IN_CLIP = Secondary.weaponClipSize;
};
ActiveWeapon = Primary;
player.r_arm.gotoAndStop(ActiveWeapon.fireAnim);
player.l_arm.gotoAndStop(ActiveWeapon.fireAnim);
player.r_arm.player_weapon.gotoAndStop(ActiveWeapon.NAME);
AddEventListeners();
BarricadeHealthBox.text = String(BarricadeHealth);
GameState = "Play";
gui_Mute.gotoAndStop(GameMute);
}
private function updateInterface(_arg1:CustomEvent):void{
}
function frame1(){
stop();
addEventListener(Event.ENTER_FRAME, loading);
}
public function moveCursor(_arg1:MouseEvent):void{
setChildIndex(ch, (numChildren - 1));
ch.x = mouseX;
ch.y = mouseY;
}
public function createCreditsMenu(_arg1:MouseEvent):void{
var _local2:CreditsPage;
_local2 = new CreditsPage();
addChild(_local2);
MovieClip(root).sndMgr.playSound("Click1");
}
private function RemoveEventListeners():void{
stage.removeEventListener(MouseEvent.MOUSE_DOWN, MouseClick);
stage.removeEventListener(MouseEvent.MOUSE_UP, MouseRelease);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressedDown);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyPressRelease);
stage.removeEventListener(Event.ENTER_FRAME, loop);
this.addEventListener(CustomEvent.UPDATE, updateInterface);
ActiveWeapon.addEventListener(CustomEvent.UPDATE, updateInterface);
}
public function gotoMainMenuFromGameOver(_arg1:MouseEvent):void{
gotoAndPlay(1, "Main Menu");
}
function frame2515(){
skpbtn.removeEventListener(MouseEvent.CLICK, SkipCred);
gotoAndPlay(1, "Intro");
}
public function mainNavToSponsor(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.dragongamez.com/");
navigateToURL(_local2, "_blank");
}
public function resumeClicking(_arg1:MouseEvent):void{
ignoreClick = false;
}
private function createDog():void{
var _local1:Dog;
_local1 = new Dog(stage.stageWidth, RandomRange(140, 340), nightNum);
aiMgr.aiArray.push(_local1);
gamelevel.addChild(_local1);
}
private function loop(_arg1:Event):void{
var _local2:int;
var _local3:int;
if (GameState == "Paused"){
return;
};
if (GameState == "Play"){
projectileMgr.updateManager();
aiMgr.updateManager();
colMgr.UpdateManager();
partMgr.updateManager();
count++;
if ((((count >= SpawnInterval)) && ((SpawnCount > -1)))){
_local3 = Math.floor(RandomRange(1, 8));
if (_local3 == 5){
createWolf();
createWolf();
if (Math.floor(RandomRange(1, 3)) == 2){
createDog();
} else {
createWolf();
};
SpawnCount--;
SpawnCount--;
SpawnCount--;
count = 0;
} else {
if ((((((_local3 == 3)) || ((_local3 == 4)))) || ((_local3 == 7)))){
createWolf();
createWolf();
SpawnCount--;
SpawnCount--;
count = 0;
} else {
if ((((((_local3 == 1)) || ((_local3 == 2)))) || ((_local3 == 6)))){
if (Math.floor(RandomRange(1, 3)) == 2){
createDog();
} else {
createWolf();
};
SpawnCount--;
count = 0;
};
};
};
};
if (fire){
fireGun();
};
if (BarricadeHealth < 1){
BarricadeHealth = 0;
colMgr.wallBroken = true;
aiMgr.TriggerA();
if (!player.Alive){
EndGame();
};
};
if ((((SpawnCount <= 0)) && ((aiMgr.aiArray.length == 1)))){
RemoveEventListeners();
fire = false;
nightOver();
};
if ((((BarricadeHealth < 51)) && (!(s1)))){
gamelevel.BarricadeMC.gotoAndStop(6);
s1 = true;
};
if ((((BarricadeHealth < 26)) && (!(s2)))){
gamelevel.BarricadeMC.gotoAndStop(11);
s2 = true;
};
if ((((BarricadeHealth < 1)) && (!(s3)))){
gamelevel.BarricadeMC.gotoAndStop(16);
s3 = true;
};
if (((colMgr.wallBroken) && (!(s4)))){
gamelevel.BarricadeMC.gotoAndStop(16);
s4 = true;
};
_local2 = (aiMgr.aiArray.length - 1);
while (_local2 > -1) {
newDepthControl(aiMgr.aiArray[_local2]);
_local2--;
};
BarricadeHealthBox.text = String(BarricadeHealth);
if ((((ActiveWeapon.NAME == "Pistol")) || ((ActiveWeapon.NAME == "Revolver")))){
root["ammo_clip"].gotoAndStop((ActiveWeapon.NUM_IN_CLIP + 1));
} else {
if ((((((((((ActiveWeapon.NAME == "Carbine")) || ((ActiveWeapon.NAME == "G3")))) || ((ActiveWeapon.NAME == "M16")))) || ((ActiveWeapon.NAME == "MP5")))) || ((ActiveWeapon.NAME == "Uzi")))){
root["ammo_clip"].gotoAndStop((ActiveWeapon.NUM_IN_CLIP + 52));
} else {
if ((((ActiveWeapon.NAME == "Remington")) || ((ActiveWeapon.NAME == "SawedOff")))){
root["ammo_clip"].gotoAndStop((ActiveWeapon.NUM_IN_CLIP + 104));
} else {
if (ActiveWeapon.NAME == "Crossbow"){
root["ammo_clip"].gotoAndStop((ActiveWeapon.NUM_IN_CLIP + 156));
};
};
};
};
};
}
function frame2(){
stage.addEventListener(MouseEvent.MOUSE_DOWN, navToSponsor);
}
public function muteToggle(_arg1:MouseEvent):void{
GameMute();
}
public function SkipMovie(_arg1:MouseEvent):void{
gotoAndStop(923);
}
public function ApplyPrimary(_arg1:CustomEvent):void{
_arg1.target.removeEventListener(CustomEvent.TRIGGER_A, ApplyPrimary);
_arg1.target.removeEventListener(CustomEvent.TRIGGER_B, ApplySecondary);
setPrimary(weaponID.name);
newDD = null;
}
function frame1209(){
stop();
loading_text.visible = false;
ctnu.addEventListener(MouseEvent.CLICK, GotoNextMenu);
}
public function destroySearchWindow(_arg1:CustomEvent):void{
newResultsWindow(_arg1.params.RepairValue, _arg1.params.BarricadeTotal, _arg1.params.ScrapsFound, _arg1.params.RationsFound);
}
public function pauseToggle(_arg1:MouseEvent):void{
GamePause();
}
function frame306(){
skipm.addEventListener(MouseEvent.CLICK, SkipMovie);
}
function frame1212(){
stop();
setupAndStart();
gui_Pause.addEventListener(MouseEvent.CLICK, MovieClip(root).pauseToggle);
gui_Pause.addEventListener(MouseEvent.MOUSE_OVER, MovieClip(root).ignoreClicking);
gui_Pause.addEventListener(MouseEvent.MOUSE_OUT, MovieClip(root).resumeClicking);
gui_Mute.addEventListener(MouseEvent.CLICK, MovieClip(root).muteToggle);
gui_Mute.addEventListener(MouseEvent.MOUSE_OVER, MovieClip(root).ignoreClicking);
gui_Mute.addEventListener(MouseEvent.MOUSE_OUT, MovieClip(root).resumeClicking);
gui_Mute.buttonMode = true;
gui_Pause.buttonMode = true;
day.text = String(("Day:" + MovieClip(root).nightNum));
sponsor.buttonMode = true;
sponsor.addEventListener(MouseEvent.MOUSE_DOWN, function (_arg1:MouseEvent):void{
addy = new URLRequest("http://www.dragongamez.com/");
navigateToURL(addy, "_blank");
});
}
function frame1211(){
stop();
contents = new MovieClip();
addChild(contents);
MovieClip(root).checkWeaponsAvailable();
if (MovieClip(root).Primary == null){
setPrimary("Pistol_wep");
};
if (MovieClip(root).Primary != null){
Primary_sel.gotoAndStop(MovieClip(root).Primary.NAME);
};
if (MovieClip(root).Secondary != null){
Secondary_sel.gotoAndStop(MovieClip(root).Secondary.NAME);
};
UpdateGunWindow();
}
function frame1214(){
ctnbtn.addEventListener(MouseEvent.CLICK, returnToMenu);
}
public function GamePause():void{
var _local1:int;
if (GameState == "Play"){
GameState = "Paused";
gui_Pause.gotoAndStop("Play");
_local1 = (aiMgr.aiArray.length - 1);
while (_local1 > -1) {
if ((((aiMgr.aiArray[_local1] is StandardWolf)) || ((aiMgr.aiArray[_local1] is Dog)))){
aiMgr.aiArray[_local1].HIDE.stop();
} else {
if ((aiMgr.aiArray[_local1] is Player)){
aiMgr.aiArray[_local1].stop();
};
};
aiMgr.aiArray[_local1].currentAnim = "Paused";
_local1--;
};
} else {
if (GameState == "Paused"){
GameState = "Play";
_local1 = (aiMgr.aiArray.length - 1);
while (_local1 > -1) {
if ((((aiMgr.aiArray[_local1] is StandardWolf)) || ((aiMgr.aiArray[_local1] is Dog)))){
aiMgr.aiArray[_local1].HIDE.play();
} else {
if ((aiMgr.aiArray[_local1] is Player)){
aiMgr.aiArray[_local1].play();
};
};
_local1--;
};
gui_Pause.gotoAndStop("Pause");
};
};
}
function frame1213(){
ctn_gameover.addEventListener(MouseEvent.CLICK, gotoMainMenuFromGameOver);
dragon_games.addEventListener(MouseEvent.MOUSE_DOWN, function (_arg1:MouseEvent):void{
addy1 = new URLRequest("http://www.dragongamez.com/");
navigateToURL(addy1, "_blank");
});
dragon_games.buttomMode = true;
}
private function nightOver():void{
var box:Shape;
var bcount:int;
var blur:Function;
blur = function (_arg1:Event){
bcount++;
if (bcount == 3){
bcount = 0;
box.alpha = (box.alpha + 0.1);
};
if (box.alpha >= 1){
box.removeEventListener(Event.ENTER_FRAME, blur);
removeChild(box);
projectileMgr.removeAll();
aiMgr.removeAllCorpse();
aiMgr.removeAllUnits();
if (nightNum == 14){
gotoAndStop(1, "End Game");
return;
};
gotoAndStop(1, "Weapon Select");
nightNum++;
newSearchWindow();
};
};
box = new Shape();
box.graphics.beginFill(0, 1);
box.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
box.graphics.endFill();
box.alpha = 0;
addChild(box);
box.addEventListener(Event.ENTER_FRAME, blur);
bcount = 0;
}
public function createUpgradeMenu(_arg1:MouseEvent):void{
newUpgradeWindow();
}
private function newDepthControl(_arg1:MovieClip){
var _local2:int;
var _local3:int;
var _local4:*;
_local2 = gamelevel.getChildIndex(_arg1);
while (_local3 < (gamelevel.numChildren - 1)) {
_local4 = gamelevel.getChildAt(_local3);
if ((((((((_local4 is Player)) || ((_local4 is StandardWolf)))) || ((_local4 is Dog)))) || ((_local4 is Barricade)))){
if (_local4.y < _arg1.y){
if (gamelevel.getChildIndex(_arg1) < _local3){
gamelevel.setChildIndex(_arg1, (_local3 + 1));
};
};
if (_local4.y > _arg1.y){
if (gamelevel.getChildIndex(_arg1) > _local3){
gamelevel.setChildIndex(_arg1, _local3);
};
};
};
_local3++;
};
}
function frame1215(){
skpbtn.addEventListener(MouseEvent.CLICK, SkipCred);
}
public function upgradeWindow(_arg1:MouseEvent):void{
newUpgradeWindow();
}
public function setSecondary(_arg1:String):void{
switch (_arg1){
case "Pistol_wep":
MovieClip(root).Secondary = MovieClip(root).pistol;
break;
case "Remington_wep":
MovieClip(root).Secondary = MovieClip(root).remington;
break;
case "mp5_wep":
MovieClip(root).Secondary = MovieClip(root).mp5;
break;
case "revolver_wep":
MovieClip(root).Secondary = MovieClip(root).revolver;
break;
case "crossbow_wep":
MovieClip(root).Secondary = MovieClip(root).crossbow;
break;
case "uzi_wep":
MovieClip(root).Secondary = MovieClip(root).uzi;
break;
case "carbine_wep":
MovieClip(root).Secondary = MovieClip(root).carbine;
break;
case "m16_wep":
MovieClip(root).Secondary = MovieClip(root).m16;
break;
case "g3_wep":
MovieClip(root).Secondary = MovieClip(root).g3;
break;
case "sawedoff_wep":
MovieClip(root).Secondary = MovieClip(root).sawedoff;
break;
default:
break;
};
Secondary_sel.gotoAndStop(MovieClip(root).Secondary.NAME);
}
private function fireGun():void{
var _local1:*;
var _local2:int;
var _local3:Point;
var _local4:Bullet;
var _local5:MuzzleFlash;
if (((!(ignoreClick)) && ((GameState == "Play")))){
_local1 = (Math.atan2((mouseY - (player.y - playerAdjustment)), (mouseX - player.x)) * (180 / Math.PI));
if ((((Math.abs(_local1) > 10)) && ((player.scaleX == 1)))){
_local1 = ((_local1 / Math.abs(_local1)) * 10);
};
_local2 = ActiveWeapon.SHOTS_FIRED;
while (_local2 > 0) {
_local3 = new Point(player.r_arm.player_weapon.gun_node.x, player.r_arm.player_weapon.gun_node.y);
_local3 = player.r_arm.localToGlobal(_local3);
_local4 = ActiveWeapon.fireWeapon(_local3.x, _local3.y, _local1);
_local5 = new MuzzleFlash(player.r_arm.player_weapon.gun_node.x, player.r_arm.player_weapon.gun_node.y);
if (_local4 != null){
projectileMgr.projectileArray.push(_local4);
partMgr.particleArray.push(_local5);
player.r_arm.player_weapon.addChild(_local5);
gamelevel.addChild(_local4);
player.r_arm.gotoAndPlay(ActiveWeapon.fireAnim);
player.l_arm.gotoAndPlay(ActiveWeapon.fireAnim);
this.dispatchEvent(new CustomEvent(CustomEvent.UPDATE));
ActiveWeapon.playSound();
};
_local2--;
};
};
}
public function loading(_arg1:Event){
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = stage.loaderInfo.bytesTotal;
_local3 = stage.loaderInfo.bytesLoaded;
_local4 = Math.round(((_local3 * 100) / _local2));
percText.text = String(_local4);
if (_local3 >= _local2){
removeEventListener(Event.ENTER_FRAME, loading);
nextScene();
};
}
function frame211(){
stage.removeEventListener(MouseEvent.CLICK, gotoHC);
}
public function setPrimary(_arg1:String):void{
switch (_arg1){
case "Pistol_wep":
MovieClip(root).Primary = MovieClip(root).pistol;
break;
case "Remington_wep":
MovieClip(root).Primary = MovieClip(root).remington;
break;
case "mp5_wep":
MovieClip(root).Primary = MovieClip(root).mp5;
break;
case "revolver_wep":
MovieClip(root).Primary = MovieClip(root).revolver;
break;
case "crossbow_wep":
MovieClip(root).Primary = MovieClip(root).crossbow;
break;
case "uzi_wep":
MovieClip(root).Primary = MovieClip(root).uzi;
break;
case "carbine_wep":
MovieClip(root).Primary = MovieClip(root).carbine;
break;
case "m16_wep":
MovieClip(root).Primary = MovieClip(root).m16;
break;
case "g3_wep":
MovieClip(root).Primary = MovieClip(root).g3;
break;
case "sawedoff_wep":
MovieClip(root).Primary = MovieClip(root).sawedoff;
break;
default:
break;
};
Primary_sel.gotoAndStop(MovieClip(root).Primary.NAME);
}
private function EndGame():void{
var box:Shape;
var bcount:int;
var blur:Function;
blur = function (_arg1:Event){
bcount++;
if (bcount == 3){
bcount = 0;
box.alpha = (box.alpha + 0.1);
};
if (box.alpha >= 1){
box.removeEventListener(Event.ENTER_FRAME, blur);
removeChild(box);
gotoAndStop(1, "Game Over");
player.Alive = true;
colMgr.wallBroken = false;
colMgr.runOnce = true;
BarricadeHealth = 100;
nightNum = 1;
pistol = new Pistol();
revolver = new Revolver();
crossbow = new Crossbow();
uzi = new Uzi();
mp5 = new MP5();
sawedoff = new SawedOff();
remington = new Remington();
m16 = new M16();
g3 = new G3();
carbine = new Carbine();
checkWeaponsAvailable();
};
};
RemoveEventListeners();
GameState = "Game Over";
box = new Shape();
box.graphics.beginFill(0x990000, 1);
box.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
box.graphics.endFill();
box.alpha = 0;
addChild(box);
box.addEventListener(Event.ENTER_FRAME, blur);
bcount = 0;
}
public function ignoreClicking(_arg1:MouseEvent):void{
ignoreClick = true;
}
public function DropDownMenu(_arg1:MouseEvent):void{
if (newDD != null){
contents.removeChild(newDD);
};
newDD = new Weapon_DropDownMenu();
newDD.x = mouseX;
newDD.y = mouseY;
contents.addChild(newDD);
weaponID = _arg1.target;
newDD.addEventListener(CustomEvent.TRIGGER_A, ApplyPrimary);
newDD.addEventListener(CustomEvent.TRIGGER_B, ApplySecondary);
}
public function GameMute():void{
if (MutedGame == "Unmute"){
MutedGame = "Mute";
gui_Mute.gotoAndStop("Mute");
sndMgr.stopAllSounds();
sndMgr.disableSound();
} else {
if (MutedGame == "Mute"){
MutedGame = "Unmute";
gui_Mute.gotoAndStop("Unmute");
sndMgr.enableSound();
sndMgr.playSound("Ambiant", 1, 0, 999);
};
};
}
function frame102(){
stage.addEventListener(MouseEvent.CLICK, gotoHC);
}
private function createWolf():void{
var _local1:StandardWolf;
_local1 = new StandardWolf(stage.stageWidth, RandomRange(140, 340), nightNum);
aiMgr.aiArray.push(_local1);
gamelevel.addChild(_local1);
}
public function newUpgradeWindow():void{
upgradeMenu = new Upgrade_Window();
addChild(upgradeMenu);
}
public function newSearchWindow():void{
searchMenu = new Search_Window(Math.ceil(RandomRange(8, 12)), TotalRations, BarricadeHealth, BarricadeTotalHealth, 10);
searchMenu.addEventListener(CustomEvent.WINDOW_CLOSE, destroySearchWindow);
addChild(searchMenu);
}
function frame101(){
stage.removeEventListener(MouseEvent.MOUSE_DOWN, navToSponsor);
}
public function startGame(_arg1:MouseEvent):void{
gotoAndPlay(1, "Cinematic");
MovieClip(root).sndMgr.stopSound("Theme");
MovieClip(root).sndMgr.playSound("Ambiant", 1, 0, 999);
MovieClip(root).sndMgr.playSound("Howl");
}
public function destroyUpgradeWindow():void{
removeChild(upgradeMenu);
}
public function gotoHC(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.hardcircle.com"), "_blank");
}
private function AddEventListeners():void{
stage.addEventListener(MouseEvent.MOUSE_DOWN, MouseClick);
stage.addEventListener(MouseEvent.MOUSE_UP, MouseRelease);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressedDown);
stage.addEventListener(KeyboardEvent.KEY_UP, keyPressRelease);
stage.addEventListener(Event.ENTER_FRAME, loop);
this.addEventListener(CustomEvent.UPDATE, updateInterface);
ActiveWeapon.addEventListener(CustomEvent.UPDATE, updateInterface);
}
public function GotoNextMenu(_arg1:MouseEvent):void{
loading_text.visible = true;
gotoAndStop(2, "Weapon Select");
}
public function SkipCred(_arg1:MouseEvent):void{
skpbtn.removeEventListener(MouseEvent.CLICK, SkipCred);
gotoAndPlay(1, "Intro");
}
public function destroyResultsWindow(_arg1:CustomEvent):void{
TotalScraps = (TotalScraps + _arg1.params.Scraps);
BarricadeHealth = _arg1.params.Health;
gotoAndStop(2, "Weapon Select");
ignoreClick = false;
}
private function MouseRelease(_arg1:MouseEvent):void{
fire = false;
}
public function returnToMenu(_arg1:MouseEvent):void{
gotoAndPlay(1, "Credits");
}
public function ApplySecondary(_arg1:CustomEvent):void{
_arg1.target.removeEventListener(CustomEvent.TRIGGER_A, ApplyPrimary);
_arg1.target.removeEventListener(CustomEvent.TRIGGER_B, ApplySecondary);
setSecondary(weaponID.name);
newDD = null;
}
public function createHTPMenu(_arg1:MouseEvent):void{
var _local2:InstructionsPage;
_local2 = new InstructionsPage();
addChild(_local2);
MovieClip(root).sndMgr.playSound("Click1");
}
private function checkWeaponsAvailable():void{
weaponArray = new Array();
weaponArray.push(pistol);
if (SaveController.Load("Remington")){
weaponArray.push(remington);
};
if (SaveController.Load("MP5")){
weaponArray.push(mp5);
};
if (SaveController.Load("Revolver")){
weaponArray.push(revolver);
};
if (SaveController.Load("SawedOff")){
weaponArray.push(sawedoff);
};
if (SaveController.Load("M16")){
weaponArray.push(m16);
};
if (SaveController.Load("Carbine")){
weaponArray.push(carbine);
};
if (SaveController.Load("Crossbow")){
weaponArray.push(crossbow);
};
if (SaveController.Load("Uzi")){
weaponArray.push(uzi);
};
if (SaveController.Load("G3")){
weaponArray.push(g3);
};
}
public function newResultsWindow(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
resultsMenu = new Results_Window(_arg1, _arg2, _arg4, _arg3);
resultsMenu.addEventListener(CustomEvent.WINDOW_CLOSE, destroyResultsWindow);
addChild(resultsMenu);
}
public function gotoGame(_arg1:MouseEvent):void{
gotoAndStop(1, "Game Screen");
removeChild(contents);
newDD = null;
MovieClip(root).sndMgr.playSound("Howl");
}
}
}//package Game5
Section 14
//MP5 (Game5.MP5)
package Game5 {
public class MP5 extends Gun {
public function MP5(){
ACCURACY = 12;
CAP_ACCURACY = 15;
FIRE_POWER = 1;
CAP_FIRE_POWER = 2;
RELOAD_SPEED = 8;
CAP_RELOAD_SPEED = 12;
RATE_OF_FIRE = 12;
CAP_RATE_OF_FIRE = 16;
CLIP_SIZE = 20;
CAP_CLIP_SIZE = 30;
NUM_IN_CLIP = CLIP_SIZE;
SHOTS_FIRED = 1;
NAME = "MP5";
UPGRADE_COST = 4;
fireAnim = "2h";
}
override public function playSound(){
sndMgr.playSound("Assault");
}
}
}//package Game5
Section 15
//MuzzleFlash (Game5.MuzzleFlash)
package Game5 {
import flash.display.*;
public class MuzzleFlash extends MovieClip {
private var count:int;// = 0
public function MuzzleFlash(_arg1:int, _arg2:int){
count = 0;
super();
addFrameScript(4, frame5);
this.x = _arg1;
this.y = _arg2;
this.alpha = 1;
}
private function RandomRange(_arg1:Number, _arg2:Number){
var _local3:Number;
_local3 = ((Math.random() * (_arg2 - _arg1)) + _arg1);
return (_local3);
}
public function removeMe():void{
parent.removeChild(this);
}
function frame5(){
stop();
}
public function update():void{
count++;
if (count > 2){
this.alpha = (this.alpha - 0.1);
count = 0;
};
}
}
}//package Game5
Section 16
//ParticleManager (Game5.ParticleManager)
package Game5 {
public class ParticleManager {
public var particleArray:Array;
public static var instance:ParticleManager;
private static var allowInstance:Boolean;
public function ParticleManager(){
this.particleArray = new Array();
if (!ParticleManager.allowInstance){
throw (new Error("Only one instance of ParticleManager available"));
};
}
public function updateManager():void{
var _local1:*;
for (_local1 in particleArray) {
particleArray[_local1].update();
if (particleArray[_local1].alpha <= 0.1){
particleArray[_local1].removeMe();
particleArray.splice(_local1, 1);
};
};
}
public function removeAll():void{
var _local1:*;
for (_local1 in particleArray) {
particleArray[_local1].removeMe();
particleArray.splice(_local1, 1);
};
}
public static function getInstance():ParticleManager{
if (ParticleManager.instance == null){
ParticleManager.allowInstance = true;
ParticleManager.instance = new (ParticleManager);
ParticleManager.allowInstance = false;
};
return (ParticleManager.instance);
}
}
}//package Game5
Section 17
//Pistol (Game5.Pistol)
package Game5 {
public class Pistol extends Gun {
public function Pistol(){
ACCURACY = 8;
CAP_ACCURACY = 12;
FIRE_POWER = 3;
CAP_FIRE_POWER = 6;
RELOAD_SPEED = 8;
CAP_RELOAD_SPEED = 12;
RATE_OF_FIRE = 1;
CAP_RATE_OF_FIRE = 5;
CLIP_SIZE = 8;
CAP_CLIP_SIZE = 16;
NUM_IN_CLIP = CLIP_SIZE;
SHOTS_FIRED = 1;
NAME = "Pistol";
UPGRADE_COST = 3;
fireAnim = "1h";
}
override public function playSound(){
sndMgr.playSound("Pistol");
}
}
}//package Game5
Section 18
//Player (Game5.Player)
package Game5 {
import flash.display.*;
public class Player extends MovieClip {
public const SPEED:int = 3;
public const type:Class;
public var l_arm:MovieClip;
public var r_arm:MovieClip;
public var legs:MovieClip;
public var currentAnim:String;// = "None"
private var preCalc:int;
public var Alive:Boolean;// = true
public var newAnim:String;// = "None"
public var head:MovieClip;
public function Player(){
type = Player;
Alive = true;
currentAnim = "None";
newAnim = "None";
super();
l_arm.stop();
r_arm.stop();
head.stop();
legs.stop();
preCalc = (3 * (this.height / 4));
}
public function removeMe():void{
parent.removeChild(this);
}
public static function update(_arg1:Player):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:*;
if (!_arg1.Alive){
return;
};
_local2 = 0;
_local3 = 0;
_arg1.newAnim = "idle";
if (KeyObject.DOWN_W){
_local3 = (_local3 - _arg1.SPEED);
_arg1.newAnim = "strafe";
} else {
if (KeyObject.DOWN_S){
_local3 = (_local3 + _arg1.SPEED);
_arg1.newAnim = "strafe";
};
};
if (KeyObject.DOWN_A){
_local2 = (_local2 - _arg1.SPEED);
_arg1.newAnim = "walk";
} else {
if (KeyObject.DOWN_D){
_local2 = (_local2 + _arg1.SPEED);
_arg1.newAnim = "walk";
};
};
_local4 = (_arg1.x + _local2);
_local5 = (_arg1.y + _local3);
if ((((_local5 > 360)) || ((_local5 < 190)))){
_local5 = _arg1.y;
};
if ((((_local4 > 80)) || ((_local4 < 20)))){
_local4 = _arg1.x;
};
_local6 = (Math.atan2((MovieClip(_arg1.root).mouseY - (_arg1.y - _arg1.preCalc)), (MovieClip(_arg1.root).mouseX - _arg1.x)) * (180 / Math.PI));
if ((((Math.abs(_local6) > 10)) && ((_arg1.scaleX == 1)))){
_local6 = ((_local6 / Math.abs(_local6)) * 10);
};
_arg1.r_arm.rotation = _local6;
_arg1.l_arm.rotation = _local6;
_arg1.head.rotation = _local6;
_arg1.x = _local4;
_arg1.y = _local5;
if (_arg1.newAnim != _arg1.currentAnim){
_arg1.currentAnim = _arg1.newAnim;
_arg1.legs.gotoAndPlay(_arg1.currentAnim);
if (_arg1.currentAnim == "idle"){
_arg1.legs.gotoAndStop(_arg1.currentAnim);
};
};
}
}
}//package Game5
Section 19
//ProjectileManager (Game5.ProjectileManager)
package Game5 {
public class ProjectileManager {
public var projectileArray:Array;
public static var instance:ProjectileManager;
private static var allowInstance:Boolean;
public function ProjectileManager(){
this.projectileArray = new Array();
if (!ProjectileManager.allowInstance){
throw (new Error("Only one instance of ProjectileManager available"));
};
}
public function updateManager():void{
var _local1:*;
for (_local1 in projectileArray) {
projectileArray[_local1].update();
if (projectileArray[_local1].x > 720){
projectileArray[_local1].removeMe();
projectileArray.splice(_local1, 1);
};
};
}
public function removeAll():void{
var _local1:int;
_local1 = (projectileArray.length - 1);
while (_local1 > -1) {
projectileArray[_local1].removeMe();
projectileArray.splice(_local1, 1);
_local1--;
};
}
public static function getInstance():ProjectileManager{
if (ProjectileManager.instance == null){
ProjectileManager.allowInstance = true;
ProjectileManager.instance = new (ProjectileManager);
ProjectileManager.allowInstance = false;
};
return (ProjectileManager.instance);
}
}
}//package Game5
Section 20
//Remington (Game5.Remington)
package Game5 {
public class Remington extends Gun {
public function Remington(){
ACCURACY = 5;
CAP_ACCURACY = 10;
FIRE_POWER = 2;
CAP_FIRE_POWER = 4;
RELOAD_SPEED = 8;
CAP_RELOAD_SPEED = 12;
RATE_OF_FIRE = 1;
CAP_RATE_OF_FIRE = 3;
CLIP_SIZE = 21;
CAP_CLIP_SIZE = 30;
NUM_IN_CLIP = CLIP_SIZE;
SHOTS_FIRED = 3;
NAME = "Remington";
UPGRADE_COST = 5;
fireAnim = "2h";
ignoreROF = true;
}
override public function playSound(){
sndMgr.playSound("Shotgun");
}
override public function increaseClipSize(_arg1:int):void{
if ((CLIP_SIZE + _arg1) <= CAP_CLIP_SIZE){
CLIP_SIZE = (CLIP_SIZE + _arg1);
};
}
}
}//package Game5
Section 21
//Results_Window (Game5.Results_Window)
package Game5 {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class Results_Window extends MovieClip {
public var accept:SimpleButton;
public var foundWeapons:TextField;
private var hp:int;
public var barricade_hp:TextField;
public var scraps:TextField;
private var ration:int;
private var scrap:int;
private var sndMgr:SoundManager;
public var barricade_totalhp:TextField;
public function Results_Window(_arg1:int, _arg2:int, _arg3:int, _arg4:int){
var _local5:int;
sndMgr = SoundManager.getInstance();
super();
setBarricadeHealth(_arg1, _arg2);
setScrapsFound(_arg4);
accept.addEventListener(MouseEvent.CLICK, Accepted);
_local5 = Math.floor(RandomRange(1, 10));
if (_arg4 > 0){
switch (_local5){
case 1:
if (!SaveController.Load("Remington")){
SaveController.Save("Remington");
foundWeapons.text = "Found a Shotgun";
};
break;
case 2:
if (!SaveController.Load("MP5")){
SaveController.Save("MP5");
foundWeapons.text = "Found an MP5";
};
break;
case 3:
if (!SaveController.Load("Revolver")){
SaveController.Save("Revolver");
foundWeapons.text = "Found a Revolver";
};
break;
case 4:
if (!SaveController.Load("SawedOff")){
SaveController.Save("SawedOff");
foundWeapons.text = "Found a Sawed Off";
};
break;
case 5:
if (!SaveController.Load("Carbine")){
SaveController.Save("Carbine");
foundWeapons.text = "Found a Carbine";
};
break;
case 6:
if (!SaveController.Load("Crossbow")){
SaveController.Save("Crossbow");
foundWeapons.text = "Found a Crossbow";
};
break;
case 7:
if (!SaveController.Load("G3")){
SaveController.Save("G3");
foundWeapons.text = "Found a G3";
};
break;
case 8:
if (!SaveController.Load("M16")){
SaveController.Save("M16");
foundWeapons.text = "Found a M16";
};
break;
case 9:
if (!SaveController.Load("Uzi")){
SaveController.Save("Uzi");
foundWeapons.text = "Found an Uzi";
};
break;
};
};
}
private function setBarricadeHealth(_arg1:int, _arg2:int):void{
hp = _arg1;
barricade_hp.text = String(_arg1);
barricade_totalhp.text = String(_arg2);
}
private function RandomRange(_arg1:Number, _arg2:Number){
var _local3:Number;
_local3 = Math.ceil(((Math.random() * (_arg2 - _arg1)) + _arg1));
return (_local3);
}
private function setScrapsFound(_arg1:int):void{
scrap = _arg1;
scraps.text = String(scrap);
}
private function Accepted(_arg1:MouseEvent):void{
dispatchEvent(new CustomEvent(CustomEvent.WINDOW_CLOSE, {Health:hp, Rations:ration, Scraps:scrap}));
parent.removeChild(this);
sndMgr.playSound("Click2");
}
private function setRationsFound(_arg1:int):void{
}
}
}//package Game5
Section 22
//Revolver (Game5.Revolver)
package Game5 {
public class Revolver extends Gun {
public function Revolver(){
ACCURACY = 8;
CAP_ACCURACY = 12;
FIRE_POWER = 4;
CAP_FIRE_POWER = 10;
RELOAD_SPEED = 6;
CAP_RELOAD_SPEED = 12;
RATE_OF_FIRE = 1;
CAP_RATE_OF_FIRE = 3;
CLIP_SIZE = 6;
CAP_CLIP_SIZE = 12;
NUM_IN_CLIP = CLIP_SIZE;
SHOTS_FIRED = 1;
NAME = "Revolver";
UPGRADE_COST = 3;
fireAnim = "1h";
}
override public function playSound(){
sndMgr.playSound("Pistol");
}
}
}//package Game5
Section 23
//SaveController (Game5.SaveController)
package Game5 {
import flash.net.*;
public class SaveController {
public static function Save(_arg1:String):void{
var _local2:SharedObject;
_local2 = SharedObject.getLocal("DragonGam");
_local2.data[("wep_" + _arg1)] = "0";
_local2.flush();
}
public static function Load(_arg1:String):Boolean{
var _local2:SharedObject;
_local2 = SharedObject.getLocal("DragonGam");
if (_local2.data[("wep_" + _arg1)] == undefined){
return (false);
};
return (true);
}
}
}//package Game5
Section 24
//SawedOff (Game5.SawedOff)
package Game5 {
public class SawedOff extends Gun {
public function SawedOff(){
ACCURACY = 3;
CAP_ACCURACY = 8;
FIRE_POWER = 2;
CAP_FIRE_POWER = 5;
RELOAD_SPEED = 8;
CAP_RELOAD_SPEED = 12;
RATE_OF_FIRE = 1;
CAP_RATE_OF_FIRE = 3;
CLIP_SIZE = 6;
CAP_CLIP_SIZE = 12;
NUM_IN_CLIP = CLIP_SIZE;
SHOTS_FIRED = 3;
NAME = "SawedOff";
UPGRADE_COST = 5;
fireAnim = "1h";
ignoreROF = true;
}
override public function playSound(){
sndMgr.playSound("Shotgun");
}
}
}//package Game5
Section 25
//Search_Window (Game5.Search_Window)
package Game5 {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class Search_Window extends MovieClip {
public var accept:SimpleButton;
private var repairRate:int;// = 0
public var barricade_hp:TextField;
private var totalHours:int;
public var barricade_repairs:TextField;
public var repair_per_hour:TextField;
public var barricade_plus:SimpleButton;
public var scrap_plus:SimpleButton;
public var total_hours:TextField;
private var barHealth:int;// = 0
public var scrap_minus:SimpleButton;
public var barricade_minus:SimpleButton;
private var barricadeHours:int;// = 0
public var scraps:TextField;
private var scrapHours:int;// = 0
private var barTotalHealth:int;// = 0
private var rationsHours:int;// = 0
private var sndMgr:SoundManager;
public function Search_Window(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int){
barricadeHours = 0;
repairRate = 0;
rationsHours = 0;
scrapHours = 0;
barTotalHealth = 0;
barHealth = 0;
sndMgr = SoundManager.getInstance();
super();
setTotalHours(_arg1);
setBarricadeHP(_arg3, _arg4);
barTotalHealth = _arg4;
barHealth = _arg3;
setBarricadeRepairRate(_arg5);
barricade_plus.addEventListener(MouseEvent.CLICK, increaseBarricadeRepairHours);
scrap_plus.addEventListener(MouseEvent.CLICK, increaseScrapSearchHours);
scrap_minus.addEventListener(MouseEvent.CLICK, decreaseScrapSearchHours);
barricade_minus.addEventListener(MouseEvent.CLICK, decreaseBarricadeRepairHours);
accept.addEventListener(MouseEvent.CLICK, CloseWindow);
}
public function setBarricadeRepairRate(_arg1:int):void{
repairRate = _arg1;
repair_per_hour.text = String(_arg1);
}
public function setBarricadeHP(_arg1:int, _arg2:int):void{
barricade_hp.text = String(((_arg1 + "/") + _arg2));
}
private function RandomRange(_arg1:Number, _arg2:Number){
var _local3:Number;
_local3 = Math.ceil(((Math.random() * (_arg2 - _arg1)) + _arg1));
return (_local3);
}
public function setTotalHours(_arg1:int):void{
totalHours = _arg1;
total_hours.text = String(totalHours);
}
private function updateWindow():void{
barricade_repairs.text = String(barricadeHours);
scraps.text = String(scrapHours);
total_hours.text = String(totalHours);
}
private function increaseScrapSearchHours(_arg1:MouseEvent):void{
if (totalHours == 0){
return;
};
scrapHours++;
totalHours--;
updateWindow();
sndMgr.playSound("Click1");
}
public function foodPenalty(_arg1:int):void{
}
private function decreaseScrapSearchHours(_arg1:MouseEvent):void{
if (scrapHours == 0){
return;
};
scrapHours--;
totalHours++;
updateWindow();
sndMgr.playSound("Click2");
}
private function decreaseRationSearchHours(_arg1:MouseEvent):void{
if (rationsHours == 0){
return;
};
rationsHours--;
totalHours++;
updateWindow();
sndMgr.playSound("Click2");
}
private function decreaseBarricadeRepairHours(_arg1:MouseEvent):void{
if (barricadeHours == 0){
return;
};
barricadeHours--;
totalHours++;
updateWindow();
sndMgr.playSound("Click2");
}
private function increaseBarricadeRepairHours(_arg1:MouseEvent):void{
if (totalHours == 0){
return;
};
barricadeHours++;
totalHours--;
updateWindow();
sndMgr.playSound("Click1");
}
private function increaseRationSearchHours(_arg1:MouseEvent):void{
if (totalHours == 0){
return;
};
rationsHours++;
totalHours--;
updateWindow();
sndMgr.playSound("Click1");
}
private function CloseWindow(_arg1:MouseEvent):void{
var _local2:int;
var _local3:int;
var _local4:int;
x = scrapHours;
while (x >= 0) {
_local2 = RandomRange(0, 2);
if (_local2 == 2){
_local3 = (_local3 + 5);
};
x--;
};
_local3 = Math.ceil(_local3);
_local4 = ((barricadeHours * repairRate) + barHealth);
if (_local4 > barTotalHealth){
_local4 = barTotalHealth;
};
dispatchEvent(new CustomEvent(CustomEvent.WINDOW_CLOSE, {RepairValue:_local4, BarricadeTotal:barTotalHealth, ScrapsFound:_local3}));
parent.removeChild(this);
sndMgr.playSound("Click2");
}
}
}//package Game5
Section 26
//SoundManager (Game5.SoundManager)
package Game5 {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
public class SoundManager {
private var _sounds:Array;
private var _soundsDict:Dictionary;
private static var NumSounds:int = 0;
private static var _instance:SoundManager;
private static var disableSounds:Boolean = false;
private static var MaxNumSound:int = 20;
private static var _allowInstance:Boolean;
public function SoundManager(){
this._soundsDict = new Dictionary(true);
this._sounds = new Array();
if (!SoundManager._allowInstance){
throw (new Error("Error:Only 1 instance of SoundManager necessary"));
};
}
private function FreeSoundChannel(_arg1:Event):void{
NumSounds--;
}
public function toggleEnableSounds():void{
disableSounds = !(disableSounds);
}
public function enableSound():void{
disableSounds = false;
}
public function SoundLimit(_arg1:uint):void{
MaxNumSound = _arg1;
}
public function stopAllSounds(_arg1:Boolean=true):void{
var _local2:int;
var _local3:String;
_local2 = 0;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (!this._soundsDict[_local3].paused){
this._soundsDict[_local3].pausedByAll = true;
this.stopSound(_local3);
};
} else {
this.stopSound(_local3);
};
_local2++;
};
}
public function muteAllSounds():void{
var _local1:int;
var _local2:String;
_local1 = 0;
while (_local1 < this._sounds.length) {
_local2 = this._sounds[_local1].name;
this.setSoundVolume(_local2, 0);
_local1++;
};
}
public function stopSound(_arg1:String):void{
var _local2:Object;
_local2 = this._soundsDict[_arg1];
_local2.paused = true;
_local2.channel.stop();
_local2.position = _local2.channel.position;
}
public function disableSound():void{
disableSounds = true;
}
public function addLibrarySound(_arg1, _arg2:String):Boolean{
var _local3:int;
var _local4:Object;
var _local5:Sound;
_local3 = 0;
while (_local3 < this._sounds.length) {
if (this._sounds[_local3].name == _arg2){
return (false);
};
_local3++;
};
_local4 = new Object();
_local5 = new (_arg1);
_local4.name = _arg2;
_local4.sound = _local5;
_local4.channel = new SoundChannel();
_local4.position = 0;
_local4.paused = true;
_local4.volume = 1;
_local4.startTime = 0;
_local4.loops = 0;
_local4.pausedByAll = false;
this._soundsDict[_arg2] = _local4;
this._sounds.push(_local4);
return (true);
}
public function setSoundVolume(_arg1:String, _arg2:Number):void{
var _local3:Object;
var _local4:SoundTransform;
_local3 = this._soundsDict[_arg1];
_local4 = _local3.channel.soundTransform;
_local4.volume = _arg2;
_local3.channel.soundTransform = _local4;
}
public function getSoundObject(_arg1:String):Sound{
return (this._soundsDict[_arg1].sound);
}
public function unmuteAllSounds():void{
var _local1:int;
var _local2:String;
var _local3:Object;
var _local4:SoundTransform;
_local1 = 0;
while (_local1 < this._sounds.length) {
_local2 = this._sounds[_local1].name;
_local3 = this._soundsDict[_local2];
_local4 = _local3.channel.soundTransform;
_local4.volume = _local3.volume;
_local3.channel.soundTransform = _local4;
_local1++;
};
}
public function playSound(_arg1:String, _arg2:Number=1, _arg3:Number=0, _arg4:int=0):void{
var _local5:Object;
if ((((NumSounds >= MaxNumSound)) || (disableSounds))){
return;
};
NumSounds++;
_local5 = this._soundsDict[_arg1];
_local5.volume = _arg2;
_local5.startTime = _arg3;
_local5.loops = _arg4;
if (_local5.paused){
_local5.channel = _local5.sound.play(_local5.position, _local5.loops, new SoundTransform(_local5.volume));
} else {
_local5.channel = _local5.sound.play(_arg3, _local5.loops, new SoundTransform(_local5.volume));
};
_local5.paused = false;
_local5.channel.addEventListener(Event.SOUND_COMPLETE, FreeSoundChannel);
}
public function toString():String{
return (getQualifiedClassName(this));
}
public static function getInstance():SoundManager{
if (SoundManager._instance == null){
SoundManager._allowInstance = true;
SoundManager._instance = new (SoundManager);
SoundManager._allowInstance = false;
};
return (SoundManager._instance);
}
}
}//package Game5
Section 27
//StandardWolf (Game5.StandardWolf)
package Game5 {
import flash.display.*;
public class StandardWolf extends Wolf {
public function StandardWolf(_arg1:int, _arg2:int, _arg3:int){
var _local4:int;
var _local5:int;
var _local6:*;
super();
STRENGTH = 1;
if (_arg3 > 3){
STRENGTH = 1;
};
if (_arg3 > 6){
STRENGTH = 2;
};
if (_arg3 > 9){
STRENGTH = 3;
};
if (_arg3 > 12){
STRENGTH = 4;
};
if (_arg3 > 15){
STRENGTH = 6;
};
if (_arg3 > 18){
STRENGTH = 6;
};
if (Math.floor(RandomRange(1, 6)) == 4){
SPEED = 10;
};
if (Math.floor(RandomRange(1, 4)) == 3){
SPEED = (SPEED + 2);
};
HEALTH = (5 + (_arg3 * 1.5));
HIDE = new Enemy();
this.addChild(HIDE);
this.x = _arg1;
this.y = _arg2;
setAttackPoint(0, _arg2);
_local4 = Math.floor(RandomRange(1, 31));
_local5 = (HIDE.numChildren - 1);
while (_local5 > -1) {
_local6 = HIDE.getChildAt(_local5);
_local6.gotoAndStop(_local4);
_local5--;
};
HIDE.addEventListener(CustomEvent.ATTACK, dealDamage);
HIDE.scaleX = RandomRange(0.8, 1);
HIDE.scaleY = HIDE.scaleX;
}
private function dealDamage(_arg1:CustomEvent):void{
MovieClip(root).BarricadeHealth = (MovieClip(root).BarricadeHealth - STRENGTH);
MovieClip(root).dispatchEvent(new CustomEvent(CustomEvent.UPDATE));
}
}
}//package Game5
Section 28
//Uzi (Game5.Uzi)
package Game5 {
public class Uzi extends Gun {
public function Uzi(){
ACCURACY = 7;
CAP_ACCURACY = 10;
FIRE_POWER = 1;
CAP_FIRE_POWER = 3;
RELOAD_SPEED = 8;
CAP_RELOAD_SPEED = 12;
RATE_OF_FIRE = 10;
CAP_RATE_OF_FIRE = 16;
CLIP_SIZE = 30;
CAP_CLIP_SIZE = 50;
NUM_IN_CLIP = CLIP_SIZE;
SHOTS_FIRED = 1;
NAME = "Uzi";
UPGRADE_COST = 4;
fireAnim = "1h";
}
override public function playSound(){
sndMgr.playSound("Pistol");
}
}
}//package Game5
Section 29
//Wolf (Game5.Wolf)
package Game5 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class Wolf extends MovieClip {
private var foundY:Boolean;// = false
protected var humanTarget:Player;
private var foundX:Boolean;// = false
protected var SPEED:int;// = 2
public var currentAnim:String;// = "None"
private var wallBroken:Boolean;// = false
protected var STRENGTH:int;// = 2
public var HEALTH:int;
private var dead:Boolean;// = false
public var attackPoint:Point;
public var type:Class;
private var Attacking:Boolean;// = false
public var HIDE:MovieClip;
public var newAnim:String;// = "None"
private var externalForce:int;
private var sndMgr:SoundManager;
public function Wolf(){
type = Wolf;
Attacking = false;
SPEED = 2;
STRENGTH = 2;
foundX = false;
foundY = false;
wallBroken = false;
dead = false;
currentAnim = "None";
newAnim = "None";
sndMgr = SoundManager.getInstance();
super();
this.addEventListener(CustomEvent.TRIGGER_A, FindPlayer);
this.addEventListener(CustomEvent.TRIGGER_B, FindWallAttackPoint);
this.addEventListener(CustomEvent.ON_HIT, TakeAHit);
}
private function mayAttack(_arg1:TimerEvent):void{
Attacking = false;
}
private function FindPlayer(_arg1:CustomEvent):void{
var _local2:Array;
var _local3:*;
wallBroken = true;
SPEED = 2;
newAnim = "walk";
_local2 = AIManager.instance.aiArray;
for (_local3 in _local2) {
if (_local2[_local3].type == Player){
humanTarget = _local2[_local3];
setAttackPoint((humanTarget.x + (humanTarget.width / 2)), humanTarget.y);
return;
};
};
}
protected function RandomRange(_arg1:Number, _arg2:Number){
var _local3:Number;
_local3 = ((Math.random() * (_arg2 - _arg1)) + _arg1);
return (_local3);
}
public function removeMe():void{
parent.removeChild(this);
}
public function StartAttack():void{
var _local1:int;
var _local2:Timer;
if (Attacking){
return;
};
newAnim = "idle";
_local1 = Math.floor(RandomRange(1, 4));
HIDE.gotoAndPlay(("attack_" + _local1));
sndMgr.playSound(("attack_" + _local1));
Attacking = true;
_local2 = new Timer(1000, 1);
_local2.addEventListener(TimerEvent.TIMER_COMPLETE, mayAttack);
_local2.start();
}
public function setAttackPoint(_arg1:int, _arg2:int):void{
attackPoint = new Point(_arg1, _arg2);
}
private function FindMoveDirection(){
var _local1:Number;
var _local2:Number;
_local1 = (attackPoint.x - this.x);
_local2 = (attackPoint.y - this.y);
return ((Math.atan2(_local2, _local1) * (180 / Math.PI)));
}
protected function uniqueAbilities():void{
}
private function TakeAHit(_arg1:CustomEvent):void{
this.HEALTH = (this.HEALTH - _arg1.params.dmg);
externalForce = (_arg1.params.dmg * 3);
if (this.HEALTH <= 0){
if (_arg1.params.hs){
this.HIDE.head.head.gotoAndStop(2);
this.HEALTH = (this.HEALTH - _arg1.params.dmg);
};
KillWolf();
};
}
private function FindWallAttackPoint(_arg1:CustomEvent):void{
this.removeEventListener(CustomEvent.TRIGGER_B, FindWallAttackPoint);
setAttackPoint(240, RandomRange(150, 360));
if (Math.floor(RandomRange(1, 3)) == 2){
if (SPEED < 10){
SPEED = (SPEED + 10);
};
};
foundX = false;
foundY = false;
}
private function KillWolf():void{
var _local1:int;
_local1 = Math.floor(RandomRange(1, 4));
HIDE.gotoAndPlay(("death_" + _local1));
sndMgr.playSound(String(("Death_" + _local1)));
AIManager.instance.removeUnit(this);
this.dead = true;
}
public static function update(_arg1:Wolf):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (_arg1.dead){
return;
};
if (!_arg1.Attacking){
if (_arg1.SPEED == 0){
_arg1.newAnim = "idle";
} else {
if (_arg1.SPEED <= 4){
_arg1.newAnim = "walk";
} else {
if (_arg1.SPEED > 4){
_arg1.newAnim = "run";
};
};
};
};
if (_arg1.wallBroken){
_arg1.foundX = false;
_arg1.foundY = false;
};
if (_arg1.x <= 500){
_arg1.dispatchEvent(new CustomEvent(CustomEvent.TRIGGER_B));
};
_local2 = 0;
_local3 = 0;
if (!_arg1.foundX){
_local2 = (_arg1.SPEED * Math.cos((_arg1.FindMoveDirection() * (Math.PI / 180))));
};
if (!_arg1.foundY){
_local3 = (_arg1.SPEED * Math.sin((_arg1.FindMoveDirection() * (Math.PI / 180))));
};
_arg1.foundX = false;
_arg1.foundY = false;
_local4 = ((_arg1.x + _local2) + _arg1.externalForce);
_local5 = (_arg1.y + _local3);
_arg1.externalForce = 0;
if (Math.ceil(_local4) <= (_arg1.attackPoint.x + 5)){
_local2 = 0;
_arg1.foundX = true;
_arg1.StartAttack();
_arg1.SPEED = 1;
};
if (Math.ceil(_local5) == _arg1.attackPoint.y){
_local3 = 0;
_arg1.foundY = true;
_arg1.foundY = true;
};
_arg1.x = _local4;
_arg1.y = _local5;
if (_arg1.newAnim != _arg1.currentAnim){
_arg1.currentAnim = _arg1.newAnim;
_arg1.HIDE.gotoAndPlay(_arg1.currentAnim);
if (_arg1.currentAnim == "idle"){
_arg1.HIDE.gotoAndStop(_arg1.currentAnim);
};
};
}
}
}//package Game5
Section 30
//BloodSpray_110 (Sonata_fla.BloodSpray_110)
package Sonata_fla {
import flash.display.*;
public dynamic class BloodSpray_110 extends MovieClip {
public function BloodSpray_110(){
addFrameScript(77, frame78);
}
function frame78(){
stop();
}
}
}//package Sonata_fla
Section 31
//dustCloud_69 (Sonata_fla.dustCloud_69)
package Sonata_fla {
import flash.display.*;
public dynamic class dustCloud_69 extends MovieClip {
public function dustCloud_69(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package Sonata_fla
Section 32
//eyes_17 (Sonata_fla.eyes_17)
package Sonata_fla {
import flash.display.*;
public dynamic class eyes_17 extends MovieClip {
public function eyes_17(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package Sonata_fla
Section 33
//GUI_MUTE_44 (Sonata_fla.GUI_MUTE_44)
package Sonata_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public dynamic class GUI_MUTE_44 extends MovieClip {
public var pauseBox:TextField;
public function GUI_MUTE_44(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.addEventListener(MouseEvent.ROLL_OVER, addMuteTip);
this.addEventListener(MouseEvent.ROLL_OUT, removeMuteTip);
}
public function removeMuteTip(_arg1:MouseEvent):void{
this.removeChild(pauseBox);
}
public function addMuteTip(_arg1:MouseEvent):void{
pauseBox = new TextField();
pauseBox.x = mouseX;
pauseBox.y = mouseY;
pauseBox.textColor = 0;
pauseBox.border = true;
pauseBox.borderColor = 0;
pauseBox.background = true;
pauseBox.backgroundColor = 16777164;
pauseBox.autoSize = TextFieldAutoSize.LEFT;
this.addChild(pauseBox);
pauseBox.text = "Mute";
}
}
}//package Sonata_fla
Section 34
//GUI_PAUSE_43 (Sonata_fla.GUI_PAUSE_43)
package Sonata_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public dynamic class GUI_PAUSE_43 extends MovieClip {
public var pauseBox:TextField;
public function GUI_PAUSE_43(){
addFrameScript(0, frame1);
}
public function removePauseTip(_arg1:MouseEvent):void{
this.removeChild(pauseBox);
}
function frame1(){
stop();
this.addEventListener(MouseEvent.ROLL_OVER, addPauseTip);
this.addEventListener(MouseEvent.ROLL_OUT, removePauseTip);
}
public function addPauseTip(_arg1:MouseEvent):void{
pauseBox = new TextField();
pauseBox.x = mouseX;
pauseBox.y = mouseY;
pauseBox.textColor = 0;
pauseBox.border = true;
pauseBox.borderColor = 0;
pauseBox.background = true;
pauseBox.backgroundColor = 16777164;
pauseBox.autoSize = TextFieldAutoSize.LEFT;
this.addChild(pauseBox);
pauseBox.text = "Pause";
}
}
}//package Sonata_fla
Section 35
//head_108 (Sonata_fla.head_108)
package Sonata_fla {
import flash.display.*;
public dynamic class head_108 extends MovieClip {
public var head:MovieClip;
}
}//package Sonata_fla
Section 36
//logo_2 (Sonata_fla.logo_2)
package Sonata_fla {
import flash.display.*;
public dynamic class logo_2 extends MovieClip {
public function logo_2(){
addFrameScript(87, frame88);
}
function frame88(){
stop();
}
}
}//package Sonata_fla
Section 37
//player_arms_38 (Sonata_fla.player_arms_38)
package Sonata_fla {
import flash.display.*;
public dynamic class player_arms_38 extends MovieClip {
public var player_weapon:MovieClip;
public function player_arms_38(){
addFrameScript(8, frame9, 16, frame17);
}
function frame17(){
gotoAndStop("2h");
}
function frame9(){
gotoAndStop("1h");
}
}
}//package Sonata_fla
Section 38
//player_Left_arm_36 (Sonata_fla.player_Left_arm_36)
package Sonata_fla {
import flash.display.*;
public dynamic class player_Left_arm_36 extends MovieClip {
public function player_Left_arm_36(){
addFrameScript(8, frame9, 16, frame17);
}
function frame17(){
gotoAndStop("2h");
}
function frame9(){
gotoAndStop("1h");
}
}
}//package Sonata_fla
Section 39
//player_legs_37 (Sonata_fla.player_legs_37)
package Sonata_fla {
import flash.display.*;
public dynamic class player_legs_37 extends MovieClip {
public function player_legs_37(){
addFrameScript(25, frame26, 45, frame46);
}
function frame26(){
gotoAndPlay("walk");
}
function frame46(){
gotoAndPlay("strafe");
}
}
}//package Sonata_fla
Section 40
//player_weapons_39 (Sonata_fla.player_weapons_39)
package Sonata_fla {
import flash.display.*;
public dynamic class player_weapons_39 extends MovieClip {
public var gun_node:MovieClip;
public function player_weapons_39(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Sonata_fla
Section 41
//TestLevel_33 (Sonata_fla.TestLevel_33)
package Sonata_fla {
import Game5.*;
import flash.display.*;
public dynamic class TestLevel_33 extends MovieClip {
public var BarricadeMC:Barricade;
public var player:Player;
}
}//package Sonata_fla
Section 42
//Upgrade_Slider_90 (Sonata_fla.Upgrade_Slider_90)
package Sonata_fla {
import flash.display.*;
public dynamic class Upgrade_Slider_90 extends MovieClip {
public function Upgrade_Slider_90(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Sonata_fla
Section 43
//Upgrade_Temp_Slider_89 (Sonata_fla.Upgrade_Temp_Slider_89)
package Sonata_fla {
import flash.display.*;
public dynamic class Upgrade_Temp_Slider_89 extends MovieClip {
public function Upgrade_Temp_Slider_89(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Sonata_fla
Section 44
//Upgrade_Weapons_88 (Sonata_fla.Upgrade_Weapons_88)
package Sonata_fla {
import flash.display.*;
public dynamic class Upgrade_Weapons_88 extends MovieClip {
public function Upgrade_Weapons_88(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Sonata_fla
Section 45
//WeaponSelect_32 (Sonata_fla.WeaponSelect_32)
package Sonata_fla {
import flash.display.*;
public dynamic class WeaponSelect_32 extends MovieClip {
public function WeaponSelect_32(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Sonata_fla
Section 46
//wolf_head_black_111 (Sonata_fla.wolf_head_black_111)
package Sonata_fla {
import flash.display.*;
public dynamic class wolf_head_black_111 extends MovieClip {
public function wolf_head_black_111(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Sonata_fla
Section 47
//wolf_head_brown_109 (Sonata_fla.wolf_head_brown_109)
package Sonata_fla {
import flash.display.*;
public dynamic class wolf_head_brown_109 extends MovieClip {
public function wolf_head_brown_109(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Sonata_fla
Section 48
//wolf_head_white_112 (Sonata_fla.wolf_head_white_112)
package Sonata_fla {
import flash.display.*;
public dynamic class wolf_head_white_112 extends MovieClip {
public function wolf_head_white_112(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Sonata_fla
Section 49
//ambiant_backdrop (ambiant_backdrop)
package {
import flash.media.*;
public dynamic class ambiant_backdrop extends Sound {
}
}//package
Section 50
//Barricade (Barricade)
package {
import flash.display.*;
public dynamic class Barricade extends MovieClip {
public function Barricade(){
addFrameScript(0, frame1, 5, frame6);
}
function frame6(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 51
//btn_click (btn_click)
package {
import flash.media.*;
public dynamic class btn_click extends Sound {
}
}//package
Section 52
//btn_click2 (btn_click2)
package {
import flash.media.*;
public dynamic class btn_click2 extends Sound {
}
}//package
Section 53
//Canine (Canine)
package {
import Game5.*;
import flash.display.*;
public dynamic class Canine extends MovieClip {
public function Canine(){
addFrameScript(0, frame1, 13, frame14, 23, frame24, 26, frame27, 37, frame38);
}
function frame14(){
gotoAndPlay("run");
}
function frame1(){
}
function frame24(){
dispatchEvent(new CustomEvent(CustomEvent.ATTACK));
}
function frame27(){
gotoAndStop("idle");
}
function frame38(){
stop();
}
}
}//package
Section 54
//CreditsPage (CreditsPage)
package {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.geom.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class CreditsPage extends MovieClip {
public var credits_accept:SimpleButton;
public function CreditsPage(){
addFrameScript(0, frame1);
}
public function removeMe(_arg1:MouseEvent):void{
MovieClip(root).sndMgr.playSound("Click2");
parent.removeChild(this);
}
function frame1(){
credits_accept.addEventListener(MouseEvent.CLICK, removeMe);
}
}
}//package
Section 55
//Crosshairs (Crosshairs)
package {
import flash.display.*;
public dynamic class Crosshairs extends MovieClip {
}
}//package
Section 56
//Enemy (Enemy)
package {
import Game5.*;
import flash.display.*;
public dynamic class Enemy extends MovieClip {
public var body:MovieClip;
public var head:MovieClip;
public function Enemy(){
addFrameScript(0, frame1, 25, frame26, 42, frame43, 53, frame54, 62, frame63, 71, frame72, 80, frame81, 92, frame93, 100, frame101, 120, frame121, 140, frame141, 159, frame160);
}
function frame72(){
dispatchEvent(new CustomEvent(CustomEvent.ATTACK));
}
function frame160(){
stop();
}
function frame81(){
gotoAndStop("idle");
}
function frame93(){
dispatchEvent(new CustomEvent(CustomEvent.ATTACK));
}
function frame1(){
stop();
}
function frame26(){
gotoAndPlay("walk");
}
function frame101(){
gotoAndStop("idle");
}
function frame43(){
gotoAndPlay("run");
}
function frame121(){
stop();
}
function frame54(){
dispatchEvent(new CustomEvent(CustomEvent.ATTACK));
}
function frame141(){
stop();
}
function frame63(){
gotoAndStop("idle");
}
}
}//package
Section 57
//InstructionsPage (InstructionsPage)
package {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.geom.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class InstructionsPage extends MovieClip {
public var htp_close:SimpleButton;
public function InstructionsPage(){
addFrameScript(0, frame1);
}
public function removeMe(_arg1:MouseEvent):void{
MovieClip(root).sndMgr.playSound("Click2");
parent.removeChild(this);
}
function frame1(){
htp_close.addEventListener(MouseEvent.CLICK, removeMe);
}
}
}//package
Section 58
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 59
//Moonlight_Sonata_Theme (Moonlight_Sonata_Theme)
package {
import flash.media.*;
public dynamic class Moonlight_Sonata_Theme extends Sound {
}
}//package
Section 60
//sfx_arrow (sfx_arrow)
package {
import flash.media.*;
public dynamic class sfx_arrow extends Sound {
}
}//package
Section 61
//sfx_AssualtGood (sfx_AssualtGood)
package {
import flash.media.*;
public dynamic class sfx_AssualtGood extends Sound {
}
}//package
Section 62
//sfx_barricade_collapse (sfx_barricade_collapse)
package {
import flash.media.*;
public dynamic class sfx_barricade_collapse extends Sound {
}
}//package
Section 63
//sfx_pistol (sfx_pistol)
package {
import flash.media.*;
public dynamic class sfx_pistol extends Sound {
}
}//package
Section 64
//sfx_shotgun (sfx_shotgun)
package {
import flash.media.*;
public dynamic class sfx_shotgun extends Sound {
}
}//package
Section 65
//sfx_wolf_death1 (sfx_wolf_death1)
package {
import flash.media.*;
public dynamic class sfx_wolf_death1 extends Sound {
}
}//package
Section 66
//sfx_wolf_death2 (sfx_wolf_death2)
package {
import flash.media.*;
public dynamic class sfx_wolf_death2 extends Sound {
}
}//package
Section 67
//sfx_wolf_death3 (sfx_wolf_death3)
package {
import flash.media.*;
public dynamic class sfx_wolf_death3 extends Sound {
}
}//package
Section 68
//sfx_wolf_death4 (sfx_wolf_death4)
package {
import flash.media.*;
public dynamic class sfx_wolf_death4 extends Sound {
}
}//package
Section 69
//sfx_wolfhowl_btn (sfx_wolfhowl_btn)
package {
import flash.media.*;
public dynamic class sfx_wolfhowl_btn extends Sound {
}
}//package
Section 70
//sfxreload_rifle (sfxreload_rifle)
package {
import flash.media.*;
public dynamic class sfxreload_rifle extends Sound {
}
}//package
Section 71
//Upgrade_Capped (Upgrade_Capped)
package {
import flash.display.*;
public dynamic class Upgrade_Capped extends MovieClip {
}
}//package
Section 72
//Upgrade_Confirm (Upgrade_Confirm)
package {
import Game5.*;
import flash.events.*;
import flash.display.*;
public dynamic class Upgrade_Confirm extends MovieClip {
public var no:SimpleButton;
public var yes:SimpleButton;
public function Upgrade_Confirm(){
addFrameScript(0, frame1);
}
public function removeMe():void{
parent.removeChild(this);
}
public function noClick(_arg1:MouseEvent):void{
dispatchEvent(new CustomEvent(CustomEvent.TRIGGER_B));
removeMe();
}
function frame1(){
yes.addEventListener(MouseEvent.CLICK, yesClick);
no.addEventListener(MouseEvent.CLICK, noClick);
}
public function yesClick(_arg1:MouseEvent):void{
dispatchEvent(new CustomEvent(CustomEvent.TRIGGER_A));
removeMe();
}
}
}//package
Section 73
//Upgrade_Window (Upgrade_Window)
package {
import Game5.*;
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.geom.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Upgrade_Window extends MovieClip {
public var rs_Down:SimpleButton;
public var upgradeCost:TextField;
public var weaponPreview:MovieClip;
public var fp_Slider:MovieClip;
public var rs_val:TextField;
public var fp_val:TextField;
public var rof_Slider:MovieClip;
public var rs:int;
public var fp_Up:SimpleButton;
public var btn_accept:SimpleButton;
public var rof_cap:Upgrade_Capped;
public var rof_temp_Slider:MovieClip;
public var acc_val:TextField;
public var btn_close:SimpleButton;
public var cs:int;
public var acc_Slider:MovieClip;
public var cs_temp_Slider:MovieClip;
public var acc:int;
public var nextItem:MovieClip;
public var rs_Slider:MovieClip;
public var weaponName:TextField;
public var fp:int;
public var rs_temp_Slider:MovieClip;
public var cs_val:TextField;
public var rs_cap:Upgrade_Capped;
public var index:int;
public var fp_cap:Upgrade_Capped;
public var cs_Up:SimpleButton;
public var rof_Up:SimpleButton;
public var acc_temp_Slider:MovieClip;
public var item;
public var acc_cap:Upgrade_Capped;
public var fp_Down:SimpleButton;
public var cs_Down:SimpleButton;
public var acc_Up:SimpleButton;
public var rof_Down:SimpleButton;
public var rs_Up:SimpleButton;
public var cs_cap:Upgrade_Capped;
public var temp_scrap:int;
public var cs_Slider:MovieClip;
public var rof_val:TextField;
public var acc_Down:SimpleButton;
public var rof:int;
public var fp_temp_Slider:MovieClip;
public var toolTip:TextField;
public var prevItem:MovieClip;
public function Upgrade_Window(){
addFrameScript(0, frame1);
}
public function closeWindow(_arg1:MouseEvent):void{
closeWindowPlz();
}
public function updateWindow(_arg1){
upgradeCost.text = String(((_arg1.UPGRADE_COST + "/") + temp_scrap));
weaponName.text = String(_arg1.NAME);
weaponPreview.gotoAndStop(_arg1.NAME);
acc_Slider.gotoAndStop(toPercent(_arg1.weaponAccuracy, _arg1.maxAccuracy));
acc_temp_Slider.gotoAndStop(toPercent((_arg1.weaponAccuracy + acc), _arg1.maxAccuracy));
acc_val.text = String(((((_arg1.weaponAccuracy + acc) + "(+") + acc) + ")"));
fp_Slider.gotoAndStop(toPercent(_arg1.weaponFirePower, _arg1.maxFirePower));
fp_temp_Slider.gotoAndStop(toPercent((_arg1.weaponFirePower + fp), _arg1.maxFirePower));
fp_val.text = String(((((_arg1.weaponFirePower + fp) + "(+") + fp) + ")"));
rs_Slider.gotoAndStop(toPercent(_arg1.weaponReloadSpeed, _arg1.maxReloadSpeed));
rs_temp_Slider.gotoAndStop(toPercent((_arg1.weaponReloadSpeed + rs), _arg1.maxReloadSpeed));
rs_val.text = String(((((_arg1.weaponReloadSpeed + rs) + "(+") + rs) + ")"));
if ((((_arg1.NAME == "Remington")) || ((_arg1.NAME == "SawedOff")))){
cs_Slider.gotoAndStop(toPercent(_arg1.weaponClipSize, _arg1.maxClipSize));
cs_temp_Slider.gotoAndStop(toPercent((_arg1.weaponClipSize + cs), _arg1.maxClipSize));
cs_val.text = String((((((_arg1.weaponClipSize / 3) + (cs / 3)) + "(+") + (cs / 3)) + ")"));
} else {
cs_Slider.gotoAndStop(toPercent(_arg1.weaponClipSize, _arg1.maxClipSize));
cs_temp_Slider.gotoAndStop(toPercent((_arg1.weaponClipSize + cs), _arg1.maxClipSize));
if ((_arg1.weaponClipSize + cs) > _arg1.capClipSize){
cs_val.text = String(_arg1.capClipSize);
} else {
cs_val.text = String(((((_arg1.weaponClipSize + cs) + "(+") + cs) + ")"));
};
};
rof_Slider.gotoAndStop(toPercent(_arg1.weaponRateOfFire, _arg1.maxRateOfFire));
rof_temp_Slider.gotoAndStop(toPercent((_arg1.weaponRateOfFire + rof), _arg1.maxRateOfFire));
rof_val.text = String(((((_arg1.weaponRateOfFire + rof) + "(+") + rof) + ")"));
if ((_arg1.weaponAccuracy + acc) >= _arg1.CAP_ACCURACY){
acc_cap.visible = true;
} else {
acc_cap.visible = false;
};
if ((_arg1.weaponFirePower + fp) >= _arg1.CAP_FIRE_POWER){
fp_cap.visible = true;
} else {
fp_cap.visible = false;
};
if ((_arg1.weaponReloadSpeed + rs) >= _arg1.CAP_RELOAD_SPEED){
rs_cap.visible = true;
} else {
rs_cap.visible = false;
};
if ((_arg1.weaponClipSize + cs) >= _arg1.CAP_CLIP_SIZE){
cs_cap.visible = true;
} else {
cs_cap.visible = false;
};
if ((_arg1.weaponRateOfFire + rof) >= _arg1.CAP_RATE_OF_FIRE){
rof_cap.visible = true;
} else {
rof_cap.visible = false;
};
if (((((_arg1.weaponAccuracy + acc) == _arg1.CAP_ACCURACY)) || ((_arg1.UPGRADE_COST > temp_scrap)))){
acc_Up.visible = false;
if ((_arg1.weaponAccuracy + acc) == _arg1.weaponAccuracy){
acc_Down.visible = false;
};
} else {
acc_Up.visible = true;
if ((_arg1.weaponAccuracy + acc) == _arg1.weaponAccuracy){
acc_Down.visible = false;
} else {
acc_Down.visible = true;
};
};
if (((((_arg1.weaponFirePower + fp) == _arg1.CAP_FIRE_POWER)) || ((_arg1.UPGRADE_COST > temp_scrap)))){
fp_Up.visible = false;
if ((_arg1.weaponFirePower + fp) == _arg1.weaponFirePower){
fp_Down.visible = false;
};
} else {
fp_Up.visible = true;
if ((_arg1.weaponFirePower + fp) == _arg1.weaponFirePower){
fp_Down.visible = false;
} else {
fp_Down.visible = true;
};
};
if (((((_arg1.weaponReloadSpeed + rs) == _arg1.CAP_RELOAD_SPEED)) || ((_arg1.UPGRADE_COST > temp_scrap)))){
rs_Up.visible = false;
if ((_arg1.weaponReloadSpeed + rs) == _arg1.weaponReloadSpeed){
rs_Down.visible = false;
};
} else {
rs_Up.visible = true;
if ((_arg1.weaponReloadSpeed + rs) == _arg1.weaponReloadSpeed){
rs_Down.visible = false;
} else {
rs_Down.visible = true;
};
};
if (((((_arg1.weaponClipSize + cs) == _arg1.CAP_CLIP_SIZE)) || ((_arg1.UPGRADE_COST > temp_scrap)))){
cs_Up.visible = false;
if ((_arg1.weaponClipSize + cs) == _arg1.weaponClipSize){
cs_Down.visible = false;
};
} else {
cs_Up.visible = true;
if ((_arg1.weaponClipSize + cs) == _arg1.weaponClipSize){
cs_Down.visible = false;
} else {
cs_Down.visible = true;
};
};
if (((((_arg1.weaponRateOfFire + rof) == _arg1.CAP_RATE_OF_FIRE)) || ((_arg1.UPGRADE_COST > temp_scrap)))){
rof_Up.visible = false;
if ((_arg1.weaponRateOfFire + rof) == _arg1.weaponRateOfFire){
rof_Down.visible = false;
};
} else {
rof_Up.visible = true;
if ((_arg1.weaponRateOfFire + rof) == _arg1.weaponRateOfFire){
rof_Down.visible = false;
} else {
rof_Down.visible = true;
};
};
}
public function removeUpgradeListeners():void{
acc_Up.removeEventListener(MouseEvent.CLICK, incStat);
fp_Up.removeEventListener(MouseEvent.CLICK, incStat);
rs_Up.removeEventListener(MouseEvent.CLICK, incStat);
cs_Up.removeEventListener(MouseEvent.CLICK, incStat);
rof_Up.removeEventListener(MouseEvent.CLICK, incStat);
acc_Down.removeEventListener(MouseEvent.CLICK, incStat);
fp_Down.removeEventListener(MouseEvent.CLICK, incStat);
rs_Down.removeEventListener(MouseEvent.CLICK, incStat);
cs_Down.removeEventListener(MouseEvent.CLICK, incStat);
rof_Down.removeEventListener(MouseEvent.CLICK, incStat);
nextItem.removeEventListener(MouseEvent.CLICK, nextWeapon);
prevItem.removeEventListener(MouseEvent.CLICK, prevWeapon);
btn_close.removeEventListener(MouseEvent.CLICK, closeWindow);
btn_accept.removeEventListener(MouseEvent.CLICK, acceptChanges);
}
public function prevWeapon(_arg1:MouseEvent):void{
var _local2:Upgrade_Confirm;
if (((((acc + fp) + rs) + cs) + rof) > 0){
_local2 = new Upgrade_Confirm();
_local2.x = 310;
_local2.y = 90;
_local2.addEventListener(CustomEvent.TRIGGER_A, acceptAndPrev);
_local2.addEventListener(CustomEvent.TRIGGER_B, declineAndPrev);
this.addChild(_local2);
removeUpgradeListeners();
} else {
previousItem();
};
}
public function addUpgradeListeners():void{
acc_Up.addEventListener(MouseEvent.CLICK, incStat);
fp_Up.addEventListener(MouseEvent.CLICK, incStat);
rs_Up.addEventListener(MouseEvent.CLICK, incStat);
cs_Up.addEventListener(MouseEvent.CLICK, incStat);
rof_Up.addEventListener(MouseEvent.CLICK, incStat);
acc_Down.addEventListener(MouseEvent.CLICK, incStat);
fp_Down.addEventListener(MouseEvent.CLICK, incStat);
rs_Down.addEventListener(MouseEvent.CLICK, incStat);
cs_Down.addEventListener(MouseEvent.CLICK, incStat);
rof_Down.addEventListener(MouseEvent.CLICK, incStat);
acc_Up.addEventListener(MouseEvent.ROLL_OVER, AddToolTips);
fp_Up.addEventListener(MouseEvent.ROLL_OVER, AddToolTips);
rs_Up.addEventListener(MouseEvent.ROLL_OVER, AddToolTips);
cs_Up.addEventListener(MouseEvent.ROLL_OVER, AddToolTips);
rof_Up.addEventListener(MouseEvent.ROLL_OVER, AddToolTips);
acc_Up.addEventListener(MouseEvent.ROLL_OUT, RemoveToolTips);
fp_Up.addEventListener(MouseEvent.ROLL_OUT, RemoveToolTips);
rs_Up.addEventListener(MouseEvent.ROLL_OUT, RemoveToolTips);
cs_Up.addEventListener(MouseEvent.ROLL_OUT, RemoveToolTips);
rof_Up.addEventListener(MouseEvent.ROLL_OUT, RemoveToolTips);
nextItem.addEventListener(MouseEvent.CLICK, nextWeapon);
prevItem.addEventListener(MouseEvent.CLICK, prevWeapon);
btn_close.addEventListener(MouseEvent.CLICK, closeWindow);
btn_accept.addEventListener(MouseEvent.CLICK, acceptChange);
}
function frame1(){
index = 0;
item = MovieClip(root).weaponArray[index];
temp_scrap = MovieClip(root).TotalScraps;
acc = 0;
fp = 0;
rs = 0;
cs = 0;
rof = 0;
updateWindow(item);
addUpgradeListeners();
}
public function AddToolTips(_arg1:MouseEvent):void{
var _local2:TextFormat;
toolTip = new TextField();
toolTip.x = mouseX;
toolTip.y = mouseY;
toolTip.textColor = 0;
toolTip.border = true;
toolTip.borderColor = 0;
toolTip.background = true;
toolTip.backgroundColor = 13086074;
toolTip.autoSize = TextFieldAutoSize.LEFT;
_local2 = new TextFormat();
toolTip.setTextFormat(_local2);
switch (_arg1.target.name){
case "acc_Up":
toolTip.text = "Each point added reduces the\nspread of bullet fire";
break;
case "fp_Up":
toolTip.text = "Each point added increases\nthe damage done per shot";
break;
case "rs_Up":
toolTip.text = "Each point added reduces the\ntime between reloading clips";
break;
case "cs_Up":
toolTip.text = "Each point added increases\nthe number of rounds per clip";
break;
case "rof_Up":
toolTip.text = "Each point added reduces the\nspeed between shots fired";
break;
};
this.addChild(toolTip);
}
public function acceptAndPrev(_arg1:CustomEvent):void{
acceptChanges();
addUpgradeListeners();
previousItem();
}
public function acceptChanges():void{
item.increaseAccuracy(acc);
item.increaseFirePower(fp);
item.increaseReloadSpeed(rs);
item.increaseClipSize(cs);
item.increaseRateOfFire(rof);
MovieClip(root).TotalScraps = temp_scrap;
temp_scrap = MovieClip(root).TotalScraps;
acc = 0;
fp = 0;
rs = 0;
cs = 0;
rof = 0;
updateWindow(item);
MovieClip(root).sndMgr.playSound("Click1");
if (((((acc + fp) + rs) + cs) + rof) == 0){
closeWindowPlz();
};
}
public function previousItem():void{
if (index == 0){
index = (MovieClip(root).weaponArray.length - 1);
} else {
index--;
};
temp_scrap = (temp_scrap + (item.UPGRADE_COST * ((((acc + fp) + rs) + cs) + rof)));
item = MovieClip(root).weaponArray[index];
acc = 0;
fp = 0;
rs = 0;
cs = 0;
rof = 0;
updateWindow(item);
MovieClip(root).sndMgr.playSound("Click2");
}
public function closeWindowPlz():void{
MovieClip(root).sndMgr.playSound("Click2");
dispatchEvent(new CustomEvent(CustomEvent.WINDOW_CLOSE));
MovieClip(root).destroyUpgradeWindow();
}
public function declineAndPrev(_arg1:CustomEvent):void{
previousItem();
addUpgradeListeners();
}
public function acceptChange(_arg1:MouseEvent):void{
acceptChanges();
}
public function nextWeapon(_arg1:MouseEvent):void{
var _local2:Upgrade_Confirm;
if (((((acc + fp) + rs) + cs) + rof) > 0){
_local2 = new Upgrade_Confirm();
_local2.x = 310;
_local2.y = 90;
_local2.addEventListener(CustomEvent.TRIGGER_A, acceptAndNext);
_local2.addEventListener(CustomEvent.TRIGGER_B, declineAndNext);
this.addChild(_local2);
removeUpgradeListeners();
} else {
n3xtItem();
};
}
public function acceptAndNext(_arg1:CustomEvent):void{
acceptChanges();
addUpgradeListeners();
n3xtItem();
}
public function incStat(_arg1:MouseEvent):void{
switch (_arg1.target.name){
case "acc_Up":
acc++;
temp_scrap = (temp_scrap - item.UPGRADE_COST);
MovieClip(root).sndMgr.playSound("Click1");
break;
case "fp_Up":
fp++;
temp_scrap = (temp_scrap - item.UPGRADE_COST);
MovieClip(root).sndMgr.playSound("Click1");
break;
case "rs_Up":
rs++;
temp_scrap = (temp_scrap - item.UPGRADE_COST);
MovieClip(root).sndMgr.playSound("Click1");
break;
case "cs_Up":
if ((((((((((item.NAME == "Remington")) || ((item.NAME == "SawedOff")))) || ((item.NAME == "Pistol")))) || ((item.NAME == "Revolver")))) || ((item.NAME == "Crossbow")))){
cs = (cs + 3);
} else {
cs = (cs + 5);
};
temp_scrap = (temp_scrap - item.UPGRADE_COST);
MovieClip(root).sndMgr.playSound("Click1");
break;
case "rof_Up":
rof++;
temp_scrap = (temp_scrap - item.UPGRADE_COST);
MovieClip(root).sndMgr.playSound("Click1");
break;
case "acc_Down":
acc--;
temp_scrap = (temp_scrap + item.UPGRADE_COST);
MovieClip(root).sndMgr.playSound("Click2");
break;
case "fp_Down":
fp--;
temp_scrap = (temp_scrap + item.UPGRADE_COST);
MovieClip(root).sndMgr.playSound("Click2");
break;
case "rs_Down":
rs--;
temp_scrap = (temp_scrap + item.UPGRADE_COST);
MovieClip(root).sndMgr.playSound("Click2");
break;
case "cs_Down":
if ((((((((((item.NAME == "Remington")) || ((item.NAME == "SawedOff")))) || ((item.NAME == "Pistol")))) || ((item.NAME == "Revolver")))) || ((item.NAME == "Crossbow")))){
cs = (cs - 3);
} else {
cs = (cs - 5);
};
temp_scrap = (temp_scrap + item.UPGRADE_COST);
MovieClip(root).sndMgr.playSound("Click2");
break;
case "rof_Down":
rof--;
temp_scrap = (temp_scrap + item.UPGRADE_COST);
MovieClip(root).sndMgr.playSound("Click2");
break;
};
updateWindow(item);
}
public function toPercent(_arg1:Number, _arg2:Number):Number{
return (Math.ceil(((_arg1 * 100) / _arg2)));
}
public function declineAndNext(_arg1:CustomEvent):void{
n3xtItem();
addUpgradeListeners();
}
public function RemoveToolTips(_arg1:MouseEvent):void{
this.removeChild(toolTip);
}
public function n3xtItem():void{
if (index == (MovieClip(root).weaponArray.length - 1)){
index = 0;
} else {
index++;
};
temp_scrap = (temp_scrap + (item.UPGRADE_COST * ((((acc + fp) + rs) + cs) + rof)));
item = MovieClip(root).weaponArray[index];
acc = 0;
fp = 0;
rs = 0;
cs = 0;
rof = 0;
updateWindow(item);
MovieClip(root).sndMgr.playSound("Click1");
}
}
}//package
Section 74
//Weapon_DropDownMenu (Weapon_DropDownMenu)
package {
import Game5.*;
import flash.events.*;
import flash.display.*;
public dynamic class Weapon_DropDownMenu extends MovieClip {
public var second:SimpleButton;
public var prime:SimpleButton;
public function Weapon_DropDownMenu(){
addFrameScript(0, frame1);
}
public function removeMe():void{
parent.removeChild(this);
delete ??getglobalscope
[this];
}
function frame1(){
prime.addEventListener(MouseEvent.CLICK, applyPrime);
second.addEventListener(MouseEvent.CLICK, applySecond);
}
public function applySecond(_arg1:MouseEvent):void{
dispatchEvent(new CustomEvent(CustomEvent.TRIGGER_B));
removeMe();
}
public function applyPrime(_arg1:MouseEvent):void{
dispatchEvent(new CustomEvent(CustomEvent.TRIGGER_A));
removeMe();
}
}
}//package
Section 75
//Wolf1 (Wolf1)
package {
import flash.media.*;
public dynamic class Wolf1 extends Sound {
}
}//package
Section 76
//Wolf2 (Wolf2)
package {
import flash.media.*;
public dynamic class Wolf2 extends Sound {
}
}//package
Section 77
//Wolf3 (Wolf3)
package {
import flash.media.*;
public dynamic class Wolf3 extends Sound {
}
}//package