Section 1
//CountDown_18 (Boxhead_TheZombieWars_fla.CountDown_18)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
import flash.text.*;
public dynamic class CountDown_18 extends MovieClip {
public var tfTime:TextField;
public var bHere:SimpleButton;
}
}//package Boxhead_TheZombieWars_fla
Section 2
//Default_Background_1 (Boxhead_TheZombieWars_fla.Default_Background_1)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
public dynamic class Default_Background_1 extends MovieClip {
public var mcTitleImage:MovieClip;
}
}//package Boxhead_TheZombieWars_fla
Section 3
//Default_Background_80 (Boxhead_TheZombieWars_fla.Default_Background_80)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
public dynamic class Default_Background_80 extends MovieClip {
public var mcConfigChanged:MovieClip;
}
}//package Boxhead_TheZombieWars_fla
Section 4
//FlashVersionProblem_17 (Boxhead_TheZombieWars_fla.FlashVersionProblem_17)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
import flash.text.*;
public dynamic class FlashVersionProblem_17 extends MovieClip {
public var tfTitles:TextField;
public var tfValues:TextField;
}
}//package Boxhead_TheZombieWars_fla
Section 5
//HUD_KillScore_Contents_132 (Boxhead_TheZombieWars_fla.HUD_KillScore_Contents_132)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
import flash.text.*;
public dynamic class HUD_KillScore_Contents_132 extends MovieClip {
public var tbAmount:TextField;
}
}//package Boxhead_TheZombieWars_fla
Section 6
//HUD_Level_Contents_154 (Boxhead_TheZombieWars_fla.HUD_Level_Contents_154)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
public dynamic class HUD_Level_Contents_154 extends MovieClip {
public var _LevelIndex:MovieClip;
public var _LevelClear:MovieClip;
}
}//package Boxhead_TheZombieWars_fla
Section 7
//HUD_Level_Index_155 (Boxhead_TheZombieWars_fla.HUD_Level_Index_155)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
import flash.text.*;
public dynamic class HUD_Level_Index_155 extends MovieClip {
public var tbIndex:TextField;
}
}//package Boxhead_TheZombieWars_fla
Section 8
//HUD_Message_Contents_152 (Boxhead_TheZombieWars_fla.HUD_Message_Contents_152)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
import flash.text.*;
public dynamic class HUD_Message_Contents_152 extends MovieClip {
public var _Size:MovieClip;
public var tbMessage:TextField;
}
}//package Boxhead_TheZombieWars_fla
Section 9
//HUD_Multiplier_Contents_127 (Boxhead_TheZombieWars_fla.HUD_Multiplier_Contents_127)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
import flash.text.*;
public dynamic class HUD_Multiplier_Contents_127 extends MovieClip {
public var _Size:MovieClip;
public var tbAmount:TextField;
}
}//package Boxhead_TheZombieWars_fla
Section 10
//Hud_Player_Ammo_135 (Boxhead_TheZombieWars_fla.Hud_Player_Ammo_135)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Hud_Player_Ammo_135 extends MovieClip {
public var tfInfo:TextField;
}
}//package Boxhead_TheZombieWars_fla
Section 11
//HUD_Score_Contents_130 (Boxhead_TheZombieWars_fla.HUD_Score_Contents_130)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
import flash.text.*;
public dynamic class HUD_Score_Contents_130 extends MovieClip {
public var _Size:MovieClip;
public var tbAmount:TextField;
}
}//package Boxhead_TheZombieWars_fla
Section 12
//Hud_Turret_Ammo_150 (Boxhead_TheZombieWars_fla.Hud_Turret_Ammo_150)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Hud_Turret_Ammo_150 extends MovieClip {
public var tfInfo:TextField;
}
}//package Boxhead_TheZombieWars_fla
Section 13
//LIcon_Image_00_51 (Boxhead_TheZombieWars_fla.LIcon_Image_00_51)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
public dynamic class LIcon_Image_00_51 extends MovieClip {
public var mcName:MovieClip;
}
}//package Boxhead_TheZombieWars_fla
Section 14
//LIcon_Image_01_53 (Boxhead_TheZombieWars_fla.LIcon_Image_01_53)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
public dynamic class LIcon_Image_01_53 extends MovieClip {
public var mcName:MovieClip;
}
}//package Boxhead_TheZombieWars_fla
Section 15
//LIcon_Image_02_54 (Boxhead_TheZombieWars_fla.LIcon_Image_02_54)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
public dynamic class LIcon_Image_02_54 extends MovieClip {
public var mcName:MovieClip;
}
}//package Boxhead_TheZombieWars_fla
Section 16
//LIcon_Image_03_55 (Boxhead_TheZombieWars_fla.LIcon_Image_03_55)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
public dynamic class LIcon_Image_03_55 extends MovieClip {
public var mcName:MovieClip;
}
}//package Boxhead_TheZombieWars_fla
Section 17
//LIcon_Image_04_56 (Boxhead_TheZombieWars_fla.LIcon_Image_04_56)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
public dynamic class LIcon_Image_04_56 extends MovieClip {
public var mcName:MovieClip;
}
}//package Boxhead_TheZombieWars_fla
Section 18
//LIcon_Image_05_57 (Boxhead_TheZombieWars_fla.LIcon_Image_05_57)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
public dynamic class LIcon_Image_05_57 extends MovieClip {
public var mcName:MovieClip;
}
}//package Boxhead_TheZombieWars_fla
Section 19
//LIcon_Image_06_58 (Boxhead_TheZombieWars_fla.LIcon_Image_06_58)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
public dynamic class LIcon_Image_06_58 extends MovieClip {
public var mcName:MovieClip;
}
}//package Boxhead_TheZombieWars_fla
Section 20
//LIcon_Image_07_59 (Boxhead_TheZombieWars_fla.LIcon_Image_07_59)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
public dynamic class LIcon_Image_07_59 extends MovieClip {
public var mcName:MovieClip;
}
}//package Boxhead_TheZombieWars_fla
Section 21
//LIcon_Name_52 (Boxhead_TheZombieWars_fla.LIcon_Name_52)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
import flash.text.*;
public dynamic class LIcon_Name_52 extends MovieClip {
public var tfName:TextField;
}
}//package Boxhead_TheZombieWars_fla
Section 22
//LOGO_163 (Boxhead_TheZombieWars_fla.LOGO_163)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
import flash.utils.*;
import flash.events.*;
import Game.*;
public dynamic class LOGO_163 extends MovieClip {
public var bTButton:SimpleButton;
public var nTimer:Timer;
public var mFinished:Boolean;
public function LOGO_163(){
addFrameScript(0, frame1);
}
public function e_ANIMATE(_arg1:TimerEvent):void{
this.nextFrame();
if (this.currentFrame == this.totalFrames){
nTimer.removeEventListener("timer", e_ANIMATE);
dispatchEvent(new Event("FINISHED"));
};
}
public function e_GOTOURL(_arg1:MouseEvent):void{
CGlobalData.OpenURL_GamesWebsite();
}
function frame1(){
stop();
mFinished = false;
bTButton.addEventListener(MouseEvent.MOUSE_UP, e_GOTOURL);
nTimer = new Timer((1000 / 30));
nTimer.addEventListener("timer", e_ANIMATE);
}
public function START(){
visible = true;
nTimer.start();
}
}
}//package Boxhead_TheZombieWars_fla
Section 23
//MainTimeline (Boxhead_TheZombieWars_fla.MainTimeline)
package Boxhead_TheZombieWars_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.utils.*;
import IO.*;
import Game.*;
import STC9.String.*;
import CPMStar.*;
import flash.system.*;
import flash.text.*;
import flash.geom.*;
import flash.external.*;
import flash.media.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var tfDebug:TextField;
public var tfVersion:TextField;
public var currentPercentage:int;
public var mcLoadingText:MovieClip;
public var mcLoaderBar:MovieClip;
public var bMoreGames:SimpleButton;
public var mcCountDown:MovieClip;
public var mcLogo:SimpleButton;
public var startTime:int;
public var adBox:MovieClip;
public var mcSTC:MovieClip;
public var bPlay:SimpleButton;
public var mcCover:MovieClip;
public var mcSUSPEND:MovieClip;
public var mcCMG:MovieClip;
public var mcFlashVersionCover:MovieClip;
public var startTime2:int;
public function MainTimeline(){
addFrameScript(0, frame1, 10, frame11, 20, frame21, 50, frame51, 60, frame61, 70, frame71, 80, frame81, 91, frame92, 96, frame97, 97, frame98, 98, frame99, 99, frame100);
}
public function STATE_INITLOAD(){
var e_GOTOBOXHEAD:Function;
var e_GOTOCMG:Function;
e_GOTOBOXHEAD = function (_arg1:MouseEvent):void{
CGlobalData.OpenURL_BoxheadWebsite();
};
e_GOTOCMG = function (_arg1:MouseEvent):void{
CGlobalData.OpenURL_SponsorWebsite();
CMochiBot.Track(CMochiBot.BXH_ZW_SPONSORCLICK_LOADING);
};
if (!CheckVersion()){
stop();
return;
};
mcFlashVersionCover.visible = false;
this.mcLoaderBar.visible = false;
this.mcLoadingText.visible = false;
this.mTimeStart = getTimer();
this.mcLogo.addEventListener(MouseEvent.MOUSE_UP, e_GOTOBOXHEAD);
this.bMoreGames.addEventListener(MouseEvent.MOUSE_UP, e_GOTOCMG);
if (((((CGlobalData.isLIVE().mLive) || (CProtection.isCMG()))) || (((CProtection.isKONGREGATE()) && (CBuild.mKongregateStats))))){
gotoAndPlay("STARTLOAD");
} else {
gotoAndPlay("COUNTDOWN");
};
}
function frame100(){
mcFlashVersionCover.visible = false;
}
function frame71(){
STATE_FADEOUT();
}
public function SendToURL(_arg1:String):void{
var loader:URLLoader;
var request:URLRequest;
var url = _arg1;
loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, completeHandler);
loader.addEventListener(Event.OPEN, openHandler);
loader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
request = new URLRequest(url);
try {
loader.load(request);
} catch(error:Error) {
};
}
function frame81(){
STATE_LOADED();
}
public function STATE_PLAYGAME(){
this.bPlay.alpha = 0;
this.addEventListener(Event.ENTER_FRAME, e_PLAYFADE);
startTime = getTimer();
stop();
}
public function e_COVERFADE(_arg1:Event):void{
var _local2:Number;
_local2 = ((getTimer() - startTime) / (1 * 1000));
this.mcCover.alpha = _local2;
if (this.mcCover.alpha >= 1){
this.removeEventListener(Event.ENTER_FRAME, e_COVERFADE);
this.gotoAndStop("LOADED");
};
}
function frame98(){
stop();
mcSTC.START();
}
public function httpStatusHandler(_arg1:HTTPStatusEvent):void{
}
public function STATE_SUSPEND():void{
this.mcSUSPEND.visible = true;
stop();
}
function frame97(){
mcSTC.visible = false;
mcCMG.visible = false;
mcFlashVersionCover.visible = false;
mcSTC.addEventListener("FINISHED", e_STCFINISHED);
if (CBuild.mSkipIntro){
gotoAndStop(3);
} else {
nextFrame();
};
}
public function STATE_FADEOUT(){
this.mcCover.alpha = 0;
this.addEventListener(Event.ENTER_FRAME, e_COVERFADE);
startTime = getTimer();
}
public function progressHandler(_arg1:ProgressEvent):void{
}
public function ioErrorHandler(_arg1:IOErrorEvent):void{
}
public function e_COVERFADE_OUT(_arg1:Event):void{
var _local2:Number;
_local2 = ((getTimer() - startTime2) / (1 * 1000));
mcCover.alpha = (1 - _local2);
if (mcCover.alpha <= 0){
this.removeEventListener(Event.ENTER_FRAME, e_COVERFADE_OUT);
gotoAndStop(1, "MAIN");
};
}
function frame92(){
stop();
}
public function e_PLAYFADE(_arg1:Event):void{
var _local2:Number;
_local2 = ((getTimer() - startTime) / (1 * 1000));
this.bPlay.alpha = _local2;
this.mcLoaderBar.alpha = (this.mcLoadingText.alpha = (1 - _local2));
if (this.bPlay.alpha >= 1){
this.removeEventListener(Event.ENTER_FRAME, e_PLAYFADE);
this.bPlay.addEventListener(MouseEvent.MOUSE_UP, e_PLAYGAME);
};
}
function frame21(){
STATE_STARTLOAD();
}
function frame99(){
this.addEventListener(Event.ENTER_FRAME, e_COVERFADE_OUT);
mcCover.alpha = 1;
startTime2 = getTimer();
stop();
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
}
function frame1(){
currentPercentage = 0;
this.stage.scaleMode = StageScaleMode.NO_SCALE;
this.stage.align = StageAlign.TOP_LEFT;
this.stage.showDefaultContextMenu = false;
mcSUSPEND.visible = false;
tfDebug.visible = false;
CProtection.mRoot = root;
CProtection.tfDebug = tfDebug;
CMochiBot.mRoot = root;
CGlobalData.SendData_Visit();
CMochiBot.Track(CMochiBot.BXH_ZW_VISITS);
tfVersion.visible = true;
tfVersion.text = (((((CVersion.mVersionString + " ") + Capabilities.version) + " (") + CProtection.GetDomain()) + ")");
CProtection.ShowDebugInfo();
STATE_INITLOAD();
}
public function e_STCFINISHED(_arg1:Event):void{
mcSTC.visible = false;
mcSTC.removeEventListener("FINISHED", e_STCFINISHED);
mcCMG.visible = true;
mcCMG.addEventListener("FINISHED", e_CMGFINISHED);
mcCMG.START();
}
public function openHandler(_arg1:Event):void{
}
function frame11(){
STATE_SUSPEND();
}
public function e_COUNTDOWNFADE(_arg1:Event):void{
var _local2:Number;
var _local3:Object;
_local2 = ((getTimer() - startTime) / (1 * 1000));
this.mcCountDown.alpha = Math.min(1, _local2);
_local3 = CGlobalData.isLIVE();
this.mcCountDown.tfTime.text = ((((((_local3.mDays + " days ") + CString.Pad(_local3.mHours, "0", 2)) + ":") + CString.Pad(_local3.mMinutes, "0", 2)) + ":") + CString.Pad(_local3.mSeconds, "0", 2));
if (_local3.mLive){
this.removeEventListener(Event.ENTER_FRAME, e_COUNTDOWNFADE);
gotoAndPlay(1);
};
}
public function STATE_LOADED(){
this.gotoAndStop(1, "INTRO");
}
public function STATE_COUNTDOWN():void{
var e_GOTOCMG:Function;
e_GOTOCMG = function (_arg1:MouseEvent):void{
CProtection.NavigateToURL(CGlobalData.mCMGBoxheadTheZombieWarsURL);
CMochiBot.Track(CMochiBot.BXH_ZW_SPONSORCLICK_LOADING);
CMochiBot.Track(CMochiBot.BXH_ZW_TOTALSPONSORCLICKS);
};
this.mcLoaderBar.visible = false;
stop();
this.mcCountDown.alpha = 0;
this.addEventListener(Event.ENTER_FRAME, e_COUNTDOWNFADE);
this.mcCountDown.bHere.addEventListener(MouseEvent.MOUSE_UP, e_GOTOCMG);
startTime = getTimer();
}
function frame51(){
STATE_COUNTDOWN();
}
public function e_PLAYGAME(_arg1:MouseEvent):void{
this.gotoAndStop("FADEOUT");
}
public function CheckVersion():Boolean{
var _local1:String;
var _local2:Array;
var _local3:Array;
var _local4:Object;
var _local5:Object;
_local1 = Capabilities.version;
_local2 = _local1.split(" ");
_local3 = _local2[1].split(",");
_local4 = {majorVersion:9, buildNumber:47};
_local5 = {majorVersion:Number(_local3[0]), buildNumber:Number(_local3[2])};
mcFlashVersionCover.tfTitles.text = "current version:\nrequired version:";
mcFlashVersionCover.tfValues.text = (((((_local2[1] + "\n") + _local4.majorVersion) + ",0,") + _local4.buildNumber) + ",0");
if ((((_local5.majorVersion < _local4.majorVersion)) || ((((_local5.majorVersion >= _local4.majorVersion)) && ((_local5.buildNumber < _local4.buildNumber)))))){
return (false);
};
return (true);
}
public function completeHandler(_arg1:Event):void{
var _local2:URLLoader;
var _local3:String;
_local2 = URLLoader(_arg1.target);
_local3 = _GetField(_local2.data, "src");
}
public function _GetField(_arg1:String, _arg2:String):String{
var _local3:int;
var _local4:int;
_arg2 = (_arg2 + ("=" + String.fromCharCode(34)));
_local3 = _arg1.indexOf(_arg2);
if (_local3 == -1){
return ("");
};
_arg1 = _arg1.substr((_local3 + _arg2.length));
_local4 = _arg1.indexOf(String.fromCharCode(34));
if (_local4 == -1){
return ("");
};
return (_arg1.substring(0, _local4));
}
public function e_CMGFINISHED(_arg1:Event):void{
mcCMG.removeEventListener("FINISHED", e_CMGFINISHED);
nextFrame();
}
public function STATE_STARTLOAD(){
this.addEventListener(Event.ENTER_FRAME, PL_LOADING);
this.mcLoaderBar.visible = true;
this.mcLoadingText.visible = true;
currentPercentage = 0;
if (CProtection.mSHOWAD){
AdLoader.LoadAd(adBox);
};
stop();
}
public function PL_LOADING(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
_local2 = ((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100);
_local3 = (((getTimer() - this.mTimeStart) / (CBuild.mLoadingTime * 1000)) * 100);
_local2 = ((_local3)<_local2) ? _local3 : _local2;
if ((((int(_local2) > currentPercentage)) && ((currentPercentage < 100)))){
currentPercentage++;
};
this.mcLoaderBar.gotoAndStop(int((_local2 + 1)));
if (currentPercentage >= 100){
this.removeEventListener(Event.ENTER_FRAME, PL_LOADING);
this.gotoAndStop("PLAYGAME");
};
}
function frame61(){
STATE_PLAYGAME();
}
}
}//package Boxhead_TheZombieWars_fla
Section 24
//Monkey_169 (Boxhead_TheZombieWars_fla.Monkey_169)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
import flash.utils.*;
import flash.events.*;
import IO.*;
import Game.*;
public dynamic class Monkey_169 extends MovieClip {
public var bTButton:SimpleButton;
public var nTimer:Timer;
public var mFinished:Boolean;
public function Monkey_169(){
addFrameScript(0, frame1, 115, frame116);
}
public function e_ANIMATE(_arg1:TimerEvent):void{
this.nextFrame();
if (this.currentFrame == this.totalFrames){
nTimer.removeEventListener("timer", e_ANIMATE);
dispatchEvent(new Event("FINISHED"));
};
}
public function e_GOTOURL(_arg1:MouseEvent):void{
CGlobalData.OpenURL_SponsorWebsite();
CMochiBot.Track(CMochiBot.BXH_ZW_SPONSORCLICK_INTRO);
}
function frame1(){
stop();
mFinished = false;
bTButton.addEventListener(MouseEvent.MOUSE_UP, e_GOTOURL);
nTimer = new Timer((1000 / 24));
nTimer.addEventListener("timer", e_ANIMATE);
}
public function START(){
visible = true;
nTimer.start();
}
function frame116(){
stop();
}
}
}//package Boxhead_TheZombieWars_fla
Section 25
//Rock_Content_96 (Boxhead_TheZombieWars_fla.Rock_Content_96)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
public dynamic class Rock_Content_96 extends MovieClip {
public var _Shadow2:MovieClip;
}
}//package Boxhead_TheZombieWars_fla
Section 26
//Tree_Contents_102 (Boxhead_TheZombieWars_fla.Tree_Contents_102)
package Boxhead_TheZombieWars_fla {
import flash.display.*;
public dynamic class Tree_Contents_102 extends MovieClip {
public var _Shadow2:MovieClip;
}
}//package Boxhead_TheZombieWars_fla
Section 27
//MD5 (CMG_AS3.MD5)
package CMG_AS3 {
public class MD5 {
public static const HEX_FORMAT_LOWERCASE:uint = 0;
public static const HEX_FORMAT_UPPERCASE:uint = 1;
public static const BASE64_PAD_CHARACTER_DEFAULT_COMPLIANCE:String = "";
public static const BASE64_PAD_CHARACTER_RFC_COMPLIANCE:String = "=";
public static var hexcase:uint = 0;
public static var b64pad:String = "";
public static function md5_gg(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 & _arg4) | (_arg3 & ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function md5_cmn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
return (safe_add(bit_rol(safe_add(safe_add(_arg2, _arg1), safe_add(_arg4, _arg6)), _arg5), _arg3));
}
public static function binl_md5(_arg1:Array, _arg2:Number):Array{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_arg1[(_arg2 >> 5)] = (_arg1[(_arg2 >> 5)] | (128 << (_arg2 % 32)));
_arg1[((((_arg2 + 64) >>> 9) << 4) + 14)] = _arg2;
_local3 = 1732584193;
_local4 = -271733879;
_local5 = -1732584194;
_local6 = 271733878;
_local7 = 0;
while (_local7 < _arg1.length) {
_local8 = _local3;
_local9 = _local4;
_local10 = _local5;
_local11 = _local6;
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 7, -680876936);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 1)], 12, -389564586);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 17, 606105819);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 3)], 22, -1044525330);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 7, -176418897);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 5)], 12, 1200080426);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 17, -1473231341);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 7)], 22, -45705983);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 7, 1770035416);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 9)], 12, -1958414417);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 17, -42063);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 11)], 22, -1990404162);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 7, 1804603682);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 13)], 12, -40341101);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 17, -1502002290);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 15)], 22, 1236535329);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 5, -165796510);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 6)], 9, -1069501632);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 14, 643717713);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 0)], 20, -373897302);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 5, -701558691);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 10)], 9, 38016083);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 14, -660478335);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 4)], 20, -405537848);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 5, 568446438);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 14)], 9, -1019803690);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 14, -187363961);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 8)], 20, 1163531501);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 5, -1444681467);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 2)], 9, -51403784);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 14, 1735328473);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 12)], 20, -1926607734);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 4, -378558);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 8)], 11, -2022574463);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 16, 1839030562);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 14)], 23, -35309556);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 4, -1530992060);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 4)], 11, 1272893353);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 16, -155497632);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 10)], 23, -1094730640);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 4, 681279174);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 0)], 11, -358537222);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 16, -722521979);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 6)], 23, 76029189);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 4, -640364487);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 12)], 11, -421815835);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 16, 530742520);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 2)], 23, -995338651);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 6, -198630844);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 7)], 10, 1126891415);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 15, -1416354905);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 5)], 21, -57434055);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 6, 1700485571);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 3)], 10, -1894986606);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 15, -1051523);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 1)], 21, -2054922799);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 6, 1873313359);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 15)], 10, -30611744);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 15, -1560198380);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 13)], 21, 1309151649);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 6, -145523070);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 11)], 10, -1120210379);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 15, 718787259);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 9)], 21, -343485551);
_local3 = safe_add(_local3, _local8);
_local4 = safe_add(_local4, _local9);
_local5 = safe_add(_local5, _local10);
_local6 = safe_add(_local6, _local11);
_local7 = (_local7 + 16);
};
return ([_local3, _local4, _local5, _local6]);
}
public static function str2rstr_utf16le(_arg1:String):String{
var _local2:String;
var _local3:Number;
_local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode((_arg1.charCodeAt(_local3) & 0xFF), ((_arg1.charCodeAt(_local3) >>> 8) & 0xFF)));
_local3++;
};
return (_local2);
}
public static function hex_hmac_md5(_arg1:String, _arg2:String):String{
return (rstr2hex(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2))));
}
public static function binl2rstr(_arg1:Array):String{
var _local2:String;
var _local3:Number;
_local2 = "";
_local3 = 0;
while (_local3 < (_arg1.length * 32)) {
_local2 = (_local2 + String.fromCharCode(((_arg1[(_local3 >> 5)] >>> (_local3 % 32)) & 0xFF)));
_local3 = (_local3 + 8);
};
return (_local2);
}
public static function md5_ff(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 & _arg3) | (~(_arg2) & _arg4)), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function md5_ii(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn((_arg3 ^ (_arg2 | ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function rstr2binl(_arg1:String):Array{
var _local2:Array;
var _local3:Number;
_local2 = new Array((_arg1.length >> 2));
_local3 = 0;
while (_local3 < _local2.length) {
_local2[_local3] = 0;
_local3++;
};
_local3 = 0;
while (_local3 < (_arg1.length * 8)) {
_local2[(_local3 >> 5)] = (_local2[(_local3 >> 5)] | ((_arg1.charCodeAt((_local3 / 8)) & 0xFF) << (_local3 % 32)));
_local3 = (_local3 + 8);
};
return (_local2);
}
public static function md5_vm_test():Boolean{
return ((hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"));
}
public static function b64_md5(_arg1:String):String{
return (rstr2b64(rstr_md5(str2rstr_utf8(_arg1))));
}
public static function any_hmac_md5(_arg1:String, _arg2:String, _arg3:String):String{
return (rstr2any(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2)), _arg3));
}
public static function hex_md5(_arg1:String):String{
return (rstr2hex(rstr_md5(str2rstr_utf8(_arg1))));
}
public static function bit_rol(_arg1:Number, _arg2:Number):Number{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
public static function encrypt(_arg1:String):String{
return (hex_md5(_arg1));
}
public static function md5_hh(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 ^ _arg3) ^ _arg4), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function rstr2hex(_arg1:String):String{
var _local2:String;
var _local3:String;
var _local4:Number;
var _local5:Number;
_local2 = (hexcase) ? "0123456789ABCDEF" : "0123456789abcdef";
_local3 = "";
_local5 = 0;
while (_local5 < _arg1.length) {
_local4 = _arg1.charCodeAt(_local5);
_local3 = (_local3 + (_local2.charAt(((_local4 >>> 4) & 15)) + _local2.charAt((_local4 & 15))));
_local5++;
};
return (_local3);
}
public static function any_md5(_arg1:String, _arg2:String):String{
return (rstr2any(rstr_md5(str2rstr_utf8(_arg1)), _arg2));
}
public static function b64_hmac_md5(_arg1:String, _arg2:String):String{
return (rstr2b64(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2))));
}
public static function rstr2b64(_arg1:String):String{
var _local2:String;
var _local3:String;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
_local3 = "";
_local4 = _arg1.length;
_local5 = 0;
while (_local5 < _local4) {
_local6 = (((_arg1.charCodeAt(_local5) << 16) | (((_local5 + 1) < _local4)) ? (_arg1.charCodeAt((_local5 + 1)) << 8) : 0) | (((_local5 + 2) < _local4)) ? _arg1.charCodeAt((_local5 + 2)) : 0);
_local7 = 0;
while (_local7 < 4) {
if (((_local5 * 8) + (_local7 * 6)) > (_arg1.length * 8)){
_local3 = (_local3 + b64pad);
} else {
_local3 = (_local3 + _local2.charAt(((_local6 >>> (6 * (3 - _local7))) & 63)));
};
_local7++;
};
_local5 = (_local5 + 3);
};
return (_local3);
}
public static function safe_add(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
_local3 = ((_arg1 & 0xFFFF) + (_arg2 & 0xFFFF));
_local4 = (((_arg1 >> 16) + (_arg2 >> 16)) + (_local3 >> 16));
return (((_local4 << 16) | (_local3 & 0xFFFF)));
}
public static function str2rstr_utf8(_arg1:String):String{
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = "";
_local3 = -1;
while (++_local3 < _arg1.length) {
_local4 = _arg1.charCodeAt(_local3);
_local5 = (((_local3 + 1) < _arg1.length)) ? _arg1.charCodeAt((_local3 + 1)) : 0;
if ((((((((0xD800 <= _local4)) && ((_local4 <= 56319)))) && ((0xDC00 <= _local5)))) && ((_local5 <= 57343)))){
_local4 = ((65536 + ((_local4 & 1023) << 10)) + (_local5 & 1023));
_local3++;
};
if (_local4 <= 127){
_local2 = (_local2 + String.fromCharCode(_local4));
} else {
if (_local4 <= 2047){
_local2 = (_local2 + String.fromCharCode((192 | ((_local4 >>> 6) & 31)), (128 | (_local4 & 63))));
} else {
if (_local4 <= 0xFFFF){
_local2 = (_local2 + String.fromCharCode((224 | ((_local4 >>> 12) & 15)), (128 | ((_local4 >>> 6) & 63)), (128 | (_local4 & 63))));
} else {
if (_local4 <= 2097151){
_local2 = (_local2 + String.fromCharCode((240 | ((_local4 >>> 18) & 7)), (128 | ((_local4 >>> 12) & 63)), (128 | ((_local4 >>> 6) & 63)), (128 | (_local4 & 63))));
};
};
};
};
};
return (_local2);
}
public static function rstr_hmac_md5(_arg1:String, _arg2:String):String{
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = rstr2binl(_arg1);
if (_local3.length > 16){
_local3 = binl_md5(_local3, (_arg1.length * 8));
};
_local4 = new Array(16);
_local5 = new Array(16);
_local6 = 0;
while (_local6 < 16) {
_local4[_local6] = (_local3[_local6] ^ 909522486);
_local5[_local6] = (_local3[_local6] ^ 1549556828);
_local6++;
};
_local7 = binl_md5(_local4.concat(rstr2binl(_arg2)), (0x0200 + (_arg2.length * 8)));
return (binl2rstr(binl_md5(_local5.concat(_local7), (0x0200 + 128))));
}
public static function str2rstr_utf16be(_arg1:String):String{
var _local2:String;
var _local3:Number;
_local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode(((_arg1.charCodeAt(_local3) >>> 8) & 0xFF), (_arg1.charCodeAt(_local3) & 0xFF)));
_local3++;
};
return (_local2);
}
public static function rstr2any(_arg1:String, _arg2:String):String{
var _local3:Number;
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
var _local9:Array;
var _local10:String;
_local3 = _arg2.length;
_local4 = [];
_local9 = new Array((_arg1.length / 2));
_local5 = 0;
while (_local5 < _local9.length) {
_local9[_local5] = ((_arg1.charCodeAt((_local5 * 2)) << 8) | _arg1.charCodeAt(((_local5 * 2) + 1)));
_local5++;
};
while (_local9.length > 0) {
_local8 = [];
_local7 = 0;
_local5 = 0;
while (_local5 < _local9.length) {
_local7 = ((_local7 << 16) + _local9[_local5]);
_local6 = Math.floor((_local7 / _local3));
_local7 = (_local7 - (_local6 * _local3));
if ((((_local8.length > 0)) || ((_local6 > 0)))){
_local8[_local8.length] = _local6;
};
_local5++;
};
_local4[_local4.length] = _local7;
_local9 = _local8;
};
_local10 = "";
_local5 = (_local4.length - 1);
while (_local5 >= 0) {
_local10 = (_local10 + _arg2.charAt(_local4[_local5]));
_local5--;
};
return (_local10);
}
public static function rstr_md5(_arg1:String):String{
return (binl2rstr(binl_md5(rstr2binl(_arg1), (_arg1.length * 8))));
}
}
}//package CMG_AS3
Section 28
//ScoreSubmitter (CMG_AS3.ScoreSubmitter)
package CMG_AS3 {
import flash.events.*;
import flash.net.*;
public class ScoreSubmitter extends EventDispatcher {
private var m_UrlLoader:URLLoader;// = null
public static const RETURNCODE_SUCCESS = 1;
public static const RETURNCODE_REJECTED = 2;
public static const RETURNCODE_INTERNALERROR = 5;
public static const URL_SUBMITSCORE = "http://scores.crazymonkeygames.com/hs/regscores2.php";
public static const URL_UPDATEGAME = "http://scores.crazymonkeygames.com/hs/pleaseupdate.php";
public static const SCORE_RESPONSE:String = "score_response";
public static const RETURNCODE_WORKING = 0;
public static const RETURNCODE_WRONGVERSION = 3;
public static const URL_VIEWSCORES = "http://scores.crazymonkeygames.com/hs/listscores.php";
public static const RETURNCODE_NETWORKERROR = 4;
public static var gameVersion:String = "";
public static var gameValidationCode:String = "";
public static var gameId:uint = 0;
public function ScoreSubmitter(){
m_UrlLoader = null;
super();
}
private function onIoError(_arg1:Event){
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_NETWORKERROR));
}
public function submitScore(_arg1:String, _arg2:Number, _arg3:String=null):void{
var _local4:*;
var _local5:URLRequest;
_arg1 = Utilities.trim(_arg1);
gameVersion = Utilities.trim(gameVersion);
if (_arg3 == null){
_arg3 = "";
} else {
_arg3 = Utilities.trim(_arg3);
};
gameValidationCode = Utilities.trim(gameValidationCode);
if ((((((gameId < 1)) || ((gameVersion == "")))) || ((gameValidationCode == "")))){
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_REJECTED));
return;
};
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_WORKING));
_local4 = new URLVariables();
_local4.name = _arg1;
_local4.score = _arg2;
_local4.gameId = gameId;
_local4.gameVersion = gameVersion;
_local4.special = _arg3;
_local4.key = MD5.encrypt(((((((((_arg1 + "|") + _arg2) + "|") + gameId) + "|") + _arg3) + "|") + gameValidationCode));
_local5 = new URLRequest(URL_SUBMITSCORE);
_local5.method = URLRequestMethod.POST;
_local5.data = _local4;
m_UrlLoader = new URLLoader();
m_UrlLoader.addEventListener("complete", onComplete);
m_UrlLoader.addEventListener("ioError", onIoError);
m_UrlLoader.load(_local5);
}
private function onComplete(_arg1:Event):void{
var _local2:URLVariables;
var _local3:*;
_local2 = new URLVariables(m_UrlLoader.data.replace("&", ""));
_local3 = Utilities.trim(_local2.ok);
if (_local3 == 1){
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_SUCCESS));
} else {
if (_local3 == 0){
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_REJECTED));
} else {
if (_local3 == 2){
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_WRONGVERSION));
} else {
dispatchEvent(new ServerResponseEvent(SCORE_RESPONSE, RETURNCODE_INTERNALERROR));
};
};
};
}
public static function loadHighScorePage():void{
Utilities.goToUrl(((URL_VIEWSCORES + "?id=") + gameId));
}
public static function loadUpdatePage(){
Utilities.goToUrl(((URL_VIEWSCORES + "?id=") + gameId));
}
}
}//package CMG_AS3
Section 29
//ServerResponseEvent (CMG_AS3.ServerResponseEvent)
package CMG_AS3 {
import flash.events.*;
public class ServerResponseEvent extends Event {
public var returnCode:uint;
public function ServerResponseEvent(_arg1:String, _arg2:uint){
super(_arg1, false, false);
returnCode = _arg2;
}
}
}//package CMG_AS3
Section 30
//Utilities (CMG_AS3.Utilities)
package CMG_AS3 {
import flash.net.*;
import flash.external.*;
import flash.system.*;
public class Utilities {
public static function trim(_arg1:String):String{
var _local2:*;
var _local3:*;
_local2 = 0;
while (_arg1.charCodeAt(_local2) < 33) {
_local2++;
};
_local3 = (_arg1.length - 1);
while (_arg1.charCodeAt(_local3) < 33) {
_local3--;
};
return (_arg1.substring(_local2, (_local3 + 1)));
}
public static function goToUrl(_arg1:String):void{
var success:Boolean;
var url = _arg1;
success = false;
if (((ExternalInterface.available) && (!((Capabilities.playerType == "External"))))){
try {
ExternalInterface.call("window.open", url, "win", "");
success = true;
} catch(error:Error) {
} catch(error:SecurityError) {
};
};
if (success != true){
navigateToURL(new URLRequest(url), "_BLANK");
};
}
}
}//package CMG_AS3
Section 31
//KongregateEvent (com.kongregate.as3.client.events.KongregateEvent)
package com.kongregate.as3.client.events {
import flash.events.*;
public class KongregateEvent extends Event {
public static const COMPLETE:String = "component_api_available";
public function KongregateEvent(_arg1:String){
super(_arg1);
}
}
}//package com.kongregate.as3.client.events
Section 32
//AbstractShadowService (com.kongregate.as3.client.services.AbstractShadowService)
package com.kongregate.as3.client.services {
import flash.events.*;
public class AbstractShadowService extends EventDispatcher {
protected function alert(_arg1:String, _arg2:String, _arg3="", _arg4:String=""):void{
trace(((((((("Kongregate API: " + _arg1) + ".") + _arg2) + "(") + _arg3) + ") ") + _arg4));
}
}
}//package com.kongregate.as3.client.services
Section 33
//HighScoreServiceShadow (com.kongregate.as3.client.services.HighScoreServiceShadow)
package com.kongregate.as3.client.services {
public class HighScoreServiceShadow extends AbstractShadowService implements IHighScoreServices {
private var mode:String;
public function HighScoreServiceShadow(){
mode = "";
}
public function submit(_arg1:Number, _arg2:String=null):void{
alert("IHighScoreServices", "submit", arguments);
}
public function connect():Boolean{
alert("IKongregateServices", "connect");
return (true);
}
public function requestList(_arg1:Function):void{
alert("IHighScoreServices", "requestList", "", (("[Mode: " + mode) + "]"));
_arg1({success:false});
}
public function setMode(_arg1:String):void{
alert("IHighScoreServices", "setMode", arguments);
this.mode = _arg1;
}
}
}//package com.kongregate.as3.client.services
Section 34
//IHighScoreServices (com.kongregate.as3.client.services.IHighScoreServices)
package com.kongregate.as3.client.services {
public interface IHighScoreServices {
function setMode(_arg1:String):void;
function submit(_arg1:Number, _arg2:String=null):void;
function requestList(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 35
//IKongregateServices (com.kongregate.as3.client.services.IKongregateServices)
package com.kongregate.as3.client.services {
import flash.events.*;
public interface IKongregateServices extends IEventDispatcher {
function getPlayerInfo(_arg1:Function):void;
function connect(_arg1:Number=-1):Boolean;
}
}//package com.kongregate.as3.client.services
Section 36
//IStatServices (com.kongregate.as3.client.services.IStatServices)
package com.kongregate.as3.client.services {
public interface IStatServices {
function submitArray(_arg1:Array):void;
function submit(_arg1:String, _arg2:Number):void;
}
}//package com.kongregate.as3.client.services
Section 37
//IUserServices (com.kongregate.as3.client.services.IUserServices)
package com.kongregate.as3.client.services {
public interface IUserServices {
function getName():String;
function getPlayerInfo(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 38
//KongregateServiceShadow (com.kongregate.as3.client.services.KongregateServiceShadow)
package com.kongregate.as3.client.services {
public class KongregateServiceShadow extends AbstractShadowService implements IKongregateServices {
public function getName():String{
alert("IKongregateServices", "getName");
return ("Guest");
}
public function connect(_arg1:Number=-1):Boolean{
alert("IKongregateServices", "connect", arguments);
return (true);
}
public function getPlayerInfo(_arg1:Function):void{
alert("IKongregateServices", "getPlayerInfo");
_arg1(new Object());
}
}
}//package com.kongregate.as3.client.services
Section 39
//StatServiceShadow (com.kongregate.as3.client.services.StatServiceShadow)
package com.kongregate.as3.client.services {
public class StatServiceShadow extends AbstractShadowService implements IStatServices {
public function submitArray(_arg1:Array):void{
alert("IStatServices", "submitArray", arguments);
}
public function submit(_arg1:String, _arg2:Number):void{
alert("IStatServices", "submitStat", arguments);
}
}
}//package com.kongregate.as3.client.services
Section 40
//UserServiceShadow (com.kongregate.as3.client.services.UserServiceShadow)
package com.kongregate.as3.client.services {
public class UserServiceShadow extends AbstractShadowService implements IUserServices {
public function getName():String{
alert("UserService", "getName");
return ("Guest");
}
public function getPlayerInfo(_arg1:Function):void{
alert("UserService", "getPlayerInfo");
_arg1({isGuest:true, name:"Guest", points:0, level:0, isMode:false, isAdmin:false, isDeveloper:false, avatarPath:"", chatAvatarPath:""});
}
}
}//package com.kongregate.as3.client.services
Section 41
//IAPIBootstrap (com.kongregate.as3.client.IAPIBootstrap)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
public interface IAPIBootstrap {
function init(_arg1:Event=null, _arg2:Stage=null):void;
function hideLog():void;
function showLog(_arg1:int=0):void;
}
}//package com.kongregate.as3.client
Section 42
//KongregateAPI (com.kongregate.as3.client.KongregateAPI)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.utils.*;
import com.kongregate.as3.client.services.*;
import com.kongregate.as3.client.events.*;
import flash.system.*;
import flash.errors.*;
public class KongregateAPI extends Sprite {
private const VERSION:Number = 1;
private var loader:Loader;
private var loadedDomain:ApplicationDomain;
private static const CLASS_USER:String = "com.kongregate.as3.client.services.UserServices";
private static const CLASS_STATS:String = "com.kongregate.as3.client.services.StatServices";
private static const CLASS_SERVICES:String = "com.kongregate.as3.client.services.KongregateServices";
private static const CLASS_SCORES:String = "com.kongregate.as3.client.services.HighScoreServices";
private static const DEBUG_API_URL:String = "//Linuxpc/kongregate/public/flash/API_AS3.swf";
private static var _connected:Boolean;
private static var kUser:IUserServices;
private static var _loaded:Boolean;
private static var kServices:IKongregateServices;
private static var kScores:IHighScoreServices;
private static var mInstance:KongregateAPI;
private static var kStats:IStatServices;
private static var kAPI:IAPIBootstrap;
public function KongregateAPI(){
if (mInstance != null){
throw (new Error("Warning: KongregateAPI has been added to stage more than once or accessed improperly. Use getInstance() or a stage reference to access."));
};
mInstance = this;
this.addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
}
public function get loaded():Boolean{
return (_loaded);
}
public function get connected():Boolean{
return (_connected);
}
private function alertConnected(_arg1:TimerEvent=null):void{
var _local2:KongregateEvent;
var _local3:Boolean;
_local2 = new KongregateEvent(KongregateEvent.COMPLETE);
_local3 = this.dispatchEvent(_local2);
}
private function init(_arg1:Event):void{
var _local2:Object;
var _local3:String;
var _local4:URLRequest;
var _local5:LoaderContext;
this.removeEventListener(Event.ADDED_TO_STAGE, init);
_loaded = false;
_connected = false;
_local2 = LoaderInfo(root.loaderInfo).parameters;
_local3 = _local2.api_path;
if (_local3 == null){
trace("Alert: Kongregate API could not be loaded, due to local testing. API will load when the game is uploaded.");
createShadowServices();
return;
};
Security.allowDomain("*.kongregate.com");
Security.allowDomain("kongregatetrunk.com");
_local4 = new URLRequest(_local3);
_local5 = new LoaderContext(false);
_local5.applicationDomain = ApplicationDomain.currentDomain;
_local5.securityDomain = SecurityDomain.currentDomain;
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.load(_local4, _local5);
}
public function get api():IAPIBootstrap{
return (kAPI);
}
private function loadComplete(_arg1:Event):void{
getServices();
}
public function get scores():IHighScoreServices{
return (kScores);
}
private function ioErrorHandler(_arg1:IOErrorEvent):void{
throw (new IOError(("API file not found. " + _arg1)));
}
public function get services():IKongregateServices{
return (kServices);
}
public function get stats():IStatServices{
return (kStats);
}
private function createShadowServices():void{
var _local1:Timer;
trace(">>> Kongregate Shadow Services instantiated for local development..");
kServices = new KongregateServiceShadow();
kScores = new HighScoreServiceShadow();
kStats = new StatServiceShadow();
kUser = new UserServiceShadow();
_local1 = new Timer(200, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, alertConnected);
_local1.start();
_connected = true;
}
public function get user():IUserServices{
return (kUser);
}
private function getServices():void{
var _local1:ApplicationDomain;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = ApplicationDomain.currentDomain;
kAPI = IAPIBootstrap(loader.getChildAt(0));
this.addChild(loader);
_local2 = _local1.getDefinition(CLASS_SERVICES);
trace(_local2);
kServices = _local2.getInstance();
_local3 = _local1.getDefinition(CLASS_SCORES);
kScores = _local3.getInstance();
_local4 = _local1.getDefinition(CLASS_STATS);
kStats = _local4.getInstance();
_local5 = _local1.getDefinition(CLASS_USER);
kUser = _local5.getInstance();
kServices.connect(VERSION);
_loaded = true;
_connected = true;
alertConnected();
}
public static function getInstance():KongregateAPI{
if (!mInstance){
throw (new IllegalOperationError("You must add the Kongregate API component to the stage before attempting to access it."));
};
return (mInstance);
}
}
}//package com.kongregate.as3.client
Section 43
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import IO.*;
import flash.system.*;
public class AdLoader {
private static var cpmstarLoader:Loader;
private static var mParent:DisplayObjectContainer;
private static var mRetries:int = 5;
public static function LoadAd(_arg1:DisplayObjectContainer=null):void{
var _local2:int;
var _local3:int;
var _local4:String;
mParent = (_arg1) ? _arg1 : mParent;
_local2 = 1051;
_local3 = 1;
Security.allowDomain("server.cpmstar.com");
_local4 = "http://server.cpmstar.com/adviewas3.swf";
cpmstarLoader = new Loader();
cpmstarLoader.load(new URLRequest(((((_local4 + "?poolid=") + _local2) + "&subpoolid=") + _local3)));
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, e_COMPLETE);
cpmstarLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, e_IOERROR);
}
public static function e_COMPLETE(_arg1:Event):void{
mParent.addChild(cpmstarLoader);
CMochiBot.Track(CMochiBot.BXH_ZW_ADSDISPLAYED);
}
public static function e_IOERROR(_arg1:IOErrorEvent):void{
if (--mRetries > 0){
LoadAd();
};
}
}
}//package CPMStar
Section 44
//CGenExplosion (Draw.CGenExplosion)
package Draw {
import flash.display.*;
import flash.geom.*;
import STC9.Bitmap.*;
import flash.events.*;
public class CGenExplosion extends CSprite {
private var renderContainer:Sprite;
private var renderScalar:MovieClip;
private var dScaleSpeed:Number;// = 0.1
private var particles:Array;
private var m:Matrix;
private var rDelta:Number;// = 8
private var genSteps:int;
private var particleClasses:Array;
private var pCounter:int;// = 0
private var dDeltaDecay:Number;// = 0.99
public function CGenExplosion(_arg1:Array, _arg2:Number=1, _arg3:int=5):void{
rDelta = 8;
dScaleSpeed = 0.1;
dDeltaDecay = 0.99;
pCounter = 0;
m = new Matrix();
super();
genSteps = _arg3;
particleClasses = _arg1;
renderScalar = new MovieClip();
renderContainer = new Sprite();
renderScalar.addChild(renderContainer);
renderContainer.scaleX = (renderContainer.scaleY = (0.1 * _arg2));
mFrames = Render();
}
public function Draw(_arg1:CBitmapData, _arg2:int, _arg3:int, _arg4:Number=0, _arg5:Number=1, _arg6:Number=1):void{
var _local7:int;
var _local8:CSpriteBMD;
_local7 = ((_arg4 * mFrames.length) % mFrames.length);
_local8 = mFrames[_local7];
_local8.Draw(_arg1, _arg2, _arg3, _arg5, _arg6);
}
private function ProcessParticles(_arg1:int):Boolean{
var _local2:MovieClip;
while (_arg1) {
if ((((particles.length < 10)) && ((pCounter > 0)))){
if (Math.random() > 0.5){
AddParticle();
};
};
for each (_local2 in particles.slice()) {
_local2.scaleX = (_local2.scaleX + ((_local2.dScale - _local2.scaleX) * dScaleSpeed));
_local2.scaleY = _local2.scaleX;
_local2.x = (_local2.x + _local2.dDelta.x);
_local2.y = (_local2.y + _local2.dDelta.y);
_local2.dDelta.normalize((_local2.dDelta.length * dDeltaDecay));
_local2.dDelta.y = (_local2.dDelta.y - 0.25);
_local2.rotation = (_local2.rotation + _local2.dRotation);
_local2.dRotation = (_local2.dRotation * 1.1);
_local2.nextFrame();
if (_local2.currentFrame == _local2.totalFrames){
particles.splice(particles.indexOf(_local2), 1);
renderContainer.removeChild(_local2);
if (particles.length == 0){
return (false);
};
};
};
_arg1--;
};
return (true);
}
private function AddParticle():void{
var _local1:*;
_local1 = new (particleClasses[int((Math.random() * particleClasses.length))]);
particles.push(_local1);
renderContainer.addChildAt(_local1, 0);
_local1.blendMode = "add";
_local1.scaleX = (_local1.scaleY = (0.5 + (Math.random() * 0.5)));
_local1.dDelta = m.transformPoint(new Point((rDelta * (1 + (Math.random() * 0.5))), 0));
_local1.dDelta.y = (_local1.dDelta.y * (28 / 40));
_local1.dScale = ((Math.random() * 0.4) + 1.6);
_local1.dRotation = ((Math.random() * 1) - 0.5);
_local1.stop();
m.rotate((Math.random() * (Math.PI * 2)));
pCounter--;
}
override public function get _CLASSID_():String{
return ("CGenExplosion");
}
public function DrawGFX(_arg1:Graphics, _arg2:int, _arg3:int, _arg4:Number=0, _arg5:Number=1):void{
var _local6:int;
var _local7:CSpriteBMD;
_local6 = ((_arg4 * mFrames.length) % mFrames.length);
_local7 = mFrames[_local6];
_local7.DrawGFX(_arg1, _arg2, _arg3, _arg5);
}
private function Render():Array{
var _local1:Array;
var _local2:*;
particles = new Array();
pCounter = 10;
_local1 = new Array();
_local2 = new CSpriteBMD(100, 100);
while (ProcessParticles(genSteps)) {
_local1.push(CSpriteBMD.asDisplayObject(renderScalar));
};
return (_local1);
}
}
}//package Draw
Section 45
//CGenFire (Draw.CGenFire)
package Draw {
import flash.display.*;
import flash.geom.*;
import STC9.Bitmap.*;
import flash.events.*;
public class CGenFire extends CSprite {
private var iCounter_Reset:int;// = 0
private var renderContainer:Sprite;
private var iCounter:int;// = 0
private var renderScalar:MovieClip;
private var pCounterMax:int;// = 0
private var dScaleSpeed:Number;// = 0.1
private var particles:Array;
private var m:Matrix;
private var rDelta:Number;// = 8
private var genSteps:int;
private var particleClasses:Array;
private var pCounter:int;// = 0
private var dDeltaDecay:Number;// = 0.99
public function CGenFire(_arg1:Array, _arg2:Number=1, _arg3:int=5):void{
rDelta = 8;
dScaleSpeed = 0.1;
dDeltaDecay = 0.99;
pCounter = 0;
pCounterMax = 0;
iCounter = 0;
iCounter_Reset = 0;
m = new Matrix();
super();
genSteps = ((_arg3)<=0) ? 1 : _arg3;
particleClasses = _arg1;
renderScalar = new MovieClip();
renderContainer = new Sprite();
renderScalar.addChild(renderContainer);
renderContainer.scaleX = (renderContainer.scaleY = (0.1 * _arg2));
mFrames = Render();
}
public function Draw(_arg1:CBitmapData, _arg2:int, _arg3:int, _arg4:Number=0, _arg5:Number=1, _arg6:Number=1):void{
var _local7:int;
var _local8:CSpriteBMD;
_local7 = ((_arg4 * mFrames.length) % mFrames.length);
_local8 = mFrames[_local7];
_local8.Draw(_arg1, _arg2, _arg3, _arg5, _arg6);
}
private function ProcessParticles(_arg1:int):Boolean{
var _local2:MovieClip;
while (_arg1) {
if ((((particles.length < pCounterMax)) && ((pCounter > 0)))){
if (iCounter-- == 0){
iCounter = iCounter_Reset;
AddParticle();
};
};
for each (_local2 in particles.slice()) {
_local2.scaleX = (_local2.scaleX + ((_local2.dScale - _local2.scaleX) * dScaleSpeed));
_local2.scaleY = _local2.scaleX;
_local2.x = (_local2.x + _local2.dDelta.x);
_local2.y = (_local2.y + _local2.dDelta.y);
_local2.dDelta.normalize((_local2.dDelta.length * dDeltaDecay));
_local2.dDelta.y = (_local2.dDelta.y - 0.5);
_local2.rotation = (_local2.rotation + _local2.dRotation);
_local2.dRotation = (_local2.dRotation * 1.1);
_local2.nextFrame();
if (_local2.currentFrame == _local2.totalFrames){
particles.splice(particles.indexOf(_local2), 1);
renderContainer.removeChild(_local2);
if (particles.length == 0){
return (false);
};
};
};
_arg1--;
};
return (true);
}
override public function get _CLASSID_():String{
return ("CGenFire");
}
public function DrawGFX(_arg1:Graphics, _arg2:int, _arg3:int, _arg4:Number=0, _arg5:Number=1):void{
var _local6:int;
var _local7:CSpriteBMD;
_local6 = ((_arg4 * mFrames.length) % mFrames.length);
_local7 = mFrames[_local6];
_local7.DrawGFX(_arg1, _arg2, _arg3, _arg5);
}
private function Render():Array{
var _local1:Array;
particles = new Array();
pCounter = 10;
iCounter_Reset = (iCounter = 4);
pCounterMax = 10;
_local1 = new Array();
while (ProcessParticles(genSteps)) {
_local1.push(CSpriteBMD.asDisplayObject(renderScalar));
};
return (_local1);
}
private function AddParticle():void{
var _local1:*;
_local1 = new (particleClasses[int((Math.random() * particleClasses.length))]);
particles.push(_local1);
renderContainer.addChildAt(_local1, 0);
_local1.blendMode = "add";
_local1.scaleX = (_local1.scaleY = (0.5 + (Math.random() * 0.5)));
_local1.dDelta = new Point((rDelta * ((Math.random() * 2) - 1)), -50);
_local1.dDelta.y = (_local1.dDelta.y * (28 / 40));
_local1.dScale = ((Math.random() * 0.4) + 1.6);
_local1.dRotation = ((Math.random() * 1) - 0.5);
_local1.stop();
pCounter--;
}
}
}//package Draw
Section 46
//CGenSmoke (Draw.CGenSmoke)
package Draw {
import flash.display.*;
import flash.geom.*;
import STC9.Bitmap.*;
import flash.events.*;
public class CGenSmoke extends CSprite {
private var renderContainer:Sprite;
private var renderScalar:MovieClip;
private var dScaleSpeed:Number;// = 0.1
private var particles:Array;
private var m:Matrix;
private var rDelta:Number;// = 8
private var genSteps:int;
private var particleClasses:Array;
private var pCounter:int;// = 0
private var dDeltaDecay:Number;// = 0.99
public function CGenSmoke(_arg1:Array, _arg2:Number=1, _arg3:int=5):void{
rDelta = 8;
dScaleSpeed = 0.1;
dDeltaDecay = 0.99;
pCounter = 0;
m = new Matrix();
super();
genSteps = _arg3;
particleClasses = _arg1;
renderScalar = new MovieClip();
renderContainer = new Sprite();
renderScalar.addChild(renderContainer);
renderContainer.scaleX = (renderContainer.scaleY = (0.1 * _arg2));
mFrames = Render();
}
public function Draw(_arg1:CBitmapData, _arg2:int, _arg3:int, _arg4:Number=0, _arg5:Number=1, _arg6:Number=1):void{
var _local7:int;
var _local8:CSpriteBMD;
_local7 = ((_arg4 * mFrames.length) % mFrames.length);
_local8 = mFrames[_local7];
_local8.Draw(_arg1, _arg2, _arg3, _arg5, _arg6);
}
private function ProcessParticles(_arg1:int):Boolean{
var _local2:MovieClip;
while (_arg1) {
if ((((particles.length < 10)) && ((pCounter > 0)))){
if (Math.random() > 0.5){
AddParticle();
};
};
for each (_local2 in particles.slice()) {
_local2.scaleX = (_local2.scaleX + ((_local2.dScale - _local2.scaleX) * dScaleSpeed));
_local2.scaleY = _local2.scaleX;
_local2.x = (_local2.x + _local2.dDelta.x);
_local2.y = (_local2.y + _local2.dDelta.y);
_local2.dDelta.normalize((_local2.dDelta.length * dDeltaDecay));
_local2.dDelta.y = (_local2.dDelta.y - 0.25);
_local2.rotation = (_local2.rotation + _local2.dRotation);
_local2.dRotation = (_local2.dRotation * 1.1);
_local2.nextFrame();
if (_local2.currentFrame == _local2.totalFrames){
particles.splice(particles.indexOf(_local2), 1);
renderContainer.removeChild(_local2);
if (particles.length == 0){
return (false);
};
};
};
_arg1--;
};
return (true);
}
private function AddParticle():void{
var _local1:*;
_local1 = new (particleClasses[int((Math.random() * particleClasses.length))]);
particles.push(_local1);
renderContainer.addChildAt(_local1, 0);
_local1.scaleX = (_local1.scaleY = (0.5 + (Math.random() * 0.5)));
_local1.dDelta = m.transformPoint(new Point((rDelta * (1 + (Math.random() * 0.5))), 0));
_local1.dDelta.y = (_local1.dDelta.y * (28 / 40));
_local1.dScale = ((Math.random() * 0.4) + 1.6);
_local1.dRotation = ((Math.random() * 1) - 0.5);
_local1.stop();
m.rotate((Math.random() * (Math.PI * 2)));
pCounter--;
}
override public function get _CLASSID_():String{
return ("CGenSmoke");
}
public function DrawGFX(_arg1:Graphics, _arg2:int, _arg3:int, _arg4:Number=0, _arg5:Number=1):void{
var _local6:int;
var _local7:CSpriteBMD;
_local6 = ((_arg4 * mFrames.length) % mFrames.length);
_local7 = mFrames[_local6];
_local7.DrawGFX(_arg1, _arg2, _arg3, _arg5);
}
private function Render():Array{
var _local1:Array;
var _local2:*;
particles = new Array();
pCounter = 10;
_local1 = new Array();
_local2 = new CSpriteBMD(100, 100);
while (ProcessParticles(genSteps)) {
_local1.push(CSpriteBMD.asDisplayObject(renderScalar));
};
return (_local1);
}
}
}//package Draw
Section 47
//CSprite (Draw.CSprite)
package Draw {
public class CSprite {
public var mFrame:CSpriteBMD;
public var mDirections:Array;
public var mDirectionAmount:int;// = 0
public var mFrames:Array;
public var mFrameCount:int;// = 0
public function CSprite(){
mFrameCount = 0;
mDirectionAmount = 0;
super();
}
public function get _CLASSID_():String{
return ("CSprite");
}
public function toString():String{
return (_CLASSID_);
}
public function cacheDirections():void{
var _local1:Array;
var _local2:int;
var _local3:Number;
_local1 = mDirections;
mDirections = new Array();
mDirectionAmount = _local1.length;
_local2 = 0;
_local3 = (mDirectionAmount / 0x0100);
while (_local2 < 0x0100) {
mDirections[_local2] = _local1[(Math.round((_local2 * _local3)) % mDirectionAmount)];
_local2++;
};
}
}
}//package Draw
Section 48
//CSpriteBMD (Draw.CSpriteBMD)
package Draw {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class CSpriteBMD extends BitmapData {
public var mDisplacement:Point;
public var mData:Object;
public static var mDrawColorTransform:ColorTransform = new ColorTransform();
public function CSpriteBMD(_arg1:int, _arg2:int, _arg3:Boolean=true, _arg4:uint=0xFF0000){
super(_arg1, _arg2, _arg3, _arg4);
mData = new Object();
mDisplacement = new Point();
}
private function ClipBMD():CSpriteBMD{
var _local1:Rectangle;
var _local2:Rectangle;
var _local3:CSpriteBMD;
var _local4:ByteArray;
_local1 = this.rect;
_local2 = this.getColorBoundsRect(4278190080, 0, false);
if ((((_local2.width == 0)) || ((_local2.height == 0)))){
this.dispose();
return (new CSpriteBMD(1, 1));
};
_local3 = new CSpriteBMD(_local2.width, _local2.height);
_local3.mDisplacement = this.mDisplacement.add(_local2.topLeft);
_local4 = this.getPixels(_local2);
_local4.position = 0;
_local3.setPixels(_local3.rect, _local4);
this.dispose();
return (_local3);
}
public function toString():String{
return (_CLASSID_);
}
public function DrawGFX(_arg1:Graphics, _arg2:int, _arg3:int, _arg4:Number=1){
_arg1.beginBitmapFill(this, new Matrix(1, 0, 0, 1, (_arg2 + mDisplacement.x), (_arg3 + mDisplacement.y)));
_arg1.drawRect((_arg2 + mDisplacement.x), (_arg3 + mDisplacement.y), this.width, this.height);
_arg1.endFill();
}
public function get _CLASSID_():String{
return ("CSpriteBMD");
}
public function Draw(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:Number=1, _arg5:Number=1):void{
var _local6:Point;
if ((((_arg4 == 1)) && ((_arg5 == 1)))){
_local6 = new Point((_arg2 + mDisplacement.x), (_arg3 + mDisplacement.y));
_arg1.copyPixels(this, this.rect, _local6, null, null, false);
} else {
mDrawColorTransform.alphaMultiplier = _arg4;
_arg1.draw(this, new Matrix(_arg5, 0, 0, _arg5, (_arg2 + (mDisplacement.x * _arg5)), (_arg3 + (mDisplacement.y * _arg5))), mDrawColorTransform);
};
}
public static function asBitmapData(_arg1:BitmapData, _arg2:Point, _arg3:Number=1, _arg4:Array=null):CSpriteBMD{
var _local5:CSpriteBMD;
_local5 = new CSpriteBMD(_arg1.width, _arg1.height);
_local5.copyPixels(_arg1, _arg1.rect, new Point(0, 0));
_local5.mDisplacement = _arg2;
return (_local5.ClipBMD());
}
public static function asMovieClip(_arg1:MovieClip, _arg2:Number=1, _arg3:Number=1, _arg4:Array=null):CSpriteBMD{
_arg1.gotoAndStop(_arg2);
return (asDisplayObject(_arg1, _arg3, _arg4));
}
public static function asDisplayObject(_arg1:DisplayObject, _arg2:Number=1, _arg3:Array=null):CSpriteBMD{
var _local4:Rectangle;
var _local5:CSpriteBMD;
var _local6:Matrix;
_arg1.filters = (_arg3) ? _arg3 : [];
_local4 = _arg1.getBounds(_arg1);
_local4.inflate(1, 1);
_local4.left = Math.floor((_local4.left * _arg2));
_local4.right = Math.floor((_local4.right * _arg2));
_local4.top = Math.ceil((_local4.top * _arg2));
_local4.bottom = Math.ceil((_local4.bottom * _arg2));
_local5 = ((((_local4.width == 0)) || ((_local4.height == 0)))) ? new CSpriteBMD(1, 1) : new CSpriteBMD(_local4.width, _local4.height);
_local5.mDisplacement = new Point(_local4.x, _local4.y);
_local6 = new Matrix();
_local6.scale(_arg2, _arg2);
_local6.translate(-(_local5.mDisplacement.x), -(_local5.mDisplacement.y));
_local5.draw(_arg1, _local6, undefined, "normal", undefined, false);
return (_local5.ClipBMD());
}
}
}//package Draw
Section 49
//CSpriteMCAnimation (Draw.CSpriteMCAnimation)
package Draw {
import flash.display.*;
import STC9.Bitmap.*;
public class CSpriteMCAnimation extends CSprite {
public function CSpriteMCAnimation(_arg1:MovieClip):void{
Buffer(_arg1);
mFrameCount = mFrames.length;
}
public function Draw(_arg1:CBitmapData, _arg2:int, _arg3:int, _arg4:Number=0, _arg5:Number=1, _arg6:Number=1):void{
var _local7:int;
var _local8:CSpriteBMD;
_local7 = ((_arg4 * mFrames.length) % mFrames.length);
_local8 = mFrames[_local7];
_local8.Draw(_arg1, _arg2, _arg3, _arg5, _arg6);
}
public function GetSpriteBMD(_arg1:Number=0):CSpriteBMD{
var _local2:int;
_local2 = ((_arg1 * mFrames.length) % mFrames.length);
return (mFrames[_local2]);
}
override public function get _CLASSID_():String{
return ("CSpriteMCAnimation");
}
override public function toString():String{
return (_CLASSID_);
}
private function Buffer(_arg1:MovieClip, _arg2:int=1){
var _local3:MovieClip;
var _local4:Number;
mFrames = new Array();
_local3 = _arg1;
if (_arg1.getChildByName("_Contents")){
_arg1 = MovieClip(_arg1.getChildByName("_Contents"));
};
_local4 = 1;
while (_local4 <= _arg1.totalFrames) {
_arg1.gotoAndStop(_local4);
mFrames.push(CSpriteBMD.asMovieClip(_local3));
_local4++;
};
}
}
}//package Draw
Section 50
//CSpriteMCOmni (Draw.CSpriteMCOmni)
package Draw {
import flash.display.*;
import flash.geom.*;
import STC9.Bitmap.*;
import Landscape.*;
import STC9.Math.*;
public class CSpriteMCOmni extends CSprite {
private var mTopID:String;
private var mFrontID:String;
private static const zMatrix:Matrix = new Matrix(1, 0, 0, 1, 0, 0);
private static var ELE_FWIDTH:Number;
private static var ELE_FPLIST1:Array;
private static var ELE_LIST2:Array = [new CVector3(), new CVector3(), new CVector3(), new CVector3()];
private static var ELE_FHEIGHT:Number;
private static var ELE_TMAP1:Array;
private static var ELE_THEIGHT:Number;
private static var ELE_TWIDTH:Number;
private static var ELE_FMAP1:Array;
private static var ELE_TPLIST1:Array;
public function CSpriteMCOmni(_arg1:MovieClip, _arg2:int=1, _arg3:Number=0, _arg4:String="mcTop", _arg5:String="mcFront"):void{
mFrontID = _arg5;
mTopID = _arg4;
Buffer(_arg1, _arg2, _arg3);
}
private function _BufferEle(_arg1:MovieClip, _arg2:Number, _arg3:Number=0):CSpriteBMD{
var _local4:CMatrix4;
var _local5:Number;
var _local6:Array;
var _local7:int;
var _local8:CVector3;
_local4 = CMatrix4.Identity_Matrix();
_local5 = _arg2;
_local4.RotateZ(-(_local5));
_local4.RotateY(-(_arg3));
_local4.transformVectors(ELE_FPLIST1, ELE_LIST2);
_local7 = (ELE_LIST2.length - 1);
_local6 = new Array();
while (_local7 >= 0) {
_local8 = ELE_LIST2[_local7];
_local6[_local7] = CLSDraw.ProjectionXYZ(_local8.x, _local8.y, _local8.z);
_local7--;
};
_arg1[mFrontID].transform.matrix = CFLMatrix.RemapPlane(ELE_FMAP1, _local6);
_arg1[mFrontID].visible = ((!((_arg1[mFrontID].width == 0))) || (!((_arg1[mFrontID].height == 0))));
_local4.transformVectors(ELE_TPLIST1, ELE_LIST2);
_local7 = (ELE_LIST2.length - 1);
_local6 = new Array();
while (_local7 >= 0) {
_local8 = ELE_LIST2[_local7];
_local6[_local7] = CLSDraw.ProjectionXYZ(_local8.x, _local8.y, _local8.z);
_local7--;
};
_arg1[mTopID].transform.matrix = CFLMatrix.RemapPlane(ELE_TMAP1, _local6);
_arg1[mTopID].visible = ((!((_arg1[mTopID].width == 0))) || (!((_arg1[mTopID].height == 0))));
return (CSpriteBMD.asDisplayObject(_arg1));
}
private function Buffer(_arg1:MovieClip, _arg2:int=1, _arg3:Number=0){
var _local4:Number;
var _local5:int;
mDirections = new Array();
if (_arg3){
_BufferEle_PRE(_arg1, _arg3);
};
_local4 = 0;
_local5 = 0;
while (_local4 < (Math.PI * 2)) {
mDirections.push((_arg3) ? _BufferEle(_arg1, _local4, _arg3) : _Buffer(_arg1, _local4));
_local4 = (_local4 + ((Math.PI * 2) / _arg2));
_local5++;
};
cacheDirections();
}
private function _BufferEle_PRE(_arg1:MovieClip, _arg2:Number=0):void{
var _local3:Number;
var _local4:Number;
ELE_FWIDTH = (_arg1[mFrontID].width / 2);
ELE_FHEIGHT = (_arg1[mFrontID].height / 2);
ELE_TWIDTH = _arg1[mTopID].width;
ELE_THEIGHT = (_arg1[mTopID].height / 2);
_local3 = (ELE_FWIDTH / CLSDraw.xProjection);
_local4 = (ELE_FHEIGHT / CLSDraw.xProjection);
ELE_FPLIST1 = [new CVector3(0, -(_local3), -(_local4)), new CVector3(0, -(_local3), _local4), new CVector3(0, _local3, _local4), new CVector3(0, _local3, -(_local4))];
ELE_FMAP1 = [new Point(-(ELE_FWIDTH), -(ELE_FHEIGHT)), new Point(-(ELE_FWIDTH), ELE_FHEIGHT), new Point(ELE_FWIDTH, ELE_FHEIGHT), new Point(ELE_FWIDTH, -(ELE_FHEIGHT))];
_local3 = (ELE_TWIDTH / CLSDraw.xProjection);
_local4 = (ELE_THEIGHT / CLSDraw.xProjection);
ELE_TPLIST1 = [new CVector3(0, -(_local4)), new CVector3(0, _local4), new CVector3(_local3, _local4), new CVector3(_local3, -(_local4))];
ELE_TMAP1 = [new Point(0, -(ELE_THEIGHT)), new Point(0, ELE_THEIGHT), new Point(ELE_TWIDTH, ELE_THEIGHT), new Point(ELE_TWIDTH, -(ELE_THEIGHT))];
}
public function Draw(_arg1:CBitmapData, _arg2:int, _arg3:int, _arg4:int=0, _arg5:Number=1):void{
var _local6:CSpriteBMD;
_local6 = mDirections[_arg4];
_local6.Draw(_arg1, _arg2, _arg3, _arg5);
}
override public function get _CLASSID_():String{
return ("CSpriteMCOmni");
}
override public function toString():String{
return (_CLASSID_);
}
private function _Buffer(_arg1:MovieClip, _arg2:Number):CSpriteBMD{
var _local3:Matrix;
var _local4:Point;
var _local5:Point;
var _local6:Matrix;
var _local7:Number;
var _local8:Number;
var _local9:Matrix;
var _local10:Number;
var _local11:Matrix;
_local3 = new Matrix();
_local3.rotate(_arg2);
_local4 = CLSDraw.ProjectionPoint(_local3.transformPoint(new Point((1 / CLSDraw.xProjection), 0)));
_local5 = CLSDraw.ProjectionPoint(_local3.transformPoint(new Point(0, (1 / CLSDraw.xProjection))));
_local6 = new Matrix();
_local7 = _local4.x;
_local8 = _local5.y;
_local6.b = (_local4.y / _local7);
_local6.c = (_local5.x / _local8);
_local9 = new Matrix();
_local9.scale(_local7, _local8);
_local9.concat(_local6);
_arg1[mTopID].transform.matrix = _local9.clone();
_local10 = (_arg2 + (Math.PI / 2));
_local11 = new Matrix(Math.cos(_local10), Math.sin(_local10), 0, 1, 0, 0);
_local11.scale(1, CLSDraw.sProjection);
_arg1[mFrontID].transform.matrix = _local11;
return (CSpriteBMD.asDisplayObject(_arg1));
}
}
}//package Draw
Section 51
//CSpriteXSIAnimation (Draw.CSpriteXSIAnimation)
package Draw {
import flash.display.*;
import Thing.*;
import flash.geom.*;
import STC9.Bitmap.*;
import Landscape.*;
import STC9.Sprite.*;
public class CSpriteXSIAnimation extends CSprite {
public function Draw(_arg1:CBitmapData, _arg2:int, _arg3:int, _arg4:uint=0, _arg5:Number=0, _arg6:Number=1):void{
var _local7:int;
var _local8:CSpriteBMD;
_local7 = ((_arg5 * mFrameCount) % mFrameCount);
_local8 = mDirections[_arg4][_local7];
_local8.Draw(_arg1, _arg2, _arg3, _arg6);
}
override public function get _CLASSID_():String{
return ("CSpriteXSIAnimation");
}
override public function toString():String{
return (_CLASSID_);
}
public function GetData(_arg1:uint=0, _arg2:Number=0):Object{
var _local3:int;
_local3 = ((_arg2 * mFrameCount) % mFrameCount);
return (mDirections[_arg1][_local3].mData);
}
private function ConvertFramesToDirections():void{
var _local1:Array;
var _local2:CSpriteBMD;
_local1 = new Array();
for each (_local2 in mDirections[0]) {
_local1.push([_local2]);
};
mDirections = _local1;
}
public static function asSpriteSheet(_arg1:CSpriteSheet, _arg2:Boolean=false):Object{
var _local3:Object;
var _local4:ShadowMaker;
var _local5:Bitmap;
var _local6:Bitmap;
var _local7:Bitmap;
var _local8:CSpriteFrame;
var _local9:CSpriteXSIAnimation;
var _local10:CSpriteXSIAnimation;
var _local11:Array;
var _local12:Array;
var _local13:CSpriteBMD;
_local3 = new Object();
_local4 = new ShadowMaker();
_local5 = new Bitmap(null);
_local6 = new Bitmap(null);
_local7 = new Bitmap(null);
_local4._Container.addChild(_local5);
_local4._Shadow1.addChild(_local6);
_local4._Shadow2.addChild(_local7);
for each (_local8 in _arg1.mAllFrames) {
_local8.mAnimID = _local8.mAnimID.toLowerCase();
_local10 = (_local3[_local8.mAnimID] = (_local3[_local8.mAnimID]) ? _local3[_local8.mAnimID] : new (CSpriteXSIAnimation));
_local11 = ((_local3[_local8.mAnimID] = (_local3[_local8.mAnimID]) ? _local3[_local8.mAnimID] : new (CSpriteXSIAnimation)).mDirections = (_local10.mDirections) ? _local10.mDirections : new Array());
_local12 = (_local11[_local8.mDirectionIndex] = (_local11[_local8.mDirectionIndex]) ? _local11[_local8.mDirectionIndex] : new Array());
_local7.bitmapData = (_local6.bitmapData = (_local5.bitmapData = _local8));
_local7.x = (_local6.x = (_local5.x = _local8.mDisplacement.x));
_local7.y = (_local6.y = (_local5.y = _local8.mDisplacement.y));
_local13 = (_local12[_local8.mFrameIndex] = CSpriteBMD.asDisplayObject(_local4));
_local13.mData.mModelInfo = FormatModelInfo(_local8.mModelInfo);
};
if (_arg2){
for each (_local9 in _local3) {
_local9.ConvertFramesToDirections();
};
};
for each (_local9 in _local3) {
_local9.cacheDirections();
_local9.mFrameCount = _local9.mDirections[0].length;
};
return (_local3);
}
private static function FormatModelInfo(_arg1:Object):Object{
var _local2:Number;
var _local3:Object;
var _local4:Object;
var _local5:Object;
_local2 = ((32 / CLSDraw.xProjection) * (1 / 100));
for each (_local3 in _arg1) {
_local4 = _local3.mDirection;
_local5 = _local3.mPosition;
_local3.mDirection = new CThingV3(_local4.x, _local4.z, -(_local4.y));
_local3.mPosition = new CThingV3(_local5.x, _local5.z, -(_local5.y)).ScaleN(_local2);
};
return (_arg1);
}
}
}//package Draw
Section 52
//CGame (Game.CGame)
package Game {
import flash.display.*;
import Thing.*;
import flash.geom.*;
import STC9.Bitmap.*;
import Landscape.*;
import World.*;
import flash.utils.*;
import flash.events.*;
import IO.*;
import STC9.System.Profiler.*;
import Screen.*;
import STC9.IO.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
public class CGame extends Sprite {
private var mTrackOffset:Point;
public var mWorld:CWorld;
private var mKeyboard:CKeyboard;
private var mPauseScreen:Screen_Pause;
private var mFastMode:Boolean;
private var mLoadClasses:Array;
private var mLandscape:CLandscape;
public static const mScreenHeight:int = 490;
public static const START:String = "START";
public static const mScreenWidth:int = 700;
private static const fFrameTime:Number = 40;
public static const SECONDS:int = 25;
public static const DISPOSED:String = "DISPOSED";
public static const mScreenAspect:Number = 1.42857142857143;
public static const DEBUG:Boolean = true;
public static var mHUD:CHUD;
private static var mTimeSlice:int;
public static var mLevelData:Object;
public static var mFPS:CFPS;
public function CGame(){
visible = false;
}
public function Activate(_arg1:int):void{
CThingAudio.mSoundActive = ((CGlobalData.GetData("Sound", "on"))=="on") ? true : false;
CBitmapData.Record();
CGlobalData.SendData_LevelPlay(_arg1);
CMochiBot.Track(CMochiBot[(("BXH_ZW_LEVEL" + (_arg1 + 1)) + "PLAYS")]);
CMochiBot.Track(CMochiBot.BXH_ZW_LEVELSPLAYED);
mLevelData = CLevelData.GetData(_arg1);
CGlobalData.AddStat("Total games played", 1, "ADD");
CGlobalData.AddStat((("Level '" + mLevelData.mName) + "' played"), 1, "ADD");
mKeyboard = new CKeyboard(stage);
mFPS = new CFPS("RIGHT");
ProcessFrames_Reset();
mHUD = new CHUD();
mLandscape = new CLandscape();
mWorld = new CWorld(mLandscape);
SetGlobals();
mWorld.Start();
mTrackOffset = new Point(0, 0);
addChild(mLandscape);
this.stage.focus = stage;
mFastMode = ((CGlobalData.GetData("GameSpeed", "normal"))=="normal") ? false : true;
mLoadClasses = [CDevil, CZombie, CMummy, CVampire, CRunner, CDestroySmoke, CAppearSmoke, CExplosion, CFire];
stage.addEventListener(Event.ENTER_FRAME, e_ENTERFRAME_LOADING);
stage.quality = StageQuality.LOW;
if (CGlobalData.GetData("MOUSE", "on") == "on"){
Mouse.show();
} else {
Mouse.hide();
};
}
private function ProcessDebug():void{
if (!((CKeyboard.IsDown("SHIFT")) && (CKeyboard.IsDown("CONTROL")))){
return;
};
if (CKeyboard.IsReleased("INSERT")){
if (contains(mFPS)){
removeChild(mFPS);
} else {
addChild(mFPS);
};
};
if (CKeyboard.IsReleased("C")){
CGlobalData.SetData("MOUSE", ((CGlobalData.GetData("MOUSE"))=="on") ? "off" : "on");
if (CGlobalData.GetData("MOUSE") == "on"){
Mouse.show();
} else {
Mouse.hide();
};
};
if (CKeyboard.IsDown("UP")){
mTrackOffset.y--;
};
if (CKeyboard.IsDown("DOWN")){
mTrackOffset.y++;
};
if (CKeyboard.IsDown("LEFT")){
mTrackOffset.x--;
};
if (CKeyboard.IsDown("RIGHT")){
mTrackOffset.x++;
};
if (CKeyboard.IsDown("HOME")){
mTrackOffset.x = (mTrackOffset.y = 0);
};
}
public function Process():void{
SetGlobals();
if (mWorld.mPause == false){
if (((CKeyboard.IsPressed("P")) || (CKeyboard.IsPressed("ESCAPE")))){
Mouse.show();
mWorld.mPause = true;
mPauseScreen = new Screen_Pause();
mPauseScreen.scaleX = (mPauseScreen.scaleY = (700 / 800));
addChild(mPauseScreen);
mPauseScreen.mGame = this;
mPauseScreen.Activate();
mPauseScreen.addEventListener(CScreen_Pause.CLOSE, e_PAUSESCREEN_CLOSE);
mPauseScreen.addEventListener(CScreen_Pause.EXITGAME, e_PAUSESCREEN_EXITGAME);
CThingAudio.PauseAllSounds();
return;
};
};
mLandscape.TrackThing(mWorld.mTrackThing, mTrackOffset);
mWorld.Process();
mHUD.Process();
}
public function Draw():void{
SetGlobals();
if (mWorld.mPause){
return;
};
mLandscape.Draw();
}
private function e_PAUSESCREEN_EXITGAME(_arg1:Event):void{
mPauseScreen.removeEventListener(CScreen_Pause.EXITGAME, e_PAUSESCREEN_EXITGAME);
mWorld.mState = "CLOSE";
CThingAudio.StopAllSounds();
}
private function SetGlobals():void{
CThingMap.mWorld = mWorld;
CThingMap.mLandscape = mLandscape;
}
public function e_ENTERFRAME_LOADING(_arg1:Event):void{
var _local2:Class;
var _local3:int;
if (mLoadClasses.length == 0){
stage.removeEventListener(Event.ENTER_FRAME, e_ENTERFRAME_LOADING);
stage.addEventListener(Event.ENTER_FRAME, e_ENTERFRAME_START);
return;
};
_local2 = mLoadClasses.pop();
_local3 = getTimer();
var _local4 = _local2;
_local4["PrepareClass"]();
}
public function e_ENTERFRAME(_arg1:Event):void{
var _local2:int;
CThing.INDENT = "";
ProcessDebug();
mFPS.Update();
mFPS.StartProfile("A_TOTAL");
_local2 = (mFastMode) ? 1 : ProcessFrames();
if (_local2){
mFPS.StartProfile("A_PROCESS");
Process();
mFPS.StopProfile("A_PROCESS");
CThingAudio.UpdateAllSounds();
mFPS.StartProfile("A_DRAW");
Draw();
mFPS.StopProfile("A_DRAW");
};
mFPS.StopProfile("A_TOTAL");
if (mWorld.mState == "CLOSE"){
Dispose();
};
}
public function e_ENTERFRAME_START(_arg1:Event):void{
visible = true;
stage.removeEventListener(Event.ENTER_FRAME, e_ENTERFRAME_START);
dispatchEvent(new Event(START));
stage.addEventListener(Event.ENTER_FRAME, e_ENTERFRAME);
mKeyboard.Clear();
}
public function get _CLASSID_():String{
return ("CGame");
}
private function e_PAUSESCREEN_CLOSE(_arg1:Event):void{
removeChild(mPauseScreen);
mWorld.mPause = false;
mPauseScreen.removeEventListener(CScreen_Pause.CLOSE, e_PAUSESCREEN_CLOSE);
mPauseScreen = null;
this.stage.focus = stage;
mKeyboard.Clear();
CThingAudio.UnpauseAllSounds();
if (CGlobalData.GetData("MOUSE", "on") == "on"){
Mouse.show();
} else {
Mouse.hide();
};
}
public function Dispose():void{
CGlobalData.Flush();
mKeyboard.Dispose();
stage.removeEventListener(Event.ENTER_FRAME, e_ENTERFRAME);
removeChild(mLandscape);
if (contains(mFPS)){
removeChild(mFPS);
};
CThingAudio.StopAllSounds();
mLandscape.Dispose();
mWorld.Dispose();
mLandscape = null;
mWorld = null;
CBitmapData.ReleaseAll();
stage.quality = StageQuality.HIGH;
dispatchEvent(new Event(DISPOSED));
Mouse.show();
}
private static function ProcessFrames_Reset(){
mTimeSlice = getTimer();
}
private static function ProcessFrames():int{
var _local1:int;
_local1 = Math.min(10000, ((getTimer() - mTimeSlice) / fFrameTime));
if (_local1 > 0){
mTimeSlice = (mTimeSlice + (_local1 * fFrameTime));
};
return (_local1);
}
}
}//package Game
Section 53
//CGlobalData (Game.CGlobalData)
package Game {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.utils.*;
import com.kongregate.as3.client.*;
import IO.*;
import STC9.String.*;
import flash.system.*;
import flash.text.*;
import STC9.IO.*;
import STC9.System.Profiler.*;
import flash.geom.*;
import flash.external.*;
import flash.media.*;
public class CGlobalData {
public static const mCMGBoxheadTheZombieWarsURL:String = (mCMGURL + "Boxhead-The-Zombie-Wars.html");
public static const mTrackingURL:String = (mProjectURL + "Tracker.aspx");
public static const mBoxheadURL:String = "http://www.boxhead.seantcooper.com/";
public static const mCMGScoreURL:String = "http://scores.crazymonkeygames.com/hs/listscores.php?id=";
public static const mCMGURL:String = "http://www.crazymonkeygames.com/";
private static const lKey:int = 63;
public static const mInstructionsURL:String = (mProjectURL + "GameGuide.aspx");
private static const key:String = "J54D15DIB50AJBB2EAEGE55GECC0GG1F0DCJBH4E2GE400GBI143AI4G0IIHFGEA";
public static const mProjectURL:String = (mBoxheadURL + "Games/BXH_ZW/");
public static const mMochiBotURL:String = "http://www.mochibot.com/";
public static const mCMGBoxheadMoreRoomsURL:String = (mCMGURL + "Boxhead-More-Rooms.html");
public static const mCMGBoxhead2PlayRoomsURL:String = (mCMGURL + "Boxhead-2Play-Rooms.html");
public static const mCMGBoxheadTheRoomsURL:String = (mCMGURL + "Boxhead-The-Rooms.html");
public static const mWWLiveDate:Date = new Date(2008, (3 - 1), (7 + 7));
public static const mMoreGamesURL:String = "http://www.crazymonkeygames.com/";
public static const mFGLURL:String = "http://www.flashgamelicense.com/game_referral.php?name=Boxheads-The%20Zombie%20Wars";
public static const mGamesURL:String = "http://www.games.seantcooper.com/";
public static const mCMGBoxheadHalloweenURL:String = (mCMGURL + "Boxhead.html");
private static var mCurrentSendScore:Boolean;
private static var mSharedObject:SharedObject;
private static var mCurrentLevelIndex:int;
public static var mKongregate:KongregateAPI;
public static var mStats:Object;
private static var mData:Object;
private static var mCurrentDifficulyLevel:int;
public static var mLocalStats:Object;
private static var mKongStatFieldUpdate:Object;
public function get _CLASSID_():String{
return ("CGlobalData");
}
public static function GetData(_arg1:String, _arg2=null){
OpenSharedObject();
if (mData[_arg1] == null){
SetData(_arg1, _arg2);
return (_arg2);
};
return (mData[_arg1]);
}
public static function LoadKongregate(_arg1:DisplayObjectContainer):void{
if (((CBuild.mKongregateStats) && (((CProtection.isKONGREGATE()) || (CBuild.mDEBUG))))){
if (!mKongregate){
mKongregate = new KongregateAPI();
mKongregate.visible = false;
};
if (!_arg1.contains(mKongregate)){
_arg1.addChild(mKongregate);
};
};
}
public static function AddStat(_arg1:String, _arg2, _arg3:String="HIGHEST"):void{
var _local4:String;
OpenSharedObject();
_AddStat(mStats, _arg1, _arg2, _arg3);
if (_AddStat(mLocalStats, _arg1, _arg2, _arg3)){
mKongStatFieldUpdate[_arg1] = mLocalStats[_arg1];
};
if ((getTimer() - mKongStatFieldUpdate["__timer"]) > 5000){
for (_local4 in mKongStatFieldUpdate) {
KongregateSubmitStat(_local4, "", mKongStatFieldUpdate[_local4]);
};
mKongStatFieldUpdate = new Object();
mKongStatFieldUpdate["__timer"] = getTimer();
};
}
private static function KongregateSubmitStat(_arg1:String, _arg2:String, _arg3):void{
var _local4:String;
if (!mCurrentSendScore){
return;
};
if (!mKongregate){
return;
};
_local4 = ((mCurrentLevelIndex)>=4) ? "M1" : "M0";
_arg1 = _arg1.toLowerCase();
switch (_arg1){
case "zombie kills":
case "devil kills":
case "mummy kills":
case "vampire kills":
case "runner kills":
mKongregate.stats.submit((_arg2 + _arg1), _arg3);
break;
case "highest score":
case "highest level":
case "highest score multiplier":
mKongregate.stats.submit((((((_arg2 + _local4) + "D") + mCurrentDifficulyLevel) + " ") + _arg1), _arg3);
break;
};
}
public static function SetData(_arg1:String, _arg2):void{
OpenSharedObject();
mData[_arg1] = _arg2;
}
private static function OpenSharedObject():void{
if (mSharedObject){
return;
};
mSharedObject = SharedObject.getLocal("BXH_ZOMBIEWARS_7892334");
if (mSharedObject.data.mStats == null){
mSharedObject.data.mStats = new Object();
};
if (mSharedObject.data.mData == null){
mSharedObject.data.mData = new Object();
};
mStats = mSharedObject.data.mStats;
mData = mSharedObject.data.mData;
Dump();
}
public static function OpenURL_GamesWebsite():void{
CProtection.NavigateToURL(CGlobalData.mGamesURL);
CMochiBot.Track(CMochiBot.BXH_ZW_GAMESWEBSITEVISITS);
}
public static function isLIVE():Object{
var _local1:Date;
var _local2:Number;
var _local3:Object;
_local1 = new Date();
_local2 = (mWWLiveDate.time - _local1.time);
_local3 = new Object();
_local3.mMilliseconds = Math.floor((_local2 % 1000));
_local3.mSeconds = Math.floor(((_local2 / 1000) % 60));
_local3.mMinutes = Math.floor(((_local2 / (1000 * 60)) % 60));
_local3.mHours = Math.floor(((_local2 / ((1000 * 60) * 60)) % 24));
_local3.mDays = Math.floor((_local2 / (((1000 * 60) * 60) * 24)));
_local3.mLive = (CProtection.isLICENSEE()) ? true : ((_local2)>=0) ? false : true;
return (_local3);
}
public static function OpenURL_SponsorWebsite():void{
OpenSponsorURL(CGlobalData.mCMGURL);
}
public static function SendData_Visit():void{
}
private static function Dump():void{
if (mSharedObject == null){
return;
};
}
public static function PostKongregateStats():void{
var _local1:String;
for (_local1 in mLocalStats) {
KongregateSubmitStat(_local1, "", mLocalStats[_local1]);
};
}
public static function SendData_LevelPlay(_arg1:int):void{
}
private static function _AddStat(_arg1:Object, _arg2:String, _arg3, _arg4:String="HIGHEST"):Boolean{
if (_arg1[_arg2] == null){
_arg1[_arg2] = _arg3;
return (true);
};
switch (_arg4){
case "HIGHEST":
if (_arg3 > _arg1[_arg2]){
_arg1[_arg2] = _arg3;
return (true);
};
break;
case "ADD":
if (_arg3 != 0){
_arg1[_arg2] = (_arg1[_arg2] + _arg3);
return (true);
};
break;
case "SET":
_arg1[_arg2] = _arg3;
return (true);
};
return (false);
}
private static function Encode(_arg1:String):String{
var _local2:String;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
_local2 = "";
_local3 = (Math.random() * 9999);
_local4 = 0;
while (_local4 < _arg1.length) {
_local5 = _arg1.charCodeAt(_local4);
_local6 = key.charCodeAt((_local4 & lKey));
_local7 = (((_local5 + _local6) + _local3) & 0xFF);
_local2 = (_local2 + CString.Pad(_local7.toString(16), "0", 2));
_local4++;
};
return ((_local2.toUpperCase() + CString.Pad(String(_local3), "0", 4)));
}
public static function StartLocalStats(_arg1:int, _arg2:int, _arg3:Boolean):void{
mLocalStats = new Object();
mKongStatFieldUpdate = new Object();
mCurrentLevelIndex = _arg1;
mCurrentDifficulyLevel = _arg2;
mCurrentSendScore = _arg3;
mKongStatFieldUpdate["__timer"] = getTimer();
}
public static function OpenURL_BoxheadWebsite():void{
CProtection.NavigateToURL(CGlobalData.mBoxheadURL);
CMochiBot.Track(CMochiBot.BXH_ZW_BOXHEADWEBSITEVISITS);
}
public static function Flush():void{
if (mSharedObject){
mSharedObject.flush();
Dump();
};
}
private static function SendData(_arg1:String, _arg2:URLVariables=null):void{
var request:URLRequest;
var nVariables:URLVariables;
var trackingType = _arg1;
var variables = _arg2;
if (CBuild.mDEBUG){
return;
};
variables = ((variables)==null) ? new URLVariables() : variables;
variables.trackid = trackingType;
variables.domain = new LocalConnection().domain.toLowerCase();
request = new URLRequest(mTrackingURL);
nVariables = new URLVariables();
nVariables.session = Encode(variables.toString());
request.data = nVariables;
try {
sendToURL(request);
} catch(e:Error) {
};
}
public static function OpenSponsorURL(_arg1:String):void{
CProtection.NavigateToURL(_arg1);
CMochiBot.Track(CMochiBot.BXH_ZW_TOTALSPONSORCLICKS);
}
}
}//package Game
Section 54
//CHUD (Game.CHUD)
package Game {
import flash.display.*;
import Thing.*;
import flash.geom.*;
import STC9.Bitmap.*;
import Landscape.*;
import World.*;
import flash.events.*;
import STC9.System.Profiler.*;
import flash.text.*;
import STC9.IO.*;
import STC9.String.*;
public class CHUD {
private var tbKillScore:TextField;
private var mScoreUpdateTick:int;
private var mcLevel:HUD_Level;
private var mcMessage:HUD_Message;
private var dPoint:Point;
private var bmdScore:CBitmapData;
private var mcScore:HUD_Score;
private var lastScore:Number;
private var tbLevel:TextField;
private var mScoreAlpha:Number;
private var tbMessage:TextField;
private var tbScore:TextField;
private var mShowScores:Boolean;
private var tbMultiplier:TextField;
private var mMessages:Array;
private var mcKillScore:HUD_KillScore;
private var mKills:Array;
private var mRenderPos:Point;
private var _Score:Number;
private var mcMultiplier:HUD_Multiplier;
public static var mDraw:Boolean;
public static var mDrawBlendMode:String;
private static var dColorTransform:ColorTransform = new ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
public static var mSilentMessages:Boolean = false;
public function CHUD(){
mcScore = new HUD_Score();
mcMultiplier = new HUD_Multiplier();
mcKillScore = new HUD_KillScore();
mcMessage = new HUD_Message();
mKills = new Array();
mMessages = new Array();
tbScore = mcScore._Contents.tbAmount;
tbKillScore = mcKillScore._Contents.tbAmount;
tbMultiplier = mcMultiplier._Contents.tbAmount;
tbMessage = mcMessage._Contents.tbMessage;
tbScore.autoSize = TextFieldAutoSize.LEFT;
tbKillScore.autoSize = TextFieldAutoSize.LEFT;
tbMultiplier.autoSize = TextFieldAutoSize.LEFT;
tbMessage.autoSize = TextFieldAutoSize.LEFT;
mcMessage._Contents._Size.visible = false;
mcScore._Contents._Size.visible = false;
mcMultiplier._Contents._Size.visible = false;
mScoreUpdateTick = 0;
lastScore = -1;
_Score = 0;
mScoreAlpha = 1;
mRenderPos = new Point(0, 0);
mDraw = ((CGlobalData.GetData("HUD", "on"))=="on") ? true : false;
mDrawBlendMode = ((CGlobalData.GetData("Quality"))=="low") ? BlendMode.NORMAL : BlendMode.OVERLAY;
mShowScores = !((CGlobalData.GetData("Quality") == "low"));
}
public function AddScore(_arg1:Point, _arg2:Number):void{
var _local3:Point;
var _local4:CBitmapData;
var _local5:Object;
if (!mDraw){
return;
};
if (!mShowScores){
return;
};
_local3 = dPoint.subtract(_arg1);
_local3.normalize(3);
tbKillScore.text = _arg2.toString();
_local4 = new CBitmapData(mcKillScore.width, mcKillScore.height, true, 0);
_arg1.x = (_arg1.x - (_local4.width / 2));
_arg1.y = (_arg1.y - (_local4.height / 2));
_local5 = {bmd:_local4, pos:_arg1, dpos:_local3};
_local5.bmd.draw(mcKillScore);
mKills.push(_local5);
}
private function UpdateScore():void{
var _local1:Boolean;
_local1 = true;
if (((!((lastScore == _Score))) && ((--mScoreUpdateTick < 0)))){
lastScore = _Score;
mScoreUpdateTick = CGame.SECONDS;
if (bmdScore){
_local1 = (bmdScore.width < mcScore.width);
};
tbScore.text = CString.Pad(_Score.toString(), "0", 8);
if (_local1){
bmdScore = new CBitmapData(mcScore.width, mcScore._Contents._Size.height, true, 0);
} else {
bmdScore.fillRect(bmdScore.rect, 0);
};
bmdScore.draw(mcScore, new Matrix(1, 0, 0, 1, 0, -(mcScore._Contents._Size.y)));
};
}
public function get _CLASSID_():String{
return ("CHUD");
}
public function set mMultiplier(_arg1:Number):void{
tbMultiplier.text = ("x" + _arg1.toString());
}
public function AddMessage(_arg1:Point, _arg2:String, _arg3:String, _arg4:Number=1):void{
var _local5:Rectangle;
var _local6:CBitmapData;
var _local7:Object;
if (!mDraw){
return;
};
if (mSilentMessages){
return;
};
_arg1 = _arg1.clone();
tbMessage.text = _arg2;
mcMessage._Contents.scaleX = (mcMessage._Contents.scaleY = _arg4);
_local5 = mcMessage._Contents._Size.getBounds(mcMessage);
_local6 = new CBitmapData(mcMessage.width, int(_local5.height), true, 0);
_arg1.x = (_arg1.x - (_local6.width / 2));
_arg1.y = (_arg1.y - (_local6.height / 2));
_local7 = {alpha:0, type:_arg3, bmd:_local6, pos:_arg1, dpos:new Point(0, -3), life:(CGame.SECONDS * 3)};
_local7.mBlendMode = mDrawBlendMode;
_local7.bmd.draw(mcMessage, new Matrix(1, 0, 0, 1, 0, -(_local5.y)));
_local7.maxAlpha = ((_local7.mBlendMode)==BlendMode.NORMAL) ? 0.5 : 1;
mMessages.push(_local7);
}
public function set mMultiplierCounter(_arg1:Number):void{
mcMultiplier._Contents.alpha = ((_arg1 * 0.5) + 0.5);
}
public function set mScore(_arg1:Number):void{
_Score = _arg1;
}
public function Process():void{
var _local1:Point;
var _local2:Point;
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local6:int;
var _local7:Object;
var _local8:Object;
var _local9:Point;
var _local10:int;
var _local11:Object;
var _local12:Point;
var _local13:Number;
var _local14:Number;
if (((((CKeyboard.IsDown("SHIFT")) && (CKeyboard.IsDown("CONTROL")))) && (CKeyboard.IsReleased("PAGE_UP")))){
CGlobalData.SetData("HUD", (mDraw) ? "off" : "on");
mDraw = ((CGlobalData.GetData("HUD"))=="on") ? true : false;
};
for each (_local4 in mKills.slice()) {
_local1 = _local4.pos;
_local2 = _local4.dpos;
_local1.x = (_local1.x + _local2.x);
_local1.y = (_local1.y + _local2.y);
_local2.x = (_local2.x * 1.05);
_local2.y = (_local2.y * 1.05);
_local3 = Point.distance(_local1, dPoint);
_local4.alpha = Math.min(1, (_local3 / 100));
if (_local4.ldist){
if (_local3 > _local4.ldist){
mKills.splice(mKills.indexOf(_local4), 1);
_local4.bmd.dispose();
mScoreAlpha = 1;
};
};
_local4.ldist = _local3;
};
_local5 = mMessages.length;
_local6 = 0;
while (_local6 < _local5) {
_local8 = mMessages[_local6];
_local9 = _local8.pos;
_local10 = (_local6 + 1);
while (_local10 < _local5) {
_local11 = mMessages[_local10];
_local12 = _local11.pos;
if (((((_local9.x + _local8.bmd.width) > _local12.x)) && (((_local12.x + _local11.bmd.width) > _local9.x)))){
if (((((_local9.y + _local8.bmd.height) > _local12.y)) && (((_local12.y + _local11.bmd.height) > _local9.y)))){
_local13 = ((_local8.bmd.height + _local11.bmd.height) / 2);
if (_local12.y > _local9.y){
_local14 = (_local13 - (_local12.y - _local9.y));
_local9.y = (_local9.y - (_local14 * 0.5));
_local12.y = (_local12.y + (_local14 * 0.5));
} else {
_local14 = (_local13 - (_local9.y - _local12.y));
_local9.y = (_local9.y - (_local14 * 0.5));
_local12.y = (_local12.y + (_local14 * 0.5));
};
};
};
_local10++;
};
_local6++;
};
for each (_local7 in mMessages.slice()) {
_local1 = _local7.pos;
_local2 = _local7.dpos;
_local1.x = (_local1.x + _local2.x);
_local1.y = (_local1.y + _local2.y);
_local2.x = (_local2.x * 0.99);
_local2.y = (_local2.y * 0.99);
_local7.alpha = Math.min(_local7.maxAlpha, ((_local7.life)>=CGame.SECONDS) ? (_local7.alpha + 0.1) : (_local7.life / CGame.SECONDS));
if (--_local7.life < 0){
mMessages.splice(mMessages.indexOf(_local7), 1);
_local7.bmd.dispose();
};
};
}
public function Draw(_arg1:Rectangle, _arg2:CBitmapData):void{
var _local3:Matrix;
var _local4:CBitmapData;
var _local5:Point;
var _local6:Rectangle;
var _local7:int;
var _local8:int;
var _local9:Object;
var _local10:Object;
if (!mDraw){
return;
};
CGame.mFPS.StartProfile("HUD_Draw");
Scroll(_arg1.topLeft);
_local3 = new Matrix(1, 0, 0, 1, 0, 0);
_local7 = ((mKills.length / 20) + 1);
_local8 = 0;
for each (_local9 in mKills) {
++_local8;
if ((_local8 % _local7) != 0){
} else {
_local4 = _local9.bmd;
_local5 = _local9.pos;
dColorTransform.alphaMultiplier = _local9.alpha;
_local3.tx = _local5.x;
_local3.ty = _local5.y;
_arg2.draw(_local4, _local3, dColorTransform, mDrawBlendMode);
};
};
for each (_local10 in mMessages) {
_local4 = _local10.bmd;
_local5 = _local10.pos;
dColorTransform.alphaMultiplier = _local10.alpha;
_local3.tx = _local5.x;
_local3.ty = _local5.y;
_arg2.draw(_local4, _local3, dColorTransform, _local10.mBlendMode);
};
UpdateScore();
_local3.tx = ((_arg2.width - bmdScore.width) - 1);
_local3.ty = 0;
dColorTransform.alphaMultiplier = mScoreAlpha;
_arg2.draw(bmdScore, _local3, dColorTransform);
dPoint = new Point((_local3.tx + (mcScore.width / 2)), (_local3.ty + (mcScore.height / 2)));
if (mScoreAlpha > 0.75){
mScoreAlpha = (mScoreAlpha - 0.02);
};
_local3.tx = ((_arg2.width - mcMultiplier.width) - 1);
_local3.ty = (_local3.ty + (bmdScore.height - 4));
_arg2.draw(mcMultiplier, _local3);
CGame.mFPS.StopProfile("HUD_Draw");
}
public function Scroll(_arg1:Point):void{
var _local2:Number;
var _local3:Number;
var _local4:Object;
_local2 = Math.round((mRenderPos.x - _arg1.x));
_local3 = Math.round((mRenderPos.y - _arg1.y));
mRenderPos.x = (mRenderPos.x - _local2);
mRenderPos.y = (mRenderPos.y - _local3);
for each (_local4 in mMessages) {
_local4.pos.x = (_local4.pos.x + _local2);
_local4.pos.y = (_local4.pos.y + _local3);
};
}
}
}//package Game
Section 55
//CMochiBot (IO.CMochiBot)
package IO {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public dynamic class CMochiBot extends Sprite {
private var mLoader:Loader;
private var mTag:String;
private var mReq:URLRequest;
public static const BXH_ZW_SPONSORCLICK_EXCLUSIVELEVEL:String = "9e2e1e76";
public static const ACTIVE:Boolean = false;
public static const BXH_ZW_BOXHEADTHEROOMSCLICKS:String = "2a7e5fff";
public static const BXH_ZW_ADSCLICKED:String = "5004c75d";
public static const BXH_ZW_SPONSORCLICK_MOREGAMES:String = "e43f4e35";
public static const BXH_ZW_HISCOREVIEWS:String = "27f28dac";
public static const BXH_ZW_SPONSORCLICK_MAIN:String = "6f1759b0";
public static const BXH_ZW_LEVEL5PLAYS:String = "24567c02";
public static const BXH_ZW_LEVEL1PLAYS:String = "c4add1e6";
public static const BXH_ZW_SPONSORCLICK_CREDITS:String = "8e4946a7";
public static const BXH_ZW_LEVELSPLAYED:String = "fb2df5f2";
public static const BXH_ZW_TOTALSPONSORCLICKS:String = "ba96432c";
public static const BXH_ZW_GAMESWEBSITEVISITS:String = "a48a61c3";
public static const BXH_ZW_LEVEL6PLAYS:String = "fb653a24";
public static const BXH_ZW_SPONSORCLICK_LOADING:String = "d9848b02";
public static const BXH_ZW_SPONSORCLICK_MOREBOXHEAD:String = "0f3bb719";
public static const BXH_ZW_LEVEL2PLAYS:String = "78a482c3";
public static const BXH_ZW_GAMEGUIDECLICKS:String = "f69f32b6";
public static const BXH_ZW_HISCOREVIEWS_DEBRIEF:String = "6bc79243";
public static const BXH_ZW_BOXHEADWEBSITEVISITS:String = "49daf715";
public static const BXH_ZW_BOXHEAD2PLAYROOMSCLICKS:String = "6bd9a29e";
public static const BXH_ZW_HISCOREVIEWS_LEVELSELECTION:String = "983505e8";
public static const BXH_ZW_LEVEL7PLAYS:String = "716a7d41";
public static const BXH_ZW_BOXHEADMOREROOMSCLICKS:String = "c2d4695a";
public static const BXH_ZW_LEVEL3PLAYS:String = "36c0f965";
public static const BXH_ZW_SCOREPOSTED:String = "1ea05b33";
public static const BXH_ZW_BOXHEADHALLOWEENCLICKS:String = "53589006";
public static const BXH_ZW_HISCOREVIEWS_POSTSCORE:String = "11624706";
public static const BXH_ZW_ADSDISPLAYED:String = "5b0053c1";
public static const BXH_ZW_SPONSORCLICK_INTRO:String = "fcedd224";
public static const BXH_ZW_LEVEL8PLAYS:String = "ee55e391";
public static const BXH_ZW_LEVEL4PLAYS:String = "382d1dc0";
public static const BXH_ZW_VISITS:String = "6882a803";
public static var mTimerInterval:Timer;
public static var mStack:Array;
public static var mTimerStack:Array;
public static var mPending:Boolean = false;
public static var mRoot:DisplayObject;
public function get _CLASSID_():String{
return ("CMochiBot");
}
private static function e_IOERROR(_arg1:IOErrorEvent):void{
mPending = false;
NextInStack();
}
public static function Track(_arg1:String):void{
var _local2:CMochiBot;
var _local3:String;
var _local4:URLVariables;
var _local5:String;
var _local6:URLRequest;
var _local7:Loader;
if (Security.sandboxType == "localWithFile"){
return;
};
if (_arg1 == null){
return;
};
_local2 = new (CMochiBot);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local3 = "http://core.mochibot.com/my/core.swf";
_local4 = new URLVariables();
_local4["sb"] = Security.sandboxType;
_local4["v"] = Capabilities.version;
_local4["swfid"] = _arg1;
_local4["mv"] = "8";
_local4["fv"] = "9";
_local5 = mRoot.loaderInfo.loaderURL;
_local4["url"] = ((_local5.indexOf("http"))==0) ? _local5 : "local";
_local6 = new URLRequest(_local3);
_local6.contentType = "application/x-www-form-urlencoded";
_local6.method = URLRequestMethod.POST;
_local6.data = _local4;
_local7 = new Loader();
_local2.mTag = _arg1;
_local2.mLoader = _local7;
_local2.mReq = _local6;
Stack(_local2);
}
private static function NextInStack():void{
var _local1:CMochiBot;
if (!mStack.length){
return;
};
_local1 = mStack.shift();
_local1.addChild(_local1.mLoader);
_local1.mLoader.load(_local1.mReq);
mPending = true;
_local1.mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, e_COMPLETE);
_local1.mLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, e_IOERROR);
}
private static function e_COMPLETE(_arg1:Event):void{
mPending = false;
NextInStack();
}
private static function Stack(_arg1:CMochiBot):void{
if (((!(mStack)) || (!(mStack.length)))){
mStack = [_arg1];
if (!mPending){
NextInStack();
};
} else {
mStack.push(_arg1);
};
}
}
}//package IO
Section 56
//CPlayerControl (IO.CPlayerControl)
package IO {
import flash.geom.*;
import flash.events.*;
import STC9.IO.*;
public class CPlayerControl extends EventDispatcher {
public var mShootUp:int;
public var mWEAPON1:Object;
public var mWEAPON2:Object;
public var mWEAPON3:Object;
public var mWEAPON4:Object;
public var mWEAPON5:Object;
public var mWEAPON0:Object;
public var mWEAPON9:Object;
public var mWEAPON6:Object;
public var mWEAPON8:Object;
public var mShootDown:int;
public var mWEAPON7:Object;
public var mAngle256:uint;
public var mSelectIndex:int;
public var mSHOOT:Object;
public var mPREVWEAPON:Object;
public var mShoot:Boolean;
public var mMOVELEFT:Object;
public var mType:String;// = "NORMAL"
private var mActive:Boolean;
public var Process:Function;
public var mMOVEUP:Object;
public var mMOVEDOWN:Object;
public var mDeltaX:int;
public var mDeltaY:int;
public var mSelectDelta:int;
public var mNEXTWEAPON:Object;
public var mMOVERIGHT:Object;
public function CPlayerControl(){
mType = "NORMAL";
super();
}
public function Activate():void{
if (!CKeyboard.mActive){
return;
};
switch (mType){
case "NORMAL":
Process = Process_Normal;
mActive = true;
break;
};
}
public function Deactivate(){
mActive = false;
}
public function get _CLASSID_():String{
return ("CPlayerControl");
}
public function Process_Normal():void{
mDeltaX = (CKeyboard.IsDown(mMOVERIGHT.mControlID)) ? 1 : (CKeyboard.IsDown(mMOVELEFT.mControlID)) ? -1 : 0;
mDeltaY = (CKeyboard.IsDown(mMOVEDOWN.mControlID)) ? 1 : (CKeyboard.IsDown(mMOVEUP.mControlID)) ? -1 : 0;
mShoot = CKeyboard.IsDown(mSHOOT.mControlID);
mShootDown = CKeyboard.IsPressed(mSHOOT.mControlID);
mShootUp = CKeyboard.IsReleased(mSHOOT.mControlID);
if (CKeyboard.IsPressed(mNEXTWEAPON.mControlID)){
mSelectDelta = 1;
} else {
if (CKeyboard.IsPressed(mPREVWEAPON.mControlID)){
mSelectDelta = -1;
} else {
mSelectDelta = 0;
};
};
mSelectIndex = -1;
if (mWEAPON0){
if (CKeyboard.IsReleased(mWEAPON0.mControlID)){
mSelectIndex = 0;
};
if (CKeyboard.IsReleased(mWEAPON1.mControlID)){
mSelectIndex = 1;
};
if (CKeyboard.IsReleased(mWEAPON2.mControlID)){
mSelectIndex = 2;
};
if (CKeyboard.IsReleased(mWEAPON3.mControlID)){
mSelectIndex = 3;
};
if (CKeyboard.IsReleased(mWEAPON4.mControlID)){
mSelectIndex = 4;
};
if (CKeyboard.IsReleased(mWEAPON5.mControlID)){
mSelectIndex = 5;
};
if (CKeyboard.IsReleased(mWEAPON6.mControlID)){
mSelectIndex = 6;
};
if (CKeyboard.IsReleased(mWEAPON7.mControlID)){
mSelectIndex = 7;
};
if (CKeyboard.IsReleased(mWEAPON8.mControlID)){
mSelectIndex = 8;
};
if (CKeyboard.IsReleased(mWEAPON9.mControlID)){
mSelectIndex = 9;
};
};
}
public static function Define_NORMAL(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:String, _arg7:String, _arg8:Boolean=true):CPlayerControl{
var _local9:CPlayerControl;
_local9 = new (CPlayerControl);
_local9.mType = "NORMAL";
_local9.mMOVELEFT = CreateControl_NORMAL(_arg1);
_local9.mMOVERIGHT = CreateControl_NORMAL(_arg2);
_local9.mMOVEUP = CreateControl_NORMAL(_arg3);
_local9.mMOVEDOWN = CreateControl_NORMAL(_arg4);
_local9.mSHOOT = CreateControl_NORMAL(_arg5);
_local9.mNEXTWEAPON = CreateControl_NORMAL(_arg7);
_local9.mPREVWEAPON = CreateControl_NORMAL(_arg6);
if (_arg8){
_local9.mWEAPON0 = {mControlID:"1"};
_local9.mWEAPON1 = {mControlID:"2"};
_local9.mWEAPON2 = {mControlID:"3"};
_local9.mWEAPON3 = {mControlID:"4"};
_local9.mWEAPON4 = {mControlID:"5"};
_local9.mWEAPON5 = {mControlID:"6"};
_local9.mWEAPON6 = {mControlID:"7"};
_local9.mWEAPON7 = {mControlID:"8"};
_local9.mWEAPON8 = {mControlID:"9"};
_local9.mWEAPON9 = {mControlID:"0"};
};
return (_local9);
}
private static function CreateControl_NORMAL(_arg1:String):Object{
return ({mControlID:_arg1});
}
}
}//package IO
Section 57
//CProtection (IO.CProtection)
package IO {
import flash.display.*;
import flash.net.*;
import flash.text.*;
public class CProtection extends MovieClip {
public static var tfDebug:TextField;
public static var mRoot:DisplayObject;
public function CProtection():void{
}
public function get _CLASSID_():String{
return ("CProtection");
}
public function Check(_arg1:DisplayObjectContainer):void{
var _local2:String;
return;
//unresolved jump
//unresolved jump
//unresolved jump
var _local3 = _local2;
//unresolved jump
//unresolved jump
//unexpected switch
}
public static function isLOCAL():Boolean{
var _local1:String;
_local1 = new LocalConnection().domain.toLowerCase();
return ((_local1 == "localhost"));
}
public static function NavigateToURL(_arg1:String, _arg2:String="_blank"):void{
var success:Boolean;
var url = _arg1;
var window = _arg2;
navigateToURL(new URLRequest(url), "_BLANK");
}
public static function ShowDebugInfo():void{
}
public static function isKONGREGATE():Boolean{
var _local1:String;
_local1 = new LocalConnection().domain.toLowerCase();
switch (_local1){
case "a.kongregate.com":
case "chat.kongregate.com":
case "www.kongregate.com":
case "a.kongregatestage.com":
case "chat.kongregatestage.com":
case "www.kongregatestage.com":
case "a.kongregatetrunk.com":
case "chat.kongregatetrunk.com":
case "www.kongregatetrunk.com":
return (true);
};
return (false);
}
public static function isARMORGAMES():Boolean{
var _local1:String;
_local1 = new LocalConnection().domain.toLowerCase();
switch (_local1){
case "games.armorgames.com":
case "armorgames.com":
case "www.games.armorgames.com":
case "www.armorgames.com":
return (true);
};
return (false);
}
public static function get mSHOWAD():Boolean{
if (isANDKON()){
return (false);
};
if (isKONGREGATE()){
return (false);
};
if (isARMORGAMES()){
return (false);
};
if (isCMG()){
return (false);
};
if (CBuild.mDEBUG){
return (false);
};
return (true);
}
public static function isLICENSEE():Boolean{
var _local1:String;
_local1 = new LocalConnection().domain.toLowerCase();
return ((((((((((((((_local1 == "localhost")) || ((_local1 == "crazymonkeygames.com")))) || ((_local1 == "www.crazymonkeygames.com")))) || ((_local1 == "boxhead.seantcooper.com")))) || ((_local1 == "www.boxhead.seantcooper.com")))) || ((_local1 == "www.games.seantcooper.com")))) || ((_local1 == "www.games.seantcooper.com"))));
}
public static function isCMG():Boolean{
var _local1:String;
_local1 = new LocalConnection().domain.toLowerCase();
return ((((_local1 == "crazymonkeygames.com")) || ((_local1 == "www.crazymonkeygames.com"))));
}
public static function isSTC():Boolean{
var _local1:String;
_local1 = new LocalConnection().domain.toLowerCase();
return ((((((((_local1 == "boxhead.seantcooper.com")) || ((_local1 == "www.boxhead.seantcooper.com")))) || ((_local1 == "www.games.seantcooper.com")))) || ((_local1 == "www.games.seantcooper.com"))));
}
public static function GetDomain():String{
return (new LocalConnection().domain.toLowerCase());
}
public static function isANDKON():Boolean{
var _local1:String;
_local1 = new LocalConnection().domain.toLowerCase();
return ((((_local1 == "andkon.com")) || ((_local1 == "www.andkon.com"))));
}
}
}//package IO
Section 58
//CLandscape (Landscape.CLandscape)
package Landscape {
import flash.display.*;
import Thing.*;
import flash.geom.*;
import World.*;
import Draw.*;
import flash.utils.*;
import flash.events.*;
import Game.*;
import flash.ui.*;
import adobe.utils.*;
public class CLandscape extends Sprite {
public var mLSThingDraw:CLSThingDraw;
public var mRenderFullArea:Rectangle;
public var mLSDraw:CLSDraw;
public var mPosition:Point;
public static const mScreenHeight:int = 490;
public static const mScreenWidth:int = 700;
public function CLandscape(){
mPosition = new Point(0, 0);
scrollRect = new Rectangle(0, 0, mScreenWidth, mScreenHeight);
mLSDraw = new CLSDraw(new CGame.mLevelData.initClass(), mScreenWidth, mScreenHeight);
mLSThingDraw = new CLSThingDraw();
addChild(mLSDraw);
mRenderFullArea = new Rectangle(0, 0, (mLSDraw.mMapWidth * CLSDraw.xProjection), (mLSDraw.mMapHeight * CLSDraw.yProjection));
mRenderFullArea.left = (mRenderFullArea.left + (CLSDraw.xProjection * 2));
mRenderFullArea.top = (mRenderFullArea.top + (CLSDraw.yProjection * 2));
}
public function get mPlayerInitPositions():Array{
return (mLSDraw.mPlayerInitPositions);
}
public function get mThingInitPositions():Array{
return (mLSDraw.mThingInitPositions);
}
public function get mMapSize():Point{
return (mLSDraw.mMapSize);
}
public function GetAltitudeAt(_arg1:Number, _arg2:Number):Number{
return (0);
}
public function Draw():void{
var _local1:Point;
var _local2:Rectangle;
_local1 = new Point();
_local1.x = int(Math.max(mRenderFullArea.x, Math.min((mRenderFullArea.width - mScreenWidth), (mPosition.x * CLSDraw.xProjection))));
_local1.y = int(Math.max(mRenderFullArea.y, Math.min((mRenderFullArea.height - mScreenHeight), (mPosition.y * CLSDraw.yProjection))));
_local2 = new Rectangle(_local1.x, _local1.y, mScreenWidth, mScreenHeight);
mLSDraw.Draw(_local2, mLSThingDraw);
}
override public function toString():String{
return (_CLASSID_);
}
public function TrackThing(_arg1:CThingDraw, _arg2:Point):void{
var _local3:CThingV3;
var _local4:CThingV3;
if (!_arg1){
return;
};
_local3 = _arg1.mPosition;
_local4 = new CThingV3((mPosition.x + ((mScreenWidth / CLSDraw.xProjection) / 2)), (mPosition.y + ((mScreenHeight / CLSDraw.yProjection) / 2)));
_local4.Sub(_local3);
Scroll((-(_local4.x) + _arg2.x), (-(_local4.y) + _arg2.y));
}
public function QGetAltitudeAt(_arg1:Number, _arg2:Number):Number{
return (0);
}
public function get _CLASSID_():String{
return ("CLandscape");
}
public function Scroll(_arg1:Number, _arg2:Number):void{
mPosition.x = (mPosition.x + _arg1);
mPosition.y = (mPosition.y + _arg2);
}
public function Dispose():void{
mLSDraw.Dispose();
removeChild(mLSDraw);
mLSDraw = null;
}
}
}//package Landscape
Section 59
//CLSCtrlBarricade (Landscape.CLSCtrlBarricade)
package Landscape {
import flash.display.*;
public class CLSCtrlBarricade extends Sprite {
public function CLSCtrlBarricade():void{
}
override public function toString():String{
return (_CLASSID_);
}
public function get _CLASSID_():String{
return ("CLSCtrlBarricade");
}
}
}//package Landscape
Section 60
//CLSCtrlCollision (Landscape.CLSCtrlCollision)
package Landscape {
import flash.display.*;
public class CLSCtrlCollision extends MovieClip {
public function CLSCtrlCollision():void{
}
override public function toString():String{
return (_CLASSID_);
}
public function get _CLASSID_():String{
return ("CLSCtrlCollision");
}
}
}//package Landscape
Section 61
//CLSCtrlCover (Landscape.CLSCtrlCover)
package Landscape {
import flash.display.*;
public class CLSCtrlCover extends Sprite {
public var mcMask:MovieClip;
public function CLSCtrlCover():void{
}
override public function toString():String{
return (_CLASSID_);
}
public function get _CLASSID_():String{
return ("CLSCtrlCover");
}
}
}//package Landscape
Section 62
//CLSCtrlCoverMask (Landscape.CLSCtrlCoverMask)
package Landscape {
import flash.display.*;
public class CLSCtrlCoverMask extends MovieClip {
public function CLSCtrlCoverMask():void{
}
override public function toString():String{
return (_CLASSID_);
}
public function get _CLASSID_():String{
return ("CLSCtrlCoverMask");
}
}
}//package Landscape
Section 63
//CLSCtrlEffect (Landscape.CLSCtrlEffect)
package Landscape {
import flash.display.*;
public class CLSCtrlEffect extends Sprite {
public function CLSCtrlEffect():void{
}
override public function toString():String{
return (_CLASSID_);
}
public function get _CLASSID_():String{
return ("CLSCtrlEffect");
}
}
}//package Landscape
Section 64
//CLSCtrlFloor (Landscape.CLSCtrlFloor)
package Landscape {
import flash.display.*;
public class CLSCtrlFloor extends Sprite {
public function CLSCtrlFloor():void{
}
override public function toString():String{
return (_CLASSID_);
}
public function get _CLASSID_():String{
return ("CLSCtrlFloor");
}
}
}//package Landscape
Section 65
//CLSCtrlPlayer (Landscape.CLSCtrlPlayer)
package Landscape {
import flash.display.*;
public class CLSCtrlPlayer extends Sprite {
public function CLSCtrlPlayer():void{
}
override public function toString():String{
return (_CLASSID_);
}
public function get _CLASSID_():String{
return ("CLSCtrlPlayer");
}
}
}//package Landscape
Section 66
//CLSCtrlTree (Landscape.CLSCtrlTree)
package Landscape {
import flash.display.*;
public class CLSCtrlTree extends Sprite {
public function CLSCtrlTree():void{
}
override public function toString():String{
return (_CLASSID_);
}
public function get _CLASSID_():String{
return ("CLSCtrlTree");
}
}
}//package Landscape
Section 67
//CLSCtrlTurretMG (Landscape.CLSCtrlTurretMG)
package Landscape {
import flash.display.*;
public class CLSCtrlTurretMG extends Sprite {
public function CLSCtrlTurretMG():void{
}
override public function toString():String{
return (_CLASSID_);
}
public function get _CLASSID_():String{
return ("CLSCtrlTurretMG");
}
}
}//package Landscape
Section 68
//CLSCtrlTurretMortor (Landscape.CLSCtrlTurretMortor)
package Landscape {
import flash.display.*;
public class CLSCtrlTurretMortor extends Sprite {
public function CLSCtrlTurretMortor():void{
}
override public function toString():String{
return (_CLASSID_);
}
public function get _CLASSID_():String{
return ("CLSCtrlTurretMortor");
}
}
}//package Landscape
Section 69
//CLSCtrlTurretRockets (Landscape.CLSCtrlTurretRockets)
package Landscape {
import flash.display.*;
public class CLSCtrlTurretRockets extends Sprite {
public function CLSCtrlTurretRockets():void{
}
override public function toString():String{
return (_CLASSID_);
}
public function get _CLASSID_():String{
return ("CLSCtrlTurretRockets");
}
}
}//package Landscape
Section 70
//CLSDraw (Landscape.CLSDraw)
package Landscape {
import flash.display.*;
import Thing.*;
import flash.geom.*;
import STC9.Bitmap.*;
import World.*;
import STC9.Math.*;
import Draw.*;
import flash.utils.*;
import flash.events.*;
import STC9.System.Profiler.*;
import Game.*;
import flash.text.*;
import flash.filters.*;
import STC9.Filters.*;
public class CLSDraw extends Sprite {
private var bmdBlood:Array;
private var bPlane:Bitmap;
private var bmdFloor:CBitmapData;
public var mPlayerInitPositions:Array;
private var mLevelOrigin:Point;
private var zPoint:Point;
public var mThingInitPositions:Array;
private var bmdDecalCover:CBitmapData;
private var yPitch:int;
private var bmdPlane:CBitmapData;
private var mSFXLayer:CLSEffects;
private var bmdCovers:Array;
private var drawLayer:Sprite;
private var mcLevel:MovieClip;
private var xPitch:int;
private var mTick:int;// = 0
private var bmdArrayActive:Boolean;
private var bmdDecal:CBitmapData;
private var mAllCells:Array;
private var bmdCover:CBitmapData;
private var screenWidth:int;
private var screenHeight:int;
private var bmdFloors:Array;
private var bmdScorch:Array;
public var mCells:Array;
public static const xProjection:int = 40;
public static const yProjection:int = 28;
public static const sProjection:Number = 0.7;
public static const zProjection:Number = 28.2842712474619;
public static const xDrawSize:int = 40;
public static const yDrawSize:int = 28;
private static var renderTopLeft:Point;
public function CLSDraw(_arg1, _arg2:int, _arg3:int):void{
zPoint = new Point(0, 0);
mTick = 0;
super();
screenWidth = _arg2;
screenHeight = _arg3;
CompileLevel(_arg1);
CreateDecals();
addChild((bPlane = new Bitmap((bmdPlane = new CBitmapData(screenWidth, screenHeight, false, 0)))));
mSFXLayer = new CLSEffects();
mSFXLayer.mActive = !((CGlobalData.GetData("Quality") == "low"));
}
public function DrawBloodMulti(_arg1:Number, _arg2:Number):void{
var _local3:int;
_local3 = 3;
while (_local3) {
DrawBlood((_arg1 + ((Math.random() - 0.5) * 0.75)), (_arg2 + ((Math.random() - 0.5) * 0.75)));
_local3--;
};
}
private function InvertPlane(_arg1:CBitmapData):void{
var _local2:Array;
var _local3:Number;
_local2 = new Array();
_local3 = 0;
while (_local3 <= 0xFF) {
_local2[_local3] = ((0xFF - _local3) << 24);
_local3++;
};
_arg1.paletteMap(_arg1, _arg1.rect, zPoint, null, null, null, _local2);
}
public function ShowGrid(_arg1:CBitmapData):void{
var _local2:int;
var _local3:int;
_local2 = 0;
while (_local2 < _arg1.height) {
_local3 = 0;
while (_local3 < _arg1.width) {
_arg1.fillRect(new Rectangle(_local3, _local2, 1, yDrawSize), 0);
_arg1.fillRect(new Rectangle(_local3, _local2, xDrawSize, 1), 0);
_local3 = (_local3 + xDrawSize);
};
_local2 = (_local2 + yDrawSize);
};
}
private function InitMap():Array{
var _local1:int;
var _local2:int;
var _local3:Array;
var _local4:Object;
mCells = new Array();
mAllCells = new Array();
_local1 = 0;
while (_local1 < yPitch) {
_local3 = (mCells[_local1] = new Array());
_local2 = 0;
while (_local2 < xPitch) {
_local3.push({mCollide:0});
_local2++;
};
mAllCells = mAllCells.concat(_local3);
_local1++;
};
_local1 = 0;
while (_local1 < yPitch) {
mCells[_local1][0].mCollide = (mCells[_local1][(xPitch - 1)].mCollide = (mCells[_local1][(xPitch - 1)].mCollide | (eWMCCollideType.EDGE | eWMCCollideType.SOLID)));
mCells[_local1][1].mCollide = (mCells[_local1][(xPitch - 2)].mCollide = (mCells[_local1][(xPitch - 2)].mCollide | eWMCCollideType.EDGE));
_local1++;
};
_local2 = 0;
while (_local2 < xPitch) {
mCells[0][_local2].mCollide = (mCells[(yPitch - 1)][_local2].mCollide = (mCells[(yPitch - 1)][_local2].mCollide | (eWMCCollideType.EDGE | eWMCCollideType.SOLID)));
mCells[1][_local2].mCollide = (mCells[(yPitch - 2)][_local2].mCollide = (mCells[(yPitch - 2)][_local2].mCollide | eWMCCollideType.EDGE));
_local2++;
};
return (mCells);
}
public function CompileLevel(_arg1){
var _local2:Array;
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:Array;
var _local7:int;
var _local8:CLSCtrlFloor;
var _local9:CLSCtrlCover;
var _local10:Matrix;
var _local11:*;
mcLevel = _arg1;
FillMapDimensions(mcLevel._Size);
InitMap();
_local2 = new Array();
_local3 = new Array();
_local4 = new Array();
_local5 = new Array();
_local6 = new Array();
mPlayerInitPositions = new Array();
mThingInitPositions = new Array();
_local7 = (mcLevel.numChildren - 1);
while (_local7 >= 0) {
_local11 = mcLevel.getChildAt(_local7);
switch (_local11.toString()){
default:
_local5.push(_local11);
break;
case "CLSCtrlSize":
_local5.push(_local11);
_local11.visible = false;
break;
case "CLSCtrlCover":
_local2.push(_local11);
CompileObject(_local11);
break;
case "CLSCtrlFloor":
_local3.push(_local11);
break;
case "CLSCtrlEffect":
_local4.push(_local11);
break;
case "CLSCtrlPlayer":
AddInitPlayer(_local11);
break;
case "CLSCtrlBarricade":
AddInitThing(_local11, CBarricade);
break;
case "CLSCtrlTree":
AddInitThing(_local11, CTree);
break;
case "CLSCtrlTurretMortor":
AddInitThing(_local11, CTurret_Mortor);
break;
case "CLSCtrlTurretMG":
AddInitThing(_local11, CTurret_MG);
break;
case "CLSCtrlTurretRockets":
AddInitThing(_local11, CTurret_Rockets);
break;
case "CLSCtrlRock":
AddInitThing(_local11, CRock);
break;
case "CLSCtrlCollision":
SetCollisionArea(new Point(_local11.x, _local11.y), new Point((_local11.x + _local11.width), (_local11.y + _local11.height)));
_local5.push(_local11);
_local11.visible = false;
break;
};
_local7--;
};
mcLevel._Size.visible = false;
_local10 = new Matrix(1, 0, 0, 1, -(mcLevel._Size.x), -(mcLevel._Size.y));
SetVisibleThings(mPlayerInitPositions, false);
SetVisibleThings(mThingInitPositions, false);
bmdFloor = new CBitmapData(mcLevel._Size.width, mcLevel._Size.height, false, 0xFF00FF);
bmdFloor.draw(mcLevel, _local10);
SetVisible(_local5, false);
SetVisible(_local3, false);
SetVisible(_local4, false);
bmdDecalCover = new CBitmapData(mcLevel._Size.width, mcLevel._Size.height, true, 0);
bmdDecalCover.draw(mcLevel, _local10);
InvertPlane(bmdDecalCover);
for each (_local9 in _local2) {
ActivateCoverMask(_local9);
};
bmdCover = new CBitmapData(mcLevel._Size.width, mcLevel._Size.height, true, 0);
bmdCover.draw(mcLevel, _local10);
mcLevel = null;
}
private function CompileObject(_arg1):void{
var _local2:int;
var _local3:*;
var _local4:Point;
var _local5:Point;
_arg1.mcMask = new MovieClip();
_local2 = (_arg1.numChildren - 1);
while (_local2 >= 0) {
_local3 = _arg1.getChildAt(_local2);
switch (_local3.toString()){
case "CLSCtrlCollision":
_local3.visible = false;
_local4 = _arg1.localToGlobal(new Point(_local3.x, _local3.y));
_local4 = mcLevel.globalToLocal(_local4);
_local5 = _arg1.localToGlobal(new Point((_local3.x + _local3.width), (_local3.y + _local3.height)));
_local5 = mcLevel.globalToLocal(_local5);
SetCollisionArea(_local4, _local5);
break;
case "CLSCtrlCoverMask":
_arg1.removeChild(_local3);
_arg1.mcMask.addChild(_local3);
break;
};
_local2--;
};
}
private function SetVisibleThings(_arg1:Array, _arg2:Boolean=false):void{
var _local3:Object;
for each (_local3 in _arg1) {
_local3.dObject.visible = _arg2;
};
}
private function AddInitThing(_arg1, _arg2:Class):void{
var _local3:Point;
_local3 = new Point((Math.round(((_arg1.x - mcLevel._Size.x) / xDrawSize)) + 0.5), (Math.round(((_arg1.y - mcLevel._Size.y) / yDrawSize)) + 0.5));
mThingInitPositions.push({mPosition:new CThingV3(_local3.x, _local3.y), initClass:_arg2, dObject:_arg1});
}
public function get mMapSize():Point{
return (new Point(xPitch, yPitch));
}
public function Draw(_arg1:Rectangle, _arg2:CLSThingDraw):void{
var _local3:Rectangle;
renderTopLeft = _arg1.topLeft;
CThingDraw.mSFXLayer = mSFXLayer;
CThingDraw.bmdPlane = bmdPlane;
CThingAudio.mAudioSize = new Point((_arg1.width / CLSDraw.xProjection), (_arg1.height / CLSDraw.yProjection));
CThingAudio.mAudioCentre = new CThingV3(((_arg1.x + (_arg1.width / 2)) / CLSDraw.xProjection), ((_arg1.y + (_arg1.height / 2)) / CLSDraw.yProjection));
_local3 = _arg1.clone();
CGame.mFPS.StartProfile("FLOOR_Draw");
bmdPlane.copyPixels(bmdFloor, _local3, zPoint);
CGame.mFPS.StopProfile("FLOOR_Draw");
CGame.mFPS.StartProfile("THING_Draw");
_arg2.Draw(_arg1);
CGame.mFPS.StopProfile("THING_Draw");
CGame.mFPS.StartProfile("SFX_Draw");
mSFXLayer.Render(_arg1, bmdPlane);
CGame.mFPS.StopProfile("SFX_Draw");
CGame.mFPS.StartProfile("COVER_Draw");
bmdPlane.copyPixels(bmdCover, _local3, zPoint);
CGame.mFPS.StopProfile("COVER_Draw");
CGame.mHUD.Draw(_arg1, bmdPlane);
}
private function ActivateCoverMask(_arg1):void{
if (_arg1.mcMask.numChildren){
_arg1.addChild(_arg1.mcMask);
_arg1.mask = _arg1.mcMask;
};
}
override public function toString():String{
return (_CLASSID_);
}
public function get mMapWidth():int{
return (xPitch);
}
private function AddInitPlayer(_arg1):void{
var _local2:Point;
_local2 = new Point((Math.round(((_arg1.x - mcLevel._Size.x) / xDrawSize)) + 0.5), (Math.round(((_arg1.y - mcLevel._Size.y) / yDrawSize)) + 0.5));
mPlayerInitPositions.push({mPosition:new CThingV3(_local2.x, _local2.y), dObject:_arg1});
}
private function CreateDecals():void{
var _local1:CBitmapData;
var _local2:int;
var _local3:BloodDecal;
var _local4:ScorchMarkDecal;
_local3 = new BloodDecal();
bmdBlood = new Array();
_local2 = 0;
while (_local2 < _local3._Content.totalFrames) {
_local3._Content.gotoAndStop((_local2 + 1));
_local1 = new CBitmapData(Math.ceil(_local3.width), Math.ceil(_local3.height), true, 0);
bmdBlood.push(_local1);
_local1.draw(_local3);
_local2++;
};
_local4 = new ScorchMarkDecal();
bmdScorch = new Array();
_local2 = 0;
while (_local2 < _local4._Content.totalFrames) {
_local4._Content.gotoAndStop((_local2 + 1));
_local1 = new CBitmapData(Math.ceil(_local4.width), Math.ceil(_local4.height), true, 0);
bmdScorch.push(_local1);
_local1.draw(_local4);
_local2++;
};
}
private function FillMapDimensions(_arg1):void{
xPitch = Math.round((_arg1.width / xDrawSize));
yPitch = Math.round((_arg1.height / yDrawSize));
mLevelOrigin = new Point(_arg1.x, _arg1.y);
}
public function DrawScorch(_arg1:Number, _arg2:Number):void{
DrawDecal(bmdScorch[int((Math.random() * bmdScorch.length))], _arg1, _arg2);
}
public function get _CLASSID_():String{
return ("CLSDraw");
}
public function get mMapHeight():int{
return (yPitch);
}
private function SetCollisionArea(_arg1:Point, _arg2:Point):void{
var _local3:int;
var _local4:int;
var _local5:Array;
_arg1 = _arg1.subtract(mLevelOrigin);
_arg2 = _arg2.subtract(mLevelOrigin);
_arg1.x = Math.round((_arg1.x / xDrawSize));
_arg1.y = Math.round((_arg1.y / yDrawSize));
_arg2.x = Math.round((_arg2.x / xDrawSize));
_arg2.y = Math.round((_arg2.y / yDrawSize));
_local3 = _arg1.y;
while (_local3 < _arg2.y) {
if ((((_local3 < 0)) || ((_local3 >= yPitch)))){
} else {
_local5 = mCells[_local3];
_local4 = _arg1.x;
while (_local4 < _arg2.x) {
if ((((_local4 < 0)) || ((_local4 >= xPitch)))){
} else {
_local5[_local4].mCollide = eWMCCollideType.SOLID;
};
_local4++;
};
};
_local3++;
};
}
private function SetVisible(_arg1:Array, _arg2:Boolean=false):void{
var _local3:DisplayObject;
for each (_local3 in _arg1) {
_local3.visible = _arg2;
};
}
public function DrawDecal(_arg1:CBitmapData, _arg2:Number, _arg3:Number):void{
var _local4:Point;
_local4 = new Point(((_arg2 * xProjection) - (_arg1.width / 2)), ((_arg3 * yProjection) - (_arg1.height / 2)));
bmdFloor.copyPixels(_arg1, _arg1.rect, _local4, bmdDecalCover, _local4, false);
}
public function DrawBlood(_arg1:Number, _arg2:Number):void{
DrawDecal(bmdBlood[int((Math.random() * bmdBlood.length))], _arg1, _arg2);
}
public function Dispose():void{
removeChild(bPlane);
bmdPlane.dispose();
bmdFloor.dispose();
bmdCover.dispose();
bmdDecalCover.dispose();
bmdPlane = (bmdFloor = (bmdCover = (bmdDecalCover = null)));
mSFXLayer.Dispose();
mSFXLayer = null;
}
public static function ProjectionPoint(_arg1:Point):Point{
return (new Point((_arg1.x * xProjection), (_arg1.y * yProjection)));
}
public static function ProjectionXYZ(_arg1:Number, _arg2:Number, _arg3:Number=0):Point{
return (new Point((_arg1 * xProjection), ((_arg2 * yProjection) - (_arg3 * zProjection))));
}
public static function ProjectionThing_Screen(_arg1:CThingV3):Point{
return (new Point(((_arg1.x * xProjection) - renderTopLeft.x), (((_arg1.y * yProjection) - (_arg1.z * zProjection)) - renderTopLeft.y)));
}
public static function QProjectionXYZ(_arg1:Number, _arg2:Number, _arg3:Number=0):Point{
return (new Point(Math.floor((_arg1 * xProjection)), Math.floor(((_arg2 * yProjection) - (_arg3 * zProjection)))));
}
public static function ProjectionThing(_arg1:CThingV3):Point{
return (new Point((_arg1.x * xProjection), ((_arg1.y * yProjection) - (_arg1.z * zProjection))));
}
}
}//package Landscape
Section 71
//CLSEffects (Landscape.CLSEffects)
package Landscape {
import flash.display.*;
import flash.geom.*;
import STC9.Bitmap.*;
import flash.filters.*;
public class CLSEffects extends Bitmap {
private var mUpdateCount:int;
private var mMatrixToPlane:Matrix;
private var mFilter:BlurFilter;
private var mMatrix:Matrix;
private var mTopLayer:Sprite;
public var mFillLayer:Sprite;
private var _FadeArray:Array;
public var mBMD:CBitmapData;
public var mLineLayer:Sprite;
public var mActive:Boolean;
private var mRenderPos:Point;
public static const UPDATECOUNT:Number = 64;
public static const scale:Number = 0.25;
public static const zPoint:Point = new Point(0, 0);
public function CLSEffects(){
super((mBMD = new CBitmapData((CLandscape.mScreenWidth * scale), (CLandscape.mScreenHeight * scale), true, 0)), "never", false);
mTopLayer = new Sprite();
mTopLayer.addChild((mLineLayer = new Sprite()));
mTopLayer.addChild((mFillLayer = new Sprite()));
mLineLayer.scaleX = (mFillLayer.scaleX = scale);
mLineLayer.scaleY = (mFillLayer.scaleY = scale);
mMatrix = new Matrix(scale, 0, 0, scale, 0, 0);
mMatrixToPlane = new Matrix((1 / scale), 0, 0, (1 / scale), 0, 0);
mFilter = new BlurFilter(2, 2, 1);
mRenderPos = new Point(0, 0);
mActive = true;
}
public function Dispose():void{
mTopLayer.removeChild(mLineLayer);
mTopLayer.removeChild(mFillLayer);
mLineLayer = null;
mFillLayer = null;
mBMD.dispose();
mBMD = null;
}
public function Clear():void{
mLineLayer.graphics.clear();
mFillLayer.graphics.clear();
}
public function DrawCircle(_arg1:int, _arg2, _arg3:Number, _arg4:Number, _arg5:Number):void{
var _local6:Graphics;
if (!mActive){
return;
};
_local6 = mFillLayer.graphics;
_local6.beginFill(_arg1, _arg2);
_local6.drawCircle(_arg3, _arg4, _arg5);
_local6.endFill();
Update();
}
public function DrawLine(_arg1:Number, _arg2:int, _arg3, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):void{
var _local8:Graphics;
if (!mActive){
return;
};
_local8 = mLineLayer.graphics;
_local8.lineStyle(_arg1, _arg2, _arg3);
_local8.moveTo(_arg4, _arg5);
_local8.lineTo(_arg6, _arg7);
Update();
}
public function DrawBulletSmoke(_arg1:Point, _arg2:Point):void{
var _local3:Point;
var _local4:int;
var _local5:Point;
var _local6:Number;
var _local7:Point;
if (!mActive){
return;
};
_local3 = _arg2.subtract(_arg1);
_local4 = (_local3.length / 20);
_local3.normalize(20);
_local5 = _arg1.clone();
_local6 = 0.5;
while (((_local4) && ((_local6 > 0)))) {
_local7 = _local5.add(_local3).add(new Point(((Math.random() - 0.5) * 6), ((Math.random() - 0.5) * 6)));
DrawLine(0, 0xFFFFFF, _local6, _local5.x, _local5.y, _local7.x, _local7.y);
_local4--;
_local6 = (_local6 - 0.07);
_local5 = _local7;
};
}
public function get _CLASSID_():String{
return ("CLSEffects");
}
public function Render(_arg1:Rectangle, _arg2:CBitmapData):void{
var _local3:Rectangle;
var _local4:Number;
if (!mActive){
return;
};
if (--mUpdateCount < 0){
Scroll(_arg1.topLeft);
return;
};
if (!_FadeArray){
_FadeArray = new Array();
_local4 = 0xFF;
while (_local4 >= 0) {
_FadeArray[_local4] = (Math.max(0, int((_local4 - 4))) << 24);
_local4--;
};
};
mBMD.paletteMap(mBMD, mBMD.rect, zPoint, null, null, null, _FadeArray);
_local3 = mTopLayer.getRect(mTopLayer);
mBMD.draw(mTopLayer);
Clear();
mBMD.applyFilter(mBMD, mBMD.rect, zPoint, mFilter);
Scroll(_arg1.topLeft);
_arg2.draw(mBMD, mMatrixToPlane, null, null, null, false);
}
private function Update():void{
mUpdateCount = UPDATECOUNT;
}
public function Scroll(_arg1:Point):void{
var _local2:Number;
var _local3:Number;
_local2 = Math.round((mRenderPos.x - (_arg1.x * scale)));
_local3 = Math.round((mRenderPos.y - (_arg1.y * scale)));
mRenderPos.x = (mRenderPos.x - _local2);
mRenderPos.y = (mRenderPos.y - _local3);
mBMD.scroll(_local2, (_local3 - 1));
}
public function DrawSmokeLine(_arg1:Point, _arg2:Point, _arg3:Number=0, _arg4:Number=0.5):void{
var _local5:Point;
var _local6:int;
var _local7:Point;
var _local8:Point;
if (!mActive){
return;
};
_local5 = _arg2.subtract(_arg1);
_local6 = (_local5.length / 20);
_local5.normalize(20);
_local7 = _arg1.clone();
while (_local6) {
_local8 = _local7.add(_local5).add(new Point(((Math.random() - 0.5) * 6), ((Math.random() - 0.5) * 6)));
DrawLine(_arg3, 0xFFFFFF, (_arg4 + (Math.random() * 0.2)), _local7.x, _local7.y, _local8.x, _local8.y);
_local6--;
_local7 = _local8;
};
DrawLine(_arg3, 0xFFFFFF, (_arg4 + (Math.random() * 0.2)), _local7.x, _local7.y, _arg2.x, _arg2.y);
}
}
}//package Landscape
Section 72
//CLSThingDraw (Landscape.CLSThingDraw)
package Landscape {
import flash.display.*;
import Thing.*;
import flash.geom.*;
import STC9.Sprite.*;
import World.*;
import STC9.Math.*;
import Draw.*;
import flash.utils.*;
import flash.events.*;
import STC9.System.Profiler.*;
import Game.*;
import STC9.IO.*;
import flash.ui.*;
import adobe.utils.*;
public class CLSThingDraw extends Sprite {
private var yPitch:int;
private var mCellIndicator:Cell_Indicator;
private var mDrawList:Array;
private var mFillLayer:Sprite;
private var xPitch:int;
private var mLineLayer:Sprite;
private var _WorldMap:CWorldMap;
public static const mDebug:Boolean = false;
private static const xProjection:int = 40;
private static const yProjection:int = 28;
private static const zProjection:Number = 28.2842712474619;
public static const zPoint:Point = new Point(0, 0);
public static var renderPosition:Point;
public function CLSThingDraw(){
mCellIndicator = new Cell_Indicator();
}
public function Draw(_arg1:Rectangle):void{
var _local2:CWMSearchArea;
var _local3:CThingV3;
var _local4:Point;
var _local5:*;
renderPosition = _arg1.topLeft;
_local2 = new CWMSearchArea(((_arg1.x / CLSDraw.xProjection) - 1), (_arg1.y / CLSDraw.yProjection), ((_arg1.width / CLSDraw.xProjection) + 1), ((_arg1.height / CLSDraw.yProjection) + 2));
mDrawList = _WorldMap.GetThings(_local2);
CGame.mFPS.StartProfile("TDraw_Sort");
mDrawList.sort(SortThing);
CGame.mFPS.StopProfile("TDraw_Sort");
CGame.mFPS.StartProfile("TDraw_Render");
for each (_local5 in mDrawList) {
_local3 = _local5.mPosition;
_local4 = _local5.mRenderPosition;
_local4.x = ((_local3.x * xProjection) - renderPosition.x);
_local4.y = ((_local3.z) ? ((_local3.y * yProjection) - (_local3.z * zProjection)) : (_local3.y * yProjection) - renderPosition.y);
_local5.Render();
};
CGame.mFPS.StopProfile("TDraw_Render");
CFPS.AddDebug("TDraw_Count", String(mDrawList.length));
}
public function get _CLASSID_():String{
return ("CLSThingDraw");
}
private function SortThing(_arg1:CThing, _arg2:CThing):Number{
return (((_arg1.mPosition.y)>_arg2.mPosition.y) ? 1 : ((_arg1.mPosition.y)<_arg2.mPosition.y) ? -1 : 0);
}
public function set mWorldMap(_arg1:CWorldMap):void{
_WorldMap = _arg1;
xPitch = _WorldMap.mWidth;
yPitch = _WorldMap.mHeight;
}
public function RenderPosition(_arg1:CThingV3):Point{
return (new Point(((_arg1.x * CLSDraw.xProjection) - renderPosition.x), (((_arg1.y * CLSDraw.yProjection) - (_arg1.z * CLSDraw.zProjection)) - renderPosition.y)));
}
}
}//package Landscape
Section 73
//Level_Size_39 (Level_Collections_fla.Level_Size_39)
package Level_Collections_fla {
import flash.display.*;
public dynamic class Level_Size_39 extends MovieClip {
public function Level_Size_39(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package Level_Collections_fla
Section 74
//CScreen (Screen.CScreen)
package Screen {
import flash.display.*;
import flash.geom.*;
import STC9.Bitmap.*;
import STC9.Math.*;
import flash.utils.*;
import flash.events.*;
import IO.*;
import STC9.System.Profiler.*;
import STC9.UI.*;
import Game.*;
import STC9.IO.*;
import flash.net.*;
import flash.media.*;
import flash.external.*;
import flash.system.*;
import flash.ui.*;
import adobe.utils.*;
import STC9.XSI.*;
import STC9.Importer.Bitmap.*;
import STC9.System.*;
public class CScreen extends MovieClip {
private var mAudioContainer:Object;
public var TransitionProcess:Function;
public var mScreenCollection:CScreenCollection;
private var mTransitionStart:int;
public function CScreen():void{
AddSound("Click", Click);
AddSound("ClickShort", ClickShort);
stop();
}
public function AddSound(_arg1:String, _arg2:Class, _arg3:int=1):Object{
if (!mAudioContainer){
mAudioContainer = new Object();
};
mAudioContainer[_arg1] = {mSound:new (_arg2), mID:_arg1};
return (mAudioContainer[_arg1]);
}
public function Activate(_arg1:String="FADEIN"):void{
visible = true;
var _local2 = this;
_local2[("Transition_" + _arg1)]();
}
public function PlaySound(_arg1:String, _arg2:Number=0, _arg3:int=0, _arg4:Number=1):void{
if (CGlobalData.GetData("Sound", "on") == "on"){
mAudioContainer[_arg1].mSound.play(_arg2, _arg3, new SoundTransform(_arg4, 0));
};
}
public function me_DUMB(_arg1:MouseEvent):void{
}
public function me_MOREGAMES_CLICK(_arg1:MouseEvent):void{
CGlobalData.OpenURL_SponsorWebsite();
CMochiBot.Track(CMochiBot.BXH_ZW_SPONSORCLICK_MOREGAMES);
}
public function PlaySound_Click():void{
PlaySound("Click");
}
public function TRANSITIONCOMPLETE():void{
mScreenCollection.ClearBackground();
}
public function PlaySound_ClickShort():void{
PlaySound("ClickShort", 0, 0, 0.2);
}
public function Deactivate(_arg1:String="FADEOUT"):void{
visible = false;
}
public function get _CLASSID_():String{
return ("CScreen");
}
private function Transition_FADEIN_Process():Boolean{
var _local1:Number;
var _local2:Boolean;
_local1 = Math.min(1, ((getTimer() - mTransitionStart) / 500));
alpha = _local1;
_local2 = (_local1 >= 1);
if (_local2){
cacheAsBitmap = false;
TransitionProcess = null;
TRANSITIONCOMPLETE();
};
return (_local2);
}
private function Transition_FADEIN():void{
TransitionProcess = Transition_FADEIN_Process;
mTransitionStart = getTimer();
cacheAsBitmap = true;
alpha = 0;
}
public function me_LOGO_CLICK(_arg1:MouseEvent):void{
CGlobalData.OpenURL_BoxheadWebsite();
}
}
}//package Screen
Section 75
//CScreen_Config (Screen.CScreen_Config)
package Screen {
import flash.display.*;
import flash.geom.*;
import STC9.Bitmap.*;
import STC9.Math.*;
import flash.utils.*;
import flash.events.*;
import IO.*;
import STC9.System.Profiler.*;
import Game.*;
import flash.text.*;
import STC9.IO.*;
import flash.ui.*;
import adobe.utils.*;
import STC9.XSI.*;
import STC9.Importer.Bitmap.*;
import STC9.System.*;
public class CScreen_Config extends CScreen {
public var tfMoveLeft:TextField;
public var bReset:SimpleButton;
public var bPrevWeapon:SimpleButton;
public var tfQuality:TextField;
public var tfUseWeapon:TextField;
public var tfZombies:TextField;
public var tfPrevWeapon:TextField;
public var bQuality:SimpleButton;
public var bUseWeapon:SimpleButton;
public var bZombies:SimpleButton;
public var tfRunners:TextField;
public var tfMoveRight:TextField;
public var bDevils:SimpleButton;
public var bMoveRight:SimpleButton;
public var bMoveDown:SimpleButton;
public var bRunners:SimpleButton;
public var tfMoveDown:TextField;
public var bVampires:SimpleButton;
public var tfDevils:TextField;
public var bClose:SimpleButton;
public var tfVampires:TextField;
public var bNextWeapon:SimpleButton;
public var mcFieldFlasher:MovieClip;
public var tfNextWeapon:TextField;
public var tfGameSpeed:TextField;
public var bGameSpeed:SimpleButton;
public var bMoveUp:SimpleButton;
public var tfMoveUp:TextField;
private var mKeyboard:CKeyboard;
private var bFocus:Object;
public var mcTopLock:MovieClip;
public var tfSound:TextField;
public var tfMummies:TextField;
public var bMummies:SimpleButton;
public var bSound:SimpleButton;
public var mcLock:MovieClip;
public var bMoveLeft:SimpleButton;
private static var bList:Object;
public function CScreen_Config():void{
bClose.addEventListener(MouseEvent.MOUSE_UP, me_CLOSE_CLICK);
bReset.addEventListener(MouseEvent.MOUSE_UP, me_RESET_CLICK);
mcLock.addEventListener(MouseEvent.MOUSE_UP, me_DUMB);
mcTopLock.addEventListener(MouseEvent.MOUSE_UP, me_DUMB);
bList = new Object();
SetupButton("Zombies", ["on", "off"], "on", false);
SetupButton("Vampires", ["on", "off"], "on");
SetupButton("Devils", ["on", "off"], "on");
SetupButton("Mummies", ["on", "off"], "on");
SetupButton("Runners", ["on", "off"], "on");
SetupButton("GameSpeed", ["normal", "fast"], "normal");
SetupButton("Quality", ["low", "high"], "high");
SetupButton("Sound", ["on", "off"], "on");
SetupButton("MoveLeft", [], "LEFT");
SetupButton("MoveRight", [], "RIGHT");
SetupButton("MoveUp", [], "UP");
SetupButton("MoveDown", [], "DOWN");
SetupButton("UseWeapon", [], "SPACE");
SetupButton("NextWeapon", [], "X");
SetupButton("PrevWeapon", [], "Z");
mcTopLock.visible = (mcFieldFlasher.visible = false);
}
private function me_CLOSE_CLICK(_arg1:MouseEvent):void{
PlaySound_ClickShort();
Deactivate();
CGlobalData.Flush();
}
private function me_RESET_CLICK(_arg1:MouseEvent):void{
var _local2:Object;
PlaySound_ClickShort();
for each (_local2 in bList) {
_local2.mTextfield.text = _local2.mDefault;
CGlobalData.SetData(_local2.bID, _local2.mDefault);
};
}
private function me_CLICKBUTTON(_arg1:MouseEvent):void{
PlaySound_ClickShort();
bFocus = bList[_arg1.currentTarget.name];
if (bFocus.mTexts.length){
bFocus.mTextfield.text = bFocus.mTexts[((bFocus.mTexts.indexOf(bFocus.mTextfield.text) + 1) % bFocus.mTexts.length)];
CGlobalData.SetData(bFocus.bID, bFocus.mTextfield.text);
} else {
bFocus.mLastValue = bFocus.mTextfield.text;
bFocus.mTextfield.text = "";
mKeyboard.addEventListener(CKeyboard.KEYDOWN, e_KEYDOWN);
mcTopLock.visible = (mcFieldFlasher.visible = true);
mcFieldFlasher.x = bFocus.mButton.x;
mcFieldFlasher.y = bFocus.mButton.y;
mcFieldFlasher.width = bFocus.mButton.width;
mcFieldFlasher.height = bFocus.mButton.height;
};
}
override public function Deactivate(_arg1:String="FADEOUT"):void{
var _local2:String;
visible = false;
mKeyboard.Dispose();
_local2 = "on";
if (CGlobalData.GetData("Zombies") == "off"){
_local2 = "off";
};
if (CGlobalData.GetData("Vampires") == "off"){
_local2 = "off";
};
if (CGlobalData.GetData("Devils") == "off"){
_local2 = "off";
};
if (CGlobalData.GetData("Mummies") == "off"){
_local2 = "off";
};
if (CGlobalData.GetData("Zombies") == "off"){
_local2 = "off";
};
if (CGlobalData.GetData("GameSpeed") == "fast"){
_local2 = "off";
};
CGlobalData.SetData("SendScore", _local2);
}
override public function Activate(_arg1:String="FADEIN"):void{
mKeyboard = new CKeyboard(this.stage, true);
visible = true;
}
private function e_KEYDOWN(_arg1:Event):void{
var _local2:String;
var _local3:String;
_local2 = CKeyboard.mKeyNames[CKeyboard.mKeycodeDown];
_local3 = _local2.toUpperCase();
if ((((_local3 == "P")) || ((_local3 == "")))){
return;
};
bFocus.mTextfield.text = ((_local3)=="ESCAPE") ? bFocus.mLastValue : _local2;
CGlobalData.SetData(bFocus.bID, bFocus.mTextfield.text);
mKeyboard.removeEventListener(CKeyboard.KEYDOWN, e_KEYDOWN);
mcTopLock.visible = (mcFieldFlasher.visible = false);
}
override public function get _CLASSID_():String{
return ("CScreen_Config");
}
private function SetupButton(_arg1:String, _arg2:Array, _arg3:String, _arg4:Boolean=true):void{
var _local5:String;
_local5 = ("b" + _arg1);
bList[_local5] = new Object();
bList[_local5].mTextfield = this[("tf" + _arg1)];
bList[_local5].mTexts = _arg2;
bList[_local5].mDefault = _arg3.toLowerCase();
bList[_local5].mButton = this[_local5];
bList[_local5].bID = _arg1;
bList[_local5].mTextfield.selectable = false;
bList[_local5].mTextfield.text = CGlobalData.GetData(_arg1, bList[_local5].mDefault);
if (_arg4){
bList[_local5].mButton.addEventListener(MouseEvent.MOUSE_UP, me_CLICKBUTTON);
} else {
bList[_local5].mButton.visible = false;
};
}
public static function GetPlayerControl(_arg1:int=0):CPlayerControl{
var _local2:Object;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:String;
_local2 = CKeyboard.mKeyNameToKeyID;
_local3 = _local2[bList["bMoveLeft"].mTextfield.text];
_local4 = _local2[bList["bMoveRight"].mTextfield.text];
_local5 = _local2[bList["bMoveUp"].mTextfield.text];
_local6 = _local2[bList["bMoveDown"].mTextfield.text];
_local7 = _local2[bList["bUseWeapon"].mTextfield.text];
_local8 = _local2[bList["bNextWeapon"].mTextfield.text];
_local9 = _local2[bList["bPrevWeapon"].mTextfield.text];
return (CPlayerControl.Define_NORMAL(_local3, _local4, _local5, _local6, _local7, _local9, _local8));
}
}
}//package Screen
Section 76
//CScreen_Credits (Screen.CScreen_Credits)
package Screen {
import flash.display.*;
import flash.events.*;
import Game.*;
import flash.text.*;
import flash.system.*;
public class CScreen_Credits extends CScreen {
public var tfVersion:TextField;
public var bFGL:SimpleButton;
public var bMoreGames:SimpleButton;
public var bMochibot:SimpleButton;
public var bClose:SimpleButton;
public var mcLock:MovieClip;
public function CScreen_Credits():void{
bClose.addEventListener(MouseEvent.MOUSE_UP, me_CLOSE_CLICK);
mcLock.addEventListener(MouseEvent.MOUSE_UP, me_DUMB);
tfVersion.text = ((CVersion.mVersionString + " ") + Capabilities.version);
tfVersion.visible = false;
}
private function me_CLOSE_CLICK(_arg1:MouseEvent):void{
PlaySound_ClickShort();
Deactivate();
CGlobalData.Flush();
}
override public function get _CLASSID_():String{
return ("CScreen_Credits");
}
}
}//package Screen
Section 77
//CScreen_Debrief (Screen.CScreen_Debrief)
package Screen {
import flash.display.*;
import flash.geom.*;
import STC9.Bitmap.*;
import STC9.Math.*;
import STC9.Security.*;
import flash.utils.*;
import flash.events.*;
import IO.*;
import STC9.System.Profiler.*;
import Game.*;
import flash.text.*;
import STC9.IO.*;
import STC9.String.*;
import flash.ui.*;
import adobe.utils.*;
import STC9.XSI.*;
import STC9.Importer.Bitmap.*;
import STC9.System.*;
public class CScreen_Debrief extends CScreen {
public var bViewHiscoreTable:SimpleButton;
public var mcPostScore:Screen_PostScore;
public var mcTitleImage:MovieClip;
public var bMoreGames:SimpleButton;
public var bRetry:SimpleButton;
public var bBack:SimpleButton;
public var tfScore:TextField;
public var mcLogo:SimpleButton;
public var tfUsername:TextField;
public var bSendScore:SimpleButton;
public var mcDisableCover:MovieClip;
public static var mDefUsername:String = "<enter your name>";
public static var SScore:CSecureNumber;
public function CScreen_Debrief():void{
bBack.addEventListener(MouseEvent.MOUSE_UP, me_BACK_CLICK);
bRetry.addEventListener(MouseEvent.MOUSE_UP, me_RETRY_CLICK);
bSendScore.addEventListener(MouseEvent.MOUSE_UP, me_SENDSCORE_CLICK);
mcPostScore.addEventListener(CScreen_PostScore.PSCANCELLED, me_POSTSCORE_CANCELLED);
bViewHiscoreTable.addEventListener(MouseEvent.MOUSE_UP, me_VIEWHISCORES_CLICK);
mcLogo.addEventListener(MouseEvent.MOUSE_UP, me_LOGO_CLICK);
mcLogo.useHandCursor = true;
bMoreGames.addEventListener(MouseEvent.MOUSE_UP, me_MOREGAMES_CLICK);
mcPostScore.visible = false;
mcDisableCover.addEventListener(MouseEvent.MOUSE_UP, me_DUMB);
mcDisableCover.mcConfigChanged.enabled = false;
mcDisableCover.mcConfigChanged.visible = false;
}
override public function Activate(_arg1:String="FADEIN"):void{
super.Activate(_arg1);
tfScore.text = CString.Pad(SScore.toString(), "0", 8);
tfUsername.text = CGlobalData.GetData("username", mDefUsername);
mcDisableCover.visible = ((CGlobalData.GetData("SendScore", "on"))=="on") ? false : true;
mcDisableCover.mcConfigChanged.visible = mcDisableCover.visible;
if (!mcDisableCover.visible){
CGlobalData.PostKongregateStats();
};
}
private function me_BACK_CLICK(_arg1:MouseEvent):void{
PlaySound_ClickShort();
mScreenCollection.Activate("MAIN");
}
private function me_SENDSCORE_CLICK(_arg1:MouseEvent):void{
if (tfUsername.text == mDefUsername){
return;
};
CGlobalData.SetData("username", tfUsername.text);
PlaySound_ClickShort();
mcPostScore.mScreenCollection = mScreenCollection;
mcDisableCover.visible = true;
mcPostScore.SendScore(SScore, tfUsername.text);
CMochiBot.Track(CMochiBot.BXH_ZW_SCOREPOSTED);
CMochiBot.Track(CMochiBot.BXH_ZW_HISCOREVIEWS_POSTSCORE);
}
private function me_VIEWHISCORES_CLICK(_arg1:MouseEvent):void{
CScreen_PostScore.ViewHiscoreTable(CScreen_SelectLevel.mLevelIndex);
CMochiBot.Track(CMochiBot.BXH_ZW_HISCOREVIEWS_DEBRIEF);
}
override public function Deactivate(_arg1:String="FADEOUT"):void{
super.Deactivate(_arg1);
CGlobalData.Flush();
}
override public function get _CLASSID_():String{
return ("CScreen_Debrief");
}
private function me_RETRY_CLICK(_arg1:MouseEvent):void{
PlaySound_ClickShort();
mScreenCollection.Activate("SELECTLEVEL");
}
public function me_POSTSCORE_CANCELLED(_arg1:Event):void{
mcDisableCover.visible = false;
}
}
}//package Screen
Section 78
//CScreen_LoadLevel (Screen.CScreen_LoadLevel)
package Screen {
import flash.display.*;
import flash.events.*;
import Game.*;
public class CScreen_LoadLevel extends CScreen {
public var mcTitleImage:MovieClip;
private var mGame:CGame;
public function CScreen_LoadLevel():void{
}
private function e_GAME_DISPOSED(_arg1:Event):void{
mGame.removeEventListener(CGame.DISPOSED, e_GAME_DISPOSED);
mScreenCollection.Unpause();
mScreenCollection.parent.removeChild(mGame);
mGame = null;
mScreenCollection.Activate("DEBRIEF");
}
override public function TRANSITIONCOMPLETE():void{
super.TRANSITIONCOMPLETE();
addEventListener(Event.ENTER_FRAME, e_GAME_LOAD);
}
private function e_GAME_LOAD(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, e_GAME_LOAD);
mGame = new CGame();
mScreenCollection.parent.addChild(mGame);
mGame.Activate(CScreen_SelectLevel.mLevelIndex);
mGame.addEventListener(CGame.DISPOSED, e_GAME_DISPOSED);
mGame.addEventListener(CGame.START, e_GAME_START);
}
override public function get _CLASSID_():String{
return ("CScreen_LoadLevel");
}
private function e_GAME_START(_arg1:Event):void{
mGame.removeEventListener(CGame.START, e_GAME_START);
mScreenCollection.Pause();
mScreenCollection.SetIDefaults(mGame);
}
}
}//package Screen
Section 79
//CScreen_Main (Screen.CScreen_Main)
package Screen {
import flash.display.*;
import flash.events.*;
import IO.*;
import Game.*;
public class CScreen_Main extends CScreen {
public var bCredits:SimpleButton;
public var bBoxheadHalloween:SimpleButton;
public var mcCredits:Screen_Credits;
public var bMoreGames:SimpleButton;
public var bInstructions:SimpleButton;
public var bBoxhead2PlayRooms:SimpleButton;
public var mcLogo:SimpleButton;
public var bBoxheadTheRooms:SimpleButton;
public var bBoxheadMoreRooms:SimpleButton;
public var bPlay:SimpleButton;
public function CScreen_Main():void{
bCredits.addEventListener(MouseEvent.MOUSE_UP, me_CREDITS_CLICK);
bPlay.addEventListener(MouseEvent.MOUSE_UP, me_PLAY_CLICK);
bMoreGames.addEventListener(MouseEvent.MOUSE_UP, lme_MOREGAMES_CLICK);
bInstructions.addEventListener(MouseEvent.MOUSE_UP, me_INSTRUCTIONS_CLICK);
mcLogo.addEventListener(MouseEvent.MOUSE_UP, me_LOGO_CLICK);
mcLogo.useHandCursor = true;
mcCredits.visible = false;
mcCredits.bMochibot.addEventListener(MouseEvent.MOUSE_UP, me_MOCHIBOT_CLICK);
mcCredits.bFGL.addEventListener(MouseEvent.MOUSE_UP, me_FGL_CLICK);
mcCredits.bMoreGames.addEventListener(MouseEvent.MOUSE_UP, lme_MOREGAMES_CREDITS_CLICK);
bBoxheadHalloween.addEventListener(MouseEvent.MOUSE_UP, me_BOXHEADHALLOWEEN_CLICK);
bBoxheadTheRooms.addEventListener(MouseEvent.MOUSE_UP, me_BOXHEADTHEROOMS_CLICK);
bBoxheadMoreRooms.addEventListener(MouseEvent.MOUSE_UP, me_BOXHEADMOREROOMS_CLICK);
bBoxhead2PlayRooms.addEventListener(MouseEvent.MOUSE_UP, me_BOXHEAD2PLAYROOMS_CLICK);
}
private function me_MOCHIBOT_CLICK(_arg1:MouseEvent):void{
CProtection.NavigateToURL(CGlobalData.mMochiBotURL);
}
private function me_CREDITS_CLICK(_arg1:MouseEvent):void{
PlaySound_Click();
mcCredits.visible = true;
}
override public function Activate(_arg1:String="FADEIN"):void{
super.Activate(_arg1);
}
private function me_INSTRUCTIONS_CLICK(_arg1:MouseEvent):void{
PlaySound_Click();
CProtection.NavigateToURL(CGlobalData.mInstructionsURL);
CMochiBot.Track(CMochiBot.BXH_ZW_GAMEGUIDECLICKS);
}
private function me_BOXHEAD2PLAYROOMS_CLICK(_arg1:MouseEvent):void{
CProtection.NavigateToURL(CGlobalData.mCMGBoxhead2PlayRoomsURL);
CMochiBot.Track(CMochiBot.BXH_ZW_BOXHEAD2PLAYROOMSCLICKS);
CMochiBot.Track(CMochiBot.BXH_ZW_TOTALSPONSORCLICKS);
}
public function lme_MOREGAMES_CLICK(_arg1:MouseEvent):void{
CGlobalData.OpenURL_SponsorWebsite();
CMochiBot.Track(CMochiBot.BXH_ZW_SPONSORCLICK_MAIN);
}
override public function Deactivate(_arg1:String="FADEOUT"):void{
super.Deactivate(_arg1);
}
public function lme_MOREGAMES_CREDITS_CLICK(_arg1:MouseEvent):void{
CGlobalData.OpenURL_SponsorWebsite();
CMochiBot.Track(CMochiBot.BXH_ZW_SPONSORCLICK_CREDITS);
}
private function me_PLAY_CLICK(_arg1:MouseEvent):void{
PlaySound_Click();
mScreenCollection.Activate("SELECTLEVEL");
}
override public function get _CLASSID_():String{
return ("CScreen_Main");
}
private function me_BOXHEADTHEROOMS_CLICK(_arg1:MouseEvent):void{
CProtection.NavigateToURL(CGlobalData.mCMGBoxheadTheRoomsURL);
CMochiBot.Track(CMochiBot.BXH_ZW_BOXHEADTHEROOMSCLICKS);
CMochiBot.Track(CMochiBot.BXH_ZW_TOTALSPONSORCLICKS);
}
private function me_BOXHEADMOREROOMS_CLICK(_arg1:MouseEvent):void{
CProtection.NavigateToURL(CGlobalData.mCMGBoxheadMoreRoomsURL);
CMochiBot.Track(CMochiBot.BXH_ZW_BOXHEADMOREROOMSCLICKS);
CMochiBot.Track(CMochiBot.BXH_ZW_TOTALSPONSORCLICKS);
}
private function me_FGL_CLICK(_arg1:MouseEvent):void{
CProtection.NavigateToURL(CGlobalData.mFGLURL);
}
private function me_BOXHEADHALLOWEEN_CLICK(_arg1:MouseEvent):void{
CProtection.NavigateToURL(CGlobalData.mCMGBoxheadHalloweenURL);
CMochiBot.Track(CMochiBot.BXH_ZW_BOXHEADHALLOWEENCLICKS);
CMochiBot.Track(CMochiBot.BXH_ZW_TOTALSPONSORCLICKS);
}
}
}//package Screen
Section 80
//CScreen_MoreGames (Screen.CScreen_MoreGames)
package Screen {
import flash.display.*;
import flash.events.*;
import IO.*;
import Game.*;
public class CScreen_MoreGames extends CScreen {
public var bBoxheadHalloween:SimpleButton;
public var mcTitleImage:MovieClip;
public var bMoreGames:SimpleButton;
public var bBoxhead2PlayRooms:SimpleButton;
public var bBack:SimpleButton;
public var mcLogo:SimpleButton;
public var bBoxheadTheRooms:SimpleButton;
public var bBoxheadMoreRooms:SimpleButton;
public var bCrazyMonkeyGames:SimpleButton;
public function CScreen_MoreGames():void{
}
override public function Activate(_arg1:String="FADEIN"):void{
super.Activate(_arg1);
}
private function me_BACK_CLICK(_arg1:MouseEvent):void{
PlaySound_ClickShort();
mScreenCollection.Activate("MAIN");
}
override public function Deactivate(_arg1:String="FADEOUT"):void{
super.Deactivate(_arg1);
}
override public function get _CLASSID_():String{
return ("CScreen_MoreGames");
}
private function me_CMG_CLICK(_arg1:MouseEvent):void{
CProtection.NavigateToURL(CGlobalData.mCMGURL);
CMochiBot.Track(CMochiBot.BXH_ZW_SPONSORCLICK_MOREBOXHEAD);
CMochiBot.Track(CMochiBot.BXH_ZW_TOTALSPONSORCLICKS);
}
}
}//package Screen
Section 81
//CScreen_Pause (Screen.CScreen_Pause)
package Screen {
import flash.display.*;
import Thing.*;
import flash.geom.*;
import STC9.Bitmap.*;
import STC9.Math.*;
import flash.utils.*;
import flash.events.*;
import IO.*;
import STC9.System.Profiler.*;
import Game.*;
import STC9.IO.*;
import STC9.String.*;
import flash.ui.*;
import adobe.utils.*;
import STC9.XSI.*;
import STC9.Importer.Bitmap.*;
import STC9.System.*;
public class CScreen_Pause extends CScreen {
public var mcScrollContainerRight1:MovieClip;
private var mContentsRight1:Sprite;
private var mContentsRight2:Sprite;
public var bThisGame:SimpleButton;
public var bAllTime:SimpleButton;
public var mcScrollContainerRight2:MovieClip;
private var mContentsLeft:Sprite;
public var mcDefaultNode:ContainerNode;
public var mcTopLock:MovieClip;
public var bExitGame:SimpleButton;
public var bClose:SimpleButton;
private var mDragObject;
public var mcLock:MovieClip;
public var mcScrollContainerLeft:MovieClip;
public var mGame:CGame;
public static const EXITGAME:String = "EXITGAME";
public static const CLOSE:String = "CLOSE";
public function CScreen_Pause():void{
bClose.addEventListener(MouseEvent.MOUSE_UP, me_CLOSE_CLICK);
bExitGame.addEventListener(MouseEvent.MOUSE_UP, me_EXITGAME_CLICK);
mcLock.addEventListener(MouseEvent.MOUSE_UP, me_DUMB);
mcTopLock.addEventListener(MouseEvent.MOUSE_UP, me_DUMB);
mcDefaultNode.visible = false;
mContentsLeft = SetupScrollContainer(mcScrollContainerLeft);
mContentsRight1 = SetupScrollContainer(mcScrollContainerRight1);
mContentsRight2 = SetupScrollContainer(mcScrollContainerRight2);
bThisGame.addEventListener(MouseEvent.MOUSE_UP, me_DISPLAYTHISGAME_CLICK);
bAllTime.addEventListener(MouseEvent.MOUSE_UP, me_DISPLAYALLTIME_CLICK);
mcTopLock.visible = false;
}
private function me_EXITGAME_CLICK(_arg1:MouseEvent):void{
PlaySound_ClickShort();
Deactivate();
dispatchEvent(new Event(EXITGAME));
dispatchEvent(new Event(CLOSE));
}
override public function Activate(_arg1:String="FADEIN"):void{
var _local2:Array;
var _local3:Array;
var _local4:Object;
visible = true;
_local2 = mGame.mWorld.mTrackThing.mUpgrades;
_local3 = mGame.mWorld.mTrackThing.mDefaultUpgrades;
for each (_local4 in _local3) {
AddUpgrade(_local4, _UpgradeExists(_local4, _local2));
};
AddStats(CGlobalData.mLocalStats, mContentsRight1);
AddStats(CGlobalData.mStats, mContentsRight2);
mContentsLeft.cacheAsBitmap = true;
mContentsRight1.cacheAsBitmap = true;
mContentsRight2.cacheAsBitmap = true;
me_DISPLAYTHISGAME_CLICK();
}
private function SetupScrollContainer(_arg1:MovieClip):Sprite{
var _local2:Sprite;
_arg1.scrollRect = new Rectangle(0, 0, _arg1.width, _arg1.height);
_local2 = new Sprite();
_arg1.addChild(_local2);
_arg1.useHandCursor = true;
_local2.addEventListener(MouseEvent.MOUSE_DOWN, e_SCROLLCONTAINER_START);
return (_local2);
}
private function me_CLOSE_CLICK(_arg1:MouseEvent):void{
PlaySound_ClickShort();
Deactivate();
dispatchEvent(new Event(CLOSE));
}
private function e_SCROLLCONTAINER_START(_arg1:MouseEvent):void{
var _local2:*;
mDragObject = _arg1.currentTarget;
mDragObject.addEventListener(MouseEvent.MOUSE_UP, e_SCROLLCONTAINER_STOP);
stage.addEventListener(MouseEvent.MOUSE_UP, e_SCROLLCONTAINER_STOP);
_local2 = mDragObject.parent;
mDragObject.startDrag(false, new Rectangle(0, -((mDragObject.height - _local2.height)), 0, (mDragObject.height - _local2.height)));
}
private function AddUpgrade(_arg1:Object, _arg2:Boolean):void{
var _local3:ContainerNode;
var _local4:CThingWeapon;
var _local5:String;
_local3 = new ContainerNode();
mContentsLeft.addChild(_local3);
_local4 = new _arg1.mClassID(null);
_local5 = _local4.mUpgrades[_arg1.mUpgrade].mName;
_local3.tfLeft.text = ((_local4.mWeaponName + ": ") + ((_arg1.mUpgrade)==0) ? "**NEW**" : _local5);
_local3.tfRight.text = _arg1.mIndex.toString();
_local3.alpha = (_arg2) ? 0.3 : 1;
_local3.y = ((mContentsLeft.numChildren - 1) * _local3.height);
}
private function AddStat(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer):void{
var _local4:ContainerNode;
_local4 = new ContainerNode();
_arg3.addChild(_local4);
_local4.tfLeft.text = _arg1;
_local4.tfRight.text = _arg2;
_local4.y = ((_arg3.numChildren - 1) * _local4.height);
}
private function _UpgradeExists(_arg1:Object, _arg2:Array):Boolean{
var _local3:Object;
for each (_local3 in _arg2) {
if (_local3.mUpgrade != _arg1.mUpgrade){
} else {
if (_local3.mIndex != _arg1.mIndex){
} else {
if (_local3.mClassID != _arg1.mClassID){
} else {
return (true);
};
};
};
};
return (false);
}
override public function Deactivate(_arg1:String="FADEOUT"):void{
bClose.removeEventListener(MouseEvent.MOUSE_UP, me_CLOSE_CLICK);
bExitGame.removeEventListener(MouseEvent.MOUSE_UP, me_EXITGAME_CLICK);
visible = false;
}
private function AddStats(_arg1:Object, _arg2:DisplayObjectContainer):void{
var _local3:Array;
var _local4:String;
_local3 = new Array();
for (_local4 in _arg1) {
_local3.push(_local4);
};
_local3.sort();
for each (_local4 in _local3) {
AddStat(_local4, CString.FormatAsNumber(_arg1[_local4].toString()), _arg2);
};
}
override public function get _CLASSID_():String{
return ("CScreen_Pause");
}
private function me_DISPLAYTHISGAME_CLICK(_arg1:MouseEvent=null):void{
mcScrollContainerRight1.visible = true;
mcScrollContainerRight2.visible = false;
bThisGame.alpha = 1;
bAllTime.alpha = 0.5;
}
private function me_DISPLAYALLTIME_CLICK(_arg1:MouseEvent=null):void{
mcScrollContainerRight1.visible = false;
mcScrollContainerRight2.visible = true;
bThisGame.alpha = 0.5;
bAllTime.alpha = 1;
}
private function e_SCROLLCONTAINER_STOP(_arg1:MouseEvent):void{
mDragObject.removeEventListener(MouseEvent.MOUSE_UP, e_SCROLLCONTAINER_STOP);
stage.removeEventListener(MouseEvent.MOUSE_UP, e_SCROLLCONTAINER_STOP);
mDragObject.stopDrag();
}
}
}//package Screen
Section 82
//CScreen_PostScore (Screen.CScreen_PostScore)
package Screen {
import flash.display.*;
import flash.geom.*;
import STC9.Bitmap.*;
import STC9.Math.*;
import STC9.Security.*;
import flash.utils.*;
import flash.events.*;
import IO.*;
import STC9.System.Profiler.*;
import CMG_AS3.*;
import Game.*;
import flash.text.*;
import STC9.IO.*;
import flash.ui.*;
import adobe.utils.*;
import STC9.XSI.*;
import STC9.Importer.Bitmap.*;
import STC9.System.*;
public class CScreen_PostScore extends CScreen {
public var mcProgress:MovieClip;
private var SScore:CSecureNumber;
public var tfResult:TextField;
private var mPlayerID:String;
private var mCancel:Boolean;
public var bCancel:SimpleButton;
public var bClose:SimpleButton;
public var tfError:TextField;
public var mcLock:MovieClip;
public static const GAMEVERSION:String = "1.0";
public static const PSCANCELLED:String = "PSCANCELLED";
public function CScreen_PostScore():void{
bClose.addEventListener(MouseEvent.MOUSE_UP, me_CLOSE_CLICK);
bCancel.addEventListener(MouseEvent.MOUSE_UP, me_CANCEL_CLICK);
tfError.visible = false;
tfResult.visible = false;
bClose.visible = false;
mcProgress.visible = true;
bCancel.visible = true;
mcLock.addEventListener(MouseEvent.MOUSE_UP, me_DUMB);
SetError("Unable to connect the server. Please check your connection and try again!", true);
SetSuccess("");
}
private function me_CLOSE_CLICK(_arg1:MouseEvent):void{
PlaySound_ClickShort();
if (mCancel){
dispatchEvent(new Event(PSCANCELLED));
};
visible = false;
}
private function SetSuccess(_arg1:String):void{
bCancel.visible = false;
mcProgress.visible = false;
tfError.visible = false;
tfResult.visible = true;
tfResult.text = _arg1;
bClose.visible = true;
mCancel = false;
}
private function e_SCORERESPONSE(_arg1:ServerResponseEvent):void{
switch (_arg1.returnCode){
case ScoreSubmitter.RETURNCODE_WORKING:
break;
case ScoreSubmitter.RETURNCODE_SUCCESS:
SetSuccess("Your score has been posted!!! \nThe score table will open shortly.");
ViewHiscoreTable(CScreen_SelectLevel.mLevelIndex);
break;
case ScoreSubmitter.RETURNCODE_REJECTED:
SetError("The server rejected your score!", false);
break;
case ScoreSubmitter.RETURNCODE_WRONGVERSION:
SetError("This is the wrong version of the game. Check for the newest version at CrazyMonkeyGames.com", false);
ScoreSubmitter.loadUpdatePage();
break;
case ScoreSubmitter.RETURNCODE_NETWORKERROR:
SetError("Your score could not reach the server at this time.", true);
break;
default:
break;
};
}
private function me_CANCEL_CLICK(_arg1:MouseEvent):void{
PlaySound_ClickShort();
visible = false;
dispatchEvent(new Event(PSCANCELLED));
}
override public function get _CLASSID_():String{
return ("CScreen_PostScore");
}
public function SendScore(_arg1:CSecureNumber, _arg2:String):void{
var _local3:Object;
var _local4:ScoreSubmitter;
SScore = _arg1;
mPlayerID = _arg2;
this.visible = true;
mcProgress.visible = true;
tfError.visible = false;
tfResult.visible = false;
bClose.visible = false;
bCancel.visible = true;
_local3 = GetGameID(CScreen_SelectLevel.mLevelIndex);
ScoreSubmitter.gameId = _local3.mGameID;
ScoreSubmitter.gameVersion = _local3.mGameVersion;
ScoreSubmitter.gameValidationCode = _local3.mGameKey;
_local4 = new ScoreSubmitter();
_local4.addEventListener(ScoreSubmitter.SCORE_RESPONSE, e_SCORERESPONSE);
_local4.submitScore(mPlayerID, Number(SScore.mNumber));
}
private function SetError(_arg1:String, _arg2:Boolean):void{
bCancel.visible = false;
mcProgress.visible = false;
tfResult.visible = false;
tfError.visible = true;
tfError.text = _arg1;
bClose.visible = true;
mCancel = _arg2;
}
public static function GetGameID(_arg1:int):Object{
switch (_arg1){
case 0:
return ({mGameVersion:GAMEVERSION, mGameID:328, mGameKey:"boxhdbe3cc81a55b1437578d86c956ab2a2b"});
case 1:
return ({mGameVersion:GAMEVERSION, mGameID:329, mGameKey:"boxh9dadeaea58c2cd08380bb072536dfd61"});
case 2:
return ({mGameVersion:GAMEVERSION, mGameID:330, mGameKey:"boxhb8389756e76505ebafeb05a519497d4e"});
case 3:
return ({mGameVersion:GAMEVERSION, mGameID:331, mGameKey:"boxh7fb139fe5361bfd4d6229ea5ffa638e2"});
case 4:
return ({mGameVersion:GAMEVERSION, mGameID:332, mGameKey:"boxh9f0ecf09d12b2daadb57f4e6a10aece2"});
case 5:
return ({mGameVersion:GAMEVERSION, mGameID:333, mGameKey:"boxh5ecddbc9ecc33be0dba2c1c47847c2f1"});
case 6:
return ({mGameVersion:GAMEVERSION, mGameID:334, mGameKey:"boxh887fb340bf32985eb59316eada6dec64"});
case 7:
return ({mGameVersion:GAMEVERSION, mGameID:335, mGameKey:"boxh18423e6ceb4d643b055ade9030f100a5"});
};
return (null);
}
public static function ViewHiscoreTable(_arg1:int):void{
CProtection.NavigateToURL((CGlobalData.mCMGScoreURL + GetGameID(_arg1).mGameID));
CMochiBot.Track(CMochiBot.BXH_ZW_HISCOREVIEWS);
CMochiBot.Track(CMochiBot.BXH_ZW_TOTALSPONSORCLICKS);
}
}
}//package Screen
Section 83
//CScreen_SelectLevel (Screen.CScreen_SelectLevel)
package Screen {
import flash.display.*;
import flash.geom.*;
import STC9.Bitmap.*;
import World.*;
import STC9.Math.*;
import flash.utils.*;
import flash.events.*;
import IO.*;
import STC9.System.Profiler.*;
import Game.*;
import STC9.IO.*;
import flash.ui.*;
import adobe.utils.*;
import STC9.XSI.*;
import STC9.Importer.Bitmap.*;
import STC9.System.*;
public class CScreen_SelectLevel extends CScreen {
public var bLIcon_04:LIcon;
public var bLIcon_05:LIcon;
public var bLIcon_07:LIcon;
public var bLIcon_08:LIcon;
public var bLIcon_06:LIcon;
public var mcTitleImage:MovieClip;
public var bMoreGames:SimpleButton;
public var mcLevelSelected:MovieClip;
private var bDifficultys:Array;
public var mcLogo:SimpleButton;
public var bBack:SimpleButton;
public var bConfig:SimpleButton;
public var bIntermediate:SimpleButton;
public var mcConfig:Screen_Config;
private var bLevels:Array;
public var bNightmare:SimpleButton;
public var bBeginner:SimpleButton;
public var bViewHiscores_1:SimpleButton;
public var bViewHiscores_2:SimpleButton;
public var bViewHiscores_4:SimpleButton;
public var bViewHiscores_5:SimpleButton;
public var bViewHiscores_6:SimpleButton;
public var bViewHiscores_8:SimpleButton;
public var bViewHiscores_3:SimpleButton;
public var bExpert:SimpleButton;
public var mcLIcon_01:MovieClip;
public var mcLIcon_02:MovieClip;
public var mcLIcon_03:MovieClip;
public var mcLIcon_05:MovieClip;
public var mcLIcon_06:MovieClip;
public var mcLIcon_08:MovieClip;
public var bViewHiscores_7:SimpleButton;
public var mcLIcon_04:MovieClip;
public var mcLIcon_07:MovieClip;
public var mcLevelExclusive1:SimpleButton;
public var mcLevelExclusive2:SimpleButton;
public var bEnterHell:SimpleButton;
public var bLIcon_01:LIcon;
public var bLIcon_02:LIcon;
public var bLIcon_03:LIcon;
public static var mDifficulty:int = 0;
public static var mLevelIndex:int = 0;
public function CScreen_SelectLevel():void{
bDifficultys = [bBeginner, bIntermediate, bExpert, bNightmare];
bBack.addEventListener(MouseEvent.MOUSE_UP, me_BACK_CLICK);
bConfig.addEventListener(MouseEvent.MOUSE_UP, me_CONFIG_CLICK);
bExpert.addEventListener(MouseEvent.MOUSE_UP, me_EXPERT_CLICK);
bIntermediate.addEventListener(MouseEvent.MOUSE_UP, me_INTERMEDIATE_CLICK);
bNightmare.addEventListener(MouseEvent.MOUSE_UP, me_NIGHTMARE_CLICK);
bBeginner.addEventListener(MouseEvent.MOUSE_UP, me_BEGINNER_CLICK);
bEnterHell.addEventListener(MouseEvent.MOUSE_UP, me_ENTERHELL_CLICK);
if (((CProtection.isCMG()) || (CBuild.mDEBUG))){
mcLevelExclusive1.visible = (mcLevelExclusive2.visible = false);
};
mcLevelExclusive1.addEventListener(MouseEvent.MOUSE_UP, me_EXCLUSIVELEVEL_CLICK);
mcLevelExclusive2.addEventListener(MouseEvent.MOUSE_UP, me_EXCLUSIVELEVEL_CLICK);
mcLogo.addEventListener(MouseEvent.MOUSE_UP, me_LOGO_CLICK);
mcLogo.useHandCursor = true;
bMoreGames.addEventListener(MouseEvent.MOUSE_UP, me_MOREGAMES_CLICK);
SelectDifficulty(CGlobalData.GetData("Difficulty", mDifficulty), true);
SelectLevelIndex(CGlobalData.GetData("LevelIndex", mLevelIndex), true);
bViewHiscores_1.addEventListener(MouseEvent.MOUSE_UP, me_VIEWHISCORES1_CLICK);
bViewHiscores_2.addEventListener(MouseEvent.MOUSE_UP, me_VIEWHISCORES2_CLICK);
bViewHiscores_3.addEventListener(MouseEvent.MOUSE_UP, me_VIEWHISCORES3_CLICK);
bViewHiscores_4.addEventListener(MouseEvent.MOUSE_UP, me_VIEWHISCORES4_CLICK);
bViewHiscores_5.addEventListener(MouseEvent.MOUSE_UP, me_VIEWHISCORES5_CLICK);
bViewHiscores_6.addEventListener(MouseEvent.MOUSE_UP, me_VIEWHISCORES6_CLICK);
bViewHiscores_7.addEventListener(MouseEvent.MOUSE_UP, me_VIEWHISCORES7_CLICK);
bViewHiscores_8.addEventListener(MouseEvent.MOUSE_UP, me_VIEWHISCORES8_CLICK);
mcConfig.visible = false;
}
private function me_VIEWHISCORES2_CLICK(_arg1:MouseEvent):void{
me_VIEWHISCORES(_arg1, 1);
}
private function SelectDifficulty(_arg1:int, _arg2:Boolean=false):void{
var _local3:*;
if ((((mDifficulty == _arg1)) && ((_arg2 == false)))){
return;
};
mDifficulty = _arg1;
CGlobalData.SetData("Difficulty", mDifficulty);
for each (_local3 in bDifficultys) {
_local3.transform.colorTransform = new ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
};
bDifficultys[_arg1].transform.colorTransform = new ColorTransform(1, 0, 0, 1, 0xFF, 0, 0, 0);
}
private function e_LICON_OVER(_arg1:MouseEvent):void{
if (_arg1.currentTarget.mSelected){
return;
};
_arg1.currentTarget.partner.mcName.visible = true;
}
private function me_VIEWHISCORES7_CLICK(_arg1:MouseEvent):void{
me_VIEWHISCORES(_arg1, 6);
}
private function me_EXPERT_CLICK(_arg1:MouseEvent):void{
PlaySound_ClickShort();
SelectDifficulty(2);
}
override public function Deactivate(_arg1:String="FADEOUT"):void{
super.Deactivate(_arg1);
CGlobalData.Flush();
}
private function me_VIEWHISCORES4_CLICK(_arg1:MouseEvent):void{
me_VIEWHISCORES(_arg1, 3);
}
private function me_INTERMEDIATE_CLICK(_arg1:MouseEvent):void{
PlaySound_ClickShort();
SelectDifficulty(1);
}
private function me_BEGINNER_CLICK(_arg1:MouseEvent):void{
PlaySound_ClickShort();
SelectDifficulty(0);
}
private function me_VIEWHISCORES1_CLICK(_arg1:MouseEvent):void{
me_VIEWHISCORES(_arg1, 0);
}
private function e_LICON_UP(_arg1:MouseEvent):void{
SelectLevelIndex(_arg1.currentTarget.mIndex);
PlaySound_ClickShort();
}
override public function Activate(_arg1:String="FADEIN"):void{
super.Activate(_arg1);
}
private function me_BACK_CLICK(_arg1:MouseEvent):void{
PlaySound_ClickShort();
mScreenCollection.Activate("MAIN");
}
private function SetChildrenField(_arg1, _arg2:String, _arg3):void{
var _local4:int;
_local4 = (_arg1.numChildren - 1);
while (_local4 >= 0) {
_arg1.getChildAt(_local4)[_arg2] = _arg3;
_local4--;
};
}
private function me_VIEWHISCORES6_CLICK(_arg1:MouseEvent):void{
me_VIEWHISCORES(_arg1, 5);
}
private function me_NIGHTMARE_CLICK(_arg1:MouseEvent):void{
PlaySound_ClickShort();
SelectDifficulty(3);
}
private function me_VIEWHISCORES(_arg1:MouseEvent, _arg2:int):void{
CScreen_PostScore.ViewHiscoreTable(_arg2);
CMochiBot.Track(CMochiBot.BXH_ZW_HISCOREVIEWS_LEVELSELECTION);
}
private function me_VIEWHISCORES3_CLICK(_arg1:MouseEvent):void{
me_VIEWHISCORES(_arg1, 2);
}
private function e_LICON_OUT(_arg1:MouseEvent):void{
if (_arg1.currentTarget.mSelected){
return;
};
_arg1.currentTarget.partner.mcName.visible = false;
}
private function me_CONFIG_CLICK(_arg1:MouseEvent):void{
PlaySound_ClickShort();
mcConfig.mScreenCollection = mScreenCollection;
mcConfig.Activate();
}
private function me_VIEWHISCORES8_CLICK(_arg1:MouseEvent):void{
me_VIEWHISCORES(_arg1, 7);
}
override public function get _CLASSID_():String{
return ("CScreen_SelectLevel");
}
private function me_VIEWHISCORES5_CLICK(_arg1:MouseEvent):void{
me_VIEWHISCORES(_arg1, 4);
}
private function me_EXCLUSIVELEVEL_CLICK(_arg1:MouseEvent):void{
CGlobalData.OpenSponsorURL(CGlobalData.mCMGBoxheadTheZombieWarsURL);
CMochiBot.Track(CMochiBot.BXH_ZW_SPONSORCLICK_EXCLUSIVELEVEL);
}
private function SelectLevelIndex(_arg1:int, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:*;
if (bLevels == null){
_local3 = [mcLIcon_01, mcLIcon_02, mcLIcon_03, mcLIcon_04, mcLIcon_05, mcLIcon_06, mcLIcon_07, mcLIcon_08];
bLevels = [bLIcon_01, bLIcon_02, bLIcon_03, bLIcon_04, bLIcon_05, bLIcon_06, bLIcon_07, bLIcon_08];
_local4 = 0;
while (_local4 < bLevels.length) {
_local5 = bLevels[_local4];
_local5.partner = _local3[_local4];
_local5.mIndex = _local4;
_local5.mSelected = false;
_local5.mNameStartY = _local5.partner.mcName.y;
_local5.partner.mcName.visible = false;
_local5.partner.mcName.tfName.text = CLevelData.GetData(_local5.mIndex).mName;
_local5.addEventListener(MouseEvent.MOUSE_UP, e_LICON_UP);
_local5.addEventListener(MouseEvent.MOUSE_OVER, e_LICON_OVER);
_local5.addEventListener(MouseEvent.MOUSE_OUT, e_LICON_OUT);
_local4++;
};
};
if ((((mLevelIndex == _arg1)) && ((_arg2 == false)))){
return;
};
bLevels[mLevelIndex].mSelected = false;
bLevels[mLevelIndex].partner.mcName.visible = false;
mLevelIndex = _arg1;
CGlobalData.SetData("LevelIndex", mLevelIndex);
mcLevelSelected.x = bLevels[mLevelIndex].x;
mcLevelSelected.y = bLevels[mLevelIndex].y;
bLevels[mLevelIndex].mSelected = true;
bLevels[mLevelIndex].partner.mcName.visible = true;
}
private function me_ENTERHELL_CLICK(_arg1:MouseEvent):void{
PlaySound_Click();
CGlobalData.StartLocalStats(mLevelIndex, mDifficulty, (CGlobalData.GetData("SendScore", "on") == "on"));
mScreenCollection.Activate("LOADLEVEL");
}
}
}//package Screen
Section 84
//CScreenCollection (Screen.CScreenCollection)
package Screen {
import flash.display.*;
import flash.geom.*;
import STC9.Bitmap.*;
import STC9.Math.*;
import flash.utils.*;
import flash.events.*;
import IO.*;
import STC9.System.Profiler.*;
import STC9.UI.*;
import Game.*;
import STC9.IO.*;
import flash.media.*;
import flash.system.*;
import flash.ui.*;
import adobe.utils.*;
import STC9.XSI.*;
import STC9.Importer.Bitmap.*;
import STC9.System.*;
public class CScreenCollection extends MovieClip {
private var mCurrentScreen:CScreen;
private var mcProtection:Protection;
public var mcDefaultBG:MovieClip;
private var mScreens:Object;
private var rParent;
private var bgBitmap:Bitmap;
public static const mScreenHeight:int = 560;
public static const mScreenWidth:int = 800;
public static const SECONDS:int = 25;
public static var mReturn:Boolean = false;
public function CScreenCollection():void{
mScreens = new Object();
AddScreen("MOREGAMES", Screen_MoreGames);
AddScreen("SELECTLEVEL", Screen_SelectLevel);
AddScreen("MAIN", Screen_Main);
AddScreen("DEBRIEF", Screen_Debrief);
AddScreen("LOADLEVEL", Screen_LoadLevel);
Activate((mReturn) ? "DEBRIEF" : "MAIN");
SetIDefaults(this);
mcProtection = new Protection();
CGlobalData.LoadKongregate(this);
stage.quality = StageQuality.HIGH;
addEventListener(Event.ENTER_FRAME, e_PROCESS);
}
public function SetBackground(_arg1:CScreen):void{
var _local2:CBitmapData;
ClearBackground();
_local2 = new CBitmapData(mScreenWidth, mScreenHeight, false, 0);
_local2.draw(_arg1);
bgBitmap = new Bitmap(_local2, "auto", true);
addChild(bgBitmap);
}
public function Activate(_arg1:String):void{
if (mCurrentScreen){
SetBackground(mCurrentScreen);
removeChild(mCurrentScreen);
mCurrentScreen.Deactivate();
};
mCurrentScreen = mScreens[_arg1].screen;
addChild(mCurrentScreen);
mCurrentScreen.Activate("FADEIN");
}
public function ClearBackground():void{
if (!bgBitmap){
return;
};
removeChild(bgBitmap);
bgBitmap.bitmapData.dispose();
bgBitmap.bitmapData = null;
bgBitmap = null;
}
private function e_PROCESS(_arg1:Event):void{
if (mCurrentScreen){
if (mCurrentScreen.TransitionProcess != null){
mCurrentScreen.TransitionProcess();
};
mcProtection.Check(this);
};
}
private function AddScreen(_arg1:String, _arg2:Class):void{
var _local3:CScreen;
_local3 = new (_arg2);
_local3.mScreenCollection = this;
mScreens[_arg1] = {id:_arg1, screen:_local3, screenClass:_arg2};
SetIDefaults(_local3);
_local3.visible = false;
}
public function SetIDefaults(_arg1):void{
CUISetDefaults.SetField(_arg1, "tabEnabled", false, true);
}
public function get _CLASSID_():String{
return ("CScreenCollection");
}
public function Pause():void{
rParent = parent;
removeEventListener(Event.ENTER_FRAME, e_PROCESS);
visible = false;
rParent.removeChild(this);
}
public function Unpause():void{
rParent.addChild(this);
addEventListener(Event.ENTER_FRAME, e_PROCESS);
visible = true;
}
}
}//package Screen
Section 85
//CBitmapData (STC9.Bitmap.CBitmapData)
package STC9.Bitmap {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import STC9.System.Profiler.*;
public class CBitmapData extends BitmapData {
public var mOffset:Point;
private var sID:String;
private static var mItems:Object;
private static var mTracking:Boolean = false;
private static var mAllocateID:int = 0;
private static var mTotalMemory:Number;
public function CBitmapData(_arg1:int, _arg2:int, _arg3:Boolean=true, _arg4:uint=0){
super(_arg1, _arg2, _arg3, _arg4);
if (mTracking){
sID = ("BMD" + ++mAllocateID);
mItems[sID] = this;
mTotalMemory = (mTotalMemory + ((width * height) * 4));
UpdateTotalmem();
};
}
override public function dispose():void{
if (sID){
mTotalMemory = (mTotalMemory - ((width * height) * 4));
UpdateTotalmem();
delete mItems[sID];
};
super.dispose();
}
private function UpdateTotalmem():void{
var _local1:int;
_local1 = Math.round((mTotalMemory / (0x0400 * 0x0400)));
CFPS.AddDebug("BMD.MEM", (_local1.toString() + "mb"));
}
public function toString():String{
return ("");
}
public function RenderDisplayObject(_arg1:DisplayObject):Point{
var _local2:Rectangle;
_local2 = _arg1.getBounds(_arg1);
mOffset = new Point(-(_local2.topLeft.x), -(_local2.topLeft.y));
draw(_arg1, new Matrix(1, 0, 0, 1, -(_local2.topLeft.x), -(_local2.topLeft.y)), null, "normal", null, true);
return (_local2.topLeft);
}
public function GetAverageColor():Number{
var _local1:BitmapData;
var _local2:Matrix;
var _local3:ByteArray;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local1 = new BitmapData(8, 8, transparent, 0);
_local2 = new Matrix((_local1.width / width), 0, 0, (_local1.height / height), 0, 0);
_local1.draw(this, _local2, null, null, null, true);
_local3 = _local1.getPixels(_local1.rect);
_local3.position = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = 0;
_local8 = (_local3.length / 4);
while (_local8) {
_local7 = (_local7 + _local3.readUnsignedByte());
_local4 = (_local4 + _local3.readUnsignedByte());
_local5 = (_local5 + _local3.readUnsignedByte());
_local6 = (_local6 + _local3.readUnsignedByte());
_local8--;
};
_local9 = (_local3.length / 4);
_local7 = Math.round((_local7 / _local9));
_local4 = Math.round((_local4 / _local9));
_local5 = Math.round((_local5 / _local9));
_local6 = Math.round((_local6 / _local9));
return (((((_local7 << 24) | (_local4 << 16)) | (_local5 << 8)) | (_local6 << 0)));
}
public function get _CLASSID_():String{
return ("CBitmapData");
}
public function get _BASECLASSID_():String{
return ("BitmapData");
}
public static function Record():void{
mTracking = true;
mTotalMemory = 0;
mItems = new Object();
}
public static function FromDisplayObject(_arg1:DisplayObject):CBitmapData{
var _local2:CBitmapData;
_local2 = new CBitmapData(_arg1.width, _arg1.height);
_local2.RenderDisplayObject(_arg1);
return (_local2);
}
public static function ReleaseAll():void{
var _local1:CBitmapData;
var _local2:int;
if (!mTracking){
return;
};
for each (_local1 in mItems) {
_local1.dispose();
};
_local2 = Math.round((mTotalMemory / (0x0400 * 0x0400)));
mTracking = false;
}
}
}//package STC9.Bitmap
Section 86
//CByteArray (STC9.Data.CByteArray)
package STC9.Data {
import flash.utils.*;
public class CByteArray extends ByteArray {
public function Pad4():void{
var _local1:int;
_local1 = ((Math.floor((((length - 1) / 4) + 1)) * 4) - length);
while (_local1 > 0) {
this.writeByte(0);
_local1--;
};
}
public function Pad2():void{
var _local1:int;
_local1 = ((Math.floor((((length - 1) / 2) + 1)) * 2) - length);
while (_local1 > 0) {
this.writeByte(0);
_local1--;
};
}
public function get _CLASSID_():String{
return ("CByteArray");
}
public function UnprotectAlpha():CByteArray{
var _local1:CByteArray;
_local1 = new CByteArray();
this.position = 0;
while (this.position < this.length) {
if ((this.position % 4) == 0){
this.readByte();
} else {
_local1.writeByte(this.readByte());
};
};
_local1.position = 0;
return (_local1);
}
public function PadN(_arg1:int):void{
var _local2:int;
_local2 = ((Math.floor((((length - 1) / _arg1) + 1)) * _arg1) - length);
while (_local2 > 0) {
this.writeByte(0);
_local2--;
};
}
public function ProtectAlpha():CByteArray{
var _local1:CByteArray;
_local1 = new CByteArray();
this.position = 0;
while (this.position < this.length) {
if ((_local1.position % 4) == 0){
_local1.writeByte(0xFF);
};
_local1.writeByte(this.readByte());
};
return (_local1);
}
}
}//package STC9.Data
Section 87
//CKey (STC9.IO.CKey)
package STC9.IO {
import flash.utils.*;
public class CKey {
public var mReleased:int;
public var mPressed:int;
public var mDown:Boolean;
public var mKeyCode:int;
static var mNumberOfSamples:Number = 30;
public function CKey(_arg1:Number){
mKeyCode = _arg1;
}
public function get _CLASSID_():String{
return ("CKey");
}
public function Clear():void{
mDown = false;
mPressed = 0;
mReleased = 0;
}
public function RegisterAsUp(){
if (mDown){
mDown = false;
mReleased = getTimer();
};
}
public function RegisterAsDown(){
if (!mDown){
mDown = true;
mPressed = getTimer();
};
}
public function get _BASECLASSID_():String{
return ("CKey");
}
}
}//package STC9.IO
Section 88
//CKeyboard (STC9.IO.CKeyboard)
package STC9.IO {
import flash.display.*;
import flash.events.*;
public class CKeyboard extends EventDispatcher {
private var mDispatchEvents:Boolean;
private var mFocusObject:InteractiveObject;
public static const KEYDOWN:String = "KEYDOWN";
public static var mKeyIDs:Array;
public static var mKeycodeDown:int;
public static var mKeyNameToKeyID:Object;
public static var mActive:Boolean = false;
public static var mKeyNames:Array;
public static var mItems:Array;
public static var mKeyTable:Object;
public function CKeyboard(_arg1:InteractiveObject, _arg2:Boolean=false):void{
mDispatchEvents = _arg2;
mFocusObject = _arg1;
if (mActive){
if (mFocusObject.hasEventListener(KeyboardEvent.KEY_DOWN)){
};
};
mFocusObject.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
mFocusObject.addEventListener(KeyboardEvent.KEY_UP, reportKeyUp);
SetupKeyTables();
mActive = true;
}
private function reportKeyDown(_arg1:KeyboardEvent):void{
if (mItems[_arg1.keyCode]){
mItems[_arg1.keyCode].RegisterAsDown();
mKeycodeDown = _arg1.keyCode;
if (mDispatchEvents){
dispatchEvent(new Event(KEYDOWN));
};
};
}
private function SetupKeyTables():void{
var _local1:int;
var _local2:String;
mKeyTable = new Object();
_local1 = 65;
while (_local1 < (65 + 26)) {
mKeyTable[String.fromCharCode(_local1)] = _local1;
mKeyTable[String.fromCharCode((_local1 + 32))] = _local1;
_local1++;
};
_local1 = 48;
while (_local1 < (48 + 10)) {
mKeyTable[String.fromCharCode(_local1)] = _local1;
_local1++;
};
mKeyTable["F1"] = 112;
mKeyTable["F2"] = 113;
mKeyTable["F3"] = 114;
mKeyTable["F4"] = 115;
mKeyTable["F5"] = 116;
mKeyTable["F6"] = 117;
mKeyTable["F7"] = 118;
mKeyTable["F8"] = 119;
mKeyTable["F9"] = 120;
mKeyTable["F10"] = 121;
mKeyTable["F11"] = 122;
mKeyTable["F12"] = 123;
mKeyTable["F13"] = 124;
mKeyTable["F14"] = 125;
mKeyTable["F15"] = 126;
mKeyTable["NUM_LOCK"] = 144;
mKeyTable["SCR_LOCK"] = 145;
mKeyTable["PAUSE"] = 19;
mKeyTable["NUMPAD_0"] = 96;
mKeyTable["NUMPAD_1"] = 97;
mKeyTable["NUMPAD_2"] = 98;
mKeyTable["NUMPAD_3"] = 99;
mKeyTable["NUMPAD_4"] = 100;
mKeyTable["NUMPAD_5"] = 101;
mKeyTable["NUMPAD_6"] = 102;
mKeyTable["NUMPAD_7"] = 103;
mKeyTable["NUMPAD_8"] = 104;
mKeyTable["NUMPAD_9"] = 105;
mKeyTable["NUMPAD_ADD"] = 107;
mKeyTable["NUMPAD_DECIMAL"] = 110;
mKeyTable["NUMPAD_DIVIDE"] = 111;
mKeyTable["NUMPAD_ENTER"] = 108;
mKeyTable["NUMPAD_MULTIPLY"] = 106;
mKeyTable["NUMPAD_SUBTRACT"] = 109;
mKeyTable["COLON"] = 186;
mKeyTable["EQUALS"] = 187;
mKeyTable["MINUS"] = 189;
mKeyTable["FWD_SLASH"] = 191;
mKeyTable["LSQR_BRACKET"] = 219;
mKeyTable["RSQR_BRACKET"] = 221;
mKeyTable["BACK_SLASH"] = 220;
mKeyTable["COMMA"] = 188;
mKeyTable["DOT"] = 190;
mKeyTable["HOME"] = 36;
mKeyTable["INSERT"] = 45;
mKeyTable["PAGE_DOWN"] = 34;
mKeyTable["PAGE_UP"] = 33;
mKeyTable["SHIFT"] = 16;
mKeyTable["SPACE"] = 32;
mKeyTable["TAB"] = 9;
mKeyTable["QUOTE"] = 34;
mKeyTable["BACKSPACE"] = 8;
mKeyTable["CAPS_LOCK"] = 20;
mKeyTable["CONTROL"] = 17;
mKeyTable["DELETE"] = 46;
mKeyTable["END"] = 35;
mKeyTable["ENTER"] = 13;
mKeyTable["ESCAPE"] = 27;
mKeyTable["UP"] = 38;
mKeyTable["LEFT"] = 37;
mKeyTable["DOWN"] = 40;
mKeyTable["RIGHT"] = 39;
mItems = new Array();
_local1 = 0;
while (_local1 < 0x0100) {
mItems.push(new CKey(_local1));
_local1++;
};
mKeyNames = new Array();
mKeyIDs = new Array();
_local1 = 0;
while (_local1 < 0x0100) {
mKeyNames[_local1] = "";
mKeyIDs[_local1] = "";
_local1++;
};
mKeyNameToKeyID = new Object();
for (_local2 in mKeyTable) {
mKeyNames[mKeyTable[_local2]] = TReplace(_local2);
mKeyNameToKeyID[mKeyNames[mKeyTable[_local2]]] = _local2;
mKeyIDs[mKeyTable[_local2]] = _local2;
};
}
private function reportKeyUp(_arg1:KeyboardEvent):void{
if (mItems[_arg1.keyCode]){
mItems[_arg1.keyCode].RegisterAsUp();
};
}
public function get _CLASSID_():String{
return ("CKeyboard");
}
override public function toString():String{
return (_CLASSID_);
}
public function Clear():void{
var _local1:CKey;
for each (_local1 in mItems) {
_local1.Clear();
};
}
private function TReplace(_arg1:String):String{
var _local2:RegExp;
_local2 = /_/;
_arg1 = _arg1.replace(_local2, " ").toLowerCase();
return (_arg1);
}
public function get _BASECLASSID_():String{
return ("CKeyboard");
}
public function Dispose():void{
mFocusObject.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
mFocusObject.removeEventListener(KeyboardEvent.KEY_UP, reportKeyUp);
mActive = false;
}
public static function IsUp(_arg1):Boolean{
return (!(mItems[GetKeyCode(_arg1)].mDown));
}
public static function IsReleased(_arg1):int{
var _local2:Number;
_local2 = mItems[GetKeyCode(_arg1)].mReleased;
mItems[GetKeyCode(_arg1)].mReleased = 0;
return (_local2);
}
public static function IsDownAuto(_arg1):Number{
var _local2:Number;
_local2 = mItems[GetKeyCode(_arg1)].mDownAuto;
mItems[GetKeyCode(_arg1)].mDownAuto = 0;
return (_local2);
}
public static function IsDown(_arg1):Boolean{
return (mItems[GetKeyCode(_arg1)].mDown);
}
private static function GetKeyCode(_arg1):int{
if (typeof(_arg1) == "string"){
return (mKeyTable[_arg1]);
};
return (_arg1);
}
public static function IsPressed(_arg1):int{
var _local2:int;
var _local3:CKey;
var _local4:Number;
_local2 = GetKeyCode(_arg1);
_local3 = mItems[_local2];
_local4 = mItems[_local2].mPressed;
mItems[_local2].mPressed = 0;
return (_local4);
}
}
}//package STC9.IO
Section 89
//CFLMatrix (STC9.Math.CFLMatrix)
package STC9.Math {
import flash.geom.*;
public class CFLMatrix extends Matrix {
public function CFLMatrix(_arg1:Number=1, _arg2:Number=0, _arg3:Number=0, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function skew(_arg1:Number, _arg2:Number):void{
this.concat(new CFLMatrix(1, _arg1, _arg2, 1, 0, 0));
}
public function flipAbout(_arg1:Boolean, _arg2:Boolean, _arg3:Point):void{
this.translate(-(_arg3.x), -(_arg3.y));
this.flip(_arg1, _arg2);
this.translate(_arg3.x, _arg3.y);
}
public function scaleAbout(_arg1:Number, _arg2:Number, _arg3:Point):void{
this.translate(-(_arg3.x), -(_arg3.y));
this.scale(_arg1, _arg2);
this.translate(_arg3.x, _arg3.y);
}
public function get _CLASSID_():String{
return ("CFLMatrix");
}
public function flip(_arg1:Boolean, _arg2:Boolean):void{
this.scale((_arg1) ? -1 : 1, (_arg2) ? -1 : 1);
}
public function rotateAbout(_arg1:Number, _arg2:Point):void{
this.translate(-(_arg2.x), -(_arg2.y));
this.rotate(_arg1);
this.translate(_arg2.x, _arg2.y);
}
public function get _BASECLASSID_():String{
return ("CFLMatrix");
}
public function Clone():CFLMatrix{
return (new CFLMatrix(a, b, c, d, tx, ty));
}
private static function N0(_arg1:Number):Number{
return (((((_arg1 == 0)) || (!(isFinite(_arg1))))) ? 1E-6 : _arg1);
}
public static function RemapPlane(_arg1:Array, _arg2:Array):CFLMatrix{
var _local3:CFLMatrix;
_local3 = PlaneMatrix(_arg1[0], _arg1[1], _arg1[2]);
_local3.invert();
_local3.concat(PlaneMatrix(_arg2[0], _arg2[1], _arg2[2]));
return (_local3);
}
public static function PlaneMatrix(_arg1:Point, _arg2:Point, _arg3:Point):CFLMatrix{
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:CFLMatrix;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:CFLMatrix;
_local5 = (_arg2.x - _arg1.x);
_local6 = (_arg3.y - _arg1.y);
_local4 = (((Math.abs(_local5) < 1E-6)) || ((Math.abs(_local6) < 1E-6)));
if (_local4){
_local12 = new (CFLMatrix);
_local12.rotate((Math.PI * 0.5));
_arg1 = _local12.transformPoint(_arg1);
_arg2 = _local12.transformPoint(_arg2);
_arg3 = _local12.transformPoint(_arg3);
};
_arg2 = _arg2.subtract(_arg1);
_arg3 = _arg3.subtract(_arg1);
_local7 = new (CFLMatrix);
_local8 = N0(_arg2.x);
_local9 = N0(_arg3.y);
_local7.scale(_local8, _local9);
_local10 = N0((_arg2.y / _arg2.x));
_local11 = N0((_arg3.x / _arg3.y));
_local7.skew(_local10, _local11);
_local7.translate(_arg1.x, _arg1.y);
if (_local4){
_local7.rotate((-(Math.PI) * 0.5));
};
return (_local7);
}
public static function Rotate_Matrix(_arg1:Number):CFLMatrix{
var _local2:CFLMatrix;
_local2 = new (CFLMatrix);
_local2.rotate(_arg1);
return (_local2);
}
}
}//package STC9.Math
Section 90
//CMatrix4 (STC9.Math.CMatrix4)
package STC9.Math {
public class CMatrix4 {
private var mE10:Number;
private var mE11:Number;
private var mE12:Number;
private var mE13:Number;
private var mE20:Number;
private var mE22:Number;
private var mE23:Number;
private var mE21:Number;
private var mE30:Number;
private var mE31:Number;
private var mE32:Number;
private var mE33:Number;
private var mE00:Number;
private var mE01:Number;
private var mE02:Number;
private var mE03:Number;
public function CMatrix4(){
Identity();
}
public function transformVectors(_arg1:Array, _arg2:Array):void{
var _local3:int;
var _local4:CVector3;
var _local5:CVector3;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local3 = (_arg1.length - 1);
while (_local3 >= 0) {
_local4 = _arg1[_local3];
_local5 = _arg2[_local3];
_local6 = _local4.x;
_local7 = _local4.y;
_local8 = _local4.z;
_local5.x = ((((_local6 * mE00) + (_local7 * mE10)) + (_local8 * mE20)) + mE30);
_local5.y = ((((_local6 * mE01) + (_local7 * mE11)) + (_local8 * mE21)) + mE31);
_local5.z = ((((_local6 * mE02) + (_local7 * mE12)) + (_local8 * mE22)) + mE32);
_local3--;
};
}
public function Inverse():CMatrix4{
var _local1:CMatrix4;
var _local2:Number;
_local1 = new CMatrix4();
_local1.mE00 = (((-(mE12) * mE21) * 1) + ((mE11 * mE22) * 1));
_local1.mE01 = (((mE02 * mE21) * 1) - ((mE01 * mE22) * 1));
_local1.mE02 = (((-(mE02) * mE11) * 1) + ((mE01 * mE12) * 1));
_local1.mE03 = 0;
_local1.mE10 = (((mE12 * mE20) * 1) - ((mE10 * mE22) * 1));
_local1.mE11 = (((-(mE02) * mE20) * 1) + ((mE00 * mE22) * 1));
_local1.mE12 = (((mE02 * mE10) * 1) - ((mE00 * mE12) * 1));
_local1.mE13 = 0;
_local1.mE20 = (((-(mE11) * mE20) * 1) + ((mE10 * mE21) * 1));
_local1.mE21 = (((mE01 * mE20) * 1) - ((mE00 * mE21) * 1));
_local1.mE22 = (((-(mE01) * mE10) * 1) + ((mE00 * mE11) * 1));
_local1.mE23 = 0;
_local1.mE30 = 0;
_local1.mE31 = 0;
_local1.mE32 = 0;
_local1.mE33 = 1;
_local2 = (1 / Determinant());
_local1.mE00 = (_local1.mE00 * _local2);
_local1.mE01 = (_local1.mE01 * _local2);
_local1.mE02 = (_local1.mE02 * _local2);
_local1.mE10 = (_local1.mE10 * _local2);
_local1.mE11 = (_local1.mE11 * _local2);
_local1.mE12 = (_local1.mE12 * _local2);
_local1.mE20 = (_local1.mE20 * _local2);
_local1.mE21 = (_local1.mE21 * _local2);
_local1.mE22 = (_local1.mE22 * _local2);
return (_local1);
}
public function Copy(_arg1:CMatrix4):CMatrix4{
mE00 = _arg1.mE00;
mE01 = _arg1.mE01;
mE02 = _arg1.mE02;
mE03 = _arg1.mE03;
mE10 = _arg1.mE10;
mE11 = _arg1.mE11;
mE12 = _arg1.mE12;
mE13 = _arg1.mE13;
mE20 = _arg1.mE20;
mE21 = _arg1.mE21;
mE22 = _arg1.mE22;
mE23 = _arg1.mE23;
mE30 = _arg1.mE30;
mE31 = _arg1.mE31;
mE32 = _arg1.mE32;
mE33 = _arg1.mE33;
return (this);
}
public function get _CLASSID_():String{
return ("CMatrix4");
}
public function Scale(_arg1:Number, _arg2:Number, _arg3:Number):CMatrix4{
var _local4:CMatrix4;
var _local5:CMatrix4;
_local4 = CMatrix4.Scale_Matrix(_arg1, _arg2, _arg3);
_local5 = this.Clone();
return (Multiply(_local5, _local4));
}
private function Determinant():Number{
return ((((((((-(mE02) * mE11) * mE20) + ((mE01 * mE12) * mE20)) + ((mE02 * mE10) * mE21)) - ((mE00 * mE12) * mE21)) - ((mE01 * mE10) * mE22)) + ((mE00 * mE11) * mE22)));
}
public function MultiplyNew(_arg1:CMatrix4):CMatrix4{
var _local2:*;
_local2 = new CMatrix4();
return (_local2.Multiply(this, _arg1));
}
public function Clone():CMatrix4{
var _local1:CMatrix4;
_local1 = new CMatrix4();
_local1.mE00 = mE00;
_local1.mE01 = mE01;
_local1.mE02 = mE02;
_local1.mE03 = mE03;
_local1.mE10 = mE10;
_local1.mE11 = mE11;
_local1.mE12 = mE12;
_local1.mE13 = mE13;
_local1.mE20 = mE20;
_local1.mE21 = mE21;
_local1.mE22 = mE22;
_local1.mE23 = mE23;
_local1.mE30 = mE30;
_local1.mE31 = mE31;
_local1.mE32 = mE32;
_local1.mE33 = mE33;
return (_local1);
}
public function RotateZ(_arg1:Number):CMatrix4{
var _local2:CMatrix4;
var _local3:CMatrix4;
_local2 = RotateZ_Matrix(_arg1);
_local3 = this.Clone();
return (Multiply(_local2, _local3));
}
public function Multiply(_arg1:CMatrix4, _arg2:CMatrix4):CMatrix4{
mE00 = (((_arg1.mE00 * _arg2.mE00) + (_arg1.mE01 * _arg2.mE10)) + (_arg1.mE02 * _arg2.mE20));
mE01 = (((_arg1.mE00 * _arg2.mE01) + (_arg1.mE01 * _arg2.mE11)) + (_arg1.mE02 * _arg2.mE21));
mE02 = (((_arg1.mE00 * _arg2.mE02) + (_arg1.mE01 * _arg2.mE12)) + (_arg1.mE02 * _arg2.mE22));
mE03 = 0;
mE10 = (((_arg1.mE10 * _arg2.mE00) + (_arg1.mE11 * _arg2.mE10)) + (_arg1.mE12 * _arg2.mE20));
mE11 = (((_arg1.mE10 * _arg2.mE01) + (_arg1.mE11 * _arg2.mE11)) + (_arg1.mE12 * _arg2.mE21));
mE12 = (((_arg1.mE10 * _arg2.mE02) + (_arg1.mE11 * _arg2.mE12)) + (_arg1.mE12 * _arg2.mE22));
mE13 = 0;
mE20 = (((_arg1.mE20 * _arg2.mE00) + (_arg1.mE21 * _arg2.mE10)) + (_arg1.mE22 * _arg2.mE20));
mE21 = (((_arg1.mE20 * _arg2.mE01) + (_arg1.mE21 * _arg2.mE11)) + (_arg1.mE22 * _arg2.mE21));
mE22 = (((_arg1.mE20 * _arg2.mE02) + (_arg1.mE21 * _arg2.mE12)) + (_arg1.mE22 * _arg2.mE22));
mE23 = 0;
mE30 = ((((_arg1.mE30 * _arg2.mE00) + (_arg1.mE31 * _arg2.mE10)) + (_arg1.mE32 * _arg2.mE20)) + _arg2.mE30);
mE31 = ((((_arg1.mE30 * _arg2.mE01) + (_arg1.mE31 * _arg2.mE11)) + (_arg1.mE32 * _arg2.mE21)) + _arg2.mE31);
mE32 = ((((_arg1.mE30 * _arg2.mE02) + (_arg1.mE31 * _arg2.mE12)) + (_arg1.mE32 * _arg2.mE22)) + _arg2.mE32);
mE33 = 1;
return (this);
}
public function RotateY(_arg1:Number):CMatrix4{
var _local2:CMatrix4;
var _local3:CMatrix4;
_local2 = RotateY_Matrix(_arg1);
_local3 = this.Clone();
return (Multiply(_local2, _local3));
}
public function Translate(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean=false):CMatrix4{
var _local5:CMatrix4;
var _local6:CMatrix4;
_local5 = Translate_Matrix(_arg1, _arg2, _arg3, _arg4);
_local6 = this.Clone();
return (Multiply(_local6, _local5));
}
public function RotateX(_arg1:Number):CMatrix4{
var _local2:CMatrix4;
var _local3:CMatrix4;
_local2 = RotateX_Matrix(_arg1);
_local3 = this.Clone();
return (Multiply(_local2, _local3));
}
public function deltaTransformVectors(_arg1:Array, _arg2:Array):void{
var _local3:int;
var _local4:CVector3;
var _local5:CVector3;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local3 = (_arg1.length - 1);
while (_local3 >= 0) {
_local4 = _arg1[_local3];
_local5 = _arg2[_local3];
_local6 = _local4.x;
_local7 = _local4.y;
_local8 = _local4.z;
_local5.x = (((_local6 * mE00) + (_local7 * mE10)) + (_local8 * mE20));
_local5.y = (((_local6 * mE01) + (_local7 * mE11)) + (_local8 * mE21));
_local5.z = (((_local6 * mE02) + (_local7 * mE12)) + (_local8 * mE22));
_local3--;
};
}
public function Identity():CMatrix4{
mE00 = 1;
mE01 = 0;
mE02 = 0;
mE03 = 0;
mE10 = 0;
mE11 = 1;
mE12 = 0;
mE13 = 0;
mE20 = 0;
mE21 = 0;
mE22 = 1;
mE23 = 0;
mE30 = 0;
mE31 = 0;
mE32 = 0;
mE33 = 1;
return (this);
}
public function toString():String{
var _local1:String;
_local1 = "CMatrix4 = \n";
_local1 = (_local1 + (((((((("[" + mE00) + ", ") + mE01) + ", ") + mE02) + ", ") + mE03) + "]\n"));
_local1 = (_local1 + (((((((("[" + mE10) + ", ") + mE11) + ", ") + mE12) + ", ") + mE13) + "]\n"));
_local1 = (_local1 + (((((((("[" + mE20) + ", ") + mE21) + ", ") + mE22) + ", ") + mE23) + "]\n"));
_local1 = (_local1 + (((((((("[" + mE30) + ", ") + mE31) + ", ") + mE32) + ", ") + mE33) + "]"));
return (_local1);
}
public function Normalize():CMatrix4{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = (1 / Math.sqrt((((mE00 * mE00) + (mE01 * mE01)) + (mE02 * mE02))));
mE00 = (mE00 * _local1);
mE01 = (mE01 * _local1);
mE02 = (mE02 * _local1);
_local2 = (1 / Math.sqrt((((mE10 * mE10) + (mE11 * mE11)) + (mE12 * mE12))));
mE10 = (mE10 * _local2);
mE11 = (mE11 * _local2);
mE12 = (mE12 * _local2);
_local3 = (1 / Math.sqrt((((mE20 * mE20) + (mE21 * mE21)) + (mE22 * mE22))));
mE20 = (mE20 * _local3);
mE21 = (mE21 * _local3);
mE22 = (mE22 * _local3);
return (this);
}
public function get _BASECLASSID_():String{
return ("CMatrix4");
}
public function Dispose():void{
}
static function Translate_Matrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean=false):CMatrix4{
var _local5:CMatrix4;
_local5 = CMatrix4.Identity_Matrix();
if (_arg4){
_local5.mE30 = -(_arg1);
_local5.mE31 = -(_arg2);
_local5.mE32 = -(_arg3);
} else {
_local5.mE30 = _arg1;
_local5.mE31 = _arg2;
_local5.mE32 = _arg3;
};
return (_local5);
}
public static function Identity_Matrix():CMatrix4{
var _local1:CMatrix4;
_local1 = new (CMatrix4);
_local1.mE00 = 1;
_local1.mE01 = 0;
_local1.mE02 = 0;
_local1.mE03 = 0;
_local1.mE10 = 0;
_local1.mE11 = 1;
_local1.mE12 = 0;
_local1.mE13 = 0;
_local1.mE20 = 0;
_local1.mE21 = 0;
_local1.mE22 = 1;
_local1.mE23 = 0;
_local1.mE30 = 0;
_local1.mE31 = 0;
_local1.mE32 = 0;
_local1.mE33 = 1;
return (_local1);
}
public static function RotateX_Matrix(_arg1:Number):CMatrix4{
var _local2:CMatrix4;
_local2 = Identity_Matrix();
_local2.mE11 = Math.cos(_arg1);
_local2.mE12 = -(Math.sin(_arg1));
_local2.mE21 = Math.sin(_arg1);
_local2.mE22 = Math.cos(_arg1);
return (_local2);
}
static function RotateXYZ_Matrix(_arg1:Number, _arg2:Number, _arg3:Number):CMatrix4{
return (undefined);
}
public static function Scale_Matrix(_arg1:Number, _arg2:Number, _arg3:Number):CMatrix4{
var _local4:CMatrix4;
_local4 = CMatrix4.Identity_Matrix();
_local4.mE00 = _arg1;
_local4.mE11 = _arg2;
_local4.mE22 = _arg3;
return (_local4);
}
public static function RotateZ_Matrix(_arg1:Number):CMatrix4{
var _local2:CMatrix4;
_local2 = Identity_Matrix();
_local2.mE00 = Math.cos(_arg1);
_local2.mE01 = -(Math.sin(_arg1));
_local2.mE10 = -(_local2.mE01);
_local2.mE11 = _local2.mE00;
return (_local2);
}
public static function RotateY_Matrix(_arg1:Number):CMatrix4{
var _local2:CMatrix4;
_local2 = Identity_Matrix();
_local2.mE00 = Math.cos(_arg1);
_local2.mE02 = Math.sin(_arg1);
_local2.mE20 = -(Math.sin(_arg1));
_local2.mE22 = Math.cos(_arg1);
return (_local2);
}
}
}//package STC9.Math
Section 91
//CVector3 (STC9.Math.CVector3)
package STC9.Math {
import flash.geom.*;
public class CVector3 {
public var x:Number;
public var y:Number;
public var z:Number;
public function CVector3(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
x = _arg1;
y = _arg2;
z = _arg3;
}
function Set(_arg1:CVector3):CVector3{
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
return (this);
}
function Normalize(_arg1:Number):CVector3{
if (this._Length() != 0){
this.ScaleN((_arg1 / this._Length()));
};
return (this);
}
function DotProduct(_arg1:CVector3):Number{
return ((((x * _arg1.x) + (y * _arg1.y)) + (z * _arg1.z)));
}
function Add(_arg1:CVector3):CVector3{
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
return (this);
}
function Inverse():CVector3{
return (new CVector3(-(x), -(y), -(z)));
}
function Abs():CVector3{
return (new CVector3(Math.abs(x), Math.abs(y), Math.abs(z)));
}
function Distance(_arg1:CVector3):Number{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = (x - _arg1.x);
_local3 = (y - _arg1.y);
_local4 = (z - _arg1.z);
return (Math.sqrt((((_local2 * _local2) + (_local3 * _local3)) + (_local4 * _local4))));
}
function Precision(_arg1:Number){
var _local2:Number;
_local2 = ((_arg1)==0) ? 1 : Math.pow(10, _arg1);
x = (Math.round((x * _local2)) / _local2);
y = (Math.round((y * _local2)) / _local2);
z = (Math.round((z * _local2)) / _local2);
return (this);
}
function Equals(_arg1:CVector3):Boolean{
return ((((((x == _arg1.x)) && ((y == _arg1.y)))) && ((z == _arg1.z))));
}
function Sub(_arg1:CVector3):CVector3{
x = (x - _arg1.x);
y = (y - _arg1.y);
z = (z - _arg1.z);
return (this);
}
function ScaleN(_arg1:Number):CVector3{
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
return (this);
}
function _Length():Number{
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
function Scale(_arg1:CVector3):CVector3{
x = (x * _arg1.x);
y = (y * _arg1.y);
z = (z * _arg1.z);
return (this);
}
public function get _CLASSID_():String{
return ("CVector3");
}
public function toString():String{
return (_CLASSID_);
}
function Clear():CVector3{
x = 0;
y = 0;
z = 0;
return (this);
}
function CrossProduct(_arg1:CVector3):CVector3{
return (new CVector3(((y * _arg1.z) - (z * _arg1.y)), ((z * _arg1.x) - (x * _arg1.z)), ((x * _arg1.y) - (y * _arg1.x))));
}
function Equals0():Boolean{
return ((((((x == 0)) && ((y == 0)))) && ((z == 0))));
}
public function ToPoint():Point{
return (new Point(x, y));
}
function Invert():CVector3{
x = -(x);
y = -(y);
z = -(z);
return (this);
}
public function get _BASECLASSID_():String{
return ("CVector3");
}
function Clone():CVector3{
return (new CVector3(x, y, z));
}
function RotateY(_arg1:Number){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
_local4 = ((this.x * _local2) - (this.z * _local3));
_local5 = ((this.z * _local2) + (this.x * _local3));
this.x = _local4;
this.z = _local5;
}
public function Dispose():void{
}
static function Average(_arg1:Array):CVector3{
var _local2:CVector3;
var _local3:Number;
_local2 = _arg1[0].Clone();
_local3 = 1;
while (_local3 < _arg1.length) {
_local2.Add(_arg1[_local3]);
_local3++;
};
return (new CVector3((_local2.x / _arg1.length), (_local2.y / _arg1.length), (_local2.z / _arg1.length)));
}
}
}//package STC9.Math
Section 92
//CSecureNumber (STC9.Security.CSecureNumber)
package STC9.Security {
public class CSecureNumber extends CSecureVar {
private var _Number:Number;
private var _Validation:Number;
public function CSecureNumber(_arg1:Number=0):void{
_Number = _arg1;
_Validation = GetValidationCode(_Number);
}
override public function get _CLASSID_():String{
return ("CSecureNumber");
}
public function set mNumber(_arg1:Number):void{
if (GetValidationCode(_Number) !== _Validation){
_arg1 = 0;
};
_Number = _arg1;
_Validation = GetValidationCode(_Number);
}
public function get mNumber():Number{
return (((GetValidationCode(_Number))==_Validation) ? _Number : 0);
}
public function toString():String{
return (mNumber.toString());
}
private function GetValidationCode(_arg1:Number):Number{
var _local2:Number;
var _local3:String;
var _local4:int;
_local2 = 0;
_local3 = _arg1.toString();
_local4 = 0;
while (_local4 < _local3.length) {
_local2 = (_local2 + _local3.charCodeAt(_local4));
_local4++;
};
return (_local2);
}
}
}//package STC9.Security
Section 93
//CSecureVar (STC9.Security.CSecureVar)
package STC9.Security {
public class CSecureVar {
public function get _CLASSID_():String{
return ("CSecureVar");
}
}
}//package STC9.Security
Section 94
//CSpriteFrame (STC9.Sprite.CSpriteFrame)
package STC9.Sprite {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import STC9.Data.*;
public class CSpriteFrame extends BitmapData {
public var mDirectionAmount:int;
public var mModelInfo:Object;
public var mDisplacement:Point;
public var mFrameIndex:int;
public var mAnimID:String;
public var mDirectionIndex:int;
public var mFrameAmount:int;
private static const nKey:uint = 2772367241;
public function CSpriteFrame(_arg1:int, _arg2:int):void{
super(_arg1, _arg2, true, 0);
}
public function get _CLASSID_():String{
return ("CSpriteFrame");
}
public function Draw(_arg1:Graphics, _arg2:int, _arg3:int){
_arg1.beginBitmapFill(this, new Matrix(1, 0, 0, 1, (_arg2 + mDisplacement.x), (_arg3 + mDisplacement.y)));
_arg1.drawRect((_arg2 + mDisplacement.x), (_arg3 + mDisplacement.y), width, height);
_arg1.endFill();
}
public static function UnpackBytes(_arg1:ByteArray):Object{
var _local2:Object;
var _local3:CByteArray;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:Object;
_local2 = new Object();
_local3 = new CByteArray();
_local2.mAnimID = _arg1.readUTF();
_local2.mDirectionIndex = _arg1.readShort();
_local2.mFrameIndex = _arg1.readShort();
_local2.mTopLeft = new Point();
_local2.mTopLeft.x = _arg1.readShort();
_local2.mTopLeft.y = _arg1.readShort();
_local4 = _arg1.readShort();
_local5 = _arg1.readShort();
_local6 = _arg1.readShort();
_local7 = _arg1.readShort();
_local2.mArea = new Rectangle(_local4, _local5, _local6, _local7);
_local8 = _arg1.readShort();
_local2.mModelInfo = new Object();
_local9 = 0;
while (_local9 < _local8) {
_local10 = (_local2.mModelInfo[_arg1.readUTF()] = {mPosition:{x:0, y:0, z:0}, mDirection:{x:0, y:0, z:0}});
_local10.mPosition.x = _arg1.readFloat();
_local10.mPosition.y = _arg1.readFloat();
_local10.mPosition.z = _arg1.readFloat();
_local10.mDirection.x = _arg1.readFloat();
_local10.mDirection.y = _arg1.readFloat();
_local10.mDirection.z = _arg1.readFloat();
_local9++;
};
return (_local2);
}
public static function PackBytes(_arg1:String, _arg2:int, _arg3:int, _arg4:Point, _arg5:Rectangle, _arg6:Object=null):ByteArray{
var _local7:ByteArray;
var _local8:String;
var _local9:int;
var _local10:Object;
_local7 = new ByteArray();
_local7.writeUTF(_arg1);
_local7.writeShort(_arg2);
_local7.writeShort(_arg3);
_local7.writeShort(_arg4.x);
_local7.writeShort(_arg4.y);
_local7.writeShort(_arg5.left);
_local7.writeShort(_arg5.top);
_local7.writeShort(_arg5.width);
_local7.writeShort(_arg5.height);
if (_arg6){
_local9 = 0;
for (_local8 in _arg6) {
_local9++;
};
_local7.writeShort(_local9);
for (_local8 in _arg6) {
_local10 = _arg6[_local8];
_local7.writeUTF(_local8);
_local7.writeFloat(_local10.mPosition.x);
_local7.writeFloat(_local10.mPosition.y);
_local7.writeFloat(_local10.mPosition.z);
_local7.writeFloat(_local10.mDirection.x);
_local7.writeFloat(_local10.mDirection.y);
_local7.writeFloat(_local10.mDirection.z);
};
} else {
_local7.writeShort(0);
};
_local7.position = 0;
return (_local7);
}
}
}//package STC9.Sprite
Section 95
//CSpriteSheet (STC9.Sprite.CSpriteSheet)
package STC9.Sprite {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import STC9.Data.*;
import flash.filters.*;
public class CSpriteSheet {
public var mAllFrames:Array;
public var mAnimations:Object;
public function CSpriteSheet(){
mAnimations = new Object();
}
public function CreateFrames(_arg1:BitmapData):void{
var _local2:int;
var _local3:int;
var _local4:CByteArray;
var _local5:int;
var _local6:ByteArray;
var _local7:CByteArray;
var _local8:int;
var _local9:Object;
var _local10:CSpriteFrame;
var _local11:Object;
var _local12:Number;
var _local13:CSpriteFrame;
var _local14:Array;
var _local15:Array;
_local2 = 0;
_local3 = 0;
mAllFrames = new Array();
_local4 = new CByteArray();
_local4.writeBytes(_arg1.getPixels(new Rectangle(0, 0, 1, 1)));
_local4.position = 2;
_local5 = _local4.readShort();
_local6 = _arg1.getPixels(new Rectangle(_local3, _local2, _arg1.width, _local5));
_local7 = new CByteArray();
_local7.writeBytes(_local6, _local4.length);
_local7.position = 0;
_local7 = _local7.UnprotectAlpha();
_local7.position = 0;
_local8 = _local7.readShort();
while (_local8) {
_local11 = CSpriteFrame.UnpackBytes(_local7);
if (!_local11){
break;
};
_local12 = 1;
_local11.mArea.inflate(_local12, _local12);
_local13 = new CSpriteFrame(_local11.mArea.width, _local11.mArea.height);
_local13.mDisplacement = _local11.mArea.topLeft;
_local13.mFrameIndex = _local11.mFrameIndex;
_local13.mDirectionIndex = _local11.mDirectionIndex;
_local13.mAnimID = _local11.mAnimID;
_local13.mModelInfo = _local11.mModelInfo;
_local13.copyPixels(_arg1, new Rectangle(_local11.mTopLeft.x, (_local11.mTopLeft.y + _local5), _local13.width, _local13.height), new Point(_local12, _local12));
_local13.applyFilter(_local13, _local13.rect, new Point(0, 0), new GlowFilter(0, 1, 2, 2, 1, 3));
mAllFrames.push(_local13);
_local8--;
};
_local9 = mAnimations;
for each (_local10 in mAllFrames) {
_local14 = (_local9[_local10.mAnimID] = (_local9[_local10.mAnimID]) ? _local9[_local10.mAnimID] : new Array());
_local15 = (_local14[_local10.mDirectionIndex] = (_local14[_local10.mDirectionIndex]) ? _local14[_local10.mDirectionIndex] : new Array());
_local15[_local10.mFrameIndex] = _local10;
};
}
public function get _CLASSID_():String{
return ("CSpriteSheet");
}
public static function AsBitmapData(_arg1:BitmapData):CSpriteSheet{
var _local2:CSpriteSheet;
_local2 = new (CSpriteSheet);
_local2.CreateFrames(_arg1);
return (_local2);
}
public static function AsLibraryItem(_arg1:String):CSpriteSheet{
var _local2:CSpriteSheet;
_local2 = new (CSpriteSheet);
return (_local2);
}
}
}//package STC9.Sprite
Section 96
//CString (STC9.String.CString)
package STC9.String {
import flash.utils.*;
public class CString {
public function get _CLASSID_():String{
return ("CString");
}
public static function MakeAlpha(_arg1:String):String{
var _local2:String;
var _local3:int;
var _local4:int;
_local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
_local4 = _arg1.charCodeAt(_local3);
if ((((((((_local4 >= 65)) && ((_local4 <= 91)))) || ((((_local4 >= 97)) && ((_local4 <= 122)))))) || ((((_local4 >= 48)) && ((_local4 <= 57)))))){
_local2 = (_local2 + _arg1.substr(_local3, 1));
};
_local3++;
};
return (_local2);
}
public static function Trim(_arg1:String):String{
return (TrimL(TrimR(_arg1)));
}
public static function FormatAsNumber(_arg1:Number):String{
var _local2:String;
var _local3:String;
var _local4:int;
var _local5:int;
_local2 = Math.floor(_arg1).toString();
_local3 = "";
_local4 = 0;
_local5 = (_local2.length - 1);
while (_local5 >= 0) {
_local3 = (_local2.charAt(_local5) + _local3);
++_local4;
if (((((_local4 % 3) == 0)) && (!((_local5 == 0))))){
_local3 = ("," + _local3);
};
_local5--;
};
return (_local3);
}
public static function Pad(_arg1, _arg2:String, _arg3:Number, _arg4:Boolean=true):String{
var _local5:String;
_local5 = _arg1;
while (_local5.length < _arg3) {
_local5 = (_arg4) ? (_arg2 + _local5) : (_local5 + _arg2);
};
return (_local5);
}
private static function TrimInvalid(_arg1:String):Boolean{
switch (_arg1.charCodeAt(0)){
case 13:
case 10:
case 9:
case 32:
return (true);
};
return (false);
}
public static function TrimR(_arg1:String):String{
while (TrimInvalid(_arg1.substr((_arg1.length - 1)))) {
_arg1 = _arg1.substring(0, (_arg1.length - 1));
};
return (_arg1);
}
public static function TrimL(_arg1:String):String{
while (TrimInvalid(_arg1.substr(0, 1))) {
_arg1 = _arg1.substring(1);
};
return (_arg1);
}
public static function ByteArrayToHex(_arg1:ByteArray):String{
var _local2:int;
var _local3:String;
_arg1.position = 0;
_local2 = _arg1.length;
_local3 = "";
while (_local2) {
_local3 = (_local3 + CString.Pad(_arg1.readUnsignedByte().toString(16), "0", 2));
_local2--;
};
return (_local3);
}
}
}//package STC9.String
Section 97
//CFPS (STC9.System.Profiler.CFPS)
package STC9.System.Profiler {
import flash.utils.*;
import flash.text.*;
import STC9.String.*;
import flash.system.*;
public class CFPS extends TextField {
private var mProfilesSlow:Object;
private var mSamples:Array;
private var mProfiles:Object;
private var mLastTimeStamp:Number;
private var mAlign:String;
private var mDebugs:Object;
private var mSampleTotalTime:Number;
public var mDebug:String;// = ""
static var mNumberOfSamples:Number = 30;
private static var _this:CFPS;
public function CFPS(_arg1:String="RIGHT"){
mDebug = "";
_this = this;
super();
mAlign = _arg1;
this.defaultTextFormat = new TextFormat("_sans", 9, 0);
this.text = "FPS: ";
this.background = true;
this.backgroundColor = 0xEEEEEE;
this.border = false;
this.x = 0;
this.y = 0;
this.autoSize = TextFieldAutoSize.LEFT;
mSamples = new Array();
mSampleTotalTime = 0;
mProfiles = new Object();
mProfilesSlow = new Object();
mDebugs = new Object();
}
public function get _BASECLASSID_():String{
return ("CFPS");
}
public function Dispose():void{
}
public function StartProfile(_arg1:String):void{
mProfiles[_arg1] = getTimer();
}
function Clone():CFPS{
return (undefined);
}
public function StopProfile(_arg1:String):Number{
return ((mProfiles[_arg1] = (getTimer() - mProfiles[_arg1])));
}
override public function toString():String{
return (_CLASSID_);
}
private function Pad(_arg1:String, _arg2:Number):String{
while (_arg1.length < _arg2) {
_arg1 = (" " + _arg1);
};
return (_arg1);
}
public function get _CLASSID_():String{
return ("CFPS");
}
private function GetFPS(_arg1:Number):Number{
var _local2:*;
_local2 = 1;
return ((Math.round(((1000 / _arg1) * _local2)) / _local2));
}
public function Update():void{
var _local1:Number;
var _local2:Number;
var _local3:String;
var _local4:Array;
if (!parent){
return;
};
_local1 = getTimer();
if (mLastTimeStamp){
_local2 = (_local1 - mLastTimeStamp);
mSampleTotalTime = (mSampleTotalTime + _local2);
mSamples.push(_local2);
while (mSamples.length > mNumberOfSamples) {
mSampleTotalTime = (mSampleTotalTime - mSamples.shift());
};
this.text = ("FPS: " + CString.Pad(GetFPS((mSampleTotalTime / mSamples.length)), "0", 3));
this.text = (this.text + ((" (" + Math.round((System.totalMemory / (0x0400 * 0x0400)))) + "mb)"));
_local4 = new Array();
for (_local3 in mProfiles) {
if (!mProfilesSlow[_local3]){
mProfilesSlow[_local3] = {mTime:mProfiles[_local3], mTimeStamp:getTimer()};
} else {
if ((((mProfiles[_local3] > mProfilesSlow[_local3].mTime)) || (((getTimer() - mProfilesSlow[_local3].mTimeStamp) > 1000)))){
mProfilesSlow[_local3] = {mTime:mProfiles[_local3], mTimeStamp:getTimer()};
};
};
_local4.push((((((_local3 + ":") + mProfiles[_local3]) + " (") + mProfilesSlow[_local3].mTime) + ")"));
};
for (_local3 in mDebugs) {
_local4.push(((_local3 + ":") + mDebugs[_local3]));
};
_local4.sort();
this.text = (this.text + ("\n" + _local4.join("\n")));
};
mLastTimeStamp = _local1;
switch (mAlign.toUpperCase()){
case "LEFT":
x = 0;
break;
case "RIGHT":
x = (stage.stageWidth - width);
break;
};
}
public static function AddDebug(_arg1:String, _arg2:String):void{
if (_this){
_this.mDebugs[_arg1] = _arg2;
};
}
}
}//package STC9.System.Profiler
Section 98
//CUISetDefaults (STC9.UI.CUISetDefaults)
package STC9.UI {
import flash.display.*;
public class CUISetDefaults {
public function get _CLASSID_():String{
return ("CUISetDefaults");
}
public static function SetField(_arg1:DisplayObjectContainer, _arg2:String, _arg3, _arg4:Boolean=true){
var _local5:int;
var _local6:DisplayObject;
_local5 = (_arg1.numChildren - 1);
while (_local5 >= 0) {
_local6 = _arg1.getChildAt(_local5);
if (_local6.hasOwnProperty(_arg2)){
_local6[_arg2] = _arg3;
};
if (((_arg4) && (_local6.hasOwnProperty("numChildren")))){
SetField(DisplayObjectContainer(_local6), _arg2, _arg3, _arg4);
};
_local5--;
};
}
}
}//package STC9.UI
Section 99
//CAffect (Thing.CAffect)
package Thing {
public class CAffect {
public var mAffector;
public var mOwner;
public var mType:int;
public var mRange:Number;
public var mHitDirection:CThingAngle;
public var mDamage:Number;
public var mForce:Number;
public var mName:String;
public function CAffect():void{
}
public function get _CLASSID_():String{
return ("CAffect");
}
private function Defaults(_arg1:String, _arg2, _arg3):void{
mType = eAffectType[_arg1];
mName = _arg1;
mOwner = _arg2;
mAffector = _arg3;
}
public function toString():String{
return (((((((mType + " - mOwner:") + mOwner) + ",mOwner:") + mOwner) + ",mDamage:") + mDamage));
}
public static function SLICED(_arg1, _arg2, _arg3:Number, _arg4:CThingAngle):CAffect{
var _local5:CAffect;
_local5 = new (CAffect);
_local5.Defaults("SLICED", _arg1, _arg2);
_local5.mHitDirection = _arg4;
_local5.mDamage = _arg3;
return (_local5);
}
public static function BULLET(_arg1, _arg2, _arg3:Number, _arg4:Number=1):CAffect{
var _local5:CAffect;
_local5 = new (CAffect);
_local5.Defaults("BULLET", _arg1, _arg2);
_local5.mDamage = _arg3;
_local5.mForce = _arg4;
return (_local5);
}
public static function HIT(_arg1, _arg2, _arg3:Number, _arg4:Number=1):CAffect{
var _local5:CAffect;
_local5 = new (CAffect);
_local5.Defaults("HIT", _arg1, _arg2);
_local5.mDamage = _arg3;
_local5.mForce = _arg4;
return (_local5);
}
public static function VAPOURIZE(_arg1, _arg2, _arg3:Number, _arg4:CThingAngle):CAffect{
var _local5:CAffect;
_local5 = new (CAffect);
_local5.Defaults("VAPOURIZE", _arg1, _arg2);
_local5.mHitDirection = _arg4;
_local5.mDamage = _arg3;
return (_local5);
}
public static function EXPLOSION(_arg1, _arg2, _arg3:Number, _arg4:Number=1):CAffect{
var _local5:CAffect;
_local5 = new (CAffect);
_local5.Defaults("EXPLOSION", _arg1, _arg2);
_local5.mDamage = _arg3;
_local5.mForce = _arg4;
return (_local5);
}
public static function FIRE(_arg1, _arg2, _arg3:Number, _arg4:Number=1):CAffect{
var _local5:CAffect;
_local5 = new (CAffect);
_local5.Defaults("FIRE", _arg1, _arg2);
_local5.mDamage = _arg3;
_local5.mForce = _arg4;
return (_local5);
}
public static function PUSH(_arg1, _arg2:Number=1):CAffect{
var _local3:CAffect;
_local3 = new (CAffect);
_local3.Defaults("PUSH", _arg1, _arg1);
_local3.mForce = _arg2;
return (_local3);
}
public static function PUNCHED(_arg1, _arg2, _arg3:Number, _arg4:CThingAngle):CAffect{
var _local5:CAffect;
_local5 = new (CAffect);
_local5.Defaults("PUNCHED", _arg1, _arg2);
_local5.mHitDirection = _arg4;
_local5.mDamage = _arg3;
return (_local5);
}
public static function ZOMBIEATTACK(_arg1, _arg2:Number, _arg3:Number=1):CAffect{
var _local4:CAffect;
_local4 = new (CAffect);
_local4.Defaults("ZOMBIEATTACK", _arg1, _arg1);
_local4.mDamage = _arg2;
_local4.mForce = _arg3;
return (_local4);
}
}
}//package Thing
Section 100
//CAirstrike (Thing.CAirstrike)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CAirstrike extends CThingWeapon {
private var mShotPIndex:int;// = 0
public static var _Upgrades:Array = [{mName:"Carpet bombs", mAmmo:2, mUpgradeID:"carpet"}, {mName:"Small nuke", mAmmo:2, mUpgradeID:"snuke"}, {mName:"Double ammo", mAmmo:4, mUpgradeID:"nuke"}, {mName:"Nuke", mAmmo:2, mUpgradeID:"nuke"}];
public function CAirstrike(_arg1):void{
mShotPIndex = 0;
super(_arg1);
mUpgrade = 0;
mFireRate = 200;
mAutoFire = false;
Process = Process_Normal;
mFireAction = "called";
}
override public function Fire():void{
super.Fire();
mAngle = mOwner.mAngle.Clone();
mPosition = mOwner.mPosition;
AddThing(new CSAirstrike({mPosition:mOwner.mPosition}, mOwner, mUpgradeID));
}
override public function Fire_Stop():void{
super.Fire_Stop();
}
public function Process_Normal(){
WeaponUpdate();
ProcessChildren();
}
override public function get mWeaponName():String{
return ("Airstrikes");
}
override public function Fire_Start():void{
super.Fire_Start();
}
override public function get mAnimExt():String{
return ("");
}
override public function get mPickupProbability():Number{
return ((LOWPROBABILITY * (1 - (mAmmo / mTotalAmmo))));
}
override public function get mUpgrades():Array{
return (_Upgrades);
}
override public function get _CLASSID_():String{
return ("CAirstrike");
}
}
}//package Thing
Section 101
//CAppearSmoke (Thing.CAppearSmoke)
package Thing {
public class CAppearSmoke extends CThingEffect {
public function CAppearSmoke(_arg1, _arg2:CThingV3=null):void{
super(_arg1);
Process = Process_Normal;
if (!GenSmokeExists(_CLASSID_)){
AddGenSmoke(_CLASSID_, [Smoke_0002], 0.65);
};
mAnimationFrame = 0;
if (_arg2){
mPosition.Add(_arg2);
};
MapAdd();
}
public function Process_Normal(){
if (AnimateEnd((1 / 15))){
Dispose();
};
}
override public function get _CLASSID_():String{
return ("CAppearSmoke");
}
public static function PrepareClass():void{
var _local1:CThingDraw;
_local1 = new CThingDraw();
if (!_local1.GenSmokeExists("CAppearSmoke")){
_local1.AddGenSmoke("CAppearSmoke", [Smoke_0002], 0.65);
};
_local1.Dispose();
}
}
}//package Thing
Section 102
//CBambo (Thing.CBambo)
package Thing {
public class CBambo extends CPeepPlayer {
public function CBambo(_arg1:Object=null){
super(_arg1, SheetBambo);
mUpgrades = mDefaultUpgrades;
InitWeapons([CPistol, CShotgun, CBarrels, CBarricades, CWTurret_MG, CMinigun, CGrenades, CRocketLauncher, CWTurret_Mortor, CAirstrike]);
}
override public function get mDefaultUpgrades():Array{
var _local1:Array;
_local1 = [{mIndex:4, mClassID:CPistol, mUpgrade:1}, {mIndex:5, mClassID:CShotgun, mUpgrade:0}, {mIndex:11, mClassID:CPistol, mUpgrade:2}, {mIndex:17, mClassID:CShotgun, mUpgrade:1}, {mIndex:18, mClassID:CPistol, mUpgrade:3}, {mIndex:20, mClassID:CBarrels, mUpgrade:0}, {mIndex:32, mClassID:CShotgun, mUpgrade:2}, {mIndex:32, mClassID:CBarrels, mUpgrade:1}, {mIndex:40, mClassID:CBarricades, mUpgrade:0}, {mIndex:47, mClassID:CShotgun, mUpgrade:3}, {mIndex:47, mClassID:CBarrels, mUpgrade:2}, {mIndex:52, mClassID:CBarricades, mUpgrade:1}, {mIndex:60, mClassID:CWTurret_MG, mUpgrade:0}, {mIndex:62, mClassID:CShotgun, mUpgrade:4}, {mIndex:62, mClassID:CBarrels, mUpgrade:3}, {mIndex:67, mClassID:CBarricades, mUpgrade:2}, {mIndex:77, mClassID:CShotgun, mUpgrade:5}, {mIndex:77, mClassID:CBarrels, mUpgrade:4}, {mIndex:80, mClassID:CMinigun, mUpgrade:0}, {mIndex:82, mClassID:CBarricades, mUpgrade:3}, {mIndex:82, mClassID:CWTurret_MG, mUpgrade:1}, {mIndex:90, mClassID:CGrenades, mUpgrade:0}, {mIndex:92, mClassID:CShotgun, mUpgrade:6}, {mIndex:97, mClassID:CBarricades, mUpgrade:4}, {mIndex:100, mClassID:CRocketLauncher, mUpgrade:0}, {mIndex:102, mClassID:CMinigun, mUpgrade:1}, {mIndex:102, mClassID:CGrenades, mUpgrade:1}, {mIndex:107, mClassID:CShotgun, mUpgrade:7}, {mIndex:117, mClassID:CWTurret_MG, mUpgrade:2}, {mIndex:117, mClassID:CRocketLauncher, mUpgrade:1}, {mIndex:122, mClassID:CShotgun, mUpgrade:8}, {mIndex:125, mClassID:CWTurret_Mortor, mUpgrade:0}, {mIndex:127, mClassID:CGrenades, mUpgrade:2}, {mIndex:137, mClassID:CMinigun, mUpgrade:2}, {mIndex:150, mClassID:CWTurret_Mortor, mUpgrade:1}, {mIndex:150, mClassID:CAirstrike, mUpgrade:0}, {mIndex:152, mClassID:CWTurret_MG, mUpgrade:3}, {mIndex:152, mClassID:CGrenades, mUpgrade:3}, {mIndex:152, mClassID:CRocketLauncher, mUpgrade:2}, {mIndex:172, mClassID:CMinigun, mUpgrade:3}, {mIndex:175, mClassID:CAirstrike, mUpgrade:1}, {mIndex:177, mClassID:CGrenades, mUpgrade:4}, {mIndex:185, mClassID:CWTurret_Mortor, mUpgrade:2}, {mIndex:187, mClassID:CWTurret_MG, mUpgrade:4}, {mIndex:187, mClassID:CRocketLauncher, mUpgrade:3}, {mIndex:207, mClassID:CMinigun, mUpgrade:4}, {mIndex:220, mClassID:CWTurret_Mortor, mUpgrade:3}, {mIndex:222, mClassID:CWTurret_MG, mUpgrade:5}, {mIndex:222, mClassID:CRocketLauncher, mUpgrade:4}, {mIndex:225, mClassID:CAirstrike, mUpgrade:2}, {mIndex:242, mClassID:CMinigun, mUpgrade:5}, {mIndex:0xFF, mClassID:CWTurret_Mortor, mUpgrade:4}, {mIndex:300, mClassID:CRocketLauncher, mUpgrade:5}, {mIndex:400, mClassID:CRocketLauncher, mUpgrade:6}, {mIndex:500, mClassID:CAirstrike, mUpgrade:3}];
return (_local1);
}
override public function get _CLASSID_():String{
return ("CBambo");
}
}
}//package Thing
Section 103
//CBarrel (Thing.CBarrel)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
import Game.*;
public class CBarrel extends CThingObject {
private var rInitObject:Object;
public function CBarrel(_arg1:Object, _arg2=null){
_arg1.mCollideRadius = 0.4;
super((rInitObject = _arg1), _arg2);
this.mCollideID = nID;
mMaxLife = (mLife = 1);
mAudioMaterial = "METAL";
SetCollide(mCellCurrent, eWMCCollideType.BARREL);
if (!SpriteSheetExists(_CLASSID_)){
AddSpriteSheet(_CLASSID_, new SheetBarrel(0, 0));
};
mAffectFlags = (mAffectFlags & ~(eAffectType.ZOMBIEATTACK));
SetState("State_GROWRADIUS");
}
override public function Affect_ZOMBIEATTACK(_arg1:CAffect):void{
mLife = (mLife - _arg1.mDamage);
}
override public function AddKill(){
CGlobalData.AddStat("Barrel kills", 1, "ADD");
return (this);
}
override public function get _CLASSID_():String{
return ("CBarrel");
}
override public function Destroyed():void{
var _local1:CExplosion;
this.mCollideID = mOwner.mCollideID;
_local1 = new CExplosion(this, new CThingV3(0, 0, (mCollideHeight / 2)));
AddThing(_local1);
if (rInitObject.mClusterShells){
_local1.AddClusterShells(rInitObject.mClusterShells);
};
if (rInitObject.mBiggerBang){
_local1.AddBiggerBang(rInitObject.mBiggerBang);
};
}
}
}//package Thing
Section 104
//CBarrels (Thing.CBarrels)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CBarrels extends CThingWeapon {
private var mShotPIndex:int;// = 0
public static var _Upgrades:Array = [{mName:"", mAmmo:10, mBiggerBang:0, mClusterShells:0}, {mName:"Double ammo", mAmmo:20, mBiggerBang:0, mClusterShells:0}, {mName:"Big bang", mAmmo:20, mBiggerBang:4, mClusterShells:0}, {mName:"Quad ammo", mAmmo:40, mBiggerBang:4, mClusterShells:0}, {mName:"Bigger bang", mAmmo:40, mBiggerBang:4, mClusterShells:4}];
public function CBarrels(_arg1):void{
mShotPIndex = 0;
super(_arg1);
mUpgrade = 0;
mFireRate = 0;
mAutoFire = false;
Process = Process_Normal;
mFireAction = "placed";
AddSound("Place", Barrel_Place);
}
override public function Fire():void{
if ((mOwner.mCellCurrent.mCollide & eWMCCollideType.NONPLACEMENT)){
return;
};
super.Fire();
mPosition = mOwner.mPosition;
mWorld.AddThing(new CBarrel({mInitCell:mOwner.mCellCurrent, mBiggerBang:mBiggerBang, mClusterShells:mClusterShells}, mOwner));
PlaySound("Place");
}
override public function Fire_Stop():void{
super.Fire_Stop();
}
public function Process_Normal(){
WeaponUpdate();
ProcessChildren();
}
override public function get mWeaponName():String{
return ("Barrels");
}
override public function Fire_Start():void{
super.Fire_Start();
}
override public function get mAnimExt():String{
return ("");
}
override public function get mPickupProbability():Number{
return ((((HIGHPROBABILITY - LOWPROBABILITY) * (1 - (mAmmo / mTotalAmmo))) + LOWPROBABILITY));
}
override public function get mUpgrades():Array{
return (_Upgrades);
}
override public function get _CLASSID_():String{
return ("CBarrels");
}
}
}//package Thing
Section 105
//CBarricade (Thing.CBarricade)
package Thing {
import flash.geom.*;
import STC9.Bitmap.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CBarricade extends CThingObject {
public function CBarricade(_arg1:Object, _arg2=null){
_arg1.mCollideRadius = 0.4;
super(_arg1, _arg2);
mMaxLife = (mLife = (_arg1.mLife) ? _arg1.mLife : 1000);
mAudioMaterial = "METAL";
SetCollide(mCellCurrent, eWMCCollideType.BARRICADE);
if (!SpriteSheetExists(_CLASSID_)){
AddSpriteSheet(_CLASSID_, new SheetBarricade(0, 0));
};
SetState("State_GROWRADIUS");
NavMapAdd();
}
override public function Dispose():void{
NavMapRemove();
super.Dispose();
}
override public function Affect_FIRE(_arg1:CAffect):void{
mLife = (mLife - (_arg1.mDamage / 8));
}
override public function get _CLASSID_():String{
return ("CBarricade");
}
}
}//package Thing
Section 106
//CBarricades (Thing.CBarricades)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CBarricades extends CThingWeapon {
private var mShotPIndex:int;// = 0
public static var _Upgrades:Array = [{mName:"", mAmmo:10, mLife:200}, {mName:"Double ammo", mAmmo:20, mLife:200}, {mName:"Strong", mAmmo:20, mLife:300}, {mName:"Quad ammo", mAmmo:40, mLife:300}, {mName:"Mighty", mAmmo:40, mLife:400}];
public function CBarricades(_arg1):void{
mShotPIndex = 0;
super(_arg1);
mFireRate = 0;
mAutoFire = false;
mUpgrade = 0;
Process = Process_Normal;
AddSound("Place", Barrel_Place);
mFireAction = "placed";
}
override public function Fire():void{
if ((mOwner.mCellCurrent.mCollide & eWMCCollideType.NONPLACEMENT)){
return;
};
super.Fire();
mPosition = mOwner.mPosition;
mWorld.AddThing(new CBarricade({mInitCell:mOwner.mCellCurrent, mLife:mLife}, mOwner));
PlaySound("Place");
}
override public function Fire_Stop():void{
super.Fire_Stop();
}
public function Process_Normal(){
WeaponUpdate();
ProcessChildren();
}
override public function get mWeaponName():String{
return ("Barricades");
}
override public function Fire_Start():void{
super.Fire_Start();
}
override public function get mAnimExt():String{
return ("");
}
override public function get mPickupProbability():Number{
return ((((HIGHPROBABILITY - LOWPROBABILITY) * (1 - (mAmmo / mTotalAmmo))) + LOWPROBABILITY));
}
override public function get mUpgrades():Array{
return (_Upgrades);
}
override public function get _CLASSID_():String{
return ("CBarricades");
}
}
}//package Thing
Section 107
//CBullet (Thing.CBullet)
package Thing {
import flash.display.*;
import flash.geom.*;
import Landscape.*;
import flash.events.*;
public class CBullet extends CThingShot {
public var mColor:uint;// = 4294901760
public function CBullet(_arg1, _arg2:CAffect, _arg3:CThingV3, _arg4:int=1, _arg5:Number=16, _arg6:Number=0.2){
var _local7:Object;
var _local8:Array;
var _local9:*;
mColor = 4294901760;
super(_arg1, _arg2);
Process = Process_Normal;
mSpeed = _arg5;
mDelta = mAngle.mDelta.ScaleN(mSpeed);
mCollideRadius = _arg6;
mLife = 1;
mPosition.Add(_arg3);
MapAdd();
_local7 = GetThingsAngle(mSpeed, mCollideRadius, eAffectType.BULLET, _arg4);
_local8 = _local7.mThings;
if (_local8.length){
for each (_local9 in _local8) {
_local9.AddAffect(mAffect);
};
mShotDestination = _local8[0].mPosition.Clone().Add(_arg3);
} else {
if (_local7.mImpactPOI){
mShotDestination = new CThingV3(_local7.mImpactPOI.x, _local7.mImpactPOI.y, mPosition.z);
} else {
mShotDestination = mPosition.Clone().Add(mDelta);
};
};
AddDrawDefault();
}
public function Process_Normal(){
if (--mLife < 0){
Dispose();
return;
};
}
override public function get _CLASSID_():String{
return ("CBullet");
}
override public function Render():void{
mSFXLayer.DrawBulletSmoke(mRenderPosition, RenderPosition(mShotDestination));
mDrawn = false;
}
}
}//package Thing
Section 108
//CClusterShell (Thing.CClusterShell)
package Thing {
public class CClusterShell extends CThingShot {
public function CClusterShell(_arg1, _arg2:CThingV3=null):void{
super(_arg1);
Process = Process_Normal;
if (_arg2){
mPosition.Add(_arg2);
};
mMaxLife = (mLife = ((SECONDS - 4) + RandomInt(8)));
mDelta = mAngle.mDelta.ScaleN((1 * (0.08 + (Random() * 0.07))));
mDelta.z = (0.4 + (Random() * 0.2));
mCollideRadius = 0.15;
mCollideHeight = (mCollideRadius * 2);
MapAdd();
AddSound("Bounce", Grenade_Bounce);
if (!MCAnimationExists(_CLASSID_)){
AddMCAnimation(_CLASSID_, new Shot_ClusterShell());
};
}
public function Process_Normal(){
var _local1:Boolean;
Animate();
_local1 = false;
mDelta.z = (mDelta.z - 0.06);
if ((mPosition.z + mDelta.z) < 0){
if ((mDelta.z = Math.abs(mDelta.z)) <= 0.06){
mDelta.z = 0;
};
mDelta.ScaleN(0.5);
mPosition.z = 0;
_local1 = true;
};
if (BounceCollide()){
_local1 = true;
mDelta.ScaleN2D(0.25);
};
if (((_local1) && ((mDelta.mLength > 0.06)))){
PlaySound("Bounce");
};
mPosition.Add(mDelta);
MapMove();
if (--mLife == 0){
AddThing(new CExplosion(this, new CThingV3(0, 0, (mCollideHeight / 2))));
MapRemove();
Process = Process_Dispose;
return;
};
}
override public function get _CLASSID_():String{
return ("CClusterShell");
}
}
}//package Thing
Section 109
//CDestroySmoke (Thing.CDestroySmoke)
package Thing {
public class CDestroySmoke extends CThingEffect {
public function CDestroySmoke(_arg1, _arg2:CThingV3=null):void{
super(_arg1);
Process = Process_Normal;
if (!GenSmokeExists(_CLASSID_)){
AddGenSmoke(_CLASSID_, [Smoke_0001], 0.65);
};
mAnimationFrame = 0;
if (_arg2){
mPosition.Add(_arg2);
};
MapAdd();
}
public function Process_Normal(){
if (AnimateEnd((1 / 15))){
Dispose();
};
}
override public function get _CLASSID_():String{
return ("CDestroySmoke");
}
public static function PrepareClass():void{
var _local1:CThingDraw;
_local1 = new CThingDraw();
if (!_local1.GenSmokeExists("CDestroySmoke")){
_local1.AddGenSmoke("CDestroySmoke", [Smoke_0001], 0.65);
};
_local1.Dispose();
}
}
}//package Thing
Section 110
//CDevil (Thing.CDevil)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CDevil extends CThingPeep {
private var mRShot:CThingShot;
public function CDevil(_arg1:Object=null){
super(_arg1, SheetDevil);
mName = "DEVIL";
mSpeed = (10 / 100);
mAngle.mDirection = 2;
SetAnimation("stand");
SetCollide(mCellCurrent, eWMCCollideType.PEEP);
mMaxLife = (mLife = 1000);
mAffectThreshold = 1;
mScore = 1000;
SetState("State_NAVIGATE");
mMass = 0.2;
mCollideRadius = 0.4;
mCollideHeight = ((1400 / 500) * mCollideRadius);
mAffectFlags = (mAffectFlags & ~(eAffectType.PUSH));
mAffectFlags = (mAffectFlags & ~(eAffectType.ZOMBIEATTACK));
AddSound("Attack", Devil_Attack);
mName = "Devil";
}
public function State_ATTACK_Exit():void{
mAttackCounter = ((SECONDS * 1) / mSpeedScale);
}
override public function State_HIT_Enter():void{
super.State_HIT_Enter();
mAttackCounter = (SECONDS * 1);
}
override public function Process_Normal(){
var _local1:Number;
super.Process_Normal();
if (mStateID != "State_ATTACK"){
if (mExists){
_local1 = mCollideRadius;
mCollideRadius = (mCollideRadius * 1.5);
AffectRadius(CAffect.PUSH(this, 0.5), 100, mAngle.mDelta.ScaleN(_local1));
mCollideRadius = _local1;
};
};
}
public function State_ATTACK_Enter():void{
mAngleTarget = CThingAngle.AsCThingV3(mTarget.mPosition.Clone().Sub(mPosition));
if (mAngleTarget.mAngle256 != mAngle.mAngle256){
SetState("State_TURN", mStateID);
return;
};
SetAnimation("attack");
PlaySound("Attack");
}
override public function State_NAVIGATE():void{
if (!mCanProcess){
return;
};
if (mAttackCounter != 0){
} else {
if (!mCellCurrent.mNavTarget){
} else {
if (mCellCurrent.mNavIndex > 10){
} else {
if (!mCellCurrent.mNavTarget.mExists){
} else {
mTarget = mCellCurrent.mNavTarget;
if (mPosition.Distance2D(mTarget.mPosition) <= 6){
SetState("State_ATTACK");
return;
};
};
};
};
};
super.State_NAVIGATE();
}
override public function get _CLASSID_():String{
return ("CDevil");
}
public function State_ATTACK():void{
if (AnimateEnd()){
if (!mRShot){
AddThing((mRShot = new CFlameLine(this, new CThingV3(0, 0.1, 0))));
} else {
if (mRShot.mDisposed){
SetState("State_WAIT", mBaseStateID);
mStateCount = 1;
mRShot = null;
};
};
};
}
public static function PrepareClass():void{
var _local1:CThingDraw;
_local1 = new CThingDraw();
if (!_local1.SpriteSheetExists("CDevil")){
_local1.AddSpriteSheet("CDevil", new SheetDevil(0, 0));
};
_local1.Dispose();
}
}
}//package Thing
Section 111
//CExplosion (Thing.CExplosion)
package Thing {
public class CExplosion extends CThingEffect {
private var mDelayCounter:int;
public function CExplosion(_arg1, _arg2:CThingV3=null, _arg3:Number=150, _arg4:Number=2):void{
super(_arg1);
Process = Process_Normal;
if (!GenExplosionExists(_CLASSID_)){
AddGenExplosion(_CLASSID_);
};
mAnimationFrame = 0;
if (_arg2){
mPosition.Add(_arg2);
};
mCollideRadius = _arg4;
AddSound("Explosion", Explosion_0, 1, 2);
mCounter = (RandomInt(3) + 2);
SetDelay(0);
}
public function AddBiggerBang(_arg1:int=0):void{
var _local2:CExplosion;
var _local3:CThingAngle;
if (_arg1 <= 0){
return;
};
mAngle.mAngle256 = RandomInt(0x0100);
_local3 = CThingAngle.AsAngle256((0x0100 / _arg1));
while (_arg1) {
_local2 = new CExplosion(this, mAngle.mDelta.ScaleN(1.5));
AddThing(_local2);
_local2.SetDelay((2 + RandomInt(4)));
mAngle.Add(_local3);
_arg1--;
};
}
public function SetDelay(_arg1:int):void{
Process = Process_Delay;
mDelayCounter = _arg1;
}
public function Process_Normal():void{
if (mCounter-- == 0){
AffectRadius(CAffect.EXPLOSION(mOwner, this, 150));
};
if (AnimateEnd((1 / 15))){
Process = Process_Dispose;
};
ProcessChildren();
}
public function Process_Delay():void{
if (mDelayCounter-- <= 0){
MapAdd();
PlaySound("Explosion");
DrawScorch();
Process = Process_Normal;
Process();
return;
};
ProcessChildren();
}
override public function get _CLASSID_():String{
return ("CExplosion");
}
public function AddClusterShells(_arg1:int=0):void{
var _local2:CThingAngle;
var _local3:int;
if (_arg1 <= 0){
return;
};
mAngle.mAngle256 = RandomInt(0x0100);
_local2 = CThingAngle.AsAngle256((0x0100 / _arg1));
_local3 = _arg1;
while (_local3) {
mAngle.Add(CThingAngle.AsAngle256(RandomInt((128 / _arg1))));
AddThing(new CClusterShell(this));
mAngle.Add(_local2);
_local3--;
};
}
public static function PrepareClass():void{
var _local1:CThingDraw;
_local1 = new CThingDraw();
if (!_local1.GenExplosionExists("CExplosion")){
_local1.AddGenExplosion("CExplosion");
};
_local1.Dispose();
}
}
}//package Thing
Section 112
//CFire (Thing.CFire)
package Thing {
public class CFire extends CThingEffect {
public function CFire(_arg1, _arg2:CThingV3=null):void{
super(_arg1);
Process = Process_Normal;
if (!GenFireExists(_CLASSID_)){
AddGenFire(_CLASSID_, 0.66);
};
mAnimationFrame = 0;
if (_arg2){
mPosition.Add(_arg2);
};
MapAdd();
mCollideRadius = 0.5;
AddSound("Fire", Fire_0);
mCounter = (RandomInt(3) + 2);
}
public function Process_Normal(){
if (mAnimationFrame == 0){
PlaySound("Fire");
DrawScorch();
};
if (mAnimationFrame <= 0.25){
AffectRadius(CAffect.FIRE(mOwner, this, 20));
};
if (AnimateEnd((1 / (SECONDS * 1.5)))){
Dispose();
};
}
override public function get _CLASSID_():String{
return ("CFire");
}
public static function PrepareClass():void{
var _local1:CThingDraw;
_local1 = new CThingDraw();
if (!_local1.GenFireExists("CFire")){
_local1.AddGenFire("CFire", 0.66);
};
_local1.Dispose();
}
}
}//package Thing
Section 113
//CFlameLine (Thing.CFlameLine)
package Thing {
import World.*;
public class CFlameLine extends CThingShot {
public var mColor:uint;// = 4294901760
private var pCounter:int;
public function CFlameLine(_arg1, _arg2:CThingV3){
mColor = 4294901760;
super(_arg1);
Process = Process_Normal;
mSpeed = 0.78;
mDelta = mAngle.mDelta.ScaleN(mSpeed);
mLife = 15;
pCounter = 0;
mPosition.Add(_arg2);
}
public function Process_Normal(){
ProcessChildren();
pCounter = 0;
AddThing(new CFire(this, new CThingV3(0, 0, 0)));
mPosition.Add(mDelta);
if ((mMap.GetCellAt(mPosition.x, mPosition.y).mCollide & eWMCCollideType.SOLID)){
mLife = 0;
};
if (--mLife < 0){
Process = Process_Dispose;
return;
};
}
override public function get _CLASSID_():String{
return ("CFlameLine");
}
}
}//package Thing
Section 114
//CGrenades (Thing.CGrenades)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CGrenades extends CThingWeapon {
public static var _Upgrades:Array = [{mName:"", mAmmo:20, mBiggerBang:0, mClusterShells:0}, {mName:"Double ammo", mAmmo:40, mBiggerBang:0, mClusterShells:0}, {mName:"Big bang", mAmmo:40, mBiggerBang:4, mClusterShells:0}, {mName:"Quad ammo", mAmmo:80, mBiggerBang:4, mClusterShells:0}, {mName:"Bigger bang", mAmmo:80, mBiggerBang:4, mClusterShells:4}];
public function CGrenades(_arg1):void{
mFireRate = 10;
mAutoFire = false;
mOnRelease = true;
Process = Process_Normal;
mUpgrade = 0;
mFireAction = "thrown";
super(_arg1);
}
override public function Fire():void{
var _local1:CThingV3;
super.Fire();
mPosition = mOwner.mPosition;
mAngle = mOwner.mAngle;
_local1 = new CThingV3(0, 0, mOwner.mCollideHeight);
AddThing(new CSGrenade(mOwner, _local1, (mChargeTime / 1000), {mBiggerBang:mBiggerBang, mClusterShells:mClusterShells}));
}
override public function Fire_Stop():void{
super.Fire_Stop();
}
public function Process_Normal(){
WeaponUpdate();
ProcessChildren();
}
override public function get mWeaponName():String{
return ("Grenades");
}
override public function Fire_Start():void{
super.Fire_Start();
}
override public function get mAnimExt():String{
return ("");
}
override public function get mPickupProbability():Number{
return ((((HIGHPROBABILITY - LOWPROBABILITY) * (1 - (mAmmo / mTotalAmmo))) + LOWPROBABILITY));
}
override public function get mUpgrades():Array{
return (_Upgrades);
}
override public function get _CLASSID_():String{
return ("CGrenades");
}
}
}//package Thing
Section 115
//CMinigun (Thing.CMinigun)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CMinigun extends CThingWeapon {
private var mShotPIndex:int;// = 0
public static var _Upgrades:Array = [{mName:"", mAmmo:150, mAutoFire:true, mFireRate:0, mDamage:25, mThingsAffected:2, mRange:12}, {mName:"Double ammo", mAmmo:300, mAutoFire:true, mFireRate:0, mDamage:50, mThingsAffected:2, mRange:12}, {mName:"Double damage", mAmmo:300, mAutoFire:true, mFireRate:0, mDamage:50, mThingsAffected:3, mRange:12}, {mName:"Quad ammo", mAmmo:450, mAutoFire:true, mFireRate:0, mDamage:100, mThingsAffected:3, mRange:12}, {mName:"Long range", mAmmo:450, mAutoFire:true, mFireRate:0, mDamage:100, mThingsAffected:3, mRange:20}, {mName:"Quad damage", mAmmo:450, mAutoFire:true, mFireRate:0, mDamage:100, mThingsAffected:5, mRange:20}];
public function CMinigun(_arg1):void{
mShotPIndex = 0;
super(_arg1);
Process = Process_Normal;
mUpgrade = 0;
AddSound("Minigun_Start", Minigun_Start, 0);
AddSound("Minigun_Stop", Minigun_Stop);
}
override public function Fire():void{
var _local1:CThingV3;
var _local2:CThingV3;
super.Fire();
mPosition = mOwner.mPosition;
mAngle = mOwner.mAngle;
UpdateSound("Minigun_Start");
mShotPIndex++;
_local1 = mParent.SpriteSheet_GetModelOffset("RSHOT");
_local2 = new CThingV3(0, 0, 0.1).RotateX((((89 * mShotPIndex) * Math.PI) / 180)).RotateZ(mAngle.mAngleRAD).Add(_local1);
AddThing(new CMuzzleFlash(mOwner, _local2, Large_MuzzleFlash));
AddThing(new CBullet(mOwner, CAffect.BULLET(mOwner, this, mDamage), _local2, mThingsAffected, mRange, 0.5));
}
override public function Fire_Stop():void{
super.Fire_Stop();
StopSound("Minigun_Start");
mPosition = mOwner.mPosition;
PlaySound("Minigun_Stop");
}
public function Process_Normal(){
WeaponUpdate();
ProcessChildren();
}
override public function get mWeaponName():String{
return ("Minigun");
}
override public function Fire_Start():void{
super.Fire_Start();
mPosition = mOwner.mPosition;
PlaySound("Minigun_Start", 0, 100000);
}
override public function get mAnimExt():String{
return ("_minigun");
}
override public function get mPickupProbability():Number{
return ((MIDPROBABILITY * (1 - (mAmmo / mTotalAmmo))));
}
override public function get mUpgrades():Array{
return (_Upgrades);
}
override public function get _CLASSID_():String{
return ("CMinigun");
}
}
}//package Thing
Section 116
//CMissile (Thing.CMissile)
package Thing {
import flash.display.*;
import flash.geom.*;
import Landscape.*;
import World.*;
import flash.events.*;
public class CMissile extends CThingShot {
public var mColor:uint;// = 4294901760
private var lPosition:CThingV3;
public function CMissile(_arg1, _arg2:CAffect, _arg3:CThingV3, _arg4:Number=150){
mColor = 4294901760;
super(_arg1, _arg2);
Process = Process_Normal;
mSpeed = 1;
mDelta = mAngle.mDelta.ScaleN(mSpeed);
mCollideRadius = 0.3;
mLife = 50;
mDamage = _arg4;
mPosition.Add(_arg3);
if (!MCAnimationExists(_CLASSID_)){
AddMCAnimation(_CLASSID_, new Missile_Flare());
};
mDrawScale = 0.5;
mAlpha = 0.8;
MapAdd();
}
public function Process_Normal(){
var _local1:CThingV3;
var _local2:Object;
var _local3:Array;
lPosition = mPosition.Clone();
_local1 = mPosition.Clone().Add(mDelta);
_local2 = GetThingsLine(_local1, mCollideRadius, eAffectType.BULLET, 1);
_local3 = _local2.mThings;
if (_local3.length){
mPosition.Set(_local3[0].mPosition.x, _local3[0].mPosition.y, mPosition.z);
mLife = 0;
AddThing(new CExplosion(this, new CThingV3()));
MapRemove();
} else {
if (_local2.mImpactPOI){
mPosition.Set(_local2.mImpactPOI.x, _local2.mImpactPOI.y, mPosition.z);
mLife = 0;
AddThing(new CExplosion(this, new CThingV3(), mDamage));
MapRemove();
} else {
mPosition.Add(mDelta);
mDelta.ScaleN(1.1);
MapMove();
};
};
if (--mLife < 0){
Process = Process_Dispose;
return;
};
}
override public function get _CLASSID_():String{
return ("CMissile");
}
override public function Render():void{
mAnimationFrame = Math.random();
super.Render();
if (lPosition){
mSFXLayer.DrawSmokeLine(RenderPosition(lPosition), mRenderPosition, 3, 1);
};
}
}
}//package Thing
Section 117
//CMortor (Thing.CMortor)
package Thing {
public class CMortor extends CThingShot {
public var mColor:uint;// = 4294901760
private var lPosition:CThingV3;
private static var checkRange:Boolean = true;
private static var ranges:Array;
private static var speed:Number = 0.74;
private static var gravity:Number = 0.05;
public function CMortor(_arg1, _arg2:CAffect, _arg3:CThingV3, _arg4:Number, _arg5:Number){
var _local6:CThingV3;
mColor = 4294901760;
super(_arg1, _arg2);
Process = Process_Normal;
CalibrateRanges(_arg3, _arg4);
mDelta = new CThingV3(ranges[Math.round(_arg5)], 0, 0).RotateY(((-(_arg4) * Math.PI) / 180)).RotateZ(mAngle.mAngleRAD);
mCollideRadius = 0.2;
_local6 = mPosition.Clone();
mPosition.Add(_arg3);
MapAdd();
if (!MCAnimationExists(_CLASSID_)){
AddMCAnimation(_CLASSID_, new Shot_Grenade());
};
}
public function CalibrateRanges(_arg1:CThingV3, _arg2:Number):void{
if (checkRange){
ranges = new Array();
ranges[0] = 0.2;
ranges[1] = 0.2;
ranges[2] = 0.24;
ranges[3] = 0.32;
ranges[4] = 0.39;
ranges[5] = 0.455;
ranges[6] = 0.51;
ranges[7] = 0.55;
ranges[8] = 0.6;
ranges[9] = 0.64;
ranges[10] = 0.679;
ranges[11] = 0.72;
ranges[12] = 0.75;
ranges[13] = 0.79;
ranges[14] = 0.82;
ranges[15] = 0.85;
ranges[16] = 0.88;
ranges[17] = 0.91;
ranges[18] = 0.94;
ranges[19] = 0.97;
ranges[20] = 1;
};
}
public function Process_Normal(){
var _local1:CExplosion;
lPosition = mPosition.Clone();
mPosition.Add(mDelta);
if (!mMap.IsValidCellPosition(mPosition.x, mPosition.y)){
Dispose();
return;
};
MapMove();
mDelta.z = (mDelta.z - gravity);
if (mPosition.z <= 0){
mPosition.z = 0;
_local1 = new CExplosion(this, new CThingV3(), 50, 1.5);
AddThing(_local1);
_local1.AddBiggerBang(4);
MapRemove();
Process = Process_Dispose;
};
}
override public function get _CLASSID_():String{
return ("CMortor");
}
override public function Render():void{
super.Render();
if (lPosition){
mSFXLayer.DrawSmokeLine(RenderPosition(lPosition), mRenderPosition, 3, 1);
};
}
}
}//package Thing
Section 118
//CMortorMuzzleFlash (Thing.CMortorMuzzleFlash)
package Thing {
public class CMortorMuzzleFlash extends CThingEffect {
public var mColor:uint;// = 4294901760
public function CMortorMuzzleFlash(_arg1, _arg2:CThingV3, _arg3:Number):void{
mColor = 4294901760;
super(_arg1);
Process = Process_Normal;
if (!MCOmniExists(_CLASSID_)){
AddMCOmni(_CLASSID_, new Large_MuzzleFlash(), 32, ((_arg3 * Math.PI) / 180));
};
mLife = 1;
mPosition.Add(_arg2);
MapAdd();
mAlpha = 1;
}
public function Process_Normal(){
if (--mLife < 0){
Dispose();
};
}
override public function get _CLASSID_():String{
return ("CMortorMuzzleFlash");
}
}
}//package Thing
Section 119
//CMummy (Thing.CMummy)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CMummy extends CThingPeep {
public function CMummy(_arg1:Object=null){
super(_arg1, SheetMummy);
mName = "Mummy";
mSpeed = (4 / 100);
mAngle.mDirection = 2;
SetAnimation("stand");
SetCollide(mCellCurrent, eWMCCollideType.PEEP);
mMaxLife = (mLife = 100);
mScore = 100;
SetState("State_NAVIGATE");
mAffectFlags = (mAffectFlags & ~(eAffectType.ZOMBIEATTACK));
mName = "Mummy";
}
public function State_ATTACK_Exit():void{
}
public function State_ATTACK_Enter():void{
if (mAngleTarget.mDirection != mAngle.mDirection){
SetState("State_TURN", mStateID);
} else {
SetAnimation("attack");
};
}
override public function State_NAVIGATE():void{
if (!mCanProcess){
return;
};
if (!mCellCurrent.mNavTarget){
} else {
if (mCellCurrent.mNavIndex > 2){
} else {
if (!mCellCurrent.mNavTarget.mExists){
} else {
if ((mCellTarget = mCellCurrent.GetNavIndex0())){
if (DistanceToCell(mCellTarget) < (Math.SQRT2 + 0.1)){
mAngleTarget = CThingAngle.AsXY((mCellTarget.mapX - mCellCurrent.mapX), (mCellTarget.mapY - mCellCurrent.mapY));
SetState("State_ATTACK");
return;
};
};
};
};
};
super.State_NAVIGATE();
}
override public function get _CLASSID_():String{
return ("CMummy");
}
public function State_ATTACK():void{
if (AnimateEnd()){
AffectCell(CAffect.ZOMBIEATTACK(this, (10 * mAttackScale), 0.5), mCellTarget, 100);
SetState("State_WAIT", mBaseStateID);
mStateCount = 5;
};
}
public static function PrepareClass():void{
var _local1:CThingDraw;
_local1 = new CThingDraw();
if (!_local1.SpriteSheetExists("CMummy")){
_local1.AddSpriteSheet("CMummy", new SheetMummy(0, 0));
};
_local1.Dispose();
}
}
}//package Thing
Section 120
//CMuzzleFlash (Thing.CMuzzleFlash)
package Thing {
public class CMuzzleFlash extends CThingEffect {
public var mColor:uint;// = 4294901760
public function CMuzzleFlash(_arg1, _arg2:CThingV3, _arg3:Class):void{
mColor = 4294901760;
super(_arg1);
Process = Process_Normal;
if (!MCOmniExists(_CLASSID_)){
AddMCOmni(_CLASSID_, new (_arg3), 32);
};
mLife = 1;
if (_arg2){
mPosition.Add(_arg2);
};
MapAdd();
mAlpha = 1;
}
public function Process_Normal(){
if (--mLife < 0){
Dispose();
};
}
override public function get _CLASSID_():String{
return ("CMuzzleFlash");
}
}
}//package Thing
Section 121
//CMuzzleFlash_Large (Thing.CMuzzleFlash_Large)
package Thing {
public class CMuzzleFlash_Large extends CMuzzleFlash {
public function CMuzzleFlash_Large(_arg1, _arg2:CThingV3):void{
super(_arg1, _arg2, Large_MuzzleFlash);
}
override public function get _CLASSID_():String{
return ("CMuzzleFlash_Large");
}
}
}//package Thing
Section 122
//CPeepPlayer (Thing.CPeepPlayer)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
import IO.*;
import Game.*;
import flash.text.*;
public class CPeepPlayer extends CThingPeep {
public var exAnimName:String;
public var mSelectedWeapon:CThingWeapon;
public var mWeapons:Array;
public var _Upgrades:Array;
public var mWeaponOrder:Array;
public function CPeepPlayer(_arg1:Object, _arg2:Class){
super(_arg1, _arg2);
mAffectFlags = (mAffectFlags & ~(eAffectType.PUSH));
Process = Process_Normal;
mSpeed = (20 / 100);
mDelta = new CThingV3();
mMaxLife = (mLife = (CBuild.PLAYERDOESNOTDIES) ? 1000000000 : 100);
fCollide = PlayerCollide;
MapAdd();
NavMapAdd();
mCollideHeight = (mCollideRadius * 2);
mAngle.mDirection = 2;
SetState("State_ENTERWORLD");
AddSound("GONG", GONG, 0);
mcDrawInfo = new HUD_Player();
mcDrawInfo.y = 0;
mcDrawInfo.mcAmmo.tfInfo.autoSize = TextFieldAutoSize.CENTER;
mDeathClock = (SECONDS * 4);
}
public function State_ENTERWORLD_Enter():void{
SetAnimation(("walk" + exAnimName));
}
public function AddWeapon(_arg1, _arg2:int):CThingWeapon{
AddThing((mWeapons[_arg2] = _arg1));
return (_arg1);
}
override public function Dispose():void{
NavMapRemove();
super.Dispose();
PlaySound("GONG");
mWorld.mState = "CLOSE";
}
public function State_CONTROL_Exit():void{
mSelectedWeapon.mFire = false;
}
public function PickupPowerup(_arg1:CThingPickup):void{
}
public function ApplyMultipleKillsUpgrade(_arg1:int):void{
}
public function State_ENTERWORLD():void{
SetState("State_CONTROL");
}
public function SelectWeapon(_arg1:CThingWeapon):void{
mSelectedWeapon = _arg1;
exAnimName = mSelectedWeapon.mAnimExt;
}
public function State_WEAPONATTACK():void{
var _local1:CPlayerControl;
mDelta.ScaleN(0.5);
_local1 = ProcessControl();
if (((_local1.mDeltaX) || (_local1.mDeltaY))){
mAngle.mDelta = new CThingV3(_local1.mDeltaX, _local1.mDeltaY, 0);
};
mPosition = PlayerCollide();
MapMove();
if (--mStateCount == 0){
mSelectedWeapon.WeaponAffect();
};
if (AnimateEnd(0.15)){
ReturnState_Base();
};
}
override public function State_HIT_Exit():void{
}
public function State_WEAPONATTACK_Enter():void{
SetAnimation(("attack" + exAnimName));
mStateCount = 4;
}
override public function PeepCollide():CThingV3{
return (PlayerCollide());
}
override public function State_HIT():void{
mPosition = fCollide();
MapMove();
mDelta.ScaleN(0.45);
if (mDelta.mLength2D < 0.1){
if (!CheckForDeath()){
ReturnState_Base();
return;
};
};
DrawBlood();
AnimateEnd();
}
override public function State_HIT_Enter():void{
super.State_HIT_Enter();
if (mDelta.mLength2D >= mCollideRadius){
mDelta.Normalize(mCollideRadius);
};
}
public function ReplenishWeapon(_arg1:CThingWeapon):void{
_arg1.mAmmo = _arg1.mTotalAmmo;
}
public function set mUpgrades(_arg1:Array):void{
_Upgrades = _arg1.slice();
}
public function State_ENTERWORLD_Exit():void{
}
public function State_WEAPONATTACK_Exit():void{
}
override public function Process_Normal(){
ApplyAffects();
if (mStateID){
var _local1 = this;
_local1[mStateID]();
};
ProcessChildren();
mcDrawInfo.mcLife.gotoAndStop((Math.floor(((mLife / mMaxLife) * 100)) + 1));
mcDrawInfo.mcAmmo.tfInfo.text = ((mSelectedWeapon.mWeaponName + ":") + mSelectedWeapon.mAmmoName).toUpperCase();
}
private function ApplyUpgrade(_arg1:Object):String{
var _local2:int;
var _local3:CThingWeapon;
_local2 = mWeaponOrder.indexOf(_arg1.mClassID);
if (_arg1.mUpgrade == 0){
if (!mWeapons[_local2]){
_local3 = new mWeaponOrder[_local2](this);
AddWeapon(_local3, _local2);
return (("New weapon: " + _local3.mWeaponName));
};
} else {
_local3 = mWeapons[_local2];
_local3.mUpgrade = _arg1.mUpgrade;
return (((_local3.mWeaponName + " upgraded: ") + _local3.mUpgradeName));
};
return ("");
}
public function get mDefaultUpgrades():Array{
return (null);
}
public function InitWeapons(_arg1:Array):void{
mWeapons = new Array();
mWeaponOrder = _arg1.slice();
AddWeapon(new mWeaponOrder[0](this), 0);
SelectWeapon(mWeapons[0]);
}
public function NextWeapon(_arg1:int):void{
var _local2:int;
var _local3:int;
var _local4:CThingWeapon;
if (_arg1 == 0){
return;
};
_local2 = mWeapons.indexOf(mSelectedWeapon);
_local3 = 1;
while (_local3 < mWeapons.length) {
_local4 = mWeapons[(((_local2 + (_arg1 * _local3)) + mWeapons.length) % mWeapons.length)];
if (!_local4.mWeaponEmpty){
SelectWeapon(_local4);
return;
};
_local3++;
};
}
public function SelectWeaponIndex(_arg1:int):CThingWeapon{
var _local2:CThingWeapon;
_local2 = mWeapons[_arg1];
if (_local2 == null){
return (null);
};
if (_local2.mWeaponEmpty){
return (null);
};
mSelectedWeapon = _local2;
exAnimName = mSelectedWeapon.mAnimExt;
return (mSelectedWeapon);
}
public function ApplyMultiplierUpgrade(_arg1:int):void{
var _local2:String;
var _local3:String;
if (mUpgrades.length){
_local2 = "";
while (_arg1 > mUpgrades[0].mIndex) {
_local3 = ApplyUpgrade(mUpgrades.shift());
if (_local3){
_local2 = (_local2 + ((_local2.length) ? "\n" : "" + _local3));
};
if (mUpgrades.length == 0){
break;
};
};
if (_local2.length){
CGame.mHUD.AddMessage(mRenderPosition, _local2, "upgrade");
};
};
}
public function State_CONTROL():void{
var _local1:CPlayerControl;
if (mLife < mMaxLife){
mLife = (mLife + 0.1);
};
_local1 = ProcessControl();
if (((_local1.mDeltaX) || (_local1.mDeltaY))){
mAngle.mDelta = new CThingV3(_local1.mDeltaX, _local1.mDeltaY, 0);
mDelta = mAngle.mDelta.ScaleN(mSpeed);
SetAnimation(("walk" + exAnimName));
Animate();
} else {
mDelta.ScaleN(0.2);
SetAnimation(("walk" + exAnimName));
};
CGlobalData.AddStat("Distance travelled (miles)", (mDelta.mLength2D / 1600), "ADD");
CGlobalData.AddStat("Distance travelled (feet)", ((mDelta.mLength2D / 1600) * 5280), "ADD");
mPosition = PlayerCollide();
MapMove();
if (mSelectedWeapon.ProcessFire(_local1.mShoot, _local1.mShootDown, _local1.mShootUp)){
if (mSelectedWeapon.mAnimateAttack){
SetState("State_WEAPONATTACK");
return;
};
} else {
if (mSelectedWeapon.mWeaponEmpty){
NextWeapon(-1);
} else {
if (_local1.mSelectIndex != -1){
SelectWeaponIndex(_local1.mSelectIndex);
} else {
NextWeapon(_local1.mSelectDelta);
};
};
};
ClearCollide();
SetCollide(mCellCurrent, eWMCCollideType.PLAYER);
}
public function get mUpgrades():Array{
return (_Upgrades);
}
public function PickupAmmo(_arg1:CThingPickup):void{
var _local2:Number;
var _local3:Array;
var _local4:CThingWeapon;
var _local5:Object;
var _local6:Number;
var _local7:Object;
var _local8:Number;
_local2 = 0;
_local3 = new Array();
for each (_local4 in mWeapons) {
_local8 = _local4.mPickupProbability;
if (_local8){
_local3.push({weapon:_local4, prob:_local8, mType:"weapon"});
_local2 = (_local2 + _local8);
};
};
_local5 = {prob:((1 - (mLife / mMaxLife)) * (_local2 / 2)), mType:"life"};
_local3.push(_local5);
_local2 = (_local2 + _local5.prob);
_local6 = (Random() * _local2);
_local2 = 0;
for each (_local7 in _local3) {
_local2 = (_local2 + _local7.prob);
if (_local6 < _local2){
if (_local7.mType == "life"){
mLife = mMaxLife;
CGame.mHUD.AddMessage(mRenderPosition, "HEALTH 100%", "info");
} else {
ReplenishWeapon(_local7.weapon);
CGame.mHUD.AddMessage(mRenderPosition, _local7.weapon.mWeaponName, "pickup");
};
break;
};
};
}
override public function get _CLASSID_():String{
return ("CPeepPlayer");
}
override public function Render():void{
ObjectRender();
if (((mcDrawInfo) && (CHUD.mDraw))){
bmdPlane.draw(mcDrawInfo, new Matrix(1, 0, 0, 1, (mcDrawInfo.x + mRenderPosition.x), (mcDrawInfo.y + mRenderPosition.y)));
};
mDrawn = true;
}
public function State_CONTROL_Enter():void{
SetAnimation(("walk" + exAnimName));
SetBaseState();
}
}
}//package Thing
Section 123
//CPickup_Ammo (Thing.CPickup_Ammo)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CPickup_Ammo extends CThingPickup {
public function CPickup_Ammo(_arg1:Object){
super(_arg1, SheetPickup_Ammo);
AddSound("Pickup", Pickup_Ammo);
}
override public function Pickup(_arg1):void{
super.Pickup(_arg1);
_arg1.PickupAmmo(this);
}
override public function get _CLASSID_():String{
return ("CPickup_Ammo");
}
}
}//package Thing
Section 124
//CPistol (Thing.CPistol)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CPistol extends CThingWeapon {
private var mShotPIndex:int;// = 0
public static var _Upgrades:Array = [{mName:"", mAmmo:INFINATEAMMO, mAutoFire:false, mFireRate:8, mDamage:50, mRange:8}, {mName:"Crack shot", mAmmo:INFINATEAMMO, mAutoFire:false, mFireRate:8, mDamage:100, mRange:8}, {mName:"Auto fire", mAmmo:INFINATEAMMO, mAutoFire:true, mFireRate:8, mDamage:100, mRange:8}, {mName:"Long range", mAmmo:INFINATEAMMO, mAutoFire:true, mFireRate:8, mDamage:100, mRange:16}];
public function CPistol(_arg1):void{
mShotPIndex = 0;
super(_arg1);
mUpgrade = 0;
Process = Process_Normal;
AddSound("Shot", Pistol_Shot1);
}
override public function Fire():void{
var _local1:CThingV3;
super.Fire();
mPosition = mOwner.mPosition;
mAngle = mOwner.mAngle;
_local1 = mParent.SpriteSheet_GetModelOffset("RSHOT");
AddThing(new CMuzzleFlash(mOwner, _local1, Medium_MuzzleFlash));
AddThing(new CBullet(mOwner, CAffect.BULLET(mOwner, this, mDamage), _local1, 1, mRange));
PlaySound("Shot");
}
override public function Fire_Stop():void{
super.Fire_Stop();
}
public function Process_Normal(){
WeaponUpdate();
ProcessChildren();
}
override public function get mWeaponName():String{
return ("Pistol");
}
override public function Fire_Start():void{
super.Fire_Start();
}
override public function get mAnimExt():String{
return ("_pistol");
}
override public function get mPickupProbability():Number{
return (0);
}
override public function get mUpgrades():Array{
return (_Upgrades);
}
override public function get _CLASSID_():String{
return ("CPistol");
}
}
}//package Thing
Section 125
//CRock (Thing.CRock)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CRock extends CThingObject {
public function CRock(_arg1:Object, _arg2=null){
_arg1.mCollideRadius = 0.5;
super(_arg1);
mMaxLife = (mLife = 1000);
mAudioMaterial = "METAL";
SetCollide(mCellCurrent, eWMCCollideType.ROCK);
if (!MCAnimationExists(_CLASSID_)){
AddMCAnimation(_CLASSID_, new Object_Rock());
};
SetState("State_GROWRADIUS");
mAnimationFrame = Random();
}
override public function get _CLASSID_():String{
return ("CRock");
}
}
}//package Thing
Section 126
//CRocketLauncher (Thing.CRocketLauncher)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CRocketLauncher extends CThingWeapon {
private var mShotPIndex:int;// = 0
public static var _Upgrades:Array = [{mName:"", mAmmo:20, mBiggerBang:0, mClusterShells:0, mAutoFire:false, mFireRate:12}, {mName:"Double ammo", mAmmo:40, mBiggerBang:0, mClusterShells:0, mAutoFire:false, mFireRate:12}, {mName:"Fast fire", mAmmo:40, mBiggerBang:0, mClusterShells:0, mAutoFire:false, mFireRate:6}, {mName:"Big bang", mAmmo:40, mBiggerBang:4, mClusterShells:0, mAutoFire:false, mFireRate:6}, {mName:"Quad ammo", mAmmo:80, mBiggerBang:4, mClusterShells:0, mAutoFire:false, mFireRate:6}, {mName:"Bigger bang", mAmmo:80, mBiggerBang:4, mClusterShells:4, mAutoFire:false, mFireRate:6}, {mName:"Rapid fire", mAmmo:80, mBiggerBang:4, mClusterShells:4, mAutoFire:true, mFireRate:3}];
public function CRocketLauncher(_arg1):void{
mShotPIndex = 0;
super(_arg1);
mUpgrade = 0;
Process = Process_Normal;
AddSound("Shot", Rocket_Shot1);
}
override public function Fire():void{
var _local1:CThingV3;
super.Fire();
mPosition = mOwner.mPosition;
mAngle = mOwner.mAngle;
mShotPIndex++;
_local1 = mParent.SpriteSheet_GetModelOffset("RSHOT");
AddThing(new CMuzzleFlash_Large(mOwner, _local1));
AddThing(new CMissile(mOwner, CAffect.BULLET(mOwner, this, 50), _local1));
PlaySound("Shot");
}
override public function Fire_Stop():void{
super.Fire_Stop();
}
public function Process_Normal(){
WeaponUpdate();
ProcessChildren();
}
override public function get mWeaponName():String{
return ("Rockets");
}
override public function Fire_Start():void{
super.Fire_Start();
}
override public function get mAnimExt():String{
return ("_rocket");
}
override public function get mPickupProbability():Number{
return (((MIDPROBABILITY * (1 - (mAmmo / mTotalAmmo))) + MIDPROBABILITY));
}
override public function get mUpgrades():Array{
return (_Upgrades);
}
override public function get _CLASSID_():String{
return ("CRocketLauncher");
}
}
}//package Thing
Section 127
//CRunner (Thing.CRunner)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CRunner extends CThingPeep {
public function CRunner(_arg1:Object=null){
super(_arg1, SheetRunner);
mName = "Runner";
mSpeed = (5 / 100);
mAngle.mDirection = 2;
SetAnimation("stand");
SetCollide(mCellCurrent, eWMCCollideType.PEEP);
mMaxLife = (mLife = 100);
mScore = 100;
SetState("State_NAVIGATE");
mAffectFlags = (mAffectFlags & ~(eAffectType.ZOMBIEATTACK));
mName = "Runner";
}
public function State_ATTACK_Exit():void{
}
public function State_RUNTOTARGET():void{
mAngle = CThingAngle.AsCThingV3(mTarget.mPosition.Clone().Sub(mPosition));
mDelta = mAngle.mDelta.ScaleN(((mSpeed * mSpeedScale) * 2.5));
mPosition = PeepCollide();
Animate(defAnimSpeed);
MapMove();
if (--mStateCount < 0){
ReturnState_Base();
return;
};
if (mPosition.Distance2D(mTarget.mPosition) < 1){
SetState("State_ATTACK");
};
}
public function State_ATTACK_Enter():void{
SetAnimation("attack");
}
public function State_RUNTOTARGET_Exit():void{
}
public function State_RUNTOTARGET_Enter():void{
mAngleTarget = CThingAngle.AsCThingV3(mTarget.mPosition.Clone().Sub(mPosition));
if (mAngleTarget.mAngle256 != mAngle.mAngle256){
SetState("State_TURN", mStateID);
return;
};
SetAnimation("run");
mStateCount = (SECONDS * 8);
ClearCollide();
}
override public function State_NAVIGATE():void{
if (!mCanProcess){
return;
};
if (mAttackCounter != 0){
} else {
if (!mCellCurrent.mNavTarget){
} else {
if (mCellCurrent.mNavIndex > 6){
} else {
if (!mCellCurrent.mNavTarget.mExists){
} else {
mTarget = mCellCurrent.mNavTarget;
SetState("State_RUNTOTARGET");
return;
};
};
};
};
super.State_NAVIGATE();
}
override public function get _CLASSID_():String{
return ("CRunner");
}
public function State_ATTACK():void{
mPosition = PeepCollide();
MapMove();
if (AnimateEnd((defAnimSpeed * 1.3))){
AffectRadius(CAffect.ZOMBIEATTACK(this, (10 * mAttackScale), 0.5), 100, mAngle.mDelta.ScaleN((mCollideRadius * 2)));
SetState("State_WAIT", mBaseStateID);
mStateCount = 5;
};
}
public static function PrepareClass():void{
var _local1:CThingDraw;
_local1 = new CThingDraw();
if (!_local1.SpriteSheetExists("CRunner")){
_local1.AddSpriteSheet("CRunner", new SheetRunner(0, 0));
};
_local1.Dispose();
}
}
}//package Thing
Section 128
//CSAirstrike (Thing.CSAirstrike)
package Thing {
import flash.display.*;
import flash.geom.*;
import Landscape.*;
import World.*;
import flash.events.*;
public class CSAirstrike extends CThingShot {
private var mStrikeInit:Number;
private var mStrikeWidth:int;
private var mStrikeSpread:int;
public var mColor:uint;// = 4294901760
private var mStrikeExChance:Number;
private var mStrikeCount:int;
private var mStrikeRange:int;
public function CSAirstrike(_arg1:Object, _arg2, _arg3:String="normal"){
mColor = 4294901760;
super(_arg2);
SetPositionByInitObject(_arg1);
MapAdd();
AddSound("Airstrike", Airstrike_Plane);
if (!MCAnimationExists(_CLASSID_)){
AddMCAnimation(_CLASSID_, new Airstrike_Beacon());
};
PlaySound("Airstrike");
mStrikeCount = (4.5 * SECONDS);
mAngle = CThingAngle.AsAngle256((Random() * 0x0100));
switch (_arg3){
case "normal":
default:
mStrikeSpread = 2;
mStrikeRange = (6 / mStrikeSpread);
mStrikeInit = 2;
Process = Process_Normal;
break;
case "carpet":
mStrikeSpread = 2;
mStrikeRange = (40 / mStrikeSpread);
mStrikeWidth = (8 / mStrikeSpread);
mStrikeInit = 2;
Process = Process_Carpet;
break;
case "snuke":
mStrikeSpread = 1.8;
mStrikeRange = (11 / mStrikeSpread);
mStrikeInit = 2;
mStrikeExChance = 1;
Process = Process_Nuke;
break;
case "nuke":
mStrikeSpread = 1.8;
mStrikeRange = (18 / mStrikeSpread);
mStrikeInit = 2;
mStrikeExChance = 0.6;
Process = Process_Nuke;
break;
};
}
override public function Process_Dispose():void{
if (mAlpha > 0){
mAlpha = (mAlpha - 0.05);
if (mAlpha <= 0){
MapRemove();
};
};
if (!ProcessChildren()){
Dispose();
};
}
public function Process_Beacon():void{
Animate();
ProcessChildren();
}
private function _GetCount(_arg1:int):int{
var _local2:Number;
var _local3:Number;
_local2 = (mStrikeSpread * _arg1);
_local3 = (((_local2 * 2) * Math.PI) / 2);
return (Math.ceil((_local3 / mStrikeSpread)));
}
public function Process_Carpet():void{
var _local1:int;
var _local2:CExplosion;
var _local3:Array;
var _local4:CThingV3;
var _local5:CThingV3;
var _local6:CThingV3;
var _local7:CThingV3;
var _local8:int;
var _local9:CThingV3;
var _local10:int;
Process_Beacon();
if (--mStrikeCount == 0){
mAlpha = 1;
_local1 = 0;
_local3 = new Array();
mAngle.mAngleRAD = mOwner.mPosition.GetAngle(mPosition);
_local4 = mAngle.mDelta.ScaleN(((-(mStrikeWidth) / 2) * mStrikeSpread));
_local5 = mAngle.mDelta.RotateZ((Math.PI / 2)).ScaleN(((-(mStrikeRange) / 2) * mStrikeSpread));
_local6 = new CThingV3().Sub(_local4).Sub(_local5);
_local4.ScaleN((1 / (mStrikeWidth / 2)));
_local5.ScaleN((1 / (mStrikeRange / 2)));
_local7 = _local6.Clone();
_local8 = 0;
while (_local8 < mStrikeRange) {
_local9 = _local7.Clone();
_local10 = 0;
while (_local10 < mStrikeWidth) {
if ((mMap.GetCellAt((mPosition.x + _local9.x), (mPosition.y + _local9.y)).mCollide & eWMCCollideType.SOLID)){
} else {
_local2 = new CExplosion(this, _local9);
AddThing(_local2);
_local2.SetDelay((_local8 * mStrikeInit));
};
_local10++;
_local9.Add(_local4);
};
_local8++;
_local7.Add(_local5);
};
Process = Process_Dispose;
};
}
public function Process_Normal():void{
var _local1:int;
var _local2:CExplosion;
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:CThingAngle;
var _local7:int;
var _local8:CThingV3;
if (--mStrikeCount == 0){
mAlpha = 1;
_local1 = 0;
_local3 = new Array();
_local4 = 1;
while (_local4 <= mStrikeRange) {
_local5 = _GetCount(_local4);
_local6 = CThingAngle.AsAngle256((0x0100 / _local5));
_local7 = _local5;
while (_local7) {
_local8 = mAngle.mDelta.ScaleN((_local4 * mStrikeSpread));
if ((mMap.GetCellAt((mPosition.x + _local8.x), (mPosition.y + _local8.y)).mCollide & eWMCCollideType.SOLID)){
} else {
var _temp1 = _local1;
_local1 = (_local1 + 1);
_local3.push(_temp1);
_local2 = new CExplosion(this, _local8);
AddThing(_local2);
};
mAngle.Add(_local6);
_local7--;
};
_local4++;
};
for each (_local2 in mChildren) {
_local2.SetDelay((_local3.splice(RandomInt(_local3.length), 1)[0] * mStrikeInit));
};
Process = Process_Dispose;
};
Process_Beacon();
}
public function Process_Nuke():void{
var _local1:int;
var _local2:CExplosion;
var _local3:int;
var _local4:int;
var _local5:CThingAngle;
var _local6:int;
var _local7:CThingV3;
if (--mStrikeCount == 0){
mAlpha = 1;
_local1 = 0;
_local3 = 1;
while (_local3 <= mStrikeRange) {
_local4 = _GetCount(_local3);
_local5 = CThingAngle.AsAngle256((0x0100 / _local4));
_local6 = _local4;
while (_local6) {
_local7 = mAngle.mDelta.ScaleN((_local3 * mStrikeSpread));
if ((mMap.GetCellAt((mPosition.x + _local7.x), (mPosition.y + _local7.y)).mCollide & eWMCCollideType.SOLID)){
} else {
_local2 = new CExplosion(this, _local7);
AddThing(_local2);
_local2.SetDelay((_local3 * mStrikeInit));
};
mAngle.Add(_local5);
_local6--;
};
_local3++;
};
Process = Process_Dispose;
};
Process_Beacon();
}
override public function get _CLASSID_():String{
return ("CSAirstrike");
}
}
}//package Thing
Section 129
//CSGrenade (Thing.CSGrenade)
package Thing {
import flash.display.*;
import flash.geom.*;
import Landscape.*;
import flash.events.*;
public class CSGrenade extends CThingShot {
private var rUpgrades:Object;
public function CSGrenade(_arg1, _arg2:CThingV3, _arg3:Number=1, _arg4:Object=null):void{
super(_arg1);
rUpgrades = _arg4;
Process = Process_Normal;
_arg3 = Math.min(1, Math.max(0.3, _arg3));
mMaxLife = (mLife = (2 * SECONDS));
mPosition.Add(_arg2);
mDelta = mAngle.mDelta;
mDelta.z = 0.5;
mDelta.ScaleN(_arg3);
mCollideRadius = 0.15;
mCollideHeight = (mCollideRadius * 2);
MapAdd();
AddSound("Bounce", Grenade_Bounce);
if (!MCAnimationExists(_CLASSID_)){
AddMCAnimation(_CLASSID_, new Shot_Grenade());
};
}
public function Process_Normal(){
var _local1:Boolean;
var _local2:CExplosion;
Animate();
_local1 = false;
mDelta.z = (mDelta.z - 0.06);
if ((mPosition.z + mDelta.z) < 0){
if ((mDelta.z = Math.abs(mDelta.z)) <= 0.06){
mDelta.z = 0;
};
mDelta.ScaleN(0.5);
mPosition.z = 0;
_local1 = true;
};
if (BounceCollide()){
_local1 = true;
mDelta.ScaleN2D(0.25);
};
if (((_local1) && ((mDelta.mLength > 0.06)))){
PlaySound("Bounce");
};
mPosition.Add(mDelta);
MapMove();
if (--mLife == 0){
_local2 = new CExplosion(this, new CThingV3(0, 0, (mCollideHeight / 2)));
AddThing(_local2);
if (rUpgrades){
if (rUpgrades.mClusterShells){
_local2.AddClusterShells(rUpgrades.mClusterShells);
};
if (rUpgrades.mBiggerBang){
_local2.AddBiggerBang(rUpgrades.mBiggerBang);
};
};
MapRemove();
Process = Process_Dispose;
return;
};
}
override public function get _CLASSID_():String{
return ("CSGrenade");
}
}
}//package Thing
Section 130
//CShotgun (Thing.CShotgun)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CShotgun extends CThingWeapon {
private var mShotPIndex:int;// = 0
public static var _Upgrades:Array = [{mName:"", mAmmo:20, mAutoFire:false, mFireRate:12, mDamage:50, mRange:7, mWideShot:0}, {mName:"Auto fire", mAmmo:20, mAutoFire:true, mFireRate:12, mDamage:50, mRange:7, mWideShot:0}, {mName:"Double ammo", mAmmo:40, mAutoFire:true, mFireRate:12, mDamage:50, mRange:7, mWideShot:0}, {mName:"Wide shot", mAmmo:40, mAutoFire:true, mFireRate:12, mDamage:50, mRange:7, mWideShot:1}, {mName:"Rapid fire", mAmmo:40, mAutoFire:true, mFireRate:5, mDamage:50, mRange:7, mWideShot:1}, {mName:"Long range", mAmmo:40, mAutoFire:true, mFireRate:5, mDamage:50, mRange:11, mWideShot:1}, {mName:"Quad ammo", mAmmo:80, mAutoFire:true, mFireRate:5, mDamage:50, mRange:11, mWideShot:1}, {mName:"Wider shot", mAmmo:80, mAutoFire:true, mFireRate:5, mDamage:50, mRange:11, mWideShot:2}, {mName:"Double damage", mAmmo:80, mAutoFire:true, mFireRate:5, mDamage:100, mRange:11, mWideShot:2}];
public function CShotgun(_arg1):void{
mShotPIndex = 0;
super(_arg1);
mUpgrade = 0;
Process = Process_Normal;
AddSound("Shot", Shotgun_Shot1);
}
override public function Fire():void{
var _local1:CThingV3;
super.Fire();
mPosition = mOwner.mPosition;
mAngle = mOwner.mAngle;
_local1 = mParent.SpriteSheet_GetModelOffset("RSHOT");
AddThing(new CMuzzleFlash(mOwner, _local1, Large_MuzzleFlash));
AddThing(new CShotgunBullet(mOwner, CAffect.BULLET(mOwner, this, mDamage), _local1, mRange, mWideShot));
PlaySound("Shot");
}
override public function Fire_Stop():void{
super.Fire_Stop();
}
public function Process_Normal(){
WeaponUpdate();
ProcessChildren();
}
override public function get mWeaponName():String{
return ("Shotgun");
}
override public function Fire_Start():void{
super.Fire_Start();
}
override public function get mAnimExt():String{
return ("_shotgun");
}
override public function get mPickupProbability():Number{
return ((((HIGHPROBABILITY - LOWPROBABILITY) * (1 - (mAmmo / mTotalAmmo))) + LOWPROBABILITY));
}
override public function get mUpgrades():Array{
return (_Upgrades);
}
override public function get _CLASSID_():String{
return ("CShotgun");
}
}
}//package Thing
Section 131
//CShotgunBullet (Thing.CShotgunBullet)
package Thing {
public class CShotgunBullet extends CThingShot {
public function CShotgunBullet(_arg1, _arg2:CAffect, _arg3:CThingV3, _arg4:Number, _arg5:int){
var _local6:CBullet;
var _local7:CThingAngle;
var _local8:int;
super(_arg1, _arg2);
switch (_arg5){
case 0:
_local7 = CThingAngle.AsAngle256(3);
mAngle.Sub(_local7);
_local8 = 3;
while (_local8) {
_local6 = new CBullet(this, _arg2, _arg3, 1, _arg4);
AddThing(_local6);
_local8--;
mAngle.Add(_local7);
};
break;
case 1:
_local7 = CThingAngle.AsAngle256(6);
mAngle.Sub(_local7);
_local8 = 3;
while (_local8) {
_local6 = new CBullet(this, _arg2, _arg3, 1, _arg4);
AddThing(_local6);
_local8--;
mAngle.Add(_local7);
};
break;
case 2:
_local7 = CThingAngle.AsAngle256(10);
mAngle.Sub(_local7);
_local7.Scale(0.5);
_local8 = 5;
while (_local8) {
_local6 = new CBullet(this, _arg2, _arg3, 1, _arg4);
AddThing(_local6);
_local8--;
mAngle.Add(_local7);
};
break;
};
Process = Process_Dispose;
}
override public function get _CLASSID_():String{
return ("CShotgunBullet");
}
}
}//package Thing
Section 132
//CThing (Thing.CThing)
package Thing {
import flash.geom.*;
import World.*;
import flash.events.*;
public class CThing {
public var mCollideRadius:Number;
public var nID:int;
public var mName:String;
public var mCollideHeight:Number;
public var OnDispose:Function;
public var mLife:int;
public var mCollideMass:Number;// = 1
public var mScore:int;
public var mDisposed:Boolean;
public var OnDeath:Function;
public var mPosition:CThingV3;
public var mDrawn:Boolean;
public var mKilledBy;
public var mDamage:Number;
public var mOwner;
public var mID:String;
public var mMoved:Boolean;
public var Process:Function;
public var mMaxLife:int;
public var mTurretTargeted:CThingTurret;
public var mCounter:int;
public var mTarget:CThingMap;
public var mAngle:CThingAngle;
public var mCollideID:int;
public var nProcessID:int;
public var mDelete:Boolean;
public static const DISPOSED:String = "DISPOSED";
public static const SECONDS:int = CWorld.SECONDS;
public static var INDENT:String;
public static var VERBOSE:Boolean;
public static var mAllocateID:int = 0;
public function CThing(){
mCollideMass = 1;
super();
nID = ++mAllocateID;
mID = ("T" + nID);
mCollideID = nID;
}
public function Dispose():void{
if (!mDisposed){
mDisposed = true;
};
}
public function get _CLASSID_():String{
return ("CThing");
}
public function GrowRadius(_arg1:Number, _arg2:Number=0.05):Boolean{
if (mCollideRadius < _arg1){
mCollideRadius = (mCollideRadius + _arg2);
return (false);
};
return (true);
}
public function get mExists():Boolean{
return (!(((mDead) || (mDisposed))));
}
public function get mThingType():String{
return ("NONE");
}
public function Inherit(_arg1):void{
if (!_arg1){
return;
};
mPosition = _arg1.mPosition.Clone();
mAngle = _arg1.mAngle.Clone();
mCollideID = _arg1.mCollideID;
mOwner = (_arg1.mOwner) ? _arg1.mOwner : _arg1;
}
public function get mDead():Boolean{
return ((mLife <= 0));
}
public function toString():String{
var _local1:String;
_local1 = ((((INDENT + _CLASSID_) + ":(cID = ") + mCollideID) + ")");
return (_local1);
}
public static function Restart():void{
mAllocateID = 0;
CThingTurret.Restart();
CThingPeep.Restart();
}
}
}//package Thing
Section 133
//CThingAffect (Thing.CThingAffect)
package Thing {
import World.*;
public class CThingAffect extends CThingMap {
public var mAffects:Array;
public var mAffectFlags:uint;// = 16775167
public var mAffect:CAffect;
public static var AFFECTED:String = "affected";
public function CThingAffect(){
mAffectFlags = eAffectType.ANY;
super();
}
public function AffectRadius(_arg1:CAffect, _arg2:int=100000, _arg3:CThingV3=null, _arg4:Number=-1):void{
var _local5:CThingV3;
var _local6:Array;
var _local7:CThingAffect;
_local5 = (_arg3) ? mPosition.Clone().Add(_arg3) : mPosition;
_arg4 = ((_arg4)<0) ? mCollideRadius : _arg4;
_local6 = mMap.GetThingsRadius(_local5.x, _local5.y, mCollideRadius);
for each (_local7 in _local6) {
if ((_arg1.mType & _local7.mAffectFlags) == 0){
} else {
if (_local7.mCollideID == mCollideID){
} else {
if (_local5.Distance2D(_local7.mPosition) <= (_local7.mCollideRadius + _arg4)){
_local7.AddAffect(_arg1);
--_arg2;
if (_arg2 <= 0){
return;
};
};
};
};
};
}
public function AffectCell(_arg1:CAffect, _arg2:CWMCell, _arg3:int=100000):void{
var _local4:CThingV3;
_local4 = new CThingV3((_arg2.mapX + 0.5), (_arg2.mapY + 0.5), mPosition.z);
AffectRadius(_arg1, _arg3, _local4.Sub(mPosition), 0.5);
}
public function Affect_EXPLOSION(_arg1:CAffect):void{
mLife = (mLife - _arg1.mDamage);
}
public function Affect_ZOMBIEATTACK(_arg1:CAffect):void{
mLife = (mLife - _arg1.mDamage);
}
public function AffectThings(_arg1:Array, _arg2:CAffect):Array{
var _local3:CThingAffect;
for each (_local3 in _arg1) {
_local3.AddAffect(_arg2);
};
return (_arg1);
}
public function AddAffect(_arg1:CAffect):void{
if (!_arg1){
return;
};
if (mAffects){
mAffects.push(_arg1);
} else {
mAffects = [_arg1];
};
}
public function Affect_FIRE(_arg1:CAffect):void{
mLife = (mLife - _arg1.mDamage);
}
public function Affect_VAPOURIZE(_arg1:CAffect):void{
mLife = (mLife - _arg1.mDamage);
}
public function Affect_HIT(_arg1:CAffect):void{
mLife = (mLife - _arg1.mDamage);
}
public function Affect_BULLET(_arg1:CAffect):void{
mLife = (mLife - _arg1.mDamage);
}
override public function get _CLASSID_():String{
return ("CThingAffect");
}
public function Affect_PUSH(_arg1:CAffect):void{
}
}
}//package Thing
Section 134
//CThingAngle (Thing.CThingAngle)
package Thing {
import flash.display.*;
import flash.geom.*;
public class CThingAngle {
private var _Angle:int;
private static const mAngle230 = new Point(0.803207531480645, -0.595699304492433);
private static const mAngle232 = new Point(0.831469612302545, -0.555570233019602);
private static const mAngle234 = new Point(0.857728610000272, -0.514102744193222);
private static const mAngle120 = new Point(-0.98078528040323, 0.195090322016129);
private static const mAngle122 = new Point(-0.989176509964781, 0.146730474455362);
private static const mAngle124 = new Point(-0.995184726672197, 0.0980171403295609);
private static const mAngle125 = new Point(-0.99729045667869, 0.0735645635996677);
private static const mAngle126 = new Point(-0.998795456205172, 0.049067674327418);
private static const mAngle127 = new Point(-0.999698818696204, 0.0245412285229123);
private static const mAngle121 = new Point(-0.985277642388941, 0.170961888760301);
private static const mAngle123 = new Point(-0.99247953459871, 0.122410675199216);
private static const mAngle231 = new Point(0.817584813151584, -0.575808191417845);
private static const mAngle129 = new Point(-0.999698818696204, -0.0245412285229121);
private static const mAngle239 = new Point(0.91420975570353, -0.40524131400499);
private static const mAngle223 = new Point(0.689540544737067, -0.724247082951467);
private static const mAngle130 = new Point(-0.998795456205172, -0.0490676743274177);
private static const mAngle128 = new Point(-1, 0);
private static const mAngle132 = new Point(-0.995184726672197, -0.0980171403295606);
private static const mAngle133 = new Point(-0.99247953459871, -0.122410675199216);
private static const CONVRADM:Number = (1 / CONVRAD);
private static const mAngle135 = new Point(-0.985277642388941, -0.170961888760301);
private static const mAngle136 = new Point(-0.98078528040323, -0.195090322016128);
private static const mAngle137 = new Point(-0.975702130038529, -0.21910124015687);
private static const mAngle131 = new Point(-0.99729045667869, -0.0735645635996675);
private static const mAngle139 = new Point(-0.96377606579544, -0.266712757474898);
private static const mAngle134 = new Point(-0.989176509964781, -0.146730474455362);
private static const mAngle236 = new Point(0.881921264348355, -0.471396736825998);
private static const mAngle241 = new Point(0.932992798834739, -0.359895036534988);
private static const mAngle138 = new Point(-0.970031253194544, -0.242980179903264);
private static const mAngle243 = new Point(0.949528180593037, -0.313681740398892);
private static const mAngle245 = new Point(0.96377606579544, -0.266712757474899);
private static const mAngle246 = new Point(0.970031253194544, -0.242980179903264);
private static const mAngle250 = new Point(0.989176509964781, -0.146730474455362);
private static const CONVRAD:Number = ((MAXANGLE / 2) / Math.PI);
private static const mAngle242 = new Point(0.941544065183021, -0.33688985339222);
private static const mAngle238 = new Point(0.903989293123443, -0.427555093430283);
private static const mAngle140 = new Point(-0.956940335732209, -0.290284677254462);
private static const mAngle141 = new Point(-0.949528180593037, -0.313681740398891);
private static const mAngle142 = new Point(-0.941544065183021, -0.33688985339222);
private static const mAngle143 = new Point(-0.932992798834739, -0.359895036534988);
private static const mAngle144 = new Point(-0.923879532511287, -0.38268343236509);
private static const mAngle145 = new Point(-0.914209755703531, -0.40524131400499);
private static const mAngle146 = new Point(-0.903989293123443, -0.427555093430282);
private static const mAngle147 = new Point(-0.893224301195515, -0.449611329654607);
private static const mAngle148 = new Point(-0.881921264348355, -0.471396736825998);
private static const mAngle247 = new Point(0.975702130038528, -0.21910124015687);
private static const mAngle149 = new Point(-0.870086991108712, -0.492898192229784);
private static const mAngle251 = new Point(0.99247953459871, -0.122410675199216);
private static const mAngle253 = new Point(0.99729045667869, -0.0735645635996674);
private static const mAngle248 = new Point(0.98078528040323, -0.195090322016129);
private static const mAngle249 = new Point(0.985277642388941, -0.170961888760302);
private static const mAngle150 = new Point(-0.857728610000272, -0.514102744193222);
private static const mAngle151 = new Point(-0.844853565249707, -0.534997619887097);
private static const mAngle152 = new Point(-0.831469612302545, -0.555570233019602);
private static const mAngle153 = new Point(-0.817584813151584, -0.575808191417845);
private static const mAngle154 = new Point(-0.803207531480645, -0.595699304492433);
private static const mAngle155 = new Point(-0.788346427626607, -0.615231590580627);
private static const mAngle156 = new Point(-0.773010453362737, -0.634393284163645);
private static const mAngle157 = new Point(-0.757208846506485, -0.653172842953777);
private static const mAngle158 = new Point(-0.740951125354959, -0.671558954847018);
private static const mAngle254 = new Point(0.998795456205172, -0.0490676743274181);
private static const mAngle159 = new Point(-0.724247082951467, -0.689540544737067);
private static const mAngle240 = new Point(0.923879532511287, -0.38268343236509);
private static const mAngle252 = new Point(0.995184726672197, -0.0980171403295605);
private static const mAngle244 = new Point(0.956940335732209, -0.290284677254462);
private static const mAngle255 = new Point(0.999698818696204, -0.0245412285229124);
private static const mAngle160 = new Point(-0.707106781186548, -0.707106781186547);
private static const mAngle161 = new Point(-0.689540544737067, -0.724247082951467);
private static const mAngle162 = new Point(-0.671558954847019, -0.740951125354959);
private static const mAngle163 = new Point(-0.653172842953777, -0.757208846506484);
private static const mAngle164 = new Point(-0.634393284163646, -0.773010453362737);
private static const mAngle0 = new Point(1, 0);
private static const mAngle1 = new Point(0.999698818696204, 0.0245412285229123);
private static const mAngle2 = new Point(0.998795456205172, 0.049067674327418);
private static const mAngle3 = new Point(0.99729045667869, 0.0735645635996674);
private static const mAngle4 = new Point(0.995184726672197, 0.0980171403295606);
private static const mAngle5 = new Point(0.99247953459871, 0.122410675199216);
private static const mAngle6 = new Point(0.989176509964781, 0.146730474455362);
private static const mAngle7 = new Point(0.985277642388941, 0.170961888760301);
private static const mAngle8 = new Point(0.98078528040323, 0.195090322016128);
private static const mAngle9 = new Point(0.975702130038529, 0.21910124015687);
private static const mAngle167 = new Point(-0.575808191417845, -0.817584813151584);
private static const mAngle169 = new Point(-0.534997619887097, -0.844853565249707);
private static const mAngle165 = new Point(-0.615231590580627, -0.788346427626606);
private static const mAngle166 = new Point(-0.595699304492433, -0.803207531480645);
private static const mAngle170 = new Point(-0.514102744193222, -0.857728610000272);
private static const mAngle168 = new Point(-0.555570233019602, -0.831469612302545);
private static const mAngle172 = new Point(-0.471396736825998, -0.881921264348355);
private static const mAngle173 = new Point(-0.449611329654607, -0.893224301195515);
private static const mAngle174 = new Point(-0.427555093430282, -0.903989293123443);
private static const mAngle175 = new Point(-0.40524131400499, -0.91420975570353);
private static const mAngle176 = new Point(-0.38268343236509, -0.923879532511287);
private static const mAngle177 = new Point(-0.359895036534988, -0.932992798834739);
private static const mAngle178 = new Point(-0.33688985339222, -0.941544065183021);
private static const mAngle179 = new Point(-0.313681740398891, -0.949528180593037);
private static const mAngle171 = new Point(-0.492898192229784, -0.870086991108711);
private static const mAngle180 = new Point(-0.290284677254462, -0.956940335732209);
private static const mAngle181 = new Point(-0.266712757474899, -0.96377606579544);
private static const mAngle182 = new Point(-0.242980179903264, -0.970031253194544);
private static const mAngle183 = new Point(-0.21910124015687, -0.975702130038528);
private static const mAngle184 = new Point(-0.195090322016129, -0.980785280403231);
private static const mAngle185 = new Point(-0.170961888760302, -0.985277642388941);
private static const mAngle186 = new Point(-0.146730474455362, -0.989176509964781);
private static const mAngle187 = new Point(-0.122410675199216, -0.99247953459871);
private static const mAngle188 = new Point(-0.0980171403295605, -0.995184726672197);
private static const mAngle189 = new Point(-0.0735645635996674, -0.99729045667869);
public static const mDirectionNames:Array = ["E", "SE", "S", "SW", "W", "NW", "N", "NE"];
private static const mAngle190 = new Point(-0.049067674327418, -0.998795456205172);
private static const mAngle191 = new Point(-0.0245412285229124, -0.999698818696204);
private static const mAngle192 = new Point(0, -1);
private static const mAngle193 = new Point(0.024541228522912, -0.999698818696204);
private static const mAngle194 = new Point(0.0490676743274177, -0.998795456205172);
private static const mAngle195 = new Point(0.073564563599667, -0.99729045667869);
private static const mAngle196 = new Point(0.0980171403295601, -0.995184726672197);
private static const mAngle197 = new Point(0.122410675199216, -0.99247953459871);
private static const mAngle198 = new Point(0.146730474455362, -0.989176509964781);
private static const mAngle199 = new Point(0.170961888760301, -0.985277642388941);
private static const mAngle10 = new Point(0.970031253194544, 0.242980179903264);
private static const mAngle11 = new Point(0.96377606579544, 0.266712757474898);
private static const mAngle12 = new Point(0.956940335732209, 0.290284677254462);
private static const mAngle13 = new Point(0.949528180593037, 0.313681740398892);
private static const mAngle14 = new Point(0.941544065183021, 0.33688985339222);
private static const mAngle15 = new Point(0.932992798834739, 0.359895036534988);
private static const mAngle16 = new Point(0.923879532511287, 0.38268343236509);
private static const mAngle17 = new Point(0.914209755703531, 0.40524131400499);
private static const mAngle18 = new Point(0.903989293123443, 0.427555093430282);
private static const mAngle19 = new Point(0.893224301195515, 0.449611329654607);
private static const mAngle21 = new Point(0.870086991108711, 0.492898192229784);
private static const mAngle23 = new Point(0.844853565249707, 0.534997619887097);
private static const mAngle24 = new Point(0.831469612302545, 0.555570233019602);
private static const mAngle26 = new Point(0.803207531480645, 0.595699304492433);
private static const mAngle27 = new Point(0.788346427626606, 0.615231590580627);
private static const mAngle28 = new Point(0.773010453362737, 0.634393284163645);
private static const mAngle22 = new Point(0.857728610000272, 0.514102744193222);
private static const mAngle25 = new Point(0.817584813151584, 0.575808191417845);
private static const mAngle20 = new Point(0.881921264348355, 0.471396736825998);
private static const mAngle29 = new Point(0.757208846506485, 0.653172842953777);
private static const mAngle30 = new Point(0.740951125354959, 0.671558954847018);
private static const mAngle31 = new Point(0.724247082951467, 0.689540544737067);
private static const mAngle32 = new Point(0.707106781186548, 0.707106781186547);
private static const mAngle33 = new Point(0.689540544737067, 0.724247082951467);
private static const mAngle34 = new Point(0.671558954847018, 0.740951125354959);
private static const mAngle35 = new Point(0.653172842953777, 0.757208846506485);
private static const mAngle36 = new Point(0.634393284163645, 0.773010453362737);
private static const mAngle37 = new Point(0.615231590580627, 0.788346427626606);
private static const mAngle38 = new Point(0.595699304492433, 0.803207531480645);
private static const mAngle39 = new Point(0.575808191417845, 0.817584813151584);
private static const mAngle40 = new Point(0.555570233019602, 0.831469612302545);
private static const mAngle41 = new Point(0.534997619887097, 0.844853565249707);
private static const mAngle42 = new Point(0.514102744193222, 0.857728610000272);
private static const mAngle43 = new Point(0.492898192229784, 0.870086991108711);
private static const mAngle44 = new Point(0.471396736825998, 0.881921264348355);
private static const mAngle45 = new Point(0.449611329654607, 0.893224301195515);
private static const mAngle46 = new Point(0.427555093430282, 0.903989293123443);
private static const mAngle47 = new Point(0.40524131400499, 0.914209755703531);
private static const mAngle48 = new Point(0.38268343236509, 0.923879532511287);
private static const mAngle49 = new Point(0.359895036534988, 0.932992798834739);
private static const mAngle50 = new Point(0.33688985339222, 0.941544065183021);
private static const mAngle51 = new Point(0.313681740398892, 0.949528180593037);
private static const mAngle52 = new Point(0.290284677254462, 0.956940335732209);
private static const mAngle53 = new Point(0.266712757474898, 0.96377606579544);
private static const mAngle54 = new Point(0.242980179903264, 0.970031253194544);
private static const mAngle55 = new Point(0.21910124015687, 0.975702130038529);
private static const mAngle56 = new Point(0.195090322016128, 0.98078528040323);
private static const mAngle57 = new Point(0.170961888760301, 0.985277642388941);
private static const mAngle58 = new Point(0.146730474455362, 0.989176509964781);
private static const mAngle59 = new Point(0.122410675199216, 0.99247953459871);
private static const mAngle60 = new Point(0.0980171403295608, 0.995184726672197);
private static const mAngle61 = new Point(0.0735645635996675, 0.99729045667869);
private static const mAngle62 = new Point(0.0490676743274181, 0.998795456205172);
private static const mAngle63 = new Point(0.0245412285229123, 0.999698818696204);
private static const mAngle64 = new Point(0, 1);
private static const mAngle65 = new Point(-0.0245412285229121, 0.999698818696204);
private static const mAngle66 = new Point(-0.049067674327418, 0.998795456205172);
private static const mAngle67 = new Point(-0.0735645635996673, 0.99729045667869);
private static const mAngle68 = new Point(-0.0980171403295606, 0.995184726672197);
private static const mAngle69 = new Point(-0.122410675199216, 0.99247953459871);
private static const mAngle70 = new Point(-0.146730474455362, 0.989176509964781);
private static const mAngle71 = new Point(-0.170961888760301, 0.985277642388941);
private static const mAngle72 = new Point(-0.195090322016128, 0.98078528040323);
private static const mAngle73 = new Point(-0.21910124015687, 0.975702130038529);
private static const mAngle74 = new Point(-0.242980179903264, 0.970031253194544);
private static const mAngle76 = new Point(-0.290284677254462, 0.956940335732209);
private static const mAngle77 = new Point(-0.313681740398891, 0.949528180593037);
private static const mAngle78 = new Point(-0.33688985339222, 0.941544065183021);
private static const mAngle79 = new Point(-0.359895036534988, 0.932992798834739);
private static const mAngle75 = new Point(-0.266712757474898, 0.96377606579544);
private static const mAngle80 = new Point(-0.38268343236509, 0.923879532511287);
private static const mAngle81 = new Point(-0.40524131400499, 0.914209755703531);
private static const mAngle82 = new Point(-0.427555093430282, 0.903989293123443);
private static const mAngle83 = new Point(-0.449611329654607, 0.893224301195515);
private static const mAngle84 = new Point(-0.471396736825998, 0.881921264348355);
private static const mAngle85 = new Point(-0.492898192229784, 0.870086991108711);
private static const mAngle86 = new Point(-0.514102744193222, 0.857728610000272);
private static const mAngle87 = new Point(-0.534997619887097, 0.844853565249707);
private static const mAngle88 = new Point(-0.555570233019602, 0.831469612302545);
private static const mAngle89 = new Point(-0.575808191417845, 0.817584813151584);
private static const MAXANGLE:Number = (4294967295 + 1);
private static const mAngle90 = new Point(-0.595699304492433, 0.803207531480645);
private static const mAngle91 = new Point(-0.615231590580627, 0.788346427626607);
private static const mAngle92 = new Point(-0.634393284163645, 0.773010453362737);
private static const mAngle93 = new Point(-0.653172842953777, 0.757208846506485);
private static const mAngle94 = new Point(-0.671558954847019, 0.740951125354959);
private static const mAngle95 = new Point(-0.689540544737067, 0.724247082951467);
private static const mAngle96 = new Point(-0.707106781186547, 0.707106781186548);
private static const mAngle97 = new Point(-0.724247082951467, 0.689540544737067);
private static const mAngle98 = new Point(-0.740951125354959, 0.671558954847019);
private static const mAngle99 = new Point(-0.757208846506485, 0.653172842953777);
private static const MAXMASK:Number = 4294967295;
private static const mAngle201 = new Point(0.21910124015687, -0.975702130038529);
private static const mAngle203 = new Point(0.266712757474898, -0.96377606579544);
private static const mAngle205 = new Point(0.313681740398891, -0.949528180593037);
private static const mAngle206 = new Point(0.33688985339222, -0.941544065183021);
private static const mAngle200 = new Point(0.195090322016128, -0.98078528040323);
private static const mAngle208 = new Point(0.38268343236509, -0.923879532511287);
private static const mAngle202 = new Point(0.242980179903264, -0.970031253194544);
private static const mAngle204 = new Point(0.290284677254462, -0.956940335732209);
private static const mAngle207 = new Point(0.359895036534988, -0.932992798834739);
private static const mAngle211 = new Point(0.449611329654607, -0.893224301195515);
private static const mAngle209 = new Point(0.40524131400499, -0.914209755703531);
private static const mAngle213 = new Point(0.492898192229784, -0.870086991108712);
private static const mAngle214 = new Point(0.514102744193222, -0.857728610000272);
private static const mAngle215 = new Point(0.534997619887097, -0.844853565249707);
private static const mAngle216 = new Point(0.555570233019602, -0.831469612302545);
private static const mAngle210 = new Point(0.427555093430282, -0.903989293123443);
private static const mAngle218 = new Point(0.595699304492433, -0.803207531480645);
private static const mAngle212 = new Point(0.471396736825998, -0.881921264348355);
private static const mAngle217 = new Point(0.575808191417845, -0.817584813151584);
private static const mAngle219 = new Point(0.615231590580627, -0.788346427626606);
private static const mAngle100 = new Point(-0.773010453362737, 0.634393284163645);
private static const mAngle102 = new Point(-0.803207531480645, 0.595699304492433);
private static const mAngle104 = new Point(-0.831469612302545, 0.555570233019602);
private static const mAngle105 = new Point(-0.844853565249707, 0.534997619887097);
private static const mAngle106 = new Point(-0.857728610000272, 0.514102744193222);
private static const mAngle107 = new Point(-0.870086991108711, 0.492898192229784);
private static const mAngle101 = new Point(-0.788346427626606, 0.615231590580627);
private static const mAngle109 = new Point(-0.893224301195515, 0.449611329654607);
private static const mAngle103 = new Point(-0.817584813151584, 0.575808191417845);
private static const mAngle226 = new Point(0.740951125354959, -0.671558954847019);
private static const mAngle220 = new Point(0.634393284163646, -0.773010453362737);
private static const mAngle108 = new Point(-0.881921264348355, 0.471396736825998);
private static const mAngle224 = new Point(0.707106781186547, -0.707106781186548);
private static const mAngle221 = new Point(0.653172842953777, -0.757208846506485);
private static const mAngle225 = new Point(0.724247082951467, -0.689540544737067);
private static const mAngle227 = new Point(0.757208846506484, -0.653172842953777);
private static const mAngle110 = new Point(-0.903989293123443, 0.427555093430282);
private static const mAngle111 = new Point(-0.914209755703531, 0.40524131400499);
private static const mAngle112 = new Point(-0.923879532511287, 0.38268343236509);
private static const mAngle113 = new Point(-0.932992798834739, 0.359895036534988);
private static const mAngle114 = new Point(-0.941544065183021, 0.33688985339222);
private static const mAngle115 = new Point(-0.949528180593037, 0.313681740398891);
private static const mAngle116 = new Point(-0.956940335732209, 0.290284677254462);
private static const mAngle117 = new Point(-0.96377606579544, 0.266712757474898);
private static const mAngle118 = new Point(-0.970031253194544, 0.242980179903264);
private static const mAngle119 = new Point(-0.975702130038528, 0.21910124015687);
private static const mAngle228 = new Point(0.773010453362737, -0.634393284163646);
private static const mAngle229 = new Point(0.788346427626606, -0.615231590580627);
private static const mAngle237 = new Point(0.893224301195515, -0.449611329654607);
private static const mAngle222 = new Point(0.671558954847018, -0.740951125354959);
private static const mAngle233 = new Point(0.844853565249707, -0.534997619887097);
private static const mAngle235 = new Point(0.870086991108711, -0.492898192229784);
public function CThingAngle(_arg1:int=0):void{
_Angle = _arg1;
}
public function Clone():CThingAngle{
return (new CThingAngle(_Angle));
}
public function Add(_arg1:CThingAngle):CThingAngle{
_Angle = (_Angle + _arg1._Angle);
return (this);
}
public function get mDelta():CThingV3{
var _local1:Point;
_local1 = CThingAngle[("mAngle" + mAngle256)];
return (new CThingV3(_local1.x, _local1.y));
}
public function set mAngle(_arg1:int){
_Angle = _arg1;
}
public function set pDelta(_arg1:Point):void{
mAngleRAD = Math.atan2(_arg1.y, _arg1.x);
}
public function get mDirection():Number{
return ((((_Angle + (1 << 28)) >> 29) & 7));
}
public function get mAngleRAD():Number{
return ((_Angle * CONVRADM));
}
public function set mAngle256(_arg1:Number){
_Angle = (_arg1 << 24);
}
public function set mDelta(_arg1:CThingV3):void{
mAngleRAD = _arg1.mAngleRAD;
}
public function set mAngleRAD(_arg1:Number){
_Angle = ((_arg1 * CONVRAD) & MAXMASK);
}
public function Equals(_arg1:CThingAngle):Boolean{
return ((_Angle == _arg1._Angle));
}
public function Sub(_arg1:CThingAngle):CThingAngle{
_Angle = (_Angle - _arg1._Angle);
return (this);
}
public function set mDirection(_arg1:Number){
_Angle = (_arg1 << 29);
}
public function get mAngle():int{
return (_Angle);
}
public function Scale(_arg1:Number):CThingAngle{
_Angle = (_Angle * _arg1);
return (this);
}
public function get _CLASSID_():String{
return ("CThingAngle");
}
public function toString():String{
return (((((_CLASSID_ + ": ") + mAngle256) + ", ") + mAngle));
}
public function get mAngle256():Number{
return ((((_Angle + (1 << 23)) >> 24) & 0xFF));
}
public function get pDelta():Point{
return (CThingAngle[("mAngle" + mAngle256)].clone());
}
function TurnAngle(_arg1:CThingAngle):CThingAngle{
return (new CThingAngle((_arg1._Angle - _Angle)));
}
public function set mDirectionName(_arg1:String){
mDirection = mDirectionNames.indexOf(_arg1);
}
function GetTurnCount(_arg1:CThingAngle):int{
var _local2:int;
_local2 = (mAngle / _arg1.mAngle);
return (((_local2)>=0) ? _local2 : -(_local2));
}
public function get mDirectionName():String{
return (mDirectionNames[mDirection]);
}
public static function AsCThingV3(_arg1:CThingV3):CThingAngle{
return (new CThingAngle((Math.atan2(_arg1.y, _arg1.x) * CONVRAD)));
}
public static function AsXY(_arg1:Number, _arg2:Number):CThingAngle{
return (new CThingAngle((Math.atan2(_arg2, _arg1) * CONVRAD)));
}
public static function AsAngle256(_arg1:Number):CThingAngle{
return (new CThingAngle((_arg1 * (1 << 24))));
}
public static function AsDirection(_arg1:int):CThingAngle{
return (new CThingAngle((_arg1 << 29)));
}
}
}//package Thing
Section 135
//CThingAudio (Thing.CThingAudio)
package Thing {
import flash.display.*;
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import Draw.*;
import flash.events.*;
import STC9.System.Profiler.*;
import Game.*;
import flash.media.*;
public class CThingAudio extends CThingState {
public var mAudioMaterial:String;
public static const mChannels:int = 8;
public static var mActiveChannels:int = 0;
public static var mSoundActive:Boolean = false;
public static var mAudioSize:Point = new Point();
public static var mAudioCentre:CThingV3 = new CThingV3();
public static var mPlaySounds:Object = new Array();
public static var mLoadedSounds:Object = new Object();
public static var mActiveSounds:Object = new Object();
public function StopSound(_arg1:String):void{
mPlaySounds.push({type:"stop", id:GetSoundID(_arg1)});
}
public function AddSound(_arg1:String, _arg2:Class, _arg3:int=1, _arg4:int=1):void{
GAddSound(GetSoundID(_arg1), _arg2, _arg3, _arg4);
}
public function PlaySound(_arg1:String, _arg2:Number=0, _arg3:int=0):void{
mPlaySounds.push({type:"play", id:GetSoundID(_arg1), loops:_arg3, levels:getPanVol(), startTime:_arg2});
}
private function GetSoundID(_arg1:String){
return (((_CLASSID_ + "_") + _arg1));
}
override public function get _CLASSID_():String{
return ("CThingAudio");
}
public function UpdateSound(_arg1:String):void{
mPlaySounds.push({type:"update", id:GetSoundID(_arg1), levels:getPanVol()});
}
private function getPanVol():Object{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local3 = mAudioCentre.Distance2D(mPosition);
_local1 = ((_local3)>4) ? (1 - Math.min(1, ((_local3 - 4) / mAudioSize.x))) : 1;
_local2 = ((mPosition.x - mAudioCentre.x) / mAudioSize.x);
return ({vol:_local1, pan:_local2});
}
private static function e_SOUNDCOMPLETE(_arg1:Event):void{
var _local2:Object;
for each (_local2 in mActiveSounds) {
if (_local2.mChannel == _arg1.currentTarget){
GKillSound(_local2.id);
};
};
}
public static function StopAllSounds():void{
var _local1:Object;
for each (_local1 in mActiveSounds) {
GStopSound(_local1.mID);
};
}
public static function GAddSound(_arg1:String, _arg2:Class, _arg3:int=1, _arg4:int=1):void{
if (!mLoadedSounds[_arg1]){
mLoadedSounds[_arg1] = {mID:_arg1, mSound:new (_arg2), mPriority:_arg3, mChannelAmount:_arg4};
};
}
public static function PauseAllSounds():void{
var _local1:Object;
for each (_local1 in mActiveSounds) {
_local1.mPaused = {mPosition:_local1.mChannel.position, mTransform:_local1.mChannel.soundTransform};
_local1.mChannel.stop();
_local1.mChannel = null;
};
}
private static function GKillSound(_arg1:String):void{
delete mActiveSounds[_arg1];
mActiveChannels--;
}
public static function UpdateAllSounds():void{
var _local1:Object;
var _local2:Object;
var _local3:int;
var _local4:int;
var _local5:String;
var _local6:String;
var _local7:Number;
var _local8:Object;
CGame.mFPS.StartProfile("AUDIO");
for each (_local1 in mPlaySounds) {
switch (_local1.type){
case "stop":
GStopSound(_local1.id);
break;
case "update":
GUpdateSound(_local1.id, _local1.levels);
break;
};
};
_local2 = new Object();
for each (_local1 in mPlaySounds) {
switch (_local1.type){
case "play":
if (_local1.levels.vol < 1E-6){
break;
};
if (_local2[_local1.id]){
_local8 = {vol:_local2[_local1.id].levels.vol, pan:_local2[_local1.id].levels.pan};
{vol:_local2[_local1.id].levels.vol, pan:_local2[_local1.id].levels.pan}.pan = (((_local8.pan * _local8.vol) + (_local1.levels.pan * _local1.levels.vol)) / 2);
_local8.vol = Math.min(1, (_local1.levels.vol + _local8.vol));
_local2[_local1.id].levels = _local8;
} else {
_local2[_local1.id] = _local1;
};
break;
};
};
_local3 = 0;
for each (_local1 in _local2) {
GPlaySound(_local1.id, _local1.startTime, _local1.loops, _local1.levels);
_local3++;
};
mPlaySounds = new Array();
_local4 = 0;
_local5 = "";
for (_local6 in mActiveSounds) {
_local4++;
_local5 = (_local5 + (_local6 + ","));
};
_local7 = CGame.mFPS.StopProfile("AUDIO");
if (_local7 >= 20){
};
CFPS.AddDebug("AUDIO#", String(_local3));
CFPS.AddDebug("AUDIOA#", String(_local4));
}
public static function GStopSound(_arg1:String):void{
if (mActiveSounds[_arg1]){
if (mActiveSounds[_arg1].mChannel){
mActiveSounds[_arg1].mChannel.removeEventListener(Event.SOUND_COMPLETE, e_SOUNDCOMPLETE);
mActiveSounds[_arg1].mChannel.stop();
};
GKillSound(_arg1);
};
}
public static function UnpauseAllSounds():void{
var _local1:Object;
for each (_local1 in mActiveSounds) {
_local1.mChannel = _local1.oSound.mSound.play(_local1.mPaused.mPosition, _local1.mLoops, _local1.mPaused.mTransform);
};
}
public static function GPlaySound(_arg1:String, _arg2:Number=0, _arg3:int=0, _arg4:Object=null):void{
if (!mSoundActive){
return;
};
if (!_arg1){
return;
};
if (mActiveSounds[_arg1]){
GStopSound(_arg1);
};
mActiveChannels++;
mActiveSounds[_arg1] = {id:_arg1, oSound:mLoadedSounds[_arg1], mLoops:_arg3};
mActiveSounds[_arg1].mChannel = mLoadedSounds[_arg1].mSound.play(_arg2, _arg3, new SoundTransform(_arg4.vol, _arg4.pan));
if (mActiveSounds[_arg1].mChannel){
mActiveSounds[_arg1].mChannel.addEventListener(Event.SOUND_COMPLETE, e_SOUNDCOMPLETE);
//unresolved jump
};
}
public static function GUpdateSound(_arg1:String, _arg2:Object):void{
var _local3:SoundTransform;
if (!mSoundActive){
return;
};
if (!mActiveSounds[_arg1]){
return;
};
_local3 = mActiveSounds[_arg1].mChannel.soundTransform;
_local3.pan = _arg2.pan;
_local3.volume = _arg2.vol;
mActiveSounds[_arg1].mChannel.soundTransform = _local3;
}
}
}//package Thing
Section 136
//CThingCollision (Thing.CThingCollision)
package Thing {
import flash.geom.*;
import World.*;
import flash.events.*;
public class CThingCollision extends CThingMove {
private var _CollideFlag:Boolean;
private var _CollideThings:Object;
private static var CollideCell_Filter:Function = IsCollideCell;
public function ThingCollideRadius(_arg1:int=16775167):CThingAffect{
var _local2:Array;
var _local3:CThingAffect;
_local2 = new Array();
for each (_local3 in mMap.GetThingsRadius(mPosition.x, mPosition.y, mCollideRadius)) {
if (!(_arg1 & _local3.mAffectFlags)){
} else {
if (_local3.mCollideID == mCollideID){
} else {
if (mPosition.Distance2D(_local3.mPosition) <= (_local3.mCollideRadius + mCollideRadius)){
return (_local3);
};
};
};
};
return (null);
}
public function BounceCollide():Boolean{
var _local1:CThingV3;
var _local2:CThingV3;
var _local3:CThingV3;
var _local4:Number;
CollideCell_Filter = IsCollideCell;
_CollideFlag = false;
_local1 = mDelta.Clone();
_local2 = MapwhoCollide(mPosition.Clone().Add(mDelta), (mOwner) ? mOwner.nID : nID, eAffectType.FILTER_SOLID);
_local1.x = (_local2.x - mPosition.x);
_local1.y = (_local2.y - mPosition.y);
_local2 = Collide_Map(_local1);
if (!_CollideFlag){
return (false);
};
_local3 = _local2.Sub(mPosition.Clone().Add(mDelta)).Normalize2D(1);
_local4 = (2 * ((mDelta.x * _local3.x) + (mDelta.y * _local3.y)));
mDelta.x = (mDelta.x - (_local3.x * _local4));
mDelta.y = (mDelta.y - (_local3.y * _local4));
return (true);
}
public function PeepCollide():CThingV3{
var _local1:Number;
var _local2:CThingV3;
CollideCell_Filter = IsCollideCell;
if (CollideCell_Filter(mCellCurrent)){
return (mPosition.Clone());
};
_local1 = 1;
while (_local1) {
_CollideFlag = false;
_local2 = MapwhoCollide(mPosition.Clone().Add(mDelta), nID, eAffectType.FILTER_SOLID);
mDelta = _local2.Clone().Sub(mPosition);
_local2 = Collide_Map(mDelta);
if (!_CollideFlag){
break;
};
_local1--;
};
mDelta = _local2.Clone().Sub(mPosition);
return (_local2);
}
private function QCollide_Map(_arg1:Number, _arg2:Number):CThingV3{
return ((mMap.GetCellsRadius(_arg1, _arg2, mCollideRadius, CollideCell_Filter).length) ? null : new CThingV3(_arg1, _arg2, mPosition.z));
}
public function MapwhoCollide(_arg1:CThingV3, _arg2:int, _arg3:int=0x0400, _arg4:int=0):CThingV3{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:CThingAffect;
var _local10:CThingV3;
_local6 = mPosition.z;
_local7 = (_local6 + mCollideHeight);
for each (_local9 in mMap.GetThingsRadius(mPosition.x, mPosition.y, mCollideRadius)) {
if (!(_arg3 & _local9.mAffectFlags)){
} else {
if (_local9.nID == _arg2){
} else {
_local8 = _local9.mPosition.z;
if ((((_local8 > _local7)) || (((_local8 + _local9.mCollideHeight) < _local6)))){
} else {
_local5 = _local9.mPosition.Distance2D(_arg1);
if (_local5 < (mCollideRadius + _local9.mCollideRadius)){
if (!(_arg4 & _local9.mAffectFlags)){
_local10 = _arg1.Clone().Sub(_local9.mPosition);
_local10.ScaleN((((mCollideRadius + _local9.mCollideRadius) - _local5) / _local5));
_arg1.Add(_local10);
_CollideFlag = true;
};
if (_CollideThings){
_CollideThings[_local9.mID] = _local9;
};
};
};
};
};
};
return (_arg1);
}
public function Collide_Map(_arg1:CThingV3):CThingV3{
var _local2:CThingV3;
_local2 = QCollide_Map((mPosition.x + _arg1.x), (mPosition.y + _arg1.y));
if (_local2){
return (_local2);
};
_CollideFlag = true;
_local2 = QCollide_Map((mPosition.x + _arg1.x), mPosition.y);
if (_local2){
return (_local2);
};
_local2 = QCollide_Map(mPosition.x, (mPosition.y + _arg1.y));
if (_local2){
return (_local2);
};
return (mPosition);
}
override public function get _CLASSID_():String{
return ("CThingCollision");
}
public function get mCollideThings():Object{
return (_CollideThings);
}
public function PlayerCollide():CThingV3{
var _local1:int;
var _local2:Number;
var _local3:*;
var _local4:CThingV3;
CollideCell_Filter = IsCollideCell_Player;
if (CollideCell_Filter(mCellCurrent)){
return (mPosition.Clone());
};
_local1 = (eAffectType.FILTER_SOLID | eAffectType.FILTER_PICKUP);
_CollideThings = new Object();
_local2 = 3;
while (_local2) {
_CollideFlag = false;
_local4 = MapwhoCollide(mPosition.Clone().Add(mDelta), nID, _local1, eAffectType.FILTER_PICKUP);
mDelta = _local4.Clone().Sub(mPosition);
_local4 = Collide_Map(mDelta);
if (!_CollideFlag){
break;
};
_local2--;
};
mDelta = _local4.Clone().Sub(mPosition);
for each (_local3 in _CollideThings) {
if ((_local3.mAffectFlags & eAffectType.FILTER_PICKUP)){
_local3.Pickup(this);
};
};
_CollideThings = null;
return (_local4);
}
private static function IsCollideCell_Player(_arg1:CWMCell):Boolean{
return (((_arg1.mCollide & (eWMCCollideType.SOLID | eWMCCollideType.EDGE))) ? true : false);
}
private static function IsCollideCell(_arg1:CWMCell):Boolean{
return (((_arg1.mCollide & eWMCCollideType.SOLID)) ? true : false);
}
}
}//package Thing
Section 137
//CThingContainer (Thing.CThingContainer)
package Thing {
import flash.geom.*;
import flash.events.*;
public class CThingContainer extends CThing {
public var mThings:Array;
public var mParent;
public function CountChildren(_arg1:String, _arg2:Boolean=false):int{
var _local3:int;
var _local4:*;
_local3 = 0;
for each (_local4 in mThings) {
if (_local4._CLASSID_ == _arg1){
if (_arg2){
};
_local3++;
};
};
return (_local3);
}
public function Process_Dispose():void{
if (!ProcessChildren()){
Dispose();
};
}
public function get mChildren():Array{
return (mThings);
}
public function RemoveThing(_arg1){
_arg1.mParent = null;
mThings.splice(mThings.indexOf(_arg1), 1);
if (!mThings.length){
mThings = null;
};
return (_arg1);
}
override public function get _CLASSID_():String{
return ("CThingContainer");
}
public function AddKill(){
return ((mParent) ? mParent.AddKill() : this);
}
public function mChildrenCount():int{
return (mThings.length);
}
public function get mNumChildren():int{
return (mThings.length);
}
public function AddThing(_arg1){
_arg1.mParent = this;
if (mThings){
mThings.push(_arg1);
} else {
mThings = [_arg1];
};
return (_arg1);
}
public function ProcessChildren():Boolean{
var _local1:*;
if (!mThings){
return (false);
};
for each (_local1 in mThings.slice()) {
if (_local1.Process){
_local1.Process();
};
};
return (true);
}
override public function toString():String{
var _local1:String;
var _local2:*;
_local1 = super.toString();
if (mThings != null){
_local1 = (_local1 + (" Children:" + String(mNumChildren)));
_local1 = (_local1 + " mChildren:");
_local1 = (_local1 + (("\n" + INDENT) + "{"));
INDENT = (INDENT + String.fromCharCode(9));
for each (_local2 in mThings) {
_local1 = (_local1 + (("\n" + _local2.toString()) + " "));
};
INDENT = ((INDENT.length)<=1) ? "" : INDENT.substr(1);
_local1 = (_local1 + (("\n" + INDENT) + "}"));
};
return (_local1);
}
override public function Dispose():void{
var _local1:*;
if (mDisposed){
return;
};
if (mParent){
mParent.RemoveThing(this);
};
if (mThings){
for each (_local1 in mThings.slice()) {
_local1.Dispose();
};
};
super.Dispose();
}
}
}//package Thing
Section 138
//CThingControl (Thing.CThingControl)
package Thing {
import IO.*;
public class CThingControl extends CThingNavigation {
public var mControl:CPlayerControl;
public function ProcessControl():CPlayerControl{
mControl.Process();
return (mControl);
}
public function DeactivateControl():void{
mControl.Deactivate();
}
public function ActivateControl(_arg1:CPlayerControl):void{
(mControl = _arg1).Activate();
}
override public function get _CLASSID_():String{
return ("CThingControl");
}
}
}//package Thing
Section 139
//CThingDraw (Thing.CThingDraw)
package Thing {
import flash.display.*;
import flash.geom.*;
import STC9.Bitmap.*;
import Landscape.*;
import STC9.Sprite.*;
import Draw.*;
import flash.events.*;
import Game.*;
public class CThingDraw extends CThingAudio {
public var mSpriteXSIAnimation:CSpriteXSIAnimation;
public var mAnimationFrame:Number;
public var preRenderPosition:Point;
public var SetAnimation:Function;
public var rpFloor:Point;
public var mDrawScale:Number;
public var mGenFire:CGenFire;
public var mFloorZ:Number;
public var mGenSmoke:CGenSmoke;
public var mRenderPosition:Point;
public var GetFrameCount:Function;
public var mInvisible:Boolean;
public var mSpriteMCAnimation:CSpriteMCAnimation;
public var GetDirectionCount:Function;
public var mGenExplosion:CGenExplosion;
public var lAnimationFrame:Number;
public var mcDrawInfo:MovieClip;
public var mSortDepth:Number;
public var mSpriteMCOmni:CSpriteMCOmni;
public var ObjectRender:Function;
public var mXSI_AnimList:Object;
public var mAlpha:Number;
public static const defAnimSpeed:Number = 0.1;
public static var bmdPlane:CBitmapData;
public static var mSFXLayer:CLSEffects;
private static var mCacheList:Object;
private function ActivateGenFire(_arg1:String):Boolean{
var id = _arg1;
mGenFire = mCacheList[id][int((Math.random() * mCacheList[id].length))];
ObjectRender = function (){
mGenFire.Draw(bmdPlane, mRenderPosition.x, mRenderPosition.y, mAnimationFrame, mAlpha, mDrawScale);
};
GetFrameCount = function (){
return (mGenFire.mFrameCount);
};
GetDirectionCount = function ():int{
return (1);
};
SetAnimation = function ():Boolean{
return (true);
};
InitDefaults();
return (true);
}
public function MCOmniExists(_arg1:String):Boolean{
return ((idExists(_arg1, mCacheList)) ? ActivateMCOmni(_arg1) : false);
}
public function AddDrawDefault():void{
InitDefaults();
}
public function SpriteSheet_Render(){
mSpriteXSIAnimation.Draw(bmdPlane, mRenderPosition.x, mRenderPosition.y, mAngle.mAngle256, mAnimationFrame, mAlpha);
}
public function MCOmni_Render(){
mSpriteMCOmni.Draw(bmdPlane, mRenderPosition.x, mRenderPosition.y, mAngle.mAngle256, mAlpha);
}
private function ActivateGenSmoke(_arg1:String):Boolean{
var id = _arg1;
mGenSmoke = mCacheList[id][int((Math.random() * mCacheList[id].length))];
ObjectRender = function (){
mGenSmoke.Draw(bmdPlane, mRenderPosition.x, mRenderPosition.y, mAnimationFrame, mAlpha, mDrawScale);
};
GetFrameCount = function (){
return (mGenSmoke.mFrameCount);
};
GetDirectionCount = function ():int{
return (1);
};
SetAnimation = function ():Boolean{
return (true);
};
InitDefaults();
return (true);
}
public function SpriteSheet_SetAnimation(_arg1:String):Boolean{
if (mXSI_AnimList[_arg1] == mSpriteXSIAnimation){
return (true);
};
if (mXSI_AnimList[_arg1] == null){
return (false);
};
mSpriteXSIAnimation = mXSI_AnimList[_arg1];
mAnimationFrame = 0;
return (true);
}
private function idExists(_arg1:String, _arg2:Object):Boolean{
if (_arg2){
if (_arg2[_arg1]){
return (true);
};
};
return (false);
}
public function AddSpriteSheet(_arg1:String, _arg2:BitmapData, _arg3:Boolean=false):void{
var _local4:Object;
_local4 = CSpriteXSIAnimation.asSpriteSheet(CSpriteSheet.AsBitmapData(_arg2), _arg3);
mCacheList = (mCacheList) ? mCacheList : new Object();
mCacheList[_arg1] = _local4;
ActivateSpriteSheet(_arg1);
_arg2.dispose();
}
public function AnimateEnd(_arg1:Number=0.1):Boolean{
mAnimationFrame = (mAnimationFrame + _arg1);
if (mAnimationFrame >= 1){
mAnimationFrame = 0.99;
return (true);
};
return (false);
}
private function ActivateGenExplosion(_arg1:String):Boolean{
var id = _arg1;
mGenExplosion = mCacheList[id][int((Math.random() * mCacheList[id].length))];
ObjectRender = function (){
mGenExplosion.Draw(bmdPlane, mRenderPosition.x, mRenderPosition.y, mAnimationFrame, mAlpha, mDrawScale);
};
GetFrameCount = function (){
return (mGenExplosion.mFrameCount);
};
GetDirectionCount = function ():int{
return (1);
};
SetAnimation = function ():Boolean{
return (true);
};
InitDefaults();
return (true);
}
public function AddMCAnimation(_arg1:String, _arg2:MovieClip):void{
var _local3:CSpriteMCAnimation;
_local3 = new CSpriteMCAnimation(_arg2);
mCacheList = (mCacheList) ? mCacheList : new Object();
mCacheList[_arg1] = _local3;
ActivateMCAnimation(_arg1);
}
public function SpriteSheet_GetModelOffset(_arg1:String):CThingV3{
var _local2:Object;
_local2 = mSpriteXSIAnimation.GetData(mAngle.mAngle256, mAnimationFrame).mModelInfo[_arg1];
return ((_local2) ? _local2.mPosition : null);
}
public function SpriteSheetExists(_arg1:String):Boolean{
return ((idExists(_arg1, mCacheList)) ? ActivateSpriteSheet(_arg1) : false);
}
public function GenSmokeExists(_arg1:String):Boolean{
return ((idExists(_arg1, mCacheList)) ? ActivateGenSmoke(_arg1) : false);
}
public function SpriteSheet_GetModelInfo():Object{
return (mSpriteXSIAnimation.GetData(mAngle.mAngle256, mAnimationFrame).mModelInfo);
}
public function GenFireExists(_arg1:String):Boolean{
return ((idExists(_arg1, mCacheList)) ? ActivateGenFire(_arg1) : false);
}
public function MCAnimationExists(_arg1:String):Boolean{
return ((idExists(_arg1, mCacheList)) ? ActivateMCAnimation(_arg1) : false);
}
public function MCAnimation_Render(){
mSpriteMCAnimation.Draw(bmdPlane, mRenderPosition.x, mRenderPosition.y, mAnimationFrame, mAlpha, mDrawScale);
}
public function GenExplosionExists(_arg1:String):Boolean{
return ((idExists(_arg1, mCacheList)) ? ActivateGenExplosion(_arg1) : false);
}
public function AddGenSmoke(_arg1:String, _arg2:Array, _arg3:Number=0.9):void{
var _local4:int;
mCacheList = (mCacheList) ? mCacheList : new Object();
mCacheList[_arg1] = new Array();
_local4 = 2;
while (_local4) {
mCacheList[_arg1].push(new CGenSmoke(_arg2, _arg3, 7));
_local4--;
};
ActivateGenSmoke(_arg1);
}
public function AddMCOmni(_arg1:String, _arg2:MovieClip, _arg3:int, _arg4:Number=0):void{
var _local5:CSpriteMCOmni;
_local5 = new CSpriteMCOmni(_arg2, _arg3, _arg4);
mCacheList = (mCacheList) ? mCacheList : new Object();
mCacheList[_arg1] = _local5;
ActivateMCOmni(_arg1);
}
private function InitDefaults():void{
mAnimationFrame = 0;
mAlpha = (isNaN(mAlpha)) ? 1 : mAlpha;
mDrawScale = (isNaN(mDrawScale)) ? 1 : mDrawScale;
mRenderPosition = new Point();
}
override public function get _CLASSID_():String{
return ("CThingDraw");
}
private function ActivateSpriteSheet(_arg1:String):Boolean{
var id = _arg1;
mXSI_AnimList = mCacheList[id];
ObjectRender = SpriteSheet_Render;
GetFrameCount = function ():int{
return (mSpriteXSIAnimation.mFrameCount);
};
GetDirectionCount = function ():int{
return (mSpriteXSIAnimation.mDirectionAmount);
};
SetAnimation = SpriteSheet_SetAnimation;
InitDefaults();
return (true);
}
private function ActivateMCOmni(_arg1:String):Boolean{
var id = _arg1;
mSpriteMCOmni = mCacheList[id];
ObjectRender = MCOmni_Render;
GetFrameCount = function (){
return (1);
};
GetDirectionCount = function ():int{
return (mSpriteMCOmni.mDirectionAmount);
};
InitDefaults();
return (true);
}
public function Render():void{
ObjectRender();
mDrawn = true;
}
public function Animate(_arg1:Number=0.1):void{
mAnimationFrame = (mAnimationFrame + _arg1);
}
public function ProjectionXYZ(_arg1:Number, _arg2:Number, _arg3:Number=0):Point{
return (CLSDraw.ProjectionXYZ(_arg1, _arg2, _arg3));
}
public function AddGenExplosion(_arg1:String, _arg2:Number=0.9):void{
var _local3:int;
mCacheList = (mCacheList) ? mCacheList : new Object();
mCacheList[_arg1] = new Array();
_local3 = 4;
while (_local3) {
mCacheList[_arg1].push(new CGenExplosion([Explosion_0001], _arg2, 5));
_local3--;
};
ActivateGenExplosion(_arg1);
}
private function ActivateMCAnimation(_arg1:String):Boolean{
var id = _arg1;
mSpriteMCAnimation = mCacheList[id];
ObjectRender = MCAnimation_Render;
GetFrameCount = function (){
return (mSpriteMCAnimation.mFrameCount);
};
GetDirectionCount = function ():int{
return (1);
};
SetAnimation = function ():Boolean{
return (true);
};
InitDefaults();
return (true);
}
public function AddGenFire(_arg1:String, _arg2:Number=0.75):void{
var _local3:int;
mCacheList = (mCacheList) ? mCacheList : new Object();
mCacheList[_arg1] = new Array();
_local3 = 4;
while (_local3) {
mCacheList[_arg1].push(new CGenFire([Fire_0001], _arg2, 4));
_local3--;
};
ActivateGenFire(_arg1);
}
}
}//package Thing
Section 140
//CThingEffect (Thing.CThingEffect)
package Thing {
public class CThingEffect extends CThingCollision {
public function CThingEffect(_arg1):void{
mAffectFlags = eAffectType.NONE;
mSeed = nID;
Inherit(_arg1);
}
override public function get _CLASSID_():String{
return ("CThingEffect");
}
}
}//package Thing
Section 141
//CThingMain (Thing.CThingMain)
package Thing {
import flash.geom.*;
import flash.events.*;
import Game.*;
public class CThingMain extends CThingAffect {
public var mThingsByType:Object;
public var mThingCounters:Object;
public function CThingMain(){
mSeed = nID;
mThingCounters = new Object();
mThingsByType = new Object();
}
override public function RemoveThing(_arg1){
mThingsByType[_arg1.mThingType].splice(mThingsByType[_arg1.mThingType].indexOf(_arg1), 1);
return (super.RemoveThing(_arg1));
}
override public function AddThing(_arg1){
if (mThingsByType[_arg1.mThingType]){
mThingsByType[_arg1.mThingType].push(_arg1);
} else {
mThingsByType[_arg1.mThingType] = [_arg1];
};
return (super.AddThing(_arg1));
}
override public function ProcessChildren():Boolean{
var _local1:String;
var _local2:*;
if (!mThings){
return (false);
};
for (_local1 in mThingsByType) {
for each (_local2 in mThingsByType[_local1]) {
if (_local2.Process){
_local2.Process();
};
};
};
return (true);
}
override public function get _CLASSID_():String{
return ("CThingMain");
}
}
}//package Thing
Section 142
//CThingMap (Thing.CThingMap)
package Thing {
import flash.geom.*;
import Landscape.*;
import World.*;
import flash.events.*;
public class CThingMap extends CThingDraw {
public var mCellCurrent:CWMCell;
private var mCollideCell:CWMCell;
public var mNavRange:int;
private var mCollideFlags:int;
public static var mThingContainer:CThingContainer;
private static var _World:CWorld;
public static var mLandscape:CLandscape;
public static var mMap:CWorldMap;
public function GetAltitudeXY(_arg1:int, _arg2:int):Number{
return (mLandscape.GetAltitudeAt(_arg1, _arg2));
}
public function DistanceToCell(_arg1:CWMCell):Number{
var _local2:Number;
var _local3:Number;
_local2 = ((_arg1.mapX + 0.5) - mPosition.x);
_local3 = ((_arg1.mapY + 0.5) - mPosition.y);
return (Math.sqrt(((_local3 * _local3) + (_local2 * _local2))));
}
public function GetAltitude():Number{
return (mLandscape.GetAltitudeAt(mPosition.x, mPosition.y));
}
public function MapMove():Boolean{
if ((((mCellCurrent.mapX == int(mPosition.x))) && ((mCellCurrent.mapY == int(mPosition.y))))){
return (false);
};
mCellCurrent.RemoveThing(this);
MapAdd();
return (true);
}
public function RenderPosition(_arg1:CThingV3):Point{
return (mLandscape.mLSThingDraw.RenderPosition(_arg1));
}
public function NavMapRemove():void{
mMap.NavMapRemove(this);
}
public function GetRandomInitCell(_arg1:int=0xFFFF):CWMCell{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:CWMCell;
_local2 = 100;
while (_local2) {
_local3 = RandomInt(mMap.mWidth);
_local4 = RandomInt(mMap.mHeight);
_local5 = mMap.QGetCellAt(_local3, _local4);
if ((_local5.mCollide & _arg1) == 0){
return (_local5);
};
_local2--;
};
return (null);
}
public function DrawScorch():void{
mLandscape.mLSDraw.DrawScorch(mPosition.x, mPosition.y);
}
override public function toString():String{
var _local1:String;
_local1 = super.toString();
_local1 = (_local1 + (" mCollideFlags:" + String(mCollideFlags)));
return (_local1);
}
public function GetThingsRadius(_arg1:int=16775167, _arg2:int=1, _arg3:CThingV3=null):Array{
var _local4:Array;
var _local5:CThingV3;
var _local6:CThingAffect;
_local4 = new Array();
_local5 = (_arg3) ? mPosition.Clone().Add(_arg3) : mPosition;
for each (_local6 in mMap.GetThingsRadius(_local5.x, _local5.y, mCollideRadius)) {
if ((_arg1 & _local6.mAffectFlags) == 0){
} else {
if (_local6.mCollideID == mCollideID){
} else {
if (_local5.Distance2D(_local6.mPosition) <= (_local6.mCollideRadius + mCollideRadius)){
_local4.push(_local6);
if (_local4.length >= _arg2){
break;
};
};
};
};
};
return (_local4);
}
public function NavMapAdd(_arg1:int=10000):void{
this.mNavRange = _arg1;
mMap.NavMapAdd(this);
}
public function SetPosition(_arg1:Number, _arg2:Number, _arg3:Number=0):void{
mPosition = new CThingV3(_arg1, _arg2, _arg3);
}
public function SetCollide(_arg1:CWMCell, _arg2:uint):void{
if (mCollideCell){
ClearCollide();
};
mCollideFlags = _arg2;
mCollideCell = _arg1;
mCollideCell.mCollide = (mCollideCell.mCollide | mCollideFlags);
}
override public function get _CLASSID_():String{
return ("CThingMap");
}
public function SetPositionByInitObject(_arg1:Object):void{
var _local2:CWMCell;
if (_arg1.mPosition){
SetPosition(_arg1.mPosition.x, _arg1.mPosition.y);
} else {
if (_arg1.mInitCell){
SetPosition((_arg1.mInitCell.mapX + 0.5), (_arg1.mInitCell.mapY + 0.5));
} else {
_local2 = GetRandomInitCell();
if (!_local2){
return;
};
SetPosition((_local2.mapX + 0.5), (_local2.mapY + 0.5));
};
};
}
public function MapAdd():void{
mCellCurrent = mMap.AddThing(this);
mMoved = true;
}
public function GetThingsLine(_arg1:CThingV3, _arg2:Number=0, _arg3:int=16775167, _arg4:int=1):Object{
return (mMap.GetThingsLine(this.mCollideID, mPosition.toPoint, _arg1.toPoint, _arg2, _arg3, _arg4));
}
public function MapRemove():void{
mCellCurrent.RemoveThing(this);
mCellCurrent = null;
}
public function ClearCollide():void{
if (mCollideCell){
mCollideCell.mCollide = (mCollideCell.mCollide & ~(mCollideFlags));
mCollideCell = null;
};
}
public function GetThingsAngle(_arg1:Number, _arg2:Number=0, _arg3:int=16775167, _arg4:int=1):Object{
var _local5:Point;
var _local6:Point;
var _local7:Point;
_local5 = mPosition.toPoint;
_local6 = mAngle.pDelta;
_local6.normalize(_arg1);
_local7 = _local5.add(_local6);
return (mMap.GetThingsLine(this.mCollideID, _local5, _local7, _arg2, _arg3, _arg4));
}
public function DrawBlood():void{
mLandscape.mLSDraw.DrawBloodMulti(mPosition.x, mPosition.y);
}
override public function Dispose():void{
if (mDisposed){
return;
};
if (mCollideCell){
ClearCollide();
};
if (mCellCurrent){
MapRemove();
};
super.Dispose();
}
public static function get mWorld():CWorld{
return (_World);
}
public static function set mWorld(_arg1:CWorld):void{
_World = _arg1;
mMap = _World.mMap;
mThingContainer = _World.mThingContainer;
}
}
}//package Thing
Section 143
//CThingMath (Thing.CThingMath)
package Thing {
public class CThingMath extends CThingContainer {
private var _Seed:uint;
private static const MULTIPLIER:uint = 16807;
public static const SQRT2:Number = 1.4142135623731;
private static const dMODULUS:Number = 4.6566128752458E-10;
private static const MODULUS:uint = 2147483647;
public static const SQRT1_2:Number = 0.707106781186548;
public function Sign(_arg1):Number{
return (((_arg1)<0) ? -1 : ((_arg1)>0) ? 1 : 0);
}
public function set mSeed(_arg1:uint):void{
_Seed = _arg1;
}
public function RandomSignOrZero():int{
return ((int((Random() * 3)) - 1));
}
override public function get _CLASSID_():String{
return ("CThingMath");
}
public function RandomInt(_arg1:uint):uint{
return ((mSeed % _arg1));
}
public function RandomSign():int{
return (((int((Random() * 2)) * 2) - 1));
}
public function RandomOffset(_arg1:Number):Number{
return ((((Random() * 2) * _arg1) - _arg1));
}
public function Random():Number{
return ((mSeed * dMODULUS));
}
public function RandomOffsetAndAdd(_arg1:Number, _arg2:Number):Number{
_arg1 = RandomOffset(_arg1);
return (((_arg1)<0) ? (_arg1 - _arg2) : (_arg1 + _arg2));
}
public function get mSeed():uint{
return ((_Seed = ((_Seed * MULTIPLIER) % MODULUS)));
}
}
}//package Thing
Section 144
//CThingMove (Thing.CThingMove)
package Thing {
import World.*;
public class CThingMove extends CThingAffect {
public var mAngleDelta:CThingAngle;
public var mDelta:CThingV3;
public var mAngleTarget:CThingAngle;
public var mSpeedScale:Number;
public var mSpeed:Number;
public var mCellTarget:CWMCell;
override public function get _CLASSID_():String{
return ("CThingMove");
}
}
}//package Thing
Section 145
//CThingNavigation (Thing.CThingNavigation)
package Thing {
import World.*;
public class CThingNavigation extends CThingCollision {
private static const nDirStack:Array = [0, -1, 1, -2, 2, -3, 3, 4];
private static const pDirStack:Array = [0, 1, -1, 2, -2, 3, -3, 4];
public function Peep_Navigate_NM():CThingAngle{
var _local1:CWMCNavigation;
if (CThing.VERBOSE == true){
};
_local1 = mCellCurrent.MovableNeighbours8_1(mAngle.mDirectionName);
return ((_local1) ? CThingAngle.AsXY((_local1.mapX - mCellCurrent.mapX), (_local1.mapY - mCellCurrent.mapY)) : null);
}
override public function get _CLASSID_():String{
return ("CThingNavigation");
}
}
}//package Thing
Section 146
//CThingObject (Thing.CThingObject)
package Thing {
import flash.geom.*;
import World.*;
import flash.events.*;
public class CThingObject extends CThingStatic {
public function CThingObject(_arg1:Object, _arg2=null){
Inherit(_arg2);
mSeed = nID;
mAngle = new CThingAngle();
mAngle.mAngle256 = RandomInt(0x0100);
SetPositionByInitObject(_arg1);
mCollideRadius = (_arg1.mCollideRadius) ? _arg1.mCollideRadius : 0.5;
mCollideHeight = (mCollideRadius * 2);
mAffectFlags = ((((eAffectType.EXPLOSION | eAffectType.BULLET) | eAffectType.ZOMBIEATTACK) | eAffectType.VAPOURIZE) | eAffectType.FIRE);
MapAdd();
Process = Process_Normal;
}
public function ApplyAffects():Boolean{
var _local1:CAffect;
if (mAffects){
for each (_local1 in mAffects) {
var _local4 = this;
_local4[("Affect_" + _local1.mName)](_local1);
};
mAffects = null;
if (mDead){
mAffectFlags = 0;
Process = Process_Dispose;
Destroyed();
ClearCollide();
MapRemove();
return (true);
};
};
return (false);
}
public function Process_Normal():void{
if (ApplyAffects()){
return;
};
if (mStateID){
var _local1 = this;
_local1[mStateID]();
};
ProcessChildren();
}
override public function get _CLASSID_():String{
return ("CThingObject");
}
public function Destroyed():void{
AddThing(new CDestroySmoke(this, new CThingV3(0, 0, (mCollideHeight / 2))));
}
}
}//package Thing
Section 147
//CThingPeep (Thing.CThingPeep)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
import Game.*;
public class CThingPeep extends CThingControl {
public const mColor:uint = 4278190080;
public var mDrawBloodOnAffect:Boolean;
public var mDeathClock:int;
public var mAffectThreshold:Number;
public var mInvalid:Boolean;
public var mMass:Number;
public var fCollide:Function;
public var mAttackScale:Number;
public var mAttackCounter:int;
private static const mProcessCount:int = 16;
private static var mAllocateProcessID:int = 0;
public static var mXSIList:Object;
public static var mOmniSprite:CSpriteMCOmni;
public static var mSpriteMCAnimation:CSpriteMCAnimation;
public function CThingPeep(_arg1:Object, _arg2:Class){
nProcessID = ++mAllocateProcessID;
mSeed = nID;
mAngle = new CThingAngle();
mAngleTarget = new CThingAngle();
mCollideRadius = 0.35;
mCollideHeight = ((1400 / 500) * mCollideRadius);
mSpeedScale = (_arg1.mSpeedScale) ? _arg1.mSpeedScale : 1;
mAttackScale = (_arg1.mAttackScale) ? _arg1.mAttackScale : 1;
mMass = 1;
mAffectThreshold = 1;
mAffectFlags = ((((((eAffectType.ZOMBIEATTACK | eAffectType.EXPLOSION) | eAffectType.BULLET) | eAffectType.VAPOURIZE) | eAffectType.HIT) | eAffectType.FIRE) | eAffectType.PUSH);
mAffectFlags = (mAffectFlags | (eAffectType.FILTER_SOLID | eAffectType.FILTER_PEEP));
AddSound("PEEP_HITFLOOR", Peep_HitFloor, ((_CLASSID_)=="CBambo") ? 0 : 3, 1);
SetPositionByInitObject(_arg1);
MapAdd();
Process = Process_Normal;
mAttackCounter = 0;
mDeathClock = (1.5 * SECONDS);
fCollide = PeepCollide;
if (!SpriteSheetExists(_CLASSID_)){
AddSpriteSheet(_CLASSID_, new _arg2(0, 0));
};
}
override public function Dispose():void{
if (OnDispose != null){
OnDispose(this);
};
super.Dispose();
}
public function State_NAVIGATE_Enter():void{
SetBaseState();
}
public function State_STAND_Enter():void{
SetAnimation("stand");
}
public function State_PUSH():void{
mPosition = PeepCollide();
MapMove();
if (--mStateCount < 0){
if ((((mCellCurrent.mCollide & eWMCCollideType.INVALIDANDIE)) && (!(mDead)))){
mLife = -1;
};
if (!CheckForDeath()){
ReturnState_Base();
};
return;
};
Animate();
}
public function State_DYING_Enter():void{
ClearCollide();
mAffectFlags = 0;
switch (RandomInt(3)){
case 0:
SetAnimation("dying");
break;
case 1:
if (SetAnimation("dying_2") == false){
SetAnimation("dying");
};
break;
case 2:
if (SetAnimation("dying_3") == false){
SetAnimation("dying");
};
break;
};
mStateCount = 0;
Process = Process_Dead;
}
public function CheckForDeath():Boolean{
if (mDead){
if (OnDeath != null){
OnDeath(this);
};
SetState("State_DYING");
return (true);
};
return (false);
}
override public function AnimateEnd(_arg1:Number=0.1):Boolean{
return (super.AnimateEnd((_arg1 * mSpeedScale)));
}
public function State_STAND():void{
}
override public function Affect_EXPLOSION(_arg1:CAffect):void{
var _local2:CThingV3;
var _local3:Number;
var _local4:Number;
_local2 = mPosition.Clone().Sub(_arg1.mAffector.mPosition);
_local2.z = 0;
_local3 = (_arg1.mAffector.mCollideRadius + 0.5);
_local4 = Math.max(0.25, Math.min(1, ((_local3 - _local2.mLength) / _local3)));
_local2.Normalize(((_local4 * _arg1.mForce) * mMass));
mLife = (mLife - (_arg1.mDamage * _local4));
AffectedAndDead(_arg1);
if (mLife < (mMaxLife * mAffectThreshold)){
mDelta = _local2;
mAngle.mAngleRAD = (mDelta.mAngleRAD + Math.PI);
SetState("State_HIT", mStateID);
};
}
override public function toString():String{
var _local1:String;
_local1 = super.toString();
return (((((((((((((((_local1 + " mAffectFlags:") + mAffectFlags) + " mPositon:") + mPosition) + " mState:") + mStateID) + " mBaseStateID:") + mBaseStateID) + " mReturnStateID:") + mReturnStateID) + " mStateCount:") + String(mStateCount)) + " mLife:") + String(mLife)));
}
public function Process_Dead(){
if (mStateID){
var _local1 = this;
_local1[mStateID]();
};
ProcessChildren();
mDrawn = false;
}
public function State_WAITTOMOVE_Exit():void{
}
public function State_WAIT():void{
if (--mStateCount < 0){
ReturnState();
};
}
public function State_HIT_Exit():void{
}
public function State_HIT():void{
mPosition = fCollide();
MapMove();
mDelta.ScaleN(0.45);
if (mDelta.mLength2D < 0.1){
if ((((mCellCurrent.mCollide & eWMCCollideType.INVALIDANDIE)) && (!(mDead)))){
mLife = -1;
};
if (!CheckForDeath()){
SetState("State_WAIT", mBaseStateID);
mStateCount = (5 * mMass);
};
return;
};
DrawBlood();
AnimateEnd();
}
public function State_STAND_Exit():void{
}
override public function Affect_ZOMBIEATTACK(_arg1:CAffect):void{
Affect_BULLET(_arg1);
}
public function State_HIT_Enter():void{
ClearCollide();
if (!mDrawn){
if (!CheckForDeath()){
SetState("State_WAIT", mBaseStateID);
};
return;
};
SetAnimation("hit");
}
override public function Animate(_arg1:Number=0.1):void{
super.Animate((_arg1 * mSpeedScale));
}
public function ApplyAffects():Boolean{
var _local1:CAffect;
if (mAffects){
for each (_local1 in mAffects) {
if (!mDead){
var _local4 = this;
_local4[("Affect_" + _local1.mName)](_local1);
};
};
mAffects = null;
return (true);
};
return (false);
}
public function get mCanProcess():Boolean{
return (true);
}
public function State_CELLTOCELL():void{
mPosition.x = (mPosition.x + mDelta.x);
mPosition.y = (mPosition.y + mDelta.y);
if (mDrawn){
MapMove();
Animate();
};
if (--mStateCount < 0){
ReturnState_Base();
};
}
public function State_CELLTOCELL_Enter():void{
if (mAngleTarget.mDirection != mAngle.mDirection){
SetState("State_TURN", mStateID);
return;
};
mCellTarget = mCellCurrent.mNeighbours[mAngle.mDirectionName];
if ((mCellTarget.mCollide & eWMCCollideType.NONMOVABLE)){
SetState("State_WAIT", mBaseStateID);
mStateCount = (SECONDS * 2);
return;
};
ClearCollide();
SetCollide(mCellTarget, eWMCCollideType.PEEP);
mDelta = mAngle.mDelta;
mDelta.Add(mPosition.mCentre.Sub(mPosition));
mStateCount = ((1 / (mSpeed * mSpeedScale)) * ((mAngleTarget.mDirection & 1)) ? SQRT2 : 1);
mDelta.ScaleN((mSpeed * mSpeedScale));
SetAnimation("walk");
}
public function Brain():Boolean{
return (false);
}
public function Process_Normal(){
ApplyAffects();
if (mStateID){
var _local1 = this;
_local1[mStateID]();
};
ProcessChildren();
if (mAttackCounter > 0){
mAttackCounter--;
};
if (((mInvalid) && (!(mDead)))){
mLife = -1;
CheckForDeath();
};
if (mDead){
SetState("State_DYING");
};
mDrawn = false;
}
override public function Affect_FIRE(_arg1:CAffect):void{
Affect_BULLET(_arg1);
}
public function State_PUSH_Exit():void{
}
public function State_TURN_Enter():void{
mAngleDelta = mAngle.TurnAngle(mAngleTarget);
mStateCount = mAngleDelta.GetTurnCount(CThingAngle.AsAngle256((128 * (mSpeed * mSpeedScale))));
mAngleDelta.Scale((1 / mStateCount));
SetAnimation("stand");
}
public function State_WAITTOMOVE():void{
if (--mStateCount < 0){
ReturnState();
};
}
override public function MapMove():Boolean{
var _local1:Boolean;
_local1 = super.MapMove();
if (_local1){
if ((mCellCurrent.mCollide & eWMCCollideType.INVALIDANDIE)){
mInvalid = true;
};
};
return (_local1);
}
override public function get mThingType():String{
return ("PEEP");
}
override public function Affect_HIT(_arg1:CAffect):void{
Affect_BULLET(_arg1);
}
public function State_CELLTOCELL_Exit():void{
MapMove();
}
public function State_DEAD():void{
mStateCount--;
if (mStateCount < 0){
Dispose();
} else {
if (mStateCount < 10){
mAlpha = (mStateCount / 10);
};
};
}
override public function Affect_BULLET(_arg1:CAffect):void{
var _local2:CThingV3;
mLife = (mLife - _arg1.mDamage);
AffectedAndDead(_arg1);
if (mLife < (mMaxLife * mAffectThreshold)){
_local2 = mPosition.Clone().Sub(_arg1.mAffector.mPosition);
_local2.Normalize((_arg1.mForce * mMass));
mAngle.mAngleRAD = (_local2.mAngleRAD + Math.PI);
mDelta = _local2;
SetState("State_HIT", mStateID);
};
}
public function State_WAIT_Exit():void{
}
public function State_TURN_Exit():void{
}
public function QProcess_Normal(){
ApplyAffects();
if (mStateID){
var _local1 = this;
_local1[mStateID]();
};
}
public function State_NAVIGATE():void{
if ((mAngleTarget = Peep_Navigate_NM()) == null){
SetState("State_WAIT", mBaseStateID);
mStateCount = (SECONDS * 2);
return;
};
SetState("State_CELLTOCELL");
}
public function State_WAITTOMOVE_Enter():void{
SetAnimation("stand");
}
public function State_TURN():void{
mAngle.Add(mAngleDelta);
if (--mStateCount < 0){
mAngle = mAngleTarget;
ReturnState();
};
}
private function AffectedAndDead(_arg1:CAffect):void{
if (mDead){
mKilledBy = _arg1.mAffector.AddKill();
if (!mKilledBy){
};
};
}
override public function get _CLASSID_():String{
return ("CThingPeep");
}
public function State_DEAD_Enter():void{
SetBaseState();
mStateCount = mDeathClock;
DrawBlood();
}
public function State_DYING_Exit():void{
}
public function State_DYING():void{
if (++mStateCount > 3){
if (AnimateEnd((1 / 7))){
PlaySound("PEEP_HITFLOOR");
SetState("State_DEAD");
};
};
}
public function get m_CLASSID_():String{
return ("CThingPeep");
}
public function State_PUSH_Enter():void{
ClearCollide();
if (!mDrawn){
if (!CheckForDeath()){
SetState("State_WAIT", mBaseStateID);
};
return;
};
SetAnimation("walk");
mStateCount = 2;
}
override public function Affect_PUSH(_arg1:CAffect):void{
mDelta = new CThingV3();
mAngle.mAngleRAD = (mPosition.Clone().Sub(_arg1.mAffector.mPosition).mAngleRAD + Math.PI);
SetState("State_PUSH", mStateID);
mDrawBloodOnAffect = false;
}
public function State_DEAD_Exit():void{
}
public function State_WAIT_Enter():void{
SetAnimation("stand");
}
public function State_NAVIGATE_Exit():void{
}
public static function Restart():void{
mAllocateProcessID = 0;
}
}
}//package Thing
Section 148
//CThingPickup (Thing.CThingPickup)
package Thing {
import flash.geom.*;
import Landscape.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CThingPickup extends CThingObject {
private var mPickupCounter:int;
public function CThingPickup(_arg1:Object, _arg2:Class){
_arg1 = (_arg1) ? _arg1 : new Object();
_arg1.mCollideRadius = 0.5;
_arg1.mCollideHeight = 0.5;
_arg1.mInitState = "State_STAND";
super(_arg1);
if (!SpriteSheetExists(_CLASSID_)){
AddSpriteSheet(_CLASSID_, new _arg2(0, 0));
};
SetAnimation("stand");
mPickupCounter = (SECONDS * 15);
mAffectFlags = eAffectType.FILTER_PICKUP;
}
public function Pickup(_arg1):void{
PlaySound("Pickup");
Dispose();
}
override public function Process_Normal():void{
mPickupCounter--;
if (mPickupCounter < SECONDS){
mAlpha = (mPickupCounter / SECONDS);
};
if (mPickupCounter < 0){
Dispose();
};
}
override public function get _CLASSID_():String{
return ("CThingPickup");
}
}
}//package Thing
Section 149
//CThingShot (Thing.CThingShot)
package Thing {
public class CThingShot extends CThingCollision {
public var mShotDestination:CThingV3;
public function CThingShot(_arg1, _arg2:CAffect=null){
mAffectFlags = eAffectType.NONE;
mSeed = nID;
mAffect = _arg2;
Inherit(_arg1);
}
override public function get _CLASSID_():String{
return ("CThingShot");
}
}
}//package Thing
Section 150
//CThingState (Thing.CThingState)
package Thing {
public class CThingState extends CThingMath {
public var mReturnStateID:String;
public var mStateID:String;
public var mStateCount:int;
public var mBaseStateID:String;
public static var STATEEXIT:String = "stateexit";
public static var STATEENTER:String = "stateenter";
public function ReturnState():Boolean{
var _local1:String;
if (mReturnStateID == null){
return (!(ReturnState_Base()));
};
_local1 = mReturnStateID;
mReturnStateID = null;
return (SetState(_local1));
}
override public function get _CLASSID_():String{
return ("CThingState");
}
public function SetBaseState(_arg1:String=""):void{
mBaseStateID = ((_arg1)=="") ? mStateID : _arg1;
}
public function ReturnState_Base():Boolean{
if (mBaseStateID){
SetState(mBaseStateID);
return (true);
};
return (false);
}
public function SetState(_arg1:String, _arg2:String=null):Boolean{
if (mStateID == _arg1){
return (false);
};
if (mStateID){
var _local3 = this;
_local3[(mStateID + "_Exit")]();
};
if (_arg2 != null){
mReturnStateID = _arg2;
};
mStateID = _arg1;
_local3 = this;
_local3[(mStateID + "_Enter")]();
return (true);
}
}
}//package Thing
Section 151
//CThingStatic (Thing.CThingStatic)
package Thing {
import World.*;
public class CThingStatic extends CThingAffect {
private var mGrowCollideRadius:Number;
public function State_STAND_Enter():void{
}
public function State_STAND():void{
}
public function State_GROWRADIUS_Enter():void{
SetAnimation("stand");
mGrowCollideRadius = mCollideRadius;
mCollideRadius = 0;
mAffectFlags = (mAffectFlags & ~(eAffectType.FILTER_SOLID));
}
public function State_STAND_Exit():void{
}
public function State_GROWRADIUS():void{
if ((mCellCurrent.mCollide & eWMCCollideType.PLAYER)){
return;
};
if (GrowRadius(mGrowCollideRadius)){
mCollideRadius = mGrowCollideRadius;
mAffectFlags = (mAffectFlags | eAffectType.FILTER_SOLID);
if (!ReturnState()){
SetState("State_STAND");
};
};
}
public function State_GROWRADIUS_Exit():void{
}
override public function get _CLASSID_():String{
return ("CThingStatic");
}
}
}//package Thing
Section 152
//CThingTurret (Thing.CThingTurret)
package Thing {
import flash.geom.*;
import Landscape.*;
import World.*;
import flash.events.*;
import STC9.System.Profiler.*;
import Game.*;
import flash.text.*;
public class CThingTurret extends CThingWeapon {
public const mRicochetAmount:int = 3;
private var mSearchQuadrants_Monitor:Object;
private var mAngleDelta:CThingAngle;
public var mTargetRange:Number;
private var mAngleTarget:CThingAngle;
private var mMinRange:int;
private var mTurretTarget:CThingPeep;
private var mMaxRange:int;
public var mTurnSpeed:CThingAngle;
private var mAddCellIndex:Object;
private var mSearchCells:Array;
private static var mAllocateProcessID:int = 0;
public function CThingTurret(_arg1:Object, _arg2=null, _arg3=null):void{
super(_arg2);
nProcessID = ++mAllocateProcessID;
mSeed = nID;
mAngle = new CThingAngle();
mAngle.mAngle256 = RandomInt(0x0100);
SetPositionByInitObject(_arg1);
mCollideRadius = (_arg1.mCollideRadius) ? _arg1.mCollideRadius : 0.5;
mCollideHeight = (mCollideRadius * 2);
mAffectFlags = (((((eAffectType.ZOMBIEATTACK | eAffectType.EXPLOSION) | eAffectType.BULLET) | eAffectType.VAPOURIZE) | eAffectType.HIT) | eAffectType.FIRE);
mAffectFlags = (mAffectFlags | (eAffectType.FILTER_SOLID | eAffectType.FILTER_PEEP));
if (_arg3){
mFireRate = _arg3.mTurretFireRate;
mAutoFire = false;
mTotalAmmo = (mAmmo = _arg3.mTurretAmmo);
mRange = _arg3.mRange;
};
MapAdd();
Process = Process_Normal;
mAudioMaterial = "METAL";
NavMapAdd();
mAngleTarget = new CThingAngle();
mTurnSpeed = CThingAngle.AsAngle256(2);
if (mOwner){
mcDrawInfo = new HUD_Turret();
mcDrawInfo.y = 0;
mcDrawInfo.mcAmmo.tfInfo.autoSize = TextFieldAutoSize.CENTER;
};
mFireAction = "fired";
}
override public function Dispose():void{
var _local1:CWMCell;
for each (_local1 in mSearchCells) {
_local1.RemoveMonitor(mID);
};
super.Dispose();
}
override public function Fire():void{
super.Fire();
if (mAmmo <= 0){
Destroyed();
};
}
public function State_SEARCH_Enter():void{
SetBaseState();
mFire = false;
}
public function State_IDLE_Exit():void{
}
public function State_SEARCH_Exit():void{
}
public function ApplyAffects():Boolean{
var _local1:CAffect;
if (mAffects){
for each (_local1 in mAffects) {
var _local4 = this;
_local4[("Affect_" + _local1.mName)](_local1);
};
mAffects = null;
if (mDead){
return (Destroyed());
};
};
return (false);
}
public function State_IDLE():void{
if (--mStateCount < 0){
SetState("State_SEARCH");
};
}
override public function Affect_FIRE(_arg1:CAffect):void{
mLife = (mLife - (_arg1.mDamage / 8));
}
public function SetupRange(_arg1:Number, _arg2:Number):void{
var _local3:Point;
var _local4:String;
var _local5:Number;
var _local6:Number;
var _local7:int;
var _local8:int;
var _local9:Number;
var _local10:CWMCell;
var _local11:String;
mMinRange = _arg1;
mMaxRange = _arg2;
_local3 = new Point(mPosition.x, mPosition.y);
mSearchCells = new Array();
mAddCellIndex = 0;
mSearchQuadrants_Monitor = new Object();
for each (_local4 in CThingAngle.mDirectionNames) {
mSearchQuadrants_Monitor[_local4] = new Object();
};
_local5 = Math.pow((mMaxRange + 0.5), 2);
_local6 = Math.pow((mMinRange - 0.5), 2);
_local7 = -(mMaxRange);
while (_local7 <= mMaxRange) {
_local8 = -(mMaxRange);
while (_local8 <= mMaxRange) {
_local9 = ((_local8 * _local8) + (_local7 * _local7));
if ((((_local9 > _local5)) || ((_local9 < _local6)))){
} else {
_local10 = mMap.GetCellAt((_local3.x + _local8), (_local3.y + _local7));
if ((_local10.mCollide & eWMCCollideType.SOLID)){
} else {
if (mMap.QLineOfSight(_local3, new Point((_local3.x + _local8), (_local3.y + _local7)), 0.3)){
_local11 = CThingAngle.AsXY(_local8, _local7).mDirectionName;
mSearchCells.push(_local10);
_local10.AddMonitor(mID, mSearchQuadrants_Monitor[_local11]);
};
};
};
_local8++;
};
_local7++;
};
}
public function Process_Normal():void{
if (ApplyAffects()){
return;
};
WeaponUpdate();
if (mStateID){
var _local1 = this;
_local1[mStateID]();
};
ProcessChildren();
}
public function State_IDLE_Enter():void{
mFire = false;
}
public function State_TRACKTARGET_Exit():void{
mTurretTarget.mTurretTargeted = null;
}
public function State_SEARCH():void{
var _local1:CThingPeep;
var _local2:Number;
var _local3:CThingAngle;
var _local4:CThingAngle;
var _local5:Number;
var _local6:Array;
var _local7:String;
var _local8:Object;
var _local9:String;
var _local10:CWMCell;
var _local11:Boolean;
var _local12:Array;
var _local13:Number;
var _local14:Number;
mTurretTarget = null;
if (mSearchQuadrants_Monitor){
_local3 = new CThingAngle();
_local4 = mAngle.Clone();
_local5 = 10000;
_local6 = CWMCNavigation.SEARCHES[mAngle.mDirectionName];
for each (_local7 in _local6) {
_local8 = mSearchQuadrants_Monitor[_local7];
for (_local9 in _local8) {
_local10 = _local8[_local9];
_local11 = true;
if (_local10){
if (_local10.mMapwhoCount){
_local12 = _local10.GetThings(mCollideID, eAffectType.FILTER_PEEP, 100);
if (_local12.length != 0){
_local11 = false;
};
for each (_local1 in _local12) {
if (!_local1.mExists){
} else {
_local13 = mPosition.Distance2D(_local1.mPosition);
if ((((_local13 > mMaxRange)) || ((_local13 < mMinRange)))){
} else {
_local3.mAngleRAD = mPosition.GetAngle(_local1.mPosition);
_local14 = ((mAngle.TurnAngle(_local3).GetTurnCount(mTurnSpeed) * 0.2) + (_local13 * 1));
if (_local14 < _local5){
_local5 = _local14;
mTurretTarget = _local1;
};
};
};
};
};
};
if (_local11){
delete _local8[_local9];
};
};
};
};
if (mTurretTarget){
SetState("State_TRACKTARGET");
return;
};
SetState("State_IDLE");
mStateCount = (SECONDS * 0.5);
}
public function State_TRACKTARGET_Enter():void{
mTurretTarget.mTurretTargeted = this;
}
override public function get mThingType():String{
return ("TURRET");
}
override public function get _CLASSID_():String{
return ("CThingTurret");
}
override public function Render():void{
var _local1:Number;
if (mcDrawInfo){
if (CHUD.mDraw == false){
} else {
if (mOwner){
_local1 = mOwner.mPosition.Distance2D(mPosition);
mcDrawInfo.alpha = ((_local1)<=1.5) ? 1 : ((_local1)<2.5) ? (1 - (_local1 - 1.5)) : 0;
if (mcDrawInfo.alpha == 0){
//unresolved jump
};
mcDrawInfo.mcLife.alpha = mcDrawInfo.alpha;
mcDrawInfo.mcAmmo.alpha = mcDrawInfo.alpha;
};
mcDrawInfo.mcLife.gotoAndStop((Math.floor(((mLife / mMaxLife) * 100)) + 1));
mcDrawInfo.mcAmmo.tfInfo.text = mAmmoName;
bmdPlane.draw(mcDrawInfo, new Matrix(1, 0, 0, 1, (mcDrawInfo.x + mRenderPosition.x), (mcDrawInfo.y + mRenderPosition.y)));
};
};
ObjectRender();
}
public function Search():void{
}
public function State_TRACKTARGET():void{
var _local1:Number;
if (!mTurretTarget.mExists){
SetState("State_IDLE");
mStateCount = (SECONDS * 0.5);
return;
};
_local1 = mPosition.Distance2D(mTurretTarget.mPosition);
if ((((_local1 > mMaxRange)) || ((_local1 < mMinRange)))){
SetState("State_IDLE");
mStateCount = (SECONDS * 0.5);
return;
};
mAngleTarget.mAngleRAD = mPosition.GetAngle(mTurretTarget.mPosition);
mAngleDelta = mAngle.TurnAngle(mAngleTarget);
mStateCount = mAngleDelta.GetTurnCount(mTurnSpeed);
if (mStateCount <= 0){
mAngle.mAngle = mAngleTarget.mAngle;
mTargetRange = _local1;
mFire = true;
return;
};
mAngleDelta.Scale((1 / mStateCount));
mAngle.Add(mAngleDelta);
mFire = false;
}
public function Destroyed():Boolean{
AddThing(new CDestroySmoke(this, new CThingV3(0, 0, (mCollideHeight / 2))));
mAffectFlags = 0;
ClearCollide();
NavMapRemove();
MapRemove();
Process = Process_Dispose;
return (true);
}
public static function Restart():void{
mAllocateProcessID = 0;
}
}
}//package Thing
Section 153
//CThingV3 (Thing.CThingV3)
package Thing {
import flash.geom.*;
public class CThingV3 {
public var x:Number;
public var y:Number;
public var z:Number;
private static var mMapHeight:int;
private static var mMapWidth:int;
public function CThingV3(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):void{
x = _arg1;
y = _arg2;
z = _arg3;
}
public function Set(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):CThingV3{
x = _arg1;
y = _arg2;
z = _arg3;
return (this);
}
public function Clone():CThingV3{
var _local1:CThingV3;
_local1 = new CThingV3();
_local1.x = x;
_local1.y = y;
_local1.z = z;
return (_local1);
}
public function get mLength2D():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function RotateZ(_arg1:Number):CThingV3{
var _local2:Matrix;
var _local3:Point;
_local2 = new Matrix();
_local2.rotate(_arg1);
_local3 = _local2.transformPoint(new Point(x, y));
x = _local3.x;
y = _local3.y;
return (this);
}
public function Add(_arg1:CThingV3):CThingV3{
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
return (this);
}
public function get mMapX():uint{
return ((x & 0xFFFFFF));
}
public function get mMapY():uint{
return ((y & 0xFFFFFF));
}
public function get mLength():Number{
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
public function RotateX(_arg1:Number):CThingV3{
var _local2:Matrix;
var _local3:Point;
_local2 = new Matrix();
_local2.rotate(_arg1);
_local3 = _local2.transformPoint(new Point(z, y));
z = _local3.x;
y = _local3.y;
return (this);
}
public function get mCellX():Number{
return ((x % 1));
}
public function get mCellY():Number{
return ((y % 1));
}
public function get toPoint():Point{
return (new Point(x, y));
}
public function get mAngleRAD():Number{
return (Math.atan2(y, x));
}
public function AddXY(_arg1:Number, _arg2:Number):CThingV3{
x = (x + _arg1);
y = (y + _arg2);
return (this);
}
public function GetMinAndMaxRadius(_arg1:Number):Object{
return ({min:new CThingV3((x - _arg1), (y - _arg1)), max:new CThingV3((x + _arg1), (y + _arg1))});
}
public function Sub(_arg1:CThingV3):CThingV3{
x = (x - _arg1.x);
y = (y - _arg1.y);
z = (z - _arg1.z);
return (this);
}
public function get mCellOffset():Point{
return (new Point((x % 1), (y % 1)));
}
public function ScaleN(_arg1:Number):CThingV3{
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
return (this);
}
public function Distance2D(_arg1:CThingV3):Number{
var _local2:Number;
var _local3:Number;
_local2 = (x - _arg1.x);
_local3 = (y - _arg1.y);
return (Math.sqrt(((_local2 * _local2) + (_local3 * _local3))));
}
public function get mCentre():CThingV3{
return (new CThingV3(((x & 0xFFFFFF) + 0.5), ((y & 0xFFFFFF) + 0.5), z));
}
public function get _CLASSID_():String{
return ("CThingV3");
}
public function toString():String{
return (((((((_CLASSID_ + ": ") + x) + ",") + y) + ",") + z));
}
public function Normalize(_arg1:Number=1):CThingV3{
var _local2:Number;
_local2 = ((1 / Math.sqrt((((x * x) + (y * y)) + (z * z)))) * _arg1);
return ((isFinite(_local2)) ? ScaleN(_local2) : Set(_arg1));
}
public function ScaleN2D(_arg1:Number):CThingV3{
x = (x * _arg1);
y = (y * _arg1);
return (this);
}
public function CentreOnCell():void{
x = ((x % 1) + 0.5);
y = ((y % 1) + 0.5);
}
public function GetAngle(_arg1:CThingV3):Number{
return (Math.atan2((_arg1.y - y), (_arg1.x - x)));
}
public function RotateY(_arg1:Number):CThingV3{
var _local2:Matrix;
var _local3:Point;
_local2 = new Matrix();
_local2.rotate(_arg1);
_local3 = _local2.transformPoint(new Point(x, z));
x = _local3.x;
z = _local3.y;
return (this);
}
public function Normalize2D(_arg1:Number=1):CThingV3{
var _local2:Number;
_local2 = ((1 / Math.sqrt(((x * x) + (y * y)))) * _arg1);
return ((isFinite(_local2)) ? ScaleN2D(_local2) : Set(_arg1));
}
public static function SetMapSize(_arg1:int, _arg2:int):void{
mMapWidth = _arg1;
mMapHeight = _arg2;
}
}
}//package Thing
Section 154
//CThingWeapon (Thing.CThingWeapon)
package Thing {
import flash.geom.*;
import flash.events.*;
import Game.*;
public class CThingWeapon extends CThingStatic {
public var mAutoFire:Boolean;
public var mTotalAmmo:int;
public var mUpgradeID:String;
public var mFireAction:String;// = "fired"
public var mTimeDown:int;
public var mThingsAffected:int;
public var mRange:Number;
public var mAmmo:int;
public var mFireRateCount:int;
public var mBiggerBang:int;
public var mUpgradeIndex:int;
private var _Fire:Boolean;
public var mOnRelease:Boolean;
public var mClusterShells:int;
public var mFireRate:int;
public var mChargeTime:int;
public var mWideShot:int;
public static const LOWPROBABILITY:Number = 0.3;
public static const HIGHPROBABILITY:Number = 1;
public static const INFINATEAMMO:int = 1000000;
public static const MIDPROBABILITY:Number = 0.7;
public function CThingWeapon(_arg1):void{
mFireAction = "fired";
super();
mAngle = new CThingAngle();
mSeed = nID;
mOwner = _arg1;
Inherit(_arg1);
}
public function get mAmmoName():String{
return (((mAmmo)==INFINATEAMMO) ? "inf" : mAmmo.toString());
}
public function get mUpgradeName():String{
return (mUpgrades[mUpgradeIndex].mName);
}
public function WeaponUpdate():void{
if (mWeaponEmpty){
mFire = false;
return;
};
if (--mFireRateCount <= 0){
mFireRateCount = 0;
if (mFire){
Fire();
if (!mAutoFire){
mFire = false;
};
};
};
}
public function get mFire():Boolean{
return (_Fire);
}
public function Fire():void{
DecrementAmmo();
CGlobalData.AddStat(((mWeaponName + " ") + mFireAction), 1, "ADD");
if (mWeaponEmpty){
mFire = false;
};
}
public function Fire_Stop():void{
}
public function set mFire(_arg1:Boolean):void{
if (_Fire != _arg1){
if ((_Fire = _arg1)){
Fire_Start();
} else {
Fire_Stop();
};
};
}
public function WeaponAffect():void{
}
public function get mUpgrade():int{
return (mUpgradeIndex);
}
public function ActivateWeapon():void{
mFireRateCount = 0;
}
public function Fire_Start():void{
}
public function ProcessFire(_arg1:Boolean, _arg2:int, _arg3:int):Boolean{
if (mWeaponEmpty){
mFire = false;
return (mFire);
};
_arg2 = (((_arg2) && ((mFireRateCount <= 0)))) ? _arg2 : 0;
if (mAutoFire){
mFire = ((_arg1) || (_arg2));
} else {
if (mOnRelease){
if (_arg2){
mTimeDown = _arg2;
} else {
if (_arg3){
mChargeTime = (_arg3 - mTimeDown);
mFire = true;
};
};
} else {
if (_arg2){
mFire = true;
};
};
};
return (mFire);
}
public function get mAnimExt():String{
return ("");
}
public function get mAnimateAttack():Boolean{
return (false);
}
public function get mWeaponName():String{
return ("NONAME");
}
public function get mPickupProbability():Number{
return (1);
}
public function get mUpgrades():Array{
return (null);
}
override public function AddKill(){
CGlobalData.AddStat((mWeaponName + " kills"), 1, "ADD");
return (this);
}
override public function get _CLASSID_():String{
return ("CThingWeapon");
}
public function set mUpgrade(_arg1:int):void{
var _local2:Object;
var _local3:String;
if (!mUpgrades){
return;
};
if (!mUpgrades[_arg1]){
return;
};
mUpgradeIndex = _arg1;
_local2 = mUpgrades[_arg1];
for (_local3 in _local2) {
switch (_local3){
case "mName":
break;
case "mAmmo":
mTotalAmmo = (this[_local3] = _local2[_local3]);
break;
default:
this[_local3] = _local2[_local3];
break;
};
};
}
public function DecrementAmmo(){
if (((!((mTotalAmmo == INFINATEAMMO))) && (!(CBuild.UNLIMITEDAMMO)))){
mAmmo--;
};
mFireRateCount = mFireRate;
}
public function get mWeaponEmpty():Boolean{
return ((mAmmo <= 0));
}
override public function Dispose():void{
mFire = false;
super.Dispose();
}
}
}//package Thing
Section 155
//CTree (Thing.CTree)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CTree extends CThingObject {
public function CTree(_arg1:Object, _arg2=null){
_arg1.mCollideRadius = 0.4;
super(_arg1);
mMaxLife = (mLife = 1000);
mAudioMaterial = "METAL";
SetCollide(mCellCurrent, eWMCCollideType.TREE);
mAnimationFrame = Random();
mPosition.y = (mPosition.y + RandomOffset(0.1));
if (!MCAnimationExists(_CLASSID_)){
AddMCAnimation(_CLASSID_, new Object_Tree());
};
SetState("State_GROWRADIUS");
mAnimationFrame = Random();
}
override public function get _CLASSID_():String{
return ("CTree");
}
}
}//package Thing
Section 156
//CTurret_MG (Thing.CTurret_MG)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CTurret_MG extends CThingTurret {
public function CTurret_MG(_arg1:Object, _arg2=null, _arg3=null):void{
super(_arg1, _arg2, _arg3);
if (((isNaN(mAmmo)) || ((mAmmo == 0)))){
mFireRate = CWTurret_MG._Upgrades[0].mTurretFireRate;
mAutoFire = false;
mTotalAmmo = (mAmmo = CWTurret_MG._Upgrades[0].mTurretAmmo);
mRange = CWTurret_MG._Upgrades[0].mRange;
};
mCollideRadius = 0.4;
mCollideHeight = (mCollideRadius * 2);
SetCollide(mCellCurrent, eWMCCollideType.TURRET);
mMaxLife = (mLife = 250);
if (!SpriteSheetExists(_CLASSID_)){
AddSpriteSheet(_CLASSID_, new SheetTurret_MG(0, 0), true);
};
AddSound("shot0", Turret_MG_Shot_1, 1);
AddSound("shot1", Turret_MG_Shot_2, 1);
AddSound("shot2", Turret_MG_Shot_3, 1);
SetState("State_GROWRADIUS", "State_SEARCH");
SetupRange(0, mRange);
mTurnSpeed = CThingAngle.AsAngle256(5);
}
override public function Fire():void{
var _local1:CThingV3;
super.Fire();
_local1 = SpriteSheet_GetModelOffset("SHOT");
AddThing(new CBullet(this, CAffect.BULLET(this, this, 25), _local1, 1, (mRange + 1)));
AddThing(new CMuzzleFlash(this, _local1, Large_MuzzleFlash));
PlaySound(("shot" + Math.floor((Math.random() * 3))));
}
override public function get mWeaponName():String{
return ("Turret Gun");
}
override public function get _CLASSID_():String{
return ("CTurret_MG");
}
}
}//package Thing
Section 157
//CTurret_Mortor (Thing.CTurret_Mortor)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CTurret_Mortor extends CThingTurret {
public function CTurret_Mortor(_arg1:Object, _arg2=null, _arg3=null):void{
super(_arg1, _arg2, _arg3);
if (((isNaN(mAmmo)) || ((mAmmo == 0)))){
mFireRate = CWTurret_Mortor._Upgrades[0].mTurretFireRate;
mAutoFire = false;
mTotalAmmo = (mAmmo = CWTurret_Mortor._Upgrades[0].mTurretAmmo);
mRange = CWTurret_Mortor._Upgrades[0].mRange;
};
mCollideRadius = 0.4;
mCollideHeight = (mCollideRadius * 2);
SetCollide(mCellCurrent, eWMCCollideType.TURRET);
mMaxLife = (mLife = 120);
if (!SpriteSheetExists(_CLASSID_)){
AddSpriteSheet(_CLASSID_, new SheetTurret_Mortor(0, 0), true);
};
AddSound("Shot", Turret_Mortor_Shot);
SetState("State_GROWRADIUS", "State_SEARCH");
SetupRange(6, mRange);
mTurnSpeed = CThingAngle.AsAngle256(1);
}
override public function Fire():void{
var _local1:CThingV3;
super.Fire();
_local1 = SpriteSheet_GetModelOffset("SHOT1");
AddThing(new CMortor(this, CAffect.BULLET(this, this, 50), _local1, (33.9 - 90), mTargetRange));
AddThing(new CMortorMuzzleFlash(this, _local1, (33.9 - 90)));
PlaySound("Shot");
}
override public function get mWeaponName():String{
return ("Turret Mortor");
}
override public function get _CLASSID_():String{
return ("CTurret_Mortor");
}
}
}//package Thing
Section 158
//CTurret_Rockets (Thing.CTurret_Rockets)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CTurret_Rockets extends CThingTurret {
private var mShotIndex:int;
public function CTurret_Rockets(_arg1:Object, _arg2=null, _arg3=null):void{
super(_arg1, _arg2, _arg3);
if (((isNaN(mAmmo)) || ((mAmmo == 0)))){
mFireRate = CWTurret_Rockets._Upgrades[0].mTurretFireRate;
mAutoFire = false;
mTotalAmmo = (mAmmo = CWTurret_Rockets._Upgrades[0].mTurretAmmo);
mRange = CWTurret_Rockets._Upgrades[0].mRange;
};
mCollideRadius = 0.4;
mCollideHeight = (mCollideRadius * 2);
SetCollide(mCellCurrent, eWMCCollideType.TURRET);
mMaxLife = (mLife = 80);
if (!SpriteSheetExists(_CLASSID_)){
AddSpriteSheet(_CLASSID_, new SheetTurret_Rockets(0, 0), true);
};
AddSound("Shot", Rocket_Shot1);
SetState("State_GROWRADIUS", "State_SEARCH");
mShotIndex = 0;
SetupRange(3, mRange);
mTurnSpeed = CThingAngle.AsAngle256(3);
}
override public function Fire():void{
var _local1:CThingV3;
super.Fire();
mShotIndex = ((mShotIndex + 1) % 8);
_local1 = SpriteSheet_GetModelOffset(("SHOT" + (mShotIndex + 1)));
AddThing(new CMissile(this, CAffect.BULLET(this, this, 50), _local1, 100));
AddThing(new CMuzzleFlash(this, _local1, Large_MuzzleFlash));
PlaySound("Shot");
}
override public function get mWeaponName():String{
return ("Turret Rockets");
}
override public function get _CLASSID_():String{
return ("CTurret_Rockets");
}
}
}//package Thing
Section 159
//CVampire (Thing.CVampire)
package Thing {
import World.*;
public class CVampire extends CThingPeep {
private var mReappearCell:CWMCell;
public function CVampire(_arg1:Object=null){
super(_arg1, SheetVampire);
mName = "Vampire";
mSpeed = (6 / 100);
mAngle.mDirection = 2;
SetAnimation("stand");
SetCollide(mCellCurrent, eWMCCollideType.PEEP);
mMaxLife = (mLife = 100);
mScore = 100;
SetState("State_NAVIGATE");
mAffectFlags = (mAffectFlags & ~(eAffectType.ZOMBIEATTACK));
AddSound("Disappear", Vampire_Disappear, 2);
mName = "Vampire";
}
public function State_DISAPPEAR_Exit():void{
mAlpha = 1;
}
public function State_ATTACK_Exit():void{
}
public function State_REAPPEAR_Exit():void{
mAlpha = 1;
}
public function State_REAPPEAR_Enter():void{
mPosition = new CThingV3((mReappearCell.mapX + 0.5), (mReappearCell.mapY + 0.5), 0);
mAngle = CThingAngle.AsXY(((mCellTarget.mapX + 0.5) - mPosition.x), ((mCellTarget.mapY + 0.5) - mPosition.y));
SetAnimation("stand");
AddThing(new CAppearSmoke(this, new CThingV3(0, 0, (mCollideHeight / 2))));
MapMove();
}
public function State_ATTACK_Enter():void{
SetAnimation("attack");
}
public function State_DISAPPEAR():void{
mAlpha = (mAlpha - 0.2);
if (mAlpha <= 0){
SetState("State_REAPPEAR");
mAlpha = 0;
};
}
public function State_DISAPPEAR_Enter():void{
ClearCollide();
SetCollide(mReappearCell, eWMCCollideType.PEEP);
SetAnimation("stand");
AddThing(new CAppearSmoke(this, new CThingV3(0, 0, (mCollideHeight / 2))));
PlaySound("Disappear");
mAlpha = 1;
}
override public function State_NAVIGATE():void{
var _local1:Number;
var _local2:Array;
if (!mCanProcess){
return;
};
if (mCellCurrent.mNavIndex > 12){
} else {
if (!(mTarget = mCellCurrent.mNavTarget)){
} else {
if (!mTarget.mExists){
} else {
if (mCellCurrent.mNavIndex <= 2){
if ((mCellTarget = mCellCurrent.GetNavIndex0())){
if (DistanceToCell(mCellTarget) < (Math.SQRT2 + 0.1)){
mAngleTarget = CThingAngle.AsXY((mCellTarget.mapX - mCellCurrent.mapX), (mCellTarget.mapY - mCellCurrent.mapY));
if (mAngleTarget.mDirection != mAngle.mDirection){
SetState("State_TURN", mStateID);
return;
};
SetState("State_ATTACK");
return;
};
};
} else {
if (mAttackCounter){
} else {
mCellTarget = mTarget.mCellCurrent;
if (mCellTarget == null){
} else {
_local1 = DistanceToCell(mCellTarget);
if ((((_local1 > 6)) && ((_local1 < 10)))){
_local2 = mCellTarget.MovableNeighbours4(false);
if (_local2.length != 0){
mReappearCell = _local2[RandomInt(_local2.length)];
SetState("State_DISAPPEAR");
mAttackCounter = (SECONDS * 5);
return;
};
};
};
};
};
};
};
};
super.State_NAVIGATE();
}
public function State_REAPPEAR():void{
if (mTarget){
mAngle.mAngleRAD = mPosition.GetAngle(mTarget.mPosition);
};
mAlpha = (mAlpha + 0.2);
if (mAlpha >= 1){
SetState("State_ATTACK");
};
}
override public function get _CLASSID_():String{
return ("CVampire");
}
public function State_ATTACK():void{
if (mTarget){
mAngle.mAngleRAD = mPosition.GetAngle(mTarget.mPosition);
};
if (AnimateEnd()){
AffectCell(CAffect.ZOMBIEATTACK(this, (20 * mAttackScale), 0.5), mCellTarget, 100);
SetState("State_WAIT", mBaseStateID);
mStateCount = 5;
};
}
public static function PrepareClass():void{
var _local1:CThingDraw;
_local1 = new CThingDraw();
if (!_local1.SpriteSheetExists("CVampire")){
_local1.AddSpriteSheet("CVampire", new SheetVampire(0, 0));
};
_local1.Dispose();
}
}
}//package Thing
Section 160
//CWTurret_MG (Thing.CWTurret_MG)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CWTurret_MG extends CThingWeapon {
private var mShotPIndex:int;// = 0
public var mTurretAmmo:int;
public var mTurretFireRate:int;
public static var _Upgrades:Array = [{mName:"", mAmmo:2, mAutoFire:false, mFireRate:0, mRange:6, mTurretFireRate:6, mTurretAmmo:50}, {mName:"Double ammo", mAmmo:4, mAutoFire:false, mFireRate:0, mRange:6, mTurretFireRate:6, mTurretAmmo:100}, {mName:"Fast fire", mAmmo:4, mAutoFire:false, mFireRate:0, mRange:6, mTurretFireRate:4, mTurretAmmo:100}, {mName:"Rapid fire", mAmmo:4, mAutoFire:false, mFireRate:0, mRange:6, mTurretFireRate:2, mTurretAmmo:100}, {mName:"Triple ammo", mAmmo:8, mAutoFire:false, mFireRate:0, mRange:6, mTurretFireRate:2, mTurretAmmo:150}, {mName:"Longer range", mAmmo:8, mAutoFire:false, mFireRate:0, mRange:9, mTurretFireRate:2, mTurretAmmo:150}];
public function CWTurret_MG(_arg1):void{
mShotPIndex = 0;
super(_arg1);
mUpgrade = 0;
Process = Process_Normal;
AddSound("Place", Turret_Place);
mFireAction = "placed";
}
override public function Fire():void{
if ((mOwner.mCellCurrent.mCollide & eWMCCollideType.NONPLACEMENT)){
return;
};
super.Fire();
mPosition = mOwner.mPosition;
mWorld.AddThing(new CTurret_MG({mInitCell:mOwner.mCellCurrent}, mOwner, this));
PlaySound("Place");
}
override public function Fire_Stop():void{
super.Fire_Stop();
}
public function Process_Normal(){
WeaponUpdate();
ProcessChildren();
}
override public function get mWeaponName():String{
return ("Turret Gun");
}
override public function Fire_Start():void{
super.Fire_Start();
}
override public function get mAnimExt():String{
return ("");
}
override public function get mPickupProbability():Number{
return ((LOWPROBABILITY * (1 - ((mAmmo + CountChildren("CTurret_MG")) / (mTotalAmmo * 2)))));
}
override public function get mUpgrades():Array{
return (_Upgrades);
}
override public function get _CLASSID_():String{
return ("CWTurret_MG");
}
override public function set mUpgrade(_arg1:int):void{
super.mUpgrade = _arg1;
}
}
}//package Thing
Section 161
//CWTurret_Mortor (Thing.CWTurret_Mortor)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CWTurret_Mortor extends CThingWeapon {
private var mShotPIndex:int;// = 0
public var mTurretAmmo:int;
public var mTurretFireRate:int;
public var mTurretDamage:int;
public static var _Upgrades:Array = [{mName:"", mAmmo:2, mAutoFire:false, mFireRate:0, mRange:9, mTurretFireRate:(SECONDS * 2), mTurretAmmo:25}, {mName:"Double ammo", mAmmo:4, mAutoFire:false, mFireRate:0, mRange:9, mTurretFireRate:(SECONDS * 2), mTurretAmmo:50}, {mName:"Faster fire", mAmmo:6, mAutoFire:false, mFireRate:0, mRange:9, mTurretFireRate:(SECONDS * 1), mTurretAmmo:75}, {mName:"Triple ammo", mAmmo:6, mAutoFire:false, mFireRate:0, mRange:9, mTurretFireRate:(SECONDS * 1), mTurretAmmo:75}, {mName:"Long range", mAmmo:6, mAutoFire:false, mFireRate:0, mRange:15, mTurretFireRate:(SECONDS * 1), mTurretAmmo:75}];
public function CWTurret_Mortor(_arg1):void{
mShotPIndex = 0;
super(_arg1);
mUpgrade = 0;
Process = Process_Normal;
AddSound("Place", Turret_Place);
mFireAction = "placed";
}
override public function Fire():void{
if ((mOwner.mCellCurrent.mCollide & eWMCCollideType.NONPLACEMENT)){
return;
};
super.Fire();
mPosition = mOwner.mPosition;
mWorld.AddThing(new CTurret_Mortor({mInitCell:mOwner.mCellCurrent}, mOwner, this));
PlaySound("Place");
}
override public function Fire_Stop():void{
super.Fire_Stop();
}
public function Process_Normal(){
WeaponUpdate();
ProcessChildren();
}
override public function get mWeaponName():String{
return ("Turret Mortor");
}
override public function Fire_Start():void{
super.Fire_Start();
}
override public function get mAnimExt():String{
return ("");
}
override public function get mPickupProbability():Number{
return ((LOWPROBABILITY * (1 - ((mAmmo + CountChildren("CTurret_Mortor")) / (mTotalAmmo * 2)))));
}
override public function get mUpgrades():Array{
return (_Upgrades);
}
override public function get _CLASSID_():String{
return ("CWTurret_Mortor");
}
}
}//package Thing
Section 162
//CWTurret_Rockets (Thing.CWTurret_Rockets)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CWTurret_Rockets extends CThingWeapon {
private var mShotPIndex:int;// = 0
public var mTurretAmmo:int;
public var mTurretFireRate:int;
public static var _Upgrades:Array = [{mName:"", mAmmo:2, mAutoFire:false, mFireRate:0, mRange:8, mTurretFireRate:12, mTurretAmmo:50}, {mName:"Double ammo", mAmmo:4, mAutoFire:false, mFireRate:0, mRange:8, mTurretFireRate:12, mTurretAmmo:100}, {mName:"Fast fire", mAmmo:4, mAutoFire:false, mFireRate:0, mRange:8, mTurretFireRate:8, mTurretAmmo:100}, {mName:"Triple ammo", mAmmo:8, mAutoFire:false, mFireRate:0, mRange:8, mTurretFireRate:8, mTurretAmmo:150}, {mName:"Rapid fire", mAmmo:8, mAutoFire:false, mFireRate:0, mRange:8, mTurretFireRate:4, mTurretAmmo:150}, {mName:"Long range", mAmmo:8, mAutoFire:false, mFireRate:0, mRange:13, mTurretFireRate:4, mTurretAmmo:150}];
public function CWTurret_Rockets(_arg1):void{
mShotPIndex = 0;
super(_arg1);
mUpgrade = 0;
Process = Process_Normal;
AddSound("Place", Turret_Place);
mFireAction = "placed";
}
override public function Fire():void{
if ((mOwner.mCellCurrent.mCollide & eWMCCollideType.NONPLACEMENT)){
return;
};
super.Fire();
mPosition = mOwner.mPosition;
mWorld.AddThing(new CTurret_Rockets({mInitCell:mOwner.mCellCurrent}, mOwner, this));
PlaySound("Place");
}
override public function Fire_Stop():void{
super.Fire_Stop();
}
public function Process_Normal(){
WeaponUpdate();
ProcessChildren();
}
override public function get mWeaponName():String{
return ("Turret Rockets");
}
override public function Fire_Start():void{
super.Fire_Start();
}
override public function get mAnimExt():String{
return ("");
}
override public function get mPickupProbability():Number{
return ((LOWPROBABILITY * (1 - ((mAmmo + CountChildren("CTurret_Rockets")) / (mTotalAmmo * 2)))));
}
override public function get mUpgrades():Array{
return (_Upgrades);
}
override public function get _CLASSID_():String{
return ("CWTurret_Rockets");
}
}
}//package Thing
Section 163
//CZombie (Thing.CZombie)
package Thing {
import flash.geom.*;
import Landscape.*;
import STC9.Sprite.*;
import World.*;
import Draw.*;
import flash.events.*;
public class CZombie extends CThingPeep {
private static var firstZombie:CZombie;
public function CZombie(_arg1:Object=null){
super(_arg1, SheetZombie);
mName = "Zombie";
mSpeed = (5 / 100);
mAngle.mDirection = 2;
SetAnimation("stand");
SetCollide(mCellCurrent, eWMCCollideType.PEEP);
mMaxLife = (mLife = 100);
mScore = 100;
mAffectFlags = (mAffectFlags & ~(eAffectType.ZOMBIEATTACK));
SetState("State_NAVIGATE");
Process = QProcess_Normal;
mName = "Zombie";
}
public function State_ATTACK_Exit():void{
}
public function State_ATTACK_Enter():void{
if (mAngleTarget.mDirection != mAngle.mDirection){
SetState("State_TURN", mStateID);
return;
};
SetAnimation("attack");
}
override public function State_NAVIGATE():void{
if (!mCellCurrent.mNavTarget){
} else {
if (mCellCurrent.mNavIndex > 2){
} else {
if (!mCellCurrent.mNavTarget.mExists){
} else {
if ((mCellTarget = mCellCurrent.GetNavIndex0())){
if (DistanceToCell(mCellTarget) < (Math.SQRT2 + 0.1)){
mAngleTarget = CThingAngle.AsXY((mCellTarget.mapX - mCellCurrent.mapX), (mCellTarget.mapY - mCellCurrent.mapY));
SetState("State_ATTACK");
return;
};
};
};
};
};
super.State_NAVIGATE();
}
override public function get _CLASSID_():String{
return ("CZombie");
}
public function State_ATTACK():void{
if (AnimateEnd()){
AffectCell(CAffect.ZOMBIEATTACK(this, (10 * mAttackScale), 0.5), mCellTarget, 100);
SetState("State_WAIT", mBaseStateID);
mStateCount = 5;
};
}
public static function PrepareClass():void{
var _local1:CThingDraw;
_local1 = new CThingDraw();
if (!_local1.SpriteSheetExists("CZombie")){
_local1.AddSpriteSheet("CZombie", new SheetZombie(0, 0));
};
_local1.Dispose();
}
}
}//package Thing
Section 164
//eAffectType (Thing.eAffectType)
package Thing {
public class eAffectType {
public static const BULLET:int = 1;
public static const FILTER_PEEP:int = 0x1000;
public static const FILTER_SOLID:int = 0x0400;
public static const ANY:int = 16775167;
public static const VAPOURIZE:int = 2;
public static const PLAYERLINEOFSIGHT:int = 0x0200;
public static const SLICED:int = 32;
public static const FILTER_PICKUP:int = 0x0800;
public static const PUNCHED:int = 8;
public static const ZOMBIEATTACK:int = 128;
public static const PUSH:int = 64;
public static const HIT:int = 16;
public static const EXPLOSION:int = 4;
public static const FIRE:int = 0x0100;
public static const NONE:int = 0;
}
}//package Thing
Section 165
//CLevel (World.CLevel)
package World {
import Thing.*;
import flash.geom.*;
import Landscape.*;
import flash.events.*;
import IO.*;
import STC9.System.Profiler.*;
import Game.*;
import STC9.IO.*;
public class CLevel {
private var mEdgeSpawnIndex:int;
private var mEdgeSpawnPositions:Array;
public var mWorld:CWorld;
private var mLevelInitCounter:int;
private var mLevelObject:Object;
private var mLevels:Array;
private var mOpenSpawnIndex:int;
public var mLevelStats:CLevelStats;
private var mSpawnIndex:int;
private var mOpenSpawnPositions:Array;
private var _LevelIndex:int;
public var mUpgradePeep:CPeepPlayer;
public var mWorldMap:CWorldMap;
public static const MAXLEVEL:Number = 250;
public static const MUMMYRATIO:Number = 0.1;
public static const ZOMBIERATIO:Number = (1 - (((RUNNERRATIO + MUMMYRATIO) + VAMPIRERATIO) + DEVILRATIO));
public static const DEVILRATIO:Number = 0.01;
public static const RUNNERRATIO:Number = 0.2;
public static const VAMPIRERATIO:Number = 0.05;
public static var LEVELINITCOUNT:int = 5;
public static var MAXSCORE:Number = 0;
public function CLevel(_arg1:CWorld):void{
mWorld = _arg1;
mWorldMap = _arg1.mMap;
CreateSpawnPositions();
SetupLevels();
mLevelStats = new CLevelStats(this);
LEVELINITCOUNT = ((CGame.mLevelData.mMode)=="DEFENCE") ? (CGame.SECONDS * 10) : CGame.SECONDS;
mLevelInitCounter = LEVELINITCOUNT;
}
private function EnemyKilled(_arg1:CThingPeep):void{
mActiveCount--;
}
private function AddEdgeSpawnPosition(_arg1:CWMCell):void{
var _local2:Array;
var _local3:String;
_local2 = CWMCNeighbours.mNeighboursDirections4;
for each (_local3 in _local2) {
if (!(_arg1.mNeighbours[_local3].mCollide & eWMCCollideType.SOLID)){
mEdgeSpawnPositions.push(new CSpawnPosition(_arg1, _local3));
return;
};
};
}
private function EnemyScore(_arg1:CThingPeep):void{
CGlobalData.AddStat((_arg1.mName + " kills"), 1, "ADD");
CGlobalData.AddStat("Total kills", 1, "ADD");
mLevelStats.AddKillScore(_arg1);
}
private function GetSpawnPositionEdge():CSpawnPosition{
var _local1:int;
var _local2:CSpawnPosition;
_local1 = 20;
while (_local1) {
mEdgeSpawnIndex = ((mEdgeSpawnIndex + 1) % mEdgeSpawnPositions.length);
_local2 = mEdgeSpawnPositions[mEdgeSpawnIndex];
if (_local2.mCell.mNeighbours[_local2.mDirection].mCollide <= eWMCCollideType.EDGE){
return (_local2);
};
_local1--;
};
return (null);
}
private function RandomInt(_arg1:int):Number{
return (mWorld.mThingContainer.RandomInt(_arg1));
}
private function Levelup_CreateEnemy(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Class, _arg6:Function):Object{
return ({mRatio:_arg2, mSpeed:Math.min(2.5, Math.max(1, _arg3)), mAttack:Math.min(5, Math.max(1, _arg4)), mCount:0, mTotal:Math.round((_arg1 * _arg2)), cInitClass:_arg5, InitPosition:_arg6, mSpawnCount:0});
}
private function GetSpawnPositionOpen():CSpawnPosition{
var _local1:int;
var _local2:CSpawnPosition;
_local1 = 20;
while (_local1) {
mOpenSpawnIndex = ((mOpenSpawnIndex + 1) % mOpenSpawnPositions.length);
_local2 = mOpenSpawnPositions[mOpenSpawnIndex];
if (_local2.mCell.mCollide == eWMCCollideType.NONE){
return (_local2);
};
_local1--;
};
return (null);
}
private function AddOpenSpawnPosition(_arg1:CWMCell):void{
mOpenSpawnPositions.push(new CSpawnPosition(_arg1, "ANY"));
}
private function get mSpawnCount():int{
return (mLevelObject.mSpawnCount);
}
public function get _CLASSID_():String{
return ("CLevel");
}
private function SetupLevels():void{
var _local1:int;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:int;
var _local8:int;
var _local9:Object;
var _local10:Object;
var _local11:Number;
var _local12:Number;
var _local13:Boolean;
var _local14:Object;
mLevels = new Array();
mLevelIndex = 0;
MAXSCORE = 0;
_local7 = ((CGlobalData.GetData("Quality"))=="low") ? 250 : 500;
_local8 = 1;
while (_local8 <= MAXLEVEL) {
_local9 = null;
_local10 = new Object();
_local10.mSpawnCount = 0;
_local10.mActiveCount = 0;
_local10.mEnemys = new Array();
_local11 = (((_local8 - 1) * (1 / 20)) + 1);
_local12 = (((_local8 - 1) * (1 / 20)) + 1);
if (_local8 >= 5){
_local13 = (((((((((_local8 >= 50)) && (((_local8 % 5) == 0)))) || ((((_local8 >= 60)) && (((_local8 % 3) == 0)))))) || ((((_local8 >= 70)) && (((_local8 % 2) == 0)))))) || ((_local8 >= 80)));
_local10.mEnemyTotal = (_local8 * 25);
_local10.mSpecialLevel = _local13;
_local10.mTotalActive = Math.max(100, Math.min(_local7, _local10.mEnemyTotal));
_local3 = GetRatio("RUNNER", RUNNERRATIO);
_local4 = GetRatio("VAMPIRE", VAMPIRERATIO);
_local5 = GetRatio("MUMMY", MUMMYRATIO);
_local6 = GetRatio("DEVIL", (_local13) ? (DEVILRATIO * 10) : DEVILRATIO);
_local2 = GetRatio("ZOMBIE", (1 - (((_local3 + _local5) + _local4) + _local6)));
if (_local3){
_local10.mEnemys.push(Levelup_CreateEnemy(_local10.mEnemyTotal, _local3, _local11, _local12, CRunner, GetSpawnPositionEdge));
};
if (_local5){
_local10.mEnemys.push(Levelup_CreateEnemy(_local10.mEnemyTotal, _local5, _local11, _local12, CMummy, GetSpawnPositionOpen));
};
if (_local4){
_local10.mEnemys.push(Levelup_CreateEnemy(_local10.mEnemyTotal, _local4, _local11, _local12, CVampire, GetSpawnPositionEdge));
};
if (_local6){
_local10.mEnemys.push(Levelup_CreateEnemy(_local10.mEnemyTotal, _local6, _local11, _local12, CDevil, GetSpawnPositionEdge));
};
if (_local2){
_local9 = Levelup_CreateEnemy(_local10.mEnemyTotal, _local2, _local11, _local12, CZombie, GetSpawnPositionEdge);
_local10.mEnemys.push(_local9);
};
} else {
if (_local8 == 1){
_local10.mEnemyTotal = 20;
_local10.mTotalActive = _local10.mEnemyTotal;
_local2 = GetRatio("ZOMBIE", 1);
if (_local2){
_local9 = Levelup_CreateEnemy(_local10.mEnemyTotal, _local2, _local11, _local12, CZombie, GetSpawnPositionEdge);
_local10.mEnemys.push(_local9);
};
} else {
if (_local8 == 2){
_local10.mEnemyTotal = 50;
_local10.mTotalActive = _local10.mEnemyTotal;
_local3 = GetRatio("RUNNER", RUNNERRATIO);
_local2 = GetRatio("ZOMBIE", (1 - _local3));
_local2 = (1 - _local3);
if (_local3){
_local10.mEnemys.push(Levelup_CreateEnemy(_local10.mEnemyTotal, _local3, _local11, _local12, CRunner, GetSpawnPositionEdge));
};
if (_local2){
_local9 = Levelup_CreateEnemy(_local10.mEnemyTotal, _local2, _local11, _local12, CZombie, GetSpawnPositionEdge);
_local10.mEnemys.push(_local9);
};
} else {
if (_local8 == 3){
_local10.mEnemyTotal = 75;
_local10.mTotalActive = _local10.mEnemyTotal;
_local3 = GetRatio("RUNNER", RUNNERRATIO);
_local5 = GetRatio("MUMMY", MUMMYRATIO);
_local2 = GetRatio("ZOMBIE", (1 - (_local3 + _local5)));
if (_local3){
_local10.mEnemys.push(Levelup_CreateEnemy(_local10.mEnemyTotal, _local3, _local11, _local12, CRunner, GetSpawnPositionEdge));
};
if (_local5){
_local10.mEnemys.push(Levelup_CreateEnemy(_local10.mEnemyTotal, _local5, _local11, _local12, CMummy, GetSpawnPositionOpen));
};
if (_local2){
_local9 = Levelup_CreateEnemy(_local10.mEnemyTotal, _local2, _local11, _local12, CZombie, GetSpawnPositionEdge);
_local10.mEnemys.push(_local9);
};
} else {
if (_local8 == 4){
_local10.mEnemyTotal = 100;
_local10.mTotalActive = _local10.mEnemyTotal;
_local3 = GetRatio("RUNNER", RUNNERRATIO);
_local4 = GetRatio("VAMPIRE", VAMPIRERATIO);
_local5 = GetRatio("MUMMY", MUMMYRATIO);
_local2 = GetRatio("ZOMBIE", (1 - ((_local3 + _local5) + _local4)));
if (_local3){
_local10.mEnemys.push(Levelup_CreateEnemy(_local10.mEnemyTotal, _local3, _local11, _local12, CRunner, GetSpawnPositionEdge));
};
if (_local5){
_local10.mEnemys.push(Levelup_CreateEnemy(_local10.mEnemyTotal, _local5, _local11, _local12, CMummy, GetSpawnPositionOpen));
};
if (_local4){
_local10.mEnemys.push(Levelup_CreateEnemy(_local10.mEnemyTotal, _local4, _local11, _local12, CVampire, GetSpawnPositionEdge));
};
if (_local2){
_local9 = Levelup_CreateEnemy(_local10.mEnemyTotal, _local2, _local11, _local12, CZombie, GetSpawnPositionEdge);
_local10.mEnemys.push(_local9);
};
};
};
};
};
};
if (_local9){
_local1 = 0;
for each (_local14 in _local10.mEnemys) {
_local1 = (_local1 + _local14.mTotal);
};
_local9.mTotal = (_local9.mTotal + (_local10.mEnemyTotal - _local1));
};
mLevels[_local8] = _local10;
MAXSCORE = (MAXSCORE + ((_local10.mEnemyTotal * 1000) * 999));
_local8++;
};
}
private function get mTotalActive():int{
return (mLevelObject.mTotalActive);
}
public function Start(_arg1:int=1, _arg2:int=1):void{
CHUD.mSilentMessages = true;
switch (CGlobalData.GetData("Difficulty")){
case 0:
default:
_arg1 = 0;
_arg2 = ((CGame.mLevelData.mMode)=="DEFENCE") ? 5 : 1;
break;
case 1:
_arg1 = 30;
_arg2 = ((CGame.mLevelData.mMode)=="DEFENCE") ? 10 : 5;
break;
case 2:
_arg1 = 80;
_arg2 = ((CGame.mLevelData.mMode)=="DEFENCE") ? 20 : 10;
break;
case 3:
_arg1 = 150;
_arg2 = ((CGame.mLevelData.mMode)=="DEFENCE") ? 40 : 20;
break;
};
mLevelStats.mMultiplier = 0;
mLevelIndex = 0;
while (_arg1) {
mLevelStats.mMultiplier++;
_arg1--;
};
_arg2--;
while (_arg2) {
mLevelIndex++;
_arg2--;
};
if (mLevelIndex == 0){
mLevelInitCounter = 1;
};
CHUD.mSilentMessages = false;
}
private function set mSpawnCount(_arg1:int):void{
if (mLevelObject.mSpawnCount == _arg1){
return;
};
mLevelObject.mSpawnCount = _arg1;
}
public function Process():void{
var _local1:String;
if (CBuild.mDEBUG){
if (CKeyboard.IsDown("D")){
CFPS.AddDebug("LEV_mActiveCount", mActiveCount.toString());
CFPS.AddDebug("LEV_mTotalActive", mTotalActive.toString());
CFPS.AddDebug("LEV_mSpawnCount", mSpawnCount.toString());
CFPS.AddDebug("LEV_mEnemyTotal", mEnemyTotal.toString());
CFPS.AddDebug("LEV_mLevelInitCounter", mLevelInitCounter.toString());
for each (_local1 in ["Zombie", "Mummy", "Runner", "Vampire", "Devil"]) {
CFPS.AddDebug((("LEV_" + _local1) + "Count"), mWorld.mThingContainer.CountChildren(("C" + _local1), true).toString());
};
};
};
if (mLevelIndex){
SpawnEnemy();
mLevelStats.Process();
};
if (--mLevelInitCounter == 0){
mUpgradePeep.PlaySound("GONG");
mLevelIndex++;
};
}
private function set mEnemyTotal(_arg1:int):void{
if (mLevelObject.mEnemyTotal == _arg1){
return;
};
mLevelObject.mEnemyTotal = _arg1;
}
private function RandomizePositions(_arg1:Array):Array{
var _local2:CSpawnPosition;
for each (_local2 in _arg1) {
_local2.mRandomizer = Random();
};
_arg1.sort(SortOnRandomizer);
return (_arg1);
}
private function Random():Number{
return (mWorld.mThingContainer.Random());
}
private function get mEnemyTotal():int{
return (mLevelObject.mEnemyTotal);
}
public function CreateSpawnPositions(){
var _local1:int;
var _local2:int;
var _local3:Array;
var _local4:CWMCell;
mEdgeSpawnPositions = new Array();
mOpenSpawnPositions = new Array();
_local2 = (mWorldMap.mHeight - 1);
while (_local2 >= 0) {
_local1 = (mWorldMap.mWidth - 1);
_local3 = mWorldMap.mCells[_local2];
while (_local1 >= 0) {
_local4 = _local3[_local1];
if (_local4.mCollide == (eWMCCollideType.EDGE | eWMCCollideType.SOLID)){
AddEdgeSpawnPosition(_local4);
} else {
if (_local4.mCollide == eWMCCollideType.NONE){
AddOpenSpawnPosition(_local4);
};
};
_local1--;
};
_local2--;
};
RandomizePositions(mEdgeSpawnPositions);
RandomizePositions(mOpenSpawnPositions);
mEdgeSpawnIndex = (mOpenSpawnIndex = 0);
}
private function SpawnEnemy():Boolean{
var _local1:Boolean;
var _local2:Array;
var _local3:Object;
var _local4:CSpawnPosition;
var _local5:CThingPeep;
if (mLevelInitCounter >= 0){
return (false);
};
if (mLevelObject == null){
return (false);
};
if (mLevelObject.mEnemys.length == 0){
return (false);
};
if (mActiveCount >= mTotalActive){
return (false);
};
if (mSpawnCount > mEnemyTotal){
return (false);
};
if (mSpawnCount == mEnemyTotal){
if ((((mActiveCount <= 0)) && ((mLevelInitCounter < 0)))){
mLevelInitCounter = LEVELINITCOUNT;
CGame.mHUD.AddMessage(mUpgradePeep.mRenderPosition, "...LEVEL CLEAR...", "level", 1.25);
};
return (false);
};
_local1 = false;
_local2 = CThingAngle.mDirectionNames;
for each (_local3 in mLevelObject.mEnemys) {
if (_local3.mCount >= _local3.mTotal){
} else {
_local3.mSpawnCount = Math.min(_local3.mTotal, (_local3.mSpawnCount + _local3.mRatio));
if (_local3.mCount < Math.floor(_local3.mSpawnCount)){
_local4 = _local3.InitPosition();
if (_local4 != null){
_local5 = mWorld.AddThing(new _local3.cInitClass({mInitCell:_local4.mCell, mSpeedScale:_local3.mSpeed, mAttackScale:_local3.mAttack}));
_local5.OnDeath = EnemyScore;
_local5.OnDispose = EnemyKilled;
_local5.mAngle.mDirectionName = ((_local4.mDirection)=="ANY") ? _local2[RandomInt(_local2.length)] : _local4.mDirection;
_local3.mCount++;
mSpawnCount++;
mActiveCount++;
_local1 = true;
if (mActiveCount >= mTotalActive){
break;
};
};
};
};
};
return ((_local1) ? true : false);
}
private function GetRatio(_arg1:String, _arg2:Number=0):Number{
switch (_arg1){
case "ZOMBIE":
if (CGlobalData.GetData("Zombies") == "on"){
return (_arg2);
};
return (0);
case "MUMMY":
if (CGlobalData.GetData("Mummies") == "on"){
return (_arg2);
};
return (0);
case "VAMPIRE":
if (CGlobalData.GetData("Vampires") == "on"){
return (_arg2);
};
return (0);
case "DEVIL":
if (CGlobalData.GetData("Devils") == "on"){
return (_arg2);
};
return (0);
case "RUNNER":
if (CGlobalData.GetData("Runners") == "on"){
return (_arg2);
};
return (0);
};
return (0);
}
private function set mLevelIndex(_arg1:int):void{
if (_LevelIndex == _arg1){
return;
};
if (_LevelIndex == MAXLEVEL){
mWorld.mState = "CLOSE";
return;
};
_LevelIndex = _arg1;
CGame.mHUD.AddMessage(mUpgradePeep.mRenderPosition, ("LEVEL " + mLevelIndex), "level", 1.25);
mLevelObject = mLevels[_LevelIndex];
if (mLevelObject.mSpecialLevel){
CGame.mHUD.AddMessage(mUpgradePeep.mRenderPosition, "WELCOME TO HELL", "level", 1.25);
};
CGlobalData.AddStat("Highest Level", _LevelIndex);
}
private function get mLevelIndex():int{
return (_LevelIndex);
}
private function get mActiveCount():int{
return (mLevelObject.mActiveCount);
}
private function SortOnRandomizer(_arg1:CSpawnPosition, _arg2:CSpawnPosition):Number{
return (((_arg1.mRandomizer)>_arg2.mRandomizer) ? 1 : ((_arg1.mRandomizer)<_arg2.mRandomizer) ? -1 : 0);
}
private function set mActiveCount(_arg1:int):void{
if (mLevelObject.mActiveCount == _arg1){
return;
};
mLevelObject.mActiveCount = _arg1;
}
}
}//package World
Section 166
//CLevelData (World.CLevelData)
package World {
public class CLevelData {
public function get _CLASSID_():String{
return ("CLevelData");
}
public static function GetData(_arg1:int):Object{
switch (_arg1){
case 0:
default:
return ({initClass:Level_00, mMode:"NONE", mIndex:0, mName:"Close combat"});
case 1:
return ({initClass:Level_01, mMode:"NONE", mIndex:1, mName:"Death alley"});
case 2:
return ({initClass:Level_02, mMode:"NONE", mIndex:2, mName:"Double trouble"});
case 3:
return ({initClass:Level_03, mMode:"NONE", mIndex:3, mName:"In the middle"});
case 4:
return ({initClass:Level_00, mMode:"DEFENCE", mIndex:4, mName:"Welcome to HELL"});
case 5:
return ({initClass:Level_01, mMode:"DEFENCE", mIndex:5, mName:"Top heavy"});
case 6:
return ({initClass:Level_02, mMode:"DEFENCE", mIndex:6, mName:"The road to hell"});
case 7:
return ({initClass:Level_03, mMode:"DEFENCE", mIndex:7, mName:"Cross roads"});
};
}
}
}//package World
Section 167
//CLevelStats (World.CLevelStats)
package World {
import Thing.*;
import flash.geom.*;
import Landscape.*;
import STC9.Security.*;
import flash.events.*;
import IO.*;
import STC9.System.Profiler.*;
import Game.*;
public class CLevelStats {
private var _Multiplier:int;
private var _MultipleKills:int;
private var mMultiplierTick:int;
private var mMultipleKillsTickTotal:int;
private var mUpgradeMultiplierLevel:int;// = 0
private var mLevel:CLevel;
private var _MultipleKillsValid:int;
private var mMultipleKillsValid:int;
private var _Score:CSecureNumber;
private var mMultipleKillsTick:int;
private var mMultiplierTickTotal:int;
private var mMultipleKillsScore:int;
private var mUpgradeMultipleKillsLevel:int;// = 0
public function CLevelStats(_arg1:CLevel){
mUpgradeMultipleKillsLevel = 0;
mUpgradeMultiplierLevel = 0;
super();
mLevel = _arg1;
mMultiplier = 0;
mMultipleKills = 0;
mMultipleKillsValid = 0;
_Score = new CSecureNumber();
}
public function set mScore(_arg1:Number):void{
if (_arg1 == _Score.mNumber){
return;
};
_Score.mNumber = _arg1;
CGame.mHUD.mScore = _arg1;
}
public function get mMultiplier():int{
return (_Multiplier);
}
private function ApplyMultipleKillsUpgrades():void{
if (mMultipleKills > mUpgradeMultipleKillsLevel){
mUpgradeMultipleKillsLevel = mMultipleKills;
if (mLevel.mUpgradePeep){
mLevel.mUpgradePeep.ApplyMultipleKillsUpgrade(mMultipleKills);
};
};
}
public function AddScore(_arg1:Number, _arg2:Boolean=true):void{
mScore = (mScore + _arg1);
}
public function get mScore():Number{
return (_Score.mNumber);
}
public function AddKillScore(_arg1):void{
var _local2:Number;
var _local3:Boolean;
_local2 = (_arg1.mScore * mMultiplier);
mMultipleKillsScore = (mMultipleKillsScore + _local2);
mScore = (mScore + _local2);
mMultipleKills++;
mMultiplier++;
CGlobalData.AddStat("Highest consecutive score", mMultipleKillsScore);
CGlobalData.AddStat("Highest score", mScore);
CGame.mHUD.AddScore(CLSDraw.ProjectionThing_Screen(_arg1.mPosition), _local2);
if (_arg1.mKilledBy){
if (_arg1.mKilledBy._CLASSID_.indexOf("CTurret") == -1){
mMultipleKillsValid++;
};
//unresolved jump
};
_local3 = false;
if (_arg1._CLASSID_ == "CDevil"){
_local3 = true;
} else {
if (mMultipleKillsValid < 10){
if ((((mMultipleKillsValid == 2)) || ((mMultipleKillsValid == 5)))){
_local3 = true;
};
} else {
if (mMultipleKillsValid < 40){
if ((mMultipleKillsValid % 10) == 0){
_local3 = true;
};
} else {
if ((mMultipleKillsValid % 15) == 0){
_local3 = true;
};
};
};
};
if (_local3){
AddPickup(_arg1);
};
}
private function _getTicks(_arg1:Number):int{
return ((((Math.pow((100 - Math.min(100, _arg1)), 2.5) / Math.pow(100, 2.5)) * ((CWorld.SECONDS * 3) - 1)) + 1));
}
private function get mMultiplierTickRatio():Number{
return (((mMultiplier)==1) ? 0 : (mMultiplierTick / mMultiplierTickTotal));
}
public function AddPickup(_arg1):void{
if ((_arg1.mCellCurrent.mCollide & ~(eWMCCollideType.PEEP)) == 0){
mLevel.mWorld.AddThing(new CPickup_Ammo({mPosition:_arg1.mPosition.Clone().AddXY(0, 0.05)}));
};
}
public function Process():void{
if (mMultipleKillsTick-- < 0){
mMultipleKills = 0;
mMultipleKillsValid = 0;
};
if (mMultiplierTick-- < 0){
mMultiplier--;
};
CGame.mHUD.mMultiplierCounter = ((mMultiplier)>1) ? (mMultiplierTick / mMultiplierTickTotal) : 0;
}
public function get _CLASSID_():String{
return ("CLevelStats");
}
private function ApplyMultiplierUpgrades():void{
if (mMultiplier > mUpgradeMultiplierLevel){
mUpgradeMultiplierLevel = mMultiplier;
if (mLevel.mUpgradePeep){
mLevel.mUpgradePeep.ApplyMultiplierUpgrade(mMultiplier);
};
};
}
private function set mMultipleKills(_arg1:int):void{
_MultipleKills = ((_arg1)<0) ? 0 : _arg1;
if (_MultipleKills){
CGlobalData.AddStat("Highest consecutive kills", _MultipleKills);
mMultipleKillsTickTotal = (mMultipleKillsTick = (_getTicks(_MultipleKills) / 6));
ApplyMultipleKillsUpgrades();
} else {
mMultipleKillsTickTotal = (mMultipleKillsTick = 100000);
mMultipleKillsScore = 0;
};
}
private function get mMultipleKillRatio():Number{
return (((mMultipleKills)==0) ? 0 : (mMultipleKillsTick / mMultipleKillsTickTotal));
}
private function get mMultipleKills():int{
return (_MultipleKills);
}
public function set mMultiplier(_arg1:int):void{
_Multiplier = Math.max(1, Math.min(999, _arg1));
mMultiplierTickTotal = (mMultiplierTick = _getTicks(_Multiplier));
CGlobalData.AddStat("Highest score multiplier", _Multiplier);
CGame.mHUD.mMultiplier = _Multiplier;
if (_arg1 > 1){
ApplyMultiplierUpgrades();
};
}
public function get SScore():CSecureNumber{
return (_Score);
}
}
}//package World
Section 168
//CSpawnPosition (World.CSpawnPosition)
package World {
public class CSpawnPosition {
public var mDirection:String;
public var mRandomizer:Number;
public var mCell:CWMCell;
public function CSpawnPosition(_arg1:CWMCell, _arg2:String):void{
mCell = _arg1;
mDirection = _arg2;
}
public function toString():String{
return (mRandomizer.toString());
}
public function get _CLASSID_():String{
return ("CSpawnPosition");
}
}
}//package World
Section 169
//CWMBase (World.CWMBase)
package World {
public class CWMBase {
public var xCells:Array;
public var mCells:Array;
public var mHeight1:uint;
public var mHeight:uint;
public var dumbCell:CWMCell;
public var mWidth1:uint;
public var mWidth:uint;
public var mAllCells:Array;
public function get _CLASSID_():String{
return ("CWMBase");
}
}
}//package World
Section 170
//CWMCBase (World.CWMCBase)
package World {
import Thing.*;
public class CWMCBase {
public var mMapwhoCount:int;
public var nID:int;
public var sID:String;
public var mCollide:uint;
public var mMapwho:Object;
public var mapX:int;
public var mapY:int;
public function get _CLASSID_():String{
return ("CWMCBase");
}
public function toString():String{
return (_CLASSID_);
}
public function GetThings(_arg1:int, _arg2:int=16775167, _arg3:int=1):Array{
var _local4:Array;
var _local5:CThingAffect;
_local4 = new Array();
for each (_local5 in mMapwho) {
if (!(_arg2 & _local5.mAffectFlags)){
} else {
if (_local5.mCollideID == _arg1){
} else {
if (_local4.push(_local5) >= _arg3){
break;
};
};
};
};
return (_local4);
}
public function Dispose():void{
}
}
}//package World
Section 171
//CWMCell (World.CWMCell)
package World {
import Thing.*;
import flash.geom.*;
import flash.events.*;
public class CWMCell extends CWMCNavigation {
private var mMonitors:Object;
public static const MAPWHOCHANGE:String = "COLLIDECHANGE";
public function CWMCell(_arg1:int, _arg2:int):void{
mapX = _arg1;
mapY = _arg2;
nID = ((mapY << 16) | mapX);
sID = ("WMC" + nID.toString(16));
mMapwho = new Object();
mMapwhoCount = 0;
mMonitors = new Object();
}
public function RemoveMonitor(_arg1:String):void{
delete mMonitors[_arg1];
}
public function RemoveThing(_arg1):void{
mMapwhoCount--;
delete mMapwho[_arg1.mID];
}
public function AddMonitor(_arg1:String, _arg2:Object):void{
mMonitors[_arg1] = _arg2;
mMonitors[_arg1][sID] = this;
}
override public function get _CLASSID_():String{
return ("CWMCell");
}
public function AddThing(_arg1):void{
var _local2:Object;
mMapwho[_arg1.mID] = _arg1;
mMapwhoCount++;
for each (_local2 in mMonitors) {
_local2[sID] = this;
};
}
}
}//package World
Section 172
//CWMCNavigation (World.CWMCNavigation)
package World {
import flash.display.*;
import Thing.*;
import flash.geom.*;
public class CWMCNavigation extends CWMCNeighbours {
public var mNavID:int;
public var mNavTarget;
public var mNavRange:int;
public var mNavIndex:int;
public static const bN_E:int = (bE | bN);
public static const bN_W:int = (bW | bN);
public static const bS_W:int = (bW | bS);
public static const bSW:int = 8;
public static const COLLIDEINDEX:int = 1;
public static const COLLIDEINDEXp1:int = (eWMCCollideType.EDGE + 1);
public static const SEARCHES:Object = {E:["E", "NE", "SE", "N", "S", "NW", "SW", "W"], SE:["SE", "E", "S", "SW", "NE", "W", "N", "NW"], S:["S", "SW", "SE", "W", "E", "NW", "NE", "N"], SW:["SW", "W", "S", "NW", "SE", "E", "N", "NE"], W:["W", "SW", "NW", "S", "N", "NE", "SE", "E"], NW:["NW", "W", "N", "SW", "NE", "S", "E", "SE"], N:["N", "NE", "NW", "E", "W", "SE", "SW", "S"], NE:["NE", "N", "E", "NW", "SE", "W", "S", "SW"]};
public static const bNE:int = 128;
public static const bESNW:int = (((bE | bS) | bN) | bW);
public static const bE:int = 1;
public static const bNW:int = 32;
public static const bN:int = 64;
public static const bS:int = 4;
public static const bSE:int = 2;
public static const bW:int = 16;
public static const bS_E:int = (bE | bS);
private static var moveBits:int;
public function CWMCNavigation():void{
mNavIndex = 1000000;
mNavID = 0;
mNavRange = 0;
}
public function CanMove_1(_arg1:String):Boolean{
var _local2:CWMCNavigation;
_local2 = mNeighbours[_arg1];
if (_local2.mCollide > COLLIDEINDEX){
return (false);
};
return ((_local2.mNavIndex < mNavIndex));
}
public function CanMove_2(_arg1:String):Boolean{
var _local2:CWMCNavigation;
if (mNeighbours[_arg1.charAt(0)].mCollide > COLLIDEINDEX){
return (false);
};
if (mNeighbours[_arg1.charAt(1)].mCollide > COLLIDEINDEX){
return (false);
};
_local2 = mNeighbours[_arg1];
if (_local2.mCollide > COLLIDEINDEX){
return (false);
};
return ((_local2.mNavIndex < mNavIndex));
}
public function MovableNeighbours8_1(_arg1:String, _arg2:Boolean=true):CWMCNavigation{
var _local3:int;
var _local4:CWMCNavigation;
var _local5:String;
var _local6:CWMCNavigation;
moveBits = 0;
if (nEast.mCollide < COLLIDEINDEXp1){
moveBits = (moveBits | bE);
};
if (nSouth.mCollide < COLLIDEINDEXp1){
moveBits = (moveBits | bS);
};
if (nWest.mCollide < COLLIDEINDEXp1){
moveBits = (moveBits | bW);
};
if (nNorth.mCollide < COLLIDEINDEXp1){
moveBits = (moveBits | bN);
};
if (CThing.VERBOSE == true){
};
if (moveBits == 0){
return (null);
};
if (CThing.VERBOSE == true){
};
_local3 = mNavIndex;
_local4 = null;
for each (_local5 in SEARCHES[_arg1]) {
_local6 = mNeighbours[_local5];
if (_local6.mNavIndex > _local3){
} else {
if (this[("CanMove_" + _local5)]()){
_local3 = _local6.mNavIndex;
if ((mNavIndex - _local3) >= 1){
if (CThing.VERBOSE == true){
};
return (_local6);
};
_local4 = _local6;
};
};
};
if (CThing.VERBOSE == true){
};
return (_local4);
}
public function GetNavIndex0():CWMCell{
var _local1:CWMCell;
for each (_local1 in mNeighbours) {
if (_local1.mNavIndex == 0){
return (_local1);
};
};
return (null);
}
public function CanMove(_arg1:String):Boolean{
if (_arg1.length == 1){
return (CanMove_1(_arg1));
};
return (CanMove_2(_arg1));
}
private function CanMove_NE():Boolean{
return ((((nNorthEast.mCollide < COLLIDEINDEXp1)) && ((moveBits & bN_E))));
}
private function CanMove_E():int{
return ((moveBits & bE));
}
private function CanMove_N():int{
return ((moveBits & bN));
}
override public function get _CLASSID_():String{
return ("CWMCNavigation");
}
private function CanMove_S():int{
return ((moveBits & bS));
}
private function CanMove_NW():Boolean{
return ((((nNorthWest.mCollide < COLLIDEINDEXp1)) && ((moveBits & bN_W))));
}
private function CanMove_W():int{
return ((moveBits & bW));
}
private function CanMove_SE():Boolean{
return ((((nSouthEast.mCollide < COLLIDEINDEXp1)) && ((moveBits & bS_E))));
}
private function CanMove_SW():Boolean{
return ((((nSouthWest.mCollide < COLLIDEINDEXp1)) && ((moveBits & bS_W))));
}
private function SortOnNavIndex(_arg1:CWMCNavigation, _arg2:CWMCNavigation):Number{
return (((_arg1.mNavIndex)>_arg2.mNavIndex) ? 1 : ((_arg1.mNavIndex)<_arg2.mNavIndex) ? -1 : 0);
}
public function MovableNeighbours4(_arg1:Boolean=true):Array{
var _local2:Array;
_local2 = new Array();
if (nEast.mCollide <= COLLIDEINDEX){
_local2.push(nEast);
};
if (nWest.mCollide <= COLLIDEINDEX){
_local2.push(nWest);
};
if (nSouth.mCollide <= COLLIDEINDEX){
_local2.push(nSouth);
};
if (nNorth.mCollide <= COLLIDEINDEX){
_local2.push(nNorth);
};
if (((_arg1) && (_local2.length))){
_local2.sort(SortOnNavIndex);
};
return (_local2);
}
public function MovableNeighbours8(_arg1:Boolean=true):Array{
var _local2:Array;
var _local3:Boolean;
var _local4:Boolean;
_local2 = new Array();
_local3 = (nEast.mCollide <= COLLIDEINDEX);
_local4 = (nWest.mCollide <= COLLIDEINDEX);
if (_local3){
_local2.push(nEast);
};
if (_local4){
_local2.push(nWest);
};
if (nSouth.mCollide <= COLLIDEINDEX){
_local2.push(nSouth);
if ((((nSouthEast.mCollide <= COLLIDEINDEX)) && (_local3))){
_local2.push(nSouthEast);
};
if ((((nSouthWest.mCollide <= COLLIDEINDEX)) && (_local4))){
_local2.push(nSouthWest);
};
};
if (nNorth.mCollide <= COLLIDEINDEX){
_local2.push(nNorth);
if ((((nNorthEast.mCollide <= COLLIDEINDEX)) && (_local3))){
_local2.push(nNorthEast);
};
if ((((nNorthWest.mCollide <= COLLIDEINDEX)) && (_local4))){
_local2.push(nNorthWest);
};
};
if (((_arg1) && (_local2.length))){
_local2.sort(SortOnNavIndex);
};
return (_local2);
}
}
}//package World
Section 173
//CWMCNeighbours (World.CWMCNeighbours)
package World {
public class CWMCNeighbours extends CWMCBase {
public var mNeighbours:Object;
public var nWest:CWMCell;
public var nEast:CWMCell;
public var nNorthWest:CWMCell;
public var nNorthEast:CWMCell;
public var nSouthWest:CWMCell;
public var nSouth:CWMCell;
public var nSouthEast:CWMCell;
public var nNorth:CWMCell;
public static const mNeighboursDirections8:Array = ["E", "SE", "S", "SW", "W", "NW", "N", "NE"];
public static const mNeighboursDirections4:Array = ["E", "S", "W", "N"];
public function SetNeighbours(_arg1:CWorldMap):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
_local2 = mapY;
_local3 = (mapY - 1);
_local4 = (mapY + 1);
_local5 = mapX;
_local6 = (mapX - 1);
_local7 = (mapX + 1);
mNeighbours = new Object();
nEast = (mNeighbours["E"] = _arg1.GetCellAt(_local7, _local2));
nSouthEast = (mNeighbours["SE"] = _arg1.GetCellAt(_local7, _local4));
nSouth = (mNeighbours["S"] = _arg1.GetCellAt(_local5, _local4));
nSouthWest = (mNeighbours["SW"] = _arg1.GetCellAt(_local6, _local4));
nWest = (mNeighbours["W"] = _arg1.GetCellAt(_local6, _local2));
nNorthWest = (mNeighbours["NW"] = _arg1.GetCellAt(_local6, _local3));
nNorth = (mNeighbours["N"] = _arg1.GetCellAt(_local5, _local3));
nNorthEast = (mNeighbours["NE"] = _arg1.GetCellAt(_local7, _local3));
}
override public function get _CLASSID_():String{
return ("CWMCNeighbours");
}
}
}//package World
Section 174
//CWMNavigation (World.CWMNavigation)
package World {
import Thing.*;
import flash.geom.*;
import flash.events.*;
import STC9.System.Profiler.*;
import Game.*;
public class CWMNavigation extends CWMWho {
private const NN:uint;
private var mNavID:int;
private var pNavCells:Array;
private var mNavThings:Array;
private var mNavCells:Array;
private static var NM_TARGET;
private static var NM_INDEX:int;
private static var NM_RANGE:int;
public function CWMNavigation(){
NN = eWMCCollideType.NONNAVIGATE;
super();
mNavID = 0;
mNavThings = new Array();
}
public function NavMapAdd(_arg1):void{
mNavThings.push(_arg1);
}
override public function get _CLASSID_():String{
return ("CWMNavigation");
}
private function NM_ProcessStep(_arg1:int):Boolean{
var _local2:int;
var _local3:Object;
var _local4:CWMCell;
while (true) {
if (pNavCells == null){
if (mNavCells.length == 0){
return (false);
};
pNavCells = mNavCells;
mNavCells = new Array();
};
while (pNavCells.length) {
_local4 = pNavCells.pop();
NM_RANGE = (_local4.mNavRange - 1);
if (NM_RANGE >= 0){
NM_TARGET = _local4.mNavTarget;
NM_INDEX = (_local4.mNavIndex + 1);
_local3 = _local4.mNeighbours;
_AddCell(_local3["E"]);
_AddCell(_local3["S"]);
_AddCell(_local3["W"]);
_AddCell(_local3["N"]);
};
--_arg1;
if (_arg1 <= 0){
return (true);
};
};
pNavCells = null;
};
return (true);
}
public function _AddCell(_arg1:CWMCell):void{
if (_arg1.mNavID == mNavID){
return;
};
if ((_arg1.mCollide & NN)){
return;
};
mNavCells.push(_arg1);
_arg1.mNavID = mNavID;
_arg1.mNavIndex = NM_INDEX;
_arg1.mNavTarget = NM_TARGET;
_arg1.mNavRange = NM_RANGE;
}
public function NavMapRemove(_arg1):void{
mNavThings.splice(mNavThings.indexOf(_arg1), 1);
}
public function NavMapProcess():void{
var _local1:*;
var _local2:CWMCell;
if (mNavThings.length == 0){
return;
};
if (mNavCells == null){
mNavCells = new Array();
mNavID++;
CFPS.AddDebug("NV_ThingCount", String(mNavThings.length));
for each (_local1 in mNavThings) {
if (!_local1.mExists){
} else {
_local2 = _local1.mCellCurrent;
if (_local2){
mNavCells.push(_local2);
_local2.mNavIndex = 0;
_local2.mNavTarget = _local1;
_local2.mNavID = mNavID;
_local2.mNavRange = _local1.mNavRange;
};
};
};
};
if (NM_ProcessStep(500) == false){
mNavCells = null;
};
if (pNavCells != null){
CFPS.AddDebug("NV_pNavCells", String(pNavCells.length));
};
if (mNavCells != null){
CFPS.AddDebug("NV_mNavCells", String(mNavCells.length));
};
}
}
}//package World
Section 175
//CWMSearch (World.CWMSearch)
package World {
import flash.display.*;
import Thing.*;
import flash.geom.*;
import STC9.Bitmap.*;
import flash.events.*;
public class CWMSearch extends CWMBase {
public var _GTL_ldx:Number;
public var _GTL_ldy:Number;
public var _GTL_COLLIDE:Function;
public var _GTL_POI:Point;
public var _GTL_1divldv:Number;
public var _GTL_OFFLOC:Point;
public var _GTL_ZEROLOC:CThingV3;
public var _GTL_ldv:Number;
private static const LS_ANGLES:int = 0x0100;
public static const a256PI:Number = 40.7436654315252;
private static const LS_LENGTH:int = 16;
public static var mSearchLines:Array;
public function GetCellAt(_arg1:uint, _arg2:uint):CWMCell{
return (((((_arg1 >= mWidth)) || ((_arg2 >= mHeight)))) ? dumbCell : mCells[_arg2][_arg1]);
}
public function _GTL_COLLIDE_TL(_arg1:Number, _arg2:Number):Boolean{
if (_GTL_LineIntersectsLineX(_arg1, _arg2)){
return (true);
};
if (_GTL_LineIntersectsLineY(_arg1, _arg2)){
return (true);
};
return (false);
}
public function IsValidCellPosition(_arg1:uint, _arg2:uint):Boolean{
return (!((((_arg1 >= mWidth)) || ((_arg2 >= mHeight)))));
}
public function _GTL_Setup(_arg1:Point, _arg2:Point):void{
_GTL_ldx = (_arg2.x - _arg1.x);
_GTL_ldy = (_arg2.y - _arg1.y);
_GTL_ldv = ((_GTL_ldx * _GTL_ldx) + (_GTL_ldy * _GTL_ldy));
_GTL_1divldv = (1 / _GTL_ldv);
_GTL_ZEROLOC = new CThingV3(_arg1.x, _arg1.y);
_GTL_OFFLOC = new Point((_arg1.x % 1), (_arg1.y % 1));
_GTL_POI = null;
_GTL_COLLIDE = ((_GTL_ldy)>=0) ? ((_GTL_ldx)>=0) ? _GTL_COLLIDE_TL : _GTL_COLLIDE_TR : ((_GTL_ldx)>=0) ? _GTL_COLLIDE_BL : _GTL_COLLIDE_BR;
}
public function _GTL_COLLIDE_TR(_arg1:Number, _arg2:Number):Boolean{
if (_GTL_LineIntersectsLineX(_arg1, _arg2)){
return (true);
};
if (_GTL_LineIntersectsLineY((_arg1 + 1), _arg2)){
return (true);
};
return (false);
}
public function GetCellsRadius(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Function=null):Array{
return (GetCells(new CWMSearchArea((_arg1 - _arg3), (_arg2 - _arg3), (_arg3 * 2), (_arg3 * 2)), _arg4));
}
override public function get _CLASSID_():String{
return ("CWMSearch");
}
public function GetCells(_arg1:CWMSearchArea, _arg2:Function=null):Array{
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Array;
_local3 = new Array();
if (!_arg1.valid){
return (_local3);
};
_local5 = _arg1.right;
if (_arg2 != null){
_local6 = _arg1.top;
_local7 = _arg1.bottom;
while (_local6 <= _local7) {
_local4 = _arg1.left;
_local8 = mCells[_local6];
while (_local4 <= _local5) {
if (_arg2(_local8[_local4])){
_local3.push(_local8[_local4]);
};
_local4++;
};
_local6++;
};
} else {
_local6 = _arg1.top;
_local7 = _arg1.bottom;
while (_local6 <= _local7) {
_local4 = _arg1.left;
_local8 = mCells[_local6];
while (_local4 <= _local5) {
_local3.push(_local8[_local4]);
_local4++;
};
_local6++;
};
};
return (_local3);
}
public function _GTL_LineIntersectsRadius(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local6 = ((_GTL_ldx * _arg1) + (_GTL_ldy * _arg2));
if (_local6 <= 0){
return ((((_arg1 * _arg1) + (_arg2 * _arg2)) <= (_arg3 * _arg3)));
};
if (_GTL_ldv <= _local6){
_arg1 = (_arg1 - _GTL_ldx);
_arg2 = (_arg2 - _GTL_ldy);
return ((((_arg1 * _arg1) + (_arg2 * _arg2)) <= (_arg3 * _arg3)));
};
_local7 = (_local6 * _GTL_1divldv);
_local8 = (_arg1 - (_GTL_ldx * _local7));
_local9 = (_arg2 - (_GTL_ldy * _local7));
return ((((_local8 * _local8) + (_local9 * _local9)) <= (_arg3 * _arg3)));
}
public function GetCellsLine(_arg1:Point, _arg2:Point, _arg3:Number=0, _arg4:Boolean=false):Array{
var _local5:int;
var _local6:Array;
var _local7:Number;
var _local8:Object;
var _local9:CWMCell;
var _local10:int;
var _local11:int;
var _local12:Array;
var _local13:*;
_GTL_Setup(_arg1, _arg2);
_local5 = ((Math.atan2(_GTL_ldy, _GTL_ldx) * a256PI) & 0xFF);
_local6 = mSearchLines[_local5];
_local7 = (Math.sqrt(_GTL_ldv) + _arg3);
if (_arg4){
_local12 = new Array();
for each (_local8 in _local6) {
_local9 = GetCellAt((_arg1.x + _local8.x), (_arg1.y + _local8.y));
if ((_local9.mCollide & eWMCCollideType.SOLID)){
if (_GTL_COLLIDE((_local8.x - _GTL_OFFLOC.x), (_local8.y - _GTL_OFFLOC.y))){
break;
};
};
for each (_local13 in _local9.mMapwho) {
_local12.push(_local13);
};
if (_local8.len > _local7){
break;
};
};
return (_local12);
};
return (new Array());
}
public function QGetCellAt(_arg1:int, _arg2:int):CWMCell{
return (mCells[_arg2][_arg1]);
}
public function _GTL_LineIntersectsLineX(_arg1:Number, _arg2:Number):Boolean{
var _local3:Number;
var _local4:Number;
if (Math.abs(_GTL_ldy) < 1E-6){
return (false);
};
_local3 = (_arg2 / _GTL_ldy);
if ((((_local3 < 0)) || ((_local3 > 1)))){
return (false);
};
_local4 = (((_GTL_ldy * _arg1) - (_GTL_ldx * _arg2)) / -(_GTL_ldy));
if ((((_local4 >= 0)) && ((_local4 <= 1)))){
_GTL_POI = new Point((_GTL_ZEROLOC.x + (_local3 * _GTL_ldx)), (_GTL_ZEROLOC.y + (_local3 * _GTL_ldy)));
return (true);
};
return (false);
}
public function _GTL_LineIntersectsLineY(_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=1):Boolean{
var _local5:Number;
var _local6:Number;
if (Math.abs(_GTL_ldx) < 1E-6){
return (false);
};
_local5 = (_arg1 / _GTL_ldx);
if ((((_local5 < 0)) || ((_local5 > 1)))){
return (false);
};
_local6 = (((_GTL_ldy * _arg1) - (_GTL_ldx * _arg2)) / _GTL_ldx);
if ((((_local6 >= 0)) && ((_local6 <= 1)))){
_GTL_POI = new Point((_GTL_ZEROLOC.x + (_local5 * _GTL_ldx)), (_GTL_ZEROLOC.y + (_local5 * _GTL_ldy)));
return (true);
};
return (false);
}
public function QLineOfSight(_arg1:Point, _arg2:Point, _arg3:Number=0):Boolean{
var _local4:int;
var _local5:Array;
var _local6:Number;
var _local7:Object;
var _local8:CWMCell;
_GTL_Setup(_arg1, _arg2);
_local4 = ((Math.atan2(_GTL_ldy, _GTL_ldx) * a256PI) & 0xFF);
_local5 = mSearchLines[_local4];
_local6 = (Math.sqrt(_GTL_ldv) + _arg3);
for each (_local7 in _local5) {
_local8 = GetCellAt((_arg1.x + _local7.x), (_arg1.y + _local7.y));
if ((_local8.mCollide & eWMCCollideType.SOLID)){
if (_GTL_COLLIDE((_local7.x - _GTL_OFFLOC.x), (_local7.y - _GTL_OFFLOC.y))){
return (false);
};
};
if (_local7.len > _local6){
return (true);
};
};
return (false);
}
public function _GTL_COLLIDE_BL(_arg1:Number, _arg2:Number):Boolean{
if (_GTL_LineIntersectsLineX(_arg1, (_arg2 + 1))){
return (true);
};
if (_GTL_LineIntersectsLineY(_arg1, _arg2)){
return (true);
};
return (false);
}
public function _GTL_COLLIDE_BR(_arg1:Number, _arg2:Number):Boolean{
if (_GTL_LineIntersectsLineX(_arg1, (_arg2 + 1))){
return (true);
};
if (_GTL_LineIntersectsLineY((_arg1 + 1), _arg2)){
return (true);
};
return (false);
}
private static function Sort_LineSearchPoints(_arg1:Object, _arg2:Object):Number{
return (((_arg1.len)>_arg2.len) ? 1 : ((_arg1.len)<_arg2.len) ? -1 : 0);
}
public static function CreateLineSearches():void{
var _local1:Sprite;
var _local2:CBitmapData;
var _local3:Point;
var _local4:Point;
var _local5:Rectangle;
var _local6:Array;
var _local7:Array;
var _local8:Matrix;
var _local9:int;
var _local10:Point;
var _local11:Array;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
_local1 = new Sprite();
_local2 = new CBitmapData(((LS_LENGTH * 2) + 1), ((LS_LENGTH * 2) + 1), false, 0);
_local3 = new Point((LS_LENGTH + 0.5), (LS_LENGTH + 0.5));
_local4 = new Point(LS_LENGTH, LS_LENGTH);
_local5 = new Rectangle(-0.5, -1.5, LS_LENGTH, 3);
_local6 = [new Point(_local5.left, _local5.top), new Point(_local5.left, _local5.bottom), new Point(_local5.right, _local5.bottom), new Point(_local5.right, _local5.top)];
_local7 = new Array();
_local8 = new Matrix();
_local9 = 0;
mSearchLines = new Array();
_local9 = LS_ANGLES;
while (_local9) {
_local7[0] = _local8.transformPoint(_local6[0]);
_local7[1] = _local8.transformPoint(_local6[1]);
_local7[2] = _local8.transformPoint(_local6[2]);
_local7[3] = _local8.transformPoint(_local6[3]);
_local1.graphics.clear();
_local1.graphics.beginFill(0xFF00, 1);
_local1.graphics.moveTo((_local3.x + _local7[3].x), (_local3.y + _local7[3].y));
for each (_local10 in _local7) {
_local1.graphics.lineTo((_local3.x + _local10.x), (_local3.y + _local10.y));
};
_local1.graphics.endFill();
_local2.fillRect(_local2.rect, 0);
_local2.draw(_local1, null, null, null, null, false);
_local11 = new Array();
_local12 = 0;
while (_local12 < _local2.height) {
_local13 = 0;
while (_local13 < _local2.width) {
if (_local2.getPixel(_local13, _local12)){
_local14 = (_local13 - _local4.x);
_local15 = (_local12 - _local4.y);
_local11.push({x:_local14, y:_local15, len:Math.sqrt(((_local14 * _local14) + (_local15 * _local15)))});
};
_local13++;
};
_local12++;
};
_local11.sort(Sort_LineSearchPoints);
mSearchLines.push(_local11);
_local8.rotate((Math.PI / 128));
_local9--;
};
_local2.dispose();
}
}
}//package World
Section 176
//CWMSearchArea (World.CWMSearchArea)
package World {
public class CWMSearchArea {
public var valid:Boolean;
public var bottom:uint;
public var left:uint;
public var top:uint;
public var right:uint;
public static var mWidth1:uint;
public static var mHeight1:uint;
public function CWMSearchArea(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
if ((((((((_arg1 > mWidth1)) || (((_arg1 + _arg3) < 0)))) || ((_arg2 > mHeight1)))) || (((_arg2 + _arg4) < 0)))){
valid = false;
return;
};
valid = true;
left = ((_arg1)<0) ? 0 : _arg1;
top = ((_arg2)<0) ? 0 : _arg2;
right = (((_arg1 + _arg3))>mWidth1) ? mWidth1 : (_arg1 + _arg3);
bottom = (((_arg2 + _arg4))>mHeight1) ? mHeight1 : (_arg2 + _arg4);
}
public function get _CLASSID_():String{
return ("CWMSearchArea");
}
}
}//package World
Section 177
//CWMWho (World.CWMWho)
package World {
import Thing.*;
import flash.geom.*;
import flash.events.*;
import STC9.System.Profiler.*;
public class CWMWho extends CWMSearch {
public function GetThingsRadius(_arg1:Number, _arg2:Number, _arg3:Number):Array{
return (GetThings(new CWMSearchArea((_arg1 - _arg3), (_arg2 - _arg3), (_arg3 * 2), (_arg3 * 2))));
}
public function GetThings(_arg1:CWMSearchArea):Array{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Array;
var _local7:*;
var _local8:int;
var _local9:CWMCell;
_local2 = new Array();
if (!_arg1.valid){
return (_local2);
};
_local8 = _arg1.right;
_local4 = _arg1.top;
_local5 = _arg1.bottom;
while (_local4 <= _local5) {
_local6 = mCells[_local4];
_local3 = _arg1.left;
while (_local3 <= _local8) {
for each (_local7 in _local6[_local3].mMapwho) {
_local2.push(_local7);
};
_local3++;
};
_local4++;
};
return (_local2);
}
public function RemoveThing(_arg1, _arg2:CWMCell):void{
_arg2.RemoveThing(_arg1);
}
public function GetThingsLine(_arg1:int, _arg2:Point, _arg3:Point, _arg4:Number=0, _arg5:int=16775167, _arg6:int=1):Object{
var _local7:Array;
var _local8:Array;
var _local9:CThingAffect;
var _local10:CThingV3;
_local7 = new Array();
_local8 = GetCellsLine(_arg2, _arg3, _arg4, true);
for each (_local9 in _local8) {
if (!(_arg5 & _local9.mAffectFlags)){
} else {
if (_local9.mCollideID == _arg1){
} else {
_local10 = _local9.mPosition.Clone().Sub(_GTL_ZEROLOC);
if (_GTL_LineIntersectsRadius(_local10.x, _local10.y, (_arg4 + _local9.mCollideRadius))){
_local7.push(_local9);
if (_local7.length >= _arg6){
break;
};
};
};
};
};
return ({mImpactPOI:_GTL_POI, mThings:_local7});
}
override public function get _CLASSID_():String{
return ("CWMWho");
}
public function AddThing(_arg1:CThing):CWMCell{
var _local2:CWMCell;
_local2 = GetCellAt(_arg1.mPosition.x, _arg1.mPosition.y);
_local2.AddThing(_arg1);
return (_local2);
}
}
}//package World
Section 178
//CWorld (World.CWorld)
package World {
import Thing.*;
import flash.geom.*;
import Landscape.*;
import flash.events.*;
import IO.*;
import STC9.System.Profiler.*;
import Screen.*;
import Game.*;
import STC9.IO.*;
public class CWorld {
public var mThingContainer:CThingMain;
public var mState:String;
public var mPause:Boolean;
public var mTick:int;
public var mTrackThing:CPeepPlayer;
public var mLandscape:CLandscape;
public var mMap:CWorldMap;
public var mLevel:CLevel;
public static const SECONDS:int = 25;
public function CWorld(_arg1:CLandscape){
mLandscape = _arg1;
mThingContainer = new CThingMain();
mTick = 0;
mPause = false;
mMap = new CWorldMap(_arg1.mLSDraw.mCells);
CThingV3.SetMapSize(mMap.mWidth, mMap.mHeight);
mLandscape.mLSThingDraw.mWorldMap = mMap;
mLevel = new CLevel(this);
}
public function Process():void{
if (mPause){
return;
};
mMap.Process();
mLevel.Process();
mThingContainer.ProcessChildren();
mMap.NavMapProcess();
mTick++;
if (CBuild.mDEBUG){
if (CKeyboard.IsReleased("G")){
CThing.VERBOSE = false;
};
if (CKeyboard.IsReleased("F")){
CThing.VERBOSE = true;
};
};
}
public function get _CLASSID_():String{
return ("CWorld");
}
public function AddThing(_arg1){
return (mThingContainer.AddThing(_arg1));
}
public function Start():void{
var _local1:int;
var _local2:CThingV3;
var _local3:Object;
var _local4:CPeepPlayer;
var _local5:Object;
var _local6:Boolean;
CThing.Restart();
_local2 = mLandscape.mPlayerInitPositions[0].mPosition;
_local3 = (_local2) ? {mPosition:_local2} : null;
_local4 = AddThing(new CBambo(_local3));
_local4.ActivateControl(CScreen_Config.GetPlayerControl(0));
for each (_local5 in mLandscape.mThingInitPositions) {
_local6 = false;
if (CGame.mLevelData.mMode != "DEFENCE"){
switch (_local5.initClass.toString()){
case "[class CTree]":
case "[class CRock]":
_local6 = true;
break;
};
} else {
_local6 = true;
};
if (_local6){
AddThing(new _local5.initClass(_local5, _local4));
};
};
mTrackThing = _local4;
mLevel.mUpgradePeep = _local4;
mLevel.Start();
}
public function Dispose():void{
CScreen_Debrief.SScore = mLevel.mLevelStats.SScore;
mThingContainer.Dispose();
mThingContainer = null;
mLevel = null;
mMap = null;
}
}
}//package World
Section 179
//CWorldMap (World.CWorldMap)
package World {
import Thing.*;
import flash.geom.*;
import flash.events.*;
public class CWorldMap extends CWMNavigation {
public function CWorldMap(_arg1:Array){
CreateCells(_arg1);
CWMSearch.CreateLineSearches();
}
public function CreateCells(_arg1:Array):void{
var _local2:CWMCell;
var _local3:int;
var _local4:int;
var _local5:Array;
var _local6:CWMCell;
mWidth = _arg1[0].length;
mHeight = _arg1.length;
mWidth1 = (mWidth - 1);
mHeight1 = (mHeight - 1);
mCells = new Array();
mAllCells = new Array();
_local4 = 0;
while (_local4 < mHeight) {
_local3 = 0;
_local5 = (mCells[_local4] = new Array());
while (_local3 < mWidth) {
_local6 = new CWMCell(_local3, _local4);
_local6.mCollide = _arg1[_local4][_local3].mCollide;
_local5.push(_local6);
mAllCells.push(_local6);
_local3++;
};
_local4++;
};
dumbCell = new CWMCell(0, 0);
dumbCell.mCollide = (eWMCCollideType.SOLID | eWMCCollideType.DUMBCELL);
for each (_local2 in mAllCells) {
_local2.SetNeighbours(this);
};
}
override public function get _CLASSID_():String{
return ("CWorldMap");
}
public function Process():void{
CWMSearchArea.mWidth1 = mWidth1;
CWMSearchArea.mHeight1 = mHeight1;
}
}
}//package World
Section 180
//eWMCCollideType (World.eWMCCollideType)
package World {
public class eWMCCollideType {
public static const NONMOVABLE:uint = ((((((PEEP | SOLID) | TREE) | TURRET) | ROCK) | BARREL) | BARRICADE);
public static const DUMBCELL:uint = 0x0200;
public static const BARRICADE:uint = 0x0100;
public static const SOLID:uint = 2;
public static const NONINITABLE:uint = 0xFFFF;
public static const INVALIDANDIE:uint = (SOLID | DUMBCELL);
public static const TREE:uint = 16;
public static const PEEP:uint = 4;
public static const PLAYER:uint = 8;
public static const ROCK:uint = 32;
public static const BARREL:uint = 64;
public static const NONNAVIGATE:uint = (((((SOLID | TREE) | TURRET) | ROCK) | BARREL) | BARRICADE);
public static const TURRET:uint = 128;
public static const NONE:uint = 0;
public static const EDGE:uint = 1;
public static const NONPLACEMENT:uint = (NONMOVABLE | EDGE);
}
}//package World
Section 181
//Airstrike_Beacon (Airstrike_Beacon)
package {
import flash.display.*;
public dynamic class Airstrike_Beacon extends MovieClip {
public var _Contents:MovieClip;
}
}//package
Section 182
//Airstrike_Plane (Airstrike_Plane)
package {
import flash.media.*;
public dynamic class Airstrike_Plane extends Sound {
}
}//package
Section 183
//Barrel_Place (Barrel_Place)
package {
import flash.media.*;
public dynamic class Barrel_Place extends Sound {
}
}//package
Section 184
//BloodDecal (BloodDecal)
package {
import flash.display.*;
public dynamic class BloodDecal extends MovieClip {
public var _Content:MovieClip;
}
}//package
Section 185
//Brush_Collision (Brush_Collision)
package {
import Landscape.*;
public dynamic class Brush_Collision extends CLSCtrlCollision {
public function Brush_Collision(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package
Section 186
//Brush_Cover (Brush_Cover)
package {
import Landscape.*;
public dynamic class Brush_Cover extends CLSCtrlCoverMask {
public function Brush_Cover(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package
Section 187
//CBuild (CBuild)
package {
public class CBuild {
public static const mSkipIntro:Boolean = (mDEBUG) ? true : false;
;
public static const mDEBUG:Boolean = false;
public static const UNLIMITEDAMMO:Boolean = false;
public static const PLAYERDOESNOTDIES:Boolean = false;
public static const mKongregateStats:Boolean = true;
public static const mLoadingTime:int = (mDEBUG) ? 1 : 10;
;
}
}//package
Section 188
//Cell_Indicator (Cell_Indicator)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Cell_Indicator extends Sprite {
public var tbIndex:TextField;
public var _BG:MovieClip;
}
}//package
Section 189
//Click (Click)
package {
import flash.media.*;
public dynamic class Click extends Sound {
}
}//package
Section 190
//ClickShort (ClickShort)
package {
import flash.media.*;
public dynamic class ClickShort extends Sound {
}
}//package
Section 191
//Cliff_04x04_00 (Cliff_04x04_00)
package {
import Landscape.*;
public dynamic class Cliff_04x04_00 extends CLSCtrlCover {
}
}//package
Section 192
//Cliff_1120x1120_01 (Cliff_1120x1120_01)
package {
import Landscape.*;
public dynamic class Cliff_1120x1120_01 extends CLSCtrlCover {
}
}//package
Section 193
//Cliff_560x560_01 (Cliff_560x560_01)
package {
import Landscape.*;
public dynamic class Cliff_560x560_01 extends CLSCtrlCover {
}
}//package
Section 194
//Cliff_560x560_02 (Cliff_560x560_02)
package {
import Landscape.*;
public dynamic class Cliff_560x560_02 extends CLSCtrlCover {
}
}//package
Section 195
//ContainerNode (ContainerNode)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ContainerNode extends MovieClip {
public var tfLeft:TextField;
public var tfRight:TextField;
}
}//package
Section 196
//CVersion (CVersion)
package {
public class CVersion {
public static function get mMinorVersion():String{
return ("00233");
}
public static function get mVersionString():String{
return ((((((mName + ": ") + mVersionID) + " (") + mCompileDate) + ")"));
}
public static function get mCompileDate():String{
return ("01/04/2008 11:59");
}
public static function get mVersionName():String{
return ("Final");
}
public static function get mName():String{
return ("BXH_ZW");
}
public static function get mMajorVersion():String{
return ("1");
}
public static function get mVersionID():String{
return (((((mVersionName + ".") + mMajorVersion) + ".") + mMinorVersion));
}
}
}//package
Section 197
//Devil_Attack (Devil_Attack)
package {
import flash.media.*;
public dynamic class Devil_Attack extends Sound {
}
}//package
Section 198
//Effect_Explosion_Dome (Effect_Explosion_Dome)
package {
import flash.display.*;
public dynamic class Effect_Explosion_Dome extends MovieClip {
public var _Contents:MovieClip;
}
}//package
Section 199
//Effect_RocketSmoke (Effect_RocketSmoke)
package {
import flash.display.*;
public dynamic class Effect_RocketSmoke extends MovieClip {
}
}//package
Section 200
//Effect_Slope_Feel (Effect_Slope_Feel)
package {
import Landscape.*;
public dynamic class Effect_Slope_Feel extends CLSCtrlEffect {
}
}//package
Section 201
//Effect_Slope_Feel_Large (Effect_Slope_Feel_Large)
package {
import Landscape.*;
public dynamic class Effect_Slope_Feel_Large extends CLSCtrlEffect {
}
}//package
Section 202
//Explosion_0 (Explosion_0)
package {
import flash.media.*;
public dynamic class Explosion_0 extends Sound {
}
}//package
Section 203
//Explosion_0001 (Explosion_0001)
package {
import flash.display.*;
public dynamic class Explosion_0001 extends MovieClip {
}
}//package
Section 204
//Fire_0 (Fire_0)
package {
import flash.media.*;
public dynamic class Fire_0 extends Sound {
}
}//package
Section 205
//Fire_0001 (Fire_0001)
package {
import flash.display.*;
public dynamic class Fire_0001 extends MovieClip {
}
}//package
Section 206
//GONG (GONG)
package {
import flash.media.*;
public dynamic class GONG extends Sound {
}
}//package
Section 207
//Grass_16x16 (Grass_16x16)
package {
import Landscape.*;
public dynamic class Grass_16x16 extends CLSCtrlFloor {
}
}//package
Section 208
//Grass_RockPatch_8x8_1 (Grass_RockPatch_8x8_1)
package {
import Landscape.*;
public dynamic class Grass_RockPatch_8x8_1 extends CLSCtrlFloor {
}
}//package
Section 209
//Grenade_Bounce (Grenade_Bounce)
package {
import flash.media.*;
public dynamic class Grenade_Bounce extends Sound {
}
}//package
Section 210
//HUD_KillScore (HUD_KillScore)
package {
import flash.display.*;
public dynamic class HUD_KillScore extends Sprite {
public var _Contents:MovieClip;
}
}//package
Section 211
//HUD_Level (HUD_Level)
package {
import flash.display.*;
public dynamic class HUD_Level extends MovieClip {
public var _Contents:MovieClip;
}
}//package
Section 212
//HUD_Message (HUD_Message)
package {
import flash.display.*;
public dynamic class HUD_Message extends Sprite {
public var _Contents:MovieClip;
}
}//package
Section 213
//HUD_Multiplier (HUD_Multiplier)
package {
import flash.display.*;
public dynamic class HUD_Multiplier extends Sprite {
public var _Contents:MovieClip;
}
}//package
Section 214
//HUD_Player (HUD_Player)
package {
import flash.display.*;
public dynamic class HUD_Player extends MovieClip {
public var mcAmmo:MovieClip;
public var mcLife:MovieClip;
}
}//package
Section 215
//HUD_Score (HUD_Score)
package {
import flash.display.*;
public dynamic class HUD_Score extends Sprite {
public var _Contents:MovieClip;
}
}//package
Section 216
//HUD_Turret (HUD_Turret)
package {
import flash.display.*;
public dynamic class HUD_Turret extends MovieClip {
public var mcAmmo:MovieClip;
public var mcLife:MovieClip;
}
}//package
Section 217
//Init_Barricade (Init_Barricade)
package {
import Landscape.*;
public dynamic class Init_Barricade extends CLSCtrlBarricade {
}
}//package
Section 218
//Init_Player (Init_Player)
package {
import Landscape.*;
public dynamic class Init_Player extends CLSCtrlPlayer {
}
}//package
Section 219
//Init_Tree (Init_Tree)
package {
import Landscape.*;
public dynamic class Init_Tree extends CLSCtrlTree {
}
}//package
Section 220
//Init_TurretMG (Init_TurretMG)
package {
import Landscape.*;
public dynamic class Init_TurretMG extends CLSCtrlTurretMG {
}
}//package
Section 221
//Init_TurretMortor (Init_TurretMortor)
package {
import Landscape.*;
public dynamic class Init_TurretMortor extends CLSCtrlTurretMortor {
}
}//package
Section 222
//Init_TurretRockets (Init_TurretRockets)
package {
import Landscape.*;
public dynamic class Init_TurretRockets extends CLSCtrlTurretRockets {
}
}//package
Section 223
//Large_MuzzleFlash (Large_MuzzleFlash)
package {
import flash.display.*;
public dynamic class Large_MuzzleFlash extends MovieClip {
public var mcFront:MovieClip;
public var mcTop:MovieClip;
}
}//package
Section 224
//Level_00 (Level_00)
package {
import flash.display.*;
public dynamic class Level_00 extends MovieClip {
public var _Size:MovieClip;
}
}//package
Section 225
//Level_01 (Level_01)
package {
import flash.display.*;
public dynamic class Level_01 extends MovieClip {
public var _Size:MovieClip;
}
}//package
Section 226
//Level_02 (Level_02)
package {
import flash.display.*;
public dynamic class Level_02 extends MovieClip {
public var _Size:MovieClip;
}
}//package
Section 227
//Level_03 (Level_03)
package {
import flash.display.*;
public dynamic class Level_03 extends MovieClip {
public var _Size:MovieClip;
}
}//package
Section 228
//Level_Collections (Level_Collections)
package {
import flash.display.*;
public dynamic class Level_Collections extends MovieClip {
}
}//package
Section 229
//LIcon (LIcon)
package {
import flash.display.*;
public dynamic class LIcon extends SimpleButton {
}
}//package
Section 230
//Medium_MuzzleFlash (Medium_MuzzleFlash)
package {
import flash.display.*;
public dynamic class Medium_MuzzleFlash extends MovieClip {
public var mcFront:MovieClip;
public var mcTop:MovieClip;
}
}//package
Section 231
//Mine_Detonate (Mine_Detonate)
package {
import flash.media.*;
public dynamic class Mine_Detonate extends Sound {
}
}//package
Section 232
//Mine_Place (Mine_Place)
package {
import flash.media.*;
public dynamic class Mine_Place extends Sound {
}
}//package
Section 233
//Minigun_Start (Minigun_Start)
package {
import flash.media.*;
public dynamic class Minigun_Start extends Sound {
}
}//package
Section 234
//Minigun_Stop (Minigun_Stop)
package {
import flash.media.*;
public dynamic class Minigun_Stop extends Sound {
}
}//package
Section 235
//Missile_Flare (Missile_Flare)
package {
import flash.display.*;
public dynamic class Missile_Flare extends MovieClip {
public var _Contents:MovieClip;
}
}//package
Section 236
//Object_Mine (Object_Mine)
package {
import flash.display.*;
public dynamic class Object_Mine extends MovieClip {
public var _Contents:MovieClip;
}
}//package
Section 237
//Object_Rock (Object_Rock)
package {
import flash.display.*;
public dynamic class Object_Rock extends MovieClip {
public var _Contents:MovieClip;
}
}//package
Section 238
//Object_Tree (Object_Tree)
package {
import flash.display.*;
public dynamic class Object_Tree extends MovieClip {
public var _Contents:MovieClip;
}
}//package
Section 239
//Peep_HitFloor (Peep_HitFloor)
package {
import flash.media.*;
public dynamic class Peep_HitFloor extends Sound {
}
}//package
Section 240
//Pickup_Ammo (Pickup_Ammo)
package {
import flash.media.*;
public dynamic class Pickup_Ammo extends Sound {
}
}//package
Section 241
//Pickup_Powerup (Pickup_Powerup)
package {
import flash.media.*;
public dynamic class Pickup_Powerup extends Sound {
}
}//package
Section 242
//Pistol_Shot1 (Pistol_Shot1)
package {
import flash.media.*;
public dynamic class Pistol_Shot1 extends Sound {
}
}//package
Section 243
//Protection (Protection)
package {
import IO.*;
public dynamic class Protection extends CProtection {
}
}//package
Section 244
//Ricochet_Metal_0 (Ricochet_Metal_0)
package {
import flash.media.*;
public dynamic class Ricochet_Metal_0 extends Sound {
}
}//package
Section 245
//Ricochet_Metal_1 (Ricochet_Metal_1)
package {
import flash.media.*;
public dynamic class Ricochet_Metal_1 extends Sound {
}
}//package
Section 246
//Ricochet_Metal_2 (Ricochet_Metal_2)
package {
import flash.media.*;
public dynamic class Ricochet_Metal_2 extends Sound {
}
}//package
Section 247
//Rock_02_02 (Rock_02_02)
package {
import Landscape.*;
public dynamic class Rock_02_02 extends CLSCtrlFloor {
}
}//package
Section 248
//Rock_04_04 (Rock_04_04)
package {
import Landscape.*;
public dynamic class Rock_04_04 extends CLSCtrlFloor {
}
}//package
Section 249
//Rocket_Shot1 (Rocket_Shot1)
package {
import flash.media.*;
public dynamic class Rocket_Shot1 extends Sound {
}
}//package
Section 250
//ScorchMarkDecal (ScorchMarkDecal)
package {
import flash.display.*;
public dynamic class ScorchMarkDecal extends MovieClip {
public var _Content:MovieClip;
}
}//package
Section 251
//Screen_Collection (Screen_Collection)
package {
import Screen.*;
public dynamic class Screen_Collection extends CScreenCollection {
}
}//package
Section 252
//Screen_Config (Screen_Config)
package {
import Screen.*;
public dynamic class Screen_Config extends CScreen_Config {
}
}//package
Section 253
//Screen_Credits (Screen_Credits)
package {
import Screen.*;
public dynamic class Screen_Credits extends CScreen_Credits {
}
}//package
Section 254
//Screen_Debrief (Screen_Debrief)
package {
import Screen.*;
public dynamic class Screen_Debrief extends CScreen_Debrief {
}
}//package
Section 255
//Screen_LoadLevel (Screen_LoadLevel)
package {
import Screen.*;
public dynamic class Screen_LoadLevel extends CScreen_LoadLevel {
}
}//package
Section 256
//Screen_Main (Screen_Main)
package {
import Screen.*;
public dynamic class Screen_Main extends CScreen_Main {
}
}//package
Section 257
//Screen_MoreGames (Screen_MoreGames)
package {
import Screen.*;
public dynamic class Screen_MoreGames extends CScreen_MoreGames {
}
}//package
Section 258
//Screen_Pause (Screen_Pause)
package {
import Screen.*;
public dynamic class Screen_Pause extends CScreen_Pause {
}
}//package
Section 259
//Screen_PostScore (Screen_PostScore)
package {
import Screen.*;
public dynamic class Screen_PostScore extends CScreen_PostScore {
}
}//package
Section 260
//Screen_SelectLevel (Screen_SelectLevel)
package {
import Screen.*;
public dynamic class Screen_SelectLevel extends CScreen_SelectLevel {
}
}//package
Section 261
//ShadowMaker (ShadowMaker)
package {
import flash.display.*;
public dynamic class ShadowMaker extends MovieClip {
public var _Shadow2:MovieClip;
public var _Shadow1:MovieClip;
public var _Container:MovieClip;
}
}//package
Section 262
//SheetBambo (SheetBambo)
package {
import flash.display.*;
public dynamic class SheetBambo extends BitmapData {
public function SheetBambo(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 263
//SheetBarrel (SheetBarrel)
package {
import flash.display.*;
public dynamic class SheetBarrel extends BitmapData {
public function SheetBarrel(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 264
//SheetBarricade (SheetBarricade)
package {
import flash.display.*;
public dynamic class SheetBarricade extends BitmapData {
public function SheetBarricade(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 265
//SheetDevil (SheetDevil)
package {
import flash.display.*;
public dynamic class SheetDevil extends BitmapData {
public function SheetDevil(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 266
//SheetMummy (SheetMummy)
package {
import flash.display.*;
public dynamic class SheetMummy extends BitmapData {
public function SheetMummy(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 267
//SheetPickup_Ammo (SheetPickup_Ammo)
package {
import flash.display.*;
public dynamic class SheetPickup_Ammo extends BitmapData {
public function SheetPickup_Ammo(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 268
//SheetPickup_Powerup (SheetPickup_Powerup)
package {
import flash.display.*;
public dynamic class SheetPickup_Powerup extends BitmapData {
public function SheetPickup_Powerup(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 269
//SheetRunner (SheetRunner)
package {
import flash.display.*;
public dynamic class SheetRunner extends BitmapData {
public function SheetRunner(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 270
//SheetTurret_MG (SheetTurret_MG)
package {
import flash.display.*;
public dynamic class SheetTurret_MG extends BitmapData {
public function SheetTurret_MG(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 271
//SheetTurret_Mortor (SheetTurret_Mortor)
package {
import flash.display.*;
public dynamic class SheetTurret_Mortor extends BitmapData {
public function SheetTurret_Mortor(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 272
//SheetTurret_Rockets (SheetTurret_Rockets)
package {
import flash.display.*;
public dynamic class SheetTurret_Rockets extends BitmapData {
public function SheetTurret_Rockets(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 273
//SheetVampire (SheetVampire)
package {
import flash.display.*;
public dynamic class SheetVampire extends BitmapData {
public function SheetVampire(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 274
//SheetZombie (SheetZombie)
package {
import flash.display.*;
public dynamic class SheetZombie extends BitmapData {
public function SheetZombie(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 275
//Shot_ClusterShell (Shot_ClusterShell)
package {
import flash.display.*;
public dynamic class Shot_ClusterShell extends MovieClip {
}
}//package
Section 276
//Shot_Grenade (Shot_Grenade)
package {
import flash.display.*;
public dynamic class Shot_Grenade extends MovieClip {
}
}//package
Section 277
//Shotgun_Shot1 (Shotgun_Shot1)
package {
import flash.media.*;
public dynamic class Shotgun_Shot1 extends Sound {
}
}//package
Section 278
//Small_MuzzleFlash (Small_MuzzleFlash)
package {
import flash.display.*;
public dynamic class Small_MuzzleFlash extends MovieClip {
public var mcFront:MovieClip;
public var mcTop:MovieClip;
}
}//package
Section 279
//Smoke_0001 (Smoke_0001)
package {
import flash.display.*;
public dynamic class Smoke_0001 extends MovieClip {
}
}//package
Section 280
//Smoke_0002 (Smoke_0002)
package {
import flash.display.*;
public dynamic class Smoke_0002 extends MovieClip {
}
}//package
Section 281
//Turret_MG_Shot_1 (Turret_MG_Shot_1)
package {
import flash.media.*;
public dynamic class Turret_MG_Shot_1 extends Sound {
}
}//package
Section 282
//Turret_MG_Shot_2 (Turret_MG_Shot_2)
package {
import flash.media.*;
public dynamic class Turret_MG_Shot_2 extends Sound {
}
}//package
Section 283
//Turret_MG_Shot_3 (Turret_MG_Shot_3)
package {
import flash.media.*;
public dynamic class Turret_MG_Shot_3 extends Sound {
}
}//package
Section 284
//Turret_Mortor_Shot (Turret_Mortor_Shot)
package {
import flash.media.*;
public dynamic class Turret_Mortor_Shot extends Sound {
}
}//package
Section 285
//Turret_Place (Turret_Place)
package {
import flash.media.*;
public dynamic class Turret_Place extends Sound {
}
}//package
Section 286
//UZI_Shot1 (UZI_Shot1)
package {
import flash.media.*;
public dynamic class UZI_Shot1 extends Sound {
}
}//package
Section 287
//Vampire_Disappear (Vampire_Disappear)
package {
import flash.media.*;
public dynamic class Vampire_Disappear extends Sound {
}
}//package