Section 1
//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 2
//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 3
//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 4
//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 5
//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 6
//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 7
//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 8
//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 9
//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 10
//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 11
//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 12
//KongregateAPI (com.kongregate.as3.client.KongregateAPI)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
import com.kongregate.as3.client.events.*;
import com.kongregate.as3.client.services.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
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 13
//AdLoader (defclass.cpmstar.AdLoader)
package defclass.cpmstar {
import flash.events.*;
import flash.display.*;
import flash.system.*;
import flash.net.*;
public class AdLoader extends Sprite {
private var contentspotid:String;
private var cpmstarLoader:Loader;
public function AdLoader(contentspotid:String){
super();
this.contentspotid = contentspotid;
addEventListener(Event.ADDED, addedHandler);
}
private function addedHandler(event:Event):void{
var cpmstarViewSWFUrl:String;
var container:DisplayObjectContainer;
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
cpmstarViewSWFUrl = "http://server.cpmstar.com/adviewas3.swf";
container = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
cpmstarLoader.load(new URLRequest(((cpmstarViewSWFUrl + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
private function dispatchHandler(event:Event):void{
dispatchEvent(event);
}
}
}//package defclass.cpmstar
Section 14
//HostManager (defclass.host.HostManager)
package defclass.host {
import flash.events.*;
import defclass.mochi.*;
import defclass.swfstats.*;
import flash.utils.*;
import defclass.cpmstar.*;
import flash.net.*;
import flash.ui.*;
public class HostManager {
private var usegameninjasites;
public var bboxid;// = "1473"
private var usekongsites;
private var nomochiadsites;
public var cpmprerollid:String;// = "1524QB0F37219"
public var usecpmad;// = true
public var mochibotid:String;// = "d2f0c20f"
public var usekong;// = true
private var cpmtimer;// = 0
private var nocpmadsites;
private var noswfstatssites;
public var usegameninja;// = true
public var bboxname;// = "elephantvsmouse"
public var usestatic;// = false
public var algid;// = "elephantvsmouse"
private var tracing:Boolean;// = true
private var cpmad;
private var nomochibotsites;
public var mochiadid:String;// = "357a9f990b57ea7d"
public var usemochibot;// = true
public var useswfstats;// = false
private var noadsites;
public var usead;// = true
public var url;
private var usestaticsites;
private var maintimeline;
public var cpmitlevelid:String;// = "1525Q75A9A067"
public var usemochiad;// = false
public function HostManager(_mtl){
var i:*;
var res:*;
var date:*;
tracing = true;
algid = "elephantvsmouse";
bboxname = "elephantvsmouse";
bboxid = "1473";
mochiadid = "357a9f990b57ea7d";
mochibotid = "d2f0c20f";
cpmprerollid = "1524QB0F37219";
cpmitlevelid = "1525Q75A9A067";
usead = true;
usecpmad = true;
usemochiad = false;
usemochibot = true;
useswfstats = false;
usestatic = false;
usekong = true;
usegameninja = true;
noadsites = [];
nocpmadsites = ["yoarcade.net", "kongregate.com", "http://external.kongregate-games.com/"];
nomochiadsites = ["yoarcade.net"];
nomochibotsites = ["armorgames.com"];
noswfstatssites = ["armorgames.com"];
usestaticsites = ["http://www.yoarcade.net", "http://yoarcade.net"];
usekongsites = ["kongregate.com", "external.kongregate-games.com"];
usegameninjasites = ["gameninja.com"];
cpmtimer = 0;
super();
date = new Date();
maintimeline = _mtl;
url = maintimeline.loaderInfo.loaderURL;
i = 0;
while (i < noadsites.length) {
if (url.indexOf(noadsites[i]) > -1){
usead = false;
};
i++;
};
i = 0;
while (i < nocpmadsites.length) {
if (url.indexOf(nocpmadsites[i]) > -1){
usecpmad = false;
};
i++;
};
i = 0;
while (i < nomochiadsites.length) {
if (url.indexOf(nomochiadsites[i]) > -1){
usemochiad = false;
};
i++;
};
i = 0;
while (i < nomochibotsites.length) {
if (url.indexOf(nomochibotsites[i]) > -1){
usemochibot = false;
};
i++;
};
i = 0;
while (i < noswfstatssites.length) {
if (url.indexOf(noswfstatssites[i]) > -1){
useswfstats = false;
};
i++;
};
i = 0;
while (i < usestaticsites.length) {
if (((usestatic) && ((url.indexOf(usestaticsites[i]) > -1)))){
usestatic = false;
};
i++;
};
usecpmad = ((usecpmad) && (usead));
usemochiad = ((((usemochiad) && (!(usecpmad)))) && (usead));
if (usemochibot){
MochiBot.track(maintimeline, mochibotid);
};
if (useswfstats){
Tracker.Initialise(url);
};
res = false;
i = 0;
while (i < usekongsites.length) {
res = ((res) || ((url.indexOf(usekongsites[i]) > -1)));
i++;
};
usekong = ((usekong) && (res));
res = false;
i = 0;
while (i < usegameninjasites.length) {
res = ((res) || ((url.indexOf(usegameninjasites[i]) > -1)));
i++;
};
usegameninja = ((usegameninja) && (res));
if (tracing){
trace(("Reading host : " + url));
trace(("Advertisements : " + (usead) ? "ON" : "OFF"));
trace(("CPMad : " + (usecpmad) ? "ON" : "OFF"));
trace(("Mochiad : " + (usemochiad) ? "ON" : "OFF"));
trace(("Mochibot : " + (usemochibot) ? "ON" : "OFF"));
trace(("SWFStats : " + (useswfstats) ? "ON" : "OFF"));
trace(("Locking : " + (usestatic) ? "ON" : "OFF"));
trace(("KongAPI : " + (usekong) ? "ON" : "OFF"));
trace(("GameNinjaAPI : " + (usegameninja) ? "ON" : "OFF"));
};
createContextMenu();
}
public function createContextMenu(){
var item1:ContextMenuItem;
var myMenu:*;
item1 = new ContextMenuItem("© 2009 Artlogic Games™");
item1.separatorBefore = true;
item1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, goArtlogic, false, 0, true);
myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
myMenu.customItems.push(item1);
maintimeline.contextMenu = myMenu;
}
public function goSponsor(e=null){
navigateToURL(new URLRequest("http://www.yoarcade.net"), "_blank");
}
public function clearCPMAds(_mc, _destroy=false){
_mc.removeChild(cpmad);
if (((((getTimer() - cpmtimer) > 60000)) || (_destroy))){
cpmad = null;
};
}
public function goHighscore(e=null){
navigateToURL(new URLRequest("http://www.yoarcade.net"), "_blank");
}
public function goFacebook(e=null){
navigateToURL(new URLRequest("http://apps.facebook.com/flysquirrelfly"), "_blank");
}
public function goArtlogic(e=null){
navigateToURL(new URLRequest(("http://artlogicgames.com/?gamereferral=" + algid)), "_blank");
}
public function getCPMAds(_mc, _param){
if (usecpmad){
if (((!(cpmad)) || (((getTimer() - cpmtimer) > 60000)))){
cpmtimer = getTimer();
if (_param == "preload"){
cpmad = new AdLoader(cpmprerollid);
} else {
cpmad = new AdLoader(cpmitlevelid);
};
};
} else {
if (!cpmad){
cpmad = new mc_default_adbox();
cpmad.buttonMode = true;
cpmad.addEventListener(MouseEvent.CLICK, goSponsor, false, 0, true);
};
};
_mc.addChild(cpmad);
}
}
}//package defclass.host
Section 15
//KongregateDataManager (defclass.host.KongregateDataManager)
package defclass.host {
import com.kongregate.as3.client.events.*;
import com.kongregate.as3.client.*;
public class KongregateDataManager {
private var maintimeline;
private var kongregate:KongregateAPI;
private var kongregateServiceLoaded:Boolean;// = false
public function KongregateDataManager(_mtl){
kongregateServiceLoaded = false;
super();
maintimeline = _mtl;
kongregate = new KongregateAPI();
maintimeline.addChild(kongregate);
kongregate.addEventListener(KongregateEvent.COMPLETE, serviceLoaded, false, 0, true);
}
private function serviceLoaded(e:KongregateEvent):void{
kongregate.services.connect();
kongregateServiceLoaded = true;
}
public function submitStat(_params){
var i:*;
if (((kongregate) && (kongregateServiceLoaded))){
for (i in _params) {
kongregate.stats.submit(i, _params[i]);
};
};
}
}
}//package defclass.host
Section 16
//MochiBot (defclass.mochi.MochiBot)
package defclass.mochi {
import flash.display.*;
import flash.system.*;
import flash.net.*;
public dynamic class MochiBot extends Sprite {
public function MochiBot(){
super();
}
public static function track(parent:Sprite, tag:String):MochiBot{
var self:MochiBot;
var server:String;
var lv:URLVariables;
var url:String;
var req:URLRequest;
var loader:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
self = new (MochiBot);
parent.addChild(self);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
server = "http://core.mochibot.com/my/core.swf";
lv = new URLVariables();
lv["sb"] = Security.sandboxType;
lv["v"] = Capabilities.version;
lv["swfid"] = tag;
lv["mv"] = "8";
lv["fv"] = "9";
url = self.root.loaderInfo.loaderURL;
if (url.indexOf("http") == 0){
lv["url"] = url;
} else {
lv["url"] = "local";
};
req = new URLRequest(server);
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
self.addChild(loader);
loader.load(req);
return (self);
}
}
}//package defclass.mochi
Section 17
//BaseSound (defclass.sound.BaseSound)
package defclass.sound {
import flash.events.*;
import flash.media.*;
import flash.utils.*;
public class BaseSound extends Sound {
private var sndTransform:SoundTransform;
public var sndPlaying:Boolean;
private var sndFadeOut:Boolean;
private var sndFadeIn:Boolean;
private var sndPosTime:Number;
private var loop:Boolean;
private var sndObj:Sound;
private var sndChannel:SoundChannel;
private var sndTimer:Timer;
private var sndVolume:Number;
private var sndPan:Number;
public function BaseSound(){
super();
sndObj = this;
sndChannel = null;
sndTransform = null;
sndVolume = 1;
sndPan = 0;
sndPosTime = 0;
sndFadeIn = false;
sndFadeOut = false;
loop = false;
}
public function setVolume(vol:Number):void{
var sndTransform:SoundTransform;
sndVolume = vol;
if (sndChannel){
sndTransform = sndChannel.soundTransform;
sndTransform.volume = sndVolume;
sndChannel.soundTransform = sndTransform;
};
}
public function stopSound():void{
if (sndChannel){
sndPlaying = false;
sndChannel.stop();
sndChannel.removeEventListener(Event.SOUND_COMPLETE, sound_loop);
loop = false;
};
}
public function fadeOut(init:Boolean):void{
sndFadeOut = true;
sndFadeIn = false;
if (init){
setVolume(1);
};
if (!sndTimer){
sndTimer = new Timer(50);
sndTimer.addEventListener(TimerEvent.TIMER, sndTimerHandler, false, 0, true);
sndTimer.start();
};
}
public function pauseSound():void{
if (sndChannel){
sndPlaying = false;
sndPosTime = sndChannel.position;
sndChannel.stop();
sndChannel.removeEventListener(Event.SOUND_COMPLETE, sound_loop);
};
}
public function playSound():void{
stopSound();
sndChannel = sndObj.play();
sndChannel.addEventListener(Event.SOUND_COMPLETE, sound_complete, false, 0, true);
setVolume(sndVolume);
setPan(sndPan);
sndPlaying = true;
}
public function fadeIn(init:Boolean):void{
sndFadeIn = true;
sndFadeOut = false;
if (init){
setVolume(0);
};
if (!sndTimer){
sndTimer = new Timer(50);
sndTimer.addEventListener(TimerEvent.TIMER, sndTimerHandler, false, 0, true);
sndTimer.start();
};
}
private function sndTimerHandler(event:TimerEvent):void{
if (((sndFadeIn) && (sndFadeOut))){
sndFadeIn = false;
sndFadeOut = false;
setVolume(1);
};
if (sndFadeIn){
sndVolume = (sndVolume + 0.01);
if (sndVolume > 1){
setVolume(1);
sndFadeIn = false;
} else {
setVolume(sndVolume);
};
};
if (sndFadeOut){
sndVolume = (sndVolume - 0.01);
if (sndVolume < 0){
setVolume(0);
sndFadeOut = false;
} else {
setVolume(sndVolume);
};
};
}
public function setPan(pan:Number):void{
var sndTransform:SoundTransform;
sndPan = pan;
if (sndChannel){
sndTransform = sndChannel.soundTransform;
sndTransform.pan = sndPan;
sndChannel.soundTransform = sndTransform;
};
}
public function resumeSound():void{
stopSound();
sndChannel = sndObj.play(sndPosTime);
if (loop){
sndChannel.addEventListener(Event.SOUND_COMPLETE, sound_loop, false, 0, true);
};
setVolume(sndVolume);
setPan(sndPan);
sndPlaying = true;
}
private function sound_complete(event:Event){
sndChannel.removeEventListener(Event.SOUND_COMPLETE, sound_complete);
sndPlaying = false;
}
private function sound_loop(event:Event){
sndChannel = sndObj.play();
setVolume(sndVolume);
setPan(sndPan);
sndPlaying = true;
sndChannel.addEventListener(Event.SOUND_COMPLETE, sound_loop, false, 0, true);
}
public function playSoundLoop():void{
stopSound();
sndChannel = sndObj.play();
sndChannel.addEventListener(Event.SOUND_COMPLETE, sound_loop, false, 0, true);
setVolume(sndVolume);
setPan(sndPan);
sndPlaying = true;
loop = true;
}
}
}//package defclass.sound
Section 18
//Config (defclass.swfstats.Config)
package defclass.swfstats {
import flash.utils.*;
public class Config {
public static const LevelLabels:Dictionary = new Dictionary();
public static const GUID:String = "c7780af6-d01e-4cfd-ab4e-59bfbca4e6b7";
public static const LevelCounterMetrics:Dictionary = new Dictionary();
public static const ScoreTables:Dictionary = new Dictionary();
public static const LevelRangedMetrics:Dictionary = new Dictionary();
public static const CustomMetrics:Dictionary = new Dictionary();
public static const SWFID:int = 82;
public function Config(){
super();
}
}
}//package defclass.swfstats
Section 19
//Tracker (defclass.swfstats.Tracker)
package defclass.swfstats {
import flash.events.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.external.*;
public class Tracker {
public static const Random:Number = Math.random();
private static const Ping:Timer = new Timer(30000);
public static var Initialised:Boolean = false;
public static var SourceUrl:String;
public static var DebugMode:Boolean = true;
public function Tracker(){
super();
}
public static function LogView():void{
var sendaction:URLLoader;
if (SourceUrl == null){
return;
};
if (DebugMode){
trace("SWFStats.Tracker.LogView");
};
sendaction = new URLLoader();
sendaction.addEventListener(IOErrorEvent.IO_ERROR, ErrorHandler);
sendaction.load(new URLRequest(((((((("http://tracker.swfstats.com/games/view.aspx?guid=" + Config.GUID) + "&swfid=") + Config.SWFID) + "&url=") + SourceUrl) + "&") + Random)));
Ping.addEventListener(TimerEvent.TIMER, PingServer);
Ping.start();
}
public static function ErrorHandler(e:IOErrorEvent):void{
if (DebugMode){
trace("** ERROR COMPLETING URL REQUEST TO SWFSTATS **");
};
SourceUrl = null;
}
private static function PingServer(e:Event):void{
var sendaction:URLLoader;
if (SourceUrl == null){
return;
};
if (DebugMode){
trace("SWFStats.Tracker.PingServer");
};
sendaction = new URLLoader();
sendaction.addEventListener(IOErrorEvent.IO_ERROR, ErrorHandler);
sendaction.load(new URLRequest(((((((("http://tracker.swfstats.com/games/ping.aspx?guid=" + Config.GUID) + "&swfid=") + Config.SWFID) + "&url=") + SourceUrl) + "&") + Random)));
}
public static function Initialise(defaulturl:String, turnoffdebugmode:Boolean=false):void{
var defaulturl = defaulturl;
var turnoffdebugmode = turnoffdebugmode;
DebugMode = (turnoffdebugmode) ? false : (Security.sandboxType == "localTrusted");
if (DebugMode){
trace("SWFStats.Tracker.Initialise");
};
if ((((Config.SWFID == 0)) || ((Config.GUID == "")))){
if (DebugMode){
trace("** ERROR YOU MUST COPY YOUR DATA INTO CONFIG.AS **");
trace(" You have not copied your settings into SWFStats\\Config.as.");
trace(" Solution:");
trace(" 1) Go to http://my.swfstats.com/");
trace(" 2) Select your game and go into the 'API Code' section");
trace(" 3) Copy your data into SWFStats\\Config.as");
};
return;
};
Initialised = true;
if (((!((defaulturl.indexOf("http://") == 0))) && (!((Security.sandboxType == "localTrusted"))))){
return;
};
SourceUrl = GetUrl(defaulturl);
Security.loadPolicyFile("http://tracker.swfstats.com/crossdomain.xml");
Security.loadPolicyFile("http://utils.swfstats.com/crossdomain.xml");
//unresolved jump
var _slot1 = s;
SourceUrl = null;
return;
if (DebugMode){
trace("** ERROR COULD NOT LOAD SWFSTATS POLICY FILE **");
};
}
public static function LogPlay():void{
var sendaction:URLLoader;
if (SourceUrl == null){
return;
};
if (DebugMode){
trace("SWFStats.Tracker.LogPlay");
};
sendaction = new URLLoader();
sendaction.addEventListener(IOErrorEvent.IO_ERROR, ErrorHandler);
sendaction.load(new URLRequest(((((((("http://tracker.swfstats.com/games/play.aspx?guid=" + Config.GUID) + "&swfid=") + Config.SWFID) + "&url=") + SourceUrl) + "&") + Random)));
}
private static function GetUrl(defaulturl:String):String{
var url:String;
var defaulturl = defaulturl;
url = String(ExternalInterface.call("window.location.href.toString"));
//unresolved jump
var _slot1 = s;
url = ((defaulturl)!=null) ? defaulturl : "";
return (((url)!="null") ? url : "");
}
}
}//package defclass.swfstats
Section 20
//TweenEquations (defclass.tweener.TweenEquations)
package defclass.tweener {
public class TweenEquations {
public static var equations:Array = new Array();
public function TweenEquations(){
super();
trace("TweenEquations is a static class and should not be instantiated.");
}
public static function easeOutBounce(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
if (t < (1 / 2.75)){
return (((c * ((7.5625 * t) * t)) + b));
};
if (t < (2 / 2.75)){
t = (t - (1.5 / 2.75));
return (((c * (((7.5625 * t) * t) + 0.75)) + b));
};
if (t < (2.5 / 2.75)){
t = (t - (2.25 / 2.75));
return (((c * (((7.5625 * t) * t) + 0.9375)) + b));
};
t = (t - (2.625 / 2.75));
return (((c * (((7.5625 * t) * t) + 0.984375)) + b));
}
public static function easeInOutElastic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var p:Number;
var s:Number;
var a:Number;
if (t == 0){
return (b);
};
t = (t / (d / 2));
if (t == 2){
return ((b + c));
};
p = (((!(Boolean(p_params))) || (isNaN(p_params.period)))) ? (d * (0.3 * 1.5)) : p_params.period;
a = (((!(Boolean(p_params))) || (isNaN(p_params.amplitude)))) ? 0 : p_params.amplitude;
if (((!(Boolean(a))) || ((a < Math.abs(c))))){
a = c;
s = (p / 4);
} else {
s = ((p / (2 * Math.PI)) * Math.asin((c / a)));
};
if (t < 1){
--t;
return (((-0.5 * ((a * Math.pow(2, (10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p)))) + b));
};
--t;
return ((((((a * Math.pow(2, (-10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p))) * 0.5) + c) + b));
}
public static function easeInOutQuad(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return (((((c / 2) * t) * t) + b));
};
--t;
return ((((-(c) / 2) * ((t * (t - 2)) - 1)) + b));
}
public static function easeInOutBounce(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (((easeInBounce((t * 2), 0, c, d) * 0.5) + b));
};
return ((((easeOutBounce(((t * 2) - d), 0, c, d) * 0.5) + (c * 0.5)) + b));
}
public static function easeInOutBack(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number;
s = (((!(Boolean(p_params))) || (isNaN(p_params.overshoot)))) ? 1.70158 : p_params.overshoot;
t = (t / (d / 2));
if (t < 1){
s = (s * 1.525);
return ((((c / 2) * ((t * t) * (((s + 1) * t) - s))) + b));
};
t = (t - 2);
s = (s * 1.525);
return ((((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b));
}
public static function easeOutInCubic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutCubic((t * 2), b, (c / 2), d, p_params));
};
return (easeInCubic(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeNone(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return ((((c * t) / d) + b));
}
public static function easeOutBack(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number;
s = (((!(Boolean(p_params))) || (isNaN(p_params.overshoot)))) ? 1.70158 : p_params.overshoot;
t = ((t / d) - 1);
return (((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b));
}
public static function easeInOutSine(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return ((((-(c) / 2) * (Math.cos(((Math.PI * t) / d)) - 1)) + b));
}
public static function easeInBack(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number;
s = (((!(Boolean(p_params))) || (isNaN(p_params.overshoot)))) ? 1.70158 : p_params.overshoot;
t = (t / d);
return (((((c * t) * t) * (((s + 1) * t) - s)) + b));
}
public static function easeInQuart(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return ((((((c * t) * t) * t) * t) + b));
}
public static function easeOutInQuint(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutQuint((t * 2), b, (c / 2), d, p_params));
};
return (easeInQuint(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeOutInBounce(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutBounce((t * 2), b, (c / 2), d, p_params));
};
return (easeInBounce(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function init():void{
equations = new Array();
equations["easenone"] = easeNone;
equations["linear"] = easeNone;
equations["easeinquad"] = easeInQuad;
equations["easeoutquad"] = easeOutQuad;
equations["easeinoutquad"] = easeInOutQuad;
equations["easeoutinquad"] = easeOutInQuad;
equations["easeincubic"] = easeInCubic;
equations["easeoutcubic"] = easeOutCubic;
equations["easeinoutcubic"] = easeInOutCubic;
equations["easeoutincubic"] = easeOutInCubic;
equations["easeinquart"] = easeInQuart;
equations["easeoutquart"] = easeOutQuart;
equations["easeinoutquart"] = easeInOutQuart;
equations["easeoutinquart"] = easeOutInQuart;
equations["easeinquint"] = easeInQuint;
equations["easeoutquint"] = easeOutQuint;
equations["easeinoutquint"] = easeInOutQuint;
equations["easeoutinquint"] = easeOutInQuint;
equations["easeinsine"] = easeInSine;
equations["easeoutsine"] = easeOutSine;
equations["easeinoutsine"] = easeInOutSine;
equations["easeoutinsine"] = easeOutInSine;
equations["easeincirc"] = easeInCirc;
equations["easeoutcirc"] = easeOutCirc;
equations["easeinoutcirc"] = easeInOutCirc;
equations["easeoutincirc"] = easeOutInCirc;
equations["easeinexpo"] = easeInExpo;
equations["easeoutexpo"] = easeOutExpo;
equations["easeinoutexpo"] = easeInOutExpo;
equations["easeoutinexpo"] = easeOutInExpo;
equations["easeinelastic"] = easeInElastic;
equations["easeoutelastic"] = easeOutElastic;
equations["easeinoutelastic"] = easeInOutElastic;
equations["easeoutinelastic"] = easeOutInElastic;
equations["easeinback"] = easeInBack;
equations["easeoutback"] = easeOutBack;
equations["easeinoutback"] = easeInOutBack;
equations["easeoutinback"] = easeOutInBack;
equations["easeinbounce"] = easeInBounce;
equations["easeoutbounce"] = easeOutBounce;
equations["easeinoutbounce"] = easeInOutBounce;
equations["easeoutinbounce"] = easeOutInBounce;
}
public static function easeOutExpo(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return (((t)==d) ? (b + c) : (((c * 1.001) * (-(Math.pow(2, ((-10 * t) / d))) + 1)) + b));
}
public static function easeOutInBack(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutBack((t * 2), b, (c / 2), d, p_params));
};
return (easeInBack(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeInExpo(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return (((t)==0) ? b : (((c * Math.pow(2, (10 * ((t / d) - 1)))) + b) - (c * 0.001)));
}
public static function easeInCubic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return (((((c * t) * t) * t) + b));
}
public static function easeInQuint(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return (((((((c * t) * t) * t) * t) * t) + b));
}
public static function easeInOutCirc(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return ((((-(c) / 2) * (Math.sqrt((1 - (t * t))) - 1)) + b));
};
t = (t - 2);
return ((((c / 2) * (Math.sqrt((1 - (t * t))) + 1)) + b));
}
public static function easeInQuad(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return ((((c * t) * t) + b));
}
public static function easeInBounce(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return (((c - easeOutBounce((d - t), 0, c, d)) + b));
}
public static function easeOutInExpo(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutExpo((t * 2), b, (c / 2), d, p_params));
};
return (easeInExpo(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeOutQuart(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = ((t / d) - 1);
return (((-(c) * ((((t * t) * t) * t) - 1)) + b));
}
public static function easeInSine(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return ((((-(c) * Math.cos(((t / d) * (Math.PI / 2)))) + c) + b));
}
public static function easeInOutQuart(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return (((((((c / 2) * t) * t) * t) * t) + b));
};
t = (t - 2);
return ((((-(c) / 2) * ((((t * t) * t) * t) - 2)) + b));
}
public static function easeOutInElastic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutElastic((t * 2), b, (c / 2), d, p_params));
};
return (easeInElastic(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeInElastic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var p:Number;
var s:Number;
var a:Number;
if (t == 0){
return (b);
};
t = (t / d);
if (t == 1){
return ((b + c));
};
p = (((!(Boolean(p_params))) || (isNaN(p_params.period)))) ? (d * 0.3) : p_params.period;
a = (((!(Boolean(p_params))) || (isNaN(p_params.amplitude)))) ? 0 : p_params.amplitude;
if (((!(Boolean(a))) || ((a < Math.abs(c))))){
a = c;
s = (p / 4);
} else {
s = ((p / (2 * Math.PI)) * Math.asin((c / a)));
};
--t;
return ((-(((a * Math.pow(2, (10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p)))) + b));
}
public static function easeOutCubic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = ((t / d) - 1);
return (((c * (((t * t) * t) + 1)) + b));
}
public static function easeOutQuint(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = ((t / d) - 1);
return (((c * (((((t * t) * t) * t) * t) + 1)) + b));
}
public static function easeOutInQuad(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutQuad((t * 2), b, (c / 2), d, p_params));
};
return (easeInQuad(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeOutSine(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return (((c * Math.sin(((t / d) * (Math.PI / 2)))) + b));
}
public static function easeOutQuad(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return ((((-(c) * t) * (t - 2)) + b));
}
public static function easeInOutCubic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return ((((((c / 2) * t) * t) * t) + b));
};
t = (t - 2);
return ((((c / 2) * (((t * t) * t) + 2)) + b));
}
public static function easeInOutQuint(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return ((((((((c / 2) * t) * t) * t) * t) * t) + b));
};
t = (t - 2);
return ((((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b));
}
public static function easeInCirc(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return (((-(c) * (Math.sqrt((1 - (t * t))) - 1)) + b));
}
public static function easeOutInSine(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutSine((t * 2), b, (c / 2), d, p_params));
};
return (easeInSine(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeInOutExpo(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t == 0){
return (b);
};
if (t == d){
return ((b + c));
};
t = (t / (d / 2));
if (t < 1){
return (((((c / 2) * Math.pow(2, (10 * (t - 1)))) + b) - (c * 0.0005)));
};
--t;
return (((((c / 2) * 1.0005) * (-(Math.pow(2, (-10 * t))) + 2)) + b));
}
public static function easeOutElastic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var p:Number;
var s:Number;
var a:Number;
if (t == 0){
return (b);
};
t = (t / d);
if (t == 1){
return ((b + c));
};
p = (((!(Boolean(p_params))) || (isNaN(p_params.period)))) ? (d * 0.3) : p_params.period;
a = (((!(Boolean(p_params))) || (isNaN(p_params.amplitude)))) ? 0 : p_params.amplitude;
if (((!(Boolean(a))) || ((a < Math.abs(c))))){
a = c;
s = (p / 4);
} else {
s = ((p / (2 * Math.PI)) * Math.asin((c / a)));
};
return (((((a * Math.pow(2, (-10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p))) + c) + b));
}
public static function easeOutCirc(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = ((t / d) - 1);
return (((c * Math.sqrt((1 - (t * t)))) + b));
}
public static function easeOutInQuart(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutQuart((t * 2), b, (c / 2), d, p_params));
};
return (easeInQuart(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeOutInCirc(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutCirc((t * 2), b, (c / 2), d, p_params));
};
return (easeInCirc(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
}
}//package defclass.tweener
Section 21
//TweenManager (defclass.tweener.TweenManager)
package defclass.tweener {
import flash.events.*;
import flash.display.*;
public class TweenManager {
public var tweenengine:MovieClip;
public var clip:Array;
public var curlive:Array;
public var clipparams:Array;
public var functions:Array;
public function TweenManager(){
super();
TweenEquations.init();
tweenengine = new MovieClip();
tweenengine.addEventListener(Event.ENTER_FRAME, moveClip, false, 0, true);
clip = new Array();
curlive = new Array();
clipparams = new Array();
functions = new Array();
}
public function register(_mc, _params, _function=null){
var i:*;
i = clip.indexOf(_mc);
if (i > -1){
clip.splice(i, 1);
curlive.splice(i, 1);
clipparams.splice(i, 1);
functions.splice(i, 1);
};
i = clip.length;
clip.push(_mc);
curlive.push(0);
clipparams.push({live:0, ease:"easenone", x:0, y:0, alpha:1, rotation:0, scalex:1, scaley:1, startx:0, starty:0, startalpha:1, startrotation:0, startscalex:1, startscaley:1});
clipparams[i].live = _params.live;
clipparams[i].ease = _params.ease;
clipparams[i].x = _params.x;
clipparams[i].y = _params.y;
clipparams[i].alpha = _params.alpha;
clipparams[i].rotation = _params.rotation;
clipparams[i].scalex = _params.scalex;
clipparams[i].scaley = _params.scaley;
clipparams[i].startx = clip[i].x;
clipparams[i].starty = clip[i].y;
clipparams[i].startalpha = clip[i].alpha;
clipparams[i].startrotation = clip[i].rotation;
clipparams[i].startscalex = clip[i].scaleX;
clipparams[i].startscaley = clip[i].scaleY;
if (((_function) && (_function["scope"]))){
functions.push(_function);
} else {
functions.push({scope:null});
};
}
private function applyFunction(_n, _event){
if (((functions[_n]["scope"]) && (functions[_n][_event]))){
functions[_n][_event].apply(functions[_n]["scope"], [clip[_n]]);
};
}
private function moveClip(e){
var i:*;
var cek:*;
cek = true;
i = (clip.length - 1);
while (i > -1) {
var _local4 = curlive;
var _local5 = i;
var _local6 = (_local4[_local5] + 1);
_local4[_local5] = _local6;
if (curlive[i] <= clipparams[i].live){
if (Math.abs((clipparams[i].x - clip[i].x)) > 1){
cek = false;
clip[i].x = TweenEquations.equations[clipparams[i].ease].apply(clip, [curlive[i], clipparams[i].startx, (clipparams[i].x - clipparams[i].startx), clipparams[i].live]);
};
if (Math.abs((clipparams[i].y - clip[i].y)) > 1){
cek = false;
clip[i].y = TweenEquations.equations[clipparams[i].ease].apply(clip, [curlive[i], clipparams[i].starty, (clipparams[i].y - clipparams[i].starty), clipparams[i].live]);
};
if (Math.abs((clipparams[i].alpha - clip[i].alpha)) > 0.01){
cek = false;
clip[i].alpha = TweenEquations.equations[clipparams[i].ease].apply(clip, [curlive[i], clipparams[i].startalpha, (clipparams[i].alpha - clipparams[i].startalpha), clipparams[i].live]);
};
if (Math.abs((clipparams[i].rotation - clip[i].rotation)) > 1){
cek = false;
clip[i].rotation = TweenEquations.equations[clipparams[i].ease].apply(clip, [curlive[i], clipparams[i].startrotation, (clipparams[i].rotation - clipparams[i].startrotation), clipparams[i].live]);
};
if (Math.abs((clipparams[i].scalex - clip[i].scaleX)) > 0.01){
cek = false;
clip[i].scaleX = TweenEquations.equations[clipparams[i].ease].apply(clip, [curlive[i], clipparams[i].startscalex, (clipparams[i].scalex - clipparams[i].startscalex), clipparams[i].live]);
};
if (Math.abs((clipparams[i].scaley - clip[i].scaleY)) > 0.01){
cek = false;
clip[i].scaleY = TweenEquations.equations[clipparams[i].ease].apply(clip, [curlive[i], clipparams[i].startscaley, (clipparams[i].scaley - clipparams[i].startscaley), clipparams[i].live]);
};
applyFunction(i, "onrefresh");
};
if (((cek) || ((curlive[i] > clipparams[i].live)))){
unregister(i);
};
i--;
};
}
public function clearScreen(_scr){
while (_scr.numChildren > 0) {
_scr.removeChild(_scr.getChildAt(0));
};
}
public function unregister(_n){
var f:*;
var p:*;
var o:*;
f = functions[_n];
p = clipparams[_n];
o = clip[_n];
clip.splice(_n, 1);
curlive.splice(_n, 1);
clipparams.splice(_n, 1);
functions.splice(_n, 1);
if (((f["scope"]) && (f["onfinished"]))){
f["onfinished"].apply(f["scope"], [o]);
};
}
}
}//package defclass.tweener
Section 22
//ButtonManager (defclass.ui.ButtonManager)
package defclass.ui {
import flash.events.*;
import defclass.tweener.*;
import flash.geom.*;
public class ButtonManager {
private var prepress:Boolean;
private var curpress:Boolean;
private var tweenmgr:TweenManager;
private var curpos:Point;
private var groupmode:Array;
private var functions:Array;
public var button:Array;
public var status:Array;
private var group:Array;
public function ButtonManager(_btn, _group=null, _groupmode=null){
var i:*;
var j:*;
super();
functions = new Array();
status = new Array();
button = new Array();
i = 0;
while (i < _btn.length) {
functions.push({scope:null, onover:null, onout:null, onselect:null, ondeselect:null});
status.push(0);
button.push(_btn[i]);
i++;
};
group = new Array();
groupmode = new Array();
if (_group){
i = 0;
while (i < _group.length) {
group.push(new Array());
j = 0;
while (j < _group[i].length) {
group[i].push(_group[i][j]);
j++;
};
groupmode.push(_groupmode[i]);
if (groupmode[i] == "toggle"){
btnActivate(button[group[i][0]]);
};
i++;
};
};
}
public function activateButton(_idx){
if (status[_idx] > -1){
btnActivate(button[_idx]);
};
}
public function moveClip(_pos, _press){
}
public function resetButtons(){
var i:*;
i = 0;
while (i < button.length) {
button[i].gotoAndStop(1);
status[i] = 0;
i++;
};
i = 0;
while (i < groupmode.length) {
if (groupmode[i] == "toggle"){
btnActivate(button[group[i][0]]);
};
i++;
};
}
private function doMouseClick(e){
var idx:*;
idx = btnIndex(e.target);
btnActivate(e.target);
}
private function btnGroup(_btn):int{
var idx:*;
var res:*;
var i:*;
idx = btnIndex(_btn);
if (idx > -1){
res = -1;
i = 0;
while ((((res < 0)) && ((i < group.length)))) {
if (group[i].indexOf(idx) > -1){
res = group[i].indexOf(idx);
};
i++;
};
if (res > -1){
return ((i - 1));
};
return (-1);
//unresolved jump
};
return (-1);
}
public function enableButton(_idx){
if (status[_idx] == -1){
status[_idx] = 0;
button[_idx].enabled = true;
};
}
public function unlockButton(_idx){
if (status[_idx] == -2){
status[_idx] = 0;
button[_idx].enabled = true;
};
}
public function registerFunction(_idx, _scope, _params){
functions[_idx]["scope"] = _scope;
if (_params["onover"]){
functions[_idx]["onover"] = _params["onover"];
button[_idx].addEventListener(MouseEvent.MOUSE_OVER, doMouseOver, false, 0, true);
};
if (_params["onout"]){
functions[_idx]["onout"] = _params["onout"];
button[_idx].addEventListener(MouseEvent.MOUSE_OUT, doMouseOut, false, 0, true);
};
if (_params["onselect"]){
functions[_idx]["onselect"] = _params["onselect"];
button[_idx].addEventListener(MouseEvent.CLICK, doMouseClick, false, 0, true);
};
if (_params["ondeselect"]){
functions[_idx]["ondeselect"] = _params["ondeselect"];
};
}
private function doMouseOver(e){
var idx:*;
idx = btnIndex(e.target);
applyFunction(idx, "onover");
}
public function deactivateButton(_idx){
if (status[_idx] > -1){
btnDeactivate(button[_idx]);
};
}
private function doMouseOut(e){
var idx:*;
idx = btnIndex(e.target);
applyFunction(idx, "onout");
}
private function btnIndex(_btn):int{
return (button.indexOf(_btn));
}
private function applyFunction(_idx, _event){
if (((functions[_idx]["scope"]) && (functions[_idx][_event]))){
functions[_idx][_event].apply(functions[_idx]["scope"], [_idx]);
};
}
private function btnActivate(_btn){
var grp:*;
var idx:*;
var i:*;
grp = btnGroup(_btn);
idx = btnIndex(_btn);
if (status[idx] > -1){
if (grp > -1){
i = 0;
while (i < group[grp].length) {
if (group[grp][i] != idx){
btnDeactivate(button[group[grp][i]]);
} else {
if (status[idx] != 1){
status[idx] = 1;
applyFunction(idx, "onselect");
} else {
if (groupmode[grp] == "normal"){
status[idx] = 0;
applyFunction(idx, "ondeselect");
};
};
};
i++;
};
} else {
status[idx] = 2;
applyFunction(idx, "onselect");
};
};
}
private function btnDeactivate(_btn){
var idx:*;
idx = btnIndex(_btn);
if (status[idx] > -1){
status[idx] = 0;
};
}
public function deactivateGroup(_grp){
var i:*;
i = 0;
while (i < group[_grp].length) {
if ((((status[group[_grp][i]] > -1)) && (!((status[group[_grp][i]] == 0))))){
btnDeactivate(button[group[_grp][i]]);
};
i++;
};
}
public function unregisterFunction(_idx, _params){
if (_params.indexOf("onover") > -1){
functions[_idx]["onover"] = null;
};
if (_params.indexOf("onout") > -1){
functions[_idx]["onout"] = null;
};
if (_params.indexOf("onselect") > -1){
functions[_idx]["onselect"] = null;
};
if (_params.indexOf("ondeselect") > -1){
functions[_idx]["ondeselect"] = null;
};
}
public function disableButton(_idx){
if (status[_idx] > -1){
status[_idx] = -1;
button[_idx].enabled = false;
};
}
public function lockButton(_idx){
if (status[_idx] > -2){
status[_idx] = -2;
button[_idx].enabled = false;
};
}
}
}//package defclass.ui
Section 23
//ControlManager (defclass.ui.ControlManager)
package defclass.ui {
import flash.events.*;
import flash.geom.*;
import flash.ui.*;
public class ControlManager {
public var KEYPRESS;
public var MOUSESCROLL;// = 0
public var MOUSEPOS;
public var GLOBALPREVKEYPRESS;// = false
public var GLOBALKEYPRESS;// = false
public var PREVMOUSEPRESS;// = false
public var PREVKEYPRESS;
public var MOUSEPRESS;// = false
public function ControlManager(stage=null){
MOUSEPOS = new Point(0, 0);
PREVMOUSEPRESS = false;
MOUSEPRESS = false;
MOUSESCROLL = 0;
PREVKEYPRESS = new Array();
KEYPRESS = new Array();
GLOBALPREVKEYPRESS = false;
GLOBALKEYPRESS = false;
super();
if (stage){
startListeners(stage);
};
}
private function keyReleaseHandler(e){
var key:*;
key = convertKeyCode(e.keyCode);
PREVKEYPRESS[key] = KEYPRESS[key];
KEYPRESS[key] = false;
GLOBALPREVKEYPRESS = GLOBALKEYPRESS;
GLOBALKEYPRESS = false;
}
private function keyPressHandler(e){
var key:*;
key = convertKeyCode(e.keyCode);
PREVKEYPRESS[key] = KEYPRESS[key];
KEYPRESS[key] = true;
GLOBALPREVKEYPRESS = GLOBALKEYPRESS;
GLOBALKEYPRESS = true;
}
private function mouseUpHandler(e){
PREVMOUSEPRESS = MOUSEPRESS;
MOUSEPRESS = false;
GLOBALPREVKEYPRESS = GLOBALKEYPRESS;
GLOBALKEYPRESS = false;
}
public function moveClip(){
var i:*;
PREVMOUSEPRESS = MOUSEPRESS;
MOUSESCROLL = 0;
for each (i in PREVKEYPRESS) {
i = false;
};
}
public function stopListeners(stage){
stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMovementHandler);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
stage.removeEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressHandler);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyReleaseHandler);
}
private function mouseDownHandler(e){
PREVMOUSEPRESS = MOUSEPRESS;
MOUSEPRESS = true;
GLOBALPREVKEYPRESS = GLOBALKEYPRESS;
GLOBALKEYPRESS = true;
}
private function mouseMovementHandler(e){
MOUSEPOS.x = e.stageX;
MOUSEPOS.y = e.stageY;
}
private function convertKeyCode(code){
switch (code){
case Keyboard.UP:
return ("UP");
case Keyboard.DOWN:
return ("DOWN");
case Keyboard.LEFT:
return ("LEFT");
case Keyboard.RIGHT:
return ("RIGHT");
case Keyboard.ESCAPE:
return ("ESC");
case Keyboard.SPACE:
return ("SPACE");
case Keyboard.CONTROL:
return ("CTRL");
case Keyboard.SHIFT:
return ("SHIFT");
case Keyboard.NUMPAD_0:
return ("NUM_0");
case Keyboard.NUMPAD_1:
return ("NUM_1");
case Keyboard.NUMPAD_2:
return ("NUM_2");
case Keyboard.NUMPAD_3:
return ("NUM_3");
case Keyboard.NUMPAD_4:
return ("NUM_4");
case Keyboard.NUMPAD_5:
return ("NUM_5");
case Keyboard.NUMPAD_6:
return ("NUM_6");
case Keyboard.NUMPAD_7:
return ("NUM_7");
case Keyboard.NUMPAD_8:
return ("NUM_8");
case Keyboard.NUMPAD_9:
return ("NUM_9");
case Keyboard.F1:
return ("F1");
case Keyboard.F2:
return ("F2");
case Keyboard.F3:
return ("F3");
case Keyboard.F4:
return ("F4");
case Keyboard.F5:
return ("F5");
case Keyboard.F6:
return ("F6");
case Keyboard.F7:
return ("F7");
case Keyboard.F8:
return ("F8");
case Keyboard.F9:
return ("F9");
case Keyboard.F10:
return ("F10");
case Keyboard.F11:
return ("F11");
case Keyboard.F12:
return ("F12");
case Keyboard.F13:
return ("F13");
case Keyboard.F14:
return ("F14");
case Keyboard.F15:
return ("F15");
case 48:
return ("n0");
case 49:
return ("n1");
case 50:
return ("n2");
case 51:
return ("n3");
case 52:
return ("n4");
case 53:
return ("n5");
case 54:
return ("n6");
case 55:
return ("n7");
case 56:
return ("n8");
case 57:
return ("n9");
case 65:
return ("A");
case 66:
return ("B");
case 67:
return ("C");
case 68:
return ("D");
case 69:
return ("E");
case 70:
return ("F");
case 71:
return ("G");
case 72:
return ("H");
case 73:
return ("I");
case 74:
return ("J");
case 75:
return ("K");
case 76:
return ("L");
case 77:
return ("M");
case 78:
return ("N");
case 79:
return ("O");
case 80:
return ("P");
case 81:
return ("Q");
case 82:
return ("R");
case 83:
return ("S");
case 84:
return ("T");
case 85:
return ("U");
case 86:
return ("V");
case 87:
return ("W");
case 88:
return ("X");
case 89:
return ("Y");
case 90:
return ("Z");
default:
return ("unknown");
};
}
private function mouseWheelHandler(e){
MOUSESCROLL = e.delta;
}
public function startListeners(stage){
stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMovementHandler, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler, false, 0, true);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressHandler, false, 0, true);
stage.addEventListener(KeyboardEvent.KEY_UP, keyReleaseHandler, false, 0, true);
}
}
}//package defclass.ui
Section 24
//MathVect (defclass.utils.MathVect)
package defclass.utils {
public class MathVect {
public function MathVect(){
super();
trace("MathVect is a static class and should not be instantiated.");
}
public static function getResultAngle(rad1, ang1, rad2, ang2):Number{
var dx:*;
var dy:*;
dx = (getDx(rad1, ang1) + getDx(rad2, ang2));
dy = (getDy(rad1, ang1) + getDy(rad2, ang2));
return (((Math.atan2(dy, dx) / Math.PI) * 180));
}
public static function getObjectDistance(obj1, obj2):Number{
var dx:*;
var dy:*;
dx = (obj2.x - obj1.x);
dy = (obj2.y - obj1.y);
return (Math.sqrt(((dx * dx) + (dy * dy))));
}
public static function getDistance(x1, y1, x2, y2):Number{
var dx:*;
var dy:*;
dx = (x2 - x1);
dy = (y2 - y1);
return (Math.sqrt(((dx * dx) + (dy * dy))));
}
public static function isClose(v1, v2, lim=0.01){
return ((Math.abs((v2 - v1)) < lim));
}
public static function getResultDistance(rad1, ang1, rad2, ang2):Number{
var dx:*;
var dy:*;
dx = (getDx(rad1, ang1) + getDx(rad2, ang2));
dy = (getDy(rad1, ang1) + getDy(rad2, ang2));
return (Math.sqrt(((dx * dx) + (dy * dy))));
}
public static function addAngle(ang1, ang2):Number{
var res:*;
res = (ang1 + ang2);
if (res > 180){
res = (res - 360);
};
if (res < -180){
res = (res + 360);
};
return (res);
}
public static function getDx(rad, ang):Number{
return ((rad * Math.cos(((ang / 180) * Math.PI))));
}
public static function getDy(rad, ang):Number{
return ((rad * Math.sin(((ang / 180) * Math.PI))));
}
public static function getAngle(x1, y1, x2, y2):Number{
var dx:*;
var dy:*;
dx = (x2 - x1);
dy = (y2 - y1);
return (((Math.atan2(dy, dx) / Math.PI) * 180));
}
public static function getObjectAngle(obj1, obj2):Number{
var dx:*;
var dy:*;
dx = (obj2.x - obj1.x);
dy = (obj2.y - obj1.y);
return (((Math.atan2(dy, dx) / Math.PI) * 180));
}
public static function randRange(_start=0, _stop=1):Number{
return ((_start + (Math.random() * (_stop - _start))));
}
}
}//package defclass.utils
Section 25
//PermanentDraw (defclass.utils.PermanentDraw)
package defclass.utils {
import flash.display.*;
public class PermanentDraw extends MovieClip {
private var w;
private var bd;
private var h;
private var bmp;
public function PermanentDraw(_w=640, _h=480){
super();
w = _w;
h = _h;
bd = new BitmapData(w, h, true, 0xFFFFFF);
bmp = new Bitmap(bd);
this.addChild(bmp);
}
public function drawChild(_mc){
this.addChild(_mc);
bd = new BitmapData(w, h, true, 0xFFFFFF);
bd.lock();
bd.draw(this);
bd.unlock();
while (this.numChildren > 0) {
this.removeChild(this.getChildAt(0));
};
bmp.bitmapData = bd;
this.addChild(bmp);
}
}
}//package defclass.utils
Section 26
//bt_iconAchieve_181 (elephantvsmouse_fla.bt_iconAchieve_181)
package elephantvsmouse_fla {
import flash.display.*;
public dynamic class bt_iconAchieve_181 extends MovieClip {
public var mccontent:MovieClip;
public var mctag:MovieClip;
public var mcborder:MovieClip;
public var animator;
public function bt_iconAchieve_181(){
super();
addFrameScript(0, frame1);
}
function frame1(){
animator = new CirclicIconAnimator(this);
}
}
}//package elephantvsmouse_fla
Section 27
//bt_iconCredits_178 (elephantvsmouse_fla.bt_iconCredits_178)
package elephantvsmouse_fla {
import flash.display.*;
public dynamic class bt_iconCredits_178 extends MovieClip {
public var mccontent:MovieClip;
public var mctag:MovieClip;
public var mcborder:MovieClip;
public var animator;
public function bt_iconCredits_178(){
super();
addFrameScript(0, frame1);
}
function frame1(){
animator = new CirclicIconAnimator(this);
}
}
}//package elephantvsmouse_fla
Section 28
//bt_iconLoad_184 (elephantvsmouse_fla.bt_iconLoad_184)
package elephantvsmouse_fla {
import flash.display.*;
public dynamic class bt_iconLoad_184 extends MovieClip {
public var mccontent:MovieClip;
public var mctag:MovieClip;
public var mcborder:MovieClip;
public var animator;
public function bt_iconLoad_184(){
super();
addFrameScript(0, frame1);
}
function frame1(){
animator = new CirclicIconAnimator(this);
}
}
}//package elephantvsmouse_fla
Section 29
//bt_iconPlay_187 (elephantvsmouse_fla.bt_iconPlay_187)
package elephantvsmouse_fla {
import flash.display.*;
public dynamic class bt_iconPlay_187 extends MovieClip {
public var mccontent:MovieClip;
public var mctag:MovieClip;
public var mcborder:MovieClip;
public var animator;
public function bt_iconPlay_187(){
super();
addFrameScript(0, frame1);
}
function frame1(){
animator = new CirclicIconAnimator(this);
}
}
}//package elephantvsmouse_fla
Section 30
//bt_iconStats_173 (elephantvsmouse_fla.bt_iconStats_173)
package elephantvsmouse_fla {
import flash.display.*;
public dynamic class bt_iconStats_173 extends MovieClip {
public var mccontent:MovieClip;
public var mctag:MovieClip;
public var mcborder:MovieClip;
public var animator;
public function bt_iconStats_173(){
super();
addFrameScript(0, frame1);
}
function frame1(){
animator = new CirclicIconAnimator(this);
}
}
}//package elephantvsmouse_fla
Section 31
//MainTimeline (elephantvsmouse_fla.MainTimeline)
package elephantvsmouse_fla {
import flash.events.*;
import flash.display.*;
import defclass.host.*;
import defclass.tweener.*;
import defclass.ui.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.system.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.external.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var phantvar;
public var loadtexttimer;
public var loadtext;
public var admgr;
public var pagemgr;
public var datamgr;
public var fencevar;
public var btartlogiclogo:SimpleButton;
public var textstart;
public var mcloaderbar:MovieClip;
public var btplay:SimpleButton;
public var btsponsor:SimpleButton;
public var mcintro:MovieClip;
public var soundmgr;
public var weaponvar;
public var tweenmgr;
public var loadertext:TextField;
public var ctrlmgr;
public var framecounter;
public var mcadbox:MovieClip;
public var staticpage;
public function MainTimeline(){
super();
addFrameScript(1, frame2, 5, frame6, 8, frame9, 21, frame22);
}
public function goSponsor(e){
admgr.goSponsor();
}
function frame6(){
if (!staticpage){
staticpage = new mc_staticpage();
};
staticpage.addEventListener(MouseEvent.CLICK, goSponsor, false, 0, true);
staticpage.buttonMode = true;
stop();
if (admgr.usestatic){
this.addChild(staticpage);
} else {
mcintro.buttonMode = true;
mcintro.addEventListener(MouseEvent.CLICK, goSponsor, false, 0, true);
this.addEventListener(Event.ENTER_FRAME, watchIntro, false, 0, true);
};
}
function frame9(){
stop();
if (admgr.usestatic){
this.addChild(staticpage);
} else {
mcintro.buttonMode = true;
mcintro.addEventListener(MouseEvent.CLICK, goArtlogic, false, 0, true);
this.addEventListener(Event.ENTER_FRAME, watchIntro, false, 0, true);
};
}
function frame22(){
if (!tweenmgr){
tweenmgr = new TweenManager();
};
if (!ctrlmgr){
ctrlmgr = new ControlManager(this.stage);
};
if (!datamgr){
datamgr = new DataManager(this);
};
if (!soundmgr){
soundmgr = new SoundManager(this);
};
if (!weaponvar){
weaponvar = new DataWeapon();
};
if (!fencevar){
fencevar = new DataFence();
};
if (!phantvar){
phantvar = new DataElephant();
};
stop();
if (!admgr.usestatic){
pagemgr = new PageManager(this);
pagemgr.loadPage("cover");
} else {
this.addChild(staticpage);
};
}
public function goArtlogic(e){
admgr.goArtlogic();
}
public function playGame(e){
this.play();
}
public function watchLoader(e){
var pt:*;
pt = (this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal);
mcloaderbar.mcbar.scaleX = pt;
loadtexttimer++;
if (loadtexttimer >= 150){
loadtexttimer = 0;
textstart++;
if (textstart == loadtext.length){
textstart = 0;
};
loadertext.text = loadtext[textstart];
};
if (pt == 1){
this.removeEventListener(Event.ENTER_FRAME, watchLoader);
btplay.y = (mcloaderbar.y + 20);
btplay.addEventListener(MouseEvent.CLICK, playGame, false, 0, true);
mcloaderbar.visible = false;
loadertext.visible = false;
};
}
public function watchIntro(e){
if (mcintro.currentFrame == mcintro.totalFrames){
this.removeEventListener(Event.ENTER_FRAME, watchIntro);
this.play();
};
}
function frame2(){
this.stage.scaleMode = StageScaleMode.NO_SCALE;
if (!admgr){
admgr = new HostManager(this);
};
stop();
loadtexttimer = 0;
loadtext = ["Filling gasoline...", "Building weapon shop...", "Rearranging guns...", "Importing ammo...", "Deducting mouse genetics...", "Crossing rats with jelly...", "Entering the city...", "Crossing rats with pegasus...", "Driving jeeps...", "Train the elephant to stand...", "Crossing rats with Predators...", "Train the elephant to fill in the ammunition...", "Build a flying saucer...", "Crossing rats with hamsters...", "Mop the field...", "Wondering if cheese is bad for your bones...", "Playing golf...", "Collecting dynamites...", "Researching nanotechnology...", "Cut the grass..."];
textstart = Math.floor((Math.random() * loadtext.length));
loadertext.text = loadtext[textstart];
btartlogiclogo.addEventListener(MouseEvent.CLICK, goArtlogic, false, 0, true);
btsponsor.addEventListener(MouseEvent.CLICK, goSponsor, false, 0, true);
admgr.getCPMAds(mcadbox, "preload");
this.addEventListener(Event.ENTER_FRAME, watchLoader, false, 0, true);
}
}
}//package elephantvsmouse_fla
Section 32
//mc_bosshealthbar_306 (elephantvsmouse_fla.mc_bosshealthbar_306)
package elephantvsmouse_fla {
import flash.display.*;
public dynamic class mc_bosshealthbar_306 extends MovieClip {
public var bar:MovieClip;
public function mc_bosshealthbar_306(){
super();
}
}
}//package elephantvsmouse_fla
Section 33
//mc_healthbar_301 (elephantvsmouse_fla.mc_healthbar_301)
package elephantvsmouse_fla {
import flash.display.*;
public dynamic class mc_healthbar_301 extends MovieClip {
public var bar:MovieClip;
public function mc_healthbar_301(){
super();
}
}
}//package elephantvsmouse_fla
Section 34
//mc_loaderbar_1 (elephantvsmouse_fla.mc_loaderbar_1)
package elephantvsmouse_fla {
import flash.display.*;
public dynamic class mc_loaderbar_1 extends MovieClip {
public var mcbar:MovieClip;
public function mc_loaderbar_1(){
super();
}
}
}//package elephantvsmouse_fla
Section 35
//mc_note_left_212 (elephantvsmouse_fla.mc_note_left_212)
package elephantvsmouse_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_note_left_212 extends MovieClip {
public var txtitle:TextField;
public var txnote:TextField;
public function mc_note_left_212(){
super();
}
}
}//package elephantvsmouse_fla
Section 36
//mc_note_right_213 (elephantvsmouse_fla.mc_note_right_213)
package elephantvsmouse_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_note_right_213 extends MovieClip {
public var txtitle:TextField;
public var txnote:TextField;
public function mc_note_right_213(){
super();
}
}
}//package elephantvsmouse_fla
Section 37
//mc_resetdialog_201 (elephantvsmouse_fla.mc_resetdialog_201)
package elephantvsmouse_fla {
import flash.display.*;
public dynamic class mc_resetdialog_201 extends MovieClip {
public var btstart:SimpleButton;
public var btclose:SimpleButton;
public function mc_resetdialog_201(){
super();
}
}
}//package elephantvsmouse_fla
Section 38
//mc_tab_trap_132 (elephantvsmouse_fla.mc_tab_trap_132)
package elephantvsmouse_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_tab_trap_132 extends MovieClip {
public var txequipped1:TextField;
public var txequipped2:TextField;
public var txequipped3:TextField;
public var mcupgradebar1:MovieClip;
public var mcupgradebar2:MovieClip;
public var mcloadersmall3:MovieClip;
public var mcloadersmall2:MovieClip;
public var mcloadersmall1:MovieClip;
public var txupgradebar2:TextField;
public var txupgradebar3:TextField;
public var txupgradebar1:TextField;
public var txowned1:TextField;
public var txowned2:TextField;
public var txowned3:TextField;
public function mc_tab_trap_132(){
super();
}
}
}//package elephantvsmouse_fla
Section 39
//mc_tab_weapon_127 (elephantvsmouse_fla.mc_tab_weapon_127)
package elephantvsmouse_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_tab_weapon_127 extends MovieClip {
public var txequipped1:TextField;
public var txequipped2:TextField;
public var txequipped3:TextField;
public var mcupgradebar1:MovieClip;
public var mcupgradebar2:MovieClip;
public var mcloadersmall3:MovieClip;
public var mcloadersmall2:MovieClip;
public var mcupgradebar3:MovieClip;
public var mcloadersmall1:MovieClip;
public var txupgradebar2:TextField;
public var txupgradebar3:TextField;
public var txupgradebar1:TextField;
public var btequip1:SimpleButton;
public var btequip2:SimpleButton;
public var btequip3:SimpleButton;
public var btupgrade2:SimpleButton;
public var btupgrade3:SimpleButton;
public var btupgrade1:SimpleButton;
public function mc_tab_weapon_127(){
super();
}
}
}//package elephantvsmouse_fla
Section 40
//mc_trapcontainer_308 (elephantvsmouse_fla.mc_trapcontainer_308)
package elephantvsmouse_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mc_trapcontainer_308 extends MovieClip {
public var txcount:TextField;
public var txname:TextField;
public var mcloader:MovieClip;
public var txlabel:TextField;
public function mc_trapcontainer_308(){
super();
}
}
}//package elephantvsmouse_fla
Section 41
//mc_upgrade_lamp_117 (elephantvsmouse_fla.mc_upgrade_lamp_117)
package elephantvsmouse_fla {
import flash.display.*;
public dynamic class mc_upgrade_lamp_117 extends MovieClip {
public function mc_upgrade_lamp_117(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package elephantvsmouse_fla
Section 42
//mc_weaponbar_303 (elephantvsmouse_fla.mc_weaponbar_303)
package elephantvsmouse_fla {
import flash.display.*;
public dynamic class mc_weaponbar_303 extends MovieClip {
public var bar:MovieClip;
public function mc_weaponbar_303(){
super();
}
}
}//package elephantvsmouse_fla
Section 43
//AwardsPage (AwardsPage)
package {
import flash.events.*;
import flash.display.*;
import defclass.ui.*;
public class AwardsPage extends MovieClip {
private var maintimeline;
private var panel;
private var nextpage;
private var lastbtn;
private var admgr;
private var pagemgr;
private var datamgr;
private var btnmgr;
private var timer;
private var soundmgr;
private var tweenmgr;
public var status;
public function AwardsPage(_mtl){
var i:*;
super();
maintimeline = _mtl;
tweenmgr = maintimeline.tweenmgr;
pagemgr = maintimeline.pagemgr;
soundmgr = maintimeline.soundmgr;
datamgr = maintimeline.datamgr;
admgr = maintimeline.admgr;
panel = [new mc_game_ads(), new mc_game_awards()];
this.addChild(panel[0]);
this.addChild(panel[1]);
admgr.getCPMAds(panel[0].adbox, "interlevel");
status = "start";
tweenmgr.register(panel[0], {live:10, ease:"easeoutcubic", x:0, y:300, alpha:1, rotation:0, scalex:1, scaley:1}, {scope:this, onfinished:startPanel});
tweenmgr.register(panel[1], {live:10, ease:"easeoutcubic", x:0, y:(0 - panel[1].height), alpha:1, rotation:0, scalex:1, scaley:1});
activateButtons();
refreshButtons();
}
private function activateButtons(){
var i:*;
btnmgr = new ButtonManager([panel[1].btaward1, panel[1].btaward2, panel[1].btaward3, panel[1].btaward4, panel[1].btaward5, panel[1].btaward6, panel[1].btaward7, panel[1].btaward8, panel[1].btaward9, panel[1].btaward10, panel[1].btaward11, panel[1].btaward12, panel[1].btaward13, panel[1].btaward14, panel[1].btaward15, panel[1].btaward16, panel[1].btaward17, panel[1].btaward18, panel[1].btaward19, panel[1].btaward20, panel[1].btaward21, panel[1].btaward22, panel[1].btaward23, panel[1].btaward24, panel[1].btaward25, panel[1].btaward26, panel[1].btaward27, panel[1].btaward28, panel[1].btaward29, panel[1].btaward30, panel[1].btaward31, panel[1].btaward32, panel[1].btaward33, panel[1].btaward34, panel[1].btaward35, panel[1].btaward36, panel[1].btaward37, panel[1].btaward38, panel[1].btaward39, panel[1].btaward40, panel[1].btachieved1, panel[1].btachieved2, panel[1].btachieved3, panel[1].btachieved4, panel[1].btachieved5, panel[1].btachieved6, panel[1].btachieved7, panel[1].btachieved8, panel[1].btachieved9, panel[1].btachieved10, panel[1].btachieved11, panel[1].btachieved12, panel[1].btachieved13, panel[1].btachieved14, panel[1].btachieved15, panel[1].btachieved16, panel[1].btachieved17, panel[1].btachieved18, panel[1].btachieved19, panel[1].btachieved20, panel[1].btachieved21, panel[1].btachieved22, panel[1].btachieved23, panel[1].btachieved24, panel[1].btachieved25, panel[1].btachieved26, panel[1].btachieved27, panel[1].btachieved28, panel[1].btachieved29, panel[1].btachieved30, panel[1].btachieved31, panel[1].btachieved32, panel[1].btachieved33, panel[1].btachieved34, panel[1].btachieved35, panel[1].btachieved36, panel[1].btachieved37, panel[1].btachieved38, panel[1].btachieved39, panel[1].btachieved40, panel[1].btclose]);
i = 0;
while (i < 80) {
btnmgr.registerFunction(i, this, {onover:startTimer, onout:stopTimer});
i++;
};
btnmgr.registerFunction(80, this, {onselect:stopPanel});
}
private function startTimer(_idx){
var idx:*;
idx = _idx;
if (idx >= 40){
idx = (idx - 40);
};
if (lastbtn != idx){
lastbtn = idx;
timer = 10;
if ((idx % 10) < 5){
panel[1].mcnoteleft.visible = false;
panel[1].mcnoteleft.txtitle.text = datamgr.achievementsnote[idx][0];
panel[1].mcnoteleft.txnote.text = datamgr.achievementsnote[idx][1];
panel[1].mcnoteleft.x = btnmgr.button[idx].x;
panel[1].mcnoteleft.y = (btnmgr.button[idx].y - (btnmgr.button[idx].height * 0.6));
panel[1].mcnoteright.x = -425;
} else {
panel[1].mcnoteright.visible = false;
panel[1].mcnoteright.txtitle.text = datamgr.achievementsnote[idx][0];
panel[1].mcnoteright.txnote.text = datamgr.achievementsnote[idx][1];
panel[1].mcnoteright.x = btnmgr.button[idx].x;
panel[1].mcnoteright.y = (btnmgr.button[idx].y - (btnmgr.button[idx].height * 0.6));
panel[1].mcnoteleft.x = -425;
};
soundmgr.playSFX("menuclick");
};
}
private function stopPanel(e=null){
this.removeEventListener(Event.ENTER_FRAME, moveClip);
deactivateButtons();
close();
soundmgr.playSFX("menuclick");
}
private function refreshButtons(){
var i:*;
i = 0;
while (i < 40) {
if (datamgr.achievements[i]){
btnmgr.button[(i + 40)].x = btnmgr.button[i].x;
btnmgr.button[(i + 40)].y = btnmgr.button[i].y;
};
i++;
};
}
function deactivateButtons(){
var i:*;
i = 0;
while (i < 80) {
btnmgr.unregisterFunction(i, ["onover", "onout"]);
i++;
};
btnmgr.unregisterFunction(80, ["onselect"]);
}
private function stopTimer(_idx){
var idx:*;
idx = _idx;
if (idx >= 40){
idx = (idx - 40);
};
if (lastbtn == idx){
timer = 0;
panel[1].mcnoteleft.visible = false;
panel[1].mcnoteright.visible = false;
lastbtn = -1;
};
}
private function goCover(e){
nextpage = "cover";
stopPanel();
soundmgr.playSFX("menuclick");
}
private function moveClip(e){
if (timer > 0){
timer--;
if (timer == 0){
panel[1].mcnoteleft.visible = true;
panel[1].mcnoteright.visible = true;
};
};
}
private function startPanel(e){
this.addEventListener(Event.ENTER_FRAME, moveClip, false, 0, true);
}
private function close(e=null){
admgr.clearCPMAds(panel[0].adbox, false);
pagemgr.loadPage(nextpage);
}
}
}//package
Section 44
//bgm_ambient (bgm_ambient)
package {
import defclass.sound.*;
public dynamic class bgm_ambient extends BaseSound {
public function bgm_ambient(){
super();
}
}
}//package
Section 45
//bgm_boss (bgm_boss)
package {
import defclass.sound.*;
public dynamic class bgm_boss extends BaseSound {
public function bgm_boss(){
super();
}
}
}//package
Section 46
//bgm_cover (bgm_cover)
package {
import defclass.sound.*;
public dynamic class bgm_cover extends BaseSound {
public function bgm_cover(){
super();
}
}
}//package
Section 47
//BossIntro (BossIntro)
package {
import flash.display.*;
public class BossIntro extends MovieClip {
public var complete;
public var layers;
private var delay;
private var txtcount;
public var level;
public var page;
private var delaytimer;
private var conversation;
public function BossIntro(_lv=0){
conversation = [[{obj:"boss", text:"mmm... yummm... little elephant sandwich... yummy..."}, {obj:"phant", text:"Eat my bullet first!"}, {obj:"boss", text:"You are asking for it, lovely pie!"}], [{obj:"boss", text:"So you think youre so smart huh?"}, {obj:"phant", text:"Whoa, a flying saucer! With rat on it!"}, {obj:"boss", text:"I'll fry you alive!"}], [{obj:"phant", text:"Ugly smelly hamster. It's not funny at all."}, {obj:"boss", text:"blugluhguh..."}, {obj:"phant", text:"It can't even speak!"}, {obj:"boss", text:"..."}]];
super();
complete = false;
delay = 90;
level = _lv;
page = 0;
layers = new Array();
switch (level){
case 2:
layers["boss"] = new mc_dialog_boss_03();
break;
case 1:
layers["boss"] = new mc_dialog_boss_02();
break;
case 0:
default:
layers["boss"] = new mc_dialog_boss_01();
break;
};
layers["phant"] = new mc_dialog_boss_phant();
layers["back"] = new mc_dialog_boss_bg();
initPage();
}
public function skip(){
if (layers["back"].txdialog.text.length < conversation[level][page].text.length){
layers["back"].txdialog.text = conversation[level][page].text;
} else {
delaytimer = 0;
};
}
public function moveClip(){
if (layers["back"].txdialog.text.length < conversation[level][page].text.length){
layers["back"].txdialog.text = conversation[level][page].text.substr(0, (layers["back"].txdialog.text.length + 1));
} else {
if (delaytimer == 0){
page++;
if (page == conversation[level].length){
while (this.numChildren > 0) {
this.removeChildAt(0);
};
complete = true;
} else {
initPage();
};
};
};
}
private function initPage(){
while (this.numChildren > 0) {
this.removeChildAt(0);
};
layers["back"].txdialog.text = "";
txtcount = 0;
delaytimer = delay;
this.addChild(layers["back"]);
if (conversation[level][page].obj == "boss"){
this.addChild(layers["boss"]);
} else {
this.addChild(layers["phant"]);
};
}
}
}//package
Section 48
//bt_achieved1 (bt_achieved1)
package {
import flash.display.*;
public dynamic class bt_achieved1 extends SimpleButton {
public function bt_achieved1(){
super();
}
}
}//package
Section 49
//BulletPart (BulletPart)
package {
import flash.display.*;
import defclass.utils.*;
public class BulletPart extends MovieClip {
private var skin;
private var tweenmgr;
private var nextx;
private var nextr;
private var nexty;
public var status;
public function BulletPart(_tweenmgr, _pos){
super();
tweenmgr = _tweenmgr;
this.name = "bulletpart";
status = "animating";
this.x = _pos[0];
this.y = _pos[1];
skin = new mc_bulletpart();
this.addChild(skin);
skin.rotation = ((360 * Math.random()) - 180);
if (Math.random() < 0.5){
this.rotation = ((30 * Math.random()) - 15);
} else {
this.rotation = ((30 * Math.random()) + 165);
};
nextx = (this.x + MathVect.getDx((30 - (Math.random() * 10)), this.rotation));
nexty = (this.y + MathVect.getDy((30 - (Math.random() * 10)), this.rotation));
nextr = (180 * Math.random());
tweenmgr.register(this, {live:5, ease:"easenone", x:nextx, y:nexty, rotation:nextr, alpha:1, scalex:1, scaley:1}, {scope:this, onfinished:doStep2});
}
private function doStep2(e){
this.rotation = (360 * Math.random());
nextx = (this.x + MathVect.getDx((50 - (Math.random() * 20)), this.rotation));
nexty = (this.y + MathVect.getDy((50 - (Math.random() * 20)), this.rotation));
nextr = (180 * Math.random());
tweenmgr.register(this, {live:5, ease:"easenone", x:nextx, y:nexty, rotation:nextr, alpha:1, scalex:1, scaley:1}, {scope:this, onfinished:doStep3});
}
private function doStep3(e){
this.status = "finished";
}
}
}//package
Section 50
//CirclicIconAnimator (CirclicIconAnimator)
package {
import flash.events.*;
import defclass.utils.*;
public class CirclicIconAnimator {
private var parent;
private var border;
private var rollover;
private var borderspeed;
private var content;
private var tag;
public function CirclicIconAnimator(_obj){
var i:*;
super();
parent = _obj;
content = parent.mccontent;
tag = parent.mctag;
tag.scaleX = 0;
tag.scaleY = 0;
tag.rotation = -90;
border = new Array();
borderspeed = new Array();
i = 0;
while (i < parent.mcborder.numChildren) {
border.push(parent.mcborder.getChildAt(i));
border[i].scaleX = (Math.random() + 0.5);
border[i].scaleY = border[i].scaleX;
border[i].rotation = (Math.random() * 360);
border[i].x = MathVect.getDx(15, border[i].rotation);
border[i].y = MathVect.getDy(15, border[i].rotation);
borderspeed[i] = ((Math.random() * 3) + 2);
i++;
};
content.addEventListener(Event.ENTER_FRAME, moveClip, false, 0, true);
content.addEventListener(MouseEvent.ROLL_OVER, onOver, false, 0, true);
content.addEventListener(MouseEvent.ROLL_OUT, onOut, false, 0, true);
parent.buttonMode = true;
rollover = false;
}
private function moveClip(e){
var p:*;
var i:*;
if (rollover){
if (tag.scaleX < 1){
tag.scaleX = (tag.scaleX + 0.1);
tag.scaleY = tag.scaleX;
p = tag.scaleX;
tag.rotation = ((p * 90) + -90);
content.scaleX = ((p * 0.2) + 1);
content.scaleY = content.scaleX;
};
} else {
if (tag.scaleX > 0){
tag.scaleX = (tag.scaleX - 0.1);
tag.scaleY = tag.scaleX;
p = tag.scaleX;
tag.rotation = ((p * 90) + -90);
content.scaleX = ((p * 0.2) + 1);
content.scaleY = content.scaleX;
};
};
p = tag.scaleX;
i = 0;
while (i < border.length) {
border[i].scaleX = (border[i].scaleX + ((Math.random() * 0.2) - 0.1));
if (border[i].scaleX < 1){
border[i].scaleX = 1;
} else {
if (border[i].scaleX > 1.5){
border[i].scaleX = 1.5;
};
};
border[i].scaleY = border[i].scaleX;
border[i].rotation = (border[i].rotation + borderspeed[i]);
border[i].x = MathVect.getDx(((p * 10) + 13), border[i].rotation);
border[i].y = MathVect.getDy(((p * 10) + 13), border[i].rotation);
i++;
};
}
private function onOver(e){
rollover = true;
}
private function onOut(e){
rollover = false;
}
}
}//package
Section 51
//ComicPage (ComicPage)
package {
import flash.events.*;
import flash.display.*;
public class ComicPage extends MovieClip {
private var pagemgr;
private var timer;
public var skin;
private var page;
private var soundmgr;
public function ComicPage(_mtl, _param){
super();
pagemgr = _mtl.pagemgr;
soundmgr = _mtl.soundmgr;
setSkin(_param);
timer = 150;
this.addEventListener(Event.ENTER_FRAME, moveClip, false, 0, true);
}
private function skipPage(e){
soundmgr.playSFX("menuclick");
timer = 0;
}
private function moveClip(e){
timer--;
if (timer <= 0){
closePage();
};
}
private function closePage(){
skin.btnext.removeEventListener(MouseEvent.CLICK, skipPage);
this.removeEventListener(Event.ENTER_FRAME, moveClip);
switch (page){
case "intro1":
pagemgr.loadPage("intro2");
break;
case "intro2":
pagemgr.loadPage("game");
break;
case "ending":
pagemgr.loadPage("credits");
break;
};
}
private function setSkin(_param){
switch (_param){
case "intro1":
page = "intro1";
skin = new mc_intro1();
break;
case "intro2":
page = "intro2";
skin = new mc_intro2();
break;
case "ending":
page = "ending";
skin = new mc_ending();
break;
};
this.addChild(skin);
skin.btnext.addEventListener(MouseEvent.CLICK, skipPage, false, 0, true);
}
}
}//package
Section 52
//CreditsPage (CreditsPage)
package {
import flash.events.*;
import flash.display.*;
public class CreditsPage extends MovieClip {
private var maintimeline;
private var panel;
private var nextpage;
private var admgr;
private var pagemgr;
private var datamgr;
private var timer;
private var soundmgr;
private var tweenmgr;
public var status;
public function CreditsPage(_mtl){
var i:*;
super();
maintimeline = _mtl;
tweenmgr = maintimeline.tweenmgr;
pagemgr = maintimeline.pagemgr;
soundmgr = maintimeline.soundmgr;
datamgr = maintimeline.datamgr;
admgr = maintimeline.admgr;
panel = [new mc_game_ads(), new mc_game_credits()];
this.addChild(panel[0]);
this.addChild(panel[1]);
admgr.getCPMAds(panel[0].adbox, "interlevel");
status = "start";
tweenmgr.register(panel[0], {live:10, ease:"easeoutcubic", x:0, y:300, alpha:1, rotation:0, scalex:1, scaley:1}, {scope:this, onfinished:startPanel});
tweenmgr.register(panel[1], {live:10, ease:"easeoutcubic", x:0, y:(0 - panel[1].height), alpha:1, rotation:0, scalex:1, scaley:1});
}
private function stopPanel(e=null){
panel[1].btclose.removeEventListener(MouseEvent.CLICK, goCover);
close();
}
private function goCover(e){
nextpage = "cover";
stopPanel();
soundmgr.playSFX("menuclick");
}
private function startPanel(e){
panel[1].btclose.addEventListener(MouseEvent.CLICK, goCover, false, 0, true);
}
private function close(e=null){
admgr.clearCPMAds(panel[0].adbox, false);
pagemgr.loadPage(nextpage);
}
}
}//package
Section 53
//DataBoss (DataBoss)
package {
import flash.display.*;
import defclass.tweener.*;
import defclass.utils.*;
import flash.geom.*;
public class DataBoss extends MovieClip {
public var wave;
private var dskindata;
private var dskinct;
public var attacktime;
public var curlive;
public var totallive;
public var timer;
public var attack;
private var dskinrect;
public var health;
public var damage;
private var dskintimer;
private var wavemgr;
public var skin;
public var attacktype;
public var nextpos;
public var levels;
public var startpos;
private var tweenmgr;
public var attackcount;
public var maxhealth;
public var readypos;
private var dskin;
public var prevstatus;
private var dskinmatrix;
public var status;
public function DataBoss(_wavemgr, _name="boss1"){
levels = {boss1:{health:5000, attack:25, attacktime:[30, 35, 60], pos:[225, 300], wave:[{name:"blue", count:10, interval:4}], matrix:new Matrix(1, 0, 0, 1, 120, 320), rect:new Rectangle(0, 0, 240, 290)}, boss2:{health:10000, attack:50, attacktime:[30, 45, 60], pos:[225, 180], wave:[{name:"white", count:10, interval:4}], matrix:new Matrix(1, 0, 0, 1, 180, 150), rect:new Rectangle(0, 0, 360, 200)}, boss3:{health:20000, attack:150, attacktime:[30], pos:[220, 340], wave:[{name:"red", count:10, interval:4}], matrix:new Matrix(1, 0, 0, 1, 140, 355), rect:new Rectangle(0, 0, 280, 355)}};
super();
wavemgr = _wavemgr;
name = _name;
setData();
setSkin();
createDetectSkin();
this.x = 225;
this.y = 150;
setScale();
}
private function setSkin(){
while (this.numChildren > 0) {
this.removeChildAt(0);
};
switch (this.name){
case "boss3":
switch (status){
case "attack":
skin = new mc_boss3_attack();
attacktype = 0;
break;
case "dead":
skin = new mc_explosion_big();
break;
case "idle":
default:
skin = new mc_boss3_walk();
break;
};
break;
case "boss2":
switch (status){
case "attack":
if ((attackcount % 3) == 0){
skin = new mc_boss2_gattling();
attacktype = 0;
} else {
if ((attackcount % 2) == 0){
skin = new mc_boss2_laser();
attacktype = 1;
} else {
skin = new mc_boss2_rocket();
attacktype = 2;
};
};
break;
case "dead":
skin = new mc_explosion_big();
break;
case "idle":
default:
skin = new mc_boss2_fly();
break;
};
break;
case "boss1":
default:
switch (status){
case "attack":
if ((attackcount % 3) == 0){
skin = new mc_boss1_knife();
attacktype = 0;
} else {
if ((attackcount % 2) == 0){
skin = new mc_boss1_grind();
attacktype = 1;
} else {
skin = new mc_boss1_fire();
attacktype = 2;
};
};
break;
case "dead":
skin = new mc_explosion_big();
break;
case "idle":
default:
skin = new mc_boss1_walk();
break;
};
break;
};
this.addChild(skin);
skin.gotoAndPlay(1);
}
public function setScale(){
var sc:*;
var min:*;
var max:*;
switch (this.name){
case "boss3":
min = 0.5;
max = 0.9;
break;
case "boss2":
case "boss1":
default:
min = 0.7;
max = 1;
break;
};
sc = TweenEquations.easeInSine((this.y - 150), min, (max - min), (readypos[1] - 150));
this.scaleX = sc;
this.scaleY = sc;
}
private function createDetectSkin(){
var customdsm:*;
if (((dskin) && (this.contains(dskin)))){
this.removeChild(dskin);
};
dskinct = new ColorTransform(1, 1, 1, 1, 0xFF, 0xFF, 0xFF, 0xFF);
dskindata = new BitmapData(dskinrect.width, dskinrect.height, true, 0xFFFFFF);
dskin = new Bitmap(dskindata);
dskin.x = (dskinmatrix.tx * -1);
dskin.y = (dskinmatrix.ty * -1);
dskin.alpha = 0;
dskintimer = 2;
if (((skin) && (this.contains(skin)))){
switch (this.name){
case "boss1":
if (((skin.body) && (skin.head))){
dskindata.lock();
customdsm = new Matrix(skin.body.scaleX, 0, 0, skin.body.scaleY, (dskinmatrix.tx + skin.body.x), (dskinmatrix.ty + skin.body.y));
dskindata.draw(skin.body, customdsm, dskinct, BlendMode.NORMAL, dskinrect, true);
customdsm = new Matrix(skin.head.scaleX, 0, 0, skin.head.scaleY, (dskinmatrix.tx + skin.head.x), (dskinmatrix.ty + skin.head.y));
dskindata.draw(skin.head, customdsm, dskinct, BlendMode.NORMAL, dskinrect, true);
dskindata.unlock();
this.addChild(dskin);
};
break;
case "boss2":
if (skin.hitarea){
dskindata.lock();
customdsm = new Matrix(skin.hitarea.scaleX, 0, 0, skin.hitarea.scaleY, (dskinmatrix.tx + skin.hitarea.x), (dskinmatrix.ty + skin.hitarea.y));
dskindata.draw(skin.hitarea, customdsm, dskinct, BlendMode.NORMAL, dskinrect, true);
dskindata.unlock();
this.addChild(dskin);
};
break;
case "boss3":
default:
dskindata.lock();
dskindata.draw(skin, dskinmatrix, dskinct, BlendMode.NORMAL, dskinrect, true);
dskindata.unlock();
this.addChild(dskin);
break;
};
};
}
public function setData(_name="current"){
var n:*;
n = _name;
if (_name == "current"){
n = name;
};
health = levels[n].health;
maxhealth = levels[n].health;
attack = levels[n].attack;
damage = levels[n].attack;
readypos = levels[n].pos;
wave = levels[n].wave;
attacktime = levels[n].attacktime;
attackcount = 0;
dskinrect = levels[n].rect;
dskinmatrix = levels[n].matrix;
timer = 150;
prevstatus = status;
status = "startup";
}
public function resetPos(e=null){
if (e){
startpos = [this.x, this.y];
nextpos = e;
totallive = Math.floor((MathVect.getDistance(this.x, this.y, nextpos[0], nextpos[1]) / 1));
curlive = 0;
if (MathVect.getDistance(this.x, this.y, e[0], e[1]) < 5){
nextpos = null;
prevstatus = status;
status = "attack";
attackcount++;
setSkin();
};
} else {
startpos = [this.x, this.y];
nextpos = [((Math.random() * 325) + 100), ((Math.random() * (readypos[1] - 150)) + 150)];
switch (this.name){
case "boss3":
totallive = Math.floor((MathVect.getDistance(this.x, this.y, nextpos[0], nextpos[1]) * 4));
break;
case "boss2":
totallive = Math.floor(MathVect.getDistance(this.x, this.y, nextpos[0], nextpos[1]));
break;
case "boss1":
default:
totallive = Math.floor(MathVect.getDistance(this.x, this.y, nextpos[0], nextpos[1]));
break;
};
curlive = 0;
};
}
public function setPos(e=null){
if (nextpos){
this.x = TweenEquations.easeNone(curlive, startpos[0], (nextpos[0] - startpos[0]), totallive);
this.y = TweenEquations.easeNone(curlive, startpos[1], (nextpos[1] - startpos[1]), totallive);
curlive++;
if (curlive > totallive){
nextpos = null;
};
};
}
public function hit(_dmg){
var ph:*;
if (status != "dead"){
if (!this.contains(dskin)){
createDetectSkin();
};
dskin.alpha = 0.5;
ph = health;
health = (health - _dmg);
if (health <= 0){
health = 0;
};
};
}
public function moveClip(e=null){
if (dskintimer > 0){
dskintimer--;
if (dskintimer == 0){
clearDetectSkin();
};
};
switch (status){
case "startup":
prevstatus = status;
status = "idle";
setSkin();
wavemgr.generateWave(wave, 2);
timer = 0;
resetPos();
break;
case "idle":
setPos();
setScale();
if (!nextpos){
prevstatus = status;
status = "stop";
timer = (90 + Math.floor((Math.random() * 60)));
skin.gotoAndStop(1);
};
break;
case "stop":
if (timer > 0){
timer--;
if (timer == 0){
prevstatus = status;
status = "idle";
skin.gotoAndPlay(1);
resetPos();
if (((!((wavemgr.status == "finished"))) || (!((wavemgr.status == "completed"))))){
resetPos([readypos[0], readypos[1]]);
};
};
};
break;
case "attacking":
prevstatus = status;
status = "attack";
case "attack":
if (skin.currentFrame == skin.totalFrames){
status = "idle";
setSkin();
wavemgr.generateWave(wave, 2);
timer = 0;
resetPos();
} else {
if (skin.currentFrame == attacktime[attacktype]){
prevstatus = status;
status = "attacking";
};
};
break;
case "dead":
if (skin.currentFrame == skin.totalFrames){
if (this.contains(skin)){
this.removeChild(skin);
};
};
break;
};
if (((!((status == "dead"))) && ((health <= 0)))){
prevstatus = status;
status = "dead";
setSkin();
wavemgr.stopWave();
};
}
private function clearDetectSkin(){
if (((dskin) && (this.contains(dskin)))){
this.removeChild(dskin);
};
}
public function detectHit(_pos):Boolean{
var pos:*;
var res:*;
res = false;
if (status != "dead"){
createDetectSkin();
pos = new Point(_pos[0], _pos[1]);
pos = this.globalToLocal(pos);
res = (dskindata.getPixel32((pos.x + dskinmatrix.tx), (pos.y + dskinmatrix.ty)) > 0);
};
return (res);
}
}
}//package
Section 54
//DataElephant (DataElephant)
package {
public class DataElephant {
public var payment;
public var anger;
public var price;
public var skill;
public var levels;
public function DataElephant(){
levels = {payment:[1, 1.2, 1.35, 1.5], skill:[1, 1.2, 1.35, 1.5], anger:[1, 0.8, 0.65, 0.5]};
price = {payment:[2000, 5000, 7500], skill:[2000, 5000, 7500], anger:[2000, 5000, 7500]};
super();
setElephant({payment:0, skill:0, anger:0});
}
public function setElephant(_data){
payment = levels.payment[_data.payment];
skill = levels.skill[_data.skill];
anger = levels.anger[_data.anger];
}
}
}//package
Section 55
//DataFence (DataFence)
package {
import flash.display.*;
public class DataFence {
public var level;
public var price;
public var repair;
public var attack;
public var healthmax;
private var repairtimer;
public var health;
public var repairrate;
public var damage;
public var levels;
public var skin;
public function DataFence(){
levels = [{health:250, repair:[0, 1, 2, 3], repairrate:[0, 60, 55, 50], attack:[0, 3, 4, 5]}, {health:500, repair:[0, 1, 2, 3], repairrate:[0, 60, 55, 50], attack:[0, 4, 5, 6]}, {health:1000, repair:[0, 1, 2, 3], repairrate:[0, 60, 55, 50], attack:[0, 5, 6, 7]}];
price = {heal:[50, 100, 200], level:[3000, 7000, 10000], repair:[1000, 3000, 7000], attack:[1000, 3000, 7000]};
super();
setFence(250, {level:0, repair:0, attack:0});
}
private function getSkin(_lv):MovieClip{
var obj:*;
switch (_lv){
case 0:
obj = new mc_fence_01();
break;
case 1:
obj = new mc_fence_02();
break;
case 2:
obj = new mc_fence_03();
break;
};
return (obj);
}
public function moveClip(){
if (repairtimer > 0){
repairtimer--;
if (repairtimer == 0){
repairtimer = repairrate;
if (health > 0){
health = (health + repair);
};
if (health > healthmax){
health = healthmax;
};
};
};
}
public function setFence(_health, _data){
level = _data["level"];
skin = getSkin(level);
health = _health;
healthmax = levels[level]["health"];
repair = levels[level]["repair"][_data["repair"]];
repairrate = levels[level]["repairrate"][_data["repair"]];
attack = levels[level]["attack"][_data["attack"]];
damage = attack;
if (health > healthmax){
health = healthmax;
} else {
if (health == 0){
health = healthmax;
};
};
repairtimer = repairrate;
}
}
}//package
Section 56
//DataManager (DataManager)
package {
import flash.events.*;
import flash.display.*;
import defclass.host.*;
import defclass.tweener.*;
import flash.net.*;
public class DataManager {
public var totalmoney;
public var weaponunlocked;
private var maintimeline:MovieClip;
public var totaltime;
public var fenceunlocked;
private var admgr:HostManager;
public var achievementsnote:Array;
public var weaponbought;
public var achievements;
public var levelkillmoney;
private var savepath:String;
public var levelfence;
public var fencemoney;
public var fence;
public var unlockallachievement:Boolean;// = false
public var killmoney;
private var achieverskin:MovieClip;
public var phantupgrade;
public var kill;
public var levelaccuracymoney;
public var accuracymoney;
private var achieverqueue:Array;
public var debugmode:Boolean;// = false
public var resetdata:Boolean;// = false
public var levelaccuracy;
public var weaponupgrade;
public var hint:Array;
private var savename:String;
public var level;
public var levelscore;
public var fencerate;
public var score;
public var hit;
public var levelmiss;
public var leveltotalkill;
public var totalkill;
private var savedata:Boolean;
private var achieverpic:MovieClip;
private var achievertimer:int;
public var levelhit;
public var levelfencemoney;
public var datasummary;
public var money;
private var tracing:Boolean;// = false
public var fenceupgrade;
private var tweenmgr:TweenManager;
public var ammo;
public var phantunlocked;
public var levelmoney;
private var kongmgr:KongregateDataManager;
public var equipped;
public var levelkill;
public var accuracy;
public var miss;
public function DataManager(mtl){
tracing = false;
resetdata = false;
debugmode = false;
unlockallachievement = false;
hint = ["Anti pest barricade", "Pegasus! woo..", "Phant, the killing machine", "Strawberry juice", "No one touch my barricade... or bite!", "Boom! Boom! Boom!", "Darn, these mouse never give up!", "Chef of Rodent!", "Victorious night", "Cheese robber", "Lake of blood", "Eat my bullets", "Juicy, juicy!", "Eew! Its stick everywhere", "Slicky, slicky!", "Space gopher rules!", "No gopher win to a Phant", "Phant! Phant! Phant!", "Underground attack!", "Load the gun", "This is nuts! Deadfest!", "Sick rats!", "Adrenaline!", "Hail to the King of Rodent", "Bossfest : Dead Man Walk!"];
achievementsnote = [["Volunteer", "Play for 5 min total"], ["Testing my new gun!", "Play for 10 min total"], ["Yay!", "Play for 20 min total"], ["Die! Die! Die!", "Play for 30 min total"], ["Ratdicted!", "Play for 60 min total"], ["Dead mouse walk", "Kill a regular mouse"], ["Birdy!", "Kill a flying mouse"], ["Juicy!", "Kill a jelly mouse"], ["Suicide failure", "Kill a suicide bomber"], ["Ratminator", "Kill a digger"], ["Going Rampage", "Buy a shotgun"], ["Front liner", "Buy an assault riffle"], ["Easy to use", "Buy a submachine gun"], ["The Hunter", "Buy a hand gun"], ["Killing Machine", "Buy a machine gun"], ["Blow 'em up 1.0", "Buy a grenade launcher"], ["Mini killer", "Buy a minigun"], ["Blow 'em up 2.0", "Buy a land mine"], ["Sticky", "Buy a glue trap"], ["Going Slicky", "Buy a mouse trap"], ["Cold Blooded", "Collect all handgun"], ["Fence Builder", "Upgrade fence level to the max"], ["Nanotech", "Upgrade all fence tech"], ["The Trainer", "Upgrade all phant training"], ["Overprotected", "Complete all upgrades"], ["Gun Collector", "Upgrade a gun to the max"], ["Slicky Phant", "Buy all traps"], ["Blow 'em up 3.0", "Buy 5 land mines"], ["Co-Sniper", "Achieving 80% accuracy in a level"], ["The Sniper", "Achieving 100% accuracy in a level"], ["Dying Winner", "Win a level with under 10% fence"], ["Clean Fight", "Win a level with 100% fence"], ["Pestilence", "Kill 100 rats"], ["Fire In the Hole", "Kill 500 rats"], ["Spawn Burn", "Kill 1000 rats"], ["Mass Murderous", "Kill 1500 rats"], ["The Chef", "Defeat the Chef"], ["Space Gopher", "Defeat the Space Gopher"], ["Great Hamster", "Defeat the Great Hamster"], ["Completion", "Finish the game"]];
super();
if (tracing){
trace("GameDataManager:$init: Initiating game data manager");
};
maintimeline = mtl;
tweenmgr = maintimeline.tweenmgr;
admgr = maintimeline.admgr;
if (admgr.usekong){
kongmgr = new KongregateDataManager(maintimeline);
};
savename = "x_elephantxmouse_x";
savepath = "";
savedata = true;
resetData();
initLevel();
if (resetdata){
saveData();
};
loadData();
saveData();
loadDataSummary();
achieverqueue = new Array();
achieverskin = new mc_achievements_note();
achievertimer = 0;
}
private function showAchievement(){
achieverskin.x = 0;
achieverskin.y = 200;
achieverskin.txheader.text = achievementsnote[achieverqueue[0]][0];
achieverskin.txnote.text = achievementsnote[achieverqueue[0]][1];
maintimeline.addChild(achieverskin);
tweenmgr.register(achieverskin, {live:15, ease:"easenone", x:0, y:0, alpha:1, rotation:0, scalex:1, scaley:1}, {scope:this, onfinished:pauseAchievement});
}
public function isCompletelyUpgraded():Boolean{
var res:*;
return (res);
}
public function addShot(_hit){
if (_hit){
levelhit++;
} else {
levelmiss++;
};
levelaccuracy = ((levelhit / (levelhit + levelmiss)) * 100);
}
private function saveKong(){
kongmgr.submitStat({TOTAL_SCORE:score});
}
public function buyWeapon(iname, iprice):Boolean{
if (((weaponunlocked[iname]) && ((money >= iprice)))){
switch (iname){
case "trap1":
case "trap2":
case "trap3":
if (weaponbought[iname] < 5){
money = (money - iprice);
var _local3 = weaponbought;
var _local4 = iname;
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
saveData();
return (true);
};
break;
default:
if (!weaponbought[iname]){
money = (money - iprice);
_local3 = weaponbought;
_local4 = iname;
_local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
saveData();
return (true);
};
break;
};
} else {
if (debugmode){
switch (iname){
case "trap1":
case "trap2":
case "trap3":
if (weaponbought[iname] < 5){
_local3 = weaponbought;
_local4 = iname;
_local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
return (true);
};
break;
default:
if (!weaponbought[iname]){
_local3 = weaponbought;
_local4 = iname;
_local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
return (true);
};
break;
};
};
};
return (false);
}
public function initLevel(){
leveltotalkill = 0;
levelkill = new Array();
levelkillmoney = 0;
levelhit = 0;
levelmiss = 0;
levelaccuracy = 0;
levelaccuracymoney = 0;
levelfence = 0;
levelfencemoney = 0;
levelmoney = 0;
if ((((level > 24)) && ((level < 100)))){
level = 24;
};
}
public function upgradePhant(iname, iprice):Boolean{
if (((((phantunlocked[iname]) && ((money >= iprice)))) && ((phantupgrade[iname] < 3)))){
money = (money - iprice);
var _local3 = phantupgrade;
var _local4 = iname;
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
saveData();
return (true);
};
if (((debugmode) && ((phantupgrade[iname] < 3)))){
_local3 = phantupgrade;
_local4 = iname;
_local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
return (true);
};
return (false);
}
public function upgradeWeapon(iname, iidx, iprice):Boolean{
if (((((((weaponunlocked[iname]) && (weaponbought[iname]))) && ((money >= iprice)))) && ((weaponupgrade[iname][iidx] < 3)))){
money = (money - iprice);
var _local4 = weaponupgrade[iname];
var _local5 = iidx;
var _local6 = (_local4[_local5] + 1);
_local4[_local5] = _local6;
saveData();
return (true);
};
if (((debugmode) && ((weaponupgrade[iname][iidx] < 3)))){
_local4 = weaponupgrade[iname];
_local5 = iidx;
_local6 = (_local4[_local5] + 1);
_local4[_local5] = _local6;
return (true);
};
return (false);
}
private function pauseAchievement(_skin){
if (achieverqueue.length > 1){
achievertimer = 45;
} else {
achievertimer = 60;
};
achieverskin.addEventListener(Event.ENTER_FRAME, waitAchievement, false, 0, true);
}
private function checkValidity(){
if (!achievements){
achievements = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
} else {
if (achievements.length == 0){
achievements = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
};
};
if (!fenceupgrade){
fenceupgrade = {level:0, repair:0, attack:0};
} else {
if (fenceupgrade.length == 0){
fenceupgrade = {level:0, repair:0, attack:0};
};
};
if (!fenceunlocked){
fenceunlocked = {level:1, repair:1, attack:1};
} else {
if (fenceunlocked.length == 0){
fenceunlocked = {level:1, repair:1, attack:1};
};
};
if (!phantupgrade){
phantupgrade = {payment:0, skill:0, anger:0};
} else {
if (phantupgrade.length == 0){
phantupgrade = {payment:0, skill:0, anger:0};
};
};
if (!phantunlocked){
phantunlocked = {payment:1, skill:1, anger:1};
} else {
if (phantunlocked.length == 0){
phantunlocked = {payment:1, skill:1, anger:1};
};
};
if (!weaponupgrade){
weaponupgrade = {beretta:[0, 0, 0], deagle:[0, 0, 0], danwesson:[0, 0, 0], trench:[0, 0, 0], mossberg:[0, 0, 0], spas:[0, 0, 0], mp5:[0, 0, 0], mp9:[0, 0, 0], steyrtmp:[0, 0, 0], ak47:[0, 0, 0], steyraug:[0, 0, 0], xm8:[0, 0, 0], mk2:[0, 0, 0], m60:[0, 0, 0], mg34:[0, 0, 0], m79:[0, 0, 0], mm1:[0, 0, 0], xm25:[0, 0, 0], minigun:[0, 0, 0], trap1:[0, 0, 0], trap2:[0, 0, 0], trap3:[0, 0, 0]};
} else {
if (weaponupgrade.length == 0){
weaponupgrade = {beretta:[0, 0, 0], deagle:[0, 0, 0], danwesson:[0, 0, 0], trench:[0, 0, 0], mossberg:[0, 0, 0], spas:[0, 0, 0], mp5:[0, 0, 0], mp9:[0, 0, 0], steyrtmp:[0, 0, 0], ak47:[0, 0, 0], steyraug:[0, 0, 0], xm8:[0, 0, 0], mk2:[0, 0, 0], m60:[0, 0, 0], mg34:[0, 0, 0], m79:[0, 0, 0], mm1:[0, 0, 0], xm25:[0, 0, 0], minigun:[0, 0, 0], trap1:[0, 0, 0], trap2:[0, 0, 0], trap3:[0, 0, 0]};
};
};
if (!weaponunlocked){
weaponunlocked = {beretta:1, deagle:1, danwesson:1, trench:1, mossberg:1, spas:0, mp5:1, mp9:1, steyrtmp:1, ak47:1, steyraug:1, xm8:0, mk2:1, m60:1, mg34:0, m79:1, mm1:1, xm25:0, minigun:0, trap1:1, trap2:1, trap3:1};
} else {
if (weaponunlocked.length == 0){
weaponunlocked = {beretta:1, deagle:1, danwesson:1, trench:1, mossberg:1, spas:0, mp5:1, mp9:1, steyrtmp:1, ak47:1, steyraug:1, xm8:0, mk2:1, m60:1, mg34:0, m79:1, mm1:1, xm25:0, minigun:0, trap1:1, trap2:1, trap3:1};
};
};
if (!weaponbought){
weaponbought = {beretta:1, deagle:0, danwesson:0, trench:0, mossberg:0, spas:0, mp5:0, mp9:0, steyrtmp:0, ak47:0, steyraug:0, xm8:0, mk2:0, m60:0, mg34:0, m79:0, mm1:0, xm25:0, minigun:0, trap1:0, trap2:0, trap3:0};
} else {
if (weaponbought.length == 0){
weaponbought = {beretta:1, deagle:0, danwesson:0, trench:0, mossberg:0, spas:0, mp5:0, mp9:0, steyrtmp:0, ak47:0, steyraug:0, xm8:0, mk2:0, m60:0, mg34:0, m79:0, mm1:0, xm25:0, minigun:0, trap1:0, trap2:0, trap3:0};
} else {
if (!weaponbought["beretta"]){
weaponbought["beretta"] = 1;
};
};
};
if (!equipped){
equipped = ["beretta", "", ""];
} else {
if (equipped.length == 0){
equipped = ["beretta", "", ""];
} else {
if (equipped[0] != "beretta"){
equipped = ["beretta", "", ""];
};
};
};
if (!ammo){
ammo = {beretta:-1, rifle:0, shotgun:0, mgun:0, grenade:0};
} else {
if (ammo.length == 0){
ammo = {beretta:-1, rifle:0, shotgun:0, mgun:0, grenade:0};
} else {
ammo["beretta"] = -1;
};
};
if (!accuracy){
accuracy = 100;
} else {
if (accuracy == 0){
accuracy = 100;
};
};
if (!fence){
fence = 0;
} else {
if (fence == 0){
fence = 0;
};
};
if (!fencerate){
fencerate = 100;
} else {
if (fencerate == 0){
fencerate = 100;
};
};
if (!level){
level = 0;
};
}
public function doDebugMode(){
debugmode = true;
savedata = false;
achievements = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
fenceunlocked = {level:1, repair:1, attack:1};
phantunlocked = {payment:1, skill:1, anger:1};
weaponunlocked = {beretta:1, deagle:1, danwesson:1, trench:1, mossberg:1, spas:1, mp5:1, mp9:1, steyrtmp:1, ak47:1, steyraug:1, xm8:1, mk2:1, m60:1, mg34:1, m79:1, mm1:1, xm25:1, minigun:1, trap1:1, trap2:1, trap3:1};
}
public function setAchievement(_id){
if (((!(debugmode)) && (!(achievements[_id])))){
achieverqueue.push(_id);
achievements[_id] = 1;
if (achieverqueue.length == 1){
showAchievement();
} else {
achievertimer = (achievertimer * 0.5);
};
};
}
public function upgradeFence(iname, iprice, max):Boolean{
if (((((fenceunlocked[iname]) && ((money >= iprice)))) && ((fenceupgrade[iname] < 3)))){
money = (money - iprice);
var _local4 = fenceupgrade;
var _local5 = iname;
var _local6 = (_local4[_local5] + 1);
_local4[_local5] = _local6;
if (iname == "level"){
fence = max;
};
saveData();
return (true);
} else {
if (((debugmode) && ((fenceupgrade[iname] < 3)))){
_local4 = fenceupgrade;
_local5 = iname;
_local6 = (_local4[_local5] + 1);
_local4[_local5] = _local6;
if (iname == "level"){
fence = max;
};
return (true);
};
};
return (false);
}
private function waitAchievement(e){
if (!maintimeline.contains(achieverskin)){
maintimeline.addChild(achieverskin);
} else {
maintimeline.setChildIndex(achieverskin, (maintimeline.numChildren - 2));
};
achievertimer--;
if (achievertimer == 0){
tweenmgr.register(achieverskin, {live:15, ease:"easenone", x:0, y:200, alpha:1, rotation:0, scalex:1, scaley:1}, {scope:this, onfinished:hideAchievement});
achieverskin.removeEventListener(Event.ENTER_FRAME, waitAchievement);
};
}
private function hideAchievement(_skin){
achieverqueue.splice(0, 1);
if (achieverqueue.length > 0){
showAchievement();
};
}
public function resetData(_initdata=null){
if (!_initdata){
_initdata = new Array();
};
if (maintimeline.weaponmgr){
maintimeline.weaponmgr.setWeapon();
};
if (_initdata.achievements){
achievements = _initdata.achievements;
} else {
achievements = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
};
if (_initdata.fenceupgrade){
fenceupgrade = _initdata.fenceupgrade;
} else {
fenceupgrade = {level:0, repair:0, attack:0};
};
if (_initdata.fenceunlocked){
fenceunlocked = _initdata.fenceunlocked;
} else {
fenceunlocked = {level:1, repair:1, attack:1};
};
if (_initdata.phantupgrade){
phantupgrade = _initdata.phantupgrade;
} else {
phantupgrade = {payment:0, skill:0, anger:0};
};
if (_initdata.phantunlocked){
phantunlocked = _initdata.phantunlocked;
} else {
phantunlocked = {payment:1, skill:1, anger:1};
};
if (_initdata.weaponupgrade){
weaponupgrade = _initdata.weaponupgrade;
} else {
weaponupgrade = {beretta:[0, 0, 0], deagle:[0, 0, 0], danwesson:[0, 0, 0], trench:[0, 0, 0], mossberg:[0, 0, 0], spas:[0, 0, 0], mp5:[0, 0, 0], mp9:[0, 0, 0], steyrtmp:[0, 0, 0], ak47:[0, 0, 0], steyraug:[0, 0, 0], xm8:[0, 0, 0], mk2:[0, 0, 0], m60:[0, 0, 0], mg34:[0, 0, 0], m79:[0, 0, 0], mm1:[0, 0, 0], xm25:[0, 0, 0], minigun:[0, 0, 0], trap1:[0, 0, 0], trap2:[0, 0, 0], trap3:[0, 0, 0]};
};
if (_initdata.weaponunlocked){
weaponunlocked = _initdata.weaponunlocked;
} else {
weaponunlocked = {beretta:1, deagle:1, danwesson:1, trench:1, mossberg:1, spas:1, mp5:1, mp9:1, steyrtmp:1, ak47:1, steyraug:1, xm8:1, mk2:1, m60:1, mg34:1, m79:1, mm1:1, xm25:1, minigun:1, trap1:1, trap2:1, trap3:1};
};
if (_initdata.weaponbought){
weaponbought = _initdata.weaponbought;
} else {
weaponbought = {beretta:1, deagle:0, danwesson:0, trench:0, mossberg:0, spas:0, mp5:0, mp9:0, steyrtmp:0, ak47:0, steyraug:0, xm8:0, mk2:0, m60:0, mg34:0, m79:0, mm1:0, xm25:0, minigun:0, trap1:0, trap2:0, trap3:0};
};
if (_initdata.equipped){
equipped = _initdata.equipped;
} else {
equipped = ["beretta", "", ""];
};
if (_initdata.ammo){
ammo = _initdata.ammo;
} else {
ammo = {beretta:-1, rifle:-1, shotgun:-1, mgun:-1, grenade:-1};
};
if (_initdata.money){
money = _initdata.money;
} else {
money = 0;
};
if (_initdata.score){
score = _initdata.score;
} else {
score = 0;
};
if (_initdata.totalkill){
totalkill = _initdata.totalkill;
} else {
totalkill = 0;
};
if (_initdata.kill){
kill = _initdata.kill;
} else {
kill = new Array();
};
if (_initdata.killmoney){
killmoney = _initdata.killmoney;
} else {
killmoney = 0;
};
if (_initdata.hit){
hit = _initdata.hit;
} else {
hit = 0;
};
if (_initdata.miss){
miss = _initdata.miss;
} else {
miss = 0;
};
if (_initdata.accuracy){
accuracy = _initdata.accuracy;
} else {
accuracy = 0;
};
if (_initdata.accuracymoney){
accuracymoney = _initdata.accuracymoney;
} else {
accuracymoney = 0;
};
if (_initdata.fence){
fence = _initdata.fence;
} else {
fence = 250;
};
if (_initdata.fencerate){
fencerate = _initdata.fencerate;
} else {
fencerate = 100;
};
if (_initdata.fencemoney){
fencemoney = _initdata.fencemoney;
} else {
fencemoney = 0;
};
if (_initdata.totalmoney){
totalmoney = _initdata.totalmoney;
} else {
totalmoney = 0;
};
if (_initdata.totaltime){
totaltime = _initdata.totaltime;
} else {
totaltime = 0;
};
if (_initdata.level){
level = _initdata.level;
} else {
level = 0;
};
}
public function getAchievementCount():int{
var i:*;
var cnt:*;
i = 0;
while (i < achievements.length) {
cnt = (cnt + achievements[i]);
i++;
};
return (cnt);
}
public function addKill(_name){
if (!levelkill[_name]){
levelkill[_name] = 1;
} else {
levelkill[_name] = (levelkill[_name] + 1);
};
leveltotalkill = (leveltotalkill + 1);
}
public function addGameTime(_time){
if (!debugmode){
totaltime = (totaltime + _time);
saveData();
};
}
public function loadData(_slot=0){
var so:*;
var sname:*;
if (tracing){
trace("GameDataManager:loadData:Loading Data");
};
if (_slot > 0){
sname = ((savename + "_") + _slot);
} else {
sname = savename;
};
so = SharedObject.getLocal(sname);
if (so.size == 0){
resetData();
saveData();
};
resetData();
if (so.data.score){
achievements = so.data.achievements;
fenceupgrade = so.data.fenceupgrade;
fenceunlocked = so.data.fenceunlocked;
phantupgrade = so.data.phantupgrade;
phantunlocked = so.data.phantunlocked;
weaponupgrade = so.data.weaponupgrade;
weaponunlocked = so.data.weaponunlocked;
weaponbought = so.data.weaponbought;
equipped = so.data.equipped;
ammo = so.data.ammo;
money = so.data.money;
score = so.data.score;
totalkill = so.data.totalkill;
kill = so.data.kill;
killmoney = so.data.killmoney;
hit = so.data.hit;
miss = so.data.miss;
accuracy = so.data.accuracy;
accuracymoney = so.data.accuracymoney;
fence = so.data.fence;
fencerate = so.data.fencerate;
fencemoney = so.data.fencemoney;
totalmoney = so.data.totalmoney;
totaltime = so.data.totaltime;
level = so.data.level;
};
checkValidity();
}
public function saveData(_slot=0){
var so:*;
var sname:*;
if (!debugmode){
if (tracing){
trace("GameDataManager:saveData: Saving Data");
};
if (_slot > 0){
sname = ((savename + "_") + _slot);
} else {
sname = savename;
};
so = SharedObject.getLocal(sname);
if (savedata){
so.data.achievements = achievements;
so.data.fenceupgrade = fenceupgrade;
so.data.fenceunlocked = fenceunlocked;
so.data.phantupgrade = phantupgrade;
so.data.phantunlocked = phantunlocked;
so.data.weaponupgrade = weaponupgrade;
so.data.weaponunlocked = weaponunlocked;
so.data.weaponbought = weaponbought;
so.data.equipped = equipped;
so.data.ammo = ammo;
so.data.money = money;
so.data.score = score;
so.data.totalkill = totalkill;
so.data.kill = kill;
so.data.killmoney = killmoney;
so.data.hit = hit;
so.data.miss = miss;
so.data.accuracy = accuracy;
so.data.accuracymoney = accuracymoney;
so.data.fence = fence;
so.data.fencerate = fencerate;
so.data.fencemoney = fencemoney;
so.data.totalmoney = totalmoney;
so.data.totaltime = totaltime;
so.data.level = level;
so.flush();
if (kongmgr){
saveKong();
};
};
loadDataSummary();
};
}
public function repairFence(repair, price, max):Boolean{
if ((((money >= price)) && ((fence < max)))){
money = (money - price);
fence = (fence + (repair * max));
if (fence > max){
fence = max;
};
saveData();
return (true);
} else {
if (((debugmode) && ((fence < max)))){
fence = (fence + (repair * max));
if (fence > max){
fence = max;
};
return (true);
};
};
return (false);
}
public function loadDataSummary(){
var i:*;
var so:*;
var sname:*;
if (tracing){
trace("GameDataManager:loadData:Loading Data Summary");
};
datasummary = new Array();
i = 0;
while (i < 4) {
if (i == 0){
sname = savename;
} else {
sname = ((savename + "_") + i);
};
so = SharedObject.getLocal(sname);
if (so.size == 0){
datasummary.push({level:0, score:0});
} else {
if (so.data.score){
datasummary.push({level:so.data.level, score:so.data.score});
} else {
datasummary.push({level:0, score:0});
};
};
i++;
};
}
public function commitLevelData(_obj, _win=true){
var key:*;
leveltotalkill = _obj.leveltotalkill;
levelkill = _obj.levelkill;
levelkillmoney = _obj.levelkillmoney;
levelhit = _obj.levelhit;
levelmiss = _obj.levelmiss;
levelaccuracy = _obj.levelaccuracy;
levelaccuracymoney = _obj.levelaccuracymoney;
levelfence = _obj.levelfence;
levelfencemoney = _obj.levelfencemoney;
levelmoney = _obj.levelmoney;
levelscore = _obj.levelscore;
money = (money + levelmoney);
score = (score + levelscore);
totalkill = (totalkill + leveltotalkill);
if (!kill){
kill = new Array();
};
for (key in levelkill) {
if (kill[key]){
kill[key] = (kill[key] + levelkill[key]);
} else {
kill[key] = levelkill[key];
};
};
killmoney = (killmoney + levelkillmoney);
hit = (hit + levelhit);
miss = (miss + levelmiss);
accuracy = Math.floor(((hit / (hit + miss)) * 100));
accuracymoney = (accuracymoney + levelaccuracymoney);
fence = _obj.fencevar.health;
fencerate = Math.floor(((fencerate + levelfence) / 2));
fencemoney = (fencemoney + levelfencemoney);
totalmoney = (totalmoney + levelmoney);
if (_win){
level = (level + 1);
};
saveData();
}
public function startLevelTest(_lv){
var lvdata:*;
doDebugMode();
switch (_lv){
case 700:
lvdata = {level:700};
resetData(lvdata);
break;
case 1500:
lvdata = {level:1500};
resetData(lvdata);
break;
case 2300:
lvdata = {level:2300};
resetData(lvdata);
break;
case 2400:
lvdata = {level:2400};
resetData(lvdata);
break;
default:
lvdata = {level:_lv};
resetData(lvdata);
break;
};
}
}
}//package
Section 57
//DataTrap (DataTrap)
package {
import flash.display.*;
public class DataTrap extends MovieClip {
public var live;
public var skin;
public function DataTrap(_name){
super();
this.name = _name;
setSkin("start");
switch (this.name){
case "trap3":
live = 1;
break;
case "trap2":
live = 2;
break;
case "trap1":
default:
live = 1;
break;
};
}
public function setSkin(_param){
var obj:*;
while (this.numChildren > 0) {
this.removeChildAt(0);
};
switch (_param){
case "start":
switch (this.name){
case "trap3":
skin = new mc_trap3_pointer();
this.name = "trap3";
break;
case "trap2":
skin = new mc_trap2_pointer();
this.name = "trap2";
break;
case "trap1":
default:
skin = new mc_trap1_pointer();
this.name = "trap1";
break;
};
break;
case "put":
switch (this.name){
case "trap3":
skin = new mc_trap3_put();
this.name = "trap3put";
this.alpha = 0.9;
break;
case "trap2":
skin = new mc_trap2_put();
this.name = "trap2put";
this.alpha = 0.9;
break;
case "trap1":
default:
skin = new mc_trap1_put();
this.name = "trap1put";
this.alpha = 0.9;
break;
};
break;
case "idle":
switch (this.name){
case "trap3put":
skin = new mc_trap3_idle();
this.name = "trap3";
this.alpha = 0.9;
break;
case "trap2put":
skin = new mc_trap2_idle();
this.name = "trap2";
this.alpha = 0.9;
break;
case "trap1put":
skin = new mc_trap1_idle();
this.name = "trap1";
this.alpha = 0.9;
break;
};
break;
case "hit":
switch (this.name){
case "trap3put":
case "trap3":
if (live){
skin = new mc_trap3_hit();
this.name = "trap3";
} else {
skin = new mc_trap3_hit();
this.name = "trap3";
};
break;
case "trap2put":
case "trap2":
if (live){
skin = new mc_trap2_hit();
this.name = "trap2";
} else {
skin = new mc_trap2_hit();
this.name = "trap2";
};
break;
case "trap1put":
case "trap1":
if (live){
skin = new mc_trap1_hit();
this.name = "trap1";
} else {
skin = new mc_trap1_hit();
this.name = "trap1";
};
break;
};
break;
};
this.addChild(skin);
}
}
}//package
Section 58
//DataWeapon (DataWeapon)
package {
import flash.display.*;
public class DataWeapon extends MovieClip {
public var reloadrate;
public var picture;
public var heatdec;
public var weaponbullet;
public var weaponavailable;
public var shoot;
public var bulletmagzmax;
public var bullettype;
public var named;
public var damage;
public var bulletmagz;
public var current;
public var skin;
public var bullettotal;
public var reloadskin;
public var heatmax;
public var ratemax;
public var bulletlist;
public var shock;
public var type;
public var effect;
public var weaponlist;
public var weaponequippable;
public var weapons;
public var rate;
public var reloadtime;
public var heatinc;
public var heat;
public function DataWeapon(){
bulletlist = ["beretta", "rifle", "shotgun", "mgun", "grenade"];
weaponlist = ["beretta", "deagle", "danwesson", "trench", "mossberg", "spas", "mp5", "mp9", "steyrtmp", "ak47", "steyraug", "xm8", "mk2", "m60", "mg34", "m79", "mm1", "xm25", "minigun", "trap1", "trap2", "trap3"];
weaponavailable = [true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true];
weaponequippable = [true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false];
weaponbullet = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
weapons = {beretta:{named:"HG9 PB", type:"Handgun", price:{buy:0, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[7, 9, 11, 13], ratemax:8, heatinc:10, heatdec:2, heatmax:100, bullettype:"beretta", bulletmagzmax:[15, 20, 25, 30], bullettotal:-1, reloadrate:[35, 30, 25, 20], shock:0.2, effect:"None"}, deagle:{named:"Dexert Eagle", type:"Handgun", price:{buy:750, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[11, 13, 15, 17], ratemax:12, heatinc:10, heatdec:2, heatmax:100, bullettype:"rifle", bulletmagzmax:[10, 15, 20, 25], bullettotal:-1, reloadrate:[30, 25, 20, 15], shock:0.2, effect:"None"}, danwesson:{named:".357 HG", type:"Handgun", price:{buy:900, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[15, 17, 19, 21], ratemax:10, heatinc:10, heatdec:2, heatmax:100, bullettype:"rifle", bulletmagzmax:[6, 8, 10, 12], bullettotal:-1, reloadrate:[25, 20, 15, 10], shock:0.2, effect:"None"}, trench:{named:"Trench Gun", type:"Shotgun", price:{buy:1100, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[8, 10, 12, 14], ratemax:25, heatinc:10, heatdec:2, heatmax:100, bullettype:"shotgun", bulletmagzmax:[5, 6, 7, 9], bullettotal:-1, reloadrate:[35, 30, 25, 20], shock:0.6, effect:"None"}, mossberg:{named:"MSG 500", type:"Shotgun", price:{buy:1250, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[12, 14, 16, 18], ratemax:25, heatinc:10, heatdec:2, heatmax:100, bullettype:"shotgun", bulletmagzmax:[5, 6, 7, 9], bullettotal:-1, reloadrate:[35, 30, 25, 20], shock:0.6, effect:"None"}, spas:{named:"MSP 12", type:"Shotgun", price:{buy:1500, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[6, 8, 10, 12], ratemax:15, heatinc:10, heatdec:2, heatmax:100, bullettype:"shotgun", bulletmagzmax:[8, 10, 12, 14], bullettotal:-1, reloadrate:[35, 30, 25, 20], shock:0.5, effect:"None"}, mp5:{named:"SMG-5", type:"Submachine Gun", price:{buy:1250, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[5, 6, 7, 9], ratemax:4, heatinc:5, heatdec:1, heatmax:100, bullettype:"rifle", bulletmagzmax:[50, 60, 70, 80], bullettotal:-1, reloadrate:[35, 30, 25, 20], shock:1, effect:"None"}, mp9:{named:"SMG-9", type:"Submachine Gun", price:{buy:1750, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[7, 8, 9, 10], ratemax:4, heatinc:5, heatdec:1, heatmax:100, bullettype:"rifle", bulletmagzmax:[50, 60, 70, 80], bullettotal:-1, reloadrate:[35, 30, 25, 20], shock:1, effect:"None"}, steyrtmp:{named:"SMG-TMP", type:"Submachine Gun", price:{buy:2500, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[9, 10, 11, 12], ratemax:4, heatinc:5, heatdec:1, heatmax:100, bullettype:"rifle", bulletmagzmax:[50, 60, 70, 80], bullettotal:-1, reloadrate:[35, 30, 25, 20], shock:0.75, effect:"None"}, ak47:{named:"MK-47", type:"Assault Rifles", price:{buy:3500, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[12, 14, 16, 18], ratemax:6, heatinc:7, heatdec:1, heatmax:100, bullettype:"rifle", bulletmagzmax:[30, 40, 50, 60], bullettotal:-1, reloadrate:[35, 30, 25, 20], shock:0.5, effect:"None"}, steyraug:{named:"MK AUG", type:"Assault Rifles", price:{buy:4250, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[16, 18, 20, 22], ratemax:6, heatinc:7, heatdec:1, heatmax:100, bullettype:"rifle", bulletmagzmax:[30, 40, 50, 60], bullettotal:-1, reloadrate:[35, 30, 25, 20], shock:0.4, effect:"None"}, xm8:{named:"KM-8", type:"Assault Rifles", price:{buy:5100, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[20, 22, 24, 26], ratemax:6, heatinc:7, heatdec:1, heatmax:100, bullettype:"rifle", bulletmagzmax:[30, 40, 50, 60], bullettotal:-1, reloadrate:[35, 30, 25, 20], shock:0.4, effect:"None"}, mk2:{named:"Bren .303 MG", type:"Machine Gun", price:{buy:6300, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[20, 22, 24, 26], ratemax:4, heatinc:10, heatdec:1, heatmax:200, bullettype:"mgun", bulletmagzmax:[50, 60, 70, 80], bullettotal:-1, reloadrate:[35, 30, 25, 20], shock:0.3, effect:"None"}, m60:{named:"Classic MG", type:"Machine Gun", price:{buy:7800, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[24, 26, 28, 30], ratemax:4, heatinc:10, heatdec:1, heatmax:200, bullettype:"mgun", bulletmagzmax:[100, 120, 140, 160], bullettotal:-1, reloadrate:[40, 35, 30, 25], shock:0.25, effect:"None"}, mg34:{named:"X34 MG", type:"Machine Gun", price:{buy:8800, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[28, 30, 32, 34], ratemax:4, heatinc:10, heatdec:1, heatmax:200, bullettype:"mgun", bulletmagzmax:[100, 120, 140, 160], bullettotal:-1, reloadrate:[45, 40, 35, 30], shock:0.2, effect:"None"}, m79:{named:"Old Launcher", type:"Grenade Launcher", price:{buy:10350, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[40, 45, 50, 55], ratemax:30, heatinc:5, heatdec:2, heatmax:100, bullettype:"grenade", bulletmagzmax:[3, 4, 5, 6], bullettotal:-1, reloadrate:[45, 40, 35, 30], shock:0.4, effect:"None"}, mm1:{named:"New Launcher", type:"Grenade Launcher", price:{buy:11750, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[50, 55, 60, 65], ratemax:30, heatinc:5, heatdec:2, heatmax:100, bullettype:"grenade", bulletmagzmax:[4, 5, 6, 7], bullettotal:-1, reloadrate:[45, 40, 35, 30], shock:0.4, effect:"None"}, xm25:{named:"Fast Launcher", type:"Grenade Launcher", price:{buy:13250, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[60, 65, 70, 75], ratemax:30, heatinc:5, heatdec:2, heatmax:100, bullettype:"grenade", bulletmagzmax:[5, 6, 7, 8], bullettotal:-1, reloadrate:[45, 40, 35, 30], shock:0.3, effect:"None"}, minigun:{named:"Minigun", type:"Special", price:{buy:15000, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[28, 30, 32, 34], ratemax:2, heatinc:7, heatdec:1, heatmax:200, bullettype:"mgun", bulletmagzmax:[100, 120, 150, 200], bullettotal:-1, reloadrate:[45, 40, 35, 30], shock:0.1, effect:"None"}, trap1:{named:"Land Mine", type:"Special", price:{buy:250, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[200, 200, 200, 200], ratemax:3, heatinc:5, heatdec:2, heatmax:100, bullettype:".303", bulletmagzmax:[1, 1, 1, 1], bullettotal:-1, reloadrate:[45, 40, 35, 30], shock:0.9, effect:"None"}, trap2:{named:"Special Glue", type:"Special", price:{buy:50, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[50, 50, 50, 50], ratemax:3, heatinc:5, heatdec:2, heatmax:100, bullettype:".303", bulletmagzmax:[1, 1, 1, 1], bullettotal:-1, reloadrate:[45, 40, 35, 30], shock:0.9, effect:"Stun"}, trap3:{named:"Mouse Trap", type:"Special", price:{buy:50, damage:[300, 500, 700], clip:[500, 600, 700], rate:[300, 500, 700]}, damage:[75, 75, 75, 75], ratemax:3, heatinc:5, heatdec:2, heatmax:100, bullettype:".303", bulletmagzmax:[1, 1, 1, 1], bullettotal:-1, reloadrate:[45, 40, 35, 30], shock:0.9, effect:"Slow"}};
super();
weaponbullet[0] = 20;
setWeapon("beretta", [0, 0, 0], {beretta:-1});
}
public function setWeapon(_name, _data, _ammo){
if ((weaponlist.indexOf(current) > -1)){
weaponbullet[weaponlist.indexOf(current)] = bulletmagz;
};
if ((((weaponlist.indexOf(_name) > -1)) && (weaponavailable[weaponlist.indexOf(_name)]))){
current = _name;
picture = getWeaponPicture();
skin = getWeaponSkin();
reloadskin = getReloadSkin();
named = weapons[current].named;
type = weapons[current].type;
damage = weapons[current].damage[_data[0]];
rate = 0;
ratemax = weapons[current].ratemax;
heat = 0;
heatinc = weapons[current].heatinc;
heatdec = weapons[current].heatdec;
heatmax = weapons[current].heatmax;
bullettype = weapons[current].bullettype;
bulletmagzmax = weapons[current].bulletmagzmax[_data[1]];
bulletmagz = weaponbullet[weaponlist.indexOf(current)];
bullettotal = weapons[current].bullettotal;
reloadtime = 0;
reloadrate = weapons[current].reloadrate[_data[2]];
shock = weapons[current].shock;
effect = weapons[current].effect;
shoot = false;
};
}
public function getReloadSkin(_type="current"):MovieClip{
var res:*;
var type:*;
type = _type;
if (type == "current"){
type = current;
};
switch (type){
case "beretta":
res = new mc_reload_m9();
break;
case "deagle":
res = new mc_reload_deagle();
break;
case "danwesson":
res = new mc_reload_danwesson();
break;
case "trench":
res = new mc_reload_trench();
break;
case "mossberg":
res = new mc_reload_mossberg500();
break;
case "spas":
res = new mc_reload_spas12();
break;
case "mp5":
res = new mc_reload_mp5();
break;
case "mp9":
res = new mc_reload_mp9();
break;
case "steyrtmp":
res = new mc_reload_steyrTMP();
break;
case "ak47":
res = new mc_reload_ak47();
break;
case "steyraug":
res = new mc_reload_steyrAUG();
break;
case "xm8":
res = new mc_reload_xm8();
break;
case "mk2":
res = new mc_reload_brenmk2();
break;
case "m60":
res = new mc_reload_m60();
break;
case "mg34":
res = new mc_reload_mg34();
break;
case "m79":
res = new mc_reload_m79();
break;
case "mm1":
res = new mc_reload_mm1();
break;
case "xm25":
res = new mc_reload_xm25();
break;
case "minigun":
res = new mc_reload_minigun();
break;
case "trap1":
res = new mc_reload_m60();
break;
case "trap2":
res = new mc_reload_m60();
break;
case "trap3":
res = new mc_reload_m60();
break;
default:
res = new mc_reload_m9();
break;
};
return (res);
}
public function getWeaponSkin(_type="current"):MovieClip{
var res:*;
var type:*;
type = _type;
if (type == "current"){
type = current;
};
switch (type){
case "beretta":
res = new mc_shoot_m9();
break;
case "deagle":
res = new mc_shoot_deagle();
break;
case "danwesson":
res = new mc_shoot_danwesson();
break;
case "trench":
res = new mc_shoot_trench();
break;
case "mossberg":
res = new mc_shoot_mossberg500();
break;
case "spas":
res = new mc_shoot_spas12();
break;
case "mp5":
res = new mc_shoot_mp5();
break;
case "mp9":
res = new mc_shoot_mp9();
break;
case "steyrtmp":
res = new mc_shoot_steyrTMP();
break;
case "ak47":
res = new mc_shoot_ak47();
break;
case "steyraug":
res = new mc_shoot_steyrAUG();
break;
case "xm8":
res = new mc_shoot_xm8();
break;
case "mk2":
res = new mc_shoot_brenmk2();
break;
case "m60":
res = new mc_shoot_m60();
break;
case "mg34":
res = new mc_shoot_mg34();
break;
case "m79":
res = new mc_shoot_m79();
break;
case "mm1":
res = new mc_shoot_mm1();
break;
case "xm25":
res = new mc_shoot_xm25();
break;
case "minigun":
res = new mc_shoot_minigun();
break;
case "trap1":
res = new mc_shoot_m9();
break;
case "trap2":
res = new mc_shoot_m9();
break;
case "trap3":
res = new mc_shoot_m9();
break;
default:
res = new mc_shoot_m9();
break;
};
return (res);
}
public function getWeaponPicture(_type="current"):Object{
var res:*;
var type:*;
type = _type;
if (type == "current"){
type = current;
};
switch (type){
case "beretta":
res = new mc_beretta();
break;
case "deagle":
res = new mc_deagle();
break;
case "danwesson":
res = new mc_danwesson();
break;
case "trench":
res = new mc_trench();
break;
case "mossberg":
res = new mc_mossberg();
break;
case "spas":
res = new mc_spas();
break;
case "mp5":
res = new mc_mp5();
break;
case "mp9":
res = new mc_mp9();
break;
case "steyrtmp":
res = new mc_steyrtmp();
break;
case "ak47":
res = new mc_ak47();
break;
case "steyraug":
res = new mc_steyraug();
break;
case "xm8":
res = new mc_xm8();
break;
case "mk2":
res = new mc_mk2();
break;
case "m60":
res = new mc_m60();
break;
case "mg34":
res = new mc_mg34();
break;
case "m79":
res = new mc_m79();
break;
case "mm1":
res = new mc_mm1();
break;
case "xm25":
res = new mc_xm25();
break;
case "minigun":
res = new mc_minigun();
break;
case "trap1":
res = new mc_trap1();
break;
case "trap2":
res = new mc_trap2();
break;
case "trap3":
res = new mc_trap3();
break;
default:
res = new mc_beretta();
break;
};
return (res);
}
public function resetMagazines(_data, _ammo){
var maxmagz:*;
var bltyp:*;
var crnt:*;
var i:*;
i = 0;
while (i < weaponbullet.length) {
crnt = weaponlist[i];
maxmagz = weapons[crnt].bulletmagzmax[_data[crnt][1]];
bltyp = weapons[crnt].bullettype;
if (_ammo[bullettype] > -1){
weaponbullet[i] = ((_ammo[bltyp])>=maxmagz) ? maxmagz : _ammo[bltyp];
} else {
weaponbullet[i] = maxmagz;
};
i++;
};
}
}
}//package
Section 59
//GameLost (GameLost)
package {
import flash.events.*;
import flash.display.*;
public class GameLost extends MovieClip {
private var maintimeline;
private var panel;
private var nextpage;
private var admgr;
private var pagemgr;
private var datamgr;
private var timer;
private var soundmgr;
private var tweenmgr;
private var curpage;
public var status;
public function GameLost(_mtl){
var i:*;
super();
maintimeline = _mtl;
tweenmgr = maintimeline.tweenmgr;
pagemgr = maintimeline.pagemgr;
soundmgr = maintimeline.soundmgr;
datamgr = maintimeline.datamgr;
admgr = maintimeline.admgr;
panel = [new mc_game_ads(), new mc_game_lost()];
this.addChild(panel[0]);
this.addChild(panel[1]);
admgr.getCPMAds(panel[0].adbox, "interlevel");
status = "start";
tweenmgr.register(panel[0], {live:10, ease:"easeoutcubic", x:0, y:300, alpha:1, rotation:0, scalex:1, scaley:1}, {scope:this, onfinished:startPanel});
tweenmgr.register(panel[1], {live:10, ease:"easeoutcubic", x:0, y:(0 - panel[1].height), alpha:1, rotation:0, scalex:1, scaley:1});
panel[1].tx1.text = (("but gained $" + datamgr.levelmoney) + " from the merchants");
panel[1].tx2.text = ("total money : $" + datamgr.money);
soundmgr.playBGM("cover");
}
private function goLoadGame(e){
nextpage = "load";
curpage = "gamelost";
stopPanel();
soundmgr.playSFX("menuclick");
}
private function activateButton(){
panel[1].btupgrade.addEventListener(MouseEvent.CLICK, goUpgrade, false, 0, true);
panel[1].btclose.addEventListener(MouseEvent.CLICK, goCover, false, 0, true);
panel[1].btreplay.addEventListener(MouseEvent.CLICK, goReplay, false, 0, true);
panel[1].btloadgame.addEventListener(MouseEvent.CLICK, goLoadGame, false, 0, true);
}
private function goUpgrade(e){
nextpage = "upgradeweapon";
curpage = "gamelost";
stopPanel();
soundmgr.playSFX("menuclick");
}
private function stopPanel(e=null){
deactivateButton();
close();
soundmgr.playSFX("menuclick");
}
private function goCover(e){
nextpage = "cover";
curpage = "none";
stopPanel();
soundmgr.playSFX("menuclick");
}
private function startPanel(e){
activateButton();
}
private function deactivateButton(){
panel[1].btupgrade.addEventListener(MouseEvent.CLICK, goUpgrade, false, 0, true);
panel[1].btclose.removeEventListener(MouseEvent.CLICK, goCover);
panel[1].btreplay.removeEventListener(MouseEvent.CLICK, goReplay);
panel[1].btloadgame.removeEventListener(MouseEvent.CLICK, goLoadGame);
}
private function goReplay(e){
nextpage = "game";
curpage = "none";
stopPanel();
soundmgr.playSFX("menuclick");
}
private function close(e=null){
admgr.clearCPMAds(panel[0].adbox, false);
pagemgr.loadPage(nextpage, curpage);
}
}
}//package
Section 60
//GameManager (GameManager)
package {
import flash.events.*;
import flash.display.*;
import defclass.ui.*;
import flash.utils.*;
import flash.ui.*;
public class GameManager extends MovieClip {
public var maintimeline;
private var nextpage;
private var introdlg;
public var scenemgr;
public var pagemgr;
public var datamgr;
private var starttime;
private var pausedlg;
public var btnmgr;
private var detectachievementstimer;
private var bossintrodlg;
private var startpausetime;
public var soundmgr;
public var ctrlmgr;
public var tweenmgr;
private var curpage;
public var status:String;
public function GameManager(_mtl){
var i:*;
super();
maintimeline = _mtl;
ctrlmgr = maintimeline.ctrlmgr;
pagemgr = maintimeline.pagemgr;
tweenmgr = maintimeline.tweenmgr;
soundmgr = maintimeline.soundmgr;
datamgr = maintimeline.datamgr;
scenemgr = new SceneManager(_mtl);
this.addChild(scenemgr);
pausedlg = new mc_paused();
introdlg = new mc_level_intro();
datamgr.initLevel();
startIntro();
soundmgr.playBGM("game");
}
private function destroyIntro(e){
this.removeChild(introdlg);
introdlg = null;
}
private function pauseGame(e=null){
status = "paused";
showPauseDialog();
ctrlmgr.PREVKEYPRESS["P"] = false;
ctrlmgr.PREVKEYPRESS["ESC"] = false;
Mouse.show();
}
private function removeDialog(obj=null){
if (this.contains(obj)){
this.removeChild(obj);
};
if (obj == pausedlg){
status = "playing";
};
}
private function increaseSFX(obj=null){
if (soundmgr.sfxvolume < 0.25){
soundmgr.adjustSFX(0.25);
} else {
if (soundmgr.sfxvolume < 0.5){
soundmgr.adjustSFX(0.5);
} else {
if (soundmgr.sfxvolume < 0.75){
soundmgr.adjustSFX(0.75);
} else {
if (soundmgr.sfxvolume < 1){
soundmgr.adjustSFX(1);
} else {
soundmgr.adjustSFX(0);
};
};
};
};
adjustSFXLamp(btnmgr.button[obj].parent);
soundmgr.playSFX("menuclick");
}
private function goUpgrade(e){
nextpage = "upgradeweapon";
curpage = "game";
stopGame();
}
private function stopGame(e=null){
this.removeEventListener(Event.ENTER_FRAME, moveClip);
status = "stop";
datamgr.addGameTime((getTimer() - starttime));
Mouse.show();
pagemgr.loadPage(nextpage, curpage);
}
private function startIntro(){
Mouse.show();
introdlg.btstart.addEventListener(MouseEvent.CLICK, stopIntro, false, 0, true);
introdlg.btupgrade.addEventListener(MouseEvent.CLICK, goUpgrade, false, 0, true);
introdlg.btexit.addEventListener(MouseEvent.CLICK, stopMainMenu, false, 0, true);
introdlg.y = -525;
this.addChild(introdlg);
tweenmgr.register(introdlg, {live:10, ease:"easeoutcubic", x:0, y:0, alpha:1, scalex:1, scaley:1});
if (datamgr.level < 100){
introdlg.txday.text = (datamgr.level + 1);
introdlg.txhint.text = datamgr.hint[datamgr.level];
} else {
introdlg.txday.text = (Math.floor((datamgr.level / 100)) + 1);
introdlg.txhint.text = datamgr.hint[Math.floor((datamgr.level / 100))];
};
}
private function increaseBGM(obj=null){
if (soundmgr.bgmvolume < 0.25){
soundmgr.adjustBGM(0.25);
} else {
if (soundmgr.bgmvolume < 0.5){
soundmgr.adjustBGM(0.5);
} else {
if (soundmgr.bgmvolume < 0.75){
soundmgr.adjustBGM(0.75);
} else {
if (soundmgr.bgmvolume < 1){
soundmgr.adjustBGM(1);
} else {
soundmgr.adjustBGM(0);
};
};
};
};
adjustBGMLamp(btnmgr.button[obj].parent);
soundmgr.playSFX("menuclick");
}
private function exitGame(e){
maintimeline.gotoAndPlay("coverpage");
soundmgr.playSFX("menuclick");
}
private function hidePauseDialog(obj=null){
tweenmgr.register(pausedlg, {live:10, ease:"easeincubic", x:0, y:600, alpha:1, scalex:1, scaley:1}, {scope:this, onfinished:removeDialog});
starttime = (starttime + (getTimer() - startpausetime));
soundmgr.playSFX("menuclick");
}
private function detectResultAchievements(){
if (!datamgr.achievements[28]){
if (datamgr.levelaccuracy >= 80){
datamgr.setAchievement(28);
};
};
if (!datamgr.achievements[29]){
if (datamgr.levelaccuracy >= 100){
datamgr.setAchievement(29);
};
};
if (!datamgr.achievements[30]){
if (datamgr.levelfence < 10){
datamgr.setAchievement(30);
};
};
if (!datamgr.achievements[31]){
if (datamgr.levelfence >= 100){
datamgr.setAchievement(31);
};
};
if (!datamgr.achievements[36]){
if (datamgr.levelkill["boss1"]){
datamgr.setAchievement(36);
};
};
if (!datamgr.achievements[37]){
if (datamgr.levelkill["boss2"]){
datamgr.setAchievement(37);
};
};
if (!datamgr.achievements[38]){
if (datamgr.levelkill["boss3"]){
datamgr.setAchievement(38);
};
};
if (!datamgr.achievements[39]){
if (datamgr.level > 24){
datamgr.setAchievement(39);
};
};
}
private function stopPlayerLost(){
nextpage = "gamelost";
curpage = "none";
stopGame();
}
private function stopPlayerWin(){
if (datamgr.level < 24){
nextpage = "gamestats";
} else {
nextpage = "ending";
};
curpage = "none";
detectResultAchievements();
stopGame();
}
private function adjustSFXLamp(_lampparent){
_lampparent.mcsoundlamp01.gotoAndStop(1);
_lampparent.mcsoundlamp02.gotoAndStop(1);
_lampparent.mcsoundlamp03.gotoAndStop(1);
_lampparent.mcsoundlamp04.gotoAndStop(1);
if (soundmgr.sfxvolume > 0){
_lampparent.mcsoundlamp01.gotoAndStop(2);
};
if (soundmgr.sfxvolume > 0.25){
_lampparent.mcsoundlamp02.gotoAndStop(2);
};
if (soundmgr.sfxvolume > 0.5){
_lampparent.mcsoundlamp03.gotoAndStop(2);
};
if (soundmgr.sfxvolume > 0.75){
_lampparent.mcsoundlamp04.gotoAndStop(2);
};
}
private function adjustBGMLamp(_lampparent){
_lampparent.mcmusiclamp01.gotoAndStop(1);
_lampparent.mcmusiclamp02.gotoAndStop(1);
_lampparent.mcmusiclamp03.gotoAndStop(1);
_lampparent.mcmusiclamp04.gotoAndStop(1);
if (soundmgr.bgmvolume > 0){
_lampparent.mcmusiclamp01.gotoAndStop(2);
};
if (soundmgr.bgmvolume > 0.25){
_lampparent.mcmusiclamp02.gotoAndStop(2);
};
if (soundmgr.bgmvolume > 0.5){
_lampparent.mcmusiclamp03.gotoAndStop(2);
};
if (soundmgr.bgmvolume > 0.75){
_lampparent.mcmusiclamp04.gotoAndStop(2);
};
}
private function startGame(){
this.addEventListener(Event.ENTER_FRAME, moveClip, false, 0, true);
status = "startplaying";
scenemgr.status = "playing";
starttime = getTimer();
detectachievementstimer = 60;
Mouse.hide();
}
private function stopIntro(e){
introdlg.btstart.removeEventListener(MouseEvent.CLICK, stopIntro);
introdlg.btupgrade.removeEventListener(MouseEvent.CLICK, goUpgrade);
introdlg.btexit.removeEventListener(MouseEvent.CLICK, stopMainMenu);
tweenmgr.register(introdlg, {live:10, ease:"easeoutcubic", x:0, y:525, alpha:1, scalex:1, scaley:1}, {scope:this, onfinished:destroyIntro});
startGame();
}
private function detectControl(){
if ((((status == "playing")) && ((scenemgr.status == "playing")))){
if (ctrlmgr.MOUSEPRESS){
scenemgr.shootTarget(maintimeline.mouseX, maintimeline.mouseY);
} else {
scenemgr.setTarget(maintimeline.mouseX, maintimeline.mouseY);
};
if (((!(ctrlmgr.KEYPRESS["n1"])) && (ctrlmgr.PREVKEYPRESS["n1"]))){
scenemgr.setWeapon(0);
ctrlmgr.PREVKEYPRESS["n1"] = false;
soundmgr.playSFX("menuclick");
};
if (((!(ctrlmgr.KEYPRESS["n2"])) && (ctrlmgr.PREVKEYPRESS["n2"]))){
scenemgr.setWeapon(1);
ctrlmgr.PREVKEYPRESS["n2"] = false;
soundmgr.playSFX("menuclick");
};
if (((!(ctrlmgr.KEYPRESS["n3"])) && (ctrlmgr.PREVKEYPRESS["n3"]))){
scenemgr.setWeapon(2);
ctrlmgr.PREVKEYPRESS["n3"] = false;
soundmgr.playSFX("menuclick");
};
if (((!(ctrlmgr.KEYPRESS["n4"])) && (ctrlmgr.PREVKEYPRESS["n4"]))){
scenemgr.setWeapon(3);
ctrlmgr.PREVKEYPRESS["n4"] = false;
soundmgr.playSFX("menuclick");
};
if (((!(ctrlmgr.KEYPRESS["n5"])) && (ctrlmgr.PREVKEYPRESS["n5"]))){
scenemgr.setWeapon(4);
ctrlmgr.PREVKEYPRESS["n5"] = false;
soundmgr.playSFX("menuclick");
};
if (((!(ctrlmgr.KEYPRESS["n6"])) && (ctrlmgr.PREVKEYPRESS["n6"]))){
scenemgr.setWeapon(5);
ctrlmgr.PREVKEYPRESS["n6"] = false;
soundmgr.playSFX("menuclick");
};
if (((!(ctrlmgr.KEYPRESS["Q"])) && (ctrlmgr.PREVKEYPRESS["Q"]))){
scenemgr.prevWeapon();
ctrlmgr.PREVKEYPRESS["Q"] = false;
soundmgr.playSFX("menuclick");
};
if (((!(ctrlmgr.KEYPRESS["E"])) && (ctrlmgr.PREVKEYPRESS["E"]))){
scenemgr.nextWeapon();
ctrlmgr.PREVKEYPRESS["E"] = false;
soundmgr.playSFX("menuclick");
};
if (((!(ctrlmgr.KEYPRESS["R"])) && (ctrlmgr.PREVKEYPRESS["R"]))){
scenemgr.reloadWeapon();
ctrlmgr.PREVKEYPRESS["R"] = false;
soundmgr.playSFX("menuclick");
};
if (((((!(ctrlmgr.KEYPRESS["P"])) && (ctrlmgr.PREVKEYPRESS["P"]))) || (((!(ctrlmgr.KEYPRESS["ESC"])) && (ctrlmgr.PREVKEYPRESS["ESC"]))))){
pauseGame();
ctrlmgr.PREVKEYPRESS["P"] = false;
ctrlmgr.PREVKEYPRESS["ESC"] = false;
};
} else {
if (scenemgr.status == "startboss"){
if (((!(ctrlmgr.GLOBALKEYPRESS)) && (ctrlmgr.GLOBALPREVKEYPRESS))){
ctrlmgr.GLOBALPREVKEYPRESS = false;
if (bossintrodlg){
bossintrodlg.skip();
};
};
};
};
}
private function showPauseDialog(obj=null){
adjustSFXLamp(pausedlg);
adjustBGMLamp(pausedlg);
pausedlg.y = -200;
this.addChild(pausedlg);
tweenmgr.register(pausedlg, {live:5, ease:"easeoutcubic", x:0, y:0, alpha:1, scalex:1, scaley:1});
btnmgr = new ButtonManager([pausedlg.btok, pausedlg.btcancel, pausedlg.btsfx, pausedlg.btbgm]);
btnmgr.registerFunction(0, this, {onselect:hidePauseDialog});
btnmgr.registerFunction(1, this, {onselect:stopMainMenu});
btnmgr.registerFunction(2, this, {onselect:increaseSFX});
btnmgr.registerFunction(3, this, {onselect:increaseBGM});
startpausetime = getTimer();
soundmgr.playSFX("menuclick");
}
private function resetData(e){
}
private function moveClip(e=null){
maintimeline.stage.focus = maintimeline.stage;
switch (status){
case "showdialog":
scenemgr.moveClip();
btnmgr.moveClip(ctrlmgr.MOUSEPOS, ctrlmgr.MOUSEPRESS);
break;
case "startplaying":
status = "playing";
case "playing":
switch (scenemgr.status){
case "startboss":
scenemgr.moveClip();
if (!bossintrodlg){
if (scenemgr.bosslevel < 3){
bossintrodlg = new BossIntro(scenemgr.bosslevel);
this.addChild(bossintrodlg);
} else {
scenemgr.status = "playing";
};
} else {
if (bossintrodlg.complete){
this.removeChild(bossintrodlg);
bossintrodlg = null;
scenemgr.status = "playing";
} else {
bossintrodlg.moveClip();
};
};
break;
case "playing":
scenemgr.moveClip();
break;
case "playerwin":
stopPlayerWin();
break;
case "playerlost":
stopPlayerLost();
break;
};
detectControl();
break;
case "paused":
if (((((!(ctrlmgr.KEYPRESS["P"])) && (ctrlmgr.PREVKEYPRESS["P"]))) || (((!(ctrlmgr.KEYPRESS["ESC"])) && (ctrlmgr.PREVKEYPRESS["ESC"]))))){
ctrlmgr.PREVKEYPRESS["P"] = false;
ctrlmgr.PREVKEYPRESS["ESC"] = false;
resumeGame();
};
break;
};
detectPlayingAchievements();
ctrlmgr.moveClip();
}
private function resumeGame(e=null){
status = "playing";
hidePauseDialog();
ctrlmgr.PREVKEYPRESS["P"] = false;
ctrlmgr.PREVKEYPRESS["ESC"] = false;
Mouse.hide();
}
private function stopMainMenu(btn=null){
nextpage = "cover";
curpage = "none";
stopGame();
}
private function detectPlayingAchievements(){
var playtime:*;
var pausetime:*;
detectachievementstimer--;
if (detectachievementstimer == 0){
detectachievementstimer = 60;
if (!datamgr.achievements[0]){
if (((datamgr.totaltime + getTimer()) - starttime) >= 300000){
datamgr.setAchievement(0);
};
};
if (!datamgr.achievements[1]){
if (((datamgr.totaltime + getTimer()) - starttime) >= 600000){
datamgr.setAchievement(1);
};
};
if (!datamgr.achievements[2]){
if (((datamgr.totaltime + getTimer()) - starttime) >= 1200000){
datamgr.setAchievement(2);
};
};
if (!datamgr.achievements[3]){
if (((datamgr.totaltime + getTimer()) - starttime) >= 1800000){
datamgr.setAchievement(3);
};
};
if (!datamgr.achievements[4]){
if (((datamgr.totaltime + getTimer()) - starttime) >= 3600000){
datamgr.setAchievement(4);
};
};
} else {
if (detectachievementstimer == 20){
if (!datamgr.achievements[5]){
if (scenemgr.levelkill["blue"]){
datamgr.setAchievement(5);
};
};
if (!datamgr.achievements[6]){
if (scenemgr.levelkill["white"]){
datamgr.setAchievement(6);
};
};
if (!datamgr.achievements[7]){
if (scenemgr.levelkill["yellow"]){
datamgr.setAchievement(7);
};
};
if (!datamgr.achievements[8]){
if (scenemgr.levelkill["black"]){
datamgr.setAchievement(8);
};
};
if (!datamgr.achievements[9]){
if (scenemgr.levelkill["gray"]){
datamgr.setAchievement(9);
};
};
} else {
if (detectachievementstimer == 40){
if (!datamgr.achievements[32]){
if ((datamgr.totalkill + scenemgr.leveltotalkill) >= 100){
datamgr.setAchievement(32);
};
};
if (!datamgr.achievements[33]){
if ((datamgr.totalkill + scenemgr.leveltotalkill) >= 500){
datamgr.setAchievement(33);
};
};
if (!datamgr.achievements[34]){
if ((datamgr.totalkill + scenemgr.leveltotalkill) >= 1000){
datamgr.setAchievement(34);
};
};
if (!datamgr.achievements[35]){
if ((datamgr.totalkill + scenemgr.leveltotalkill) >= 1500){
datamgr.setAchievement(35);
};
};
};
};
};
}
}
}//package
Section 61
//GamePanel (GamePanel)
package {
import flash.events.*;
import flash.display.*;
import flash.filters.*;
public class GamePanel extends MovieClip {
private var bosshealth;
private var bossmaxhealth;
private var datamgr;
private var btbgmpos;
public var skin;
private var btsfxpos;
private var weaponvar;
private var fencemaxhealth;
public var mouseoverpanel;
private var tweenmgr;
private var selectedfilter;
private var fencehealth;
public function GamePanel(_tweenmgr, _datamgr, _weaponvar){
selectedfilter = new ColorMatrixFilter([1, 0, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 1, 0]);
super();
tweenmgr = _tweenmgr;
datamgr = _datamgr;
weaponvar = _weaponvar;
skin = new mc_gamepanel();
this.addChild(skin);
skin.bosshealth.y = 550;
btsfxpos = [skin.btsfxon.x, skin.btsfxon.y];
btbgmpos = [skin.btbgmon.x, skin.btbgmon.y];
skin.btsfxon.addEventListener(MouseEvent.ROLL_OVER, mouseOn, false, 0, true);
skin.btbgmon.addEventListener(MouseEvent.ROLL_OVER, mouseOn, false, 0, true);
skin.btweapon1.addEventListener(MouseEvent.ROLL_OVER, viewWeapon, false, 0, true);
skin.btweapon2.addEventListener(MouseEvent.ROLL_OVER, viewWeapon, false, 0, true);
skin.btweapon3.addEventListener(MouseEvent.ROLL_OVER, viewWeapon, false, 0, true);
skin.btweapon4.addEventListener(MouseEvent.ROLL_OVER, viewWeapon, false, 0, true);
skin.btweapon5.addEventListener(MouseEvent.ROLL_OVER, viewWeapon, false, 0, true);
skin.btweapon6.addEventListener(MouseEvent.ROLL_OVER, viewWeapon, false, 0, true);
skin.btsfxon.addEventListener(MouseEvent.ROLL_OUT, mouseOff, false, 0, true);
skin.btbgmon.addEventListener(MouseEvent.ROLL_OUT, mouseOff, false, 0, true);
skin.btweapon1.addEventListener(MouseEvent.ROLL_OUT, hideWeapon, false, 0, true);
skin.btweapon2.addEventListener(MouseEvent.ROLL_OUT, hideWeapon, false, 0, true);
skin.btweapon3.addEventListener(MouseEvent.ROLL_OUT, hideWeapon, false, 0, true);
skin.btweapon4.addEventListener(MouseEvent.ROLL_OUT, hideWeapon, false, 0, true);
skin.btweapon5.addEventListener(MouseEvent.ROLL_OUT, hideWeapon, false, 0, true);
skin.btweapon6.addEventListener(MouseEvent.ROLL_OUT, hideWeapon, false, 0, true);
skin.btweapon1.visible = !((datamgr.equipped[0] == ""));
skin.btweapon1.filters = ((datamgr.equipped[0])!=weaponvar.current) ? [] : [selectedfilter];
skin.btweapon2.visible = !((datamgr.equipped[1] == ""));
skin.btweapon2.filters = ((datamgr.equipped[1])!=weaponvar.current) ? [] : [selectedfilter];
skin.btweapon3.visible = !((datamgr.equipped[2] == ""));
skin.btweapon3.filters = ((datamgr.equipped[2])!=weaponvar.current) ? [] : [selectedfilter];
skin.btweapon4.visible = (datamgr.weaponbought["trap1"] > 0);
skin.btweapon5.visible = (datamgr.weaponbought["trap2"] > 0);
skin.btweapon6.visible = (datamgr.weaponbought["trap3"] > 0);
mouseoverpanel = false;
}
private function hideWeapon(e=null){
tweenmgr.register(skin.mctrapcontainer, {live:5, ease:"easenone", x:450, y:95, alpha:1, rotation:0, scalex:1, scaley:1});
mouseOff();
}
public function musicOn(){
skin.btbgmon.y = btbgmpos[1];
skin.btbgmoff.y = (btbgmpos[1] - 525);
}
public function musicOff(){
skin.btbgmoff.y = btbgmpos[1];
skin.btbgmon.y = (btbgmpos[1] - 525);
}
public function setBossHealth(health, maxhealth){
bosshealth = health;
bossmaxhealth = maxhealth;
}
private function viewWeapon(e=null){
if (skin.mctrapcontainer.mcloader.numChildren > 1){
skin.mctrapcontainer.mcloader.removeChildAt((skin.mctrapcontainer.mcloader.numChildren - 1));
};
if (e.target == skin.btweapon1){
if (datamgr.equipped[0] != ""){
skin.mctrapcontainer.mcloader.addChild(weaponvar.getWeaponPicture(datamgr.equipped[0]));
skin.mctrapcontainer.txname.text = weaponvar.weapons[datamgr.equipped[0]].named;
skin.mctrapcontainer.txlabel.text = "";
skin.mctrapcontainer.txcount.text = "";
} else {
skin.mctrapcontainer.txname.text = "Empty";
skin.mctrapcontainer.txlabel.text = "";
skin.mctrapcontainer.txcount.text = "";
};
} else {
if (e.target == skin.btweapon2){
if (datamgr.equipped[1] != ""){
skin.mctrapcontainer.mcloader.addChild(weaponvar.getWeaponPicture(datamgr.equipped[1]));
skin.mctrapcontainer.txname.text = weaponvar.weapons[datamgr.equipped[1]].named;
skin.mctrapcontainer.txlabel.text = "";
skin.mctrapcontainer.txcount.text = "";
} else {
skin.mctrapcontainer.txname.text = "Empty";
skin.mctrapcontainer.txlabel.text = "";
skin.mctrapcontainer.txcount.text = "";
};
} else {
if (e.target == skin.btweapon3){
if (datamgr.equipped[2] != ""){
skin.mctrapcontainer.mcloader.addChild(weaponvar.getWeaponPicture(datamgr.equipped[2]));
skin.mctrapcontainer.txname.text = weaponvar.weapons[datamgr.equipped[2]].named;
skin.mctrapcontainer.txlabel.text = "";
skin.mctrapcontainer.txcount.text = "";
} else {
skin.mctrapcontainer.txname.text = "Empty";
skin.mctrapcontainer.txlabel.text = "";
skin.mctrapcontainer.txcount.text = "";
};
} else {
if (e.target == skin.btweapon4){
skin.mctrapcontainer.mcloader.addChild(weaponvar.getWeaponPicture("trap1"));
skin.mctrapcontainer.txname.text = weaponvar.weapons["trap1"].named;
skin.mctrapcontainer.txlabel.text = "Inventory";
skin.mctrapcontainer.txcount.text = datamgr.weaponbought["trap1"];
} else {
if (e.target == skin.btweapon5){
skin.mctrapcontainer.mcloader.addChild(weaponvar.getWeaponPicture("trap2"));
skin.mctrapcontainer.txname.text = weaponvar.weapons["trap2"].named;
skin.mctrapcontainer.txlabel.text = "Inventory";
skin.mctrapcontainer.txcount.text = datamgr.weaponbought["trap2"];
} else {
if (e.target == skin.btweapon6){
skin.mctrapcontainer.mcloader.addChild(weaponvar.getWeaponPicture("trap3"));
skin.mctrapcontainer.txname.text = weaponvar.weapons["trap3"].named;
skin.mctrapcontainer.txlabel.text = "Inventory";
skin.mctrapcontainer.txcount.text = datamgr.weaponbought["trap3"];
};
};
};
};
};
};
tweenmgr.register(skin.mctrapcontainer, {live:5, ease:"easenone", x:322, y:95, alpha:1, rotation:0, scalex:1, scaley:1});
mouseOn();
}
public function soundOn(){
skin.btsfxon.y = btsfxpos[1];
skin.btsfxoff.y = (btsfxpos[1] - 525);
}
public function mouseOn(e=null){
mouseoverpanel = true;
}
public function mouseOff(e=null){
mouseoverpanel = false;
}
public function setHealth(health, maxhealth){
fencehealth = health;
fencemaxhealth = maxhealth;
}
public function stopBoss(){
skin.bosshealth.y = 550;
skin.bosshealth.bar.scaleX = 0;
tweenmgr.register(skin.bosshealth, {live:30, ease:"easeoutcubic", x:skin.bosshealth.x, y:510, alpha:1, rotation:0, scalex:1, scaley:1});
tweenmgr.register(skin.bosshealth.bar, {live:30, ease:"easeoutcubic", x:0, y:0, alpha:1, rotation:0, scalex:1, scaley:1});
}
public function setHealthInstant(health, maxhealth){
var sc:*;
fencehealth = health;
fencemaxhealth = maxhealth;
sc = (fencehealth / fencemaxhealth);
if (sc > 1){
sc = 1;
};
skin.fencehealth.bar.scaleX = sc;
}
public function moveClip(e=null){
var sc:*;
sc = (fencehealth / fencemaxhealth);
if (sc > 1){
sc = 1;
};
if ((skin.fencehealth.bar.scaleX - sc) > 0.01){
skin.fencehealth.bar.scaleX = (skin.fencehealth.bar.scaleX - 0.01);
} else {
if ((skin.fencehealth.bar.scaleX - sc) < -0.01){
skin.fencehealth.bar.scaleX = (skin.fencehealth.bar.scaleX + 0.01);
} else {
skin.fencehealth.bar.scaleX = sc;
};
};
skin.txfencehealth.text = ((("HEALTH : " + fencehealth) + " / ") + fencemaxhealth);
if (!skin.mcloader1.contains(weaponvar["picture"])){
while (skin.mcloader1.numChildren > 1) {
skin.mcloader1.removeChildAt((skin.mcloader1.numChildren - 1));
};
skin.mcloader1.addChild(weaponvar["picture"]);
};
skin.txweapon.text = weaponvar["named"];
skin.txbullet.text = ((("CLIP : " + weaponvar["bulletmagz"]) + " / ") + ((weaponvar["bullettotal"])>-1) ? weaponvar["bullettotal"] : "-inf-");
skin.weaponreload.bar.scaleX = (weaponvar["reloadtime"] / weaponvar["reloadrate"]);
skin.weaponheat.bar.scaleX = (((weaponvar["heat"] / weaponvar["heatmax"]))>1) ? 1 : (weaponvar["heat"] / weaponvar["heatmax"]);
skin.btweapon1.visible = !((datamgr.equipped[0] == ""));
skin.btweapon1.filters = ((datamgr.equipped[0])!=weaponvar.current) ? [] : [selectedfilter];
skin.btweapon2.visible = !((datamgr.equipped[1] == ""));
skin.btweapon2.filters = ((datamgr.equipped[1])!=weaponvar.current) ? [] : [selectedfilter];
skin.btweapon3.visible = !((datamgr.equipped[2] == ""));
skin.btweapon3.filters = ((datamgr.equipped[2])!=weaponvar.current) ? [] : [selectedfilter];
skin.btweapon4.visible = (datamgr.weaponbought["trap1"] > 0);
skin.btweapon5.visible = (datamgr.weaponbought["trap2"] > 0);
skin.btweapon6.visible = (datamgr.weaponbought["trap3"] > 0);
sc = (bosshealth / bossmaxhealth);
if (sc > 1){
sc = 1;
};
if ((skin.bosshealth.bar.scaleX - sc) > 0.01){
skin.bosshealth.bar.scaleX = (skin.bosshealth.bar.scaleX - 0.01);
} else {
if ((skin.bosshealth.bar.scaleX - sc) < -0.01){
skin.bosshealth.bar.scaleX = (skin.bosshealth.bar.scaleX + 0.01);
} else {
skin.bosshealth.bar.scaleX = sc;
};
};
}
public function setDay(day){
if (day < 100){
skin.txlevel.text = ("DAY " + day);
} else {
skin.txlevel.text = ("DAY " + Math.floor((day / 100)));
};
}
public function soundOff(){
skin.btsfxoff.y = btsfxpos[1];
skin.btsfxon.y = (btsfxpos[1] - 525);
}
public function startBoss(){
skin.bosshealth.y = 550;
skin.bosshealth.bar.scaleX = 0;
tweenmgr.register(skin.bosshealth, {live:30, ease:"easeoutcubic", x:skin.bosshealth.x, y:510, alpha:1, rotation:0, scalex:1, scaley:1});
tweenmgr.register(skin.bosshealth.bar, {live:30, ease:"easeoutcubic", x:0, y:0, alpha:1, rotation:0, scalex:1, scaley:1});
}
}
}//package
Section 62
//GameStatistics (GameStatistics)
package {
import flash.events.*;
import flash.display.*;
public class GameStatistics extends MovieClip {
private var maintimeline;
private var panel;
private var nextpage;
private var element;
private var admgr;
private var pagemgr;
private var datamgr;
private var timer;
private var soundmgr;
private var tweenmgr;
private var curpage;
public var status;
public function GameStatistics(_mtl){
var i:*;
super();
maintimeline = _mtl;
tweenmgr = maintimeline.tweenmgr;
pagemgr = maintimeline.pagemgr;
soundmgr = maintimeline.soundmgr;
datamgr = maintimeline.datamgr;
admgr = maintimeline.admgr;
panel = [new mc_game_ads(), new mc_game_stats()];
this.addChild(panel[0]);
this.addChild(panel[1]);
admgr.getCPMAds(panel[0].adbox, "interlevel");
element = [panel[1].txtitle, panel[1].txlabel1, panel[1].txkill, panel[1].txkillmoney, panel[1].txlabel2, panel[1].txaccuracy, panel[1].txaccuracymoney, panel[1].txlabel3, panel[1].txfence, panel[1].txfencemoney, panel[1].txlabel4, panel[1].txsubtotalmoney, panel[1].txlabel5, panel[1].txtotalmoney, panel[1].txlabel6, panel[1].txtotalscore, panel[1].btsave, panel[1].btupgrade, panel[1].btresume];
panel[1].txkill.text = Math.floor(datamgr.leveltotalkill);
panel[1].txkillmoney.text = ("$ " + Math.floor(datamgr.levelkillmoney));
panel[1].txaccuracy.text = (Math.floor(datamgr.levelaccuracy) + " %");
panel[1].txaccuracymoney.text = ("$ " + Math.floor(datamgr.levelaccuracymoney));
panel[1].txfence.text = (Math.floor(datamgr.levelfence) + " %");
panel[1].txfencemoney.text = ("$ " + Math.floor(datamgr.levelfencemoney));
panel[1].txsubtotalmoney.text = ("$ " + Math.floor(datamgr.levelmoney));
panel[1].txtotalmoney.text = ("$ " + Math.floor(datamgr.money));
panel[1].txtotalscore.text = Math.floor(datamgr.score);
i = 0;
while (i < element.length) {
element[i].visible = false;
i++;
};
status = "start";
tweenmgr.register(panel[0], {live:10, ease:"easeoutcubic", x:0, y:300, alpha:1, rotation:0, scalex:1, scaley:1}, {scope:this, onfinished:startPanel});
tweenmgr.register(panel[1], {live:10, ease:"easeoutcubic", x:0, y:(0 - panel[1].height), alpha:1, rotation:0, scalex:1, scaley:1});
soundmgr.playBGM("cover");
}
private function close(e=null){
admgr.clearCPMAds(panel[0].adbox, false);
pagemgr.loadPage(nextpage, curpage);
}
private function goGame(e){
nextpage = "game";
curpage = "none";
stopPanel();
soundmgr.playSFX("menuclick");
}
private function goUpgrade(e){
nextpage = "upgradeweapon";
curpage = "gamestats";
stopPanel();
soundmgr.playSFX("menuclick");
}
private function stopPanel(e=null){
panel[1].btsave.removeEventListener(MouseEvent.CLICK, goSave);
panel[1].btupgrade.removeEventListener(MouseEvent.CLICK, goUpgrade);
panel[1].btresume.removeEventListener(MouseEvent.CLICK, goGame);
close();
}
private function goSave(e){
nextpage = "save";
curpage = "gamestats";
stopPanel();
soundmgr.playSFX("menuclick");
}
private function moveClip(e){
if (timer > 0){
timer--;
if ((timer % 3) == 0){
element[((element.length - Math.floor((timer / 3))) - 1)].visible = true;
};
} else {
this.removeEventListener(Event.ENTER_FRAME, moveClip);
};
}
private function startPanel(e){
panel[1].btsave.addEventListener(MouseEvent.CLICK, goSave, false, 0, true);
panel[1].btupgrade.addEventListener(MouseEvent.CLICK, goUpgrade, false, 0, true);
panel[1].btresume.addEventListener(MouseEvent.CLICK, goGame, false, 0, true);
this.addEventListener(Event.ENTER_FRAME, moveClip, false, 0, true);
timer = (element.length * 3);
}
}
}//package
Section 63
//LoadPage (LoadPage)
package {
import flash.events.*;
import flash.display.*;
public class LoadPage extends MovieClip {
private var maintimeline;
private var panel;
private var nextpage;
private var element;
private var admgr;
private var pagemgr;
private var datamgr;
private var selectedslot;
private var timer;
private var slotpos;
private var soundmgr;
private var tweenmgr;
public var status;
public function LoadPage(_mtl){
var i:*;
super();
maintimeline = _mtl;
tweenmgr = maintimeline.tweenmgr;
pagemgr = maintimeline.pagemgr;
soundmgr = maintimeline.soundmgr;
datamgr = maintimeline.datamgr;
admgr = maintimeline.admgr;
panel = [new mc_game_ads(), new mc_game_load()];
this.addChild(panel[0]);
this.addChild(panel[1]);
admgr.getCPMAds(panel[0].adbox, "interlevel");
element = [panel[1].txtitle, panel[1].txsubtitle, panel[1].btslot1, panel[1].btslot2, panel[1].btslot3, panel[1].btslot4, panel[1].txlabel11, panel[1].txlabel12, panel[1].txmoney1, panel[1].txlabel13, panel[1].txscore1, panel[1].txlabel21, panel[1].txlabel22, panel[1].txmoney2, panel[1].txlabel23, panel[1].txscore2, panel[1].txlabel31, panel[1].txlabel32, panel[1].txmoney3, panel[1].txlabel33, panel[1].txscore3, panel[1].txlabel41, panel[1].txlabel42, panel[1].txmoney4, panel[1].txlabel43, panel[1].txscore4, panel[1].btload, panel[1].btclose, panel[1].btreset];
i = 0;
while (i < element.length) {
element[i].visible = true;
i++;
};
status = "start";
slotpos = [panel[1].btslot4.x, panel[1].btslot1.x, panel[1].btslot2.x, panel[1].btslot3.x];
panel[1].txmoney1.text = (datamgr.datasummary[1].level + 1);
panel[1].txscore1.text = datamgr.datasummary[1].score;
panel[1].txmoney2.text = (datamgr.datasummary[2].level + 1);
panel[1].txscore2.text = datamgr.datasummary[2].score;
panel[1].txmoney3.text = (datamgr.datasummary[3].level + 1);
panel[1].txscore3.text = datamgr.datasummary[3].score;
panel[1].txmoney4.text = (datamgr.datasummary[0].level + 1);
panel[1].txscore4.text = datamgr.datasummary[0].score;
tweenmgr.register(panel[0], {live:10, ease:"easeoutcubic", x:0, y:300, alpha:1, rotation:0, scalex:1, scaley:1}, {scope:this, onfinished:startPanel});
tweenmgr.register(panel[1], {live:10, ease:"easeoutcubic", x:0, y:(0 - panel[1].height), alpha:1, rotation:0, scalex:1, scaley:1});
}
private function close(e=null){
admgr.clearCPMAds(panel[0].adbox, false);
pagemgr.loadPage(nextpage);
}
private function stopPanel(e=null){
panel[1].btload.removeEventListener(MouseEvent.CLICK, goLoad);
panel[1].btclose.removeEventListener(MouseEvent.CLICK, goGameStats);
panel[1].btreset.removeEventListener(MouseEvent.CLICK, showResetDialog);
panel[1].mcresetdialog.btstart.removeEventListener(MouseEvent.CLICK, goReset);
panel[1].mcresetdialog.btclose.removeEventListener(MouseEvent.CLICK, hideResetDialog);
panel[1].btslot1.removeEventListener(MouseEvent.CLICK, selectSlot1);
panel[1].btslot2.removeEventListener(MouseEvent.CLICK, selectSlot2);
panel[1].btslot3.removeEventListener(MouseEvent.CLICK, selectSlot3);
panel[1].btslot4.removeEventListener(MouseEvent.CLICK, selectSlot4);
close();
}
private function selectSlot1(e=null){
panel[1].txsubtitle.text = "Slot 1 Selected";
selectedslot = 1;
panel[1].btslot1.x = -425;
panel[1].btslot2.x = slotpos[2];
panel[1].btslot3.x = slotpos[3];
panel[1].btslot4.x = slotpos[0];
panel[1].mcselectedslot.x = slotpos[1];
soundmgr.playSFX("menuclick");
}
private function goReset(e){
nextpage = "intro1";
datamgr.resetData();
datamgr.saveData(0);
stopPanel();
soundmgr.playSFX("menuclick");
}
private function selectSlot4(e=null){
panel[1].txsubtitle.text = "Autosave Selected";
selectedslot = 0;
panel[1].btslot1.x = slotpos[1];
panel[1].btslot2.x = slotpos[2];
panel[1].btslot3.x = slotpos[3];
panel[1].btslot4.x = -425;
panel[1].mcselectedslot.x = slotpos[0];
soundmgr.playSFX("menuclick");
}
private function selectSlot2(e=null){
panel[1].txsubtitle.text = "Slot 2 Selected";
selectedslot = 2;
panel[1].btslot1.x = slotpos[1];
panel[1].btslot2.x = -425;
panel[1].btslot3.x = slotpos[3];
panel[1].btslot4.x = slotpos[0];
panel[1].mcselectedslot.x = slotpos[2];
soundmgr.playSFX("menuclick");
}
private function selectSlot3(e=null){
panel[1].txsubtitle.text = "Slot 3 Selected";
selectedslot = 3;
panel[1].btslot1.x = slotpos[1];
panel[1].btslot2.x = slotpos[2];
panel[1].btslot3.x = -425;
panel[1].btslot4.x = slotpos[0];
panel[1].mcselectedslot.x = slotpos[3];
soundmgr.playSFX("menuclick");
}
private function showResetDialog(e){
panel[1].mcresetdialog.x = 0;
soundmgr.playSFX("menuclick");
}
private function moveClip(e){
if (timer > 0){
timer--;
if ((timer % 3) == 0){
element[((element.length - Math.floor((timer / 3))) - 1)].visible = true;
};
} else {
this.removeEventListener(Event.ENTER_FRAME, moveClip);
};
}
private function startPanel(e){
panel[1].btload.addEventListener(MouseEvent.CLICK, goLoad, false, 0, true);
panel[1].btclose.addEventListener(MouseEvent.CLICK, goGameStats, false, 0, true);
panel[1].btreset.addEventListener(MouseEvent.CLICK, showResetDialog, false, 0, true);
panel[1].mcresetdialog.btstart.addEventListener(MouseEvent.CLICK, goReset, false, 0, true);
panel[1].mcresetdialog.btclose.addEventListener(MouseEvent.CLICK, hideResetDialog, false, 0, true);
panel[1].btslot1.addEventListener(MouseEvent.CLICK, selectSlot1, false, 0, true);
panel[1].btslot2.addEventListener(MouseEvent.CLICK, selectSlot2, false, 0, true);
panel[1].btslot3.addEventListener(MouseEvent.CLICK, selectSlot3, false, 0, true);
panel[1].btslot4.addEventListener(MouseEvent.CLICK, selectSlot4, false, 0, true);
selectSlot4();
timer = (element.length * 3);
}
private function goGameStats(e){
nextpage = "return";
stopPanel();
soundmgr.playSFX("menuclick");
}
private function hideResetDialog(e){
panel[1].mcresetdialog.x = 525;
soundmgr.playSFX("menuclick");
}
private function goLoad(e){
nextpage = "game";
datamgr.loadData(selectedslot);
stopPanel();
soundmgr.playSFX("menuclick");
}
}
}//package
Section 64
//MainMenu (MainMenu)
package {
import flash.events.*;
import flash.display.*;
public class MainMenu extends MovieClip {
private var maintimeline;
private var admgr;
private var pagemgr;
private var datamgr;
private var buttons;
private var buttonmgr;
private var soundmgr;
private var tweenmgr;
private var coverpage;
public function MainMenu(_mtl){
super();
maintimeline = _mtl;
pagemgr = maintimeline.pagemgr;
admgr = maintimeline.admgr;
tweenmgr = maintimeline.tweenmgr;
soundmgr = maintimeline.soundmgr;
datamgr = maintimeline.datamgr;
coverpage = new mc_coverpage();
coverpage.y = -525;
this.addChild(coverpage);
coverpage.txdebug.alpha = 0;
tweenmgr.register(coverpage, {live:10, ease:"easeincubic", x:0, y:0, alpha:1, rotation:0, scalex:1, scaley:1});
buttons = [coverpage.btplay, coverpage.btload, coverpage.btcredits, coverpage.btachievements, coverpage.btstatistics, coverpage.btplaymore, coverpage.btdebug, coverpage.btsfxon, coverpage.btbgmon, coverpage.btsfxoff, coverpage.btbgmoff, coverpage.bttest1, coverpage.bttest2, coverpage.bttest3, coverpage.bttest4, coverpage.btartlogiclogo, coverpage.btsponsor];
activateButton();
soundmgr.playBGM("cover");
}
public function showStatistics(_btnidx){
pagemgr.loadPage("statistics", "cover");
soundmgr.playSFX("menuclick");
}
public function testBoss4(_btnidx){
maintimeline.datamgr.startLevelTest(2400);
coverpage.txdebug.alpha = 1;
tweenmgr.register(coverpage.txdebug, {live:90, ease:"easeoutcubic", x:coverpage.txdebug.x, y:coverpage.txdebug.y, alpha:0.5, rotation:0, scalex:1, scaley:1});
soundmgr.playSFX("menuclick");
}
private function activateButton(){
buttons[0].addEventListener(MouseEvent.CLICK, playGame, false, 0, true);
buttons[1].addEventListener(MouseEvent.CLICK, loadGame, false, 0, true);
buttons[2].addEventListener(MouseEvent.CLICK, showCredits, false, 0, true);
buttons[3].addEventListener(MouseEvent.CLICK, showAchievements, false, 0, true);
buttons[4].addEventListener(MouseEvent.CLICK, showStatistics, false, 0, true);
buttons[5].addEventListener(MouseEvent.CLICK, goSponsor, false, 0, true);
buttons[6].addEventListener(MouseEvent.CLICK, doDebugMode, false, 0, true);
buttons[7].addEventListener(MouseEvent.CLICK, soundOff, false, 0, true);
buttons[8].addEventListener(MouseEvent.CLICK, musicOff, false, 0, true);
buttons[9].addEventListener(MouseEvent.CLICK, soundOn, false, 0, true);
buttons[10].addEventListener(MouseEvent.CLICK, musicOn, false, 0, true);
buttons[11].addEventListener(MouseEvent.CLICK, testBoss1, false, 0, true);
buttons[12].addEventListener(MouseEvent.CLICK, testBoss2, false, 0, true);
buttons[13].addEventListener(MouseEvent.CLICK, testBoss3, false, 0, true);
buttons[14].addEventListener(MouseEvent.CLICK, testBoss4, false, 0, true);
buttons[15].addEventListener(MouseEvent.CLICK, goArtlogic, false, 0, true);
buttons[16].addEventListener(MouseEvent.CLICK, goSponsor, false, 0, true);
}
private function musicOn(e){
coverpage.btbgmon.y = coverpage.btbgmoff.y;
coverpage.btbgmoff.y = -525;
soundmgr.adjustBGM(1);
soundmgr.playSFX("menuclick");
}
public function testBoss2(_btnidx){
maintimeline.datamgr.startLevelTest(1500);
coverpage.txdebug.alpha = 1;
tweenmgr.register(coverpage.txdebug, {live:90, ease:"easeoutcubic", x:coverpage.txdebug.x, y:coverpage.txdebug.y, alpha:0.5, rotation:0, scalex:1, scaley:1});
soundmgr.playSFX("menuclick");
}
public function goArtlogic(_btnidx){
soundmgr.playSFX("menuclick");
admgr.goArtlogic();
}
public function goSponsor(_btnidx){
soundmgr.playSFX("menuclick");
admgr.goSponsor();
}
private function musicOff(e){
coverpage.btbgmoff.y = coverpage.btbgmon.y;
coverpage.btbgmon.y = -525;
soundmgr.adjustBGM(0);
soundmgr.playSFX("menuclick");
}
public function testBoss3(_btnidx){
maintimeline.datamgr.startLevelTest(2300);
coverpage.txdebug.alpha = 1;
tweenmgr.register(coverpage.txdebug, {live:90, ease:"easeoutcubic", x:coverpage.txdebug.x, y:coverpage.txdebug.y, alpha:0.5, rotation:0, scalex:1, scaley:1});
soundmgr.playSFX("menuclick");
}
private function soundOn(e){
coverpage.btsfxon.y = coverpage.btsfxoff.y;
coverpage.btsfxoff.y = -525;
soundmgr.adjustSFX(1);
soundmgr.playSFX("menuclick");
}
public function doDebugMode(_btnidx){
maintimeline.datamgr.doDebugMode();
coverpage.txdebug.alpha = 1;
tweenmgr.register(coverpage.txdebug, {live:90, ease:"easeoutcubic", x:coverpage.txdebug.x, y:coverpage.txdebug.y, alpha:0.5, rotation:0, scalex:1, scaley:1});
soundmgr.playSFX("menuclick");
}
public function showAchievements(_btnidx){
pagemgr.loadPage("awards", "cover");
soundmgr.playSFX("menuclick");
}
public function playGame(_btnidx){
if (datamgr.level == 1){
pagemgr.loadPage("intro1");
} else {
pagemgr.loadPage("game");
};
soundmgr.playSFX("menuclick");
}
public function showCredits(_btnidx){
pagemgr.loadPage("credits", "cover");
soundmgr.playSFX("menuclick");
}
private function deactivateButton(){
buttons[0].removeEventListener(MouseEvent.CLICK, playGame);
buttons[1].removeEventListener(MouseEvent.CLICK, loadGame);
buttons[2].removeEventListener(MouseEvent.CLICK, showCredits);
buttons[3].removeEventListener(MouseEvent.CLICK, showAchievements);
buttons[4].removeEventListener(MouseEvent.CLICK, showStatistics);
buttons[5].removeEventListener(MouseEvent.CLICK, goSponsor);
buttons[6].removeEventListener(MouseEvent.CLICK, doDebugMode);
buttons[7].removeEventListener(MouseEvent.CLICK, soundOff);
buttons[8].removeEventListener(MouseEvent.CLICK, musicOff);
buttons[9].removeEventListener(MouseEvent.CLICK, soundOn);
buttons[10].removeEventListener(MouseEvent.CLICK, musicOn);
buttons[11].removeEventListener(MouseEvent.CLICK, testBoss1);
buttons[12].removeEventListener(MouseEvent.CLICK, testBoss2);
buttons[13].removeEventListener(MouseEvent.CLICK, testBoss3);
buttons[14].removeEventListener(MouseEvent.CLICK, testBoss4);
buttons[15].removeEventListener(MouseEvent.CLICK, goArtlogic);
buttons[16].removeEventListener(MouseEvent.CLICK, goSponsor);
}
private function soundOff(e){
coverpage.btsfxoff.y = coverpage.btsfxon.y;
coverpage.btsfxon.y = -525;
soundmgr.adjustSFX(0);
soundmgr.playSFX("menuclick");
}
public function testBoss1(_btnidx){
maintimeline.datamgr.startLevelTest(700);
coverpage.txdebug.alpha = 1;
tweenmgr.register(coverpage.txdebug, {live:90, ease:"easeoutcubic", x:coverpage.txdebug.x, y:coverpage.txdebug.y, alpha:0.5, rotation:0, scalex:1, scaley:1});
soundmgr.playSFX("menuclick");
}
public function loadGame(_btnidx){
pagemgr.loadPage("load", "cover");
soundmgr.playSFX("menuclick");
}
}
}//package
Section 65
//mc_achievements_note (mc_achievements_note)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mc_achievements_note extends MovieClip {
public var txheader:TextField;
public var txnote:TextField;
public function mc_achievements_note(){
super();
}
}
}//package
Section 66
//mc_ak47 (mc_ak47)
package {
import flash.display.*;
public dynamic class mc_ak47 extends MovieClip {
public function mc_ak47(){
super();
}
}
}//package
Section 67
//mc_beretta (mc_beretta)
package {
import flash.display.*;
public dynamic class mc_beretta extends MovieClip {
public function mc_beretta(){
super();
}
}
}//package
Section 68
//mc_big_mouth (mc_big_mouth)
package {
import flash.display.*;
public dynamic class mc_big_mouth extends MovieClip {
public function mc_big_mouth(){
super();
}
}
}//package
Section 69
//mc_blood_blow (mc_blood_blow)
package {
import flash.display.*;
public dynamic class mc_blood_blow extends MovieClip {
public function mc_blood_blow(){
super();
}
}
}//package
Section 70
//mc_blood_blow2 (mc_blood_blow2)
package {
import flash.display.*;
public dynamic class mc_blood_blow2 extends MovieClip {
public function mc_blood_blow2(){
super();
}
}
}//package
Section 71
//mc_blood_splat1 (mc_blood_splat1)
package {
import flash.display.*;
public dynamic class mc_blood_splat1 extends MovieClip {
public function mc_blood_splat1(){
super();
}
}
}//package
Section 72
//mc_blood_splat2 (mc_blood_splat2)
package {
import flash.display.*;
public dynamic class mc_blood_splat2 extends MovieClip {
public function mc_blood_splat2(){
super();
}
}
}//package
Section 73
//mc_blood_splat3 (mc_blood_splat3)
package {
import flash.display.*;
public dynamic class mc_blood_splat3 extends MovieClip {
public function mc_blood_splat3(){
super();
}
}
}//package
Section 74
//mc_blood_splat4 (mc_blood_splat4)
package {
import flash.display.*;
public dynamic class mc_blood_splat4 extends MovieClip {
public function mc_blood_splat4(){
super();
}
}
}//package
Section 75
//mc_blood_splat5 (mc_blood_splat5)
package {
import flash.display.*;
public dynamic class mc_blood_splat5 extends MovieClip {
public function mc_blood_splat5(){
super();
}
}
}//package
Section 76
//mc_blood_splat6 (mc_blood_splat6)
package {
import flash.display.*;
public dynamic class mc_blood_splat6 extends MovieClip {
public function mc_blood_splat6(){
super();
}
}
}//package
Section 77
//mc_boss1_fire (mc_boss1_fire)
package {
import flash.display.*;
public dynamic class mc_boss1_fire extends MovieClip {
public var body:MovieClip;
public var head:MovieClip;
public function mc_boss1_fire(){
super();
}
}
}//package
Section 78
//mc_boss1_grind (mc_boss1_grind)
package {
import flash.display.*;
public dynamic class mc_boss1_grind extends MovieClip {
public var body:MovieClip;
public var head:MovieClip;
public function mc_boss1_grind(){
super();
}
}
}//package
Section 79
//mc_boss1_knife (mc_boss1_knife)
package {
import flash.display.*;
public dynamic class mc_boss1_knife extends MovieClip {
public var body:MovieClip;
public var head:MovieClip;
public function mc_boss1_knife(){
super();
}
}
}//package
Section 80
//mc_boss1_walk (mc_boss1_walk)
package {
import flash.display.*;
public dynamic class mc_boss1_walk extends MovieClip {
public var body:MovieClip;
public var head:MovieClip;
public function mc_boss1_walk(){
super();
}
}
}//package
Section 81
//mc_boss2_fly (mc_boss2_fly)
package {
import flash.display.*;
public dynamic class mc_boss2_fly extends MovieClip {
public var hitarea:MovieClip;
public function mc_boss2_fly(){
super();
}
}
}//package
Section 82
//mc_boss2_gattling (mc_boss2_gattling)
package {
import flash.display.*;
public dynamic class mc_boss2_gattling extends MovieClip {
public var hitarea:MovieClip;
public function mc_boss2_gattling(){
super();
}
}
}//package
Section 83
//mc_boss2_laser (mc_boss2_laser)
package {
import flash.display.*;
public dynamic class mc_boss2_laser extends MovieClip {
public var hitarea:MovieClip;
public function mc_boss2_laser(){
super();
}
}
}//package
Section 84
//mc_boss2_rocket (mc_boss2_rocket)
package {
import flash.display.*;
public dynamic class mc_boss2_rocket extends MovieClip {
public var hitarea:MovieClip;
public function mc_boss2_rocket(){
super();
}
}
}//package
Section 85
//mc_boss3_attack (mc_boss3_attack)
package {
import flash.display.*;
public dynamic class mc_boss3_attack extends MovieClip {
public function mc_boss3_attack(){
super();
}
}
}//package
Section 86
//mc_boss3_drip (mc_boss3_drip)
package {
import flash.display.*;
public dynamic class mc_boss3_drip extends MovieClip {
public function mc_boss3_drip(){
super();
}
}
}//package
Section 87
//mc_boss3_walk (mc_boss3_walk)
package {
import flash.display.*;
public dynamic class mc_boss3_walk extends MovieClip {
public function mc_boss3_walk(){
super();
}
}
}//package
Section 88
//mc_bullethole (mc_bullethole)
package {
import flash.display.*;
public dynamic class mc_bullethole extends MovieClip {
public function mc_bullethole(){
super();
}
}
}//package
Section 89
//mc_bulletpart (mc_bulletpart)
package {
import flash.display.*;
public dynamic class mc_bulletpart extends MovieClip {
public function mc_bulletpart(){
super();
}
}
}//package
Section 90
//mc_can_splat1 (mc_can_splat1)
package {
import flash.display.*;
public dynamic class mc_can_splat1 extends MovieClip {
public function mc_can_splat1(){
super();
}
}
}//package
Section 91
//mc_can_splat2 (mc_can_splat2)
package {
import flash.display.*;
public dynamic class mc_can_splat2 extends MovieClip {
public function mc_can_splat2(){
super();
}
}
}//package
Section 92
//mc_can_splat3 (mc_can_splat3)
package {
import flash.display.*;
public dynamic class mc_can_splat3 extends MovieClip {
public function mc_can_splat3(){
super();
}
}
}//package
Section 93
//mc_can_splat4 (mc_can_splat4)
package {
import flash.display.*;
public dynamic class mc_can_splat4 extends MovieClip {
public function mc_can_splat4(){
super();
}
}
}//package
Section 94
//mc_coverpage (mc_coverpage)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mc_coverpage extends MovieClip {
public var btstatistics:MovieClip;
public var btcredits:MovieClip;
public var btsfxon:SimpleButton;
public var btload:MovieClip;
public var btdebug:SimpleButton;
public var btartlogiclogo:SimpleButton;
public var txdebug:TextField;
public var btachievements:MovieClip;
public var btplay:MovieClip;
public var btsponsor:SimpleButton;
public var btbgmoff:SimpleButton;
public var btbgmon:SimpleButton;
public var btsfxoff:SimpleButton;
public var bttest1:SimpleButton;
public var bttest2:SimpleButton;
public var bttest3:SimpleButton;
public var bttest4:SimpleButton;
public var btplaymore:SimpleButton;
public function mc_coverpage(){
super();
}
}
}//package
Section 95
//mc_danwesson (mc_danwesson)
package {
import flash.display.*;
public dynamic class mc_danwesson extends MovieClip {
public function mc_danwesson(){
super();
}
}
}//package
Section 96
//mc_deagle (mc_deagle)
package {
import flash.display.*;
public dynamic class mc_deagle extends MovieClip {
public function mc_deagle(){
super();
}
}
}//package
Section 97
//mc_default_adbox (mc_default_adbox)
package {
import flash.display.*;
public dynamic class mc_default_adbox extends MovieClip {
public function mc_default_adbox(){
super();
}
}
}//package
Section 98
//mc_dialog_boss_01 (mc_dialog_boss_01)
package {
import flash.display.*;
public dynamic class mc_dialog_boss_01 extends MovieClip {
public function mc_dialog_boss_01(){
super();
}
}
}//package
Section 99
//mc_dialog_boss_02 (mc_dialog_boss_02)
package {
import flash.display.*;
public dynamic class mc_dialog_boss_02 extends MovieClip {
public function mc_dialog_boss_02(){
super();
}
}
}//package
Section 100
//mc_dialog_boss_03 (mc_dialog_boss_03)
package {
import flash.display.*;
public dynamic class mc_dialog_boss_03 extends MovieClip {
public function mc_dialog_boss_03(){
super();
}
}
}//package
Section 101
//mc_dialog_boss_bg (mc_dialog_boss_bg)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mc_dialog_boss_bg extends MovieClip {
public var txdialog:TextField;
public function mc_dialog_boss_bg(){
super();
}
}
}//package
Section 102
//mc_dialog_boss_phant (mc_dialog_boss_phant)
package {
import flash.display.*;
public dynamic class mc_dialog_boss_phant extends MovieClip {
public function mc_dialog_boss_phant(){
super();
}
}
}//package
Section 103
//mc_dirt_splat1 (mc_dirt_splat1)
package {
import flash.display.*;
public dynamic class mc_dirt_splat1 extends MovieClip {
public function mc_dirt_splat1(){
super();
}
}
}//package
Section 104
//mc_dirt_splat2 (mc_dirt_splat2)
package {
import flash.display.*;
public dynamic class mc_dirt_splat2 extends MovieClip {
public function mc_dirt_splat2(){
super();
}
}
}//package
Section 105
//mc_dirt_splat3 (mc_dirt_splat3)
package {
import flash.display.*;
public dynamic class mc_dirt_splat3 extends MovieClip {
public function mc_dirt_splat3(){
super();
}
}
}//package
Section 106
//mc_dirt_splat4 (mc_dirt_splat4)
package {
import flash.display.*;
public dynamic class mc_dirt_splat4 extends MovieClip {
public function mc_dirt_splat4(){
super();
}
}
}//package
Section 107
//mc_drill_tip (mc_drill_tip)
package {
import flash.display.*;
public dynamic class mc_drill_tip extends MovieClip {
public function mc_drill_tip(){
super();
}
}
}//package
Section 108
//mc_drilling_down (mc_drilling_down)
package {
import flash.display.*;
public dynamic class mc_drilling_down extends MovieClip {
public function mc_drilling_down(){
super();
}
}
}//package
Section 109
//mc_drilling_up (mc_drilling_up)
package {
import flash.display.*;
public dynamic class mc_drilling_up extends MovieClip {
public function mc_drilling_up(){
super();
}
}
}//package
Section 110
//mc_ending (mc_ending)
package {
import flash.display.*;
public dynamic class mc_ending extends MovieClip {
public var btnext:SimpleButton;
public function mc_ending(){
super();
}
}
}//package
Section 111
//mc_explosion (mc_explosion)
package {
import flash.display.*;
public dynamic class mc_explosion extends MovieClip {
public function mc_explosion(){
super();
}
}
}//package
Section 112
//mc_explosion_big (mc_explosion_big)
package {
import flash.display.*;
public dynamic class mc_explosion_big extends MovieClip {
public function mc_explosion_big(){
super();
}
}
}//package
Section 113
//mc_explosion1 (mc_explosion1)
package {
import flash.display.*;
public dynamic class mc_explosion1 extends MovieClip {
public function mc_explosion1(){
super();
}
}
}//package
Section 114
//mc_explosionhole (mc_explosionhole)
package {
import flash.display.*;
public dynamic class mc_explosionhole extends MovieClip {
public function mc_explosionhole(){
super();
}
}
}//package
Section 115
//mc_fence_01 (mc_fence_01)
package {
import flash.display.*;
public dynamic class mc_fence_01 extends MovieClip {
public function mc_fence_01(){
super();
}
}
}//package
Section 116
//mc_fence_02 (mc_fence_02)
package {
import flash.display.*;
public dynamic class mc_fence_02 extends MovieClip {
public function mc_fence_02(){
super();
}
}
}//package
Section 117
//mc_fence_03 (mc_fence_03)
package {
import flash.display.*;
public dynamic class mc_fence_03 extends MovieClip {
public function mc_fence_03(){
super();
}
}
}//package
Section 118
//mc_fence_splat1 (mc_fence_splat1)
package {
import flash.display.*;
public dynamic class mc_fence_splat1 extends MovieClip {
public function mc_fence_splat1(){
super();
}
}
}//package
Section 119
//mc_fence_splat2 (mc_fence_splat2)
package {
import flash.display.*;
public dynamic class mc_fence_splat2 extends MovieClip {
public function mc_fence_splat2(){
super();
}
}
}//package
Section 120
//mc_fur1 (mc_fur1)
package {
import flash.display.*;
public dynamic class mc_fur1 extends MovieClip {
public function mc_fur1(){
super();
}
}
}//package
Section 121
//mc_fur2 (mc_fur2)
package {
import flash.display.*;
public dynamic class mc_fur2 extends MovieClip {
public function mc_fur2(){
super();
}
}
}//package
Section 122
//mc_game_ads (mc_game_ads)
package {
import flash.display.*;
public dynamic class mc_game_ads extends MovieClip {
public var adbox:MovieClip;
public function mc_game_ads(){
super();
}
}
}//package
Section 123
//mc_game_awards (mc_game_awards)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mc_game_awards extends MovieClip {
public var btaward1:SimpleButton;
public var btaward3:SimpleButton;
public var btaward4:SimpleButton;
public var btaward5:SimpleButton;
public var btaward7:SimpleButton;
public var btachieved5:bt_achieved1;
public var btaward6:SimpleButton;
public var btachieved6:bt_achieved1;
public var btachieved7:bt_achieved1;
public var btachieved9:bt_achieved1;
public var btachieved3:bt_achieved1;
public var btaward2:SimpleButton;
public var btachieved8:bt_achieved1;
public var btachieved2:bt_achieved1;
public var btaward9:SimpleButton;
public var btachieved4:bt_achieved1;
public var btachieved1:bt_achieved1;
public var btaward8:SimpleButton;
public var mcnoteleft:MovieClip;
public var mcnoteright:MovieClip;
public var btaward11:SimpleButton;
public var btaward12:SimpleButton;
public var btaward13:SimpleButton;
public var btaward14:SimpleButton;
public var btaward15:SimpleButton;
public var btaward16:SimpleButton;
public var btaward17:SimpleButton;
public var btaward19:SimpleButton;
public var btaward18:SimpleButton;
public var btaward10:SimpleButton;
public var btaward20:SimpleButton;
public var btaward22:SimpleButton;
public var btaward24:SimpleButton;
public var btaward28:SimpleButton;
public var btaward29:SimpleButton;
public var btaward23:SimpleButton;
public var btaward25:SimpleButton;
public var btaward27:SimpleButton;
public var btaward21:SimpleButton;
public var btaward26:SimpleButton;
public var btclose:SimpleButton;
public var btaward30:SimpleButton;
public var btaward31:SimpleButton;
public var btaward32:SimpleButton;
public var btaward33:SimpleButton;
public var btaward35:SimpleButton;
public var btaward36:SimpleButton;
public var btaward37:SimpleButton;
public var btaward39:SimpleButton;
public var btaward34:SimpleButton;
public var btaward38:SimpleButton;
public var btaward40:SimpleButton;
public var btachieved10:bt_achieved1;
public var btachieved11:bt_achieved1;
public var btachieved16:bt_achieved1;
public var btachieved17:bt_achieved1;
public var btachieved12:bt_achieved1;
public var btachieved13:bt_achieved1;
public var btachieved14:bt_achieved1;
public var btachieved15:bt_achieved1;
public var txlabel1:TextField;
public var btachieved18:bt_achieved1;
public var btachieved19:bt_achieved1;
public var btachieved20:bt_achieved1;
public var btachieved21:bt_achieved1;
public var btachieved22:bt_achieved1;
public var btachieved24:bt_achieved1;
public var btachieved26:bt_achieved1;
public var btachieved27:bt_achieved1;
public var btachieved28:bt_achieved1;
public var btachieved25:bt_achieved1;
public var btachieved23:bt_achieved1;
public var btachieved34:bt_achieved1;
public var btachieved35:bt_achieved1;
public var btachieved36:bt_achieved1;
public var btachieved30:bt_achieved1;
public var btachieved31:bt_achieved1;
public var btachieved33:bt_achieved1;
public var btachieved37:bt_achieved1;
public var btachieved38:bt_achieved1;
public var btachieved39:bt_achieved1;
public var btachieved32:bt_achieved1;
public var btachieved29:bt_achieved1;
public var btachieved40:bt_achieved1;
public function mc_game_awards(){
super();
}
}
}//package
Section 124
//mc_game_credits (mc_game_credits)
package {
import flash.display.*;
public dynamic class mc_game_credits extends MovieClip {
public var btclose:SimpleButton;
public function mc_game_credits(){
super();
}
}
}//package
Section 125
//mc_game_load (mc_game_load)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mc_game_load extends MovieClip {
public var mcresetdialog:MovieClip;
public var btslot3:SimpleButton;
public var btslot4:SimpleButton;
public var txmoney1:TextField;
public var txlabel11:TextField;
public var txlabel13:TextField;
public var txlabel12:TextField;
public var txlabel22:TextField;
public var txlabel23:TextField;
public var txlabel21:TextField;
public var btreset:SimpleButton;
public var txlabel33:TextField;
public var txtitle:TextField;
public var txlabel31:TextField;
public var txscore1:TextField;
public var txmoney3:TextField;
public var txscore2:TextField;
public var txlabel32:TextField;
public var txscore4:TextField;
public var txlabel43:TextField;
public var txlabel41:TextField;
public var txscore3:TextField;
public var txlabel42:TextField;
public var mcselectedslot:MovieClip;
public var txsubtitle:TextField;
public var btload:SimpleButton;
public var btslot1:SimpleButton;
public var btclose:SimpleButton;
public var btslot2:SimpleButton;
public var txmoney2:TextField;
public var txmoney4:TextField;
public function mc_game_load(){
super();
}
}
}//package
Section 126
//mc_game_lost (mc_game_lost)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mc_game_lost extends MovieClip {
public var tx1:TextField;
public var tx2:TextField;
public var btloadgame:SimpleButton;
public var btupgrade:SimpleButton;
public var btreplay:SimpleButton;
public var btclose:SimpleButton;
public function mc_game_lost(){
super();
}
}
}//package
Section 127
//mc_game_save (mc_game_save)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mc_game_save extends MovieClip {
public var btslot3:SimpleButton;
public var btslot4:SimpleButton;
public var txmoney1:TextField;
public var txlabel11:TextField;
public var txlabel13:TextField;
public var txlabel12:TextField;
public var txlabel22:TextField;
public var txlabel23:TextField;
public var txlabel21:TextField;
public var txlabel33:TextField;
public var txtitle:TextField;
public var txlabel31:TextField;
public var txscore1:TextField;
public var txmoney3:TextField;
public var txscore2:TextField;
public var txlabel32:TextField;
public var txscore4:TextField;
public var txlabel43:TextField;
public var txlabel41:TextField;
public var txscore3:TextField;
public var txlabel42:TextField;
public var mcselectedslot:MovieClip;
public var txsubtitle:TextField;
public var btsave:SimpleButton;
public var btslot1:SimpleButton;
public var btclose:SimpleButton;
public var btslot2:SimpleButton;
public var txmoney2:TextField;
public var txmoney4:TextField;
public function mc_game_save(){
super();
}
}
}//package
Section 128
//mc_game_stats (mc_game_stats)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mc_game_stats extends MovieClip {
public var txkillmoney:TextField;
public var txfence:TextField;
public var txsubtotalmoney:TextField;
public var txlabel3:TextField;
public var txlabel4:TextField;
public var txlabel5:TextField;
public var txlabel1:TextField;
public var txtitle:TextField;
public var txaccuracymoney:TextField;
public var txtotalscore:TextField;
public var txlabel2:TextField;
public var txlabel6:TextField;
public var txaccuracy:TextField;
public var txtotalmoney:TextField;
public var btupgrade:SimpleButton;
public var txfencemoney:TextField;
public var btsave:SimpleButton;
public var txkill:TextField;
public var btresume:SimpleButton;
public function mc_game_stats(){
super();
}
}
}//package
Section 129
//mc_gamepanel (mc_gamepanel)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mc_gamepanel extends MovieClip {
public var btweapon2:SimpleButton;
public var btweapon3:SimpleButton;
public var btweapon4:SimpleButton;
public var bosshealth:MovieClip;
public var btweapon5:SimpleButton;
public var btsfxon:SimpleButton;
public var btweapon6:SimpleButton;
public var weaponheat:MovieClip;
public var mctrapcontainer:MovieClip;
public var btweapon1:SimpleButton;
public var mcloader1:MovieClip;
public var txlevel:TextField;
public var btbgmoff:SimpleButton;
public var txbullet:TextField;
public var txweapon:TextField;
public var btbgmon:SimpleButton;
public var weaponreload:MovieClip;
public var btsfxoff:SimpleButton;
public var txfencehealth:TextField;
public var fencehealth:MovieClip;
public function mc_gamepanel(){
super();
}
}
}//package
Section 130
//mc_goo_blow (mc_goo_blow)
package {
import flash.display.*;
public dynamic class mc_goo_blow extends MovieClip {
public function mc_goo_blow(){
super();
}
}
}//package
Section 131
//mc_goo_splat1 (mc_goo_splat1)
package {
import flash.display.*;
public dynamic class mc_goo_splat1 extends MovieClip {
public function mc_goo_splat1(){
super();
}
}
}//package
Section 132
//mc_goo_splat2 (mc_goo_splat2)
package {
import flash.display.*;
public dynamic class mc_goo_splat2 extends MovieClip {
public function mc_goo_splat2(){
super();
}
}
}//package
Section 133
//mc_goo_splat3 (mc_goo_splat3)
package {
import flash.display.*;
public dynamic class mc_goo_splat3 extends MovieClip {
public function mc_goo_splat3(){
super();
}
}
}//package
Section 134
//mc_intro1 (mc_intro1)
package {
import flash.display.*;
public dynamic class mc_intro1 extends MovieClip {
public var btnext:SimpleButton;
public function mc_intro1(){
super();
}
}
}//package
Section 135
//mc_intro2 (mc_intro2)
package {
import flash.display.*;
public dynamic class mc_intro2 extends MovieClip {
public var btnext:SimpleButton;
public function mc_intro2(){
super();
}
}
}//package
Section 136
//mc_level_intro (mc_level_intro)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mc_level_intro extends MovieClip {
public var txhint:TextField;
public var btstart:SimpleButton;
public var btexit:SimpleButton;
public var btupgrade:SimpleButton;
public var txday:TextField;
public function mc_level_intro(){
super();
}
}
}//package
Section 137
//mc_m60 (mc_m60)
package {
import flash.display.*;
public dynamic class mc_m60 extends MovieClip {
public function mc_m60(){
super();
}
}
}//package
Section 138
//mc_m79 (mc_m79)
package {
import flash.display.*;
public dynamic class mc_m79 extends MovieClip {
public function mc_m79(){
super();
}
}
}//package
Section 139
//mc_mg34 (mc_mg34)
package {
import flash.display.*;
public dynamic class mc_mg34 extends MovieClip {
public function mc_mg34(){
super();
}
}
}//package
Section 140
//mc_minigun (mc_minigun)
package {
import flash.display.*;
public dynamic class mc_minigun extends MovieClip {
public function mc_minigun(){
super();
}
}
}//package
Section 141
//mc_mk2 (mc_mk2)
package {
import flash.display.*;
public dynamic class mc_mk2 extends MovieClip {
public function mc_mk2(){
super();
}
}
}//package
Section 142
//mc_mm1 (mc_mm1)
package {
import flash.display.*;
public dynamic class mc_mm1 extends MovieClip {
public function mc_mm1(){
super();
}
}
}//package
Section 143
//mc_mossberg (mc_mossberg)
package {
import flash.display.*;
public dynamic class mc_mossberg extends MovieClip {
public function mc_mossberg(){
super();
}
}
}//package
Section 144
//mc_mouse_dead1 (mc_mouse_dead1)
package {
import flash.display.*;
public dynamic class mc_mouse_dead1 extends MovieClip {
public function mc_mouse_dead1(){
super();
}
}
}//package
Section 145
//mc_mouse_dead2 (mc_mouse_dead2)
package {
import flash.display.*;
public dynamic class mc_mouse_dead2 extends MovieClip {
public function mc_mouse_dead2(){
super();
}
}
}//package
Section 146
//mc_mouse_dead3 (mc_mouse_dead3)
package {
import flash.display.*;
public dynamic class mc_mouse_dead3 extends MovieClip {
public function mc_mouse_dead3(){
super();
}
}
}//package
Section 147
//mc_mouse_goo1 (mc_mouse_goo1)
package {
import flash.display.*;
public dynamic class mc_mouse_goo1 extends MovieClip {
public function mc_mouse_goo1(){
super();
}
}
}//package
Section 148
//mc_mouse_goo2 (mc_mouse_goo2)
package {
import flash.display.*;
public dynamic class mc_mouse_goo2 extends MovieClip {
public function mc_mouse_goo2(){
super();
}
}
}//package
Section 149
//mc_mouse_goo3 (mc_mouse_goo3)
package {
import flash.display.*;
public dynamic class mc_mouse_goo3 extends MovieClip {
public function mc_mouse_goo3(){
super();
}
}
}//package
Section 150
//mc_mouse_goo4 (mc_mouse_goo4)
package {
import flash.display.*;
public dynamic class mc_mouse_goo4 extends MovieClip {
public function mc_mouse_goo4(){
super();
}
}
}//package
Section 151
//mc_mouse_purple1 (mc_mouse_purple1)
package {
import flash.display.*;
public dynamic class mc_mouse_purple1 extends MovieClip {
public function mc_mouse_purple1(){
super();
}
}
}//package
Section 152
//mc_mouse_purple2 (mc_mouse_purple2)
package {
import flash.display.*;
public dynamic class mc_mouse_purple2 extends MovieClip {
public function mc_mouse_purple2(){
super();
}
}
}//package
Section 153
//mc_mouse_purple3 (mc_mouse_purple3)
package {
import flash.display.*;
public dynamic class mc_mouse_purple3 extends MovieClip {
public function mc_mouse_purple3(){
super();
}
}
}//package
Section 154
//mc_mouse01_100 (mc_mouse01_100)
package {
import flash.display.*;
public dynamic class mc_mouse01_100 extends MovieClip {
public function mc_mouse01_100(){
super();
}
}
}//package
Section 155
//mc_mouse01_25 (mc_mouse01_25)
package {
import flash.display.*;
public dynamic class mc_mouse01_25 extends MovieClip {
public function mc_mouse01_25(){
super();
}
}
}//package
Section 156
//mc_mouse01_50 (mc_mouse01_50)
package {
import flash.display.*;
public dynamic class mc_mouse01_50 extends MovieClip {
public function mc_mouse01_50(){
super();
}
}
}//package
Section 157
//mc_mouse01_75 (mc_mouse01_75)
package {
import flash.display.*;
public dynamic class mc_mouse01_75 extends MovieClip {
public function mc_mouse01_75(){
super();
}
}
}//package
Section 158
//mc_mouse02_100 (mc_mouse02_100)
package {
import flash.display.*;
public dynamic class mc_mouse02_100 extends MovieClip {
public function mc_mouse02_100(){
super();
}
}
}//package
Section 159
//mc_mouse02_25 (mc_mouse02_25)
package {
import flash.display.*;
public dynamic class mc_mouse02_25 extends MovieClip {
public function mc_mouse02_25(){
super();
}
}
}//package
Section 160
//mc_mouse02_50 (mc_mouse02_50)
package {
import flash.display.*;
public dynamic class mc_mouse02_50 extends MovieClip {
public function mc_mouse02_50(){
super();
}
}
}//package
Section 161
//mc_mouse02_75 (mc_mouse02_75)
package {
import flash.display.*;
public dynamic class mc_mouse02_75 extends MovieClip {
public function mc_mouse02_75(){
super();
}
}
}//package
Section 162
//mc_mouse02_attack (mc_mouse02_attack)
package {
import flash.display.*;
public dynamic class mc_mouse02_attack extends MovieClip {
public var light:MovieClip;
public function mc_mouse02_attack(){
super();
}
}
}//package
Section 163
//mc_mouse03_100 (mc_mouse03_100)
package {
import flash.display.*;
public dynamic class mc_mouse03_100 extends MovieClip {
public var tip:mc_drill_tip;
public function mc_mouse03_100(){
super();
}
}
}//package
Section 164
//mc_mouse03_25 (mc_mouse03_25)
package {
import flash.display.*;
public dynamic class mc_mouse03_25 extends MovieClip {
public var tip:mc_drill_tip;
public function mc_mouse03_25(){
super();
}
}
}//package
Section 165
//mc_mouse03_50 (mc_mouse03_50)
package {
import flash.display.*;
public dynamic class mc_mouse03_50 extends MovieClip {
public var tip:mc_drill_tip;
public function mc_mouse03_50(){
super();
}
}
}//package
Section 166
//mc_mouse03_75 (mc_mouse03_75)
package {
import flash.display.*;
public dynamic class mc_mouse03_75 extends MovieClip {
public var tip:mc_drill_tip;
public function mc_mouse03_75(){
super();
}
}
}//package
Section 167
//mc_mouse04_100 (mc_mouse04_100)
package {
import flash.display.*;
public dynamic class mc_mouse04_100 extends MovieClip {
public function mc_mouse04_100(){
super();
}
}
}//package
Section 168
//mc_mouse04_25 (mc_mouse04_25)
package {
import flash.display.*;
public dynamic class mc_mouse04_25 extends MovieClip {
public function mc_mouse04_25(){
super();
}
}
}//package
Section 169
//mc_mouse04_50 (mc_mouse04_50)
package {
import flash.display.*;
public dynamic class mc_mouse04_50 extends MovieClip {
public function mc_mouse04_50(){
super();
}
}
}//package
Section 170
//mc_mouse04_75 (mc_mouse04_75)
package {
import flash.display.*;
public dynamic class mc_mouse04_75 extends MovieClip {
public function mc_mouse04_75(){
super();
}
}
}//package
Section 171
//mc_mouse05_100 (mc_mouse05_100)
package {
import flash.display.*;
public dynamic class mc_mouse05_100 extends MovieClip {
public function mc_mouse05_100(){
super();
}
}
}//package
Section 172
//mc_mouse05_25 (mc_mouse05_25)
package {
import flash.display.*;
public dynamic class mc_mouse05_25 extends MovieClip {
public function mc_mouse05_25(){
super();
}
}
}//package
Section 173
//mc_mouse05_50 (mc_mouse05_50)
package {
import flash.display.*;
public dynamic class mc_mouse05_50 extends MovieClip {
public function mc_mouse05_50(){
super();
}
}
}//package
Section 174
//mc_mouse05_75 (mc_mouse05_75)
package {
import flash.display.*;
public dynamic class mc_mouse05_75 extends MovieClip {
public function mc_mouse05_75(){
super();
}
}
}//package
Section 175
//mc_mouse06_100 (mc_mouse06_100)
package {
import flash.display.*;
public dynamic class mc_mouse06_100 extends MovieClip {
public function mc_mouse06_100(){
super();
}
}
}//package
Section 176
//mc_mouse06_25 (mc_mouse06_25)
package {
import flash.display.*;
public dynamic class mc_mouse06_25 extends MovieClip {
public function mc_mouse06_25(){
super();
}
}
}//package
Section 177
//mc_mouse06_50 (mc_mouse06_50)
package {
import flash.display.*;
public dynamic class mc_mouse06_50 extends MovieClip {
public function mc_mouse06_50(){
super();
}
}
}//package
Section 178
//mc_mouse06_75 (mc_mouse06_75)
package {
import flash.display.*;
public dynamic class mc_mouse06_75 extends MovieClip {
public function mc_mouse06_75(){
super();
}
}
}//package
Section 179
//mc_mouse06_a_100 (mc_mouse06_a_100)
package {
import flash.display.*;
public dynamic class mc_mouse06_a_100 extends MovieClip {
public function mc_mouse06_a_100(){
super();
}
}
}//package
Section 180
//mc_mouse06_a_25 (mc_mouse06_a_25)
package {
import flash.display.*;
public dynamic class mc_mouse06_a_25 extends MovieClip {
public function mc_mouse06_a_25(){
super();
}
}
}//package
Section 181
//mc_mouse06_a_50 (mc_mouse06_a_50)
package {
import flash.display.*;
public dynamic class mc_mouse06_a_50 extends MovieClip {
public function mc_mouse06_a_50(){
super();
}
}
}//package
Section 182
//mc_mouse06_a_explode (mc_mouse06_a_explode)
package {
import flash.display.*;
public dynamic class mc_mouse06_a_explode extends MovieClip {
public function mc_mouse06_a_explode(){
super();
}
}
}//package
Section 183
//mc_mouse06_b_100 (mc_mouse06_b_100)
package {
import flash.display.*;
public dynamic class mc_mouse06_b_100 extends MovieClip {
public function mc_mouse06_b_100(){
super();
}
}
}//package
Section 184
//mc_mouse06_b_25 (mc_mouse06_b_25)
package {
import flash.display.*;
public dynamic class mc_mouse06_b_25 extends MovieClip {
public function mc_mouse06_b_25(){
super();
}
}
}//package
Section 185
//mc_mouse06_b_50 (mc_mouse06_b_50)
package {
import flash.display.*;
public dynamic class mc_mouse06_b_50 extends MovieClip {
public function mc_mouse06_b_50(){
super();
}
}
}//package
Section 186
//mc_mouse06_b_explode (mc_mouse06_b_explode)
package {
import flash.display.*;
public dynamic class mc_mouse06_b_explode extends MovieClip {
public function mc_mouse06_b_explode(){
super();
}
}
}//package
Section 187
//mc_mp5 (mc_mp5)
package {
import flash.display.*;
public dynamic class mc_mp5 extends MovieClip {
public function mc_mp5(){
super();
}
}
}//package
Section 188
//mc_mp9 (mc_mp9)
package {
import flash.display.*;
public dynamic class mc_mp9 extends MovieClip {
public function mc_mp9(){
super();
}
}
}//package
Section 189
//mc_paused (mc_paused)
package {
import flash.display.*;
public dynamic class mc_paused extends MovieClip {
public var btsfx:SimpleButton;
public var mcmusiclamp04:MovieClip;
public var btbgm:SimpleButton;
public var btcancel:SimpleButton;
public var mcsoundlamp03:MovieClip;
public var mcsoundlamp01:MovieClip;
public var mcsoundlamp02:MovieClip;
public var mcsoundlamp04:MovieClip;
public var btok:SimpleButton;
public var mcmusiclamp01:MovieClip;
public var mcmusiclamp02:MovieClip;
public var mcmusiclamp03:MovieClip;
public function mc_paused(){
super();
}
}
}//package
Section 190
//mc_purple_blow (mc_purple_blow)
package {
import flash.display.*;
public dynamic class mc_purple_blow extends MovieClip {
public function mc_purple_blow(){
super();
}
}
}//package
Section 191
//mc_purple_splat1 (mc_purple_splat1)
package {
import flash.display.*;
public dynamic class mc_purple_splat1 extends MovieClip {
public function mc_purple_splat1(){
super();
}
}
}//package
Section 192
//mc_purple_splat2 (mc_purple_splat2)
package {
import flash.display.*;
public dynamic class mc_purple_splat2 extends MovieClip {
public function mc_purple_splat2(){
super();
}
}
}//package
Section 193
//mc_purple_splat3 (mc_purple_splat3)
package {
import flash.display.*;
public dynamic class mc_purple_splat3 extends MovieClip {
public function mc_purple_splat3(){
super();
}
}
}//package
Section 194
//mc_purple_splat4 (mc_purple_splat4)
package {
import flash.display.*;
public dynamic class mc_purple_splat4 extends MovieClip {
public function mc_purple_splat4(){
super();
}
}
}//package
Section 195
//mc_reload_ak47 (mc_reload_ak47)
package {
import flash.display.*;
public dynamic class mc_reload_ak47 extends MovieClip {
public function mc_reload_ak47(){
super();
}
}
}//package
Section 196
//mc_reload_brenmk2 (mc_reload_brenmk2)
package {
import flash.display.*;
public dynamic class mc_reload_brenmk2 extends MovieClip {
public function mc_reload_brenmk2(){
super();
}
}
}//package
Section 197
//mc_reload_danwesson (mc_reload_danwesson)
package {
import flash.display.*;
public dynamic class mc_reload_danwesson extends MovieClip {
public function mc_reload_danwesson(){
super();
}
}
}//package
Section 198
//mc_reload_deagle (mc_reload_deagle)
package {
import flash.display.*;
public dynamic class mc_reload_deagle extends MovieClip {
public function mc_reload_deagle(){
super();
}
}
}//package
Section 199
//mc_reload_m60 (mc_reload_m60)
package {
import flash.display.*;
public dynamic class mc_reload_m60 extends MovieClip {
public function mc_reload_m60(){
super();
}
}
}//package
Section 200
//mc_reload_m79 (mc_reload_m79)
package {
import flash.display.*;
public dynamic class mc_reload_m79 extends MovieClip {
public function mc_reload_m79(){
super();
}
}
}//package
Section 201
//mc_reload_m9 (mc_reload_m9)
package {
import flash.display.*;
public dynamic class mc_reload_m9 extends MovieClip {
public function mc_reload_m9(){
super();
}
}
}//package
Section 202
//mc_reload_mg34 (mc_reload_mg34)
package {
import flash.display.*;
public dynamic class mc_reload_mg34 extends MovieClip {
public function mc_reload_mg34(){
super();
}
}
}//package
Section 203
//mc_reload_minigun (mc_reload_minigun)
package {
import flash.display.*;
public dynamic class mc_reload_minigun extends MovieClip {
public function mc_reload_minigun(){
super();
}
}
}//package
Section 204
//mc_reload_mm1 (mc_reload_mm1)
package {
import flash.display.*;
public dynamic class mc_reload_mm1 extends MovieClip {
public function mc_reload_mm1(){
super();
}
}
}//package
Section 205
//mc_reload_mossberg500 (mc_reload_mossberg500)
package {
import flash.display.*;
public dynamic class mc_reload_mossberg500 extends MovieClip {
public function mc_reload_mossberg500(){
super();
}
}
}//package
Section 206
//mc_reload_mp5 (mc_reload_mp5)
package {
import flash.display.*;
public dynamic class mc_reload_mp5 extends MovieClip {
public function mc_reload_mp5(){
super();
}
}
}//package
Section 207
//mc_reload_mp9 (mc_reload_mp9)
package {
import flash.display.*;
public dynamic class mc_reload_mp9 extends MovieClip {
public function mc_reload_mp9(){
super();
}
}
}//package
Section 208
//mc_reload_spas12 (mc_reload_spas12)
package {
import flash.display.*;
public dynamic class mc_reload_spas12 extends MovieClip {
public function mc_reload_spas12(){
super();
}
}
}//package
Section 209
//mc_reload_steyrAUG (mc_reload_steyrAUG)
package {
import flash.display.*;
public dynamic class mc_reload_steyrAUG extends MovieClip {
public function mc_reload_steyrAUG(){
super();
}
}
}//package
Section 210
//mc_reload_steyrTMP (mc_reload_steyrTMP)
package {
import flash.display.*;
public dynamic class mc_reload_steyrTMP extends MovieClip {
public function mc_reload_steyrTMP(){
super();
}
}
}//package
Section 211
//mc_reload_trench (mc_reload_trench)
package {
import flash.display.*;
public dynamic class mc_reload_trench extends MovieClip {
public function mc_reload_trench(){
super();
}
}
}//package
Section 212
//mc_reload_xm25 (mc_reload_xm25)
package {
import flash.display.*;
public dynamic class mc_reload_xm25 extends MovieClip {
public function mc_reload_xm25(){
super();
}
}
}//package
Section 213
//mc_reload_xm8 (mc_reload_xm8)
package {
import flash.display.*;
public dynamic class mc_reload_xm8 extends MovieClip {
public function mc_reload_xm8(){
super();
}
}
}//package
Section 214
//mc_rpgbullet (mc_rpgbullet)
package {
import flash.display.*;
public dynamic class mc_rpgbullet extends MovieClip {
public function mc_rpgbullet(){
super();
}
}
}//package
Section 215
//mc_sceneback (mc_sceneback)
package {
import flash.display.*;
public dynamic class mc_sceneback extends MovieClip {
public function mc_sceneback(){
super();
}
}
}//package
Section 216
//mc_scenefront (mc_scenefront)
package {
import flash.display.*;
public dynamic class mc_scenefront extends MovieClip {
public function mc_scenefront(){
super();
}
}
}//package
Section 217
//mc_screenborder (mc_screenborder)
package {
import flash.display.*;
public dynamic class mc_screenborder extends MovieClip {
public function mc_screenborder(){
super();
}
}
}//package
Section 218
//mc_shoot_ak47 (mc_shoot_ak47)
package {
import flash.display.*;
public dynamic class mc_shoot_ak47 extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_ak47(){
super();
}
}
}//package
Section 219
//mc_shoot_brenmk2 (mc_shoot_brenmk2)
package {
import flash.display.*;
public dynamic class mc_shoot_brenmk2 extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_brenmk2(){
super();
}
}
}//package
Section 220
//mc_shoot_danwesson (mc_shoot_danwesson)
package {
import flash.display.*;
public dynamic class mc_shoot_danwesson extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_danwesson(){
super();
}
}
}//package
Section 221
//mc_shoot_deagle (mc_shoot_deagle)
package {
import flash.display.*;
public dynamic class mc_shoot_deagle extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_deagle(){
super();
}
}
}//package
Section 222
//mc_shoot_m60 (mc_shoot_m60)
package {
import flash.display.*;
public dynamic class mc_shoot_m60 extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_m60(){
super();
}
}
}//package
Section 223
//mc_shoot_m79 (mc_shoot_m79)
package {
import flash.display.*;
public dynamic class mc_shoot_m79 extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_m79(){
super();
}
}
}//package
Section 224
//mc_shoot_m9 (mc_shoot_m9)
package {
import flash.display.*;
public dynamic class mc_shoot_m9 extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_m9(){
super();
}
}
}//package
Section 225
//mc_shoot_mg34 (mc_shoot_mg34)
package {
import flash.display.*;
public dynamic class mc_shoot_mg34 extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_mg34(){
super();
}
}
}//package
Section 226
//mc_shoot_minigun (mc_shoot_minigun)
package {
import flash.display.*;
public dynamic class mc_shoot_minigun extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_minigun(){
super();
}
}
}//package
Section 227
//mc_shoot_mm1 (mc_shoot_mm1)
package {
import flash.display.*;
public dynamic class mc_shoot_mm1 extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_mm1(){
super();
}
}
}//package
Section 228
//mc_shoot_mossberg500 (mc_shoot_mossberg500)
package {
import flash.display.*;
public dynamic class mc_shoot_mossberg500 extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_mossberg500(){
super();
}
}
}//package
Section 229
//mc_shoot_mp5 (mc_shoot_mp5)
package {
import flash.display.*;
public dynamic class mc_shoot_mp5 extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_mp5(){
super();
}
}
}//package
Section 230
//mc_shoot_mp9 (mc_shoot_mp9)
package {
import flash.display.*;
public dynamic class mc_shoot_mp9 extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_mp9(){
super();
}
}
}//package
Section 231
//mc_shoot_spas12 (mc_shoot_spas12)
package {
import flash.display.*;
public dynamic class mc_shoot_spas12 extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_spas12(){
super();
}
}
}//package
Section 232
//mc_shoot_steyrAUG (mc_shoot_steyrAUG)
package {
import flash.display.*;
public dynamic class mc_shoot_steyrAUG extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_steyrAUG(){
super();
}
}
}//package
Section 233
//mc_shoot_steyrTMP (mc_shoot_steyrTMP)
package {
import flash.display.*;
public dynamic class mc_shoot_steyrTMP extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_steyrTMP(){
super();
}
}
}//package
Section 234
//mc_shoot_trench (mc_shoot_trench)
package {
import flash.display.*;
public dynamic class mc_shoot_trench extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_trench(){
super();
}
}
}//package
Section 235
//mc_shoot_xm25 (mc_shoot_xm25)
package {
import flash.display.*;
public dynamic class mc_shoot_xm25 extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_xm25(){
super();
}
}
}//package
Section 236
//mc_shoot_xm8 (mc_shoot_xm8)
package {
import flash.display.*;
public dynamic class mc_shoot_xm8 extends MovieClip {
public var bulletstart:MovieClip;
public function mc_shoot_xm8(){
super();
}
}
}//package
Section 237
//mc_shottrail (mc_shottrail)
package {
import flash.display.*;
public dynamic class mc_shottrail extends MovieClip {
public function mc_shottrail(){
super();
}
}
}//package
Section 238
//mc_small_mouth (mc_small_mouth)
package {
import flash.display.*;
public dynamic class mc_small_mouth extends MovieClip {
public function mc_small_mouth(){
super();
}
}
}//package
Section 239
//mc_smoke1 (mc_smoke1)
package {
import flash.display.*;
public dynamic class mc_smoke1 extends MovieClip {
public function mc_smoke1(){
super();
}
}
}//package
Section 240
//mc_smoke2 (mc_smoke2)
package {
import flash.display.*;
public dynamic class mc_smoke2 extends MovieClip {
public function mc_smoke2(){
super();
}
}
}//package
Section 241
//mc_spas (mc_spas)
package {
import flash.display.*;
public dynamic class mc_spas extends MovieClip {
public function mc_spas(){
super();
}
}
}//package
Section 242
//mc_staticpage (mc_staticpage)
package {
import flash.display.*;
public dynamic class mc_staticpage extends MovieClip {
public function mc_staticpage(){
super();
}
}
}//package
Section 243
//mc_statistics (mc_statistics)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mc_statistics extends MovieClip {
public var tx1:TextField;
public var tx2:TextField;
public var tx4:TextField;
public var tx5:TextField;
public var tx6:TextField;
public var tx7:TextField;
public var tx9:TextField;
public var tx3:TextField;
public var tx8:TextField;
public var btclose:SimpleButton;
public function mc_statistics(){
super();
}
}
}//package
Section 244
//mc_steyraug (mc_steyraug)
package {
import flash.display.*;
public dynamic class mc_steyraug extends MovieClip {
public function mc_steyraug(){
super();
}
}
}//package
Section 245
//mc_steyrtmp (mc_steyrtmp)
package {
import flash.display.*;
public dynamic class mc_steyrtmp extends MovieClip {
public function mc_steyrtmp(){
super();
}
}
}//package
Section 246
//mc_targetpoint (mc_targetpoint)
package {
import flash.display.*;
public dynamic class mc_targetpoint extends MovieClip {
public function mc_targetpoint(){
super();
}
}
}//package
Section 247
//mc_trap_layer (mc_trap_layer)
package {
import flash.display.*;
public dynamic class mc_trap_layer extends MovieClip {
public function mc_trap_layer(){
super();
}
}
}//package
Section 248
//mc_trap1 (mc_trap1)
package {
import flash.display.*;
public dynamic class mc_trap1 extends MovieClip {
public function mc_trap1(){
super();
}
}
}//package
Section 249
//mc_trap1_hit (mc_trap1_hit)
package {
import flash.display.*;
public dynamic class mc_trap1_hit extends MovieClip {
public function mc_trap1_hit(){
super();
}
}
}//package
Section 250
//mc_trap1_idle (mc_trap1_idle)
package {
import flash.display.*;
public dynamic class mc_trap1_idle extends MovieClip {
public function mc_trap1_idle(){
super();
}
}
}//package
Section 251
//mc_trap1_pointer (mc_trap1_pointer)
package {
import flash.display.*;
public dynamic class mc_trap1_pointer extends MovieClip {
public function mc_trap1_pointer(){
super();
}
}
}//package
Section 252
//mc_trap1_put (mc_trap1_put)
package {
import flash.display.*;
public dynamic class mc_trap1_put extends MovieClip {
public function mc_trap1_put(){
super();
}
}
}//package
Section 253
//mc_trap2 (mc_trap2)
package {
import flash.display.*;
public dynamic class mc_trap2 extends MovieClip {
public function mc_trap2(){
super();
}
}
}//package
Section 254
//mc_trap2_hit (mc_trap2_hit)
package {
import flash.display.*;
public dynamic class mc_trap2_hit extends MovieClip {
public function mc_trap2_hit(){
super();
}
}
}//package
Section 255
//mc_trap2_idle (mc_trap2_idle)
package {
import flash.display.*;
public dynamic class mc_trap2_idle extends MovieClip {
public function mc_trap2_idle(){
super();
}
}
}//package
Section 256
//mc_trap2_pointer (mc_trap2_pointer)
package {
import flash.display.*;
public dynamic class mc_trap2_pointer extends MovieClip {
public function mc_trap2_pointer(){
super();
}
}
}//package
Section 257
//mc_trap2_put (mc_trap2_put)
package {
import flash.display.*;
public dynamic class mc_trap2_put extends MovieClip {
public function mc_trap2_put(){
super();
}
}
}//package
Section 258
//mc_trap3 (mc_trap3)
package {
import flash.display.*;
public dynamic class mc_trap3 extends MovieClip {
public function mc_trap3(){
super();
}
}
}//package
Section 259
//mc_trap3_hit (mc_trap3_hit)
package {
import flash.display.*;
public dynamic class mc_trap3_hit extends MovieClip {
public function mc_trap3_hit(){
super();
}
}
}//package
Section 260
//mc_trap3_idle (mc_trap3_idle)
package {
import flash.display.*;
public dynamic class mc_trap3_idle extends MovieClip {
public function mc_trap3_idle(){
super();
}
}
}//package
Section 261
//mc_trap3_pointer (mc_trap3_pointer)
package {
import flash.display.*;
public dynamic class mc_trap3_pointer extends MovieClip {
public function mc_trap3_pointer(){
super();
}
}
}//package
Section 262
//mc_trap3_put (mc_trap3_put)
package {
import flash.display.*;
public dynamic class mc_trap3_put extends MovieClip {
public function mc_trap3_put(){
super();
}
}
}//package
Section 263
//mc_trench (mc_trench)
package {
import flash.display.*;
public dynamic class mc_trench extends MovieClip {
public function mc_trench(){
super();
}
}
}//package
Section 264
//mc_upgrade_other (mc_upgrade_other)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mc_upgrade_other extends MovieClip {
public var btupgrade6:SimpleButton;
public var btupgrade5:SimpleButton;
public var mcupgradebar1:MovieClip;
public var mcupgradebar2:MovieClip;
public var mcupgradebar5:MovieClip;
public var mcupgradebar6:MovieClip;
public var mcupgradebar4:MovieClip;
public var mcupgradebar7:MovieClip;
public var txnote1:TextField;
public var txnote2:TextField;
public var txnote5:TextField;
public var txnote3:TextField;
public var txnote6:TextField;
public var txnote7:TextField;
public var txtotalmoney:TextField;
public var mcupgradebar3:MovieClip;
public var txnote4:TextField;
public var btgoweapons:SimpleButton;
public var btclose:SimpleButton;
public var btupgrade2:SimpleButton;
public var btupgrade3:SimpleButton;
public var btupgrade7:SimpleButton;
public var btupgrade1:SimpleButton;
public var btupgrade9:SimpleButton;
public var btupgrade4:SimpleButton;
public var btupgrade8:SimpleButton;
public function mc_upgrade_other(){
super();
}
}
}//package
Section 265
//mc_upgrade_weapon (mc_upgrade_weapon)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mc_upgrade_weapon extends MovieClip {
public var btselect1:SimpleButton;
public var btselect2:SimpleButton;
public var btselect3:SimpleButton;
public var btselect4:SimpleButton;
public var btselect5:SimpleButton;
public var btselect6:SimpleButton;
public var btselect7:SimpleButton;
public var bthandgun1:SimpleButton;
public var bthandgun2:SimpleButton;
public var bthandgun3:SimpleButton;
public var btlauncher1:SimpleButton;
public var btlauncher2:SimpleButton;
public var btlauncher3:SimpleButton;
public var btgoupgrades:SimpleButton;
public var btclose:SimpleButton;
public var btspecial1:SimpleButton;
public var btspecial2:SimpleButton;
public var btspecial3:SimpleButton;
public var btspecial4:SimpleButton;
public var btbuy:SimpleButton;
public var mctabweapon:MovieClip;
public var btmachine1:SimpleButton;
public var btmachine3:SimpleButton;
public var btmachine2:SimpleButton;
public var btshotgun1:SimpleButton;
public var btshotgun2:SimpleButton;
public var btshotgun3:SimpleButton;
public var mcloaderbig:MovieClip;
public var btassault1:SimpleButton;
public var btassault2:SimpleButton;
public var btassault3:SimpleButton;
public var btsubmachine1:SimpleButton;
public var btsubmachine2:SimpleButton;
public var btsubmachine3:SimpleButton;
public var txtotalmoney:TextField;
public var txweapon:TextField;
public var mctabtrap:MovieClip;
public function mc_upgrade_weapon(){
super();
}
}
}//package
Section 266
//mc_weapon_locked (mc_weapon_locked)
package {
import flash.display.*;
public dynamic class mc_weapon_locked extends MovieClip {
public function mc_weapon_locked(){
super();
}
}
}//package
Section 267
//mc_xm25 (mc_xm25)
package {
import flash.display.*;
public dynamic class mc_xm25 extends MovieClip {
public function mc_xm25(){
super();
}
}
}//package
Section 268
//mc_xm8 (mc_xm8)
package {
import flash.display.*;
public dynamic class mc_xm8 extends MovieClip {
public function mc_xm8(){
super();
}
}
}//package
Section 269
//MouseBase (MouseBase)
package {
import flash.display.*;
import defclass.tweener.*;
import flash.filters.*;
public class MouseBase extends MovieClip {
private var slowcolor;
public var part;
public var moveright;
private var slowglow;
private var slowtimer;
public var timer;
public var attack;
private var stunglow;
public var health;
public var damage;
public var skin;
public var attackskin;
private var blowntimer;
public var maxhealth;
private var topy;
private var basey;
private var stuntimer;
private var stuncolor;
public var status;
public function MouseBase(_data){
super();
setData(_data);
setSkin();
if (Math.random() < 0.5){
moveright = true;
};
basey = 75;
topy = getClosestY();
this.y = getClosestY(basey);
this.x = ((Math.random() * 405) + 10);
setScale();
stuncolor = new ColorMatrixFilter([0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]);
slowcolor = new ColorMatrixFilter([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]);
stunglow = new GlowFilter(0xFFFF);
slowglow = new GlowFilter(0xFFFF00);
stuntimer = 0;
slowtimer = 0;
blowntimer = 0;
}
public function setScale(){
var sc:*;
sc = TweenEquations.easeInSine((this.y - 100), 0.2, 0.7, (350 - 100));
this.scaleX = sc;
this.scaleY = sc;
}
private function doIdle(){
if (name == "gray"){
if (basey < 200){
if (timer > 0){
timer--;
if (timer == 0){
status = "drilldown";
setSkin();
timer = 1;
};
};
} else {
timer--;
if (timer == 0){
status = "attack";
setSkin();
timer = 0;
};
};
} else {
setPos();
};
}
private function setData(_data){
name = _data.name;
health = _data.health;
maxhealth = _data.health;
attack = _data.attack;
part = _data.part;
damage = attack;
if (name == "gray"){
status = "drillup";
} else {
status = "idle";
};
moveright = false;
}
private function drillUp(){
if (attackskin.currentFrame == attackskin.totalFrames){
timer = 30;
status = "idle";
setSkin();
};
}
public function setTrapEffect(_param, _damage){
switch (_param){
case "trap3":
if (!stuntimer){
if (skin){
skin.stop();
stuntimer = 120;
if (slowtimer){
skin.filters = [stuncolor, stunglow, slowcolor, slowglow];
} else {
skin.filters = [stuncolor, stunglow];
};
hit(_damage);
};
};
break;
case "trap2":
if (!slowtimer){
if (skin){
slowtimer = 120;
if (stuntimer){
skin.filters = [slowcolor, slowglow, stuncolor, stunglow];
} else {
skin.filters = [slowcolor, slowglow];
};
trace(skin.filters);
hit(_damage);
};
};
break;
case "trap1":
default:
if (!blowntimer){
blowntimer = 120;
hit(_damage);
};
break;
};
}
private function clearSkin(){
while (this.numChildren > 0) {
this.removeChild(this.getChildAt(0));
};
}
private function setDeadSkin(){
var rnd:*;
rnd = Math.random();
clearSkin();
skin = null;
attackskin = null;
switch (this.name){
case "yellow":
skin = new mc_goo_blow();
this.addChild(skin);
break;
case "yellowchild":
skin = new mc_goo_blow();
skin.scaleX = 0.5;
skin.scaleY = 0.5;
this.addChild(skin);
break;
case "black":
skin = new mc_purple_blow();
this.addChild(skin);
break;
default:
if (rnd < 0.5){
skin = new mc_blood_blow();
} else {
skin = new mc_blood_blow2();
};
this.addChild(skin);
break;
};
}
public function hit(_damage){
var ph:*;
if (((((!((status == "dead"))) && (!((status == "drillup"))))) && (!((status == "drilldown"))))){
ph = health;
health = (health - _damage);
if (health <= 0){
health = 0;
this.y = (this.y - ((_damage / maxhealth) / 10));
} else {
if (status != "attack"){
this.y = (this.y - ((_damage / maxhealth) / 10));
};
};
if (((((!((health == 0))) && (!((ph == health))))) && (((((((((ph / maxhealth) > 0.75)) && (((health / maxhealth) <= 0.75)))) || (((((ph / maxhealth) > 0.5)) && (((health / maxhealth) <= 0.5)))))) || (((((ph / maxhealth) > 0.25)) && (((health / maxhealth) <= 0.25)))))))){
setSkin();
};
};
}
private function setPos(){
switch (this.name){
case "yellow":
if (this.y < topy){
if (slowtimer){
this.y = (this.y + TweenEquations.easeInSine((this.y - basey), 0.2, 0.4, (350 - basey)));
} else {
this.y = (this.y + TweenEquations.easeInSine((this.y - basey), 0.7, 1.5, (350 - basey)));
};
if (Math.random() > 0.9){
moveright = !(moveright);
};
if (moveright){
if (slowtimer){
this.x = (this.x + TweenEquations.easeInSine((this.y - basey), 0.1, 0.5, (350 - basey)));
} else {
this.x = (this.x + TweenEquations.easeInSine((this.y - basey), 0.5, 2, (350 - basey)));
};
} else {
if (slowtimer){
this.x = (this.x - TweenEquations.easeInSine((this.y - basey), 0.1, 0.5, (350 - basey)));
} else {
this.x = (this.x - TweenEquations.easeInSine((this.y - basey), 0.5, 2, (350 - basey)));
};
};
} else {
if (status == "idle"){
status = "attack";
setSkin();
};
};
break;
case "red":
if (this.y < topy){
if (slowtimer){
this.y = (this.y + TweenEquations.easeInSine((this.y - basey), 0.2, 0.4, (350 - basey)));
} else {
this.y = (this.y + TweenEquations.easeInSine((this.y - basey), 1, 1.7, (350 - basey)));
};
if (Math.random() > 0.9){
moveright = !(moveright);
};
if (Math.random() < 0.5){
this.x = (this.x + TweenEquations.easeInSine((this.y - basey), 0.5, 2, (350 - basey)));
} else {
this.x = (this.x - TweenEquations.easeInSine((this.y - basey), 0.5, 2, (350 - basey)));
};
if (moveright){
if (slowtimer){
this.x = (this.x + TweenEquations.easeInSine((this.y - basey), 0.1, 0.5, (350 - basey)));
} else {
this.x = (this.x + TweenEquations.easeInSine((this.y - basey), 0.5, 2, (350 - basey)));
};
} else {
if (slowtimer){
this.x = (this.x - TweenEquations.easeInSine((this.y - basey), 0.1, 0.5, (350 - basey)));
} else {
this.x = (this.x - TweenEquations.easeInSine((this.y - basey), 0.5, 2, (350 - basey)));
};
};
} else {
if (status == "idle"){
status = "attack";
setSkin();
};
};
break;
case "white":
if (this.y < (topy - 5)){
if (slowtimer){
this.y = (this.y + TweenEquations.easeInSine((this.y - basey), 0.2, 0.4, (350 - basey)));
} else {
this.y = (this.y + TweenEquations.easeInSine((this.y - basey), 1, 3, (350 - basey)));
};
if (Math.random() < 0.5){
this.x = (this.x + TweenEquations.easeInSine((this.y - basey), 0.5, 1, (350 - basey)));
} else {
this.x = (this.x - TweenEquations.easeInSine((this.y - basey), 0.5, 1, (350 - basey)));
};
if (moveright){
if (slowtimer){
this.x = (this.x + TweenEquations.easeInSine((this.y - basey), 0.1, 0.5, (350 - basey)));
} else {
this.x = (this.x + TweenEquations.easeInSine((this.y - basey), 0.5, 2, (350 - basey)));
};
} else {
if (slowtimer){
this.x = (this.x - TweenEquations.easeInSine((this.y - basey), 0.1, 0.5, (350 - basey)));
} else {
this.x = (this.x - TweenEquations.easeInSine((this.y - basey), 0.5, 2, (350 - basey)));
};
};
} else {
if (status == "idle"){
status = "attack";
setSkin();
};
};
break;
case "yellowchild":
if (this.y < (topy - 5)){
if (slowtimer){
this.y = (this.y + TweenEquations.easeInSine((this.y - basey), 0.3, 0.7, (350 - basey)));
} else {
this.y = (this.y + TweenEquations.easeInSine((this.y - basey), 0.7, 1.5, (350 - basey)));
};
if (Math.random() > 0.9){
moveright = !(moveright);
};
if (moveright){
if (slowtimer){
this.x = (this.x + TweenEquations.easeInSine((this.y - basey), 0.1, 0.3, (350 - basey)));
} else {
this.x = (this.x + TweenEquations.easeInSine((this.y - basey), 0.5, 1, (350 - basey)));
};
} else {
if (slowtimer){
this.x = (this.x - TweenEquations.easeInSine((this.y - basey), 0.1, 0.3, (350 - basey)));
} else {
this.x = (this.x - TweenEquations.easeInSine((this.y - basey), 0.5, 1, (350 - basey)));
};
};
} else {
if (status == "idle"){
status = "attack";
setSkin();
};
};
break;
case "blue":
if (this.y < (topy - 5)){
if (slowtimer){
this.y = (this.y + TweenEquations.easeInSine((this.y - basey), 0.2, 0.4, (350 - basey)));
} else {
this.y = (this.y + TweenEquations.easeInSine((this.y - basey), 1, 3, (350 - basey)));
};
if (Math.random() < 0.5){
this.x = (this.x + TweenEquations.easeInSine((this.y - basey), 0.5, 1, (350 - basey)));
} else {
this.x = (this.x - TweenEquations.easeInSine((this.y - basey), 0.5, 1, (350 - basey)));
};
if (moveright){
if (slowtimer){
this.x = (this.x + TweenEquations.easeInSine((this.y - basey), 0.1, 0.5, (350 - basey)));
} else {
this.x = (this.x + TweenEquations.easeInSine((this.y - basey), 0.5, 2, (350 - basey)));
};
} else {
if (slowtimer){
this.x = (this.x - TweenEquations.easeInSine((this.y - basey), 0.1, 0.5, (350 - basey)));
} else {
this.x = (this.x - TweenEquations.easeInSine((this.y - basey), 0.5, 2, (350 - basey)));
};
};
} else {
if (status == "idle"){
status = "attack";
setSkin();
};
};
break;
case "black":
if (this.y < (topy - 5)){
if (slowtimer){
this.y = (this.y + TweenEquations.easeInSine((this.y - basey), 0.2, 0.4, (350 - basey)));
} else {
this.y = (this.y + TweenEquations.easeInSine((this.y - basey), 1, 1.7, (350 - basey)));
};
if (Math.random() < 0.5){
this.x = (this.x + TweenEquations.easeInSine((this.y - basey), 0.5, 1, (350 - basey)));
} else {
this.x = (this.x - TweenEquations.easeInSine((this.y - basey), 0.5, 1, (350 - basey)));
};
} else {
if (status == "idle"){
status = "attack";
setSkin();
};
};
break;
case "gray":
default:
if (this.y < (topy - 5)){
if (slowtimer){
this.y = (this.y + TweenEquations.easeInSine((this.y - basey), 0.2, 0.4, (350 - basey)));
} else {
this.y = (this.y + TweenEquations.easeInSine((this.y - basey), 0.5, 1.5, (350 - basey)));
};
if (Math.random() < 0.5){
this.x = (this.x + TweenEquations.easeInSine((this.y - basey), 0.5, 1, (350 - basey)));
} else {
this.x = (this.x - TweenEquations.easeInSine((this.y - basey), 0.5, 1, (350 - basey)));
};
} else {
if (status == "idle"){
status = "attack";
setSkin();
};
};
break;
};
if (this.x < 10){
this.x = 10;
moveright = true;
} else {
if (this.x > 405){
this.x = 405;
moveright = false;
};
};
topy = getClosestY();
}
private function drillDown(){
if (attackskin.currentFrame == attackskin.totalFrames){
if (basey < 300){
basey = (basey + (100 + (Math.random() * 20)));
} else {
basey = (basey - (10 + (Math.random() * 25)));
};
this.y = getClosestY(basey);
this.x = ((Math.random() * 405) + 10);
if (this.y > 300){
this.y = 305;
};
status = "drillup";
setSkin();
};
}
private function doAttack(){
switch (this.name){
case "black":
if (attackskin.currentFrame == (attackskin.totalFrames - 1)){
status = "attacking";
} else {
if (attackskin.currentFrame == attackskin.totalFrames){
health = 0;
status = "dead";
setDeadSkin();
};
};
break;
case "yellowchild":
if (attackskin.currentFrame == (attackskin.totalFrames - 1)){
status = "attacking";
} else {
if (attackskin.currentFrame == attackskin.totalFrames){
health = 0;
status = "dead";
setDeadSkin();
trace(skin, attackskin);
};
};
break;
case "yellow":
health = 0;
status = "dead";
setDeadSkin();
break;
case "gray":
setTipPos();
break;
default:
if (attackskin){
timer = attackskin.currentFrame;
if (attackskin.currentFrame == 3){
status = "attacking";
};
} else {
timer = 0;
};
setPos();
break;
};
}
private function setTipPos(){
topy = (((getClosestY(350) - this.y) * 1) / this.scaleX);
timer++;
if (timer < 10){
attackskin.y = TweenEquations.easeInSine(timer, 0, topy, 10);
} else {
if (timer < 11){
status = "attacking";
} else {
if (Math.random() < 0.5){
timer = 120;
status = "drilldown";
setSkin();
} else {
timer = 60;
status = "idle";
setSkin();
};
};
};
}
public function moveClip(){
if (slowtimer){
slowtimer--;
};
if (skin){
if (!slowtimer){
if (stuntimer){
skin.filters = [stuncolor, stunglow];
} else {
skin.filters = [];
};
} else {
if (stuntimer){
skin.filters = [stuncolor, stunglow, slowcolor, slowglow];
} else {
skin.filters = [slowcolor, slowglow];
};
};
};
if (stuntimer){
stuntimer--;
if (skin){
if (!stuntimer){
skin.play();
if (slowtimer){
skin.filters = [slowcolor, slowglow];
} else {
skin.filters = [];
};
} else {
if (slowtimer){
skin.filters = [slowcolor, slowglow, stuncolor, stunglow];
} else {
skin.filters = [stuncolor, stunglow];
};
};
};
};
if (blowntimer){
blowntimer--;
};
if (!stuntimer){
switch (status){
case "idle":
doIdle();
break;
case "drillup":
drillUp();
break;
case "drilldown":
drillDown();
break;
case "attacking":
status = "attack";
case "attack":
doAttack();
break;
case "dead":
if (skin){
if (skin.currentFrame == skin.totalFrames){
skin.stop();
};
};
if (attackskin){
if (attackskin.currentFrame == attackskin.totalFrames){
attackskin.stop();
};
};
break;
};
} else {
switch (status){
case "dead":
if (skin){
if (skin.currentFrame == skin.totalFrames){
skin.stop();
};
};
if (attackskin){
if (attackskin.currentFrame == attackskin.totalFrames){
attackskin.stop();
};
};
break;
};
};
if (((!((status == "dead"))) && ((health <= 0)))){
status = "dead";
setDeadSkin();
};
setScale();
}
private function getClosestY(_pos=350):Number{
var mid:*;
var pos:*;
var miny:*;
var maxy:*;
mid = (425 / 2);
miny = _pos;
maxy = (_pos + 30);
if (this.x > mid){
pos = (this.x - mid);
} else {
pos = ((mid - this.x) * -1);
};
return (TweenEquations.easeInSine(pos, miny, (maxy - miny), mid));
}
private function setSkin(){
var hd:*;
var rnd:*;
rnd = Math.random();
hd = (health / maxhealth);
clearSkin();
switch (this.name){
case "blue":
if (hd > 0.75){
skin = new mc_mouse01_100();
} else {
if (hd > 0.5){
skin = new mc_mouse01_75();
} else {
if (hd > 0.25){
skin = new mc_mouse01_50();
} else {
skin = new mc_mouse01_25();
};
};
};
switch (status){
case "attacking":
case "attack":
if (!attackskin){
attackskin = new mc_small_mouth();
};
break;
default:
attackskin = null;
break;
};
break;
case "black":
if (hd > 0.75){
skin = new mc_mouse02_100();
} else {
if (hd > 0.5){
skin = new mc_mouse02_75();
} else {
if (hd > 0.25){
skin = new mc_mouse02_50();
} else {
skin = new mc_mouse02_25();
};
};
};
switch (status){
case "attacking":
case "attack":
if (!attackskin){
attackskin = new mc_mouse02_attack();
};
break;
default:
attackskin = null;
break;
};
break;
case "gray":
if (status == "drillup"){
attackskin = new mc_drilling_up();
skin = null;
} else {
if (status == "drilldown"){
skin.tip.visible = true;
attackskin = new mc_drilling_down();
} else {
if (hd > 0.75){
skin = new mc_mouse03_100();
} else {
if (hd > 0.5){
skin = new mc_mouse03_75();
} else {
if (hd > 0.25){
skin = new mc_mouse03_50();
} else {
skin = new mc_mouse03_25();
};
};
};
switch (status){
case "attacking":
case "attack":
skin.tip.visible = false;
attackskin = new mc_drill_tip();
break;
default:
attackskin = null;
break;
};
};
};
break;
case "white":
if (hd > 0.75){
skin = new mc_mouse04_100();
} else {
if (hd > 0.5){
skin = new mc_mouse04_75();
} else {
if (hd > 0.25){
skin = new mc_mouse04_50();
} else {
skin = new mc_mouse04_25();
};
};
};
switch (status){
case "attacking":
case "attack":
if (!attackskin){
attackskin = new mc_small_mouth();
};
break;
default:
attackskin = null;
break;
};
break;
case "red":
if (hd > 0.75){
skin = new mc_mouse05_100();
} else {
if (hd > 0.5){
skin = new mc_mouse05_75();
} else {
if (hd > 0.25){
skin = new mc_mouse05_50();
} else {
skin = new mc_mouse05_25();
};
};
};
switch (status){
case "attacking":
case "attack":
if (!attackskin){
attackskin = new mc_big_mouth();
};
break;
default:
attackskin = null;
break;
};
break;
case "yellow":
if (hd > 0.75){
skin = new mc_mouse06_100();
} else {
if (hd > 0.5){
skin = new mc_mouse06_75();
} else {
if (hd > 0.25){
skin = new mc_mouse06_50();
} else {
skin = new mc_mouse06_25();
};
};
};
break;
case "yellowchild":
if ((((status == "attack")) || ((status == "attacking")))){
if (!attackskin){
skin = null;
attackskin = ((part)=="left") ? new mc_mouse06_a_explode() : new mc_mouse06_b_explode();
};
} else {
if (hd > 0.5){
skin = ((part)=="left") ? new mc_mouse06_a_100() : new mc_mouse06_b_100();
} else {
if (hd > 0.25){
skin = ((part)=="left") ? new mc_mouse06_a_50() : new mc_mouse06_b_50();
} else {
skin = ((part)=="left") ? new mc_mouse06_a_25() : new mc_mouse06_b_25();
};
};
attackskin = null;
};
break;
};
if (skin){
this.addChild(skin);
};
if (attackskin){
this.addChild(attackskin);
};
}
}
}//package
Section 270
//PageManager (PageManager)
package {
import flash.events.*;
import flash.display.*;
import defclass.utils.*;
public class PageManager {
private var prevpage;
private var returnpage;
private var nextpage;
private var shakeangle;
private var currentpage;
private var shakeengine;
private var border;
private var maintimeline;
private var shaketimer;
public function PageManager(_mtl){
super();
maintimeline = _mtl;
border = new mc_screenborder();
returnpage = "none";
}
public function moveClip(e){
var r:*;
if (shaketimer > 0){
r = (((shaketimer / 5))>3) ? 3 : (shaketimer / 5);
shakeangle = (Math.random() * 360);
nextpage.x = MathVect.getDx(r, shakeangle);
nextpage.y = MathVect.getDy(r, shakeangle);
border.x = MathVect.getDx(r, shakeangle);
border.y = MathVect.getDy(r, shakeangle);
shaketimer--;
if (shaketimer == 0){
nextpage.x = 0;
nextpage.y = 0;
border.x = 0;
border.y = 0;
shakeengine.removeEventListener(Event.ENTER_FRAME, moveClip);
shakeengine = null;
};
};
}
private function getPage(_page){
var res:*;
var p:*;
currentpage = _page;
if (currentpage == "return"){
currentpage = returnpage;
};
if (currentpage == "none"){
currentpage = "cover";
};
switch (currentpage){
case "intro1":
res = new ComicPage(maintimeline, "intro1");
break;
case "intro2":
res = new ComicPage(maintimeline, "intro2");
break;
case "ending":
res = new ComicPage(maintimeline, "ending");
break;
case "game":
res = new GameManager(maintimeline);
break;
case "load":
res = new LoadPage(maintimeline);
break;
case "save":
res = new SavePage(maintimeline);
break;
case "awards":
res = new AwardsPage(maintimeline);
break;
case "credits":
res = new CreditsPage(maintimeline);
break;
case "statistics":
res = new StatisticsPage(maintimeline);
break;
case "gamestats":
res = new GameStatistics(maintimeline);
break;
case "gamelost":
res = new GameLost(maintimeline);
break;
case "upgradeweapon":
res = new UpgradeWeapon(maintimeline);
break;
case "upgradeother":
res = new UpgradeOther(maintimeline);
break;
case "cover":
res = new MainMenu(maintimeline);
break;
default:
res = new MainMenu(maintimeline);
break;
};
return (res);
}
public function shakeScreen(_strength=10){
shakeengine = new MovieClip();
shakeengine.addEventListener(Event.ENTER_FRAME, moveClip, false, 0, true);
shakeangle = (Math.random() * 360);
shaketimer = _strength;
}
public function loadPage(_page="return", _returnpage="none"){
clearScreen();
if (_returnpage != "none"){
returnpage = _returnpage;
};
if (nextpage){
prevpage = freezePreviousPage();
maintimeline.addChild(prevpage);
};
nextpage = getPage(_page);
maintimeline.addChild(nextpage);
maintimeline.addChild(border);
if (shaketimer > 0){
shaketimer = 1;
};
}
private function clearScreen(){
while (maintimeline.numChildren > 0) {
maintimeline.removeChild(maintimeline.getChildAt(0));
};
}
private function freezePreviousPage(){
var bd:*;
var bmp:*;
bd = new BitmapData(425, 525, true, 0xFFFFFF);
bd.lock();
bd.draw(nextpage);
bd.unlock();
bmp = new Bitmap(bd);
return (bmp);
}
}
}//package
Section 271
//RPGBulletPart (RPGBulletPart)
package {
import flash.events.*;
import flash.display.*;
import defclass.utils.*;
public class RPGBulletPart extends MovieClip {
private var targetpos;
public var timer;
public var damage;
private var skin;
private var startpos;
public var status;
public function RPGBulletPart(_dmg, _startpos, _targetpos){
super();
damage = _dmg;
startpos = _startpos;
targetpos = _targetpos;
this.rotation = (MathVect.getAngle(startpos[0], startpos[1], targetpos[0], targetpos[1]) + 90);
this.x = _startpos[0];
this.y = _startpos[1];
this.name = "rpgbullet";
skin = new mc_rpgbullet();
this.addChild(skin);
timer = 1;
status = "animating";
this.addEventListener(Event.ENTER_FRAME, moveClip, false, 0, true);
}
public function moveClip(e){
if (timer < 5){
timer++;
this.x = (startpos[0] + ((timer * (targetpos[0] - startpos[0])) / 5));
this.y = (startpos[1] + ((timer * (targetpos[1] - startpos[1])) / 5));
this.scaleX = (1 - ((timer * 0.7) / 5));
this.scaleY = (1 - (((timer * 0.7) / 5) / 2));
if (timer == 5){
this.removeEventListener(Event.ENTER_FRAME, moveClip);
status = "finished";
};
};
}
}
}//package
Section 272
//SavePage (SavePage)
package {
import flash.events.*;
import flash.display.*;
public class SavePage extends MovieClip {
private var maintimeline;
private var panel;
private var nextpage;
private var element;
private var admgr;
private var pagemgr;
private var datamgr;
private var selectedslot;
private var timer;
private var slotpos;
private var soundmgr;
private var tweenmgr;
public var status;
public function SavePage(_mtl){
var i:*;
super();
maintimeline = _mtl;
tweenmgr = maintimeline.tweenmgr;
pagemgr = maintimeline.pagemgr;
soundmgr = maintimeline.soundmgr;
datamgr = maintimeline.datamgr;
admgr = maintimeline.admgr;
panel = [new mc_game_ads(), new mc_game_save()];
this.addChild(panel[0]);
this.addChild(panel[1]);
admgr.getCPMAds(panel[0].adbox, "interlevel");
element = [panel[1].txtitle, panel[1].txsubtitle, panel[1].btslot1, panel[1].btslot2, panel[1].btslot3, panel[1].btslot4, panel[1].txlabel11, panel[1].txlabel12, panel[1].txmoney1, panel[1].txlabel13, panel[1].txscore1, panel[1].txlabel21, panel[1].txlabel22, panel[1].txmoney2, panel[1].txlabel23, panel[1].txscore2, panel[1].txlabel31, panel[1].txlabel32, panel[1].txmoney3, panel[1].txlabel33, panel[1].txscore3, panel[1].txlabel41, panel[1].txlabel42, panel[1].txmoney4, panel[1].txlabel43, panel[1].txscore4, panel[1].btsave, panel[1].btclose];
i = 0;
while (i < element.length) {
element[i].visible = true;
i++;
};
status = "start";
slotpos = [panel[1].btslot4.x, panel[1].btslot1.x, panel[1].btslot2.x, panel[1].btslot3.x];
panel[1].txmoney1.text = (datamgr.datasummary[1].level + 1);
panel[1].txscore1.text = datamgr.datasummary[1].score;
panel[1].txmoney2.text = (datamgr.datasummary[2].level + 1);
panel[1].txscore2.text = datamgr.datasummary[2].score;
panel[1].txmoney3.text = (datamgr.datasummary[3].level + 1);
panel[1].txscore3.text = datamgr.datasummary[3].score;
panel[1].txmoney4.text = (datamgr.datasummary[0].level + 1);
panel[1].txscore4.text = datamgr.datasummary[0].score;
tweenmgr.register(panel[0], {live:10, ease:"easeoutcubic", x:0, y:300, alpha:1, rotation:0, scalex:1, scaley:1}, {scope:this, onfinished:startPanel});
tweenmgr.register(panel[1], {live:10, ease:"easeoutcubic", x:0, y:(0 - panel[1].height), alpha:1, rotation:0, scalex:1, scaley:1});
}
private function close(e=null){
admgr.clearCPMAds(panel[0].adbox, false);
pagemgr.loadPage(nextpage);
}
private function stopPanel(e=null){
panel[1].btsave.removeEventListener(MouseEvent.CLICK, goSave);
panel[1].btclose.removeEventListener(MouseEvent.CLICK, goGameStats);
panel[1].btslot1.removeEventListener(MouseEvent.CLICK, selectSlot1);
panel[1].btslot2.removeEventListener(MouseEvent.CLICK, selectSlot2);
panel[1].btslot3.removeEventListener(MouseEvent.CLICK, selectSlot3);
panel[1].btslot4.removeEventListener(MouseEvent.CLICK, selectSlot4);
close();
}
private function selectSlot1(e=null){
panel[1].txsubtitle.text = "Slot 1 Selected";
selectedslot = 1;
panel[1].btslot1.x = -425;
panel[1].btslot2.x = slotpos[2];
panel[1].btslot3.x = slotpos[3];
panel[1].btslot4.x = slotpos[0];
panel[1].mcselectedslot.x = slotpos[1];
soundmgr.playSFX("menuclick");
}
private function selectSlot2(e=null){
panel[1].txsubtitle.text = "Slot 2 Selected";
selectedslot = 2;
panel[1].btslot1.x = slotpos[1];
panel[1].btslot2.x = -425;
panel[1].btslot3.x = slotpos[3];
panel[1].btslot4.x = slotpos[0];
panel[1].mcselectedslot.x = slotpos[2];
soundmgr.playSFX("menuclick");
}
private function selectSlot4(e=null){
panel[1].txsubtitle.text = "Autosave Selected";
selectedslot = 0;
panel[1].btslot1.x = slotpos[1];
panel[1].btslot2.x = slotpos[2];
panel[1].btslot3.x = slotpos[3];
panel[1].btslot4.x = -425;
panel[1].mcselectedslot.x = slotpos[0];
soundmgr.playSFX("menuclick");
}
private function selectSlot3(e=null){
panel[1].txsubtitle.text = "Slot 3 Selected";
selectedslot = 3;
panel[1].btslot1.x = slotpos[1];
panel[1].btslot2.x = slotpos[2];
panel[1].btslot3.x = -425;
panel[1].btslot4.x = slotpos[0];
panel[1].mcselectedslot.x = slotpos[3];
soundmgr.playSFX("menuclick");
}
private function goSave(e){
nextpage = "return";
datamgr.saveData(selectedslot);
stopPanel();
soundmgr.playSFX("menuclick");
}
private function moveClip(e){
if (timer > 0){
timer--;
if ((timer % 3) == 0){
element[((element.length - Math.floor((timer / 3))) - 1)].visible = true;
};
} else {
this.removeEventListener(Event.ENTER_FRAME, moveClip);
};
}
private function startPanel(e){
panel[1].btsave.addEventListener(MouseEvent.CLICK, goSave, false, 0, true);
panel[1].btclose.addEventListener(MouseEvent.CLICK, goGameStats, false, 0, true);
panel[1].btslot1.addEventListener(MouseEvent.CLICK, selectSlot1, false, 0, true);
panel[1].btslot2.addEventListener(MouseEvent.CLICK, selectSlot2, false, 0, true);
panel[1].btslot3.addEventListener(MouseEvent.CLICK, selectSlot3, false, 0, true);
panel[1].btslot4.addEventListener(MouseEvent.CLICK, selectSlot4, false, 0, true);
selectSlot1();
timer = (element.length * 3);
}
private function goGameStats(e){
nextpage = "return";
stopPanel();
soundmgr.playSFX("menuclick");
}
}
}//package
Section 273
//ScenarioManager (ScenarioManager)
package {
public class ScenarioManager {
private var dispatchcounter;
private var level;
private var dispatchfactor;
public var status;
private var cdata;
private var scenectr;
public var mdata;
private var dispatcher;
private var wave;
public function ScenarioManager(_ctr, _lv=0, _nowave=false){
mdata = {blue:{name:"blue", health:10, attack:3, price:15}, yellow:{name:"yellow", health:150, attack:0, price:17}, red:{name:"red", health:100, attack:10, price:25}, black:{name:"black", health:50, attack:50, price:20}, white:{name:"white", health:40, attack:5, price:17}, gray:{name:"gray", health:200, attack:25, price:30}, yellowchild:{name:"yellowchild", health:30, attack:50, price:20, part:"left"}};
cdata = [{wave:[{name:"blue", count:20, interval:1}]}, {wave:[{name:"white", count:3, interval:7}, {name:"blue", count:20, interval:1}]}, {wave:[{name:"white", count:5, interval:7}, {name:"blue", count:30, interval:1}]}, {wave:[{name:"red", count:1, interval:35}, {name:"white", count:5, interval:7}, {name:"blue", count:30, interval:1}]}, {wave:[{name:"red", count:2, interval:25}, {name:"white", count:5, interval:8}, {name:"blue", count:40, interval:1}]}, {wave:[{name:"black", count:2, interval:25}, {name:"red", count:3, interval:10}, {name:"white", count:5, interval:7}, {name:"blue", count:50, interval:1}]}, {wave:[{name:"black", count:4, interval:12}, {name:"red", count:4, interval:10}, {name:"white", count:10, interval:4}, {name:"blue", count:50, interval:1}]}, {wave:[{name:"black", count:4, interval:12}, {name:"red", count:4, interval:10}, {name:"white", count:10, interval:4}, {name:"blue", count:50, interval:1}]}, {wave:[{name:"black", count:5, interval:23}, {name:"red", count:5, interval:24}, {name:"white", count:30, interval:4}, {name:"blue", count:75, interval:1}]}, {wave:[{name:"black", count:6, interval:20}, {name:"red", count:6, interval:20}, {name:"white", count:30, interval:4}, {name:"blue", count:75, interval:1}]}, {wave:[{name:"black", count:10, interval:13}, {name:"red", count:10, interval:13}, {name:"white", count:30, interval:4}, {name:"blue", count:75, interval:1}]}, {wave:[{name:"black", count:15, interval:9}, {name:"red", count:15, interval:9}, {name:"white", count:30, interval:5}, {name:"blue", count:75, interval:1}]}, {wave:[{name:"yellow", count:5, interval:28}, {name:"black", count:15, interval:9}, {name:"red", count:15, interval:9}, {name:"white", count:30, interval:5}, {name:"blue", count:75, interval:1}]}, {wave:[{name:"yellow", count:7, interval:20}, {name:"black", count:15, interval:9}, {name:"red", count:15, interval:9}, {name:"white", count:30, interval:5}, {name:"blue", count:75, interval:1}]}, {wave:[{name:"yellow", count:10, interval:13}, {name:"black", count:15, interval:9}, {name:"red", count:15, interval:9}, {name:"white", count:30, interval:5}, {name:"blue", count:75, interval:1}]}, {wave:[{name:"yellow", count:5, interval:13}, {name:"black", count:7, interval:9}, {name:"red", count:7, interval:9}, {name:"white", count:15, interval:5}, {name:"blue", count:30, interval:1}]}, {wave:[{name:"yellow", count:15, interval:10}, {name:"black", count:20, interval:8}, {name:"red", count:15, interval:10}, {name:"white", count:30, interval:5}, {name:"blue", count:75, interval:1}]}, {wave:[{name:"yellow", count:20, interval:8}, {name:"black", count:20, interval:8}, {name:"red", count:15, interval:10}, {name:"white", count:30, interval:5}, {name:"blue", count:75, interval:1}]}, {wave:[{name:"gray", count:5, interval:33}, {name:"yellow", count:20, interval:8}, {name:"black", count:20, interval:8}, {name:"red", count:15, interval:10}, {name:"white", count:30, interval:5}, {name:"blue", count:75, interval:1}]}, {wave:[{name:"gray", count:10, interval:18}, {name:"yellow", count:20, interval:8}, {name:"black", count:20, interval:8}, {name:"red", count:15, interval:10}, {name:"white", count:30, interval:5}, {name:"blue", count:75, interval:1}]}, {wave:[{name:"gray", count:10, interval:18}, {name:"yellow", count:20, interval:9}, {name:"black", count:20, interval:9}, {name:"red", count:15, interval:12}, {name:"white", count:40, interval:5}, {name:"blue", count:75, interval:1}]}, {wave:[{name:"gray", count:15, interval:13}, {name:"yellow", count:20, interval:10}, {name:"black", count:20, interval:10}, {name:"red", count:25, interval:8}, {name:"white", count:40, interval:5}, {name:"blue", count:75, interval:1}]}, {wave:[{name:"gray", count:20, interval:11}, {name:"yellow", count:25, interval:9}, {name:"black", count:25, interval:9}, {name:"red", count:30, interval:7}, {name:"white", count:40, interval:5}, {name:"blue", count:75, interval:1}]}, {wave:[{name:"gray", count:10, interval:11}, {name:"yellow", count:12, interval:9}, {name:"black", count:12, interval:9}, {name:"red", count:15, interval:7}, {name:"white", count:20, interval:5}, {name:"blue", count:35, interval:1}]}, {wave:[]}];
super();
scenectr = _ctr;
level = (_lv % cdata.length);
dispatchfactor = 1;
if (_nowave){
generateWave(new Array());
} else {
generateWave(cdata[level].wave);
};
}
public function moveClip(){
var res:*;
if (status != "completed"){
dispatcher--;
if ((((dispatcher == 0)) && ((status == "idle")))){
if (Math.random() < (((level / cdata.length) / 2) + 0.1)){
dispatcher = ((20 - Math.floor((level / 2))) + Math.floor((Math.random() * 10)));
} else {
dispatcher = ((40 - Math.floor((level / 2))) + Math.floor((Math.random() * 30)));
};
dispatcher = (dispatcher * dispatchfactor);
res = dispatch();
if (!res){
status = "finished";
};
};
if (scenectr.numChildren > 0){
sortMouse();
} else {
if (status == "finished"){
status = "completed";
};
};
};
}
public function stopWave(){
var i:*;
var obj:*;
dispatchcounter = wave.length;
i = 0;
while (i < scenectr.length) {
obj = scenectr.getChildAt(i);
obj.hit(obj.maxhealth);
i++;
};
}
public function generateWave(_wave, _factor=1){
var i:*;
var j:*;
var cnt:*;
var fill:*;
var res:*;
var rescnt:*;
dispatchfactor = _factor;
res = new Array();
rescnt = new Array();
if (_wave.length == 0){
status = "finished";
return (res);
};
cnt = 0;
i = 0;
while (i < _wave.length) {
cnt = (cnt + _wave[i].count);
rescnt.push(0);
i++;
};
i = 0;
while (i < cnt) {
fill = false;
j = 0;
while (j < _wave.length) {
if ((((_wave[j].count > rescnt[j])) && ((Math.floor((i / _wave[j].interval)) > rescnt[j])))){
res.push(_wave[j].name);
var _local9 = rescnt;
var _local10 = j;
var _local11 = (_local9[_local10] + 1);
_local9[_local10] = _local11;
fill = true;
i++;
};
j++;
};
if (!fill){
fill = false;
j = (_wave.length - 1);
while (!(fill)) {
if (_wave[j].count > rescnt[j]){
res.push(_wave[j].name);
_local9 = rescnt;
_local10 = j;
_local11 = (_local9[_local10] + 1);
_local9[_local10] = _local11;
fill = true;
i++;
};
j--;
};
};
};
dispatcher = 30;
dispatchcounter = 0;
status = "idle";
wave = res;
}
public function manualDispatch(_name, _pos){
var o:*;
var p:*;
var i:*;
var d:*;
switch (_name){
case "yellowchild":
d = mdata["yellowchild"];
d.part = "left";
o = new MouseBase(d);
o.x = (_pos[0] - 20);
o.y = _pos[1];
o.moveright = false;
o.setScale();
scenectr.addChild(o);
d.part = "right";
o = new MouseBase(d);
o.x = (_pos[0] + 20);
o.y = _pos[1];
o.moveright = true;
o.setScale();
scenectr.addChild(o);
break;
};
}
public function sortMouse(){
var o:*;
var p:*;
var i:*;
var j:*;
if (scenectr.numChildren > 1){
j = (scenectr.numChildren - 1);
while (j < 0) {
i = (j - 1);
o = scenectr.getChildAt(j);
p = scenectr.getChildAt(i);
if (p.name != o.name){
while (i > -1) {
p = scenectr.getChildAt(i);
if (p.width > o.width){
scenectr.setChildIndex(o, i);
scenectr.setChildIndex(p, j);
o = p;
};
i--;
};
} else {
while (i > -1) {
p = scenectr.getChildAt(i);
if (p.y > o.y){
scenectr.setChildIndex(o, i);
scenectr.setChildIndex(p, j);
o = p;
};
i--;
};
};
j--;
};
};
}
private function dispatch():Boolean{
var res:*;
var o:*;
var p:*;
var i:*;
res = false;
if (dispatchcounter < wave.length){
o = new MouseBase(mdata[wave[dispatchcounter]]);
scenectr.addChild(o);
dispatchcounter = (dispatchcounter + 1);
res = true;
};
return (res);
}
}
}//package
Section 274
//SceneManager (SceneManager)
package {
import flash.events.*;
import flash.display.*;
import defclass.tweener.*;
import defclass.utils.*;
import flash.geom.*;
import flash.ui.*;
public class SceneManager extends MovieClip {
private var targetshot;
private var datamgr;
public var bosslevel;
private var targettimer;
public var levelaccuracymoney;
public var wavemgr;
public var levelmiss;
public var levelaccuracy;
public var statustimer;
private var targetpoint;
private var showpointer;
private var soundmgr;
public var levelkill;
private var maintimeline;
public var levelkillmoney;
private var pagemgr;
public var levelfence;
public var fencevar;
private var layer;
public var level;
public var bossmgr;
public var levelscore;
public var levelhit;
public var weaponvar;
public var leveltotalkill;
public var levelfencemoney;
public var levelmoney;
private var ctrlmgr;
private var tweenmgr;
public var phantvar;
public var status;
public function SceneManager(_mtl){
super();
maintimeline = _mtl;
ctrlmgr = maintimeline.ctrlmgr;
tweenmgr = maintimeline.tweenmgr;
soundmgr = maintimeline.soundmgr;
datamgr = maintimeline.datamgr;
pagemgr = maintimeline.pagemgr;
weaponvar = maintimeline.weaponvar;
fencevar = maintimeline.fencevar;
phantvar = maintimeline.phantvar;
weaponvar.resetMagazines(datamgr.weaponupgrade, datamgr.ammo);
if (datamgr.equipped[1] != ""){
weaponvar.setWeapon(datamgr.equipped[1], datamgr.weaponupgrade[datamgr.equipped[1]], datamgr.ammo);
} else {
weaponvar.setWeapon(datamgr.equipped[0], datamgr.weaponupgrade[datamgr.equipped[0]], datamgr.ammo);
};
fencevar.setFence(datamgr.fence, datamgr.fenceupgrade);
phantvar.setElephant(datamgr.phantupgrade);
initData();
initLayers();
initWeaponSkin();
refreshPanel();
level = datamgr.level;
if (level < 100){
wavemgr = new ScenarioManager(layer["mouse"], level);
} else {
level = Math.floor((datamgr.level / 100));
wavemgr = new ScenarioManager(layer["mouse"], level, true);
};
status = "paused";
showpointer = true;
}
private function createBulletPart(_pos){
var obj:*;
obj = new BulletPart(tweenmgr, _pos);
layer["deadmouse"].addChild(obj);
}
public function prevWeapon(){
var i:*;
var j:*;
i = datamgr.equipped.indexOf(weaponvar["current"]);
i = ((i)>0) ? (i - 1) : 2;
if (datamgr.equipped[i] == ""){
i = ((i)>0) ? (i - 1) : 2;
};
if (datamgr.equipped[i] == ""){
i = ((i)>0) ? (i - 1) : 2;
};
weaponvar.setWeapon(datamgr.equipped[i], datamgr.weaponupgrade[datamgr.equipped[i]], datamgr.ammo);
initWeaponSkin();
}
public function refreshEffect(){
var hit:*;
var obj:*;
var i:*;
i = (layer["mouse"].numChildren - 1);
while (i > -1) {
obj = layer["mouse"].getChildAt(i);
obj.moveClip();
if (obj.name != "white"){
hit = layer["trap"].detectHit(obj);
} else {
hit = "";
};
if (hit != ""){
obj.setTrapEffect(hit, weaponvar.weapons[hit].damage[0]);
if (hit == "trap1"){
createBloodSplat("trapexplode", [obj.x, obj.y]);
detectMouseExplode(weaponvar.weapons[hit].damage[0], [obj.x, obj.y]);
pagemgr.shakeScreen(20);
};
};
if (obj.status == "attacking"){
fencevar["health"] = (fencevar["health"] - obj.damage);
if (fencevar["health"] < 0){
fencevar["health"] = 0;
};
if (obj.name != "gray"){
obj.hit(fencevar["damage"]);
createBloodSplat(obj.name, [obj.x, obj.y]);
};
} else {
if (obj.status == "dead"){
layer["mouse"].removeChild(obj);
layer["deadmouse"].addChild(obj);
switch (obj.name){
case "black":
createBloodSplat("mouseexplode", [obj.x, obj.y]);
detectMouseExplode(obj.damage, [obj.x, obj.y]);
pagemgr.shakeScreen(20);
break;
case "gray":
createBloodSplat("mouseexplode", [obj.x, obj.y]);
detectMouseExplode(obj.damage, [obj.x, obj.y]);
pagemgr.shakeScreen(20);
break;
case "yellow":
wavemgr.manualDispatch("yellowchild", [obj.x, obj.y]);
break;
};
};
};
i--;
};
i = (layer["deadmouse"].numChildren - 1);
while (i > -1) {
obj = layer["deadmouse"].getChildAt(i);
if ((((((obj.name == "blood")) || ((obj.name == "goo")))) || ((obj.name == "purple")))){
obj.alpha = (obj.alpha - 0.01);
if (obj.alpha < 0.3){
layer["deadmouse"].removeChild(obj);
layer["gore"].drawChild(obj);
};
} else {
if (obj.name == "hole"){
obj.alpha = (obj.alpha - 0.1);
if (obj.alpha < 0.7){
layer["deadmouse"].removeChild(obj);
layer["gore"].drawChild(obj);
};
} else {
if (obj.name == "bulletpart"){
if (obj.status == "finished"){
layer["deadmouse"].removeChild(obj);
layer["gore"].drawChild(obj);
};
} else {
obj.alpha = (obj.alpha - 0.01);
if (obj.moveClip){
obj.moveClip();
};
if (obj.alpha < 0.1){
layer["deadmouse"].removeChild(obj);
};
};
};
};
i--;
};
i = (layer["shooteffect"].numChildren - 1);
while (i > -1) {
obj = layer["shooteffect"].getChildAt(i);
if (obj.name == "shottrail"){
obj.alpha = (obj.alpha - 0.6);
if (obj.alpha < 0.1){
layer["shooteffect"].removeChild(obj);
};
} else {
if (obj.name == "rpgbullet"){
if (obj.status == "finished"){
layer["shooteffect"].removeChild(obj);
createBloodSplat("rpgexplode", [obj.x, obj.y]);
detectBulletExplode(obj.damage, [obj.x, obj.y]);
pagemgr.shakeScreen(20);
};
} else {
if (obj.name == "explode"){
if (obj.currentFrame == obj.totalFrames){
layer["shooteffect"].removeChild(obj);
};
} else {
obj.alpha = (obj.alpha - 0.2);
if (obj.alpha < 0.1){
layer["shooteffect"].removeChild(obj);
};
};
};
};
i--;
};
}
private function createBloodSplat(_name, _bt){
var skin1:*;
var skin2:*;
var rnd1:*;
var rnd2:*;
rnd1 = Math.random();
rnd2 = Math.random();
switch (_name){
case "boss1":
case "boss2":
if (rnd1 < (1 / 4)){
skin1 = new mc_can_splat1();
} else {
if (rnd1 < (2 / 4)){
skin1 = new mc_can_splat2();
} else {
if (rnd1 < (3 / 4)){
skin1 = new mc_can_splat3();
} else {
skin1 = new mc_can_splat4();
};
};
};
skin1.name = "can";
skin2 = null;
break;
case "boss3":
if (rnd1 < (1 / 3)){
skin1 = new mc_goo_splat1();
} else {
if (rnd1 < (2 / 3)){
skin1 = new mc_goo_splat2();
} else {
skin1 = new mc_goo_splat3();
};
};
skin1.name = "goo";
skin2 = null;
break;
case "dirt":
if (rnd1 < (1 / 4)){
skin1 = new mc_dirt_splat1();
} else {
if (rnd1 < (2 / 4)){
skin1 = new mc_dirt_splat2();
} else {
if (rnd1 < (3 / 4)){
skin1 = new mc_dirt_splat3();
} else {
skin1 = new mc_dirt_splat4();
};
};
};
skin1.name = "dirt";
skin2 = new mc_bullethole();
skin2.name = "hole";
break;
case "trapexplode":
skin1 = null;
skin2 = new mc_explosionhole();
skin2.name = "hole";
break;
case "mouseexplode":
skin1 = new mc_explosion1();
skin1.name = "explode";
skin2 = new mc_explosionhole();
skin2.name = "hole";
break;
case "rpgexplode":
skin1 = new mc_explosion1();
skin1.name = "explode";
skin2 = new mc_explosionhole();
skin2.name = "hole";
break;
case "yellow":
if (rnd1 < (1 / 3)){
skin1 = new mc_goo_splat1();
} else {
if (rnd1 < (2 / 3)){
skin1 = new mc_goo_splat2();
} else {
skin1 = new mc_goo_splat3();
};
};
skin1.name = "goo";
if (rnd2 < (1 / 4)){
skin2 = new mc_mouse_goo1();
} else {
if (rnd2 < (2 / 4)){
skin2 = new mc_mouse_goo2();
} else {
if (rnd2 < (3 / 4)){
skin2 = new mc_mouse_goo3();
} else {
skin2 = new mc_mouse_goo4();
};
};
};
skin2.name = "goo";
break;
case "yellowchild":
if (rnd1 < (1 / 3)){
skin1 = new mc_goo_splat1();
} else {
if (rnd1 < (2 / 3)){
skin1 = new mc_goo_splat2();
} else {
skin1 = new mc_goo_splat3();
};
};
skin1.name = "goo";
if (rnd2 < (1 / 4)){
skin2 = new mc_mouse_goo1();
} else {
if (rnd2 < (2 / 4)){
skin2 = new mc_mouse_goo2();
} else {
if (rnd2 < (3 / 4)){
skin2 = new mc_mouse_goo3();
} else {
skin2 = new mc_mouse_goo4();
};
};
};
skin2.name = "goo";
break;
case "black":
if (rnd1 < (1 / 4)){
skin1 = new mc_purple_splat1();
} else {
if (rnd1 < (2 / 4)){
skin1 = new mc_purple_splat2();
} else {
if (rnd1 < (3 / 4)){
skin1 = new mc_purple_splat3();
} else {
skin1 = new mc_purple_splat4();
};
};
};
skin1.name = "purple";
if (rnd2 < (1 / 3)){
skin2 = new mc_mouse_purple1();
} else {
if (rnd2 < (2 / 3)){
skin2 = new mc_mouse_purple2();
} else {
skin2 = new mc_mouse_purple3();
};
};
skin2.name = "purple";
break;
case "gray":
if (rnd1 < (1 / 4)){
skin1 = new mc_can_splat1();
} else {
if (rnd1 < (2 / 4)){
skin1 = new mc_can_splat2();
} else {
if (rnd1 < (3 / 4)){
skin1 = new mc_can_splat3();
} else {
skin1 = new mc_can_splat4();
};
};
};
skin1.name = "can";
if (rnd2 < (1 / 3)){
skin2 = new mc_mouse_purple1();
} else {
if (rnd2 < (2 / 3)){
skin2 = new mc_mouse_purple2();
} else {
skin2 = new mc_mouse_purple3();
};
};
skin2.name = "purple";
break;
default:
if (rnd1 < (1 / 6)){
skin1 = new mc_blood_splat1();
} else {
if (rnd1 < (2 / 6)){
skin1 = new mc_blood_splat2();
} else {
if (rnd1 < (3 / 6)){
skin1 = new mc_blood_splat3();
} else {
if (rnd1 < (4 / 6)){
skin1 = new mc_blood_splat4();
} else {
if (rnd1 < (5 / 6)){
skin1 = new mc_blood_splat5();
} else {
skin1 = new mc_blood_splat6();
};
};
};
};
};
skin1.name = "blood";
if (rnd2 < (1 / 3)){
skin2 = new mc_mouse_dead1();
} else {
if (rnd2 < (2 / 3)){
skin2 = new mc_mouse_dead2();
} else {
skin2 = new mc_mouse_dead3();
};
};
skin2.name = "blood";
break;
};
if (skin1){
skin1.x = _bt[0];
skin1.y = _bt[1];
if (_name == "yellowchild"){
skin1.scaleX = (getScale(skin1.y, 0.2, 0.6) / 2);
skin1.scaleY = (getScale(skin1.y, 0.2, 0.6) / 2);
} else {
skin1.scaleX = getScale(skin1.y, 0.2, 0.6);
skin1.scaleY = getScale(skin1.y, 0.2, 0.6);
};
layer["shooteffect"].addChild(skin1);
};
if (skin2){
if (_bt[1] > 100){
skin2.x = _bt[0];
skin2.y = _bt[1];
if (_name == "yellowchild"){
skin2.scaleX = (getScale(skin2.y) / 2);
skin2.scaleY = (getScale(skin2.y) / 2);
} else {
skin2.scaleX = getScale(skin2.y);
skin2.scaleY = getScale(skin2.y);
};
layer["deadmouse"].addChild(skin2);
};
};
}
private function initLayers(){
layer = new Array();
layer["backscene"] = new mc_sceneback();
layer["gore"] = new PermanentDraw(425, 525);
layer["deadmouse"] = new MovieClip();
layer["trap"] = new TrapDropper(new mc_trap_layer(), new Rectangle(0, 200, 425, 120));
layer["mouse"] = new MovieClip();
layer["fence"] = fencevar.skin;
layer["frontscene"] = new mc_scenefront();
layer["boss"] = new MovieClip();
layer["elephant"] = new MovieClip();
layer["elephant"].x = 230;
layer["elephant"].y = 495;
layer["shooteffect"] = new MovieClip();
layer["target"] = new mc_targetpoint();
layer["target"].x = 210;
layer["target"].y = 260;
layer["panel"] = new GamePanel(tweenmgr, datamgr, weaponvar);
layer["panel"].setHealthInstant(fencevar["health"], fencevar["healthmax"]);
layer["panel"].setDay((datamgr.level + 1));
if (soundmgr.sfxvolume == 0){
layer["panel"].soundOff();
} else {
layer["panel"].soundOn();
};
if (soundmgr.bgmvolume == 0){
layer["panel"].musicOff();
} else {
layer["panel"].musicOn();
};
layer["panel"].skin.btsfxon.addEventListener(MouseEvent.CLICK, soundOff, false, 0, true);
layer["panel"].skin.btbgmon.addEventListener(MouseEvent.CLICK, musicOff, false, 0, true);
layer["panel"].skin.btsfxoff.addEventListener(MouseEvent.CLICK, soundOn, false, 0, true);
layer["panel"].skin.btbgmoff.addEventListener(MouseEvent.CLICK, musicOn, false, 0, true);
layer["panel"].skin.btweapon1.addEventListener(MouseEvent.CLICK, setWeaponFromPanel, false, 0, true);
layer["panel"].skin.btweapon2.addEventListener(MouseEvent.CLICK, setWeaponFromPanel, false, 0, true);
layer["panel"].skin.btweapon3.addEventListener(MouseEvent.CLICK, setWeaponFromPanel, false, 0, true);
layer["panel"].skin.btweapon4.addEventListener(MouseEvent.CLICK, setWeaponFromPanel, false, 0, true);
layer["panel"].skin.btweapon5.addEventListener(MouseEvent.CLICK, setWeaponFromPanel, false, 0, true);
layer["panel"].skin.btweapon6.addEventListener(MouseEvent.CLICK, setWeaponFromPanel, false, 0, true);
while (this.numChildren > 0) {
this.removeChildAt(0);
};
this.addChild(layer["backscene"]);
this.addChild(layer["gore"]);
this.addChild(layer["deadmouse"]);
this.addChild(layer["trap"]);
this.addChild(layer["mouse"]);
this.addChild(layer["fence"]);
this.addChild(layer["frontscene"]);
this.addChild(layer["boss"]);
this.addChild(layer["elephant"]);
this.addChild(layer["shooteffect"]);
this.addChild(layer["target"]);
this.addChild(layer["panel"]);
}
private function createBoss(){
if (!bossmgr){
if (level == 7){
bossmgr = new DataBoss(wavemgr, "boss1");
} else {
if (level == 15){
bossmgr = new DataBoss(wavemgr, "boss2");
} else {
if (level == 23){
bossmgr = new DataBoss(wavemgr, "boss3");
} else {
if (level == 24){
bossmgr = new DataBoss(wavemgr, "boss1");
};
};
};
};
layer["boss"].addChild(bossmgr);
layer["panel"].startBoss();
} else {
if (level == 24){
if (bossmgr.name == "boss1"){
if (layer["boss"].contains(bossmgr)){
layer["boss"].removeChild(bossmgr);
};
bossmgr = new DataBoss(wavemgr, "boss2");
layer["boss"].addChild(bossmgr);
layer["panel"].startBoss();
} else {
if (bossmgr.name == "boss2"){
if (layer["boss"].contains(bossmgr)){
layer["boss"].removeChild(bossmgr);
};
bossmgr = new DataBoss(wavemgr, "boss3");
layer["boss"].addChild(bossmgr);
layer["panel"].startBoss();
} else {
if (bossmgr.name == "boss3"){
statustimer = 30;
layer["panel"].stopBoss();
};
};
};
};
};
}
private function calcWeaponVar(){
layer["target"].x = (layer["target"].x + ((targetpoint[0] - layer["target"].x) * 0.7));
layer["target"].y = (layer["target"].y + ((targetpoint[1] - layer["target"].y) * 0.7));
if (layer["target"].rotation > 1){
layer["target"].scaleX = (layer["target"].scaleX + 0.03);
layer["target"].scaleY = (layer["target"].scaleY + 0.03);
layer["target"].rotation = (layer["target"].rotation - 1);
} else {
layer["target"].scaleX = 1;
layer["target"].scaleY = 1;
layer["target"].rotation = 0;
};
if (weaponvar["rate"] > 0){
var _local1 = weaponvar;
var _local2 = "rate";
var _local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
};
if (weaponvar["heat"] > 0){
if (weaponvar["shoot"]){
weaponvar["heat"] = (weaponvar["heat"] - weaponvar["heatdec"]);
} else {
weaponvar["heat"] = (weaponvar["heat"] - (weaponvar["heatdec"] * 2));
};
};
if (weaponvar["reloadtime"] > 0){
_local1 = weaponvar;
_local2 = "reloadtime";
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (weaponvar["reloadtime"] == 0){
initWeaponSkin();
if (weaponvar["bullettotal"] > -1){
weaponvar["bulletmagz"] = ((weaponvar["bullettotal"])>=weaponvar["bulletmagzmax"]) ? weaponvar["bulletmagzmax"] : weaponvar["bullettotal"];
weaponvar["bullettotal"] = ((weaponvar["bullettotal"])>weaponvar["bulletmagzmax"]) ? (weaponvar["bullettotal"] - weaponvar["bulletmagzmax"]) : 0;
} else {
weaponvar["bulletmagz"] = weaponvar["bulletmagzmax"];
};
};
};
weaponvar["shoot"] = false;
}
public function shootTarget(_x, _y){
var i:*;
var pt:*;
var hit:*;
var bltcount:*;
targetpoint = [_x, _y];
targetshot = [_x, _y];
if ((((((status == "playing")) && (showpointer))) && (!((layer["trap"].status == "waiting"))))){
if (isWeaponReady()){
layer["target"].scaleX = 0.7;
layer["target"].scaleY = 0.7;
layer["target"].rotation = 10;
weaponvar["skin"].gotoAndPlay(2);
targetpoint = [_x, _y];
hit = false;
if (weaponvar["type"] == "Shotgun"){
bltcount = (Math.floor((Math.random() * 2)) + 3);
i = 0;
while (i < bltcount) {
targetshot[0] = (_x + (((((Math.random() * weaponvar["damage"]) * 2) - weaponvar["damage"]) * weaponvar["shock"]) * phantvar["anger"]));
targetshot[1] = (_y - ((((Math.random() * weaponvar["damage"]) * 2) * weaponvar["shock"]) * phantvar["anger"]));
if (hit){
detectBulletTarget(false);
} else {
hit = detectBulletTarget(true);
};
i++;
};
if (hit){
levelhit++;
} else {
levelmiss++;
soundmgr.playSFX("concrete");
};
createBulletPart([layer["elephant"].x, (layer["elephant"].y - 40)]);
} else {
if (weaponvar["type"] == "Grenade Launcher"){
targetshot[0] = (_x + (((Math.random() * (20 - 10)) * weaponvar["shock"]) * phantvar["anger"]));
targetshot[1] = (_y - ((((Math.random() * 10) * 2) * weaponvar["shock"]) * phantvar["anger"]));
levelhit++;
levelmiss++;
pt = layer["elephant"].localToGlobal(new Point(layer["elephant"].getChildAt(0).bulletstart.x, layer["elephant"].getChildAt(0).bulletstart.y));
createRPGBullet(weaponvar["damage"], [pt.x, pt.y], targetshot);
} else {
targetshot[0] = (_x + (((((Math.random() * weaponvar["damage"]) * 2) - weaponvar["damage"]) * weaponvar["shock"]) * phantvar["anger"]));
targetshot[1] = (_y - ((((Math.random() * weaponvar["damage"]) * 2) * weaponvar["shock"]) * phantvar["anger"]));
hit = detectBulletTarget();
if (hit){
levelhit++;
} else {
levelmiss++;
soundmgr.playSFX("concrete");
};
createBulletPart([layer["elephant"].x, (layer["elephant"].y - 40)]);
};
};
if (weaponvar["current"] == "minigun"){
soundmgr.playSFX("minigun");
} else {
if (weaponvar["type"] == "Shotgun"){
soundmgr.playSFX("shotgun");
} else {
if (weaponvar["type"] == "Submachine Gun"){
soundmgr.playSFX("submachine");
} else {
soundmgr.playSFX("shoot");
};
};
};
weaponvar["rate"] = weaponvar["ratemax"];
weaponvar["heat"] = (weaponvar["heat"] + weaponvar["heatinc"]);
var _local7 = weaponvar;
var _local8 = "bulletmagz";
var _local9 = (_local7[_local8] - 1);
_local7[_local8] = _local9;
if ((((weaponvar["bulletmagz"] == 0)) && (!((weaponvar["bullettotal"] == 0))))){
reloadWeapon();
if (weaponvar["type"] == "Shotgun"){
soundmgr.playSFX("reloadshotgun");
} else {
soundmgr.playSFX("reload");
};
} else {
if (weaponvar["bullettotal"] == 0){
prevWeapon();
};
};
weaponvar["shoot"] = true;
} else {
soundmgr.playSFX("empty");
weaponvar["shoot"] = false;
};
} else {
if (layer["trap"].status == "waiting"){
layer["trap"].stopClip();
if (layer["trap"].status == "finished"){
if (datamgr.weaponbought[layer["trap"].pointername]){
_local7 = datamgr.weaponbought;
_local8 = layer["trap"].pointername;
_local9 = (_local7[_local8] - 1);
_local7[_local8] = _local9;
};
if (datamgr.weaponbought[layer["trap"].pointername] < 0){
datamgr.weaponbought[layer["trap"].pointername] = 0;
};
};
};
};
}
public function setTarget(_x, _y){
targetpoint = [_x, _y];
targetshot = [_x, _y];
}
private function createRPGBullet(_dmg, _start, _end){
var obj:*;
obj = new RPGBulletPart(_dmg, _start, _end);
layer["shooteffect"].addChild(obj);
}
private function detectMouseExplode(_dmg, _pos){
var i:*;
var r:*;
var sc:*;
var obj:*;
var hit:*;
sc = getScale(_pos[1], 0.1, 1);
hit = false;
i = 0;
while (i < layer["mouse"].numChildren) {
obj = layer["mouse"].getChildAt(i);
r = (MathVect.getDistance(_pos[0], _pos[1], obj.x, obj.y) * sc);
if (r < (75 * sc)){
hit = true;
if (obj.health > 0){
obj.hit(_dmg);
createBloodSplat(obj.name, [obj.x, obj.y]);
if (obj.health == 0){
leveltotalkill++;
if (levelkill[obj.name]){
var _local8 = levelkill;
var _local9 = obj.name;
var _local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
} else {
levelkill[obj.name] = 1;
};
};
};
};
i++;
};
soundmgr.playSFX("boom");
}
public function moveClip(){
if (weaponvar["skin"].currentFrame == 1){
weaponvar["skin"].stop();
};
switch (status){
case "startboss":
createBoss();
fencevar.moveClip();
wavemgr.moveClip();
calcWeaponVar();
calcElephantPos();
refreshPanel();
refreshEffect();
detectStatusTimer();
break;
case "playing":
if (bossmgr){
bossmgr.moveClip();
if (bossmgr.status == "attacking"){
fencevar["health"] = (fencevar["health"] - bossmgr.damage);
if (fencevar["health"] < 0){
fencevar["health"] = 0;
};
pagemgr.shakeScreen(bossmgr.damage);
};
};
fencevar.moveClip();
wavemgr.moveClip();
calcWeaponVar();
calcElephantPos();
refreshPanel();
refreshEffect();
detectStatusTimer();
layer["trap"].moveClip(targetpoint);
break;
};
}
private function saveData(_win=true){
var i:*;
var key:*;
leveltotalkill = 0;
for (key in levelkill) {
leveltotalkill = (leveltotalkill + levelkill[key]);
if (key == "boss1"){
levelkillmoney = (levelkillmoney + Math.floor((2500 * phantvar["payment"])));
} else {
if (key == "boss2"){
levelkillmoney = (levelkillmoney + Math.floor((5000 * phantvar["payment"])));
} else {
if (key == "boss3"){
levelkillmoney = (levelkillmoney + Math.floor((10000 * phantvar["payment"])));
} else {
levelkillmoney = (levelkillmoney + Math.floor(((levelkill[key] * wavemgr.mdata[key].price) * phantvar["payment"])));
};
};
};
};
if ((levelhit + levelmiss) > 0){
levelaccuracy = Math.floor(((levelhit / (levelhit + levelmiss)) * 100));
} else {
levelaccuracy = 0;
};
if (_win){
levelkillmoney = (levelkillmoney + Math.floor(leveltotalkill));
levelaccuracymoney = Math.floor(((levelaccuracy * 2) + levelaccuracy));
levelfence = Math.floor(((fencevar["health"] / fencevar["healthmax"]) * 100));
levelfencemoney = Math.floor(((levelfence * 2) + levelfence));
levelmoney = Math.floor(((levelkillmoney + levelaccuracymoney) + levelfencemoney));
levelscore = levelmoney;
} else {
fencevar["health"] = datamgr.fence;
levelkillmoney = (levelkillmoney + Math.floor((leveltotalkill / 2)));
levelaccuracymoney = Math.floor((((levelaccuracy * 2) + levelaccuracy) / 2));
levelfence = 0;
levelfencemoney = 0;
levelmoney = Math.floor(((levelkillmoney + levelaccuracymoney) + levelfencemoney));
levelscore = levelmoney;
};
datamgr.commitLevelData(this, _win);
}
private function initData(){
targetpoint = [210, 260];
statustimer = 0;
leveltotalkill = 0;
levelkill = new Array();
levelkillmoney = 0;
levelhit = 0;
levelmiss = 0;
levelaccuracy = 0;
levelaccuracymoney = 0;
levelfence = 0;
levelfencemoney = 0;
levelmoney = 0;
}
private function initWeaponSkin(){
while (layer["elephant"].numChildren > 0) {
layer["elephant"].removeChildAt(0);
};
layer["elephant"].addChild(weaponvar["skin"]);
weaponvar["skin"].gotoAndStop(1);
}
private function musicOn(e){
layer["panel"].musicOn();
soundmgr.adjustBGM(1);
soundmgr.playSFX("menuclick");
}
public function nextWeapon(){
var i:*;
var j:*;
i = datamgr.equipped.indexOf(weaponvar["current"]);
i = ((i + 1) % 3);
if (datamgr.equipped[i] == ""){
i = ((i + 1) % 3);
};
if (datamgr.equipped[i] == ""){
i = ((i + 1) % 3);
};
weaponvar.setWeapon(datamgr.equipped[i], datamgr.weaponupgrade[datamgr.equipped[i]], datamgr.ammo);
initWeaponSkin();
}
private function setWeaponFromPanel(e){
if (e.target == layer["panel"].skin.btweapon1){
setWeapon(0);
} else {
if (e.target == layer["panel"].skin.btweapon2){
setWeapon(1);
} else {
if (e.target == layer["panel"].skin.btweapon3){
setWeapon(2);
} else {
if (e.target == layer["panel"].skin.btweapon4){
layer["trap"].startClip("trap1");
} else {
if (e.target == layer["panel"].skin.btweapon5){
layer["trap"].startClip("trap2");
} else {
if (e.target == layer["panel"].skin.btweapon6){
layer["trap"].startClip("trap3");
};
};
};
};
};
};
}
public function reloadWeapon(){
if (weaponvar["bullettotal"] != 0){
weaponvar["reloadtime"] = weaponvar["reloadrate"];
initReloadSkin();
};
}
private function musicOff(e){
layer["panel"].musicOff();
soundmgr.adjustBGM(0);
soundmgr.playSFX("menuclick");
}
private function soundOn(e){
layer["panel"].soundOn();
soundmgr.adjustSFX(1);
soundmgr.playSFX("menuclick");
}
public function setWeapon(_idx){
if (_idx < 3){
if (datamgr.equipped[_idx] != ""){
weaponvar.setWeapon(datamgr.equipped[_idx], datamgr.weaponupgrade[datamgr.equipped[_idx]], datamgr.ammo);
initWeaponSkin();
};
} else {
if (_idx == 3){
if (datamgr.weaponbought["trap1"]){
layer["trap"].startClip("trap1");
};
} else {
if (_idx == 4){
if (datamgr.weaponbought["trap2"]){
layer["trap"].startClip("trap2");
};
} else {
if (_idx == 5){
if (datamgr.weaponbought["trap3"]){
layer["trap"].startClip("trap3");
};
};
};
};
};
if (weaponvar["bulletmagz"] == 0){
weaponvar["reloadtime"] = weaponvar["reloadrate"];
initWeaponSkin();
if (weaponvar["bullettotal"] > -1){
weaponvar["bulletmagz"] = ((weaponvar["bullettotal"])>=weaponvar["bulletmagzmax"]) ? weaponvar["bulletmagzmax"] : weaponvar["bullettotal"];
weaponvar["bullettotal"] = ((weaponvar["bullettotal"])>weaponvar["bulletmagzmax"]) ? (weaponvar["bullettotal"] - weaponvar["bulletmagzmax"]) : 0;
} else {
weaponvar["bulletmagz"] = weaponvar["bulletmagzmax"];
};
};
}
private function isWeaponReady():Boolean{
return ((((((((weaponvar["rate"] == 0)) && ((weaponvar["heat"] < weaponvar["heatmax"])))) && ((weaponvar["reloadtime"] == 0)))) && ((weaponvar["bulletmagz"] > 0))));
}
private function detectBulletTarget(_blood=true):Boolean{
var i:*;
var hit:*;
var can:*;
var obj:*;
var blt:*;
var pt:*;
pt = layer["elephant"].localToGlobal(new Point(layer["elephant"].getChildAt(0).bulletstart.x, layer["elephant"].getChildAt(0).bulletstart.y));
blt = new mc_shottrail();
blt.x = pt.x;
blt.y = pt.y;
blt.width = MathVect.getDistance(blt.x, blt.y, targetshot[0], targetshot[1]);
blt.rotation = MathVect.getAngle(blt.x, blt.y, targetshot[0], targetshot[1]);
blt.name = "shottrail";
layer["shooteffect"].addChild(blt);
pt.x = (pt.x + MathVect.getDx(blt.width, blt.rotation));
pt.y = (pt.y + MathVect.getDy(blt.width, blt.rotation));
hit = false;
can = false;
i = 0;
while (i < layer["mouse"].numChildren) {
obj = layer["mouse"].getChildAt(i);
if (MathVect.getDistance(obj.x, obj.y, targetshot[0], targetshot[1]) < (obj.width * 0.7)){
if ((((((obj.health > 0)) && (!((obj.status == "drillup"))))) && (!((obj.status == "drilldown"))))){
hit = true;
obj.hit((weaponvar["damage"] * phantvar["skill"]));
if (_blood){
createBloodSplat(obj.name, targetshot);
};
if (obj.health == 0){
leveltotalkill++;
if (levelkill[obj.name]){
var _local8 = levelkill;
var _local9 = obj.name;
var _local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
} else {
levelkill[obj.name] = 1;
};
};
if (obj.name == "gray"){
can = true;
};
};
};
i++;
};
i = 0;
while (i < layer["boss"].numChildren) {
obj = layer["boss"].getChildAt(i);
if (obj.detectHit(targetshot)){
if (obj.health > 0){
hit = true;
obj.hit(weaponvar["damage"]);
if (_blood){
createBloodSplat(obj.name, targetshot);
};
can = true;
};
};
i++;
};
if (!hit){
createBloodSplat("dirt", targetshot);
};
if (can){
switch (obj.name){
case "boss1":
case "boss2":
soundmgr.playSFX("metal");
break;
default:
break;
};
};
return (hit);
}
private function getScale(_y, _min=0.1, _max=0.7):Number{
return (TweenEquations.easeInSine((_y - 100), _min, _max, (350 - 100)));
}
private function detectBulletExplode(_dmg, _pos){
var i:*;
var r:*;
var sc:*;
var obj:*;
var hit:*;
sc = getScale(_pos[1], 0.1, 1);
hit = false;
i = 0;
while (i < layer["mouse"].numChildren) {
obj = layer["mouse"].getChildAt(i);
r = (MathVect.getDistance(_pos[0], _pos[1], obj.x, obj.y) * sc);
if (r < (75 * sc)){
if ((((((obj.health > 0)) && (!((obj.status == "drillup"))))) && (!((obj.status == "drilldown"))))){
hit = true;
obj.hit((_dmg * phantvar["skill"]));
createBloodSplat(obj.name, [obj.x, obj.y]);
if (obj.health == 0){
leveltotalkill++;
if (levelkill[obj.name]){
var _local8 = levelkill;
var _local9 = obj.name;
var _local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
} else {
levelkill[obj.name] = 1;
};
};
};
};
i++;
};
i = 0;
while (i < layer["boss"].numChildren) {
obj = layer["boss"].getChildAt(i);
r = (MathVect.getDistance(_pos[0], _pos[1], obj.x, obj.y) * sc);
if ((((r < (30 * sc))) || (obj.detectHit(_pos)))){
if ((((obj.health > 0)) && (!((obj.status == "drillup"))))){
hit = true;
obj.hit((_dmg * phantvar["skill"]));
};
};
i++;
};
soundmgr.playSFX("boom");
if (hit){
levelmiss--;
} else {
levelhit--;
};
}
private function detectStatusTimer(){
if (statustimer == 0){
if (wavemgr.status == "completed"){
if ((((((level == 7)) || ((level == 15)))) || ((level == 23)))){
if (!bossmgr){
status = "startboss";
soundmgr.playBGM("boss");
if (level == 7){
bosslevel = 0;
} else {
if (level == 15){
bosslevel = 1;
} else {
if (level == 23){
bosslevel = 2;
} else {
if (level == 24){
bosslevel = 3;
};
};
};
};
} else {
if (bossmgr.health == 0){
if (!levelkill[bossmgr.name]){
levelkill[bossmgr.name] = 1;
} else {
var _local1 = levelkill;
var _local2 = bossmgr.name;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
statustimer = 30;
};
};
} else {
if ((level == 24)){
if (!bossmgr){
status = "startboss";
soundmgr.playBGM("boss");
if (level == 7){
bosslevel = 0;
} else {
if (level == 15){
bosslevel = 1;
} else {
if (level == 23){
bosslevel = 2;
} else {
if (level == 24){
bosslevel = 3;
};
};
};
};
} else {
if (bossmgr.health == 0){
if (!levelkill[bossmgr.name]){
levelkill[bossmgr.name] = 1;
} else {
_local1 = levelkill;
_local2 = bossmgr.name;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
if (bossmgr.name != "boss3"){
status = "startboss";
if (level == 7){
bosslevel = 0;
} else {
if (level == 15){
bosslevel = 1;
} else {
if (level == 23){
bosslevel = 2;
} else {
if (level == 24){
bosslevel = 3;
};
};
};
};
} else {
statustimer = 30;
};
};
};
} else {
statustimer = 30;
};
};
} else {
if (fencevar["health"] == 0){
statustimer = 30;
};
};
} else {
if (statustimer > 0){
statustimer--;
if (statustimer == 0){
if (fencevar["health"] == 0){
saveData(false);
status = "playerlost";
} else {
saveData(true);
status = "playerwin";
};
};
};
};
}
private function soundOff(e){
layer["panel"].soundOff();
soundmgr.adjustSFX(0);
soundmgr.playSFX("menuclick");
}
private function initReloadSkin(){
while (layer["elephant"].numChildren > 0) {
layer["elephant"].removeChildAt(0);
};
layer["elephant"].addChild(weaponvar["reloadskin"]);
weaponvar["reloadskin"].gotoAndPlay(1);
}
private function refreshPanel(){
layer["panel"].setHealth(fencevar["health"], fencevar["healthmax"]);
if (bossmgr){
layer["panel"].setBossHealth(bossmgr["health"], bossmgr["maxhealth"]);
};
layer["panel"].moveClip();
showpointer = !(layer["panel"].mouseoverpanel);
if (layer["trap"].status == "waiting"){
Mouse.show();
layer["target"].visible = false;
} else {
if (showpointer){
Mouse.hide();
layer["target"].visible = true;
} else {
Mouse.show();
layer["target"].visible = false;
};
};
}
private function calcElephantPos(){
var pt:*;
var wa:*;
var ea:*;
if ((((layer["elephant"].x > (targetpoint[0] + 75))) && ((layer["elephant"].x > 25)))){
layer["elephant"].x--;
};
if ((((layer["elephant"].x < (targetpoint[0] - 75))) && ((layer["elephant"].x < 400)))){
layer["elephant"].x++;
};
if ((((weaponvar["type"] == "Handgun")) || ((weaponvar["reloadtime"] > 0)))){
layer["elephant"].rotation = (MathVect.getObjectAngle(layer["elephant"], layer["target"]) + 90);
} else {
pt = layer["elephant"].localToGlobal(new Point(layer["elephant"].getChildAt(0).bulletstart.x, layer["elephant"].getChildAt(0).bulletstart.y));
wa = (MathVect.getObjectAngle(pt, layer["target"]) + 90);
ea = (MathVect.getObjectAngle(layer["elephant"], layer["target"]) + 90);
layer["elephant"].rotation = (ea - ((10 * (layer["target"].y - 100)) / 250));
};
}
}
}//package
Section 275
//sfx_boom (sfx_boom)
package {
import defclass.sound.*;
public dynamic class sfx_boom extends BaseSound {
public function sfx_boom(){
super();
}
}
}//package
Section 276
//sfx_empty (sfx_empty)
package {
import defclass.sound.*;
public dynamic class sfx_empty extends BaseSound {
public function sfx_empty(){
super();
}
}
}//package
Section 277
//sfx_reload_generic (sfx_reload_generic)
package {
import defclass.sound.*;
public dynamic class sfx_reload_generic extends BaseSound {
public function sfx_reload_generic(){
super();
}
}
}//package
Section 278
//sfx_reload_shotgun (sfx_reload_shotgun)
package {
import defclass.sound.*;
public dynamic class sfx_reload_shotgun extends BaseSound {
public function sfx_reload_shotgun(){
super();
}
}
}//package
Section 279
//sfx_ric_conca (sfx_ric_conca)
package {
import defclass.sound.*;
public dynamic class sfx_ric_conca extends BaseSound {
public function sfx_ric_conca(){
super();
}
}
}//package
Section 280
//sfx_ric_concb (sfx_ric_concb)
package {
import defclass.sound.*;
public dynamic class sfx_ric_concb extends BaseSound {
public function sfx_ric_concb(){
super();
}
}
}//package
Section 281
//sfx_ric_metala (sfx_ric_metala)
package {
import defclass.sound.*;
public dynamic class sfx_ric_metala extends BaseSound {
public function sfx_ric_metala(){
super();
}
}
}//package
Section 282
//sfx_ric_metalb (sfx_ric_metalb)
package {
import defclass.sound.*;
public dynamic class sfx_ric_metalb extends BaseSound {
public function sfx_ric_metalb(){
super();
}
}
}//package
Section 283
//sfx_shoot_ak47 (sfx_shoot_ak47)
package {
import defclass.sound.*;
public dynamic class sfx_shoot_ak47 extends BaseSound {
public function sfx_shoot_ak47(){
super();
}
}
}//package
Section 284
//sfx_shoot_minigun (sfx_shoot_minigun)
package {
import defclass.sound.*;
public dynamic class sfx_shoot_minigun extends BaseSound {
public function sfx_shoot_minigun(){
super();
}
}
}//package
Section 285
//sfx_shoot_mp5 (sfx_shoot_mp5)
package {
import defclass.sound.*;
public dynamic class sfx_shoot_mp5 extends BaseSound {
public function sfx_shoot_mp5(){
super();
}
}
}//package
Section 286
//sfx_shoot_shotgun (sfx_shoot_shotgun)
package {
import defclass.sound.*;
public dynamic class sfx_shoot_shotgun extends BaseSound {
public function sfx_shoot_shotgun(){
super();
}
}
}//package
Section 287
//SoundManager (SoundManager)
package {
import defclass.sound.*;
public class SoundManager {
private var tracing:Boolean;// = false
private var bgmdefaultvolume:Array;
private var sfxdefault:Array;
public var sfxvolume:Number;// = 1
public var bgmvolume:Number;// = 1
private var sfxdefaultvolume:Array;
private var usingsfxarray:Boolean;
private var bgmdefault:Array;
private var sndfx:Array;
private var sndbgm:BaseSound;
public function SoundManager(_usearray=false){
tracing = false;
bgmvolume = 1;
sfxvolume = 1;
super();
if (tracing){
trace("Sound Manager:$init: Use array : ", _usearray);
};
usingsfxarray = _usearray;
bgmdefault = new Array();
bgmdefaultvolume = new Array();
sfxdefault = new Array();
sfxdefaultvolume = new Array();
sndfx = new Array();
bgmdefault["cover"] = new bgm_ambient();
bgmdefaultvolume["cover"] = 1;
bgmdefault["boss"] = new bgm_boss();
bgmdefaultvolume["boss"] = 1;
bgmdefault["game"] = new bgm_cover();
bgmdefaultvolume["game"] = 1;
if (usingsfxarray){
sfxdefault["empty"] = new sfx_empty();
sfxdefault["reload"] = new sfx_reload_generic();
sfxdefault["reloadshotgun"] = new sfx_reload_shotgun();
sfxdefault["concrete"] = new sfx_ric_conca();
sfxdefault["concrete2"] = new sfx_ric_concb();
sfxdefault["metal"] = new sfx_ric_metala();
sfxdefault["metal2"] = new sfx_ric_metalb();
sfxdefault["shoot"] = new sfx_shoot_ak47();
sfxdefault["minigun"] = new sfx_shoot_minigun();
sfxdefault["shotgun"] = new sfx_shoot_shotgun();
sfxdefault["submachine"] = new sfx_shoot_mp5();
sfxdefault["boom"] = new sfx_boom();
sfxdefault["menuclick"] = new sfx_empty();
};
sfxdefaultvolume["empty"] = 1;
sfxdefaultvolume["reload"] = 1;
sfxdefaultvolume["reloadshotgun"] = 1;
sfxdefaultvolume["concrete"] = 0.5;
sfxdefaultvolume["concrete2"] = 0.5;
sfxdefaultvolume["metal"] = 0.5;
sfxdefaultvolume["metal2"] = 0.5;
sfxdefaultvolume["shoot"] = 0.5;
sfxdefaultvolume["minigun"] = 0.5;
sfxdefaultvolume["shotgun"] = 0.5;
sfxdefaultvolume["submachine"] = 0.5;
sfxdefaultvolume["boom"] = 1;
sfxdefaultvolume["menuclick"] = 1;
}
public function adjustBGM(_val=1){
bgmvolume = _val;
refreshVolume();
if (tracing){
trace("Sound Manager:adjustBGM: Adjusted to : ", bgmvolume);
};
}
private function startSFX(_snd, _vol=1){
var i:*;
i = 0;
if (sndfx.length < 20){
_snd.playSound();
_snd.setVolume((_vol * sfxvolume));
sndfx.push(_snd);
} else {
i = (sndfx.length - 1);
while (i >= 0) {
if (!sndfx[i].sndPlaying){
sndfx[i].stopSound();
sndfx.splice(i, 1);
};
i--;
};
if (_snd){
_snd.playSound();
_snd.setVolume((_vol * sfxvolume));
sndfx.push(_snd);
};
};
}
public function adjustSFX(_val=1){
sfxvolume = _val;
if (tracing){
trace("Sound Manager:adjustSFX: Adjusted to : ", sfxvolume);
};
}
public function refreshVolume(){
if (sndbgm){
sndbgm.setVolume(bgmvolume);
};
}
private function startSFX2(_snd, _vol=1){
_snd.playSound();
_snd.setVolume((_vol * sfxvolume));
}
public function stopSFX(){
var i:*;
var j:*;
if (usingsfxarray){
i = (sndfx.length - 1);
while (i >= 0) {
if (sndfx[i].sndPlaying){
sndfx[i].stopSound();
};
sndfx.splice(i, 1);
i--;
};
} else {
for each (j in sfxdefault) {
if (j.sndPlaying){
j.stopSound();
};
};
};
}
private function createSFX(_param):BaseSound{
var rnd:*;
switch (_param){
case "empty":
return (new sfx_empty());
case "reload":
return (new sfx_reload_generic());
case "reloadshotgun":
return (new sfx_reload_shotgun());
case "concrete":
rnd = Math.random();
if (rnd < 0.5){
return (new sfx_ric_conca());
};
return (new sfx_ric_concb());
case "metal":
rnd = Math.random();
if (rnd < 0.5){
return (new sfx_ric_metala());
};
return (new sfx_ric_metalb());
case "shoot":
rnd = Math.random();
return (new sfx_shoot_ak47());
case "minigun":
rnd = Math.random();
return (new sfx_shoot_minigun());
case "shotgun":
rnd = Math.random();
return (new sfx_shoot_shotgun());
case "submachine":
rnd = Math.random();
return (new sfx_shoot_mp5());
case "boom":
rnd = Math.random();
return (new sfx_boom());
case "menuclick":
return (new sfx_empty());
};
return (null);
}
public function stopBGM(){
if (sndbgm){
if (tracing){
trace("Sound Manager:stopBGM: BGM stopped");
};
sndbgm.stopSound();
sndbgm = null;
};
}
public function playSFX(_param:String="", _multisound:Boolean=true){
var res:*;
var rand:*;
var played:*;
var i:*;
rand = Math.random();
played = false;
i = 0;
if (((usingsfxarray) || (!(_multisound)))){
if (sfxdefault[_param]){
startSFX2(sfxdefault[_param], sfxdefaultvolume[_param]);
if (tracing){
trace("Sound Manager:playSFX: Playing sfx : ", _param);
};
} else {
if (tracing){
trace("Sound Manager:playSFX: Invalid sfx param : ", _param);
};
};
} else {
if (sfxdefault[_param]){
startSFX(createSFX(_param), sfxdefaultvolume[_param]);
if (tracing){
trace("Sound Manager:playSFX: Playing sfx : ", _param);
};
} else {
if (tracing){
trace("Sound Manager:playSFX: Invalid sfx param : ", _param);
};
};
};
}
public function playBGM(_param:String=""){
if (bgmdefault[_param]){
if (sndbgm != bgmdefault[_param]){
stopBGM();
sndbgm = bgmdefault[_param];
sndbgm.playSoundLoop();
sndbgm.setVolume((bgmvolume * bgmdefaultvolume[_param]));
if (tracing){
trace("Sound Manager:playBGM: play bgm : ", _param);
};
} else {
sndbgm.setVolume((1 * bgmvolume));
if (tracing){
trace("Sound Manager:playBGM: play bgm : ", _param);
};
};
} else {
if (tracing){
trace("Sound Manager:playBGM: Invalid bgm param : ", _param);
};
};
}
}
}//package
Section 288
//StatisticsPage (StatisticsPage)
package {
import flash.events.*;
import flash.display.*;
public class StatisticsPage extends MovieClip {
private var maintimeline;
private var panel;
private var nextpage;
private var admgr;
private var pagemgr;
private var datamgr;
private var timer;
private var soundmgr;
private var tweenmgr;
public var status;
public function StatisticsPage(_mtl){
var i:*;
super();
maintimeline = _mtl;
tweenmgr = maintimeline.tweenmgr;
pagemgr = maintimeline.pagemgr;
soundmgr = maintimeline.soundmgr;
datamgr = maintimeline.datamgr;
admgr = maintimeline.admgr;
panel = new mc_statistics();
panel.y = 525;
this.addChild(panel);
status = "start";
tweenmgr.register(panel, {live:10, ease:"easeoutcubic", x:0, y:0, alpha:1, rotation:0, scalex:1, scaley:1});
panel.btclose.addEventListener(MouseEvent.CLICK, goCover, false, 0, true);
refreshPage();
}
private function refreshPage(){
panel.tx1.text = datamgr.totalkill;
panel.tx2.text = (((datamgr.kill["boss1"]) ? datamgr.kill["boss1"] : 0 + (datamgr.kill["boss2"]) ? datamgr.kill["boss2"] : 0) + (datamgr.kill["boss3"]) ? datamgr.kill["boss3"] : 0);
panel.tx3.text = datamgr.killmoney;
panel.tx4.text = datamgr.hit;
panel.tx5.text = datamgr.miss;
panel.tx6.text = (datamgr.accuracy + " %");
panel.tx7.text = datamgr.totalmoney;
panel.tx8.text = (Math.floor(((datamgr.level / 24) * 100)) + " %");
panel.tx9.text = datamgr.getAchievementCount();
}
private function goCover(e){
nextpage = "cover";
panel.btclose.removeEventListener(MouseEvent.CLICK, goCover);
soundmgr.playSFX("menuclick");
close();
}
private function close(e=null){
pagemgr.loadPage(nextpage);
}
}
}//package
Section 289
//TrapDropper (TrapDropper)
package {
import flash.display.*;
import defclass.tweener.*;
import defclass.utils.*;
public class TrapDropper extends MovieClip {
public var rect;
public var pointername;
public var layers;
public var status;
public function TrapDropper(_skin, _rect){
super();
layers = new Array();
layers["skin"] = _skin;
layers["trap"] = new MovieClip();
layers["bin"] = new MovieClip();
this.addChild(layers["bin"]);
this.addChild(layers["trap"]);
rect = _rect;
status = "idle";
}
private function sortTrap(_layer){
var i:*;
var n:*;
var swapped:*;
var o:*;
var p:*;
if (_layer.numChildren > 1){
n = _layer.numChildren;
swapped = true;
while (swapped) {
swapped = false;
i = 0;
while (i < (n - 1)) {
o = _layer.getChildAt(i);
p = _layer.getChildAt((i + 1));
if (o.y > p.y){
_layer.setChildIndex(o, (i + 1));
_layer.setChildIndex(p, i);
swapped = true;
};
i++;
};
n--;
};
};
}
public function stopClip(){
var obj:*;
if (((layers["skin"]) && (this.contains(layers["skin"])))){
this.removeChild(layers["skin"]);
};
if (((layers["ptr"]) && (this.contains(layers["ptr"])))){
this.removeChild(layers["ptr"]);
};
if (layers["ptr"].alpha == 1){
status = "finished";
layers["trap"].addChild(layers["ptr"]);
layers["ptr"].setSkin("put");
sortTrap(layers["trap"]);
layers["ptr"] = null;
} else {
status = "cancel";
layers["ptr"] = null;
};
}
public function getScale(_obj):Number{
return (TweenEquations.easeInSine((_obj.y - 100), 0.4, 0.7, (350 - 100)));
}
public function moveClip(_pos){
var i:*;
var obj:*;
var newobj:*;
if (layers["ptr"]){
layers["ptr"].x = _pos[0];
layers["ptr"].y = _pos[1];
layers["ptr"].scaleX = getScale(layers["ptr"]);
layers["ptr"].scaleY = layers["ptr"].scaleX;
if (inRectangle(_pos, rect)){
layers["ptr"].alpha = 1;
} else {
layers["ptr"].alpha = 0.1;
};
};
i = (layers["trap"].numChildren - 1);
while (i > -1) {
obj = layers["trap"].getChildAt(i);
if (obj.skin.currentFrame == obj.skin.totalFrames){
obj.skin.stop();
switch (obj.name){
case "trap3put":
case "trap2put":
case "trap1put":
obj.setSkin("idle");
break;
};
};
i--;
};
i = (layers["bin"].numChildren - 1);
while (i > -1) {
obj = layers["bin"].getChildAt(i);
if (obj.skin.currentFrame == obj.skin.totalFrames){
obj.skin.stop();
switch (obj.name){
case "trap3":
layers["bin"].removeChild(obj);
break;
case "trap2":
layers["bin"].removeChild(obj);
break;
case "trap1":
layers["bin"].removeChild(obj);
break;
};
};
i--;
};
}
private function inRectangle(_pos, _rect):Boolean{
return ((((((((_pos[0] > _rect.x)) && ((_pos[0] < (_rect.x + _rect.width))))) && ((_pos[1] > _rect.y)))) && ((_pos[1] < (_rect.y + _rect.height)))));
}
public function startClip(_ptr){
var obj:*;
while (this.numChildren > 0) {
this.removeChildAt(0);
};
if (layers["skin"]){
this.addChild(layers["skin"]);
};
if (layers["bin"]){
this.addChild(layers["bin"]);
};
if (layers["trap"]){
this.addChild(layers["trap"]);
};
obj = new DataTrap(_ptr);
pointername = _ptr;
if (obj){
layers["ptr"] = obj;
this.addChild(layers["ptr"]);
} else {
this.removeChild(layers["skin"]);
};
status = "waiting";
}
public function detectHit(obj):String{
var i:*;
var trap:*;
var res:*;
res = "";
i = (layers["trap"].numChildren - 1);
while ((((i > -1)) && ((res == "")))) {
trap = layers["trap"].getChildAt(i);
if (MathVect.getDistance(obj.x, obj.y, trap.x, trap.y) < (((trap.width + (trap.height / 2)) + (obj.width / 2)) / 3)){
switch (trap.name){
case "trap3put":
case "trap3":
res = "trap3";
break;
case "trap2put":
case "trap2":
res = "trap2";
break;
case "trap1put":
case "trap1":
res = "trap1";
break;
};
trap.live--;
trap.setSkin("hit");
if (!trap.live){
layers["trap"].removeChild(trap);
layers["bin"].addChild(trap);
sortTrap(layers["bin"]);
};
};
i--;
};
return (res);
}
}
}//package
Section 290
//UpgradeOther (UpgradeOther)
package {
import flash.events.*;
import flash.display.*;
import defclass.ui.*;
public class UpgradeOther extends MovieClip {
private var maintimeline;
private var panel;
private var phantvar;
private var nextpage;
private var admgr;
private var pagemgr;
private var datamgr;
private var btnmgr;
private var timer;
private var fencevar;
private var buttons;
private var soundmgr;
private var notes;
private var tweenmgr;
private var bars;
public var status;
public function UpgradeOther(_mtl){
var i:*;
super();
maintimeline = _mtl;
tweenmgr = maintimeline.tweenmgr;
pagemgr = maintimeline.pagemgr;
soundmgr = maintimeline.soundmgr;
datamgr = maintimeline.datamgr;
admgr = maintimeline.admgr;
fencevar = maintimeline.fencevar;
phantvar = maintimeline.phantvar;
panel = new mc_upgrade_other();
panel.y = 525;
this.addChild(panel);
notes = [panel.txnote1, panel.txnote2, panel.txnote3, panel.txnote4, panel.txnote5, panel.txnote6, panel.txnote7];
bars = [panel.mcupgradebar1, panel.mcupgradebar2, panel.mcupgradebar3, panel.mcupgradebar4, panel.mcupgradebar5, panel.mcupgradebar6, panel.mcupgradebar7];
buttons = [panel.btupgrade1, panel.btupgrade2, panel.btupgrade3, panel.btupgrade4, panel.btupgrade5, panel.btupgrade6, panel.btupgrade7, panel.btupgrade8, panel.btupgrade9, panel.btclose, panel.btgoweapons];
status = "start";
tweenmgr.register(panel, {live:10, ease:"easeoutcubic", x:0, y:0, alpha:1, rotation:0, scalex:1, scaley:1});
activateButtons();
refreshPanel();
this.addEventListener(Event.ENTER_FRAME, moveClip, false, 0, true);
}
private function activateButtons(){
var i:*;
btnmgr = new ButtonManager(buttons);
i = 0;
while (i < 9) {
btnmgr.registerFunction(i, this, {onselect:goUpgrade});
i++;
};
btnmgr.registerFunction(9, this, {onselect:goStats});
btnmgr.registerFunction(10, this, {onselect:goWeapons});
}
private function goUpgrade(idx){
var heal:*;
var price:*;
switch (idx){
case 0:
heal = ((fencevar.levels[datamgr.fenceupgrade.level].health - datamgr.fence) / fencevar.levels[datamgr.fenceupgrade.level].health);
price = ((heal)>0.1) ? ((fencevar.price.heal[datamgr.fenceupgrade.level] * 0.1) * 10) : ((fencevar.price.heal[datamgr.fenceupgrade.level] * heal) * 10);
datamgr.repairFence(0.1, price, fencevar.levels[datamgr.fenceupgrade.level].health);
break;
case 1:
heal = ((fencevar.levels[datamgr.fenceupgrade.level].health - datamgr.fence) / fencevar.levels[datamgr.fenceupgrade.level].health);
price = ((heal)>0.25) ? ((fencevar.price.heal[datamgr.fenceupgrade.level] * 0.25) * 10) : ((fencevar.price.heal[datamgr.fenceupgrade.level] * heal) * 10);
datamgr.repairFence(0.25, price, fencevar.levels[datamgr.fenceupgrade.level].health);
break;
case 2:
heal = ((fencevar.levels[datamgr.fenceupgrade.level].health - datamgr.fence) / fencevar.levels[datamgr.fenceupgrade.level].health);
price = ((fencevar.price.heal[datamgr.fenceupgrade.level] * heal) * 10);
datamgr.repairFence(1, price, fencevar.levels[datamgr.fenceupgrade.level].health);
break;
case 3:
if (datamgr.fenceupgrade.level < 2){
datamgr.upgradeFence("level", fencevar.price.level[datamgr.fenceupgrade.level], fencevar.levels[(datamgr.fenceupgrade.level + 1)].health);
};
break;
case 4:
datamgr.upgradeFence("repair", fencevar.price.repair[datamgr.fenceupgrade.repair], fencevar.levels[datamgr.fenceupgrade.level].health);
break;
case 5:
datamgr.upgradeFence("attack", fencevar.price.attack[datamgr.fenceupgrade.attack], fencevar.levels[datamgr.fenceupgrade.level].health);
break;
case 6:
datamgr.upgradePhant("payment", phantvar.price.payment[datamgr.phantupgrade.payment]);
break;
case 7:
datamgr.upgradePhant("skill", phantvar.price.skill[datamgr.phantupgrade.skill]);
break;
case 8:
datamgr.upgradePhant("anger", phantvar.price.anger[datamgr.phantupgrade.anger]);
break;
};
refreshPanel();
soundmgr.playSFX("menuclick");
}
private function stopPanel(e=null){
deactivateButtons();
close();
}
private function deactivateButtons(){
var i:*;
i = 0;
while (i < 11) {
btnmgr.unregisterFunction(i, ["onselect"]);
i++;
};
}
private function goStats(e){
nextpage = "return";
stopPanel();
soundmgr.playSFX("menuclick");
}
private function moveClip(e){
if (!datamgr.achievements[21]){
if (datamgr.fenceupgrade["level"] == 2){
datamgr.setAchievement(21);
};
};
if (!datamgr.achievements[22]){
if (((datamgr.fenceupgrade["repair"]) && (datamgr.fenceupgrade["attack"]))){
datamgr.setAchievement(22);
};
};
if (!datamgr.achievements[23]){
if (((((datamgr.phantupgrade["payment"]) && (datamgr.phantupgrade["skill"]))) && (datamgr.phantupgrade["anger"]))){
datamgr.setAchievement(23);
};
};
if (!datamgr.achievements[24]){
if ((((((((((((datamgr.fenceupgrade["level"] == 2)) && ((datamgr.fenceupgrade["repair"] == 3)))) && ((datamgr.fenceupgrade["attack"] == 3)))) && ((datamgr.phantupgrade["payment"] == 3)))) && ((datamgr.phantupgrade["skill"] == 3)))) && ((datamgr.phantupgrade["anger"] == 3)))){
datamgr.setAchievement(24);
};
};
}
private function goWeapons(e){
nextpage = "upgradeweapon";
stopPanel();
soundmgr.playSFX("menuclick");
}
private function refreshPanel(){
var i:*;
notes[0].text = (("Repair your fence, $" + fencevar.price.heal[datamgr.fenceupgrade.level]) + " for every 10%");
if (datamgr.fenceupgrade.level < 2){
notes[1].text = ("Increase your fence HP for $" + fencevar.price.level[datamgr.fenceupgrade.level]);
} else {
notes[1].text = "Fence level maxed";
buttons[3].visible = false;
};
if (datamgr.fenceupgrade.repair < 3){
notes[2].text = ("These brand new nano-technologies will do it for $" + fencevar.price.repair[datamgr.fenceupgrade.repair]);
} else {
notes[2].text = "Fence nano repair maxed";
buttons[4].visible = false;
};
if (datamgr.fenceupgrade.attack < 3){
notes[3].text = ("Nano-technologies attack when the fence damaged for only $" + fencevar.price.attack[datamgr.fenceupgrade.attack]);
} else {
notes[3].text = "Fence nano attack maxed";
buttons[5].visible = false;
};
if (datamgr.phantupgrade.payment < 3){
notes[4].text = ("Increase payment for each body sold for $" + phantvar.price.payment[datamgr.phantupgrade.payment]);
} else {
notes[4].text = "Merchant payment maxed";
buttons[6].visible = false;
};
if (datamgr.phantupgrade.skill < 3){
notes[5].text = ("More trained elephant will do more damage for $" + phantvar.price.skill[datamgr.phantupgrade.skill]);
} else {
notes[5].text = "Elephant is the master";
buttons[7].visible = false;
};
if (datamgr.phantupgrade.anger < 3){
notes[6].text = ("Hire doctor to counsell the elephant anger for $" + phantvar.price.anger[datamgr.phantupgrade.anger]);
} else {
notes[6].text = "The elephant is untameable";
buttons[8].visible = false;
};
bars[0].width = ((200 * datamgr.fence) / fencevar.levels[datamgr.fenceupgrade.level].health);
bars[1].width = ((200 * datamgr.fenceupgrade.level) / 2);
bars[2].width = ((200 * datamgr.fenceupgrade.repair) / 3);
bars[3].width = ((200 * datamgr.fenceupgrade.attack) / 3);
bars[4].width = ((200 * datamgr.phantupgrade.payment) / 3);
bars[5].width = ((200 * datamgr.phantupgrade.skill) / 3);
bars[6].width = ((200 * datamgr.phantupgrade.anger) / 3);
i = 0;
while (i < bars.length) {
if (bars[i].width > 200){
bars[i].width = 200;
};
i++;
};
panel.txtotalmoney.text = ("$" + Math.floor(datamgr.money));
}
private function close(e=null){
pagemgr.loadPage(nextpage);
}
}
}//package
Section 291
//UpgradeWeapon (UpgradeWeapon)
package {
import flash.events.*;
import flash.display.*;
import defclass.ui.*;
public class UpgradeWeapon extends MovieClip {
private var maintimeline;
private var panel;
private var itemname;
private var pagemgr;
private var datamgr;
private var itemprice;
private var btnmgr;
private var txtmoney;
private var btgroup;
private var itemimage;
private var txtloader;
private var imgloader;
private var itemindex;
private var soundmgr;
private var txtupgrade;
private var weaponvar;
private var barupgrade;
private var btitems;
private var itemupgrade;
private var tweenmgr;
private var itemtype;
public function UpgradeWeapon(_mtl){
super();
maintimeline = _mtl;
tweenmgr = maintimeline.tweenmgr;
pagemgr = maintimeline.pagemgr;
soundmgr = maintimeline.soundmgr;
datamgr = maintimeline.datamgr;
weaponvar = maintimeline.weaponvar;
panel = new mc_upgrade_weapon();
panel.y = 525;
this.addChild(panel);
activateButtons();
initPanel();
tweenmgr.register(panel, {live:10, ease:"easeoutcubic", x:0, y:0, alpha:1, rotation:0, scalex:1, scaley:1});
}
private function activateButtons(){
btnmgr = new ButtonManager([panel.btselect1, panel.btselect2, panel.btselect3, panel.btselect4, panel.btselect5, panel.btselect6, panel.btselect7, panel.bthandgun1, panel.bthandgun2, panel.bthandgun3, panel.btshotgun1, panel.btshotgun2, panel.btshotgun3, panel.btsubmachine1, panel.btsubmachine2, panel.btsubmachine3, panel.btassault1, panel.btassault2, panel.btassault3, panel.btmachine1, panel.btmachine2, panel.btmachine3, panel.btlauncher1, panel.btlauncher2, panel.btlauncher3, panel.btspecial1, panel.btspecial2, panel.btspecial3, panel.btspecial4, panel.btbuy, panel.mctabweapon.btupgrade1, panel.mctabweapon.btupgrade2, panel.mctabweapon.btupgrade3, panel.mctabweapon.btequip1, panel.mctabweapon.btequip2, panel.mctabweapon.btequip3, panel.btclose, panel.btgoupgrades]);
btnmgr.registerFunction(0, this, {onselect:activateGroup});
btnmgr.registerFunction(1, this, {onselect:activateGroup});
btnmgr.registerFunction(2, this, {onselect:activateGroup});
btnmgr.registerFunction(3, this, {onselect:activateGroup});
btnmgr.registerFunction(4, this, {onselect:activateGroup});
btnmgr.registerFunction(5, this, {onselect:activateGroup});
btnmgr.registerFunction(6, this, {onselect:activateGroup});
btnmgr.registerFunction(7, this, {onselect:activateItem});
btnmgr.registerFunction(8, this, {onselect:activateItem});
btnmgr.registerFunction(9, this, {onselect:activateItem});
btnmgr.registerFunction(10, this, {onselect:activateItem});
btnmgr.registerFunction(11, this, {onselect:activateItem});
btnmgr.registerFunction(12, this, {onselect:activateItem});
btnmgr.registerFunction(13, this, {onselect:activateItem});
btnmgr.registerFunction(14, this, {onselect:activateItem});
btnmgr.registerFunction(15, this, {onselect:activateItem});
btnmgr.registerFunction(16, this, {onselect:activateItem});
btnmgr.registerFunction(17, this, {onselect:activateItem});
btnmgr.registerFunction(18, this, {onselect:activateItem});
btnmgr.registerFunction(19, this, {onselect:activateItem});
btnmgr.registerFunction(20, this, {onselect:activateItem});
btnmgr.registerFunction(21, this, {onselect:activateItem});
btnmgr.registerFunction(22, this, {onselect:activateItem});
btnmgr.registerFunction(23, this, {onselect:activateItem});
btnmgr.registerFunction(24, this, {onselect:activateItem});
btnmgr.registerFunction(25, this, {onselect:activateItem});
btnmgr.registerFunction(26, this, {onselect:activateItem});
btnmgr.registerFunction(27, this, {onselect:activateItem});
btnmgr.registerFunction(28, this, {onselect:activateItem});
btnmgr.registerFunction(29, this, {onselect:buyWeapon});
btnmgr.registerFunction(30, this, {onselect:upgradeDamage});
btnmgr.registerFunction(31, this, {onselect:upgradeClip});
btnmgr.registerFunction(32, this, {onselect:upgradeRate});
btnmgr.registerFunction(33, this, {onselect:equipWeapon});
btnmgr.registerFunction(34, this, {onselect:equipWeapon});
btnmgr.registerFunction(35, this, {onselect:equipWeapon});
btnmgr.registerFunction(36, this, {onselect:continueGame});
btnmgr.registerFunction(37, this, {onselect:goUpgrade});
}
private function goUpgrade(e){
deactivateButtons();
pagemgr.loadPage("upgradeother");
soundmgr.playSFX("menuclick");
}
private function upgradeRate(e){
datamgr.upgradeWeapon(itemname, 2, itemprice.rate[itemupgrade[2]]);
activateItem((itemindex + 7));
soundmgr.playSFX("menuclick");
}
private function continueGame(e){
deactivateButtons();
pagemgr.loadPage("return");
soundmgr.playSFX("menuclick");
}
private function activateGroup(e){
var i:*;
var idx:*;
i = 0;
while (i < btitems.length) {
btitems[i].x = -425;
i++;
};
i = 0;
while (i < btgroup.length) {
btgroup[i]["parent"].visible = true;
i++;
};
btgroup[e]["parent"].visible = false;
i = 0;
while (i < btgroup[e]["child"].length) {
btgroup[e]["child"][i].x = 5;
i++;
};
idx = 7;
i = 0;
while (i < e) {
idx = (idx + btgroup[i]["child"].length);
i++;
};
soundmgr.playSFX("menuclick");
activateItem(idx);
}
private function setTrapTab(){
panel.mctabweapon.x = -425;
panel.mctabtrap.x = 0;
if (datamgr.weaponbought[itemname] < 5){
panel.btbuy.visible = true;
};
txtupgrade[3].text = "Damage";
txtupgrade[4].text = (("Owned " + datamgr.weaponbought[itemname]) + " / 5");
txtupgrade[5].text = ("Effect : " + weaponvar.weapons[itemname]["effect"]);
barupgrade[3].scaleX = (weaponvar.weapons[itemname]["damage"][0] / 200);
barupgrade[4].scaleX = (datamgr.weaponbought[itemname] / 5);
imgloader[4].addChild(weaponvar.getWeaponPicture("trap1"));
imgloader[5].addChild(weaponvar.getWeaponPicture("trap2"));
imgloader[6].addChild(weaponvar.getWeaponPicture("trap3"));
txtloader[4].text = weaponvar.weapons["trap1"]["named"];
txtloader[5].text = weaponvar.weapons["trap2"]["named"];
txtloader[6].text = weaponvar.weapons["trap3"]["named"];
txtloader[7].text = (datamgr.weaponbought["trap1"] + " / 5");
txtloader[8].text = (datamgr.weaponbought["trap2"] + " / 5");
txtloader[9].text = (datamgr.weaponbought["trap3"] + " / 5");
}
private function buyWeapon(e){
datamgr.buyWeapon(itemname, itemprice.buy);
activateItem((itemindex + 7));
soundmgr.playSFX("menuclick");
}
private function equipWeapon(e){
var i:*;
i = 0;
while (i < datamgr.equipped.length) {
if (datamgr.equipped[i] == itemname){
datamgr.equipped[i] = "";
};
i++;
};
datamgr.equipped[(e - 33)] = itemname;
loadEquipped();
soundmgr.playSFX("menuclick");
}
private function setWeaponTab(){
var idx:*;
var nm:*;
var dmg:*;
var div:*;
panel.mctabweapon.x = 0;
panel.mctabtrap.x = -425;
if (!datamgr.weaponunlocked[itemname]){
imgloader[0].addChild(new mc_weapon_locked());
panel.btbuy.visible = false;
} else {
if (!datamgr.weaponbought[itemname]){
panel.btbuy.visible = true;
} else {
panel.btbuy.visible = false;
};
};
txtupgrade[0].text = ("Damage : " + ((itemupgrade[0])<3) ? ("$" + itemprice.damage[itemupgrade[0]]) : "Max");
txtupgrade[1].text = ("Clip Size : " + ((itemupgrade[1])<3) ? ("$" + itemprice.clip[itemupgrade[1]]) : "Max");
txtupgrade[2].text = ("Reload Rate : " + ((itemupgrade[2])<3) ? ("$" + itemprice.rate[itemupgrade[2]]) : "Max");
panel.mctabweapon.btupgrade1.visible = false;
panel.mctabweapon.btupgrade2.visible = false;
panel.mctabweapon.btupgrade3.visible = false;
if (((datamgr.weaponunlocked[itemname]) && (datamgr.weaponbought[itemname]))){
if (datamgr.weaponupgrade[itemname][0] < 3){
panel.mctabweapon.btupgrade1.visible = true;
};
if (datamgr.weaponupgrade[itemname][1] < 3){
panel.mctabweapon.btupgrade2.visible = true;
};
if (datamgr.weaponupgrade[itemname][2] < 3){
panel.mctabweapon.btupgrade3.visible = true;
};
};
panel.mctabweapon.btequip1.visible = false;
panel.mctabweapon.btequip2.visible = false;
panel.mctabweapon.btequip3.visible = false;
switch (itemtype){
case "Handgun":
if (itemname != "beretta"){
if (datamgr.weaponbought[itemname]){
if (datamgr.equipped[1] != itemname){
panel.mctabweapon.btequip2.visible = true;
};
if (datamgr.equipped[2] != itemname){
panel.mctabweapon.btequip3.visible = true;
};
};
};
break;
case "Shotgun":
case "Submachine Gun":
case "Assault Rifles":
case "Machine Gun":
case "Grenade Launcher":
if (datamgr.weaponbought[itemname]){
if (datamgr.equipped[1] != itemname){
panel.mctabweapon.btequip2.visible = true;
};
if (datamgr.equipped[2] != itemname){
panel.mctabweapon.btequip3.visible = true;
};
};
break;
case "Special":
if (itemname == "minigun"){
if (datamgr.weaponbought[itemname]){
if (datamgr.equipped[1] != itemname){
panel.mctabweapon.btequip2.visible = true;
};
if (datamgr.equipped[2] != itemname){
panel.mctabweapon.btequip3.visible = true;
};
};
};
break;
};
dmg = weaponvar.weapons[itemname].damage[datamgr.weaponupgrade[itemname][0]];
switch (itemtype){
case "Handgun":
case "Shotgun":
case "Submachine Gun":
div = 25;
break;
case "Assault Rifles":
case "Machine Gun":
div = 50;
break;
case "Grenade Launcher":
div = 100;
break;
case "Special":
div = 50;
break;
};
barupgrade[0].scaleX = (dmg / div);
if (barupgrade[0].scaleX > 1){
barupgrade[0].scaleX = 1;
};
dmg = weaponvar.weapons[itemname].bulletmagzmax[datamgr.weaponupgrade[itemname][1]];
switch (itemtype){
case "Handgun":
div = 30;
break;
case "Shotgun":
div = 20;
break;
case "Submachine Gun":
case "Assault Rifles":
div = 100;
break;
case "Machine Gun":
div = 200;
break;
case "Grenade Launcher":
div = 20;
break;
case "Special":
div = 200;
break;
};
barupgrade[1].scaleX = (dmg / div);
if (barupgrade[1].scaleX > 1){
barupgrade[1].scaleX = 1;
};
dmg = (60 - weaponvar.weapons[itemname].reloadrate[datamgr.weaponupgrade[itemname][2]]);
div = 50;
barupgrade[2].scaleX = (dmg / div);
if (barupgrade[2].scaleX > 1){
barupgrade[2].scaleX = 1;
};
}
private function loadPanelItems(){
txtmoney = panel.txtotalmoney;
imgloader = [panel.mcloaderbig, panel.mctabweapon.mcloadersmall1, panel.mctabweapon.mcloadersmall2, panel.mctabweapon.mcloadersmall3, panel.mctabtrap.mcloadersmall1, panel.mctabtrap.mcloadersmall2, panel.mctabtrap.mcloadersmall3];
txtloader = [panel.txweapon, panel.mctabweapon.txequipped1, panel.mctabweapon.txequipped2, panel.mctabweapon.txequipped3, panel.mctabtrap.txequipped1, panel.mctabtrap.txequipped2, panel.mctabtrap.txequipped3, panel.mctabtrap.txowned1, panel.mctabtrap.txowned2, panel.mctabtrap.txowned3];
txtupgrade = [panel.mctabweapon.txupgradebar1, panel.mctabweapon.txupgradebar2, panel.mctabweapon.txupgradebar3, panel.mctabtrap.txupgradebar1, panel.mctabtrap.txupgradebar2, panel.mctabtrap.txupgradebar3];
barupgrade = [panel.mctabweapon.mcupgradebar1, panel.mctabweapon.mcupgradebar2, panel.mctabweapon.mcupgradebar3, panel.mctabtrap.mcupgradebar1, panel.mctabtrap.mcupgradebar2];
btgroup = [{parent:panel.btselect1, child:[panel.bthandgun1, panel.bthandgun2, panel.bthandgun3]}, {parent:panel.btselect2, child:[panel.btshotgun1, panel.btshotgun2, panel.btshotgun3]}, {parent:panel.btselect3, child:[panel.btsubmachine1, panel.btsubmachine2, panel.btsubmachine3]}, {parent:panel.btselect4, child:[panel.btassault1, panel.btassault2, panel.btassault3]}, {parent:panel.btselect5, child:[panel.btmachine1, panel.btmachine2, panel.btmachine3]}, {parent:panel.btselect6, child:[panel.btlauncher1, panel.btlauncher2, panel.btlauncher3]}, {parent:panel.btselect7, child:[panel.btspecial1, panel.btspecial2, panel.btspecial3, panel.btspecial4]}];
btitems = [panel.bthandgun1, panel.bthandgun2, panel.bthandgun3, panel.btshotgun1, panel.btshotgun2, panel.btshotgun3, panel.btsubmachine1, panel.btsubmachine2, panel.btsubmachine3, panel.btassault1, panel.btassault2, panel.btassault3, panel.btmachine1, panel.btmachine2, panel.btmachine3, panel.btlauncher1, panel.btlauncher2, panel.btlauncher3, panel.btspecial1, panel.btspecial2, panel.btspecial3, panel.btspecial4];
}
private function deactivateButtons(){
var i:*;
i = 0;
while (i < btnmgr.button.length) {
btnmgr.unregisterFunction(i, ["onselect"]);
i++;
};
}
private function upgradeClip(e){
datamgr.upgradeWeapon(itemname, 1, itemprice.clip[itemupgrade[1]]);
activateItem((itemindex + 7));
soundmgr.playSFX("menuclick");
}
private function upgradeDamage(e){
datamgr.upgradeWeapon(itemname, 0, itemprice.damage[itemupgrade[0]]);
activateItem((itemindex + 7));
soundmgr.playSFX("menuclick");
}
private function activateItem(e){
itemindex = (e - 7);
itemname = weaponvar.weaponlist[itemindex];
itemtype = weaponvar.weapons[itemname]["type"];
itemprice = weaponvar.weapons[itemname]["price"];
itemupgrade = datamgr.weaponupgrade[itemname];
itemimage = weaponvar.getWeaponPicture(itemname);
while (imgloader[0].numChildren > 1) {
imgloader[0].removeChildAt((imgloader[0].numChildren - 1));
};
txtmoney.text = ("$" + Math.floor(datamgr.money));
txtloader[0].text = ((((weaponvar.weapons[itemname]["named"] + "\n") + itemtype) + "\n") + (datamgr.weaponbought[itemname]) ? "Owned" : ("$" + weaponvar.weapons[itemname]["price"]["buy"]));
imgloader[0].addChild(itemimage);
if (itemtype == "Special"){
if (itemname == "minigun"){
setWeaponTab();
} else {
setTrapTab();
};
} else {
setWeaponTab();
};
soundmgr.playSFX("menuclick");
}
private function moveClip(e){
if (!datamgr.achievements[10]){
if (((((datamgr.weaponbought["trench"]) || (datamgr.weaponbought["mossberg"]))) || (datamgr.weaponbought["spas"]))){
datamgr.setAchievement(10);
};
};
if (!datamgr.achievements[11]){
if (((((datamgr.weaponbought["ak47"]) || (datamgr.weaponbought["steyraug"]))) || (datamgr.weaponbought["xm8"]))){
datamgr.setAchievement(11);
};
};
if (!datamgr.achievements[12]){
if (((((datamgr.weaponbought["mp5"]) || (datamgr.weaponbought["mp9"]))) || (datamgr.weaponbought["steyrtmp"]))){
datamgr.setAchievement(12);
};
};
if (!datamgr.achievements[13]){
if (((datamgr.weaponbought["deagle"]) || (datamgr.weaponbought["danwesson"]))){
datamgr.setAchievement(13);
};
};
if (!datamgr.achievements[14]){
if (((((datamgr.weaponbought["mk2"]) || (datamgr.weaponbought["m60"]))) || (datamgr.weaponbought["mg34"]))){
datamgr.setAchievement(14);
};
};
if (!datamgr.achievements[15]){
if (((((datamgr.weaponbought["m79"]) || (datamgr.weaponbought["mm1"]))) || (datamgr.weaponbought["xm25"]))){
datamgr.setAchievement(15);
};
};
if (!datamgr.achievements[16]){
if (datamgr.weaponbought["minigun"]){
datamgr.setAchievement(16);
};
};
if (!datamgr.achievements[17]){
if (datamgr.weaponbought["trap1"]){
datamgr.setAchievement(17);
};
};
if (!datamgr.achievements[18]){
if (datamgr.weaponbought["trap2"]){
datamgr.setAchievement(18);
};
};
if (!datamgr.achievements[19]){
if (datamgr.weaponbought["trap3"]){
datamgr.setAchievement(19);
};
};
if (!datamgr.achievements[20]){
if (((datamgr.weaponbought["deagle"]) && (datamgr.weaponbought["danwesson"]))){
datamgr.setAchievement(20);
};
};
if (!datamgr.achievements[25]){
if ((((((((((((((((((((((((((((((((((((((((((datamgr.weaponupgrade["beretta"][0] == 3)) && ((datamgr.weaponupgrade["beretta"][1] == 3)))) && ((datamgr.weaponupgrade["beretta"][2] == 3)))) || ((((((datamgr.weaponupgrade["deagle"][0] == 3)) && ((datamgr.weaponupgrade["deagle"][1] == 3)))) && ((datamgr.weaponupgrade["deagle"][2] == 3)))))) || ((((((datamgr.weaponupgrade["danwesson"][0] == 3)) && ((datamgr.weaponupgrade["danwesson"][1] == 3)))) && ((datamgr.weaponupgrade["danwesson"][2] == 3)))))) || ((((((datamgr.weaponupgrade["trench"][0] == 3)) && ((datamgr.weaponupgrade["trench"][1] == 3)))) && ((datamgr.weaponupgrade["trench"][2] == 3)))))) || ((((((datamgr.weaponupgrade["mossberg"][0] == 3)) && ((datamgr.weaponupgrade["mossberg"][1] == 3)))) && ((datamgr.weaponupgrade["mossberg"][2] == 3)))))) || ((((((datamgr.weaponupgrade["spas"][0] == 3)) && ((datamgr.weaponupgrade["spas"][1] == 3)))) && ((datamgr.weaponupgrade["spas"][2] == 3)))))) || ((((((datamgr.weaponupgrade["mp5"][0] == 3)) && ((datamgr.weaponupgrade["mp5"][1] == 3)))) && ((datamgr.weaponupgrade["mp5"][2] == 3)))))) || ((((((datamgr.weaponupgrade["mp9"][0] == 3)) && ((datamgr.weaponupgrade["mp9"][1] == 3)))) && ((datamgr.weaponupgrade["mp9"][2] == 3)))))) || ((((((datamgr.weaponupgrade["steyrtmp"][0] == 3)) && ((datamgr.weaponupgrade["steyrtmp"][1] == 3)))) && ((datamgr.weaponupgrade["steyrtmp"][2] == 3)))))) || ((((((datamgr.weaponupgrade["ak47"][0] == 3)) && ((datamgr.weaponupgrade["ak47"][1] == 3)))) && ((datamgr.weaponupgrade["ak47"][2] == 3)))))) || ((((((datamgr.weaponupgrade["steyraug"][0] == 3)) && ((datamgr.weaponupgrade["steyraug"][1] == 3)))) && ((datamgr.weaponupgrade["steyraug"][2] == 3)))))) || ((((((datamgr.weaponupgrade["xm8"][0] == 3)) && ((datamgr.weaponupgrade["xm8"][1] == 3)))) && ((datamgr.weaponupgrade["xm8"][2] == 3)))))) || ((((((datamgr.weaponupgrade["mk2"][0] == 3)) && ((datamgr.weaponupgrade["mk2"][1] == 3)))) && ((datamgr.weaponupgrade["mk2"][2] == 3)))))) || ((((((datamgr.weaponupgrade["m60"][0] == 3)) && ((datamgr.weaponupgrade["m60"][1] == 3)))) && ((datamgr.weaponupgrade["m60"][2] == 3)))))) || ((((((datamgr.weaponupgrade["mg34"][0] == 3)) && ((datamgr.weaponupgrade["mg34"][1] == 3)))) && ((datamgr.weaponupgrade["mg34"][2] == 3)))))) || ((((((datamgr.weaponupgrade["m79"][0] == 3)) && ((datamgr.weaponupgrade["m79"][1] == 3)))) && ((datamgr.weaponupgrade["m79"][2] == 3)))))) || ((((((datamgr.weaponupgrade["mm1"][0] == 3)) && ((datamgr.weaponupgrade["mm1"][1] == 3)))) && ((datamgr.weaponupgrade["mm1"][2] == 3)))))) || ((((((datamgr.weaponupgrade["xm25"][0] == 3)) && ((datamgr.weaponupgrade["xm25"][1] == 3)))) && ((datamgr.weaponupgrade["xm25"][2] == 3)))))) || ((((((datamgr.weaponupgrade["minigun"][0] == 3)) && ((datamgr.weaponupgrade["minigun"][1] == 3)))) && ((datamgr.weaponupgrade["minigun"][2] == 3)))))){
datamgr.setAchievement(25);
};
};
if (!datamgr.achievements[26]){
if (((((datamgr.weaponbought["trap1"]) && (datamgr.weaponbought["trap2"]))) && (datamgr.weaponbought["trap3"]))){
datamgr.setAchievement(26);
};
};
if (!datamgr.achievements[27]){
if (datamgr.weaponbought["trap1"] == 5){
datamgr.setAchievement(27);
};
};
}
private function initPanel(){
loadPanelItems();
activateGroup(0);
loadEquipped();
this.addEventListener(Event.ENTER_FRAME, moveClip, false, 0, true);
}
private function loadEquipped(){
var i:*;
i = 0;
while (i < datamgr.equipped.length) {
if (datamgr.equipped[i] != ""){
while (imgloader[(i + 1)].numChildren > 1) {
imgloader[(i + 1)].removeChildAt((imgloader[(i + 1)].numChildren - 1));
};
imgloader[(i + 1)].addChild(weaponvar.getWeaponPicture(datamgr.equipped[i]));
txtloader[(i + 1)].text = weaponvar.weapons[datamgr.equipped[i]]["named"];
} else {
while (imgloader[(i + 1)].numChildren > 1) {
imgloader[(i + 1)].removeChildAt((imgloader[(i + 1)].numChildren - 1));
};
txtloader[(i + 1)].text = "Empty";
};
i++;
};
panel.mctabweapon.btequip1.visible = false;
panel.mctabweapon.btequip2.visible = false;
panel.mctabweapon.btequip3.visible = false;
switch (itemtype){
case "Handgun":
if (itemname != "beretta"){
if (datamgr.weaponbought[itemname]){
if (datamgr.equipped[1] != itemname){
panel.mctabweapon.btequip2.visible = true;
};
if (datamgr.equipped[2] != itemname){
panel.mctabweapon.btequip3.visible = true;
};
};
};
break;
case "Shotgun":
case "Submachine Gun":
case "Assault Rifles":
case "Machine Gun":
case "Grenade Launcher":
if (datamgr.weaponbought[itemname]){
if (datamgr.equipped[1] != itemname){
panel.mctabweapon.btequip2.visible = true;
};
if (datamgr.equipped[2] != itemname){
panel.mctabweapon.btequip3.visible = true;
};
};
break;
case "Special":
if (itemname == "minigun"){
if (datamgr.weaponbought[itemname]){
if (datamgr.equipped[1] != itemname){
panel.mctabweapon.btequip2.visible = true;
};
if (datamgr.equipped[2] != itemname){
panel.mctabweapon.btequip3.visible = true;
};
};
};
break;
};
}
}
}//package