Section 1
//wav (buttonbuzz.wav)
package buttonbuzz {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package buttonbuzz
Section 2
//mp3 (buttonding.mp3)
package buttonding {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package buttonding
Section 3
//mp3 (explode.mp3)
package explode {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package explode
Section 4
//mp3 (hit1.mp3)
package hit1 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package hit1
Section 5
//mp3 (hit2.mp3)
package hit2 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package hit2
Section 6
//mp3 (hit3.mp3)
package hit3 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package hit3
Section 7
//mp3 (hit4.mp3)
package hit4 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package hit4
Section 8
//mp3 (hit5.mp3)
package hit5 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package hit5
Section 9
//MochiServices (mochi.MochiServices)
package mochi {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _sendChannel:LocalConnection;
private static var _rcvChannelName:String;
private static var _gatewayURL:String = "http://www.mochiads.com/static/lib/services/services.swf";
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 = "__mochiservices";
private static var _rcvChannel:LocalConnection;
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 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 get id():String{
return (_id);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function getVersion():String{
return ("1.32");
}
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();
_rcvChannel.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
Security.allowDomain("*");
Security.allowInsecureDomain("*");
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
return (_local2);
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
if (_clip.parent != null){
Sprite(_clip.parent).removeChild(_clip);
};
}
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 onStatus(_arg1:StatusEvent):void{
switch (_arg1.level){
case "error":
_connected = false;
_listenChannel.connect(_listenChannelName);
break;
};
}
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()});
_rcvChannel.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");
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
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...");
}
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) {
};
};
};
};
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
_rcvChannelName = _arg1;
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var clipname:String;
var f:Function;
var req:URLRequest;
var id = _arg1;
var clip = _arg2;
clipname = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
MochiServices.allowDomains(_gatewayURL);
_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");
};
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
req = new URLRequest(_gatewayURL);
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain("*", "localhost");
_rcvChannel.allowInsecureDomain("*", "localhost");
_rcvChannel.client = _clip;
_clip._nextcallbackID = 0;
_clip._callbacks = {};
listen();
return (_clip);
}
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 10
//mp3 (Music_Base.mp3)
package Music_Base {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Music_Base
Section 11
//mp3 (Music_Overlay.mp3)
package Music_Overlay {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Music_Overlay
Section 12
//mp3 (punch_hurk.mp3)
package punch_hurk {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package punch_hurk
Section 13
//mp3 (punch_leftjab.mp3)
package punch_leftjab {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package punch_leftjab
Section 14
//mp3 (punch_rightjab.mp3)
package punch_rightjab {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package punch_rightjab
Section 15
//mp3 (punch_smash.mp3)
package punch_smash {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package punch_smash
Section 16
//ad_container_4 (TF_fla.ad_container_4)
package TF_fla {
import flash.display.*;
public dynamic class ad_container_4 extends MovieClip {
public var container:MovieClip;
public function ad_container_4(){
addFrameScript(0, frame1, 1, frame2, 9, frame10);
}
function frame10(){
gotoAndStop(2);
}
function frame1(){
stop();
container = this;
MochiAd.showPreGameAd({clip:container, id:"c505f16192da7125", res:"700x400", background:0xC8C8C8, color:0x696969, outline:0xFFFFFF, no_bg:true});
}
function frame2(){
stop();
}
}
}//package TF_fla
Section 17
//bob_body_25 (TF_fla.bob_body_25)
package TF_fla {
import flash.display.*;
public dynamic class bob_body_25 extends MovieClip {
public function bob_body_25(){
addFrameScript(79, frame80, 129, frame130, 199, frame200, 254, frame255);
}
function frame80(){
gotoAndStop("run");
}
function frame200(){
gotoAndStop("run");
}
function frame130(){
gotoAndStop("stun");
}
function frame255(){
gotoAndStop("dead");
}
}
}//package TF_fla
Section 18
//bubble_logo3_171 (TF_fla.bubble_logo3_171)
package TF_fla {
import flash.display.*;
public dynamic class bubble_logo3_171 extends MovieClip {
public function bubble_logo3_171(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package TF_fla
Section 19
//BubbleBoxLogoGraphicMc_173 (TF_fla.BubbleBoxLogoGraphicMc_173)
package TF_fla {
import flash.display.*;
public dynamic class BubbleBoxLogoGraphicMc_173 extends MovieClip {
public var play_latest_text:MovieClip;
}
}//package TF_fla
Section 20
//BubbleBoxSplash_169 (TF_fla.BubbleBoxSplash_169)
package TF_fla {
import flash.display.*;
public dynamic class BubbleBoxSplash_169 extends MovieClip {
public var link:MovieClip;
public var play_latest_text:MovieClip;
public function BubbleBoxSplash_169(){
addFrameScript(160, frame161);
}
function frame161(){
stop();
}
}
}//package TF_fla
Section 21
//checkbox_96 (TF_fla.checkbox_96)
package TF_fla {
import flash.display.*;
public dynamic class checkbox_96 extends MovieClip {
public function checkbox_96(){
addFrameScript(0, frame1, 10, frame11);
}
function frame1(){
stop();
}
function frame11(){
stop();
}
}
}//package TF_fla
Section 22
//chunk1_52 (TF_fla.chunk1_52)
package TF_fla {
import flash.display.*;
public dynamic class chunk1_52 extends MovieClip {
public var end:col_vol;
}
}//package TF_fla
Section 23
//hacman_body_27 (TF_fla.hacman_body_27)
package TF_fla {
import flash.display.*;
public dynamic class hacman_body_27 extends MovieClip {
public function hacman_body_27(){
addFrameScript(59, frame60, 89, frame90, 134, frame135);
}
function frame90(){
gotoAndStop("stun");
}
function frame135(){
gotoAndStop("dead");
}
function frame60(){
gotoAndStop("fly");
}
}
}//package TF_fla
Section 24
//hud_erasetext_67 (TF_fla.hud_erasetext_67)
package TF_fla {
import flash.display.*;
import flash.text.*;
public dynamic class hud_erasetext_67 extends MovieClip {
public var res:TextField;
}
}//package TF_fla
Section 25
//MainTimeline (TF_fla.MainTimeline)
package TF_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import mochi.*;
import flash.media.*;
import flash.filters.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var pe:Phase;
public var loaded:Boolean;
public var splash:MovieClip;
public var tf:TFGame;
public var pre:MovieClip;
public function MainTimeline(){
addFrameScript(0, frame1, 39, frame40, 59, frame60, 60, frame61);
}
public function loadBubble(_arg1:Event){
navigateToURL(new URLRequest("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1173&subid=splash"), "_blank");
}
public function setupSplash(_arg1:Event){
if (!loaded){
loaded = true;
splash.addEventListener(MouseEvent.CLICK, loadBubble);
splash.buttonMode = true;
splash.useHandCursor = true;
} else {
if (splash.currentFrame == 161){
proceed2();
};
};
}
public function proceed2(){
this.removeEventListener(Event.ENTER_FRAME, setupSplash);
splash.removeEventListener(MouseEvent.CLICK, loadBubble);
gotoAndStop(61);
}
function frame1(){
stop();
MochiBot.track(this, "8155c956");
MochiServices.connect("c505f16192da7125", this);
addEventListener(Event.ENTER_FRAME, loadLoop);
}
public function setup():void{
Phase.setupPlanes(7);
tf = new TFGame();
Phase.debug.visible = false;
Phase.tim.init();
}
function frame40(){
gotoAndStop(60);
}
public function loadLoop(_arg1:Event){
if (pre.ad.currentFrame > 1){
proceed();
} else {
pre.bplay.visible = false;
pre.txt.text = "";
};
}
public function proceed(){
this.removeEventListener(Event.ENTER_FRAME, loadLoop);
gotoAndStop(60);
}
public function gameLoop(_arg1:Event):void{
Phase.loopStart();
tf.input();
Phase.loopEnd();
}
function frame61(){
stop();
this.stage.quality = StageQuality.MEDIUM;
pe = new Phase(this.stage);
setup();
addEventListener(Event.ENTER_FRAME, gameLoop);
}
function frame60(){
stop();
loaded = false;
addEventListener(Event.ENTER_FRAME, setupSplash);
}
}
}//package TF_fla
Section 26
//menu_challenges_114 (TF_fla.menu_challenges_114)
package TF_fla {
import flash.display.*;
public dynamic class menu_challenges_114 extends MovieClip {
public var bpage2:SimpleButton;
public var page2:MovieClip;
public var page1:MovieClip;
public var bpage1:SimpleButton;
public var bclose:SimpleButton;
public function menu_challenges_114(){
addFrameScript(0, frame1, 4, frame5);
}
function frame1(){
stop();
}
function frame5(){
stop();
}
}
}//package TF_fla
Section 27
//menu_challenges_page1_115 (TF_fla.menu_challenges_page1_115)
package TF_fla {
import flash.display.*;
public dynamic class menu_challenges_page1_115 extends MovieClip {
public var c0:chal_easy;
public var c1:chal_hillfighter;
public var c3:chal_spikepunch;
public var c4:chal_superb;
public var c5:chal_stunner;
public var c6:chal_thorny;
public var c8:chal_anime;
public var c2:chal_lastguy;
public var c7:chal_normal;
public var c9:chal_getoverthere;
}
}//package TF_fla
Section 28
//menu_challenges_page2_136 (TF_fla.menu_challenges_page2_136)
package TF_fla {
import flash.display.*;
public dynamic class menu_challenges_page2_136 extends MovieClip {
public var c10:chal_wontsurvive;
public var c11:chal_tdsucks;
public var c13:chal_hard;
public var c17:chal_click2000;
public var c14:chal_ultimate;
public var c15:chal_scoutersays;
public var c16:chal_click100;
public var c12:chal_smashpansies;
}
}//package TF_fla
Section 29
//menu_options_92 (TF_fla.menu_options_92)
package TF_fla {
import flash.display.*;
public dynamic class menu_options_92 extends MovieClip {
public var masvol:MovieClip;
public var ctips:MovieClip;
public var wglow:MovieClip;
public var eglow:MovieClip;
public var musvol:MovieClip;
public var effvol:MovieClip;
public var pglow:MovieClip;
}
}//package TF_fla
Section 30
//menu_pause_91 (TF_fla.menu_pause_91)
package TF_fla {
import flash.display.*;
import flash.text.*;
public dynamic class menu_pause_91 extends MovieClip {
public var btopres:SimpleButton;
public var bresume:SimpleButton;
public var topres:TextField;
public var bbubble:SimpleButton;
}
}//package TF_fla
Section 31
//menu_play_112 (TF_fla.menu_play_112)
package TF_fla {
import flash.display.*;
public dynamic class menu_play_112 extends MovieClip {
public var bnorm:SimpleButton;
public var resume:MovieClip;
public var beasy:SimpleButton;
public var bhard:SimpleButton;
}
}//package TF_fla
Section 32
//menu_play_resume_113 (TF_fla.menu_play_resume_113)
package TF_fla {
import flash.display.*;
import flash.text.*;
public dynamic class menu_play_resume_113 extends MovieClip {
public var bresume:SimpleButton;
public var save_details:TextField;
}
}//package TF_fla
Section 33
//menu_tut_97 (TF_fla.menu_tut_97)
package TF_fla {
import flash.display.*;
public dynamic class menu_tut_97 extends MovieClip {
public var bcontrols:SimpleButton;
public var bbuild:SimpleButton;
public var bbasics:SimpleButton;
public function menu_tut_97(){
addFrameScript(0, frame1, 4, frame5, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame5(){
stop();
}
}
}//package TF_fla
Section 34
//menu_upgrade_buy_76 (TF_fla.menu_upgrade_buy_76)
package TF_fla {
import flash.display.*;
import flash.text.*;
public dynamic class menu_upgrade_buy_76 extends MovieClip {
public var tforce:SimpleButton;
public var sboost:SimpleButton;
public var text_bforce:TextField;
public var text_acombo:TextField;
public var text_tforce:TextField;
public var sforce:SimpleButton;
public var text_sboost:TextField;
public var bpixel:SimpleButton;
public var bfinish:SimpleButton;
public var gcombo:SimpleButton;
public var bbubble:SimpleButton;
public var text_sforce:TextField;
public var bforce:SimpleButton;
public var acombo:SimpleButton;
public var save_msg:TextField;
public var text_gcombo:TextField;
public var bsave:SimpleButton;
}
}//package TF_fla
Section 35
//player_body_22 (TF_fla.player_body_22)
package TF_fla {
import flash.display.*;
public dynamic class player_body_22 extends MovieClip {
public var hit:col_circle;
public function player_body_22(){
addFrameScript(79, frame80, 124, frame125, 149, frame150, 164, frame165, 184, frame185, 204, frame205, 224, frame225, 269, frame270, 304, frame305, 322, frame323, 359, frame360, 370, frame371, 406, frame407, 410, frame411, 445, frame446, 450, frame451, 467, frame468, 499, frame500, 505, frame506, 540, frame541, 556, frame557, 589, frame590, 600, frame601, 639, frame640, 660, frame661, 689, frame690, 702, frame703, 734, frame735, 741, frame742, 789, frame790, 800, frame801, 814, frame815, 879, frame880);
}
function frame790(){
gotoAndStop("fall");
}
function frame270(){
gotoAndStop("run");
}
function frame661(){
Phase.playSound("punch_leftjab.mp3", 0.25);
play();
}
function frame305(){
gotoAndStop("stand");
}
function frame557(){
Phase.playSound("punch_smash.mp3", 0.5);
play();
}
function frame165(){
gotoAndStop("fall");
}
function frame80(){
gotoAndStop("stand");
}
function frame446(){
gotoAndStop("stand");
}
function frame323(){
gotoAndStop("fall");
}
function frame205(){
gotoAndStop("run");
}
function frame451(){
Phase.playSound("punch_leftjab.mp3", 0.15);
play();
}
function frame601(){
Phase.playSound("punch_rightjab.mp3", 0.6);
play();
}
function frame735(){
gotoAndStop("fall");
}
function frame468(){
Phase.playSound("punch_rightjab.mp3", 0.25);
play();
}
function frame690(){
gotoAndStop("fall");
}
function frame185(){
gotoAndStop("stand");
}
function frame506(){
Phase.playSound("punch_smash.mp3", 0.25);
play();
}
function frame225(){
gotoAndStop("run");
}
function frame590(){
gotoAndStop("stand");
}
function frame500(){
gotoAndStop("stand");
}
function frame742(){
Phase.playSound("punch_hurk.mp3", 0.4);
play();
}
function frame125(){
gotoAndStop("fall");
}
function frame640(){
gotoAndStop("fall");
}
function frame360(){
gotoAndStop("run");
}
function frame801(){
Phase.playSound("punch_rightjab.mp3", 0.2);
play();
}
function frame407(){
gotoAndStop("stand");
}
function frame880(){
gotoAndStop("stand");
}
function frame411(){
Phase.playSound("punch_leftjab.mp3", 0.3);
play();
}
function frame371(){
Phase.playSound("punch_rightjab.mp3", 0.5);
play();
}
function frame815(){
gotoAndStop("pndloop");
}
function frame541(){
gotoAndStop("stand");
}
function frame703(){
Phase.playSound("punch_smash.mp3", 0.5);
play();
}
function frame150(){
gotoAndStop("fall");
}
}
}//package TF_fla
Section 36
//preload_everything_5 (TF_fla.preload_everything_5)
package TF_fla {
import flash.display.*;
public dynamic class preload_everything_5 extends MovieClip {
public function preload_everything_5(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TF_fla
Section 37
//preloader_1 (TF_fla.preloader_1)
package TF_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class preloader_1 extends MovieClip {
public var green:spinner_blue;
public var ad:MovieClip;
public var blue2:spinner_blue;
public var blue:spinner_blue;
public var redspin:Number;
public var txt:TextField;
public var blue2spin:Number;
public var red2spin:Number;
public var green2spin:Number;
public var red:spinner_blue;
public var bplay:SimpleButton;
public var green2:spinner_blue;
public var bluespin:Number;
public var red2:spinner_blue;
public var greenspin:Number;
public function preloader_1(){
addFrameScript(0, frame1);
}
public function preloadLoop(_arg1:Event){
red.alpha = (red.alpha * 0.99);
redspin = (redspin - 0.08);
if (redspin <= 1){
redspin = (Math.random() * 15);
red.alpha = 1;
};
red.x = (red.x + redspin);
red.y = (red.y + (redspin * 3));
if (red.x > 700){
red.x = (red.x - 900);
};
if (red.y > 1200){
red.y = (red.y - 800);
};
blue.alpha = (blue.alpha * 0.99);
bluespin = (bluespin - 0.08);
if (bluespin <= 1){
bluespin = (Math.random() * 15);
blue.alpha = 1;
};
blue.x = (blue.x + bluespin);
blue.y = (blue.y + (bluespin * 3));
if (blue.x > 700){
blue.x = (blue.x - 900);
};
if (blue.y > 1200){
blue.y = (blue.y - 800);
};
green.alpha = (green.alpha * 0.99);
greenspin = (greenspin - 0.08);
if (greenspin <= 1){
greenspin = (Math.random() * 15);
green.alpha = 1;
};
green.x = (green.x + greenspin);
green.y = (green.y + (greenspin * 3));
if (green.x > 700){
green.x = (green.x - 900);
};
if (green.y > 1200){
green.y = (green.y - 800);
};
red2.alpha = (red2.alpha * 0.99);
red2spin = (red2spin - 0.08);
if (red2spin <= 1){
red2spin = (Math.random() * 15);
red2.alpha = 1;
};
red2.x = (red2.x - red2spin);
red2.y = (red2.y + (red2spin * 3));
if (red2.x < -200){
red2.x = (red2.x + 900);
};
if (red2.y > 1200){
red2.y = (red2.y - 800);
};
blue2.alpha = (blue2.alpha * 0.99);
blue2spin = (blue2spin - 0.08);
if (blue2spin <= 1){
blue2spin = (Math.random() * 15);
blue2.alpha = 1;
};
blue2.x = (blue2.x - blue2spin);
blue2.y = (blue2.y + (blue2spin * 3));
if (blue2.x < -200){
blue2.x = (blue2.x + 900);
};
if (blue2.y > 1200){
blue2.y = (blue2.y - 800);
};
green2.alpha = (green2.alpha * 0.99);
green2spin = (green2spin - 0.08);
if (green2spin <= 1){
green2spin = (Math.random() * 15);
green2.alpha = 1;
};
green2.x = (green2.x - green2spin);
green2.y = (green2.y + (green2spin * 3));
if (green2.x < -200){
green2.x = (green2.x + 900);
};
if (green2.y > 1200){
green2.y = (green2.y - 800);
};
}
function frame1(){
redspin = (Math.random() * 15);
bluespin = (Math.random() * 15);
greenspin = (Math.random() * 15);
red2spin = (Math.random() * 15);
blue2spin = (Math.random() * 15);
green2spin = (Math.random() * 15);
addEventListener(Event.ENTER_FRAME, preloadLoop);
}
}
}//package TF_fla
Section 38
//pusher_body_29 (TF_fla.pusher_body_29)
package TF_fla {
import flash.display.*;
public dynamic class pusher_body_29 extends MovieClip {
public function pusher_body_29(){
addFrameScript(80, frame81, 109, frame110, 199, frame200, 239, frame240);
}
function frame200(){
gotoAndStop("run");
}
function frame81(){
gotoAndStop("run");
}
function frame110(){
gotoAndStop("stun");
}
function frame240(){
gotoAndStop("dead");
}
}
}//package TF_fla
Section 39
//rewheel_body_31 (TF_fla.rewheel_body_31)
package TF_fla {
import flash.display.*;
public dynamic class rewheel_body_31 extends MovieClip {
public function rewheel_body_31(){
addFrameScript(39, frame40, 108, frame109);
}
function frame109(){
gotoAndStop("dead");
}
function frame40(){
gotoAndStop("run");
}
}
}//package TF_fla
Section 40
//slider_93 (TF_fla.slider_93)
package TF_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.filters.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class slider_93 extends MovieClip {
public var val:Number;
public var dragging:Boolean;
public var rectangle:Rectangle;
public var updated:Boolean;
public var slider:MovieClip;
public function slider_93(){
addFrameScript(0, frame1);
}
public function adjustValue(_arg1:Event):void{
val = (slider.handle.x / 100);
}
function frame1(){
val = 0.5;
updated = false;
dragging = false;
rectangle = new Rectangle(0, 0, 100, 0);
slider.handle.addEventListener(MouseEvent.MOUSE_DOWN, dragIt);
stage.addEventListener(MouseEvent.MOUSE_UP, dropIt);
slider.handle.buttonMode = (slider.handle.useHandCursor = true);
}
public function dragIt(_arg1:Event):void{
slider.handle.startDrag(false, rectangle);
dragging = true;
slider.handle.addEventListener(Event.ENTER_FRAME, adjustValue);
}
public function dropIt(_arg1:Event):void{
if (dragging){
slider.handle.stopDrag();
dragging = false;
updated = true;
};
}
}
}//package TF_fla
Section 41
//slider_bar_94 (TF_fla.slider_bar_94)
package TF_fla {
import flash.display.*;
public dynamic class slider_bar_94 extends MovieClip {
public var handle:MovieClip;
}
}//package TF_fla
Section 42
//spawn_lightning_48 (TF_fla.spawn_lightning_48)
package TF_fla {
import flash.display.*;
public dynamic class spawn_lightning_48 extends MovieClip {
public function spawn_lightning_48(){
addFrameScript(2, frame3, 20, frame21);
}
function frame3(){
gotoAndPlay(1);
}
function frame21(){
gotoAndPlay(1);
}
}
}//package TF_fla
Section 43
//strutter_body_38 (TF_fla.strutter_body_38)
package TF_fla {
import flash.display.*;
public dynamic class strutter_body_38 extends MovieClip {
public function strutter_body_38(){
addFrameScript(79, frame80, 119, frame120, 149, frame150, 184, frame185, 209, frame210);
}
function frame80(){
gotoAndPlay("run");
}
function frame210(){
gotoAndPlay("run");
}
function frame185(){
gotoAndPlay("dead");
}
function frame120(){
gotoAndPlay("run");
}
function frame150(){
gotoAndPlay("stun");
}
}
}//package TF_fla
Section 44
//tack_body_42 (TF_fla.tack_body_42)
package TF_fla {
import flash.display.*;
public dynamic class tack_body_42 extends MovieClip {
public function tack_body_42(){
addFrameScript(60, frame61, 99, frame100, 129, frame130);
}
function frame100(){
gotoAndStop("stun");
}
function frame130(){
gotoAndStop("dead");
}
function frame61(){
gotoAndStop("fly");
}
}
}//package TF_fla
Section 45
//tut_start_bar1_14 (TF_fla.tut_start_bar1_14)
package TF_fla {
import flash.display.*;
public dynamic class tut_start_bar1_14 extends MovieClip {
public var bar:MovieClip;
}
}//package TF_fla
Section 46
//tut_start_bar2_17 (TF_fla.tut_start_bar2_17)
package TF_fla {
import flash.display.*;
public dynamic class tut_start_bar2_17 extends MovieClip {
public var bar:MovieClip;
}
}//package TF_fla
Section 47
//tut_start_bar3_19 (TF_fla.tut_start_bar3_19)
package TF_fla {
import flash.display.*;
public dynamic class tut_start_bar3_19 extends MovieClip {
public var bar:MovieClip;
}
}//package TF_fla
Section 48
//tut_start_char_8 (TF_fla.tut_start_char_8)
package TF_fla {
import flash.display.*;
public dynamic class tut_start_char_8 extends MovieClip {
public function tut_start_char_8(){
addFrameScript(161, frame162);
}
function frame162(){
gotoAndPlay(85);
}
}
}//package TF_fla
Section 49
//tut_start_char2_18 (TF_fla.tut_start_char2_18)
package TF_fla {
import flash.display.*;
public dynamic class tut_start_char2_18 extends MovieClip {
public function tut_start_char2_18(){
addFrameScript(57, frame58);
}
function frame58(){
stop();
}
}
}//package TF_fla
Section 50
//tut_start_nme_11 (TF_fla.tut_start_nme_11)
package TF_fla {
import flash.display.*;
public dynamic class tut_start_nme_11 extends MovieClip {
public function tut_start_nme_11(){
addFrameScript(80, frame81);
}
function frame81(){
gotoAndPlay(1);
}
}
}//package TF_fla
Section 51
//tut_start_nme2_20 (TF_fla.tut_start_nme2_20)
package TF_fla {
import flash.display.*;
public dynamic class tut_start_nme2_20 extends MovieClip {
public function tut_start_nme2_20(){
addFrameScript(79, frame80);
}
function frame80(){
gotoAndStop("dead");
}
}
}//package TF_fla
Section 52
//bob_mc (bob_mc)
package {
import flash.display.*;
public dynamic class bob_mc extends MovieClip {
public var body:MovieClip;
}
}//package
Section 53
//bob2_mc (bob2_mc)
package {
import flash.display.*;
public dynamic class bob2_mc extends MovieClip {
public var body:MovieClip;
}
}//package
Section 54
//bubblebox_score (bubblebox_score)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.filters.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.ui.*;
public dynamic class bubblebox_score extends MovieClip {
public var loader:URLLoader;
public var loadingStatus:String;
public var hexChars:String;
public var score:Number;
public var gameID:Number;
public var insertname:TextField;
public function bubblebox_score(){
addFrameScript(0, frame1);
}
public function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (tr(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public function hash(_arg1:String):String{
var _local2:ByteArray;
_local2 = new ByteArray();
_local2.writeUTFBytes(_arg1);
return (hashBinary(_local2));
}
public function removeListeners():void{
loader.removeEventListener(Event.COMPLETE, completeHandler);
loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
loader.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
}
public function clicked(_arg1:MouseEvent):void{
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:URLVariables;
var _local7:URLRequest;
if (loadingStatus == "insertName"){
if (((((!((_arg1.target.name == "insertName"))) && (!((this.insertname.text == "YOUR NAME"))))) && ((this.insertname.text.length > 0)))){
_local2 = this.insertname.text;
_local3 = ((((gameID + "_") + score) + "_") + _local2);
_local4 = ((((((((((gameID + "_") + "4234232143214421") + "_") + score) + "_") + "2537625476251") + "_") + _local2) + "_") + "desleutelistessa");
_local5 = hash(_local4);
_local6 = new URLVariables();
_local6.datastring = _local3;
_local6.hashstring = _local5;
_local7 = new URLRequest("http://www.bubblebox.com/scripts/insertscore2008.php");
_local7.data = _local6;
_local7.method = URLRequestMethod.POST;
loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.addEventListener(Event.COMPLETE, completeHandler, false, 0, true);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler, false, 0, true);
loader.load(_local7);
this.gotoAndStop(2);
loadingStatus = "sending";
};
} else {
if (loadingStatus == "sending"){
} else {
if (loadingStatus == "completed"){
navigateToURL(new URLRequest((("http://www.bubblebox.com/highscores/" + gameID) + ".htm")), "_blank");
} else {
if (loadingStatus == "failed"){
loadingStatus = "insertName";
this.gotoAndStop(1);
};
};
};
};
}
public function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (tr(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public function failed():void{
loadingStatus = "failed";
removeListeners();
this.gotoAndStop(4);
}
public function setScore(_arg1:Number, _arg2:Number):void{
score = _arg1;
gameID = _arg2;
}
public function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
public function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
function frame1(){
hexChars = "0123456789abcdef";
this.stage.focus = this.insertname;
this.insertname.setSelection(0, this.insertname.text.length);
loader = new URLLoader();
loadingStatus = "insertName";
this.addEventListener(MouseEvent.CLICK, clicked, false, 0, true);
stop();
}
public function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
public function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
public function ioErrorHandler(_arg1:IOErrorEvent):void{
trace("ioError");
failed();
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
trace("securityError");
failed();
}
public function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local3:String;
var _local4:int;
var _local5:int;
_local3 = "";
if (_arg2){
_local4 = 0;
while (_local4 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15))));
_local4++;
};
} else {
_local5 = 0;
while (_local5 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15))));
_local5++;
};
};
return (_local3);
}
public function createBlocks(_arg1:ByteArray):Array{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = new Array();
_local3 = (_arg1.length * 8);
_local4 = 0xFF;
_local5 = 0;
while (_local5 < _local3) {
_local2[int((_local5 >> 5))] = (_local2[int((_local5 >> 5))] | ((_arg1[(_local5 / 8)] & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[int((_local3 >> 5))] = (_local2[int((_local3 >> 5))] | (128 << (_local3 % 32)));
_local2[int(((((_local3 + 64) >>> 9) << 4) + 14))] = _local3;
return (_local2);
}
public function hashBinary(_arg1:ByteArray):String{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:int;
_local2 = 1732584193;
_local3 = -271733879;
_local4 = -1732584194;
_local5 = 271733878;
_local10 = createBlocks(_arg1);
_local11 = _local10.length;
_local12 = 0;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 1))], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 3))], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 5))], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 7))], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 9))], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 11))], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 13))], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 15))], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 6))], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 0))], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 10))], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 4))], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 14))], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 8))], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 2))], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 12))], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 8))], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 14))], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 4))], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 10))], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 0))], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 6))], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 12))], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 2))], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 7))], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 5))], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 3))], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 1))], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 15))], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 13))], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 11))], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 9))], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
return ((((toHex(_local2) + toHex(_local3)) + toHex(_local4)) + toHex(_local5)));
}
public function tr(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int;
_local9 = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((rol(_local9, _arg7) + _arg3));
}
public function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
public function completeHandler(_arg1:Event):void{
loadingStatus = "completed";
removeListeners();
this.gotoAndStop(3);
}
public function ror(_arg1:int, _arg2:int):uint{
var _local3:int;
_local3 = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (tr(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (tr(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
}
}//package
Section 55
//chal_anime (chal_anime)
package {
import flash.display.*;
public dynamic class chal_anime extends MovieClip {
}
}//package
Section 56
//chal_click100 (chal_click100)
package {
import flash.display.*;
public dynamic class chal_click100 extends MovieClip {
}
}//package
Section 57
//chal_click2000 (chal_click2000)
package {
import flash.display.*;
public dynamic class chal_click2000 extends MovieClip {
}
}//package
Section 58
//chal_easy (chal_easy)
package {
import flash.display.*;
public dynamic class chal_easy extends MovieClip {
}
}//package
Section 59
//chal_getoverthere (chal_getoverthere)
package {
import flash.display.*;
public dynamic class chal_getoverthere extends MovieClip {
}
}//package
Section 60
//chal_hard (chal_hard)
package {
import flash.display.*;
public dynamic class chal_hard extends MovieClip {
}
}//package
Section 61
//chal_hillfighter (chal_hillfighter)
package {
import flash.display.*;
public dynamic class chal_hillfighter extends MovieClip {
}
}//package
Section 62
//chal_lastguy (chal_lastguy)
package {
import flash.display.*;
public dynamic class chal_lastguy extends MovieClip {
}
}//package
Section 63
//chal_normal (chal_normal)
package {
import flash.display.*;
public dynamic class chal_normal extends MovieClip {
}
}//package
Section 64
//chal_scoutersays (chal_scoutersays)
package {
import flash.display.*;
public dynamic class chal_scoutersays extends MovieClip {
}
}//package
Section 65
//chal_smashpansies (chal_smashpansies)
package {
import flash.display.*;
public dynamic class chal_smashpansies extends MovieClip {
}
}//package
Section 66
//chal_spikepunch (chal_spikepunch)
package {
import flash.display.*;
public dynamic class chal_spikepunch extends MovieClip {
}
}//package
Section 67
//chal_stunner (chal_stunner)
package {
import flash.display.*;
public dynamic class chal_stunner extends MovieClip {
}
}//package
Section 68
//chal_superb (chal_superb)
package {
import flash.display.*;
public dynamic class chal_superb extends MovieClip {
}
}//package
Section 69
//chal_tdsucks (chal_tdsucks)
package {
import flash.display.*;
public dynamic class chal_tdsucks extends MovieClip {
}
}//package
Section 70
//chal_thorny (chal_thorny)
package {
import flash.display.*;
public dynamic class chal_thorny extends MovieClip {
}
}//package
Section 71
//chal_ultimate (chal_ultimate)
package {
import flash.display.*;
public dynamic class chal_ultimate extends MovieClip {
}
}//package
Section 72
//chal_wontsurvive (chal_wontsurvive)
package {
import flash.display.*;
public dynamic class chal_wontsurvive extends MovieClip {
}
}//package
Section 73
//col_box (col_box)
package {
public dynamic class col_box extends PEColClip_Box {
}
}//package
Section 74
//col_box_slant1l (col_box_slant1l)
package {
public dynamic class col_box_slant1l extends PEColClip_Box {
}
}//package
Section 75
//col_box_slant1r (col_box_slant1r)
package {
public dynamic class col_box_slant1r extends PEColClip_Box {
}
}//package
Section 76
//col_circle (col_circle)
package {
public dynamic class col_circle extends PEColClip {
}
}//package
Section 77
//col_line (col_line)
package {
public dynamic class col_line extends PEColClip {
}
}//package
Section 78
//col_vol (col_vol)
package {
public dynamic class col_vol extends PEColClip_Vol {
}
}//package
Section 79
//death_sparks (death_sparks)
package {
import flash.display.*;
public dynamic class death_sparks extends MovieClip {
public function death_sparks(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package
Section 80
//debug_overlay (debug_overlay)
package {
import flash.display.*;
import flash.text.*;
public dynamic class debug_overlay extends MovieClip {
public var log:TextField;
}
}//package
Section 81
//dmg_nums (dmg_nums)
package {
import flash.display.*;
import flash.text.*;
public dynamic class dmg_nums extends MovieClip {
public var amt:TextField;
}
}//package
Section 82
//faery (faery)
package {
import flash.display.*;
public dynamic class faery extends MovieClip {
}
}//package
Section 83
//hacman_mc (hacman_mc)
package {
import flash.display.*;
public dynamic class hacman_mc extends MovieClip {
public var body:MovieClip;
}
}//package
Section 84
//hacman2_mc (hacman2_mc)
package {
import flash.display.*;
public dynamic class hacman2_mc extends MovieClip {
public var body:MovieClip;
}
}//package
Section 85
//hud (hud)
package {
import flash.display.*;
public dynamic class hud extends MovieClip {
public var erase:MovieClip;
public var eraselife:MovieClip;
public var flash:MovieClip;
}
}//package
Section 86
//hud_build (hud_build)
package {
import flash.display.*;
public dynamic class hud_build extends MovieClip {
public var tornado:SimpleButton;
public var vine:SimpleButton;
public var storm:SimpleButton;
public var boulder:SimpleButton;
}
}//package
Section 87
//hud_chal (hud_chal)
package {
import flash.display.*;
public dynamic class hud_chal extends MovieClip {
public var strip:MovieClip;
public function hud_chal(){
addFrameScript(199, frame200);
}
function frame200(){
stop();
}
}
}//package
Section 88
//hud_round (hud_round)
package {
import flash.display.*;
import flash.text.*;
public dynamic class hud_round extends MovieClip {
public var bStart:SimpleButton;
public var txt:TextField;
}
}//package
Section 89
//hud_tips (hud_tips)
package {
import flash.display.*;
import flash.text.*;
public dynamic class hud_tips extends MovieClip {
public var txt:TextField;
}
}//package
Section 90
//hud_upgrade (hud_upgrade)
package {
import flash.display.*;
import flash.text.*;
public dynamic class hud_upgrade extends MovieClip {
public var power:TextField;
public var tower:TextField;
public var speed:TextField;
public var bsell:SimpleButton;
}
}//package
Section 91
//hud_upgrade_boulder2 (hud_upgrade_boulder2)
package {
public dynamic class hud_upgrade_boulder2 extends TFUpgradeIcon {
}
}//package
Section 92
//hud_upgrade_boulder3 (hud_upgrade_boulder3)
package {
public dynamic class hud_upgrade_boulder3 extends TFUpgradeIcon {
}
}//package
Section 93
//hud_upgrade_boulder4 (hud_upgrade_boulder4)
package {
public dynamic class hud_upgrade_boulder4 extends TFUpgradeIcon {
}
}//package
Section 94
//hud_upgrade_storm2 (hud_upgrade_storm2)
package {
public dynamic class hud_upgrade_storm2 extends TFUpgradeIcon {
}
}//package
Section 95
//hud_upgrade_storm3 (hud_upgrade_storm3)
package {
public dynamic class hud_upgrade_storm3 extends TFUpgradeIcon {
}
}//package
Section 96
//hud_upgrade_storm4 (hud_upgrade_storm4)
package {
public dynamic class hud_upgrade_storm4 extends TFUpgradeIcon {
}
}//package
Section 97
//hud_upgrade_tornado2 (hud_upgrade_tornado2)
package {
public dynamic class hud_upgrade_tornado2 extends TFUpgradeIcon {
}
}//package
Section 98
//hud_upgrade_tornado3 (hud_upgrade_tornado3)
package {
public dynamic class hud_upgrade_tornado3 extends TFUpgradeIcon {
}
}//package
Section 99
//hud_upgrade_tornado4 (hud_upgrade_tornado4)
package {
public dynamic class hud_upgrade_tornado4 extends TFUpgradeIcon {
}
}//package
Section 100
//hud_upgrade_vine2 (hud_upgrade_vine2)
package {
public dynamic class hud_upgrade_vine2 extends TFUpgradeIcon {
}
}//package
Section 101
//hud_upgrade_vine3 (hud_upgrade_vine3)
package {
public dynamic class hud_upgrade_vine3 extends TFUpgradeIcon {
}
}//package
Section 102
//hud_upgrade_vine4 (hud_upgrade_vine4)
package {
public dynamic class hud_upgrade_vine4 extends TFUpgradeIcon {
}
}//package
Section 103
//icon_boulder (icon_boulder)
package {
public dynamic class icon_boulder extends TFUpgradeIcon {
}
}//package
Section 104
//icon_storm (icon_storm)
package {
public dynamic class icon_storm extends TFUpgradeIcon {
}
}//package
Section 105
//icon_tornado (icon_tornado)
package {
public dynamic class icon_tornado extends TFUpgradeIcon {
}
}//package
Section 106
//icon_vine (icon_vine)
package {
public dynamic class icon_vine extends TFUpgradeIcon {
}
}//package
Section 107
//map (map)
package {
import flash.display.*;
public dynamic class map extends MovieClip {
public var spalit1:MovieClip;
public var spalit2:MovieClip;
public var spalit3:MovieClip;
public var bg:MovieClip;
public var chunk:MovieClip;
public var warn:col_vol;
public var glow:MovieClip;
}
}//package
Section 108
//menu (menu)
package {
import flash.display.*;
public dynamic class menu extends MovieClip {
public var tut:MovieClip;
public var modes:MovieClip;
public var chal:MovieClip;
public var bmoregames:SimpleButton;
public var btut:SimpleButton;
public var bplay:SimpleButton;
public var bchal:SimpleButton;
public var bop:SimpleButton;
public var op:MovieClip;
public var pause:MovieClip;
public function menu(){
addFrameScript(0, frame1, 4, frame5, 9, frame10, 14, frame15, 19, frame20, 24, frame25);
}
function frame10(){
stop();
}
function frame15(){
stop();
}
function frame25(){
stop();
}
function frame5(){
stop();
}
function frame1(){
stop();
}
function frame20(){
stop();
}
}
}//package
Section 109
//menu_over (menu_over)
package {
import flash.display.*;
import flash.text.*;
public dynamic class menu_over extends MovieClip {
public var text_score:TextField;
public var text_kills:TextField;
public var bbscore:bubblebox_score;
public var text_dmgTower:TextField;
public var text_resSpent:TextField;
public var text_resFound:TextField;
public var bmenu:SimpleButton;
public var text_dmgMelee:TextField;
}
}//package
Section 110
//menu_upgrade (menu_upgrade)
package {
import flash.display.*;
public dynamic class menu_upgrade extends MovieClip {
public var buy:MovieClip;
public function menu_upgrade(){
addFrameScript(59, frame60, 259, frame260);
}
function frame260(){
gotoAndStop(60);
}
function frame60(){
stop();
}
}
}//package
Section 111
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("2.7");
}
public static function showClickAwayAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_timeout:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var sendHostProgress:Boolean;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
sendHostProgress = false;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array;
var _local4:Number;
_local3 = _arg2.split(".");
_local4 = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = 10;
bar.y = (h - 20);
};
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
options.ad_progress(_local10);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7});
if (_local7 == 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local11 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 112
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 113
//nme_health (nme_health)
package {
import flash.display.*;
public dynamic class nme_health extends MovieClip {
public var bar:MovieClip;
}
}//package
Section 114
//nme_icon (nme_icon)
package {
import flash.display.*;
public dynamic class nme_icon extends MovieClip {
}
}//package
Section 115
//PEBind (PEBind)
package {
public class PEBind {
public var a:PEObj;
public var b:PEObj;
public var bDirect:Boolean;
public var bTemp:Boolean;
public function PEBind(_arg1:PEObj, _arg2:PEObj){
a = _arg1;
b = _arg2;
bDirect = true;
bTemp = true;
}
}
}//package
Section 116
//PEChar (PEChar)
package {
public class PEChar extends PEPhysObj {
public var sndLand:Array;
public var actions:Array;
public var fallTime:Number;
public var wallPush:Number;
public var frictionStop:Number;
public var landImpact:Number;
public var pstate:uint;
public var jumpStr:Number;
public var bDJumped:Boolean;
public var wallAngle:Number;
public var frictionRun:Number;
public var sndJump:Array;
public var gravNorm:Vect;
public var bBlockInput:Boolean;// = false
public var wallSide:String;
public var wallGrip:Number;
public var speed:Number;
public var command:Array;
public var bCanDoubleJump:Boolean;
public var frictionASlide:Number;
public var jumpFrames:Number;
public var acc:Number;
public var state:uint;
public var bCanWallSlide:Boolean;
public var grabPoint:PEPhysObj;
public var airControl:Number;
public var boostStr:Number;
public var grabCool:uint;
public var wallImpact:Number;
public var frictionSlide:Number;
public var lastJump:Number;
public var bIsRunning:Boolean;
public var sndWallImpact:String;
public var moveDir:String;
public static const STAND:uint = 1;
public static const WSLIDE:uint = 2;
public static const FALL:uint = 0;
public function PEChar(_arg1, _arg2:uint){
bBlockInput = false;
super(_arg1, _arg2);
state = FALL;
pstate = state;
command = new Array();
command.push("stop");
actions = new Array();
bGrav = true;
gravNorm = new Vect(0, 1);
moveDir = "";
speed = 8;
acc = 0.6;
frictionRun = 0;
frictionStop = 0.12;
frictionSlide = 0.05;
frictionASlide = -0.02;
airControl = 0.5;
jumpStr = -5;
boostStr = -1.4;
jumpFrames = 10;
lastJump = 0;
bCanDoubleJump = false;
bDJumped = false;
landImpact = 0;
bCanWallSlide = false;
wallGrip = 0.99;
wallSide = "";
wallPush = -5;
wallImpact = 0;
wallAngle = 0;
grabCool = 0;
grabPoint = null;
bIsRunning = false;
fallTime = 0;
bounce = 0;
sndJump = new Array();
sndLand = new Array();
sndWallImpact = "";
}
public function grabLedge(_arg1:PEPhysObj){
if (state == WSLIDE){
bDJumped = false;
if ((((vel.y < 0)) && ((grabCool == 0)))){
if (_arg1.apos.x < apos.x){
vel.x = (vel.x - 1);
actions.push("ledgepopl");
pos.x = (pos.x + 25);
} else {
if (_arg1.apos.x > apos.x){
vel.x = (vel.x + 1);
actions.push("ledgepopr");
pos.x = (pos.x - 25);
};
};
state = FALL;
grabCool = 10;
vel.y = -5;
} else {
actions.push("ledgegrab");
grabPoint = _arg1;
};
};
}
public function control(_arg1:String, _arg2:String=""){
var _local3:*;
moveDir = _arg2;
for (_local3 in command) {
if (command[_local3] == _arg1){
return;
};
};
command.push(_arg1);
}
public function land(){
var _local1:Number;
state = STAND;
bDJumped = false;
if (pstate != STAND){
landImpact = vel.y;
if ((((sndLand.length > 0)) && ((fallTime > 10)))){
_local1 = (landImpact / 20);
Phase.playSound(sndLand[Phase.rand(0, sndLand.length, true)], _local1);
};
if (bIsRunning){
bIsRunning = true;
if (fallTime < 40){
actions.push("quickland");
} else {
actions.push("rland");
};
} else {
bIsRunning = false;
actions.push("land");
};
};
fallTime = 0;
}
public function playAnim(_arg1:String){
img[0].gotoAndPlay(_arg1);
}
public function turn(_arg1:String){
if (state == FALL){
if ((((((_arg1 == "l")) && ((vel.x < (speed * airControl))))) && ((img[0].scaleX > 0)))){
actions.push("fturnl");
};
if ((((((_arg1 == "r")) && ((vel.x > -((speed * airControl)))))) && ((img[0].scaleX < 0)))){
actions.push("fturnr");
};
} else {
if (state == STAND){
if ((((moveDir == "l")) && ((img[0].scaleX > 0)))){
actions.push("rturnl");
};
if ((((moveDir == "r")) && ((img[0].scaleX < 0)))){
actions.push("rturnr");
};
};
};
}
override public function updateImages(){
var _local1:*;
var _local2:Vect;
var _local3:*;
_local1 = 0;
while (_local1 < img.length) {
if (img[_local1] == null){
} else {
_local2 = imgOffset.copy();
_local2.rotate(img[_local1].rotation);
_local3 = (Math.abs(img[_local1].rotation) / 90);
_local2 = _local2.mult((1 - _local3)).addv(imgOffset.mult(_local3));
img[_local1].x = (mc.x + _local2.x);
img[_local1].y = (mc.y + _local2.y);
if (img[_local1].body.currentLabel != "ns"){
img[_local1].body.gotoAndStop((img[_local1].body.currentFrame + 1));
};
};
_local1++;
};
}
override public function update(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:Vect;
var _local5:Vect;
if (((!(bActive)) || (paused))){
return;
};
if (!bBlockInput){
input();
};
if (state == STAND){
_local3 = (Vect.toDeg(Math.atan2(gravNorm.y, gravNorm.x)) - 90);
_local3 = ((_local3 - img[0].rotation) / 10);
img[0].rotation = (img[0].rotation + _local3);
grabPoint = null;
} else {
if (state == FALL){
fallTime++;
bIsRunning = false;
_local3 = ((0 - img[0].rotation) / 10);
img[0].rotation = (img[0].rotation + _local3);
grabPoint = null;
} else {
if (state == WSLIDE){
bIsRunning = false;
_local3 = (((wallAngle + 90) - img[0].rotation) / 10);
img[0].rotation = (img[0].rotation + _local3);
if (wallSide == "l"){
vel.x = (vel.x + 0.1);
};
if (wallSide == "r"){
vel.x = (vel.x - 0.1);
};
if (grabPoint != null){
vel.y = 0;
pos.y = (grabPoint.apos.y + 24);
};
if (pstate == FALL){
if (sndWallImpact != ""){
Phase.playSound(sndWallImpact, (wallImpact / 25));
};
};
};
};
};
if (grabCool > 0){
grabCool--;
};
_local1 = false;
friction = frictionStop;
for each (_local2 in command) {
if (_local2 == "move"){
_local1 = true;
turn(moveDir);
if (state == FALL){
friction = 0;
if ((((moveDir == "r")) && ((vel.x < speed)))){
vel.x = (vel.x + (acc * airControl));
};
if ((((moveDir == "l")) && ((vel.x > -(speed))))){
vel.x = (vel.x + (-(acc) * airControl));
};
} else {
if (state == STAND){
if (!bIsRunning){
actions.push("startrun");
};
friction = frictionRun;
_local4 = gravNorm.copy();
_local4.rotate(90);
_local4 = _local4.mult(acc);
if ((((moveDir == "r")) && ((vel.x < speed)))){
_local5 = _local4.mult(-1);
if (_local5.y < 0){
_local5.y = (_local5.y * 0.6);
} else {
if (_local5.y > 0){
_local5.y = (_local5.y * 1.2);
};
};
vel = vel.addv(_local5);
};
if ((((moveDir == "l")) && ((vel.x > -(speed))))){
_local5 = _local4;
if (_local5.y < 0){
_local5.y = (_local5.y * 0.6);
} else {
if (_local5.y > 0){
_local5.y = (_local5.y * 1.2);
};
};
vel = vel.addv(_local5);
};
} else {
if (state == WSLIDE){
if (vel.y > 0){
friction = frictionSlide;
} else {
friction = frictionASlide;
};
if ((((moveDir == "r")) && ((vel.x < speed)))){
vel.x = (vel.x + (acc * airControl));
};
if ((((moveDir == "l")) && ((vel.x > -(speed))))){
vel.x = (vel.x + (-(acc) * airControl));
};
};
};
};
if (!bIsRunning){
bIsRunning = true;
};
} else {
if (_local2 == "stop"){
if (bIsRunning){
bIsRunning = false;
if (state == STAND){
actions.push("stoprun");
};
};
} else {
if (_local2 == "jump"){
if (state == STAND){
actions.push("jump");
state = FALL;
gravNorm.set(0, 1);
vel.y = jumpStr;
lastJump = jumpFrames;
if (sndJump.length > 0){
Phase.playSound(sndJump[Phase.rand(0, sndJump.length, true)]);
};
} else {
if (state == FALL){
if (PEIndex.lineTrace(pos.addv(new Vect(10, 0)), pos.addv(new Vect(20, 0))).hit){
actions.push("wjumpl");
wallSide = "l";
gravNorm.set(0, 1);
vel.y = wallPush;
vel.x = -((speed + airControl));
lastJump = 0;
} else {
if (PEIndex.lineTrace(pos.addv(new Vect(-10, 0)), pos.addv(new Vect(-20, 0))).hit){
actions.push("wjumpr");
wallSide = "r";
gravNorm.set(0, 1);
vel.y = (wallPush + airControl);
vel.x = (speed + airControl);
lastJump = 0;
} else {
if (((bCanDoubleJump) && (!(bDJumped)))){
actions.push("jump");
gravNorm.set(0, 1);
vel.y = jumpStr;
lastJump = jumpFrames;
bDJumped = true;
};
};
};
} else {
if (state == WSLIDE){
if (grabPoint != null){
actions.push("ledgepop");
if (grabPoint.apos.x < apos.x){
vel.x = (vel.x - 1);
actions.push("ledgepopl");
pos.x = (pos.x + 25);
} else {
if (grabPoint.apos.x > apos.x){
vel.x = (vel.x + 1);
actions.push("ledgepopr");
pos.x = (pos.x - 25);
};
};
state = FALL;
grabCool = 10;
vel.y = -5;
} else {
actions.push(("wjump" + wallSide));
gravNorm.set(0, 1);
vel.y = wallPush;
if (wallSide == "l"){
vel.x = -((speed + airControl));
};
if (wallSide == "r"){
vel.x = (speed + airControl);
};
lastJump = (jumpFrames / 2);
};
};
};
};
} else {
if (_local2 == "boost"){
if (lastJump > 1){
if (lastJump == jumpFrames){
vel.y = (vel.y + (((boostStr * lastJump) / jumpFrames) * 0.5));
} else {
vel.y = (vel.y + ((boostStr * lastJump) / jumpFrames));
};
lastJump--;
};
};
};
};
};
};
clearCommands();
if (_local1){
command.push("move");
};
if (bGrav){
vel = vel.addv(gravNorm.mult((gravity * airResist)));
vel.y = (vel.y - (gravity * airResist));
};
pstate = state;
super.update();
}
public function input(){
}
public function act(){
}
public function faceDir(_arg1:String){
if ((((((_arg1 == "l")) && ((img[0].scaleX > 0)))) || ((((_arg1 == "r")) && ((img[0].scaleX < 0)))))){
img[0].scaleX = (img[0].scaleX * -1);
};
}
public function clearCommands(){
command = new Array();
}
override public function unpause(_arg1:Boolean=false){
control("stop");
super.unpause(_arg1);
}
}
}//package
Section 117
//PEColClip (PEColClip)
package {
import flash.display.*;
public class PEColClip extends MovieClip {
}
}//package
Section 118
//PEColClip_Box (PEColClip_Box)
package {
public class PEColClip_Box extends PEColClip {
public var l1:col_line;
public var l4:col_line;
public var l3:col_line;
public var l2:col_line;
}
}//package
Section 119
//PEColClip_Vol (PEColClip_Vol)
package {
public class PEColClip_Vol extends PEColClip {
public var l1:col_line;
public var l4:col_line;
public var l3:col_line;
public var l2:col_line;
}
}//package
Section 120
//PECollision (PECollision)
package {
public class PECollision {
public static function linetolinev(_arg1:Vect, _arg2:Vect, _arg3:PEPhysObj){
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:*;
var _local16:*;
var _local17:*;
_local4 = new PEColResult();
_local5 = _arg3.pos.copy();
_local6 = 0;
while (_local6 < _arg3.contain.length) {
_local5 = _local5.multv(_arg3.contain[_local6].sca);
_local5.rotate(_arg3.contain[_local6].rot);
_local5.add(_arg3.contain[_local6].pos.x, _arg3.contain[_local6].pos.y);
_local6++;
};
_local7 = Vect.toRad(_arg3.rot);
_local8 = new Vect(((Math.cos(_local7) * _arg3.sca.x) * 100), ((Math.sin(_local7) * _arg3.sca.x) * 100));
_local6 = 0;
while (_local6 < _arg3.contain.length) {
_local8 = _local8.multv(_arg3.contain[_local6].sca);
_local8.rotate(_arg3.contain[_local6].rot);
_local6++;
};
_local9 = _local5.addv(_local8);
_local10 = _arg2.subv(_arg1);
_local11 = _local9.subv(_local5);
_local12 = (_local5.x - _arg1.x);
_local13 = (_arg1.y - _local5.y);
_local14 = ((_local10.x * _local11.y) - (_local10.y * _local11.x));
if (_local14 == 0){
_local4.hit = false;
return (_local4);
};
_local15 = (1 / _local14);
_local16 = (((_local11.x * _local13) + (_local11.y * _local12)) * _local15);
_local17 = (((_local10.x * _local13) + (_local10.y * _local12)) * _local15);
if ((((((((_local16 < 0)) || ((_local16 > 1)))) || ((_local17 < 0)))) || ((_local17 > 1)))){
_local4.hit = false;
} else {
_local4.hit = true;
_local4.point = new Vect((_arg1.x + (_local10.x * _local16)), (_arg1.y + (_local10.y * _local16)));
};
return (_local4);
}
public static function circletocircle(_arg1:PEPhysObj, _arg2:PEPhysObj){
var _local3:*;
_local3 = new PEColResult();
_local3.a = _arg1;
_local3.b = _arg2;
_local3.dirvec = _arg1.apos.subv(_arg2.apos);
_local3.norm = _local3.dirvec.norm();
_local3.dist = _local3.dirvec.rawmag();
_local3.range = _local3.norm.multv(new Vect((_arg1.sca.x * 50), (_arg1.sca.y * 50))).rawmag();
_local3.range = (_local3.range + _local3.norm.multv(new Vect((_arg2.sca.x * 50), (_arg2.sca.y * 50))).rawmag());
_local3.range = (_local3.range * 2);
if (_local3.dist < _local3.range){
_local3.hit = true;
_local3.dist = Math.sqrt(_local3.dist);
_local3.range = Math.sqrt(_local3.range);
} else {
_local3.hit = false;
};
return (_local3);
}
public static function linetoline(_arg1:PEPhysObj, _arg2:PEPhysObj){
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
_local3 = _arg1.pos.copy();
_local4 = 0;
while (_local4 < _arg1.contain.length) {
_local3 = _local3.multv(_arg1.contain[_local4].sca);
_local3.rotate(_arg1.contain[_local4].rot);
_local3.add(_arg1.contain[_local4].pos.x, _arg1.contain[_local4].pos.y);
_local4++;
};
_local5 = Vect.toRad(_arg1.rot);
_local6 = new Vect((Math.cos(_local5) * _arg1.sca.x), (Math.sin(_local5) * _arg1.sca.x));
_local4 = 0;
while (_local4 < _arg1.contain.length) {
_local6 = _local6.multv(_arg1.contain[_local4].sca.mult(100));
_local6.rotate(_arg1.contain[_local4].rot);
_local4++;
};
_local7 = _local3.addv(_local6);
_local8 = linetolinev(_local3, _local7, _arg2);
_local8.a = _arg1;
_local8.b = _arg2;
return (_local8);
}
public static function circletoline(_arg1:PEPhysObj, _arg2:PEPhysObj, _arg3:Boolean=false){
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:Boolean;
_local4 = new PEColResult();
_local4.a = _arg1;
_local4.b = _arg2;
_local5 = _arg2.pos.copy();
_local6 = 0;
while (_local6 < _arg2.contain.length) {
_local5 = _local5.multv(_arg2.contain[_local6].sca);
_local5.rotate(_arg2.contain[_local6].rot);
_local5.add(_arg2.contain[_local6].pos.x, _arg2.contain[_local6].pos.y);
_local6++;
};
_local7 = Vect.toRad(_arg2.rot);
_local8 = new Vect(((Math.cos(_local7) * _arg2.sca.x) * 100), ((Math.sin(_local7) * _arg2.sca.x) * 100));
_local6 = 0;
while (_local6 < _arg2.contain.length) {
_local8 = _local8.multv(_arg2.contain[_local6].sca);
_local8.rotate(_arg2.contain[_local6].rot);
_local6++;
};
_local9 = _local5.addv(_local8);
_local10 = _arg1.apos.subv(_local5);
_local11 = _local9.subv(_local5);
_local12 = _local11.norm();
_local13 = _local10.dot(_local12);
_local14 = false;
_local4.point = new Vect(0, 0);
if (_local13 <= 0){
_local4.point.x = _local5.x;
_local4.point.y = _local5.y;
_local14 = true;
} else {
if (_local13 > _local11.mag()){
_local4.point.x = _local9.x;
_local4.point.y = _local9.y;
_local14 = true;
} else {
_local4.point.x = (_local5.x + (_local12.x * _local13));
_local4.point.y = (_local5.y + (_local12.y * _local13));
};
};
_local4.dirvec = _arg1.apos.subv(_local4.point);
_local4.norm = _local4.dirvec.norm();
_local4.range = _local4.norm.multv(new Vect((_arg1.sca.x * 50), (_arg1.sca.y * 50))).rawmag();
_local4.dist = _local4.dirvec.rawmag();
if (_local4.dist < _local4.range){
_local4.hit = true;
_local4.dist = Math.sqrt(_local4.dist);
_local4.range = Math.sqrt(_local4.range);
if (((_local14) && ((_local4.dist > (_local4.range - 4))))){
_local4.hit = false;
};
} else {
_local4.hit = false;
};
return (_local4);
}
}
}//package
Section 121
//PEColResult (PEColResult)
package {
public class PEColResult {
public var a:PEPhysObj;
public var b:PEPhysObj;
public var dist:Number;
public var point:Vect;
public var hit:Boolean;
public var dirvec:Vect;
public var norm:Vect;
public var range:Number;
}
}//package
Section 122
//PEDebug (PEDebug)
package {
import flash.display.*;
public class PEDebug {
public static var target:MovieClip;
public static function log(_arg1:String){
target.log.text = (target.log.text + (_arg1 + "\n"));
}
public static function clear(){
target.log.text = "Debug:\n";
}
}
}//package
Section 123
//PEIndex (PEIndex)
package {
import flash.display.*;
public class PEIndex {
public var colTests:uint;
public var colDives:uint;
public var colHits:uint;
public var accrue:Number;
public var m:Array;
public var msize:Vect;
public var o:Array;
public var p:Array;
public var z:Array;
public var limit:Number;
public static var levelref:MovieClip;
public static var ids:uint;
public static var sm:Array;
public static var so:Array;
public static var sp:Array;
public function PEIndex(){
o = new Array();
p = new Array();
z = new Array();
m = new Array();
so = o;
sp = p;
sm = m;
msize = new Vect(0, 0);
accrue = 0;
ids = 0;
}
public function remove(_arg1:uint){
var _local2:*;
for (_local2 in o) {
if (o[_local2].id == _arg1){
o.splice(_local2, 1);
break;
};
};
for (_local2 in p) {
if (p[_local2].id == _arg1){
p.splice(_local2, 1);
break;
};
};
}
function collide(_arg1:PEPhysObj, _arg2:PEPhysObj){
var _local3:*;
var _local4:*;
colDives++;
if (((((_arg1.colMask & _arg2.colType) > 0)) && (((_arg2.colMask & _arg1.colType) > 0)))){
if (!_arg2.bChecked){
if (_arg2.colShape != Phase.NONE){
colTests++;
if (!_arg1.mc.hitTestObject(_arg2.mc)){
return;
};
if (_arg1.colShape == Phase.CIRCLE){
colHits++;
if (_arg2.colShape == Phase.CIRCLE){
col_circlecircle(_arg1, _arg2);
} else {
if (_arg2.colShape == Phase.LINE){
col_circleline(_arg1, _arg2);
};
};
};
};
};
} else {
if (((((_arg1.triggerMask & _arg2.colType) > 0)) && (((_arg2.triggerMask & _arg1.colType) > 0)))){
if (!_arg2.bChecked){
if (_arg2.colShape != Phase.NONE){
colTests++;
if (!_arg1.mc.hitTestObject(_arg2.mc)){
return;
};
if (_arg1.colShape == Phase.CIRCLE){
colHits++;
if (_arg2.colShape == Phase.CIRCLE){
trig_circlecircle(_arg1, _arg2);
} else {
if (_arg2.colShape == Phase.LINE){
trig_circleline(_arg1, _arg2);
} else {
if (_arg2.colShape == Phase.VOL){
trig_circlevol(_arg1, _arg2);
};
};
};
};
};
};
} else {
return;
};
};
for (_local3 in _arg2.children) {
_local4 = _arg2.children[_local3];
if (!(_local4 is PEPhysObj)){
} else {
if ((((_arg1.id == _local4.id)) || (!(_local4.bActive)))){
} else {
collide(_arg1, _local4);
};
};
};
}
function col_circlecircle(_arg1, _arg2){
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
_local3 = PECollision.circletocircle(_arg1, _arg2);
if (_local3.hit){
_local4 = (_arg1.mass + _arg2.mass);
if (_local4 == 0){
_local4 = 1;
};
_local5 = (_arg2.mass / _local4);
if (_arg2.bStatic){
_local5 = 1;
};
_arg1.shiftPosv(_local3.norm.mult(((_local3.range - _local3.dist) * _local5)));
_arg2.shiftPosv(_local3.norm.mult(-(((_local3.range - _local3.dist) * (1 - _local5)))));
_local6 = (_arg1.mass * _arg1.vel.mag());
_local7 = (_arg2.mass * _arg2.vel.mag());
if (!_arg2.bStatic){
_local8 = ((_local6 / _arg2.mass) * _local5);
_arg2.vel = _arg2.vel.addv(_local3.norm.mult(-(_local8)));
_local9 = ((_local7 / _arg1.mass) * (1 - _local5));
_arg1.vel = _arg1.vel.addv(_local3.norm.mult(_local9));
} else {
_local10 = ((_local6 / _arg1.mass) * (1 + _arg1.bounce));
_arg1.vel = _arg1.vel.addv(_local3.norm.mult(_local10));
};
if (((((_arg1.triggerMask & _arg2.colType) > 0)) && (((_arg2.triggerMask & _arg1.colType) > 0)))){
respond(_arg1, _arg2, _local3);
};
};
}
public function menuGrab(_arg1:Vect){
var _local2:*;
var _local3:*;
_local2 = m.length;
_local3 = 0;
while (_local3 < _local2) {
if (!m[_local3].bDraggable){
} else {
if (m[_local3].clickThrough){
} else {
if (m[_local3].mc.grab.hitTestPoint(_arg1.x, _arg1.y, false)){
m[_local3].dragging = true;
};
};
};
_local3++;
};
}
function trig_circleline(_arg1, _arg2){
var _local3:*;
_local3 = PECollision.circletoline(_arg1, _arg2);
if (_local3.hit){
if (((((_arg1.triggerMask & _arg2.colType) > 0)) && (((_arg2.triggerMask & _arg1.colType) > 0)))){
respond(_arg1, _arg2, _local3);
};
};
}
public function update(_arg1:Number){
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = 0;
accrue = (accrue + _arg1);
while (accrue >= limit) {
_local2++;
accrue = (accrue - limit);
};
if (_local2 > 4){
_local2 = 4;
};
_local3 = 0;
while (_local3 < _local2) {
for (_local4 in o) {
o[_local4].update();
};
updateCollision();
_local3++;
};
}
public function showPhys(_arg1:PEObj, _arg2:Boolean){
var _local3:*;
for (_local3 in _arg1.children) {
showPhys(_arg1.children[_local3], _arg2);
};
if ((((((_arg1 is PEPhysObj)) && (!((PEPhysObj(_arg1).colShape == Phase.NONE))))) && (!((PEPhysObj(_arg1).colShape == Phase.CONTAINER))))){
_arg1.mc.visible = _arg2;
};
}
function trigDive(_arg1:PEPhysObj){
var _local2:*;
var _local3:*;
for (_local2 in p) {
_local3 = p[_local2];
if (!(_local3 is PEPhysObj)){
} else {
if (!_local3.bActive){
} else {
trigCollide(_arg1, _local3);
};
};
};
}
function colDive(_arg1:PEPhysObj){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_arg1.bChecked = true;
if ((_arg1 is PEChar)){
PEChar(_arg1).state = PEChar.FALL;
PEChar(_arg1).gravNorm.set(0, 1);
};
if ((((_arg1.colType > 0)) && ((_arg1.colShape > 0)))){
for (_local3 in p) {
_local4 = p[_local3];
if (!(_local4 is PEPhysObj)){
} else {
if ((((_arg1.id == _local4.id)) || (!(_local4.bActive)))){
} else {
collide(_arg1, _local4);
};
};
};
};
for (_local2 in _arg1.children) {
_local5 = _arg1.children[_local2];
if (((((_local5.bStatic) || (!(_local5.bActive)))) || (_arg1.paused))){
} else {
colDive(_local5);
};
};
}
public function menuDrag(_arg1:Vect){
var _local2:*;
var _local3:*;
_local2 = m.length;
_local3 = 0;
while (_local3 < _local2) {
if (!m[_local3].dragging){
} else {
m[_local3].pos = m[_local3].pos.addv(_arg1);
};
_local3++;
};
}
function trigCollide(_arg1:PEPhysObj, _arg2:PEPhysObj){
var _local3:*;
var _local4:*;
var _local5:*;
if ((_arg1.triggerMask & _arg2.colType) > 0){
if (_arg2.colShape != Phase.NONE){
if (!_arg1.mc.hitTestObject(_arg2.mc)){
return;
};
_local4 = new PEColResult();
_local4.a = _arg1;
_local4.b = _arg2;
respond(_arg1, _arg2, _local4);
};
} else {
return;
};
for (_local3 in _arg2.children) {
_local5 = _arg2.children[_local3];
if (!(_local5 is PEPhysObj)){
} else {
if (!_local5.bActive){
} else {
trigCollide(_arg1, _local5);
};
};
};
}
public function autoPhys(_arg1:PEPhysObj){
var child:*;
var i:*;
var chu:*;
var a:*;
var vol:*;
var clip = _arg1;
try {
i = 0;
while (i < 1000) {
child = clip.mc.getChildAt(i);
if ((((child.name == "chunk")) || ((child is PEColClip_Box)))){
chu = new PEPhysObj(child);
chu.bStatic = true;
chu.colShape = Phase.CONTAINER;
chu.contain.push(clip);
chu.contain = chu.contain.concat(clip.contain);
Phase.parent(chu, clip);
autoPhys(chu);
} else {
if ((child is col_line)){
a = new PEPhysObj(child, Phase.LINE);
a.bStatic = true;
a.colType = Phase.SURFACE;
a.contain.push(clip);
a.contain = a.contain.concat(clip.contain);
Phase.parent(a, clip);
} else {
if ((child is PEColClip_Vol)){
vol = new PEPhysObj(child, Phase.VOL);
vol.bStatic = true;
vol.colType = Phase.TRIGGER;
vol.colShape = Phase.VOL;
vol.contain.push(clip);
vol.contain = vol.contain.concat(clip.contain);
vol.tells.push(child.name);
Phase.parent(vol, clip);
};
};
};
i = (i + 1);
};
} catch(error:Error) {
};
}
function trig_circlecircle(_arg1, _arg2){
var _local3:*;
_local3 = PECollision.circletocircle(_arg1, _arg2);
if (_local3.hit){
if (((((_arg1.triggerMask & _arg2.colType) > 0)) && (((_arg2.triggerMask & _arg1.colType) > 0)))){
respond(_arg1, _arg2, _local3);
};
};
}
public function menuLetgo(){
var _local1:*;
var _local2:*;
_local1 = m.length;
_local2 = 0;
while (_local2 < _local1) {
m[_local2].dragging = false;
_local2++;
};
}
function updateCollision(){
var _local1:*;
var _local2:*;
colDives = 0;
colTests = 0;
colHits = 0;
for (_local1 in p) {
_local2 = p[_local1];
if (((((_local2.bStatic) || (!(_local2.bActive)))) || (_local2.paused))){
} else {
colDive(_local2);
};
};
}
function col_circleline(_arg1, _arg2){
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
_local3 = PECollision.circletoline(_arg1, _arg2);
if (_local3.hit){
_local4 = (_arg1.mass + _arg2.mass);
if (_local4 == 0){
_local4 = 1;
};
_local5 = (_arg2.mass / _local4);
if (_arg2.bStatic){
_local5 = 1;
};
_arg1.shiftPosv(_local3.norm.mult((((_local3.range - _local3.dist) * _local5) + 0.01)));
if (!_arg2.bStatic){
_arg2.shiftPosv(_local3.norm.mult(-(((_local3.range - _local3.dist) * (1 - _local5)))));
};
if ((_arg1 is PEChar)){
if (checkStand(_local3.norm, _arg1, _arg2)){
respond(_arg1, _arg2, _local3);
} else {
if (_arg1.state == PEChar.FALL){
checkWallslide(_local3.norm, _arg1, _arg2);
};
};
};
if (!_arg2.bStatic){
_local6 = (_arg1.mass * _arg1.vel.mag());
_local7 = (_arg2.mass * _arg2.vel.mag());
_local8 = (_local6 / _arg2.mass);
_arg2.vel = _arg2.vel.addv(_local3.norm.mult(-(_local8)));
_local9 = (_local7 / _arg1.mass);
_arg1.vel = _arg1.vel.addv(_local3.norm.mult(_local9));
} else {
_local10 = -(_arg1.vel.dot(_local3.norm));
_local10 = (_local10 * (1 + _arg1.bounce));
if (_local10 > 0.1){
_arg1.vel = _arg1.vel.addv(_local3.norm.mult(_local10));
};
_local11 = _local3.norm.copy();
_local11.rotate(90);
_local11 = _local11.mult((_arg1.friction + _arg2.friction));
_arg1.vel.x = (_arg1.vel.x * (1 - Math.abs(_local11.x)));
_arg1.vel.y = (_arg1.vel.y * (1 - Math.abs(_local11.y)));
};
if (((((_arg1.triggerMask & _arg2.colType) > 0)) && (((_arg2.triggerMask & _arg1.colType) > 0)))){
respond(_arg1, _arg2, _local3);
};
};
}
function preventWallPass(_arg1:PEPhysObj){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
_local2 = _arg1.apos.copy();
_local3 = false;
_local4 = p.length;
_local5 = 0;
while (_local5 < _local4) {
_local7 = p[_local5];
if (((((!((_local7.colShape == "line"))) || (!(_local7.bStatic)))) || (!(_local7.bActive)))){
} else {
_local8 = PECollision.linetolinev(_arg1.appos, _arg1.apos, _local7);
if (_local8.hit){
_local9 = _arg1.ppos.subv(_arg1.pos).norm();
_local10 = _local8.point.addv(_local9);
if (_local10.distance(_arg1.appos) < _local2.distance(_arg1.appos)){
_local2 = _local10.copy();
_local3 = true;
};
};
};
_local5++;
};
_local6 = 0;
while (_local6 < _arg1.contain.length) {
_local2.sub(_arg1.contain[_local6].pos.x, _arg1.contain[_local6].pos.y);
_local2.rotate(-(_arg1.contain[_local6].rot));
_local6++;
};
if (_local3){
_arg1.setPos(_local2.x, _local2.y);
return;
};
}
public function checkStand(_arg1:Vect, _arg2:PEChar, _arg3:PEObj){
_arg1 = _arg1.norm().mult(-1);
if (_arg1.y > 0.6){
_arg2.land();
_arg2.att.push(new PEBind(_arg2, _arg3));
_arg2.gravNorm = _arg1;
return (true);
};
return (false);
}
public function respond(_arg1:PEPhysObj, _arg2:PEPhysObj, _arg3:PEColResult){
var t:*;
var tlen:*;
var i:*;
var a = _arg1;
var b = _arg2;
var cr = _arg3;
try {
if (a.respond != null){
t = cr.b.tells;
tlen = t.length;
i = 0;
while (i < tlen) {
a.respond(t[i], cr, cr.b);
i = (i + 1);
};
};
} catch(err:Error) {
trace(("respond error: " + err));
};
if (((!((b.respond == null))) && (!((cr.a == null))))){
t = cr.a.tells;
i = 0;
while (i < t.length) {
b.respond(t[i], cr, cr.a);
i = (i + 1);
};
};
}
function trig_circlevol(_arg1, _arg2){
var _local3:*;
_local3 = new PEColResult();
_local3.a = _arg1;
_local3.b = _arg2;
respond(_arg1, _arg2, _local3);
}
public function checkWallslide(_arg1:Vect, _arg2:PEChar, _arg3:PEObj){
if (!_arg2.bCanWallSlide){
return (false);
};
_arg1 = _arg1.norm().mult(-1);
if (_arg1.x > 0.7){
if (_arg2.pstate == PEChar.FALL){
_arg2.actions.push("wslidel");
};
_arg2.state = PEChar.WSLIDE;
_arg2.wallSide = "l";
_arg2.wallImpact = _arg2.vel.x;
if (_arg2.vel.y > 0){
_arg2.friction = _arg2.frictionSlide;
} else {
_arg2.friction = _arg2.frictionASlide;
};
_arg2.wallAngle = (Vect.toDeg(Math.atan2(_arg1.y, _arg1.x)) - 90);
return (true);
} else {
if (_arg1.x < -0.7){
if (_arg2.pstate == PEChar.FALL){
_arg2.actions.push("wslider");
};
_arg2.state = PEChar.WSLIDE;
_arg2.wallSide = "r";
_arg2.wallImpact = _arg2.vel.x;
if (_arg2.vel.y > 0){
_arg2.friction = _arg2.frictionSlide;
} else {
_arg2.friction = _arg2.frictionASlide;
};
_arg2.wallAngle = (Vect.toDeg(Math.atan2(_arg1.y, _arg1.x)) + 90);
if (_arg2.wallAngle > 0){
_arg2.wallAngle = (_arg2.wallAngle - 360);
};
return (true);
};
};
return (false);
}
public static function addPhysObj(_arg1:PEPhysObj){
so.push(_arg1);
sp.push(_arg1);
}
public static function addUIObj(_arg1:PEUIObj){
so.push(_arg1);
sm.push(_arg1);
}
public static function lineTrace(_arg1:Vect, _arg2:Vect, _arg3:Boolean=false){
var _local4:PEColResult;
var _local5:PEColResult;
var _local6:*;
var _local7:Number;
var _local8:*;
var _local9:*;
var _local10:*;
_local5 = new PEColResult();
_local5.hit = false;
_local5.point = _arg2.copy();
_local6 = PEIndex.addLine(_arg1, _arg2);
levelref.addChild(_local6.mc);
_local7 = sp.length;
_local8 = 0;
for (;_local8 < _local7;_local8++) {
_local9 = sp[_local8];
if (((!(_local9.bStatic)) || (!(_local9.bActive)))){
} else {
if (_local9.colShape == "line"){
if (!_local6.mc.hitTestObject(_local9.mc)){
continue;
};
_local4 = PECollision.linetolinev(_arg1, _arg2, _local9);
if (_local4.hit){
if (!_arg3){
_local5.point = _local4.point.copy();
_local5.hit = true;
break;
} else {
if (_arg1.distance(_local4.point) < _arg1.distance(_local5.point)){
_local5.point = _local4.point.copy();
_local5.hit = true;
_local5.dist = _arg1.distance(_local4.point);
};
};
};
} else {
if (_local9.colShape == "box"){
_local10 = 0;
while (_local10 < 4) {
if (!_local6.mc.hitTestObject(_local9.edges[_local10].mc)){
} else {
_local4 = PECollision.linetolinev(_arg1, _arg2, _local9.edges[_local10]);
if (_local4.hit){
if (!_arg3){
_local5.point = _local4.point.copy();
_local5.hit = true;
break;
} else {
if (_arg1.distance(_local4.point) < _arg1.distance(_local5.point)){
_local5.point = _local4.point.copy();
_local5.hit = true;
_local5.dist = _arg1.distance(_local4.point);
};
};
};
};
_local10++;
};
};
};
};
};
levelref.removeChild(_local6.mc);
return (_local5);
}
public static function addLine(_arg1:Vect, _arg2:Vect){
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
_local3 = _arg2.subv(_arg1);
_local4 = (_local3.mag() / 100);
_local5 = Vect.toDeg(Math.atan2(_local3.y, _local3.x));
_local6 = new PEPhysObj("col_line", Phase.LINE);
_local6.setProps(_arg1.x, _arg1.y, _local4, 1, _local5);
return (_local6);
}
public static function addObj(_arg1:PEObj){
so.push(_arg1);
}
public static function createID():uint{
ids++;
return (ids);
}
}
}//package
Section 124
//PEInput (PEInput)
package {
import flash.display.*;
import flash.events.*;
public class PEInput {
var heldtime:Array;
var traceInput:Boolean;
var updates;
var mouseDelta:Vect;
var lpress:Array;
var dpress:Array;
var mousePos:Vect;
var keys:Array;
var allowDuals:Boolean;
var keyup:Array;
public function PEInput(_arg1:Stage){
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, pressKey);
_arg1.addEventListener(KeyboardEvent.KEY_UP, releaseKey);
_arg1.addEventListener(Event.DEACTIVATE, reset);
_arg1.addEventListener(MouseEvent.MOUSE_MOVE, mouseTrack);
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, pressMouse);
_arg1.addEventListener(MouseEvent.MOUSE_UP, releaseMouse);
keys = new Array(0x0100);
heldtime = new Array(0x0100);
keyup = new Array(0x0100);
reset(undefined);
traceInput = false;
allowDuals = true;
mouseDelta = new Vect(0, 0);
mousePos = new Vect(0, 0);
updates = 0;
}
public function update(){
var _local1:uint;
_local1 = 0;
while (_local1 < 0x0100) {
if (keys[_local1]){
var _local2 = heldtime;
var _local3 = _local1;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
if (keyup[_local1]){
keys[_local1] = false;
heldtime[_local1] = 0;
};
} else {
if (keyup[_local1]){
keyup[_local1] = false;
};
};
_local1++;
};
}
public function keyString(_arg1:Number){
if ((((_arg1 >= 48)) && ((_arg1 <= 57)))){
return (String.fromCharCode(_arg1));
};
if ((((_arg1 >= 65)) && ((_arg1 <= 90)))){
return (String.fromCharCode(_arg1));
};
if ((((_arg1 >= 96)) && ((_arg1 <= 105)))){
return (("NUMPAD " + String((_arg1 - 96))));
};
if ((((_arg1 >= 112)) && ((_arg1 <= 123)))){
return (("F" + String((_arg1 - 111))));
};
switch (_arg1){
case 1:
return ("LEFT CLICK");
case 2:
return ("RIGHT CLICK");
case 4:
return ("MIDDLE CLICK");
case 5:
return ("MOUSE 4");
case 6:
return ("MOUSE 5");
case 8:
return ("BACKSPACE");
case 9:
return ("TAB");
case 13:
return ("ENTER");
case 16:
return ("SHIFT (BOTH)");
case 17:
return ("CTRL (BOTH)");
case 18:
return ("ALT (BOTH)");
case 19:
return ("PAUSE");
case 20:
return ("CAPS LOCK");
case 27:
return ("ESCAPE");
case 32:
return ("SPACEBAR");
case 33:
return ("PAGE UP");
case 34:
return ("PAGE DOWN");
case 35:
return ("END");
case 36:
return ("HOME");
case 37:
return ("LEFT");
case 38:
return ("UP");
case 39:
return ("RIGHT");
case 40:
return ("DOWN");
case 44:
return ("PRINT SCREEN");
case 45:
return ("INSERT");
case 46:
return ("DELETE");
case 91:
return ("WINDOWS (LEFT)");
case 92:
return ("WINDOWS (RIGHT)");
case 106:
return ("NUMPAD *");
case 107:
return ("NUMPAD +");
case 109:
return ("NUMPAD -");
case 110:
return ("NUMPAD .");
case 111:
return ("NUMPAD /");
case 144:
return ("NUM LOCK");
case 145:
return ("SCROLL LOCK");
case 160:
return ("LEFT SHIFT");
case 161:
return ("RIGHT SHIFT");
case 162:
return ("LEFT CTRL");
case 163:
return ("RIGHT CTRL");
case 164:
return ("LEFT ALT");
case 165:
return ("RIGHT ALT");
case 186:
return (";");
case 187:
return ("=");
case 188:
return (",");
case 189:
return ("-");
case 190:
return (".");
case 191:
return ("/");
case 192:
return ("~");
case 219:
return ("[");
case 220:
return ("\\");
case 221:
return ("]");
case 222:
return ("'");
};
return ("UNKNOWN");
}
public function reset(_arg1:Event){
var _local2:uint;
_local2 = 0;
while (_local2 < 0x0100) {
keys[_local2] = false;
keyup[_local2] = false;
heldtime[_local2] = 0;
_local2++;
};
}
public function releaseKey(_arg1:KeyboardEvent){
keyup[_arg1.keyCode] = true;
}
public function pressMouse(_arg1:MouseEvent){
if (traceInput){
trace("Left mouse clicked");
};
keys[1] = true;
}
public function pressKey(_arg1:KeyboardEvent){
if (traceInput){
trace(((_arg1.keyCode + " code pressed: ") + keyString(_arg1.keyCode)));
};
keys[_arg1.keyCode] = true;
}
public function releaseMouse(_arg1:MouseEvent){
keyup[1] = true;
}
public function down(_arg1:uint):Boolean{
if (keys[_arg1]){
return (true);
};
return (false);
}
public function tap(_arg1:uint):Boolean{
if (((keys[_arg1]) && ((heldtime[_arg1] == 1)))){
return (true);
};
return (false);
}
public function mouseTrack(_arg1:MouseEvent){
mouseDelta.set(((mouseDelta.x + _arg1.stageX) - mousePos.x), ((mouseDelta.y + _arg1.stageY) - mousePos.y));
mousePos.set(_arg1.stageX, _arg1.stageY);
}
public function held(_arg1:uint):uint{
return (heldtime[_arg1]);
}
public function released(_arg1:uint):Boolean{
if (keyup[_arg1]){
return (true);
};
return (false);
}
}
}//package
Section 125
//PEObj (PEObj)
package {
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class PEObj {
public var img:Array;
public var bClear:Boolean;
public var sca:Vect;
public var pos:Vect;
public var mc:MovieClip;
public var rot:Number;
public var id:uint;
public var att:Array;
public var vel:Vect;
public var parent:PEObj;
public var paused:Boolean;
public var imgOffset:Vect;
public var children:Array;
public function PEObj(_arg1){
var _local2:Class;
super();
if ((_arg1 is String)){
if (_arg1 == ""){
mc = new MovieClip();
} else {
_local2 = (getDefinitionByName(_arg1) as Class);
mc = new (_local2);
};
pos = new Vect(0, 0);
vel = new Vect(0, 0);
sca = new Vect(1, 1);
rot = 0;
} else {
if ((_arg1 is MovieClip)){
mc = _arg1;
pos = new Vect(mc.x, mc.y);
vel = new Vect(0, 0);
sca = new Vect(mc.scaleX, mc.scaleY);
rot = mc.rotation;
};
};
imgOffset = new Vect(0, 0);
mc.cacheAsBitmap = true;
att = new Array();
img = new Array();
id = PEIndex.createID();
bClear = true;
children = new Array();
paused = false;
}
public function shiftPosv(_arg1:Vect){
shiftPos(_arg1.x, _arg1.y);
}
public function pause(_arg1:Boolean=false){
var _local2:*;
paused = true;
if (_arg1){
for (_local2 in children) {
children[_local2].pause(true);
};
};
}
public function rotate(_arg1){
rot = (rot + _arg1);
updateProperties();
}
public function update(){
var _local1:*;
var _local2:*;
var _local3:*;
if (paused){
return;
};
pos = pos.addv(vel);
for (_local1 in att) {
_local3 = att[_local1];
if (_local3.bDirect){
pos = pos.addv(_local3.b.vel);
};
if (att[_local1].bTemp){
vel = vel.addv(_local3.b.vel);
att.splice(_local1, 1);
};
};
updateProperties();
updateImages();
for (_local2 in children) {
children[_local2].update();
};
}
public function unpause(_arg1:Boolean=false){
var _local2:*;
paused = false;
if (_arg1){
for (_local2 in children) {
children[_local2].unpause(true);
};
};
}
public function traceDown(_arg1:String){
var _local2:*;
trace(((_arg1 + "Child: ") + this));
for (_local2 in children) {
children[_local2].traceDown((_arg1 + "--"));
};
}
public function setProps(_arg1, _arg2, _arg3, _arg4, _arg5){
pos.set(_arg1, _arg2);
sca.set(_arg3, _arg4);
rot = _arg5;
updateProperties();
}
public function colourImage(_arg1, _arg2, _arg3, _arg4:Number=1, _arg5:int=-1){
var _local6:ColorTransform;
var _local7:Number;
var _local8:Number;
if (_arg5 == -1){
_local6 = mc.transform.colorTransform;
_local7 = (1 - _arg4);
_local8 = (_arg4 / 1);
_local6.redMultiplier = (_local6.greenMultiplier = (_local6.blueMultiplier = _local7));
_local6.redOffset = (_arg1 * _local8);
_local6.greenOffset = (_arg2 * _local8);
_local6.blueOffset = (_arg3 * _local8);
mc.transform.colorTransform = _local6;
} else {
_local6 = img[_arg5].transform.colorTransform;
_local7 = (1 - _arg4);
_local8 = (_arg4 / 1);
_local6.redMultiplier = (_local6.greenMultiplier = (_local6.blueMultiplier = _local7));
_local6.redOffset = (_arg1 * _local8);
_local6.greenOffset = (_arg2 * _local8);
_local6.blueOffset = (_arg3 * _local8);
img[_arg5].transform.colorTransform = _local6;
};
}
public function unload(){
}
public function setPos(_arg1, _arg2){
pos.set(_arg1, _arg2);
updateProperties();
}
public function setScale(_arg1, _arg2){
sca.set(_arg1, _arg2);
updateProperties();
}
public function attachImage(_arg1:String){
var _local2:Class;
if (_arg1 == ""){
img.push(new MovieClip());
} else {
_local2 = (getDefinitionByName(_arg1) as Class);
img.push(new (_local2));
};
img[(img.length - 1)].cacheAsBitmap = true;
img[(img.length - 1)].stop();
return (img[(img.length - 1)]);
}
public function setPosv(_arg1:Vect){
setPos(_arg1.x, _arg1.y);
}
public function setRot(_arg1){
rot = _arg1;
updateProperties();
}
public function accel(_arg1, _arg2){
vel.add(_arg1, _arg2);
}
public function updateImages(){
var _local1:*;
_local1 = 0;
while (_local1 < img.length) {
if (img[_local1] == null){
} else {
img[_local1].x = (mc.x + imgOffset.x);
img[_local1].y = (mc.y + imgOffset.y);
if (img[_local1].currentLabel != "ns"){
img[_local1].gotoAndStop((img[_local1].currentFrame + 1));
};
};
_local1++;
};
}
public function shiftPos(_arg1, _arg2){
pos.add(_arg1, _arg2);
updateProperties();
}
function updateProperties(){
mc.x = pos.x;
mc.y = pos.y;
mc.scaleX = sca.x;
mc.scaleY = sca.y;
mc.rotation = rot;
calcAbsolute();
}
public function removeChild(_arg1:uint){
var _local2:*;
for (_local2 in children) {
if (children[_local2].id == _arg1){
children.splice(_local2, 1);
return;
};
};
}
public function calcAbsolute(){
}
public function traceChildren(){
var _local1:String;
var _local2:*;
_local1 = "";
trace(((_local1 + "Obj: ") + this));
for (_local2 in children) {
children[_local2].traceDown((_local1 + "--"));
};
}
}
}//package
Section 126
//PEPhysObj (PEPhysObj)
package {
import flash.display.*;
public class PEPhysObj extends PEObj {
public var redirect:Object;
public var colMask:uint;
public var airResist:Number;
public var bActive:Boolean;
public var colShape:uint;
public var contain:Array;
public var bounce:Number;
public var bAttached:Boolean;
public var absorb:Number;
public var appos:Vect;
public var gravity:Number;
public var respond:Function;
public var triggerMask:uint;
public var colType:uint;
public var bGrav:Boolean;
public var bChecked:Boolean;
public var tells:Array;
public var bStatic:Boolean;
public var mass:Number;
public var apos:Vect;
public var friction:Number;
public var ppos:Vect;
public function PEPhysObj(_arg1, _arg2:uint=0){
super(_arg1);
if ((_arg1 is MovieClip)){
bAttached = true;
};
bActive = true;
bStatic = false;
bGrav = false;
gravity = 0.4;
mass = 1;
airResist = 1;
bounce = 1;
friction = 0.02;
absorb = 0;
colShape = _arg2;
colType = Phase.SURFACE;
colMask = ((((Phase.SURFACE | Phase.PLAYER) | Phase.ENEMY) | Phase.NPC) | Phase.PROJECTILE);
triggerMask = (colMask | Phase.TRIGGER);
ppos = pos.copy();
contain = new Array();
tells = new Array();
if (mc.bound != undefined){
mc.bound._visible = false;
};
}
override public function setPos(_arg1, _arg2){
ppos.set(_arg1, _arg2);
super.setPos(_arg1, _arg2);
}
override public function updateImages(){
super.updateImages();
}
public function lock(){
bStatic = true;
bGrav = false;
}
override public function setProps(_arg1, _arg2, _arg3, _arg4, _arg5){
ppos.set(_arg1, _arg2);
super.setProps(_arg1, _arg2, _arg3, _arg4, _arg5);
}
override public function update(){
var _local1:*;
if (paused){
return;
};
if (bActive){
if (bGrav){
vel.y = (vel.y + (gravity * airResist));
gravity = 0.4;
};
};
ppos = pos.copy();
bChecked = false;
if (bAttached){
pos.set(mc.x, mc.y);
rot = mc.rotation;
sca.set(mc.scaleX, mc.scaleY);
vel.set(0, 0);
updateImages();
calcAbsolute();
for (_local1 in children) {
children[_local1].update();
};
} else {
super.update();
};
}
public function setState(_arg1:Boolean, _arg2:Boolean, _arg3:Boolean){
bActive = _arg1;
bStatic = _arg2;
bGrav = _arg3;
}
public function setAttrib(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
mass = _arg1;
airResist = _arg2;
bounce = _arg3;
friction = _arg4;
absorb = _arg5;
}
override public function calcAbsolute(){
var _local1:*;
apos = pos.copy();
appos = ppos.copy();
_local1 = 0;
while (_local1 < contain.length) {
apos.rotate(contain[_local1].rot);
appos.rotate(contain[_local1].rot);
apos.add(contain[_local1].pos.x, contain[_local1].pos.y);
appos.add(contain[_local1].pos.x, contain[_local1].pos.y);
_local1++;
};
}
}
}//package
Section 127
//PESound (PESound)
package {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
public class PESound {
var done:Boolean;
var chan:SoundChannel;
var sound:Sound;
var prevLoops:uint;
var prevVol:uint;
var infLoop:Boolean;
var tran:SoundTransform;
var pausePos:Number;
public function PESound(_arg1:String){
var _local2:Class;
super();
_local2 = (getDefinitionByName(_arg1) as Class);
sound = new (_local2);
pausePos = 0;
prevVol = 0;
prevLoops = 0;
infLoop = false;
}
public function stop(){
chan.stop();
}
public function isDone(_arg1:Event){
if (infLoop){
tran = new SoundTransform(prevVol, 0);
chan = sound.play(0, 1, tran);
chan.addEventListener(Event.SOUND_COMPLETE, isDone);
} else {
this.done = true;
};
}
public function setVol(_arg1:Number){
if (chan){
tran = chan.soundTransform;
tran.volume = _arg1;
chan.soundTransform = tran;
};
prevVol = _arg1;
}
public function setPan(_arg1:Number){
if (chan){
tran = chan.soundTransform;
tran.pan = _arg1;
chan.soundTransform = tran;
};
}
public function play(_arg1:Number=1, _arg2:uint=1, _arg3:Number=0){
if (infLoop){
_arg2 = 1;
};
tran = new SoundTransform(_arg1, 0);
chan = sound.play(_arg3, _arg2, tran);
done = false;
if (chan){
chan.addEventListener(Event.SOUND_COMPLETE, isDone);
};
prevVol = _arg1;
prevLoops = _arg2;
}
public function pause(){
if (!done){
if (chan){
pausePos = chan.position;
chan.stop();
};
};
}
public function unpause(){
if (!done){
play(prevVol, prevLoops, pausePos);
};
}
}
}//package
Section 128
//PESoundObj (PESoundObj)
package {
public class PESoundObj extends PEObj {
var positional:Boolean;
var dropoff:Number;
var fadeSpeed:Number;
var pauseState:String;
var panRate:Number;
var playState:String;
var vol:Number;
var fadePhase:Number;
var snd:PESound;
var bMusic:Boolean;
public function PESoundObj(_arg1:String){
super("");
positional = true;
dropoff = 100;
panRate = 100;
vol = 1;
fadeSpeed = 0;
fadePhase = 0;
snd = new PESound(_arg1);
playState = "off";
pauseState = "";
}
public function adjust(_arg1:Number, _arg2:Number, _arg3:Number){
vol = _arg1;
dropoff = _arg2;
panRate = _arg3;
}
public function play(_arg1:uint=1){
if ((((playState == "off")) || (snd.done))){
playState = "on";
snd.play(vol, _arg1);
update();
};
}
override public function update(){
var _local1:Vect;
var _local2:*;
var _local3:*;
var _local4:*;
if (playState != "off"){
if (playState == "fade"){
fadePhase = (fadePhase + fadeSpeed);
if (fadePhase <= -(vol)){
pause();
fadePhase = -(vol);
return;
};
if (fadePhase >= 0){
playState = "on";
fadePhase = 0;
};
};
if (positional){
_local1 = PESoundScape.focus;
_local2 = _local1.distance(pos);
_local3 = (vol - ((vol * _local2) / dropoff));
_local3 = (_local3 + fadePhase);
if (_local3 < 0){
_local3 = 0;
} else {
if (_local3 > vol){
_local3 = vol;
};
};
if (bMusic){
_local3 = (_local3 * PESoundScape.musicvol);
} else {
_local3 = (_local3 * PESoundScape.effectvol);
};
snd.setVol(_local3);
_local2 = (pos.x - _local1.x);
_local4 = ((_local2 * Math.abs((_local2 / panRate))) / 100);
if (_local4 < -1){
_local4 = -1;
} else {
if (_local4 > 1){
_local4 = 1;
};
};
snd.setPan(_local4);
} else {
if (bMusic){
snd.setVol(((vol + fadePhase) * PESoundScape.musicvol));
} else {
snd.setVol(((vol + fadePhase) * PESoundScape.effectvol));
};
snd.setPan(0);
};
};
}
override public function pause(_arg1:Boolean=false){
super.pause(_arg1);
if (playState != "off"){
snd.pause();
pauseState = playState;
playState = "off";
};
}
public function finished(){
playState = "off";
}
public function fade(_arg1:Number, _arg2:Number=0){
fadeSpeed = _arg1;
fadePhase = _arg2;
if (playState == "on"){
playState = "fade";
};
if ((((playState == "off")) && ((_arg1 > 0)))){
this.unpause();
};
}
override public function unpause(_arg1:Boolean=false){
super.unpause(_arg1);
if (playState == "off"){
snd.unpause();
playState = pauseState;
};
}
}
}//package
Section 129
//PESoundScape (PESoundScape)
package {
public class PESoundScape {
var clips:Array;
public static var effectvol:Number;
public static var focus:Vect;
public static var musicvol:Number;
public function PESoundScape(){
clips = new Array();
PESoundScape.focus = new Vect(0, 0);
PESoundScape.effectvol = 1;
PESoundScape.musicvol = 1;
}
public function playSound(_arg1:String, _arg2:Number=1, _arg3:uint=1){
var _local4:*;
_local4 = 0;
while (_local4 < clips.length) {
if (!clips[_local4].done){
} else {
clips[_local4] = null;
clips[_local4] = new PESound(_arg1);
clips[_local4].play((_arg2 * effectvol), _arg3);
return;
};
_local4++;
};
clips.push(new PESound(_arg1));
clips[(clips.length - 1)].play((_arg2 * effectvol), _arg3);
}
public function playPosSound(_arg1:String, _arg2:Vect, _arg3:Number=1, _arg4:uint=1){
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
_local5 = focus.distance(_arg2);
_local6 = (_arg3 - ((_arg3 * _local5) / 1000));
if (_local6 < 0){
_local6 = 0;
} else {
if (_local6 > _arg3){
_local6 = _arg3;
};
};
_local6 = (_local6 * effectvol);
_local5 = (_arg2.x - focus.x);
_local7 = ((_local5 * Math.abs((_local5 / 1000))) / 100);
if (_local7 < -1){
_local7 = -1;
} else {
if (_local7 > 1){
_local7 = 1;
};
};
_local8 = 0;
while (_local8 < clips.length) {
if (!clips[_local8].done){
} else {
clips[_local8] = null;
clips[_local8] = new PESound(_arg1);
clips[_local8].play(_local6, _arg4);
clips[_local8].setPan(_local7);
return;
};
_local8++;
};
clips.push(new PESound(_arg1));
clips[(clips.length - 1)].play(_local6, _arg4);
clips[(clips.length - 1)].setPan(_local7);
}
public static function focusOn(_arg1:Vect){
focus = _arg1.copy();
}
}
}//package
Section 130
//PETime (PETime)
package {
import flash.utils.*;
public class PETime {
public var frames:Number;
public var fps:Number;
public var frameDelta:Number;
public var startTime:Number;
public var frameTime:Number;
public function PETime(){
frameDelta = 33;
frameTime = 0;
frames = 0;
startTime = 0;
fps = 0;
}
public function init(){
startTime = getTimer();
frameTime = 0;
}
public function update(){
var _local1:*;
frames++;
_local1 = getTimer();
frameDelta = (_local1 - startTime);
frameTime = (frameTime + frameDelta);
startTime = _local1;
if (frameTime >= 1000){
fps = frames;
frameTime = (frameTime - 1000);
frames = 0;
};
PEDebug.log(String(("FPS: " + fps)));
return (fps);
}
}
}//package
Section 131
//PEUIObj (PEUIObj)
package {
public class PEUIObj extends PEObj {
public var clickThrough:Boolean;
public var bDraggable:Boolean;
public var dragging:Boolean;
public var canvas:Vect;
public var bDragOff:Boolean;
public function PEUIObj(_arg1){
super(_arg1);
bDraggable = false;
bDragOff = true;
dragging = false;
clickThrough = false;
canvas = new Vect(Phase.stage.stageWidth, Phase.stage.stageHeight);
bClear = false;
}
override public function update(){
if (!bDragOff){
if (pos.x < 0){
pos.x = 0;
} else {
if (pos.x > (canvas.x - mc.width)){
pos.x = (canvas.x - mc.width);
};
};
if (pos.y < 0){
pos.y = 0;
} else {
if (pos.y > (canvas.y - mc.height)){
pos.y = (canvas.y - mc.height);
};
};
};
super.update();
}
public function dock(_arg1:String){
if (_arg1 == "center"){
pos.x = ((canvas.x - mc.width) / 2);
pos.y = ((canvas.y - mc.height) / 2);
} else {
if (_arg1 == "left"){
pos.x = 0;
} else {
if (_arg1 == "right"){
pos.x = (canvas.x - mc.width);
} else {
if (_arg1 == "top"){
pos.y = 0;
} else {
if (_arg1 == "bottom"){
pos.y = (canvas.y - mc.height);
};
};
};
};
};
}
}
}//package
Section 132
//Phase (Phase)
package {
import flash.display.*;
import flash.utils.*;
public class Phase {
public static const PROJECTILE:uint = 32;
public static const SURFACE:uint = 1;
public static const TRIGGER:uint = 2;
public static const VOL:uint = 3;
public static const NONE:uint = 0;
public static const NPC:uint = 16;
public static const CIRCLE:uint = 1;
public static const CONTAINER:uint = 4;
public static const ENEMY:uint = 8;
public static const LINE:uint = 2;
public static const PLAYER:uint = 4;
public static var level:MovieClip;
public static var cpos:Vect;
public static var ui:MovieClip;
public static var planes:Array;
public static var tim:PETime;
public static var coff:Vect;
public static var czoom:Number;
public static var debug:MovieClip;
public static var shakeMult:Number;
public static var focusSteal:Boolean;
public static var sounds:MovieClip;
public static var ind:PEIndex;
public static var frustum;
public static var root;
public static var inp:PEInput;
public static var frameRate:uint;
public static var snd:PESoundScape;
public static var stage;
public function Phase(_arg1:Stage){
stage = _arg1;
root = _arg1.getChildAt(0);
frustum = root.frustum;
level = new MovieClip();
ui = new MovieClip();
debug = new debug_overlay();
sounds = new MovieClip();
root.addChild(level);
root.addChild(ui);
root.addChild(debug);
root.addChild(sounds);
root.mouseEnabled = true;
root.mouseChildren = true;
ui.mouseEnabled = true;
ui.mouseChildren = true;
debug.mouseEnabled = false;
debug.log.mouseEnabled = false;
sounds.mouseEnabled = false;
planes = new Array();
ind = new PEIndex();
tim = new PETime();
inp = new PEInput(_arg1);
snd = new PESoundScape();
PEDebug.target = debug;
frameRate = 40;
ind.limit = (1000 / frameRate);
PEIndex.levelref = level;
cpos = new Vect((stage.stageWidth / 2), (stage.stageHeight / 2));
coff = new Vect(0, 0);
czoom = 100;
shakeMult = 0;
focusSteal = true;
}
public static function autoPhys(_arg1:PEPhysObj){
ind.autoPhys(_arg1);
}
public static function attachObj(_arg1:uint, _arg2:PEObj, _arg3:Boolean=false){
var _local4:*;
if (!_arg3){
planes[_arg1].addChild(_arg2.mc);
};
_local4 = 0;
while (_local4 < _arg2.img.length) {
planes[_arg1].addChild(_arg2.img[_local4]);
_local4++;
};
}
public static function inView(_arg1:MovieClip):Boolean{
if (frustum.hitTestObject(_arg1)){
return (true);
};
return (false);
}
public static function stopStealingFocus(){
focusSteal = false;
}
public static function attachUIObj(_arg1:PEObj){
ui.addChild(_arg1.mc);
}
public static function keyDown(_arg1:uint){
return (inp.down(_arg1));
}
public static function loopStart():void{
if (focusSteal){
stage.focus = null;
};
PEDebug.clear();
tim.update();
inp.update();
if (inp.tap(1)){
ind.menuGrab(inp.mousePos);
} else {
if (inp.held(1)){
ind.menuDrag(inp.mouseDelta);
} else {
if (inp.released(1)){
ind.menuLetgo();
};
};
};
PESoundScape.focusOn(Phase.cpos);
}
public static function parent(_arg1:PEObj, _arg2:PEObj){
_arg2.children.push(_arg1);
_arg1.parent = _arg2;
}
public static function loopEnd():void{
var _local1:*;
inp.mouseDelta.set(0, 0);
_local1 = getTimer();
ind.update(tim.frameDelta);
}
public static function keyHeld(_arg1:uint){
return (inp.held(_arg1));
}
public static function keyReleased(_arg1:uint){
return (inp.released(_arg1));
}
public static function rand(_arg1:Number, _arg2:Number, _arg3:Boolean=false){
var _local4:*;
_local4 = ((Math.random() * (_arg2 - _arg1)) + _arg1);
if (_arg3){
_local4 = Math.floor(_local4);
};
return (_local4);
}
public static function trigger(_arg1:PEPhysObj){
ind.trigDive(_arg1);
}
public static function newLine(_arg1:uint, _arg2:Vect, _arg3:Vect):PEPhysObj{
var _local4:*;
_local4 = PEIndex.addLine(_arg2, _arg3);
PEIndex.addPhysObj(_local4);
planes[_arg1].addChild(_local4.mc);
return (_local4);
}
public static function resumeStealingFocus(){
focusSteal = true;
}
public static function playSound(_arg1:String, _arg2:Number=1, _arg3:uint=1){
snd.playSound(_arg1, _arg2, _arg3);
}
public static function cam(_arg1:Vect, _arg2:Number){
cpos = _arg1.copy();
czoom = _arg2;
level.scaleX = (level.scaleY = czoom);
level.x = ((stage.stageWidth * 0.5) - ((cpos.x + coff.x) * czoom));
level.y = ((stage.stageHeight * 0.5) - ((cpos.y + coff.y) * czoom));
planes[0].x = (-(level.x) * (1 / czoom));
planes[0].y = (-(level.y) * (1 / czoom));
planes[0].scaleX = (planes[0].scaleY = (1 / czoom));
planes[1].x = -(((level.x * (1 / czoom)) * (0.5 * czoom)));
planes[1].y = -(((level.y * (1 / czoom)) * (0.5 * czoom)));
if (coff.y != 0){
coff.y = (coff.y * -(shakeMult));
if (Math.abs(coff.y) < 1){
coff.y = 0;
shakeMult = 0;
};
};
}
public static function destroyChild(_arg1:PEObj){
var i:*;
var j:*;
var ob = _arg1;
for (i in ob.children) {
destroyChild(ob.children[i]);
};
ob.children = new Array();
try {
if (ob.mc.parent){
ob.mc.parent.removeChild(ob.mc);
};
ob.mc = null;
for (j in ob.img) {
ob.img[j].parent.removeChild(ob.img[j]);
};
} catch(err:Error) {
trace(("destroyChild catch: " + err));
};
ob.unload();
ob = null;
}
public static function index(_arg1:PEObj, _arg2:Boolean=false){
if (_arg2){
PEIndex.addPhysObj(PEPhysObj(_arg1));
} else {
PEIndex.addObj(_arg1);
};
}
public static function keyTap(_arg1:uint){
return (inp.tap(_arg1));
}
public static function showPhys(_arg1:Boolean){
var _local2:*;
for (_local2 in ind.p) {
ind.showPhys(ind.p[_local2], _arg1);
};
}
public static function playPosSound(_arg1:String, _arg2:Vect, _arg3:Number=1, _arg4:uint=1){
snd.playPosSound(_arg1, _arg2, _arg3, _arg4);
}
public static function camShake(_arg1:Number, _arg2:Number){
coff.y = _arg1;
shakeMult = _arg2;
}
public static function destroy(_arg1:PEObj){
destroyChild(_arg1);
if (_arg1.parent){
_arg1.parent.removeChild(_arg1.id);
} else {
ind.remove(_arg1.id);
};
_arg1 = null;
}
public static function setupPlanes(_arg1:uint){
var _local2:*;
_local2 = 0;
while (_local2 < _arg1) {
planes.push(new MovieClip());
level.addChild(planes[(planes.length - 1)]);
_local2++;
};
}
}
}//package
Section 133
//player_icon (player_icon)
package {
import flash.display.*;
public dynamic class player_icon extends MovieClip {
}
}//package
Section 134
//player_mc (player_mc)
package {
import flash.display.*;
public dynamic class player_mc extends MovieClip {
public var body:MovieClip;
}
}//package
Section 135
//pusher_mc (pusher_mc)
package {
import flash.display.*;
public dynamic class pusher_mc extends MovieClip {
public var body:MovieClip;
}
}//package
Section 136
//pusher2_mc (pusher2_mc)
package {
import flash.display.*;
public dynamic class pusher2_mc extends MovieClip {
public var body:MovieClip;
}
}//package
Section 137
//rewheel_mc (rewheel_mc)
package {
import flash.display.*;
public dynamic class rewheel_mc extends MovieClip {
public var body:MovieClip;
}
}//package
Section 138
//rewheel2_mc (rewheel2_mc)
package {
import flash.display.*;
public dynamic class rewheel2_mc extends MovieClip {
public var body:MovieClip;
}
}//package
Section 139
//spinner_blue (spinner_blue)
package {
import flash.display.*;
public dynamic class spinner_blue extends MovieClip {
}
}//package
Section 140
//strutter_mc (strutter_mc)
package {
import flash.display.*;
public dynamic class strutter_mc extends MovieClip {
public var body:MovieClip;
}
}//package
Section 141
//strutter2_mc (strutter2_mc)
package {
import flash.display.*;
public dynamic class strutter2_mc extends MovieClip {
public var body:MovieClip;
}
}//package
Section 142
//tack_mc (tack_mc)
package {
import flash.display.*;
public dynamic class tack_mc extends MovieClip {
public var body:MovieClip;
}
}//package
Section 143
//TFBob (TFBob)
package {
public class TFBob extends TFEnemy {
public function TFBob(_arg1:Number, _arg2:Number){
super("col_circle", Phase.CIRCLE);
setProps(_arg1, (_arg2 - (0.2 * 100)), 0.2, 0.4, 0);
setState(true, false, true);
mc.visible = false;
attachImage("bob_mc");
imgOffset.set(0, 20);
playAnim("run");
faceDir("l");
speed = 2.5;
acc = 0.3;
airControl = 0.1;
hoffset = 40;
health = (maxhealth = 60);
value = 20;
}
override public function behave(){
if (bAlive){
if (stun == 0){
control("move", "l");
} else {
stun--;
if (stun == 0){
playAnim("run");
};
control("stop");
vel.x = 0;
};
} else {
control("stop");
};
}
}
}//package
Section 144
//TFBob2 (TFBob2)
package {
public class TFBob2 extends TFEnemy {
public function TFBob2(_arg1:Number, _arg2:Number){
super("col_circle", Phase.CIRCLE);
setProps(_arg1, (_arg2 - (0.2 * 100)), 0.2, 0.4, 0);
setState(true, false, true);
mc.visible = false;
attachImage("bob2_mc");
sca = sca.mult(1.25);
img[0].scaleX = (img[0].scaleY = 1.25);
imgOffset.set(0, 25);
playAnim("run");
faceDir("l");
stunres = 10;
speed = 3.5;
acc = 0.2;
airControl = 0.1;
hoffset = 50;
health = (maxhealth = 160);
value = 50;
}
override public function behave(){
if (bAlive){
if (stun == 0){
control("move", "l");
} else {
stun--;
if (stun == 0){
playAnim("run");
};
control("stop");
vel.x = 0;
};
} else {
control("stop");
};
}
}
}//package
Section 145
//TFBoulder (TFBoulder)
package {
public class TFBoulder extends TFTower {
public function TFBoulder(_arg1:Vect){
super("", Phase.NONE);
setPosv(_arg1);
attachImage("tower_boulder");
img[0].blendMode = "screen";
damage = TFTower.dmgBoulder;
speed = 150;
Phase.attachObj(2, this);
}
override public function fire(){
var _local1:*;
_local1 = new TFBoulderProj(damage, level);
_local1.setPos((pos.x + 25), (pos.y - 175));
_local1.accel(2, 0);
Phase.parent(_local1, this);
Phase.attachObj(5, _local1);
_local1 = new TFBoulderProj(damage, level);
_local1.setPos((pos.x - 5), (pos.y - 175));
_local1.accel(-2, 0);
Phase.parent(_local1, this);
Phase.attachObj(5, _local1);
count = speed;
}
}
}//package
Section 146
//TFBoulderProj (TFBoulderProj)
package {
public class TFBoulderProj extends PEPhysObj {
var life:uint;
public function TFBoulderProj(_arg1:uint, _arg2:uint){
super("col_circle", Phase.CIRCLE);
bGrav = true;
bounce = 0.5;
setScale(0.6, 0.6);
attachImage("tower_boulder_proj");
img[0].blendMode = "screen";
img[0].rotation = Phase.rand(0, 360);
mc.visible = false;
colType = Phase.PROJECTILE;
colMask = (colMask ^ Phase.PROJECTILE);
colMask = (colMask ^ Phase.PLAYER);
triggerMask = (triggerMask ^ Phase.PROJECTILE);
triggerMask = (triggerMask ^ Phase.PLAYER);
tells.push(((("b" + _arg2) + "hit") + _arg1));
life = 140;
}
override public function update(){
sca = sca.mult(0.995);
img[0].scaleX = (img[0].scaleY = sca.x);
img[0].rotation = (img[0].rotation + (vel.x * 1.5));
super.update();
}
}
}//package
Section 147
//TFChar (TFChar)
package {
import flash.events.*;
public class TFChar extends PEChar {
public var attackDelay:uint;
public var resource:uint;
public var moveDelay:uint;
public var placer:PEObj;
public var maxCombo:uint;
public var comboPhase:uint;
public var towers:PEPhysObj;
public var ico:PEUIObj;
public var bmenu:PEUIObj;
public var ho:PEPhysObj;
public var stunStr:String;
public var stance:uint;
public var dmgBoost:uint;
public var dmgMult:Number;
public var umenu:PEUIObj;
public var launchStr:uint;
public var sellTarget:TFTower;
private var lastAnim:String;
public var attackDamage:uint;
public var towerMult:Number;
public var maxAirCombo:uint;
public static const SPIN:uint = 5;
public static const UPGRADE:uint = 6;
public static const FLIPK:uint = 1;
public static const KICK:uint = 3;
public static const LEFT:uint = 1;
public static const RIGHT:uint = 2;
public static const HURK:uint = 3;
public static const BUILD:uint = 5;
public static const RJAB:uint = 1;
public static const NONE:uint = 0;
public static const LJAB:uint = 2;
public static const AIR:uint = 3;
public static const POUND:uint = 4;
public static const VAULTK:uint = 2;
public static const SMASH:uint = 4;
public function TFChar(){
var showVine:Function;
var buildVine:Function;
var showboulder:Function;
var buildboulder:Function;
var showstorm:Function;
var buildstorm:Function;
var showtornado:Function;
var buildtornado:Function;
var hidePlacer:Function;
showVine = function (_arg1:MouseEvent){
placer.pos.x = pos.x;
placer.pos.y = (pos.y + 50);
placer.mc.gotoAndStop("vine");
placer.mc.visible = true;
};
buildVine = function (_arg1:MouseEvent){
var _local2:*;
if (resource >= TFTower.costVine){
Phase.playSound("buttonding.mp3", 0.6);
resource = (resource - TFTower.costVine);
TFStats.resSpent = (TFStats.resSpent + TFTower.costVine);
_local2 = new TFVine(new Vect(pos.x, (pos.y + 50)));
_local2.damage = uint((_local2.damage * towerMult));
towers.children.push(_local2);
stopBuild();
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
showboulder = function (_arg1:MouseEvent){
placer.pos.x = pos.x;
placer.pos.y = (pos.y + 50);
placer.mc.gotoAndStop("boulder");
placer.mc.visible = true;
};
buildboulder = function (_arg1:MouseEvent){
var _local2:*;
if (resource >= TFTower.costBoulder){
Phase.playSound("buttonding.mp3", 0.6);
resource = (resource - TFTower.costBoulder);
TFStats.resSpent = (TFStats.resSpent + TFTower.costBoulder);
_local2 = new TFBoulder(new Vect(pos.x, (pos.y + 50)));
_local2.damage = uint((_local2.damage * towerMult));
towers.children.push(_local2);
stopBuild();
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
showstorm = function (_arg1:MouseEvent){
placer.pos.x = pos.x;
placer.pos.y = (pos.y + 50);
placer.mc.gotoAndStop("storm");
placer.mc.visible = true;
};
buildstorm = function (_arg1:MouseEvent){
var _local2:*;
if (resource >= TFTower.costStorm){
Phase.playSound("buttonding.mp3", 0.6);
resource = (resource - TFTower.costStorm);
TFStats.resSpent = (TFStats.resSpent + TFTower.costStorm);
_local2 = new TFStorm(new Vect(pos.x, (pos.y + 50)));
_local2.damage = uint((_local2.damage * towerMult));
towers.children.push(_local2);
stopBuild();
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
showtornado = function (_arg1:MouseEvent){
placer.pos.x = pos.x;
placer.pos.y = (pos.y + 50);
placer.mc.gotoAndStop("tornado");
placer.mc.visible = true;
};
buildtornado = function (_arg1:MouseEvent){
var _local2:*;
if (resource >= TFTower.costTornado){
Phase.playSound("buttonding.mp3", 0.6);
resource = (resource - TFTower.costTornado);
TFStats.resSpent = (TFStats.resSpent + TFTower.costTornado);
_local2 = new TFTornado(new Vect(pos.x, (pos.y + 50)));
_local2.damage = uint((_local2.damage * towerMult));
towers.children.push(_local2);
stopBuild();
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
hidePlacer = function (_arg1:MouseEvent){
placer.mc.gotoAndStop("none");
placer.mc.visible = false;
};
super("col_circle", Phase.CIRCLE);
setProps(600, 350, 0.6, 0.75, 0);
mc.visible = false;
attachImage("player_mc");
imgOffset.set(0, 38.5);
if (!TFGame.playerGlow){
img[0].body.filters = [];
};
colType = Phase.PLAYER;
colMask = (colMask ^ Phase.ENEMY);
colMask = (colMask ^ Phase.PROJECTILE);
triggerMask = (triggerMask ^ Phase.ENEMY);
triggerMask = (triggerMask ^ Phase.PROJECTILE);
ico = new PEUIObj("player_icon");
Phase.attachUIObj(ico);
lastAnim = "stand";
stance = NONE;
comboPhase = NONE;
maxCombo = KICK;
maxAirCombo = FLIPK;
attackDelay = 0;
moveDelay = 0;
attackDamage = 0;
dmgBoost = 0;
dmgMult = 1;
launchStr = 5;
stunStr = "030";
resource = 750;
towers = new PEPhysObj("");
towers.colType = Phase.PROJECTILE;
Phase.index(towers, true);
towerMult = 1;
respond = function (_arg1:String, _arg2:PEColResult, _arg3:PEPhysObj){
};
bmenu = new PEUIObj("hud_build");
bmenu.mc.visible = false;
Phase.attachUIObj(bmenu);
placer = new PEObj("tower_placer");
placer.mc.visible = false;
placer.mc.blendMode = "screen";
Phase.attachObj(2, placer);
bmenu.mc.vine.addEventListener(MouseEvent.MOUSE_OVER, showVine);
bmenu.mc.vine.addEventListener(MouseEvent.CLICK, buildVine);
bmenu.mc.boulder.addEventListener(MouseEvent.MOUSE_OVER, showboulder);
bmenu.mc.boulder.addEventListener(MouseEvent.CLICK, buildboulder);
bmenu.mc.storm.addEventListener(MouseEvent.MOUSE_OVER, showstorm);
bmenu.mc.storm.addEventListener(MouseEvent.CLICK, buildstorm);
bmenu.mc.tornado.addEventListener(MouseEvent.MOUSE_OVER, showtornado);
bmenu.mc.tornado.addEventListener(MouseEvent.CLICK, buildtornado);
bmenu.mc.vine.addEventListener(MouseEvent.MOUSE_OUT, hidePlacer);
bmenu.mc.boulder.addEventListener(MouseEvent.MOUSE_OUT, hidePlacer);
bmenu.mc.storm.addEventListener(MouseEvent.MOUSE_OUT, hidePlacer);
bmenu.mc.tornado.addEventListener(MouseEvent.MOUSE_OUT, hidePlacer);
umenu = new PEUIObj("hud_upgrade");
umenu.mc.visible = false;
Phase.attachUIObj(umenu);
umenu.mc.bsell.addEventListener(MouseEvent.CLICK, sellTower);
sellTarget = null;
}
public function boostTowers(_arg1:Number){
TFStats.towerBoost = (TFStats.towerBoost * _arg1);
}
public function pounder(){
ho = null;
playAnim("pndstart");
stance = POUND;
comboPhase = NONE;
attackDelay = 999;
moveDelay = 60;
attackDamage = 20;
TFStats.stunned = 0;
if (img[0].scaleX > 0){
vel.set(4, 13);
};
if (img[0].scaleX < 0){
vel.set(-4, 13);
};
}
public function attack(){
if (attackDelay > 0){
return;
};
if ((((stance == BUILD)) || ((stance == UPGRADE)))){
if (((!(bmenu.mc.hitTestPoint(Phase.inp.mousePos.x, Phase.inp.mousePos.y))) && (!(umenu.mc.hitTestPoint(Phase.inp.mousePos.x, Phase.inp.mousePos.y))))){
stopBuild();
return;
};
return;
};
if (state == STAND){
ho = null;
if (comboPhase == NONE){
playAnim("rjab");
stance = RIGHT;
comboPhase = RJAB;
attackDelay = 15;
moveDelay = 36;
attackDamage = 10;
attackImpulse(3, 0);
} else {
if (comboPhase == RJAB){
stance = LEFT;
comboPhase = LJAB;
attackDelay = 15;
moveDelay = 36;
attackDamage = 15;
playAnim("ljab");
attackImpulse(3, 0);
} else {
if (comboPhase == LJAB){
stance = RIGHT;
comboPhase = KICK;
attackDelay = 35;
if (maxCombo == comboPhase){
attackDelay = (attackDelay + 25);
};
moveDelay = 49;
attackDamage = 30;
playAnim("kick");
attackImpulse(2, 0);
} else {
if ((((comboPhase == KICK)) && ((maxCombo > KICK)))){
stance = LEFT;
comboPhase = SMASH;
attackDelay = 30;
if (maxCombo == comboPhase){
attackDelay = (attackDelay + 25);
};
moveDelay = 36;
attackDamage = 50;
playAnim("smash");
attackImpulse(4, 0);
} else {
if ((((comboPhase == SMASH)) && ((maxCombo > SMASH)))){
stance = RIGHT;
comboPhase = SPIN;
attackDelay = 40;
moveDelay = 40;
attackDamage = 70;
playAnim("spin");
attackImpulse(6, 0);
};
};
};
};
};
} else {
if ((((state == FALL)) && ((fallTime > 10)))){
ho = null;
aerialAttack();
};
};
}
public function aerialAttack(){
if (comboPhase == NONE){
playAnim("flipk");
comboPhase = FLIPK;
attackDelay = 20;
moveDelay = 30;
attackDamage = 25;
vel.set(0, 0);
attackImpulse(3, -5);
stance = AIR;
} else {
if ((((comboPhase == FLIPK)) && ((maxAirCombo > FLIPK)))){
playAnim("vaultk");
comboPhase = VAULTK;
attackDelay = 35;
moveDelay = 40;
attackDamage = 50;
vel.set(0, 0);
attackImpulse(3, -7);
stance = AIR;
} else {
if ((((comboPhase == VAULTK)) && ((maxAirCombo > VAULTK)))){
playAnim("hurk");
comboPhase = HURK;
attackDelay = 50;
moveDelay = 50;
attackDamage = 75;
vel.set(0, 0);
attackImpulse(4, -8);
stance = AIR;
};
};
};
}
override public function act(){
var _local1:*;
var _local2:*;
_local1 = 0;
while (_local1 < actions.length) {
_local2 = actions[_local1];
switch (_local2){
case "land":
playAnim("stand");
break;
case "rland":
playAnim("fall2run");
break;
case "quickland":
playAnim("run");
break;
case "rturnl":
playAnim("rturn");
faceDir("l");
break;
case "rturnr":
playAnim("rturn");
faceDir("r");
break;
case "fturnl":
playAnim("fturn");
faceDir("l");
break;
case "fturnr":
playAnim("fturn");
faceDir("r");
break;
case "jump":
if ((((stance == LEFT)) || ((stance == RIGHT)))){
launcher();
} else {
stance = AIR;
playAnim("jump");
};
break;
case "fall":
playAnim("fall");
break;
case "startrun":
playAnim("run");
break;
case "stoprun":
playAnim("run2stand");
break;
};
_local1++;
};
actions = new Array();
}
override public function update(){
var _local1:*;
var _local2:uint;
if (paused){
return;
};
_local1 = ((pos.x - 550) / 3950);
ico.pos.x = (275 + (_local1 * 240));
ico.pos.y = (378 + ((pos.y / 400) * 22));
ico.update();
act();
if (attackDelay > 0){
attackDelay--;
if (attackDelay == 0){
ho = null;
};
if (img[0].body.hit){
img[0].body.hit.visible = false;
if (ho == null){
ho = new PEPhysObj(img[0].body.hit);
ho.triggerMask = (ho.triggerMask ^ Phase.PLAYER);
ho.triggerMask = (ho.triggerMask ^ Phase.PROJECTILE);
_local2 = uint(((attackDamage + dmgBoost) * dmgMult));
if ((((stance == AIR)) && ((((comboPhase == NONE)) && (!((stance == POUND))))))){
ho.tells.push(((("l" + launchStr) + "hit") + _local2));
} else {
if (stance == POUND){
ho.tells.push(((("p" + stunStr) + "hit") + _local2));
} else {
ho.tells.push(("hit" + _local2));
};
};
};
Phase.trigger(ho);
};
};
if (stance == BUILD){
placer.setPos(pos.x, (pos.y + 50));
placer.update();
};
if ((((stance == AIR)) && ((state == STAND)))){
stance = NONE;
};
if ((((((stance == POUND)) && ((state == STAND)))) && ((pstate == FALL)))){
playAnim("pndhit");
};
if (state == STAND){
TFStats.airHits = 0;
};
if (moveDelay > 0){
if (((!((stance == POUND))) || ((state == STAND)))){
moveDelay--;
};
if (moveDelay == 0){
if (state == STAND){
stance = NONE;
playAnim("xstand");
} else {
if (state == FALL){
stance = AIR;
playAnim("xfall");
};
};
comboPhase = NONE;
attackDelay = 0;
attackDamage = 0;
};
};
if (pos.x > 4000){
pos.x = 4000;
};
super.update();
}
public function sellTower(_arg1:MouseEvent){
if (sellTarget == null){
return;
};
sellTarget.sell();
if ((sellTarget is TFVine)){
if (sellTarget.level == 1){
resource = (resource + 75);
} else {
if (sellTarget.level == 2){
resource = (resource + 200);
} else {
if (sellTarget.level == 3){
resource = (resource + 450);
} else {
if (sellTarget.level == 4){
resource = (resource + 1075);
};
};
};
};
} else {
if ((sellTarget is TFBoulder)){
if (sellTarget.level == 1){
resource = (resource + 125);
} else {
if (sellTarget.level == 2){
resource = (resource + 250);
} else {
if (sellTarget.level == 3){
resource = (resource + 750);
} else {
if (sellTarget.level == 4){
resource = (resource + 1750);
};
};
};
};
} else {
if ((sellTarget is TFStorm)){
if (sellTarget.level == 1){
resource = (resource + 150);
} else {
if (sellTarget.level == 2){
resource = (resource + 400);
} else {
if (sellTarget.level == 3){
resource = (resource + 900);
} else {
if (sellTarget.level == 4){
resource = (resource + 1650);
};
};
};
};
} else {
if ((sellTarget is TFTornado)){
if (sellTarget.level == 1){
resource = (resource + 300);
} else {
if (sellTarget.level == 2){
resource = (resource + 550);
} else {
if (sellTarget.level == 3){
resource = (resource + 925);
} else {
if (sellTarget.level == 4){
resource = (resource + 1675);
};
};
};
};
};
};
};
};
sellTarget.level = 0;
sellTarget.img[0].visible = false;
sellTarget = null;
stopBuild();
}
public function buildMenu(){
var closest:*;
var chosen:*;
var i:*;
var tdist:*;
var ti:*;
var ico:*;
var up2:*;
var lv2:Function;
var up3:*;
var lv3:Function;
var up4:*;
var lv4:Function;
var blv2:Function;
var blv3:Function;
var blv4:Function;
var slv2:Function;
var slv3:Function;
var slv4:Function;
var tlv2:Function;
var tlv3:Function;
var tlv4:Function;
if ((((moveDelay == 0)) && ((state == STAND)))){
closest = 125;
chosen = -1;
for (i in towers.children) {
if (towers.children[i].sold){
} else {
tdist = Math.abs((towers.children[i].pos.x - pos.x));
if (tdist < closest){
closest = tdist;
chosen = i;
};
};
};
if (chosen != -1){
ti = towers.children[chosen];
stance = UPGRADE;
umenu.mc.visible = true;
sellTarget = ti;
if ((ti is TFVine)){
umenu.mc.tower.text = "VINE";
ico = new icon_vine();
ico.x = 225;
ico.y = 50;
ico.mouseEnabled = false;
umenu.mc.addChild(ico);
if (ti.level < 2){
lv2 = function (_arg1:MouseEvent){
if (resource >= 250){
Phase.playSound("buttonding.mp3", 0.6);
resource = (resource - 250);
TFStats.resSpent = (TFStats.resSpent + 250);
ti.level = 2;
ti.range = (ti.range + 50);
ti.damage = (ti.damage + 5);
stopBuild();
buildMenu();
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
up2 = new hud_upgrade_vine2();
up2.x = 50;
up2.y = 125;
umenu.mc.addChild(up2);
up2.lv2.addEventListener(MouseEvent.CLICK, lv2);
};
if (ti.level < 3){
up3 = new hud_upgrade_vine3();
up3.x = 50;
up3.y = 200;
umenu.mc.addChild(up3);
if (ti.level == 2){
lv3 = function (_arg1:MouseEvent){
if (resource >= 500){
Phase.playSound("buttonding.mp3", 0.6);
resource = (resource - 500);
TFStats.resSpent = (TFStats.resSpent + 500);
ti.level = 3;
ti.damage = (ti.damage + 15);
ti.speed = (ti.speed - 10);
stopBuild();
buildMenu();
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
up3.lv3.addEventListener(MouseEvent.CLICK, lv3);
} else {
up3.alpha = 0.5;
up3.lv3.visible = false;
};
};
if (ti.level < 4){
up4 = new hud_upgrade_vine4();
up4.x = 50;
up4.y = 275;
umenu.mc.addChild(up4);
if (ti.level == 3){
lv4 = function (_arg1:MouseEvent){
if (resource >= 1250){
Phase.playSound("buttonding.mp3", 0.6);
resource = (resource - 1250);
TFStats.resSpent = (TFStats.resSpent + 1250);
ti.level = 4;
ti.damage = (ti.damage + 50);
ti.range = (ti.range + 40);
stopBuild();
buildMenu();
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
up4.lv4.addEventListener(MouseEvent.CLICK, lv4);
} else {
up4.alpha = 0.5;
up4.lv4.visible = false;
};
};
} else {
if ((ti is TFBoulder)){
umenu.mc.tower.text = "BOULDER";
ico = new icon_boulder();
ico.x = 225;
ico.y = 50;
ico.mouseEnabled = false;
umenu.mc.addChild(ico);
if (ti.level < 2){
blv2 = function (_arg1:MouseEvent){
if (resource >= 250){
Phase.playSound("buttonding.mp3", 0.6);
resource = (resource - 250);
TFStats.resSpent = (TFStats.resSpent + 250);
ti.level = 2;
ti.damage = (ti.damage + 15);
ti.speed = (ti.speed - 10);
stopBuild();
buildMenu();
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
up2 = new hud_upgrade_boulder2();
up2.x = 50;
up2.y = 125;
umenu.mc.addChild(up2);
up2.lv2.addEventListener(MouseEvent.CLICK, blv2);
};
if (ti.level < 3){
up3 = new hud_upgrade_boulder3();
up3.x = 50;
up3.y = 200;
umenu.mc.addChild(up3);
if (ti.level == 2){
blv3 = function (_arg1:MouseEvent){
if (resource >= 1000){
Phase.playSound("buttonding.mp3", 0.6);
resource = (resource - 1000);
TFStats.resSpent = (TFStats.resSpent + 1000);
ti.level = 3;
ti.damage = (ti.damage + 25);
ti.speed = (ti.speed - 10);
stopBuild();
buildMenu();
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
up3.lv3.addEventListener(MouseEvent.CLICK, blv3);
} else {
up3.alpha = 0.5;
up3.lv3.visible = false;
};
};
if (ti.level < 4){
up4 = new hud_upgrade_boulder4();
up4.x = 50;
up4.y = 275;
umenu.mc.addChild(up4);
if (ti.level == 3){
blv4 = function (_arg1:MouseEvent){
if (resource >= 2000){
Phase.playSound("buttonding.mp3", 0.6);
resource = (resource - 2000);
TFStats.resSpent = (TFStats.resSpent + 2000);
ti.level = 4;
ti.speed = (ti.speed - 30);
stopBuild();
buildMenu();
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
up4.lv4.addEventListener(MouseEvent.CLICK, blv4);
} else {
up4.alpha = 0.5;
up4.lv4.visible = false;
};
};
} else {
if ((ti is TFStorm)){
umenu.mc.tower.text = "STORM";
ico = new icon_storm();
ico.x = 225;
ico.y = 50;
ico.mouseEnabled = false;
umenu.mc.addChild(ico);
if (ti.level < 2){
slv2 = function (_arg1:MouseEvent){
if (resource >= 500){
Phase.playSound("buttonding.mp3", 0.6);
resource = (resource - 500);
TFStats.resSpent = (TFStats.resSpent + 500);
ti.level = 2;
ti.damage = (ti.damage + 30);
ti.speed = (ti.speed - 5);
stopBuild();
buildMenu();
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
up2 = new hud_upgrade_storm2();
up2.x = 50;
up2.y = 125;
umenu.mc.addChild(up2);
up2.lv2.addEventListener(MouseEvent.CLICK, slv2);
};
if (ti.level < 3){
up3 = new hud_upgrade_storm3();
up3.x = 50;
up3.y = 200;
umenu.mc.addChild(up3);
if (ti.level == 2){
slv3 = function (_arg1:MouseEvent){
if (resource >= 1000){
Phase.playSound("buttonding.mp3", 0.6);
resource = (resource - 1000);
TFStats.resSpent = (TFStats.resSpent + 1000);
ti.level = 3;
ti.damage = (ti.damage + 30);
ti.speed = (ti.speed - 5);
stopBuild();
buildMenu();
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
up3.lv3.addEventListener(MouseEvent.CLICK, slv3);
} else {
up3.alpha = 0.5;
up3.lv3.visible = false;
};
};
if (ti.level < 4){
up4 = new hud_upgrade_storm4();
up4.x = 50;
up4.y = 275;
umenu.mc.addChild(up4);
if (ti.level == 3){
slv4 = function (_arg1:MouseEvent){
if (resource >= 1500){
Phase.playSound("buttonding.mp3", 0.6);
resource = (resource - 1500);
TFStats.resSpent = (TFStats.resSpent + 2000);
ti.level = 4;
ti.damage = (ti.damage + 30);
ti.speed = (ti.speed - 10);
stopBuild();
buildMenu();
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
up4.lv4.addEventListener(MouseEvent.CLICK, slv4);
} else {
up4.alpha = 0.5;
up4.lv4.visible = false;
};
};
} else {
if ((ti is TFTornado)){
umenu.mc.tower.text = "TORNADO";
ico = new icon_tornado();
ico.x = 225;
ico.y = 50;
ico.mouseEnabled = false;
umenu.mc.addChild(ico);
if (ti.level < 2){
tlv2 = function (_arg1:MouseEvent){
if (resource >= 500){
Phase.playSound("buttonding.mp3", 0.6);
resource = (resource - 500);
TFStats.resSpent = (TFStats.resSpent + 500);
ti.level = 2;
ti.damage = (ti.damage + 5);
TFTornado(ti).levelUp();
stopBuild();
buildMenu();
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
up2 = new hud_upgrade_tornado2();
up2.x = 50;
up2.y = 125;
umenu.mc.addChild(up2);
up2.lv2.addEventListener(MouseEvent.CLICK, tlv2);
};
if (ti.level < 3){
up3 = new hud_upgrade_tornado3();
up3.x = 50;
up3.y = 200;
umenu.mc.addChild(up3);
if (ti.level == 2){
tlv3 = function (_arg1:MouseEvent){
if (resource >= 750){
Phase.playSound("buttonding.mp3", 0.6);
resource = (resource - 750);
TFStats.resSpent = (TFStats.resSpent + 750);
ti.level = 3;
ti.damage = (ti.damage + 8);
TFTornado(ti).levelUp();
stopBuild();
buildMenu();
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
up3.lv3.addEventListener(MouseEvent.CLICK, tlv3);
} else {
up3.alpha = 0.5;
up3.lv3.visible = false;
};
};
if (ti.level < 4){
up4 = new hud_upgrade_tornado4();
up4.x = 50;
up4.y = 275;
umenu.mc.addChild(up4);
if (ti.level == 3){
tlv4 = function (_arg1:MouseEvent){
if (resource >= 1500){
Phase.playSound("buttonding.mp3", 0.6);
resource = (resource - 1500);
TFStats.resSpent = (TFStats.resSpent + 1500);
ti.level = 4;
ti.damage = (ti.damage + 12);
TFTornado(ti).levelUp();
stopBuild();
buildMenu();
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
up4.lv4.addEventListener(MouseEvent.CLICK, tlv4);
} else {
up4.alpha = 0.5;
up4.lv4.visible = false;
};
};
};
};
};
};
umenu.mc.power.text = uint((ti.damage * TFStats.towerBoost));
umenu.mc.speed.text = ti.speed;
control("stop");
vel.zero();
return;
};
if (pos.x > 3400){
Phase.playSound("buttonbuzz.wav", 2);
return;
};
stance = BUILD;
bmenu.mc.visible = true;
control("stop");
vel.zero();
};
}
override public function unpause(_arg1:Boolean=false){
ico.mc.visible = true;
super.unpause(_arg1);
if (stance == BUILD){
bmenu.mc.visible = true;
} else {
if (stance == UPGRADE){
umenu.mc.visible = true;
};
};
}
override public function unload(){
Phase.destroy(ico);
Phase.destroy(towers);
Phase.destroy(placer);
Phase.destroy(bmenu);
Phase.destroy(umenu);
}
public function reloadTower(_arg1:Array){
var _local2:*;
trace(_arg1);
if (_arg1[0] == "vine"){
_local2 = new TFVine(new Vect(_arg1[5], _arg1[6]));
} else {
if (_arg1[0] == "boulder"){
_local2 = new TFBoulder(new Vect(_arg1[5], _arg1[6]));
} else {
if (_arg1[0] == "storm"){
_local2 = new TFStorm(new Vect(_arg1[5], _arg1[6]));
} else {
if (_arg1[0] == "tornado"){
_local2 = new TFTornado(new Vect(_arg1[5], _arg1[6]));
};
};
};
};
_local2.level = _arg1[1];
_local2.damage = _arg1[2];
_local2.speed = _arg1[3];
_local2.range = _arg1[4];
towers.children.push(_local2);
}
public function boostStun(){
if (stunStr == "030"){
stunStr = "060";
launchStr = 7;
} else {
if (stunStr == "060"){
stunStr = "090";
launchStr = 9;
};
};
}
override public function playAnim(_arg1:String){
if (_arg1 == "xstand"){
lastAnim = "stand";
bIsRunning = false;
return;
};
if (_arg1 == "xfall"){
lastAnim = "fall";
return;
};
if ((((((((((((((lastAnim == "rjab")) || ((lastAnim == "ljab")))) || ((lastAnim == "kick")))) || ((lastAnim == "smash")))) || ((lastAnim == "spin")))) || ((lastAnim == "pndstart")))) || ((lastAnim == "pndhit")))){
if (((((((((((((((((((!((_arg1 == "rjab"))) && (!((_arg1 == "ljab"))))) && (!((_arg1 == "kick"))))) && (!((_arg1 == "smash"))))) && (!((_arg1 == "spin"))))) && (!((_arg1 == "ucut"))))) && (!((_arg1 == "flipk"))))) && (!((_arg1 == "vaultk"))))) && (!((_arg1 == "hurk"))))) && (!((_arg1 == "pndhit"))))){
return;
};
};
if ((((_arg1 == "pndhit")) && ((lastAnim == "pndhit")))){
return;
};
if (_arg1 == "stand"){
if ((((((((((lastAnim == "fall")) || ((lastAnim == "jump")))) || ((lastAnim == "wjump")))) || ((lastAnim == "fturn")))) || ((lastAnim == "ledgepop")))){
img[0].body.gotoAndStop("fall2stand");
} else {
if (lastAnim == "run"){
img[0].body.gotoAndStop("run2stand");
} else {
img[0].body.gotoAndStop("stand");
};
};
} else {
if (_arg1 == "run"){
if (lastAnim == "stand"){
img[0].body.gotoAndStop("stand2run");
} else {
if ((((lastAnim == "rturn")) || ((lastAnim == "run")))){
} else {
if (lastAnim == "fall"){
img[0].body.gotoAndStop("run");
} else {
if (lastAnim == "jump"){
img[0].body.gotoAndStop("fall2run");
} else {
if (lastAnim == "run"){
} else {
img[0].body.gotoAndStop("stand2run");
};
};
};
};
};
} else {
if (_arg1 == "jump"){
if (lastAnim == "stand"){
img[0].body.gotoAndStop("stand2jump");
} else {
img[0].body.gotoAndStop("stand2jump");
};
} else {
if (_arg1 == "wslide"){
img[0].body.gotoAndStop("fall2wslide");
} else {
if (_arg1 == "fall"){
if (lastAnim == "ledgepop"){
return;
};
img[0].body.gotoAndStop("run2fall");
} else {
if (_arg1 == "run2stand"){
if (lastAnim == "run2stand"){
} else {
img[0].body.gotoAndStop("run2stand");
};
} else {
if (_arg1 == "ledgepop"){
img[0].body.gotoAndStop("ledgepop");
} else {
if (_arg1 == "fturn"){
if (lastAnim == "ledgepop"){
_arg1 = "ledgepop";
} else {
img[0].body.gotoAndStop("fturn");
};
} else {
img[0].body.gotoAndStop(_arg1);
};
};
};
};
};
};
};
};
lastAnim = _arg1;
}
public function stopBuild(){
var child:*;
var i:*;
if (stance == BUILD){
bmenu.mc.visible = false;
placer.mc.visible = false;
stance = NONE;
} else {
if (stance == UPGRADE){
umenu.mc.visible = false;
stance = NONE;
try {
i = 0;
while (i < 1000) {
child = umenu.mc.getChildAt(i);
if ((child is TFUpgradeIcon)){
umenu.mc.removeChild(child);
i = (i - 1);
};
i = (i + 1);
};
} catch(error:Error) {
};
};
};
}
public function attackImpulse(_arg1:Number, _arg2:Number){
var _local3:String;
var _local4:Vect;
_local3 = "";
if (_arg1 != 0){
if (((Phase.keyHeld(39)) || (Phase.keyHeld(68)))){
_local3 = "r";
_arg1 = (_arg1 * 2);
} else {
if (((Phase.keyHeld(37)) || (Phase.keyHeld(65)))){
_local3 = "l";
_arg1 = (_arg1 * -2);
} else {
if (img[0].scaleX > 0){
_local3 = "r";
} else {
if (img[0].scaleX < 0){
_local3 = "l";
_arg1 = (_arg1 * -1);
};
};
};
};
};
_local4 = gravNorm.copy();
_local4.rotate(-90);
_local4 = _local4.mult(_arg1);
vel = vel.addv(_local4);
accel(0, _arg2);
faceDir(_local3);
}
public function launcher(){
ho = null;
playAnim("ucut");
stance = AIR;
comboPhase = NONE;
attackDelay = 25;
moveDelay = 39;
attackDamage = 10;
TFStats.launched = 0;
vel.set(0, 0);
attackImpulse(1, jumpStr);
}
override public function input(){
clearCommands();
if (stance != POUND){
if (((((((((Phase.keyHeld(1)) || (Phase.keyHeld(69)))) || (Phase.keyHeld(17)))) || (Phase.keyHeld(163)))) || (Phase.keyHeld(162)))){
attack();
};
if (((((Phase.keyTap(38)) || (Phase.keyTap(32)))) || (Phase.keyTap(87)))){
control("jump");
};
if (((((Phase.keyHeld(38)) || (Phase.keyHeld(32)))) || (Phase.keyHeld(87)))){
control("boost");
} else {
lastJump = 0;
};
};
if ((((comboPhase == NONE)) && ((((stance == NONE)) || ((stance == AIR)))))){
if (((Phase.keyHeld(37)) || (Phase.keyHeld(65)))){
control("move", "l");
} else {
if (((Phase.keyHeld(39)) || (Phase.keyHeld(68)))){
control("move", "r");
} else {
if (((((((Phase.keyReleased(37)) || (Phase.keyReleased(39)))) || (Phase.keyReleased(65)))) || (Phase.keyReleased(68)))){
control("stop");
};
};
};
};
if ((((stance == AIR)) && ((state == FALL)))){
if (((Phase.keyTap(40)) || (Phase.keyTap(83)))){
pounder();
};
};
if ((((stance == BUILD)) || ((stance == UPGRADE)))){
if (((((((((((((((((Phase.keyTap(40)) || (Phase.keyTap(83)))) || (Phase.keyTap(37)))) || (Phase.keyTap(65)))) || (Phase.keyTap(39)))) || (Phase.keyTap(68)))) || (Phase.keyTap(38)))) || (Phase.keyTap(32)))) || (Phase.keyTap(87)))){
stopBuild();
};
};
if ((((comboPhase == NONE)) && ((stance == NONE)))){
if (((Phase.keyTap(40)) || (Phase.keyTap(83)))){
buildMenu();
};
};
}
override public function pause(_arg1:Boolean=false){
super.pause(_arg1);
ico.mc.visible = false;
if (bmenu.mc.visible){
bmenu.mc.visible = false;
};
if (umenu.mc.visible){
umenu.mc.visible = false;
};
}
}
}//package
Section 148
//TFEnemy (TFEnemy)
package {
import flash.filters.*;
public class TFEnemy extends PEChar {
public var health:int;
public var bTargeted:Boolean;
public var hbar:PEObj;
public var ico:PEUIObj;
public var stun:uint;
public var maxhealth:int;
public var slowMult:Number;// = 1
public var removeCount:uint;
public var bBoss:Boolean;
public var hoffset:int;
public var burst:PEObj;
public var hits:Array;
public var bScore:Boolean;
public var value:uint;
public var meleeHit:Boolean;
public var bAlive:Boolean;
public var bAir:Boolean;
public var stunres:uint;
public var activeCount:uint;
private var lastAnim:String;
public static var lastSnd:uint = 9999;
public static var lastHit:uint = 0;
public function TFEnemy(_arg1, _arg2:uint){
var clip = _arg1;
var col = _arg2;
slowMult = 1;
super(clip, col);
bBoss = false;
bScore = false;
bAir = false;
colType = Phase.ENEMY;
colMask = (colMask ^ Phase.ENEMY);
colMask = (colMask ^ Phase.PLAYER);
colMask = (colMask ^ Phase.PROJECTILE);
triggerMask = (triggerMask ^ Phase.ENEMY);
triggerMask = (triggerMask ^ Phase.PLAYER);
ico = new PEUIObj("nme_icon");
Phase.attachUIObj(ico);
hbar = new PEObj("nme_health");
Phase.attachObj(3, hbar);
hbar.mc.visible = false;
lastAnim = "stand";
bAlive = true;
bTargeted = false;
stun = 0;
stunres = 5;
hits = new Array();
removeCount = 0;
activeCount = 0;
burst = null;
jumpStr = -9;
respond = function (_arg1:String, _arg2:PEColResult, _arg3:PEPhysObj){
var _local4:*;
var _local5:uint;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
if (_arg1 == "end"){
explode();
} else {
if (_arg1 == "warn"){
if (bAlive){
TFGame.warn();
};
};
};
_local4 = _arg1.indexOf("hit");
if (_local4 != -1){
if (bAlive){
if (!alreadyHit(_arg3.id)){
_local5 = uint(_arg1.substring((_local4 + 3)));
meleeHit = false;
_local6 = _arg1.charAt(0);
if (_local6 == "b"){
_local7 = (uint(_arg1.charAt(1)) * 12);
if (_local7 == 48){
_local7 = (_local7 + 6);
};
_local7 = (_local7 + 25);
_local7 = (_local7 - stunres);
if (Phase.rand(0, 100) < _local7){
stun = 65;
playAnim("stun");
};
_local5 = uint((_local5 * TFStats.towerBoost));
_local5 = (_local5 * (0.5 + _arg3.sca.x));
TFStats.dmgTower = (TFStats.dmgTower + _local5);
} else {
if (_local6 == "v"){
if (!bAir){
_local8 = (pos.y / 325);
_local5 = uint((_local5 * TFStats.towerBoost));
_local5 = (_local5 * _local8);
TFStats.dmgTower = (TFStats.dmgTower + _local5);
} else {
_local8 = (pos.y / 500);
_local5 = uint((_local5 * TFStats.towerBoost));
_local5 = (_local5 * _local8);
TFStats.dmgTower = (TFStats.dmgTower + _local5);
};
vel.x = (vel.x * 0.5);
TFVineProj(_arg3).snags++;
} else {
if (_local6 == "s"){
if (!bAir){
_local8 = ((250 - pos.y) / 250);
_local5 = uint((_local5 * TFStats.towerBoost));
_local5 = (_local5 * _local8);
TFStats.dmgTower = (TFStats.dmgTower + _local5);
} else {
_local8 = ((400 - pos.y) / 400);
_local5 = uint((_local5 * TFStats.towerBoost));
_local5 = (_local5 * _local8);
TFStats.dmgTower = (TFStats.dmgTower + _local5);
};
} else {
if (_local6 == "t"){
_local9 = (0.2 + (uint(_arg1.charAt(1)) * 0.1));
slowMult = (1 - _local9);
vel = vel.mult((1 - _local9));
_local5 = uint((_local5 * TFStats.towerBoost));
TFStats.dmgTower = (TFStats.dmgTower + _local5);
} else {
if (_local6 == "l"){
vel.set(0, -(uint(_arg1.charAt(1))));
playAnim("recoil");
TFStats.dmgMelee = (TFStats.dmgMelee + _local5);
TFStats.launched++;
if (TFStats.launched >= 8){
TFGame.challenge("chal_getoverthere");
};
meleeHit = true;
} else {
if (_local6 == "p"){
_local10 = uint(_arg1.substring(1, 4));
_local7 = 85;
if (TFStats.mode == "easy"){
_local7 = (_local7 + 10);
};
if (TFStats.mode == "hard"){
_local7 = (_local7 - 10);
};
_local7 = (_local7 - uint((stunres * 0.85)));
if (Phase.rand(0, 100) < _local7){
stun = _local10;
playAnim("stun");
TFStats.stunned++;
if (TFStats.stunned >= 8){
TFGame.challenge("chal_stunner");
};
};
TFStats.dmgMelee = (TFStats.dmgMelee + _local5);
meleeHit = true;
} else {
vel.x = (vel.x * 0.25);
TFStats.dmgMelee = (TFStats.dmgMelee + _local5);
meleeHit = true;
if (_local5 > 9000){
TFGame.challenge("chal_scoutersays");
};
TFStats.airHits++;
if (TFStats.airHits >= 20){
TFGame.challenge("chal_anime");
};
};
};
};
};
};
};
health = (health - _local5);
hbar.mc.bar.width = ((health / maxhealth) * 50);
hbar.mc.visible = true;
TFGame.showDamage(pos, _local5);
if (health <= 0){
TFStats.kills++;
if (bScore){
TFStats.killsScore++;
if (TFStats.killsScore >= 30){
TFGame.challenge("chal_wontsurvive");
};
};
if (meleeHit){
if (TFStats.mode != "easy"){
TFStats.killsMelee++;
if (TFStats.killsMelee >= 200){
TFGame.challenge("chal_spikepunch");
};
if (TFStats.killsMelee >= 1000){
TFGame.challenge("chal_superb");
};
};
};
TFStats.score = (TFStats.score + value);
death();
};
if (meleeHit){
_local11 = Phase.rand(0, 5, true);
if (_local11 == TFEnemy.lastSnd){
++_local11;
if (_local11 == 5){
_local11 = 0;
};
};
TFEnemy.lastSnd = _local11;
_local12 = (0.2 + (TFEnemy.lastHit / 30));
if (_local12 > 1){
_local12 = 1;
};
_local12 = (_local12 * 0.8);
switch (_local11){
case 0:
Phase.playSound("hit1.mp3", (0.2 * _local12));
break;
case 1:
Phase.playSound("hit2.mp3", (0.25 * _local12));
break;
case 2:
Phase.playSound("hit3.mp3", (0.2 * _local12));
break;
case 3:
Phase.playSound("hit4.mp3", (0.15 * _local12));
break;
case 4:
Phase.playSound("hit5.mp3", (0.15 * _local12));
break;
};
lastHit = 0;
};
};
};
};
};
}
public function alreadyHit(_arg1:uint){
var _local2:*;
for (_local2 in hits) {
if (hits[_local2] == _arg1){
return (true);
};
};
hits.push(_arg1);
return (false);
}
public function behave(){
}
public function death(){
vel.set(0, 0);
playAnim("die");
bAlive = false;
control("stop");
img[0].body.filters = [];
ico.mc.visible = false;
hbar.mc.visible = false;
}
override public function act(){
var _local1:*;
var _local2:*;
if (!bAlive){
return;
};
_local1 = 0;
while (_local1 < actions.length) {
_local2 = actions[_local1];
switch (_local2){
case "jump":
playAnim("jump");
break;
};
_local1++;
};
actions = new Array();
}
public function adjustDifficulty(){
if (TFStats.mode == "easy"){
health = (health - 5);
maxhealth = (maxhealth - 5);
speed = (speed - 0.25);
} else {
if (TFStats.mode == "hard"){
health = (health + 10);
maxhealth = (maxhealth + 10);
speed = (speed + 0.75);
};
};
}
override public function update(){
var _local1:*;
var _local2:*;
var _local3:*;
if (paused){
return;
};
_local1 = ((pos.x - 550) / 3950);
ico.pos.x = (275 + (_local1 * 240));
ico.pos.y = (378 + ((pos.y / 400) * 22));
ico.update();
behave();
act();
_local2 = speed;
_local3 = acc;
speed = (speed * slowMult);
acc = (acc * slowMult);
super.update();
acc = _local3;
speed = _local2;
if (slowMult < 1){
slowMult = (slowMult + 0.04);
};
hbar.pos.x = pos.x;
hbar.pos.y = (pos.y - hoffset);
hbar.update();
if (!bAlive){
hbar.mc.visible = false;
updateImages();
activeCount++;
if (activeCount > 80){
bActive = false;
bGrav = false;
};
};
}
public function explode(){
var _local1:*;
death();
bActive = false;
bTargeted = true;
playAnim("explode");
removeCount = 10;
TFTree.hurt();
burst = new PEObj("death_sparks");
burst.setPosv(pos);
burst.rot = Phase.rand(0, 360);
burst.sca.set(2, 2);
_local1 = new GlowFilter();
_local1.color = 0xFFFFFF;
_local1.blurX = 16;
_local1.blurY = 16;
_local1.strength = 2;
burst.mc.filters = [_local1];
Phase.attachObj(6, burst);
Phase.playPosSound("explode.mp3", pos, 1.2);
}
override public function unpause(_arg1:Boolean=false){
ico.mc.visible = true;
hbar.mc.visible = true;
super.unpause(_arg1);
}
override public function unload(){
Phase.destroy(ico);
Phase.destroy(hbar);
if (burst != null){
Phase.destroy(burst);
};
}
override public function playAnim(_arg1:String){
if ((((_arg1 == "run")) && ((lastAnim == "recoil")))){
return;
};
img[0].body.gotoAndStop(_arg1);
lastAnim = _arg1;
}
override public function pause(_arg1:Boolean=false){
super.pause(_arg1);
ico.mc.visible = false;
hbar.mc.visible = false;
}
}
}//package
Section 149
//TFFaery (TFFaery)
package {
public class TFFaery extends PEObj {
var target:TFEnemy;
var count:uint;
var state:String;
var res:uint;
var focus:Vect;
public function TFFaery(){
var _local1:*;
super("faery");
_local1 = ((0.5 * Math.random()) + 0.5);
setScale((1.5 * _local1), (1.5 * _local1));
if (Math.random() < 0.5){
sca.x = (sca.x * -1);
};
setPos((Math.random() * 600), (Math.random() * 400));
focus = new Vect(((700 * Math.random()) + 100), (400 * Math.random()));
mc.blendMode = "screen";
state = "idle";
count = 0;
res = 0;
}
override public function update(){
var _local1:*;
if (paused){
return;
};
if (state == "idle"){
_local1 = focus.subv(pos);
if ((((_local1.rawmag() < 100)) && ((Math.random() < 0.05)))){
focus.set(((700 * Math.random()) + 100), (400 * Math.random()));
};
_local1 = _local1.mult(0.001);
_local1.rotate((5 - (Math.random() * 10)));
vel = vel.addv(_local1);
vel = vel.mult(0.95);
} else {
if (state == "seek"){
if (target.mc == null){
state = "idle";
return;
};
_local1 = target.pos.subv(pos);
if (_local1.x > 100){
_local1.y = (50 - pos.y);
};
if (_local1.rawmag() < 500){
state = "harvest";
count = 30;
} else {
if (_local1.rawmag() < 10000){
vel = vel.mult(0.8);
} else {
vel = vel.mult(0.95);
};
};
_local1 = _local1.mult(0.005);
vel = vel.addv(_local1);
if (vel.rawmag() > 324){
vel = vel.norm().mult(18);
};
} else {
if (state == "harvest"){
if (target.mc == null){
state = "idle";
return;
};
vel.set(0, 0);
count--;
target.img[0].alpha = (target.img[0].alpha - 0.03);
if (count == 0){
state = "idle";
Phase.destroy(target);
};
};
};
};
super.update();
}
override public function pause(_arg1:Boolean=false){
super.pause(_arg1);
mc.stop();
}
override public function unpause(_arg1:Boolean=false){
super.unpause(_arg1);
mc.play();
}
}
}//package
Section 150
//TFFlyEnemy (TFFlyEnemy)
package {
public class TFFlyEnemy extends TFEnemy {
public function TFFlyEnemy(_arg1, _arg2:uint){
super(_arg1, _arg2);
bAir = true;
}
override public function act(){
var _local1:*;
var _local2:*;
if (!bAlive){
return;
};
_local1 = 0;
while (_local1 < actions.length) {
_local2 = actions[_local1];
switch (_local2){
};
_local1++;
};
actions = new Array();
}
}
}//package
Section 151
//TFGame (TFGame)
package {
import flash.events.*;
import flash.utils.*;
import mochi.*;
import flash.media.*;
import flash.filters.*;
import flash.net.*;
public class TFGame extends PEObj {
public const MID:uint = 2;
public const MENU:uint = 0;
public const OVER:uint = 3;
public const TUT:uint = 4;
public const GAME:uint = 1;
public var bLoaded:Boolean;
public var tut:PEUIObj;
public var mute:Boolean;// = false
public var music:PESoundObj;
public var playerGlow:GlowFilter;
public var tips:TFTips;
public var hudover:PEUIObj;
public var overlay:PESoundObj;
public var hudrnd:PEUIObj;
public var menu:PEUIObj;
public var map:PEPhysObj;
public var overvol:Number;
public var state:uint;
public var round:TFRounds;
public var tree:TFTree;
public var hudbar:PEUIObj;
public var hudchal:PEUIObj;// = null
public var hudup:PEUIObj;
public var player:TFChar;
public var clicks:uint;
public var game:PEPhysObj;
public static var chals:Array = new Array();
public static var numbers:PEObj;
public static var flashPhase:int;
public static var playerGlow:Boolean = true;
public static var nmeGlow:Boolean = true;
public static var showTips:Boolean = true;
public function TFGame(){
hudchal = null;
mute = false;
super("");
Phase.index(this);
TFStats.load();
state = MENU;
loadMenu();
loadMap();
Phase.showPhys(false);
playerGlow = new GlowFilter();
playerGlow.color = 0xFF00;
playerGlow.blurX = 16;
playerGlow.blurY = 16;
playerGlow.strength = 1;
music = new PESoundObj("Music_Base.mp3");
music.positional = false;
music.bMusic = true;
music.adjust(PESoundScape.musicvol, 9999, 9999);
Phase.index(music);
overvol = 0;
overlay = new PESoundObj("Music_Overlay.mp3");
overlay.positional = false;
overlay.bMusic = true;
overlay.adjust((PESoundScape.musicvol * overvol), 9999, 9999);
Phase.index(overlay);
music.play(99999);
overlay.play(99999);
}
public function showHUDUpgrade(){
TFStats.save();
if (round.round == 21){
if (clicks < 100){
TFGame.challenge("chal_click100");
};
if (clicks > 2000){
TFGame.challenge("chal_click2000");
};
};
if (round.round == 30){
TFGame.challenge("chal_ultimate");
if (TFTree.life == 1){
TFGame.challenge("chal_lastguy");
};
};
if (round.round == 31){
if (TFStats.mode == "easy"){
TFGame.challenge("chal_easy");
} else {
if (TFStats.mode == "normal"){
TFGame.challenge("chal_normal");
} else {
if (TFStats.mode == "hard"){
TFGame.challenge("chal_hard");
};
};
};
if (player.towers.children.length == 0){
TFGame.challenge("chal_tdsucks");
};
if (TFStats.dmgMelee == 0){
TFGame.challenge("chal_smashpansies");
};
};
if (round.round == 32){
TFStats.clearGame();
showHUDOver();
return;
};
state = MID;
round.state = "midround";
hudup.mc.visible = true;
hudup.mc.gotoAndPlay(1);
hudup.mc.buy.bsave.visible = true;
hudup.mc.buy.save_msg.text = "Save";
player.clearCommands();
player.control("stop");
player.stopBuild();
player.bBlockInput = true;
if (round.round == 31){
hudup.mc.gotoAndPlay("gamecomp");
};
if (player.maxCombo == TFChar.SPIN){
hudup.mc.buy.gcombo.visible = false;
hudup.mc.buy.text_gcombo.text = "";
};
if (player.maxAirCombo == TFChar.HURK){
hudup.mc.buy.acombo.visible = false;
hudup.mc.buy.text_acombo.text = "";
};
if (player.speed == 12){
hudup.mc.buy.sboost.visible = false;
hudup.mc.buy.text_sboost.text = "";
};
}
public function showMenu(){
var _local1:SharedObject;
menu.mc.visible = true;
if (TFStats.bSave){
menu.mc.modes.resume.bresume.mouseEnabled = true;
menu.mc.modes.resume.alpha = 1;
_local1 = SharedObject.getLocal("toweringforever_data", "/", false);
menu.mc.modes.resume.save_details.text = ((("mode: " + _local1.data.mode) + " round: ") + _local1.data.round);
};
}
public function loadGame(){
var startRound:Function;
startRound = function (_arg1:Event){
round.startRound();
hudrnd.mc.visible = false;
};
if (bLoaded){
unloadGame();
};
bLoaded = true;
TFStats.reset();
hudbar = new PEUIObj("hud");
Phase.attachUIObj(hudbar);
TFGame.flashPhase = 0;
loadHUDUpgrade();
loadHUDOver();
hudrnd = new PEUIObj("hud_round");
hudrnd.setPos(700, 0);
Phase.attachUIObj(hudrnd);
hudrnd.mc.bStart.addEventListener(MouseEvent.CLICK, startRound);
numbers = new PEObj("");
Phase.attachObj(6, numbers);
Phase.index(numbers);
game = new PEPhysObj("");
Phase.index(game, true);
player = new TFChar();
Phase.attachObj(4, player);
Phase.parent(player, game);
round = new TFRounds();
round.beams.push(map.mc.spalit1);
round.beams.push(map.mc.spalit2);
round.beams.push(map.mc.spalit3);
Phase.parent(round.nmes, game);
tips = new TFTips();
}
function skipTut(_arg1:Event){
state = GAME;
tut.mc.stop();
tut.mc.visible = false;
}
public function pauseGame(){
game.pause(true);
player.towers.pause(true);
tree.pause(true);
showMenu();
menu.mc.gotoAndStop("pause");
menu.mc.pause.btopres.visible = true;
menu.mc.pause.topres.text = "Resume Game";
state = MENU;
hudbar.mc.visible = false;
hudrnd.mc.visible = false;
hudup.mc.visible = false;
tips.hide();
}
public function hideMenuPanels(){
menu.mc.gotoAndStop("blank");
}
public function updateChallenges(){
var _local1:*;
_local1 = 0;
while (_local1 < 10) {
if (TFStats.chals[_local1]){
menu.mc.chal.page1[("c" + _local1)].alpha = 1;
} else {
menu.mc.chal.page1[("c" + _local1)].alpha = 0.55;
};
_local1++;
};
_local1 = 10;
while (_local1 < 18) {
if (TFStats.chals[_local1]){
menu.mc.chal.page2[("c" + _local1)].alpha = 1;
} else {
menu.mc.chal.page2[("c" + _local1)].alpha = 0.55;
};
_local1++;
};
}
public function updateFaeries(){
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = round.getDead();
for (_local2 in _local1) {
enemyDeath(_local1[_local2]);
};
for (_local2 in tree.fae) {
_local3 = tree.fae[_local2];
if (_local3.res > 0){
if (_local3.res < 40){
_local3.res--;
player.resource++;
TFStats.resFound++;
} else {
if (_local3.res < 120){
_local3.res = (_local3.res - 2);
player.resource = (player.resource + 2);
TFStats.resFound = (TFStats.resFound + 2);
} else {
_local3.res = (_local3.res - 5);
player.resource = (player.resource + 5);
TFStats.resFound = (TFStats.resFound + 5);
};
};
};
};
}
public function playGame(){
loadGame();
hideMenu();
state = TUT;
clicks = 0;
}
public function loadMenu(){
var playButton:Function;
var tutButton:Function;
var opButton:Function;
var chalButton:Function;
var loadSite:Function;
var playEasy:Function;
var playNormal:Function;
var playHard:Function;
var loadGame:Function;
var basicsButton:Function;
var controlsButton:Function;
var buildButton:Function;
var wglowCheck:Function;
var pglowCheck:Function;
var eglowCheck:Function;
var ctipsCheck:Function;
var volUpdates:Function;
var resume:Function;
var loadBubblePause:Function;
var closeChal:Function;
var chalPage1:Function;
var chalPage2:Function;
playButton = function (_arg1:Event){
menu.mc.gotoAndStop("play");
};
tutButton = function (_arg1:Event){
menu.mc.gotoAndStop("tut");
};
opButton = function (_arg1:Event){
menu.mc.gotoAndStop("op");
};
chalButton = function (_arg1:Event){
menu.mc.gotoAndStop("chal");
updateChallenges();
};
loadSite = function (_arg1:Event){
navigateToURL(new URLRequest("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1173&subid=moregames"), "_blank");
};
playEasy = function (_arg1:Event){
playGame();
TFStats.mode = "easy";
showTut();
};
playNormal = function (_arg1:Event){
playGame();
TFStats.mode = "normal";
showTut();
};
playHard = function (_arg1:Event){
playGame();
TFStats.mode = "hard";
showTut();
};
loadGame = function (_arg1:Event){
playGame();
TFStats.loadGame(player, round, hudup.mc.buy);
showHUDRound();
};
basicsButton = function (_arg1:Event){
menu.mc.tut.gotoAndStop("basics");
};
controlsButton = function (_arg1:Event){
menu.mc.tut.gotoAndStop("control");
};
buildButton = function (_arg1:Event){
menu.mc.tut.gotoAndStop("build");
};
wglowCheck = function (_arg1:MouseEvent){
if (_arg1.target.currentLabel == "unchecked"){
_arg1.target.gotoAndStop("checked");
map.mc.glow.visible = true;
} else {
_arg1.target.gotoAndStop("unchecked");
map.mc.glow.visible = false;
};
};
pglowCheck = function (_arg1:MouseEvent){
if (_arg1.target.currentLabel == "unchecked"){
_arg1.target.gotoAndStop("checked");
TFGame.playerGlow = true;
if (player != null){
player.img[0].body.filters = [playerGlow];
};
} else {
_arg1.target.gotoAndStop("unchecked");
TFGame.playerGlow = false;
if (player != null){
player.img[0].body.filters = [];
};
};
};
eglowCheck = function (_arg1:MouseEvent){
if (_arg1.target.currentLabel == "unchecked"){
_arg1.target.gotoAndStop("checked");
TFGame.nmeGlow = true;
if (round != null){
round.glow();
};
} else {
_arg1.target.gotoAndStop("unchecked");
TFGame.nmeGlow = false;
if (round != null){
round.glow();
};
};
};
ctipsCheck = function (_arg1:MouseEvent){
if (_arg1.target.currentLabel == "unchecked"){
_arg1.target.gotoAndStop("checked");
TFGame.showTips = true;
} else {
_arg1.target.gotoAndStop("unchecked");
TFGame.showTips = false;
};
};
volUpdates = function (_arg1:Event):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:SoundTransform;
_local2 = menu.mc.op.masvol;
if (_local2.updated){
_local5 = SoundMixer.soundTransform;
_local5.volume = (_local2.val * 2);
SoundMixer.soundTransform = _local5;
_local2.updated = false;
};
_local3 = menu.mc.op.musvol;
_local4 = menu.mc.op.effvol;
if (_local3.updated){
PESoundScape.musicvol = (_local3.val * 2);
_local3.updated = false;
};
if (_local4.updated){
PESoundScape.effectvol = (_local4.val * 2);
_local4.updated = false;
};
};
resume = function (_arg1:Event){
resumeGame();
};
loadBubblePause = function (_arg1:Event){
navigateToURL(new URLRequest("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1173&subid=pause_scr"), "_blank");
};
closeChal = function (_arg1:Event){
menu.mc.gotoAndStop("blank");
};
chalPage1 = function (_arg1:Event){
menu.mc.chal.gotoAndStop("page1");
};
chalPage2 = function (_arg1:Event){
menu.mc.chal.gotoAndStop("page2");
};
menu = new PEUIObj("menu");
Phase.attachUIObj(menu);
menu.mc.bplay.addEventListener(MouseEvent.CLICK, playButton);
menu.mc.btut.addEventListener(MouseEvent.CLICK, tutButton);
menu.mc.bop.addEventListener(MouseEvent.CLICK, opButton);
menu.mc.bchal.addEventListener(MouseEvent.CLICK, chalButton);
menu.mc.bmoregames.addEventListener(MouseEvent.CLICK, loadSite);
menu.mc.modes.beasy.addEventListener(MouseEvent.CLICK, playEasy);
menu.mc.modes.bnorm.addEventListener(MouseEvent.CLICK, playNormal);
menu.mc.modes.bhard.addEventListener(MouseEvent.CLICK, playHard);
menu.mc.modes.resume.bresume.addEventListener(MouseEvent.CLICK, loadGame);
menu.mc.tut.bbasics.addEventListener(MouseEvent.CLICK, basicsButton);
menu.mc.tut.bcontrols.addEventListener(MouseEvent.CLICK, controlsButton);
menu.mc.tut.bbuild.addEventListener(MouseEvent.CLICK, buildButton);
menu.mc.op.wglow.buttonMode = (menu.mc.op.wglow.useHandCursor = true);
menu.mc.op.pglow.buttonMode = (menu.mc.op.pglow.useHandCursor = true);
menu.mc.op.eglow.buttonMode = (menu.mc.op.eglow.useHandCursor = true);
menu.mc.op.ctips.buttonMode = (menu.mc.op.ctips.useHandCursor = true);
menu.mc.op.wglow.addEventListener(MouseEvent.CLICK, wglowCheck);
menu.mc.op.pglow.addEventListener(MouseEvent.CLICK, pglowCheck);
menu.mc.op.eglow.addEventListener(MouseEvent.CLICK, eglowCheck);
menu.mc.op.ctips.addEventListener(MouseEvent.CLICK, ctipsCheck);
menu.mc.op.addEventListener(Event.ENTER_FRAME, volUpdates);
menu.mc.pause.btopres.visible = false;
menu.mc.pause.bresume.addEventListener(MouseEvent.CLICK, resume);
menu.mc.pause.btopres.addEventListener(MouseEvent.CLICK, resume);
menu.mc.pause.bbubble.addEventListener(MouseEvent.CLICK, loadBubblePause);
menu.mc.chal.bclose.addEventListener(MouseEvent.CLICK, closeChal);
menu.mc.chal.bpage1.addEventListener(MouseEvent.CLICK, chalPage1);
menu.mc.chal.bpage2.addEventListener(MouseEvent.CLICK, chalPage2);
if (!TFStats.bSave){
menu.mc.modes.resume.bresume.mouseEnabled = false;
menu.mc.modes.resume.alpha = 0.5;
menu.mc.modes.resume.save_details.text = "No saved games available";
} else {
showMenu();
};
}
public function endGame(){
pauseGame();
unloadGame();
menu.mc.gotoAndStop("blank");
menu.mc.pause.btopres.visible = false;
menu.mc.pause.topres.text = "";
}
public function updateHUD(){
var _local1:uint;
var _local2:String;
var _local3:*;
var _local4:Class;
var _local5:*;
_local1 = (10 * (20 - TFTree.life));
hudbar.mc.eraselife.width = _local1;
_local2 = String(player.resource);
while (_local2.length < 5) {
_local2 = ("0" + _local2);
};
hudbar.mc.erase.res.text = _local2;
if ((((round.state == "play")) && (round.allDead()))){
showHUDUpgrade();
};
if (TFGame.showTips){
tips.update();
} else {
tips.hide();
};
if (TFGame.flashPhase > 0){
TFGame.flashPhase--;
hudbar.mc.flash.alpha = ((TFGame.flashPhase / 100) * 4);
};
if (TFGame.numbers.children.length > 0){
_local3 = TFGame.numbers.children[0];
if (_local3.mc.alpha <= 0){
TFGame.numbers.children.shift();
Phase.destroy(_local3);
};
};
if (hudchal == null){
if (TFGame.chals.length > 0){
hudchal = new PEUIObj("hud_chal");
_local4 = (getDefinitionByName(TFGame.chals[0]) as Class);
_local5 = new (_local4);
_local5.x = 10;
_local5.y = 14;
hudchal.mc.strip.addChild(_local5);
hudchal.setPos(0, 25);
Phase.attachUIObj(hudchal);
TFGame.chals.shift();
};
} else {
if (hudchal.mc.currentFrame > 160){
Phase.destroy(hudchal);
hudchal = null;
};
};
}
public function unloadGame(){
bLoaded = false;
Phase.destroy(game);
Phase.destroy(hudrnd);
Phase.destroy(hudup);
Phase.destroy(hudover);
Phase.destroy(hudbar);
Phase.destroy(TFGame.numbers);
tree.unpause(true);
tree.reset();
game = null;
}
public function loadHUDUpgrade(){
var endUpgrade:Function;
var saveButton:Function;
var tforceButton:Function;
var bforceButton:Function;
var sforceButton:Function;
var gcomboButton:Function;
var acomboButton:Function;
var sboostButton:Function;
var loadSite:Function;
var loadSite2:Function;
endUpgrade = function (_arg1:Event){
showHUDRound();
};
saveButton = function (_arg1:Event){
TFStats.saveGame(player, round, hudup.mc.buy);
hudup.mc.buy.bsave.visible = false;
hudup.mc.buy.save_msg.text = "Saved";
};
tforceButton = function (_arg1:Event){
var _local2:uint;
_local2 = uint(hudup.mc.buy.text_tforce.text);
if (player.resource >= _local2){
Phase.playSound("buttonding.mp3", 0.6);
TFStats.resSpent = (TFStats.resSpent + _local2);
player.resource = (player.resource - _local2);
player.boostTowers(TFStats.tBoostAmt);
TFStats.tBoostAmt = (TFStats.tBoostAmt - 0.004);
hudup.mc.buy.text_tforce.text = String((_local2 + 200));
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
bforceButton = function (_arg1:Event){
var _local2:uint;
_local2 = uint(hudup.mc.buy.text_bforce.text);
if (player.resource >= _local2){
Phase.playSound("buttonding.mp3", 0.6);
TFStats.resSpent = (TFStats.resSpent + _local2);
player.resource = (player.resource - _local2);
player.dmgBoost = (player.dmgBoost + 4);
player.dmgMult = (player.dmgMult * 1.2);
hudup.mc.buy.text_bforce.text = String((_local2 + 100));
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
sforceButton = function (_arg1:Event){
var _local2:uint;
_local2 = uint(hudup.mc.buy.text_sforce.text);
if (player.resource >= _local2){
Phase.playSound("buttonding.mp3", 0.6);
TFStats.resSpent = (TFStats.resSpent + _local2);
player.resource = (player.resource - _local2);
player.boostStun();
if (player.stunStr == "090"){
hudup.mc.buy.sforce.visible = false;
hudup.mc.buy.text_sforce.text = "";
} else {
hudup.mc.buy.text_sforce.text = String((_local2 + 500));
};
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
gcomboButton = function (_arg1:Event){
var _local2:uint;
_local2 = uint(hudup.mc.buy.text_gcombo.text);
if (player.resource >= _local2){
Phase.playSound("buttonding.mp3", 0.6);
TFStats.resSpent = (TFStats.resSpent + _local2);
player.resource = (player.resource - _local2);
player.maxCombo++;
if (player.maxCombo == TFChar.SPIN){
hudup.mc.buy.gcombo.visible = false;
hudup.mc.buy.text_gcombo.text = "";
if (player.maxAirCombo == TFChar.HURK){
TFGame.challenge("chal_hillfighter");
};
} else {
hudup.mc.buy.text_gcombo.text = String((_local2 + 500));
};
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
acomboButton = function (_arg1:Event){
var _local2:uint;
_local2 = uint(hudup.mc.buy.text_acombo.text);
if (player.resource >= _local2){
Phase.playSound("buttonding.mp3", 0.6);
TFStats.resSpent = (TFStats.resSpent + _local2);
player.resource = (player.resource - _local2);
player.maxAirCombo++;
if (player.maxAirCombo == TFChar.HURK){
hudup.mc.buy.acombo.visible = false;
hudup.mc.buy.text_acombo.text = "";
if (player.maxCombo == TFChar.SPIN){
TFGame.challenge("chal_hillfighter");
};
} else {
hudup.mc.buy.text_acombo.text = String((_local2 + 500));
};
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
sboostButton = function (_arg1:Event){
var _local2:uint;
_local2 = uint(hudup.mc.buy.text_sboost.text);
if (player.resource >= _local2){
Phase.playSound("buttonding.mp3", 0.6);
TFStats.resSpent = (TFStats.resSpent + _local2);
player.resource = (player.resource - _local2);
player.speed = (player.speed + 2);
player.acc = (player.acc + 0.2);
if (player.speed == 12){
hudup.mc.buy.sboost.visible = false;
hudup.mc.buy.text_sboost.text = "";
} else {
hudup.mc.buy.text_sboost.text = String((_local2 + 500));
};
} else {
Phase.playSound("buttonbuzz.wav", 2);
};
};
loadSite = function (_arg1:Event){
navigateToURL(new URLRequest("http://pgstudios.org"), "_blank");
};
loadSite2 = function (_arg1:Event){
navigateToURL(new URLRequest("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1173&subid=upgrade_scr"), "_blank");
};
hudup = new PEUIObj("menu_upgrade");
hudup.setPos(0, 400);
hudup.mc.visible = false;
Phase.attachUIObj(hudup);
hudup.mc.buy.bfinish.addEventListener(MouseEvent.CLICK, endUpgrade);
hudup.mc.buy.bsave.addEventListener(MouseEvent.CLICK, saveButton);
hudup.mc.buy.tforce.addEventListener(MouseEvent.CLICK, tforceButton);
hudup.mc.buy.bforce.addEventListener(MouseEvent.CLICK, bforceButton);
hudup.mc.buy.sforce.addEventListener(MouseEvent.CLICK, sforceButton);
hudup.mc.buy.gcombo.addEventListener(MouseEvent.CLICK, gcomboButton);
hudup.mc.buy.acombo.addEventListener(MouseEvent.CLICK, acomboButton);
hudup.mc.buy.sboost.addEventListener(MouseEvent.CLICK, sboostButton);
hudup.mc.buy.bpixel.addEventListener(MouseEvent.CLICK, loadSite);
hudup.mc.buy.bbubble.addEventListener(MouseEvent.CLICK, loadSite2);
}
public function loadHUDOver(){
var returnToMenu:Function;
returnToMenu = function (_arg1:Event){
Phase.resumeStealingFocus();
endGame();
};
hudover = new PEUIObj("menu_over");
hudover.setPos(0, 400);
hudover.mc.visible = false;
Phase.attachUIObj(hudover);
hudover.mc.bmenu.addEventListener(MouseEvent.CLICK, returnToMenu);
}
public function showHUDOver(){
pauseGame();
Phase.stopStealingFocus();
menu.mc.visible = false;
state = OVER;
hudover.mc.visible = true;
hudover.mc.text_score.text = TFStats.score;
hudover.mc.text_kills.text = TFStats.kills;
hudover.mc.text_dmgMelee.text = TFStats.dmgMelee;
hudover.mc.text_dmgTower.text = TFStats.dmgTower;
hudover.mc.text_resFound.text = TFStats.resFound;
hudover.mc.text_resSpent.text = TFStats.resSpent;
trace(("hudOver round: " + round.round));
if (TFStats.mode == "easy"){
hudover.mc.bbscore.setScore(TFStats.score, 11730001);
};
if (TFStats.mode == "normal"){
hudover.mc.bbscore.setScore(TFStats.score, 11730002);
};
if (TFStats.mode == "hard"){
hudover.mc.bbscore.setScore(TFStats.score, 11730003);
};
if (round.round == 32){
TFStats.clearGame();
menu.mc.modes.resume.bresume.mouseEnabled = false;
menu.mc.modes.resume.alpha = 0.5;
menu.mc.modes.resume.save_details.text = "No saved games available";
};
}
public function resumeGame(){
game.unpause(true);
player.towers.unpause(true);
tree.unpause(true);
hideMenu();
state = GAME;
hudbar.mc.visible = true;
tips.unhide();
if (round.state == "newround"){
hudrnd.mc.visible = true;
};
if (round.state == "midround"){
hudup.mc.visible = true;
state = MID;
};
}
public function hideMenu(){
menu.mc.visible = false;
}
override public function update(){
super.update();
if (state == GAME){
camTrack();
updateFaeries();
updateHUD();
round.update();
round.updateRemoval();
if (TFTree.life <= 0){
showHUDOver();
};
if ((((((round.nmes.children.length > 0)) && ((round.state == "play")))) && (!(mute)))){
if (overvol < 0.8){
overvol = (overvol + 0.02);
};
};
TFEnemy.lastHit++;
} else {
if (overvol > 0){
overvol = (overvol - 0.02);
};
if (state == MID){
camTrack();
updateFaeries();
updateHUD();
round.updateRemoval();
};
if (state == TUT){
if (tut.mc.currentFrame >= 320){
tut.mc.alpha = (tut.mc.alpha - 0.05);
if (tut.mc.alpha <= 0){
state = GAME;
tut.mc.bskip.removeEventListener(MouseEvent.CLICK, skipTut);
Phase.destroy(tut);
};
};
};
};
if (!mute){
overlay.adjust((PESoundScape.musicvol * overvol), 9999, 9999);
};
}
public function input(){
if (state == GAME){
if (Phase.keyTap(27)){
pauseGame();
};
if (((((((((Phase.keyTap(1)) || (Phase.keyTap(69)))) || (Phase.keyTap(17)))) || (Phase.keyTap(163)))) || (Phase.keyTap(162)))){
clicks++;
};
} else {
if (state == MID){
if (Phase.keyTap(27)){
pauseGame();
};
if (((((((((Phase.keyTap(1)) || (Phase.keyTap(69)))) || (Phase.keyTap(17)))) || (Phase.keyTap(163)))) || (Phase.keyTap(162)))){
clicks++;
};
} else {
if (state == MENU){
if (((Phase.keyTap(27)) && (!((game == null))))){
resumeGame();
};
};
};
};
if (Phase.keyTap(77)){
mute = !(mute);
if (mute){
music.adjust(0, 9999, 9999);
overlay.adjust(0, 9999, 9999);
} else {
music.adjust(PESoundScape.musicvol, 9999, 9999);
overlay.adjust((PESoundScape.musicvol * overvol), 9999, 9999);
};
};
}
public function camTrack(){
var _local1:Vect;
var _local2:Vect;
_local1 = new Vect(player.pos.x, 200);
_local1.add((player.vel.x * 25), 0);
_local2 = _local1.subv(Phase.cpos).mult(0.06);
if (_local2.rawmag() > 1){
Phase.cpos = Phase.cpos.addv(_local2);
if (Phase.cpos.x < 350){
Phase.cpos.x = 350;
};
Phase.cam(Phase.cpos, 1);
};
}
public function enemyDeath(_arg1:TFEnemy){
tree.assignTask(_arg1);
}
public function loadMap(){
Phase.planes[3].blendMode = "screen";
Phase.planes[4].blendMode = "screen";
map = new PEPhysObj("map");
map.setPos(2500, 0);
Phase.autoPhys(map);
Phase.attachObj(2, map);
Phase.index(map, true);
tree = new TFTree();
Phase.index(tree);
Phase.cam(new Vect(400, 200), 1);
}
function showTut(){
tut = new PEUIObj("tut_start");
Phase.attachUIObj(tut);
tut.mc.bskip.addEventListener(MouseEvent.CLICK, skipTut);
}
public function showHUDRound(){
state = GAME;
player.bBlockInput = false;
round.state = "newround";
hudrnd.mc.visible = true;
hudrnd.mc.txt.text = ("Round " + round.round);
hudup.mc.visible = false;
}
public static function showDamage(_arg1:Vect, _arg2:uint){
}
public static function challenge(_arg1:String){
if ((((_arg1 == "chal_easy")) && (!(TFStats.chals[0])))){
TFStats.chals[0] = true;
TFGame.chals.push(_arg1);
TFStats.save();
} else {
if (TFStats.mode != "easy"){
if ((((_arg1 == "chal_hillfighter")) && (!(TFStats.chals[1])))){
TFStats.chals[1] = true;
TFGame.chals.push(_arg1);
TFStats.save();
} else {
if ((((_arg1 == "chal_lastguy")) && (!(TFStats.chals[2])))){
TFStats.chals[2] = true;
TFGame.chals.push(_arg1);
TFStats.save();
} else {
if ((((_arg1 == "chal_spikepunch")) && (!(TFStats.chals[3])))){
TFStats.chals[3] = true;
TFGame.chals.push(_arg1);
TFStats.save();
} else {
if ((((_arg1 == "chal_superb")) && (!(TFStats.chals[4])))){
TFStats.chals[4] = true;
TFGame.chals.push(_arg1);
TFStats.save();
} else {
if ((((_arg1 == "chal_stunner")) && (!(TFStats.chals[5])))){
TFStats.chals[5] = true;
TFGame.chals.push(_arg1);
TFStats.save();
} else {
if ((((_arg1 == "chal_thorny")) && (!(TFStats.chals[6])))){
TFStats.chals[6] = true;
TFGame.chals.push(_arg1);
TFStats.save();
} else {
if ((((_arg1 == "chal_normal")) && (!(TFStats.chals[7])))){
TFStats.chals[7] = true;
TFGame.chals.push(_arg1);
TFStats.save();
} else {
if ((((_arg1 == "chal_anime")) && (!(TFStats.chals[8])))){
TFStats.chals[8] = true;
TFGame.chals.push(_arg1);
TFStats.save();
} else {
if ((((_arg1 == "chal_getoverthere")) && (!(TFStats.chals[9])))){
TFStats.chals[9] = true;
TFGame.chals.push(_arg1);
TFStats.save();
} else {
if ((((_arg1 == "chal_wontsurvive")) && (!(TFStats.chals[10])))){
TFStats.chals[10] = true;
TFGame.chals.push(_arg1);
TFStats.save();
} else {
if ((((_arg1 == "chal_tdsucks")) && (!(TFStats.chals[11])))){
TFStats.chals[11] = true;
TFGame.chals.push(_arg1);
TFStats.save();
} else {
if ((((_arg1 == "chal_smashpansies")) && (!(TFStats.chals[12])))){
TFStats.chals[12] = true;
TFGame.chals.push(_arg1);
TFStats.save();
} else {
if ((((_arg1 == "chal_hard")) && (!(TFStats.chals[13])))){
TFStats.chals[13] = true;
TFGame.chals.push(_arg1);
TFStats.save();
} else {
if ((((_arg1 == "chal_ultimate")) && (!(TFStats.chals[14])))){
TFStats.chals[14] = true;
TFGame.chals.push(_arg1);
TFStats.save();
} else {
if ((((_arg1 == "chal_scoutersays")) && (!(TFStats.chals[15])))){
TFStats.chals[15] = true;
TFGame.chals.push(_arg1);
TFStats.save();
} else {
if ((((_arg1 == "chal_click100")) && (!(TFStats.chals[16])))){
TFStats.chals[16] = true;
TFGame.chals.push(_arg1);
TFStats.save();
} else {
if ((((_arg1 == "chal_click2000")) && (!(TFStats.chals[17])))){
TFStats.chals[17] = true;
TFGame.chals.push(_arg1);
TFStats.save();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
}
public static function warn(){
if (flashPhase == 0){
flashPhase = 20;
};
}
}
}//package
Section 152
//TFHacman (TFHacman)
package {
public class TFHacman extends TFFlyEnemy {
public function TFHacman(_arg1:Number, _arg2:Number){
super("col_circle", Phase.CIRCLE);
setProps(_arg1, ((_arg2 - 30) - ((1 * Math.random()) * 100)), 0.3, 0.3, 0);
setState(true, false, true);
mc.visible = false;
attachImage("hacman_mc");
playAnim("fly");
faceDir("l");
speed = 2;
acc = 0.3;
airControl = 0.5;
bounce = 1;
hoffset = 30;
bGrav = false;
health = (maxhealth = 40);
value = 25;
}
override public function behave(){
if (bAlive){
if (stun == 0){
control("move", "l");
if (pos.y > 150){
vel.y = (vel.y - 0.025);
} else {
if (pos.y < 10){
vel.y = (vel.y + 0.1);
} else {
vel.y = (vel.y * 0.99);
};
};
} else {
stun--;
if (stun == 0){
playAnim("fly");
};
control("stop");
vel.set(0, 0);
};
} else {
control("stop");
};
}
}
}//package
Section 153
//TFHacman2 (TFHacman2)
package {
public class TFHacman2 extends TFFlyEnemy {
public function TFHacman2(_arg1:Number, _arg2:Number){
super("col_circle", Phase.CIRCLE);
setProps(_arg1, ((_arg2 - 30) - ((1 * Math.random()) * 100)), 0.3, 0.3, 0);
setState(true, false, true);
mc.visible = false;
attachImage("hacman2_mc");
playAnim("fly");
faceDir("l");
speed = 4;
acc = 0.25;
airControl = 1;
bounce = 1;
hoffset = 30;
bGrav = false;
health = (maxhealth = 120);
value = 70;
}
override public function behave(){
if (bAlive){
if (stun == 0){
control("move", "l");
if (pos.y > 150){
vel.y = (vel.y - 0.025);
} else {
if (pos.y < 10){
vel.y = (vel.y + 0.1);
} else {
vel.y = (vel.y * 0.99);
};
};
} else {
stun--;
if (stun == 0){
playAnim("fly");
};
control("stop");
vel.set(0, 0);
};
} else {
control("stop");
};
}
}
}//package
Section 154
//TFHacmanBoss (TFHacmanBoss)
package {
public class TFHacmanBoss extends TFFlyEnemy {
public function TFHacmanBoss(_arg1:Number, _arg2:Number){
super("col_circle", Phase.CIRCLE);
setProps(_arg1, ((_arg2 - 30) - ((1 * Math.random()) * 100)), 0.3, 0.3, 0);
setState(true, false, true);
mc.visible = false;
attachImage("hacman_mc");
sca = sca.mult(4);
img[0].scaleX = (img[0].scaleY = 3);
playAnim("fly");
faceDir("l");
stunres = 50;
speed = 1.6;
acc = 0.4;
airControl = 0.8;
bounce = 0.9;
hoffset = 80;
bGrav = false;
health = (maxhealth = 465);
value = 500;
bBoss = true;
}
override public function behave(){
if (bAlive){
if (stun == 0){
control("move", "l");
if (pos.y > 150){
vel.y = (vel.y - 0.025);
} else {
if (pos.y < 10){
vel.y = (vel.y + 0.1);
} else {
vel.y = (vel.y * 0.99);
};
};
} else {
stun--;
if (stun == 0){
playAnim("fly");
};
control("stop");
vel.set(0, 0);
};
} else {
control("stop");
};
}
}
}//package
Section 155
//TFPusher (TFPusher)
package {
public class TFPusher extends TFEnemy {
public function TFPusher(_arg1:Number, _arg2:Number){
super("col_circle", Phase.CIRCLE);
setProps(_arg1, (_arg2 - (0.4 * 100)), 0.4, 0.8, 0);
setState(true, false, true);
mc.visible = false;
attachImage("pusher_mc");
imgOffset.set(0, 40);
playAnim("run");
faceDir("l");
stunres = 20;
speed = 1.3;
acc = 0.25;
airControl = 0.1;
hoffset = 50;
health = (maxhealth = 150);
value = 35;
}
override public function behave(){
if (bAlive){
if (stun == 0){
control("move", "l");
} else {
stun--;
if (stun == 0){
playAnim("run");
};
control("stop");
vel.x = 0;
};
} else {
control("stop");
};
}
}
}//package
Section 156
//TFPusher2 (TFPusher2)
package {
public class TFPusher2 extends TFEnemy {
public function TFPusher2(_arg1:Number, _arg2:Number){
super("col_circle", Phase.CIRCLE);
setProps(_arg1, (_arg2 - (0.4 * 100)), 0.4, 0.8, 0);
setState(true, false, true);
mc.visible = false;
attachImage("pusher2_mc");
sca = sca.mult(1.5);
img[0].scaleX = (img[0].scaleY = 1.5);
imgOffset.set(0, 60);
playAnim("run");
faceDir("l");
stunres = 45;
speed = 1.8;
acc = 0.4;
airControl = 0.1;
hoffset = 65;
health = (maxhealth = 200);
value = 65;
}
override public function behave(){
if (bAlive){
if (stun == 0){
control("move", "l");
} else {
stun--;
if (stun == 0){
playAnim("run");
};
control("stop");
vel.x = 0;
};
} else {
control("stop");
};
}
}
}//package
Section 157
//TFPusherBoss (TFPusherBoss)
package {
public class TFPusherBoss extends TFEnemy {
public function TFPusherBoss(_arg1:Number, _arg2:Number){
super("col_circle", Phase.CIRCLE);
setProps(_arg1, (_arg2 - (1 * 100)), 0.4, 0.8, 0);
setState(true, false, true);
mc.visible = false;
attachImage("pusher_mc");
sca = sca.mult(2.5);
img[0].scaleX = (img[0].scaleY = 2.5);
imgOffset.set(0, 100);
playAnim("run");
faceDir("l");
stunres = 60;
speed = 1;
acc = 1;
airControl = 0.1;
hoffset = 95;
health = (maxhealth = 585);
value = 250;
bBoss = true;
}
override public function behave(){
if (bAlive){
if (stun == 0){
control("move", "l");
} else {
stun--;
if (stun == 0){
playAnim("run");
};
control("stop");
vel.x = 0;
};
} else {
control("stop");
};
}
}
}//package
Section 158
//TFReWheel (TFReWheel)
package {
public class TFReWheel extends TFEnemy {
public var progress:Number;
public var stuck:uint;
public function TFReWheel(_arg1:Number, _arg2:Number){
super("col_circle", Phase.CIRCLE);
setProps(_arg1, (_arg2 - (0.2 * 100)), 0.4, 0.4, 0);
setState(true, false, true);
mc.visible = false;
attachImage("rewheel_mc");
imgOffset.set(0, 20);
playAnim("run");
faceDir("l");
stunres = 10;
speed = 5;
acc = 0.125;
airControl = 0.1;
hoffset = 35;
health = (maxhealth = 80);
value = 40;
}
override public function behave(){
if (bAlive){
if (pos.x > (progress - 100)){
stuck++;
if (stuck > 150){
control("jump");
vel.x = -5;
stuck = 0;
progress = pos.x;
};
} else {
progress = pos.x;
stuck = 0;
};
if (stun == 0){
control("move", "l");
} else {
stun--;
if (stun == 0){
playAnim("run");
};
control("stop");
vel.x = 0;
};
} else {
control("stop");
};
}
}
}//package
Section 159
//TFReWheel2 (TFReWheel2)
package {
public class TFReWheel2 extends TFEnemy {
public var progress:Number;
public var stuck:uint;
public function TFReWheel2(_arg1:Number, _arg2:Number){
super("col_circle", Phase.CIRCLE);
setProps(_arg1, (_arg2 - (0.2 * 100)), 0.55, 0.6, 0);
setState(true, false, true);
mc.visible = false;
attachImage("rewheel2_mc");
sca = sca.mult(1.66);
img[0].scaleX = (img[0].scaleY = 1.66);
imgOffset.set(0, 50);
playAnim("run");
faceDir("l");
stunres = 15;
speed = 6;
acc = 0.225;
airControl = 0.1;
hoffset = 45;
health = (maxhealth = 175);
value = 80;
}
override public function behave(){
if (bAlive){
if (pos.x > (progress - 100)){
stuck++;
if (stuck > 150){
control("jump");
vel.x = -5;
stuck = 0;
progress = pos.x;
};
} else {
progress = pos.x;
stuck = 0;
};
if (stun == 0){
control("move", "l");
} else {
stun--;
if (stun == 0){
playAnim("run");
};
control("stop");
vel.x = 0;
};
} else {
control("stop");
};
}
}
}//package
Section 160
//TFReWheelBoss (TFReWheelBoss)
package {
public class TFReWheelBoss extends TFEnemy {
public var progress:Number;
public var stuck:uint;
public function TFReWheelBoss(_arg1:Number, _arg2:Number){
super("col_circle", Phase.CIRCLE);
setProps(_arg1, (_arg2 - (0.5 * 100)), 0.55, 0.6, 0);
setState(true, false, true);
mc.visible = false;
attachImage("rewheel_mc");
sca = sca.mult(2);
img[0].scaleX = (img[0].scaleY = 2);
imgOffset.set(0, 60);
playAnim("run");
faceDir("l");
stunres = 40;
speed = 6;
acc = 0.3;
airControl = 0.1;
hoffset = 60;
health = (maxhealth = 320);
value = 600;
}
override public function behave(){
if (bAlive){
if (pos.x > (progress - 100)){
stuck++;
if (stuck > 150){
control("jump");
vel.x = -5;
stuck = 0;
progress = pos.x;
};
} else {
progress = pos.x;
stuck = 0;
};
if (stun == 0){
control("move", "l");
} else {
stun--;
if (stun == 0){
playAnim("run");
};
control("stop");
vel.x = 0;
};
} else {
control("stop");
};
}
}
}//package
Section 161
//TFRoundData (TFRoundData)
package {
public class TFRoundData {
public var rate:uint;
public var times:uint;
public var type:String;
public var counter:uint;
public function TFRoundData(_arg1:String, _arg2:uint, _arg3:uint){
type = _arg1;
times = _arg2;
rate = _arg3;
}
}
}//package
Section 162
//TFRounds (TFRounds)
package {
import flash.filters.*;
public class TFRounds extends PEObj {
public var valBoost:Number;
public var state:String;
public var bWaiting:Boolean;
public var round:uint;
public var healthBoost:Number;
public var nmes:PEPhysObj;
public var data:Array;
public var healthMult:Number;
public var beams:Array;
public var valMult:Number;
public static var snmes:PEPhysObj;
public function TFRounds(){
super("");
state = "newround";
round = 1;
healthBoost = 1;
healthMult = 1.2;
valBoost = 1;
valMult = 1.04;
nmes = new PEPhysObj("");
nmes.colType = Phase.ENEMY;
snmes = nmes;
data = new Array();
beams = new Array();
}
public function glow(){
var _local1:*;
var _local2:*;
var _local3:*;
if (!TFGame.nmeGlow){
for (_local1 in nmes.children) {
_local2 = nmes.children[_local1];
_local2.img[0].body.filters = [];
};
} else {
for (_local1 in nmes.children) {
_local3 = new GlowFilter();
_local3.blurX = 16;
_local3.blurY = 16;
_local3.strength = 1;
_local2 = nmes.children[_local1];
if ((_local2 is TFBob)){
_local3.color = 0xFFFF;
} else {
if ((_local2 is TFBob2)){
_local3.color = 16724838;
_local3.strength = 1.6;
} else {
if ((((_local2 is TFPusher)) || ((_local2 is TFPusherBoss)))){
_local3.color = 0xB3FF00;
} else {
if ((_local2 is TFPusher2)){
_local3.color = 3355545;
} else {
if ((((_local2 is TFHacman)) || ((_local2 is TFHacmanBoss)))){
_local3.color = 0xFFCC00;
} else {
if ((_local2 is TFHacman2)){
_local3.color = 0xFFFFFF;
_local3.strength = 1.5;
} else {
if ((((_local2 is TFReWheel)) || ((_local2 is TFReWheelBoss)))){
_local3.color = 0xFF00FF;
} else {
if ((_local2 is TFReWheel2)){
_local3.color = 0xFF9900;
} else {
if ((_local2 is TFTackThompson)){
_local3.color = 0xFF00;
};
};
};
};
};
};
};
};
};
_local2.img[0].body.filters = [_local3];
};
};
}
public function spawnUnit(_arg1:String){
var _local2:*;
_local2 = Phase.rand(0, 3, true);
if (_local2 == 0){
_local2 = 4300;
beams[0].gotoAndPlay("burst");
} else {
if (_local2 == 1){
_local2 = 4370;
beams[1].gotoAndPlay("burst");
} else {
if (_local2 == 2){
_local2 = 4440;
beams[2].gotoAndPlay("burst");
};
};
};
if (_arg1 == "bob"){
return (new TFBob(_local2, 375));
};
if (_arg1 == "bob2"){
return (new TFBob2(_local2, 375));
};
if (_arg1 == "pusher"){
return (new TFPusher(_local2, 375));
};
if (_arg1 == "pusher2"){
return (new TFPusher2(_local2, 375));
};
if (_arg1 == "rewheel"){
return (new TFReWheel(_local2, 375));
};
if (_arg1 == "rewheel2"){
return (new TFReWheel2(_local2, 375));
};
if (_arg1 == "strutter"){
return (new TFStrutter(_local2, 375));
};
if (_arg1 == "strutter2"){
return (new TFStrutter2(_local2, 375));
};
if (_arg1 == "hacman"){
return (new TFHacman(_local2, 375));
};
if (_arg1 == "hacman2"){
return (new TFHacman2(_local2, 375));
};
if (_arg1 == "tack"){
return (new TFTackThompson(_local2, 375));
};
if (_arg1 == "bosspusher"){
return (new TFPusherBoss(_local2, 375));
};
if (_arg1 == "bosshacman"){
return (new TFHacmanBoss(_local2, 375));
};
if (_arg1 == "bossrewheel"){
return (new TFReWheelBoss(_local2, 375));
};
if (_arg1 == "strutterknight"){
healthBoost = (healthBoost * 1.08);
return (new TFStrutterKnight(_local2, 375));
};
if (_arg1 == "tackknight"){
return (new TFTackThompsonKnight(_local2, 375));
};
}
public function allDead(){
var _local1:*;
if (data.length > 0){
return (false);
};
for (_local1 in nmes.children) {
if (nmes.children[_local1].bAlive){
return (false);
};
};
return (true);
}
override public function update(){
var _local1:*;
var _local2:*;
var _local3:TFEnemy;
super.update();
if (!bWaiting){
for (_local1 in data) {
_local2 = data[_local1];
_local2.counter++;
if (_local2.counter == _local2.rate){
_local2.counter = 0;
_local2.times--;
_local3 = spawnUnit(_local2.type);
_local3.adjustDifficulty();
_local3.maxhealth = (_local3.maxhealth * healthBoost);
_local3.health = _local3.maxhealth;
_local3.value = (_local3.value * valBoost);
Phase.attachObj(3, _local3);
Phase.parent(_local3, nmes);
if (!TFGame.nmeGlow){
_local3.img[0].body.filters = [];
};
};
if (_local2.times == 0){
data.splice(_local1, 1);
};
};
};
}
public function startRound(){
state = "play";
if (round == 1){
data.push(new TFRoundData("bob", 12, 80));
} else {
if (round == 2){
data.push(new TFRoundData("bob", 8, 80));
data.push(new TFRoundData("hacman", 4, 140));
} else {
if (round == 3){
data.push(new TFRoundData("bob", 5, 120));
data.push(new TFRoundData("pusher", 5, 160));
} else {
if (round == 4){
data.push(new TFRoundData("bob", 5, 140));
data.push(new TFRoundData("pusher", 5, 120));
data.push(new TFRoundData("hacman", 5, 100));
} else {
if (round == 5){
data.push(new TFRoundData("rewheel", 12, 40));
} else {
if (round == 6){
data.push(new TFRoundData("pusher", 20, 80));
} else {
if (round == 7){
data.push(new TFRoundData("hacman", 30, 40));
} else {
if (round == 8){
data.push(new TFRoundData("bob", 15, 120));
data.push(new TFRoundData("rewheel", 15, 80));
} else {
if (round == 9){
data.push(new TFRoundData("pusher", 15, 120));
data.push(new TFRoundData("rewheel", 10, 40));
data.push(new TFRoundData("hacman", 20, 80));
} else {
if (round == 10){
data.push(new TFRoundData("bosspusher", 1, 100));
} else {
if (round == 11){
data.push(new TFRoundData("pusher", 18, 60));
data.push(new TFRoundData("bob2", 7, 130));
} else {
if (round == 12){
data.push(new TFRoundData("tack", 15, 60));
} else {
if (round == 13){
data.push(new TFRoundData("pusher", 18, 60));
data.push(new TFRoundData("bob2", 7, 130));
} else {
if (round == 14){
data.push(new TFRoundData("bob2", 6, 130));
data.push(new TFRoundData("pusher2", 7, 90));
} else {
if (round == 15){
data.push(new TFRoundData("rewheel", 10, 80));
data.push(new TFRoundData("tack", 15, 60));
} else {
if (round == 16){
data.push(new TFRoundData("strutter", 6, 90));
data.push(new TFRoundData("hacman", 10, 200));
} else {
if (round == 17){
data.push(new TFRoundData("bob", 5, 40));
data.push(new TFRoundData("hacman", 5, 60));
data.push(new TFRoundData("pusher", 5, 80));
data.push(new TFRoundData("rewheel", 5, 100));
data.push(new TFRoundData("bob2", 5, 120));
data.push(new TFRoundData("tack", 5, 140));
data.push(new TFRoundData("pusher2", 5, 160));
} else {
if (round == 18){
data.push(new TFRoundData("rewheel2", 10, 40));
} else {
if (round == 19){
data.push(new TFRoundData("rewheel2", 5, 120));
data.push(new TFRoundData("pusher2", 20, 40));
} else {
if (round == 20){
data.push(new TFRoundData("bosshacman", 1, 100));
} else {
if (round == 21){
data.push(new TFRoundData("tack", 8, 100));
data.push(new TFRoundData("strutter", 8, 100));
} else {
if (round == 22){
data.push(new TFRoundData("rewheel2", 20, 80));
} else {
if (round == 23){
data.push(new TFRoundData("strutter", 20, 60));
} else {
if (round == 24){
data.push(new TFRoundData("hacman2", 8, 100));
data.push(new TFRoundData("pusher2", 12, 90));
} else {
if (round == 25){
data.push(new TFRoundData("hacman2", 12, 60));
} else {
if (round == 26){
data.push(new TFRoundData("strutter", 8, 140));
data.push(new TFRoundData("pusher2", 12, 80));
data.push(new TFRoundData("tack", 8, 120));
} else {
if (round == 27){
data.push(new TFRoundData("strutter2", 5, 160));
} else {
if (round == 28){
data.push(new TFRoundData("pusher2", 10, 160));
data.push(new TFRoundData("pusher", 20, 80));
} else {
if (round == 29){
data.push(new TFRoundData("bob", 1, 200));
} else {
if (round == 30){
data.push(new TFRoundData("bossrewheel", 3, 80));
} else {
if (round == 31){
data.push(new TFRoundData("strutterknight", 99, 350));
data.push(new TFRoundData("tackknight", 99, 425));
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
TFStats.score = (TFStats.score + (round * 100));
healthBoost = (healthBoost * healthMult);
valBoost = (valBoost * valMult);
round++;
}
public function getDead(){
var _local1:Array;
var _local2:*;
_local1 = new Array();
for (_local2 in nmes.children) {
if (((!(nmes.children[_local2].bAlive)) && (!(nmes.children[_local2].bTargeted)))){
_local1.push(nmes.children[_local2]);
};
};
return (_local1.slice());
}
public function updateRemoval(){
var _local1:*;
var _local2:*;
for (_local1 in nmes.children) {
_local2 = nmes.children[_local1];
if (_local2.removeCount > 0){
_local2.removeCount--;
if (_local2.removeCount == 0){
Phase.destroy(_local2);
_local1--;
};
};
};
}
public static function getAll(){
return (snmes);
}
}
}//package
Section 163
//TFStats (TFStats)
package {
import flash.display.*;
import flash.net.*;
public class TFStats {
public static var resFound:uint = 0;
public static var score:uint = 0;
public static var stunned:uint = 0;
public static var kills:uint = 0;
public static var dmgMelee:uint = 0;
public static var launched:uint = 0;
public static var towerBoost:Number = 1;
public static var killsMelee:uint = 0;
public static var mode:String = "";
public static var dmgTower:uint = 0;
public static var resSpent:uint = 0;
public static var airHits:uint = 0;
public static var tBoostAmt:Number = 1.25;
public static var chals:Array = new Array();
public static var killsScore:uint = 0;
public static var bSave:Boolean = false;
public static function save(){
var _local1:SharedObject;
_local1 = SharedObject.getLocal("toweringforever_data", "/", false);
_local1.data.killsMelee = killsMelee;
_local1.data.chals = chals;
_local1.flush();
_local1.close();
}
public static function reset(){
var _local1:*;
score = (kills = (dmgMelee = (dmgTower = (resFound = (resSpent = 0)))));
towerBoost = 1;
_local1 = 0;
while (_local1 < 18) {
chals.push(false);
_local1++;
};
killsScore = 0;
}
public static function saveGame(_arg1:TFChar, _arg2:TFRounds, _arg3:MovieClip){
var _local4:SharedObject;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
_local4 = SharedObject.getLocal("toweringforever_data", "/", false);
_local4.data.mode = mode;
_local4.data.score = score;
_local4.data.kills = kills;
_local4.data.dmgMelee = dmgMelee;
_local4.data.dmgTower = dmgTower;
_local4.data.resFound = resFound;
_local4.data.resSpent = resSpent;
_local4.data.towerBoost = towerBoost;
_local4.data.tBoostAmt = tBoostAmt;
_local4.data.resource = _arg1.resource;
_local4.data.maxCombo = _arg1.maxCombo;
_local4.data.maxAirCombo = _arg1.maxAirCombo;
_local4.data.speed = _arg1.speed;
_local4.data.dmgBoost = _arg1.dmgBoost;
_local4.data.dmgMult = _arg1.dmgMult;
_local4.data.launchStr = _arg1.launchStr;
_local4.data.stunStr = _arg1.stunStr;
_local5 = new Array();
for (_local6 in _arg1.towers.children) {
_local7 = _arg1.towers.children[_local6];
if (_local7.sold){
} else {
_local8 = "";
if ((_local7 is TFVine)){
_local8 = "vine";
};
if ((_local7 is TFBoulder)){
_local8 = "boulder";
};
if ((_local7 is TFStorm)){
_local8 = "storm";
};
if ((_local7 is TFTornado)){
_local8 = "tornado";
};
_local5.push(new Array(_local8, _local7.level, _local7.damage, _local7.speed, _local7.range, _local7.pos.x, _local7.pos.y));
};
};
_local4.data.towers = _local5;
_local4.data.round = _arg2.round;
_local4.data.healthBoost = _arg2.healthBoost;
_local4.data.healthMult = _arg2.healthMult;
_local4.data.valBoost = _arg2.valBoost;
_local4.data.valMult = _arg2.valMult;
_local4.data.tforce = _arg3.text_tforce.text;
_local4.data.bforce = _arg3.text_bforce.text;
_local4.data.sforce = _arg3.text_sforce.text;
_local4.data.gcombo = _arg3.text_gcombo.text;
_local4.data.acombo = _arg3.text_acombo.text;
_local4.data.sboost = _arg3.text_sboost.text;
_local4.data.tlife = TFTree.life;
_local4.data.block = false;
_local4.flush();
_local4.close();
bSave = true;
}
public static function load(){
var _local1:SharedObject;
_local1 = SharedObject.getLocal("toweringforever_data", "/", false);
if (_local1.data.killsMelee == null){
trace("no killsMelee yet");
killsMelee = 0;
} else {
killsMelee = _local1.data.killsMelee;
};
if (_local1.data.chals == null){
trace("no chals yet");
} else {
chals = _local1.data.chals;
};
if ((((_local1.data.round == null)) || ((_local1.data.block == true)))){
trace("no saves yet");
} else {
bSave = true;
};
trace(("load block save: " + _local1.data.block));
_local1.close();
}
public static function clearGame(){
var _local1:SharedObject;
_local1 = SharedObject.getLocal("toweringforever_data", "/", false);
_local1.data.block = true;
trace(("clearGame block save: " + _local1.data.block));
_local1.flush();
_local1.close();
bSave = false;
}
public static function loadGame(_arg1:TFChar, _arg2:TFRounds, _arg3:MovieClip){
var _local4:SharedObject;
var _local5:*;
var _local6:*;
_local4 = SharedObject.getLocal("toweringforever_data", "/", false);
trace(("loadGame block save: " + _local4.data.block));
if (_local4.data.block == true){
_local4.close();
bSave = false;
return;
};
mode = _local4.data.mode;
score = _local4.data.score;
kills = _local4.data.kills;
dmgMelee = _local4.data.dmgMelee;
dmgTower = _local4.data.dmgTower;
resFound = _local4.data.resFound;
resSpent = _local4.data.resSpent;
towerBoost = _local4.data.towerBoost;
tBoostAmt = _local4.data.tBoostAmt;
_arg1.resource = _local4.data.resource;
_arg1.maxCombo = _local4.data.maxCombo;
_arg1.maxAirCombo = _local4.data.maxAirCombo;
_arg1.speed = _local4.data.speed;
_arg1.dmgBoost = _local4.data.dmgBoost;
_arg1.dmgMult = _local4.data.dmgMult;
_arg1.launchStr = _local4.data.launchStr;
_arg1.stunStr = _local4.data.stunStr;
_arg2.round = _local4.data.round;
_arg2.healthBoost = _local4.data.healthBoost;
_arg2.healthMult = _local4.data.healthMult;
_arg2.valBoost = _local4.data.valBoost;
_arg2.valMult = _local4.data.valMult;
_arg3.text_tforce.text = _local4.data.tforce;
_arg3.text_bforce.text = _local4.data.bforce;
_arg3.text_sforce.text = _local4.data.sforce;
_arg3.text_gcombo.text = _local4.data.gcombo;
_arg3.text_acombo.text = _local4.data.acombo;
_arg3.text_sboost.text = _local4.data.sboost;
TFTree.life = _local4.data.tlife;
_local5 = _local4.data.towers;
for (_local6 in _local5) {
_arg1.reloadTower(_local5[_local6]);
};
_local4.close();
}
}
}//package
Section 164
//TFStorm (TFStorm)
package {
public class TFStorm extends TFTower {
public function TFStorm(_arg1:Vect){
super("", Phase.NONE);
setPosv(_arg1);
attachImage("tower_storm");
img[0].blendMode = "screen";
damage = TFTower.dmgStorm;
speed = 40;
range = 300;
Phase.attachObj(2, this);
}
override public function fire(){
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = chooseTarget();
if (_local1 != 99999){
count = speed;
_local2 = new TFStormProj(_local1, damage);
Phase.parent(_local2, this);
Phase.attachObj(5, _local2);
_local3 = Phase.rand(0, 6, true);
if (_local3 == 0){
_local2.mc.gotoAndStop(1);
};
if (_local3 == 1){
_local2.mc.gotoAndStop(2);
};
if (_local3 == 2){
_local2.mc.gotoAndStop(3);
};
if (_local3 == 3){
_local2.mc.gotoAndStop(1);
_local2.mc.scaleX = (_local2.mc.scaleX * -1);
};
if (_local3 == 4){
_local2.mc.gotoAndStop(2);
_local2.mc.scaleX = (_local2.mc.scaleX * -1);
};
if (_local3 == 5){
_local2.mc.gotoAndStop(3);
_local2.mc.scaleX = (_local2.mc.scaleX * -1);
};
} else {
count = 10;
};
}
public function chooseTarget(){
var _local1:Array;
var _local2:PEPhysObj;
var _local3:*;
var _local4:*;
_local1 = new Array();
_local2 = TFRounds.getAll();
for (_local3 in _local2.children) {
_local4 = _local2.children[_local3];
if (_local4.bAlive){
if ((((_local4.pos.x < (pos.x + range))) && ((_local4.pos.x > (pos.x - range))))){
_local1.push(_local4.pos.x);
};
};
};
if (_local1.length == 0){
return (99999);
};
return (_local1[Phase.rand(0, _local1.length, true)]);
}
}
}//package
Section 165
//TFStormProj (TFStormProj)
package {
public class TFStormProj extends PEPhysObj {
var life:uint;
public function TFStormProj(_arg1:Number, _arg2:uint){
super("tower_storm_proj", Phase.VOL);
mc.blendMode = "screen";
colType = Phase.PROJECTILE;
colMask = (colMask ^ Phase.PROJECTILE);
colMask = (colMask ^ Phase.PLAYER);
triggerMask = (triggerMask ^ Phase.PROJECTILE);
triggerMask = (triggerMask ^ Phase.PLAYER);
setPos(_arg1, 0);
tells.push(("shit" + _arg2));
life = 20;
}
override public function update(){
if (life < 10){
mc.alpha = (mc.alpha - 0.1);
};
super.update();
}
}
}//package
Section 166
//TFStrutter (TFStrutter)
package {
public class TFStrutter extends TFEnemy {
public function TFStrutter(_arg1:Number, _arg2:Number){
super("col_circle", Phase.CIRCLE);
setProps(_arg1, (_arg2 - (0.5 * 100)), 0.5, 0.5, 0);
setState(true, false, true);
mc.visible = false;
attachImage("strutter_mc");
imgOffset.set(0, 25);
playAnim("run");
faceDir("l");
stunres = 40;
speed = 2.5;
acc = 0.25;
airControl = 0.1;
jumpStr = -11.5;
hoffset = 45;
health = (maxhealth = 225);
value = 70;
}
override public function behave(){
if (bAlive){
if (stun == 0){
control("move", "l");
if (state == STAND){
if (Phase.rand(0, 100, true) == 66){
playAnim("jump");
control("jump");
};
};
} else {
stun--;
if (stun == 0){
playAnim("run");
};
control("stop");
vel.x = 0;
};
} else {
control("stop");
};
}
}
}//package
Section 167
//TFStrutter2 (TFStrutter2)
package {
public class TFStrutter2 extends TFEnemy {
public function TFStrutter2(_arg1:Number, _arg2:Number){
super("col_circle", Phase.CIRCLE);
setProps(_arg1, (_arg2 - (0.5 * 100)), 0.5, 0.5, 0);
setState(true, false, true);
mc.visible = false;
attachImage("strutter2_mc");
sca = sca.mult(2);
img[0].scaleX = (img[0].scaleY = 2);
imgOffset.set(0, 50);
playAnim("run");
faceDir("l");
stunres = 50;
speed = 1;
acc = 1;
airControl = 1;
jumpStr = -10;
hoffset = 70;
health = (maxhealth = 300);
value = 85;
}
override public function behave(){
if (bAlive){
if (stun == 0){
control("move", "l");
if (state == STAND){
if (Phase.rand(0, 150, true) == 66){
playAnim("jump");
control("jump");
};
};
} else {
stun--;
if (stun == 0){
playAnim("run");
};
control("stop");
vel.x = 0;
};
} else {
control("stop");
};
}
}
}//package
Section 168
//TFStrutterKnight (TFStrutterKnight)
package {
public class TFStrutterKnight extends TFEnemy {
public function TFStrutterKnight(_arg1:Number, _arg2:Number){
super("col_circle", Phase.CIRCLE);
setProps(_arg1, (_arg2 - (0.5 * 100)), 0.5, 0.5, 0);
setState(true, false, true);
mc.visible = false;
attachImage("strutter2_mc");
sca = sca.mult(2);
img[0].scaleX = (img[0].scaleY = 2);
imgOffset.set(0, 50);
playAnim("run");
faceDir("l");
stunres = 45;
speed = 1;
acc = 1;
airControl = 1;
hoffset = 75;
health = (maxhealth = 225);
value = 100;
bScore = true;
}
override public function behave(){
if (bAlive){
if (stun == 0){
control("move", "l");
if (state == STAND){
if (Phase.rand(0, 200, true) == 66){
control("jump");
playAnim("jump");
};
};
} else {
stun--;
if (stun == 0){
playAnim("run");
};
control("stop");
vel.x = 0;
};
} else {
control("stop");
};
}
}
}//package
Section 169
//TFTackThompson (TFTackThompson)
package {
public class TFTackThompson extends TFFlyEnemy {
public function TFTackThompson(_arg1:Number, _arg2:Number){
super("col_circle", Phase.CIRCLE);
setProps(_arg1, ((_arg2 - 45) - ((1 * Math.random()) * 100)), 0.45, 0.45, 0);
setState(true, false, true);
mc.visible = false;
attachImage("tack_mc");
playAnim("fly");
faceDir("l");
speed = 1;
acc = 0.35;
airControl = 1;
bounce = 0.6;
hoffset = 50;
bGrav = false;
health = (maxhealth = 190);
value = 65;
}
override public function behave(){
if (bAlive){
if (stun == 0){
control("move", "l");
if (pos.y > 100){
vel.y = (vel.y - 0.1);
} else {
if (pos.y < 100){
vel.y = (vel.y + 0.1);
} else {
vel.y = (vel.y * 0.99);
};
};
} else {
stun--;
if (stun == 0){
playAnim("fly");
};
control("stop");
vel.set(0, 0);
};
} else {
control("stop");
};
}
}
}//package
Section 170
//TFTackThompsonKnight (TFTackThompsonKnight)
package {
public class TFTackThompsonKnight extends TFFlyEnemy {
public function TFTackThompsonKnight(_arg1:Number, _arg2:Number){
super("col_circle", Phase.CIRCLE);
setProps(_arg1, ((_arg2 - 45) - ((1 * Math.random()) * 100)), 0.45, 0.45, 0);
setState(true, false, true);
mc.visible = false;
attachImage("hacman_mc");
sca = sca.mult(1.5);
img[0].scaleX = (img[0].scaleY = 1.5);
playAnim("fly");
faceDir("l");
stunres = 45;
speed = 0.8;
acc = 0.4;
airControl = 1;
bounce = 0.6;
hoffset = 50;
bGrav = false;
health = (maxhealth = 200);
value = 100;
bScore = true;
}
override public function behave(){
if (bAlive){
if (stun == 0){
control("move", "l");
if (pos.y > 100){
vel.y = (vel.y - 0.1);
} else {
if (pos.y < 100){
vel.y = (vel.y + 0.1);
} else {
vel.y = (vel.y * 0.99);
};
};
} else {
stun--;
if (stun == 0){
playAnim("fly");
};
control("stop");
vel.set(0, 0);
};
} else {
control("stop");
};
}
}
}//package
Section 171
//TFTips (TFTips)
package {
public class TFTips {
public var phase:uint;
public var counter:uint;
public var tip:PEUIObj;
public var bVis:Boolean;
public function TFTips(){
counter = 80;
phase = 0;
tip = new PEUIObj("hud_tips");
tip.mc.txt.text = "Press 'ESC' to Pause";
Phase.attachUIObj(tip);
bVis = true;
tip.mc.mouseEnabled = false;
}
public function hide(){
tip.mc.visible = false;
bVis = false;
}
public function unhide(){
if (phase < 8){
tip.mc.visible = true;
};
bVis = true;
}
public function update(){
if (bVis){
counter++;
if ((((counter < 200)) && ((tip.mc.alpha < 1)))){
tip.mc.alpha = (tip.mc.alpha + 0.025);
};
if ((((counter > 320)) && ((tip.mc.alpha > 0)))){
tip.mc.alpha = (tip.mc.alpha - 0.025);
};
if (counter == 360){
phase++;
counter = 40;
if (phase == 1){
tip.mc.txt.text = "Press 'Arrow Keys' to Move";
};
if (phase == 2){
tip.mc.txt.text = "Press 'Down Arrow' to Build";
};
if (phase == 3){
tip.mc.txt.text = "Press 'Mouse Button' to Attack";
};
if (phase == 4){
tip.mc.txt.text = "Press 'M' to Mute the music";
};
if (phase == 5){
tip.mc.txt.text = "See 'Tutorial' for Advanced Controls";
};
if (phase == 6){
tip.mc.txt.text = "Alt Controls: 'WASD' keys to Move";
};
if (phase == 7){
tip.mc.txt.text = "Alt Controls: 'CTRL' or 'E' to Attack";
};
if (phase == 8){
hide();
};
};
};
}
}
}//package
Section 172
//TFTornado (TFTornado)
package {
public class TFTornado extends TFTower {
public function TFTornado(_arg1:Vect){
var _local2:*;
super("", Phase.NONE);
setPosv(_arg1);
attachImage("tower_tornado");
img[0].blendMode = "screen";
damage = TFTower.dmgTornado;
Phase.attachObj(2, this);
_local2 = new TFTornadoProj();
_local2.tells.push(((("t" + level) + "hit") + damage));
_local2.setPos((pos.x - 180), 0);
Phase.parent(_local2, this);
Phase.attachObj(5, _local2);
}
override public function fire(){
count = 20;
children[0].id = PEIndex.createID();
}
public function levelUp(){
children[0].tells.pop();
children[0].tells.push(((("t" + level) + "hit") + damage));
}
}
}//package
Section 173
//TFTornadoProj (TFTornadoProj)
package {
public class TFTornadoProj extends PEPhysObj {
var life:uint;
public function TFTornadoProj(){
super("col_vol", Phase.VOL);
attachImage("tower_tornado_proj");
img[0].blendMode = "screen";
imgOffset.set(-10, 0);
mc.visible = false;
sca.set(3.8, 4);
colType = Phase.PROJECTILE;
colMask = (colMask ^ Phase.PROJECTILE);
colMask = (colMask ^ Phase.PLAYER);
triggerMask = (triggerMask ^ Phase.PROJECTILE);
triggerMask = (triggerMask ^ Phase.PLAYER);
}
override public function update(){
super.update();
life = 9999;
}
}
}//package
Section 174
//TFTower (TFTower)
package {
public class TFTower extends PEPhysObj {
public var sold:Boolean;
public var count:uint;
public var speed:uint;
public var range:uint;
public var damage:uint;
public var level:uint;
public static var costBoulder:uint = 250;
public static var dmgTornado:uint = 5;
public static var dmgVine:uint = 15;
public static var costTornado:uint = 600;
public static var dmgStorm:uint = 30;
public static var dmgBoulder:uint = 15;
public static var costVine:uint = 150;
public static var costStorm:uint = 300;
public function TFTower(_arg1, _arg2:uint){
super(_arg1, _arg2);
colType = Phase.PROJECTILE;
colMask = (colMask ^ Phase.PROJECTILE);
colMask = (colMask ^ Phase.PLAYER);
triggerMask = (triggerMask ^ Phase.PROJECTILE);
triggerMask = (triggerMask ^ Phase.PLAYER);
level = 1;
damage = 0;
range = 0;
speed = 40;
count = 0;
sold = false;
}
public function fire(){
}
public function sell(){
sold = true;
while (children.length > 0) {
Phase.destroy(children[0]);
};
}
override public function update(){
var _local1:*;
var _local2:*;
if (((paused) || (sold))){
return;
};
if (count > 0){
count--;
};
if (count == 0){
fire();
};
for (_local1 in children) {
_local2 = children[_local1];
if ((_local2 is TFVineProj)){
if (TFVineProj(_local2).snags >= 8){
TFGame.challenge("chal_thorny");
};
};
_local2.life--;
if (_local2.life == 0){
Phase.destroy(_local2);
_local1--;
};
};
super.update();
}
}
}//package
Section 175
//TFTree (TFTree)
package {
public class TFTree extends PEObj {
public var fae:Array;
public static var life:uint;
public function TFTree(){
var _local1:*;
var _local2:*;
super("");
TFTree.life = 20;
fae = new Array();
_local1 = 0;
while (_local1 < 25) {
_local2 = new TFFaery();
children.push(_local2);
fae.push(_local2);
Phase.attachObj(2, _local2);
_local1++;
};
}
public function assignTask(_arg1:TFEnemy){
var _local2:*;
var _local3:*;
for (_local2 in fae) {
_local3 = fae[_local2];
if (_local3.state == "idle"){
_local3.target = _arg1;
_local3.state = "seek";
_local3.res = (_local3.res + _arg1.value);
_arg1.bTargeted = true;
return;
};
};
}
public function reset(){
var _local1:*;
var _local2:*;
TFTree.life = 20;
for (_local1 in fae) {
_local2 = fae[_local1];
_local2.res = 0;
};
}
public static function hurt(){
life--;
}
}
}//package
Section 176
//TFUpgradeIcon (TFUpgradeIcon)
package {
import flash.display.*;
public class TFUpgradeIcon extends MovieClip {
public var lv2:SimpleButton;
public var lv3:SimpleButton;
public var lv4:SimpleButton;
}
}//package
Section 177
//TFVine (TFVine)
package {
public class TFVine extends TFTower {
public function TFVine(_arg1:Vect){
super("", Phase.NONE);
setPosv(_arg1);
attachImage("tower_vine");
img[0].blendMode = "screen";
damage = TFTower.dmgVine;
speed = 50;
range = 360;
Phase.attachObj(2, this);
}
override public function fire(){
var _local1:*;
var _local2:*;
_local1 = chooseTarget(99999);
if (_local1 != 99999){
count = speed;
_local2 = new TFVineProj((_local1 - 15), damage);
Phase.parent(_local2, this);
Phase.attachObj(5, _local2);
if (level > 1){
_local1 = chooseTarget(_local1);
if (_local1 != 99999){
count = speed;
_local2 = new TFVineProj((_local1 - 15), damage);
Phase.parent(_local2, this);
Phase.attachObj(5, _local2);
};
};
} else {
count = 10;
};
}
public function chooseTarget(_arg1:Number){
var _local2:Number;
var _local3:PEPhysObj;
var _local4:*;
var _local5:*;
_local2 = 99999;
_local3 = TFRounds.getAll();
for (_local4 in _local3.children) {
_local5 = _local3.children[_local4];
if (_local5.bAlive){
if (_local5.pos.x != _arg1){
if ((((_local5.pos.x < (pos.x + range))) && ((_local5.pos.x > (pos.x - range))))){
if (_local5.pos.x < _local2){
_local2 = _local5.pos.x;
};
};
};
};
};
return (_local2);
}
}
}//package
Section 178
//TFVineProj (TFVineProj)
package {
public class TFVineProj extends PEPhysObj {
var snags:uint;// = 0
var life:uint;
public function TFVineProj(_arg1:Number, _arg2:uint){
snags = 0;
super("tower_vine_proj", Phase.VOL);
mc.blendMode = "screen";
colType = Phase.PROJECTILE;
colMask = (colMask ^ Phase.PROJECTILE);
colMask = (colMask ^ Phase.PLAYER);
triggerMask = (triggerMask ^ Phase.PROJECTILE);
triggerMask = (triggerMask ^ Phase.PLAYER);
setPos(_arg1, 400);
setScale(0.2, 1);
tells.push(("vhit" + _arg2));
life = 30;
}
override public function update(){
if (life > 10){
sca.x = (sca.x + 0.04);
} else {
mc.alpha = (mc.alpha - 0.1);
};
if (pos.y > 0){
pos.y = (pos.y - 25);
};
super.update();
}
}
}//package
Section 179
//tower_boulder (tower_boulder)
package {
import flash.display.*;
public dynamic class tower_boulder extends MovieClip {
}
}//package
Section 180
//tower_boulder_proj (tower_boulder_proj)
package {
import flash.display.*;
public dynamic class tower_boulder_proj extends MovieClip {
}
}//package
Section 181
//tower_placer (tower_placer)
package {
import flash.display.*;
public dynamic class tower_placer extends MovieClip {
}
}//package
Section 182
//tower_storm (tower_storm)
package {
import flash.display.*;
public dynamic class tower_storm extends MovieClip {
}
}//package
Section 183
//tower_storm_proj (tower_storm_proj)
package {
import flash.display.*;
public dynamic class tower_storm_proj extends MovieClip {
public function tower_storm_proj(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 184
//tower_tornado (tower_tornado)
package {
import flash.display.*;
public dynamic class tower_tornado extends MovieClip {
}
}//package
Section 185
//tower_tornado_proj (tower_tornado_proj)
package {
import flash.display.*;
public dynamic class tower_tornado_proj extends MovieClip {
public function tower_tornado_proj(){
addFrameScript(15, frame16);
}
function frame16(){
gotoAndStop(1);
}
}
}//package
Section 186
//tower_vine (tower_vine)
package {
import flash.display.*;
public dynamic class tower_vine extends MovieClip {
}
}//package
Section 187
//tower_vine_proj (tower_vine_proj)
package {
import flash.display.*;
public dynamic class tower_vine_proj extends MovieClip {
}
}//package
Section 188
//tut_start (tut_start)
package {
import flash.display.*;
public dynamic class tut_start extends MovieClip {
public var bskip:SimpleButton;
}
}//package
Section 189
//Vect (Vect)
package {
public class Vect {
public var y:Number;
public var x:Number;
public function Vect(_arg1:Number=0, _arg2:Number=0){
this.x = _arg1;
this.y = _arg2;
}
public function sub(_arg1:Number, _arg2:Number){
this.x = (this.x - _arg1);
this.y = (this.y - _arg2);
}
public function addv(_arg1:Vect){
return (new Vect((_arg1.x + x), (_arg1.y + y)));
}
public function multv(_arg1:Vect){
return (new Vect((x * _arg1.x), (y * _arg1.y)));
}
public function output(){
trace((((("Vect(" + x) + ", ") + y) + ")"));
}
public function dot(_arg1:Vect){
return (((x * _arg1.x) + (y * _arg1.y)));
}
public function copy(){
return (new Vect(x, y));
}
public function mag(){
return (Math.sqrt(((x * x) + (y * y))));
}
public function setv(_arg1:Vect){
this.x = _arg1.x;
this.y = _arg1.y;
}
public function rotate(_arg1:Number){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
if (_arg1 == 0){
return;
};
_local2 = norm();
_local3 = Math.cos(((_arg1 * Math.PI) / 180));
_local4 = Math.sin(((_arg1 * Math.PI) / 180));
_local5 = new Vect(((_local2.x * _local3) - (_local2.y * _local4)), ((_local2.x * _local4) + (_local2.y * _local3)));
_local6 = mag();
x = (_local5.x * _local6);
y = (_local5.y * _local6);
}
public function add(_arg1:Number, _arg2:Number){
this.x = (this.x + _arg1);
this.y = (this.y + _arg2);
}
public function set(_arg1:Number, _arg2:Number){
this.x = _arg1;
this.y = _arg2;
}
public function zero(){
x = (y = 0);
}
public function rawmag(){
return (((x * x) + (y * y)));
}
public function toString(){
return ((((("Vect(" + (Math.round((x * 100)) / 100)) + ", ") + (Math.round((y * 100)) / 100)) + ")"));
}
public function abs(){
if (this.x < 0){
this.x = (this.x * -1);
};
if (this.y < 0){
this.y = (this.y * -1);
};
}
public function distance(_arg1:Vect){
return (this.subv(_arg1).mag());
}
public function subv(_arg1:Vect){
return (new Vect((x - _arg1.x), (y - _arg1.y)));
}
public function mult(_arg1:Number){
return (new Vect((x * _arg1), (y * _arg1)));
}
public function norm(){
var _local1:*;
_local1 = mag();
if ((((_local1 == 0)) || ((_local1 == undefined)))){
return (new Vect(0, 0));
};
return (new Vect((x / _local1), (y / _local1)));
}
public static function toRad(_arg1:Number){
return (((_arg1 * Math.PI) / 180));
}
public static function toDeg(_arg1:Number){
return (((_arg1 * 180) / Math.PI));
}
}
}//package