Section 1
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class AdLoader extends Sprite {
private var contentspotid:String;
private var cpmstarLoader:Loader;
public function AdLoader(_arg1:String){
this.contentspotid = _arg1;
addEventListener(Event.ADDED, addedHandler);
}
private function addedHandler(_arg1:Event):void{
var _local2:String;
var _local3:DisplayObjectContainer;
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
_local2 = "http://server.cpmstar.com/adviewas3.swf";
_local3 = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
cpmstarLoader.load(new URLRequest(((_local2 + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
private function dispatchHandler(_arg1:Event):void{
dispatchEvent(_arg1);
}
}
}//package CPMStar
Section 2
//2games_play_latest_text_141 (DefenseV10_fla.2games_play_latest_text_141)
package DefenseV10_fla {
import flash.display.*;
public dynamic class 2games_play_latest_text_141 extends MovieClip {
public var text2G:MovieClip;
public function 2games_play_latest_text_141(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package DefenseV10_fla
Section 3
//2GamesRo_140 (DefenseV10_fla.2GamesRo_140)
package DefenseV10_fla {
import flash.display.*;
public dynamic class 2GamesRo_140 extends MovieClip {
public var logo_ro:gameslogoro;
public var play_latest_text:MovieClip;
}
}//package DefenseV10_fla
Section 4
//assetHolder_1 (DefenseV10_fla.assetHolder_1)
package DefenseV10_fla {
import flash.display.*;
public dynamic class assetHolder_1 extends MovieClip {
public function assetHolder_1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package DefenseV10_fla
Section 5
//BigExplosion_Shadow_42 (DefenseV10_fla.BigExplosion_Shadow_42)
package DefenseV10_fla {
import flash.display.*;
public dynamic class BigExplosion_Shadow_42 extends MovieClip {
public function BigExplosion_Shadow_42(){
addFrameScript(25, frame26);
}
function frame26(){
stop();
parent.removeChild(this);
}
}
}//package DefenseV10_fla
Section 6
//BoostInt_86 (DefenseV10_fla.BoostInt_86)
package DefenseV10_fla {
import flash.events.*;
import flash.display.*;
public dynamic class BoostInt_86 extends MovieClip {
public var msg:Event;
public function BoostInt_86(){
addFrameScript(119, frame120);
}
function frame120(){
stop();
msg = new Event("boostfull");
dispatchEvent(msg);
}
}
}//package DefenseV10_fla
Section 7
//bubblxbox_smallLogo_ro_21 (DefenseV10_fla.bubblxbox_smallLogo_ro_21)
package DefenseV10_fla {
import flash.display.*;
public dynamic class bubblxbox_smallLogo_ro_21 extends MovieClip {
public function bubblxbox_smallLogo_ro_21(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package DefenseV10_fla
Section 8
//CoreInd_43 (DefenseV10_fla.CoreInd_43)
package DefenseV10_fla {
import flash.display.*;
public dynamic class CoreInd_43 extends MovieClip {
public function CoreInd_43(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package DefenseV10_fla
Section 9
//GameHudBasic_80 (DefenseV10_fla.GameHudBasic_80)
package DefenseV10_fla {
import flash.display.*;
import flash.text.*;
public dynamic class GameHudBasic_80 extends MovieClip {
public var boostInd:MovieClip;
public var playerHPMarker:MovieClip;
public var materialNumber:TextField;
public var scoreNumber:TextField;
public var emy4:MovieClip;
public var emy5:MovieClip;
public var emy1:MovieClip;
public var waveStartButton:StartWaveButton;
public var emy2:MovieClip;
public var emy3:MovieClip;
public var emy6:MovieClip;
public var emy8:MovieClip;
public var out4:MovieClip;
public var emy7:MovieClip;
public var out7:MovieClip;
public var out3:MovieClip;
public var in2:MovieClip;
public var in4:MovieClip;
public var out8:MovieClip;
public var out2:MovieClip;
public var in3:MovieClip;
public var out6:MovieClip;
public var out1:MovieClip;
public var out5:MovieClip;
public var in1:MovieClip;
public var newMute:NewMuteButton;
public var coreind:MovieClip;
public var slider:MovieClip;
public var exitButton:SimpleButton;
}
}//package DefenseV10_fla
Section 10
//GameHudExitBase_79 (DefenseV10_fla.GameHudExitBase_79)
package DefenseV10_fla {
import flash.display.*;
public dynamic class GameHudExitBase_79 extends MovieClip {
public var noButton:SimpleButton;
public var closeButton:SimpleButton;
public var yesButton:SimpleButton;
}
}//package DefenseV10_fla
Section 11
//InnerInd_92 (DefenseV10_fla.InnerInd_92)
package DefenseV10_fla {
import flash.display.*;
public dynamic class InnerInd_92 extends MovieClip {
public function InnerInd_92(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package DefenseV10_fla
Section 12
//NewMuteButtonItems_23 (DefenseV10_fla.NewMuteButtonItems_23)
package DefenseV10_fla {
import flash.display.*;
public dynamic class NewMuteButtonItems_23 extends MovieClip {
public var item2:MovieClip;
public var item3:MovieClip;
public var item1:MovieClip;
public function NewMuteButtonItems_23(){
addFrameScript(6, frame7, 11, frame12);
}
function frame12(){
stop();
}
function frame7(){
stop();
}
}
}//package DefenseV10_fla
Section 13
//OuterInd_94 (DefenseV10_fla.OuterInd_94)
package DefenseV10_fla {
import flash.display.*;
public dynamic class OuterInd_94 extends MovieClip {
public function OuterInd_94(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package DefenseV10_fla
Section 14
//Player_Body_12 (DefenseV10_fla.Player_Body_12)
package DefenseV10_fla {
import flash.display.*;
public dynamic class Player_Body_12 extends MovieClip {
public var rightgun1:MovieClip;
public var rightgun2:MovieClip;
public var leftEngine:MovieClip;
public var gun3:MovieClip;
public var leftgun1:MovieClip;
public var leftgun2:MovieClip;
public var rightEngine:MovieClip;
public function Player_Body_12(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package DefenseV10_fla
Section 15
//Player_Boost_16 (DefenseV10_fla.Player_Boost_16)
package DefenseV10_fla {
import flash.display.*;
public dynamic class Player_Boost_16 extends MovieClip {
public function Player_Boost_16(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package DefenseV10_fla
Section 16
//Ranger_Turret_34 (DefenseV10_fla.Ranger_Turret_34)
package DefenseV10_fla {
import flash.display.*;
public dynamic class Ranger_Turret_34 extends MovieClip {
public var rightGun:MovieClip;
public var leftGun:MovieClip;
}
}//package DefenseV10_fla
Section 17
//Slider_81 (DefenseV10_fla.Slider_81)
package DefenseV10_fla {
import flash.display.*;
public dynamic class Slider_81 extends MovieClip {
public var sliderBase:MovieClip;
public function Slider_81(){
addFrameScript(9, frame10, 19, frame20);
}
function frame10(){
stop();
}
function frame20(){
stop();
}
}
}//package DefenseV10_fla
Section 18
//SliderBase_82 (DefenseV10_fla.SliderBase_82)
package DefenseV10_fla {
import flash.display.*;
public dynamic class SliderBase_82 extends MovieClip {
public var playerUpdateButton:SimpleButton;
public var repairButton:SimpleButton;
public var baseUpdateButton:SimpleButton;
}
}//package DefenseV10_fla
Section 19
//MochiDigits (mochi.MochiDigits)
package mochi {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function reencode():void{
var _local1:uint;
_local1 = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function toString():String{
var _local1:String;
_local1 = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function get value():Number{
return (Number(this.toString()));
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String;
_local3 = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi
Section 20
//MochiScores (mochi.MochiScores)
package mochi {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
if (options.clip != null){
if ((options.clip is Sprite)){
MochiServices.setContainer(options.clip);
};
delete options.clip;
} else {
MochiServices.setContainer();
};
MochiServices.stayOnTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
_local2 = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (_arg1 != null){
if (_arg1.error != null){
if (_arg1.error == true){
if (onErrorHandler != null){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
};
};
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi
Section 21
//MochiServices (mochi.MochiServices)
package mochi {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _listenChannel:LocalConnection;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _startTime:Number;
private static var _connecting:Boolean = false;
public static var onError:Object;
private static var _listenChannelName:String = "__ms_";
private static var _servicesURL:String = "http://www.mochiads.com/static/lib/services/services.swf";
public static var netup:Boolean = true;
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_sendChannel.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
onError("NotConnected");
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
public static function get connected():Boolean{
return (_connected);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (_clip != null){
if (_clip._queue != null){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local3:Array;
var _local4:int;
var _local5:Array;
var _local6:Array;
var _local7:MovieClip;
var _local8:LocalConnection;
var _local9:String;
var _local10:ByteArray;
var _local11:ByteArray;
var _local12:uint;
var _local13:uint;
var _local14:Loader;
_local3 = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
_local5 = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
_local6 = [0, 64, 0, 0, 0];
_local7 = new MovieClip();
_local8 = new LocalConnection();
_local9 = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().getTime()));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
_local10 = new ByteArray();
_local11 = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
_local12 = ((_local3.length + _local11.length) + 4);
_local13 = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var vars:Object;
var avm1Click:DisplayObject;
var s:String;
var i:Number;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
vars = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
s = "?";
i = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
var _local2:Rectangle;
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
_local2 = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_listenChannel.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
};
return (_local2);
}
public static function getVersion():String{
return ("1.43");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
if (_clip.parent != null){
Sprite(_clip.parent).removeChild(_clip);
};
}
private static function onStatus(_arg1:StatusEvent):void{
switch (_arg1.level){
case "error":
_connected = false;
_listenChannel.connect(_listenChannelName);
break;
};
}
public static function get id():String{
return (_id);
}
private static function urlOptions(_arg1:Object):Object{
var _local2:Object;
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
_local2 = {};
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function initComChannels():void{
if (!_connected){
_sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_listenChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_clip.onReceive = function (_arg1:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = this.client._callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete this.client._callbacks[cb];
};
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
trace("connected!");
_connecting = false;
_connected = true;
while (_clip._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function listen():void{
_listenChannel = new LocalConnection();
_listenChannel.client = _clip;
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
_listenChannel.allowDomain("*", "localhost");
_listenChannel.allowInsecureDomain("*", "localhost");
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var clipname:String;
var f:Function;
var req:URLRequest;
var vars:URLVariables;
var id = _arg1;
var clip = _arg2;
clipname = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(clip).servicesURL != undefined){
_servicesURL = urlOptions(clip).servicesURL;
};
MochiServices.allowDomains(_servicesURL);
_clip = createEmptyMovieClip(clip, clipname, 10336, false);
_loader = new Loader();
_timer = new Timer(1000, 0);
_startTime = getTimer();
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
f = function (_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor((Math.random() * 99999))));
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
req = new URLRequest(_servicesURL);
vars = new URLVariables();
vars.listenLC = _listenChannelName;
vars.mochiad_options = clip.loaderInfo.parameters.mochiad_options;
req.data = vars;
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
listen();
return (_clip);
}
public static function get clip():Object{
return (_container);
}
public static function bringToTop(_arg1:Event):void{
var e = _arg1;
if (MochiServices.clip != null){
if (MochiServices.childClip != null){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
};
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var mc:MovieClip;
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
mc = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function connectWait(_arg1:TimerEvent):void{
if ((getTimer() - _startTime) > 10000){
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_timer.stop();
};
}
}
}//package mochi
Section 22
//BigExplode (BigExplode)
package {
public class BigExplode extends GameObject {
}
}//package
Section 23
//Boss (Boss)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.geom.*;
public class Boss extends Enemy {
var pt:Point;
var fireAngle;// = 0.261666666666667
var rocketAngle;// = 40
var lightFire:Sound;
public var currentRocketNum:int;// = 0
var rocketNumLimits;// = 1
public var turretRocket1:MovieClip;
public var turretRocket4:MovieClip;
public var turretRocket2:MovieClip;
public var turretRocket3:MovieClip;
var heavyFire:Sound;
public var body:MovieClip;
public function Boss(){
rocketNumLimits = 1;
currentRocketNum = 0;
fireAngle = ((15 * 3.14) / 180);
rocketAngle = 40;
super();
speed = 1;
keepDistance = 250;
keepDistanceForCore = 400;
fireRate = 4000;
HPTable = bossHPTable;
heavyFire = new sfx_enemy_heavygun();
lightFire = new sfx_enemy_lightgun();
}
override protected function getDamage():Number{
return (bossDamageTable[iCurrentEnemyLevel]);
}
override protected function playShootSound():void{
heavyFire.play();
lightFire.play();
}
override public function getMaterial():int{
return (bossMaterialTable[iCurrentEnemyLevel]);
}
override protected function onFire(_arg1:TimerEvent):void{
if (fireTarget){
if ((fireTarget is Core)){
if (Tools.distance((root as Main).gameStage._core.x, (root as Main).gameStage._core.y, x, y) < shootRangeForCore){
bossShoot();
if (Main.bHasSound){
playShootSound();
};
};
} else {
if ((fireTarget is Player)){
if (Tools.distance((root as Main).gameStage._player.x, (root as Main).gameStage._player.y, x, y) < shootRangeForPlayer){
bossShoot();
if (Main.bHasSound){
playShootSound();
};
};
if (bShootBack){
bShootBack = false;
};
};
};
};
}
function bossShoot():void{
var _local1:Rocket_Gun3;
var _local2:int;
var _local3:Bullet;
_local2 = 0;
while (_local2 < 4) {
_local1 = new Rocket_Gun3();
_local1.setRocketLifeTime(Rocket_Gun3.rocketLife);
_local1.bType = "Enemy_Bullet";
_local1.bulletDamage = getDamage();
_local1.setOwner(this);
pt = new Point(getRocketGun(_local2).x, getRocketGun(_local2).y);
pt = this.localToGlobal(pt);
_local1.ShootFromTo((pt.x + GameStage._camera.posX), (pt.y + GameStage._camera.posY), (fireDirection + ((((_local2 - 1.5) * rocketAngle) * Math.PI) / 180)));
(_local1 as Rocket_Gun3).bGuiding = true;
(root as Main).gameStage.gameScene.addChild(_local1);
_local2++;
};
_local2 = 0;
while (_local2 < 3) {
_local3 = new Bullet_Enemy();
_local3.bType = "Enemy_Bullet";
_local3.bulletDamage = getDamage();
_local3.ShootFromTo(x, y, (fireDirection + ((_local2 - 1) * fireAngle)));
(root as Main).gameStage.gameScene.addChild(_local3);
_local2++;
};
}
override protected function setBodyRotation(_arg1:Number):void{
rotation = _arg1;
}
override public function getScore():int{
return (1);
}
function getRocketGun(_arg1:int):MovieClip{
switch (_arg1){
case 0:
return (turretRocket1);
case 1:
return (turretRocket2);
case 2:
return (turretRocket3);
case 3:
return (turretRocket4);
};
return (this);
}
override protected function setTurretRotation(_arg1:Number):void{
turretRocket1.rotation = (-(rocketAngle) * 1.5);
turretRocket2.rotation = (-(rocketAngle) * 0.5);
turretRocket3.rotation = (rocketAngle * 0.5);
turretRocket4.rotation = (rocketAngle * 1.5);
}
}
}//package
Section 24
//bubbleboxlogo (bubbleboxlogo)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class bubbleboxlogo extends MovieClip {
public var logo_ro:MovieClip;
public function bubbleboxlogo(){
stop();
addEventListener(MouseEvent.ROLL_OVER, onRollOver);
addEventListener(MouseEvent.ROLL_OUT, onRollOut);
addEventListener(MouseEvent.CLICK, onClickLogo);
}
function onClickLogo(_arg1:Event):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.2games.com/clickreg.php?type=gamestats&id=1232&subid=logoatend");
navigateToURL(_local2, "_blank");
}
function onRollOut(_arg1:Event):void{
gotoAndStop(1);
}
function onRollOver(_arg1:Event):void{
gotoAndStop(2);
}
}
}//package
Section 25
//BuildNo (BuildNo)
package {
import flash.display.*;
public dynamic class BuildNo extends MovieClip {
}
}//package
Section 26
//BuildYes (BuildYes)
package {
import flash.display.*;
public dynamic class BuildYes extends MovieClip {
}
}//package
Section 27
//Bullet (Bullet)
package {
import flash.events.*;
import flash.media.*;
import flash.utils.*;
public class Bullet extends GameObject {
var bulletDamage:Number;// = 0
var hitSound:Sound;
var bulletSpeed:Number;// = 24
var lifeTimer:Timer;
var delX:Number;
var owner;// = null
var delY:Number;
public var bType:String;// = "Player_Bullet"
var lifeTime:Number;// = 3000
public function Bullet(){
bType = "Player_Bullet";
bulletSpeed = 24;
bulletDamage = 0;
lifeTime = 3000;
owner = null;
hitSound = new sfx_bullethit();
super();
setLifeTime();
}
protected function setLifeTime():void{
lifeTimer = new Timer(lifeTime, 1);
lifeTimer.addEventListener(TimerEvent.TIMER, onLifeOut);
lifeTimer.start();
}
public function setOwner(_arg1):void{
owner = _arg1;
}
protected function moveBullet():void{
x = (x + (bulletSpeed * delX));
y = (y + (bulletSpeed * delY));
}
public function ShootFromTo(_arg1:Number, _arg2:Number, _arg3:Number):void{
x = _arg1;
y = _arg2;
delX = Math.cos(_arg3);
delY = Math.sin(_arg3);
rotation = (((_arg3 * 180) / Math.PI) - 90);
}
protected function onLifeOut(_arg1:TimerEvent):void{
if (root){
explode();
};
}
function explode():void{
var _local1:Explode;
_local1 = new Explode();
_local1.x = x;
_local1.y = y;
(root as Main).gameStage.gameScene.addChild(_local1);
(root as Main).gameStage.gameScene.removeChild(this);
}
override protected function enterFrameHandle(_arg1:Event):void{
var _local2:*;
var _local3:*;
var _local4:int;
_local2 = (root as Main).gameStage.gameScene;
moveBullet();
if ((((((((x < 0)) || ((x > Main._sceneWidth)))) || ((y < 0)))) || ((y > Main._sceneHeight)))){
parent.removeChild(this);
};
if (root){
if (bType == "Player_Bullet"){
_local4 = 0;
while (_local4 < _local2.numChildren) {
_local3 = _local2.getChildAt(_local4);
if ((_local3 is Enemy)){
if ((_local3 as Enemy).hitTestPoint((x - GameStage._camera.posX), (y - GameStage._camera.posY), true)){
(_local3 as Enemy).damageHP(bulletDamage);
if ((owner is Player)){
(_local3 as Enemy).shootBackToPlayer();
};
if (Main.bHasSound){
hitSound.play();
};
explode();
break;
};
};
_local4++;
};
} else {
_local4 = 0;
while (_local4 < _local2.numChildren) {
_local3 = _local2.getChildAt(_local4);
if ((((_local3 is Player)) && ((_local3.visible == true)))){
if ((_local3 as Player).hitTestPoint((x - GameStage._camera.posX), (y - GameStage._camera.posY), true)){
if ((_local3 as Player).bInvulnerable == false){
(_local3 as Player).damageHP(bulletDamage);
};
if (Main.bHasSound){
hitSound.play();
};
explode();
break;
};
};
if ((_local3 is Wall)){
if ((_local3 as Wall).hitTestPoint((x - GameStage._camera.posX), (y - GameStage._camera.posY), true)){
if ((_local3 as Wall).bTouchable){
(_local3 as Wall).damageHP(bulletDamage);
if (Main.bHasSound){
hitSound.play();
};
explode();
break;
};
};
};
if ((_local3 is Core)){
if ((_local3 as Core).hitTestPoint((x - GameStage._camera.posX), (y - GameStage._camera.posY), true)){
(_local3 as Core).damageHP(bulletDamage);
if (Main.bHasSound){
hitSound.play();
};
explode();
break;
};
};
_local4++;
};
};
};
}
}
}//package
Section 28
//Bullet_Enemy (Bullet_Enemy)
package {
public class Bullet_Enemy extends Bullet {
public function Bullet_Enemy(){
lifeTime = 4000;
bulletSpeed = 12;
}
}
}//package
Section 29
//Bullet_Gun2 (Bullet_Gun2)
package {
public class Bullet_Gun2 extends Bullet {
}
}//package
Section 30
//BulletTurret1 (BulletTurret1)
package {
public class BulletTurret1 extends Bullet {
}
}//package
Section 31
//BulletTurret2 (BulletTurret2)
package {
public class BulletTurret2 extends Bullet {
}
}//package
Section 32
//BulletTurret3 (BulletTurret3)
package {
public class BulletTurret3 extends Rocket_Gun3 {
}
}//package
Section 33
//Camera (Camera)
package {
public class Camera {
public var posX:Number;// = 0
public var posY:Number;// = 0
public var maxOffSetY:Number;// = 0
public var maxOffSetX:Number;// = 0
public var targetPosX:Number;// = 0
public var targetPosY:Number;// = 0
public function Camera(){
posX = 0;
posY = 0;
targetPosX = 0;
targetPosY = 0;
maxOffSetX = 0;
maxOffSetY = 0;
super();
}
public function updateCamera(_arg1:GameObject):void{
var _local2:*;
var _local3:*;
_local2 = (_arg1.mouseX / 2);
_local3 = (_arg1.mouseY / 2);
if (Math.abs(_local2) > maxOffSetX){
_local2 = (_local2 * (maxOffSetX / Math.abs(_local2)));
};
if (Math.abs(_local3) > maxOffSetY){
_local3 = (_local3 * (maxOffSetY / Math.abs(_local3)));
};
targetPosX = ((_arg1.x + _local2) - (Main._viewWidth / 2));
targetPosY = ((_arg1.y + _local3) - (Main._viewHeight / 2));
if (targetPosX < 0){
targetPosX = 0;
};
if (targetPosY < 0){
targetPosY = 0;
};
if (targetPosX > (Main._sceneWidth - Main._viewWidth)){
targetPosX = (Main._sceneWidth - Main._viewWidth);
};
if (targetPosY > (Main._sceneHeight - Main._viewHeight)){
targetPosY = (Main._sceneHeight - Main._viewHeight);
};
posX = ((posX + targetPosX) / 2);
posY = ((posY + targetPosY) / 2);
}
public function setPosition(_arg1:Number, _arg2:Number):void{
posX = _arg1;
posY = _arg2;
}
public function setOffSet(_arg1:Number, _arg2:Number):void{
maxOffSetX = _arg1;
maxOffSetY = _arg2;
}
}
}//package
Section 34
//Core (Core)
package {
import flash.events.*;
import flash.media.*;
import flash.utils.*;
public class Core extends GameObject implements IHPObject {
var hpBar:HPBar;
var gameoverTimer:Timer;
var destroySound:Sound;
var overSound:Sound;
var coreHP:Number;// = 500
public static var GAME_OVER:String = "gameover";
public static var collisionDistance = 240;
public function Core(){
coreHP = 500;
destroySound = new sfx_explosion2();
overSound = new sfx_gameover();
super();
setHP(coreHP);
gotoAndStop(1);
}
public function getDamageLevel():int{
var _local1:Number;
_local1 = (hpBar._currentHP / hpBar.fullHP);
if (_local1 > 0.75){
gotoAndStop(1);
return (1);
};
if (_local1 > 0.5){
gotoAndStop(2);
return (2);
};
if (_local1 > 0.25){
gotoAndStop(3);
return (3);
};
gotoAndStop(4);
return (4);
}
public function onHPOut(_arg1:Event):void{
gameoverTimer = new Timer(4000, 1);
gameoverTimer.addEventListener(TimerEvent.TIMER, onGameOver);
gameoverTimer.start();
if (Main.bHasSound){
destroySound.play();
overSound.play();
};
}
public function damageHP(_arg1:Number):void{
if (hpBar){
hpBar.takeDamage(_arg1);
if (getDamageLevel() > 3){
(root as Main).gameStage.gameText.setText("Core low on health!");
} else {
(root as Main).gameStage.gameText.setText("Core under attack!");
};
};
}
public function showHP(_arg1:Boolean):void{
if (_arg1 == false){
removeChild(hpBar);
};
}
function onGameOver(_arg1:TimerEvent):void{
var _local2:Event;
Main.loseReason = "Core Down";
_local2 = new Event(GAME_OVER, true);
dispatchEvent(_local2);
}
public function setHP(_arg1:Number):void{
hpBar = new HPBar();
hpBar.setHP(_arg1);
hpBar.y = (this.height / 2);
addChild(hpBar);
hpBar.addEventListener(HPBar.OUT_OF_HP, onHPOut);
showHP(false);
}
}
}//package
Section 35
//CoreDefense1 (CoreDefense1)
package {
import flash.media.*;
public dynamic class CoreDefense1 extends Sound {
}
}//package
Section 36
//DifficultyPage (DifficultyPage)
package {
import flash.events.*;
import flash.display.*;
public class DifficultyPage extends MovieClip {
public var normalBtn:SimpleButton;
public var easyBtn:SimpleButton;
public var hardBtn:SimpleButton;
public var backButton:SimpleButton;
public static var PLAY_GAME_EASY:String = "playgame_easy";
public static var BACK_TUTORIAL:String = "back_tut";
public static var PLAY_GAME_NORMAL:String = "playgame_normal";
public static var PLAY_GAME_HARD:String = "playgame_hard";
public function DifficultyPage(){
easyBtn.addEventListener(MouseEvent.CLICK, onPlay);
normalBtn.addEventListener(MouseEvent.CLICK, onPlay);
hardBtn.addEventListener(MouseEvent.CLICK, onPlay);
backButton.addEventListener(MouseEvent.CLICK, onBack);
}
function onBack(_arg1:Event):void{
var _local2:Event;
_local2 = new Event(BACK_TUTORIAL, true);
dispatchEvent(_local2);
parent.removeChild(this);
}
function onPlay(_arg1:MouseEvent):void{
var _local2:Event;
if (_arg1.target == easyBtn){
_local2 = new Event(PLAY_GAME_EASY, true);
};
if (_arg1.target == normalBtn){
_local2 = new Event(PLAY_GAME_NORMAL, true);
};
if (_arg1.target == hardBtn){
_local2 = new Event(PLAY_GAME_HARD, true);
};
dispatchEvent(_local2);
parent.removeChild(this);
}
}
}//package
Section 37
//Enemy (Enemy)
package {
import flash.events.*;
import flash.media.*;
import flash.utils.*;
public class Enemy extends GameObject implements IHPObject {
const states;
var hpBar:HPBar;
var keepDistanceForCore:Number;// = 250
var fireRate:Number;// = 1000
var shootRangeForPlayer:Number;// = 750
var speed:Number;// = 3
var bShootBack:Boolean;// = false
var bInPosition:Boolean;// = false
protected var fireTarget:GameObject;// = null
var DamageTable;
var iGoForCore:int;// = 1
var keepDistance:Number;// = 150
var angularSpeed:Number;// = 3
var currentState:String;// = "goForCore"
var HPTable;
var fireTimer:Timer;
var explodeSound:Sound;
protected var moveTarget:GameObject;// = null
var shootRangeForCore:Number;// = 500
protected var iCurrentEnemyLevel:int;// = 0
var MaterialTable;
var fireDirection:Number;// = 0
static var bossHPTable = [420, 700, 880, 1060, 1220];
static var scoutDamageTable = [5, 7, 9, 11, 13];
static var rangerMaterialTable = [3, 4, 5, 6, 7];
static var scoutHPTable = [40, 60, 80, 140, 180];
static var rangerDamageTable = [10, 13, 16, 19, 22];
static var scoutMaterialTable = [2, 2, 3, 3, 4];
static var bossMaterialTable = [25, 30, 35, 40, 45];
static var rangerHPTable = [80, 120, 160, 240, 280];
static var bossDamageTable = [10, 12, 14, 16, 18];
static var tankDamageTable = [20, 24, 28, 32, 36];
static var tankHPTable = [120, 200, 280, 400, 480];
static var tankMaterialTable = [5, 7, 9, 11, 14];
public function Enemy(){
states = ["goForCore", "goForPlayer"];
currentState = "goForCore";
speed = 3;
keepDistance = 150;
keepDistanceForCore = 250;
shootRangeForPlayer = 750;
shootRangeForCore = 500;
fireRate = 1000;
fireDirection = 0;
angularSpeed = 3;
iCurrentEnemyLevel = 0;
iGoForCore = 1;
bInPosition = false;
fireTarget = null;
moveTarget = null;
bShootBack = false;
super();
explodeSound = new sfx_explosion1();
}
public function getMaterial():int{
return (0);
}
protected function selfExplode():void{
var _local1:PickUp;
var _local2:BigExplode;
_local1 = new PickUp();
_local1.x = x;
_local1.y = y;
_local1.mymaterial = getMaterial();
(root as Main).gameStage.pickupLayer.addChild(_local1);
_local2 = new BigExplode();
_local2.rotation = (Math.random() * 360);
_local2.x = x;
_local2.y = y;
(root as Main).gameStage.gameScene.addChild(_local2);
if (Main.bHasSound){
explodeSound.play();
};
}
public function shootBackToPlayer():void{
if (!bInPosition){
bShootBack = true;
};
}
override protected function addedToStageHandle(_arg1:Event):void{
addEventListener(Event.ENTER_FRAME, enterFrameHandle);
fireTimer = new Timer(fireRate);
fireTimer.addEventListener(TimerEvent.TIMER, onFire);
fireTimer.start();
}
protected function checkMoveState():void{
}
protected function confirmTarget():void{
var _local1:Number;
_local1 = Tools.distance((root as Main).gameStage._player.x, (root as Main).gameStage._player.y, x, y);
if (currentState == "goForCore"){
if ((((_local1 < keepDistance)) || (bShootBack))){
fireTarget = (root as Main).gameStage._player;
} else {
fireTarget = (root as Main).gameStage._core;
};
} else {
fireTarget = (root as Main).gameStage._player;
};
}
protected function getDamage():Number{
return (0);
}
protected function setTurretRotation(_arg1:Number):void{
}
override protected function removeFromStageHandle(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, enterFrameHandle);
fireTimer.stop();
fireTimer.removeEventListener(TimerEvent.TIMER, onFire);
}
public function getScore():int{
return (0);
}
protected function playShootSound():void{
}
public function damageHP(_arg1:Number):void{
if (hpBar){
hpBar.takeDamage(_arg1);
};
}
function goForTarget(_arg1:GameObject):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:Number;
var _local9:Number;
var _local10:*;
moveTarget = _arg1;
_local2 = (_arg1.x - x);
_local3 = (_arg1.y - y);
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
_local2 = (_local2 / _local4);
_local3 = (_local3 / _local4);
_local5 = Math.atan((_local3 / _local2));
_local6 = ((_local5 / Math.PI) * 180);
_local7 = (_local6 + 90);
if (_local2 < 0){
_local7 = (_local7 - 180);
_local5 = (_local5 - Math.PI);
};
setBodyRotation(_local7);
_local8 = 0;
_local9 = 0;
if (currentState == "goForCore"){
_local9 = keepDistanceForCore;
} else {
_local9 = keepDistance;
};
if (speed > (_local4 - _local9)){
_local8 = (_local4 - _local9);
if (_local8 < 0){
_local8 = 0;
};
} else {
_local8 = speed;
};
if (_local8 <= 0.5){
bInPosition = true;
} else {
bInPosition = false;
};
x = (x + (_local8 * _local2));
y = (y + (_local8 * _local3));
confirmTarget();
_local2 = (fireTarget.x - x);
_local3 = (fireTarget.y - y);
fireDirection = Math.atan((_local3 / _local2));
_local6 = ((fireDirection / Math.PI) * 180);
_local10 = (_local6 + 90);
if (_local2 < 0){
_local10 = (_local10 - 180);
fireDirection = (fireDirection - Math.PI);
};
setTurretRotation(_local10);
}
public function showHP(_arg1:Boolean):void{
}
protected function setBodyRotation(_arg1:Number):void{
}
protected function onFire(_arg1:TimerEvent):void{
var _local2:Bullet;
if (fireTarget){
if ((fireTarget is Core)){
if (Tools.distance((root as Main).gameStage._core.x, (root as Main).gameStage._core.y, x, y) < shootRangeForCore){
_local2 = new Bullet_Enemy();
_local2.bType = "Enemy_Bullet";
_local2.bulletDamage = getDamage();
_local2.ShootFromTo(x, y, fireDirection);
(root as Main).gameStage.gameScene.addChild(_local2);
if (Main.bHasSound){
playShootSound();
};
};
} else {
if ((fireTarget is Player)){
if (Tools.distance((root as Main).gameStage._player.x, (root as Main).gameStage._player.y, x, y) < shootRangeForPlayer){
_local2 = new Bullet_Enemy();
_local2.bType = "Enemy_Bullet";
_local2.bulletDamage = getDamage();
_local2.ShootFromTo(x, y, fireDirection);
(root as Main).gameStage.gameScene.addChild(_local2);
if (Main.bHasSound){
playShootSound();
};
};
if (bShootBack){
bShootBack = false;
};
};
};
};
}
protected function collisionHandler():void{
var _local1:int;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:Number;
_local1 = 0;
while (_local1 < (root as Main).gameStage.gameScene.numChildren) {
_local2 = (root as Main).gameStage.gameScene.getChildAt(_local1);
if ((((_local2 is Enemy)) && (!((_local2 == this))))){
_local5 = Tools.distance(x, y, (_local2 as GameObject).x, (_local2 as GameObject).y);
if ((((_local5 < ((this.width + this.height) / 4))) && ((Math.random() > 0.5)))){
_local3 = ((_local2 as GameObject).x - x);
_local4 = ((_local2 as GameObject).y - y);
x = (x - (_local3 / _local5));
y = (y - (_local4 / _local5));
};
};
if ((_local2 is Core)){
_local5 = Tools.distance(x, y, (_local2 as GameObject).x, (_local2 as GameObject).y);
if (_local5 < Core.collisionDistance){
_local3 = ((_local2 as GameObject).x - x);
_local4 = ((_local2 as GameObject).y - y);
x = (x - ((_local3 / _local5) * (Core.collisionDistance - _local5)));
y = (y - ((_local4 / _local5) * (Core.collisionDistance - _local5)));
};
};
_local1++;
};
}
protected function getNearestWallCore():GameObject{
return ((root as Main).gameStage._core);
}
protected function angularMove():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:*;
var _local6:*;
if (moveTarget){
_local1 = (moveTarget.x - x);
_local2 = (moveTarget.y - y);
_local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
_local1 = (_local1 / _local3);
_local2 = (_local2 / _local3);
_local4 = (_local3 - Math.sqrt(((_local3 * _local3) - (angularSpeed * angularSpeed))));
x = (x + (_local1 * _local4));
y = (y + (_local2 * _local4));
_local5 = (-1 * _local2);
_local6 = _local1;
x = (x + (_local5 * angularSpeed));
y = (y + (_local6 * angularSpeed));
};
}
public function setBehavior(_arg1:int):void{
if (_arg1 == 0){
currentState = "goForPlayer";
} else {
currentState = "goForCore";
};
}
public function onHPOut(_arg1:Event):void{
var _local2:*;
_local2 = getScore();
(root as Main).gameStage.gameHud.addScore(_local2);
selfExplode();
Main.enemyKilled++;
(root as Main).gameStage.gameScene.removeChild(this);
}
public function setHP(_arg1:Number):void{
hpBar = new HPBar();
hpBar.setHP(_arg1);
addChild(hpBar);
hpBar.addEventListener(HPBar.OUT_OF_HP, onHPOut);
}
override protected function enterFrameHandle(_arg1:Event):void{
checkMoveState();
switch (currentState){
case "goForCore":
goForTarget(getNearestWallCore());
break;
case "goForPlayer":
goForTarget((root as Main).gameStage._player);
break;
};
super.enterFrameHandle(_arg1);
collisionHandler();
if (bInPosition){
angularMove();
};
}
public function setLevel(_arg1:int):void{
iCurrentEnemyLevel = (_arg1 - 1);
setHP(HPTable[iCurrentEnemyLevel]);
hpBar.y = (this.height / 2);
}
}
}//package
Section 38
//Explode (Explode)
package {
public class Explode extends GameObject {
public function Explode(){
addFrameScript(15, frame16);
}
function frame16(){
stop();
parent.removeChild(this);
}
}
}//package
Section 39
//FirstSplashScreen (FirstSplashScreen)
package {
import flash.events.*;
import flash.display.*;
public class FirstSplashScreen extends MovieClip {
var tel:int;// = 0
public static const SPLASH_OVER:String = "splash_over";
public function FirstSplashScreen(){
tel = 0;
super();
alpha = 0;
addEventListener(Event.ADDED_TO_STAGE, onAdd);
addEventListener(Event.REMOVED_FROM_STAGE, onRemove);
addEventListener(Event.ENTER_FRAME, onUpdate);
}
function onRemove(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, onUpdate);
}
function onAdd(_arg1:Event):void{
}
function onUpdate(_arg1:Event):void{
var _local2:Event;
if (alpha < 1){
alpha = (alpha + 0.1);
} else {
tel++;
};
if (tel > 120){
alpha = (alpha - 0.15);
if (alpha <= 0){
_local2 = new Event(SPLASH_OVER);
dispatchEvent(_local2);
parent.removeChild(this);
};
};
}
}
}//package
Section 40
//FPSMeter (FPSMeter)
package {
import flash.display.*;
import flash.text.*;
public dynamic class FPSMeter extends MovieClip {
public var tFPS:TextField;
}
}//package
Section 41
//GameHud (GameHud)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
public class GameHud extends MovieClip {
public const initMaterial:int = 50;
var enemyIndicators:Array;// = null
public var basic:MovieClip;
public var _gameMaterial:int;// = 0
public var repairHud:GameHudRepair;
var upSound:Sound;
public var _waveStartButton:StartWaveButton;
var coreIndicators:MovieClip;// = null
var outerIndicators:Array;// = null
var boostFullSound:Sound;
public var iRepairCost:int;// = 0
var clickSound:Sound;
var _newMuteButton:NewMuteButton;
public var baseUpdateHud:GameHudBaseUpdate;
public var playerUpdateHud:GameHudPlayerUpdate;
public var life1:PlayerLife;
var downSound:Sound;
public var life2:PlayerLife;
var innerIndicators:Array;// = null
var rolloverSound:Sound;
public var gameScore:int;// = 0
public var exitHud:GameHudExit;
public function GameHud(){
innerIndicators = null;
outerIndicators = null;
coreIndicators = null;
enemyIndicators = null;
clickSound = new sfx_gui_click();
rolloverSound = new sfx_gui_roll();
boostFullSound = new sfx_speedboostready();
iRepairCost = 0;
gameScore = 0;
_gameMaterial = 0;
super();
addFrameScript(0, frame1, 9, frame10, 18, frame19, 28, frame29, 38, frame39, 48, frame49, 58, frame59);
addEventListener(Event.ADDED_TO_STAGE, addedToStageHandle);
addEventListener(Event.REMOVED_FROM_STAGE, removeFromStageHandle);
basic.slider.gotoAndPlay(1);
basic.slider.sliderBase.playerUpdateButton.addEventListener(MouseEvent.CLICK, onPlayerUpdate);
basic.slider.sliderBase.baseUpdateButton.addEventListener(MouseEvent.CLICK, onBaseUpdate);
basic.slider.sliderBase.repairButton.addEventListener(MouseEvent.CLICK, onRepair);
basic.exitButton.addEventListener(MouseEvent.CLICK, onExit);
basic.slider.sliderBase.playerUpdateButton.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
basic.slider.sliderBase.baseUpdateButton.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
basic.slider.sliderBase.repairButton.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
basic.newMute.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
basic.waveStartButton.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
basic.exitButton.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
basic.slider.sliderBase.playerUpdateButton.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
basic.slider.sliderBase.baseUpdateButton.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
basic.slider.sliderBase.repairButton.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
basic.newMute.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
basic.waveStartButton.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
basic.exitButton.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
upSound = new sfx_gui_upgradeopen();
downSound = new sfx_gui_upgradeclose();
gameMaterial = initMaterial;
}
function onMouseOver(_arg1:Event):void{
Main.cursor.setMenu();
}
public function get gameMaterial():int{
return (_gameMaterial);
}
function onClosePlayerUpdate(_arg1:MouseEvent):void{
if (currentLabel == "playeron"){
basic.slider.sliderBase.playerUpdateButton.removeEventListener(MouseEvent.CLICK, onClosePlayerUpdate);
basic.slider.sliderBase.playerUpdateButton.addEventListener(MouseEvent.CLICK, onPlayerUpdate);
gotoAndPlay("hideplayerupdate");
playDownSound();
playerUpdateHud.closeButton.removeEventListener(MouseEvent.CLICK, onClosePlayerUpdate);
};
}
function onCloseExit(_arg1:MouseEvent):void{
exitHud.gotoAndPlay("rollback");
basic.exitButton.addEventListener(MouseEvent.CLICK, onExit);
basic.exitButton.removeEventListener(MouseEvent.CLICK, onCloseExit);
exitHud.exitBase.closeButton.removeEventListener(MouseEvent.CLICK, onCloseExit);
}
protected function addedToStageHandle(_arg1:Event):void{
addEventListener(Event.ENTER_FRAME, enterFrameHandle);
basic.boostInd.addEventListener("boostfull", onBoostFull);
_newMuteButton = basic.newMute;
_waveStartButton = basic.waveStartButton;
drawExtraLife((root as Main).gameStage._player.extraLives);
}
public function drawExtraLife(_arg1:int):void{
if (_arg1 == 1){
life1.visible = true;
life2.visible = false;
} else {
if (_arg1 == 2){
life1.visible = true;
life2.visible = true;
} else {
life1.visible = false;
life2.visible = false;
};
};
}
function onBaseUpdate(_arg1:MouseEvent):void{
if (playerUpdateHud.visible){
basic.slider.sliderBase.playerUpdateButton.removeEventListener(MouseEvent.CLICK, onClosePlayerUpdate);
basic.slider.sliderBase.playerUpdateButton.addEventListener(MouseEvent.CLICK, onPlayerUpdate);
playerUpdateHud.closeButton.removeEventListener(MouseEvent.CLICK, onClosePlayerUpdate);
};
if (repairHud.visible){
basic.slider.sliderBase.repairButton.removeEventListener(MouseEvent.CLICK, onCloseRepair);
basic.slider.sliderBase.repairButton.addEventListener(MouseEvent.CLICK, onRepair);
repairHud.closeButton.removeEventListener(MouseEvent.CLICK, onCloseRepair);
};
playerUpdateHud.visible = false;
baseUpdateHud.visible = true;
repairHud.visible = false;
basic.slider.sliderBase.baseUpdateButton.removeEventListener(MouseEvent.CLICK, onBaseUpdate);
basic.slider.sliderBase.baseUpdateButton.addEventListener(MouseEvent.CLICK, onCloseBaseUpdate);
gotoAndPlay("showbaseupdate");
playUpSound();
baseUpdateHud.closeButton.addEventListener(MouseEvent.CLICK, onCloseBaseUpdate);
}
function frame1(){
stop();
}
function frame19(){
stop();
}
public function addScore(_arg1:int):void{
if (Main.gameDiff == "Normal"){
_arg1 = (_arg1 * 2);
};
if (Main.gameDiff == "Hard"){
_arg1 = (_arg1 * 3);
};
gameScore = (gameScore + _arg1);
basic.scoreNumber.text = String(gameScore);
}
function onCloseBaseUpdate(_arg1:MouseEvent):void{
if (currentLabel == "baseon"){
basic.slider.sliderBase.baseUpdateButton.removeEventListener(MouseEvent.CLICK, onCloseBaseUpdate);
basic.slider.sliderBase.baseUpdateButton.addEventListener(MouseEvent.CLICK, onBaseUpdate);
gotoAndPlay("hidebaseupdate");
playDownSound();
baseUpdateHud.closeButton.removeEventListener(MouseEvent.CLICK, onCloseBaseUpdate);
};
}
function onMouseOut(_arg1:Event):void{
Main.cursor.setCombat();
}
function onPlayerUpdate(_arg1:MouseEvent):void{
if (baseUpdateHud.visible){
basic.slider.sliderBase.baseUpdateButton.removeEventListener(MouseEvent.CLICK, onCloseBaseUpdate);
basic.slider.sliderBase.baseUpdateButton.addEventListener(MouseEvent.CLICK, onBaseUpdate);
baseUpdateHud.closeButton.removeEventListener(MouseEvent.CLICK, onCloseBaseUpdate);
};
if (repairHud.visible){
basic.slider.sliderBase.repairButton.removeEventListener(MouseEvent.CLICK, onCloseRepair);
basic.slider.sliderBase.repairButton.addEventListener(MouseEvent.CLICK, onRepair);
repairHud.closeButton.removeEventListener(MouseEvent.CLICK, onCloseRepair);
};
baseUpdateHud.visible = false;
playerUpdateHud.visible = true;
repairHud.visible = false;
basic.slider.sliderBase.playerUpdateButton.removeEventListener(MouseEvent.CLICK, onPlayerUpdate);
basic.slider.sliderBase.playerUpdateButton.addEventListener(MouseEvent.CLICK, onClosePlayerUpdate);
gotoAndPlay("showplayerupdate");
playUpSound();
playerUpdateHud.closeButton.addEventListener(MouseEvent.CLICK, onClosePlayerUpdate);
}
protected function removeFromStageHandle(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, enterFrameHandle);
}
function playUpSound():void{
if (Main.bHasSound){
upSound.play();
};
}
function onCloseRepair(_arg1:MouseEvent):void{
if (currentLabel == "repairon"){
basic.slider.sliderBase.repairButton.removeEventListener(MouseEvent.CLICK, onCloseRepair);
basic.slider.sliderBase.repairButton.addEventListener(MouseEvent.CLICK, onRepair);
gotoAndPlay("hiderepair");
playDownSound();
repairHud.closeButton.removeEventListener(MouseEvent.CLICK, onCloseRepair);
};
}
public function set gameMaterial(_arg1:int):void{
_gameMaterial = _arg1;
basic.materialNumber.text = String(_gameMaterial);
}
function frame29(){
stop();
}
function onExit(_arg1:MouseEvent):void{
exitHud.gotoAndPlay("rollout");
basic.exitButton.removeEventListener(MouseEvent.CLICK, onExit);
basic.exitButton.addEventListener(MouseEvent.CLICK, onCloseExit);
exitHud.exitBase.closeButton.addEventListener(MouseEvent.CLICK, onCloseExit);
}
function frame10(){
stop();
}
function onBoostFull(_arg1:Event):void{
(root as Main).gameStage._player.bBoostable = true;
if (Main.bHasSound){
boostFullSound.play();
};
}
function playDownSound():void{
if (Main.bHasSound){
downSound.play();
};
}
function frame49(){
stop();
}
function frame39(){
stop();
}
function onRepair(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:*;
var _local4:Wall;
var _local5:int;
var _local6:*;
if (playerUpdateHud.visible){
basic.slider.sliderBase.playerUpdateButton.removeEventListener(MouseEvent.CLICK, onClosePlayerUpdate);
basic.slider.sliderBase.playerUpdateButton.addEventListener(MouseEvent.CLICK, onPlayerUpdate);
playerUpdateHud.closeButton.removeEventListener(MouseEvent.CLICK, onClosePlayerUpdate);
};
if (baseUpdateHud.visible){
basic.slider.sliderBase.baseUpdateButton.removeEventListener(MouseEvent.CLICK, onCloseBaseUpdate);
basic.slider.sliderBase.baseUpdateButton.addEventListener(MouseEvent.CLICK, onBaseUpdate);
baseUpdateHud.closeButton.removeEventListener(MouseEvent.CLICK, onCloseBaseUpdate);
};
repairHud.visible = true;
playerUpdateHud.visible = false;
baseUpdateHud.visible = false;
iRepairCost = 0;
_local2 = 0;
_local6 = (root as Main).gameStage.gameScene;
_local5 = 0;
while (_local5 < _local6.numChildren) {
_local3 = _local6.getChildAt(_local5);
if ((_local3 is Wall)){
_local4 = (_local3 as Wall);
_local2 = (_local2 + ((GameHudRepair.wallCost[_local4.iWallLevel] * (_local4.hpBar.fullHP - _local4.hpBar.currentHP)) / _local4.hpBar.fullHP));
};
_local5++;
};
iRepairCost = int(_local2);
repairHud.tRepairCost.text = String(iRepairCost);
basic.slider.sliderBase.repairButton.removeEventListener(MouseEvent.CLICK, onRepair);
basic.slider.sliderBase.repairButton.addEventListener(MouseEvent.CLICK, onCloseRepair);
gotoAndPlay("showrepair");
playUpSound();
repairHud.closeButton.addEventListener(MouseEvent.CLICK, onCloseRepair);
}
function frame59(){
stop();
}
public function addMaterial(_arg1:int):void{
_gameMaterial = (_gameMaterial + _arg1);
basic.materialNumber.text = String(_gameMaterial);
}
protected function enterFrameHandle(_arg1:Event):void{
var _local2:int;
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:int;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:Number;
var _local11:*;
if (innerIndicators == null){
innerIndicators = new Array(4);
outerIndicators = new Array(8);
enemyIndicators = new Array(8);
innerIndicators[0] = basic.in1;
innerIndicators[1] = basic.in2;
innerIndicators[2] = basic.in3;
innerIndicators[3] = basic.in4;
outerIndicators[0] = basic.out1;
outerIndicators[1] = basic.out2;
outerIndicators[2] = basic.out3;
outerIndicators[3] = basic.out4;
outerIndicators[4] = basic.out5;
outerIndicators[5] = basic.out6;
outerIndicators[6] = basic.out7;
outerIndicators[7] = basic.out8;
coreIndicators = basic.coreind;
enemyIndicators[0] = basic.emy1;
enemyIndicators[1] = basic.emy2;
enemyIndicators[2] = basic.emy3;
enemyIndicators[3] = basic.emy4;
enemyIndicators[4] = basic.emy5;
enemyIndicators[5] = basic.emy6;
enemyIndicators[6] = basic.emy7;
enemyIndicators[7] = basic.emy8;
};
_local3 = (root as Main).gameStage._innerWalls;
_local4 = (root as Main).gameStage._outerWalls;
_local2 = 0;
while (_local2 < _local3.length) {
innerIndicators[_local2].gotoAndStop(_local3[_local2].getDamageLevel());
_local2++;
};
_local2 = 0;
while (_local2 < _local4.length) {
outerIndicators[_local2].gotoAndStop(_local4[_local2].getDamageLevel());
_local2++;
};
coreIndicators.gotoAndStop((root as Main).gameStage._core.getDamageLevel());
_local5 = [0, 0, 0, 0, 0, 0, 0, 0];
_local6 = 0;
while (_local6 < (root as Main).gameStage.gameScene.numChildren) {
_local7 = (root as Main).gameStage.gameScene.getChildAt(_local6);
if ((_local7 is Enemy)){
_local10 = Tools.distance((root as Main).gameStage._core.x, (root as Main).gameStage._core.y, (_local7 as GameObject).x, (_local7 as GameObject).y);
_local8 = ((_local7 as GameObject).x - (root as Main).gameStage._core.x);
_local9 = ((_local7 as GameObject).y - (root as Main).gameStage._core.y);
_local8 = (_local8 / _local10);
_local9 = (_local9 / _local10);
_local11 = ((Math.atan((_local9 / _local8)) * 180) / Math.PI);
if (_local8 < 0){
_local11 = (_local11 + 180);
};
_local11 = (_local11 + 90);
_local2 = Math.floor((_local11 / (360 / 8)));
var _local12 = _local5;
var _local13 = _local2;
var _local14 = (_local12[_local13] + 1);
_local12[_local13] = _local14;
};
_local6++;
};
_local6 = 0;
while (_local6 < _local5.length) {
if (_local5[_local6] > 10){
_local5[_local6] = 10;
};
_local6++;
};
_local2 = 0;
while (_local2 < enemyIndicators.length) {
enemyIndicators[_local2].alpha = (_local5[_local2] / 4);
_local2++;
};
}
}
}//package
Section 42
//GameHudBaseUpdate (GameHudBaseUpdate)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
public class GameHudBaseUpdate extends MovieClip {
var mouseFollowerYes:MovieClip;// = null
var mouseFollowerNo:MovieClip;// = null
var wallHPCost:Array;
public var turret3:SimpleButton;
public var turret1:SimpleButton;
var wallCoverList:Array;
var upgradeSound:Sound;
public var closeButton:SimpleButton;
public var turret2:SimpleButton;
var iWeaponLevel;// = 0
public var wall1:SimpleButton;
public var wall2:SimpleButton;
public var wall3:SimpleButton;
public var wallCover2:MovieClip;
public var wallCover3:MovieClip;
public var wallCover1:MovieClip;
var warningSound:Sound;
var turretCost:Array;
public function GameHudBaseUpdate(){
turretCost = [35, 50, 250];
wallHPCost = [50, 125, 350];
wallCoverList = new Array(3);
mouseFollowerYes = null;
mouseFollowerNo = null;
iWeaponLevel = 0;
super();
upgradeSound = new sfx_turretplaced();
turret1.addEventListener(MouseEvent.CLICK, onBuildTurret);
turret2.addEventListener(MouseEvent.CLICK, onBuildTurret);
turret3.addEventListener(MouseEvent.CLICK, onBuildTurret);
wall1.addEventListener(MouseEvent.CLICK, onUpgradeWall);
wall2.addEventListener(MouseEvent.CLICK, onUpgradeWall);
wall3.addEventListener(MouseEvent.CLICK, onUpgradeWall);
wallCoverList[0] = wallCover1;
wallCoverList[1] = wallCover2;
wallCoverList[2] = wallCover3;
removeChild(wallCoverList[0]);
warningSound = new sfx_gui_warning1();
turret1.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
turret1.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
turret2.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
turret2.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
turret3.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
turret3.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
wall1.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
wall1.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
wall2.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
wall2.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
wall3.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
wall3.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
closeButton.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
closeButton.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
}
function onMouseOver(_arg1:Event):void{
Main.cursor.setMenu();
}
function onMouseOut(_arg1:Event):void{
Main.cursor.setCombat();
}
function onBuildTurret(_arg1:Event):void{
var _local2:Boolean;
_local2 = false;
if (_arg1.target == turret1){
if ((root as Main).gameStage.gameHud.gameMaterial >= turretCost[0]){
(root as Main).gameStage.gameHud.gameMaterial = ((root as Main).gameStage.gameHud.gameMaterial - turretCost[0]);
iWeaponLevel = 1;
_local2 = true;
};
};
if (_arg1.target == turret2){
if ((root as Main).gameStage.gameHud.gameMaterial >= turretCost[1]){
(root as Main).gameStage.gameHud.gameMaterial = ((root as Main).gameStage.gameHud.gameMaterial - turretCost[1]);
iWeaponLevel = 2;
_local2 = true;
};
};
if (_arg1.target == turret3){
if ((root as Main).gameStage.gameHud.gameMaterial >= turretCost[2]){
(root as Main).gameStage.gameHud.gameMaterial = ((root as Main).gameStage.gameHud.gameMaterial - turretCost[2]);
iWeaponLevel = 3;
_local2 = true;
};
};
if (_local2){
stage.addEventListener(MouseEvent.MOUSE_MOVE, buildTurretMouseMove);
stage.addEventListener(MouseEvent.MOUSE_DOWN, buildTurretDown);
(root as Main).gameStage._player.bCoreMode = true;
(root as Main).gameStage.gameHud.onCloseBaseUpdate(null);
} else {
(root as Main).gameStage.gameText.setText1("No enough Materials!");
if (Main.bHasSound){
warningSound.play();
};
};
}
function onUpgradeWall(_arg1:Event):void{
var _local2:Boolean;
var _local3:*;
var _local4:*;
var _local5:int;
var _local6:*;
_local2 = false;
_local3 = 0;
if (_arg1.target == wall1){
if ((root as Main).gameStage.gameHud.gameMaterial >= wallHPCost[0]){
(root as Main).gameStage.gameHud.gameMaterial = ((root as Main).gameStage.gameHud.gameMaterial - wallHPCost[0]);
addChild(wallCoverList[0]);
removeChild(wallCoverList[1]);
_local3 = 1;
_local2 = true;
};
};
if (_arg1.target == wall2){
if ((root as Main).gameStage.gameHud.gameMaterial >= wallHPCost[1]){
(root as Main).gameStage.gameHud.gameMaterial = ((root as Main).gameStage.gameHud.gameMaterial - wallHPCost[1]);
addChild(wallCoverList[1]);
removeChild(wallCoverList[2]);
_local3 = 2;
_local2 = true;
};
};
if (_arg1.target == wall3){
if ((root as Main).gameStage.gameHud.gameMaterial >= wallHPCost[2]){
(root as Main).gameStage.gameHud.gameMaterial = ((root as Main).gameStage.gameHud.gameMaterial - wallHPCost[2]);
addChild(wallCoverList[2]);
_local3 = 3;
_local2 = true;
};
};
if (_local2){
_local6 = (root as Main).gameStage.gameScene;
_local5 = 0;
while (_local5 < _local6.numChildren) {
_local4 = _local6.getChildAt(_local5);
if ((_local4 is Wall)){
(_local4 as Wall).iWallLevel = _local3;
};
_local5++;
};
(root as Main).gameStage.gameText.setText1("Walls upgraded!");
if (Main.bHasSound){
upgradeSound.play();
};
} else {
(root as Main).gameStage.gameText.setText1("No enough Materials!");
if (Main.bHasSound){
warningSound.play();
};
};
}
function buildTurretDown(_arg1:MouseEvent):void{
var _local2:Pillar;
_local2 = getNearAvailablePillar(_arg1.stageX, _arg1.stageY);
if (_local2 != null){
switch (iWeaponLevel){
case 1:
_local2.upgradeToTurret();
break;
case 2:
_local2.upgradeToArtillary();
break;
case 3:
_local2.upgradeToMissile();
break;
};
(root as Main).gameStage.gameText.setText1("Turret built!");
if (Main.bHasSound){
upgradeSound.play();
};
};
(root as Main).gameStage._player.bCoreMode = false;
(root as Main).gameStage.gameScene.coreMarker.removeChild(mouseFollowerYes);
(root as Main).gameStage.gameScene.coreMarker.removeChild(mouseFollowerNo);
mouseFollowerYes = null;
mouseFollowerNo = null;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, buildTurretMouseMove);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, buildTurretDown);
}
function buildTurretMouseMove(_arg1:MouseEvent):void{
if (mouseFollowerYes == null){
mouseFollowerYes = new BuildYes();
mouseFollowerNo = new BuildNo();
(root as Main).gameStage.gameScene.coreMarker.addChild(mouseFollowerYes);
(root as Main).gameStage.gameScene.coreMarker.addChild(mouseFollowerNo);
};
mouseFollowerYes.x = (root as Main).gameStage.gameScene.coreMarker.mouseX;
mouseFollowerYes.y = (root as Main).gameStage.gameScene.coreMarker.mouseY;
mouseFollowerNo.x = (root as Main).gameStage.gameScene.coreMarker.mouseX;
mouseFollowerNo.y = (root as Main).gameStage.gameScene.coreMarker.mouseY;
if (getNearAvailablePillar(_arg1.stageX, _arg1.stageY) != null){
mouseFollowerYes.visible = true;
mouseFollowerNo.visible = false;
} else {
mouseFollowerYes.visible = false;
mouseFollowerNo.visible = true;
};
}
function getNearAvailablePillar(_arg1:Number, _arg2:Number):Pillar{
var _local3:*;
var _local4:int;
var _local5:*;
var _local6:*;
var _local7:Pillar;
_local5 = (root as Main).gameStage.gameScene;
_local7 = null;
_local4 = 0;
while (_local4 < _local5.numChildren) {
_local3 = _local5.getChildAt(_local4);
if ((_local3 is Pillar)){
_local6 = Tools.distance((GameStage._camera.posX + _arg1), (GameStage._camera.posY + _arg2), _local3.x, _local3.y);
if (_local6 < (((_local3 as Pillar).width + (_local3 as Pillar).height) / 4)){
if ((_local3 as Pillar).item == null){
_local7 = (_local3 as Pillar);
break;
};
break;
};
};
_local4++;
};
return (_local7);
}
}
}//package
Section 43
//GameHudExit (GameHudExit)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
public class GameHudExit extends MovieClip {
public var exitBase:MovieClip;
public static var GAME_OVER:String = "gameover";
public function GameHudExit(){
addFrameScript(8, frame9, 19, frame20);
gotoAndStop("end");
exitBase.yesButton.addEventListener(MouseEvent.CLICK, onConfirm);
exitBase.noButton.addEventListener(MouseEvent.CLICK, onConfirm);
exitBase.yesButton.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
exitBase.yesButton.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
exitBase.noButton.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
exitBase.noButton.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
exitBase.closeButton.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
exitBase.closeButton.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
}
function onMouseOver(_arg1:Event):void{
Main.cursor.setMenu();
}
function frame20(){
stop();
}
function onMouseOut(_arg1:Event):void{
Main.cursor.setCombat();
}
function frame9(){
stop();
}
function onConfirm(_arg1:Event):void{
var _local2:Event;
if (_arg1.target == exitBase.yesButton){
_local2 = new Event(GAME_OVER, true);
dispatchEvent(_local2);
};
if (_arg1.target == exitBase.noButton){
(root as Main).gameStage.gameHud.onCloseExit(null);
};
}
}
}//package
Section 44
//GameHudPlayerUpdate (GameHudPlayerUpdate)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
public class GameHudPlayerUpdate extends MovieClip {
public var armorBtn2:SimpleButton;
public var armorBtn3:SimpleButton;
public var armorBtn1:SimpleButton;
public var speedBtn1:SimpleButton;
public var speedBtn3:SimpleButton;
public var speedBtn2:SimpleButton;
var gunCost:Array;
var upgradeSound:Sound;
public var closeButton:SimpleButton;
public var speedCover3:MovieClip;
public var speedCover1:MovieClip;
public var armorCover1:MovieClip;
var armorCoverList:Array;
public var speedCover2:MovieClip;
public var armorCover3:MovieClip;
public var armorCover2:MovieClip;
var gunCoverList:Array;
public var gunBtn1:SimpleButton;
public var gunBtn3:SimpleButton;
public var gunCover1:MovieClip;
public var gunCover2:MovieClip;
public var gunBtn2:SimpleButton;
var speedCoverList:Array;
public var gunCover3:MovieClip;
var speedCost:Array;
var armorCost:Array;
var warningSound:Sound;
public function GameHudPlayerUpdate(){
gunCost = [100, 200, 500];
speedCost = [25, 50, 75];
armorCost = [50, 125, 350];
speedCoverList = new Array(3);
gunCoverList = new Array(3);
armorCoverList = new Array(3);
upgradeSound = new sfx_upgradebought();
super();
gunBtn1.addEventListener(MouseEvent.CLICK, onGun);
gunBtn2.addEventListener(MouseEvent.CLICK, onGun);
gunBtn3.addEventListener(MouseEvent.CLICK, onGun);
speedBtn1.addEventListener(MouseEvent.CLICK, onSpeed);
speedBtn2.addEventListener(MouseEvent.CLICK, onSpeed);
speedBtn3.addEventListener(MouseEvent.CLICK, onSpeed);
armorBtn1.addEventListener(MouseEvent.CLICK, onArmor);
armorBtn2.addEventListener(MouseEvent.CLICK, onArmor);
armorBtn3.addEventListener(MouseEvent.CLICK, onArmor);
gunBtn1.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
gunBtn1.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
gunBtn2.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
gunBtn2.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
gunBtn3.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
gunBtn3.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
speedBtn1.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
speedBtn1.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
speedBtn2.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
speedBtn2.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
speedBtn3.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
speedBtn3.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
armorBtn1.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
armorBtn1.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
armorBtn2.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
armorBtn2.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
armorBtn3.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
armorBtn3.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
closeButton.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
closeButton.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
gunCoverList[0] = gunCover1;
gunCoverList[1] = gunCover2;
gunCoverList[2] = gunCover3;
speedCoverList[0] = speedCover1;
speedCoverList[1] = speedCover2;
speedCoverList[2] = speedCover3;
armorCoverList[0] = armorCover1;
armorCoverList[1] = armorCover2;
armorCoverList[2] = armorCover3;
removeChild(gunCoverList[0]);
removeChild(speedCoverList[0]);
removeChild(armorCoverList[0]);
warningSound = new sfx_gui_warning1();
}
function onMouseOver(_arg1:Event):void{
Main.cursor.setMenu();
}
function onSpeed(_arg1:Event):void{
if (_arg1.target == speedBtn1){
if ((root as Main).gameStage.gameHud.gameMaterial >= speedCost[0]){
(root as Main).gameStage.gameHud.gameMaterial = ((root as Main).gameStage.gameHud.gameMaterial - speedCost[0]);
(root as Main).gameStage._player.iSpeedLevel = 1;
addChild(speedCoverList[0]);
removeChild(speedCoverList[1]);
(root as Main).gameStage.gameText.setText1("Vehicle upgraded!");
if (Main.bHasSound){
upgradeSound.play();
};
} else {
(root as Main).gameStage.gameText.setText1("No enough Materials!");
if (Main.bHasSound){
warningSound.play();
};
};
};
if (_arg1.target == speedBtn2){
if ((root as Main).gameStage.gameHud.gameMaterial >= speedCost[1]){
(root as Main).gameStage.gameHud.gameMaterial = ((root as Main).gameStage.gameHud.gameMaterial - speedCost[1]);
(root as Main).gameStage._player.iSpeedLevel = 2;
addChild(speedCoverList[1]);
removeChild(speedCoverList[2]);
(root as Main).gameStage.gameText.setText1("Vehicle upgraded!");
if (Main.bHasSound){
upgradeSound.play();
};
} else {
(root as Main).gameStage.gameText.setText1("No enough Materials!");
if (Main.bHasSound){
warningSound.play();
};
};
};
if (_arg1.target == speedBtn3){
if ((root as Main).gameStage.gameHud.gameMaterial >= speedCost[2]){
(root as Main).gameStage.gameHud.gameMaterial = ((root as Main).gameStage.gameHud.gameMaterial - speedCost[2]);
(root as Main).gameStage._player.iSpeedLevel = 3;
addChild(speedCoverList[2]);
(root as Main).gameStage.gameText.setText1("Vehicle upgraded!");
if (Main.bHasSound){
upgradeSound.play();
};
} else {
(root as Main).gameStage.gameText.setText1("No enough Materials!");
if (Main.bHasSound){
warningSound.play();
};
};
};
}
function onArmor(_arg1:Event):void{
if (_arg1.target == armorBtn1){
if ((root as Main).gameStage.gameHud.gameMaterial >= armorCost[0]){
(root as Main).gameStage.gameHud.gameMaterial = ((root as Main).gameStage.gameHud.gameMaterial - armorCost[0]);
addChild(armorCoverList[0]);
removeChild(armorCoverList[1]);
(root as Main).gameStage._player.iHPLevel = 1;
(root as Main).gameStage.gameText.setText1("Vehicle upgraded!");
if (Main.bHasSound){
upgradeSound.play();
};
} else {
(root as Main).gameStage.gameText.setText1("No enough Materials!");
if (Main.bHasSound){
warningSound.play();
};
};
};
if (_arg1.target == armorBtn2){
if ((root as Main).gameStage.gameHud.gameMaterial >= armorCost[1]){
(root as Main).gameStage.gameHud.gameMaterial = ((root as Main).gameStage.gameHud.gameMaterial - armorCost[1]);
addChild(armorCoverList[1]);
removeChild(armorCoverList[2]);
(root as Main).gameStage._player.iHPLevel = 2;
(root as Main).gameStage.gameText.setText1("Vehicle upgraded!");
if (Main.bHasSound){
upgradeSound.play();
};
} else {
(root as Main).gameStage.gameText.setText1("No enough Materials!");
if (Main.bHasSound){
warningSound.play();
};
};
};
if (_arg1.target == armorBtn3){
if ((root as Main).gameStage.gameHud.gameMaterial >= armorCost[2]){
(root as Main).gameStage.gameHud.gameMaterial = ((root as Main).gameStage.gameHud.gameMaterial - armorCost[2]);
addChild(armorCoverList[2]);
(root as Main).gameStage._player.iHPLevel = 3;
(root as Main).gameStage.gameText.setText1("Vehicle upgraded!");
if (Main.bHasSound){
upgradeSound.play();
};
} else {
(root as Main).gameStage.gameText.setText1("No enough Materials!");
if (Main.bHasSound){
warningSound.play();
};
};
};
}
function onMouseOut(_arg1:Event):void{
Main.cursor.setCombat();
}
function onGun(_arg1:Event):void{
if (_arg1.target == gunBtn1){
if ((root as Main).gameStage.gameHud.gameMaterial >= gunCost[0]){
(root as Main).gameStage.gameHud.gameMaterial = ((root as Main).gameStage.gameHud.gameMaterial - gunCost[0]);
(root as Main).gameStage._player.iCurrentGun = 1;
addChild(gunCoverList[0]);
removeChild(gunCoverList[1]);
(root as Main).gameStage.gameText.setText1("Vehicle upgraded!");
if (Main.bHasSound){
upgradeSound.play();
};
} else {
(root as Main).gameStage.gameText.setText1("No enough Materials!");
if (Main.bHasSound){
warningSound.play();
};
};
};
if (_arg1.target == gunBtn2){
if ((root as Main).gameStage.gameHud.gameMaterial >= gunCost[1]){
(root as Main).gameStage.gameHud.gameMaterial = ((root as Main).gameStage.gameHud.gameMaterial - gunCost[1]);
(root as Main).gameStage._player.iCurrentGun = 2;
addChild(gunCoverList[1]);
removeChild(gunCoverList[2]);
(root as Main).gameStage.gameText.setText1("Vehicle upgraded!");
if (Main.bHasSound){
upgradeSound.play();
};
} else {
(root as Main).gameStage.gameText.setText1("No enough Materials!");
if (Main.bHasSound){
warningSound.play();
};
};
};
if (_arg1.target == gunBtn3){
if ((root as Main).gameStage.gameHud.gameMaterial >= gunCost[2]){
(root as Main).gameStage.gameHud.gameMaterial = ((root as Main).gameStage.gameHud.gameMaterial - gunCost[2]);
(root as Main).gameStage._player.iCurrentGun = 3;
addChild(gunCoverList[2]);
(root as Main).gameStage.gameText.setText1("Vehicle upgraded!");
if (Main.bHasSound){
upgradeSound.play();
};
} else {
(root as Main).gameStage.gameText.setText1("No enough Materials!");
if (Main.bHasSound){
warningSound.play();
};
};
};
}
}
}//package
Section 45
//GameHudRepair (GameHudRepair)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
public class GameHudRepair extends MovieClip {
public var noButton:SimpleButton;
public var closeButton:SimpleButton;
public var tRepairCost:TextField;
var warningSound:Sound;
public var yesButton:SimpleButton;
public static var wallCost = [3, 6, 8, 10];
public function GameHudRepair(){
yesButton.addEventListener(MouseEvent.CLICK, onConfirm);
noButton.addEventListener(MouseEvent.CLICK, onConfirm);
yesButton.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
yesButton.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
noButton.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
noButton.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
closeButton.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
closeButton.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
warningSound = new sfx_gui_warning1();
}
function onMouseOver(_arg1:Event):void{
Main.cursor.setMenu();
}
function onMouseOut(_arg1:Event):void{
Main.cursor.setCombat();
}
function onConfirm(_arg1:Event):void{
var _local2:*;
var _local3:int;
var _local4:*;
if ((((_arg1.target == yesButton)) && (((root as Main).gameStage.gameHud.gameMaterial >= (root as Main).gameStage.gameHud.iRepairCost)))){
(root as Main).gameStage.gameHud.gameMaterial = ((root as Main).gameStage.gameHud.gameMaterial - (root as Main).gameStage.gameHud.iRepairCost);
_local4 = (root as Main).gameStage.gameScene;
_local3 = 0;
while (_local3 < _local4.numChildren) {
_local2 = _local4.getChildAt(_local3);
if ((_local2 is Wall)){
(_local2 as Wall).restoreHP();
};
_local3++;
};
(root as Main).gameStage.gameText.setText("Repaired!");
};
(root as Main).gameStage.gameHud.onCloseRepair(null);
}
}
}//package
Section 46
//GameObject (GameObject)
package {
import flash.events.*;
import flash.display.*;
public class GameObject extends MovieClip {
public function GameObject(){
addEventListener(Event.ADDED_TO_STAGE, addedToStageHandle);
addEventListener(Event.REMOVED_FROM_STAGE, removeFromStageHandle);
}
protected function addedToStageHandle(_arg1:Event):void{
addEventListener(Event.ENTER_FRAME, enterFrameHandle);
}
protected function removeFromStageHandle(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, enterFrameHandle);
}
protected function enterFrameHandle(_arg1:Event):void{
}
}
}//package
Section 47
//GameOverPage (GameOverPage)
package {
import flash.events.*;
import flash.display.*;
import mochi.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
public class GameOverPage extends MovieClip {
public var replayBtn:SimpleButton;
public var tKillNum:TextField;
public var btnMoreGames:SimpleButton;
public var tDifficulty:TextField;
public var tMaterialSpent:TextField;
public var tLoseReason:TextField;
public var btnSubmit:SimpleButton;
public var tWave:TextField;
public var tScore:TextField;
public var logo:bubbleboxlogo;
public var tMaterialCollect:TextField;
public static var REPLAY_GAME:String = "replaygame";
public function GameOverPage(){
replayBtn.addEventListener(MouseEvent.CLICK, onRestart);
btnMoreGames.addEventListener(MouseEvent.CLICK, onClickMoreGames);
btnSubmit.addEventListener(MouseEvent.CLICK, onClickSubmit);
}
function onRestart(_arg1:MouseEvent):void{
var _local2:Event;
_local2 = new Event(REPLAY_GAME, true);
dispatchEvent(_local2);
parent.removeChild(this);
}
function onClickMoreGames(_arg1:Event):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.2games.com/clickreg.php?type=gamestats&id=1232&subid=moregamesatend");
navigateToURL(_local2, "_blank");
}
function onClickSubmit(_arg1:Event):void{
Mouse.show();
MochiScores.showLeaderboard({boardID:"4932d7a5e0bfe946", score:(root as Main).gameStage.gameHud.gameScore, onClose:resetGame});
}
function resetGame():void{
Mouse.hide();
}
}
}//package
Section 48
//GameScene (GameScene)
package {
import flash.display.*;
public class GameScene extends MovieClip {
public var scenecollision:MovieClip;
public var background:LevelBG;
public var ow4:Outer_Wall;
public var ow8:Outer_Wall;
public var ow6:Outer_Wall;
public var ow1:Outer_Wall;
public var ow3:Outer_Wall;
public var ow7:Outer_Wall;
public var ow2:Outer_Wall;
public var p11:Pillar;
public var core:Core;
public var ow5:Outer_Wall;
public var p12:Pillar;
public var p10:Pillar;
public var coreMarker:MovieClip;
public var p1:Pillar;
public var iw1:Inner_Wall;
public var iw3:Inner_Wall;
public var p2:Pillar;
public var p3:Pillar;
public var p5:Pillar;
public var iw4:Inner_Wall;
public var p7:Pillar;
public var p8:Pillar;
public var p9:Pillar;
public var iw2:Inner_Wall;
public var p6:Pillar;
public var player:Player;
public var p4:Pillar;
}
}//package
Section 49
//gameslogoro (gameslogoro)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class gameslogoro extends MovieClip {
public function gameslogoro(){
addFrameScript(0, frame1);
addEventListener(MouseEvent.ROLL_OVER, onRollOver);
addEventListener(MouseEvent.ROLL_OUT, onRollOut);
addEventListener(MouseEvent.CLICK, onClickLogo);
}
function onClickLogo(_arg1:Event):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.2games.com/clickreg.php?type=gamestats&id=1232&subid=splash");
navigateToURL(_local2, "_blank");
}
function frame1(){
stop();
}
function onRollOut(_arg1:Event):void{
gotoAndStop(1);
}
function onRollOver(_arg1:Event):void{
gotoAndStop(2);
}
}
}//package
Section 50
//GameStage (GameStage)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
public class GameStage extends MovieClip {
public var _player:Player;
public var pickupLayer:Sprite;
public var gameText:TextPlayer;
var levelController:LevelController;
var helperCounter;// = 0
public var _pillars:Array;
public var gameHud:GameHud;
public var helper:Help;
public var gameScene:GameScene;
var clearSound:Sound;
public var _background:LevelBG;
public var _core:Core;
public var _outerWalls:Array;
public var iEnemyNumber:int;// = 0
public var _innerWalls:Array;
public static var _camera:Camera = new Camera();
public function GameStage(){
levelController = new LevelController();
clearSound = new sfx_areaclear();
helperCounter = 0;
iEnemyNumber = 0;
super();
addEventListener(Event.ADDED_TO_STAGE, addedToStageHandle);
addEventListener(Event.REMOVED_FROM_STAGE, removeFromStageHandle);
}
protected function addedToStageHandle(_arg1:Event):void{
gameScene = new GameScene();
addChild(gameScene);
pickupLayer = new Sprite();
gameScene.addChild(pickupLayer);
gameHud = new GameHud();
addChild(gameHud);
gameText = new TextPlayer();
addChild(gameText);
registerGameScene();
addEventListener(Event.ENTER_FRAME, enterFrameHandle);
}
protected function registerGameScene():void{
_background = gameScene.background;
_player = gameScene.player;
if (Main.gameDiff == "Easy"){
_player.extraLives = 2;
};
if (Main.gameDiff == "Normal"){
_player.extraLives = 1;
};
_core = gameScene.core;
_outerWalls = new Array(8);
_outerWalls[0] = gameScene.ow1;
_outerWalls[1] = gameScene.ow2;
_outerWalls[2] = gameScene.ow3;
_outerWalls[3] = gameScene.ow4;
_outerWalls[4] = gameScene.ow5;
_outerWalls[5] = gameScene.ow6;
_outerWalls[6] = gameScene.ow7;
_outerWalls[7] = gameScene.ow8;
_innerWalls = new Array(4);
_innerWalls[0] = gameScene.iw1;
_innerWalls[1] = gameScene.iw2;
_innerWalls[2] = gameScene.iw3;
_innerWalls[3] = gameScene.iw4;
_pillars = new Array(12);
_pillars[0] = gameScene.p1;
_pillars[1] = gameScene.p2;
_pillars[2] = gameScene.p3;
_pillars[3] = gameScene.p4;
_pillars[4] = gameScene.p5;
_pillars[5] = gameScene.p6;
_pillars[6] = gameScene.p7;
_pillars[7] = gameScene.p8;
_pillars[8] = gameScene.p9;
_pillars[9] = gameScene.p10;
_pillars[10] = gameScene.p11;
_pillars[11] = gameScene.p12;
_camera.setPosition((_player.x - (Main._viewWidth / 2)), (_player.y - (Main._viewHeight / 2)));
_camera.setOffSet((Main._viewWidth / 4), (Main._viewHeight / 4));
levelController._stage = this;
helper = new Help();
gameHud.addChild(helper);
stage.addEventListener(KeyboardEvent.KEY_DOWN, onNextHelper);
stage.addEventListener(MouseEvent.CLICK, onNextHelper);
}
protected function removeFromStageHandle(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, enterFrameHandle);
}
public function startFromHelp(_arg1:Event):void{
gameHud._waveStartButton.base.removeEventListener(MouseEvent.CLICK, startFromHelp);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onNextHelper);
stage.removeEventListener(MouseEvent.CLICK, onNextHelper);
gameHud.removeChild(helper);
gameHud._waveStartButton.setActive(false);
levelController.startLevel("level.xml");
}
function onNextHelper(_arg1:Event):void{
helperCounter++;
if (helperCounter <= 5){
helper.gotoAndStop(helperCounter);
if (helperCounter == 5){
gameHud._waveStartButton.base.addEventListener(MouseEvent.CLICK, startFromHelp, false, 2);
};
};
}
protected function enterFrameHandle(_arg1:Event):void{
var _local2:*;
var _local3:int;
if (_camera){
gameScene.x = -(_camera.posX);
gameScene.y = -(_camera.posY);
};
iEnemyNumber = 0;
_local3 = 0;
while (_local3 < gameScene.numChildren) {
_local2 = gameScene.getChildAt(_local3);
if ((_local2 is Enemy)){
iEnemyNumber++;
};
_local3++;
};
if ((((iEnemyNumber == 0)) && ((levelController.bIsSpawning == false)))){
if (gameHud.basic.slider.currentLabel == "slider_end"){
_player.restoreHP();
gameHud.basic.slider.gotoAndPlay(1);
gameText.setText1("Area clear!");
if (Main.bHasSound){
clearSound.play();
};
};
} else {
if (gameHud.basic.slider.currentLabel == "slider_out"){
gameHud.basic.slider.gotoAndPlay((gameHud.basic.slider.currentFrame + 1));
gameHud.onCloseRepair(null);
gameHud.onCloseBaseUpdate(null);
gameHud.onClosePlayerUpdate(null);
};
};
}
}
}//package
Section 51
//Help (Help)
package {
import flash.display.*;
public class Help extends MovieClip {
public function Help(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 52
//HPBar (HPBar)
package {
import flash.events.*;
import flash.display.*;
public class HPBar extends MovieClip {
public var bar:MovieClip;
protected var mcBar:MovieClip;
public var _currentHP:Number;
public var fullHP:Number;
public static var OUT_OF_HP:String = "out_of_hp";
public function HPBar(){
mcBar = bar;
}
function get currentHP():Number{
return (_currentHP);
}
function set currentHP(_arg1:Number):void{
_currentHP = _arg1;
}
public function restore():void{
_currentHP = fullHP;
mcBar.scaleX = (_currentHP / fullHP);
}
public function takeDamage(_arg1:Number):void{
var _local2:Event;
if (_currentHP > _arg1){
_currentHP = (_currentHP - _arg1);
} else {
_currentHP = 0;
_local2 = new Event(OUT_OF_HP, true);
dispatchEvent(_local2);
};
mcBar.scaleX = (_currentHP / fullHP);
}
public function setHP(_arg1:Number):void{
fullHP = _arg1;
_currentHP = _arg1;
}
}
}//package
Section 53
//HPBar_Player (HPBar_Player)
package {
import flash.display.*;
public class HPBar_Player extends HPBar {
public var playerbar:MovieClip;
public function HPBar_Player(){
mcBar = playerbar;
}
}
}//package
Section 54
//IHPObject (IHPObject)
package {
import flash.events.*;
public interface IHPObject {
function showHP(_arg1:Boolean):void;
function onHPOut(_arg1:Event):void;
function damageHP(_arg1:Number):void;
function setHP(_arg1:Number):void;
}
}//package
Section 55
//Inner_Wall (Inner_Wall)
package {
public class Inner_Wall extends Wall {
}
}//package
Section 56
//LevelBG (LevelBG)
package {
import flash.display.*;
public dynamic class LevelBG extends MovieClip {
public var zoneC:MovieClip;
public var zoneA:MovieClip;
public var zoneB:MovieClip;
public var zoneD:MovieClip;
}
}//package
Section 57
//LevelController (LevelController)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.utils.*;
import flash.net.*;
public class LevelController extends MovieClip {
var iTotalGroup:int;// = 0
var levelXML:XML;
var gameoverTimer:Timer;
var levelTimer:Timer;
var iTotalRun:int;// = 0
var maxNumLimit:int;// = 12
var levelTimerCount:int;
var incomingSound:Sound;
var spawnTimer:Timer;
var intervalRun:Number;
var iCurrentEnemy:int;// = 0
var iCurrentGroup:int;// = 0
var iCurrentLevel:int;// = 0
var iCurrentRun:int;// = 0
var levelTimerTotal:int;
var spawningIdx:int;
var spawnIdx:int;
var interval:Number;
var intervalLevel:Number;
var spawnList:Array;
public var bIsSpawning:Boolean;// = false
var iTotalLevel:int;// = 0
var iTotalEnemy:int;// = 0
var myLoader;
public var _stage:MovieClip;// = null
public static var GAME_OVER:String = "gameover";
public function LevelController(){
levelXML = new XML();
iCurrentLevel = 0;
iCurrentRun = 0;
iCurrentGroup = 0;
iCurrentEnemy = 0;
iTotalLevel = 0;
iTotalRun = 0;
iTotalGroup = 0;
iTotalEnemy = 0;
maxNumLimit = 12;
_stage = null;
bIsSpawning = false;
super();
incomingSound = new sfx_gui_incoming();
}
public function waveStart():void{
levelTimer.start();
}
function xmlLoaded(_arg1:Event):void{
levelXML = <LevelData Interval="1000" IntervalForRun="5000" IntervalForLevel="5000">
<!-- Wave1 -->
<Level>
<Run>
<Group Type="Scout" Level="1" Number="1" Zone="D" GoForCore="0"/>
</Run>
<Run>
<Group Type="Scout" Level="1" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="1" Number="1" Zone="D" GoForCore="0"/>
<Group Type="Scout" Level="1" Number="1" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="1" Number="2" Zone="D" GoForCore="1"/>
<Group Type="Scout" Level="1" Number="2" Zone="D" GoForCore="0"/>
</Run>
</Level>
<!-- Wave2 -->
<Level>
<Run>
<Group Type="Scout" Level="1" Number="2" Zone="D" GoForCore="0"/>
<Group Type="Scout" Level="1" Number="2" Zone="A" GoForCore="0"/>
</Run>
<Run>
<Group Type="Scout" Level="1" Number="2" Zone="D" GoForCore="0"/>
<Group Type="Scout" Level="1" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="1" Number="2" Zone="A" GoForCore="0"/>
<Group Type="Scout" Level="1" Number="1" Zone="A" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="1" Number="2" Zone="A" GoForCore="0"/>
<Group Type="Scout" Level="1" Number="1" Zone="D" GoForCore="1"/>
</Run>
</Level>
<!-- Wave3 -->
<Level>
<Run>
<Group Type="Scout" Level="1" Number="2" Zone="D" GoForCore="0"/>
<Group Type="Scout" Level="1" Number="2" Zone="A" GoForCore="0"/>
</Run>
<Run>
<Group Type="Scout" Level="1" Number="2" Zone="A" GoForCore="0"/>
<Group Type="Scout" Level="1" Number="2" Zone="A" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="1" Number="2" Zone="D" GoForCore="0"/>
<Group Type="Scout" Level="1" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Ranger" Level="1" Number="1" Zone="C" GoForCore="0"/>
</Run>
</Level>
<!-- Wave4 -->
<Level>
<Run>
<Group Type="Scout" Level="1" Number="2" Zone="B" GoForCore="0"/>
<Group Type="Scout" Level="1" Number="2" Zone="A" GoForCore="0"/>
</Run>
<Run>
<Group Type="Scout" Level="1" Number="2" Zone="D" GoForCore="0"/>
<Group Type="Ranger" Level="1" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="1" Number="2" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="1" Number="2" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="1" Number="1" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Ranger" Level="1" Number="1" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="1" Number="4" Zone="B" GoForCore="0"/>
</Run>
</Level>
<!-- Wave5 -->
<Level>
<Run>
<Group Type="Scout" Level="1" Number="3" Zone="A" GoForCore="0"/>
</Run>
<Run>
<Group Type="Scout" Level="1" Number="3" Zone="C" GoForCore="1"/>
<Group Type="Scout" Level="1" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="1" Number="2" Zone="B" GoForCore="0"/>
<Group Type="Ranger" Level="2" Number="2" Zone="B" GoForCore="1"/>
</Run>
<Run>
<Group Type="Ranger" Level="1" Number="2" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="2" Number="2" Zone="D" GoForCore="0"/>
</Run>
</Level>
<!-- Wave6 -->
<Level>
<Run>
<Group Type="Scout" Level="1" Number="3" Zone="A" GoForCore="1"/>
<Group Type="Scout" Level="2" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Ranger" Level="1" Number="1" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="2" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="1" Number="3" Zone="A" GoForCore="0"/>
<Group Type="Ranger" Level="2" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="2" Number="1" Zone="D" GoForCore="1"/>
</Run>
</Level>
<!-- Wave7 -->
<Level>
<Run>
<Group Type="Scout" Level="1" Number="2" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="2" Number="2" Zone="D" GoForCore="0"/>
</Run>
<Run>
<Group Type="Scout" Level="1" Number="3" Zone="A" GoForCore="0"/>
<Group Type="Ranger" Level="2" Number="3" Zone="A" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="1" Number="2" Zone="B" GoForCore="1"/>
<Group Type="Ranger" Level="2" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="1" Number="1" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="2" Number="2" Zone="C" GoForCore="0"/>
</Run>
</Level>
<!-- Wave8 -->
<Level>
<Run>
<Group Type="Ranger" Level="1" Number="2" Zone="B" GoForCore="0"/>
<Group Type="Ranger" Level="2" Number="2" Zone="A" GoForCore="0"/>
</Run>
<Run>
<Group Type="Tank" Level="1" Number="1" Zone="D" GoForCore="0"/>
<Group Type="Ranger" Level="2" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="1" Number="4" Zone="C" GoForCore="0"/>
</Run>
<Run>
<Group Type="Ranger" Level="2" Number="2" Zone="A" GoForCore="1"/>
<Group Type="Ranger" Level="2" Number="2" Zone="B" GoForCore="1"/>
<Group Type="Ranger" Level="2" Number="2" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="2" Number="2" Zone="D" GoForCore="1"/>
</Run>
</Level>
<!-- Wave9 -->
<Level>
<Run>
<Group Type="Scout" Level="2" Number="3" Zone="A" GoForCore="0"/>
<Group Type="Scout" Level="2" Number="3" Zone="B" GoForCore="0"/>
<Group Type="Scout" Level="2" Number="3" Zone="D" GoForCore="0"/>
<Group Type="Scout" Level="2" Number="3" Zone="A" GoForCore="0"/>
</Run>
<Run>
<Group Type="Scout" Level="2" Number="3" Zone="B" GoForCore="1"/>
<Group Type="Scout" Level="2" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="2" Number="3" Zone="B" GoForCore="0"/>
<Group Type="Ranger" Level="2" Number="3" Zone="B" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="2" Number="2" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="2" Number="1" Zone="D" GoForCore="0"/>
</Run>
</Level>
<!-- Wave10 -->
<Level>
<Run>
<Group Type="Boss" Level="1" Number="1" Zone="D" GoForCore="0"/>
</Run>
</Level>
<!-- Wave11 -->
<Level>
<Run>
<Group Type="Scout" Level="2" Number="3" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="2" Number="4" Zone="D" GoForCore="0"/>
</Run>
<Run>
<Group Type="Scout" Level="2" Number="4" Zone="A" GoForCore="0"/>
<Group Type="Ranger" Level="2" Number="3" Zone="A" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="2" Number="4" Zone="D" GoForCore="0"/>
<Group Type="Ranger" Level="2" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="2" Number="1" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="2" Number="4" Zone="C" GoForCore="1"/>
</Run>
</Level>
<!-- Wave12 -->
<Level>
<Run>
<Group Type="Ranger" Level="2" Number="3" Zone="B" GoForCore="0"/>
<Group Type="Ranger" Level="2" Number="3" Zone="A" GoForCore="0"/>
</Run>
<Run>
<Group Type="Tank" Level="2" Number="1" Zone="D" GoForCore="0"/>
<Group Type="Ranger" Level="2" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="2" Number="4" Zone="C" GoForCore="0"/>
<Group Type="Ranger" Level="2" Number="3" Zone="C" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="2" Number="1" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="2" Number="4" Zone="B" GoForCore="1"/>
</Run>
</Level>
<!-- Wave13 -->
<Level>
<Run>
<Group Type="Ranger" Level="2" Number="2" Zone="C" GoForCore="0"/>
</Run>
<Run>
<Group Type="Tank" Level="2" Number="2" Zone="C" GoForCore="1"/>
<Group Type="Scout" Level="3" Number="2" Zone="B" GoForCore="0"/>
<Group Type="Scout" Level="3" Number="2" Zone="D" GoForCore="0"/>
<Group Type="Scout" Level="3" Number="1" Zone="B" GoForCore="0"/>
<Group Type="Tank" Level="2" Number="1" Zone="C" GoForCore="1"/>
<Group Type="Scout" Level="3" Number="1" Zone="D" GoForCore="0"/>
<Group Type="Scout" Level="3" Number="1" Zone="B" GoForCore="0"/>
<Group Type="Scout" Level="3" Number="1" Zone="D" GoForCore="0"/>
<Group Type="Scout" Level="3" Number="1" Zone="B" GoForCore="0"/>
<Group Type="Scout" Level="3" Number="1" Zone="D" GoForCore="0"/>
</Run>
<Run>
<Group Type="Scout" Level="2" Number="2" Zone="B" GoForCore="0"/>
<Group Type="Ranger" Level="3" Number="1" Zone="B" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="2" Number="2" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="3" Number="1" Zone="D" GoForCore="0"/>
</Run>
</Level>
<!-- Wave14 -->
<Level>
<Run>
<Group Type="Scout" Level="2" Number="3" Zone="A" GoForCore="0"/>
<Group Type="Scout" Level="3" Number="3" Zone="D" GoForCore="0"/>
</Run>
<Run>
<Group Type="Ranger" Level="2" Number="2" Zone="C" GoForCore="0"/>
<Group Type="Ranger" Level="3" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="2" Number="3" Zone="A" GoForCore="0"/>
<Group Type="Ranger" Level="3" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="2" Number="3" Zone="C" GoForCore="0"/>
<Group Type="Tank" Level="3" Number="1" Zone="D" GoForCore="0"/>
</Run>
</Level>
<!-- Wave15 -->
<Level>
<Run>
<Group Type="Scout" Level="2" Number="3" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="3" Number="4" Zone="D" GoForCore="0"/>
</Run>
<Run>
<Group Type="Scout" Level="2" Number="4" Zone="A" GoForCore="0"/>
<Group Type="Ranger" Level="3" Number="3" Zone="A" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="2" Number="4" Zone="D" GoForCore="0"/>
<Group Type="Ranger" Level="3" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="2" Number="1" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="3" Number="4" Zone="C" GoForCore="0"/>
</Run>
</Level>
<!-- Wave16 -->
<Level>
<Run>
<Group Type="Ranger" Level="2" Number="3" Zone="B" GoForCore="0"/>
<Group Type="Ranger" Level="3" Number="3" Zone="A" GoForCore="0"/>
</Run>
<Run>
<Group Type="Tank" Level="2" Number="1" Zone="D" GoForCore="0"/>
<Group Type="Ranger" Level="3" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="2" Number="4" Zone="C" GoForCore="0"/>
<Group Type="Ranger" Level="3" Number="4" Zone="C" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="2" Number="1" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="3" Number="4" Zone="B" GoForCore="0"/>
</Run>
</Level>
<!-- Wave17 -->
<Level>
<Run>
<Group Type="Tank" Level="3" Number="1" Zone="A" GoForCore="0"/>
<Group Type="Tank" Level="3" Number="1" Zone="B" GoForCore="0"/>
<Group Type="Tank" Level="3" Number="1" Zone="C" GoForCore="0"/>
<Group Type="Tank" Level="3" Number="1" Zone="D" GoForCore="0"/>
</Run>
<Run>
<Group Type="Scout" Level="3" Number="2" Zone="B" GoForCore="0"/>
<Group Type="Scout" Level="3" Number="2" Zone="A" GoForCore="0"/>
</Run>
<Run>
<Group Type="Scout" Level="3" Number="2" Zone="B" GoForCore="0"/>
<Group Type="Ranger" Level="3" Number="1" Zone="B" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="3" Number="2" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="3" Number="1" Zone="D" GoForCore="0"/>
</Run>
</Level>
<!-- Wave18 -->
<Level>
<Run>
<Group Type="Scout" Level="3" Number="3" Zone="A" GoForCore="0"/>
<Group Type="Scout" Level="3" Number="3" Zone="D" GoForCore="0"/>
</Run>
<Run>
<Group Type="Ranger" Level="3" Number="2" Zone="C" GoForCore="0"/>
<Group Type="Ranger" Level="3" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="3" Number="3" Zone="A" GoForCore="0"/>
<Group Type="Ranger" Level="3" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="3" Number="3" Zone="C" GoForCore="0"/>
<Group Type="Tank" Level="3" Number="1" Zone="D" GoForCore="0"/>
</Run>
</Level>
<!-- Wave19 -->
<Level>
<Run>
<Group Type="Scout" Level="3" Number="4" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="3" Number="5" Zone="D" GoForCore="0"/>
</Run>
<Run>
<Group Type="Scout" Level="3" Number="5" Zone="A" GoForCore="0"/>
<Group Type="Ranger" Level="3" Number="3" Zone="A" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="3" Number="5" Zone="D" GoForCore="0"/>
<Group Type="Ranger" Level="3" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="3" Number="1" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="3" Number="5" Zone="C" GoForCore="0"/>
</Run>
</Level>
<!-- Wave20 -->
<Level>
<Run>
<Group Type="Boss" Level="2" Number="1" Zone="D" GoForCore="0"/>
</Run>
</Level>
<!-- Wave21 -->
<Level>
<Run>
<Group Type="Tank" Level="3" Number="2" Zone="A" GoForCore="1"/>
<Group Type="Tank" Level="3" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="3" Number="2" Zone="B" GoForCore="1"/>
<Group Type="Tank" Level="3" Number="2" Zone="C" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="3" Number="2" Zone="B" GoForCore="0"/>
<Group Type="Ranger" Level="4" Number="1" Zone="B" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="3" Number="2" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="4" Number="1" Zone="D" GoForCore="0"/>
</Run>
</Level>
<!-- Wave22 -->
<Level>
<Run>
<Group Type="Scout" Level="3" Number="3" Zone="A" GoForCore="0"/>
<Group Type="Scout" Level="4" Number="3" Zone="D" GoForCore="0"/>
</Run>
<Run>
<Group Type="Ranger" Level="3" Number="2" Zone="C" GoForCore="0"/>
<Group Type="Ranger" Level="4" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="3" Number="3" Zone="A" GoForCore="0"/>
<Group Type="Ranger" Level="4" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="3" Number="3" Zone="C" GoForCore="0"/>
<Group Type="Tank" Level="4" Number="1" Zone="D" GoForCore="0"/>
</Run>
</Level>
<!-- Wave23 -->
<Level>
<Run>
<Group Type="Scout" Level="3" Number="4" Zone="C" GoForCore="1"/>
<Group Type="Scout" Level="4" Number="5" Zone="C" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="3" Number="5" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="4" Number="3" Zone="C" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="3" Number="5" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="4" Number="3" Zone="C" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="3" Number="1" Zone="C" GoForCore="1"/>
<Group Type="Scout" Level="4" Number="5" Zone="C" GoForCore="1"/>
</Run>
</Level>
<!-- Wave24 -->
<Level>
<Run>
<Group Type="Ranger" Level="3" Number="3" Zone="B" GoForCore="0"/>
<Group Type="Ranger" Level="4" Number="3" Zone="A" GoForCore="0"/>
</Run>
<Run>
<Group Type="Tank" Level="3" Number="1" Zone="D" GoForCore="0"/>
<Group Type="Ranger" Level="4" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Ranger" Level="4" Number="2" Zone="C" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="3" Number="1" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="4" Number="6" Zone="B" GoForCore="0"/>
</Run>
</Level>
<!-- Wave25 -->
<Level>
<Run>
<Group Type="Scout" Level="4" Number="2" Zone="A" GoForCore="0"/>
</Run>
<Run>
<Group Type="Scout" Level="4" Number="2" Zone="B" GoForCore="1"/>
<Group Type="Scout" Level="4" Number="3" Zone="A" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="4" Number="2" Zone="B" GoForCore="0"/>
<Group Type="Ranger" Level="4" Number="1" Zone="B" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="4" Number="2" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="4" Number="1" Zone="D" GoForCore="0"/>
</Run>
</Level>
<!-- Wave26 -->
<Level>
<Run>
<Group Type="Scout" Level="4" Number="3" Zone="A" GoForCore="0"/>
<Group Type="Scout" Level="4" Number="3" Zone="D" GoForCore="0"/>
</Run>
<Run>
<Group Type="Ranger" Level="4" Number="2" Zone="C" GoForCore="0"/>
<Group Type="Ranger" Level="4" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="4" Number="3" Zone="A" GoForCore="0"/>
<Group Type="Ranger" Level="4" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="4" Number="3" Zone="C" GoForCore="0"/>
<Group Type="Tank" Level="4" Number="1" Zone="D" GoForCore="0"/>
</Run>
</Level>
<!-- Wave27 -->
<Level>
<Run>
<Group Type="Scout" Level="4" Number="4" Zone="C" GoForCore="1"/>
<Group Type="Scout" Level="4" Number="4" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="4" Number="4" Zone="A" GoForCore="1"/>
<Group Type="Ranger" Level="4" Number="3" Zone="A" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="4" Number="4" Zone="D" GoForCore="1"/>
<Group Type="Ranger" Level="4" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="4" Number="1" Zone="C" GoForCore="1"/>
<Group Type="Scout" Level="4" Number="4" Zone="C" GoForCore="1"/>
</Run>
</Level>
<!-- Wave28 -->
<Level>
<Run>
<Group Type="Ranger" Level="4" Number="3" Zone="B" GoForCore="0"/>
<Group Type="Ranger" Level="4" Number="3" Zone="A" GoForCore="0"/>
</Run>
<Run>
<Group Type="Tank" Level="4" Number="1" Zone="D" GoForCore="0"/>
<Group Type="Ranger" Level="4" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="4" Number="4" Zone="C" GoForCore="0"/>
<Group Type="Ranger" Level="4" Number="4" Zone="C" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="4" Number="1" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="4" Number="4" Zone="B" GoForCore="0"/>
</Run>
</Level>
<!-- Wave29 -->
<Level>
<Run>
<Group Type="Ranger" Level="5" Number="3" Zone="A" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="3" Zone="B" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="3" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Ranger" Level="5" Number="3" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="3" Zone="B" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="3" Zone="D" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="3" Zone="A" GoForCore="1"/>
</Run>
<Run>
<Group Type="Ranger" Level="5" Number="3" Zone="D" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="3" Zone="B" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="3" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="3" Zone="A" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="5" Number="2" Zone="B" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="2" Zone="A" GoForCore="1"/>
<Group Type="Tank" Level="5" Number="2" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="2" Zone="D" GoForCore="1"/>
</Run>
</Level>
<!-- Wave30 -->
<Level>
<Run>
<Group Type="Boss" Level="3" Number="1" Zone="D" GoForCore="0"/>
</Run>
</Level>
<!-- Wave31 -->
<Level>
<Run>
<Group Type="Scout" Level="4" Number="3" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="5" Number="4" Zone="D" GoForCore="0"/>
</Run>
<Run>
<Group Type="Scout" Level="4" Number="4" Zone="A" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="3" Zone="A" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="4" Number="4" Zone="D" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="4" Number="1" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="5" Number="4" Zone="C" GoForCore="0"/>
</Run>
</Level>
<!-- Wave32 -->
<Level>
<Run>
<Group Type="Ranger" Level="4" Number="3" Zone="B" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="3" Zone="A" GoForCore="0"/>
</Run>
<Run>
<Group Type="Tank" Level="4" Number="1" Zone="D" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="4" Number="4" Zone="C" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="4" Zone="C" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="4" Number="1" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="5" Number="4" Zone="B" GoForCore="0"/>
</Run>
</Level>
<!-- Wave33 -->
<Level>
<Run>
<Group Type="Scout" Level="5" Number="2" Zone="A" GoForCore="0"/>
</Run>
<Run>
<Group Type="Scout" Level="5" Number="2" Zone="B" GoForCore="0"/>
<Group Type="Scout" Level="5" Number="3" Zone="A" GoForCore="0"/>
</Run>
<Run>
<Group Type="Scout" Level="5" Number="2" Zone="B" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="1" Zone="B" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="5" Number="2" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="1" Zone="D" GoForCore="0"/>
</Run>
</Level>
<!-- Wave34 -->
<Level>
<Run>
<Group Type="Scout" Level="5" Number="3" Zone="A" GoForCore="0"/>
<Group Type="Scout" Level="5" Number="3" Zone="D" GoForCore="0"/>
</Run>
<Run>
<Group Type="Ranger" Level="5" Number="2" Zone="C" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="5" Number="3" Zone="A" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="5" Number="3" Zone="C" GoForCore="0"/>
<Group Type="Tank" Level="5" Number="1" Zone="D" GoForCore="0"/>
</Run>
</Level>
<!-- Wave35 -->
<Level>
<Run>
<Group Type="Scout" Level="5" Number="3" Zone="C" GoForCore="1"/>
<Group Type="Scout" Level="5" Number="3" Zone="D" GoForCore="1"/>
<Group Type="Scout" Level="5" Number="3" Zone="C" GoForCore="1"/>
<Group Type="Scout" Level="5" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Ranger" Level="5" Number="2" Zone="A" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="5" Number="3" Zone="D" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="5" Number="1" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="5" Number="4" Zone="C" GoForCore="0"/>
</Run>
</Level>
<!-- Wave36 -->
<Level>
<Run>
<Group Type="Ranger" Level="5" Number="3" Zone="B" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="3" Zone="A" GoForCore="0"/>
</Run>
<Run>
<Group Type="Tank" Level="5" Number="1" Zone="D" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="5" Number="5" Zone="C" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="4" Zone="C" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="5" Number="1" Zone="C" GoForCore="0"/>
<Group Type="Scout" Level="5" Number="5" Zone="B" GoForCore="0"/>
</Run>
</Level>
<!-- Wave37 -->
<Level>
<Run>
<Group Type="Scout" Level="5" Number="2" Zone="A" GoForCore="1"/>
<Group Type="Scout" Level="5" Number="2" Zone="B" GoForCore="1"/>
<Group Type="Scout" Level="5" Number="2" Zone="C" GoForCore="1"/>
<Group Type="Scout" Level="5" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Ranger" Level="5" Number="1" Zone="A" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="1" Zone="B" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="1" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="1" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="5" Number="2" Zone="A" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="1" Zone="B" GoForCore="1"/>
<Group Type="Scout" Level="5" Number="2" Zone="C" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="1" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="5" Number="1" Zone="C" GoForCore="1"/>
<Group Type="Tank" Level="5" Number="1" Zone="C" GoForCore="0"/>
<Group Type="Tank" Level="5" Number="1" Zone="C" GoForCore="1"/>
<Group Type="Tank" Level="5" Number="1" Zone="C" GoForCore="0"/>
</Run>
</Level>
<!-- Wave38 -->
<Level>
<Run>
<Group Type="Scout" Level="5" Number="3" Zone="A" GoForCore="0"/>
<Group Type="Scout" Level="5" Number="3" Zone="D" GoForCore="0"/>
</Run>
<Run>
<Group Type="Ranger" Level="5" Number="2" Zone="C" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="5" Number="3" Zone="A" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="5" Number="3" Zone="C" GoForCore="0"/>
<Group Type="Tank" Level="5" Number="1" Zone="D" GoForCore="0"/>
</Run>
</Level>
<!-- Wave39 -->
<Level>
<Run>
<Group Type="Scout" Level="5" Number="3" Zone="A" GoForCore="1"/>
<Group Type="Scout" Level="5" Number="3" Zone="B" GoForCore="1"/>
<Group Type="Scout" Level="5" Number="3" Zone="C" GoForCore="1"/>
<Group Type="Scout" Level="5" Number="3" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Ranger" Level="5" Number="2" Zone="A" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="2" Zone="B" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="2" Zone="C" GoForCore="1"/>
<Group Type="Ranger" Level="5" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Scout" Level="5" Number="3" Zone="A" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="2" Zone="B" GoForCore="1"/>
<Group Type="Scout" Level="5" Number="3" Zone="C" GoForCore="0"/>
<Group Type="Ranger" Level="5" Number="2" Zone="D" GoForCore="1"/>
</Run>
<Run>
<Group Type="Tank" Level="5" Number="2" Zone="C" GoForCore="1"/>
<Group Type="Tank" Level="5" Number="2" Zone="C" GoForCore="0"/>
<Group Type="Tank" Level="5" Number="2" Zone="C" GoForCore="1"/>
<Group Type="Tank" Level="5" Number="2" Zone="C" GoForCore="0"/>
</Run>
</Level>
<!-- Wave40 -->
<Level>
<Run>
<Group Type="Boss" Level="4" Number="1" Zone="D" GoForCore="0"/>
</Run>
<Run>
<Group Type="Boss" Level="4" Number="1" Zone="A" GoForCore="0"/>
</Run>
<Run>
<Group Type="Boss" Level="4" Number="1" Zone="B" GoForCore="0"/>
</Run>
<Run>
<Group Type="Boss" Level="4" Number="1" Zone="C" GoForCore="0"/>
</Run>
</Level>
</LevelData>
;
interval = levelXML.@Interval;
intervalRun = levelXML.@IntervalForRun;
intervalLevel = levelXML.@IntervalForLevel;
levelTimerCount = 0;
levelTimerTotal = (intervalLevel / 1000);
levelTimer = new Timer(1000, levelTimerTotal);
spawnTimer = new Timer(interval);
iCurrentLevel = 0;
iTotalLevel = levelXML.elements().length();
if (iCurrentLevel < iTotalLevel){
trace([iCurrentLevel, iTotalLevel]);
levelTimer.addEventListener(TimerEvent.TIMER, onCountGenerateLevel);
levelTimer.start();
(_stage as GameStage).gameText.setText(((((("wave " + (iCurrentLevel + 1)) + "/") + iTotalLevel) + " in ") + levelTimerTotal));
};
}
function onFinishSpawn(_arg1:TimerEvent):void{
spawnTimer.stop();
spawningIdx++;
spawnEnemy();
}
function onFinishLevel():void{
iCurrentLevel++;
Main.waveIdx = iCurrentLevel;
if (iCurrentLevel < iTotalLevel){
levelTimerCount = 0;
levelTimerTotal = (intervalLevel / 1000);
levelTimer.reset();
(_stage as GameStage).gameHud._waveStartButton.setActive(true);
} else {
gameoverTimer = new Timer(4000, 1);
gameoverTimer.addEventListener(TimerEvent.TIMER, onGameOver);
gameoverTimer.start();
};
}
function onGenerateLevel(_arg1:TimerEvent):void{
if (Main.bHasSound){
incomingSound.play();
};
iCurrentRun = 0;
iTotalRun = levelXML.Level[iCurrentLevel].elements().length();
levelTimer.stop();
spawnList = new Array();
spawnIdx = 0;
iCurrentRun = 0;
while (iCurrentRun < iTotalRun) {
scanCurrentRun();
iCurrentRun++;
};
if (iCurrentLevel < (iTotalLevel - 1)){
};
spawningIdx = 0;
spawnTimer.addEventListener(TimerEvent.TIMER, onFinishSpawn);
setSpawnStatus(true);
spawnEnemy();
}
function onCountGenerateLevel(_arg1:TimerEvent):void{
levelTimerCount++;
(_stage as GameStage).gameText.setText(((((("wave " + (iCurrentLevel + 1)) + "/") + iTotalLevel) + " in ") + (levelTimerTotal - levelTimerCount)));
if (levelTimerCount == levelTimerTotal){
onGenerateLevel(_arg1);
};
}
function setSpawnStatus(_arg1:Boolean):void{
bIsSpawning = _arg1;
if (_arg1){
trace("start spawning");
} else {
trace("stop spawning");
};
}
function spawnIndiv(_arg1:String, _arg2:int, _arg3:String, _arg4:int):void{
var _local5:Number;
var _local6:Number;
var _local7:Scout;
var _local8:Ranger;
var _local9:Tank;
var _local10:Boss;
if ((_stage as GameStage).iEnemyNumber >= maxNumLimit){
spawningIdx--;
return;
};
switch (_arg3){
case "A":
_local5 = (_stage as GameStage)._background.zoneA.x;
_local6 = (_stage as GameStage)._background.zoneA.y;
break;
case "B":
_local5 = (_stage as GameStage)._background.zoneB.x;
_local6 = (_stage as GameStage)._background.zoneB.y;
break;
case "C":
_local5 = (_stage as GameStage)._background.zoneC.x;
_local6 = (_stage as GameStage)._background.zoneC.y;
break;
case "D":
_local5 = (_stage as GameStage)._background.zoneD.x;
_local6 = (_stage as GameStage)._background.zoneD.y;
break;
};
_local5 = (_local5 + ((Math.random() * 50) - 25));
_local6 = (_local6 + ((Math.random() * 50) - 25));
switch (_arg1){
case "Scout":
_local7 = new Scout();
_local7.x = _local5;
_local7.y = _local6;
_local7.setLevel(_arg2);
_local7.setBehavior(_arg4);
(_stage as GameStage).gameScene.addChild(_local7);
break;
case "Ranger":
_local8 = new Ranger();
_local8.x = _local5;
_local8.y = _local6;
_local8.setLevel(_arg2);
_local8.setBehavior(_arg4);
(_stage as GameStage).gameScene.addChild(_local8);
break;
case "Tank":
_local9 = new Tank();
_local9.x = _local5;
_local9.y = _local6;
_local9.setLevel(_arg2);
_local9.setBehavior(_arg4);
(_stage as GameStage).gameScene.addChild(_local9);
break;
case "Boss":
_local10 = new Boss();
_local10.x = _local5;
_local10.y = _local6;
_local10.setLevel(_arg2);
_local10.setBehavior(_arg4);
(_stage as GameStage).gameScene.addChild(_local10);
break;
};
}
function scanCurrentRun():void{
iCurrentGroup = 0;
iTotalGroup = levelXML.Level[iCurrentLevel].Run[iCurrentRun].elements().length();
iCurrentGroup = 0;
while (iCurrentGroup < iTotalGroup) {
scanCurrentGroup();
iCurrentGroup++;
};
spawnList[(spawnIdx - 1)].waittime = (spawnList[(spawnIdx - 1)].waittime + intervalRun);
}
public function startLevel(_arg1:String):void{
xmlLoaded(null);
}
function checkEnemyNumber(_arg1:Event):void{
if ((_stage as GameStage).iEnemyNumber == 0){
removeEventListener(Event.ENTER_FRAME, checkEnemyNumber);
onFinishLevel();
};
}
function spawnEnemy():void{
if (spawningIdx < spawnList.length){
trace([spawnList[spawningIdx].type, spawnList[spawningIdx].level, spawnList[spawningIdx].area, spawnList[spawningIdx].waittime]);
spawnIndiv(spawnList[spawningIdx].type, spawnList[spawningIdx].level, spawnList[spawningIdx].area, spawnList[spawningIdx].goForCore);
spawnTimer.delay = spawnList[spawningIdx].waittime;
spawnTimer.start();
if (spawningIdx == (spawnList.length - 1)){
setSpawnStatus(false);
};
} else {
addEventListener(Event.ENTER_FRAME, checkEnemyNumber);
};
}
function scanCurrentGroup():void{
var _local1:int;
var _local2:int;
var _local3:String;
var _local4:String;
var _local5:int;
_local1 = levelXML.Level[iCurrentLevel].Run[iCurrentRun].Group[iCurrentGroup].@Number;
_local2 = levelXML.Level[iCurrentLevel].Run[iCurrentRun].Group[iCurrentGroup].@Level;
_local3 = levelXML.Level[iCurrentLevel].Run[iCurrentRun].Group[iCurrentGroup].@Type;
_local4 = levelXML.Level[iCurrentLevel].Run[iCurrentRun].Group[iCurrentGroup].@Zone;
_local5 = levelXML.Level[iCurrentLevel].Run[iCurrentRun].Group[iCurrentGroup].@GoForCore;
iCurrentEnemy = 0;
while (iCurrentEnemy < _local1) {
spawnList[spawnIdx] = new Object();
spawnList[spawnIdx].level = _local2;
spawnList[spawnIdx].type = _local3;
spawnList[spawnIdx].area = _local4;
spawnList[spawnIdx].waittime = interval;
spawnList[spawnIdx].goForCore = _local5;
spawnIdx++;
iCurrentEnemy++;
};
}
function onGameOver(_arg1:TimerEvent):void{
var _local2:Event;
_local2 = new Event(GAME_OVER, true);
_stage.dispatchEvent(_local2);
}
}
}//package
Section 58
//LoadingBox (LoadingBox)
package {
import flash.display.*;
import CPMStar.*;
import flash.text.*;
public class LoadingBox extends MovieClip {
public var adBox:MovieClip;
var CPMStarContentSpotID:String;// = "617QDDE73A46"
public var logo:bubbleboxlogo;
public var loading_txt:TextField;
public function LoadingBox(){
var _local1:DisplayObject;
CPMStarContentSpotID = "617QDDE73A46";
super();
addFrameScript(0, frame1);
trace("loading box");
_local1 = new AdLoader(CPMStarContentSpotID);
adBox.addChild(_local1);
}
function frame1(){
stop();
}
public function update(_arg1:int):void{
loading_txt.text = (String(_arg1) + "%");
}
}
}//package
Section 59
//Main (Main)
package {
import flash.events.*;
import flash.display.*;
import mochi.*;
import flash.media.*;
import flash.utils.*;
import flash.net.*;
import flash.ui.*;
public class Main extends MovieClip {
var bNoLoading:Boolean;// = false
public var tutorialPage:TutPage;
var bLoaderTimerTriggered:Boolean;// = false
public var titleStarted:Boolean;// = false
var oldT;// = 0
public var titlePage:TitlePage;
var fpsMeter;
public var diffPage:DifficultyPage;
public var gameStage:GameStage;
public var gameoverPage:GameOverPage;
public var percentLoaded:int;
var newT;// = 0
var startSound:Sound;
public var gameState:int;// = 0
var frameRate;// = 0
public var loaderStarted:Boolean;// = false
public var loadingBox:LoadingBox;
var loaderTimer:Timer;
public static const STATE_SYSTEM_LOADER:int = 0;
public static const STATE_SYSTEM_TITLE:int = 1;
public static var _sceneWidth:Number = 2400;
public static var materialSpent:int = 0;
public static var _viewHeight:Number = 480;
public static var waveIdx:int = 0;
public static var _sceneHeight:Number = 1800;
public static var bHasSound:Boolean = true;
public static var cursor:MovieClip;
public static var gameDiff:String = "";
public static var materialTotal:int = 0;
public static var enemyKilled:int = 0;
public static var backgroundMusic:Sound;
public static var _viewWidth:Number = 640;
public static var diffFactor:Number = 1;
public static var loseReason:String = "";
public static var backgroundMusicChannel:SoundChannel;
public function Main(){
var _local1:MovieClip;
gameState = STATE_SYSTEM_LOADER;
loaderStarted = false;
titleStarted = false;
bLoaderTimerTriggered = false;
bNoLoading = false;
startSound = new sfx_gamestart();
oldT = 0;
newT = 0;
frameRate = 0;
super();
addFrameScript(0, frame1, 2, frame3);
_local1 = new MovieClip();
addChild(_local1);
MochiServices.connect("d33479ea0920fe73", _local1);
loaderTimer = new Timer(10000, 1);
loaderTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onLoaderTimerComplete);
loaderTimer.start();
addEventListener(Event.ENTER_FRAME, runGame);
}
function onLoaderTimerComplete(_arg1:Event):void{
trace("Loader timer trigger");
loaderTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onLoaderTimerComplete);
bLoaderTimerTriggered = true;
if (bNoLoading){
removeChild(loadingBox);
loadingBox = null;
this.loaderInfo.removeEventListener(Event.INIT, loadingComplete);
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, loadingProgress);
trace("finishPreload 2");
finishPreload();
};
}
protected function init():void{
Tools.init(stage);
titlePage = new TitlePage();
showTitle(null);
tutorialPage = new TutPage();
diffPage = new DifficultyPage();
gameoverPage = new GameOverPage();
addEventListener(TitlePage.PLAY_GAME, startGame);
addEventListener(TitlePage.GAME_TUTORIAL, showTutorial);
addEventListener(TutPage.PLAY_GAME, startGame);
addEventListener(TutPage.BACK_TUTORIAL, showTitle);
addEventListener(DifficultyPage.PLAY_GAME_EASY, startGameWithDiff_Easy);
addEventListener(DifficultyPage.PLAY_GAME_NORMAL, startGameWithDiff_Normal);
addEventListener(DifficultyPage.PLAY_GAME_HARD, startGameWithDiff_Hard);
addEventListener(GameOverPage.REPLAY_GAME, showTitle);
backgroundMusic = new CoreDefense1();
backgroundMusicChannel = backgroundMusic.play(0, int.MAX_VALUE);
fpsMeter = new FPSMeter();
}
public function runGame(_arg1:Event):void{
switch (gameState){
case STATE_SYSTEM_LOADER:
doLoadScreen();
break;
case STATE_SYSTEM_TITLE:
doTitleScreen();
break;
};
}
function siteLock():void{
var _local1:String;
var _local2:Number;
var _local3:Number;
var _local4:String;
var _local5:Number;
var _local6:Number;
_local1 = stage.loaderInfo.url;
_local2 = (_local1.indexOf("://") + 3);
_local3 = _local1.indexOf("/", _local2);
_local4 = _local1.substring(_local2, _local3);
_local5 = (_local4.lastIndexOf(".") - 1);
_local6 = (_local4.lastIndexOf(".", _local5) + 1);
_local4 = _local4.substring(_local6, _local4.length);
if (((((!((_local4 == "2games.com"))) && (!((_local4 == "bubblebox.com"))))) && (!((_local4 == "xs4all.nl"))))){
root.visible = false;
};
}
function moveMouse(_arg1:MouseEvent):void{
cursor.x = (_arg1.stageX + 1);
cursor.y = (_arg1.stageY + 1);
}
function frame3(){
stop();
}
protected function showTitle(_arg1:Event):void{
addChildAt(titlePage, 0);
}
function frame1(){
stop();
}
public function doTitleScreen():void{
var _local1:FirstSplashScreen;
if (((!(titleStarted)) && ((currentFrame == 3)))){
titleStarted = true;
stage.showDefaultContextMenu = false;
_local1 = new FirstSplashScreen();
addChild(_local1);
_local1.addEventListener(FirstSplashScreen.SPLASH_OVER, onFirstSplashOver);
};
}
function onSecondSplashOver(_arg1:Event):void{
Mouse.hide();
cursor = new MouseCursor();
addChild(cursor);
addEventListener(MouseEvent.MOUSE_MOVE, moveMouse);
stage.stageFocusRect = false;
init();
addEventListener(Event.ENTER_FRAME, onFPS);
}
protected function startGame(_arg1:Event):void{
addChildAt(diffPage, 0);
}
protected function startGameWithDiff(_arg1:Event):void{
gameStage = new GameStage();
addChildAt(gameStage, 0);
stage.focus = gameStage;
Main.cursor.setCombat();
gameStage.addEventListener(Player.GAME_OVER, onGameOver);
loseReason = "";
enemyKilled = 0;
materialTotal = 0;
materialSpent = 0;
if (Main.bHasSound){
startSound.play();
};
}
protected function showTutorial(_arg1:Event):void{
addChildAt(tutorialPage, 0);
}
public function loadingProgress(_arg1:Event):void{
percentLoaded = ((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100);
trace(percentLoaded);
loadingBox.update(percentLoaded);
}
function onFPS(_arg1:Event):void{
newT = getTimer();
frameRate = Math.round((1000 / (newT - oldT)));
oldT = newT;
}
public function loadingComplete(_arg1:Event){
if (bLoaderTimerTriggered){
trace("loadingComplete");
removeChild(loadingBox);
loadingBox = null;
this.loaderInfo.removeEventListener(Event.INIT, loadingComplete);
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, loadingProgress);
trace("finishPreload 2");
finishPreload();
} else {
bNoLoading = true;
};
}
function onFirstSplashOver(_arg1:Event):void{
var _local2:SecondSplashScreen;
_local2 = new SecondSplashScreen();
addChild(_local2);
_local2.addEventListener(SecondSplashScreen.SPLASH_OVER, onSecondSplashOver);
}
protected function startGameWithDiff_Hard(_arg1:Event):void{
diffFactor = 0.5;
gameDiff = "Hard";
startGameWithDiff(_arg1);
}
protected function startGameWithDiff_Normal(_arg1:Event):void{
diffFactor = 0.75;
gameDiff = "Normal";
startGameWithDiff(_arg1);
}
public function doLoadScreen():void{
if (!loaderStarted){
loadingBox = new LoadingBox();
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadingProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, loadingComplete);
loaderStarted = true;
percentLoaded = ((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100);
loadingBox.update(percentLoaded);
addChild(loadingBox);
if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){
bNoLoading = true;
};
};
}
function resetGame():void{
}
protected function onGameOver(_arg1:Event):void{
gameStage.removeEventListener(Player.GAME_OVER, onGameOver);
gameoverPage.tLoseReason.selectable = false;
gameoverPage.tDifficulty.selectable = false;
gameoverPage.tKillNum.selectable = false;
gameoverPage.tWave.selectable = false;
gameoverPage.tScore.selectable = false;
gameoverPage.tMaterialCollect.selectable = false;
gameoverPage.tMaterialSpent.selectable = false;
gameoverPage.tLoseReason.text = loseReason;
gameoverPage.tDifficulty.text = gameDiff;
gameoverPage.tKillNum.text = String(enemyKilled);
gameoverPage.tWave.text = String(waveIdx);
gameoverPage.tScore.text = String(gameStage.gameHud.gameScore);
gameoverPage.tMaterialCollect.text = String(materialTotal);
gameoverPage.tMaterialSpent.text = String(((materialTotal - gameStage.gameHud.gameMaterial) + gameStage.gameHud.initMaterial));
removeChild(gameStage);
addChildAt(gameoverPage, 0);
Main.cursor.setMenu();
}
protected function startGameWithDiff_Easy(_arg1:Event):void{
diffFactor = 1;
gameDiff = "Easy";
startGameWithDiff(_arg1);
}
public function finishPreload():void{
this.play();
gameState = STATE_SYSTEM_TITLE;
}
}
}//package
Section 60
//MouseCursor (MouseCursor)
package {
import flash.display.*;
public class MouseCursor extends MovieClip {
public var bInMenu:Boolean;// = true
public function MouseCursor(){
bInMenu = true;
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
public function setMenu():void{
gotoAndStop(1);
bInMenu = true;
}
public function setCombat():void{
gotoAndStop(2);
bInMenu = false;
}
}
}//package
Section 61
//NewMuteButton (NewMuteButton)
package {
import flash.events.*;
import flash.display.*;
public class NewMuteButton extends MovieClip {
public var items:MovieClip;
public function NewMuteButton(){
addEventListener(MouseEvent.CLICK, onMouseOver);
items.gotoAndStop(1);
}
function onMouseOver(_arg1:Event):void{
items.gotoAndPlay("comeout");
removeEventListener(MouseEvent.CLICK, onMouseOver);
addEventListener(MouseEvent.CLICK, onMouseOut);
}
function onMouseOut(_arg1:MouseEvent):void{
items.gotoAndPlay("comein");
removeEventListener(MouseEvent.CLICK, onMouseOut);
addEventListener(MouseEvent.CLICK, onMouseOver);
if (_arg1.target == items.item1){
Main.bHasSound = true;
Main.backgroundMusicChannel.stop();
Main.backgroundMusicChannel = Main.backgroundMusic.play(0, int.MAX_VALUE);
};
if (_arg1.target == items.item2){
Main.bHasSound = true;
Main.backgroundMusicChannel.stop();
};
if (_arg1.target == items.item3){
Main.bHasSound = false;
Main.backgroundMusicChannel.stop();
};
stage.focus = (root as Main).gameStage;
}
}
}//package
Section 62
//Outer_Wall (Outer_Wall)
package {
public class Outer_Wall extends Wall {
}
}//package
Section 63
//ParticleGen (ParticleGen)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class ParticleGen extends GameObject {
var scaleDecrease:Number;// = 0.2
var alphaDecrease:Number;// = 0.1
var refreshCount:int;// = 0
var ptEnd:Point;
var particleIdx;// = 0
var refreshRate:int;// = 0
var particleInterval:Number;// = 50
var particleArray:Array;
public var maxParticles:Number;// = 5
var ptStart:Point;
public var spreadWide:Number;// = 4
public function ParticleGen(){
particleArray = new Array();
maxParticles = 5;
particleInterval = 50;
alphaDecrease = 0.1;
scaleDecrease = 0.2;
refreshRate = 0;
refreshCount = 0;
spreadWide = 4;
ptStart = new Point(0, 0);
ptEnd = new Point(0, 0);
particleIdx = 0;
super();
}
function addParticle(_arg1:Event){
var _local2:TestParticle;
var _local3:TestParticle;
if (particleArray.length <= maxParticles){
_local2 = new TestParticle();
_local2.alpha = ((Math.random() * 0.8) + 0.2);
_local2.scaleX = (_local2.scaleY = ((Math.random() * 1) + 1));
_local2.xMovement = ((Math.random() * spreadWide) - (spreadWide / 2));
_local2.yMovement = ((Math.random() * 2) + 4);
particleArray.push(_local2);
ptStart.x = 0;
ptStart.y = 0;
ptEnd.x = _local2.xMovement;
ptEnd.y = _local2.yMovement;
ptStart = this.localToGlobal(ptStart);
ptEnd = this.localToGlobal(ptEnd);
_local2.x = (ptStart.x + GameStage._camera.posX);
_local2.y = (ptStart.y + GameStage._camera.posY);
_local2.xMovement = (ptEnd.x - ptStart.x);
_local2.yMovement = (ptEnd.y - ptStart.y);
_local2.addEventListener(Event.ENTER_FRAME, moveParticle);
(root as Main).gameStage.gameScene.addChild(_local2);
} else {
_local3 = particleArray[particleIdx];
_local3.alpha = ((Math.random() * 0.8) + 0.2);
_local3.scaleX = (_local3.scaleY = ((Math.random() * 1) + 1));
_local3.xMovement = ((Math.random() * 4) - 2);
_local3.yMovement = ((Math.random() * 2) + 4);
ptStart.x = 0;
ptStart.y = 0;
ptEnd.x = _local3.xMovement;
ptEnd.y = _local3.yMovement;
ptStart = this.localToGlobal(ptStart);
ptEnd = this.localToGlobal(ptEnd);
_local3.x = (ptStart.x + GameStage._camera.posX);
_local3.y = (ptStart.y + GameStage._camera.posY);
_local3.xMovement = (ptEnd.x - ptStart.x);
_local3.yMovement = (ptEnd.y - ptStart.y);
particleIdx++;
if (particleIdx == maxParticles){
particleIdx = 0;
};
_local3.transform.colorTransform = this.transform.colorTransform;
};
}
function moveParticle(_arg1:Event){
_arg1.currentTarget.x = (_arg1.currentTarget.x + _arg1.currentTarget.xMovement);
_arg1.currentTarget.y = (_arg1.currentTarget.y + _arg1.currentTarget.yMovement);
_arg1.currentTarget.alpha = (_arg1.currentTarget.alpha - alphaDecrease);
_arg1.currentTarget.scaleX = (_arg1.currentTarget.scaleX - scaleDecrease);
_arg1.currentTarget.scaleY = (_arg1.currentTarget.scaleY - scaleDecrease);
if (root){
if ((root as Main).gameStage._player.visible == false){
_arg1.currentTarget.visible = false;
};
};
}
override protected function enterFrameHandle(_arg1:Event):void{
if (refreshCount >= refreshRate){
addParticle(_arg1);
refreshCount = 0;
};
refreshCount++;
}
}
}//package
Section 64
//PickUp (PickUp)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
public class PickUp extends MovieClip {
var checkDistance:Number;// = 80
var bStartFly:Boolean;// = false
var pickDistance:Number;// = 30
var picksound:Sound;
var flySpeed:Number;// = 10
public var mymaterial:int;// = 0
public function PickUp(){
checkDistance = 80;
pickDistance = 30;
bStartFly = false;
flySpeed = 10;
mymaterial = 0;
picksound = new sfx_pickup_mat();
super();
addEventListener(Event.ADDED_TO_STAGE, addedToStageHandle);
addEventListener(Event.REMOVED_FROM_STAGE, removeFromStageHandle);
}
protected function addedToStageHandle(_arg1:Event):void{
addEventListener(Event.ENTER_FRAME, enterFrameHandle);
}
protected function removeFromStageHandle(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, enterFrameHandle);
}
protected function enterFrameHandle(_arg1:Event):void{
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = Tools.distance(x, y, (root as Main).gameStage._player.x, (root as Main).gameStage._player.y);
if (bStartFly){
_local3 = ((root as Main).gameStage._player.x - x);
_local4 = ((root as Main).gameStage._player.y - y);
_local3 = (_local3 / _local2);
_local4 = (_local4 / _local2);
x = (x + (_local3 * flySpeed));
y = (y + (_local4 * flySpeed));
if (_local2 < pickDistance){
(root as Main).gameStage.gameHud.addMaterial(mymaterial);
Main.materialTotal = (Main.materialTotal + mymaterial);
picksound.play();
parent.removeChild(this);
};
} else {
if (_local2 < checkDistance){
bStartFly = true;
};
};
}
}
}//package
Section 65
//Pillar (Pillar)
package {
public class Pillar extends GameObject {
var item:Pillar_Item;// = null
public function Pillar(){
item = null;
super();
}
public function upgradeToArtillary():void{
if (item){
} else {
item = new Pillar_Artillary();
item.x = x;
item.y = y;
(root as Main).gameStage.gameScene.addChild(item);
};
}
public function upgradeToMissile():void{
if (item){
} else {
item = new Pillar_Missile();
item.x = x;
item.y = y;
(root as Main).gameStage.gameScene.addChild(item);
};
}
public function upgradeToTurret():void{
if (item){
} else {
item = new Pillar_Turret();
item.x = x;
item.y = y;
(root as Main).gameStage.gameScene.addChild(item);
};
}
}
}//package
Section 66
//Pillar_Artillary (Pillar_Artillary)
package {
import flash.media.*;
public class Pillar_Artillary extends Pillar_Item {
var midFire:Sound;
public function Pillar_Artillary(){
shootRange = 600;
shootInterval = 6000;
damage = 35;
midFire = new sfx_turret_medgun();
}
override protected function playShootSound():void{
if (Main.bHasSound){
midFire.play();
};
}
override function shootAtEnemy():void{
var _local1:Bullet;
_local1 = new BulletTurret2();
_local1.bulletDamage = damage;
_local1.ShootFromTo(x, y, directionRad);
(root as Main).gameStage.gameScene.addChild(_local1);
playShootSound();
}
}
}//package
Section 67
//Pillar_Item (Pillar_Item)
package {
import flash.events.*;
import flash.utils.*;
public class Pillar_Item extends GameObject {
var shootInterval:Number;// = 1000
var directionRad:Number;// = 0
var bAmmo:Boolean;// = true
var shootTimer:Timer;// = null
var shootRange:Number;// = 0
var damage:Number;// = 0
var targetEnemy:Enemy;// = null
public function Pillar_Item(){
shootRange = 0;
targetEnemy = null;
shootTimer = null;
shootInterval = 1000;
bAmmo = true;
damage = 0;
directionRad = 0;
super();
}
function fireEnemy():void{
if (((targetEnemy) && (bAmmo))){
shootAtEnemy();
bAmmo = false;
shootTimer.reset();
shootTimer.start();
};
}
function shootAtEnemy():void{
var _local1:Bullet;
_local1 = new Bullet();
_local1.bulletDamage = damage;
_local1.ShootFromTo(x, y, directionRad);
(root as Main).gameStage.gameScene.addChild(_local1);
playShootSound();
}
function onReload(_arg1:TimerEvent):void{
if (bAmmo == false){
bAmmo = true;
};
}
protected function playShootSound():void{
}
function getEnemyInRange():void{
var _local1:*;
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:int;
var _local6:Number;
if (targetEnemy == null){
_local4 = 10000;
_local5 = -1;
_local2 = 0;
while (_local2 < (root as Main).gameStage.gameScene.numChildren) {
_local1 = (root as Main).gameStage.gameScene.getChildAt(_local2);
if ((_local1 is Enemy)){
_local3 = Tools.distance(x, y, (_local1 as Enemy).x, (_local1 as Enemy).y);
if (_local3 < _local4){
_local4 = _local3;
_local5 = _local2;
};
};
_local2++;
};
if (((!((_local5 == -1))) && ((_local4 < shootRange)))){
targetEnemy = ((root as Main).gameStage.gameScene.getChildAt(_local5) as Enemy);
};
} else {
if (targetEnemy.root){
_local6 = Tools.distance(x, y, targetEnemy.x, targetEnemy.y);
if (_local6 > shootRange){
targetEnemy = null;
};
} else {
targetEnemy = null;
};
};
}
function rotateToEnemy():void{
var _local1:Number;
var _local2:Number;
var _local3:*;
var _local4:*;
if (targetEnemy){
_local1 = (targetEnemy.x - x);
_local2 = (targetEnemy.y - y);
directionRad = Math.atan((_local2 / _local1));
_local3 = ((directionRad / Math.PI) * 180);
_local4 = (_local3 - 90);
if (_local1 < 0){
_local4 = (_local4 - 180);
directionRad = (directionRad - Math.PI);
};
rotation = _local4;
};
}
override protected function enterFrameHandle(_arg1:Event):void{
if (shootTimer == null){
shootTimer = new Timer(shootInterval, 1);
shootTimer.addEventListener(TimerEvent.TIMER, onReload);
};
getEnemyInRange();
rotateToEnemy();
fireEnemy();
super.enterFrameHandle(_arg1);
}
}
}//package
Section 68
//Pillar_Missile (Pillar_Missile)
package {
import flash.media.*;
public class Pillar_Missile extends Pillar_Item {
public var currentRocketNum:int;// = 0
var heavyFire:Sound;
var rocketNumLimits;// = 1
public function Pillar_Missile(){
rocketNumLimits = 1;
currentRocketNum = 0;
super();
shootRange = 440;
shootInterval = 1000;
damage = 50;
heavyFire = new sfx_turret_heavygun();
}
override function shootAtEnemy():void{
var _local1:Bullet;
if (currentRocketNum < rocketNumLimits){
_local1 = new BulletTurret3();
_local1.bulletDamage = damage;
_local1.setOwner(this);
_local1.ShootFromTo(x, y, directionRad);
(_local1 as Rocket_Gun3).bGuiding = true;
(root as Main).gameStage.gameScene.addChild(_local1);
if (Main.bHasSound){
heavyFire.play();
};
};
}
}
}//package
Section 69
//Pillar_Turret (Pillar_Turret)
package {
import flash.media.*;
public class Pillar_Turret extends Pillar_Item {
var lightFire:Sound;
public function Pillar_Turret(){
lightFire = new sfx_turret_lightgun();
super();
shootRange = 380;
shootInterval = 250;
damage = 10;
}
override protected function playShootSound():void{
if (Main.bHasSound){
lightFire.play();
};
}
override function shootAtEnemy():void{
var _local1:Bullet;
_local1 = new BulletTurret1();
_local1.bulletDamage = damage;
_local1.ShootFromTo(x, y, directionRad);
(root as Main).gameStage.gameScene.addChild(_local1);
playShootSound();
}
}
}//package
Section 70
//Player (Player)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.utils.*;
import flash.geom.*;
import flash.ui.*;
public class Player extends GameObject implements IHPObject {
protected var speedLoss:Number;// = 0.97
var directionRad:Number;
var particleGenLeft:ParticleGen;
var boostCooldown:Number;// = 4000
var _iHPLevel:int;// = 0
var greenUpgradeSpeed;
public var mouseXRelative:Number;// = 0
var redUpgrade;
var boostDuration:Number;// = 2000
var blueUpgrade;
var lightFire:Sound;
var accelerateBoostList:Array;
public var bCoreMode:Boolean;// = false
private var _iCurrentGun:int;// = 0
var invulCounter:int;// = 0
var upgradeSpeedColor:ColorTransform;
public var currentRocketNum:int;// = 0
var overSound:Sound;
var midFire:Sound;
var upgradeColor:ColorTransform;
var rebornTimer:Timer;
protected var weaponDamage;
var explodeSound:Sound;
var redUpgradeSpeed;
var rocketNumLimits;// = 1
public var extraLives:int;// = 0
protected var accelerate:Number;
var accelerateNormalList:Array;
protected var speedX:Number;// = 0
protected var speedY:Number;// = 0
protected var friction:Number;// = 0.1
protected var fireRates;
var blueUpgradeSpeed;
var _iSpeedLevel:int;// = 0
var bFireActive1:Boolean;// = false
var bFireActive2:Boolean;// = false
var bFireActive3:Boolean;// = false
public var mouseXAbs:Number;// = 0
var boostSound:Sound;
var collisionPushDist;// = 10
var bBoostable:Boolean;// = false
public var mouseYRelative:Number;// = 0
var gameoverTimer:Timer;
var particleGenRight:ParticleGen;
var fireTimer1:Timer;
var fireTimer3:Timer;
var boostTimer:Timer;// = null
var fireTimer2:Timer;
public var mouseYAbs:Number;// = 0
var greenUpgrade;
protected var speedMax:Number;
public var body:MovieClip;
var heavyFire:Sound;
var speedMaxNormalList:Array;
var bInvulnerable:Boolean;// = false
var speedMaxBoostList:Array;
var invulTimer:Timer;
var playerHPList:Array;
var hpBar:HPBar;// = null
public static var GAME_OVER:String = "gameover";
public function Player(){
_iHPLevel = 0;
_iSpeedLevel = 0;
speedMaxNormalList = [5, 6, 7, 8];
speedMaxBoostList = [9, 10, 11, 12];
accelerateNormalList = [18, 19, 20, 21];
accelerateBoostList = [25, 26, 27, 28];
playerHPList = [100, 180, 260, 320];
rocketNumLimits = 1;
currentRocketNum = 0;
extraLives = 0;
speedX = 0;
speedY = 0;
speedMax = speedMaxNormalList[0];
accelerate = accelerateNormalList[0];
friction = 0.1;
speedLoss = 0.97;
_iCurrentGun = 0;
fireRates = [400, 400, 1000];
weaponDamage = [8, 8, 35];
boostDuration = 2000;
boostCooldown = 4000;
collisionPushDist = 10;
overSound = new sfx_gameover();
upgradeColor = new ColorTransform();
redUpgrade = [0, 50, 100, 150];
greenUpgrade = [0, 0, 0, 0];
blueUpgrade = [0, 0, 0, 0];
upgradeSpeedColor = new ColorTransform();
redUpgradeSpeed = [0, -100, -150, -200];
greenUpgradeSpeed = [0, -100, -150, -200];
blueUpgradeSpeed = [0, 0, 0, 0];
fireTimer1 = new Timer(fireRates[0]);
fireTimer2 = new Timer(fireRates[1]);
fireTimer3 = new Timer(fireRates[2]);
bFireActive1 = false;
bFireActive2 = false;
bFireActive3 = false;
mouseXAbs = 0;
mouseYAbs = 0;
mouseXRelative = 0;
mouseYRelative = 0;
bCoreMode = false;
bBoostable = false;
boostTimer = null;
boostSound = new sfx_speedboost();
hpBar = null;
bInvulnerable = false;
invulCounter = 0;
super();
setFireRate();
lightFire = new sfx_player_lightgun();
midFire = new sfx_player_mediumgun();
heavyFire = new sfx_player_heavygun();
explodeSound = new sfx_explosion1();
}
protected function setRotation():void{
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = (mouseXAbs - x);
_local2 = (mouseYAbs - y);
directionRad = Math.atan((_local2 / _local1));
_local3 = ((directionRad / Math.PI) * 180);
body.rotation = (_local3 + 90);
if (_local1 < 0){
body.rotation = (body.rotation - 180);
directionRad = (directionRad - Math.PI);
};
}
function shootBullet(_arg1:int):void{
var _local2:Bullet;
var _local3:Bullet;
var _local4:Point;
var _local5:Point;
var _local6:Rocket_Gun3;
var _local7:Point;
if ((((_arg1 == 0)) || ((_arg1 == 1)))){
if (_arg1 == 0){
_local2 = new Bullet();
_local3 = new Bullet();
_local2.setOwner(this);
_local3.setOwner(this);
_local4 = new Point(body.leftgun1.x, body.leftgun1.y);
_local5 = new Point(body.rightgun1.x, body.rightgun1.y);
if (Main.bHasSound){
lightFire.play();
};
} else {
_local2 = new Bullet_Gun2();
_local3 = new Bullet_Gun2();
_local2.setOwner(this);
_local3.setOwner(this);
_local4 = new Point(body.leftgun2.x, body.leftgun2.y);
_local5 = new Point(body.rightgun2.x, body.rightgun2.y);
if (Main.bHasSound){
midFire.play();
};
};
_local4 = this.body.localToGlobal(_local4);
_local5 = this.body.localToGlobal(_local5);
_local2.bulletDamage = weaponDamage[_arg1];
_local3.bulletDamage = weaponDamage[_arg1];
_local2.ShootFromTo((_local4.x + GameStage._camera.posX), (_local4.y + GameStage._camera.posY), directionRad);
(root as Main).gameStage.gameScene.addChild(_local2);
_local3.ShootFromTo((_local5.x + GameStage._camera.posX), (_local5.y + GameStage._camera.posY), directionRad);
(root as Main).gameStage.gameScene.addChild(_local3);
};
if (_arg1 == 2){
if (currentRocketNum < rocketNumLimits){
_local6 = new Rocket_Gun3();
_local7 = new Point(body.gun3.x, body.gun3.y);
_local6.setOwner(this);
_local7 = this.body.localToGlobal(_local7);
_local6.bGuiding = true;
_local6.bulletDamage = weaponDamage[_arg1];
_local6.ShootFromTo((_local7.x + GameStage._camera.posX), (_local7.y + GameStage._camera.posY), directionRad);
(root as Main).gameStage.gameScene.addChild(_local6);
if (Main.bHasSound){
heavyFire.play();
};
};
};
}
public function restoreHP():void{
if (hpBar){
hpBar.restore();
};
}
override protected function addedToStageHandle(_arg1:Event):void{
addEventListener(Event.ENTER_FRAME, enterFrameHandle);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mousedownHandler);
stage.addEventListener(MouseEvent.MOUSE_MOVE, mousemoveHandler);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseupHandler);
stage.addEventListener("keyDown", onSpeedBoost);
particleGenLeft = new ParticleGen();
particleGenLeft.x = body.leftEngine.x;
particleGenLeft.y = body.leftEngine.y;
particleGenLeft.rotation = body.leftEngine.rotation;
body.addChild(particleGenLeft);
particleGenRight = new ParticleGen();
particleGenRight.x = body.rightEngine.x;
particleGenRight.y = body.rightEngine.y;
particleGenRight.rotation = body.rightEngine.rotation;
body.addChild(particleGenRight);
upgradeColor.redOffset = redUpgrade[iHPLevel];
upgradeColor.greenOffset = greenUpgrade[iHPLevel];
upgradeColor.blueOffset = blueUpgrade[iHPLevel];
this.transform.colorTransform = upgradeColor;
upgradeSpeedColor.redOffset = redUpgradeSpeed[iSpeedLevel];
upgradeSpeedColor.greenOffset = greenUpgradeSpeed[iSpeedLevel];
upgradeSpeedColor.blueOffset = blueUpgradeSpeed[iSpeedLevel];
particleGenLeft.transform.colorTransform = upgradeColor;
particleGenRight.transform.colorTransform = upgradeColor;
}
public function get iCurrentGun():int{
return (_iCurrentGun);
}
protected function mousemoveHandler(_arg1:MouseEvent):void{
mouseXRelative = _arg1.stageX;
mouseYRelative = _arg1.stageY;
mouseXAbs = (_arg1.stageX + GameStage._camera.posX);
mouseYAbs = (_arg1.stageY + GameStage._camera.posY);
setRotation();
}
protected function mousedownHandler(_arg1:MouseEvent):void{
if (Main.cursor.bInMenu){
return;
};
switch (iCurrentGun){
case 0:
bFireActive1 = true;
break;
case 1:
bFireActive1 = true;
bFireActive2 = true;
break;
case 2:
bFireActive1 = true;
bFireActive2 = true;
bFireActive3 = true;
break;
case 3:
bFireActive1 = true;
bFireActive2 = true;
bFireActive3 = true;
break;
};
if (bFireActive1){
if (fireTimer1.running){
} else {
shootBullet(0);
fireTimer1.start();
};
};
if (bFireActive2){
if (fireTimer2.running){
} else {
shootBullet(1);
fireTimer2.start();
};
};
if (bFireActive3){
if (fireTimer3.running){
} else {
shootBullet(2);
fireTimer3.start();
};
};
}
public function set iCurrentGun(_arg1:int):void{
this._iCurrentGun = _arg1;
if (_iCurrentGun == 3){
doubleFireRate();
rocketNumLimits = 2;
};
}
public function damageHP(_arg1:Number):void{
if (hpBar){
hpBar.takeDamage(_arg1);
};
}
function setFireRate():void{
fireTimer1.addEventListener(TimerEvent.TIMER, onFire);
fireTimer2.addEventListener(TimerEvent.TIMER, onFire);
fireTimer3.addEventListener(TimerEvent.TIMER, onFire);
}
function onReborn(_arg1:TimerEvent):void{
extraLives--;
this.visible = true;
bInvulnerable = true;
invulCounter = 0;
invulTimer = new Timer(100, 30);
invulTimer.addEventListener(TimerEvent.TIMER, onInvul);
invulTimer.start();
upgradeColor.redOffset = (redUpgrade[iHPLevel] + (3 * 60));
upgradeColor.greenOffset = (greenUpgrade[iHPLevel] + (3 * 60));
upgradeColor.blueOffset = (blueUpgrade[iHPLevel] + (3 * 60));
this.transform.colorTransform = upgradeColor;
(root as Main).gameStage.gameHud.drawExtraLife(extraLives);
restoreHP();
fireTimer1.addEventListener(TimerEvent.TIMER, onFire);
fireTimer2.addEventListener(TimerEvent.TIMER, onFire);
fireTimer3.addEventListener(TimerEvent.TIMER, onFire);
addEventListener(Event.ENTER_FRAME, enterFrameHandle);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mousedownHandler);
stage.addEventListener(MouseEvent.MOUSE_MOVE, mousemoveHandler);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseupHandler);
stage.addEventListener("keyDown", onSpeedBoost);
}
public function onHPOut(_arg1:Event):void{
if (extraLives == 0){
gameoverTimer = new Timer(4000, 1);
gameoverTimer.addEventListener(TimerEvent.TIMER, onGameOver);
gameoverTimer.start();
selfExplode();
this.visible = false;
fireTimer1.stop();
fireTimer2.stop();
fireTimer3.stop();
fireTimer1.removeEventListener(TimerEvent.TIMER, onFire);
fireTimer2.removeEventListener(TimerEvent.TIMER, onFire);
fireTimer3.removeEventListener(TimerEvent.TIMER, onFire);
removeEventListener(Event.ENTER_FRAME, enterFrameHandle);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, mousedownHandler);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, mousemoveHandler);
stage.removeEventListener(MouseEvent.MOUSE_UP, mouseupHandler);
stage.removeEventListener("keyDown", onSpeedBoost);
} else {
rebornTimer = new Timer(3000, 1);
rebornTimer.addEventListener(TimerEvent.TIMER, onReborn);
rebornTimer.start();
fireTimer1.stop();
fireTimer2.stop();
fireTimer3.stop();
fireTimer1.removeEventListener(TimerEvent.TIMER, onFire);
fireTimer2.removeEventListener(TimerEvent.TIMER, onFire);
fireTimer3.removeEventListener(TimerEvent.TIMER, onFire);
removeEventListener(Event.ENTER_FRAME, enterFrameHandle);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, mousedownHandler);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, mousemoveHandler);
stage.removeEventListener(MouseEvent.MOUSE_UP, mouseupHandler);
stage.removeEventListener("keyDown", onSpeedBoost);
selfExplode();
this.visible = false;
};
}
public function showHP(_arg1:Boolean):void{
if (_arg1 == false){
(root as Main).gameStage.gameHud.basic.playerHPMarker.removeChild(hpBar);
};
}
public function get iSpeedLevel():int{
return (_iSpeedLevel);
}
public function get iHPLevel():int{
return (_iHPLevel);
}
function onSpeedBoost(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == Keyboard.SPACE)) || ((_arg1.keyCode == Keyboard.CONTROL)))){
if (bBoostable){
bBoostable = false;
(root as Main).gameStage.gameHud.basic.boostInd.gotoAndStop(1);
speedBoost();
if (Main.bHasSound){
boostSound.play();
};
};
};
}
function onGameOver(_arg1:TimerEvent):void{
var _local2:Event;
Main.loseReason = "Player Down";
_local2 = new Event(GAME_OVER, true);
dispatchEvent(_local2);
}
public function setHP(_arg1:Number):void{
if (hpBar){
hpBar.removeEventListener(HPBar.OUT_OF_HP, onHPOut);
(root as Main).gameStage.gameHud.basic.removeChild(hpBar);
};
hpBar = new HPBar_Player();
hpBar.setHP(_arg1);
hpBar.x = (root as Main).gameStage.gameHud.basic.playerHPMarker.x;
hpBar.y = (root as Main).gameStage.gameHud.basic.playerHPMarker.y;
(root as Main).gameStage.gameHud.basic.addChildAt(hpBar, (root as Main).gameStage.gameHud.basic.getChildIndex((root as Main).gameStage.gameHud.basic.playerHPMarker));
hpBar.addEventListener(HPBar.OUT_OF_HP, onHPOut);
}
function onFire(_arg1:TimerEvent):void{
if (_arg1.target == fireTimer1){
if (bFireActive1 == false){
fireTimer1.stop();
} else {
shootBullet(0);
};
};
if (_arg1.target == fireTimer2){
if (bFireActive2 == false){
fireTimer2.stop();
} else {
shootBullet(1);
};
};
if (_arg1.target == fireTimer3){
if (bFireActive3 == false){
fireTimer3.stop();
} else {
shootBullet(2);
};
};
}
protected function mouseupHandler(_arg1:MouseEvent):void{
bFireActive1 = false;
bFireActive2 = false;
bFireActive3 = false;
}
function doubleFireRate():void{
fireTimer1.delay = (fireRates[0] / 1.5);
fireTimer2.delay = (fireRates[1] / 1.5);
fireTimer3.delay = (fireRates[2] / 1.5);
}
protected function moveMe():void{
if (((Tools.isDown(68)) || (Tools.isDown(Keyboard.RIGHT)))){
speedX = (speedX + accelerate);
if (speedX > speedMax){
speedX = speedMax;
};
};
if (((Tools.isDown(65)) || (Tools.isDown(Keyboard.LEFT)))){
speedX = (speedX - accelerate);
if (speedX < (-1 * speedMax)){
speedX = (-1 * speedMax);
};
};
if (((Tools.isDown(83)) || (Tools.isDown(Keyboard.DOWN)))){
speedY = (speedY + accelerate);
if (speedY > speedMax){
speedY = speedMax;
};
};
if (((Tools.isDown(87)) || (Tools.isDown(Keyboard.UP)))){
speedY = (speedY - accelerate);
if (speedY < (-1 * speedMax)){
speedY = (-1 * speedMax);
};
};
if (Tools.isDown(77)){
(root as Main).gameStage.gameHud.addMaterial(10);
};
x = (x + speedX);
y = (y + speedY);
speedX = (speedX * speedLoss);
speedY = (speedY * speedLoss);
if (Math.abs(speedX) > 0){
if (Math.abs(speedX) < friction){
speedX = 0;
} else {
speedX = (speedX - ((friction * Math.abs(speedX)) / speedX));
};
};
if (Math.abs(speedY) > 0){
if (Math.abs(speedY) < friction){
speedY = 0;
} else {
speedY = (speedY - ((friction * Math.abs(speedY)) / speedY));
};
};
}
protected function updateCamera():void{
if (bCoreMode){
GameStage._camera.updateCamera((root as Main).gameStage._core);
} else {
GameStage._camera.updateCamera(this);
};
}
override protected function removeFromStageHandle(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, enterFrameHandle);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, mousedownHandler);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, mousemoveHandler);
stage.removeEventListener(MouseEvent.MOUSE_UP, mouseupHandler);
stage.removeEventListener("keyDown", onSpeedBoost);
}
function speedBoost():void{
if (boostTimer == null){
boostTimer = new Timer(boostDuration, 1);
boostTimer.addEventListener(TimerEvent.TIMER, onBoostOver);
boostTimer.start();
} else {
boostTimer.reset();
boostTimer.start();
};
body.gotoAndStop(2);
speedMax = speedMaxBoostList[_iSpeedLevel];
accelerate = accelerateBoostList[_iSpeedLevel];
}
public function set iHPLevel(_arg1:int):void{
this._iHPLevel = _arg1;
setHP((playerHPList[_iHPLevel] * Main.diffFactor));
upgradeColor.redOffset = redUpgrade[iHPLevel];
upgradeColor.greenOffset = greenUpgrade[iHPLevel];
upgradeColor.blueOffset = blueUpgrade[iHPLevel];
this.transform.colorTransform = upgradeColor;
}
function onInvul(_arg1:TimerEvent):void{
invulCounter++;
upgradeColor.redOffset = (redUpgrade[iHPLevel] + ((30 - invulCounter) * 6));
upgradeColor.greenOffset = (greenUpgrade[iHPLevel] + ((30 - invulCounter) * 6));
upgradeColor.blueOffset = (blueUpgrade[iHPLevel] + ((30 - invulCounter) * 6));
this.transform.colorTransform = upgradeColor;
if (invulCounter == 30){
bInvulnerable = false;
};
}
public function set iSpeedLevel(_arg1:int):void{
this._iSpeedLevel = _arg1;
speedMax = speedMaxNormalList[_iSpeedLevel];
accelerate = accelerateNormalList[_iSpeedLevel];
upgradeSpeedColor.redOffset = redUpgradeSpeed[_iSpeedLevel];
upgradeSpeedColor.greenOffset = greenUpgradeSpeed[_iSpeedLevel];
upgradeSpeedColor.blueOffset = blueUpgradeSpeed[_iSpeedLevel];
particleGenLeft.transform.colorTransform = upgradeSpeedColor;
particleGenRight.transform.colorTransform = upgradeSpeedColor;
}
protected function collisionHandler():void{
var _local1:int;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:Number;
_local1 = 0;
while (_local1 < (root as Main).gameStage.gameScene.numChildren) {
_local2 = (root as Main).gameStage.gameScene.getChildAt(_local1);
if ((_local2 is Core)){
_local5 = Tools.distance(x, y, (_local2 as GameObject).x, (_local2 as GameObject).y);
if (_local5 < Core.collisionDistance){
_local3 = ((_local2 as GameObject).x - x);
_local4 = ((_local2 as GameObject).y - y);
x = (x - ((_local3 / _local5) * (Core.collisionDistance - _local5)));
y = (y - ((_local4 / _local5) * (Core.collisionDistance - _local5)));
};
};
if (_local2.name == "scenecollision"){
_local5 = Tools.distance(x, y, _local2.x, _local2.y);
if (_local2.hitTestPoint((x - GameStage._camera.posX), (y - GameStage._camera.posY), true)){
_local3 = (x - (root as Main).gameStage._core.x);
_local4 = (y - (root as Main).gameStage._core.y);
x = (x - ((_local3 / _local5) * collisionPushDist));
y = (y - ((_local4 / _local5) * collisionPushDist));
};
};
if (x < (0 + (width / 2))){
x = (0 + (width / 2));
};
if (x > (Main._sceneWidth - (width / 2))){
x = (Main._sceneWidth - (width / 2));
};
if (y < (0 + (height / 2))){
y = (0 + (height / 2));
};
if (y > (Main._sceneHeight - (height / 2))){
y = (Main._sceneHeight - (height / 2));
};
_local1++;
};
}
function onBoostOver(_arg1:Event):void{
(root as Main).gameStage.gameHud.basic.boostInd.gotoAndPlay(1);
body.gotoAndStop(1);
speedMax = speedMaxNormalList[_iSpeedLevel];
accelerate = accelerateNormalList[_iSpeedLevel];
}
function selfExplode():void{
var _local1:BigExplode;
_local1 = new BigExplode();
_local1.rotation = (Math.random() * 360);
_local1.x = x;
_local1.y = y;
(root as Main).gameStage.gameScene.addChild(_local1);
if (Main.bHasSound){
explodeSound.play();
overSound.play();
};
}
override protected function enterFrameHandle(_arg1:Event):void{
moveMe();
updateCamera();
super.enterFrameHandle(_arg1);
collisionHandler();
if ((((hpBar == null)) && ((root as Main).gameStage.gameHud.basic))){
setHP((playerHPList[_iHPLevel] * Main.diffFactor));
};
}
}
}//package
Section 71
//PlayerLife (PlayerLife)
package {
import flash.display.*;
public dynamic class PlayerLife extends MovieClip {
}
}//package
Section 72
//Ranger (Ranger)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.geom.*;
public class Ranger extends Enemy {
var ptLeft:Point;
var ptRight:Point;
var midFire:Sound;
public var turret:MovieClip;
public var body:MovieClip;
public function Ranger(){
speed = 2;
keepDistance = 200;
keepDistanceForCore = 350;
fireRate = 2000;
HPTable = rangerHPTable;
midFire = new sfx_enemy_mediumgun();
}
override protected function getDamage():Number{
return (rangerDamageTable[iCurrentEnemyLevel]);
}
override protected function playShootSound():void{
midFire.play();
}
override public function getMaterial():int{
return (rangerMaterialTable[iCurrentEnemyLevel]);
}
override protected function onFire(_arg1:TimerEvent):void{
var _local2:Bullet;
var _local3:Bullet;
if (fireTarget){
if ((fireTarget is Core)){
if (Tools.distance((root as Main).gameStage._core.x, (root as Main).gameStage._core.y, x, y) < shootRangeForCore){
_local2 = new Bullet_Enemy();
_local3 = new Bullet_Enemy();
_local2.bType = "Enemy_Bullet";
_local3.bType = "Enemy_Bullet";
_local2.bulletDamage = getDamage();
_local3.bulletDamage = getDamage();
ptLeft = new Point(turret.leftGun.x, turret.leftGun.y);
ptRight = new Point(turret.rightGun.x, turret.rightGun.y);
ptLeft = this.turret.localToGlobal(ptLeft);
ptRight = this.turret.localToGlobal(ptRight);
_local2.ShootFromTo((ptLeft.x + GameStage._camera.posX), (ptLeft.y + GameStage._camera.posY), fireDirection);
(root as Main).gameStage.gameScene.addChild(_local2);
_local3.ShootFromTo((ptRight.x + GameStage._camera.posX), (ptRight.y + GameStage._camera.posY), fireDirection);
(root as Main).gameStage.gameScene.addChild(_local3);
if (Main.bHasSound){
playShootSound();
};
};
} else {
if ((fireTarget is Player)){
if (Tools.distance((root as Main).gameStage._player.x, (root as Main).gameStage._player.y, x, y) < shootRangeForPlayer){
_local2 = new Bullet_Enemy();
_local3 = new Bullet_Enemy();
_local2.bType = "Enemy_Bullet";
_local3.bType = "Enemy_Bullet";
_local2.bulletDamage = getDamage();
_local3.bulletDamage = getDamage();
ptLeft = new Point(turret.leftGun.x, turret.leftGun.y);
ptRight = new Point(turret.rightGun.x, turret.rightGun.y);
ptLeft = this.turret.localToGlobal(ptLeft);
ptRight = this.turret.localToGlobal(ptRight);
_local2.ShootFromTo((ptLeft.x + GameStage._camera.posX), (ptLeft.y + GameStage._camera.posY), fireDirection);
(root as Main).gameStage.gameScene.addChild(_local2);
_local3.ShootFromTo((ptRight.x + GameStage._camera.posX), (ptRight.y + GameStage._camera.posY), fireDirection);
(root as Main).gameStage.gameScene.addChild(_local3);
if (Main.bHasSound){
playShootSound();
};
};
if (bShootBack){
bShootBack = false;
};
};
};
};
}
override protected function setBodyRotation(_arg1:Number):void{
body.rotation = _arg1;
}
override public function getScore():int{
return (1);
}
override protected function setTurretRotation(_arg1:Number):void{
turret.rotation = _arg1;
}
}
}//package
Section 73
//Rocket_Gun3 (Rocket_Gun3)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Rocket_Gun3 extends Bullet {
public var maxGuideAngel:Number;// = 120
public var bGuiding:Boolean;// = false
var oldR:Number;// = 0
var oldY:Number;// = 0
var trailRotationArray:Array;
var oldX:Number;// = 0
var trailLists:Array;
public var bFirstMove:Boolean;// = true
public var angularSpeed:Number;// = 0.08
var trailPositionYArray:Array;
public var guidingTarget:GameObject;// = null
var trailLength:int;// = 3
public var particlePosition:MovieClip;
var bNeedRemove;// = false
var particleGen:ParticleGen;
var trailPositionXArray:Array;
public static var rocketLife:Number = 4000;
public function Rocket_Gun3(){
trailLength = 3;
bGuiding = false;
bFirstMove = true;
guidingTarget = null;
maxGuideAngel = 120;
angularSpeed = 0.08;
bNeedRemove = false;
oldX = 0;
oldY = 0;
oldR = 0;
super();
bulletSpeed = 12;
}
override protected function addedToStageHandle(_arg1:Event):void{
var _local2:int;
var _local3:*;
trailLists = new Array(trailLength);
trailPositionXArray = new Array(trailLength);
trailPositionYArray = new Array(trailLength);
trailRotationArray = new Array(trailLength);
_local2 = 0;
while (_local2 < trailLength) {
_local3 = new TrailSample();
parent.addChild(_local3);
trailLists[_local2] = _local3;
trailPositionXArray[_local2] = 0;
trailPositionYArray[_local2] = 0;
trailRotationArray[_local2] = 0;
_local2++;
};
super.addedToStageHandle(_arg1);
}
override protected function moveBullet():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:int;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:*;
if (bGuiding){
if (bFirstMove){
bFirstMove = false;
if (root){
if (bType == "Enemy_Bullet"){
guidingTarget = (root as Main).gameStage._player;
return;
};
_local3 = (root as Main).gameStage.gameScene;
_local9 = 10000;
_local10 = -1;
_local5 = 0;
while (_local5 < _local3.numChildren) {
_local4 = _local3.getChildAt(_local5);
if ((_local4 is Enemy)){
_local6 = Tools.distance(x, y, (_local4 as Enemy).x, (_local4 as Enemy).y);
_local7 = ((_local4 as Enemy).x - x);
_local8 = ((_local4 as Enemy).y - y);
_local7 = (_local7 / _local6);
_local8 = (_local8 / _local6);
if (((delX * _local7) + (delY * _local8)) > Math.cos((((maxGuideAngel / 2) * Math.PI) / 180))){
if (_local6 < _local9){
_local9 = _local6;
_local10 = _local5;
};
};
};
_local5++;
};
if (_local10 != -1){
guidingTarget = _local3.getChildAt(_local10);
};
};
} else {
if (((guidingTarget) && (!((guidingTarget.root == null))))){
_local11 = (guidingTarget.x - x);
_local12 = (guidingTarget.y - y);
_local13 = Tools.distance(guidingTarget.x, guidingTarget.y, x, y);
_local11 = (_local11 / _local13);
_local12 = (_local12 / _local13);
delX = (delX + (angularSpeed * (_local11 - delX)));
delY = (delY + (angularSpeed * (_local12 - delY)));
_local14 = Math.sqrt(((delX * delX) + (delY * delY)));
delX = (delX / _local14);
delY = (delY / _local14);
_local15 = ((Math.atan((delY / delX)) * 180) / Math.PI);
if (delX < 0){
_local15 = (_local15 - 180);
};
rotation = (_local15 - 90);
};
};
};
super.moveBullet();
_local1 = (oldX - x);
_local2 = (oldY - y);
_local5 = 0;
while (_local5 < (trailLength - 1)) {
trailPositionXArray[(_local5 + 1)] = trailPositionXArray[_local5];
trailPositionYArray[(_local5 + 1)] = trailPositionYArray[_local5];
trailRotationArray[(_local5 + 1)] = trailRotationArray[_local5];
_local5++;
};
trailPositionXArray[0] = oldX;
trailPositionYArray[0] = oldY;
trailRotationArray[0] = oldR;
oldX = x;
oldY = y;
oldR = rotation;
_local5 = 0;
while (_local5 < trailLength) {
trailLists[_local5].x = trailPositionXArray[_local5];
trailLists[_local5].y = trailPositionYArray[_local5];
trailLists[_local5].rotation = trailRotationArray[_local5];
_local5++;
};
if (bNeedRemove){
if (root){
parent.removeChild(this);
};
};
}
override protected function setLifeTime():void{
}
override public function setOwner(_arg1):void{
owner = _arg1;
if ((((owner is Player)) || ((owner is Pillar_Missile)))){
owner.currentRocketNum++;
};
}
override protected function removeFromStageHandle(_arg1:Event):void{
var _local2:*;
removeEventListener(Event.ENTER_FRAME, enterFrameHandle);
_local2 = 0;
while (_local2 < trailLength) {
parent.removeChild(trailLists[_local2]);
_local2++;
};
if (owner){
owner.currentRocketNum--;
};
}
public function setRocketLifeTime(_arg1:Number):void{
lifeTimer = new Timer(_arg1, 1);
lifeTimer.addEventListener(TimerEvent.TIMER, onLifeOut);
lifeTimer.start();
}
}
}//package
Section 74
//Scout (Scout)
package {
import flash.display.*;
import flash.media.*;
public class Scout extends Enemy {
var lightFire:Sound;
public var turret:MovieClip;
public var body:MovieClip;
public function Scout(){
speed = 3;
keepDistance = 150;
keepDistanceForCore = 300;
fireRate = 1000;
HPTable = scoutHPTable;
lightFire = new sfx_enemy_lightgun();
}
override protected function getDamage():Number{
return (scoutDamageTable[iCurrentEnemyLevel]);
}
override protected function confirmTarget():void{
if (currentState == "goForPlayer"){
fireTarget = (root as Main).gameStage._player;
} else {
super.confirmTarget();
};
}
override protected function playShootSound():void{
lightFire.play();
}
override public function getMaterial():int{
return (scoutMaterialTable[iCurrentEnemyLevel]);
}
override protected function setBodyRotation(_arg1:Number):void{
body.rotation = _arg1;
}
override public function getScore():int{
return (1);
}
override protected function checkMoveState():void{
var _local1:Number;
_local1 = Tools.distance((root as Main).gameStage._player.x, (root as Main).gameStage._player.y, x, y);
if (_local1 < keepDistance){
currentState = "goForPlayer";
};
}
override protected function setTurretRotation(_arg1:Number):void{
turret.rotation = _arg1;
}
}
}//package
Section 75
//SecondSplashBase (SecondSplashBase)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class SecondSplashBase extends SimpleButton {
public function SecondSplashBase(){
addEventListener(MouseEvent.CLICK, onClickLogo);
}
function onClickLogo(_arg1:Event):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.anothergamestudio.com/");
navigateToURL(_local2, "_blank");
}
}
}//package
Section 76
//SecondSplashScreen (SecondSplashScreen)
package {
import flash.events.*;
import flash.display.*;
public class SecondSplashScreen extends MovieClip {
var tel:int;// = 0
public static const SPLASH_OVER:String = "splash_over";
public function SecondSplashScreen(){
tel = 0;
super();
alpha = 0;
addEventListener(Event.ADDED_TO_STAGE, onAdd);
addEventListener(Event.REMOVED_FROM_STAGE, onRemove);
addEventListener(Event.ENTER_FRAME, onUpdate);
}
function onRemove(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, onUpdate);
}
function onAdd(_arg1:Event):void{
}
function onUpdate(_arg1:Event):void{
var _local2:Event;
if (alpha < 1){
alpha = (alpha + 0.1);
} else {
tel++;
};
if (tel > 120){
alpha = (alpha - 0.15);
if (alpha <= 0){
_local2 = new Event(SPLASH_OVER);
dispatchEvent(_local2);
parent.removeChild(this);
};
};
}
}
}//package
Section 77
//sfx_areaclear (sfx_areaclear)
package {
import flash.media.*;
public dynamic class sfx_areaclear extends Sound {
}
}//package
Section 78
//sfx_bullethit (sfx_bullethit)
package {
import flash.media.*;
public dynamic class sfx_bullethit extends Sound {
}
}//package
Section 79
//sfx_enemy_heavygun (sfx_enemy_heavygun)
package {
import flash.media.*;
public dynamic class sfx_enemy_heavygun extends Sound {
}
}//package
Section 80
//sfx_enemy_lightgun (sfx_enemy_lightgun)
package {
import flash.media.*;
public dynamic class sfx_enemy_lightgun extends Sound {
}
}//package
Section 81
//sfx_enemy_mediumgun (sfx_enemy_mediumgun)
package {
import flash.media.*;
public dynamic class sfx_enemy_mediumgun extends Sound {
}
}//package
Section 82
//sfx_explosion1 (sfx_explosion1)
package {
import flash.media.*;
public dynamic class sfx_explosion1 extends Sound {
}
}//package
Section 83
//sfx_explosion2 (sfx_explosion2)
package {
import flash.media.*;
public dynamic class sfx_explosion2 extends Sound {
}
}//package
Section 84
//sfx_gameover (sfx_gameover)
package {
import flash.media.*;
public dynamic class sfx_gameover extends Sound {
}
}//package
Section 85
//sfx_gamestart (sfx_gamestart)
package {
import flash.media.*;
public dynamic class sfx_gamestart extends Sound {
}
}//package
Section 86
//sfx_gui_click (sfx_gui_click)
package {
import flash.media.*;
public dynamic class sfx_gui_click extends Sound {
}
}//package
Section 87
//sfx_gui_incoming (sfx_gui_incoming)
package {
import flash.media.*;
public dynamic class sfx_gui_incoming extends Sound {
}
}//package
Section 88
//sfx_gui_roll (sfx_gui_roll)
package {
import flash.media.*;
public dynamic class sfx_gui_roll extends Sound {
}
}//package
Section 89
//sfx_gui_upgradeclose (sfx_gui_upgradeclose)
package {
import flash.media.*;
public dynamic class sfx_gui_upgradeclose extends Sound {
}
}//package
Section 90
//sfx_gui_upgradeopen (sfx_gui_upgradeopen)
package {
import flash.media.*;
public dynamic class sfx_gui_upgradeopen extends Sound {
}
}//package
Section 91
//sfx_gui_warning1 (sfx_gui_warning1)
package {
import flash.media.*;
public dynamic class sfx_gui_warning1 extends Sound {
}
}//package
Section 92
//sfx_pickup_mat (sfx_pickup_mat)
package {
import flash.media.*;
public dynamic class sfx_pickup_mat extends Sound {
}
}//package
Section 93
//sfx_player_heavygun (sfx_player_heavygun)
package {
import flash.media.*;
public dynamic class sfx_player_heavygun extends Sound {
}
}//package
Section 94
//sfx_player_lightgun (sfx_player_lightgun)
package {
import flash.media.*;
public dynamic class sfx_player_lightgun extends Sound {
}
}//package
Section 95
//sfx_player_mediumgun (sfx_player_mediumgun)
package {
import flash.media.*;
public dynamic class sfx_player_mediumgun extends Sound {
}
}//package
Section 96
//sfx_speedboost (sfx_speedboost)
package {
import flash.media.*;
public dynamic class sfx_speedboost extends Sound {
}
}//package
Section 97
//sfx_speedboostready (sfx_speedboostready)
package {
import flash.media.*;
public dynamic class sfx_speedboostready extends Sound {
}
}//package
Section 98
//sfx_turret_heavygun (sfx_turret_heavygun)
package {
import flash.media.*;
public dynamic class sfx_turret_heavygun extends Sound {
}
}//package
Section 99
//sfx_turret_lightgun (sfx_turret_lightgun)
package {
import flash.media.*;
public dynamic class sfx_turret_lightgun extends Sound {
}
}//package
Section 100
//sfx_turret_medgun (sfx_turret_medgun)
package {
import flash.media.*;
public dynamic class sfx_turret_medgun extends Sound {
}
}//package
Section 101
//sfx_turretplaced (sfx_turretplaced)
package {
import flash.media.*;
public dynamic class sfx_turretplaced extends Sound {
}
}//package
Section 102
//sfx_upgradebought (sfx_upgradebought)
package {
import flash.media.*;
public dynamic class sfx_upgradebought extends Sound {
}
}//package
Section 103
//StartWaveButton (StartWaveButton)
package {
import flash.events.*;
import flash.display.*;
public class StartWaveButton extends MovieClip {
public var notActive:MovieClip;
public var base:SimpleButton;
public function StartWaveButton(){
setActive(true);
}
public function setActive(_arg1:Boolean):void{
trace(_arg1, "setactive");
if (_arg1 == true){
base.addEventListener(MouseEvent.CLICK, onClick);
notActive.visible = false;
} else {
base.removeEventListener(MouseEvent.CLICK, onClick);
notActive.visible = true;
};
}
function onClick(_arg1:MouseEvent):void{
setActive(false);
(root as Main).gameStage.levelController.waveStart();
}
}
}//package
Section 104
//Tank (Tank)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
public class Tank extends Enemy {
public var currentRocketNum:int;// = 0
var rocketNumLimits;// = 1
public var turret:MovieClip;
var heavyFire:Sound;
public var body:MovieClip;
public function Tank(){
rocketNumLimits = 1;
currentRocketNum = 0;
super();
speed = 1;
keepDistance = 250;
keepDistanceForCore = 400;
fireRate = 4000;
HPTable = tankHPTable;
heavyFire = new sfx_enemy_heavygun();
}
override protected function getDamage():Number{
return (tankDamageTable[iCurrentEnemyLevel]);
}
override protected function playShootSound():void{
heavyFire.play();
}
override public function getMaterial():int{
return (tankMaterialTable[iCurrentEnemyLevel]);
}
override protected function onFire(_arg1:TimerEvent):void{
var _local2:Rocket_Gun3;
var _local3:Rocket_Gun3;
if (fireTarget){
if ((fireTarget is Core)){
if (Tools.distance((root as Main).gameStage._core.x, (root as Main).gameStage._core.y, x, y) < shootRangeForCore){
_local2 = new Rocket_Gun3();
_local2.setRocketLifeTime(Rocket_Gun3.rocketLife);
_local2.bType = "Enemy_Bullet";
_local2.bulletDamage = getDamage();
_local2.setOwner(this);
_local2.ShootFromTo(x, y, fireDirection);
(_local2 as Rocket_Gun3).bGuiding = true;
(root as Main).gameStage.gameScene.addChild(_local2);
if (Main.bHasSound){
playShootSound();
};
};
} else {
if ((fireTarget is Player)){
if (Tools.distance((root as Main).gameStage._player.x, (root as Main).gameStage._player.y, x, y) < shootRangeForPlayer){
_local3 = new Rocket_Gun3();
_local3.setRocketLifeTime(Rocket_Gun3.rocketLife);
_local3.bType = "Enemy_Bullet";
_local3.bulletDamage = getDamage();
_local3.setOwner(this);
_local3.ShootFromTo(x, y, fireDirection);
(_local3 as Rocket_Gun3).bGuiding = true;
(root as Main).gameStage.gameScene.addChild(_local3);
if (Main.bHasSound){
playShootSound();
};
};
if (bShootBack){
bShootBack = false;
};
};
};
};
}
override protected function setBodyRotation(_arg1:Number):void{
body.rotation = _arg1;
}
override public function getScore():int{
return (1);
}
override protected function setTurretRotation(_arg1:Number):void{
turret.rotation = _arg1;
}
}
}//package
Section 105
//TestParticle (TestParticle)
package {
import flash.display.*;
public class TestParticle extends MovieClip {
public var yMovement:Number;// = 0
public var xMovement:Number;// = 0
public function TestParticle(){
xMovement = 0;
yMovement = 0;
super();
}
}
}//package
Section 106
//TextPlayer (TextPlayer)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class TextPlayer extends MovieClip {
var textMessage:TextField;
var textMessage1:TextField;
public var tText1:TextField;
var alphaLost;// = 0.03
public var tText:TextField;
var alphaLost1;// = 0.01
public function TextPlayer(){
alphaLost = 0.03;
alphaLost1 = 0.01;
super();
textMessage = tText;
textMessage.selectable = false;
addEventListener(Event.ENTER_FRAME, onUpdate);
textMessage1 = tText1;
textMessage1.selectable = false;
}
public function setText1(_arg1:String):void{
textMessage1.alpha = 1;
textMessage1.text = _arg1;
}
function onUpdate(_arg1:Event):void{
if (textMessage.alpha > alphaLost){
textMessage.alpha = (textMessage.alpha - alphaLost);
} else {
textMessage.alpha = 0;
};
if (textMessage1.alpha > alphaLost1){
textMessage1.alpha = (textMessage1.alpha - alphaLost1);
} else {
textMessage1.alpha = 0;
};
}
public function setText(_arg1:String):void{
textMessage.alpha = 1;
textMessage.text = _arg1;
}
}
}//package
Section 107
//TitlePage (TitlePage)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class TitlePage extends MovieClip {
public var playMoreButton:SimpleButton;
public var instructionsButton:SimpleButton;
public var playButton:SimpleButton;
public static var GAME_TUTORIAL:String = "gametutorial_title";
public static var PLAY_GAME:String = "playgame_title";
public function TitlePage(){
playButton.addEventListener(MouseEvent.CLICK, onPlay);
instructionsButton.addEventListener(MouseEvent.CLICK, onTut);
playMoreButton.addEventListener(MouseEvent.CLICK, onMore);
}
function onPlay(_arg1:Event):void{
var _local2:Event;
_local2 = new Event(PLAY_GAME, true);
dispatchEvent(_local2);
parent.removeChild(this);
}
function onTut(_arg1:Event):void{
var _local2:Event;
_local2 = new Event(GAME_TUTORIAL, true);
dispatchEvent(_local2);
parent.removeChild(this);
}
function onMore(_arg1:Event):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.2games.com/clickreg.php?type=gamestats&id=1232&subid=mainmenu");
navigateToURL(_local2, "_blank");
}
}
}//package
Section 108
//Tools (Tools)
package {
import flash.events.*;
import flash.display.*;
public class Tools {
private static var obj:Object;
public static function init(_arg1:DisplayObject):void{
obj = new Object();
_arg1.addEventListener("keyDown", keydownHandler);
_arg1.addEventListener("keyUp", keyupHandler);
}
public static function allup():void{
var _local1:String;
for (_local1 in obj) {
obj[_local1] = false;
};
}
public static function distance(_arg1:int, _arg2:int, _arg3:int, _arg4:int):Number{
return (Math.sqrt((((_arg4 - _arg2) * (_arg4 - _arg2)) + ((_arg3 - _arg1) * (_arg3 - _arg1)))));
}
private static function keydownHandler(_arg1:KeyboardEvent):void{
obj[_arg1.keyCode] = true;
}
public static function isDown(_arg1:uint):Boolean{
return ((obj[_arg1]) ? true : false);
}
private static function keyupHandler(_arg1:KeyboardEvent):void{
obj[_arg1.keyCode] = false;
}
}
}//package
Section 109
//TrailSample (TrailSample)
package {
import flash.display.*;
public dynamic class TrailSample extends MovieClip {
}
}//package
Section 110
//TutPage (TutPage)
package {
import flash.events.*;
import flash.display.*;
public class TutPage extends MovieClip {
public var playButton:SimpleButton;
public var backButton:SimpleButton;
public static var PLAY_GAME:String = "playgame_tut";
public static var BACK_TUTORIAL:String = "back_tut";
public function TutPage(){
playButton.addEventListener(MouseEvent.CLICK, onPlay);
backButton.addEventListener(MouseEvent.CLICK, onBack);
}
function onBack(_arg1:Event):void{
var _local2:Event;
_local2 = new Event(BACK_TUTORIAL, true);
dispatchEvent(_local2);
parent.removeChild(this);
}
function onPlay(_arg1:Event):void{
var _local2:Event;
_local2 = new Event(PLAY_GAME, true);
dispatchEvent(_local2);
parent.removeChild(this);
}
}
}//package
Section 111
//Wall (Wall)
package {
import flash.events.*;
import flash.media.*;
import flash.geom.*;
public class Wall extends GameObject implements IHPObject {
var hpBar:HPBar;
var _iWallLevel;// = 0
var destroySound:Sound;
var redUpgrade;
var blueUpgrade;
var greenUpgrade;
var upgradeColor:ColorTransform;
var HPList;
public var bTouchable:Boolean;// = true
public function Wall(){
_iWallLevel = 0;
HPList = [100, 150, 200, 250];
bTouchable = true;
destroySound = new sfx_explosion2();
upgradeColor = new ColorTransform();
redUpgrade = [0, 50, 100, 150];
greenUpgrade = [0, 0, 0, 0];
blueUpgrade = [0, 0, 0, 0];
super();
setHP((HPList[_iWallLevel] * Main.diffFactor));
gotoAndStop(1);
upgradeColor.redOffset = redUpgrade[iWallLevel];
upgradeColor.greenOffset = greenUpgrade[iWallLevel];
upgradeColor.blueOffset = blueUpgrade[iWallLevel];
this.transform.colorTransform = upgradeColor;
}
public function getDamageLevel():int{
var _local1:Number;
_local1 = (hpBar._currentHP / hpBar.fullHP);
if (_local1 > 0.75){
gotoAndStop(1);
return (1);
};
if (_local1 > 0.5){
gotoAndStop(2);
return (2);
};
if (_local1 > 0.25){
gotoAndStop(3);
return (3);
};
gotoAndStop(4);
return (4);
}
public function restoreHP():void{
if (hpBar){
hpBar.restore();
visible = true;
bTouchable = true;
};
}
public function get iWallLevel():int{
return (_iWallLevel);
}
public function damageHP(_arg1:Number):void{
if (hpBar){
hpBar.takeDamage(_arg1);
(root as Main).gameStage.gameText.setText("Base under attack!");
};
}
public function showHP(_arg1:Boolean):void{
if (_arg1 == false){
removeChild(hpBar);
};
}
public function onHPOut(_arg1:Event):void{
visible = false;
bTouchable = false;
if (Main.bHasSound){
destroySound.play();
};
}
public function set iWallLevel(_arg1:int):void{
this._iWallLevel = _arg1;
setHP((HPList[_iWallLevel] * Main.diffFactor));
upgradeColor.redOffset = redUpgrade[iWallLevel];
upgradeColor.greenOffset = greenUpgrade[iWallLevel];
upgradeColor.blueOffset = blueUpgrade[iWallLevel];
this.transform.colorTransform = upgradeColor;
}
public function setHP(_arg1:Number):void{
if (hpBar){
hpBar.removeEventListener(HPBar.OUT_OF_HP, onHPOut);
};
hpBar = new HPBar();
hpBar.setHP(_arg1);
hpBar.y = (this.height / 2);
addChild(hpBar);
hpBar.addEventListener(HPBar.OUT_OF_HP, onHPOut);
showHP(false);
}
}
}//package